From 93bf3196991cf8520c802243440197995b50fc5f Mon Sep 17 00:00:00 2001 From: Roberto Wagner Date: Fri, 19 Jul 2024 16:07:21 -0300 Subject: [PATCH] Comparador de corridas --- assets/{Analysis.0f84ef1d.js => Analysis.db10ad10.js} | 2 +- ...ice.e7d85534.js => ArcGISCachedService.a530cd26.js} | 2 +- ....af78936a.js => BaseDynamicLayerView2D.be251f41.js} | 2 +- ...er.6b1c597d.js => BaseGraphicContainer.7704bbc1.js} | 2 +- ...Processor.fe0bade4.js => BaseProcessor.f4010bc0.js} | 2 +- ...nderer.5cd35765.js => BaseTileRenderer.f04a8f8b.js} | 2 +- ...MapsLayer.cc96b552.js => BingMapsLayer.057bb977.js} | 2 +- assets/{Bitmap.43defcb1.js => Bitmap.72a3702e.js} | 2 +- ...ntainer.3274be0c.js => BitmapContainer.9e943f6d.js} | 2 +- ...ner.3a622161.js => BitmapTileContainer.f5b20598.js} | 2 +- .../{BufferPool.ff53b3f4.js => BufferPool.98277e4b.js} | 2 +- .../{BufferView.89055914.js => BufferView.6eee27cd.js} | 2 +- ...ayer.0da55a35.js => BuildingSceneLayer.73877459.js} | 2 +- assets/{CSVLayer.ec8919b4.js => CSVLayer.f7ffeeb7.js} | 2 +- ...eWorker.08ba4b81.js => CSVSourceWorker.20514f1e.js} | 2 +- ...ularArray.a4d7e1c2.js => CircularArray.62f75f43.js} | 2 +- ...1cb22b3.js => ComputedAttributeStorage.29767acd.js} | 2 +- assets/DefaultMaterial.glsl.037cb4cc.js | 1 - assets/DefaultMaterial.glsl.13f68fae.js | 1 + ...13a8.js => DefaultMaterial_COLOR_GAMMA.8ee780a2.js} | 2 +- ...ionLayer.dcd3110d.js => DimensionLayer.5b17861f.js} | 2 +- ...er.2beeabb2.js => EdgeProcessingWorker.f1d5e58e.js} | 2 +- ...ionLayer.7d5a34eb.js => ElevationLayer.0f63abe9.js} | 2 +- ...ionQuery.5a32e4bc.js => ElevationQuery.dec612cd.js} | 2 +- ....4ebae562.js => ElevationSamplerWorker.28a172f3.js} | 2 +- ...ExpandedCIM.f0b7f36d.js => ExpandedCIM.a372ce74.js} | 2 +- ...s.0ebe2d44.js => ExportImageParameters.65ee285f.js} | 2 +- ...Strategy.e65233e4.js => ExportStrategy.fb59ab52.js} | 2 +- ...c1ac1a0.js => ExportWMSImageParameters.013012f9.js} | 2 +- ...tainer.4ca52b51.js => FeatureContainer.b427dd87.js} | 2 +- ...ureFilter.d7d1bf79.js => FeatureFilter.c87783c2.js} | 2 +- ...urce.99e97c87.js => FeatureLayerSource.98dc2955.js} | 2 +- ...ew2D.c0de0a56.js => FeatureLayerView2D.7c1a650d.js} | 2 +- ... => FeatureServiceSnappingSourceWorker.1a7b44d8.js} | 2 +- ...atureStore.27890cc9.js => FeatureStore.99d80f36.js} | 2 +- ...eStore2D.eebd57c6.js => FeatureStore2D.3fea35f0.js} | 2 +- ...fa59.js => FetchAssociatedFeatureLayer.f6cbad39.js} | 2 +- ...oJSONLayer.979b524a.js => GeoJSONLayer.980a83f3.js} | 2 +- ...ker.2e44a17b.js => GeoJSONSourceWorker.5dfffbc8.js} | 2 +- ...GeoRSSLayer.cfaccd23.js => GeoRSSLayer.705a427d.js} | 2 +- ...iew2D.e15a9a7b.js => GeoRSSLayerView2D.f2cd7f86.js} | 2 +- ...tainer.618d10e5.js => GraphicContainer.b0be80ad.js} | 2 +- ...w2D.3b31f4c0.js => GraphicsLayerView2D.a23860d1.js} | 2 +- ...ontainer.b2a77ceb.js => GroupContainer.f412d859.js} | 2 +- .../{GroupLayer.04359856.js => GroupLayer.d2d54b11.js} | 2 +- ...View2D.4f483153.js => GroupLayerView2D.f66e97aa.js} | 2 +- ...cessor.5f3f2029.js => HeatmapProcessor.ceb8669d.js} | 2 +- ...rer.3cbc266c.js => HeatmapTileRenderer.f9ecd2b7.js} | 2 +- ...c65ba9.js => HighlightGraphicContainer.a4fdc946.js} | 2 +- ...yReader.9c0bbe1b.js => I3SBinaryReader.2f855706.js} | 2 +- ...ons.96f4da60.js => I3SLayerDefinitions.0127897b.js} | 2 +- ...Manager.9f244ffe.js => IdentityManager.0784430d.js} | 2 +- ...ageryLayer.f621acf5.js => ImageryLayer.e44f33f4.js} | 2 +- ...ew2D.52654f54.js => ImageryLayerView2D.f0826692.js} | 2 +- ...eLayer.f9fb83b4.js => ImageryTileLayer.e6833128.js} | 2 +- ....687f9a67.js => ImageryTileLayerView2D.14079c8d.js} | 2 +- ...yer.3a48c634.js => IntegratedMeshLayer.23dae716.js} | 2 +- ...ayout.f9d79992.js => InterleavedLayout.30cdc193.js} | 2 +- assets/{KMLLayer.c732c888.js => KMLLayer.5fd7c195.js} | 2 +- ...erView2D.bb939d29.js => KMLLayerView2D.5351cad6.js} | 2 +- .../{LayerView.42d17220.js => LayerView.ce6e0535.js} | 2 +- .../{LercWorker.7426541e.js => LercWorker.089f2d60.js} | 2 +- ...tLayer.a4d98e23.js => LineOfSightLayer.d828be17.js} | 2 +- ...mageLayer.817bf3c0.js => MapImageLayer.09c43a61.js} | 2 +- ...w2D.af3159c8.js => MapImageLayerView2D.de2fd653.js} | 2 +- ...otesLayer.0d53edee.js => MapNotesLayer.52447f2c.js} | 2 +- ...w2D.8d6b9dc0.js => MapNotesLayerView2D.c9456f55.js} | 2 +- assets/{Matcher.fe0c3dcf.js => Matcher.6586928a.js} | 2 +- ...MaterialKey.229b1dd6.js => MaterialKey.0cadabc1.js} | 2 +- ...View2D.09f1bca2.js => MediaLayerView2D.44f0fc2d.js} | 2 +- ...rker.0c33bcc2.js => MemorySourceWorker.8d1364ce.js} | 2 +- ...reLayer.a08e7e0a.js => OGCFeatureLayer.c9b31254.js} | 2 +- assets/OGCFeatureLayerView2D.5ee46b9c.js | 1 + assets/OGCFeatureLayerView2D.f2b5dde2.js | 1 - ...ayer.0dc3f11e.js => OpenStreetMapLayer.959d4b15.js} | 2 +- ...er.928bb67a.js => OrientedImageryLayer.adb44f0f.js} | 2 +- ...Worker.4eacb33a.js => PBFDecoderWorker.47cbd979.js} | 2 +- assets/{Pipeline.4cffa97b.js => Pipeline.e5f0f177.js} | 2 +- ...udLayer.9b3b72ab.js => PointCloudLayer.454ff7a9.js} | 2 +- ...13.js => PointCloudUniqueValueRenderer.32cfad84.js} | 2 +- ...Worker.b6328283.js => PointCloudWorker.ac192dad.js} | 2 +- ...PooledRBush.04520070.js => PooledRBush.e6a31ee9.js} | 2 +- ...emplate.e9a5aa54.js => ProgramTemplate.cf9dd4e8.js} | 2 +- ...QueryEngine.5a5ece4a.js => QueryEngine.ac81c46d.js} | 2 +- ...esult.7611d68a.js => QueryEngineResult.2fc58178.js} | 2 +- ...olizer.4ee6ff2c.js => RasterSymbolizer.093b1748.js} | 2 +- ...t.3d75d94d.js => RasterVFDisplayObject.da692284.js} | 2 +- ...sterWorker.612f6623.js => RasterWorker.bd4ba3a5.js} | 2 +- ...lockCache.73929591.js => RawBlockCache.e5f26f22.js} | 2 +- assets/RealisticTree.glsl.6abe3a4c.js | 1 + assets/RealisticTree.glsl.8875d152.js | 1 - ...ew.28a00159.js => RefreshableLayerView.887ed8c3.js} | 2 +- ...ontext.6e624525.js => RenderingContext.8853f4cd.js} | 2 +- .../{RouteLayer.ab63e037.js => RouteLayer.bee5d382.js} | 2 +- ...View2D.4c625030.js => RouteLayerView2D.3761d027.js} | 2 +- assets/SSAO.glsl.1592f040.js | 1 + assets/SSAO.glsl.e631cc39.js | 1 - assets/SSAOBlur.glsl.1501066c.js | 1 - assets/SSAOBlur.glsl.7f71e6b4.js | 1 + .../{SceneLayer.46cfbdf5.js => SceneLayer.4e29d3af.js} | 2 +- ...8.js => SceneLayerSnappingSourceWorker.b99c81d4.js} | 2 +- ...Worker.5a8acc10.js => SceneLayerWorker.b2729abd.js} | 2 +- ...eneService.0f3bf01a.js => SceneService.9c2e5b40.js} | 2 +- ...ialFilter.dc70612a.js => SpatialFilter.fd0a95ff.js} | 2 +- assets/{Stop.a3532add.js => Stop.6862dd5a.js} | 2 +- ...StreamLayer.aded61fe.js => StreamLayer.ee7e4471.js} | 2 +- ...iew2D.999b4965.js => StreamLayerView2D.29625b01.js} | 2 +- ...ository.a1fecb1f.js => StyleRepository.e426e44d.js} | 2 +- ...ersOwner.8a52d000.js => SublayersOwner.fd9e3967.js} | 2 +- ...Layer.8fd2feb6.js => SubtypeGroupLayer.76081822.js} | 2 +- ...e026c935.js => SubtypeGroupLayerView2D.e28062ee.js} | 2 +- ...ocessor.179a3ae5.js => SymbolProcessor.1465a4e3.js} | 2 +- ...erer.a57bd090.js => SymbolTileRenderer.5a8a4597.js} | 2 +- assets/{Texture.4c97bad5.js => Texture.940076b2.js} | 2 +- ...TileClipper.8c399a8a.js => TileClipper.77103a2e.js} | 2 +- ...Container.8b7fafe2.js => TileContainer.5aeb32d6.js} | 2 +- .../{TileLayer.42bba12d.js => TileLayer.d3072542.js} | 2 +- ...rView2D.98b348c2.js => TileLayerView2D.18abd98d.js} | 2 +- ...lemapCache.11964483.js => TilemapCache.b64a2ea8.js} | 2 +- ...knownLayer.08ed3ee7.js => UnknownLayer.5555c7bd.js} | 2 +- ...dLayer.518b4e2c.js => UnsupportedLayer.5a5fca4b.js} | 2 +- assets/{Util.ea9235b8.js => Util.f17667f9.js} | 2 +- assets/{Utils.7f6f3a6b.js => Utils.2136650a.js} | 2 +- ...leLayer.f3cc18bb.js => VectorTileLayer.1b238b34.js} | 2 +- ...D.fd81c1b1.js => VectorTileLayerView2D.d09abb15.js} | 2 +- assets/{Version.59f2da65.js => Version.433fbe58.js} | 2 +- ...bject.a4c1d809.js => VertexArrayObject.53cf1857.js} | 2 +- .../{VoxelLayer.50438218.js => VoxelLayer.733738ec.js} | 2 +- assets/{WFSLayer.9b7e311f.js => WFSLayer.431b960b.js} | 2 +- ...eWorker.bb34a8ad.js => WFSSourceWorker.b32c1de1.js} | 2 +- ...LContainer.1850619d.js => WGLContainer.347cc5cd.js} | 2 +- assets/{WMSLayer.b219bb80.js => WMSLayer.5b9ad09d.js} | 2 +- ...erView2D.1b7f0c8d.js => WMSLayerView2D.ed538bb1.js} | 2 +- .../{WMTSLayer.2d04341c.js => WMTSLayer.902b88c8.js} | 2 +- ...rView2D.430450ca.js => WMTSLayerView2D.c5c29679.js} | 2 +- ...bTileLayer.ab421225.js => WebTileLayer.b038b70d.js} | 2 +- ...WhereClause.253310fe.js => WhereClause.5b749615.js} | 2 +- ...ndler.8091b1a1.js => WorkerTileHandler.de9f3c4a.js} | 2 +- assets/{action.a0f1f825.js => action.033e9799.js} | 2 +- ...time.9a6ca0c0.js => arcadeAsyncRuntime.f9b6facc.js} | 2 +- ...arcadeUtils.9e078218.js => arcadeUtils.09abf965.js} | 6 +++--- ...cgisLayers.c7a7062a.js => arcgisLayers.296603be.js} | 2 +- ...e-action.6526d132.js => calcite-action.101f7577.js} | 2 +- ...-item.4a278560.js => calcite-flow-item.62da4be8.js} | 2 +- ...lcite-flow.ddd9f745.js => calcite-flow.45a3e267.js} | 2 +- ...lcite-icon.8f7a3cfc.js => calcite-icon.8b0ddff6.js} | 2 +- ...-item.bd111fd1.js => calcite-list-item.c5e3f8cb.js} | 2 +- ...lcite-list.8f1cbf55.js => calcite-list.73c0b6c3.js} | 2 +- ...e-notice.49afa2e1.js => calcite-notice.41dd0b76.js} | 2 +- ...ite-scrim.7f1cb3c0.js => calcite-scrim.b8319447.js} | 2 +- ...tooltip.583e6f48.js => calcite-tooltip.8ddd4c89.js} | 2 +- assets/{centroid.cc817cc5.js => centroid.06db4b74.js} | 2 +- ...ults.f5f7bfa0.js => clientSideDefaults.d40b9315.js} | 2 +- ...nalSlot.39f4bfa2.js => conditionalSlot.32d69949.js} | 2 +- ...ection.60903ce1.js => createConnection.0e3796d4.js} | 2 +- ...hema.e54d2060.js => createSymbolSchema.827eb617.js} | 2 +- .../{dataUtils.0f9b810f.js => dataUtils.e7623e56.js} | 2 +- ...deduplicate.17ab7923.js => deduplicate.ef93b18a.js} | 2 +- ...drapedUtils.e64c9295.js => drapedUtils.0866c85c.js} | 2 +- ...ocessing.b309b825.js => edgeProcessing.a9e4d72e.js} | 2 +- ...gSupport.b066c126.js => editingSupport.7278fc9c.js} | 2 +- ...uteForIds.bade5c1b.js => executeForIds.9f78e2a6.js} | 2 +- ...Utils.37a0188b.js => featureLayerUtils.878164f5.js} | 2 +- ...etUtils.f1157478.js => featureSetUtils.e062de4c.js} | 2 +- ...esetbase.df0355d2.js => featuresetbase.dc4264cd.js} | 2 +- ...esetgeom.d91e9a0c.js => featuresetgeom.d2fdc1e5.js} | 2 +- ...etstats.d56be13b.js => featuresetstats.a24876b2.js} | 2 +- ...string.4242b3c8.js => featuresetstring.0a520808.js} | 2 +- ...terInfo.d4fdc8d4.js => fetchRasterInfo.3f6af61b.js} | 2 +- ...tchService.36bd4782.js => fetchService.88193309.js} | 2 +- .../{floatRGBA.df11258c.js => floatRGBA.3f71f8e9.js} | 2 +- ...s.ebdde5b7.js => generateRendererUtils.5c972fdb.js} | 2 +- assets/{geojson.8a0cb9d1.js => geojson.7d18026b.js} | 2 +- .../{geomasync.a1913b84.js => geomasync.ca31aba0.js} | 2 +- ...ryEngine.cfc395ce.js => geometryEngine.a80c0474.js} | 2 +- ...ync.3b47a469.js => geometryEngineAsync.68619ff9.js} | 2 +- ...ls.88d2a7a3.js => geometryServiceUtils.89c8be1f.js} | 2 +- ...oreference.c844666d.js => georeference.1d7480c1.js} | 2 +- .../{gltfexport.b4e546f6.js => gltfexport.4b9e2f8e.js} | 2 +- assets/{hydrated.905f3857.js => hydrated.406495cb.js} | 2 +- assets/{icon.8e346cc3.js => icon.781cca93.js} | 2 +- .../{imageUtils.b93c1581.js => imageUtils.215a62b1.js} | 2 +- .../{imageutils.9dde1c66.js => imageutils.5e4d6270.js} | 2 +- assets/{index.d94abe07.js => index.221827cd.js} | 10 +++++----- ...jsonContext.3176ed6f.js => jsonContext.fe51f9bd.js} | 2 +- assets/{kmlUtils.abf45fa2.js => kmlUtils.3e458b80.js} | 2 +- ...tUtils.24133ce3.js => labelFormatUtils.1d67a85b.js} | 2 +- ...rsCreator.eb921b3a.js => layersCreator.67b651fa.js} | 2 +- ...yersLoader.67118e89.js => layersLoader.afdddce2.js} | 2 +- assets/lazyLayerLoader.4d2df2af.js | 1 + assets/lazyLayerLoader.f961f278.js | 1 - ...adGLTFMesh.fce23b90.js => loadGLTFMesh.4a319eb1.js} | 2 +- assets/{loader.3df23557.js => loader.d1e283c7.js} | 2 +- ...mapViewDeps.ae59dec6.js => mapViewDeps.692d211f.js} | 2 +- ...atureSet.81c1d5a6.js => meshFeatureSet.eec93388.js} | 2 +- ...s.4f713da1.js => multidimensionalUtils.59c05ac5.js} | 2 +- ...9814374.js => nonChromiumPlatformUtils.a164ac17.js} | 2 +- ...Sync.757b5fd1.js => normalizeUtilsSync.4d52fbd0.js} | 2 +- assets/{number.8c2c26f3.js => number.9e690eda.js} | 2 +- ...ils.996108d7.js => objectResourceUtils.dfe6cb73.js} | 10 +++++----- .../{observers.11f150c2.js => observers.440ad120.js} | 2 +- ...reUtils.ed8217a8.js => ogcFeatureUtils.61a937b0.js} | 2 +- ...persistable.5f665309.js => persistable.6b292e5e.js} | 2 +- .../{pixelUtils.82950e1a.js => pixelUtils.9c6f8dae.js} | 2 +- assets/{plane.86573aee.js => plane.444b53ce.js} | 2 +- .../{popupUtils.4abb3ffd.js => popupUtils.c6371f3a.js} | 2 +- ...emUtils.57ded807.js => portalItemUtils.92eef7f6.js} | 2 +- ...rtalLayers.8fee158d.js => portalLayers.72750f56.js} | 2 +- ...ogramUtils.956e69db.js => programUtils.10ecfb8b.js} | 2 +- ...pport.0542c13b.js => projectionSupport.4f5da4af.js} | 2 +- ...Utils.0d428d19.js => quantizationUtils.7ff797cc.js} | 2 +- assets/{quat.b3994f2f.js => quat.d9562009.js} | 2 +- ....0a540f3d.js => rasterProjectionHelper.f3c10be2.js} | 2 +- ...gUtils.4baad29a.js => rasterizingUtils.ec7fabe7.js} | 2 +- assets/{request.493a15ad.js => request.aa5275d6.js} | 2 +- ...Utils.7b09b5e8.js => requestImageUtils.1f5d4b6d.js} | 2 +- ...urceUtils.6d10bf82.js => resourceUtils.f4b6e42a.js} | 2 +- .../{scaleUtils.467c71f9.js => scaleUtils.de5ad5a6.js} | 2 +- ...schemaUtils.69ad92d2.js => schemaUtils.d20994fa.js} | 2 +- ...lidator.49ec0b34.js => schemaValidator.90689324.js} | 2 +- assets/{scrim.5d8801d4.js => scrim.51d512d2.js} | 2 +- ...sourceUtils.61cd5549.js => sourceUtils.ed369a2c.js} | 2 +- assets/{sphere.ec1f4496.js => sphere.f99ddb50.js} | 2 +- ...statsWorker.46eac3dc.js => statsWorker.181932ee.js} | 2 +- ...ayerUtils.9d6cbcc3.js => sublayerUtils.59f5d9da.js} | 2 +- ...rUtils.d5fe1bd7.js => symbolColorUtils.36aaa708.js} | 2 +- ...rUtils.072aa491.js => symbolLayerUtils.5e2d5733.js} | 2 +- .../{tileUtils.44921ab9.js => tileUtils.332711ed.js} | 2 +- ...timeSupport.668a2439.js => timeSupport.968e62fc.js} | 2 +- assets/{tooltip.e0637362.js => tooltip.1fb2f0ea.js} | 4 ++-- assets/{util.ab699fea.js => util.520a352e.js} | 2 +- assets/{utils.4b023c9d.js => utils.0160becb.js} | 2 +- assets/{utils.8c53cad2.js => utils.83e0b804.js} | 2 +- assets/{utils.9731fda2.js => utils.bc3381b3.js} | 2 +- assets/{utils.399e6089.js => utils.e42485ea.js} | 2 +- assets/{vec33.4564cd5b.js => vec33.46fc6802.js} | 2 +- ...ls.32e27706.js => visualVariablesUtils.061b7a4e.js} | 2 +- ...ls.aff73e6d.js => visualVariablesUtils.62efda9d.js} | 2 +- ...ils.1a3d8f77.js => webStyleSymbolUtils.20098551.js} | 2 +- assets/webglDeps.a00b541b.js | 1 - assets/webglDeps.e3ffc164.js | 1 + assets/{wfsUtils.f8061e44.js => wfsUtils.6ba3d875.js} | 2 +- index.html | 4 ++-- 243 files changed, 248 insertions(+), 248 deletions(-) rename assets/{Analysis.0f84ef1d.js => Analysis.db10ad10.js} (93%) rename assets/{ArcGISCachedService.e7d85534.js => ArcGISCachedService.a530cd26.js} (89%) rename assets/{BaseDynamicLayerView2D.af78936a.js => BaseDynamicLayerView2D.be251f41.js} (59%) rename assets/{BaseGraphicContainer.6b1c597d.js => BaseGraphicContainer.7704bbc1.js} (98%) rename assets/{BaseProcessor.fe0bade4.js => BaseProcessor.f4010bc0.js} (90%) rename assets/{BaseTileRenderer.5cd35765.js => BaseTileRenderer.f04a8f8b.js} (93%) rename assets/{BingMapsLayer.cc96b552.js => BingMapsLayer.057bb977.js} (99%) rename assets/{Bitmap.43defcb1.js => Bitmap.72a3702e.js} (95%) rename assets/{BitmapContainer.3274be0c.js => BitmapContainer.9e943f6d.js} (81%) rename assets/{BitmapTileContainer.3a622161.js => BitmapTileContainer.f5b20598.js} (83%) rename assets/{BufferPool.ff53b3f4.js => BufferPool.98277e4b.js} (98%) rename assets/{BufferView.89055914.js => BufferView.6eee27cd.js} (99%) rename assets/{BuildingSceneLayer.0da55a35.js => BuildingSceneLayer.73877459.js} (97%) rename assets/{CSVLayer.ec8919b4.js => CSVLayer.f7ffeeb7.js} (98%) rename assets/{CSVSourceWorker.08ba4b81.js => CSVSourceWorker.20514f1e.js} (93%) rename assets/{CircularArray.a4d7e1c2.js => CircularArray.62f75f43.js} (91%) rename assets/{ComputedAttributeStorage.c1cb22b3.js => ComputedAttributeStorage.29767acd.js} (96%) delete mode 100644 assets/DefaultMaterial.glsl.037cb4cc.js create mode 100644 assets/DefaultMaterial.glsl.13f68fae.js rename assets/{DefaultMaterial_COLOR_GAMMA.bf8213a8.js => DefaultMaterial_COLOR_GAMMA.8ee780a2.js} (98%) rename assets/{DimensionLayer.dcd3110d.js => DimensionLayer.5b17861f.js} (97%) rename assets/{EdgeProcessingWorker.2beeabb2.js => EdgeProcessingWorker.f1d5e58e.js} (90%) rename assets/{ElevationLayer.7d5a34eb.js => ElevationLayer.0f63abe9.js} (93%) rename assets/{ElevationQuery.5a32e4bc.js => ElevationQuery.dec612cd.js} (99%) rename assets/{ElevationSamplerWorker.4ebae562.js => ElevationSamplerWorker.28a172f3.js} (82%) rename assets/{ExpandedCIM.f0b7f36d.js => ExpandedCIM.a372ce74.js} (99%) rename assets/{ExportImageParameters.0ebe2d44.js => ExportImageParameters.65ee285f.js} (95%) rename assets/{ExportStrategy.e65233e4.js => ExportStrategy.fb59ab52.js} (98%) rename assets/{ExportWMSImageParameters.bc1ac1a0.js => ExportWMSImageParameters.013012f9.js} (90%) rename assets/{FeatureContainer.4ca52b51.js => FeatureContainer.b427dd87.js} (97%) rename assets/{FeatureFilter.d7d1bf79.js => FeatureFilter.c87783c2.js} (82%) rename assets/{FeatureLayerSource.99e97c87.js => FeatureLayerSource.98dc2955.js} (97%) rename assets/{FeatureLayerView2D.c0de0a56.js => FeatureLayerView2D.7c1a650d.js} (94%) rename assets/{FeatureServiceSnappingSourceWorker.5ab08ebc.js => FeatureServiceSnappingSourceWorker.1a7b44d8.js} (98%) rename assets/{FeatureStore.27890cc9.js => FeatureStore.99d80f36.js} (96%) rename assets/{FeatureStore2D.eebd57c6.js => FeatureStore2D.3fea35f0.js} (97%) rename assets/{FetchAssociatedFeatureLayer.7dd7fa59.js => FetchAssociatedFeatureLayer.f6cbad39.js} (95%) rename assets/{GeoJSONLayer.979b524a.js => GeoJSONLayer.980a83f3.js} (97%) rename assets/{GeoJSONSourceWorker.2e44a17b.js => GeoJSONSourceWorker.5dfffbc8.js} (91%) rename assets/{GeoRSSLayer.cfaccd23.js => GeoRSSLayer.705a427d.js} (98%) rename assets/{GeoRSSLayerView2D.e15a9a7b.js => GeoRSSLayerView2D.f2cd7f86.js} (67%) rename assets/{GraphicContainer.618d10e5.js => GraphicContainer.b0be80ad.js} (77%) rename assets/{GraphicsLayerView2D.3b31f4c0.js => GraphicsLayerView2D.a23860d1.js} (57%) rename assets/{GroupContainer.b2a77ceb.js => GroupContainer.f412d859.js} (95%) rename assets/{GroupLayer.04359856.js => GroupLayer.d2d54b11.js} (96%) rename assets/{GroupLayerView2D.4f483153.js => GroupLayerView2D.f66e97aa.js} (85%) rename assets/{HeatmapProcessor.5f3f2029.js => HeatmapProcessor.ceb8669d.js} (91%) rename assets/{HeatmapTileRenderer.3cbc266c.js => HeatmapTileRenderer.f9ecd2b7.js} (76%) rename assets/{HighlightGraphicContainer.9bc65ba9.js => HighlightGraphicContainer.a4fdc946.js} (73%) rename assets/{I3SBinaryReader.9c0bbe1b.js => I3SBinaryReader.2f855706.js} (99%) rename assets/{I3SLayerDefinitions.96f4da60.js => I3SLayerDefinitions.0127897b.js} (96%) rename assets/{IdentityManager.9f244ffe.js => IdentityManager.0784430d.js} (99%) rename assets/{ImageryLayer.f621acf5.js => ImageryLayer.e44f33f4.js} (99%) rename assets/{ImageryLayerView2D.52654f54.js => ImageryLayerView2D.f0826692.js} (86%) rename assets/{ImageryTileLayer.f9fb83b4.js => ImageryTileLayer.e6833128.js} (99%) rename assets/{ImageryTileLayerView2D.687f9a67.js => ImageryTileLayerView2D.14079c8d.js} (96%) rename assets/{IntegratedMeshLayer.3a48c634.js => IntegratedMeshLayer.23dae716.js} (94%) rename assets/{InterleavedLayout.f9d79992.js => InterleavedLayout.30cdc193.js} (97%) rename assets/{KMLLayer.c732c888.js => KMLLayer.5fd7c195.js} (96%) rename assets/{KMLLayerView2D.bb939d29.js => KMLLayerView2D.5351cad6.js} (85%) rename assets/{LayerView.42d17220.js => LayerView.ce6e0535.js} (98%) rename assets/{LercWorker.7426541e.js => LercWorker.089f2d60.js} (98%) rename assets/{LineOfSightLayer.a4d98e23.js => LineOfSightLayer.d828be17.js} (96%) rename assets/{MapImageLayer.817bf3c0.js => MapImageLayer.09c43a61.js} (95%) rename assets/{MapImageLayerView2D.af3159c8.js => MapImageLayerView2D.de2fd653.js} (88%) rename assets/{MapNotesLayer.0d53edee.js => MapNotesLayer.52447f2c.js} (99%) rename assets/{MapNotesLayerView2D.8d6b9dc0.js => MapNotesLayerView2D.c9456f55.js} (74%) rename assets/{Matcher.fe0c3dcf.js => Matcher.6586928a.js} (98%) rename assets/{MaterialKey.229b1dd6.js => MaterialKey.0cadabc1.js} (98%) rename assets/{MediaLayerView2D.09f1bca2.js => MediaLayerView2D.44f0fc2d.js} (93%) rename assets/{MemorySourceWorker.0c33bcc2.js => MemorySourceWorker.8d1364ce.js} (90%) rename assets/{OGCFeatureLayer.a08e7e0a.js => OGCFeatureLayer.c9b31254.js} (97%) create mode 100644 assets/OGCFeatureLayerView2D.5ee46b9c.js delete mode 100644 assets/OGCFeatureLayerView2D.f2b5dde2.js rename assets/{OpenStreetMapLayer.0dc3f11e.js => OpenStreetMapLayer.959d4b15.js} (96%) rename assets/{OrientedImageryLayer.928bb67a.js => OrientedImageryLayer.adb44f0f.js} (87%) rename assets/{PBFDecoderWorker.4eacb33a.js => PBFDecoderWorker.47cbd979.js} (98%) rename assets/{Pipeline.4cffa97b.js => Pipeline.e5f0f177.js} (97%) rename assets/{PointCloudLayer.9b3b72ab.js => PointCloudLayer.454ff7a9.js} (97%) rename assets/{PointCloudUniqueValueRenderer.345f2613.js => PointCloudUniqueValueRenderer.32cfad84.js} (99%) rename assets/{PointCloudWorker.b6328283.js => PointCloudWorker.ac192dad.js} (96%) rename assets/{PooledRBush.04520070.js => PooledRBush.e6a31ee9.js} (97%) rename assets/{ProgramTemplate.e9a5aa54.js => ProgramTemplate.cf9dd4e8.js} (99%) rename assets/{QueryEngine.5a5ece4a.js => QueryEngine.ac81c46d.js} (97%) rename assets/{QueryEngineResult.7611d68a.js => QueryEngineResult.2fc58178.js} (98%) rename assets/{RasterSymbolizer.4ee6ff2c.js => RasterSymbolizer.093b1748.js} (99%) rename assets/{RasterVFDisplayObject.3d75d94d.js => RasterVFDisplayObject.da692284.js} (98%) rename assets/{RasterWorker.612f6623.js => RasterWorker.bd4ba3a5.js} (86%) rename assets/{RawBlockCache.73929591.js => RawBlockCache.e5f26f22.js} (97%) create mode 100644 assets/RealisticTree.glsl.6abe3a4c.js delete mode 100644 assets/RealisticTree.glsl.8875d152.js rename assets/{RefreshableLayerView.28a00159.js => RefreshableLayerView.887ed8c3.js} (84%) rename assets/{RenderingContext.6e624525.js => RenderingContext.8853f4cd.js} (99%) rename assets/{RouteLayer.ab63e037.js => RouteLayer.bee5d382.js} (99%) rename assets/{RouteLayerView2D.4c625030.js => RouteLayerView2D.3761d027.js} (77%) create mode 100644 assets/SSAO.glsl.1592f040.js delete mode 100644 assets/SSAO.glsl.e631cc39.js delete mode 100644 assets/SSAOBlur.glsl.1501066c.js create mode 100644 assets/SSAOBlur.glsl.7f71e6b4.js rename assets/{SceneLayer.46cfbdf5.js => SceneLayer.4e29d3af.js} (95%) rename assets/{SceneLayerSnappingSourceWorker.15d0e4f8.js => SceneLayerSnappingSourceWorker.b99c81d4.js} (95%) rename assets/{SceneLayerWorker.5a8acc10.js => SceneLayerWorker.b2729abd.js} (97%) rename assets/{SceneService.0f3bf01a.js => SceneService.9c2e5b40.js} (97%) rename assets/{SpatialFilter.dc70612a.js => SpatialFilter.fd0a95ff.js} (99%) rename assets/{Stop.a3532add.js => Stop.6862dd5a.js} (99%) rename assets/{StreamLayer.aded61fe.js => StreamLayer.ee7e4471.js} (96%) rename assets/{StreamLayerView2D.999b4965.js => StreamLayerView2D.29625b01.js} (77%) rename assets/{StyleRepository.a1fecb1f.js => StyleRepository.e426e44d.js} (99%) rename assets/{SublayersOwner.8a52d000.js => SublayersOwner.fd9e3967.js} (97%) rename assets/{SubtypeGroupLayer.8fd2feb6.js => SubtypeGroupLayer.76081822.js} (97%) rename assets/{SubtypeGroupLayerView2D.e026c935.js => SubtypeGroupLayerView2D.e28062ee.js} (62%) rename assets/{SymbolProcessor.179a3ae5.js => SymbolProcessor.1465a4e3.js} (90%) rename assets/{SymbolTileRenderer.a57bd090.js => SymbolTileRenderer.5a8a4597.js} (95%) rename assets/{Texture.4c97bad5.js => Texture.940076b2.js} (99%) rename assets/{TileClipper.8c399a8a.js => TileClipper.77103a2e.js} (99%) rename assets/{TileContainer.8b7fafe2.js => TileContainer.5aeb32d6.js} (85%) rename assets/{TileLayer.42bba12d.js => TileLayer.d3072542.js} (94%) rename assets/{TileLayerView2D.98b348c2.js => TileLayerView2D.18abd98d.js} (85%) rename assets/{TilemapCache.11964483.js => TilemapCache.b64a2ea8.js} (99%) rename assets/{UnknownLayer.08ed3ee7.js => UnknownLayer.5555c7bd.js} (91%) rename assets/{UnsupportedLayer.518b4e2c.js => UnsupportedLayer.5a5fca4b.js} (92%) rename assets/{Util.ea9235b8.js => Util.f17667f9.js} (86%) rename assets/{Utils.7f6f3a6b.js => Utils.2136650a.js} (98%) rename assets/{VectorTileLayer.f3cc18bb.js => VectorTileLayer.1b238b34.js} (98%) rename assets/{VectorTileLayerView2D.fd81c1b1.js => VectorTileLayerView2D.d09abb15.js} (98%) rename assets/{Version.59f2da65.js => Version.433fbe58.js} (93%) rename assets/{VertexArrayObject.a4c1d809.js => VertexArrayObject.53cf1857.js} (99%) rename assets/{VoxelLayer.50438218.js => VoxelLayer.733738ec.js} (98%) rename assets/{WFSLayer.9b7e311f.js => WFSLayer.431b960b.js} (97%) rename assets/{WFSSourceWorker.bb34a8ad.js => WFSSourceWorker.b32c1de1.js} (80%) rename assets/{WGLContainer.1850619d.js => WGLContainer.347cc5cd.js} (99%) rename assets/{WMSLayer.b219bb80.js => WMSLayer.5b9ad09d.js} (99%) rename assets/{WMSLayerView2D.1b7f0c8d.js => WMSLayerView2D.ed538bb1.js} (81%) rename assets/{WMTSLayer.2d04341c.js => WMTSLayer.902b88c8.js} (99%) rename assets/{WMTSLayerView2D.430450ca.js => WMTSLayerView2D.c5c29679.js} (85%) rename assets/{WebTileLayer.ab421225.js => WebTileLayer.b038b70d.js} (99%) rename assets/{WhereClause.253310fe.js => WhereClause.5b749615.js} (99%) rename assets/{WorkerTileHandler.8091b1a1.js => WorkerTileHandler.de9f3c4a.js} (99%) rename assets/{action.a0f1f825.js => action.033e9799.js} (98%) rename assets/{arcadeAsyncRuntime.9a6ca0c0.js => arcadeAsyncRuntime.f9b6facc.js} (98%) rename assets/{arcadeUtils.9e078218.js => arcadeUtils.09abf965.js} (99%) rename assets/{arcgisLayers.c7a7062a.js => arcgisLayers.296603be.js} (90%) rename assets/{calcite-action.6526d132.js => calcite-action.101f7577.js} (60%) rename assets/{calcite-flow-item.4a278560.js => calcite-flow-item.62da4be8.js} (99%) rename assets/{calcite-flow.ddd9f745.js => calcite-flow.45a3e267.js} (97%) rename assets/{calcite-icon.8f7a3cfc.js => calcite-icon.8b0ddff6.js} (69%) rename assets/{calcite-list-item.bd111fd1.js => calcite-list-item.c5e3f8cb.js} (96%) rename assets/{calcite-list.8f1cbf55.js => calcite-list.73c0b6c3.js} (98%) rename assets/{calcite-notice.49afa2e1.js => calcite-notice.41dd0b76.js} (98%) rename assets/{calcite-scrim.7f1cb3c0.js => calcite-scrim.b8319447.js} (67%) rename assets/{calcite-tooltip.583e6f48.js => calcite-tooltip.8ddd4c89.js} (70%) rename assets/{centroid.cc817cc5.js => centroid.06db4b74.js} (97%) rename assets/{clientSideDefaults.f5f7bfa0.js => clientSideDefaults.d40b9315.js} (92%) rename assets/{conditionalSlot.39f4bfa2.js => conditionalSlot.32d69949.js} (83%) rename assets/{createConnection.60903ce1.js => createConnection.0e3796d4.js} (98%) rename assets/{createSymbolSchema.e54d2060.js => createSymbolSchema.827eb617.js} (91%) rename assets/{dataUtils.0f9b810f.js => dataUtils.e7623e56.js} (99%) rename assets/{deduplicate.17ab7923.js => deduplicate.ef93b18a.js} (95%) rename assets/{drapedUtils.e64c9295.js => drapedUtils.0866c85c.js} (95%) rename assets/{edgeProcessing.b309b825.js => edgeProcessing.a9e4d72e.js} (97%) rename assets/{editingSupport.b066c126.js => editingSupport.7278fc9c.js} (99%) rename assets/{executeForIds.bade5c1b.js => executeForIds.9f78e2a6.js} (76%) rename assets/{featureLayerUtils.37a0188b.js => featureLayerUtils.878164f5.js} (95%) rename assets/{featureSetUtils.f1157478.js => featureSetUtils.e062de4c.js} (99%) rename assets/{featuresetbase.df0355d2.js => featuresetbase.dc4264cd.js} (97%) rename assets/{featuresetgeom.d91e9a0c.js => featuresetgeom.d2fdc1e5.js} (90%) rename assets/{featuresetstats.d56be13b.js => featuresetstats.a24876b2.js} (90%) rename assets/{featuresetstring.4242b3c8.js => featuresetstring.0a520808.js} (95%) rename assets/{fetchRasterInfo.d4fdc8d4.js => fetchRasterInfo.3f6af61b.js} (99%) rename assets/{fetchService.36bd4782.js => fetchService.88193309.js} (89%) rename assets/{floatRGBA.df11258c.js => floatRGBA.3f71f8e9.js} (83%) rename assets/{generateRendererUtils.ebdde5b7.js => generateRendererUtils.5c972fdb.js} (98%) rename assets/{geojson.8a0cb9d1.js => geojson.7d18026b.js} (96%) rename assets/{geomasync.a1913b84.js => geomasync.ca31aba0.js} (98%) rename assets/{geometryEngine.cfc395ce.js => geometryEngine.a80c0474.js} (96%) rename assets/{geometryEngineAsync.3b47a469.js => geometryEngineAsync.68619ff9.js} (97%) rename assets/{geometryServiceUtils.88d2a7a3.js => geometryServiceUtils.89c8be1f.js} (93%) rename assets/{georeference.c844666d.js => georeference.1d7480c1.js} (96%) rename assets/{gltfexport.b4e546f6.js => gltfexport.4b9e2f8e.js} (97%) rename assets/{hydrated.905f3857.js => hydrated.406495cb.js} (90%) rename assets/{icon.8e346cc3.js => icon.781cca93.js} (98%) rename assets/{imageUtils.b93c1581.js => imageUtils.215a62b1.js} (89%) rename assets/{imageutils.9dde1c66.js => imageutils.5e4d6270.js} (95%) rename assets/{index.d94abe07.js => index.221827cd.js} (97%) rename assets/{jsonContext.3176ed6f.js => jsonContext.fe51f9bd.js} (81%) rename assets/{kmlUtils.abf45fa2.js => kmlUtils.3e458b80.js} (97%) rename assets/{labelFormatUtils.24133ce3.js => labelFormatUtils.1d67a85b.js} (90%) rename assets/{layersCreator.eb921b3a.js => layersCreator.67b651fa.js} (93%) rename assets/{layersLoader.67118e89.js => layersLoader.afdddce2.js} (97%) create mode 100644 assets/lazyLayerLoader.4d2df2af.js delete mode 100644 assets/lazyLayerLoader.f961f278.js rename assets/{loadGLTFMesh.fce23b90.js => loadGLTFMesh.4a319eb1.js} (89%) rename assets/{loader.3df23557.js => loader.d1e283c7.js} (99%) rename assets/{mapViewDeps.ae59dec6.js => mapViewDeps.692d211f.js} (98%) rename assets/{meshFeatureSet.81c1d5a6.js => meshFeatureSet.eec93388.js} (95%) rename assets/{multidimensionalUtils.4f713da1.js => multidimensionalUtils.59c05ac5.js} (99%) rename assets/{nonChromiumPlatformUtils.79814374.js => nonChromiumPlatformUtils.a164ac17.js} (98%) rename assets/{normalizeUtilsSync.757b5fd1.js => normalizeUtilsSync.4d52fbd0.js} (98%) rename assets/{number.8c2c26f3.js => number.9e690eda.js} (98%) rename assets/{objectResourceUtils.996108d7.js => objectResourceUtils.dfe6cb73.js} (97%) rename assets/{observers.11f150c2.js => observers.440ad120.js} (94%) rename assets/{ogcFeatureUtils.ed8217a8.js => ogcFeatureUtils.61a937b0.js} (97%) rename assets/{persistable.5f665309.js => persistable.6b292e5e.js} (94%) rename assets/{pixelUtils.82950e1a.js => pixelUtils.9c6f8dae.js} (99%) rename assets/{plane.86573aee.js => plane.444b53ce.js} (73%) rename assets/{popupUtils.4abb3ffd.js => popupUtils.c6371f3a.js} (91%) rename assets/{portalItemUtils.57ded807.js => portalItemUtils.92eef7f6.js} (92%) rename assets/{portalLayers.8fee158d.js => portalLayers.72750f56.js} (93%) rename assets/{programUtils.956e69db.js => programUtils.10ecfb8b.js} (91%) rename assets/{projectionSupport.0542c13b.js => projectionSupport.4f5da4af.js} (96%) rename assets/{quantizationUtils.0d428d19.js => quantizationUtils.7ff797cc.js} (97%) rename assets/{quat.b3994f2f.js => quat.d9562009.js} (96%) rename assets/{rasterProjectionHelper.0a540f3d.js => rasterProjectionHelper.f3c10be2.js} (99%) rename assets/{rasterizingUtils.4baad29a.js => rasterizingUtils.ec7fabe7.js} (93%) rename assets/{request.493a15ad.js => request.aa5275d6.js} (93%) rename assets/{requestImageUtils.7b09b5e8.js => requestImageUtils.1f5d4b6d.js} (54%) rename assets/{resourceUtils.6d10bf82.js => resourceUtils.f4b6e42a.js} (97%) rename assets/{scaleUtils.467c71f9.js => scaleUtils.de5ad5a6.js} (71%) rename assets/{schemaUtils.69ad92d2.js => schemaUtils.d20994fa.js} (97%) rename assets/{schemaValidator.49ec0b34.js => schemaValidator.90689324.js} (99%) rename assets/{scrim.5d8801d4.js => scrim.51d512d2.js} (96%) rename assets/{sourceUtils.61cd5549.js => sourceUtils.ed369a2c.js} (96%) rename assets/{sphere.ec1f4496.js => sphere.f99ddb50.js} (98%) rename assets/{statsWorker.46eac3dc.js => statsWorker.181932ee.js} (94%) rename assets/{sublayerUtils.9d6cbcc3.js => sublayerUtils.59f5d9da.js} (94%) rename assets/{symbolColorUtils.d5fe1bd7.js => symbolColorUtils.36aaa708.js} (62%) rename assets/{symbolLayerUtils.072aa491.js => symbolLayerUtils.5e2d5733.js} (67%) rename assets/{tileUtils.44921ab9.js => tileUtils.332711ed.js} (67%) rename assets/{timeSupport.668a2439.js => timeSupport.968e62fc.js} (95%) rename assets/{tooltip.e0637362.js => tooltip.1fb2f0ea.js} (99%) rename assets/{util.ab699fea.js => util.520a352e.js} (84%) rename assets/{utils.4b023c9d.js => utils.0160becb.js} (98%) rename assets/{utils.8c53cad2.js => utils.83e0b804.js} (99%) rename assets/{utils.9731fda2.js => utils.bc3381b3.js} (99%) rename assets/{utils.399e6089.js => utils.e42485ea.js} (96%) rename assets/{vec33.4564cd5b.js => vec33.46fc6802.js} (97%) rename assets/{visualVariablesUtils.32e27706.js => visualVariablesUtils.061b7a4e.js} (93%) rename assets/{visualVariablesUtils.aff73e6d.js => visualVariablesUtils.62efda9d.js} (84%) rename assets/{webStyleSymbolUtils.1a3d8f77.js => webStyleSymbolUtils.20098551.js} (96%) delete mode 100644 assets/webglDeps.a00b541b.js create mode 100644 assets/webglDeps.e3ffc164.js rename assets/{wfsUtils.f8061e44.js => wfsUtils.6ba3d875.js} (98%) diff --git a/assets/Analysis.0f84ef1d.js b/assets/Analysis.db10ad10.js similarity index 93% rename from assets/Analysis.0f84ef1d.js rename to assets/Analysis.db10ad10.js index e2559ca..111d0eb 100644 --- a/assets/Analysis.0f84ef1d.js +++ b/assets/Analysis.db10ad10.js @@ -1 +1 @@ -import{iy as n,eg as o,aP as l,c as a,a6 as e,a7 as s,a8 as p,a9 as y}from"./index.d94abe07.js";let c=0,t=class extends n(o(l(y))){constructor(r){super(r),this.id=`${Date.now().toString(16)}-analysis-${c++}`,this.title=null}get parent(){return this._get("parent")}set parent(r){const i=this.parent;if(a(i))switch(i.type){case"line-of-sight":case"dimension":i.releaseAnalysis(this);break;case"2d":case"3d":i.analyses.includes(this)&&i.analyses.remove(this)}this._set("parent",r)}get isEditable(){return this.requiredPropertiesForEditing.every(a)}};e([s({type:String,constructOnly:!0,clonable:!1})],t.prototype,"id",void 0),e([s({type:String})],t.prototype,"title",void 0),e([s({constructOnly:!0})],t.prototype,"type",void 0),e([s({clonable:!1,value:null})],t.prototype,"parent",null),e([s({readOnly:!0})],t.prototype,"isEditable",null),e([s({readOnly:!0})],t.prototype,"requiredPropertiesForEditing",void 0),t=e([p("esri.analysis.Analysis")],t);const u=t;export{u as c}; +import{iy as n,eg as o,aP as l,c as a,a6 as e,a7 as s,a8 as p,a9 as y}from"./index.221827cd.js";let c=0,t=class extends n(o(l(y))){constructor(r){super(r),this.id=`${Date.now().toString(16)}-analysis-${c++}`,this.title=null}get parent(){return this._get("parent")}set parent(r){const i=this.parent;if(a(i))switch(i.type){case"line-of-sight":case"dimension":i.releaseAnalysis(this);break;case"2d":case"3d":i.analyses.includes(this)&&i.analyses.remove(this)}this._set("parent",r)}get isEditable(){return this.requiredPropertiesForEditing.every(a)}};e([s({type:String,constructOnly:!0,clonable:!1})],t.prototype,"id",void 0),e([s({type:String})],t.prototype,"title",void 0),e([s({constructOnly:!0})],t.prototype,"type",void 0),e([s({clonable:!1,value:null})],t.prototype,"parent",null),e([s({readOnly:!0})],t.prototype,"isEditable",null),e([s({readOnly:!0})],t.prototype,"requiredPropertiesForEditing",void 0),t=e([p("esri.analysis.Analysis")],t);const u=t;export{u as c}; diff --git a/assets/ArcGISCachedService.e7d85534.js b/assets/ArcGISCachedService.a530cd26.js similarity index 89% rename from assets/ArcGISCachedService.e7d85534.js rename to assets/ArcGISCachedService.a530cd26.js index b17f9fd..9030fe2 100644 --- a/assets/ArcGISCachedService.e7d85534.js +++ b/assets/ArcGISCachedService.a530cd26.js @@ -1 +1 @@ -import{a6 as a,a7 as l,d2 as r,aT as p,a8 as n}from"./index.d94abe07.js";import{r as s,z as c}from"./TilemapCache.11964483.js";const d=o=>{let e=class extends o{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}readMinScale(i,t){return t.minLOD!=null&&t.maxLOD!=null?i:0}readMaxScale(i,t){return t.minLOD!=null&&t.maxLOD!=null?i:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(i,t){return t.capabilities&&t.capabilities.includes("Tilemap")?new c({layer:this}):null}};return a([l({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),a([l()],e.prototype,"minScale",void 0),a([r("service","minScale")],e.prototype,"readMinScale",null),a([l()],e.prototype,"maxScale",void 0),a([r("service","maxScale")],e.prototype,"readMaxScale",null),a([l({type:p})],e.prototype,"spatialReference",void 0),a([l({readOnly:!0})],e.prototype,"supportsBlankTile",null),a([l(s)],e.prototype,"tileInfo",void 0),a([l()],e.prototype,"tilemapCache",void 0),a([r("service","tilemapCache",["capabilities"])],e.prototype,"readTilemapCache",null),a([l()],e.prototype,"version",void 0),e=a([n("esri.layers.mixins.ArcGISCachedService")],e),e};export{d as s}; +import{a6 as a,a7 as l,d2 as r,aT as p,a8 as n}from"./index.221827cd.js";import{r as s,z as c}from"./TilemapCache.b64a2ea8.js";const d=o=>{let e=class extends o{constructor(){super(...arguments),this.copyright=null,this.minScale=0,this.maxScale=0,this.spatialReference=null,this.tileInfo=null,this.tilemapCache=null}readMinScale(i,t){return t.minLOD!=null&&t.maxLOD!=null?i:0}readMaxScale(i,t){return t.minLOD!=null&&t.maxLOD!=null?i:0}get supportsBlankTile(){return this.version>=10.2}readTilemapCache(i,t){return t.capabilities&&t.capabilities.includes("Tilemap")?new c({layer:this}):null}};return a([l({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),a([l()],e.prototype,"minScale",void 0),a([r("service","minScale")],e.prototype,"readMinScale",null),a([l()],e.prototype,"maxScale",void 0),a([r("service","maxScale")],e.prototype,"readMaxScale",null),a([l({type:p})],e.prototype,"spatialReference",void 0),a([l({readOnly:!0})],e.prototype,"supportsBlankTile",null),a([l(s)],e.prototype,"tileInfo",void 0),a([l()],e.prototype,"tilemapCache",void 0),a([r("service","tilemapCache",["capabilities"])],e.prototype,"readTilemapCache",null),a([l()],e.prototype,"version",void 0),e=a([n("esri.layers.mixins.ArcGISCachedService")],e),e};export{d as s}; diff --git a/assets/BaseDynamicLayerView2D.af78936a.js b/assets/BaseDynamicLayerView2D.be251f41.js similarity index 59% rename from assets/BaseDynamicLayerView2D.af78936a.js rename to assets/BaseDynamicLayerView2D.be251f41.js index e3a684b..ef5edd0 100644 --- a/assets/BaseDynamicLayerView2D.af78936a.js +++ b/assets/BaseDynamicLayerView2D.be251f41.js @@ -1 +1 @@ -import{x as o,s as p,a6 as r,a7 as a,a8 as m}from"./index.d94abe07.js";import{a as n}from"./BitmapContainer.3274be0c.js";import{y as h,u as d}from"./LayerView.42d17220.js";import{v as c}from"./ExportStrategy.e65233e4.js";import{i as u}from"./RefreshableLayerView.28a00159.js";import"./WGLContainer.1850619d.js";import"./enums.2d9e6f64.js";import"./pixelUtils.82950e1a.js";import"./utils.4b023c9d.js";import"./Utils.7f6f3a6b.js";import"./enums.0295eb81.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.229b1dd6.js";import"./VertexArrayObject.a4c1d809.js";import"./ProgramTemplate.e9a5aa54.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./Bitmap.43defcb1.js";let t=class extends u(h(d)){update(e){this._strategy.update(e).catch(i=>{o(i)||p.getLogger(this.declaredClass).error(i)}),this.notifyChange("updating")}attach(){this._bitmapContainer=new n,this.container.addChild(this._bitmapContainer),this._strategy=new c({container:this._bitmapContainer,fetchSource:this.fetchBitmapData.bind(this),requestUpdate:this.requestUpdate.bind(this)})}detach(){this._strategy.destroy(),this._strategy=null,this.container.removeChild(this._bitmapContainer),this._bitmapContainer.removeAllChildren()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}fetchBitmapData(e,i,s){return this.layer.fetchImage(e,i,s)}async doRefresh(){this.requestUpdate()}isUpdating(){return this._strategy.updating||this.updateRequested}};r([a()],t.prototype,"_strategy",void 0),r([a()],t.prototype,"updating",void 0),t=r([m("esri.views.2d.layers.BaseDynamicLayerView2D")],t);const V=t;export{V as default}; +import{x as o,s as p,a6 as r,a7 as a,a8 as m}from"./index.221827cd.js";import{a as n}from"./BitmapContainer.9e943f6d.js";import{y as h,u as d}from"./LayerView.ce6e0535.js";import{v as c}from"./ExportStrategy.fb59ab52.js";import{i as u}from"./RefreshableLayerView.887ed8c3.js";import"./WGLContainer.347cc5cd.js";import"./enums.2d9e6f64.js";import"./pixelUtils.9c6f8dae.js";import"./utils.0160becb.js";import"./Utils.2136650a.js";import"./enums.0295eb81.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.0cadabc1.js";import"./VertexArrayObject.53cf1857.js";import"./ProgramTemplate.cf9dd4e8.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./Bitmap.72a3702e.js";let t=class extends u(h(d)){update(e){this._strategy.update(e).catch(i=>{o(i)||p.getLogger(this.declaredClass).error(i)}),this.notifyChange("updating")}attach(){this._bitmapContainer=new n,this.container.addChild(this._bitmapContainer),this._strategy=new c({container:this._bitmapContainer,fetchSource:this.fetchBitmapData.bind(this),requestUpdate:this.requestUpdate.bind(this)})}detach(){this._strategy.destroy(),this._strategy=null,this.container.removeChild(this._bitmapContainer),this._bitmapContainer.removeAllChildren()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}fetchBitmapData(e,i,s){return this.layer.fetchImage(e,i,s)}async doRefresh(){this.requestUpdate()}isUpdating(){return this._strategy.updating||this.updateRequested}};r([a()],t.prototype,"_strategy",void 0),r([a()],t.prototype,"updating",void 0),t=r([m("esri.views.2d.layers.BaseDynamicLayerView2D")],t);const V=t;export{V as default}; diff --git a/assets/BaseGraphicContainer.6b1c597d.js b/assets/BaseGraphicContainer.7704bbc1.js similarity index 98% rename from assets/BaseGraphicContainer.6b1c597d.js rename to assets/BaseGraphicContainer.7704bbc1.js index c852820..8d63c9d 100644 --- a/assets/BaseGraphicContainer.6b1c597d.js +++ b/assets/BaseGraphicContainer.7704bbc1.js @@ -1,4 +1,4 @@ -import{c as F,ax as E,ay as b,az as Ke,u as Ee,aA as fe,aB as qe,aC as de,j as A,aD as He,aE as ne,aF as Ne,aG as Ze,aH as Qe,aI as Ye,aJ as Ge,aK as We,aL as Oe,aM as Xe,aN as Je,aO as et,I as N,aP as tt,a6 as v,a7 as C,a8 as $e,m as st,a4 as it,aQ as rt,_ as nt,v as x,aR as ot,aS as at,x as Z,aT as lt,aU as _e,aV as xe,aW as ve,aX as ht,aY as be,aZ as oe,a_ as dt,a$ as ct,b0 as ut,a9 as ft,N as De,b1 as pt,b2 as mt,S as gt,b3 as yt,Q as _t,R as xt}from"./index.d94abe07.js";import{d as Ce,V as vt,Q as bt,n as Dt}from"./ExpandedCIM.f0b7f36d.js";import{p as Ct}from"./normalizeUtilsSync.757b5fd1.js";import{f as Bt,g as wt}from"./projectionSupport.0542c13b.js";import{U as Tt}from"./enums.0295eb81.js";import{K as pe,X,c as ce,i as Ft,s as Rt,W as ee,G as St,h as It,S as Ue,g as Mt}from"./Utils.7f6f3a6b.js";import{a as Pe,E as te}from"./VertexArrayObject.a4c1d809.js";import{F as ue,R as Be,E as Lt,C as Ve,I as At}from"./enums.2d9e6f64.js";import{m as zt,i as Gt,o as Ot}from"./FeatureContainer.4ca52b51.js";import{U as $t}from"./MaterialKey.229b1dd6.js";import{a as J,l as Ut,x as Pt,b as Vt,n as jt,E as kt}from"./Matcher.fe0c3dcf.js";import{w as we,$ as Kt}from"./schemaUtils.69ad92d2.js";import{c as Et,b as qt,r as Ht,v as Nt}from"./ComputedAttributeStorage.c1cb22b3.js";import{O as Zt,U as P}from"./quantizationUtils.0d428d19.js";import{createSymbolSchema as Qt}from"./createSymbolSchema.e54d2060.js";import{r as Yt}from"./vec3f32.1121a836.js";import{r as Wt}from"./utils.4b023c9d.js";const g=-1;class Te{constructor(){this._dirties=[{vertexFrom:g,vertexCount:g,indexFrom:g,indexCount:g,allDirty:!1},{vertexFrom:g,vertexCount:g,indexFrom:g,indexCount:g,allDirty:!1},{vertexFrom:g,vertexCount:g,indexFrom:g,indexCount:g,allDirty:!1},{vertexFrom:g,vertexCount:g,indexFrom:g,indexCount:g,allDirty:!1},{vertexFrom:g,vertexCount:g,indexFrom:g,indexCount:g,allDirty:!1}]}hasDirty(){return this._dirties.some(e=>e.indexCount!==g||e.allDirty)}markAllClean(){for(const e of this._dirties)e.indexFrom=g,e.indexCount=g,e.vertexFrom=g,e.vertexCount=g,e.allDirty=!1}markAllDirty(){for(const e of this._dirties)e.allDirty=!0}forEach(e){for(let t=0;t0)&&(l.geometry={count:r,from:n,allDirty:a},h=!0),(a||i!==g&&s>0)&&(d={count:s,from:i,allDirty:a},h=!0),h&&e({indices:d,vertices:l},t)}}markDirtyIndices(e,t,s){const i=this._dirties[e],r=t,n=s;if(!i.allDirty)if(i.indexCount!==g){const a=Math.min(i.indexFrom,r),l=Math.max(i.indexFrom+i.indexCount,r+n)-a;i.indexFrom=a,i.indexCount=l}else i.indexFrom=r,i.indexCount=n}markDirtyVertices(e,t,s,i){const r=this._dirties[e],n=s,a=i;if(!r.allDirty)if(r.vertexCount!==g){const l=Math.min(r.vertexFrom,n),d=Math.max(r.vertexFrom+r.vertexCount,n+a)-l;r.vertexFrom=l,r.vertexCount=d}else r.vertexFrom=n,r.vertexCount=a}}class Xt{constructor(e){this._largestRange=null,this._parent=e,this._updateLargestRange()}get largestRange(){return this._largestRange}rangeCreated(e){(!this._largestRange||e.count>this._largestRange.count)&&(this._largestRange=e)}rangeResized(e,t){e===this._largestRange?e.countthis._largestRange.count)&&(this._largestRange=e)}findBestRange(e){let t=this._parent._freeHead,s=null;for(;t!==null;)t.count>=e&&(!s||t.count-e=a&&e+t<=l?(s=!1,i=!0):n!==null?(r=n,n=n.next):s=!1}return[r,n]}_updateLargestRange(){let e=null,t=this._parent._freeHead;for(;t!==null;)(!e||t.count>e.count)&&(e=t),t=t.next;this._largestRange=e}}class B{constructor(e,t){this._allocated=0,this._size=e,this._freeHead=e>0?{from:0,count:e,prev:null,next:null}:null,this._bookKeeper=t||new Xt(this),this._freeHead&&this._bookKeeper.rangeCreated(this._freeHead)}allocate(e){const t=this._bookKeeper.findBestRange(e);if(t===null)return-1;const s=t.from,i=t.count;if(t.from+=e,t.count-=e,this._bookKeeper.rangeResized(t,s,i),this._allocated+=e,t.count===0){const r=t.prev!==null?this._freeHead:t.next;B._removeRange(t),this._freeHead=r}return s}free(e,t){const[s,i]=this._bookKeeper.findAdjacentRanges(e,t),r={from:e,count:t,prev:s,next:i};if(s!==null&&(s.next=r),i!==null&&(i.prev=r),this._bookKeeper.rangeCreated(r),this._allocated-=t,i!==null&&r.from+r.count===i.from){const n=r.from,a=r.count;B._fuse(r,i),B._removeRange(i),this._bookKeeper.rangeResized(r,n,a),this._bookKeeper.rangeResized(i,void 0,0)}if(s!==null&&s.from+s.count===r.from){const n=s.from,a=s.count;B._fuse(s,r),B._removeRange(r),this._bookKeeper.rangeResized(s,n,a),this._bookKeeper.rangeResized(r,void 0,0)}this._freeHead=r.prev!==null?this._freeHead:r}get fragmentation(){const e=this._size-this._allocated;return e===0?0:1-this._bookKeeper.largestRange.count/e}static _removeRange(e){e.prev!==null?e.next!==null?(e.prev.next=e.next,e.next.prev=e.prev):e.prev.next=null:e.next!==null&&(e.next.prev=null)}static _fuse(e,t){e.count+=t.count,e.next=t.next,t.from+=t.count,t.count=0,t.next!==null&&(t.next.prev=e)}}const k=["FILL","LINE","MARKER","TEXT","LABEL"];function Jt(o){const e=o.getStrides(),t={};for(let s=0;se.vertexCount?(this._freeVertices(n,e.vertexFrom,e.vertexCount),l=t.vertexCount,a=this._allocateVertices(n,l)):t.vertexCount===e.vertexCount?(a=e.vertexFrom,l=e.vertexCount):(this._freeVertices(n,e.vertexFrom+t.vertexCount,e.vertexCount-t.vertexCount),a=e.vertexFrom,l=t.vertexCount);let d,h,c,u=!0;if(e.indexFrom===void 0?(d=r,c=t.indexCount,h=this._allocateIndices(n,c)):t.indexCount>e.indexCount?(d=this._displayList.removeFromList(e),this._freeIndices(n,e.indexFrom,e.indexCount),c=t.indexCount,h=this._allocateIndices(n,c)):t.indexCount===e.indexCount?(u=!1,h=e.indexFrom,c=e.indexCount):(d=this._displayList.removeFromList(e),this._freeIndices(n,e.indexFrom+t.indexCount,e.indexCount-t.indexCount),h=e.indexFrom,c=t.indexCount),a!==-1&&h!==-1){const p=this._storageFor(n);if(ce(a,h,p.vertexBuffers,p.indexBuffer,t,s,i),e.vertexFrom=a,e.indexFrom=h,e.vertexCount=t.vertexCount,e.indexCount=t.indexCount,this._dirtyMap){this._dirtyMap.markDirtyIndices(e.geometryType,e.indexFrom,e.indexCount);for(const f in s)this._dirtyMap.markDirtyVertices(e.geometryType,f,e.vertexFrom,e.vertexCount)}return u&&this._displayList.addToList(e,d),!0}return a!==-1&&this._freeVertices(n,a,l),h!==-1&&this._freeIndices(n,h,c),e.setMeshDataFromBuffers(t,s,i),e.vertexFrom=void 0,e.vertexCount=0,e.indexFrom=void 0,e.indexCount=0,!1}tryAddMeshData(e,t){const s=t.vertexBuffer,i=t.indexBuffer,r=k[e.geometryType],n=this._allocateVertices(r,e.vertexCount);if(n===-1)return this._freeVertices(r,n,e.vertexCount),!1;const a=this._allocateIndices(r,e.indexCount);if(a===-1)return this._freeVertices(r,n,e.vertexCount),this._freeIndices(r,a,e.indexCount),!1;const l=this._storageFor(r);if(ce(n,a,l.vertexBuffers,l.indexBuffer,e,s,i),e.vertexFrom=n,e.indexFrom=a,this._dirtyMap){this._dirtyMap.markDirtyIndices(e.geometryType,e.indexFrom,e.indexCount);for(const d in s)this._dirtyMap.markDirtyVertices(e.geometryType,d,n,e.vertexCount)}return this._displayList.addToList(e),!0}_allocateVertices(e,t){const s=this._storageFor(e),i=s.vtxFreeList.allocate(t);return i===-1||s.vtxFreeList.fragmentation>Fe?-1:i}_freeVertices(e,t,s){this._storageFor(e).vtxFreeList.free(t,s)}_freeIndices(e,t,s){this._storageFor(e).idxFreeList.free(t,s)}_allocateIndices(e,t){const s=this._storageFor(e),i=s.idxFreeList.allocate(t);return i===-1||s.idxFreeList.fragmentation>Fe?-1:i}_storageFor(e){return this._freeListsAndStorage[e]}_stridesFor(e,t){return this._strides[e][t]}}class es{constructor(e){this.geometryMap=Ft(()=>({indexBuffer:te.createIndex(e,ue.STATIC_DRAW),vao:null}),(t,s)=>({vertexBuffer:te.createVertex(e,Rt[s])}))}dispose(){for(let e=0;e<5;e++){const t=this.geometryMap[e];if(t){t.data.vao&&t.data.vao.dispose(!1),t.data.indexBuffer&&t.data.indexBuffer.dispose();for(const s in t.buffers)t.buffers[s]&&t.buffers[s].data.vertexBuffer.dispose()}}}get(e){const t=this.geometryMap[e];return{getVAO(s,i,r){if(!t.data.vao){const n={};for(const a in t.buffers)n[a]=t.buffers[a].data.vertexBuffer;t.data.vao=new Pe(s,r,i,n,t.data.indexBuffer)}return t.data.vao}}}has(e){return this.geometryMap[e]!=null}upload(e,t){t.forEach((s,i)=>{this._upload(s,i,e)})}_upload(e,t,s){if(e.indices&&(e.indices.allDirty?this._uploadIndices(s,t):e.indices.from!=null&&e.indices.count!=null&&this._uploadIndices(s,t,e.indices.from,e.indices.count)),e.vertices){const i=e.vertices;for(const r in i){const n=i[r];n.allDirty?this._uploadVertices(s,t,r):n.from!=null&&n.count!=null&&this._uploadVertices(s,t,r,n.from,n.count)}}}_uploadVertices(e,t,s,i,r){const n=this.geometryMap[t];if(!n)return;const a=e.geometries[t].vertexBuffer[s];if(!a)return;const{data:l,stride:d}=a;if(n.buffers[s]&&l.length>0){const h=d/l.BYTES_PER_ELEMENT;i!=null&&r!=null?n.buffers[s].data.vertexBuffer.setSubData(l,i*h,i*h,(i+r)*h):n.buffers[s].data.vertexBuffer.setData(l)}}_uploadIndices(e,t,s,i){const r=this.geometryMap[t];if(!r)return;const n=e.geometries[t].indexBuffer;r.data.indexBuffer&&n.length>0&&(s!=null&&i!=null?r.data.indexBuffer.setSubData(n,s,s,s+i):r.data.indexBuffer.setData(n))}}class ts extends zt{constructor(){super(...arguments),this._data=null,this._displayList=null,this._lastCommitTime=0,this._hasData=!1,this._invalidated=!1,this._wglBuffers=null,this._dirtyMap=new Te}destroy(){super.destroy(),this.clear()}get hasData(){return!!this._hasData}get displayObjects(){var e;return(e=this._displayObjects)!=null?e:[]}getGeometry(e){return this._wglBuffers&&this._wglBuffers.has(e)?this._wglBuffers.get(e):null}getDisplayList(){return this._displayList}patch(e){if(e.clear===!0)return this.clear(),void(this._hasData=!1);const t=e.addOrUpdate,s=e.remove;!this._data&&t&&t.tileDisplayData.displayObjects.length?(t.tileDisplayData.computeDisplayList(),this._dirtyMap=new Te,this._dispRecStore=se.fromTileData(t,this._dirtyMap),this._data=t,this._dirtyMap.markAllDirty(),this._hasData=!0,e.end&&this.ready()):this._data&&(t&&t.tileDisplayData.displayObjects.length||s.length)?this._doPatchData(e):e.end&&this.ready(),e.end&&!this._data&&this.clear(),this.requestRender(),this.emit("change")}commit(e){e.time&&e.time===this._lastCommitTime||(this._lastCommitTime=e.time,this.visible&&this._data&&(this._wglBuffers||(this._wglBuffers=new es(e.context)),(this._dirtyMap.hasDirty()||this._invalidated)&&(this._invalidated=!1,this._wglBuffers.upload(this._data.tileBufferData,this._dirtyMap),this._displayList=this._data.tileDisplayData.displayList.clone(),this._displayObjects=this._data.tileDisplayData.displayObjects.slice(),this._dirtyMap.markAllClean())))}clear(){this._data=null,this._displayList=null,this._dispRecStore=null,this._wglBuffers&&(this._wglBuffers.dispose(),this._wglBuffers=null)}_doPatchData(e){this._invalidated=!0,this._patchData(e)||(this._dirtyMap.markAllDirty(),this._data.reshuffle(),this._dispRecStore=se.fromTileData(this._data,this._dirtyMap)),this.requestRender()}_patchData(e){let t=!0;const s=e.addOrUpdate&&e.addOrUpdate.tileDisplayData&&e.addOrUpdate.tileDisplayData.displayObjects||[],i=(e.remove||[]).slice();for(const n of s)n.insertAfter!=null&&i.push(n.id);let r;i.length>0&&(r=new Set(i));for(const n of i){const a=this._data.tileDisplayData.displayObjectRegistry.get(n);if(a){this._data.tileDisplayData.displayList.removeFromList(a.displayRecords);for(const l of a.displayRecords)this._dispRecStore.delete(l);this._data.tileDisplayData.displayObjectRegistry.delete(n)}}r&&r.size&&(this._data.tileDisplayData.displayObjects=this._data.tileDisplayData.displayObjects.filter(n=>!r.has(n.id)));for(const n of s){let a,l=this._data.tileDisplayData.displayObjectRegistry.get(n.id);if(l){const h=l.displayRecords;l.set(n),l.displayRecords=h;const c=l.displayRecords.length;for(let u=0;u=n.displayRecords.length||p.geometryType!==f.geometryType||p.symbolLevel!==f.symbolLevel||p.zOrder!==f.zOrder||p.materialKey!==f.materialKey)&&(this._dispRecStore.delete(l.displayRecords[u]),u=0){const u=this._data.tileDisplayData.displayObjectRegistry.get(l.insertAfter);u?(h=c.indexOf(u)+1,h0?1:0;let p=0;for(let f=h-1;f>=0&&p=0&&pn.indexFrom&&i<=n.indexFrom+n.indexCount){if(i=0&&nl.indexFrom&&e.indexFromt.clone()),e.line=this.line&&this.line.map(t=>t.clone()),e.marker=this.marker&&this.marker.map(t=>t.clone()),e.text=this.text&&this.text.map(t=>t.clone()),e.label=this.label&&this.label.map(t=>t.clone()),e.unified=this.unified&&this.unified.map(t=>t.clone()),e}}class ge{constructor(){this.geometryDPInfo=new re}clone(){const e=new ge;return e.zLevel=this.zLevel,e.geometryDPInfo=this.geometryDPInfo.clone(),e}}class ye{constructor(){this.zLevels=[]}clone(){const e=new ye;e.symbolLevel=this.symbolLevel;for(const t of this.zLevels)e.zLevels.push(t.clone());return e}}class Re{constructor(){this.vertexData=new Map,this.vertexCount=0,this.indexData=[]}clear(){this.vertexData.clear(),this.vertexCount=0,this.indexData=[]}update(e,t,s){for(const i in e)this.vertexData.set(i,e[i]);for(const i in this.vertexData)e[i]===null&&this.vertexData.delete(i);this.vertexCount=t,this.indexData=s}}class U{constructor(e,t,s,i=0,r=0){this.id=e,this.geometryType=t,this.materialKey=s,this.minZoom=i,this.maxZoom=r,this.meshData=null,this.symbolLevel=0,this.zOrder=0,this.vertexFrom=0,this.vertexCount=0,this.indexFrom=0,this.indexCount=0}get sortKey(){return this._sortKey===void 0&&this._computeSortKey(),this._sortKey}clone(){return this.copy()}copy(){const e=new U(this.id,this.geometryType,this.materialKey);return e.vertexFrom=this.vertexFrom,e.vertexCount=this.vertexCount,e.indexFrom=this.indexFrom,e.indexCount=this.indexCount,e.zOrder=this.zOrder,e.symbolLevel=this.symbolLevel,e.meshData=this.meshData,e.minZoom=this.minZoom,e.maxZoom=this.maxZoom,e}setMeshDataFromBuffers(e,t,s){const i=new Re;for(const r in t){const n=t[r].stride,a=t[r].data,l=[],d=X(n);for(let h=0;ht.clone()),e.insertAfter=this.insertAfter,e}set(e){this.id=e.id,this.displayRecords=e.displayRecords,this.insertAfter=e.insertAfter}serialize(e){return e.push(this.id),ke(e,this.displayRecords),e}static deserialize(e){const t=e.readInt32(),s=new G(t),i={id:t};return s.displayRecords=ss(e,U,i),s}}class q{get displayObjectRegistry(){if(!this._displayObjectRegistry){this._displayObjectRegistry=new Map;for(const e of this.displayObjects)this._displayObjectRegistry.set(e.id,e)}return this._displayObjectRegistry}get displayList(){return this._displayList}computeDisplayList(){this._displayList=new me;for(const e of this.displayObjects)for(const t of e.displayRecords)this._displayList.addToList(t)}clone(){const e=new q;return this.displayObjects&&(e.displayObjects=this.displayObjects.map(t=>t.clone())),e}serialize(e){return ke(e,this.displayObjects),e}_deserializeObjects(e){const t=e.readInt32(),s=new Array(t),i=new Map;for(let r=0;r{const n=e.data[r];if(F(n)){const a=Gt.from(n.records).getCursor();for(;a.next();){const l=a.id,d=a.materialKey,h=a.indexFrom,c=a.indexCount,u=a.vertexFrom,p=a.vertexCount,f=i.get(l),m=new U(l,r,d);m.indexFrom=h,m.indexCount=c,m.vertexFrom=u,m.vertexCount=p,f.displayRecords.push(m)}s[r]=$.fromVertexData(n,r)}else s[r]=new rs(r,0,Ue.DEFAULT).intoBuffers()}),D.fromMeshData({displayObjects:t,vertexBuffersMap:s})}static fromMeshData(e){const t=new D,s=new q,i=new z;s.displayObjects=e.displayObjects;for(const r in e.vertexBuffersMap){const n=e.vertexBuffersMap[r];i.geometries[r].indexBuffer=n.indexBuffer,i.geometries[r].vertexBuffer=n.namedBuffers}return t.tileDisplayData=s,t.tileBufferData=i,t}static bind(e,t){const s=new D;return s.tileDisplayData=e,s.tileBufferData=t,s}static create(e,t){const s=new D;s.tileDisplayData=new q,s.tileDisplayData.displayObjects=e;const i=[0,0,0,0,0],r=[0,0,0,0,0],n=[[],[],[],[],[]];for(const d of e)for(const h of d.displayRecords)n[h.geometryType].push(h),i[h.geometryType]+=h.meshData.vertexCount,r[h.geometryType]+=h.meshData.indexData.length;const a=new z,l=as(t);for(let d=0;di?[b([o[0],o[1],i,o[3]]),b([s,o[1],s+o[2]-i,o[3]])]:o[0]!!a.geometry);for(const a of n){const l=fe(a.geometry);qe(r,[a],l,!1,!1,t)}return new ie(i,r,s)}get geometryType(){const e=this._current;return e?e.geometryType:null}get insertAfter(){return this._current.insertAfter}readGraphic(){return this._current}getCursor(){return this.copy()}copy(){const e=new ie(this.instance,this._features,this._transform);return this.copyInto(e),e}}const V=new Ge,le=new Ge,Me="esriGeometryPolyline";function Le(o){o.coords.length=0,o.lengths.length=0}class R{constructor(){this.bounds=b(),this.graphic=null}static acquire(e=null,t,s,i,r){let n;return R._pool.length===0?n=new R:(n=R._pool.pop(),this._set.delete(n)),n.acquire(e,t,s,i,r),n}static release(e){e&&!this._set.has(e)&&(e.release(),this._pool.push(e),this._set.add(e))}static getCentroidQuantized(e,t){if(de(e.geometry)){const s=e.symbol;if(A(s))return null;if((s==null?void 0:s.layers.length)>0&&s.layers.some(i=>i.type==="text"||i.type==="marker")){const i=He(e.geometry);return i!==null?Zt(t,{},{x:i[0],y:i[1]},!1,!1):null}}return null}acquire(e=null,t,s,i,r){e&&this.set(e,t,s,i,r)}release(){this.graphic=null,this.symbolResource=null,this.geometry=null}get symbol(){return this.symbolResource.symbol}set(e,t,s,i,r){this.graphic=e,this.geometry=s,this.symbolResource=t,this.bounds=i,r&&(this.size=r)}getGeometryQuantized(e,t,s,i){const r=this.geometry,n=fe(r);if(A(n))return null;switch(n){case"esriGeometryPolygon":{const a=r,{rings:l}=a;if(!l||l.length===0)return null;let d;if(d=l.length===1&&l[0].length===2?P(e,{paths:[[l[0][0],l[0][1]]]}):P(e,this.geometry),!d){const h={x:l[0][0][0],y:l[0][0][1]};if(d=P(e,h),d){const{x:c,y:u}=d;return{rings:[[[c-1,u],[1,-1],[1,1],[-1,1],[-1,-1]]]}}}return d}case"esriGeometryPolyline":{const a=r;return Le(V),Le(le),Ne(V,a),Ze(le,V,a.hasZ,a.hasM,Me,e.scale[0]),Qe(V,le,a.hasZ,a.hasM,Me,e),Ye(V,a.hasZ,a.hasM)}case"esriGeometryMultipoint":{const a=r,l=.5*i*Math.max(Math.abs(this.size[0])+this.size[2]-this.size[0],Math.abs(this.size[1])+this.size[3]-this.size[1]),d=E(s);let h=a.points;if(d){const[c,u]=d.valid,p=u-c;h=h.filter(f=>{if(f[0]+l>u||f[0]-lu?m[0]-=p:m[0]+=p,ne(t,f,l)||ne(t,m,l)}return ne(t,f,l)})}return h.length===0?{points:h}:P(e,{points:h})}}return P(e,this.geometry)}}R._pool=[],R._set=new Set;const j={minX:0,minY:0,maxX:0,maxY:0},L=b(),Ae=1e-5;function W(o,e,t,s,i){return j.minX=e,j.minY=t,j.maxX=s,j.maxY=i,o.search(j)}function fs(o){return{minX:o.bounds[0],minY:o.bounds[1],maxX:o.bounds[2],maxY:o.bounds[3]}}class ps{constructor(e,t,s,i,r,n,a){this._graphics=i,this._onAdd=r,this._onRemove=n,this._hashToCIM=a,this._index=We(9,fs),this._itemByGraphic=new Map,this._inflatedSizeHelper=new Ce,this._tileInfoView=e,this._uidFieldName=s;const l=e.getClosestInfoForScale(t);l&&(this._resolution=this._tileInfoView.getTileResolution(l.level))}setResourceManager(e){this._cimResourceManager=e,this._hittestDrawHelper=new vt(e)}hitTest(e,t,s,i,r){e=Oe(e,this._tileInfoView.spatialReference);const n=.5*i*window.devicePixelRatio*s;L[0]=e-n,L[1]=t-n,L[2]=e+n,L[3]=t+n;const a=.5*i*(s+T),l=W(this._index,e-a,t-a,e+a,t+a);if(!l||l.length===0)return[];const d=[],h=b(),c=b();for(const f of l){const{geometry:m,symbolResource:_}=f;this._getSymbolBounds(h,_,m,c,r),c[3]=c[2]=c[1]=c[0]=0,Xe(h,L)&&f.graphic.visible&&d.push(f)}if(d.length===0)return[];const u=this._hittestDrawHelper,p=[];for(const f of d){const{geometry:m,symbolResource:_}=f,{hash:y,textInfo:S}=_,H=this._hashToCIM.get(y);H&&u.hitTest(L,H.symbol,m,S,r,i)&&p.push(f)}return p.sort(ms),p.map(f=>f.graphic)}getGraphicsData(e,t,s){const i=this._searchForItems(t);if(i.length===0||s.length===0)return[];i.sort((c,u)=>c.zorder-u.zorder),i[0].insertAfter=-1;for(let c=1;cc.graphic.uid-u.graphic.uid),s.sort((c,u)=>c.uid-u.uid);let r,n=0,a=0;const l=t.resolution,d=[],h={originPosition:"upperLeft",scale:[l,l],translate:[t.bounds[0],t.bounds[3]]};for(const c of s){for(a=-2;nc.zorder-u.zorder),d}queryTileData(e,t){if(this._graphics.length===0)return[];const{bounds:s,resolution:i}=t,r=this._searchForItems(t),n=[];return r.length===0||this._createTileGraphics(n,e,r,{originPosition:"upperLeft",scale:[i,i],translate:[s[0],s[3]]},t),n}has(e){return this._itemByGraphic.has(e)}getBounds(e){const t=this._itemByGraphic.get(e);return t?t.bounds:null}getAllBounds(){return Array.from(this._itemByGraphic.values()).filter(e=>e.graphic.visible).map(e=>e.bounds)}addOrModify(e,t,s){if(!e||A(t))return;this.has(e)&&this.remove(e),this._onAdd(e);const i=[0,0,0,0],r=this._getSymbolBounds(null,t,s,i,0),n=R.acquire(e,t,s,F(r)?r:null,i);return this._itemByGraphic.set(e,n),s&&this._index.insert(n),n.bounds}remove(e){if(!this._itemByGraphic.has(e))return;this._onRemove(e);const t=this._itemByGraphic.get(e);t.bounds&&this._index.remove(t),this._itemByGraphic.delete(e)}updateZ(){const e=this._graphics.items;let t,s;for(let i=0;if.zorder-m.zorder);for(let f=0;f{const t=Ie(o.graphic),s=Ie(e.graphic);return t===s?e.zorder-o.zorder:t-s},gs=o=>{let e=class extends tt(o){constructor(){super(...arguments),this.graphics=null,this.renderer=null}};return v([C()],e.prototype,"graphics",void 0),v([C()],e.prototype,"renderer",void 0),v([C()],e.prototype,"updating",void 0),v([C()],e.prototype,"view",void 0),e=v([$e("esri.views.layers.GraphicsView")],e),e},ys=st("esri-2d-graphic-debug");function he(o,e,t){if(t.has(o))return t.get(o);const s={tile:e,addedOrModified:[],removed:[]};return t.set(o,s),s}let w=class extends gs(it(ft)){constructor(o){super(o),this._storage=new Ht,this._displayIds=new Map,this._controller=new AbortController,this._tiles=new Map,this._graphicStoreUpdate=!1,this._graphicsSet=new Set,this._matcher=Promise.resolve(null),this._tileUpdateSet=new Set,this._tilesToUpdate=new Map,this._graphicIdToAbortController=new Map,this._attached=!1,this._updatingGraphicsTimer=null,this._hashToExpandedSymbol=new Map,this._hashToExpandedSymbolPromise=new Map,this._hashToCIMSymbolPromise=new Map,this._hashToCIM=new Map,this._processing=!1,this._needsProcessing=!1,this._pendingUpdate={added:new Set,updated:new Set,removed:new Set},this.lastUpdateId=-1,this.updateRequested=!1,this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this._updatingGraphicsTimer&&(clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=null,this.notifyChange("updating")),this._controller.abort(),this.container.destroy(),this._set("graphics",null),this._graphicStore.clear(),this._attributeStore=null,this._hashToExpandedSymbol.clear(),this.view=null,this.renderer=null,this._hashToCIM.clear(),this._hashToCIMSymbolPromise.clear(),this._hashToExpandedSymbolPromise.clear()}_createMatcher(o,e,t){if(o){const s=we(o),i=Kt({indexCount:0,fields:{}},"feature",o,s);this._matcher=Ut(i,e,null,t)}}_createDisplayId(o){return this._displayIds.has(o)||this._displayIds.set(o,this._storage.createDisplayId()),this._displayIds.get(o)}initialize(){this._attributeStore=new Nt({type:"local",initialize:i=>Promise.resolve(this.container.attributeView.initialize(i)),update:i=>this.container.attributeView.requestUpdate(i),render:()=>this.container.requestRender()},rt("2d"),()=>this.notifyChange("updating")),this.container.hasHighlight=()=>this._attributeStore.hasHighlight;const o=i=>{this._createDisplayId(i.uid),this._setFilterState(i.uid,i.visible)},e=i=>{const r=this._displayIds.get(i.uid);this._displayIds.delete(i.uid),this._storage.releaseDisplayId(r)},t=new Pt(this.container.getMaterialItems.bind(this.container),this.view.featuresTilingScheme.tileInfo);this._graphicStore=new ps(this.view.featuresTilingScheme,this.view.state.scale,this.uid,this.graphics,o,e,this._hashToCIM),this._meshFactory=new Vt(null,this.uid,t),this._templateStore=t,this.handles.add([nt(()=>this.renderer,i=>{this._createMatcher(i,t,this.container.stage.resourceManager);for(const r of this.graphics)this._pendingUpdate.updated.add(r);this.requestUpdate()}),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{ys&&this.container.enableRenderingBounds(()=>this._graphicStore.getAllBounds()),this.graphics.items.length>0&&this._graphicsChangeHandler({target:this.graphics,added:this.graphics.items,removed:[],moved:[]}),this.handles.add(this.graphics.on("change",r=>this._graphicsChangeHandler(r)),"graphics");const i=this.container.stage.resourceManager;this._createMatcher(this.renderer,t,i),this._graphicStore.setResourceManager(i),this._attached=!0,this.notifyChange("updating")})]);const s=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:s,removed:[]})}get updating(){return!this._attached||this._updatingGraphicsTimer!==null||this._tileUpdateSet.size>0||this._tilesToUpdate.size>0||this._attributeStore.isUpdating()}hitTest(o){if(!this.view||!this.view.position)return[];const{resolution:e,rotation:t}=this.view.state;return this._graphicStore.hitTest(o.x,o.y,2,e,t)}update(o){x(this._controller.signal);const e=o.state,{resolution:t}=e;if(this._graphicStore.updateLevel(t),this._graphicStoreUpdate=!0,this.updateRequested=!1,this._pendingUpdate.updated.size>0){if(!this._processing)return void this._updateGraphics();this._needsProcessing=!0}}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback())}processUpdate(o){this.updateRequested&&(this.updateRequested=!1,this.update(o))}graphicUpdateHandler(o){const{graphic:e,property:t}=o;switch(t){case"attributes":case"geometry":case"symbol":this._pendingUpdate.updated.add(e),this.requestUpdate();break;case"visible":this._setFilterState(e.uid,e.visible),this._attributeStore.sendUpdates()}}setHighlight(o){const e=o.map(t=>this._displayIds.get(t));this._attributeStore.setHighlight(o,e)}_getIntersectingTiles(o){const e=this._graphicStore.getBounds(o);if(!e||ot(e)===0||at(e)===0)return[];const t=hs(e,this.view.spatialReference);return F(t)?[...new Set([...this.view.graphicsTileStore.boundsIntersections(t[0]),...this.view.graphicsTileStore.boundsIntersections(t[1])])]:this.view.graphicsTileStore.boundsIntersections(e)}async _updateTile(o){x(this._controller.signal);const e=o.tile,t=this._getGraphicsData(this._templateStore,e,o.addedOrModified),s=await this._processGraphics(e,t);return x(this._controller.signal),this._patchTile(e.key,{type:"update",addOrUpdate:s,remove:o.removed,end:!0,clear:!1,sort:!1}),s}_patchTile(o,e){if(!this._tiles.has(o))return;const t=this._tiles.get(o);this.container.onTileData(t,e),this.container.requestRender()}_graphicsChangeHandler(o){const e=this._pendingUpdate;for(const t of o.added)e.added.add(t);for(const t of o.moved)e.updated.add(t);for(const t of o.removed)this._pendingUpdate.added.has(t)?e.added.delete(t):e.removed.add(t);this._processing?this._needsProcessing=!0:this._updateGraphics()}_getGraphicsToUpdate(){const o={added:[],removed:[],updated:[]};if(!this.graphics)return o;const e=this._pendingUpdate;for(const t of this.graphics.items)e.added.has(t)?o.added.push(t):e.updated.has(t)&&o.updated.push(t);for(const t of e.removed)this._graphicStore.has(t)&&o.removed.push(t);return e.added.clear(),e.removed.clear(),e.updated.clear(),o}async _updateGraphics(){this._processing=!0;const{added:o,removed:e,updated:t}=this._getGraphicsToUpdate(),s=this._tilesToUpdate;let i;try{if(!this._graphicStoreUpdate){const h=this.view.state,{resolution:c}=h;this._graphicStore.updateLevel(c)}const r=[],n=new Array(o.length+e.length);for(let h=0;h({name:t,alias:t,type:typeof o.attributes[t]=="string"?"esriFieldTypeString":"esriFieldTypeDouble"}));return A(o.geometry)?null:{geometryType:fe(o.geometry),spatialReference:lt.fromJSON(o.geometry.spatialReference),fields:e}}_getSymbolForGraphic(o,e){return x(this._controller.signal),F(o.symbol)?Promise.resolve(o.symbol):F(this.renderer)?this.renderer.getSymbolAsync(o,{scale:this.view.scale,signal:F(e)?e.signal:null}):Promise.resolve(this._getNullSymbol(o))}_getCIMSymbol(o,e,t){let s=this._hashToCIM.get(e);if(s)return Promise.resolve(s);const i=bt(o);if(F(i)){if(i.type==="CIMSymbolReference")return s=i,this._hashToCIM.set(e,s),Promise.resolve(s);let r=this._hashToCIMSymbolPromise.get(e);return r||(r=i.fetchCIMSymbol(t).then(n=>(this._hashToCIM.set(e,n.data),this._hashToCIMSymbolPromise.delete(e),n)).catch(n=>(this._hashToCIMSymbolPromise.delete(e),_e(n),null)),this._hashToCIMSymbolPromise.set(e,r),r)}return Promise.resolve(null)}_expandCIMSymbol(o,e,t,s){const i=this._hashToExpandedSymbol.get(t);if(i)return Promise.resolve(i);let r=this._hashToExpandedSymbolPromise.get(t);if(r)return r;const n=this.container.stage,a=this._getArcadeInfo(e),l=we(null),d=Qt(o,l);return r=jt(d,a,n.resourceManager,s),this._hashToExpandedSymbolPromise.set(t,r),r.then(h=>(this._hashToExpandedSymbol.set(t,h),this._hashToExpandedSymbolPromise.delete(t),h)),r}async _getSymbolResources(o,e){return x(this._controller.signal),this.container.stage?this._getSymbolForGraphic(o,e).then(t=>{const s=t.hash();return this._getCIMSymbol(t,s,e).then(i=>A(i)?null:this._expandCIMSymbol(i,o,s,e).then(r=>{const n=r.layers.filter(a=>a.type==="text"&&typeof a.text=="string");if(n&&n.length>0){const a=new Array(n.length);for(let d=0;d{for(let h=0;h(_e(t),null)):null}async _projectAndNormalizeGeometry(o,e){if(x(this._controller.signal),A(o.geometry)||o.geometry.type==="mesh")return null;let t=o.geometry;if(de(t)){const r=t.rings;t.rings=r}else if(xe(t)){const r=t.paths;t.paths=r}else if(ve(t)){const r=await this._getSymbolForGraphic(o,e);x(this._controller.signal),cs(r.type)||ds(r.type)?t=t.center:t=us(t)}await Bt(t.spatialReference,this.view.spatialReference);const s=Ct(t),i=wt(s,t.spatialReference,this.view.spatialReference);return i&&ht(i),i}_onTileUpdate(o){const e=E(this.view.spatialReference);if(o.added&&o.added.length>0)for(const t of o.added)this._addNewTile(t,e);if(o.removed&&o.removed.length>0)for(const t of o.removed)this._removeTile(t.key)}async _addGraphic(o){this._abortProcessingGraphic(o.uid),x(this._controller.signal);const e=new AbortController;this._graphicIdToAbortController.set(o.uid,e);const t={signal:e.signal};try{await this._addOrUpdateGraphic(o,t),x(this._controller.signal),this._graphicIdToAbortController.delete(o.uid)}catch(s){if(this._graphicIdToAbortController.delete(o.uid),!Z(s))throw s}}_updateGraphic(o,e){x(this._controller.signal);const t=this._projectAndNormalizeGeometry(o,e),s=this._getSymbolResources(o,e);return Promise.all([t,s]).then(([i,r])=>{x(this._controller.signal),this._graphicStore.addOrModify(o,r,i)})}_addOrUpdateGraphic(o,e){x(this._controller.signal);const t=this._projectAndNormalizeGeometry(o,e),s=this._getSymbolResources(o,e);return Promise.all([t,s]).then(([i,r])=>{x(this._controller.signal),this._graphicsSet.has(o)&&this._graphicStore.addOrModify(o,r,i)})}_addTile(o){const e=this.view.featuresTilingScheme.getTileBounds(b(),o),t=this.view.featuresTilingScheme.getTileResolution(o.level),s=new ts(o,t,e[0],e[3]);return this._tiles.set(o,s),this.container.addChild(s),s}async _addNewTile(o,e){const t=this._addTile(o.key),s=this._graphicStore.queryTileData(this._templateStore,o);if(s.length===0)return;if(e){const r=Math.round((e.valid[1]-e.valid[0])/o.resolution);for(const n of s)n.geometry&&(be(n.geometry)||oe(n.geometry))&&this._wrapPoints(n,r)}const i=o.key;this._tileUpdateSet.add(o.key),this.notifyChange("updating");try{const r={type:"update",clear:!1,addOrUpdate:await this._processGraphics(o,s),remove:[],end:!0,sort:!1};t.patch(r),this._tileUpdateSet.delete(i),this.notifyChange("updating")}catch(r){if(this._tileUpdateSet.delete(i),this.notifyChange("updating"),!Z(r))throw r}}_removeTile(o){if(!this._tiles.has(o))return;const e=this._tiles.get(o);this.container.removeChild(e),e.destroy(),this._tiles.delete(o)}_setFilterState(o,e){const t=this._displayIds.get(o),s=this._attributeStore.getHighlightFlag(o);this._attributeStore.setData(t,0,0,s|(e?Tt:0))}_getGraphicsData(o,e,t){const s=this.view,i=E(s.spatialReference),r=this._graphicStore.getGraphicsData(o,e,t);if(i){const n=Math.round((i.valid[1]-i.valid[0])/e.resolution);for(const a of r)a.geometry&&(be(a.geometry)||oe(a.geometry))&&this._wrapPoints(a,n)}return r}_wrapPoints(o,e){const t=o.geometry;oe(t)?this._wrapMultipoint(t,e):this._wrapPoint(o,e)}_wrapMultipoint(o,e){const t=o.points,s=[];let i=0,r=0;for(const[n,a]of t){if(s.push([n+i,a]),i=0,e===M){const l=5*T;n+rM-l&&(s.push([-e,0]),i=e)}else n+r<-T?(s.push([e,0]),i=-e):n+r>M+T&&(s.push([-e,0]),i=e);r+=n}o.points=s}_wrapPoint(o,e){const t=o.geometry;if(e===M){const s=5*T;t.xM-s&&(o.geometry={points:[[t.x,t.y],[-e,0]]})}else t.x<-T?o.geometry={points:[[t.x,t.y],[e,0]]}:t.x>M+T&&(o.geometry={points:[[t.x,t.y],[-e,0]]})}_processGraphics(o,e,t){if(!(e&&e.length)||!this._meshFactory)return null;const s=ie.from(e,this.uid,o.transform),i=this._meshFactory;return this._matcher.then(r=>i.analyzeGraphics(s,this.container.stage.resourceManager,r,null,null,t).then(()=>(this._attributeStore.sendUpdates(),this._processAnalyzedGraphics(o,s))))}_processAnalyzedGraphics(o,e){const t=this._meshFactory,s=e.getSize(),i=e.getCursor(),r={features:s,records:s,metrics:0},n=new kt(o.key.id,r,Ue.DEFAULT,!1,!1),a=[];for(;i.next();){const c=i.readGraphic();c.insertAfter=c.insertAfter===-1?-1:this._displayIds.get(c.insertAfter),c.displayId=this._displayIds.get(c.attributes[this.uid]);const u=new G(c.displayId);u.insertAfter=c.insertAfter,a.push(u),t.writeGraphic(n,i,o.level,this.container.stage.resourceManager)}const l=o.tileInfoView.tileInfo.isWrappable,d=n.serialize(l);if(d.length!==1)return new D;const h=d[0].message;return D.fromVertexData(h,a)}_abortProcessingGraphic(o){this._graphicIdToAbortController.has(o)&&this._graphicIdToAbortController.get(o).abort()}_getNullSymbol(o){const e=o.geometry;return xe(e)?dt:de(e)||ve(e)?ct:ut}_flipUpdatingGraphics(){this._updatingGraphicsTimer&&clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=setTimeout(()=>{this._updatingGraphicsTimer=null,this.notifyChange("updating")},160),this.notifyChange("updating")}};v([C({constructOnly:!0})],w.prototype,"requestUpdateCallback",void 0),v([C()],w.prototype,"container",void 0),v([C({constructOnly:!0})],w.prototype,"graphics",void 0),v([C()],w.prototype,"updating",null),v([C()],w.prototype,"view",void 0),v([C()],w.prototype,"updateRequested",void 0),w=v([$e("esri.views.2d.layers.support.GraphicsView2D")],w);const Us=w,_s=Math.PI/180,xs=4;class vs extends Wt{constructor(e){super(),this._dvsMat3=De(),this._localOrigin={x:0,y:0},this._getBounds=e}destroy(){this._vao&&(this._vao.dispose(!0),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program&&(this._program.dispose(),this._program=null)}doRender(e){const{context:t}=e,s=this._getBounds();if(s.length<1)return;this._createShaderProgram(t),this._updateMatricesAndLocalOrigin(e),this._updateBufferData(t,s),t.setBlendingEnabled(!0),t.setDepthTestEnabled(!1),t.setStencilWriteMask(0),t.setStencilTestEnabled(!1),t.setBlendFunction(Be.ONE,Be.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0);const i=this._program;t.bindVAO(this._vao),t.useProgram(i),i.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),t.gl.lineWidth(1),t.drawElements(Lt.LINES,8*s.length,Ve.UNSIGNED_INT,0),t.bindVAO()}_createTransforms(){return{dvs:De()}}_createShaderProgram(e){if(this._program)return;const t=`precision highp float; +import{c as F,ax as E,ay as b,az as Ke,u as Ee,aA as fe,aB as qe,aC as de,j as A,aD as He,aE as ne,aF as Ne,aG as Ze,aH as Qe,aI as Ye,aJ as Ge,aK as We,aL as Oe,aM as Xe,aN as Je,aO as et,I as N,aP as tt,a6 as v,a7 as C,a8 as $e,m as st,a4 as it,aQ as rt,_ as nt,v as x,aR as ot,aS as at,x as Z,aT as lt,aU as _e,aV as xe,aW as ve,aX as ht,aY as be,aZ as oe,a_ as dt,a$ as ct,b0 as ut,a9 as ft,N as De,b1 as pt,b2 as mt,S as gt,b3 as yt,Q as _t,R as xt}from"./index.221827cd.js";import{d as Ce,V as vt,Q as bt,n as Dt}from"./ExpandedCIM.a372ce74.js";import{p as Ct}from"./normalizeUtilsSync.4d52fbd0.js";import{f as Bt,g as wt}from"./projectionSupport.4f5da4af.js";import{U as Tt}from"./enums.0295eb81.js";import{K as pe,X,c as ce,i as Ft,s as Rt,W as ee,G as St,h as It,S as Ue,g as Mt}from"./Utils.2136650a.js";import{a as Pe,E as te}from"./VertexArrayObject.53cf1857.js";import{F as ue,R as Be,E as Lt,C as Ve,I as At}from"./enums.2d9e6f64.js";import{m as zt,i as Gt,o as Ot}from"./FeatureContainer.b427dd87.js";import{U as $t}from"./MaterialKey.0cadabc1.js";import{a as J,l as Ut,x as Pt,b as Vt,n as jt,E as kt}from"./Matcher.6586928a.js";import{w as we,$ as Kt}from"./schemaUtils.d20994fa.js";import{c as Et,b as qt,r as Ht,v as Nt}from"./ComputedAttributeStorage.29767acd.js";import{O as Zt,U as P}from"./quantizationUtils.7ff797cc.js";import{createSymbolSchema as Qt}from"./createSymbolSchema.827eb617.js";import{r as Yt}from"./vec3f32.1121a836.js";import{r as Wt}from"./utils.0160becb.js";const g=-1;class Te{constructor(){this._dirties=[{vertexFrom:g,vertexCount:g,indexFrom:g,indexCount:g,allDirty:!1},{vertexFrom:g,vertexCount:g,indexFrom:g,indexCount:g,allDirty:!1},{vertexFrom:g,vertexCount:g,indexFrom:g,indexCount:g,allDirty:!1},{vertexFrom:g,vertexCount:g,indexFrom:g,indexCount:g,allDirty:!1},{vertexFrom:g,vertexCount:g,indexFrom:g,indexCount:g,allDirty:!1}]}hasDirty(){return this._dirties.some(e=>e.indexCount!==g||e.allDirty)}markAllClean(){for(const e of this._dirties)e.indexFrom=g,e.indexCount=g,e.vertexFrom=g,e.vertexCount=g,e.allDirty=!1}markAllDirty(){for(const e of this._dirties)e.allDirty=!0}forEach(e){for(let t=0;t0)&&(l.geometry={count:r,from:n,allDirty:a},h=!0),(a||i!==g&&s>0)&&(d={count:s,from:i,allDirty:a},h=!0),h&&e({indices:d,vertices:l},t)}}markDirtyIndices(e,t,s){const i=this._dirties[e],r=t,n=s;if(!i.allDirty)if(i.indexCount!==g){const a=Math.min(i.indexFrom,r),l=Math.max(i.indexFrom+i.indexCount,r+n)-a;i.indexFrom=a,i.indexCount=l}else i.indexFrom=r,i.indexCount=n}markDirtyVertices(e,t,s,i){const r=this._dirties[e],n=s,a=i;if(!r.allDirty)if(r.vertexCount!==g){const l=Math.min(r.vertexFrom,n),d=Math.max(r.vertexFrom+r.vertexCount,n+a)-l;r.vertexFrom=l,r.vertexCount=d}else r.vertexFrom=n,r.vertexCount=a}}class Xt{constructor(e){this._largestRange=null,this._parent=e,this._updateLargestRange()}get largestRange(){return this._largestRange}rangeCreated(e){(!this._largestRange||e.count>this._largestRange.count)&&(this._largestRange=e)}rangeResized(e,t){e===this._largestRange?e.countthis._largestRange.count)&&(this._largestRange=e)}findBestRange(e){let t=this._parent._freeHead,s=null;for(;t!==null;)t.count>=e&&(!s||t.count-e=a&&e+t<=l?(s=!1,i=!0):n!==null?(r=n,n=n.next):s=!1}return[r,n]}_updateLargestRange(){let e=null,t=this._parent._freeHead;for(;t!==null;)(!e||t.count>e.count)&&(e=t),t=t.next;this._largestRange=e}}class B{constructor(e,t){this._allocated=0,this._size=e,this._freeHead=e>0?{from:0,count:e,prev:null,next:null}:null,this._bookKeeper=t||new Xt(this),this._freeHead&&this._bookKeeper.rangeCreated(this._freeHead)}allocate(e){const t=this._bookKeeper.findBestRange(e);if(t===null)return-1;const s=t.from,i=t.count;if(t.from+=e,t.count-=e,this._bookKeeper.rangeResized(t,s,i),this._allocated+=e,t.count===0){const r=t.prev!==null?this._freeHead:t.next;B._removeRange(t),this._freeHead=r}return s}free(e,t){const[s,i]=this._bookKeeper.findAdjacentRanges(e,t),r={from:e,count:t,prev:s,next:i};if(s!==null&&(s.next=r),i!==null&&(i.prev=r),this._bookKeeper.rangeCreated(r),this._allocated-=t,i!==null&&r.from+r.count===i.from){const n=r.from,a=r.count;B._fuse(r,i),B._removeRange(i),this._bookKeeper.rangeResized(r,n,a),this._bookKeeper.rangeResized(i,void 0,0)}if(s!==null&&s.from+s.count===r.from){const n=s.from,a=s.count;B._fuse(s,r),B._removeRange(r),this._bookKeeper.rangeResized(s,n,a),this._bookKeeper.rangeResized(r,void 0,0)}this._freeHead=r.prev!==null?this._freeHead:r}get fragmentation(){const e=this._size-this._allocated;return e===0?0:1-this._bookKeeper.largestRange.count/e}static _removeRange(e){e.prev!==null?e.next!==null?(e.prev.next=e.next,e.next.prev=e.prev):e.prev.next=null:e.next!==null&&(e.next.prev=null)}static _fuse(e,t){e.count+=t.count,e.next=t.next,t.from+=t.count,t.count=0,t.next!==null&&(t.next.prev=e)}}const k=["FILL","LINE","MARKER","TEXT","LABEL"];function Jt(o){const e=o.getStrides(),t={};for(let s=0;se.vertexCount?(this._freeVertices(n,e.vertexFrom,e.vertexCount),l=t.vertexCount,a=this._allocateVertices(n,l)):t.vertexCount===e.vertexCount?(a=e.vertexFrom,l=e.vertexCount):(this._freeVertices(n,e.vertexFrom+t.vertexCount,e.vertexCount-t.vertexCount),a=e.vertexFrom,l=t.vertexCount);let d,h,c,u=!0;if(e.indexFrom===void 0?(d=r,c=t.indexCount,h=this._allocateIndices(n,c)):t.indexCount>e.indexCount?(d=this._displayList.removeFromList(e),this._freeIndices(n,e.indexFrom,e.indexCount),c=t.indexCount,h=this._allocateIndices(n,c)):t.indexCount===e.indexCount?(u=!1,h=e.indexFrom,c=e.indexCount):(d=this._displayList.removeFromList(e),this._freeIndices(n,e.indexFrom+t.indexCount,e.indexCount-t.indexCount),h=e.indexFrom,c=t.indexCount),a!==-1&&h!==-1){const p=this._storageFor(n);if(ce(a,h,p.vertexBuffers,p.indexBuffer,t,s,i),e.vertexFrom=a,e.indexFrom=h,e.vertexCount=t.vertexCount,e.indexCount=t.indexCount,this._dirtyMap){this._dirtyMap.markDirtyIndices(e.geometryType,e.indexFrom,e.indexCount);for(const f in s)this._dirtyMap.markDirtyVertices(e.geometryType,f,e.vertexFrom,e.vertexCount)}return u&&this._displayList.addToList(e,d),!0}return a!==-1&&this._freeVertices(n,a,l),h!==-1&&this._freeIndices(n,h,c),e.setMeshDataFromBuffers(t,s,i),e.vertexFrom=void 0,e.vertexCount=0,e.indexFrom=void 0,e.indexCount=0,!1}tryAddMeshData(e,t){const s=t.vertexBuffer,i=t.indexBuffer,r=k[e.geometryType],n=this._allocateVertices(r,e.vertexCount);if(n===-1)return this._freeVertices(r,n,e.vertexCount),!1;const a=this._allocateIndices(r,e.indexCount);if(a===-1)return this._freeVertices(r,n,e.vertexCount),this._freeIndices(r,a,e.indexCount),!1;const l=this._storageFor(r);if(ce(n,a,l.vertexBuffers,l.indexBuffer,e,s,i),e.vertexFrom=n,e.indexFrom=a,this._dirtyMap){this._dirtyMap.markDirtyIndices(e.geometryType,e.indexFrom,e.indexCount);for(const d in s)this._dirtyMap.markDirtyVertices(e.geometryType,d,n,e.vertexCount)}return this._displayList.addToList(e),!0}_allocateVertices(e,t){const s=this._storageFor(e),i=s.vtxFreeList.allocate(t);return i===-1||s.vtxFreeList.fragmentation>Fe?-1:i}_freeVertices(e,t,s){this._storageFor(e).vtxFreeList.free(t,s)}_freeIndices(e,t,s){this._storageFor(e).idxFreeList.free(t,s)}_allocateIndices(e,t){const s=this._storageFor(e),i=s.idxFreeList.allocate(t);return i===-1||s.idxFreeList.fragmentation>Fe?-1:i}_storageFor(e){return this._freeListsAndStorage[e]}_stridesFor(e,t){return this._strides[e][t]}}class es{constructor(e){this.geometryMap=Ft(()=>({indexBuffer:te.createIndex(e,ue.STATIC_DRAW),vao:null}),(t,s)=>({vertexBuffer:te.createVertex(e,Rt[s])}))}dispose(){for(let e=0;e<5;e++){const t=this.geometryMap[e];if(t){t.data.vao&&t.data.vao.dispose(!1),t.data.indexBuffer&&t.data.indexBuffer.dispose();for(const s in t.buffers)t.buffers[s]&&t.buffers[s].data.vertexBuffer.dispose()}}}get(e){const t=this.geometryMap[e];return{getVAO(s,i,r){if(!t.data.vao){const n={};for(const a in t.buffers)n[a]=t.buffers[a].data.vertexBuffer;t.data.vao=new Pe(s,r,i,n,t.data.indexBuffer)}return t.data.vao}}}has(e){return this.geometryMap[e]!=null}upload(e,t){t.forEach((s,i)=>{this._upload(s,i,e)})}_upload(e,t,s){if(e.indices&&(e.indices.allDirty?this._uploadIndices(s,t):e.indices.from!=null&&e.indices.count!=null&&this._uploadIndices(s,t,e.indices.from,e.indices.count)),e.vertices){const i=e.vertices;for(const r in i){const n=i[r];n.allDirty?this._uploadVertices(s,t,r):n.from!=null&&n.count!=null&&this._uploadVertices(s,t,r,n.from,n.count)}}}_uploadVertices(e,t,s,i,r){const n=this.geometryMap[t];if(!n)return;const a=e.geometries[t].vertexBuffer[s];if(!a)return;const{data:l,stride:d}=a;if(n.buffers[s]&&l.length>0){const h=d/l.BYTES_PER_ELEMENT;i!=null&&r!=null?n.buffers[s].data.vertexBuffer.setSubData(l,i*h,i*h,(i+r)*h):n.buffers[s].data.vertexBuffer.setData(l)}}_uploadIndices(e,t,s,i){const r=this.geometryMap[t];if(!r)return;const n=e.geometries[t].indexBuffer;r.data.indexBuffer&&n.length>0&&(s!=null&&i!=null?r.data.indexBuffer.setSubData(n,s,s,s+i):r.data.indexBuffer.setData(n))}}class ts extends zt{constructor(){super(...arguments),this._data=null,this._displayList=null,this._lastCommitTime=0,this._hasData=!1,this._invalidated=!1,this._wglBuffers=null,this._dirtyMap=new Te}destroy(){super.destroy(),this.clear()}get hasData(){return!!this._hasData}get displayObjects(){var e;return(e=this._displayObjects)!=null?e:[]}getGeometry(e){return this._wglBuffers&&this._wglBuffers.has(e)?this._wglBuffers.get(e):null}getDisplayList(){return this._displayList}patch(e){if(e.clear===!0)return this.clear(),void(this._hasData=!1);const t=e.addOrUpdate,s=e.remove;!this._data&&t&&t.tileDisplayData.displayObjects.length?(t.tileDisplayData.computeDisplayList(),this._dirtyMap=new Te,this._dispRecStore=se.fromTileData(t,this._dirtyMap),this._data=t,this._dirtyMap.markAllDirty(),this._hasData=!0,e.end&&this.ready()):this._data&&(t&&t.tileDisplayData.displayObjects.length||s.length)?this._doPatchData(e):e.end&&this.ready(),e.end&&!this._data&&this.clear(),this.requestRender(),this.emit("change")}commit(e){e.time&&e.time===this._lastCommitTime||(this._lastCommitTime=e.time,this.visible&&this._data&&(this._wglBuffers||(this._wglBuffers=new es(e.context)),(this._dirtyMap.hasDirty()||this._invalidated)&&(this._invalidated=!1,this._wglBuffers.upload(this._data.tileBufferData,this._dirtyMap),this._displayList=this._data.tileDisplayData.displayList.clone(),this._displayObjects=this._data.tileDisplayData.displayObjects.slice(),this._dirtyMap.markAllClean())))}clear(){this._data=null,this._displayList=null,this._dispRecStore=null,this._wglBuffers&&(this._wglBuffers.dispose(),this._wglBuffers=null)}_doPatchData(e){this._invalidated=!0,this._patchData(e)||(this._dirtyMap.markAllDirty(),this._data.reshuffle(),this._dispRecStore=se.fromTileData(this._data,this._dirtyMap)),this.requestRender()}_patchData(e){let t=!0;const s=e.addOrUpdate&&e.addOrUpdate.tileDisplayData&&e.addOrUpdate.tileDisplayData.displayObjects||[],i=(e.remove||[]).slice();for(const n of s)n.insertAfter!=null&&i.push(n.id);let r;i.length>0&&(r=new Set(i));for(const n of i){const a=this._data.tileDisplayData.displayObjectRegistry.get(n);if(a){this._data.tileDisplayData.displayList.removeFromList(a.displayRecords);for(const l of a.displayRecords)this._dispRecStore.delete(l);this._data.tileDisplayData.displayObjectRegistry.delete(n)}}r&&r.size&&(this._data.tileDisplayData.displayObjects=this._data.tileDisplayData.displayObjects.filter(n=>!r.has(n.id)));for(const n of s){let a,l=this._data.tileDisplayData.displayObjectRegistry.get(n.id);if(l){const h=l.displayRecords;l.set(n),l.displayRecords=h;const c=l.displayRecords.length;for(let u=0;u=n.displayRecords.length||p.geometryType!==f.geometryType||p.symbolLevel!==f.symbolLevel||p.zOrder!==f.zOrder||p.materialKey!==f.materialKey)&&(this._dispRecStore.delete(l.displayRecords[u]),u=0){const u=this._data.tileDisplayData.displayObjectRegistry.get(l.insertAfter);u?(h=c.indexOf(u)+1,h0?1:0;let p=0;for(let f=h-1;f>=0&&p=0&&pn.indexFrom&&i<=n.indexFrom+n.indexCount){if(i=0&&nl.indexFrom&&e.indexFromt.clone()),e.line=this.line&&this.line.map(t=>t.clone()),e.marker=this.marker&&this.marker.map(t=>t.clone()),e.text=this.text&&this.text.map(t=>t.clone()),e.label=this.label&&this.label.map(t=>t.clone()),e.unified=this.unified&&this.unified.map(t=>t.clone()),e}}class ge{constructor(){this.geometryDPInfo=new re}clone(){const e=new ge;return e.zLevel=this.zLevel,e.geometryDPInfo=this.geometryDPInfo.clone(),e}}class ye{constructor(){this.zLevels=[]}clone(){const e=new ye;e.symbolLevel=this.symbolLevel;for(const t of this.zLevels)e.zLevels.push(t.clone());return e}}class Re{constructor(){this.vertexData=new Map,this.vertexCount=0,this.indexData=[]}clear(){this.vertexData.clear(),this.vertexCount=0,this.indexData=[]}update(e,t,s){for(const i in e)this.vertexData.set(i,e[i]);for(const i in this.vertexData)e[i]===null&&this.vertexData.delete(i);this.vertexCount=t,this.indexData=s}}class U{constructor(e,t,s,i=0,r=0){this.id=e,this.geometryType=t,this.materialKey=s,this.minZoom=i,this.maxZoom=r,this.meshData=null,this.symbolLevel=0,this.zOrder=0,this.vertexFrom=0,this.vertexCount=0,this.indexFrom=0,this.indexCount=0}get sortKey(){return this._sortKey===void 0&&this._computeSortKey(),this._sortKey}clone(){return this.copy()}copy(){const e=new U(this.id,this.geometryType,this.materialKey);return e.vertexFrom=this.vertexFrom,e.vertexCount=this.vertexCount,e.indexFrom=this.indexFrom,e.indexCount=this.indexCount,e.zOrder=this.zOrder,e.symbolLevel=this.symbolLevel,e.meshData=this.meshData,e.minZoom=this.minZoom,e.maxZoom=this.maxZoom,e}setMeshDataFromBuffers(e,t,s){const i=new Re;for(const r in t){const n=t[r].stride,a=t[r].data,l=[],d=X(n);for(let h=0;ht.clone()),e.insertAfter=this.insertAfter,e}set(e){this.id=e.id,this.displayRecords=e.displayRecords,this.insertAfter=e.insertAfter}serialize(e){return e.push(this.id),ke(e,this.displayRecords),e}static deserialize(e){const t=e.readInt32(),s=new G(t),i={id:t};return s.displayRecords=ss(e,U,i),s}}class q{get displayObjectRegistry(){if(!this._displayObjectRegistry){this._displayObjectRegistry=new Map;for(const e of this.displayObjects)this._displayObjectRegistry.set(e.id,e)}return this._displayObjectRegistry}get displayList(){return this._displayList}computeDisplayList(){this._displayList=new me;for(const e of this.displayObjects)for(const t of e.displayRecords)this._displayList.addToList(t)}clone(){const e=new q;return this.displayObjects&&(e.displayObjects=this.displayObjects.map(t=>t.clone())),e}serialize(e){return ke(e,this.displayObjects),e}_deserializeObjects(e){const t=e.readInt32(),s=new Array(t),i=new Map;for(let r=0;r{const n=e.data[r];if(F(n)){const a=Gt.from(n.records).getCursor();for(;a.next();){const l=a.id,d=a.materialKey,h=a.indexFrom,c=a.indexCount,u=a.vertexFrom,p=a.vertexCount,f=i.get(l),m=new U(l,r,d);m.indexFrom=h,m.indexCount=c,m.vertexFrom=u,m.vertexCount=p,f.displayRecords.push(m)}s[r]=$.fromVertexData(n,r)}else s[r]=new rs(r,0,Ue.DEFAULT).intoBuffers()}),D.fromMeshData({displayObjects:t,vertexBuffersMap:s})}static fromMeshData(e){const t=new D,s=new q,i=new z;s.displayObjects=e.displayObjects;for(const r in e.vertexBuffersMap){const n=e.vertexBuffersMap[r];i.geometries[r].indexBuffer=n.indexBuffer,i.geometries[r].vertexBuffer=n.namedBuffers}return t.tileDisplayData=s,t.tileBufferData=i,t}static bind(e,t){const s=new D;return s.tileDisplayData=e,s.tileBufferData=t,s}static create(e,t){const s=new D;s.tileDisplayData=new q,s.tileDisplayData.displayObjects=e;const i=[0,0,0,0,0],r=[0,0,0,0,0],n=[[],[],[],[],[]];for(const d of e)for(const h of d.displayRecords)n[h.geometryType].push(h),i[h.geometryType]+=h.meshData.vertexCount,r[h.geometryType]+=h.meshData.indexData.length;const a=new z,l=as(t);for(let d=0;di?[b([o[0],o[1],i,o[3]]),b([s,o[1],s+o[2]-i,o[3]])]:o[0]!!a.geometry);for(const a of n){const l=fe(a.geometry);qe(r,[a],l,!1,!1,t)}return new ie(i,r,s)}get geometryType(){const e=this._current;return e?e.geometryType:null}get insertAfter(){return this._current.insertAfter}readGraphic(){return this._current}getCursor(){return this.copy()}copy(){const e=new ie(this.instance,this._features,this._transform);return this.copyInto(e),e}}const V=new Ge,le=new Ge,Me="esriGeometryPolyline";function Le(o){o.coords.length=0,o.lengths.length=0}class R{constructor(){this.bounds=b(),this.graphic=null}static acquire(e=null,t,s,i,r){let n;return R._pool.length===0?n=new R:(n=R._pool.pop(),this._set.delete(n)),n.acquire(e,t,s,i,r),n}static release(e){e&&!this._set.has(e)&&(e.release(),this._pool.push(e),this._set.add(e))}static getCentroidQuantized(e,t){if(de(e.geometry)){const s=e.symbol;if(A(s))return null;if((s==null?void 0:s.layers.length)>0&&s.layers.some(i=>i.type==="text"||i.type==="marker")){const i=He(e.geometry);return i!==null?Zt(t,{},{x:i[0],y:i[1]},!1,!1):null}}return null}acquire(e=null,t,s,i,r){e&&this.set(e,t,s,i,r)}release(){this.graphic=null,this.symbolResource=null,this.geometry=null}get symbol(){return this.symbolResource.symbol}set(e,t,s,i,r){this.graphic=e,this.geometry=s,this.symbolResource=t,this.bounds=i,r&&(this.size=r)}getGeometryQuantized(e,t,s,i){const r=this.geometry,n=fe(r);if(A(n))return null;switch(n){case"esriGeometryPolygon":{const a=r,{rings:l}=a;if(!l||l.length===0)return null;let d;if(d=l.length===1&&l[0].length===2?P(e,{paths:[[l[0][0],l[0][1]]]}):P(e,this.geometry),!d){const h={x:l[0][0][0],y:l[0][0][1]};if(d=P(e,h),d){const{x:c,y:u}=d;return{rings:[[[c-1,u],[1,-1],[1,1],[-1,1],[-1,-1]]]}}}return d}case"esriGeometryPolyline":{const a=r;return Le(V),Le(le),Ne(V,a),Ze(le,V,a.hasZ,a.hasM,Me,e.scale[0]),Qe(V,le,a.hasZ,a.hasM,Me,e),Ye(V,a.hasZ,a.hasM)}case"esriGeometryMultipoint":{const a=r,l=.5*i*Math.max(Math.abs(this.size[0])+this.size[2]-this.size[0],Math.abs(this.size[1])+this.size[3]-this.size[1]),d=E(s);let h=a.points;if(d){const[c,u]=d.valid,p=u-c;h=h.filter(f=>{if(f[0]+l>u||f[0]-lu?m[0]-=p:m[0]+=p,ne(t,f,l)||ne(t,m,l)}return ne(t,f,l)})}return h.length===0?{points:h}:P(e,{points:h})}}return P(e,this.geometry)}}R._pool=[],R._set=new Set;const j={minX:0,minY:0,maxX:0,maxY:0},L=b(),Ae=1e-5;function W(o,e,t,s,i){return j.minX=e,j.minY=t,j.maxX=s,j.maxY=i,o.search(j)}function fs(o){return{minX:o.bounds[0],minY:o.bounds[1],maxX:o.bounds[2],maxY:o.bounds[3]}}class ps{constructor(e,t,s,i,r,n,a){this._graphics=i,this._onAdd=r,this._onRemove=n,this._hashToCIM=a,this._index=We(9,fs),this._itemByGraphic=new Map,this._inflatedSizeHelper=new Ce,this._tileInfoView=e,this._uidFieldName=s;const l=e.getClosestInfoForScale(t);l&&(this._resolution=this._tileInfoView.getTileResolution(l.level))}setResourceManager(e){this._cimResourceManager=e,this._hittestDrawHelper=new vt(e)}hitTest(e,t,s,i,r){e=Oe(e,this._tileInfoView.spatialReference);const n=.5*i*window.devicePixelRatio*s;L[0]=e-n,L[1]=t-n,L[2]=e+n,L[3]=t+n;const a=.5*i*(s+T),l=W(this._index,e-a,t-a,e+a,t+a);if(!l||l.length===0)return[];const d=[],h=b(),c=b();for(const f of l){const{geometry:m,symbolResource:_}=f;this._getSymbolBounds(h,_,m,c,r),c[3]=c[2]=c[1]=c[0]=0,Xe(h,L)&&f.graphic.visible&&d.push(f)}if(d.length===0)return[];const u=this._hittestDrawHelper,p=[];for(const f of d){const{geometry:m,symbolResource:_}=f,{hash:y,textInfo:S}=_,H=this._hashToCIM.get(y);H&&u.hitTest(L,H.symbol,m,S,r,i)&&p.push(f)}return p.sort(ms),p.map(f=>f.graphic)}getGraphicsData(e,t,s){const i=this._searchForItems(t);if(i.length===0||s.length===0)return[];i.sort((c,u)=>c.zorder-u.zorder),i[0].insertAfter=-1;for(let c=1;cc.graphic.uid-u.graphic.uid),s.sort((c,u)=>c.uid-u.uid);let r,n=0,a=0;const l=t.resolution,d=[],h={originPosition:"upperLeft",scale:[l,l],translate:[t.bounds[0],t.bounds[3]]};for(const c of s){for(a=-2;nc.zorder-u.zorder),d}queryTileData(e,t){if(this._graphics.length===0)return[];const{bounds:s,resolution:i}=t,r=this._searchForItems(t),n=[];return r.length===0||this._createTileGraphics(n,e,r,{originPosition:"upperLeft",scale:[i,i],translate:[s[0],s[3]]},t),n}has(e){return this._itemByGraphic.has(e)}getBounds(e){const t=this._itemByGraphic.get(e);return t?t.bounds:null}getAllBounds(){return Array.from(this._itemByGraphic.values()).filter(e=>e.graphic.visible).map(e=>e.bounds)}addOrModify(e,t,s){if(!e||A(t))return;this.has(e)&&this.remove(e),this._onAdd(e);const i=[0,0,0,0],r=this._getSymbolBounds(null,t,s,i,0),n=R.acquire(e,t,s,F(r)?r:null,i);return this._itemByGraphic.set(e,n),s&&this._index.insert(n),n.bounds}remove(e){if(!this._itemByGraphic.has(e))return;this._onRemove(e);const t=this._itemByGraphic.get(e);t.bounds&&this._index.remove(t),this._itemByGraphic.delete(e)}updateZ(){const e=this._graphics.items;let t,s;for(let i=0;if.zorder-m.zorder);for(let f=0;f{const t=Ie(o.graphic),s=Ie(e.graphic);return t===s?e.zorder-o.zorder:t-s},gs=o=>{let e=class extends tt(o){constructor(){super(...arguments),this.graphics=null,this.renderer=null}};return v([C()],e.prototype,"graphics",void 0),v([C()],e.prototype,"renderer",void 0),v([C()],e.prototype,"updating",void 0),v([C()],e.prototype,"view",void 0),e=v([$e("esri.views.layers.GraphicsView")],e),e},ys=st("esri-2d-graphic-debug");function he(o,e,t){if(t.has(o))return t.get(o);const s={tile:e,addedOrModified:[],removed:[]};return t.set(o,s),s}let w=class extends gs(it(ft)){constructor(o){super(o),this._storage=new Ht,this._displayIds=new Map,this._controller=new AbortController,this._tiles=new Map,this._graphicStoreUpdate=!1,this._graphicsSet=new Set,this._matcher=Promise.resolve(null),this._tileUpdateSet=new Set,this._tilesToUpdate=new Map,this._graphicIdToAbortController=new Map,this._attached=!1,this._updatingGraphicsTimer=null,this._hashToExpandedSymbol=new Map,this._hashToExpandedSymbolPromise=new Map,this._hashToCIMSymbolPromise=new Map,this._hashToCIM=new Map,this._processing=!1,this._needsProcessing=!1,this._pendingUpdate={added:new Set,updated:new Set,removed:new Set},this.lastUpdateId=-1,this.updateRequested=!1,this.graphicUpdateHandler=this.graphicUpdateHandler.bind(this)}destroy(){this._updatingGraphicsTimer&&(clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=null,this.notifyChange("updating")),this._controller.abort(),this.container.destroy(),this._set("graphics",null),this._graphicStore.clear(),this._attributeStore=null,this._hashToExpandedSymbol.clear(),this.view=null,this.renderer=null,this._hashToCIM.clear(),this._hashToCIMSymbolPromise.clear(),this._hashToExpandedSymbolPromise.clear()}_createMatcher(o,e,t){if(o){const s=we(o),i=Kt({indexCount:0,fields:{}},"feature",o,s);this._matcher=Ut(i,e,null,t)}}_createDisplayId(o){return this._displayIds.has(o)||this._displayIds.set(o,this._storage.createDisplayId()),this._displayIds.get(o)}initialize(){this._attributeStore=new Nt({type:"local",initialize:i=>Promise.resolve(this.container.attributeView.initialize(i)),update:i=>this.container.attributeView.requestUpdate(i),render:()=>this.container.requestRender()},rt("2d"),()=>this.notifyChange("updating")),this.container.hasHighlight=()=>this._attributeStore.hasHighlight;const o=i=>{this._createDisplayId(i.uid),this._setFilterState(i.uid,i.visible)},e=i=>{const r=this._displayIds.get(i.uid);this._displayIds.delete(i.uid),this._storage.releaseDisplayId(r)},t=new Pt(this.container.getMaterialItems.bind(this.container),this.view.featuresTilingScheme.tileInfo);this._graphicStore=new ps(this.view.featuresTilingScheme,this.view.state.scale,this.uid,this.graphics,o,e,this._hashToCIM),this._meshFactory=new Vt(null,this.uid,t),this._templateStore=t,this.handles.add([nt(()=>this.renderer,i=>{this._createMatcher(i,t,this.container.stage.resourceManager);for(const r of this.graphics)this._pendingUpdate.updated.add(r);this.requestUpdate()}),this.view.graphicsTileStore.on("update",this._onTileUpdate.bind(this)),this.container.on("attach",()=>{ys&&this.container.enableRenderingBounds(()=>this._graphicStore.getAllBounds()),this.graphics.items.length>0&&this._graphicsChangeHandler({target:this.graphics,added:this.graphics.items,removed:[],moved:[]}),this.handles.add(this.graphics.on("change",r=>this._graphicsChangeHandler(r)),"graphics");const i=this.container.stage.resourceManager;this._createMatcher(this.renderer,t,i),this._graphicStore.setResourceManager(i),this._attached=!0,this.notifyChange("updating")})]);const s=this.view.graphicsTileStore.tiles;this._onTileUpdate({added:s,removed:[]})}get updating(){return!this._attached||this._updatingGraphicsTimer!==null||this._tileUpdateSet.size>0||this._tilesToUpdate.size>0||this._attributeStore.isUpdating()}hitTest(o){if(!this.view||!this.view.position)return[];const{resolution:e,rotation:t}=this.view.state;return this._graphicStore.hitTest(o.x,o.y,2,e,t)}update(o){x(this._controller.signal);const e=o.state,{resolution:t}=e;if(this._graphicStore.updateLevel(t),this._graphicStoreUpdate=!0,this.updateRequested=!1,this._pendingUpdate.updated.size>0){if(!this._processing)return void this._updateGraphics();this._needsProcessing=!0}}viewChange(){this.requestUpdate()}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.requestUpdateCallback())}processUpdate(o){this.updateRequested&&(this.updateRequested=!1,this.update(o))}graphicUpdateHandler(o){const{graphic:e,property:t}=o;switch(t){case"attributes":case"geometry":case"symbol":this._pendingUpdate.updated.add(e),this.requestUpdate();break;case"visible":this._setFilterState(e.uid,e.visible),this._attributeStore.sendUpdates()}}setHighlight(o){const e=o.map(t=>this._displayIds.get(t));this._attributeStore.setHighlight(o,e)}_getIntersectingTiles(o){const e=this._graphicStore.getBounds(o);if(!e||ot(e)===0||at(e)===0)return[];const t=hs(e,this.view.spatialReference);return F(t)?[...new Set([...this.view.graphicsTileStore.boundsIntersections(t[0]),...this.view.graphicsTileStore.boundsIntersections(t[1])])]:this.view.graphicsTileStore.boundsIntersections(e)}async _updateTile(o){x(this._controller.signal);const e=o.tile,t=this._getGraphicsData(this._templateStore,e,o.addedOrModified),s=await this._processGraphics(e,t);return x(this._controller.signal),this._patchTile(e.key,{type:"update",addOrUpdate:s,remove:o.removed,end:!0,clear:!1,sort:!1}),s}_patchTile(o,e){if(!this._tiles.has(o))return;const t=this._tiles.get(o);this.container.onTileData(t,e),this.container.requestRender()}_graphicsChangeHandler(o){const e=this._pendingUpdate;for(const t of o.added)e.added.add(t);for(const t of o.moved)e.updated.add(t);for(const t of o.removed)this._pendingUpdate.added.has(t)?e.added.delete(t):e.removed.add(t);this._processing?this._needsProcessing=!0:this._updateGraphics()}_getGraphicsToUpdate(){const o={added:[],removed:[],updated:[]};if(!this.graphics)return o;const e=this._pendingUpdate;for(const t of this.graphics.items)e.added.has(t)?o.added.push(t):e.updated.has(t)&&o.updated.push(t);for(const t of e.removed)this._graphicStore.has(t)&&o.removed.push(t);return e.added.clear(),e.removed.clear(),e.updated.clear(),o}async _updateGraphics(){this._processing=!0;const{added:o,removed:e,updated:t}=this._getGraphicsToUpdate(),s=this._tilesToUpdate;let i;try{if(!this._graphicStoreUpdate){const h=this.view.state,{resolution:c}=h;this._graphicStore.updateLevel(c)}const r=[],n=new Array(o.length+e.length);for(let h=0;h({name:t,alias:t,type:typeof o.attributes[t]=="string"?"esriFieldTypeString":"esriFieldTypeDouble"}));return A(o.geometry)?null:{geometryType:fe(o.geometry),spatialReference:lt.fromJSON(o.geometry.spatialReference),fields:e}}_getSymbolForGraphic(o,e){return x(this._controller.signal),F(o.symbol)?Promise.resolve(o.symbol):F(this.renderer)?this.renderer.getSymbolAsync(o,{scale:this.view.scale,signal:F(e)?e.signal:null}):Promise.resolve(this._getNullSymbol(o))}_getCIMSymbol(o,e,t){let s=this._hashToCIM.get(e);if(s)return Promise.resolve(s);const i=bt(o);if(F(i)){if(i.type==="CIMSymbolReference")return s=i,this._hashToCIM.set(e,s),Promise.resolve(s);let r=this._hashToCIMSymbolPromise.get(e);return r||(r=i.fetchCIMSymbol(t).then(n=>(this._hashToCIM.set(e,n.data),this._hashToCIMSymbolPromise.delete(e),n)).catch(n=>(this._hashToCIMSymbolPromise.delete(e),_e(n),null)),this._hashToCIMSymbolPromise.set(e,r),r)}return Promise.resolve(null)}_expandCIMSymbol(o,e,t,s){const i=this._hashToExpandedSymbol.get(t);if(i)return Promise.resolve(i);let r=this._hashToExpandedSymbolPromise.get(t);if(r)return r;const n=this.container.stage,a=this._getArcadeInfo(e),l=we(null),d=Qt(o,l);return r=jt(d,a,n.resourceManager,s),this._hashToExpandedSymbolPromise.set(t,r),r.then(h=>(this._hashToExpandedSymbol.set(t,h),this._hashToExpandedSymbolPromise.delete(t),h)),r}async _getSymbolResources(o,e){return x(this._controller.signal),this.container.stage?this._getSymbolForGraphic(o,e).then(t=>{const s=t.hash();return this._getCIMSymbol(t,s,e).then(i=>A(i)?null:this._expandCIMSymbol(i,o,s,e).then(r=>{const n=r.layers.filter(a=>a.type==="text"&&typeof a.text=="string");if(n&&n.length>0){const a=new Array(n.length);for(let d=0;d{for(let h=0;h(_e(t),null)):null}async _projectAndNormalizeGeometry(o,e){if(x(this._controller.signal),A(o.geometry)||o.geometry.type==="mesh")return null;let t=o.geometry;if(de(t)){const r=t.rings;t.rings=r}else if(xe(t)){const r=t.paths;t.paths=r}else if(ve(t)){const r=await this._getSymbolForGraphic(o,e);x(this._controller.signal),cs(r.type)||ds(r.type)?t=t.center:t=us(t)}await Bt(t.spatialReference,this.view.spatialReference);const s=Ct(t),i=wt(s,t.spatialReference,this.view.spatialReference);return i&&ht(i),i}_onTileUpdate(o){const e=E(this.view.spatialReference);if(o.added&&o.added.length>0)for(const t of o.added)this._addNewTile(t,e);if(o.removed&&o.removed.length>0)for(const t of o.removed)this._removeTile(t.key)}async _addGraphic(o){this._abortProcessingGraphic(o.uid),x(this._controller.signal);const e=new AbortController;this._graphicIdToAbortController.set(o.uid,e);const t={signal:e.signal};try{await this._addOrUpdateGraphic(o,t),x(this._controller.signal),this._graphicIdToAbortController.delete(o.uid)}catch(s){if(this._graphicIdToAbortController.delete(o.uid),!Z(s))throw s}}_updateGraphic(o,e){x(this._controller.signal);const t=this._projectAndNormalizeGeometry(o,e),s=this._getSymbolResources(o,e);return Promise.all([t,s]).then(([i,r])=>{x(this._controller.signal),this._graphicStore.addOrModify(o,r,i)})}_addOrUpdateGraphic(o,e){x(this._controller.signal);const t=this._projectAndNormalizeGeometry(o,e),s=this._getSymbolResources(o,e);return Promise.all([t,s]).then(([i,r])=>{x(this._controller.signal),this._graphicsSet.has(o)&&this._graphicStore.addOrModify(o,r,i)})}_addTile(o){const e=this.view.featuresTilingScheme.getTileBounds(b(),o),t=this.view.featuresTilingScheme.getTileResolution(o.level),s=new ts(o,t,e[0],e[3]);return this._tiles.set(o,s),this.container.addChild(s),s}async _addNewTile(o,e){const t=this._addTile(o.key),s=this._graphicStore.queryTileData(this._templateStore,o);if(s.length===0)return;if(e){const r=Math.round((e.valid[1]-e.valid[0])/o.resolution);for(const n of s)n.geometry&&(be(n.geometry)||oe(n.geometry))&&this._wrapPoints(n,r)}const i=o.key;this._tileUpdateSet.add(o.key),this.notifyChange("updating");try{const r={type:"update",clear:!1,addOrUpdate:await this._processGraphics(o,s),remove:[],end:!0,sort:!1};t.patch(r),this._tileUpdateSet.delete(i),this.notifyChange("updating")}catch(r){if(this._tileUpdateSet.delete(i),this.notifyChange("updating"),!Z(r))throw r}}_removeTile(o){if(!this._tiles.has(o))return;const e=this._tiles.get(o);this.container.removeChild(e),e.destroy(),this._tiles.delete(o)}_setFilterState(o,e){const t=this._displayIds.get(o),s=this._attributeStore.getHighlightFlag(o);this._attributeStore.setData(t,0,0,s|(e?Tt:0))}_getGraphicsData(o,e,t){const s=this.view,i=E(s.spatialReference),r=this._graphicStore.getGraphicsData(o,e,t);if(i){const n=Math.round((i.valid[1]-i.valid[0])/e.resolution);for(const a of r)a.geometry&&(be(a.geometry)||oe(a.geometry))&&this._wrapPoints(a,n)}return r}_wrapPoints(o,e){const t=o.geometry;oe(t)?this._wrapMultipoint(t,e):this._wrapPoint(o,e)}_wrapMultipoint(o,e){const t=o.points,s=[];let i=0,r=0;for(const[n,a]of t){if(s.push([n+i,a]),i=0,e===M){const l=5*T;n+rM-l&&(s.push([-e,0]),i=e)}else n+r<-T?(s.push([e,0]),i=-e):n+r>M+T&&(s.push([-e,0]),i=e);r+=n}o.points=s}_wrapPoint(o,e){const t=o.geometry;if(e===M){const s=5*T;t.xM-s&&(o.geometry={points:[[t.x,t.y],[-e,0]]})}else t.x<-T?o.geometry={points:[[t.x,t.y],[e,0]]}:t.x>M+T&&(o.geometry={points:[[t.x,t.y],[-e,0]]})}_processGraphics(o,e,t){if(!(e&&e.length)||!this._meshFactory)return null;const s=ie.from(e,this.uid,o.transform),i=this._meshFactory;return this._matcher.then(r=>i.analyzeGraphics(s,this.container.stage.resourceManager,r,null,null,t).then(()=>(this._attributeStore.sendUpdates(),this._processAnalyzedGraphics(o,s))))}_processAnalyzedGraphics(o,e){const t=this._meshFactory,s=e.getSize(),i=e.getCursor(),r={features:s,records:s,metrics:0},n=new kt(o.key.id,r,Ue.DEFAULT,!1,!1),a=[];for(;i.next();){const c=i.readGraphic();c.insertAfter=c.insertAfter===-1?-1:this._displayIds.get(c.insertAfter),c.displayId=this._displayIds.get(c.attributes[this.uid]);const u=new G(c.displayId);u.insertAfter=c.insertAfter,a.push(u),t.writeGraphic(n,i,o.level,this.container.stage.resourceManager)}const l=o.tileInfoView.tileInfo.isWrappable,d=n.serialize(l);if(d.length!==1)return new D;const h=d[0].message;return D.fromVertexData(h,a)}_abortProcessingGraphic(o){this._graphicIdToAbortController.has(o)&&this._graphicIdToAbortController.get(o).abort()}_getNullSymbol(o){const e=o.geometry;return xe(e)?dt:de(e)||ve(e)?ct:ut}_flipUpdatingGraphics(){this._updatingGraphicsTimer&&clearTimeout(this._updatingGraphicsTimer),this._updatingGraphicsTimer=setTimeout(()=>{this._updatingGraphicsTimer=null,this.notifyChange("updating")},160),this.notifyChange("updating")}};v([C({constructOnly:!0})],w.prototype,"requestUpdateCallback",void 0),v([C()],w.prototype,"container",void 0),v([C({constructOnly:!0})],w.prototype,"graphics",void 0),v([C()],w.prototype,"updating",null),v([C()],w.prototype,"view",void 0),v([C()],w.prototype,"updateRequested",void 0),w=v([$e("esri.views.2d.layers.support.GraphicsView2D")],w);const Us=w,_s=Math.PI/180,xs=4;class vs extends Wt{constructor(e){super(),this._dvsMat3=De(),this._localOrigin={x:0,y:0},this._getBounds=e}destroy(){this._vao&&(this._vao.dispose(!0),this._vao=null,this._vertexBuffer=null,this._indexBuffer=null),this._program&&(this._program.dispose(),this._program=null)}doRender(e){const{context:t}=e,s=this._getBounds();if(s.length<1)return;this._createShaderProgram(t),this._updateMatricesAndLocalOrigin(e),this._updateBufferData(t,s),t.setBlendingEnabled(!0),t.setDepthTestEnabled(!1),t.setStencilWriteMask(0),t.setStencilTestEnabled(!1),t.setBlendFunction(Be.ONE,Be.ONE_MINUS_SRC_ALPHA),t.setColorMask(!0,!0,!0,!0);const i=this._program;t.bindVAO(this._vao),t.useProgram(i),i.setUniformMatrix3fv("u_dvsMat3",this._dvsMat3),t.gl.lineWidth(1),t.drawElements(Lt.LINES,8*s.length,Ve.UNSIGNED_INT,0),t.bindVAO()}_createTransforms(){return{dvs:De()}}_createShaderProgram(e){if(this._program)return;const t=`precision highp float; uniform mat3 u_dvsMat3; attribute vec2 a_position; diff --git a/assets/BaseProcessor.fe0bade4.js b/assets/BaseProcessor.f4010bc0.js similarity index 90% rename from assets/BaseProcessor.fe0bade4.js rename to assets/BaseProcessor.f4010bc0.js index 974c64b..0cfd0b9 100644 --- a/assets/BaseProcessor.fe0bade4.js +++ b/assets/BaseProcessor.f4010bc0.js @@ -1 +1 @@ -import{a6 as t,a7 as o,a8 as r,dA as l}from"./index.d94abe07.js";let e=class extends l{initialize(){}destroy(){}get supportsTileUpdates(){return!1}get spatialReference(){const s=this.get("tileStore.tileScheme.spatialReference");return s&&s.toJSON()||null}};t([o({readOnly:!0})],e.prototype,"supportsTileUpdates",null),t([o({constructOnly:!0})],e.prototype,"remoteClient",void 0),t([o({constructOnly:!0})],e.prototype,"service",void 0),t([o()],e.prototype,"spatialReference",null),t([o({constructOnly:!0})],e.prototype,"tileInfo",void 0),t([o({constructOnly:!0})],e.prototype,"tileStore",void 0),e=t([r("esri.views.2d.layers.features.processors.BaseProcessor")],e);const n=e;export{n as p}; +import{a6 as t,a7 as o,a8 as r,dA as l}from"./index.221827cd.js";let e=class extends l{initialize(){}destroy(){}get supportsTileUpdates(){return!1}get spatialReference(){const s=this.get("tileStore.tileScheme.spatialReference");return s&&s.toJSON()||null}};t([o({readOnly:!0})],e.prototype,"supportsTileUpdates",null),t([o({constructOnly:!0})],e.prototype,"remoteClient",void 0),t([o({constructOnly:!0})],e.prototype,"service",void 0),t([o()],e.prototype,"spatialReference",null),t([o({constructOnly:!0})],e.prototype,"tileInfo",void 0),t([o({constructOnly:!0})],e.prototype,"tileStore",void 0),e=t([r("esri.views.2d.layers.features.processors.BaseProcessor")],e);const n=e;export{n as p}; diff --git a/assets/BaseTileRenderer.5cd35765.js b/assets/BaseTileRenderer.f04a8f8b.js similarity index 93% rename from assets/BaseTileRenderer.5cd35765.js rename to assets/BaseTileRenderer.f04a8f8b.js index 8f8634b..1016da4 100644 --- a/assets/BaseTileRenderer.5cd35765.js +++ b/assets/BaseTileRenderer.f04a8f8b.js @@ -1 +1 @@ -import{a6 as s,a7 as r,a8 as a,dA as l}from"./index.d94abe07.js";let t=class extends l{constructor(e){super(e),this.tiles=new Map}destroy(){this.tiles.clear(),this.layer=this.layerView=this.tileInfoView=this.tiles=null}get updating(){return this.isUpdating()}acquireTile(e){const i=this.createTile(e);return i.once("isReady",()=>this.notifyChange("updating")),this.tiles.set(e.id,i),i}forceAttributeTextureUpload(){}forEachTile(e){this.tiles.forEach(e)}releaseTile(e){this.tiles.delete(e.key.id),this.disposeTile(e)}isUpdating(){let e=!0;return this.tiles.forEach(i=>{e=e&&i.isReady}),!e}setHighlight(){}invalidateLabels(){}requestUpdate(){this.layerView.requestUpdate()}};s([r()],t.prototype,"layer",void 0),s([r()],t.prototype,"layerView",void 0),s([r()],t.prototype,"tileInfoView",void 0),s([r()],t.prototype,"updating",null),t=s([a("esri.views.2d.layers.features.tileRenderers.BaseTileRenderer")],t);const d=t;export{d as o}; +import{a6 as s,a7 as r,a8 as a,dA as l}from"./index.221827cd.js";let t=class extends l{constructor(e){super(e),this.tiles=new Map}destroy(){this.tiles.clear(),this.layer=this.layerView=this.tileInfoView=this.tiles=null}get updating(){return this.isUpdating()}acquireTile(e){const i=this.createTile(e);return i.once("isReady",()=>this.notifyChange("updating")),this.tiles.set(e.id,i),i}forceAttributeTextureUpload(){}forEachTile(e){this.tiles.forEach(e)}releaseTile(e){this.tiles.delete(e.key.id),this.disposeTile(e)}isUpdating(){let e=!0;return this.tiles.forEach(i=>{e=e&&i.isReady}),!e}setHighlight(){}invalidateLabels(){}requestUpdate(){this.layerView.requestUpdate()}};s([r()],t.prototype,"layer",void 0),s([r()],t.prototype,"layerView",void 0),s([r()],t.prototype,"tileInfoView",void 0),s([r()],t.prototype,"updating",null),t=s([a("esri.views.2d.layers.features.tileRenderers.BaseTileRenderer")],t);const d=t;export{d as o}; diff --git a/assets/BingMapsLayer.cc96b552.js b/assets/BingMapsLayer.057bb977.js similarity index 99% rename from assets/BingMapsLayer.cc96b552.js rename to assets/BingMapsLayer.057bb977.js index 6684e1a..7b07402 100644 --- a/assets/BingMapsLayer.cc96b552.js +++ b/assets/BingMapsLayer.057bb977.js @@ -1 +1 @@ -import{cP as S,i2 as w,i3 as j,ia as B,du as h,aT as y,cU as U,ay as x,U as c,n as p,a6 as a,a7 as r,a8 as T,cF as P,ct as k,eF as R,eH as I,c as M,j as f}from"./index.d94abe07.js";var m;const d=new S("0/0/0",0,0,0,void 0);let u=m=class extends w(j(B(P))){constructor(){super(...arguments),this.tileInfo=h.create({spatialReference:y.WebMercator,size:256}),this.type="base-tile",this.fullExtent=new U(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,y.WebMercator),this.spatialReference=y.WebMercator}getTileBounds(t,e,i,o){const n=o||x();return d.level=t,d.row=e,d.col=i,d.extent=n,this.tileInfo.updateTileInfo(d),d.extent=void 0,n}fetchTile(t,e,i,o={}){const{signal:n}=o,l=this.getTileUrl(t,e,i),g={responseType:"image",signal:n,query:{...this.refreshParameters}};return c(l!=null?l:"",g).then(b=>b.data)}async fetchImageBitmapTile(t,e,i,o={}){const{signal:n}=o;if(this.fetchTile!==m.prototype.fetchTile)return createImageBitmap(await this.fetchTile(t,e,i,o));const l=this.getTileUrl(t,e,i),g={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:b}=await c(l!=null?l:"",g);return createImageBitmap(b)}getTileUrl(){throw new p("basetilelayer:gettileurl-not-implemented","getTileUrl() is not implemented")}};a([r({type:h})],u.prototype,"tileInfo",void 0),a([r({type:["show","hide"]})],u.prototype,"listMode",void 0),a([r({readOnly:!0,value:"base-tile"})],u.prototype,"type",void 0),a([r({nonNullable:!0})],u.prototype,"fullExtent",void 0),a([r()],u.prototype,"spatialReference",void 0),u=m=a([T("esri.layers.BaseTileLayer")],u);const $=u,v=new k({BingMapsAerial:"aerial",BingMapsRoad:"road",BingMapsHybrid:"hybrid"}),_="https://dev.virtualearth.net";let s=class extends w(R(I($))){constructor(t){super(t),this.type="bing-maps",this.tileInfo=new h({size:[256,256],dpi:96,origin:{x:-20037508342787e-6,y:20037508342787e-6,spatialReference:y.WebMercator},spatialReference:y.WebMercator,lods:[{level:1,resolution:78271.5169639999,scale:295828763795777e-6},{level:2,resolution:39135.7584820001,scale:147914381897889e-6},{level:3,resolution:19567.8792409999,scale:73957190948944e-6},{level:4,resolution:9783.93962049996,scale:36978595474472e-6},{level:5,resolution:4891.96981024998,scale:18489297737236e-6},{level:6,resolution:2445.98490512499,scale:9244648868618e-6},{level:7,resolution:1222.99245256249,scale:4622324434309e-6},{level:8,resolution:611.49622628138,scale:2311162217155e-6},{level:9,resolution:305.748113140558,scale:1155581108577e-6},{level:10,resolution:152.874056570411,scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144},{level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:.597164283559817,scale:2256.994353},{level:19,resolution:.298582141647617,scale:1128.497176},{level:20,resolution:.1492910708238085,scale:564.248588}]}),this.key=null,this.style="road",this.culture="en-US",this.region=null,this.portalUrl=null,this.hasAttributionData=!0}get bingMetadata(){return this._get("bingMetadata")}set bingMetadata(t){this._set("bingMetadata",t)}get copyright(){return M(this.bingMetadata)?this.bingMetadata.copyright:null}get operationalLayerType(){return v.toJSON(this.style)}get bingLogo(){return M(this.bingMetadata)?this.bingMetadata.brandLogoUri:null}load(t){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then(()=>this._getMetadata())):this.addResolvingPromise(Promise.reject(new p("bingmapslayer:load","Bing layer must have bing key."))),Promise.resolve(this)}getTileUrl(t,e,i){if(!this.loaded||f(this.bingMetadata))return null;const o=this.bingMetadata.resourceSets[0].resources[0],n=o.imageUrlSubdomains[e%o.imageUrlSubdomains.length],l=this._getQuadKey(t,e,i);return o.imageUrl.replace("{subdomain}",n).replace("{quadkey}",l)}async fetchAttributionData(){return this.load().then(()=>f(this.bingMetadata)?null:{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map(t=>({attribution:t.attribution,coverageAreas:t.coverageAreas.map(e=>({zoomMin:e.zoomMin,zoomMax:e.zoomMax,score:1,bbox:[e.bbox[0],e.bbox[1],e.bbox[2],e.bbox[3]]}))}))})}_getMetadata(){const t={road:"roadOnDemand",aerial:"aerial",hybrid:"aerialWithLabelsOnDemand"}[this.style];return c(`${_}/REST/v1/Imagery/Metadata/${t}`,{responseType:"json",query:{include:"ImageryProviders",uriScheme:"https",key:this.key,suppressStatus:!0,output:"json",culture:this.culture,userRegion:this.region}}).then(e=>{const i=e.data;if(i.statusCode!==200)throw new p("bingmapslayer:getmetadata",i.statusDescription);if(this.bingMetadata=i,this.bingMetadata.resourceSets.length===0)throw new p("bingmapslayer:getmetadata","no bing resourcesets");if(this.bingMetadata.resourceSets[0].resources.length===0)throw new p("bingmapslayer:getmetadata","no bing resources")}).catch(e=>{throw new p("bingmapslayer:getmetadata",e.message)})}_getPortalBingKey(){var t;return c((t=this.portalUrl)!=null?t:"",{responseType:"json",authMode:"no-prompt",query:{f:"json"}}).then(e=>{if(!e.data.bingKey)throw new p("bingmapslayer:getportalbingkey","The referenced Portal does not contain a valid bing key");this.key=e.data.bingKey}).catch(e=>{throw new p("bingmapslayer:getportalbingkey",e.message)})}_getQuadKey(t,e,i){let o="";for(let n=t;n>0;n--){let l=0;const g=1<b.data)}async fetchImageBitmapTile(t,e,i,o={}){const{signal:n}=o;if(this.fetchTile!==m.prototype.fetchTile)return createImageBitmap(await this.fetchTile(t,e,i,o));const l=this.getTileUrl(t,e,i),g={responseType:"blob",signal:n,query:{...this.refreshParameters}},{data:b}=await c(l!=null?l:"",g);return createImageBitmap(b)}getTileUrl(){throw new p("basetilelayer:gettileurl-not-implemented","getTileUrl() is not implemented")}};a([r({type:h})],u.prototype,"tileInfo",void 0),a([r({type:["show","hide"]})],u.prototype,"listMode",void 0),a([r({readOnly:!0,value:"base-tile"})],u.prototype,"type",void 0),a([r({nonNullable:!0})],u.prototype,"fullExtent",void 0),a([r()],u.prototype,"spatialReference",void 0),u=m=a([T("esri.layers.BaseTileLayer")],u);const $=u,v=new k({BingMapsAerial:"aerial",BingMapsRoad:"road",BingMapsHybrid:"hybrid"}),_="https://dev.virtualearth.net";let s=class extends w(R(I($))){constructor(t){super(t),this.type="bing-maps",this.tileInfo=new h({size:[256,256],dpi:96,origin:{x:-20037508342787e-6,y:20037508342787e-6,spatialReference:y.WebMercator},spatialReference:y.WebMercator,lods:[{level:1,resolution:78271.5169639999,scale:295828763795777e-6},{level:2,resolution:39135.7584820001,scale:147914381897889e-6},{level:3,resolution:19567.8792409999,scale:73957190948944e-6},{level:4,resolution:9783.93962049996,scale:36978595474472e-6},{level:5,resolution:4891.96981024998,scale:18489297737236e-6},{level:6,resolution:2445.98490512499,scale:9244648868618e-6},{level:7,resolution:1222.99245256249,scale:4622324434309e-6},{level:8,resolution:611.49622628138,scale:2311162217155e-6},{level:9,resolution:305.748113140558,scale:1155581108577e-6},{level:10,resolution:152.874056570411,scale:577790.554289},{level:11,resolution:76.4370282850732,scale:288895.277144},{level:12,resolution:38.2185141425366,scale:144447.638572},{level:13,resolution:19.1092570712683,scale:72223.819286},{level:14,resolution:9.55462853563415,scale:36111.909643},{level:15,resolution:4.77731426794937,scale:18055.954822},{level:16,resolution:2.38865713397468,scale:9027.977411},{level:17,resolution:1.19432856685505,scale:4513.988705},{level:18,resolution:.597164283559817,scale:2256.994353},{level:19,resolution:.298582141647617,scale:1128.497176},{level:20,resolution:.1492910708238085,scale:564.248588}]}),this.key=null,this.style="road",this.culture="en-US",this.region=null,this.portalUrl=null,this.hasAttributionData=!0}get bingMetadata(){return this._get("bingMetadata")}set bingMetadata(t){this._set("bingMetadata",t)}get copyright(){return M(this.bingMetadata)?this.bingMetadata.copyright:null}get operationalLayerType(){return v.toJSON(this.style)}get bingLogo(){return M(this.bingMetadata)?this.bingMetadata.brandLogoUri:null}load(t){return this.key?this.addResolvingPromise(this._getMetadata()):this.portalUrl?this.addResolvingPromise(this._getPortalBingKey().then(()=>this._getMetadata())):this.addResolvingPromise(Promise.reject(new p("bingmapslayer:load","Bing layer must have bing key."))),Promise.resolve(this)}getTileUrl(t,e,i){if(!this.loaded||f(this.bingMetadata))return null;const o=this.bingMetadata.resourceSets[0].resources[0],n=o.imageUrlSubdomains[e%o.imageUrlSubdomains.length],l=this._getQuadKey(t,e,i);return o.imageUrl.replace("{subdomain}",n).replace("{quadkey}",l)}async fetchAttributionData(){return this.load().then(()=>f(this.bingMetadata)?null:{contributors:this.bingMetadata.resourceSets[0].resources[0].imageryProviders.map(t=>({attribution:t.attribution,coverageAreas:t.coverageAreas.map(e=>({zoomMin:e.zoomMin,zoomMax:e.zoomMax,score:1,bbox:[e.bbox[0],e.bbox[1],e.bbox[2],e.bbox[3]]}))}))})}_getMetadata(){const t={road:"roadOnDemand",aerial:"aerial",hybrid:"aerialWithLabelsOnDemand"}[this.style];return c(`${_}/REST/v1/Imagery/Metadata/${t}`,{responseType:"json",query:{include:"ImageryProviders",uriScheme:"https",key:this.key,suppressStatus:!0,output:"json",culture:this.culture,userRegion:this.region}}).then(e=>{const i=e.data;if(i.statusCode!==200)throw new p("bingmapslayer:getmetadata",i.statusDescription);if(this.bingMetadata=i,this.bingMetadata.resourceSets.length===0)throw new p("bingmapslayer:getmetadata","no bing resourcesets");if(this.bingMetadata.resourceSets[0].resources.length===0)throw new p("bingmapslayer:getmetadata","no bing resources")}).catch(e=>{throw new p("bingmapslayer:getmetadata",e.message)})}_getPortalBingKey(){var t;return c((t=this.portalUrl)!=null?t:"",{responseType:"json",authMode:"no-prompt",query:{f:"json"}}).then(e=>{if(!e.data.bingKey)throw new p("bingmapslayer:getportalbingkey","The referenced Portal does not contain a valid bing key");this.key=e.data.bingKey}).catch(e=>{throw new p("bingmapslayer:getportalbingkey",e.message)})}_getQuadKey(t,e,i){let o="";for(let n=t;n>0;n--){let l=0;const g=1<t.renderedRasterPixels):P(s):s}class U extends v{constructor(t=null,e){var i,r;super(),this.blendFunction="standard",this._sourceWidth=0,this._sourceHeight=0,this._textureInvalidated=!1,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._width=void 0,this.x=0,this.y=0,this.immutable=(i=e.immutable)!=null?i:!1,this.requestRenderOnSourceChangedEnabled=(r=e.requestRenderOnSourceChangedEnabled)!=null?r:!0,this.source=t,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null),n(this._uploadStatus)&&(this._uploadStatus.controller.abort(),this._uploadStatus=null)}get isSourceScaled(){return this.width!==this._sourceWidth||this.height!==this._sourceHeight}get height(){return this._height!==void 0?this._height:this._sourceHeight}set height(t){this._height=t}get source(){return this._source}set source(t){t==null&&this._source==null||(this._source=t,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width),this.invalidateTexture())}get width(){return this._width!==void 0?this._width:this._sourceWidth}set width(t){this._width=t}beforeRender(t){super.beforeRender(t),this.updateTexture(t)}async setSourceAsync(t,e){n(this._uploadStatus)&&this._uploadStatus.controller.abort();const i=new AbortController,r=g();return _(e,()=>i.abort()),_(i,h=>r.reject(h)),this._uploadStatus={controller:i,resolver:r},this.source=t,r.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRenderOnSourceChangedEnabled&&this.requestRender())}updateTransitionProperties(t,e){t>=64&&(this.fadeTransitionEnabled=!1,this.inFadeTransition=!1),super.updateTransitionProperties(t,e)}setTransform(t){const e=m(this.transforms.dvs),[i,r]=t.toScreenNoRotation([0,0],[this.x,this.y]),h=this.resolution/this.pixelRatio/t.resolution,o=h*this.width,a=h*this.height,l=Math.PI*this.rotation/180;c(e,e,u(i,r)),c(e,e,u(o/2,a/2)),f(e,e,-l),c(e,e,u(-o/2,-a/2)),R(e,e,u(o,a)),b(this.transforms.dvs,t.displayViewMat3,e)}setSamplingProfile(t){this._texture&&(t.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(t.samplingMode))}bind(t,e){this._texture&&t.bindTexture(this._texture,e)}async updateTexture({context:t,painter:e}){if(!this._textureInvalidated)return;if(this._textureInvalidated=!1,this._texture||(this._texture=this._createTexture(t)),!this.source)return void this._texture.setData(null);this._texture.resize(this._sourceWidth,this._sourceHeight);const i=G(this.source);try{if(n(this._uploadStatus)){const{controller:r,resolver:h}=this._uploadStatus,o={signal:r.signal},{width:a,height:l}=this,x=this._texture;await e.textureUploadManager.enqueueTextureUpdate({data:i,texture:x,width:a,height:l},o),h.resolve(),this._uploadStatus=null}else this._texture.setData(i);this.ready()}catch(r){w(r)}}onDetach(){this.destroy()}_createTransforms(){return{dvs:B()}}_createTexture(t){const e=this.immutable&&t.type===S.WEBGL2;return new A(t,{target:k.TEXTURE_2D,pixelFormat:p.RGBA,internalFormat:e?E.RGBA8:p.RGBA,dataType:y.UNSIGNED_BYTE,wrapMode:M.CLAMP_TO_EDGE,isImmutable:e,width:this._sourceWidth,height:this._sourceHeight})}}export{U as R,I as S,P as T,D as i}; +import{c as n,j as d,K as g,L as _,b1 as m,S as c,b3 as u,R as f,ck as R,b2 as b,z as w,N as B,r as S,bc as T}from"./index.221827cd.js";import{r as v}from"./utils.0160becb.js";import{M as k,P as p,U as E,G as y,D as M}from"./enums.2d9e6f64.js";import{E as A}from"./Texture.940076b2.js";class D{constructor(t,e,i){this.pixelBlock=t,this.extent=e,this.originalPixelBlock=i}get width(){return n(this.pixelBlock)?this.pixelBlock.width:0}get height(){return n(this.pixelBlock)?this.pixelBlock.height:0}render(t){const e=this.pixelBlock;if(d(e))return;const i=this.filter({pixelBlock:e});if(d(i.pixelBlock))return;const r=i.pixelBlock.getAsRGBA(),h=t.createImageData(i.pixelBlock.width,i.pixelBlock.height);h.data.set(r),t.putImageData(h,0,0)}getRenderedRasterPixels(){const t=this.filter({pixelBlock:this.pixelBlock});return d(t.pixelBlock)?null:{width:t.pixelBlock.width,height:t.pixelBlock.height,renderedRasterPixels:new Uint8Array(t.pixelBlock.getAsRGBA().buffer)}}}function I(s){return s&&"render"in s}function P(s){const t=document.createElement("canvas");return t.width=s.width,t.height=s.height,s.render(t.getContext("2d")),t}function G(s){return I(s)?s instanceof D?T(s.getRenderedRasterPixels(),t=>t.renderedRasterPixels):P(s):s}class U extends v{constructor(t=null,e){var i,r;super(),this.blendFunction="standard",this._sourceWidth=0,this._sourceHeight=0,this._textureInvalidated=!1,this.stencilRef=0,this.coordScale=[1,1],this._height=void 0,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this._width=void 0,this.x=0,this.y=0,this.immutable=(i=e.immutable)!=null?i:!1,this.requestRenderOnSourceChangedEnabled=(r=e.requestRenderOnSourceChangedEnabled)!=null?r:!0,this.source=t,this.requestRender=this.requestRender.bind(this)}destroy(){this._texture&&(this._texture.dispose(),this._texture=null),n(this._uploadStatus)&&(this._uploadStatus.controller.abort(),this._uploadStatus=null)}get isSourceScaled(){return this.width!==this._sourceWidth||this.height!==this._sourceHeight}get height(){return this._height!==void 0?this._height:this._sourceHeight}set height(t){this._height=t}get source(){return this._source}set source(t){t==null&&this._source==null||(this._source=t,this._source instanceof HTMLImageElement?(this._sourceHeight=this._source.naturalHeight,this._sourceWidth=this._source.naturalWidth):(this._sourceHeight=this._source.height,this._sourceWidth=this._source.width),this.invalidateTexture())}get width(){return this._width!==void 0?this._width:this._sourceWidth}set width(t){this._width=t}beforeRender(t){super.beforeRender(t),this.updateTexture(t)}async setSourceAsync(t,e){n(this._uploadStatus)&&this._uploadStatus.controller.abort();const i=new AbortController,r=g();return _(e,()=>i.abort()),_(i,h=>r.reject(h)),this._uploadStatus={controller:i,resolver:r},this.source=t,r.promise}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRenderOnSourceChangedEnabled&&this.requestRender())}updateTransitionProperties(t,e){t>=64&&(this.fadeTransitionEnabled=!1,this.inFadeTransition=!1),super.updateTransitionProperties(t,e)}setTransform(t){const e=m(this.transforms.dvs),[i,r]=t.toScreenNoRotation([0,0],[this.x,this.y]),h=this.resolution/this.pixelRatio/t.resolution,o=h*this.width,a=h*this.height,l=Math.PI*this.rotation/180;c(e,e,u(i,r)),c(e,e,u(o/2,a/2)),f(e,e,-l),c(e,e,u(-o/2,-a/2)),R(e,e,u(o,a)),b(this.transforms.dvs,t.displayViewMat3,e)}setSamplingProfile(t){this._texture&&(t.mips&&!this._texture.descriptor.hasMipmap&&this._texture.generateMipmap(),this._texture.setSamplingMode(t.samplingMode))}bind(t,e){this._texture&&t.bindTexture(this._texture,e)}async updateTexture({context:t,painter:e}){if(!this._textureInvalidated)return;if(this._textureInvalidated=!1,this._texture||(this._texture=this._createTexture(t)),!this.source)return void this._texture.setData(null);this._texture.resize(this._sourceWidth,this._sourceHeight);const i=G(this.source);try{if(n(this._uploadStatus)){const{controller:r,resolver:h}=this._uploadStatus,o={signal:r.signal},{width:a,height:l}=this,x=this._texture;await e.textureUploadManager.enqueueTextureUpdate({data:i,texture:x,width:a,height:l},o),h.resolve(),this._uploadStatus=null}else this._texture.setData(i);this.ready()}catch(r){w(r)}}onDetach(){this.destroy()}_createTransforms(){return{dvs:B()}}_createTexture(t){const e=this.immutable&&t.type===S.WEBGL2;return new A(t,{target:k.TEXTURE_2D,pixelFormat:p.RGBA,internalFormat:e?E.RGBA8:p.RGBA,dataType:y.UNSIGNED_BYTE,wrapMode:M.CLAMP_TO_EDGE,isImmutable:e,width:this._sourceWidth,height:this._sourceHeight})}}export{U as R,I as S,P as T,D as i}; diff --git a/assets/BitmapContainer.3274be0c.js b/assets/BitmapContainer.9e943f6d.js similarity index 81% rename from assets/BitmapContainer.3274be0c.js rename to assets/BitmapContainer.9e943f6d.js index 5b78d0a..c0e0b15 100644 --- a/assets/BitmapContainer.3274be0c.js +++ b/assets/BitmapContainer.9e943f6d.js @@ -1 +1 @@ -import{o as r,c as a}from"./WGLContainer.1850619d.js";import{I as t}from"./Utils.7f6f3a6b.js";class h extends r{constructor(){super(...arguments),this._hasCrossfade=!1}get requiresDedicatedFBO(){return this._hasCrossfade}beforeRender(e){super.beforeRender(e),this._manageFade()}prepareRenderPasses(e){const s=e.registerRenderPass({name:"bitmap",brushes:[a.bitmap],target:()=>this.children,drawPhase:t.MAP});return[...super.prepareRenderPasses(e),s]}_manageFade(){this.children.reduce((e,s)=>e+(s.inFadeTransition?1:0),0)>=2?(this.children.forEach(e=>e.blendFunction="additive"),this._hasCrossfade=!0):(this.children.forEach(e=>e.blendFunction="standard"),this._hasCrossfade=!1)}}export{h as a}; +import{o as r,c as a}from"./WGLContainer.347cc5cd.js";import{I as t}from"./Utils.2136650a.js";class h extends r{constructor(){super(...arguments),this._hasCrossfade=!1}get requiresDedicatedFBO(){return this._hasCrossfade}beforeRender(e){super.beforeRender(e),this._manageFade()}prepareRenderPasses(e){const s=e.registerRenderPass({name:"bitmap",brushes:[a.bitmap],target:()=>this.children,drawPhase:t.MAP});return[...super.prepareRenderPasses(e),s]}_manageFade(){this.children.reduce((e,s)=>e+(s.inFadeTransition?1:0),0)>=2?(this.children.forEach(e=>e.blendFunction="additive"),this._hasCrossfade=!0):(this.children.forEach(e=>e.blendFunction="standard"),this._hasCrossfade=!1)}}export{h as a}; diff --git a/assets/BitmapTileContainer.3a622161.js b/assets/BitmapTileContainer.f5b20598.js similarity index 83% rename from assets/BitmapTileContainer.3a622161.js rename to assets/BitmapTileContainer.f5b20598.js index da581e7..e90770d 100644 --- a/assets/BitmapTileContainer.3a622161.js +++ b/assets/BitmapTileContainer.f5b20598.js @@ -1 +1 @@ -import{N as n,ay as p}from"./index.d94abe07.js";import{R as h}from"./Bitmap.43defcb1.js";import{r as l,i as b}from"./TileContainer.8b7fafe2.js";import{c as f}from"./WGLContainer.1850619d.js";import{I as o}from"./Utils.7f6f3a6b.js";class u extends l{constructor(e,t,s,i,r,a,m=null){super(e,t,s,i,r,a),this.bitmap=new h(m,{immutable:!1,requestRenderOnSourceChangedEnabled:!1}),this.bitmap.coordScale=[r,a],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy()}beforeRender(e){super.beforeRender(e),this.bitmap.beforeRender(e)}afterRender(e){super.afterRender(e),this.bitmap.afterRender(e)}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}_createTransforms(){return{dvs:n(),tileMat3:n()}}setTransform(e){super.setTransform(e),this.bitmap.transforms.dvs=this.transforms.dvs}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap&&(this.bitmap.stage=null)}}class v extends b{get requiresDedicatedFBO(){return this.children.some(e=>e.bitmap.blendFunction==="additive")}createTile(e){const t=this._tileInfoView.getTileBounds(p(),e),s=this._tileInfoView.getTileResolution(e.level),[i,r]=this._tileInfoView.tileInfo.size;return new u(e,s,t[0],t[3],i,r)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"bitmap (tile)",brushes:[f.bitmap],target:()=>this.children.map(s=>s.bitmap),drawPhase:o.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===o.MAP&&super.doRender(e)}}export{v as n}; +import{N as n,ay as p}from"./index.221827cd.js";import{R as h}from"./Bitmap.72a3702e.js";import{r as l,i as b}from"./TileContainer.5aeb32d6.js";import{c as f}from"./WGLContainer.347cc5cd.js";import{I as o}from"./Utils.2136650a.js";class u extends l{constructor(e,t,s,i,r,a,m=null){super(e,t,s,i,r,a),this.bitmap=new h(m,{immutable:!1,requestRenderOnSourceChangedEnabled:!1}),this.bitmap.coordScale=[r,a],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy()}beforeRender(e){super.beforeRender(e),this.bitmap.beforeRender(e)}afterRender(e){super.afterRender(e),this.bitmap.afterRender(e)}set stencilRef(e){this.bitmap.stencilRef=e}get stencilRef(){return this.bitmap.stencilRef}_createTransforms(){return{dvs:n(),tileMat3:n()}}setTransform(e){super.setTransform(e),this.bitmap.transforms.dvs=this.transforms.dvs}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap&&(this.bitmap.stage=null)}}class v extends b{get requiresDedicatedFBO(){return this.children.some(e=>e.bitmap.blendFunction==="additive")}createTile(e){const t=this._tileInfoView.getTileBounds(p(),e),s=this._tileInfoView.getTileResolution(e.level),[i,r]=this._tileInfoView.tileInfo.size;return new u(e,s,t[0],t[3],i,r)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"bitmap (tile)",brushes:[f.bitmap],target:()=>this.children.map(s=>s.bitmap),drawPhase:o.MAP});return[...super.prepareRenderPasses(e),t]}doRender(e){this.visible&&e.drawPhase===o.MAP&&super.doRender(e)}}export{v as n}; diff --git a/assets/BufferPool.ff53b3f4.js b/assets/BufferPool.98277e4b.js similarity index 98% rename from assets/BufferPool.ff53b3f4.js rename to assets/BufferPool.98277e4b.js index 0a59395..d98dad5 100644 --- a/assets/BufferPool.ff53b3f4.js +++ b/assets/BufferPool.98277e4b.js @@ -1 +1 @@ -import{j as h,m as f,c as y,ba as g}from"./index.d94abe07.js";class i{constructor(t){if(this.next=null,!Array.isArray(t))return void(this.data=t);this.data=t[0];let e=this;for(let a=1;at(e.data)?this:e;return this.next?this.next.max(t,a):a}remove(t,e=null){var a,s;return this===t?e?(e.next=this.next,e):this.next:(s=(a=this.next)==null?void 0:a.remove(t,this))!=null?s:null}get last(){return this.next?this.next.last:this}}class x{constructor(t){this._head=null,h(t)||(this._head=new i(t))}get head(){return this._head}maxAvailableSpace(){if(h(this._head))return 0;const t=this._head.max(e=>e.end-e.start);return t.data.end-t.data.start}firstFit(t){if(h(this._head))return null;let e=null,a=this._head;for(;a;){const s=a.data.end-a.data.start;if(s===t)return e?e.next=a.next:this._head=a.next,a.data.start;if(s>t){const r=a.data.start;return a.data.start+=t,r}e=a,a=a.next}return null}free(t,e){const a=t+e;if(h(this._head)){const n=new i({start:t,end:a});return void(this._head=n)}if(a<=this._head.data.start){if(a===this._head.data.start)return void(this._head.data.start-=e);const n=new i({start:t,end:a});return n.next=this._head,void(this._head=n)}let s=this._head,r=s.next;for(;r;){if(r.data.start>=a){if(s.data.end===t){if(s.data.end+=e,s.data.end===r.data.start){const c=r.data.end-r.data.start;return s.data.end+=c,void(s.next=r.next)}return}if(r.data.start===a)return void(r.data.start-=e);const n=new i({start:t,end:a});return n.next=s.next,void(s.next=n)}s=r,r=r.next}if(t===s.data.end)return void(s.data.end+=e);const u=new i({start:t,end:a});s.next=u}}const l=f("esri-2d-log-allocations");class o{constructor(t,e){this._array=t,this._pool=e}get array(){return this._array}get length(){return this._array.length}static create(t,e){const a=e.acquire(t);return new o(a,e)}expand(t){const e=this._pool.acquire(t);e.set(this._array),this._pool.release(this._array),this._array=e}destroy(){this._pool.release(this._array)}set(t,e){this._array.set(t._array,e)}slice(){const t=this._pool.acquire(this._array.byteLength);return t.set(this._array),new o(t,this._pool)}}class d{constructor(){this._data=new ArrayBuffer(d.BYTE_LENGTH),this._freeList=new x({start:0,end:this._data.byteLength})}static get BYTE_LENGTH(){return 64e6}get buffer(){return this._data}allocate(t){const e=this._freeList.firstFit(t);return h(e)?null:new Uint32Array(this._data,e,t/Uint32Array.BYTES_PER_ELEMENT)}free(t){this._freeList.free(t.byteOffset,t.byteLength)}}class E{constructor(){this._bytesAllocated=0,this._pages=[],this._pagesByBuffer=new Map,this._addPage()}destroy(){this._pages=[],this._pagesByBuffer=null}get _bytesTotal(){return this._pages.length*d.BYTE_LENGTH}acquire(t){if(this._bytesAllocated+=t,l&&console.log(`Allocating ${t}, (${this._bytesAllocated} / ${this._bytesTotal})`),t>d.BYTE_LENGTH)return new Uint32Array(t/Uint32Array.BYTES_PER_ELEMENT);for(const e of this._pages){const a=e.allocate(t);if(y(a))return a}return g(this._addPage().allocate(t),"Expected to allocate page")}release(t){this._bytesAllocated-=t.byteLength,l&&console.log(`Freeing ${t.byteLength}, (${this._bytesAllocated} / ${this._bytesTotal})`);const e=this._pagesByBuffer.get(t.buffer);e&&e.free(t)}_addPage(){const t=new d;return this._pages.push(t),this._pagesByBuffer.set(t.buffer,t),t}}export{i as a,x as e,o as i,E as n}; +import{j as h,m as f,c as y,ba as g}from"./index.221827cd.js";class i{constructor(t){if(this.next=null,!Array.isArray(t))return void(this.data=t);this.data=t[0];let e=this;for(let a=1;at(e.data)?this:e;return this.next?this.next.max(t,a):a}remove(t,e=null){var a,s;return this===t?e?(e.next=this.next,e):this.next:(s=(a=this.next)==null?void 0:a.remove(t,this))!=null?s:null}get last(){return this.next?this.next.last:this}}class x{constructor(t){this._head=null,h(t)||(this._head=new i(t))}get head(){return this._head}maxAvailableSpace(){if(h(this._head))return 0;const t=this._head.max(e=>e.end-e.start);return t.data.end-t.data.start}firstFit(t){if(h(this._head))return null;let e=null,a=this._head;for(;a;){const s=a.data.end-a.data.start;if(s===t)return e?e.next=a.next:this._head=a.next,a.data.start;if(s>t){const r=a.data.start;return a.data.start+=t,r}e=a,a=a.next}return null}free(t,e){const a=t+e;if(h(this._head)){const n=new i({start:t,end:a});return void(this._head=n)}if(a<=this._head.data.start){if(a===this._head.data.start)return void(this._head.data.start-=e);const n=new i({start:t,end:a});return n.next=this._head,void(this._head=n)}let s=this._head,r=s.next;for(;r;){if(r.data.start>=a){if(s.data.end===t){if(s.data.end+=e,s.data.end===r.data.start){const c=r.data.end-r.data.start;return s.data.end+=c,void(s.next=r.next)}return}if(r.data.start===a)return void(r.data.start-=e);const n=new i({start:t,end:a});return n.next=s.next,void(s.next=n)}s=r,r=r.next}if(t===s.data.end)return void(s.data.end+=e);const u=new i({start:t,end:a});s.next=u}}const l=f("esri-2d-log-allocations");class o{constructor(t,e){this._array=t,this._pool=e}get array(){return this._array}get length(){return this._array.length}static create(t,e){const a=e.acquire(t);return new o(a,e)}expand(t){const e=this._pool.acquire(t);e.set(this._array),this._pool.release(this._array),this._array=e}destroy(){this._pool.release(this._array)}set(t,e){this._array.set(t._array,e)}slice(){const t=this._pool.acquire(this._array.byteLength);return t.set(this._array),new o(t,this._pool)}}class d{constructor(){this._data=new ArrayBuffer(d.BYTE_LENGTH),this._freeList=new x({start:0,end:this._data.byteLength})}static get BYTE_LENGTH(){return 64e6}get buffer(){return this._data}allocate(t){const e=this._freeList.firstFit(t);return h(e)?null:new Uint32Array(this._data,e,t/Uint32Array.BYTES_PER_ELEMENT)}free(t){this._freeList.free(t.byteOffset,t.byteLength)}}class E{constructor(){this._bytesAllocated=0,this._pages=[],this._pagesByBuffer=new Map,this._addPage()}destroy(){this._pages=[],this._pagesByBuffer=null}get _bytesTotal(){return this._pages.length*d.BYTE_LENGTH}acquire(t){if(this._bytesAllocated+=t,l&&console.log(`Allocating ${t}, (${this._bytesAllocated} / ${this._bytesTotal})`),t>d.BYTE_LENGTH)return new Uint32Array(t/Uint32Array.BYTES_PER_ELEMENT);for(const e of this._pages){const a=e.allocate(t);if(y(a))return a}return g(this._addPage().allocate(t),"Expected to allocate page")}release(t){this._bytesAllocated-=t.byteLength,l&&console.log(`Freeing ${t.byteLength}, (${this._bytesAllocated} / ${this._bytesTotal})`);const e=this._pagesByBuffer.get(t.buffer);e&&e.free(t)}_addPage(){const t=new d;return this._pages.push(t),this._pagesByBuffer.set(t.buffer,t),t}}export{i as a,x as e,o as i,E as n}; diff --git a/assets/BufferView.89055914.js b/assets/BufferView.6eee27cd.js similarity index 99% rename from assets/BufferView.89055914.js rename to assets/BufferView.6eee27cd.js index aa08244..ac8e70b 100644 --- a/assets/BufferView.89055914.js +++ b/assets/BufferView.6eee27cd.js @@ -1 +1 @@ -import{G as z,O as D,fH as _}from"./index.d94abe07.js";class j{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=9;const f=this.TypedArrayConstructor;r===void 0&&(r=9*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getMat(e,t){let s=e*this.typedBufferStride;for(let r=0;r<9;r++)t[r]=this.typedBuffer[s++];return t}setMat(e,t){let s=e*this.typedBufferStride;for(let r=0;r<9;r++)this.typedBuffer[s++]=t[r]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;for(let p=0;p<9;++p)r[f++]=i[u++]}get buffer(){return this.typedBuffer.buffer}}j.ElementCount=9;class k{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=16;const f=this.TypedArrayConstructor;r===void 0&&(r=16*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getMat(e,t){let s=e*this.typedBufferStride;for(let r=0;r<16;r++)t[r]=this.typedBuffer[s++];return t}setMat(e,t){let s=e*this.typedBufferStride;for(let r=0;r<16;r++)this.typedBuffer[s++]=t[r]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;for(let p=0;p<16;++p)r[f++]=i[u++]}get buffer(){return this.typedBuffer.buffer}}k.ElementCount=16;class y{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=1;const f=this.TypedArrayConstructor;r===void 0&&(r=f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.stride=r,this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}get(e){return this.typedBuffer[e*this.typedBufferStride]}set(e,t){this.typedBuffer[e*this.typedBufferStride]=t}get buffer(){return this.typedBuffer.buffer}}y.ElementCount=1;class n{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=2;const f=this.TypedArrayConstructor;r===void 0&&(r=2*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getVec(e,t){return e*=this.typedBufferStride,z(t,this.typedBuffer[e],this.typedBuffer[e+1])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e]=t[1]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}setValues(e,t,s){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e]=s}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;r[f++]=i[u++],r[f]=i[u]}get buffer(){return this.typedBuffer.buffer}}n.ElementCount=2;class h{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=3;const f=this.TypedArrayConstructor;r===void 0&&(r=3*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getVec(e,t){return e*=this.typedBufferStride,D(t,this.typedBuffer[e],this.typedBuffer[e+1],this.typedBuffer[e+2])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e]=t[2]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}setValues(e,t,s,r){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=s,this.typedBuffer[e]=r}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;r[f++]=i[u++],r[f++]=i[u++],r[f]=i[u]}get buffer(){return this.typedBuffer.buffer}}h.ElementCount=3;class c{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.start=s,this.elementCount=4;const f=this.TypedArrayConstructor;r===void 0&&(r=4*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getVec(e,t){return e*=this.typedBufferStride,_(t,this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e++]=t[2],this.typedBuffer[e]=t[3]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}setValues(e,t,s,r,i){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=s,this.typedBuffer[e++]=r,this.typedBuffer[e]=i}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;r[f++]=i[u++],r[f++]=i[u++],r[f++]=i[u++],r[f]=i[u]}get buffer(){return this.typedBuffer.buffer}}c.ElementCount=4;class q extends y{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}static fromTypedArray(e,t){return new q(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}q.ElementType="f32";class l extends n{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(l,e,t)}static fromTypedArray(e,t){return new l(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}l.ElementType="f32";class o extends h{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(o,e,t)}static fromTypedArray(e,t){return new o(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}o.ElementType="f32";class a extends c{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(a,e,t)}static fromTypedArray(e,t){return new a(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}a.ElementType="f32";class B extends j{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(B,e,t)}static fromTypedArray(e,t){return new B(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}B.ElementType="f32";class b extends j{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(b,e,t)}static fromTypedArray(e,t){return new b(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}b.ElementType="f64";class T extends k{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(T,e,t)}static fromTypedArray(e,t){return new T(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}T.ElementType="f32";class E extends k{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(E,e,t)}static fromTypedArray(e,t){return new E(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}E.ElementType="f64";class m extends y{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(m,e,t)}static fromTypedArray(e,t){return new m(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}m.ElementType="f64";class A extends n{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(A,e,t)}static fromTypedArray(e,t){return new A(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}A.ElementType="f64";class O extends h{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(O,e,t)}static fromTypedArray(e,t){return new O(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}O.ElementType="f64";class S extends c{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(S,e,t)}static fromTypedArray(e,t){return new S(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}S.ElementType="f64";class g extends y{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(g,e,t)}static fromTypedArray(e,t){return new g(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}g.ElementType="u8";class L extends n{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(L,e,t)}static fromTypedArray(e,t){return new L(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}L.ElementType="u8";class w extends h{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(w,e,t)}static fromTypedArray(e,t){return new w(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}w.ElementType="u8";class x extends c{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(x,e,t)}static fromTypedArray(e,t){return new x(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}x.ElementType="u8";class M extends y{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(M,e,t)}static fromTypedArray(e,t){return new M(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}M.ElementType="u16";class C extends n{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(C,e,t)}static fromTypedArray(e,t){return new C(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}C.ElementType="u16";class N extends h{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(N,e,t)}static fromTypedArray(e,t){return new N(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}N.ElementType="u16";class P extends c{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(P,e,t)}static fromTypedArray(e,t){return new P(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}P.ElementType="u16";class R extends y{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(R,e,t)}static fromTypedArray(e,t){return new R(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}R.ElementType="u32";class Y extends n{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(Y,e,t)}static fromTypedArray(e,t){return new Y(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Y.ElementType="u32";class F extends h{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(F,e,t)}static fromTypedArray(e,t){return new F(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}F.ElementType="u32";class I extends c{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(I,e,t)}static fromTypedArray(e,t){return new I(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}I.ElementType="u32";class U extends y{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer(U,e,t)}static fromTypedArray(e,t){return new U(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}U.ElementType="i8";class V extends n{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer(V,e,t)}static fromTypedArray(e,t){return new V(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}V.ElementType="i8";class $ extends h{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer($,e,t)}static fromTypedArray(e,t){return new $(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}$.ElementType="i8";class v extends c{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer(v,e,t)}static fromTypedArray(e,t){return new v(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}v.ElementType="i8";class G extends y{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(G,e,t)}static fromTypedArray(e,t){return new G(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}G.ElementType="i16";class H extends n{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(H,e,t)}static fromTypedArray(e,t){return new H(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}H.ElementType="i16";class J extends h{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(J,e,t)}static fromTypedArray(e,t){return new J(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}J.ElementType="i16";class K extends c{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(K,e,t)}static fromTypedArray(e,t){return new K(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}K.ElementType="i16";class Q extends y{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(Q,e,t)}static fromTypedArray(e,t){return new Q(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Q.ElementType="i32";class W extends n{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(W,e,t)}static fromTypedArray(e,t){return new W(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}W.ElementType="i32";class X extends h{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(X,e,t)}static fromTypedArray(e,t){return new X(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}X.ElementType="i32";class Z extends c{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(Z,e,t)}static fromTypedArray(e,t){return new Z(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Z.ElementType="i32";export{L as A,R as B,Q as C,W as D,N as E,Y as F,X as G,Z as H,F as I,P as L,$ as M,w as O,v as S,O as T,I as U,V,b as a,E as b,a as c,g as d,M as g,S as h,o as i,U as j,G as k,B as l,A as m,m as o,T as p,H as q,l as u,J as v,C as w,x,q as y,K as z}; +import{G as z,O as D,fH as _}from"./index.221827cd.js";class j{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=9;const f=this.TypedArrayConstructor;r===void 0&&(r=9*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getMat(e,t){let s=e*this.typedBufferStride;for(let r=0;r<9;r++)t[r]=this.typedBuffer[s++];return t}setMat(e,t){let s=e*this.typedBufferStride;for(let r=0;r<9;r++)this.typedBuffer[s++]=t[r]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;for(let p=0;p<9;++p)r[f++]=i[u++]}get buffer(){return this.typedBuffer.buffer}}j.ElementCount=9;class k{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=16;const f=this.TypedArrayConstructor;r===void 0&&(r=16*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getMat(e,t){let s=e*this.typedBufferStride;for(let r=0;r<16;r++)t[r]=this.typedBuffer[s++];return t}setMat(e,t){let s=e*this.typedBufferStride;for(let r=0;r<16;r++)this.typedBuffer[s++]=t[r]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;for(let p=0;p<16;++p)r[f++]=i[u++]}get buffer(){return this.typedBuffer.buffer}}k.ElementCount=16;class y{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=1;const f=this.TypedArrayConstructor;r===void 0&&(r=f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.stride=r,this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride)}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}get(e){return this.typedBuffer[e*this.typedBufferStride]}set(e,t){this.typedBuffer[e*this.typedBufferStride]=t}get buffer(){return this.typedBuffer.buffer}}y.ElementCount=1;class n{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=2;const f=this.TypedArrayConstructor;r===void 0&&(r=2*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getVec(e,t){return e*=this.typedBufferStride,z(t,this.typedBuffer[e],this.typedBuffer[e+1])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e]=t[1]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}setValues(e,t,s){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e]=s}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;r[f++]=i[u++],r[f]=i[u]}get buffer(){return this.typedBuffer.buffer}}n.ElementCount=2;class h{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.elementCount=3;const f=this.TypedArrayConstructor;r===void 0&&(r=3*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getVec(e,t){return e*=this.typedBufferStride,D(t,this.typedBuffer[e],this.typedBuffer[e+1],this.typedBuffer[e+2])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e]=t[2]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}setValues(e,t,s,r){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=s,this.typedBuffer[e]=r}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;r[f++]=i[u++],r[f++]=i[u++],r[f]=i[u]}get buffer(){return this.typedBuffer.buffer}}h.ElementCount=3;class c{constructor(e,t,s=0,r,i){this.TypedArrayConstructor=e,this.start=s,this.elementCount=4;const f=this.TypedArrayConstructor;r===void 0&&(r=4*f.BYTES_PER_ELEMENT);const u=t.byteLength===0?0:s;this.typedBuffer=i==null?new f(t,u):new f(t,u,(i-s)/f.BYTES_PER_ELEMENT),this.typedBufferStride=r/f.BYTES_PER_ELEMENT,this.count=Math.ceil(this.typedBuffer.length/this.typedBufferStride),this.stride=this.typedBufferStride*this.TypedArrayConstructor.BYTES_PER_ELEMENT}sliceBuffer(e,t,s=this.count-t){const r=this.typedBuffer.byteOffset+t*this.stride;return new e(this.buffer,r,this.stride,r+s*this.stride)}getVec(e,t){return e*=this.typedBufferStride,_(t,this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e++],this.typedBuffer[e])}setVec(e,t){e*=this.typedBufferStride,this.typedBuffer[e++]=t[0],this.typedBuffer[e++]=t[1],this.typedBuffer[e++]=t[2],this.typedBuffer[e]=t[3]}get(e,t){return this.typedBuffer[e*this.typedBufferStride+t]}set(e,t,s){this.typedBuffer[e*this.typedBufferStride+t]=s}setValues(e,t,s,r,i){e*=this.typedBufferStride,this.typedBuffer[e++]=t,this.typedBuffer[e++]=s,this.typedBuffer[e++]=r,this.typedBuffer[e]=i}copyFrom(e,t,s){const r=this.typedBuffer,i=t.typedBuffer;let f=e*this.typedBufferStride,u=s*t.typedBufferStride;r[f++]=i[u++],r[f++]=i[u++],r[f++]=i[u++],r[f]=i[u]}get buffer(){return this.typedBuffer.buffer}}c.ElementCount=4;class q extends y{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}static fromTypedArray(e,t){return new q(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}q.ElementType="f32";class l extends n{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(l,e,t)}static fromTypedArray(e,t){return new l(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}l.ElementType="f32";class o extends h{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(o,e,t)}static fromTypedArray(e,t){return new o(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}o.ElementType="f32";class a extends c{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(a,e,t)}static fromTypedArray(e,t){return new a(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}a.ElementType="f32";class B extends j{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(B,e,t)}static fromTypedArray(e,t){return new B(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}B.ElementType="f32";class b extends j{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(b,e,t)}static fromTypedArray(e,t){return new b(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}b.ElementType="f64";class T extends k{constructor(e,t=0,s,r){super(Float32Array,e,t,s,r),this.elementType="f32"}slice(e,t){return this.sliceBuffer(T,e,t)}static fromTypedArray(e,t){return new T(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}T.ElementType="f32";class E extends k{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(E,e,t)}static fromTypedArray(e,t){return new E(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}E.ElementType="f64";class m extends y{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(m,e,t)}static fromTypedArray(e,t){return new m(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}m.ElementType="f64";class A extends n{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(A,e,t)}static fromTypedArray(e,t){return new A(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}A.ElementType="f64";class O extends h{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(O,e,t)}static fromTypedArray(e,t){return new O(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}O.ElementType="f64";class S extends c{constructor(e,t=0,s,r){super(Float64Array,e,t,s,r),this.elementType="f64"}slice(e,t){return this.sliceBuffer(S,e,t)}static fromTypedArray(e,t){return new S(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}S.ElementType="f64";class g extends y{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(g,e,t)}static fromTypedArray(e,t){return new g(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}g.ElementType="u8";class L extends n{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(L,e,t)}static fromTypedArray(e,t){return new L(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}L.ElementType="u8";class w extends h{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(w,e,t)}static fromTypedArray(e,t){return new w(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}w.ElementType="u8";class x extends c{constructor(e,t=0,s,r){super(Uint8Array,e,t,s,r),this.elementType="u8"}slice(e,t){return this.sliceBuffer(x,e,t)}static fromTypedArray(e,t){return new x(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}x.ElementType="u8";class M extends y{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(M,e,t)}static fromTypedArray(e,t){return new M(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}M.ElementType="u16";class C extends n{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(C,e,t)}static fromTypedArray(e,t){return new C(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}C.ElementType="u16";class N extends h{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(N,e,t)}static fromTypedArray(e,t){return new N(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}N.ElementType="u16";class P extends c{constructor(e,t=0,s,r){super(Uint16Array,e,t,s,r),this.elementType="u16"}slice(e,t){return this.sliceBuffer(P,e,t)}static fromTypedArray(e,t){return new P(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}P.ElementType="u16";class R extends y{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(R,e,t)}static fromTypedArray(e,t){return new R(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}R.ElementType="u32";class Y extends n{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(Y,e,t)}static fromTypedArray(e,t){return new Y(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Y.ElementType="u32";class F extends h{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(F,e,t)}static fromTypedArray(e,t){return new F(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}F.ElementType="u32";class I extends c{constructor(e,t=0,s,r){super(Uint32Array,e,t,s,r),this.elementType="u32"}slice(e,t){return this.sliceBuffer(I,e,t)}static fromTypedArray(e,t){return new I(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}I.ElementType="u32";class U extends y{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer(U,e,t)}static fromTypedArray(e,t){return new U(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}U.ElementType="i8";class V extends n{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer(V,e,t)}static fromTypedArray(e,t){return new V(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}V.ElementType="i8";class $ extends h{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer($,e,t)}static fromTypedArray(e,t){return new $(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}$.ElementType="i8";class v extends c{constructor(e,t=0,s,r){super(Int8Array,e,t,s,r),this.elementType="i8"}slice(e,t){return this.sliceBuffer(v,e,t)}static fromTypedArray(e,t){return new v(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}v.ElementType="i8";class G extends y{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(G,e,t)}static fromTypedArray(e,t){return new G(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}G.ElementType="i16";class H extends n{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(H,e,t)}static fromTypedArray(e,t){return new H(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}H.ElementType="i16";class J extends h{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(J,e,t)}static fromTypedArray(e,t){return new J(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}J.ElementType="i16";class K extends c{constructor(e,t=0,s,r){super(Int16Array,e,t,s,r),this.elementType="i16"}slice(e,t){return this.sliceBuffer(K,e,t)}static fromTypedArray(e,t){return new K(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}K.ElementType="i16";class Q extends y{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(Q,e,t)}static fromTypedArray(e,t){return new Q(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Q.ElementType="i32";class W extends n{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(W,e,t)}static fromTypedArray(e,t){return new W(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}W.ElementType="i32";class X extends h{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(X,e,t)}static fromTypedArray(e,t){return new X(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}X.ElementType="i32";class Z extends c{constructor(e,t=0,s,r){super(Int32Array,e,t,s,r),this.elementType="i32"}slice(e,t){return this.sliceBuffer(Z,e,t)}static fromTypedArray(e,t){return new Z(e.buffer,e.byteOffset,t,e.byteOffset+e.byteLength)}}Z.ElementType="i32";export{L as A,R as B,Q as C,W as D,N as E,Y as F,X as G,Z as H,F as I,P as L,$ as M,w as O,v as S,O as T,I as U,V,b as a,E as b,a as c,g as d,M as g,S as h,o as i,U as j,G as k,B as l,A as m,m as o,T as p,H as q,l as u,J as v,C as w,x,q as y,K as z}; diff --git a/assets/BuildingSceneLayer.0da55a35.js b/assets/BuildingSceneLayer.73877459.js similarity index 97% rename from assets/BuildingSceneLayer.0da55a35.js rename to assets/BuildingSceneLayer.73877459.js index 125aee5..f12dea1 100644 --- a/assets/BuildingSceneLayer.0da55a35.js +++ b/assets/BuildingSceneLayer.73877459.js @@ -1 +1 @@ -import{aP as ue,a6 as t,a7 as s,d2 as j,h0 as ce,ib as q,a8 as p,ic as he,s as F,hT as ee,d0 as te,ci as ge,c as d,hZ as re,id as fe,U as se,dd as me,dc as ve,n as I,d1 as be,j as we,cU as Se,aT as ie,gw as $e,ie as Oe,ig as xe,dv as Fe,ei as oe,ct as Ie,ih as je,cE as w,ii as Le,ij as Te,cx as m,b4 as c,ik as Be,i1 as Ae,eE as Ee,eF as _e,eG as qe,i3 as Ne,eH as Pe,il as Re,ee as ke,eP as Me,aU as Ue,i8 as Ce,im as Qe,io as De,cF as Ke}from"./index.d94abe07.js";import{t as Ve,y as Ze,l as Ge}from"./FetchAssociatedFeatureLayer.7dd7fa59.js";import{n as He,N as Je,L as H}from"./SceneService.0f3bf01a.js";import{s as ze,l as We,u as Xe,m as Ye}from"./I3SLayerDefinitions.96f4da60.js";import{d as et,s as tt}from"./popupUtils.4abb3ffd.js";import"./mat3f64.6d32a1d7.js";import"./mat4f64.ff2a477c.js";import"./quat.b3994f2f.js";import"./quatf64.4ae3e6f1.js";import"./I3SBinaryReader.9c0bbe1b.js";import"./VertexAttribute.42396f25.js";import"./symbolColorUtils.d5fe1bd7.js";import"./vec3f32.1121a836.js";import"./plane.86573aee.js";import"./sphere.ec1f4496.js";import"./originUtils.2d0aad75.js";import"./multiOriginJSONSupportUtils.38b69b9c.js";import"./resourceUtils.6d10bf82.js";let y=class extends ue(he){constructor(e){super(e),this.title="",this.id=-1,this.modelName=null,this.isEmpty=null,this.visible=!0,this.opacity=1}readTitle(e,r){return typeof r.alias=="string"?r.alias:typeof r.name=="string"?r.name:""}readIdOnlyOnce(e){return this.id!==-1?this.id:typeof e=="number"?e:-1}};t([s({type:String,json:{origins:{"web-scene":{write:!0},"portal-item":{write:!0}}}})],y.prototype,"title",void 0),t([j("service","title",["alias","name"])],y.prototype,"readTitle",null),t([s()],y.prototype,"layer",void 0),t([s({type:ce,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],y.prototype,"id",void 0),t([j("service","id")],y.prototype,"readIdOnlyOnce",null),t([s(q(String))],y.prototype,"modelName",void 0),t([s(q(Boolean))],y.prototype,"isEmpty",void 0),t([s({type:Boolean,json:{name:"visibility",write:!0}})],y.prototype,"visible",void 0),t([s({type:Number,json:{write:!0}})],y.prototype,"opacity",void 0),y=t([p("esri.layers.buildingSublayers.BuildingSublayer")],y);const ae=y,ne="esri.layers.buildingSublayers.BuildingComponentSublayer",rt=F.getLogger(ne),J=je();let a=class extends ee.LoadableMixin(te(ae)){constructor(e){super(e),this.type="building-component",this.nodePages=null,this.materialDefinitions=[],this.textureSetDefinitions=[],this.geometryDefinitions=[],this.indexInfo=null,this.serviceUpdateTimeStamp=null,this.store=null,this.attributeStorageInfo=[],this.fields=[],this.associatedLayer=null,this.outFields=null,this.listMode="show",this.renderer=null,this.definitionExpression=null,this.popupEnabled=!0,this.popupTemplate=null,this.layerType="3d-object"}get parsedUrl(){var e,r;return this.layer?{path:`${(e=this.layer.parsedUrl)==null?void 0:e.path}/sublayers/${this.id}`,query:(r=this.layer.parsedUrl)==null?void 0:r.query}:{path:""}}get fieldsIndex(){return new ge(this.fields)}readAssociatedLayer(e,r){const i=this.layer.associatedFeatureServiceItem,o=r.associatedLayerID;return d(i)&&typeof o=="number"?new re({portalItem:i,layerId:o}):null}get objectIdField(){if(this.fields!=null){for(const e of this.fields)if(e.type==="oid")return e.name}return null}get displayField(){return d(this.associatedLayer)?this.associatedLayer.displayField:void 0}get apiKey(){return this.layer.apiKey}get fullExtent(){return this.layer.fullExtent}get spatialReference(){return this.layer.spatialReference}get version(){return this.layer.version}get elevationInfo(){return this.layer.elevationInfo}get minScale(){return this.layer.minScale}get maxScale(){return this.layer.maxScale}get effectiveScaleRange(){return this.layer.effectiveScaleRange}get defaultPopupTemplate(){return this.createPopupTemplate()}load(e){const r=d(e)?e.signal:null,i=this._fetchService(r).then(()=>{this.indexInfo=He(this.parsedUrl.path,this.rootNode,this.nodePages,this.apiKey,rt,r)});return this.addResolvingPromise(i),Promise.resolve(this)}createPopupTemplate(e){return fe(this,e)}async _fetchService(e){const r=(await se(this.parsedUrl.path,{query:{f:"json",token:this.apiKey},responseType:"json",signal:e})).data;this.read(r,{origin:"service",url:this.parsedUrl})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,r){var o,n,h,G;const i=(n=(o=this.getFeatureType(r==null?void 0:r.feature))==null?void 0:o.domains)==null?void 0:n[e];return i&&i.type!=="inherited"?i:(G=(h=this.getField(e))==null?void 0:h.domain)!=null?G:null}getFeatureType(e){return e&&d(this.associatedLayer)?this.associatedLayer.getFeatureType(e):null}get types(){var e;return d(this.associatedLayer)?(e=this.associatedLayer.types)!=null?e:[]:[]}get typeIdField(){return d(this.associatedLayer)?this.associatedLayer.typeIdField:null}get geometryType(){return this.layerType==="3d-object"?"mesh":"point"}get profile(){return this.layerType==="3d-object"?"mesh-pyramids":"points"}get capabilities(){const e=d(this.associatedLayer)&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:Ve,{query:r,data:{supportsZ:i,supportsM:o,isVersioned:n}}=e;return{query:r,data:{supportsZ:i,supportsM:o,isVersioned:n}}}createQuery(){const e=new me;return this.geometryType!=="mesh"&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,r){return this._getAssociatedLayerForQuery().then(i=>i.queryExtent(e||this.createQuery(),r))}queryFeatureCount(e,r){return this._getAssociatedLayerForQuery().then(i=>i.queryFeatureCount(e||this.createQuery(),r))}queryFeatures(e,r){return this._getAssociatedLayerForQuery().then(i=>i.queryFeatures(e||this.createQuery(),r)).then(i=>{if(i!=null&&i.features)for(const o of i.features)o.layer=this.layer,o.sourceLayer=this;return i})}queryObjectIds(e,r){return this._getAssociatedLayerForQuery().then(i=>i.queryObjectIds(e||this.createQuery(),r))}async queryCachedAttributes(e,r){const i=ve(this.fieldsIndex,await et(this,tt(this)));return Ze(this.parsedUrl.path,this.attributeStorageInfo,e,r,i)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||i.length===0)throw new I("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const o=new be;return o.attributes=i[0],o.layer=this,o.sourceLayer=this,o}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:d(this.associatedLayer)}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return d(e)&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),we(this.associatedLayer))throw new I("buildingscenelayer:query-not-available","BuildingSceneLayer component layer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new I("buildingscenelayer:query-not-available","BuildingSceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}};t([s({readOnly:!0})],a.prototype,"parsedUrl",null),t([s({type:ze,readOnly:!0})],a.prototype,"nodePages",void 0),t([s({type:[We],readOnly:!0})],a.prototype,"materialDefinitions",void 0),t([s({type:[Xe],readOnly:!0})],a.prototype,"textureSetDefinitions",void 0),t([s({type:[Ye],readOnly:!0})],a.prototype,"geometryDefinitions",void 0),t([s({readOnly:!0})],a.prototype,"serviceUpdateTimeStamp",void 0),t([s({readOnly:!0})],a.prototype,"store",void 0),t([s({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],a.prototype,"rootNode",void 0),t([s({readOnly:!0})],a.prototype,"attributeStorageInfo",void 0),t([s(J.fields)],a.prototype,"fields",void 0),t([s({readOnly:!0})],a.prototype,"fieldsIndex",null),t([s({readOnly:!0,type:re})],a.prototype,"associatedLayer",void 0),t([j("service","associatedLayer",["associatedLayerID"])],a.prototype,"readAssociatedLayer",null),t([s(J.outFields)],a.prototype,"outFields",void 0),t([s({type:String,readOnly:!0})],a.prototype,"objectIdField",null),t([s({readOnly:!0,type:String,json:{read:!1}})],a.prototype,"displayField",null),t([s({readOnly:!0,type:String})],a.prototype,"apiKey",null),t([s({readOnly:!0,type:Se})],a.prototype,"fullExtent",null),t([s({readOnly:!0,type:ie})],a.prototype,"spatialReference",null),t([s({readOnly:!0})],a.prototype,"version",null),t([s({readOnly:!0,type:$e})],a.prototype,"elevationInfo",null),t([s({readOnly:!0,type:Number})],a.prototype,"minScale",null),t([s({readOnly:!0,type:Number})],a.prototype,"maxScale",null),t([s({readOnly:!0,type:Number})],a.prototype,"effectiveScaleRange",null),t([s({type:["hide","show"],json:{write:!0}})],a.prototype,"listMode",void 0),t([s({types:Oe,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],a.prototype,"renderer",void 0),t([s({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],a.prototype,"definitionExpression",void 0),t([s(xe)],a.prototype,"popupEnabled",void 0),t([s({type:Fe,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],a.prototype,"popupTemplate",void 0),t([s({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],a.prototype,"normalReferenceFrame",void 0),t([s({readOnly:!0,json:{read:!1}})],a.prototype,"defaultPopupTemplate",null),t([s()],a.prototype,"types",null),t([s()],a.prototype,"typeIdField",null),t([s({json:{write:!1}}),oe(new Ie({"3DObject":"3d-object",Point:"point"}))],a.prototype,"layerType",void 0),t([s()],a.prototype,"geometryType",null),t([s()],a.prototype,"profile",null),t([s({readOnly:!0,json:{read:!1}})],a.prototype,"capabilities",null),a=t([p(ne)],a);const N=a;var P;const z={type:w,readOnly:!0,json:{origins:{service:{read:{source:"sublayers",reader:le}}},read:!1}};function le(e,r,i){if(e&&Array.isArray(e))return new w(e.map(o=>{const n=st(o);if(n){const h=new n;return h.read(o,i),h}return i&&i.messages&&o&&i.messages.push(new Le("building-scene-layer:unsupported-sublayer-type","Building scene sublayer of type '"+(o.type||"unknown")+"' are not supported",{definition:o,context:i})),null}))}let f=P=class extends ae{constructor(e){super(e),this.type="building-group",this.listMode="show",this.sublayers=null}loadAll(){return Te(this,e=>P.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}))}};function st(e){return e.layerType==="group"?f:N}t([s({type:["hide","show","hide-children"],json:{write:!0}})],f.prototype,"listMode",void 0),t([s(z)],f.prototype,"sublayers",void 0),f=P=t([p("esri.layers.buildingSublayers.BuildingGroupSublayer")],f),function(e){function r(i,o){i.forEach(n=>{o(n),n.type==="building-group"&&r(n.sublayers,o)})}e.sublayersProperty=z,e.readSublayers=le,e.forEachSublayer=r}(f||(f={}));const v=f;let L=class extends m{constructor(){super(...arguments),this.type=null}};t([s({type:String,readOnly:!0,json:{write:!0}})],L.prototype,"type",void 0),L=t([p("esri.layers.support.BuildingFilterAuthoringInfo")],L);const pe=L;var R;let S=R=class extends m{constructor(){super(...arguments),this.filterType=null,this.filterValues=null}clone(){return new R({filterType:this.filterType,filterValues:c(this.filterValues)})}};t([s({type:String,json:{write:!0}})],S.prototype,"filterType",void 0),t([s({type:[String],json:{write:!0}})],S.prototype,"filterValues",void 0),S=R=t([p("esri.layers.support.BuildingFilterAuthoringInfoType")],S);const it=S;var k;const ot=w.ofType(it);let T=k=class extends m{clone(){return new k({filterTypes:c(this.filterTypes)})}};t([s({type:ot,json:{write:!0}})],T.prototype,"filterTypes",void 0),T=k=t([p("esri.layers.support.BuildingFilterAuthoringInfoBlock")],T);const at=T;var M;const nt=w.ofType(at);let $=M=class extends pe{constructor(){super(...arguments),this.type="checkbox"}clone(){return new M({filterBlocks:c(this.filterBlocks)})}};t([s({type:["checkbox"]})],$.prototype,"type",void 0),t([s({type:nt,json:{write:!0}})],$.prototype,"filterBlocks",void 0),$=M=t([p("esri.layers.support.BuildingFilterAuthoringInfoCheckbox")],$);const W=$;let B=class extends m{};t([s({readOnly:!0,json:{read:!1}})],B.prototype,"type",void 0),B=t([p("esri.layers.support.BuildingFilterMode")],B);const _=B;var U;let A=U=class extends _{constructor(){super(...arguments),this.type="solid"}clone(){return new U}};t([s({type:["solid"],readOnly:!0,json:{write:!0}})],A.prototype,"type",void 0),A=U=t([p("esri.layers.support.BuildingFilterModeSolid")],A);const C=A;var Q;let O=Q=class extends _{constructor(){super(...arguments),this.type="wire-frame",this.edges=null}clone(){return new Q({edges:c(this.edges)})}};t([oe({wireFrame:"wire-frame"})],O.prototype,"type",void 0),t([s(Be)],O.prototype,"edges",void 0),O=Q=t([p("esri.layers.support.BuildingFilterModeWireFrame")],O);const X=O;var D;let E=D=class extends _{constructor(){super(...arguments),this.type="x-ray"}clone(){return new D}};t([s({type:["x-ray"],readOnly:!0,json:{write:!0}})],E.prototype,"type",void 0),E=D=t([p("esri.layers.support.BuildingFilterModeXRay")],E);const Y=E;var K;const lt={nonNullable:!0,types:{key:"type",base:_,typeMap:{solid:C,"wire-frame":X,"x-ray":Y}},json:{read:e=>{switch(e&&e.type){case"solid":return C.fromJSON(e);case"wireFrame":return X.fromJSON(e);case"x-ray":return Y.fromJSON(e);default:return}},write:{enabled:!0,isRequired:!0}}};let b=K=class extends m{constructor(){super(...arguments),this.filterExpression=null,this.filterMode=new C,this.title=""}clone(){return new K({filterExpression:this.filterExpression,filterMode:c(this.filterMode),title:this.title})}};t([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"filterExpression",void 0),t([s(lt)],b.prototype,"filterMode",void 0),t([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"title",void 0),b=K=t([p("esri.layers.support.BuildingFilterBlock")],b);const pt=b;var V;const yt=w.ofType(pt);let g=V=class extends m{constructor(){super(...arguments),this.description=null,this.filterBlocks=null,this.id=Ae(),this.name=null}clone(){return new V({description:this.description,filterBlocks:c(this.filterBlocks),id:this.id,name:this.name,filterAuthoringInfo:c(this.filterAuthoringInfo)})}};t([s({type:String,json:{write:!0}})],g.prototype,"description",void 0),t([s({type:yt,json:{write:{enabled:!0,isRequired:!0}}})],g.prototype,"filterBlocks",void 0),t([s({types:{key:"type",base:pe,typeMap:{checkbox:W}},json:{read:e=>(e&&e.type)==="checkbox"?W.fromJSON(e):null,write:!0}})],g.prototype,"filterAuthoringInfo",void 0),t([s({type:String,constructOnly:!0,json:{write:{enabled:!0,isRequired:!0}}})],g.prototype,"id",void 0),t([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],g.prototype,"name",void 0),g=V=t([p("esri.layers.support.BuildingFilter")],g);const dt=g;let u=class extends m{constructor(){super(...arguments),this.fieldName=null,this.modelName=null,this.label=null,this.min=null,this.max=null,this.mostFrequentValues=null,this.subLayerIds=null}};t([s({type:String})],u.prototype,"fieldName",void 0),t([s({type:String})],u.prototype,"modelName",void 0),t([s({type:String})],u.prototype,"label",void 0),t([s({type:Number})],u.prototype,"min",void 0),t([s({type:Number})],u.prototype,"max",void 0),t([s({json:{read:e=>Array.isArray(e)&&(e.every(r=>typeof r=="string")||e.every(r=>typeof r=="number"))?e.slice():null}})],u.prototype,"mostFrequentValues",void 0),t([s({type:[Number]})],u.prototype,"subLayerIds",void 0),u=t([p("esri.layers.support.BuildingFieldStatistics")],u);let x=class extends ee.LoadableMixin(te(m)){constructor(){super(...arguments),this.url=null}get fields(){return this.loaded||this.loadStatus==="loading"?this._get("fields"):(F.getLogger(this.declaredClass).error("building summary statistics are not loaded"),null)}load(e){const r=d(e)?e.signal:null;return this.addResolvingPromise(this._fetchService(r)),Promise.resolve(this)}async _fetchService(e){const r=(await se(this.url,{query:{f:"json"},responseType:"json",signal:e})).data;this.read(r,{origin:"service"})}};t([s({constructOnly:!0,type:String})],x.prototype,"url",void 0),t([s({readOnly:!0,type:[u],json:{read:{source:"summary"}}})],x.prototype,"fields",null),x=t([p("esri.layers.support.BuildingSummaryStatistics")],x);const ye=x,de=w.ofType(dt),Z=c(v.sublayersProperty);Z.json.origins["web-scene"]={type:[N],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}},Z.json.origins["portal-item"]={type:[N],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}};let l=class extends Je(Ee(_e(qe(Ne(Pe(Re(Ke))))))){constructor(e){super(e),this.operationalLayerType="BuildingSceneLayer",this.allSublayers=new ke({getCollections:()=>[this.sublayers],getChildrenFunction:r=>r.type==="building-group"?r.sublayers:null}),this.sublayers=null,this._sublayerOverrides=null,this.filters=new de,this.activeFilterId=null,this.summaryStatistics=null,this.outFields=null,this.type="building-scene"}normalizeCtorArgs(e){return typeof e=="string"?{url:e}:e!=null?e:{}}destroy(){this.allSublayers.destroy()}readSublayers(e,r,i){const o=v.readSublayers(e,r,i);return v.forEachSublayer(o,n=>n.layer=this),this._sublayerOverrides&&(this.applySublayerOverrides(o,this._sublayerOverrides),this._sublayerOverrides=null),o}applySublayerOverrides(e,{overrides:r,context:i}){v.forEachSublayer(e,o=>o.read(r.get(o.id),i))}readSublayerOverrides(e,r){var o;const i=new Map;for(const n of e)n!=null&&typeof n=="object"&&typeof n.id=="number"?i.set(n.id,n):(o=r.messages)==null||o.push(new I("building-scene-layer:invalid-sublayer-override","Invalid value for sublayer override. Not an object or no id specified.",{value:n}));return{overrides:i,context:r}}writeSublayerOverrides(e,r,i){const o=[];v.forEachSublayer(this.sublayers,n=>{const h=n.write({},i);Object.keys(h).length>1&&o.push(h)}),o.length>0&&(r.sublayers=o)}writeUnappliedOverrides(e,r){r.sublayers=[],e.overrides.forEach(i=>{r.sublayers.push(c(i))})}write(e,r){return e=super.write(e,r),!r||r.origin!=="web-scene"&&r.origin!=="portal-item"||(this.sublayers?this.writeSublayerOverrides(this.sublayers,e,r):this._sublayerOverrides&&this.writeUnappliedOverrides(this._sublayerOverrides,e)),e}read(e,r){if(super.read(e,r),r&&(r.origin==="web-scene"||r.origin==="portal-item")&&e!=null&&Array.isArray(e.sublayers)){const i=this.readSublayerOverrides(e.sublayers,r);this.sublayers?this.applySublayerOverrides(this.sublayers,i):this._sublayerOverrides=i}}readSummaryStatistics(e,r){var i;if(typeof r.statisticsHRef=="string"){const o=Me((i=this.parsedUrl)==null?void 0:i.path,r.statisticsHRef);return new ye({url:o})}return null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}load(e){const r=d(e)?e.signal:null,i=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(Ue).then(()=>this._fetchService(r)).then(()=>this._fetchAssociatedFeatureService(r));return this.addResolvingPromise(i),Promise.resolve(this)}loadAll(){return Ce(this,e=>{v.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}),this.summaryStatistics&&e(this.summaryStatistics)})}async saveAs(e,r){return this._debouncedSaveOperations(H.SAVE_AS,{...r,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"};return this._debouncedSaveOperations(H.SAVE,e)}validateLayer(e){if(!e.layerType||e.layerType!=="Building")throw new I("buildingscenelayer:layer-type-not-supported","BuildingSceneLayer does not support this layer type",{layerType:e.layerType})}_getTypeKeywords(){return["Building"]}_validateElevationInfo(){const e=this.elevationInfo;e&&(e.mode!=="absolute-height"&&F.getLogger(this.declaredClass).warn(".elevationInfo=","Building scene layers only support absolute-height elevation mode"),e.featureExpressionInfo&&e.featureExpressionInfo.expression!=="0"&&F.getLogger(this.declaredClass).warn(".elevationInfo=","Building scene layers do not support featureExpressionInfo"))}async _fetchAssociatedFeatureService(e){const r=new Ge(this.parsedUrl,this.portalItem,this.apiKey,e);try{this.associatedFeatureServiceItem=await r.fetchPortalItem()}catch(i){F.getLogger(this.declaredClass).warn("Associated feature service item could not be loaded",i)}}};t([s({type:["BuildingSceneLayer"]})],l.prototype,"operationalLayerType",void 0),t([s({readOnly:!0})],l.prototype,"allSublayers",void 0),t([s(Z)],l.prototype,"sublayers",void 0),t([j("service","sublayers")],l.prototype,"readSublayers",null),t([s({type:de,nonNullable:!0,json:{write:!0}})],l.prototype,"filters",void 0),t([s({type:String,json:{write:!0}})],l.prototype,"activeFilterId",void 0),t([s({readOnly:!0,type:ye})],l.prototype,"summaryStatistics",void 0),t([j("summaryStatistics",["statisticsHRef"])],l.prototype,"readSummaryStatistics",null),t([s({type:[String],json:{read:!1}})],l.prototype,"outFields",void 0),t([s(Qe)],l.prototype,"fullExtent",void 0),t([s({type:["show","hide","hide-children"]})],l.prototype,"listMode",void 0),t([s(q(ie))],l.prototype,"spatialReference",void 0),t([s(De)],l.prototype,"elevationInfo",null),t([s({json:{read:!1},readOnly:!0})],l.prototype,"type",void 0),t([s()],l.prototype,"associatedFeatureServiceItem",void 0),l=t([p("esri.layers.BuildingSceneLayer")],l);const Bt=l;export{Bt as default}; +import{aP as ue,a6 as t,a7 as s,d2 as j,h0 as ce,ib as q,a8 as p,ic as he,s as F,hT as ee,d0 as te,ci as ge,c as d,hZ as re,id as fe,U as se,dd as me,dc as ve,n as I,d1 as be,j as we,cU as Se,aT as ie,gw as $e,ie as Oe,ig as xe,dv as Fe,ei as oe,ct as Ie,ih as je,cE as w,ii as Le,ij as Te,cx as m,b4 as c,ik as Be,i1 as Ae,eE as Ee,eF as _e,eG as qe,i3 as Ne,eH as Pe,il as Re,ee as ke,eP as Me,aU as Ue,i8 as Ce,im as Qe,io as De,cF as Ke}from"./index.221827cd.js";import{t as Ve,y as Ze,l as Ge}from"./FetchAssociatedFeatureLayer.f6cbad39.js";import{n as He,N as Je,L as H}from"./SceneService.9c2e5b40.js";import{s as ze,l as We,u as Xe,m as Ye}from"./I3SLayerDefinitions.0127897b.js";import{d as et,s as tt}from"./popupUtils.c6371f3a.js";import"./mat3f64.6d32a1d7.js";import"./mat4f64.ff2a477c.js";import"./quat.d9562009.js";import"./quatf64.4ae3e6f1.js";import"./I3SBinaryReader.2f855706.js";import"./VertexAttribute.42396f25.js";import"./symbolColorUtils.36aaa708.js";import"./vec3f32.1121a836.js";import"./plane.444b53ce.js";import"./sphere.f99ddb50.js";import"./originUtils.2d0aad75.js";import"./multiOriginJSONSupportUtils.38b69b9c.js";import"./resourceUtils.f4b6e42a.js";let y=class extends ue(he){constructor(e){super(e),this.title="",this.id=-1,this.modelName=null,this.isEmpty=null,this.visible=!0,this.opacity=1}readTitle(e,r){return typeof r.alias=="string"?r.alias:typeof r.name=="string"?r.name:""}readIdOnlyOnce(e){return this.id!==-1?this.id:typeof e=="number"?e:-1}};t([s({type:String,json:{origins:{"web-scene":{write:!0},"portal-item":{write:!0}}}})],y.prototype,"title",void 0),t([j("service","title",["alias","name"])],y.prototype,"readTitle",null),t([s()],y.prototype,"layer",void 0),t([s({type:ce,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],y.prototype,"id",void 0),t([j("service","id")],y.prototype,"readIdOnlyOnce",null),t([s(q(String))],y.prototype,"modelName",void 0),t([s(q(Boolean))],y.prototype,"isEmpty",void 0),t([s({type:Boolean,json:{name:"visibility",write:!0}})],y.prototype,"visible",void 0),t([s({type:Number,json:{write:!0}})],y.prototype,"opacity",void 0),y=t([p("esri.layers.buildingSublayers.BuildingSublayer")],y);const ae=y,ne="esri.layers.buildingSublayers.BuildingComponentSublayer",rt=F.getLogger(ne),J=je();let a=class extends ee.LoadableMixin(te(ae)){constructor(e){super(e),this.type="building-component",this.nodePages=null,this.materialDefinitions=[],this.textureSetDefinitions=[],this.geometryDefinitions=[],this.indexInfo=null,this.serviceUpdateTimeStamp=null,this.store=null,this.attributeStorageInfo=[],this.fields=[],this.associatedLayer=null,this.outFields=null,this.listMode="show",this.renderer=null,this.definitionExpression=null,this.popupEnabled=!0,this.popupTemplate=null,this.layerType="3d-object"}get parsedUrl(){var e,r;return this.layer?{path:`${(e=this.layer.parsedUrl)==null?void 0:e.path}/sublayers/${this.id}`,query:(r=this.layer.parsedUrl)==null?void 0:r.query}:{path:""}}get fieldsIndex(){return new ge(this.fields)}readAssociatedLayer(e,r){const i=this.layer.associatedFeatureServiceItem,o=r.associatedLayerID;return d(i)&&typeof o=="number"?new re({portalItem:i,layerId:o}):null}get objectIdField(){if(this.fields!=null){for(const e of this.fields)if(e.type==="oid")return e.name}return null}get displayField(){return d(this.associatedLayer)?this.associatedLayer.displayField:void 0}get apiKey(){return this.layer.apiKey}get fullExtent(){return this.layer.fullExtent}get spatialReference(){return this.layer.spatialReference}get version(){return this.layer.version}get elevationInfo(){return this.layer.elevationInfo}get minScale(){return this.layer.minScale}get maxScale(){return this.layer.maxScale}get effectiveScaleRange(){return this.layer.effectiveScaleRange}get defaultPopupTemplate(){return this.createPopupTemplate()}load(e){const r=d(e)?e.signal:null,i=this._fetchService(r).then(()=>{this.indexInfo=He(this.parsedUrl.path,this.rootNode,this.nodePages,this.apiKey,rt,r)});return this.addResolvingPromise(i),Promise.resolve(this)}createPopupTemplate(e){return fe(this,e)}async _fetchService(e){const r=(await se(this.parsedUrl.path,{query:{f:"json",token:this.apiKey},responseType:"json",signal:e})).data;this.read(r,{origin:"service",url:this.parsedUrl})}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,r){var o,n,h,G;const i=(n=(o=this.getFeatureType(r==null?void 0:r.feature))==null?void 0:o.domains)==null?void 0:n[e];return i&&i.type!=="inherited"?i:(G=(h=this.getField(e))==null?void 0:h.domain)!=null?G:null}getFeatureType(e){return e&&d(this.associatedLayer)?this.associatedLayer.getFeatureType(e):null}get types(){var e;return d(this.associatedLayer)?(e=this.associatedLayer.types)!=null?e:[]:[]}get typeIdField(){return d(this.associatedLayer)?this.associatedLayer.typeIdField:null}get geometryType(){return this.layerType==="3d-object"?"mesh":"point"}get profile(){return this.layerType==="3d-object"?"mesh-pyramids":"points"}get capabilities(){const e=d(this.associatedLayer)&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:Ve,{query:r,data:{supportsZ:i,supportsM:o,isVersioned:n}}=e;return{query:r,data:{supportsZ:i,supportsM:o,isVersioned:n}}}createQuery(){const e=new me;return this.geometryType!=="mesh"&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,r){return this._getAssociatedLayerForQuery().then(i=>i.queryExtent(e||this.createQuery(),r))}queryFeatureCount(e,r){return this._getAssociatedLayerForQuery().then(i=>i.queryFeatureCount(e||this.createQuery(),r))}queryFeatures(e,r){return this._getAssociatedLayerForQuery().then(i=>i.queryFeatures(e||this.createQuery(),r)).then(i=>{if(i!=null&&i.features)for(const o of i.features)o.layer=this.layer,o.sourceLayer=this;return i})}queryObjectIds(e,r){return this._getAssociatedLayerForQuery().then(i=>i.queryObjectIds(e||this.createQuery(),r))}async queryCachedAttributes(e,r){const i=ve(this.fieldsIndex,await et(this,tt(this)));return Ze(this.parsedUrl.path,this.attributeStorageInfo,e,r,i)}async queryCachedFeature(e,r){const i=await this.queryCachedAttributes(e,[r]);if(!i||i.length===0)throw new I("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const o=new be;return o.attributes=i[0],o.layer=this,o.sourceLayer=this,o}getFieldUsageInfo(e){return this.fieldsIndex.has(e)?{supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1}:{supportsLabelingInfo:!1,supportsRenderer:!0,supportsPopupTemplate:!0,supportsLayerQuery:d(this.associatedLayer)}}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return d(e)&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),we(this.associatedLayer))throw new I("buildingscenelayer:query-not-available","BuildingSceneLayer component layer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new I("buildingscenelayer:query-not-available","BuildingSceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}};t([s({readOnly:!0})],a.prototype,"parsedUrl",null),t([s({type:ze,readOnly:!0})],a.prototype,"nodePages",void 0),t([s({type:[We],readOnly:!0})],a.prototype,"materialDefinitions",void 0),t([s({type:[Xe],readOnly:!0})],a.prototype,"textureSetDefinitions",void 0),t([s({type:[Ye],readOnly:!0})],a.prototype,"geometryDefinitions",void 0),t([s({readOnly:!0})],a.prototype,"serviceUpdateTimeStamp",void 0),t([s({readOnly:!0})],a.prototype,"store",void 0),t([s({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],a.prototype,"rootNode",void 0),t([s({readOnly:!0})],a.prototype,"attributeStorageInfo",void 0),t([s(J.fields)],a.prototype,"fields",void 0),t([s({readOnly:!0})],a.prototype,"fieldsIndex",null),t([s({readOnly:!0,type:re})],a.prototype,"associatedLayer",void 0),t([j("service","associatedLayer",["associatedLayerID"])],a.prototype,"readAssociatedLayer",null),t([s(J.outFields)],a.prototype,"outFields",void 0),t([s({type:String,readOnly:!0})],a.prototype,"objectIdField",null),t([s({readOnly:!0,type:String,json:{read:!1}})],a.prototype,"displayField",null),t([s({readOnly:!0,type:String})],a.prototype,"apiKey",null),t([s({readOnly:!0,type:Se})],a.prototype,"fullExtent",null),t([s({readOnly:!0,type:ie})],a.prototype,"spatialReference",null),t([s({readOnly:!0})],a.prototype,"version",null),t([s({readOnly:!0,type:$e})],a.prototype,"elevationInfo",null),t([s({readOnly:!0,type:Number})],a.prototype,"minScale",null),t([s({readOnly:!0,type:Number})],a.prototype,"maxScale",null),t([s({readOnly:!0,type:Number})],a.prototype,"effectiveScaleRange",null),t([s({type:["hide","show"],json:{write:!0}})],a.prototype,"listMode",void 0),t([s({types:Oe,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],a.prototype,"renderer",void 0),t([s({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],a.prototype,"definitionExpression",void 0),t([s(xe)],a.prototype,"popupEnabled",void 0),t([s({type:Fe,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],a.prototype,"popupTemplate",void 0),t([s({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],a.prototype,"normalReferenceFrame",void 0),t([s({readOnly:!0,json:{read:!1}})],a.prototype,"defaultPopupTemplate",null),t([s()],a.prototype,"types",null),t([s()],a.prototype,"typeIdField",null),t([s({json:{write:!1}}),oe(new Ie({"3DObject":"3d-object",Point:"point"}))],a.prototype,"layerType",void 0),t([s()],a.prototype,"geometryType",null),t([s()],a.prototype,"profile",null),t([s({readOnly:!0,json:{read:!1}})],a.prototype,"capabilities",null),a=t([p(ne)],a);const N=a;var P;const z={type:w,readOnly:!0,json:{origins:{service:{read:{source:"sublayers",reader:le}}},read:!1}};function le(e,r,i){if(e&&Array.isArray(e))return new w(e.map(o=>{const n=st(o);if(n){const h=new n;return h.read(o,i),h}return i&&i.messages&&o&&i.messages.push(new Le("building-scene-layer:unsupported-sublayer-type","Building scene sublayer of type '"+(o.type||"unknown")+"' are not supported",{definition:o,context:i})),null}))}let f=P=class extends ae{constructor(e){super(e),this.type="building-group",this.listMode="show",this.sublayers=null}loadAll(){return Te(this,e=>P.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}))}};function st(e){return e.layerType==="group"?f:N}t([s({type:["hide","show","hide-children"],json:{write:!0}})],f.prototype,"listMode",void 0),t([s(z)],f.prototype,"sublayers",void 0),f=P=t([p("esri.layers.buildingSublayers.BuildingGroupSublayer")],f),function(e){function r(i,o){i.forEach(n=>{o(n),n.type==="building-group"&&r(n.sublayers,o)})}e.sublayersProperty=z,e.readSublayers=le,e.forEachSublayer=r}(f||(f={}));const v=f;let L=class extends m{constructor(){super(...arguments),this.type=null}};t([s({type:String,readOnly:!0,json:{write:!0}})],L.prototype,"type",void 0),L=t([p("esri.layers.support.BuildingFilterAuthoringInfo")],L);const pe=L;var R;let S=R=class extends m{constructor(){super(...arguments),this.filterType=null,this.filterValues=null}clone(){return new R({filterType:this.filterType,filterValues:c(this.filterValues)})}};t([s({type:String,json:{write:!0}})],S.prototype,"filterType",void 0),t([s({type:[String],json:{write:!0}})],S.prototype,"filterValues",void 0),S=R=t([p("esri.layers.support.BuildingFilterAuthoringInfoType")],S);const it=S;var k;const ot=w.ofType(it);let T=k=class extends m{clone(){return new k({filterTypes:c(this.filterTypes)})}};t([s({type:ot,json:{write:!0}})],T.prototype,"filterTypes",void 0),T=k=t([p("esri.layers.support.BuildingFilterAuthoringInfoBlock")],T);const at=T;var M;const nt=w.ofType(at);let $=M=class extends pe{constructor(){super(...arguments),this.type="checkbox"}clone(){return new M({filterBlocks:c(this.filterBlocks)})}};t([s({type:["checkbox"]})],$.prototype,"type",void 0),t([s({type:nt,json:{write:!0}})],$.prototype,"filterBlocks",void 0),$=M=t([p("esri.layers.support.BuildingFilterAuthoringInfoCheckbox")],$);const W=$;let B=class extends m{};t([s({readOnly:!0,json:{read:!1}})],B.prototype,"type",void 0),B=t([p("esri.layers.support.BuildingFilterMode")],B);const _=B;var U;let A=U=class extends _{constructor(){super(...arguments),this.type="solid"}clone(){return new U}};t([s({type:["solid"],readOnly:!0,json:{write:!0}})],A.prototype,"type",void 0),A=U=t([p("esri.layers.support.BuildingFilterModeSolid")],A);const C=A;var Q;let O=Q=class extends _{constructor(){super(...arguments),this.type="wire-frame",this.edges=null}clone(){return new Q({edges:c(this.edges)})}};t([oe({wireFrame:"wire-frame"})],O.prototype,"type",void 0),t([s(Be)],O.prototype,"edges",void 0),O=Q=t([p("esri.layers.support.BuildingFilterModeWireFrame")],O);const X=O;var D;let E=D=class extends _{constructor(){super(...arguments),this.type="x-ray"}clone(){return new D}};t([s({type:["x-ray"],readOnly:!0,json:{write:!0}})],E.prototype,"type",void 0),E=D=t([p("esri.layers.support.BuildingFilterModeXRay")],E);const Y=E;var K;const lt={nonNullable:!0,types:{key:"type",base:_,typeMap:{solid:C,"wire-frame":X,"x-ray":Y}},json:{read:e=>{switch(e&&e.type){case"solid":return C.fromJSON(e);case"wireFrame":return X.fromJSON(e);case"x-ray":return Y.fromJSON(e);default:return}},write:{enabled:!0,isRequired:!0}}};let b=K=class extends m{constructor(){super(...arguments),this.filterExpression=null,this.filterMode=new C,this.title=""}clone(){return new K({filterExpression:this.filterExpression,filterMode:c(this.filterMode),title:this.title})}};t([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"filterExpression",void 0),t([s(lt)],b.prototype,"filterMode",void 0),t([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"title",void 0),b=K=t([p("esri.layers.support.BuildingFilterBlock")],b);const pt=b;var V;const yt=w.ofType(pt);let g=V=class extends m{constructor(){super(...arguments),this.description=null,this.filterBlocks=null,this.id=Ae(),this.name=null}clone(){return new V({description:this.description,filterBlocks:c(this.filterBlocks),id:this.id,name:this.name,filterAuthoringInfo:c(this.filterAuthoringInfo)})}};t([s({type:String,json:{write:!0}})],g.prototype,"description",void 0),t([s({type:yt,json:{write:{enabled:!0,isRequired:!0}}})],g.prototype,"filterBlocks",void 0),t([s({types:{key:"type",base:pe,typeMap:{checkbox:W}},json:{read:e=>(e&&e.type)==="checkbox"?W.fromJSON(e):null,write:!0}})],g.prototype,"filterAuthoringInfo",void 0),t([s({type:String,constructOnly:!0,json:{write:{enabled:!0,isRequired:!0}}})],g.prototype,"id",void 0),t([s({type:String,json:{write:{enabled:!0,isRequired:!0}}})],g.prototype,"name",void 0),g=V=t([p("esri.layers.support.BuildingFilter")],g);const dt=g;let u=class extends m{constructor(){super(...arguments),this.fieldName=null,this.modelName=null,this.label=null,this.min=null,this.max=null,this.mostFrequentValues=null,this.subLayerIds=null}};t([s({type:String})],u.prototype,"fieldName",void 0),t([s({type:String})],u.prototype,"modelName",void 0),t([s({type:String})],u.prototype,"label",void 0),t([s({type:Number})],u.prototype,"min",void 0),t([s({type:Number})],u.prototype,"max",void 0),t([s({json:{read:e=>Array.isArray(e)&&(e.every(r=>typeof r=="string")||e.every(r=>typeof r=="number"))?e.slice():null}})],u.prototype,"mostFrequentValues",void 0),t([s({type:[Number]})],u.prototype,"subLayerIds",void 0),u=t([p("esri.layers.support.BuildingFieldStatistics")],u);let x=class extends ee.LoadableMixin(te(m)){constructor(){super(...arguments),this.url=null}get fields(){return this.loaded||this.loadStatus==="loading"?this._get("fields"):(F.getLogger(this.declaredClass).error("building summary statistics are not loaded"),null)}load(e){const r=d(e)?e.signal:null;return this.addResolvingPromise(this._fetchService(r)),Promise.resolve(this)}async _fetchService(e){const r=(await se(this.url,{query:{f:"json"},responseType:"json",signal:e})).data;this.read(r,{origin:"service"})}};t([s({constructOnly:!0,type:String})],x.prototype,"url",void 0),t([s({readOnly:!0,type:[u],json:{read:{source:"summary"}}})],x.prototype,"fields",null),x=t([p("esri.layers.support.BuildingSummaryStatistics")],x);const ye=x,de=w.ofType(dt),Z=c(v.sublayersProperty);Z.json.origins["web-scene"]={type:[N],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}},Z.json.origins["portal-item"]={type:[N],write:{enabled:!0,overridePolicy:()=>({enabled:!1})}};let l=class extends Je(Ee(_e(qe(Ne(Pe(Re(Ke))))))){constructor(e){super(e),this.operationalLayerType="BuildingSceneLayer",this.allSublayers=new ke({getCollections:()=>[this.sublayers],getChildrenFunction:r=>r.type==="building-group"?r.sublayers:null}),this.sublayers=null,this._sublayerOverrides=null,this.filters=new de,this.activeFilterId=null,this.summaryStatistics=null,this.outFields=null,this.type="building-scene"}normalizeCtorArgs(e){return typeof e=="string"?{url:e}:e!=null?e:{}}destroy(){this.allSublayers.destroy()}readSublayers(e,r,i){const o=v.readSublayers(e,r,i);return v.forEachSublayer(o,n=>n.layer=this),this._sublayerOverrides&&(this.applySublayerOverrides(o,this._sublayerOverrides),this._sublayerOverrides=null),o}applySublayerOverrides(e,{overrides:r,context:i}){v.forEachSublayer(e,o=>o.read(r.get(o.id),i))}readSublayerOverrides(e,r){var o;const i=new Map;for(const n of e)n!=null&&typeof n=="object"&&typeof n.id=="number"?i.set(n.id,n):(o=r.messages)==null||o.push(new I("building-scene-layer:invalid-sublayer-override","Invalid value for sublayer override. Not an object or no id specified.",{value:n}));return{overrides:i,context:r}}writeSublayerOverrides(e,r,i){const o=[];v.forEachSublayer(this.sublayers,n=>{const h=n.write({},i);Object.keys(h).length>1&&o.push(h)}),o.length>0&&(r.sublayers=o)}writeUnappliedOverrides(e,r){r.sublayers=[],e.overrides.forEach(i=>{r.sublayers.push(c(i))})}write(e,r){return e=super.write(e,r),!r||r.origin!=="web-scene"&&r.origin!=="portal-item"||(this.sublayers?this.writeSublayerOverrides(this.sublayers,e,r):this._sublayerOverrides&&this.writeUnappliedOverrides(this._sublayerOverrides,e)),e}read(e,r){if(super.read(e,r),r&&(r.origin==="web-scene"||r.origin==="portal-item")&&e!=null&&Array.isArray(e.sublayers)){const i=this.readSublayerOverrides(e.sublayers,r);this.sublayers?this.applySublayerOverrides(this.sublayers,i):this._sublayerOverrides=i}}readSummaryStatistics(e,r){var i;if(typeof r.statisticsHRef=="string"){const o=Me((i=this.parsedUrl)==null?void 0:i.path,r.statisticsHRef);return new ye({url:o})}return null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}load(e){const r=d(e)?e.signal:null,i=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(Ue).then(()=>this._fetchService(r)).then(()=>this._fetchAssociatedFeatureService(r));return this.addResolvingPromise(i),Promise.resolve(this)}loadAll(){return Ce(this,e=>{v.forEachSublayer(this.sublayers,r=>{r.type!=="building-group"&&e(r)}),this.summaryStatistics&&e(this.summaryStatistics)})}async saveAs(e,r){return this._debouncedSaveOperations(H.SAVE_AS,{...r,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"building-scene"};return this._debouncedSaveOperations(H.SAVE,e)}validateLayer(e){if(!e.layerType||e.layerType!=="Building")throw new I("buildingscenelayer:layer-type-not-supported","BuildingSceneLayer does not support this layer type",{layerType:e.layerType})}_getTypeKeywords(){return["Building"]}_validateElevationInfo(){const e=this.elevationInfo;e&&(e.mode!=="absolute-height"&&F.getLogger(this.declaredClass).warn(".elevationInfo=","Building scene layers only support absolute-height elevation mode"),e.featureExpressionInfo&&e.featureExpressionInfo.expression!=="0"&&F.getLogger(this.declaredClass).warn(".elevationInfo=","Building scene layers do not support featureExpressionInfo"))}async _fetchAssociatedFeatureService(e){const r=new Ge(this.parsedUrl,this.portalItem,this.apiKey,e);try{this.associatedFeatureServiceItem=await r.fetchPortalItem()}catch(i){F.getLogger(this.declaredClass).warn("Associated feature service item could not be loaded",i)}}};t([s({type:["BuildingSceneLayer"]})],l.prototype,"operationalLayerType",void 0),t([s({readOnly:!0})],l.prototype,"allSublayers",void 0),t([s(Z)],l.prototype,"sublayers",void 0),t([j("service","sublayers")],l.prototype,"readSublayers",null),t([s({type:de,nonNullable:!0,json:{write:!0}})],l.prototype,"filters",void 0),t([s({type:String,json:{write:!0}})],l.prototype,"activeFilterId",void 0),t([s({readOnly:!0,type:ye})],l.prototype,"summaryStatistics",void 0),t([j("summaryStatistics",["statisticsHRef"])],l.prototype,"readSummaryStatistics",null),t([s({type:[String],json:{read:!1}})],l.prototype,"outFields",void 0),t([s(Qe)],l.prototype,"fullExtent",void 0),t([s({type:["show","hide","hide-children"]})],l.prototype,"listMode",void 0),t([s(q(ie))],l.prototype,"spatialReference",void 0),t([s(De)],l.prototype,"elevationInfo",null),t([s({json:{read:!1},readOnly:!0})],l.prototype,"type",void 0),t([s()],l.prototype,"associatedFeatureServiceItem",void 0),l=t([p("esri.layers.BuildingSceneLayer")],l);const Bt=l;export{Bt as default}; diff --git a/assets/CSVLayer.ec8919b4.js b/assets/CSVLayer.f7ffeeb7.js similarity index 98% rename from assets/CSVLayer.ec8919b4.js rename to assets/CSVLayer.f7ffeeb7.js index 3579947..f4b0653 100644 --- a/assets/CSVLayer.ec8919b4.js +++ b/assets/CSVLayer.f7ffeeb7.js @@ -1 +1 @@ -import{a6 as i,a7 as r,a8 as p,hT as w,dn as S,c as h,d3 as O,cU as F,d6 as b,m as I,d2 as q,iw as N,ix as _,hZ as x,aT as J,aU as j,bX as C,dd as l,n as m}from"./index.d94abe07.js";import{l as P}from"./clientSideDefaults.f5f7bfa0.js";import"./QueryEngineCapabilities.78217f95.js";let n=class extends w{constructor(e){super(e),this.type="csv",this.refresh=S(async t=>{await this.load();const{extent:s,timeExtent:a}=await this._connection.invoke("refresh",t);return this.sourceJSON.extent=s,a&&(this.sourceJSON.timeInfo.timeExtent=[a.start,a.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){const t=h(e)?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);const s=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return O.fromJSON(s)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._connection.invoke("queryFeatures",e?e.toJSON():null,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t)}async queryObjectIds(e,t={}){return await this.load(t),this._connection.invoke("queryObjectIds",e?e.toJSON():null,t)}async queryExtent(e,t={}){await this.load(t);const s=await this._connection.invoke("queryExtent",e?e.toJSON():null,t);return{count:s.count,extent:F.fromJSON(s.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke("querySnapping",e,t)}async _startWorker(e){this._connection=await b("CSVSourceWorker",{strategy:I("feature-layers-workers")?"dedicated":"local",signal:e});const{url:t,delimiter:s,fields:a,latitudeField:f,longitudeField:g,spatialReference:u,timeInfo:d}=this.loadOptions,c=await this._connection.invoke("load",{url:t,customParameters:this.customParameters,parsingOptions:{delimiter:s,fields:a==null?void 0:a.map(v=>v.toJSON()),latitudeField:f,longitudeField:g,spatialReference:u==null?void 0:u.toJSON(),timeInfo:d==null?void 0:d.toJSON()}},{signal:e});this.locationInfo=c.locationInfo,this.sourceJSON=c.layerDefinition,this.delimiter=c.delimiter}};i([r()],n.prototype,"type",void 0),i([r()],n.prototype,"loadOptions",void 0),i([r()],n.prototype,"customParameters",void 0),i([r()],n.prototype,"locationInfo",void 0),i([r()],n.prototype,"sourceJSON",void 0),i([r()],n.prototype,"delimiter",void 0),n=i([p("esri.layers.graphics.sources.CSVSource")],n);function y(e,t){throw new m(t,`CSVLayer (title: ${e.title}, id: ${e.id}) cannot be saved to a portal item`)}let o=class extends x{constructor(...e){super(...e),this.geometryType="point",this.capabilities=P(!1,!1),this.delimiter=null,this.editingEnabled=!1,this.fields=null,this.latitudeField=null,this.locationType="coordinates",this.longitudeField=null,this.operationalLayerType="CSV",this.outFields=["*"],this.path=null,this.spatialReference=J.WGS84,this.source=null,this.type="csv"}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=h(e)?e.signal:null,s=this.loadFromPortal({supportedTypes:["CSV"],supportsData:!1},e).catch(j).then(async()=>this.initLayerProperties(await this.createGraphicsSource(t)));return this.addResolvingPromise(s),Promise.resolve(this)}get isTable(){return this.loaded&&this.geometryType==null}readWebMapLabelsVisible(e,t){return t.showLabels!=null?t.showLabels:!!(t.layerDefinition&&t.layerDefinition.drawingInfo&&t.layerDefinition.drawingInfo.labelingInfo)}set url(e){if(!e)return void this._set("url",e);const t=C(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async createGraphicsSource(e){const t=new n({loadOptions:{delimiter:this.delimiter,fields:this.fields,latitudeField:this.latitudeField,longitudeField:this.longitudeField,spatialReference:this.spatialReference,timeInfo:this.timeInfo,url:this.url},customParameters:this.customParameters});return this._set("source",t),await t.load({signal:e}),this.read({locationInfo:t.locationInfo,columnDelimiter:t.delimiter},{origin:"service",url:this.parsedUrl}),t}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(l.from(e)||this.createQuery())).then(s=>{if(s!=null&&s.features)for(const a of s.features)a.layer=a.sourceLayer=this;return s})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(l.from(e)||this.createQuery()))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(l.from(e)||this.createQuery()))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(l.from(e)||this.createQuery()))}read(e,t){super.read(e,t),t&&t.origin==="service"&&this.revert(["latitudeField","longitudeField"],"service")}write(e,t){return super.write(e,{...t,writeLayerSchema:!0})}clone(){throw new m("csv-layer:clone",`CSVLayer (title: ${this.title}, id: ${this.id}) cannot be cloned`)}async save(e){return y(this,"csv-layer:save")}async saveAs(e,t){return y(this,"csv-layer:save-as")}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return h(t)&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}_verifyFields(){}_verifySource(){}_hasMemorySource(){return!1}};i([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"capabilities",void 0),i([r({type:[","," ",";","|"," "],json:{read:{source:"columnDelimiter"},write:{target:"columnDelimiter",ignoreOrigin:!0}}})],o.prototype,"delimiter",void 0),i([r({readOnly:!0,type:Boolean,json:{origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"editingEnabled",void 0),i([r({json:{read:{source:"layerDefinition.fields"},write:{target:"layerDefinition.fields"}}})],o.prototype,"fields",void 0),i([r({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),i([q("web-map","labelsVisible",["layerDefinition.drawingInfo.labelingInfo","showLabels"])],o.prototype,"readWebMapLabelsVisible",null),i([r({type:String,json:{read:{source:"locationInfo.latitudeFieldName"},write:{target:"locationInfo.latitudeFieldName",ignoreOrigin:!0}}})],o.prototype,"latitudeField",void 0),i([r({type:["show","hide"]})],o.prototype,"listMode",void 0),i([r({type:["coordinates"],json:{read:{source:"locationInfo.locationType"},write:{target:"locationInfo.locationType",ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"locationType",void 0),i([r({type:String,json:{read:{source:"locationInfo.longitudeFieldName"},write:{target:"locationInfo.longitudeFieldName",ignoreOrigin:!0}}})],o.prototype,"longitudeField",void 0),i([r({type:["CSV"]})],o.prototype,"operationalLayerType",void 0),i([r()],o.prototype,"outFields",void 0),i([r({type:String,json:{origins:{"web-scene":{read:!1,write:!1}},read:!1,write:!1}})],o.prototype,"path",void 0),i([r({json:{read:!1},cast:null,type:n,readOnly:!0})],o.prototype,"source",void 0),i([r({json:{read:!1},value:"csv",readOnly:!0})],o.prototype,"type",void 0),i([r({json:{read:N,write:{isRequired:!0,ignoreOrigin:!0,writer:_}}})],o.prototype,"url",null),o=i([p("esri.layers.CSVLayer")],o);const T=o;export{T as default}; +import{a6 as i,a7 as r,a8 as p,hT as w,dn as S,c as h,d3 as O,cU as F,d6 as b,m as I,d2 as q,iw as N,ix as _,hZ as x,aT as J,aU as j,bX as C,dd as l,n as m}from"./index.221827cd.js";import{l as P}from"./clientSideDefaults.d40b9315.js";import"./QueryEngineCapabilities.78217f95.js";let n=class extends w{constructor(e){super(e),this.type="csv",this.refresh=S(async t=>{await this.load();const{extent:s,timeExtent:a}=await this._connection.invoke("refresh",t);return this.sourceJSON.extent=s,a&&(this.sourceJSON.timeInfo.timeExtent=[a.start,a.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){const t=h(e)?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);const s=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return O.fromJSON(s)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._connection.invoke("queryFeatures",e?e.toJSON():null,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t)}async queryObjectIds(e,t={}){return await this.load(t),this._connection.invoke("queryObjectIds",e?e.toJSON():null,t)}async queryExtent(e,t={}){await this.load(t);const s=await this._connection.invoke("queryExtent",e?e.toJSON():null,t);return{count:s.count,extent:F.fromJSON(s.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke("querySnapping",e,t)}async _startWorker(e){this._connection=await b("CSVSourceWorker",{strategy:I("feature-layers-workers")?"dedicated":"local",signal:e});const{url:t,delimiter:s,fields:a,latitudeField:f,longitudeField:g,spatialReference:u,timeInfo:d}=this.loadOptions,c=await this._connection.invoke("load",{url:t,customParameters:this.customParameters,parsingOptions:{delimiter:s,fields:a==null?void 0:a.map(v=>v.toJSON()),latitudeField:f,longitudeField:g,spatialReference:u==null?void 0:u.toJSON(),timeInfo:d==null?void 0:d.toJSON()}},{signal:e});this.locationInfo=c.locationInfo,this.sourceJSON=c.layerDefinition,this.delimiter=c.delimiter}};i([r()],n.prototype,"type",void 0),i([r()],n.prototype,"loadOptions",void 0),i([r()],n.prototype,"customParameters",void 0),i([r()],n.prototype,"locationInfo",void 0),i([r()],n.prototype,"sourceJSON",void 0),i([r()],n.prototype,"delimiter",void 0),n=i([p("esri.layers.graphics.sources.CSVSource")],n);function y(e,t){throw new m(t,`CSVLayer (title: ${e.title}, id: ${e.id}) cannot be saved to a portal item`)}let o=class extends x{constructor(...e){super(...e),this.geometryType="point",this.capabilities=P(!1,!1),this.delimiter=null,this.editingEnabled=!1,this.fields=null,this.latitudeField=null,this.locationType="coordinates",this.longitudeField=null,this.operationalLayerType="CSV",this.outFields=["*"],this.path=null,this.spatialReference=J.WGS84,this.source=null,this.type="csv"}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=h(e)?e.signal:null,s=this.loadFromPortal({supportedTypes:["CSV"],supportsData:!1},e).catch(j).then(async()=>this.initLayerProperties(await this.createGraphicsSource(t)));return this.addResolvingPromise(s),Promise.resolve(this)}get isTable(){return this.loaded&&this.geometryType==null}readWebMapLabelsVisible(e,t){return t.showLabels!=null?t.showLabels:!!(t.layerDefinition&&t.layerDefinition.drawingInfo&&t.layerDefinition.drawingInfo.labelingInfo)}set url(e){if(!e)return void this._set("url",e);const t=C(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async createGraphicsSource(e){const t=new n({loadOptions:{delimiter:this.delimiter,fields:this.fields,latitudeField:this.latitudeField,longitudeField:this.longitudeField,spatialReference:this.spatialReference,timeInfo:this.timeInfo,url:this.url},customParameters:this.customParameters});return this._set("source",t),await t.load({signal:e}),this.read({locationInfo:t.locationInfo,columnDelimiter:t.delimiter},{origin:"service",url:this.parsedUrl}),t}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(l.from(e)||this.createQuery())).then(s=>{if(s!=null&&s.features)for(const a of s.features)a.layer=a.sourceLayer=this;return s})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(l.from(e)||this.createQuery()))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(l.from(e)||this.createQuery()))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(l.from(e)||this.createQuery()))}read(e,t){super.read(e,t),t&&t.origin==="service"&&this.revert(["latitudeField","longitudeField"],"service")}write(e,t){return super.write(e,{...t,writeLayerSchema:!0})}clone(){throw new m("csv-layer:clone",`CSVLayer (title: ${this.title}, id: ${this.id}) cannot be cloned`)}async save(e){return y(this,"csv-layer:save")}async saveAs(e,t){return y(this,"csv-layer:save-as")}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return h(t)&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}_verifyFields(){}_verifySource(){}_hasMemorySource(){return!1}};i([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"capabilities",void 0),i([r({type:[","," ",";","|"," "],json:{read:{source:"columnDelimiter"},write:{target:"columnDelimiter",ignoreOrigin:!0}}})],o.prototype,"delimiter",void 0),i([r({readOnly:!0,type:Boolean,json:{origins:{"web-scene":{read:!1,write:!1}}}})],o.prototype,"editingEnabled",void 0),i([r({json:{read:{source:"layerDefinition.fields"},write:{target:"layerDefinition.fields"}}})],o.prototype,"fields",void 0),i([r({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),i([q("web-map","labelsVisible",["layerDefinition.drawingInfo.labelingInfo","showLabels"])],o.prototype,"readWebMapLabelsVisible",null),i([r({type:String,json:{read:{source:"locationInfo.latitudeFieldName"},write:{target:"locationInfo.latitudeFieldName",ignoreOrigin:!0}}})],o.prototype,"latitudeField",void 0),i([r({type:["show","hide"]})],o.prototype,"listMode",void 0),i([r({type:["coordinates"],json:{read:{source:"locationInfo.locationType"},write:{target:"locationInfo.locationType",ignoreOrigin:!0,isRequired:!0}}})],o.prototype,"locationType",void 0),i([r({type:String,json:{read:{source:"locationInfo.longitudeFieldName"},write:{target:"locationInfo.longitudeFieldName",ignoreOrigin:!0}}})],o.prototype,"longitudeField",void 0),i([r({type:["CSV"]})],o.prototype,"operationalLayerType",void 0),i([r()],o.prototype,"outFields",void 0),i([r({type:String,json:{origins:{"web-scene":{read:!1,write:!1}},read:!1,write:!1}})],o.prototype,"path",void 0),i([r({json:{read:!1},cast:null,type:n,readOnly:!0})],o.prototype,"source",void 0),i([r({json:{read:!1},value:"csv",readOnly:!0})],o.prototype,"type",void 0),i([r({json:{read:N,write:{isRequired:!0,ignoreOrigin:!0,writer:_}}})],o.prototype,"url",null),o=i([p("esri.layers.CSVLayer")],o);const T=o;export{T as default}; diff --git a/assets/CSVSourceWorker.08ba4b81.js b/assets/CSVSourceWorker.20514f1e.js similarity index 93% rename from assets/CSVSourceWorker.08ba4b81.js rename to assets/CSVSourceWorker.20514f1e.js index e615a02..00b733d 100644 --- a/assets/CSVSourceWorker.08ba4b81.js +++ b/assets/CSVSourceWorker.20514f1e.js @@ -1,4 +1,4 @@ -import{n as F,av as k,x as P,s as V,bX as L,U as G,eY as M,bK as Q,bB as R,bG as A,bM as Y,aT as Z,eZ as U,aJ as B,e_ as J,cA as z,ci as x}from"./index.d94abe07.js";import{t as W}from"./json.879c9adc.js";import{u as K}from"./FeatureStore.27890cc9.js";import{f as X}from"./projectionSupport.0542c13b.js";import{Y as H}from"./QueryEngine.5a5ece4a.js";import{a as ee}from"./number.8c2c26f3.js";import{i as te,o as ie}from"./clientSideDefaults.f5f7bfa0.js";import"./PooledRBush.04520070.js";import"./centroid.cc817cc5.js";import"./QueryEngineResult.7611d68a.js";import"./quantizationUtils.0d428d19.js";import"./WhereClause.253310fe.js";import"./utils.8c53cad2.js";import"./generateRendererUtils.ebdde5b7.js";import"./utils.399e6089.js";import"./QueryEngineCapabilities.78217f95.js";import"./timeSupport.668a2439.js";const T=/^\s*"([\S\s]*)"\s*$/,E=/""/g,$=` +import{n as F,av as k,x as P,s as V,bX as L,U as G,eY as M,bK as Q,bB as R,bG as A,bM as Y,aT as Z,eZ as U,aJ as B,e_ as J,cA as z,ci as x}from"./index.221827cd.js";import{t as W}from"./json.879c9adc.js";import{u as K}from"./FeatureStore.99d80f36.js";import{f as X}from"./projectionSupport.4f5da4af.js";import{Y as H}from"./QueryEngine.ac81c46d.js";import{a as ee}from"./number.9e690eda.js";import{i as te,o as ie}from"./clientSideDefaults.d40b9315.js";import"./PooledRBush.e6a31ee9.js";import"./centroid.06db4b74.js";import"./QueryEngineResult.2fc58178.js";import"./quantizationUtils.7ff797cc.js";import"./WhereClause.5b749615.js";import"./utils.83e0b804.js";import"./generateRendererUtils.5c972fdb.js";import"./utils.e42485ea.js";import"./QueryEngineCapabilities.78217f95.js";import"./timeSupport.968e62fc.js";const T=/^\s*"([\S\s]*)"\s*$/,E=/""/g,$=` `,ne=[","," ",";","|"," "];function*S(r,t,e){let i=0;for(;i<=r.length;){const n=r.indexOf(t,i),s=r.substring(i,n>-1?n:void 0);i+=s.length+t.length,e&&!s.trim()||(yield s)}}function O(r){const t=r.includes(`\r `)?`\r `:$;return S(r,t,!0)}function q(r,t){return S(r,t,!1)}function re(r,t,e){var c;r=r.trim(),t=t==null?void 0:t.trim();const i=[],n=Array.from(new Set([e==null?void 0:e.delimiter,...ne])).filter(o=>o!=null);for(const o of n){const a=I(r,o).length,d=(c=I(t,o).length)!=null?c:a;a>1&&i.push({weight:Math.min(a,d),delimiter:o})}const s=i.sort(({weight:o},{weight:a})=>a-o).map(({delimiter:o})=>o);for(const o of s){const a=se(v(r,o).names,e==null?void 0:e.longitudeField,e==null?void 0:e.latitudeField);if(a.longitudeFieldName&&a.latitudeFieldName)return{delimiter:o,locationInfo:a}}return{delimiter:s[0],locationInfo:null}}function*C(r,t,e,i=()=>Object.create(null)){const n=O(r);n.next();let s="",c="",o=0,a=i(),d=0;e:for(const g of n){const h=q(g,e);for(const m of h)if(s+=c+m,c="",o+=D(m),o%2==0){if(o>0){const p=T.exec(s);if(!p){a=i(),d=0,s="",o=0;continue e}a[t[d]]=p[1].replace(E,'"'),d++}else a[t[d]]=s,d++;s="",o=0}else c=e;o===0?(yield a,a=i(),d=0):c=$}}function v(r,t){const e=I(r,t).filter(n=>n!=null),i=e.map(n=>N(n));for(let n=i.length-1;n>=0;n--)i[n]||(i.splice(n,1),e.splice(n,1));return{names:i,aliases:e}}function I(r,t){if(!(r!=null&&r.length))return[];const e=[];let i="",n="",s=0;const c=q(r,t);for(const o of c)if(i+=n+o,n="",s+=D(o),s%2==0){if(s>0){const a=T.exec(i);a&&e.push(a[1].replace(E,'"'))}else e.push(i);i="",s=0}else n=t;return e}function D(r){let t=0,e=0;for(e=r.indexOf('"',e);e>=0;)t++,e=r.indexOf('"',e+1);return t}function se(r,t,e){var c,o;t=(c=N(t))==null?void 0:c.toLowerCase(),e=(o=N(e))==null?void 0:o.toLowerCase();const i=r.map(a=>a.toLowerCase()),n=t?r[i.indexOf(t)]:null,s=e?r[i.indexOf(e)]:null;return{longitudeFieldName:n||r[i.indexOf(de.find(a=>i.includes(a)))],latitudeFieldName:s||r[i.indexOf(ce.find(a=>i.includes(a)))]}}function oe(r,t,e,i,n){const s=[],c=C(r,e,t),o=[];for(const a of c){if(o.length===10)break;o.push(a)}for(let a=0;ap[d]))){case"integer":h="esriFieldTypeInteger";break;case"double":h="esriFieldTypeDouble";break;case"date":h="esriFieldTypeDate",m=36;break;default:h="esriFieldTypeString",m=255}s.push({name:d,type:h,alias:g,length:m})}}return s}function ae(r){if(!r.length)return"string";const t=/[^+-.,0-9]/;return r.map(e=>{let i=!1;if(e!==""){if(t.test(e))i=!0;else{let n=w(e);if(!isNaN(n))return/[.,]/.test(e)||!Number.isInteger(n)||n>214783647||n<-214783648?"double":"integer";if(e.includes("E")){if(n=Number(e),!isNaN(n))return"double";if(e.includes(",")){if(e=e.replace(",","."),n=Number(e),!isNaN(n))return"double";i=!0}else i=!0}else i=!0}return i?/^[-]?\d*[.,]?\d*$/.test(e)?"string":j(new Date(e),e)?"date":"string":"string"}}).reduce((e,i)=>e===void 0?i:i===void 0?e:e===i?i:e==="string"||i==="string"?"string":e==="double"||i==="double"?"double":void 0)}function j(r,t){if(!r||Object.prototype.toString.call(r)!=="[object Date]"||isNaN(r.getTime()))return!1;let e=!0;if(!ue&&/\d+\W*$/.test(t)){const i=t.match(/[a-zA-Z]{2,}/);if(i){let n=!1,s=0;for(;!n&&s<=i.length;)n=!le.test(i[s]),s++;e=!n}}return e}const w=function(){const r=ee(),t=new RegExp("^"+r.regexp+"$"),e=new RegExp("["+r.group+"\\s\\xa0]","g"),i=r.factor;return n=>{const s=t.exec(n);if(r.factor=i,!s)return NaN;let c=s[1];if(!s[1]){if(!s[2])return NaN;c=s[2],r.factor*=-1}return c=c.replace(e,"").replace(r.decimal,"."),+c*r.factor}}(),le=/^((jan(uary)?)|(feb(ruary)?)|(mar(ch)?)|(apr(il)?)|(may)|(jun(e)?)|(jul(y)?)|(aug(ust)?)|(sep(tember)?)|(oct(ober)?)|(nov(ember)?)|(dec(ember)?)|(am)|(pm)|(gmt)|(utc))$/i,ue=Number.isNaN(new Date("technology 10").getTime()),ce=["lat","latitude","latitude83","latdecdeg","lat_dd","y","ycenter","point_y"],de=["lon","lng","long","longitude","longitude83","longdecdeg","long_dd","x","xcenter","point_x"],fe=/^([0-9])/,me=/[^A-Za-z0-9_\u0080-\uffff]/g,pe=/_{2,}/g,he=/^_/,ye=/_$/;function N(r){return r?r.trim().replace(me,"_").replace(pe,"_").replace(he,"").replace(ye,"").replace(fe,"F$1"):null}const ge=ie("esriGeometryPoint"),_e=["csv"],Fe=[0,0];class Ie{constructor(t,e){this.x=t,this.y=e}}class Ge{constructor(){this._queryEngine=null,this._snapshotFeatures=async t=>{const e=await this._fetch(t);return this._createFeatures(e)}}destroy(){var t;(t=this._queryEngine)==null||t.destroy(),this._queryEngine=null}async load(t,e={}){var c;this._loadOptions=t;const[i]=await Promise.all([this._fetch(e.signal),this._checkProjection((c=t==null?void 0:t.parsingOptions)==null?void 0:c.spatialReference)]),n=we(i,t);this._locationInfo=n.locationInfo,this._delimiter=n.delimiter,this._queryEngine=this._createQueryEngine(n);const s=await this._createFeatures(i);if(this._queryEngine.featureStore.addMany(s),n.layerDefinition.extent=this._queryEngine.fullExtent,n.layerDefinition.timeInfo){const{start:o,end:a}=this._queryEngine.timeExtent;n.layerDefinition.timeInfo.timeExtent=[o,a]}return n}async applyEdits(){throw new F("csv-layer:editing-not-supported","applyEdits() is not supported on CSVLayer")}async queryFeatures(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(t,e.signal)}async queryFeatureCount(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(t,e.signal)}async queryObjectIds(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(t,e.signal)}async queryExtent(t={},e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(t,e.signal)}async querySnapping(t,e={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(t,e.signal)}async refresh(t){var e;return this._loadOptions.customParameters=t,(e=this._snapshotTask)==null||e.abort(),this._snapshotTask=k(this._snapshotFeatures),this._snapshotTask.promise.then(i=>{this._queryEngine.featureStore.clear(),i&&this._queryEngine.featureStore.addMany(i)},i=>{this._queryEngine.featureStore.clear(),P(i)||V.getLogger("esri.layers.CSVLayer").error(new F("csv-layer:refresh","An error occurred during refresh",{error:i}))}),await this._waitSnapshotComplete(),{extent:this._queryEngine.fullExtent,timeExtent:this._queryEngine.timeExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(t){const{url:e,customParameters:i}=this._loadOptions;if(!e)throw new F("csv-layer:invalid-source","url not defined");const n=L(e);return(await G(n.path,{query:{...n.query,...i},responseType:"text",signal:t})).data}_createQueryEngine(t){const{objectIdField:e,fields:i,extent:n,timeInfo:s}=t.layerDefinition,c=new K({geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1});return new H({fields:i,geometryType:"esriGeometryPoint",hasM:!1,hasZ:!1,timeInfo:s,objectIdField:e,spatialReference:n.spatialReference||{wkid:4326},cacheSpatialQueries:!0,featureStore:c})}async _createFeatures(t){const{latitudeFieldName:e,longitudeFieldName:i}=this._locationInfo,{objectIdField:n,fieldsIndex:s,spatialReference:c}=this._queryEngine;let o=[];const a=[],d=s.fields.filter(l=>l.name!==n).map(l=>l.name);let g=0;const h={};for(const l of s.fields)if(l.type!=="esriFieldTypeOID"&&l.type!=="esriFieldTypeGlobalID"){const y=M(l);y!==void 0&&(h[l.name]=y)}const m=C(t,d,this._delimiter,te(h,n));for(const l of m){const y=this._parseCoordinateValue(l[e]),_=this._parseCoordinateValue(l[i]);if(_!=null&&y!=null&&!isNaN(y)&&!isNaN(_)){l[e]=y,l[i]=_;for(const u in l)if(u!==e&&u!==i){if(s.isDateField(u)){const f=new Date(l[u]);l[u]=j(f,l[u])?f.getTime():null}else if(s.isNumericField(u)){const f=w(l[u]);isNaN(f)?l[u]=null:l[u]=f}}l[n]=g,g++,o.push(new Ie(_,y)),a.push(l)}}if(!Q({wkid:4326},c))if(R(c))for(const l of o)[l.x,l.y]=A(l.x,l.y,Fe);else o=Y(W,o,Z.WGS84,c,null,null);const p=[];for(let l=0;l181)&&(e=parseFloat(t)),e}async _checkProjection(t){try{await X(J,t)}catch{throw new F("csv-layer:projection-not-supported","Projection not supported")}}}function we(r,t){var l,y,_;const e=t.parsingOptions||{},i={delimiter:e.delimiter,layerDefinition:null,locationInfo:{latitudeFieldName:e.latitudeField,longitudeFieldName:e.longitudeField}},n=i.layerDefinition={name:z(t.url,_e)||"csv",drawingInfo:ge,geometryType:"esriGeometryPoint",objectIdField:null,fields:[],timeInfo:e.timeInfo,extent:{xmin:Number.POSITIVE_INFINITY,ymin:Number.POSITIVE_INFINITY,xmax:Number.NEGATIVE_INFINITY,ymax:Number.NEGATIVE_INFINITY,spatialReference:e.spatialReference||{wkid:102100}}},s=O(r),c=(l=s.next().value)==null?void 0:l.trim(),o=(y=s.next().value)==null?void 0:y.trim();if(!c)throw new F("csv-layer:empty-csv","CSV is empty",{csv:r});const{delimiter:a,locationInfo:d}=re(c,o,e);if(!a)throw new F("csv-layer:invalid-delimiter","Unable to detect the delimiter from CSV",{firstLine:c,secondLine:o,parsingOptions:e});if(!d)throw new F("csv-layer:location-fields-not-found","Unable to identify latitude and longitude fields from the CSV file",{firstLine:c,secondLine:o,parsingOptions:e});i.locationInfo=d,i.delimiter=a;const{names:g,aliases:h}=v(c,a),m=oe(r,i.delimiter,g,h,i.locationInfo);if((_=e.fields)!=null&&_.length){const u=new x(e.fields);for(const f of m){const b=u.get(f.name);b&&Object.assign(f,b)}}if(!m.some(u=>u.type==="esriFieldTypeOID"&&(n.objectIdField=u.name,!0))){const u={name:"__OBJECTID",alias:"__OBJECTID",type:"esriFieldTypeOID",editable:!1,nullable:!1};n.objectIdField=u.name,m.unshift(u)}n.fields=m;const p=new x(n.fields);if(i.locationInfo&&(i.locationInfo.latitudeFieldName=p.get(i.locationInfo.latitudeFieldName).name,i.locationInfo.longitudeFieldName=p.get(i.locationInfo.longitudeFieldName).name),n.timeInfo){const u=n.timeInfo;if(u.startTimeField){const f=p.get(u.startTimeField);f?(u.startTimeField=f.name,f.type="esriFieldTypeDate"):u.startTimeField=null}if(u.endTimeField){const f=p.get(u.endTimeField);f?(u.endTimeField=f.name,f.type="esriFieldTypeDate"):u.endTimeField=null}if(u.trackIdField){const f=p.get(u.trackIdField);u.trackIdField=f?f.name:null}u.startTimeField||u.endTimeField||(n.timeInfo=null)}return i}export{Ge as default}; diff --git a/assets/CircularArray.a4d7e1c2.js b/assets/CircularArray.62f75f43.js similarity index 91% rename from assets/CircularArray.a4d7e1c2.js rename to assets/CircularArray.62f75f43.js index c757d26..277412c 100644 --- a/assets/CircularArray.a4d7e1c2.js +++ b/assets/CircularArray.62f75f43.js @@ -1 +1 @@ -import{c as e}from"./index.d94abe07.js";class h{constructor(t){this.size=0,this._start=0,this.maxSize=t,this._buffer=new Array(t)}get entries(){return this._buffer}enqueue(t){if(this.size===this.maxSize){const s=this._buffer[this._start];return this._buffer[this._start]=t,this._start=(this._start+1)%this.maxSize,s}return this._buffer[(this._start+this.size++)%this.maxSize]=t,null}dequeue(){if(this.size===0)return null;const t=this._buffer[this._start];return this._buffer[this._start]=null,this.size--,this._start=(this._start+1)%this.maxSize,t}peek(){return this.size===0?null:this._buffer[this._start]}find(t){if(this.size===0)return null;for(const s of this._buffer)if(e(s)&&t(s))return s;return null}clear(t){let s=this.dequeue();for(;e(s);)t&&t(s),s=this.dequeue()}}export{h as s}; +import{c as e}from"./index.221827cd.js";class h{constructor(t){this.size=0,this._start=0,this.maxSize=t,this._buffer=new Array(t)}get entries(){return this._buffer}enqueue(t){if(this.size===this.maxSize){const s=this._buffer[this._start];return this._buffer[this._start]=t,this._start=(this._start+1)%this.maxSize,s}return this._buffer[(this._start+this.size++)%this.maxSize]=t,null}dequeue(){if(this.size===0)return null;const t=this._buffer[this._start];return this._buffer[this._start]=null,this.size--,this._start=(this._start+1)%this.maxSize,t}peek(){return this.size===0?null:this._buffer[this._start]}find(t){if(this.size===0)return null;for(const s of this._buffer)if(e(s)&&t(s))return s;return null}clear(t){let s=this.dequeue();for(;e(s);)t&&t(s),s=this.dequeue()}}export{h as s}; diff --git a/assets/ComputedAttributeStorage.c1cb22b3.js b/assets/ComputedAttributeStorage.29767acd.js similarity index 96% rename from assets/ComputedAttributeStorage.c1cb22b3.js rename to assets/ComputedAttributeStorage.29767acd.js index 60f2118..b8c3a2d 100644 --- a/assets/ComputedAttributeStorage.c1cb22b3.js +++ b/assets/ComputedAttributeStorage.29767acd.js @@ -1 +1 @@ -import{m as _,c,aJ as N,c8 as $,c9 as H,j as l,ba as Y,bd as J,ca as Q,cb as Z,cc as X,cd as g,ce as q,cf as V,s as K,c3 as W,K as tt,x as k,n as E,cg as et,ch as st,at as rt,ci as it,bc as nt,u as f,a1 as at}from"./index.d94abe07.js";import{e as ot}from"./centroid.cc817cc5.js";import{a9 as ht,aa as ut,ab as dt,ac as v,N as ct,O as lt}from"./enums.0295eb81.js";import{c as _t,u as ft,f as y,e as gt,i as pt,n as mt,l as yt,r as bt,s as j,a as h}from"./visualVariablesUtils.32e27706.js";import{m as xt}from"./Utils.7f6f3a6b.js";import{G as p}from"./enums.2d9e6f64.js";class x{constructor(t,e){this._mask=0,this._buf=t,this._mask=e}static fromBuffer(t,e){return new x(t,e)}static create(t,e=4294967295){const s=new Uint32Array(Math.ceil(t/32));return new x(s,e)}_getIndex(t){return Math.floor(t/32)}has(t){const e=this._mask&t;return!!(this._buf[this._getIndex(e)]&1<>>=1,r++}}countSet(){let t=0;return this.forEachSet(e=>{t++}),t}}let S=0;var B;const F=(B=_("featurelayer-simplify-thresholds"))!=null?B:[.5,.5,.5,.5],It=F[0],St=F[1],At=F[2],Tt=F[3];var O;const D=(O=_("featurelayer-simplify-payload-size-factors"))!=null?O:[1,2,4],zt=D[0],Ct=D[1],Ft=D[2];var R;const wt=(R=_("featurelayer-simplify-mobile-factor"))!=null?R:2,Et=_("esri-mobile");class U{constructor(t,e){this.type="FeatureSetReader",this.arcadeDeclaredClass="esri.arcade.Feature",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=t,this._layerSchema=e}static createInstance(){return S++,S=S>65535?0:S,S}get isEmpty(){return c(this._deleted)&&this._deleted.countSet()===this.getSize()}set level(t){this._level=t}getAreaSimplificationThreshold(t,e){let s=1;const r=Et?wt:1;e>4e6?s=Ft*r:e>1e6?s=Ct*r:e>5e5?s=zt*r:e>1e5&&(s=r);let i=0;t>4e3?i=Tt*s:t>2e3?i=At*s:t>100?i=St:t>15&&(i=It);let n=8;return this._level<4?n=1:this._level<5?n=2:this._level<6&&(n=4),i*n}createQuantizedExtrudedQuad(t,e){return new N([5],[t-1,e,1,-1,1,1,-1,1,-1,-1])}setArcadeSpatialReference(t){this._arcadeSpatialReference=t}attachStorage(t){this._storage=t}getQuantizationTransform(){throw new Error("Unable to find transform for featureSet")}getStorage(){return this._storage}getComputedNumeric(t){return this.getComputedNumericAtIndex(0)}setComputedNumeric(t,e){return this.setComputedNumericAtIndex(e,0)}getComputedString(t){return this.getComputedStringAtIndex(0)}setComputedString(t,e){return this.setComputedStringAtIndex(0,e)}getComputedNumericAtIndex(t){return this._storage.getComputedNumericAtIndex(this.getDisplayId(),t)}setComputedNumericAtIndex(t,e){this._storage.setComputedNumericAtIndex(this.getDisplayId(),t,e)}getComputedStringAtIndex(t){return this._storage.getComputedStringAtIndex(this.getDisplayId(),t)}setComputedStringAtIndex(t,e){return this._storage.setComputedStringAtIndex(this.getDisplayId(),t,e)}transform(t,e,s,r){const i=this.copy();return i._tx+=t,i._ty+=e,i._sx*=s,i._sy*=r,i}readAttribute(t,e=!1){const s=this._readAttribute(t,e);if(s!==void 0)return s;for(const r of this._joined){r.setIndex(this.getIndex());const i=r._readAttribute(t,e);if(i!==void 0)return i}}readAttributes(){const t=this._readAttributes();for(const e of this._joined){e.setIndex(this.getIndex());const s=e._readAttributes();for(const r of Object.keys(s))t[r]=s[r]}return t}joinAttributes(t){this._joined.push(t)}readArcadeFeature(){return this}geometry(){const t=this.readHydratedGeometry(),e=$(t,this.geometryType,this.hasZ,this.hasM),s=H(e);return s&&(s.spatialReference=this._arcadeSpatialReference),s}field(t){if(this.hasField(t))return this.readAttribute(t,!0);for(const e of this._joined)if(e.setIndex(this.getIndex()),e.hasField(t))return e._readAttribute(t,!0);throw new Error(`Field ${t} does not exist`)}setField(t,e){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.getFieldNames()}castToText(t=!1){if(!t)return JSON.stringify(this.readLegacyFeature());const e=this.readLegacyFeature();if(!e)return JSON.stringify(null);const s={geometry:e.geometry,attributes:{...e.attributes?e.attributes:{}}};for(const r in s.attributes){const i=s.attributes[r];i instanceof Date&&(s.attributes[r]=i.getTime())}return JSON.stringify(s)}gdbVersion(){return null}fullSchema(){return this._layerSchema}castAsJson(t=null){return{attributes:this._readAttributes(),geometry:(t==null?void 0:t.keepGeometryType)===!0?this.geometry():this.geometry().toJSON()}}castAsJsonAsync(t=null,e=null){return Promise.resolve(this.castAsJson(e))}removeIds(t){if(l(this._objectIdToIndex)){const s=new Map,r=this.getCursor();for(;r.next();){const i=Y(r.getObjectId());s.set(i,r.getIndex())}this._objectIdToIndex=s}const e=this._objectIdToIndex;for(const s of t)e.has(s)&&this.removeAtIndex(e.get(s))}removeAtIndex(t){l(this._deleted)&&(this._deleted=x.create(this.getSize())),this._deleted.set(t)}readGeometryForDisplay(){return this.readUnquantizedGeometry(!0)}readLegacyGeometryForDisplay(){return this.readLegacyGeometry(!0)}*features(){const t=this.getCursor();for(;t.next();)yield t.readOptimizedFeature()}_getExists(){return l(this._deleted)||!this._deleted.has(this.getIndex())}_computeCentroid(){if(this.geometryType!=="esriGeometryPolygon")return null;const t=this.readUnquantizedGeometry();if(!t||t.hasIndeterminateRingOrder)return null;const e=J(this.getQuantizationTransform(),null);return ot(new N,t,this.hasM,this.hasZ,e)}copyInto(t){t.seen=this.seen,t._storage=this._storage,t._arcadeSpatialReference=this._arcadeSpatialReference,t._joined=this._joined,t._tx=this._tx,t._ty=this._ty,t._sx=this._sx,t._sy=this._sy,t._deleted=this._deleted,t._objectIdToIndex=this._objectIdToIndex}}function Dt({coords:u,lengths:t}){let e=0;for(const s of t){for(let r=1;r!(s.objectId&&e.has(s.objectId)))}append(t){for(const e of t)this._features.push(e)}getSize(){return this._features.length}getCursor(){return this.copy()}getQuantizationTransform(){return this._transform}getAttributeHash(){let t="";for(const e in this._current.attributes)t+=this._current.attributes[e];return t}getIndex(){return this._featureIndex}setIndex(t){this._featureIndex=t}getObjectId(){return this._current.objectId}getDisplayId(){return this._current.displayId}setDisplayId(t){this._current.displayId=t}getGroupId(){return this._current.groupId}setGroupId(t){this._current.groupId=t}copy(){const t=new m(this.instance,this._features,this.fullSchema());return this.copyInto(t),t}next(){for(;++this._featureIndexe.toLowerCase()).includes(t.toLowerCase())}getFieldNames(){return Object.keys(this._current.attributes)}_readAttribute(t,e){const s=this._current.attributes[t];if(s!==void 0)return s!=null&&e&&this._dateFields.has(t)?new Date(s):s;const r=this.readAttributes(),i=t.toLocaleLowerCase().trim();for(const n in r)if(n.toLocaleLowerCase().trim()===i){const a=this._current.attributes[n];return a!=null&&e&&this._dateFields.has(n)?new Date(a):a}}copyInto(t){super.copyInto(t),t._featureIndex=this._featureIndex,t._transform=this._transform,t._dateFields=this._dateFields}_readAttributes(){return this._current.attributes}}const b=K.getLogger("esri.views.layers.2d.features.support.AttributeStore"),z=mt(yt,b),A={sharedArrayBuffer:_("esri-shared-array-buffer"),atomics:_("esri-atomics")};function G(u,t){return e=>t(u(e))}class Mt{constructor(t,e,s,r){this.size=0,this.texelSize=4;const{pixelType:i,layout:n,textureOnly:a}=r;this.textureOnly=a||!1,this.pixelType=i,this._ctype=e,this.layout=n,this._resetRange(),this._shared=t,this.size=s,a||(this.data=this._initData(i,s,t,e))}get buffer(){return nt(this.data,t=>t.buffer)}unsetComponentAllTexels(t,e){const s=f(this.data);for(let r=0;re)return null;this._resetRange();const r=!(this._shared||this._ctype==="local"),i=this.pixelType,n=this.layout,a=f(this.data);return{start:t,end:e,data:r&&a.slice(t*s,(e+1)*s)||null,pixelType:i,layout:n}}_initData(t,e,s,r){const i=s&&r!=="local"?SharedArrayBuffer:ArrayBuffer,n=xt(t),a=new n(new i(e*e*4*n.BYTES_PER_ELEMENT));for(let o=0;o{}){this._client=t,this.config=e,this._notifyChange=s,this._attributeComputeMap=new Map,this._blocks=new Array,this._filters=new Array(ht),this._targetType=0,this._abortController=new AbortController,this._hasScaleExpr=!1,this._size=32,this._idsToHighlight=new Set;const r=e.supportsTextureFloat?p.FLOAT:p.UNSIGNED_BYTE;z(`Creating AttributeStore ${A.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:p.UNSIGNED_BYTE,layout:1},{pixelType:p.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:p.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:r,layout:15},{pixelType:r,layout:15},{pixelType:r,layout:15},{pixelType:r,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}isUpdating(){return!!this._currUpdate||!!this._nextUpdate}update(t,e){this.config=e;const s=e.schema.processors[0].storage,r=W(this._schema,s);if((t.targets.feature||t.targets.aggregate)&&(t.storage.data=!0),r&&(_("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",r),t.storage.data=!0,this._schema=s,this._attributeComputeMap.clear(),!l(s))){switch(s.target){case"feature":this._targetType=ft;break;case"aggregate":this._targetType=_t}if(s.type==="subtype")for(const i in s.mapping){const n=s.mapping[i];if(c(n)&&c(n.vvMapping))for(const a of n.vvMapping)this._bindAttribute(a)}else{if(c(s.vvMapping))for(const i of s.vvMapping)this._bindAttribute(i);if(c(s.attributeMapping))for(const i of s.attributeMapping)this._bindAttribute(i)}}}onTileData(t,e){if(l(e.addOrUpdate))return;const s=e.addOrUpdate.getCursor();for(;s.next();){const r=s.getDisplayId();this.setAttributeData(r,s)}}async setHighlight(t,e){const r=this._getBlock(0),i=e.map(n=>y(n));r.lock(),r.unsetComponentAllTexels(0,1),r.setComponent(0,1,i),r.unlock(),this._idsToHighlight.clear();for(const n of t)this._idsToHighlight.add(n);await this.sendUpdates()}async updateFilters(t,e,s){const{service:r,spatialReference:i}=s,{filters:n}=e,a=n.map((o,d)=>this._updateFilter(o,d,r,i));(await Promise.all(a)).some(o=>o)&&(t.storage.filters=!0,_("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(t,e,s,r){const i=y(t);this._ensureSizeForTexel(i),this._getBlock(e).setData(t,s,r)}getData(t,e,s){return this._getBlock(e).getData(t,s)}getHighlightFlag(t){return this._idsToHighlight.has(t)?ut:0}unsetAttributeData(t){const e=y(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e){const s=y(t);if(this._ensureSizeForTexel(s),this._getBlock(0).setData(s,0,this.getFilterFlags(e)),this._targetType!==gt(t))return;const r=this._attributeComputeMap,i=this.config.supportsTextureFloat?1:2,n=4;r.size&&r.forEach((a,o)=>{const d=o*i%n,T=Math.floor(o*i/n),I=this._getBlock(T+dt),w=a(e);if(this.config.supportsTextureFloat)I.setData(s,d,w);else if(w===v)I.setData(s,d,255),I.setData(s,d+1,255);else{const M=at(Math.round(w),-32767,32766)+32768,L=255&M,P=(65280&M)>>8;I.setData(s,d,L),I.setData(s,d+1,P)}})}sendUpdates(){if(_("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate"),this._notifyChange(),this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=tt(),this._nextUpdate.promise;const t={blocks:this._blocks.map(e=>c(e)?e.toMessage():null)};return this._currUpdate=this._createResources().then(()=>{const e=()=>{if(this._currUpdate=null,this._nextUpdate){const r=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then(()=>r.resolve())}else _("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::No additional updates queued");this._notifyChange()};_("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::client.update");const s=this._client.update(t,this._signal).then(e).catch(e);return this._client.render(this._signal),s}).catch(e=>{if(k(e))return this._createResourcesPromise=null,this._createResources();this._notifyChange(),b.error(new E("mapview-attribute-store","Encountered an error during client update",e))}),this._currUpdate}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}_bindAttribute(t){function e(){return t.normalizationField?n=>{const a=n.readAttribute(t.normalizationField);return a?n.readAttribute(t.field)/a:null}:n=>n.readAttribute(t.field)}function s(){return t.normalizationField&&b.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),n=>n.getComputedNumericAtIndex(t.fieldIndex)}let r;if(t.fieldIndex!=null)r=s();else{if(!t.field)return;r=e()}t.valueRepresentation&&(r=G(r,n=>bt(n,t.valueRepresentation)));const i=n=>n===null||isNaN(n)||n===1/0||n===-1/0?v:n;this._attributeComputeMap.set(t.binding,G(r,i))}_createResources(){if(c(this._createResourcesPromise))return this._createResourcesPromise;this._getBlock(ct),this._getBlock(lt),z("Initializing AttributeStore");const t={shared:A.sharedArrayBuffer&&this._client.type!=="local",size:this._size,blocks:et(this._blocks,s=>({textureOnly:s.textureOnly,buffer:s.buffer,pixelType:s.pixelType}))},e=this._client.initialize(t,this._signal).catch(s=>{k(s)?this._createResourcesPromise=null:b.error(new E("mapview-attribute-store","Encountered an error during client initialization",s))});return this._createResourcesPromise=e,e.then(()=>l(this._createResourcesPromise)?this._createResources():void 0),e}_getBlock(t){const e=this._blocks[t];if(c(e))return e;z(`Initializing AttributeBlock at index ${t}`);const s=A.sharedArrayBuffer,r=this._client.type,i=new Mt(s,r,this._size,this._blockDescriptors[t]);return this._blocks[t]=i,this._createResourcesPromise=null,i}_expand(){if(this._sizee.expand(t)),this._createResourcesPromise=null,this._size=t,0}return b.error(new E("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(t,e,s,r){const i=this._filters[e],n=c(i)&&i.hash;if(!i&&!t||n===JSON.stringify(t))return!1;if(l(t)){if(!i)return!1;const o=1<import("./FeatureFilter.d7d1bf79.js"),["assets/FeatureFilter.d7d1bf79.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/timeSupport.668a2439.js","assets/projectionSupport.0542c13b.js","assets/json.879c9adc.js","assets/utils.399e6089.js","assets/FeatureStore2D.eebd57c6.js","assets/CircularArray.a4d7e1c2.js","assets/centroid.cc817cc5.js","assets/enums.0295eb81.js","assets/visualVariablesUtils.32e27706.js","assets/Utils.7f6f3a6b.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/visualVariablesUtils.aff73e6d.js"]),i=new r({geometryType:e.geometryType,hasM:!1,hasZ:!1,timeInfo:e.timeInfo,fieldsIndex:new it(e.fields)});return this._filters[t]=i,i}isVisible(t){return!!(2&this._getBlock(0).getData(t,0))}getFilterFlags(t){let e=0;const s=pt(t.getDisplayId());for(let i=0;it))for(;u.length<=t;)u.push(e)}class $t{constructor(){this._numerics=[],this._strings=[],this._idGenerator=new Nt,this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[]}createBitset(){const t=this._bitsets.length;return this._bitsets.push(x.create(this._allocatedSize,h)),t+1}getBitset(t){return this._bitsets[t-1]}_expand(){this._allocatedSize<<=1;for(const t of this._bitsets)t.resize(this._allocatedSize)}_ensureNumeric(t,e){this._numerics[t]||(this._numerics[t]=[]),C(this._numerics[t],e,0)}_ensureInstanceId(t){C(this._instanceIds,t,0)}_ensureString(t,e){this._strings[t]||(this._strings[t]=[]),C(this._strings[t],e,null)}createDisplayId(t=!1){const e=this._idGenerator.createId();return e>this._allocatedSize&&this._expand(),j(e,t)}releaseDisplayId(t){for(const e of this._bitsets)e.unset(t);return this._idGenerator.releaseId(t&h)}getComputedNumeric(t,e){return this.getComputedNumericAtIndex(t&h,0)}setComputedNumeric(t,e,s){return this.setComputedNumericAtIndex(t&h,s,0)}getComputedString(t,e){return this.getComputedStringAtIndex(t&h,0)}setComputedString(t,e,s){return this.setComputedStringAtIndex(t&h,0,s)}getComputedNumericAtIndex(t,e){const s=t&h;return this._ensureNumeric(e,s),this._numerics[e][s]}setComputedNumericAtIndex(t,e,s){const r=t&h;this._ensureNumeric(e,r),this._numerics[e][r]=s}getInstanceId(t){const e=t&h;return this._ensureInstanceId(e),this._instanceIds[e]}setInstanceId(t,e){const s=t&h;this._ensureInstanceId(s),this._instanceIds[s]=e}getComputedStringAtIndex(t,e){const s=t&h;return this._ensureString(e,s),this._strings[e][s]}setComputedStringAtIndex(t,e,s){const r=t&h;this._ensureString(e,r),this._strings[e][r]=s}getXMin(t){return this._bounds[4*(t&h)]}getYMin(t){return this._bounds[4*(t&h)+1]}getXMax(t){return this._bounds[4*(t&h)+2]}getYMax(t){return this._bounds[4*(t&h)+3]}setBounds(t,e){const s=e.readHydratedGeometry();if(!s||!s.coords.length)return!1;let r=1/0,i=1/0,n=-1/0,a=-1/0;s.forEachVertex((d,T)=>{r=Math.min(r,d),i=Math.min(i,T),n=Math.max(n,d),a=Math.max(a,T)});const o=t&h;return C(this._bounds,4*o+4,0),this._bounds[4*o]=r,this._bounds[4*o+1]=i,this._bounds[4*o+2]=n,this._bounds[4*o+3]=a,!0}}export{U as b,m as c,$t as r,x as t,Rt as v}; +import{m as _,c,aJ as N,c8 as $,c9 as H,j as l,ba as Y,bd as J,ca as Q,cb as Z,cc as X,cd as g,ce as q,cf as V,s as K,c3 as W,K as tt,x as k,n as E,cg as et,ch as st,at as rt,ci as it,bc as nt,u as f,a1 as at}from"./index.221827cd.js";import{e as ot}from"./centroid.06db4b74.js";import{a9 as ht,aa as ut,ab as dt,ac as v,N as ct,O as lt}from"./enums.0295eb81.js";import{c as _t,u as ft,f as y,e as gt,i as pt,n as mt,l as yt,r as bt,s as j,a as h}from"./visualVariablesUtils.061b7a4e.js";import{m as xt}from"./Utils.2136650a.js";import{G as p}from"./enums.2d9e6f64.js";class x{constructor(t,e){this._mask=0,this._buf=t,this._mask=e}static fromBuffer(t,e){return new x(t,e)}static create(t,e=4294967295){const s=new Uint32Array(Math.ceil(t/32));return new x(s,e)}_getIndex(t){return Math.floor(t/32)}has(t){const e=this._mask&t;return!!(this._buf[this._getIndex(e)]&1<>>=1,r++}}countSet(){let t=0;return this.forEachSet(e=>{t++}),t}}let S=0;var B;const F=(B=_("featurelayer-simplify-thresholds"))!=null?B:[.5,.5,.5,.5],It=F[0],St=F[1],At=F[2],Tt=F[3];var O;const D=(O=_("featurelayer-simplify-payload-size-factors"))!=null?O:[1,2,4],zt=D[0],Ct=D[1],Ft=D[2];var R;const wt=(R=_("featurelayer-simplify-mobile-factor"))!=null?R:2,Et=_("esri-mobile");class U{constructor(t,e){this.type="FeatureSetReader",this.arcadeDeclaredClass="esri.arcade.Feature",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=t,this._layerSchema=e}static createInstance(){return S++,S=S>65535?0:S,S}get isEmpty(){return c(this._deleted)&&this._deleted.countSet()===this.getSize()}set level(t){this._level=t}getAreaSimplificationThreshold(t,e){let s=1;const r=Et?wt:1;e>4e6?s=Ft*r:e>1e6?s=Ct*r:e>5e5?s=zt*r:e>1e5&&(s=r);let i=0;t>4e3?i=Tt*s:t>2e3?i=At*s:t>100?i=St:t>15&&(i=It);let n=8;return this._level<4?n=1:this._level<5?n=2:this._level<6&&(n=4),i*n}createQuantizedExtrudedQuad(t,e){return new N([5],[t-1,e,1,-1,1,1,-1,1,-1,-1])}setArcadeSpatialReference(t){this._arcadeSpatialReference=t}attachStorage(t){this._storage=t}getQuantizationTransform(){throw new Error("Unable to find transform for featureSet")}getStorage(){return this._storage}getComputedNumeric(t){return this.getComputedNumericAtIndex(0)}setComputedNumeric(t,e){return this.setComputedNumericAtIndex(e,0)}getComputedString(t){return this.getComputedStringAtIndex(0)}setComputedString(t,e){return this.setComputedStringAtIndex(0,e)}getComputedNumericAtIndex(t){return this._storage.getComputedNumericAtIndex(this.getDisplayId(),t)}setComputedNumericAtIndex(t,e){this._storage.setComputedNumericAtIndex(this.getDisplayId(),t,e)}getComputedStringAtIndex(t){return this._storage.getComputedStringAtIndex(this.getDisplayId(),t)}setComputedStringAtIndex(t,e){return this._storage.setComputedStringAtIndex(this.getDisplayId(),t,e)}transform(t,e,s,r){const i=this.copy();return i._tx+=t,i._ty+=e,i._sx*=s,i._sy*=r,i}readAttribute(t,e=!1){const s=this._readAttribute(t,e);if(s!==void 0)return s;for(const r of this._joined){r.setIndex(this.getIndex());const i=r._readAttribute(t,e);if(i!==void 0)return i}}readAttributes(){const t=this._readAttributes();for(const e of this._joined){e.setIndex(this.getIndex());const s=e._readAttributes();for(const r of Object.keys(s))t[r]=s[r]}return t}joinAttributes(t){this._joined.push(t)}readArcadeFeature(){return this}geometry(){const t=this.readHydratedGeometry(),e=$(t,this.geometryType,this.hasZ,this.hasM),s=H(e);return s&&(s.spatialReference=this._arcadeSpatialReference),s}field(t){if(this.hasField(t))return this.readAttribute(t,!0);for(const e of this._joined)if(e.setIndex(this.getIndex()),e.hasField(t))return e._readAttribute(t,!0);throw new Error(`Field ${t} does not exist`)}setField(t,e){throw new Error("Unable to update feature attribute values, feature is readonly")}keys(){return this.getFieldNames()}castToText(t=!1){if(!t)return JSON.stringify(this.readLegacyFeature());const e=this.readLegacyFeature();if(!e)return JSON.stringify(null);const s={geometry:e.geometry,attributes:{...e.attributes?e.attributes:{}}};for(const r in s.attributes){const i=s.attributes[r];i instanceof Date&&(s.attributes[r]=i.getTime())}return JSON.stringify(s)}gdbVersion(){return null}fullSchema(){return this._layerSchema}castAsJson(t=null){return{attributes:this._readAttributes(),geometry:(t==null?void 0:t.keepGeometryType)===!0?this.geometry():this.geometry().toJSON()}}castAsJsonAsync(t=null,e=null){return Promise.resolve(this.castAsJson(e))}removeIds(t){if(l(this._objectIdToIndex)){const s=new Map,r=this.getCursor();for(;r.next();){const i=Y(r.getObjectId());s.set(i,r.getIndex())}this._objectIdToIndex=s}const e=this._objectIdToIndex;for(const s of t)e.has(s)&&this.removeAtIndex(e.get(s))}removeAtIndex(t){l(this._deleted)&&(this._deleted=x.create(this.getSize())),this._deleted.set(t)}readGeometryForDisplay(){return this.readUnquantizedGeometry(!0)}readLegacyGeometryForDisplay(){return this.readLegacyGeometry(!0)}*features(){const t=this.getCursor();for(;t.next();)yield t.readOptimizedFeature()}_getExists(){return l(this._deleted)||!this._deleted.has(this.getIndex())}_computeCentroid(){if(this.geometryType!=="esriGeometryPolygon")return null;const t=this.readUnquantizedGeometry();if(!t||t.hasIndeterminateRingOrder)return null;const e=J(this.getQuantizationTransform(),null);return ot(new N,t,this.hasM,this.hasZ,e)}copyInto(t){t.seen=this.seen,t._storage=this._storage,t._arcadeSpatialReference=this._arcadeSpatialReference,t._joined=this._joined,t._tx=this._tx,t._ty=this._ty,t._sx=this._sx,t._sy=this._sy,t._deleted=this._deleted,t._objectIdToIndex=this._objectIdToIndex}}function Dt({coords:u,lengths:t}){let e=0;for(const s of t){for(let r=1;r!(s.objectId&&e.has(s.objectId)))}append(t){for(const e of t)this._features.push(e)}getSize(){return this._features.length}getCursor(){return this.copy()}getQuantizationTransform(){return this._transform}getAttributeHash(){let t="";for(const e in this._current.attributes)t+=this._current.attributes[e];return t}getIndex(){return this._featureIndex}setIndex(t){this._featureIndex=t}getObjectId(){return this._current.objectId}getDisplayId(){return this._current.displayId}setDisplayId(t){this._current.displayId=t}getGroupId(){return this._current.groupId}setGroupId(t){this._current.groupId=t}copy(){const t=new m(this.instance,this._features,this.fullSchema());return this.copyInto(t),t}next(){for(;++this._featureIndexe.toLowerCase()).includes(t.toLowerCase())}getFieldNames(){return Object.keys(this._current.attributes)}_readAttribute(t,e){const s=this._current.attributes[t];if(s!==void 0)return s!=null&&e&&this._dateFields.has(t)?new Date(s):s;const r=this.readAttributes(),i=t.toLocaleLowerCase().trim();for(const n in r)if(n.toLocaleLowerCase().trim()===i){const a=this._current.attributes[n];return a!=null&&e&&this._dateFields.has(n)?new Date(a):a}}copyInto(t){super.copyInto(t),t._featureIndex=this._featureIndex,t._transform=this._transform,t._dateFields=this._dateFields}_readAttributes(){return this._current.attributes}}const b=K.getLogger("esri.views.layers.2d.features.support.AttributeStore"),z=mt(yt,b),A={sharedArrayBuffer:_("esri-shared-array-buffer"),atomics:_("esri-atomics")};function G(u,t){return e=>t(u(e))}class Mt{constructor(t,e,s,r){this.size=0,this.texelSize=4;const{pixelType:i,layout:n,textureOnly:a}=r;this.textureOnly=a||!1,this.pixelType=i,this._ctype=e,this.layout=n,this._resetRange(),this._shared=t,this.size=s,a||(this.data=this._initData(i,s,t,e))}get buffer(){return nt(this.data,t=>t.buffer)}unsetComponentAllTexels(t,e){const s=f(this.data);for(let r=0;re)return null;this._resetRange();const r=!(this._shared||this._ctype==="local"),i=this.pixelType,n=this.layout,a=f(this.data);return{start:t,end:e,data:r&&a.slice(t*s,(e+1)*s)||null,pixelType:i,layout:n}}_initData(t,e,s,r){const i=s&&r!=="local"?SharedArrayBuffer:ArrayBuffer,n=xt(t),a=new n(new i(e*e*4*n.BYTES_PER_ELEMENT));for(let o=0;o{}){this._client=t,this.config=e,this._notifyChange=s,this._attributeComputeMap=new Map,this._blocks=new Array,this._filters=new Array(ht),this._targetType=0,this._abortController=new AbortController,this._hasScaleExpr=!1,this._size=32,this._idsToHighlight=new Set;const r=e.supportsTextureFloat?p.FLOAT:p.UNSIGNED_BYTE;z(`Creating AttributeStore ${A.sharedArrayBuffer?"with":"without"} shared memory`),this._blockDescriptors=[{pixelType:p.UNSIGNED_BYTE,layout:1},{pixelType:p.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:p.UNSIGNED_BYTE,layout:15,textureOnly:!0},{pixelType:r,layout:15},{pixelType:r,layout:15},{pixelType:r,layout:15},{pixelType:r,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}isUpdating(){return!!this._currUpdate||!!this._nextUpdate}update(t,e){this.config=e;const s=e.schema.processors[0].storage,r=W(this._schema,s);if((t.targets.feature||t.targets.aggregate)&&(t.storage.data=!0),r&&(_("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:",r),t.storage.data=!0,this._schema=s,this._attributeComputeMap.clear(),!l(s))){switch(s.target){case"feature":this._targetType=ft;break;case"aggregate":this._targetType=_t}if(s.type==="subtype")for(const i in s.mapping){const n=s.mapping[i];if(c(n)&&c(n.vvMapping))for(const a of n.vvMapping)this._bindAttribute(a)}else{if(c(s.vvMapping))for(const i of s.vvMapping)this._bindAttribute(i);if(c(s.attributeMapping))for(const i of s.attributeMapping)this._bindAttribute(i)}}}onTileData(t,e){if(l(e.addOrUpdate))return;const s=e.addOrUpdate.getCursor();for(;s.next();){const r=s.getDisplayId();this.setAttributeData(r,s)}}async setHighlight(t,e){const r=this._getBlock(0),i=e.map(n=>y(n));r.lock(),r.unsetComponentAllTexels(0,1),r.setComponent(0,1,i),r.unlock(),this._idsToHighlight.clear();for(const n of t)this._idsToHighlight.add(n);await this.sendUpdates()}async updateFilters(t,e,s){const{service:r,spatialReference:i}=s,{filters:n}=e,a=n.map((o,d)=>this._updateFilter(o,d,r,i));(await Promise.all(a)).some(o=>o)&&(t.storage.filters=!0,_("esri-2d-update-debug")&&console.debug("Applying Update - AttributeStore:","Filters changed"))}setData(t,e,s,r){const i=y(t);this._ensureSizeForTexel(i),this._getBlock(e).setData(t,s,r)}getData(t,e,s){return this._getBlock(e).getData(t,s)}getHighlightFlag(t){return this._idsToHighlight.has(t)?ut:0}unsetAttributeData(t){const e=y(t);this._getBlock(0).setData(e,0,0)}setAttributeData(t,e){const s=y(t);if(this._ensureSizeForTexel(s),this._getBlock(0).setData(s,0,this.getFilterFlags(e)),this._targetType!==gt(t))return;const r=this._attributeComputeMap,i=this.config.supportsTextureFloat?1:2,n=4;r.size&&r.forEach((a,o)=>{const d=o*i%n,T=Math.floor(o*i/n),I=this._getBlock(T+dt),w=a(e);if(this.config.supportsTextureFloat)I.setData(s,d,w);else if(w===v)I.setData(s,d,255),I.setData(s,d+1,255);else{const M=at(Math.round(w),-32767,32766)+32768,L=255&M,P=(65280&M)>>8;I.setData(s,d,L),I.setData(s,d+1,P)}})}sendUpdates(){if(_("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate"),this._notifyChange(),this._nextUpdate)return this._nextUpdate.promise;if(this._currUpdate)return this._nextUpdate=tt(),this._nextUpdate.promise;const t={blocks:this._blocks.map(e=>c(e)?e.toMessage():null)};return this._currUpdate=this._createResources().then(()=>{const e=()=>{if(this._currUpdate=null,this._nextUpdate){const r=this._nextUpdate;this._nextUpdate=null,this.sendUpdates().then(()=>r.resolve())}else _("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::No additional updates queued");this._notifyChange()};_("esri-2d-update-debug")&&console.debug("AttributeStore::sendUpdate::client.update");const s=this._client.update(t,this._signal).then(e).catch(e);return this._client.render(this._signal),s}).catch(e=>{if(k(e))return this._createResourcesPromise=null,this._createResources();this._notifyChange(),b.error(new E("mapview-attribute-store","Encountered an error during client update",e))}),this._currUpdate}_ensureSizeForTexel(t){for(;t>=this._size*this._size;)if(this._expand())return}_bindAttribute(t){function e(){return t.normalizationField?n=>{const a=n.readAttribute(t.normalizationField);return a?n.readAttribute(t.field)/a:null}:n=>n.readAttribute(t.field)}function s(){return t.normalizationField&&b.warn("mapview-arcade","Ignoring normalizationField specified with an arcade expression which is not supported."),n=>n.getComputedNumericAtIndex(t.fieldIndex)}let r;if(t.fieldIndex!=null)r=s();else{if(!t.field)return;r=e()}t.valueRepresentation&&(r=G(r,n=>bt(n,t.valueRepresentation)));const i=n=>n===null||isNaN(n)||n===1/0||n===-1/0?v:n;this._attributeComputeMap.set(t.binding,G(r,i))}_createResources(){if(c(this._createResourcesPromise))return this._createResourcesPromise;this._getBlock(ct),this._getBlock(lt),z("Initializing AttributeStore");const t={shared:A.sharedArrayBuffer&&this._client.type!=="local",size:this._size,blocks:et(this._blocks,s=>({textureOnly:s.textureOnly,buffer:s.buffer,pixelType:s.pixelType}))},e=this._client.initialize(t,this._signal).catch(s=>{k(s)?this._createResourcesPromise=null:b.error(new E("mapview-attribute-store","Encountered an error during client initialization",s))});return this._createResourcesPromise=e,e.then(()=>l(this._createResourcesPromise)?this._createResources():void 0),e}_getBlock(t){const e=this._blocks[t];if(c(e))return e;z(`Initializing AttributeBlock at index ${t}`);const s=A.sharedArrayBuffer,r=this._client.type,i=new Mt(s,r,this._size,this._blockDescriptors[t]);return this._blocks[t]=i,this._createResourcesPromise=null,i}_expand(){if(this._sizee.expand(t)),this._createResourcesPromise=null,this._size=t,0}return b.error(new E("mapview-limitations","Maximum number of onscreen features exceeded.")),-1}async _updateFilter(t,e,s,r){const i=this._filters[e],n=c(i)&&i.hash;if(!i&&!t||n===JSON.stringify(t))return!1;if(l(t)){if(!i)return!1;const o=1<import("./FeatureFilter.c87783c2.js"),["assets/FeatureFilter.c87783c2.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/timeSupport.968e62fc.js","assets/projectionSupport.4f5da4af.js","assets/json.879c9adc.js","assets/utils.e42485ea.js","assets/FeatureStore2D.3fea35f0.js","assets/CircularArray.62f75f43.js","assets/centroid.06db4b74.js","assets/enums.0295eb81.js","assets/visualVariablesUtils.061b7a4e.js","assets/Utils.2136650a.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/visualVariablesUtils.62efda9d.js"]),i=new r({geometryType:e.geometryType,hasM:!1,hasZ:!1,timeInfo:e.timeInfo,fieldsIndex:new it(e.fields)});return this._filters[t]=i,i}isVisible(t){return!!(2&this._getBlock(0).getData(t,0))}getFilterFlags(t){let e=0;const s=pt(t.getDisplayId());for(let i=0;it))for(;u.length<=t;)u.push(e)}class $t{constructor(){this._numerics=[],this._strings=[],this._idGenerator=new Nt,this._allocatedSize=256,this._bitsets=[],this._instanceIds=[],this._bounds=[]}createBitset(){const t=this._bitsets.length;return this._bitsets.push(x.create(this._allocatedSize,h)),t+1}getBitset(t){return this._bitsets[t-1]}_expand(){this._allocatedSize<<=1;for(const t of this._bitsets)t.resize(this._allocatedSize)}_ensureNumeric(t,e){this._numerics[t]||(this._numerics[t]=[]),C(this._numerics[t],e,0)}_ensureInstanceId(t){C(this._instanceIds,t,0)}_ensureString(t,e){this._strings[t]||(this._strings[t]=[]),C(this._strings[t],e,null)}createDisplayId(t=!1){const e=this._idGenerator.createId();return e>this._allocatedSize&&this._expand(),j(e,t)}releaseDisplayId(t){for(const e of this._bitsets)e.unset(t);return this._idGenerator.releaseId(t&h)}getComputedNumeric(t,e){return this.getComputedNumericAtIndex(t&h,0)}setComputedNumeric(t,e,s){return this.setComputedNumericAtIndex(t&h,s,0)}getComputedString(t,e){return this.getComputedStringAtIndex(t&h,0)}setComputedString(t,e,s){return this.setComputedStringAtIndex(t&h,0,s)}getComputedNumericAtIndex(t,e){const s=t&h;return this._ensureNumeric(e,s),this._numerics[e][s]}setComputedNumericAtIndex(t,e,s){const r=t&h;this._ensureNumeric(e,r),this._numerics[e][r]=s}getInstanceId(t){const e=t&h;return this._ensureInstanceId(e),this._instanceIds[e]}setInstanceId(t,e){const s=t&h;this._ensureInstanceId(s),this._instanceIds[s]=e}getComputedStringAtIndex(t,e){const s=t&h;return this._ensureString(e,s),this._strings[e][s]}setComputedStringAtIndex(t,e,s){const r=t&h;this._ensureString(e,r),this._strings[e][r]=s}getXMin(t){return this._bounds[4*(t&h)]}getYMin(t){return this._bounds[4*(t&h)+1]}getXMax(t){return this._bounds[4*(t&h)+2]}getYMax(t){return this._bounds[4*(t&h)+3]}setBounds(t,e){const s=e.readHydratedGeometry();if(!s||!s.coords.length)return!1;let r=1/0,i=1/0,n=-1/0,a=-1/0;s.forEachVertex((d,T)=>{r=Math.min(r,d),i=Math.min(i,T),n=Math.max(n,d),a=Math.max(a,T)});const o=t&h;return C(this._bounds,4*o+4,0),this._bounds[4*o]=r,this._bounds[4*o+1]=i,this._bounds[4*o+2]=n,this._bounds[4*o+3]=a,!0}}export{U as b,m as c,$t as r,x as t,Rt as v}; diff --git a/assets/DefaultMaterial.glsl.037cb4cc.js b/assets/DefaultMaterial.glsl.037cb4cc.js deleted file mode 100644 index 669a3ee..0000000 --- a/assets/DefaultMaterial.glsl.037cb4cc.js +++ /dev/null @@ -1 +0,0 @@ -import"./mat4f64.ff2a477c.js";import{Q as y}from"./objectResourceUtils.996108d7.js";import"./mat3f64.6d32a1d7.js";import"./vec3f32.1121a836.js";import"./index.d94abe07.js";import"./VertexAttribute.42396f25.js";import"./symbolColorUtils.d5fe1bd7.js";import"./OrderIndependentTransparency.4d1575c0.js";import"./VertexArrayObject.a4c1d809.js";import"./enums.2d9e6f64.js";import"./Texture.4c97bad5.js";import"./devEnvironmentUtils.d8d0484c.js";import"./BufferView.89055914.js";import"./vec33.4564cd5b.js";import"./DefaultMaterial_COLOR_GAMMA.bf8213a8.js";import"./types.44c7402c.js";import"./Version.59f2da65.js";import"./quat.b3994f2f.js";import"./quatf64.4ae3e6f1.js";import"./requestImageUtils.7b09b5e8.js";import"./Util.ea9235b8.js";import"./sphere.ec1f4496.js";import"./VertexElementDescriptor.1fdca6da.js";import"./InterleavedLayout.f9d79992.js";export{y as build}; diff --git a/assets/DefaultMaterial.glsl.13f68fae.js b/assets/DefaultMaterial.glsl.13f68fae.js new file mode 100644 index 0000000..5bb785b --- /dev/null +++ b/assets/DefaultMaterial.glsl.13f68fae.js @@ -0,0 +1 @@ +import"./mat4f64.ff2a477c.js";import{Q as y}from"./objectResourceUtils.dfe6cb73.js";import"./mat3f64.6d32a1d7.js";import"./vec3f32.1121a836.js";import"./index.221827cd.js";import"./VertexAttribute.42396f25.js";import"./symbolColorUtils.36aaa708.js";import"./OrderIndependentTransparency.4d1575c0.js";import"./VertexArrayObject.53cf1857.js";import"./enums.2d9e6f64.js";import"./Texture.940076b2.js";import"./devEnvironmentUtils.d8d0484c.js";import"./BufferView.6eee27cd.js";import"./vec33.46fc6802.js";import"./DefaultMaterial_COLOR_GAMMA.8ee780a2.js";import"./types.44c7402c.js";import"./Version.433fbe58.js";import"./quat.d9562009.js";import"./quatf64.4ae3e6f1.js";import"./requestImageUtils.1f5d4b6d.js";import"./Util.f17667f9.js";import"./sphere.f99ddb50.js";import"./VertexElementDescriptor.1fdca6da.js";import"./InterleavedLayout.30cdc193.js";export{y as build}; diff --git a/assets/DefaultMaterial_COLOR_GAMMA.bf8213a8.js b/assets/DefaultMaterial_COLOR_GAMMA.8ee780a2.js similarity index 98% rename from assets/DefaultMaterial_COLOR_GAMMA.bf8213a8.js rename to assets/DefaultMaterial_COLOR_GAMMA.8ee780a2.js index 6bf14d2..993a437 100644 --- a/assets/DefaultMaterial_COLOR_GAMMA.bf8213a8.js +++ b/assets/DefaultMaterial_COLOR_GAMMA.8ee780a2.js @@ -1 +1 @@ -import{a as W}from"./vec33.4564cd5b.js";import{s as ce,r as fe,c as de,e as le}from"./types.44c7402c.js";import{cu as Z,v as pe,kP as ee,j as te,U as me,cQ as ye,aU as he,n as Y,s as Te,gH as xe,kQ as _e,cv as be,e6 as we,fP as ge,kK as Se,kR as Ee,g0 as Ie,eB as Ae,gQ as q,c as z,i as Oe,kE as Re}from"./index.d94abe07.js";import{e as re,r as ne}from"./mat4f64.ff2a477c.js";import{D as j,L as V,C as l,E as B}from"./enums.2d9e6f64.js";import{r as se}from"./Version.59f2da65.js";import{x as Ue}from"./quat.b3994f2f.js";import{e as Ne}from"./quatf64.4ae3e6f1.js";import{B as Be,g as Ce,d as Me,i as H,c as J,u as oe,x as ve,L as Le,O as $e,E as Fe,F as Pe,w as De,q as Ge,A as je,V as Ve}from"./BufferView.89055914.js";function ke(n,e,t){if(n.count!==e.count)return void W.error("source and destination buffers need to have the same number of elements");const s=n.count,r=t[0],o=t[1],a=t[2],f=t[3],i=t[4],u=t[5],c=t[6],d=t[7],m=t[8],h=t[9],T=t[10],p=t[11],y=t[12],w=t[13],g=t[14],b=t[15],x=n.typedBuffer,S=n.typedBufferStride,_=e.typedBuffer,A=e.typedBufferStride;for(let U=0;U0){const T=1/Math.sqrt(h);s[i]=T*c,s[i+1]=T*d,s[i+2]=T*m}}}function ze(n,e,t){const s=Math.min(n.count,e.count),r=n.typedBuffer,o=n.typedBufferStride,a=e.typedBuffer,f=e.typedBufferStride;for(let i=0;i>t,r[u+1]=a[c+1]>>t,r[u+2]=a[c+2]>>t,r[u+3]=a[c+3]>>t}}Object.freeze(Object.defineProperty({__proto__:null,transformMat4:ke,transformMat3:He,normalize:Ye,scale:ze,shiftRight:qe},Symbol.toStringTag,{value:"Module"}));function Je(n,e,t){const s=n.typedBuffer,r=n.typedBufferStride,o=e.typedBuffer,a=e.typedBufferStride,f=t?t.count:e.count;let i=(t&&t.dstIndex?t.dstIndex:0)*r,u=(t&&t.srcIndex?t.srcIndex:0)*a;for(let c=0;c{const e={...ie,...n.pbrMetallicRoughness},t=it({...at,...n.extras});return{...ot,...n,pbrMetallicRoughness:e,extras:t}};function it(n){switch(n.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:xe(n.ESRI_externalColorMixMode),n.ESRI_externalColorMixMode="tint"}return n}const ut={magFilter:V.LINEAR,minFilter:V.LINEAR_MIPMAP_LINEAR,wrapS:j.REPEAT,wrapT:j.REPEAT},ct=n=>({...ut,...n});function ft(n){let e,t;return n.replace(/^(.*\/)?([^/]*)$/,(s,r,o)=>(e=r||"",t=o||"","")),{dirPart:e,filePart:t}}const F={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};class E{constructor(e,t,s,r,o){this._context=e,this._errorContext=t,this.uri=s,this.json=r,this._glbBuffer=o,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._baseUri=ft(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),t.errorUnsupportedIf(r.scenes==null,"Scenes must be defined."),t.errorUnsupportedIf(r.meshes==null,"Meshes must be defined"),t.errorUnsupportedIf(r.nodes==null,"Nodes must be defined."),this._computeNodeParents()}static async load(e,t,s,r){if(Z(s)){const f=be(s);if(f&&f.mediaType!=="model/gltf-binary")try{const u=JSON.parse(f.isBase64?atob(f.data):f.data);return new E(e,t,s,u)}catch{}const i=ee(s);if(E._isGLBData(i))return this._fromGLBData(e,t,s,i)}if(s.endsWith(".gltf")){const f=await e.loadJSON(s,r);return new E(e,t,s,f)}const o=await e.loadBinary(s,r);if(E._isGLBData(o))return this._fromGLBData(e,t,s,o);const a=await e.loadJSON(s,r);return new E(e,t,s,a)}static _isGLBData(e){if(e==null)return!1;const t=new K(e);return t.remainingBytes()>=4&&t.readUint32()===F.MAGIC}static async _fromGLBData(e,t,s,r){const o=await E._parseGLBData(t,r);return new E(e,t,s,o.json,o.binaryData)}static async _parseGLBData(e,t){const s=new K(t);e.assert(s.remainingBytes()>=12,"GLB binary data is insufficiently large.");const r=s.readUint32(),o=s.readUint32(),a=s.readUint32();e.assert(r===F.MAGIC,"Magic first 4 bytes do not fit to expected GLB value."),e.assert(t.byteLength>=a,"GLB binary data is smaller than header specifies."),e.errorUnsupportedIf(o!==2,"An unsupported GLB container version was detected. Only version 2 is supported.");let f,i,u=0;for(;s.remainingBytes()>=8;){const c=s.readUint32(),d=s.readUint32();u===0?(e.assert(d===F.CHUNK_TYPE_JSON,"First GLB chunk must be JSON."),e.assert(c>=0,"No JSON data found."),f=await ht(s.readUint8Array(c))):u===1?(e.errorUnsupportedIf(d!==F.CHUNK_TYPE_BIN,"Second GLB chunk expected to be BIN."),i=s.readUint8Array(c)):e.warnUnsupported("More than 2 GLB chunks detected. Skipping."),u+=1}return f||e.error("No GLB JSON chunk detected."),{json:f,binaryData:i}}async getBuffer(e,t){const s=this.json.buffers[e],r=this._errorContext;if(s.uri==null)return r.assert(this._glbBuffer!=null,"GLB buffer not present"),this._glbBuffer;const o=await this._getBufferLoader(e,t);return r.assert(o.byteLength===s.byteLength,"Buffer byte lengths should match."),o}async _getBufferLoader(e,t){const s=this._bufferLoaders.get(e);if(s)return s;const r=this.json.buffers[e].uri,o=this._context.loadBinary(this._resolveUri(r),t).then(a=>new Uint8Array(a));return this._bufferLoaders.set(e,o),o}async getAccessor(e,t){const s=this._errorContext;s.errorUnsupportedIf(!this.json.accessors,"Accessors missing.");const r=this.json.accessors[e];s.errorUnsupportedIf((r==null?void 0:r.bufferView)==null,"Some accessor does not specify a bufferView."),s.errorUnsupportedIf(r.type in[C.MAT2,C.MAT3,C.MAT4],`AttributeType ${r.type} is not supported`);const o=this.json.bufferViews[r.bufferView],a=await this.getBuffer(o.buffer,t),f=pt[r.type],i=mt[r.componentType],u=f*i,c=o.byteStride||u;return{raw:a.buffer,byteStride:c,byteOffset:a.byteOffset+(o.byteOffset||0)+(r.byteOffset||0),entryCount:r.count,isDenselyPacked:c===u,componentCount:f,componentByteSize:i,componentType:r.componentType,min:r.min,max:r.max,normalized:!!r.normalized}}async getIndexData(e,t){if(e.indices==null)return;const s=await this.getAccessor(e.indices,t);if(s.isDenselyPacked)switch(s.componentType){case l.UNSIGNED_BYTE:return new Uint8Array(s.raw,s.byteOffset,s.entryCount);case l.UNSIGNED_SHORT:return new Uint16Array(s.raw,s.byteOffset,s.entryCount);case l.UNSIGNED_INT:return new Uint32Array(s.raw,s.byteOffset,s.entryCount)}else switch(s.componentType){case l.UNSIGNED_BYTE:return D(this._wrapAccessor(Me,s));case l.UNSIGNED_SHORT:return D(this._wrapAccessor(Ce,s));case l.UNSIGNED_INT:return D(this._wrapAccessor(Be,s))}}async getPositionData(e,t){const s=this._errorContext;s.errorUnsupportedIf(e.attributes.POSITION==null,"No POSITION vertex data found.");const r=await this.getAccessor(e.attributes.POSITION,t);return s.errorUnsupportedIf(r.componentType!==l.FLOAT,"Expected type FLOAT for POSITION vertex attribute, but found "+l[r.componentType]),s.errorUnsupportedIf(r.componentCount!==3,"POSITION vertex attribute must have 3 components, but found "+r.componentCount.toFixed()),this._wrapAccessor(H,r)}async getNormalData(e,t){const s=this._errorContext;s.assert(e.attributes.NORMAL!=null,"No NORMAL vertex data found.");const r=await this.getAccessor(e.attributes.NORMAL,t);return s.errorUnsupportedIf(r.componentType!==l.FLOAT,"Expected type FLOAT for NORMAL vertex attribute, but found "+l[r.componentType]),s.errorUnsupportedIf(r.componentCount!==3,"NORMAL vertex attribute must have 3 components, but found "+r.componentCount.toFixed()),this._wrapAccessor(H,r)}async getTangentData(e,t){const s=this._errorContext;s.assert(e.attributes.TANGENT!=null,"No TANGENT vertex data found.");const r=await this.getAccessor(e.attributes.TANGENT,t);return s.errorUnsupportedIf(r.componentType!==l.FLOAT,"Expected type FLOAT for TANGENT vertex attribute, but found "+l[r.componentType]),s.errorUnsupportedIf(r.componentCount!==4,"TANGENT vertex attribute must have 4 components, but found "+r.componentCount.toFixed()),new J(r.raw,r.byteOffset,r.byteStride,r.byteOffset+r.byteStride*r.entryCount)}async getTextureCoordinates(e,t){const s=this._errorContext;s.assert(e.attributes.TEXCOORD_0!=null,"No TEXCOORD_0 vertex data found.");const r=await this.getAccessor(e.attributes.TEXCOORD_0,t);return s.errorUnsupportedIf(r.componentCount!==2,"TEXCOORD_0 vertex attribute must have 2 components, but found "+r.componentCount.toFixed()),r.componentType===l.FLOAT?this._wrapAccessor(oe,r):(s.errorUnsupportedIf(!r.normalized,"Integer component types are only supported for a normalized accessor for TEXCOORD_0."),yt(r))}async getVertexColors(e,t){const s=this._errorContext;s.assert(e.attributes.COLOR_0!=null,"No COLOR_0 vertex data found.");const r=await this.getAccessor(e.attributes.COLOR_0,t);if(s.errorUnsupportedIf(r.componentCount!==4&&r.componentCount!==3,"COLOR_0 attribute must have 3 or 4 components, but found "+r.componentCount.toFixed()),r.componentCount===4){if(r.componentType===l.FLOAT)return this._wrapAccessor(J,r);if(r.componentType===l.UNSIGNED_BYTE)return this._wrapAccessor(ve,r);if(r.componentType===l.UNSIGNED_SHORT)return this._wrapAccessor(Le,r)}else if(r.componentCount===3){if(r.componentType===l.FLOAT)return this._wrapAccessor(H,r);if(r.componentType===l.UNSIGNED_BYTE)return this._wrapAccessor($e,r);if(r.componentType===l.UNSIGNED_SHORT)return this._wrapAccessor(Fe,r)}s.errorUnsupported("Unsupported component type for COLOR_0 attribute: "+l[r.componentType])}hasPositions(e){return e.attributes.POSITION!==void 0}hasNormals(e){return e.attributes.NORMAL!==void 0}hasVertexColors(e){return e.attributes.COLOR_0!==void 0}hasTextureCoordinates(e){return e.attributes.TEXCOORD_0!==void 0}hasTangents(e){return e.attributes.TANGENT!==void 0}async getMaterial(e,t,s){var o,a,f,i,u,c,d,m,h,T;let r=e.material?this._materialCache.get(e.material):void 0;if(!r){const p=e.material!=null?Q(this.json.materials[e.material]):Q(),y=p.pbrMetallicRoughness,w=this.hasVertexColors(e),g=this.getTexture(y.baseColorTexture,t),b=this.getTexture(p.normalTexture,t),x=s?this.getTexture(p.occlusionTexture,t):void 0,S=s?this.getTexture(p.emissiveTexture,t):void 0,_=s?this.getTexture(y.metallicRoughnessTexture,t):void 0,A=e.material!=null?e.material:-1;r={alphaMode:p.alphaMode,alphaCutoff:p.alphaCutoff,color:y.baseColorFactor,doubleSided:!!p.doubleSided,colorTexture:await g,normalTexture:await b,name:p.name,id:A,occlusionTexture:await x,emissiveTexture:await S,emissiveFactor:p.emissiveFactor,metallicFactor:y.metallicFactor,roughnessFactor:y.roughnessFactor,metallicRoughnessTexture:await _,hasVertexColors:w,ESRI_externalColorMixMode:p.extras.ESRI_externalColorMixMode,colorTextureTransform:(a=(o=y==null?void 0:y.baseColorTexture)==null?void 0:o.extensions)==null?void 0:a.KHR_texture_transform,normalTextureTransform:(i=(f=p.normalTexture)==null?void 0:f.extensions)==null?void 0:i.KHR_texture_transform,occlusionTextureTransform:(c=(u=p.occlusionTexture)==null?void 0:u.extensions)==null?void 0:c.KHR_texture_transform,emissiveTextureTransform:(m=(d=p.emissiveTexture)==null?void 0:d.extensions)==null?void 0:m.KHR_texture_transform,metallicRoughnessTextureTransform:(T=(h=y==null?void 0:y.metallicRoughnessTexture)==null?void 0:h.extensions)==null?void 0:T.KHR_texture_transform}}return r}async getTexture(e,t){if(!e)return;this._errorContext.errorUnsupportedIf((e.texCoord||0)!==0,"Only TEXCOORD with index 0 is supported.");const s=e.index,r=this._errorContext,o=this.json.textures[s],a=ct(o.sampler!=null?this.json.samplers[o.sampler]:{});r.errorUnsupportedIf(o.source==null,"Source is expected to be defined for a texture.");const f=this.json.images[o.source],i=await this._loadTextureImageData(s,o,t);return we(this._textureCache,s,()=>{const u=d=>d===33071||d===33648||d===10497,c=d=>(r.error(`Unexpected TextureSampler WrapMode: ${d}. Using default REPEAT(10497).`),10497);return{data:i,wrapS:u(a.wrapS)?a.wrapS:c(a.wrapS),wrapT:u(a.wrapT)?a.wrapT:c(a.wrapT),minFilter:a.minFilter,name:f.name,id:s}})}getNodeTransform(e){if(e===void 0)return lt;let t=this._nodeTransformCache.get(e);if(!t){const s=this.getNodeTransform(this._getNodeParent(e)),r=this.json.nodes[e];r.matrix?t=ge(re(),s,r.matrix):r.translation||r.rotation||r.scale?(t=ne(s),r.translation&&Se(t,t,r.translation),r.rotation&&(P[3]=Ue(P,r.rotation),Ee(t,t,P[3],P)),r.scale&&Ie(t,t,r.scale)):t=s,this._nodeTransformCache.set(e,t)}return t}_wrapAccessor(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}_resolveUri(e){return Ae(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=se.parse(this.json.asset.version,"glTF");dt.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json,t=this._errorContext;e.extensionsRequired&&e.extensionsRequired.length!==0&&t.errorUnsupported("gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach((e,t)=>{e.children&&e.children.forEach(s=>{this._nodeParentMap.set(s,t)})})}async _loadTextureImageData(e,t,s){const r=this._textureLoaders.get(e);if(r)return r;const o=this._createTextureLoader(t,s);return this._textureLoaders.set(e,o),o}async _createTextureLoader(e,t){const s=this.json.images[e.source];if(s.uri)return this._context.loadImage(this._resolveUri(s.uri),t);const r=this._errorContext;r.errorUnsupportedIf(s.bufferView==null,"Image bufferView must be defined."),r.errorUnsupportedIf(s.mimeType==null,"Image mimeType must be defined.");const o=this.json.bufferViews[s.bufferView],a=await this.getBuffer(o.buffer,t);return r.errorUnsupportedIf(o.byteStride!=null,"byteStride not supported for image buffer"),Tt(new Uint8Array(a.buffer,a.byteOffset+(o.byteOffset||0),o.byteLength),s.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await q(Array.from(this._bufferLoaders.values())),t=await q(Array.from(this._textureLoaders.values()));return e.reduce((s,r)=>{var o;return s+((o=r==null?void 0:r.byteLength)!=null?o:0)},0)+t.reduce((s,r)=>s+(r?r.width*r.height*4:0),0)}}const dt=new se(2,0,"glTF"),lt=_e(re(),Math.PI/2),P=Ne(),pt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4},mt={[l.BYTE]:1,[l.UNSIGNED_BYTE]:1,[l.SHORT]:2,[l.UNSIGNED_SHORT]:2,[l.FLOAT]:4,[l.UNSIGNED_INT]:4};function yt(n){switch(n.componentType){case l.BYTE:return new Ve(n.raw,n.byteOffset,n.byteStride,n.byteOffset+n.byteStride*n.entryCount);case l.UNSIGNED_BYTE:return new je(n.raw,n.byteOffset,n.byteStride,n.byteOffset+n.byteStride*n.entryCount);case l.SHORT:return new Ge(n.raw,n.byteOffset,n.byteStride,n.byteOffset+n.byteStride*n.entryCount);case l.UNSIGNED_SHORT:return new De(n.raw,n.byteOffset,n.byteStride,n.byteOffset+n.byteStride*n.entryCount);case l.UNSIGNED_INT:return new Pe(n.raw,n.byteOffset,n.byteStride,n.byteOffset+n.byteStride*n.entryCount);case l.FLOAT:return new oe(n.raw,n.byteOffset,n.byteStride,n.byteOffset+n.byteStride*n.entryCount)}}async function ht(n){return new Promise((e,t)=>{const s=new Blob([n]),r=new FileReader;r.onload=()=>{const o=r.result;e(JSON.parse(o))},r.onerror=o=>{t(o)},r.readAsText(s)})}async function Tt(n,e){return new Promise((t,s)=>{const r=new Blob([n],{type:e}),o=URL.createObjectURL(r),a=new Image,f=()=>{URL.revokeObjectURL(o),"decode"in a?a.decode().then(()=>t(a),()=>t(a)).then(u):(t(a),u())},i=c=>{URL.revokeObjectURL(o),s(c),u()},u=()=>{a.removeEventListener("load",f),a.removeEventListener("error",i)};a.addEventListener("load",f),a.addEventListener("error",i),a.src=o})}let xt=0;async function Ft(n,e,t={},s=!0){const r=await E.load(n,G,e,t),o="gltf_"+xt++,a={lods:[],materials:new Map,textures:new Map,meta:_t(r)},f=!(!r.json.asset.extras||r.json.asset.extras.ESRI_type!=="symbolResource"),i=new Map;await bt(r,async(c,d,m,h)=>{var R;const T=(R=i.get(m))!=null?R:0;i.set(m,T+1);const p=c.mode!==void 0?c.mode:B.TRIANGLES,y=p===B.TRIANGLES||p===B.TRIANGLE_STRIP||p===B.TRIANGLE_FAN?p:null;if(te(y))return void G.warnUnsupported("Unsupported primitive mode ("+B[p]+"). Skipping primitive.");if(!r.hasPositions(c))return void G.warn("Skipping primitive without POSITION vertex attribute.");const w=r.getPositionData(c,t),g=r.getMaterial(c,t,s),b=r.hasNormals(c)?r.getNormalData(c,t):null,x=r.hasTangents(c)?r.getTangentData(c,t):null,S=r.hasTextureCoordinates(c)?r.getTextureCoordinates(c,t):null,_=r.hasVertexColors(c)?r.getVertexColors(c,t):null,A=r.getIndexData(c,t),U={transform:ne(d),attributes:{position:await w,normal:b?await b:null,texCoord0:S?await S:null,color:_?await _:null,tangent:x?await x:null},indices:await A,primitiveType:y,material:gt(a,await g,o)};let O=null;z(a.meta)&&z(a.meta.ESRI_lod)&&a.meta.ESRI_lod.metric==="screenSpaceRadius"&&(O=a.meta.ESRI_lod.thresholds[m]),a.lods[m]=a.lods[m]||{parts:[],name:h,lodThreshold:O},a.lods[m].parts[T]=U});for(const c of a.lods)c.parts=c.parts.filter(d=>!!d);const u=await r.getLoadedBuffersSize();return{model:a,meta:{isEsriSymbolResource:f,uri:r.uri},customMeta:{},size:u}}function _t(n){const e=n.json;let t=null;return e.nodes.forEach(s=>{const r=s.extras;z(r)&&(r.ESRI_proxyEllipsoid||r.ESRI_lod)&&(t=r)}),t}async function bt(n,e){const t=n.json,s=t.scenes[t.scene||0].nodes,r=s.length>1,o=[];for(const f of s){const i=t.nodes[f];o.push(a(f,0)),wt(i)&&!r&&i.extensions.MSFT_lod.ids.forEach((u,c)=>a(u,c+1))}async function a(f,i){const u=t.nodes[f],c=n.getNodeTransform(f);if(G.warnUnsupportedIf(u.weights!=null,"Morph targets are not supported."),u.mesh!=null){const d=t.meshes[u.mesh];for(const m of d.primitives)o.push(e(m,c,i,d.name))}for(const d of u.children||[])o.push(a(d,i))}await Promise.all(o)}function wt(n){return n.extensions&&n.extensions.MSFT_lod&&Array.isArray(n.extensions.MSFT_lod.ids)}function gt(n,e,t){const s=o=>{const a=`${t}_tex_${o&&o.id}${o&&o.name?"_"+o.name:""}`;if(o&&!n.textures.has(a)){const f=st(o.data,{wrap:{s:o.wrapS,t:o.wrapT},mipmap:St.includes(o.minFilter),noUnpackFlip:!0});n.textures.set(a,f)}return a},r=`${t}_mat_${e.id}_${e.name}`;if(!n.materials.has(r)){const o=nt({color:[e.color[0],e.color[1],e.color[2]],opacity:e.color[3],alphaMode:e.alphaMode,alphaCutoff:e.alphaCutoff,doubleSided:e.doubleSided,colorMixMode:e.ESRI_externalColorMixMode,textureColor:e.colorTexture?s(e.colorTexture):void 0,textureNormal:e.normalTexture?s(e.normalTexture):void 0,textureOcclusion:e.occlusionTexture?s(e.occlusionTexture):void 0,textureEmissive:e.emissiveTexture?s(e.emissiveTexture):void 0,textureMetallicRoughness:e.metallicRoughnessTexture?s(e.metallicRoughnessTexture):void 0,emissiveFactor:[e.emissiveFactor[0],e.emissiveFactor[1],e.emissiveFactor[2]],colorTextureTransform:e.colorTextureTransform,normalTextureTransform:e.normalTextureTransform,occlusionTextureTransform:e.occlusionTextureTransform,emissiveTextureTransform:e.emissiveTextureTransform,metallicRoughnessTextureTransform:e.metallicRoughnessTextureTransform,metallicFactor:e.metallicFactor,roughnessFactor:e.roughnessFactor});n.materials.set(r,o)}return r}const G=new rt,St=[V.LINEAR_MIPMAP_LINEAR,V.LINEAR_MIPMAP_NEAREST],k=1024;function Pt(n){if(Array.isArray(n)){if(n.length=65536)return new Uint32Array(n);return new Uint16Array(n)}if(n.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT)return n;for(const e of n)if(e>=65536)return n;return new Uint16Array(n)}function Et(n){const e=3*n;return e<=k?new Array(e):e<=65536?new Uint16Array(e):new Uint32Array(e)}let I=(()=>{const n=new Uint32Array(131072);for(let e=0;e{const n=new Uint16Array(65536);for(let e=0;eI.length){const e=Math.max(2*I.length,n);I=new Uint32Array(e);for(let t=0;tI.length){const e=new Uint32Array(n);for(let t=0;t0){const T=1/Math.sqrt(h);s[i]=T*c,s[i+1]=T*d,s[i+2]=T*m}}}function ze(n,e,t){const s=Math.min(n.count,e.count),r=n.typedBuffer,o=n.typedBufferStride,a=e.typedBuffer,f=e.typedBufferStride;for(let i=0;i>t,r[u+1]=a[c+1]>>t,r[u+2]=a[c+2]>>t,r[u+3]=a[c+3]>>t}}Object.freeze(Object.defineProperty({__proto__:null,transformMat4:ke,transformMat3:He,normalize:Ye,scale:ze,shiftRight:qe},Symbol.toStringTag,{value:"Module"}));function Je(n,e,t){const s=n.typedBuffer,r=n.typedBufferStride,o=e.typedBuffer,a=e.typedBufferStride,f=t?t.count:e.count;let i=(t&&t.dstIndex?t.dstIndex:0)*r,u=(t&&t.srcIndex?t.srcIndex:0)*a;for(let c=0;c{const e={...ie,...n.pbrMetallicRoughness},t=it({...at,...n.extras});return{...ot,...n,pbrMetallicRoughness:e,extras:t}};function it(n){switch(n.ESRI_externalColorMixMode){case"multiply":case"tint":case"ignore":case"replace":break;default:xe(n.ESRI_externalColorMixMode),n.ESRI_externalColorMixMode="tint"}return n}const ut={magFilter:V.LINEAR,minFilter:V.LINEAR_MIPMAP_LINEAR,wrapS:j.REPEAT,wrapT:j.REPEAT},ct=n=>({...ut,...n});function ft(n){let e,t;return n.replace(/^(.*\/)?([^/]*)$/,(s,r,o)=>(e=r||"",t=o||"","")),{dirPart:e,filePart:t}}const F={MAGIC:1179937895,CHUNK_TYPE_JSON:1313821514,CHUNK_TYPE_BIN:5130562,MIN_HEADER_LENGTH:20};class E{constructor(e,t,s,r,o){this._context=e,this._errorContext=t,this.uri=s,this.json=r,this._glbBuffer=o,this._bufferLoaders=new Map,this._textureLoaders=new Map,this._textureCache=new Map,this._materialCache=new Map,this._nodeParentMap=new Map,this._nodeTransformCache=new Map,this._baseUri=ft(this.uri).dirPart,this._checkVersionSupported(),this._checkRequiredExtensionsSupported(),t.errorUnsupportedIf(r.scenes==null,"Scenes must be defined."),t.errorUnsupportedIf(r.meshes==null,"Meshes must be defined"),t.errorUnsupportedIf(r.nodes==null,"Nodes must be defined."),this._computeNodeParents()}static async load(e,t,s,r){if(Z(s)){const f=be(s);if(f&&f.mediaType!=="model/gltf-binary")try{const u=JSON.parse(f.isBase64?atob(f.data):f.data);return new E(e,t,s,u)}catch{}const i=ee(s);if(E._isGLBData(i))return this._fromGLBData(e,t,s,i)}if(s.endsWith(".gltf")){const f=await e.loadJSON(s,r);return new E(e,t,s,f)}const o=await e.loadBinary(s,r);if(E._isGLBData(o))return this._fromGLBData(e,t,s,o);const a=await e.loadJSON(s,r);return new E(e,t,s,a)}static _isGLBData(e){if(e==null)return!1;const t=new K(e);return t.remainingBytes()>=4&&t.readUint32()===F.MAGIC}static async _fromGLBData(e,t,s,r){const o=await E._parseGLBData(t,r);return new E(e,t,s,o.json,o.binaryData)}static async _parseGLBData(e,t){const s=new K(t);e.assert(s.remainingBytes()>=12,"GLB binary data is insufficiently large.");const r=s.readUint32(),o=s.readUint32(),a=s.readUint32();e.assert(r===F.MAGIC,"Magic first 4 bytes do not fit to expected GLB value."),e.assert(t.byteLength>=a,"GLB binary data is smaller than header specifies."),e.errorUnsupportedIf(o!==2,"An unsupported GLB container version was detected. Only version 2 is supported.");let f,i,u=0;for(;s.remainingBytes()>=8;){const c=s.readUint32(),d=s.readUint32();u===0?(e.assert(d===F.CHUNK_TYPE_JSON,"First GLB chunk must be JSON."),e.assert(c>=0,"No JSON data found."),f=await ht(s.readUint8Array(c))):u===1?(e.errorUnsupportedIf(d!==F.CHUNK_TYPE_BIN,"Second GLB chunk expected to be BIN."),i=s.readUint8Array(c)):e.warnUnsupported("More than 2 GLB chunks detected. Skipping."),u+=1}return f||e.error("No GLB JSON chunk detected."),{json:f,binaryData:i}}async getBuffer(e,t){const s=this.json.buffers[e],r=this._errorContext;if(s.uri==null)return r.assert(this._glbBuffer!=null,"GLB buffer not present"),this._glbBuffer;const o=await this._getBufferLoader(e,t);return r.assert(o.byteLength===s.byteLength,"Buffer byte lengths should match."),o}async _getBufferLoader(e,t){const s=this._bufferLoaders.get(e);if(s)return s;const r=this.json.buffers[e].uri,o=this._context.loadBinary(this._resolveUri(r),t).then(a=>new Uint8Array(a));return this._bufferLoaders.set(e,o),o}async getAccessor(e,t){const s=this._errorContext;s.errorUnsupportedIf(!this.json.accessors,"Accessors missing.");const r=this.json.accessors[e];s.errorUnsupportedIf((r==null?void 0:r.bufferView)==null,"Some accessor does not specify a bufferView."),s.errorUnsupportedIf(r.type in[C.MAT2,C.MAT3,C.MAT4],`AttributeType ${r.type} is not supported`);const o=this.json.bufferViews[r.bufferView],a=await this.getBuffer(o.buffer,t),f=pt[r.type],i=mt[r.componentType],u=f*i,c=o.byteStride||u;return{raw:a.buffer,byteStride:c,byteOffset:a.byteOffset+(o.byteOffset||0)+(r.byteOffset||0),entryCount:r.count,isDenselyPacked:c===u,componentCount:f,componentByteSize:i,componentType:r.componentType,min:r.min,max:r.max,normalized:!!r.normalized}}async getIndexData(e,t){if(e.indices==null)return;const s=await this.getAccessor(e.indices,t);if(s.isDenselyPacked)switch(s.componentType){case l.UNSIGNED_BYTE:return new Uint8Array(s.raw,s.byteOffset,s.entryCount);case l.UNSIGNED_SHORT:return new Uint16Array(s.raw,s.byteOffset,s.entryCount);case l.UNSIGNED_INT:return new Uint32Array(s.raw,s.byteOffset,s.entryCount)}else switch(s.componentType){case l.UNSIGNED_BYTE:return D(this._wrapAccessor(Me,s));case l.UNSIGNED_SHORT:return D(this._wrapAccessor(Ce,s));case l.UNSIGNED_INT:return D(this._wrapAccessor(Be,s))}}async getPositionData(e,t){const s=this._errorContext;s.errorUnsupportedIf(e.attributes.POSITION==null,"No POSITION vertex data found.");const r=await this.getAccessor(e.attributes.POSITION,t);return s.errorUnsupportedIf(r.componentType!==l.FLOAT,"Expected type FLOAT for POSITION vertex attribute, but found "+l[r.componentType]),s.errorUnsupportedIf(r.componentCount!==3,"POSITION vertex attribute must have 3 components, but found "+r.componentCount.toFixed()),this._wrapAccessor(H,r)}async getNormalData(e,t){const s=this._errorContext;s.assert(e.attributes.NORMAL!=null,"No NORMAL vertex data found.");const r=await this.getAccessor(e.attributes.NORMAL,t);return s.errorUnsupportedIf(r.componentType!==l.FLOAT,"Expected type FLOAT for NORMAL vertex attribute, but found "+l[r.componentType]),s.errorUnsupportedIf(r.componentCount!==3,"NORMAL vertex attribute must have 3 components, but found "+r.componentCount.toFixed()),this._wrapAccessor(H,r)}async getTangentData(e,t){const s=this._errorContext;s.assert(e.attributes.TANGENT!=null,"No TANGENT vertex data found.");const r=await this.getAccessor(e.attributes.TANGENT,t);return s.errorUnsupportedIf(r.componentType!==l.FLOAT,"Expected type FLOAT for TANGENT vertex attribute, but found "+l[r.componentType]),s.errorUnsupportedIf(r.componentCount!==4,"TANGENT vertex attribute must have 4 components, but found "+r.componentCount.toFixed()),new J(r.raw,r.byteOffset,r.byteStride,r.byteOffset+r.byteStride*r.entryCount)}async getTextureCoordinates(e,t){const s=this._errorContext;s.assert(e.attributes.TEXCOORD_0!=null,"No TEXCOORD_0 vertex data found.");const r=await this.getAccessor(e.attributes.TEXCOORD_0,t);return s.errorUnsupportedIf(r.componentCount!==2,"TEXCOORD_0 vertex attribute must have 2 components, but found "+r.componentCount.toFixed()),r.componentType===l.FLOAT?this._wrapAccessor(oe,r):(s.errorUnsupportedIf(!r.normalized,"Integer component types are only supported for a normalized accessor for TEXCOORD_0."),yt(r))}async getVertexColors(e,t){const s=this._errorContext;s.assert(e.attributes.COLOR_0!=null,"No COLOR_0 vertex data found.");const r=await this.getAccessor(e.attributes.COLOR_0,t);if(s.errorUnsupportedIf(r.componentCount!==4&&r.componentCount!==3,"COLOR_0 attribute must have 3 or 4 components, but found "+r.componentCount.toFixed()),r.componentCount===4){if(r.componentType===l.FLOAT)return this._wrapAccessor(J,r);if(r.componentType===l.UNSIGNED_BYTE)return this._wrapAccessor(ve,r);if(r.componentType===l.UNSIGNED_SHORT)return this._wrapAccessor(Le,r)}else if(r.componentCount===3){if(r.componentType===l.FLOAT)return this._wrapAccessor(H,r);if(r.componentType===l.UNSIGNED_BYTE)return this._wrapAccessor($e,r);if(r.componentType===l.UNSIGNED_SHORT)return this._wrapAccessor(Fe,r)}s.errorUnsupported("Unsupported component type for COLOR_0 attribute: "+l[r.componentType])}hasPositions(e){return e.attributes.POSITION!==void 0}hasNormals(e){return e.attributes.NORMAL!==void 0}hasVertexColors(e){return e.attributes.COLOR_0!==void 0}hasTextureCoordinates(e){return e.attributes.TEXCOORD_0!==void 0}hasTangents(e){return e.attributes.TANGENT!==void 0}async getMaterial(e,t,s){var o,a,f,i,u,c,d,m,h,T;let r=e.material?this._materialCache.get(e.material):void 0;if(!r){const p=e.material!=null?Q(this.json.materials[e.material]):Q(),y=p.pbrMetallicRoughness,w=this.hasVertexColors(e),g=this.getTexture(y.baseColorTexture,t),b=this.getTexture(p.normalTexture,t),x=s?this.getTexture(p.occlusionTexture,t):void 0,S=s?this.getTexture(p.emissiveTexture,t):void 0,_=s?this.getTexture(y.metallicRoughnessTexture,t):void 0,A=e.material!=null?e.material:-1;r={alphaMode:p.alphaMode,alphaCutoff:p.alphaCutoff,color:y.baseColorFactor,doubleSided:!!p.doubleSided,colorTexture:await g,normalTexture:await b,name:p.name,id:A,occlusionTexture:await x,emissiveTexture:await S,emissiveFactor:p.emissiveFactor,metallicFactor:y.metallicFactor,roughnessFactor:y.roughnessFactor,metallicRoughnessTexture:await _,hasVertexColors:w,ESRI_externalColorMixMode:p.extras.ESRI_externalColorMixMode,colorTextureTransform:(a=(o=y==null?void 0:y.baseColorTexture)==null?void 0:o.extensions)==null?void 0:a.KHR_texture_transform,normalTextureTransform:(i=(f=p.normalTexture)==null?void 0:f.extensions)==null?void 0:i.KHR_texture_transform,occlusionTextureTransform:(c=(u=p.occlusionTexture)==null?void 0:u.extensions)==null?void 0:c.KHR_texture_transform,emissiveTextureTransform:(m=(d=p.emissiveTexture)==null?void 0:d.extensions)==null?void 0:m.KHR_texture_transform,metallicRoughnessTextureTransform:(T=(h=y==null?void 0:y.metallicRoughnessTexture)==null?void 0:h.extensions)==null?void 0:T.KHR_texture_transform}}return r}async getTexture(e,t){if(!e)return;this._errorContext.errorUnsupportedIf((e.texCoord||0)!==0,"Only TEXCOORD with index 0 is supported.");const s=e.index,r=this._errorContext,o=this.json.textures[s],a=ct(o.sampler!=null?this.json.samplers[o.sampler]:{});r.errorUnsupportedIf(o.source==null,"Source is expected to be defined for a texture.");const f=this.json.images[o.source],i=await this._loadTextureImageData(s,o,t);return we(this._textureCache,s,()=>{const u=d=>d===33071||d===33648||d===10497,c=d=>(r.error(`Unexpected TextureSampler WrapMode: ${d}. Using default REPEAT(10497).`),10497);return{data:i,wrapS:u(a.wrapS)?a.wrapS:c(a.wrapS),wrapT:u(a.wrapT)?a.wrapT:c(a.wrapT),minFilter:a.minFilter,name:f.name,id:s}})}getNodeTransform(e){if(e===void 0)return lt;let t=this._nodeTransformCache.get(e);if(!t){const s=this.getNodeTransform(this._getNodeParent(e)),r=this.json.nodes[e];r.matrix?t=ge(re(),s,r.matrix):r.translation||r.rotation||r.scale?(t=ne(s),r.translation&&Se(t,t,r.translation),r.rotation&&(P[3]=Ue(P,r.rotation),Ee(t,t,P[3],P)),r.scale&&Ie(t,t,r.scale)):t=s,this._nodeTransformCache.set(e,t)}return t}_wrapAccessor(e,t){return new e(t.raw,t.byteOffset,t.byteStride,t.byteOffset+t.byteStride*(t.entryCount-1)+t.componentByteSize*t.componentCount)}_resolveUri(e){return Ae(e,this._baseUri)}_getNodeParent(e){return this._nodeParentMap.get(e)}_checkVersionSupported(){const e=se.parse(this.json.asset.version,"glTF");dt.validate(e)}_checkRequiredExtensionsSupported(){const e=this.json,t=this._errorContext;e.extensionsRequired&&e.extensionsRequired.length!==0&&t.errorUnsupported("gltf loader was not able to load unsupported feature. Required extensions: "+e.extensionsRequired.join(", "))}_computeNodeParents(){this.json.nodes.forEach((e,t)=>{e.children&&e.children.forEach(s=>{this._nodeParentMap.set(s,t)})})}async _loadTextureImageData(e,t,s){const r=this._textureLoaders.get(e);if(r)return r;const o=this._createTextureLoader(t,s);return this._textureLoaders.set(e,o),o}async _createTextureLoader(e,t){const s=this.json.images[e.source];if(s.uri)return this._context.loadImage(this._resolveUri(s.uri),t);const r=this._errorContext;r.errorUnsupportedIf(s.bufferView==null,"Image bufferView must be defined."),r.errorUnsupportedIf(s.mimeType==null,"Image mimeType must be defined.");const o=this.json.bufferViews[s.bufferView],a=await this.getBuffer(o.buffer,t);return r.errorUnsupportedIf(o.byteStride!=null,"byteStride not supported for image buffer"),Tt(new Uint8Array(a.buffer,a.byteOffset+(o.byteOffset||0),o.byteLength),s.mimeType)}async getLoadedBuffersSize(){if(this._glbBuffer)return this._glbBuffer.byteLength;const e=await q(Array.from(this._bufferLoaders.values())),t=await q(Array.from(this._textureLoaders.values()));return e.reduce((s,r)=>{var o;return s+((o=r==null?void 0:r.byteLength)!=null?o:0)},0)+t.reduce((s,r)=>s+(r?r.width*r.height*4:0),0)}}const dt=new se(2,0,"glTF"),lt=_e(re(),Math.PI/2),P=Ne(),pt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4},mt={[l.BYTE]:1,[l.UNSIGNED_BYTE]:1,[l.SHORT]:2,[l.UNSIGNED_SHORT]:2,[l.FLOAT]:4,[l.UNSIGNED_INT]:4};function yt(n){switch(n.componentType){case l.BYTE:return new Ve(n.raw,n.byteOffset,n.byteStride,n.byteOffset+n.byteStride*n.entryCount);case l.UNSIGNED_BYTE:return new je(n.raw,n.byteOffset,n.byteStride,n.byteOffset+n.byteStride*n.entryCount);case l.SHORT:return new Ge(n.raw,n.byteOffset,n.byteStride,n.byteOffset+n.byteStride*n.entryCount);case l.UNSIGNED_SHORT:return new De(n.raw,n.byteOffset,n.byteStride,n.byteOffset+n.byteStride*n.entryCount);case l.UNSIGNED_INT:return new Pe(n.raw,n.byteOffset,n.byteStride,n.byteOffset+n.byteStride*n.entryCount);case l.FLOAT:return new oe(n.raw,n.byteOffset,n.byteStride,n.byteOffset+n.byteStride*n.entryCount)}}async function ht(n){return new Promise((e,t)=>{const s=new Blob([n]),r=new FileReader;r.onload=()=>{const o=r.result;e(JSON.parse(o))},r.onerror=o=>{t(o)},r.readAsText(s)})}async function Tt(n,e){return new Promise((t,s)=>{const r=new Blob([n],{type:e}),o=URL.createObjectURL(r),a=new Image,f=()=>{URL.revokeObjectURL(o),"decode"in a?a.decode().then(()=>t(a),()=>t(a)).then(u):(t(a),u())},i=c=>{URL.revokeObjectURL(o),s(c),u()},u=()=>{a.removeEventListener("load",f),a.removeEventListener("error",i)};a.addEventListener("load",f),a.addEventListener("error",i),a.src=o})}let xt=0;async function Ft(n,e,t={},s=!0){const r=await E.load(n,G,e,t),o="gltf_"+xt++,a={lods:[],materials:new Map,textures:new Map,meta:_t(r)},f=!(!r.json.asset.extras||r.json.asset.extras.ESRI_type!=="symbolResource"),i=new Map;await bt(r,async(c,d,m,h)=>{var R;const T=(R=i.get(m))!=null?R:0;i.set(m,T+1);const p=c.mode!==void 0?c.mode:B.TRIANGLES,y=p===B.TRIANGLES||p===B.TRIANGLE_STRIP||p===B.TRIANGLE_FAN?p:null;if(te(y))return void G.warnUnsupported("Unsupported primitive mode ("+B[p]+"). Skipping primitive.");if(!r.hasPositions(c))return void G.warn("Skipping primitive without POSITION vertex attribute.");const w=r.getPositionData(c,t),g=r.getMaterial(c,t,s),b=r.hasNormals(c)?r.getNormalData(c,t):null,x=r.hasTangents(c)?r.getTangentData(c,t):null,S=r.hasTextureCoordinates(c)?r.getTextureCoordinates(c,t):null,_=r.hasVertexColors(c)?r.getVertexColors(c,t):null,A=r.getIndexData(c,t),U={transform:ne(d),attributes:{position:await w,normal:b?await b:null,texCoord0:S?await S:null,color:_?await _:null,tangent:x?await x:null},indices:await A,primitiveType:y,material:gt(a,await g,o)};let O=null;z(a.meta)&&z(a.meta.ESRI_lod)&&a.meta.ESRI_lod.metric==="screenSpaceRadius"&&(O=a.meta.ESRI_lod.thresholds[m]),a.lods[m]=a.lods[m]||{parts:[],name:h,lodThreshold:O},a.lods[m].parts[T]=U});for(const c of a.lods)c.parts=c.parts.filter(d=>!!d);const u=await r.getLoadedBuffersSize();return{model:a,meta:{isEsriSymbolResource:f,uri:r.uri},customMeta:{},size:u}}function _t(n){const e=n.json;let t=null;return e.nodes.forEach(s=>{const r=s.extras;z(r)&&(r.ESRI_proxyEllipsoid||r.ESRI_lod)&&(t=r)}),t}async function bt(n,e){const t=n.json,s=t.scenes[t.scene||0].nodes,r=s.length>1,o=[];for(const f of s){const i=t.nodes[f];o.push(a(f,0)),wt(i)&&!r&&i.extensions.MSFT_lod.ids.forEach((u,c)=>a(u,c+1))}async function a(f,i){const u=t.nodes[f],c=n.getNodeTransform(f);if(G.warnUnsupportedIf(u.weights!=null,"Morph targets are not supported."),u.mesh!=null){const d=t.meshes[u.mesh];for(const m of d.primitives)o.push(e(m,c,i,d.name))}for(const d of u.children||[])o.push(a(d,i))}await Promise.all(o)}function wt(n){return n.extensions&&n.extensions.MSFT_lod&&Array.isArray(n.extensions.MSFT_lod.ids)}function gt(n,e,t){const s=o=>{const a=`${t}_tex_${o&&o.id}${o&&o.name?"_"+o.name:""}`;if(o&&!n.textures.has(a)){const f=st(o.data,{wrap:{s:o.wrapS,t:o.wrapT},mipmap:St.includes(o.minFilter),noUnpackFlip:!0});n.textures.set(a,f)}return a},r=`${t}_mat_${e.id}_${e.name}`;if(!n.materials.has(r)){const o=nt({color:[e.color[0],e.color[1],e.color[2]],opacity:e.color[3],alphaMode:e.alphaMode,alphaCutoff:e.alphaCutoff,doubleSided:e.doubleSided,colorMixMode:e.ESRI_externalColorMixMode,textureColor:e.colorTexture?s(e.colorTexture):void 0,textureNormal:e.normalTexture?s(e.normalTexture):void 0,textureOcclusion:e.occlusionTexture?s(e.occlusionTexture):void 0,textureEmissive:e.emissiveTexture?s(e.emissiveTexture):void 0,textureMetallicRoughness:e.metallicRoughnessTexture?s(e.metallicRoughnessTexture):void 0,emissiveFactor:[e.emissiveFactor[0],e.emissiveFactor[1],e.emissiveFactor[2]],colorTextureTransform:e.colorTextureTransform,normalTextureTransform:e.normalTextureTransform,occlusionTextureTransform:e.occlusionTextureTransform,emissiveTextureTransform:e.emissiveTextureTransform,metallicRoughnessTextureTransform:e.metallicRoughnessTextureTransform,metallicFactor:e.metallicFactor,roughnessFactor:e.roughnessFactor});n.materials.set(r,o)}return r}const G=new rt,St=[V.LINEAR_MIPMAP_LINEAR,V.LINEAR_MIPMAP_NEAREST],k=1024;function Pt(n){if(Array.isArray(n)){if(n.length=65536)return new Uint32Array(n);return new Uint16Array(n)}if(n.BYTES_PER_ELEMENT===Uint16Array.BYTES_PER_ELEMENT)return n;for(const e of n)if(e>=65536)return n;return new Uint16Array(n)}function Et(n){const e=3*n;return e<=k?new Array(e):e<=65536?new Uint16Array(e):new Uint32Array(e)}let I=(()=>{const n=new Uint32Array(131072);for(let e=0;e{const n=new Uint16Array(65536);for(let e=0;eI.length){const e=Math.max(2*I.length,n);I=new Uint32Array(e);for(let t=0;tI.length){const e=new Uint32Array(n);for(let t=0;t_.normalize(C(e),0,!0))],a.prototype,"orientation",void 0),a=t([w("esri.analysis.LengthDimension")],a);const D=a,g=N.ofType(D);let p=class extends M{constructor(e){super(e),this.type="dimension",this.style=new b,this.extent=null}initialize(){this.addHandles(O(()=>this._computeExtent(),e=>{(m(e)||m(e.pending))&&this._set("extent",s(e)?e.extent:null)},q))}get dimensions(){return this._get("dimensions")||new g}set dimensions(e){this._set("dimensions",k(e,this.dimensions,g))}get spatialReference(){for(const e of this.dimensions){if(s(e.startPoint))return e.startPoint.spatialReference;if(s(e.endPoint))return e.endPoint.spatialReference}return null}get requiredPropertiesForEditing(){return this.dimensions.reduce((e,n)=>(e.push(n.startPoint,n.endPoint),e),[])}async waitComputeExtent(){const e=this._computeExtent();return s(e)?z(e.pending):null}_computeExtent(){const e=this.spatialReference;if(m(e))return{pending:null,extent:null};const n=[];for(const r of this.dimensions)s(r.startPoint)&&n.push(r.startPoint),s(r.endPoint)&&n.push(r.endPoint);const u=A(n,e);if(s(u.pending))return{pending:u.pending,extent:null};let h=null;return s(u.geometries)&&(h=u.geometries.reduce((r,y)=>m(r)?s(y)?P.fromPoint(y):null:s(y)?r.union(P.fromPoint(y)):r,null)),{pending:null,extent:h}}clear(){this.dimensions.removeAll()}};t([i({type:["dimension"]})],p.prototype,"type",void 0),t([i({cast:T,type:g,nonNullable:!0})],p.prototype,"dimensions",null),t([i({readOnly:!0})],p.prototype,"spatialReference",null),t([i({types:{key:"type",base:null,typeMap:{simple:b}},nonNullable:!0})],p.prototype,"style",void 0),t([i({value:null,readOnly:!0})],p.prototype,"extent",void 0),t([i({readOnly:!0})],p.prototype,"requiredPropertiesForEditing",null),p=t([w("esri.analysis.DimensionAnalysis")],p);const j=p;let o=class extends L(H(B)){constructor(e){if(super(e),this.type="dimension",this.operationalLayerType="ArcGISDimensionLayer",this.source=new j,this.opacity=1,e){const{source:n,style:u}=e;n&&u&&(n.style=u)}}initialize(){this.addHandles([O(()=>this.source,(e,n)=>{s(n)&&n.parent===this&&(n.parent=null),s(e)&&(e.parent=this)},q)])}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return z(this.source.spatialReference)}get style(){return this.source.style}set style(e){this.source.style=e}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new j)}get analysis(){return this.source}set analysis(e){this.source=e}get dimensions(){return this.source.dimensions}set dimensions(e){this.source.dimensions=e}writeDimensions(e,n,u,h){n.dimensions=e.filter(({startPoint:r,endPoint:y})=>s(r)&&s(y)).map(r=>r.toJSON(h)).toJSON()}};t([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),t([i({type:["ArcGISDimensionLayer"]})],o.prototype,"operationalLayerType",void 0),t([i({nonNullable:!0})],o.prototype,"source",void 0),t([i({readOnly:!0})],o.prototype,"spatialReference",null),t([i({types:{key:"type",base:null,typeMap:{simple:b}},json:{write:{ignoreOrigin:!0}}})],o.prototype,"style",null),t([i({readOnly:!0})],o.prototype,"fullExtent",null),t([i({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],o.prototype,"opacity",void 0),t([i({type:["show","hide"]})],o.prototype,"listMode",void 0),t([i({type:N.ofType(D),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],o.prototype,"dimensions",null),t([F("web-scene","dimensions")],o.prototype,"writeDimensions",null),o=t([w("esri.layers.DimensionLayer")],o);const V=o;export{V as default}; +import{iy as R,b9 as d,a6 as t,a7 as i,h0 as f,bQ as v,bw as E,a8 as w,iz as $,af as x,cw as S,iA as _,iB as C,cE as N,dy as T,_ as O,c_ as q,j as m,c as s,cZ as k,u as z,iC as A,cU as P,eF as L,eH as H,e0 as F,cF as B}from"./index.221827cd.js";import{c as M}from"./Analysis.db10ad10.js";let l=class extends R($){constructor(e){super(e),this.type="simple",this.color=new d("black"),this.lineSize=2,this.fontSize=10,this.textColor=new d("black"),this.textBackgroundColor=new d([255,255,255,.6])}};t([i({type:["simple"],readOnly:!0,json:{write:{isRequired:!0}}})],l.prototype,"type",void 0),t([i({type:d,nonNullable:!0,json:{type:[f],write:{isRequired:!0}}})],l.prototype,"color",void 0),t([i({type:Number,cast:v,nonNullable:!0,range:{min:E(1)},json:{write:{isRequired:!0}}})],l.prototype,"lineSize",void 0),t([i({type:Number,cast:v,nonNullable:!0,json:{write:{isRequired:!0}}})],l.prototype,"fontSize",void 0),t([i({type:d,nonNullable:!0,json:{type:[f],write:{isRequired:!0}}})],l.prototype,"textColor",void 0),t([i({type:d,nonNullable:!0,json:{type:[f],write:{isRequired:!0}}})],l.prototype,"textBackgroundColor",void 0),l=t([w("esri.analysis.DimensionSimpleStyle")],l);const b=l;var c;(function(e){e.Horizontal="horizontal",e.Vertical="vertical",e.Direct="direct"})(c||(c={}));const G=[c.Horizontal,c.Vertical,c.Direct];let a=class extends R($){constructor(e){super(e),this.type="length",this.startPoint=null,this.endPoint=null,this.measureType=c.Direct,this.offset=0,this.orientation=0}};t([i({type:["length"],json:{write:{isRequired:!0}}})],a.prototype,"type",void 0),t([i({type:x,json:{write:!0}})],a.prototype,"startPoint",void 0),t([i({type:x,json:{write:!0}})],a.prototype,"endPoint",void 0),t([i({type:G,nonNullable:!0,json:{write:{isRequired:!0}}})],a.prototype,"measureType",void 0),t([i({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}})],a.prototype,"offset",void 0),t([i({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),S(e=>_.normalize(C(e),0,!0))],a.prototype,"orientation",void 0),a=t([w("esri.analysis.LengthDimension")],a);const D=a,g=N.ofType(D);let p=class extends M{constructor(e){super(e),this.type="dimension",this.style=new b,this.extent=null}initialize(){this.addHandles(O(()=>this._computeExtent(),e=>{(m(e)||m(e.pending))&&this._set("extent",s(e)?e.extent:null)},q))}get dimensions(){return this._get("dimensions")||new g}set dimensions(e){this._set("dimensions",k(e,this.dimensions,g))}get spatialReference(){for(const e of this.dimensions){if(s(e.startPoint))return e.startPoint.spatialReference;if(s(e.endPoint))return e.endPoint.spatialReference}return null}get requiredPropertiesForEditing(){return this.dimensions.reduce((e,n)=>(e.push(n.startPoint,n.endPoint),e),[])}async waitComputeExtent(){const e=this._computeExtent();return s(e)?z(e.pending):null}_computeExtent(){const e=this.spatialReference;if(m(e))return{pending:null,extent:null};const n=[];for(const r of this.dimensions)s(r.startPoint)&&n.push(r.startPoint),s(r.endPoint)&&n.push(r.endPoint);const u=A(n,e);if(s(u.pending))return{pending:u.pending,extent:null};let h=null;return s(u.geometries)&&(h=u.geometries.reduce((r,y)=>m(r)?s(y)?P.fromPoint(y):null:s(y)?r.union(P.fromPoint(y)):r,null)),{pending:null,extent:h}}clear(){this.dimensions.removeAll()}};t([i({type:["dimension"]})],p.prototype,"type",void 0),t([i({cast:T,type:g,nonNullable:!0})],p.prototype,"dimensions",null),t([i({readOnly:!0})],p.prototype,"spatialReference",null),t([i({types:{key:"type",base:null,typeMap:{simple:b}},nonNullable:!0})],p.prototype,"style",void 0),t([i({value:null,readOnly:!0})],p.prototype,"extent",void 0),t([i({readOnly:!0})],p.prototype,"requiredPropertiesForEditing",null),p=t([w("esri.analysis.DimensionAnalysis")],p);const j=p;let o=class extends L(H(B)){constructor(e){if(super(e),this.type="dimension",this.operationalLayerType="ArcGISDimensionLayer",this.source=new j,this.opacity=1,e){const{source:n,style:u}=e;n&&u&&(n.style=u)}}initialize(){this.addHandles([O(()=>this.source,(e,n)=>{s(n)&&n.parent===this&&(n.parent=null),s(e)&&(e.parent=this)},q)])}async load(){return this.addResolvingPromise(this.source.waitComputeExtent()),this}get spatialReference(){return z(this.source.spatialReference)}get style(){return this.source.style}set style(e){this.source.style=e}get fullExtent(){return this.source.extent}releaseAnalysis(e){this.source===e&&(this.source=new j)}get analysis(){return this.source}set analysis(e){this.source=e}get dimensions(){return this.source.dimensions}set dimensions(e){this.source.dimensions=e}writeDimensions(e,n,u,h){n.dimensions=e.filter(({startPoint:r,endPoint:y})=>s(r)&&s(y)).map(r=>r.toJSON(h)).toJSON()}};t([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),t([i({type:["ArcGISDimensionLayer"]})],o.prototype,"operationalLayerType",void 0),t([i({nonNullable:!0})],o.prototype,"source",void 0),t([i({readOnly:!0})],o.prototype,"spatialReference",null),t([i({types:{key:"type",base:null,typeMap:{simple:b}},json:{write:{ignoreOrigin:!0}}})],o.prototype,"style",null),t([i({readOnly:!0})],o.prototype,"fullExtent",null),t([i({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],o.prototype,"opacity",void 0),t([i({type:["show","hide"]})],o.prototype,"listMode",void 0),t([i({type:N.ofType(D),json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{ignoreOrigin:!0}}}}})],o.prototype,"dimensions",null),t([F("web-scene","dimensions")],o.prototype,"writeDimensions",null),o=t([w("esri.layers.DimensionLayer")],o);const V=o;export{V as default}; diff --git a/assets/EdgeProcessingWorker.2beeabb2.js b/assets/EdgeProcessingWorker.f1d5e58e.js similarity index 90% rename from assets/EdgeProcessingWorker.2beeabb2.js rename to assets/EdgeProcessingWorker.f1d5e58e.js index 89cd1b6..46d9e17 100644 --- a/assets/EdgeProcessingWorker.2beeabb2.js +++ b/assets/EdgeProcessingWorker.f1d5e58e.js @@ -1 +1 @@ -import{y as d,u as p,i as g,c as h,l as m,p as $,o as y,m as w,T as L,h as D,a as b,b as E,d as I,A,O as x,x as V,g as k,w as U,E as B,L as T,B as v,F as z,I as C,U as F,j as H,V as O,M as S,S as M,k as N,q as j,v as q,z as G,C as J,D as _,G as K,H as P}from"./BufferView.89055914.js";import{f as Q,u as c,h as u,A as R,a as W,m as X}from"./edgeProcessing.b309b825.js";import"./index.d94abe07.js";import"./deduplicate.17ab7923.js";import"./InterleavedLayout.f9d79992.js";import"./types.44c7402c.js";import"./VertexAttribute.42396f25.js";import"./enums.2d9e6f64.js";import"./VertexElementDescriptor.1fdca6da.js";function a(t,e){return e.push(t.buffer),{buffer:t.buffer,layout:Y(t.layout)}}function Y(t){const e=new Array;return t.fields.forEach((s,n)=>{const r={...s,constructor:f(s.constructor)};e.push([n,r])}),{stride:t.stride,fields:e,fieldNames:t.fieldNames}}const Z=[d,p,g,h,m,$,y,w,L,D,b,E,I,A,x,V,k,U,B,T,v,z,C,F,H,O,S,M,N,j,q,G,J,_,K,P];function f(t){return`${t.ElementType}_${t.ElementCount}`}const tt=new Map;Z.forEach(t=>tt.set(f(t),t));class ht{async extract(e){const s=o(e),n=Q(s),r=[s.data.buffer];return{result:et(n,r),transferList:r}}async extractComponentsEdgeLocations(e){const s=o(e),n=c(s.data,s.skipDeduplicate,s.indices,s.indicesLength),r=u(n,it,l),i=[];return{result:a(r.regular.instancesData,i),transferList:i}}async extractEdgeLocations(e){const s=o(e),n=c(s.data,s.skipDeduplicate,s.indices,s.indicesLength),r=u(n,rt,l),i=[];return{result:a(r.regular.instancesData,i),transferList:i}}}function o(t){return{data:R.createView(t.dataBuffer),indices:t.indicesType==="Uint32Array"?new Uint32Array(t.indices):t.indicesType==="Uint16Array"?new Uint16Array(t.indices):t.indices,indicesLength:t.indicesLength,writerSettings:t.writerSettings,skipDeduplicate:t.skipDeduplicate}}function et(t,e){return e.push(t.regular.lodInfo.lengths.buffer),e.push(t.silhouette.lodInfo.lengths.buffer),{regular:{instancesData:a(t.regular.instancesData,e),lodInfo:{lengths:t.regular.lodInfo.lengths.buffer}},silhouette:{instancesData:a(t.silhouette.instancesData,e),lodInfo:{lengths:t.silhouette.lodInfo.lengths.buffer}},averageEdgeLength:t.averageEdgeLength}}class st{allocate(e){return W.createBuffer(e)}trim(e,s){return e.slice(0,s)}write(e,s,n){e.position0.setVec(s,n.position0),e.position1.setVec(s,n.position1)}}class nt{allocate(e){return X.createBuffer(e)}trim(e,s){return e.slice(0,s)}write(e,s,n){e.position0.setVec(s,n.position0),e.position1.setVec(s,n.position1),e.componentIndex.set(s,n.componentIndex)}}const rt=new st,it=new nt,l={allocate:()=>null,write:()=>{},trim:()=>null};export{ht as default}; +import{y as d,u as p,i as g,c as h,l as m,p as $,o as y,m as w,T as L,h as D,a as b,b as E,d as I,A,O as x,x as V,g as k,w as U,E as B,L as T,B as v,F as z,I as C,U as F,j as H,V as O,M as S,S as M,k as N,q as j,v as q,z as G,C as J,D as _,G as K,H as P}from"./BufferView.6eee27cd.js";import{f as Q,u as c,h as u,A as R,a as W,m as X}from"./edgeProcessing.a9e4d72e.js";import"./index.221827cd.js";import"./deduplicate.ef93b18a.js";import"./InterleavedLayout.30cdc193.js";import"./types.44c7402c.js";import"./VertexAttribute.42396f25.js";import"./enums.2d9e6f64.js";import"./VertexElementDescriptor.1fdca6da.js";function a(t,e){return e.push(t.buffer),{buffer:t.buffer,layout:Y(t.layout)}}function Y(t){const e=new Array;return t.fields.forEach((s,n)=>{const r={...s,constructor:f(s.constructor)};e.push([n,r])}),{stride:t.stride,fields:e,fieldNames:t.fieldNames}}const Z=[d,p,g,h,m,$,y,w,L,D,b,E,I,A,x,V,k,U,B,T,v,z,C,F,H,O,S,M,N,j,q,G,J,_,K,P];function f(t){return`${t.ElementType}_${t.ElementCount}`}const tt=new Map;Z.forEach(t=>tt.set(f(t),t));class ht{async extract(e){const s=o(e),n=Q(s),r=[s.data.buffer];return{result:et(n,r),transferList:r}}async extractComponentsEdgeLocations(e){const s=o(e),n=c(s.data,s.skipDeduplicate,s.indices,s.indicesLength),r=u(n,it,l),i=[];return{result:a(r.regular.instancesData,i),transferList:i}}async extractEdgeLocations(e){const s=o(e),n=c(s.data,s.skipDeduplicate,s.indices,s.indicesLength),r=u(n,rt,l),i=[];return{result:a(r.regular.instancesData,i),transferList:i}}}function o(t){return{data:R.createView(t.dataBuffer),indices:t.indicesType==="Uint32Array"?new Uint32Array(t.indices):t.indicesType==="Uint16Array"?new Uint16Array(t.indices):t.indices,indicesLength:t.indicesLength,writerSettings:t.writerSettings,skipDeduplicate:t.skipDeduplicate}}function et(t,e){return e.push(t.regular.lodInfo.lengths.buffer),e.push(t.silhouette.lodInfo.lengths.buffer),{regular:{instancesData:a(t.regular.instancesData,e),lodInfo:{lengths:t.regular.lodInfo.lengths.buffer}},silhouette:{instancesData:a(t.silhouette.instancesData,e),lodInfo:{lengths:t.silhouette.lodInfo.lengths.buffer}},averageEdgeLength:t.averageEdgeLength}}class st{allocate(e){return W.createBuffer(e)}trim(e,s){return e.slice(0,s)}write(e,s,n){e.position0.setVec(s,n.position0),e.position1.setVec(s,n.position1)}}class nt{allocate(e){return X.createBuffer(e)}trim(e,s){return e.slice(0,s)}write(e,s,n){e.position0.setVec(s,n.position0),e.position1.setVec(s,n.position1),e.componentIndex.set(s,n.componentIndex)}}const rt=new st,it=new nt,l={allocate:()=>null,write:()=>{},trim:()=>null};export{ht as default}; diff --git a/assets/ElevationLayer.7d5a34eb.js b/assets/ElevationLayer.0f63abe9.js similarity index 93% rename from assets/ElevationLayer.7d5a34eb.js rename to assets/ElevationLayer.0f63abe9.js index 0302f8f..386f069 100644 --- a/assets/ElevationLayer.7d5a34eb.js +++ b/assets/ElevationLayer.0f63abe9.js @@ -1 +1 @@ -import{d6 as f,s as g,er as w,eD as T,c as p,v as u,u as S,eE as $,eF as b,eG as I,eH as L,eI as D,n as E,aU as k,U as v,dR as x,at as m,a6 as a,a7 as o,d2 as V,eJ as O,eK as j,a8 as P,cF as A}from"./index.d94abe07.js";import{s as M}from"./ArcGISCachedService.e7d85534.js";import"./TilemapCache.11964483.js";class U{constructor(e,t,r,l,h={}){this._mainMethod=t,this._transferLists=r,this._listeners=[],this._promise=f(e,{...h,schedule:l}).then(d=>{if(this._thread===void 0){this._thread=d,this._promise=null,h.hasInitialize&&this.broadcast({},"initialize");for(const n of this._listeners)this._connectListener(n)}else d.close()}),this._promise.catch(d=>g.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e} worker: ${d}`))}on(e,t){const r={removed:!1,eventName:e,callback:t,threadHandle:null};return this._listeners.push(r),this._connectListener(r),w(()=>{r.removed=!0,T(this._listeners,r),this._thread&&p(r.threadHandle)&&r.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null),this._promise=null}invoke(e,t){return this.invokeMethod(this._mainMethod,e,t)}invokeMethod(e,t,r){if(this._thread){const l=this._transferLists[e],h=l?l(t):[];return this._thread.invoke(e,t,{transferList:h,signal:r})}return this._promise?this._promise.then(()=>(u(r),this.invokeMethod(e,t,r))):Promise.reject(null)}broadcast(e,t){return this._thread?Promise.all(this._thread.broadcast(t,e)).then(()=>{}):this._promise?this._promise.then(()=>this.broadcast(e,t)):Promise.reject()}get promise(){return this._promise}_connectListener(e){this._thread&&this._thread.on(e.eventName,e.callback).then(t=>{e.removed||(e.threadHandle=t)})}}class _ extends U{constructor(e=null){super("LercWorker","_decode",{_decode:t=>[t.buffer]},e,{strategy:"dedicated"}),this.schedule=e,this.ref=0}decode(e,t,r){return e&&e.byteLength!==0?this.invoke({buffer:e,options:t},r):Promise.resolve(null)}release(){--this.ref<=0&&(c.forEach((e,t)=>{e===this&&c.delete(t)}),this.destroy())}}const c=new Map;function C(i=null){let e=c.get(S(i));return e||(p(i)?(e=new _(t=>i.schedule(t)),c.set(i,e)):(e=new _,c.set(null,e))),++e.ref,e}let s=class extends M($(b(I(L(A))))){constructor(...i){super(...i),this.copyright=null,this.heightModelInfo=null,this.path=null,this.minScale=void 0,this.maxScale=void 0,this.opacity=1,this.operationalLayerType="ArcGISTiledElevationServiceLayer",this.sourceJSON=null,this.type="elevation",this.url=null,this.version=null,this._lercDecoder=C()}normalizeCtorArgs(i,e){return typeof i=="string"?{url:i,...e}:i}destroy(){this._lercDecoder=D(this._lercDecoder)}readVersion(i,e){let t=e.currentVersion;return t||(t=9.3),t}load(i){const e=p(i)?i.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:t=>{for(let r=0;rthis._fetchImageService(e))),Promise.resolve(this)}fetchTile(i,e,t,r){const l=p((r=r||{signal:null}).signal)?r.signal:r.signal=new AbortController().signal,h={responseType:"array-buffer",signal:l},d={noDataValue:r.noDataValue,returnFileInfo:!0};return this.load().then(()=>this._fetchTileAvailability(i,e,t,r)).then(()=>v(this.getTileUrl(i,e,t),h)).then(n=>this._lercDecoder.decode(n.data,d,l)).then(n=>{var y;return{values:n.pixelData,width:n.width,height:n.height,maxZError:(y=n.fileInfo)==null?void 0:y.maxZError,noDataValue:n.noDataValue,minValue:n.minValue,maxValue:n.maxValue}})}getTileUrl(i,e,t){const r=!this.tilemapCache&&this.supportsBlankTile,l=x({...this.parsedUrl.query,blankTile:!r&&null});return`${this.parsedUrl.path}/tile/${i}/${e}/${t}${l?"?"+l:""}`}async queryElevation(i,e){const{ElevationQuery:t}=await m(()=>import("./ElevationQuery.5a32e4bc.js"),["assets/ElevationQuery.5a32e4bc.js","assets/index.d94abe07.js","assets/index.f5419ca5.css"]);return u(e),new t().query(this,i,e)}async createElevationSampler(i,e){const{ElevationQuery:t}=await m(()=>import("./ElevationQuery.5a32e4bc.js"),["assets/ElevationQuery.5a32e4bc.js","assets/index.d94abe07.js","assets/index.f5419ca5.css"]);return u(e),new t().createSampler(this,i,e)}_fetchTileAvailability(i,e,t,r){return this.tilemapCache?this.tilemapCache.fetchAvailability(i,e,t,r):Promise.resolve("unknown")}async _fetchImageService(i){var r;if(this.sourceJSON)return this.sourceJSON;const e={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:i},t=await v(this.parsedUrl.path,e);t.ssl&&(this.url=(r=this.url)==null?void 0:r.replace(/^http:/i,"https:")),this.sourceJSON=t.data,this.read(t.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile.__isDefault__}};a([o({json:{read:{source:"copyrightText"}}})],s.prototype,"copyright",void 0),a([o({readOnly:!0,type:O})],s.prototype,"heightModelInfo",void 0),a([o({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),a([o({type:["show","hide"]})],s.prototype,"listMode",void 0),a([o({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],s.prototype,"minScale",void 0),a([o({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],s.prototype,"maxScale",void 0),a([o({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],s.prototype,"opacity",void 0),a([o({type:["ArcGISTiledElevationServiceLayer"]})],s.prototype,"operationalLayerType",void 0),a([o()],s.prototype,"sourceJSON",void 0),a([o({json:{read:!1},value:"elevation",readOnly:!0})],s.prototype,"type",void 0),a([o(j)],s.prototype,"url",void 0),a([o()],s.prototype,"version",void 0),a([V("version",["currentVersion"])],s.prototype,"readVersion",null),s=a([P("esri.layers.ElevationLayer")],s),s.prototype.fetchTile.__isDefault__=!0;const J=s;export{J as default}; +import{d6 as f,s as g,er as w,eD as T,c as p,v as u,u as S,eE as $,eF as b,eG as I,eH as L,eI as D,n as E,aU as k,U as v,dR as x,at as m,a6 as a,a7 as o,d2 as V,eJ as O,eK as j,a8 as P,cF as A}from"./index.221827cd.js";import{s as M}from"./ArcGISCachedService.a530cd26.js";import"./TilemapCache.b64a2ea8.js";class U{constructor(e,t,r,l,h={}){this._mainMethod=t,this._transferLists=r,this._listeners=[],this._promise=f(e,{...h,schedule:l}).then(d=>{if(this._thread===void 0){this._thread=d,this._promise=null,h.hasInitialize&&this.broadcast({},"initialize");for(const n of this._listeners)this._connectListener(n)}else d.close()}),this._promise.catch(d=>g.getLogger("esri.core.workers.WorkerHandle").error(`Failed to initialize ${e} worker: ${d}`))}on(e,t){const r={removed:!1,eventName:e,callback:t,threadHandle:null};return this._listeners.push(r),this._connectListener(r),w(()=>{r.removed=!0,T(this._listeners,r),this._thread&&p(r.threadHandle)&&r.threadHandle.remove()})}destroy(){this._thread&&(this._thread.close(),this._thread=null),this._promise=null}invoke(e,t){return this.invokeMethod(this._mainMethod,e,t)}invokeMethod(e,t,r){if(this._thread){const l=this._transferLists[e],h=l?l(t):[];return this._thread.invoke(e,t,{transferList:h,signal:r})}return this._promise?this._promise.then(()=>(u(r),this.invokeMethod(e,t,r))):Promise.reject(null)}broadcast(e,t){return this._thread?Promise.all(this._thread.broadcast(t,e)).then(()=>{}):this._promise?this._promise.then(()=>this.broadcast(e,t)):Promise.reject()}get promise(){return this._promise}_connectListener(e){this._thread&&this._thread.on(e.eventName,e.callback).then(t=>{e.removed||(e.threadHandle=t)})}}class _ extends U{constructor(e=null){super("LercWorker","_decode",{_decode:t=>[t.buffer]},e,{strategy:"dedicated"}),this.schedule=e,this.ref=0}decode(e,t,r){return e&&e.byteLength!==0?this.invoke({buffer:e,options:t},r):Promise.resolve(null)}release(){--this.ref<=0&&(c.forEach((e,t)=>{e===this&&c.delete(t)}),this.destroy())}}const c=new Map;function C(i=null){let e=c.get(S(i));return e||(p(i)?(e=new _(t=>i.schedule(t)),c.set(i,e)):(e=new _,c.set(null,e))),++e.ref,e}let s=class extends M($(b(I(L(A))))){constructor(...i){super(...i),this.copyright=null,this.heightModelInfo=null,this.path=null,this.minScale=void 0,this.maxScale=void 0,this.opacity=1,this.operationalLayerType="ArcGISTiledElevationServiceLayer",this.sourceJSON=null,this.type="elevation",this.url=null,this.version=null,this._lercDecoder=C()}normalizeCtorArgs(i,e){return typeof i=="string"?{url:i,...e}:i}destroy(){this._lercDecoder=D(this._lercDecoder)}readVersion(i,e){let t=e.currentVersion;return t||(t=9.3),t}load(i){const e=p(i)?i.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"],supportsData:!1,validateItem:t=>{for(let r=0;rthis._fetchImageService(e))),Promise.resolve(this)}fetchTile(i,e,t,r){const l=p((r=r||{signal:null}).signal)?r.signal:r.signal=new AbortController().signal,h={responseType:"array-buffer",signal:l},d={noDataValue:r.noDataValue,returnFileInfo:!0};return this.load().then(()=>this._fetchTileAvailability(i,e,t,r)).then(()=>v(this.getTileUrl(i,e,t),h)).then(n=>this._lercDecoder.decode(n.data,d,l)).then(n=>{var y;return{values:n.pixelData,width:n.width,height:n.height,maxZError:(y=n.fileInfo)==null?void 0:y.maxZError,noDataValue:n.noDataValue,minValue:n.minValue,maxValue:n.maxValue}})}getTileUrl(i,e,t){const r=!this.tilemapCache&&this.supportsBlankTile,l=x({...this.parsedUrl.query,blankTile:!r&&null});return`${this.parsedUrl.path}/tile/${i}/${e}/${t}${l?"?"+l:""}`}async queryElevation(i,e){const{ElevationQuery:t}=await m(()=>import("./ElevationQuery.dec612cd.js"),["assets/ElevationQuery.dec612cd.js","assets/index.221827cd.js","assets/index.f5419ca5.css"]);return u(e),new t().query(this,i,e)}async createElevationSampler(i,e){const{ElevationQuery:t}=await m(()=>import("./ElevationQuery.dec612cd.js"),["assets/ElevationQuery.dec612cd.js","assets/index.221827cd.js","assets/index.f5419ca5.css"]);return u(e),new t().createSampler(this,i,e)}_fetchTileAvailability(i,e,t,r){return this.tilemapCache?this.tilemapCache.fetchAvailability(i,e,t,r):Promise.resolve("unknown")}async _fetchImageService(i){var r;if(this.sourceJSON)return this.sourceJSON;const e={query:{f:"json",...this.parsedUrl.query},responseType:"json",signal:i},t=await v(this.parsedUrl.path,e);t.ssl&&(this.url=(r=this.url)==null?void 0:r.replace(/^http:/i,"https:")),this.sourceJSON=t.data,this.read(t.data,{origin:"service",url:this.parsedUrl})}get hasOverriddenFetchTile(){return!this.fetchTile.__isDefault__}};a([o({json:{read:{source:"copyrightText"}}})],s.prototype,"copyright",void 0),a([o({readOnly:!0,type:O})],s.prototype,"heightModelInfo",void 0),a([o({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),a([o({type:["show","hide"]})],s.prototype,"listMode",void 0),a([o({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],s.prototype,"minScale",void 0),a([o({json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}},readOnly:!0})],s.prototype,"maxScale",void 0),a([o({json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],s.prototype,"opacity",void 0),a([o({type:["ArcGISTiledElevationServiceLayer"]})],s.prototype,"operationalLayerType",void 0),a([o()],s.prototype,"sourceJSON",void 0),a([o({json:{read:!1},value:"elevation",readOnly:!0})],s.prototype,"type",void 0),a([o(j)],s.prototype,"url",void 0),a([o()],s.prototype,"version",void 0),a([V("version",["currentVersion"])],s.prototype,"readVersion",null),s=a([P("esri.layers.ElevationLayer")],s),s.prototype.fetchTile.__isDefault__=!0;const J=s;export{J as default}; diff --git a/assets/ElevationQuery.5a32e4bc.js b/assets/ElevationQuery.dec612cd.js similarity index 99% rename from assets/ElevationQuery.5a32e4bc.js rename to assets/ElevationQuery.dec612cd.js index eb17596..5cbce65 100644 --- a/assets/ElevationQuery.5a32e4bc.js +++ b/assets/ElevationQuery.dec612cd.js @@ -1 +1 @@ -import{s as K,af as I,cJ as N,ay as U,cq as g,j as T,cK as H,bd as X,cL as Y,c as v,n as d,bI as D,cI as $,cM as ee,cN as k,cO as A,aU as L,cB as te,cP as Q,cQ as ie,cR as q,cS as se,cT as O}from"./index.d94abe07.js";const M=K.getLogger("esri.layers.support.ElevationSampler");class W{queryElevation(e){return oe(e.clone(),this)}on(){return ce}projectIfRequired(e,t){return B(e,t)}}class ne extends W{constructor(e,t,i){super(),this.tile=e,this.noDataValue=i;const s=e.tile.extent;this.extent=N(s,t.spatialReference),this.extent.zmin=e.zmin,this.extent.zmax=e.zmax,this._aaExtent=s;const n=g(t.spatialReference),o=t.lodAt(e.tile.level).resolution*n;this.demResolution={min:o,max:o}}get spatialReference(){return this.extent.spatialReference}contains(e){const t=this.projectIfRequired(e,this.spatialReference);return!T(t)&&this.containsAt(t.x,t.y)}containsAt(e,t){return H(this._aaExtent,e,t)}elevationAt(e,t){if(!this.containsAt(e,t)){const i=this.extent,s=`${i.xmin}, ${i.ymin}, ${i.xmax}, ${i.ymax}`;return M.warn("#elevationAt()",`Point used to sample elevation (${e}, ${t}) is outside of the sampler extent (${s})`),this.noDataValue}return X(this.tile.sample(e,t),this.noDataValue)}}class Z extends W{constructor(e,t,i){let s;super(),typeof t=="number"?(this.noDataValue=t,s=null):(s=t,this.noDataValue=i),this.samplers=s?e.map(o=>new ne(o,s,this.noDataValue)):e;const n=this.samplers[0];if(n){this.extent=n.extent.clone();const{min:o,max:l}=n.demResolution;this.demResolution={min:o,max:l};for(let a=1;at?t:r}class fe{async queryAll(e,t,i){if(!(e=i&&i.ignoreInvisibleLayers?e.filter(c=>c.visible):e.slice()).length)throw new d("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");const s=x.fromGeometry(t);let n=!1;i&&i.returnSampleInfo||(n=!0);const o={...w,...i,returnSampleInfo:!0},l=await this.query(e[e.length-1],s,o),a=await this._queryAllContinue(e,l,o);return a.geometry=a.geometry.export(),n&&delete a.sampleInfo,a}async query(e,t,i){if(!e)throw new d("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||!(t instanceof x)&&t.type!=="point"&&t.type!=="multipoint"&&t.type!=="polyline")throw new d("elevation-query:invalid-geometry","Only point, polyline and multipoint geometries can be used to query elevation");const s={...w,...i},n=new he(e,t.spatialReference,s),o=s.signal;return await e.load({signal:o}),await this._createGeometryDescriptor(n,t,o),await this._selectTiles(n,o),await this._populateElevationTiles(n,o),this._sampleGeometryWithElevation(n),this._createQueryResult(n,o)}async createSampler(e,t,i){if(!e)throw new d("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new d("elevation-query:invalid-extent","Invalid or undefined extent");const s={...w,...i};return this._createSampler(e,t,s)}async createSamplerAll(e,t,i){if(!(e=i&&i.ignoreInvisibleLayers?e.filter(o=>o.visible):e.slice()).length)throw new d("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new d("elevation-query:invalid-extent","Invalid or undefined extent");const s={...w,...i,returnSampleInfo:!0},n=await this._createSampler(e[e.length-1],t,s);return this._createSamplerAllContinue(e,t,n,s)}async _createSampler(e,t,i,s){const n=i.signal;await e.load({signal:n});const o=t.spatialReference,l=e.tileInfo.spatialReference;o.equals(l)||(await D([{source:o,dest:l}],{signal:n}),t=$(t,l));const a=new pe(e,t,i,s);return await this._selectTiles(a,n),await this._populateElevationTiles(a,n),new Z(a.elevationTiles,a.layer.tileInfo,a.options.noDataValue)}async _createSamplerAllContinue(e,t,i,s){if(e.pop(),!e.length)return i;const n=i.samplers.map(c=>ee(c.extent)),o=await this._createSampler(e[e.length-1],t,s,n);if(o.samplers.length===0)return i;const l=i.samplers.concat(o.samplers),a=new Z(l,s.noDataValue);return this._createSamplerAllContinue(e,t,a,s)}async _queryAllContinue(e,t,i){const s=e.pop(),n=t.geometry.coordinates,o=t.sampleInfo;k(o);const l=[],a=[];for(let p=0;p=0?h.source||(h.source=s):e.length&&(l.push(n[p]),a.push(p))}if(!e.length||l.length===0)return t;const c=t.geometry.clone(l),u=await this.query(e[e.length-1],c,i),m=u.sampleInfo;if(!m)throw new Error("no sampleInfo");return a.forEach((p,h)=>{n[p].z=u.geometry.coordinates[h].z,o[p].demResolution=m[h].demResolution}),this._queryAllContinue(e,t,i)}async _createQueryResult(e,t){const i=await e.geometry.project(e.outSpatialReference,t);k(i);const s={geometry:i.export(),noDataValue:e.options.noDataValue};return e.options.returnSampleInfo&&(s.sampleInfo=this._extractSampleInfo(e)),e.geometry.coordinates.forEach(n=>{n.tile=null,n.elevationTile=null}),s}async _createGeometryDescriptor(e,t,i){let s;const n=e.layer.tileInfo.spatialReference;if(t instanceof x?s=await t.project(n,i):(await D([{source:t.spatialReference,dest:n}],{signal:i}),s=$(t,n)),!s)throw new d("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${t.spatialReference.wkid}' on an elevation service in '${n.wkid}'`);e.geometry=x.fromGeometry(s)}async _selectTiles(e,t){const i=e.options.demResolution;if(e.type==="geometry"&&this._preselectOutsideLayerExtent(e),typeof i=="number")this._selectTilesClosestResolution(e);else if(i==="finest-contiguous")await this._selectTilesFinestContiguous(e,t);else{if(i!=="auto")throw new d("elevation-query:invalid-dem-resolution",`Invalid dem resolution value '${i}', expected a number, "finest-contiguous" or "auto"`);await this._selectTilesAuto(e,t)}}_preselectOutsideLayerExtent(e){if(T(e.layer.fullExtent))return;const t=new G(null);t.sample=()=>e.options.noDataValue,e.outsideExtentTile=t;const i=e.layer.fullExtent;e.geometry.coordinates.forEach(s=>{const n=s.x,o=s.y;(ni.xmax||oi.ymax)&&(s.elevationTile=t)})}_selectTilesClosestResolution(e){const t=e.layer.tileInfo,i=this._findNearestDemResolutionLODIndex(t,e.options.demResolution);e.selectTilesAtLOD(i)}_findNearestDemResolutionLODIndex(e,t){const i=t/g(e.spatialReference);let s=e.lods[0],n=0;for(let o=1;on.fetchAvailability(l.level,l.row,l.col,{signal:i}))),i);else if(await this._populateElevationTiles(e,i),!e.allElevationTilesFetched())throw e.clearElevationTiles(),new d("elevation-query:has-unavailable-tiles")}catch(l){L(l),await this._selectTilesFinestContiguousAt(e,t-1,i)}}async _populateElevationTiles(e,t){const i=e.getTilesToFetch(),s={},n=e.options.cache,o=e.options.noDataValue,l=i.map(async a=>{if(a.id==null)return;const c=`${e.layer.uid}:${a.id}:${o}`,u=v(n)?n.get(c):null,m=v(u)?u:await e.layer.fetchTile(a.level,a.row,a.col,{noDataValue:o,signal:t});v(n)&&n.put(c,m),s[a.id]=new G(a,m)});await A(te(l),t),e.populateElevationTiles(s)}async _selectTilesAuto(e,t){this._selectTilesAutoFinest(e),this._reduceTilesForMaximumRequests(e);const i=e.layer.tilemapCache;if(!i)return this._selectTilesAutoPrefetchUpsample(e,t);const s=e.getTilesToFetch(),n={},o=s.map(async l=>{const a=new Q(null,0,0,0,U()),c=await ie(i.fetchAvailabilityUpsample(l.level,l.row,l.col,a,{signal:t}));c.ok!==!1?l.id!=null&&(n[l.id]=a):L(c.error)});await A(Promise.all(o),t),e.remapTiles(n)}_reduceTilesForMaximumRequests(e){const t=e.layer.tileInfo;let i=0;const s={},n=a=>{a.id!=null&&(a.id in s?s[a.id]++:(s[a.id]=1,i++))},o=a=>{if(a.id==null)return;const c=s[a.id];c===1?(delete s[a.id],i--):s[a.id]=c-1};e.forEachTileToFetch(n,o);let l=!0;for(;l&&(l=!1,e.forEachTileToFetch(a=>{i<=e.options.maximumAutoTileRequests||(o(a),t.upsampleTile(a)&&(l=!0),n(a))},o),l););}_selectTilesAutoFinest(e){const t=j(e.layer.tileInfo,e.options.minDemResolution);e.selectTilesAtLOD(t,e.options.maximumAutoTileRequests)}async _selectTilesAutoPrefetchUpsample(e,t){const i=e.layer.tileInfo;await this._populateElevationTiles(e,t);let s=!1;e.forEachTileToFetch((n,o)=>{i.upsampleTile(n)?s=!0:o()}),s&&await this._selectTilesAutoPrefetchUpsample(e,t)}_sampleGeometryWithElevation(e){e.geometry.coordinates.forEach(t=>{const i=t.elevationTile;let s=e.options.noDataValue;if(i){const n=i.sample(t.x,t.y);v(n)?s=n:t.elevationTile=null}t.z=s})}_extractSampleInfo(e){const t=e.layer.tileInfo,i=g(t.spatialReference);return e.geometry.coordinates.map(s=>{let n=-1;return s.elevationTile&&s.elevationTile!==e.outsideExtentTile&&(n=t.lodAt(s.elevationTile.tile.level).resolution*i),{demResolution:n}})}}class x{export(){return this._exporter(this.coordinates,this.spatialReference)}clone(e){const t=new x;return t.geometry=this.geometry,t.spatialReference=this.spatialReference,t.coordinates=e||this.coordinates.map(i=>i.clone()),t._exporter=this._exporter,t}async project(e,t){if(this.spatialReference.equals(e))return this.clone();await D([{source:this.spatialReference,dest:e}],{signal:t});const i=new q({spatialReference:this.spatialReference,points:this.coordinates.map(l=>[l.x,l.y])}),s=$(i,e);if(!s)return null;const n=this.coordinates.map((l,a)=>{const c=l.clone(),u=s.points[a];return c.x=u[0],c.y=u[1],c}),o=this.clone(n);return o.spatialReference=e,o}static fromGeometry(e){const t=new x;if(t.geometry=e,t.spatialReference=e.spatialReference,e instanceof x)t.coordinates=e.coordinates.map(i=>i.clone()),t._exporter=(i,s)=>{const n=e.clone(i);return n.spatialReference=s,n};else switch(e.type){case"point":{const i=e,{hasZ:s,hasM:n}=i;t.coordinates=s&&n?[new f(i.x,i.y,i.z,i.m)]:s?[new f(i.x,i.y,i.z)]:n?[new f(i.x,i.y,null,i.m)]:[new f(i.x,i.y)],t._exporter=(o,l)=>e.hasM?new I(o[0].x,o[0].y,o[0].z,o[0].m,l):new I(o[0].x,o[0].y,o[0].z,l);break}case"multipoint":{const i=e,{hasZ:s,hasM:n}=i;t.coordinates=s&&n?i.points.map(o=>new f(o[0],o[1],o[2],o[3])):s?i.points.map(o=>new f(o[0],o[1],o[2])):n?i.points.map(o=>new f(o[0],o[1],null,o[2])):i.points.map(o=>new f(o[0],o[1])),t._exporter=(o,l)=>e.hasM?new q({points:o.map(a=>[a.x,a.y,a.z,a.m]),hasZ:!0,hasM:!0,spatiaReference:l}):new q(o.map(a=>[a.x,a.y,a.z]),l);break}case"polyline":{const i=e,s=[],n=[],{hasZ:o,hasM:l}=e;let a=0;for(const c of i.paths)if(n.push([a,a+c.length]),a+=c.length,o&&l)for(const u of c)s.push(new f(u[0],u[1],u[2],u[3]));else if(o)for(const u of c)s.push(new f(u[0],u[1],u[2]));else if(l)for(const u of c)s.push(new f(u[0],u[1],null,u[2]));else for(const u of c)s.push(new f(u[0],u[1]));t.coordinates=s,t._exporter=(c,u)=>{const m=e.hasM?c.map(h=>[h.x,h.y,h.z,h.m]):c.map(h=>[h.x,h.y,h.z]),p=n.map(h=>m.slice(h[0],h[1]));return new se({paths:p,hasM:e.hasM,hasZ:!0,spatialReference:u})};break}}return t}}class f{constructor(e,t,i=null,s=null,n=null,o=null){this.x=e,this.y=t,this.z=i,this.m=s,this.tile=n,this.elevationTile=o}clone(){return new f(this.x,this.y,this.z,this.m)}}class J{constructor(e,t){this.layer=e,this.options=t}}class he extends J{constructor(e,t,i){super(e,i),this.outSpatialReference=t,this.type="geometry"}selectTilesAtLOD(e){if(e<0)this.geometry.coordinates.forEach(t=>{t.tile=null});else{const t=this.layer.tileInfo,i=t.lods[e].level;this.geometry.coordinates.forEach(s=>{s.tile=t.tileAt(i,s.x,s.y)})}}allElevationTilesFetched(){return!this.geometry.coordinates.some(e=>!e.elevationTile)}clearElevationTiles(){for(const e of this.geometry.coordinates)e.elevationTile!==this.outsideExtentTile&&(e.elevationTile=null)}populateElevationTiles(e){var t;for(const i of this.geometry.coordinates)!i.elevationTile&&((t=i.tile)==null?void 0:t.id)&&(i.elevationTile=e[i.tile.id])}remapTiles(e){var t;for(const i of this.geometry.coordinates){const s=(t=i.tile)==null?void 0:t.id;i.tile=s?e[s]:null}}getTilesToFetch(){var i;const e={},t=[];for(const s of this.geometry.coordinates){const n=s.tile;if(!n)continue;const o=(i=s.tile)==null?void 0:i.id;s.elevationTile||!o||e[o]||(e[o]=n,t.push(n))}return t}forEachTileToFetch(e){for(const t of this.geometry.coordinates)t.tile&&!t.elevationTile&&e(t.tile,()=>{t.tile=null})}}class pe extends J{constructor(e,t,i,s){super(e,i),this.type="extent",this.elevationTiles=[],this._candidateTiles=[],this._fetchedCandidates=new Set,this.extent=t.intersection(e.fullExtent),this.maskExtents=s}selectTilesAtLOD(e,t){const i=this._maximumLodForRequests(t),s=Math.min(i,e);s<0?this._candidateTiles.length=0:this._selectCandidateTilesCoveringExtentAt(s)}_maximumLodForRequests(e){const t=this.layer.tileInfo;if(!e)return t.lods.length-1;const i=this.extent;if(T(i))return-1;for(let s=t.lods.length-1;s>=0;s--){const n=t.lods[s],o=n.resolution*t.size[0],l=n.resolution*t.size[1];if(Math.ceil(i.width/o)*Math.ceil(i.height/l)<=e)return s}return-1}allElevationTilesFetched(){return this._candidateTiles.length===this.elevationTiles.length}clearElevationTiles(){this.elevationTiles.length=0,this._fetchedCandidates.clear()}populateElevationTiles(e){for(const t of this._candidateTiles){const i=t.id&&e[t.id];i&&(this._fetchedCandidates.add(t),this.elevationTiles.push(i))}}remapTiles(e){this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles.map(t=>e[t.id]))}getTilesToFetch(){return this._candidateTiles}forEachTileToFetch(e,t){const i=this._candidateTiles;this._candidateTiles=[],i.forEach(s=>{if(this._fetchedCandidates.has(s))return void(t&&t(s));let n=!1;e(s,()=>n=!0),n?t&&t(s):this._candidateTiles.push(s)}),this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles,t)}_uniqueNonOverlappingTiles(e,t){const i={},s=[];for(const o of e){const l=o.id;l&&!i[l]?(i[l]=o,s.push(o)):t&&t(o)}const n=s.sort((o,l)=>o.level-l.level);return n.filter((o,l)=>{for(let a=0;ae.extent&&O(t,e.extent))}}function j(r,e=0){let t=r.lods.length-1;if(e>0){const i=e/g(r.spatialReference),s=r.lods.findIndex(n=>n.resolution0&&(t=s-1)}return t}const w={maximumAutoTileRequests:20,noDataValue:0,returnSampleInfo:!1,demResolution:"auto",minDemResolution:0};export{fe as ElevationQuery,x as GeometryDescriptor,j as getFinestLodIndex}; +import{s as K,af as I,cJ as N,ay as U,cq as g,j as T,cK as H,bd as X,cL as Y,c as v,n as d,bI as D,cI as $,cM as ee,cN as k,cO as A,aU as L,cB as te,cP as Q,cQ as ie,cR as q,cS as se,cT as O}from"./index.221827cd.js";const M=K.getLogger("esri.layers.support.ElevationSampler");class W{queryElevation(e){return oe(e.clone(),this)}on(){return ce}projectIfRequired(e,t){return B(e,t)}}class ne extends W{constructor(e,t,i){super(),this.tile=e,this.noDataValue=i;const s=e.tile.extent;this.extent=N(s,t.spatialReference),this.extent.zmin=e.zmin,this.extent.zmax=e.zmax,this._aaExtent=s;const n=g(t.spatialReference),o=t.lodAt(e.tile.level).resolution*n;this.demResolution={min:o,max:o}}get spatialReference(){return this.extent.spatialReference}contains(e){const t=this.projectIfRequired(e,this.spatialReference);return!T(t)&&this.containsAt(t.x,t.y)}containsAt(e,t){return H(this._aaExtent,e,t)}elevationAt(e,t){if(!this.containsAt(e,t)){const i=this.extent,s=`${i.xmin}, ${i.ymin}, ${i.xmax}, ${i.ymax}`;return M.warn("#elevationAt()",`Point used to sample elevation (${e}, ${t}) is outside of the sampler extent (${s})`),this.noDataValue}return X(this.tile.sample(e,t),this.noDataValue)}}class Z extends W{constructor(e,t,i){let s;super(),typeof t=="number"?(this.noDataValue=t,s=null):(s=t,this.noDataValue=i),this.samplers=s?e.map(o=>new ne(o,s,this.noDataValue)):e;const n=this.samplers[0];if(n){this.extent=n.extent.clone();const{min:o,max:l}=n.demResolution;this.demResolution={min:o,max:l};for(let a=1;at?t:r}class fe{async queryAll(e,t,i){if(!(e=i&&i.ignoreInvisibleLayers?e.filter(c=>c.visible):e.slice()).length)throw new d("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");const s=x.fromGeometry(t);let n=!1;i&&i.returnSampleInfo||(n=!0);const o={...w,...i,returnSampleInfo:!0},l=await this.query(e[e.length-1],s,o),a=await this._queryAllContinue(e,l,o);return a.geometry=a.geometry.export(),n&&delete a.sampleInfo,a}async query(e,t,i){if(!e)throw new d("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||!(t instanceof x)&&t.type!=="point"&&t.type!=="multipoint"&&t.type!=="polyline")throw new d("elevation-query:invalid-geometry","Only point, polyline and multipoint geometries can be used to query elevation");const s={...w,...i},n=new he(e,t.spatialReference,s),o=s.signal;return await e.load({signal:o}),await this._createGeometryDescriptor(n,t,o),await this._selectTiles(n,o),await this._populateElevationTiles(n,o),this._sampleGeometryWithElevation(n),this._createQueryResult(n,o)}async createSampler(e,t,i){if(!e)throw new d("elevation-query:invalid-layer","Elevation queries require an elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new d("elevation-query:invalid-extent","Invalid or undefined extent");const s={...w,...i};return this._createSampler(e,t,s)}async createSamplerAll(e,t,i){if(!(e=i&&i.ignoreInvisibleLayers?e.filter(o=>o.visible):e.slice()).length)throw new d("elevation-query:invalid-layer","Elevation queries require at least one elevation layer to fetch tiles from");if(!t||t.type!=="extent")throw new d("elevation-query:invalid-extent","Invalid or undefined extent");const s={...w,...i,returnSampleInfo:!0},n=await this._createSampler(e[e.length-1],t,s);return this._createSamplerAllContinue(e,t,n,s)}async _createSampler(e,t,i,s){const n=i.signal;await e.load({signal:n});const o=t.spatialReference,l=e.tileInfo.spatialReference;o.equals(l)||(await D([{source:o,dest:l}],{signal:n}),t=$(t,l));const a=new pe(e,t,i,s);return await this._selectTiles(a,n),await this._populateElevationTiles(a,n),new Z(a.elevationTiles,a.layer.tileInfo,a.options.noDataValue)}async _createSamplerAllContinue(e,t,i,s){if(e.pop(),!e.length)return i;const n=i.samplers.map(c=>ee(c.extent)),o=await this._createSampler(e[e.length-1],t,s,n);if(o.samplers.length===0)return i;const l=i.samplers.concat(o.samplers),a=new Z(l,s.noDataValue);return this._createSamplerAllContinue(e,t,a,s)}async _queryAllContinue(e,t,i){const s=e.pop(),n=t.geometry.coordinates,o=t.sampleInfo;k(o);const l=[],a=[];for(let p=0;p=0?h.source||(h.source=s):e.length&&(l.push(n[p]),a.push(p))}if(!e.length||l.length===0)return t;const c=t.geometry.clone(l),u=await this.query(e[e.length-1],c,i),m=u.sampleInfo;if(!m)throw new Error("no sampleInfo");return a.forEach((p,h)=>{n[p].z=u.geometry.coordinates[h].z,o[p].demResolution=m[h].demResolution}),this._queryAllContinue(e,t,i)}async _createQueryResult(e,t){const i=await e.geometry.project(e.outSpatialReference,t);k(i);const s={geometry:i.export(),noDataValue:e.options.noDataValue};return e.options.returnSampleInfo&&(s.sampleInfo=this._extractSampleInfo(e)),e.geometry.coordinates.forEach(n=>{n.tile=null,n.elevationTile=null}),s}async _createGeometryDescriptor(e,t,i){let s;const n=e.layer.tileInfo.spatialReference;if(t instanceof x?s=await t.project(n,i):(await D([{source:t.spatialReference,dest:n}],{signal:i}),s=$(t,n)),!s)throw new d("elevation-query:spatial-reference-mismatch",`Cannot query elevation in '${t.spatialReference.wkid}' on an elevation service in '${n.wkid}'`);e.geometry=x.fromGeometry(s)}async _selectTiles(e,t){const i=e.options.demResolution;if(e.type==="geometry"&&this._preselectOutsideLayerExtent(e),typeof i=="number")this._selectTilesClosestResolution(e);else if(i==="finest-contiguous")await this._selectTilesFinestContiguous(e,t);else{if(i!=="auto")throw new d("elevation-query:invalid-dem-resolution",`Invalid dem resolution value '${i}', expected a number, "finest-contiguous" or "auto"`);await this._selectTilesAuto(e,t)}}_preselectOutsideLayerExtent(e){if(T(e.layer.fullExtent))return;const t=new G(null);t.sample=()=>e.options.noDataValue,e.outsideExtentTile=t;const i=e.layer.fullExtent;e.geometry.coordinates.forEach(s=>{const n=s.x,o=s.y;(ni.xmax||oi.ymax)&&(s.elevationTile=t)})}_selectTilesClosestResolution(e){const t=e.layer.tileInfo,i=this._findNearestDemResolutionLODIndex(t,e.options.demResolution);e.selectTilesAtLOD(i)}_findNearestDemResolutionLODIndex(e,t){const i=t/g(e.spatialReference);let s=e.lods[0],n=0;for(let o=1;on.fetchAvailability(l.level,l.row,l.col,{signal:i}))),i);else if(await this._populateElevationTiles(e,i),!e.allElevationTilesFetched())throw e.clearElevationTiles(),new d("elevation-query:has-unavailable-tiles")}catch(l){L(l),await this._selectTilesFinestContiguousAt(e,t-1,i)}}async _populateElevationTiles(e,t){const i=e.getTilesToFetch(),s={},n=e.options.cache,o=e.options.noDataValue,l=i.map(async a=>{if(a.id==null)return;const c=`${e.layer.uid}:${a.id}:${o}`,u=v(n)?n.get(c):null,m=v(u)?u:await e.layer.fetchTile(a.level,a.row,a.col,{noDataValue:o,signal:t});v(n)&&n.put(c,m),s[a.id]=new G(a,m)});await A(te(l),t),e.populateElevationTiles(s)}async _selectTilesAuto(e,t){this._selectTilesAutoFinest(e),this._reduceTilesForMaximumRequests(e);const i=e.layer.tilemapCache;if(!i)return this._selectTilesAutoPrefetchUpsample(e,t);const s=e.getTilesToFetch(),n={},o=s.map(async l=>{const a=new Q(null,0,0,0,U()),c=await ie(i.fetchAvailabilityUpsample(l.level,l.row,l.col,a,{signal:t}));c.ok!==!1?l.id!=null&&(n[l.id]=a):L(c.error)});await A(Promise.all(o),t),e.remapTiles(n)}_reduceTilesForMaximumRequests(e){const t=e.layer.tileInfo;let i=0;const s={},n=a=>{a.id!=null&&(a.id in s?s[a.id]++:(s[a.id]=1,i++))},o=a=>{if(a.id==null)return;const c=s[a.id];c===1?(delete s[a.id],i--):s[a.id]=c-1};e.forEachTileToFetch(n,o);let l=!0;for(;l&&(l=!1,e.forEachTileToFetch(a=>{i<=e.options.maximumAutoTileRequests||(o(a),t.upsampleTile(a)&&(l=!0),n(a))},o),l););}_selectTilesAutoFinest(e){const t=j(e.layer.tileInfo,e.options.minDemResolution);e.selectTilesAtLOD(t,e.options.maximumAutoTileRequests)}async _selectTilesAutoPrefetchUpsample(e,t){const i=e.layer.tileInfo;await this._populateElevationTiles(e,t);let s=!1;e.forEachTileToFetch((n,o)=>{i.upsampleTile(n)?s=!0:o()}),s&&await this._selectTilesAutoPrefetchUpsample(e,t)}_sampleGeometryWithElevation(e){e.geometry.coordinates.forEach(t=>{const i=t.elevationTile;let s=e.options.noDataValue;if(i){const n=i.sample(t.x,t.y);v(n)?s=n:t.elevationTile=null}t.z=s})}_extractSampleInfo(e){const t=e.layer.tileInfo,i=g(t.spatialReference);return e.geometry.coordinates.map(s=>{let n=-1;return s.elevationTile&&s.elevationTile!==e.outsideExtentTile&&(n=t.lodAt(s.elevationTile.tile.level).resolution*i),{demResolution:n}})}}class x{export(){return this._exporter(this.coordinates,this.spatialReference)}clone(e){const t=new x;return t.geometry=this.geometry,t.spatialReference=this.spatialReference,t.coordinates=e||this.coordinates.map(i=>i.clone()),t._exporter=this._exporter,t}async project(e,t){if(this.spatialReference.equals(e))return this.clone();await D([{source:this.spatialReference,dest:e}],{signal:t});const i=new q({spatialReference:this.spatialReference,points:this.coordinates.map(l=>[l.x,l.y])}),s=$(i,e);if(!s)return null;const n=this.coordinates.map((l,a)=>{const c=l.clone(),u=s.points[a];return c.x=u[0],c.y=u[1],c}),o=this.clone(n);return o.spatialReference=e,o}static fromGeometry(e){const t=new x;if(t.geometry=e,t.spatialReference=e.spatialReference,e instanceof x)t.coordinates=e.coordinates.map(i=>i.clone()),t._exporter=(i,s)=>{const n=e.clone(i);return n.spatialReference=s,n};else switch(e.type){case"point":{const i=e,{hasZ:s,hasM:n}=i;t.coordinates=s&&n?[new f(i.x,i.y,i.z,i.m)]:s?[new f(i.x,i.y,i.z)]:n?[new f(i.x,i.y,null,i.m)]:[new f(i.x,i.y)],t._exporter=(o,l)=>e.hasM?new I(o[0].x,o[0].y,o[0].z,o[0].m,l):new I(o[0].x,o[0].y,o[0].z,l);break}case"multipoint":{const i=e,{hasZ:s,hasM:n}=i;t.coordinates=s&&n?i.points.map(o=>new f(o[0],o[1],o[2],o[3])):s?i.points.map(o=>new f(o[0],o[1],o[2])):n?i.points.map(o=>new f(o[0],o[1],null,o[2])):i.points.map(o=>new f(o[0],o[1])),t._exporter=(o,l)=>e.hasM?new q({points:o.map(a=>[a.x,a.y,a.z,a.m]),hasZ:!0,hasM:!0,spatiaReference:l}):new q(o.map(a=>[a.x,a.y,a.z]),l);break}case"polyline":{const i=e,s=[],n=[],{hasZ:o,hasM:l}=e;let a=0;for(const c of i.paths)if(n.push([a,a+c.length]),a+=c.length,o&&l)for(const u of c)s.push(new f(u[0],u[1],u[2],u[3]));else if(o)for(const u of c)s.push(new f(u[0],u[1],u[2]));else if(l)for(const u of c)s.push(new f(u[0],u[1],null,u[2]));else for(const u of c)s.push(new f(u[0],u[1]));t.coordinates=s,t._exporter=(c,u)=>{const m=e.hasM?c.map(h=>[h.x,h.y,h.z,h.m]):c.map(h=>[h.x,h.y,h.z]),p=n.map(h=>m.slice(h[0],h[1]));return new se({paths:p,hasM:e.hasM,hasZ:!0,spatialReference:u})};break}}return t}}class f{constructor(e,t,i=null,s=null,n=null,o=null){this.x=e,this.y=t,this.z=i,this.m=s,this.tile=n,this.elevationTile=o}clone(){return new f(this.x,this.y,this.z,this.m)}}class J{constructor(e,t){this.layer=e,this.options=t}}class he extends J{constructor(e,t,i){super(e,i),this.outSpatialReference=t,this.type="geometry"}selectTilesAtLOD(e){if(e<0)this.geometry.coordinates.forEach(t=>{t.tile=null});else{const t=this.layer.tileInfo,i=t.lods[e].level;this.geometry.coordinates.forEach(s=>{s.tile=t.tileAt(i,s.x,s.y)})}}allElevationTilesFetched(){return!this.geometry.coordinates.some(e=>!e.elevationTile)}clearElevationTiles(){for(const e of this.geometry.coordinates)e.elevationTile!==this.outsideExtentTile&&(e.elevationTile=null)}populateElevationTiles(e){var t;for(const i of this.geometry.coordinates)!i.elevationTile&&((t=i.tile)==null?void 0:t.id)&&(i.elevationTile=e[i.tile.id])}remapTiles(e){var t;for(const i of this.geometry.coordinates){const s=(t=i.tile)==null?void 0:t.id;i.tile=s?e[s]:null}}getTilesToFetch(){var i;const e={},t=[];for(const s of this.geometry.coordinates){const n=s.tile;if(!n)continue;const o=(i=s.tile)==null?void 0:i.id;s.elevationTile||!o||e[o]||(e[o]=n,t.push(n))}return t}forEachTileToFetch(e){for(const t of this.geometry.coordinates)t.tile&&!t.elevationTile&&e(t.tile,()=>{t.tile=null})}}class pe extends J{constructor(e,t,i,s){super(e,i),this.type="extent",this.elevationTiles=[],this._candidateTiles=[],this._fetchedCandidates=new Set,this.extent=t.intersection(e.fullExtent),this.maskExtents=s}selectTilesAtLOD(e,t){const i=this._maximumLodForRequests(t),s=Math.min(i,e);s<0?this._candidateTiles.length=0:this._selectCandidateTilesCoveringExtentAt(s)}_maximumLodForRequests(e){const t=this.layer.tileInfo;if(!e)return t.lods.length-1;const i=this.extent;if(T(i))return-1;for(let s=t.lods.length-1;s>=0;s--){const n=t.lods[s],o=n.resolution*t.size[0],l=n.resolution*t.size[1];if(Math.ceil(i.width/o)*Math.ceil(i.height/l)<=e)return s}return-1}allElevationTilesFetched(){return this._candidateTiles.length===this.elevationTiles.length}clearElevationTiles(){this.elevationTiles.length=0,this._fetchedCandidates.clear()}populateElevationTiles(e){for(const t of this._candidateTiles){const i=t.id&&e[t.id];i&&(this._fetchedCandidates.add(t),this.elevationTiles.push(i))}}remapTiles(e){this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles.map(t=>e[t.id]))}getTilesToFetch(){return this._candidateTiles}forEachTileToFetch(e,t){const i=this._candidateTiles;this._candidateTiles=[],i.forEach(s=>{if(this._fetchedCandidates.has(s))return void(t&&t(s));let n=!1;e(s,()=>n=!0),n?t&&t(s):this._candidateTiles.push(s)}),this._candidateTiles=this._uniqueNonOverlappingTiles(this._candidateTiles,t)}_uniqueNonOverlappingTiles(e,t){const i={},s=[];for(const o of e){const l=o.id;l&&!i[l]?(i[l]=o,s.push(o)):t&&t(o)}const n=s.sort((o,l)=>o.level-l.level);return n.filter((o,l)=>{for(let a=0;ae.extent&&O(t,e.extent))}}function j(r,e=0){let t=r.lods.length-1;if(e>0){const i=e/g(r.spatialReference),s=r.lods.findIndex(n=>n.resolution0&&(t=s-1)}return t}const w={maximumAutoTileRequests:20,noDataValue:0,returnSampleInfo:!1,demResolution:"auto",minDemResolution:0};export{fe as ElevationQuery,x as GeometryDescriptor,j as getFinestLodIndex}; diff --git a/assets/ElevationSamplerWorker.4ebae562.js b/assets/ElevationSamplerWorker.28a172f3.js similarity index 82% rename from assets/ElevationSamplerWorker.4ebae562.js rename to assets/ElevationSamplerWorker.28a172f3.js index e47589a..e676a51 100644 --- a/assets/ElevationSamplerWorker.4ebae562.js +++ b/assets/ElevationSamplerWorker.28a172f3.js @@ -1 +1 @@ -import{c as l,m as h}from"./index.d94abe07.js";import{h as m}from"./PooledRBush.04520070.js";import{k as u}from"./georeference.c844666d.js";import"./mat3f64.6d32a1d7.js";import"./mat4f64.ff2a477c.js";import"./quat.b3994f2f.js";import"./quatf64.4ae3e6f1.js";import"./BufferView.89055914.js";import"./vec33.4564cd5b.js";class M{async createIndex(t,r){const e=new Array;if(!t.vertexAttributes||!t.vertexAttributes.position)return new m;const a=this._createMeshData(t),n=l(r)?await r.invoke("createIndexThread",a,{transferList:e}):this.createIndexThread(a).result;return this._createPooledRBush().fromJSON(n)}createIndexThread(t){const r=new Float64Array(t.position),e=this._createPooledRBush();return t.components?this._createIndexComponentsThread(e,r,t.components.map(a=>new Uint32Array(a))):this._createIndexAllThread(e,r)}_createIndexAllThread(t,r){const e=new Array(r.length/9);let a=0;for(let n=0;n!e.faces)?{position:r}:{position:r,components:t.components.map(e=>e.faces)}}_createPooledRBush(){return new m(9,h("esri-csp-restrictions")?t=>t:[".minX",".minY",".maxX",".maxY"])}}function c(o,t,r,e){return{minX:Math.min(o[t+0],o[r+0],o[e+0]),maxX:Math.max(o[t+0],o[r+0],o[e+0]),minY:Math.min(o[t+1],o[r+1],o[e+1]),maxY:Math.max(o[t+1],o[r+1],o[e+1]),p0:[o[t+0],o[t+1],o[t+2]],p1:[o[r+0],o[r+1],o[r+2]],p2:[o[e+0],o[e+1],o[e+2]]}}export{M as default}; +import{c as l,m as h}from"./index.221827cd.js";import{h as m}from"./PooledRBush.e6a31ee9.js";import{k as u}from"./georeference.1d7480c1.js";import"./mat3f64.6d32a1d7.js";import"./mat4f64.ff2a477c.js";import"./quat.d9562009.js";import"./quatf64.4ae3e6f1.js";import"./BufferView.6eee27cd.js";import"./vec33.46fc6802.js";class M{async createIndex(t,r){const e=new Array;if(!t.vertexAttributes||!t.vertexAttributes.position)return new m;const a=this._createMeshData(t),n=l(r)?await r.invoke("createIndexThread",a,{transferList:e}):this.createIndexThread(a).result;return this._createPooledRBush().fromJSON(n)}createIndexThread(t){const r=new Float64Array(t.position),e=this._createPooledRBush();return t.components?this._createIndexComponentsThread(e,r,t.components.map(a=>new Uint32Array(a))):this._createIndexAllThread(e,r)}_createIndexAllThread(t,r){const e=new Array(r.length/9);let a=0;for(let n=0;n!e.faces)?{position:r}:{position:r,components:t.components.map(e=>e.faces)}}_createPooledRBush(){return new m(9,h("esri-csp-restrictions")?t=>t:[".minX",".minY",".maxX",".maxY"])}}function c(o,t,r,e){return{minX:Math.min(o[t+0],o[r+0],o[e+0]),maxX:Math.max(o[t+0],o[r+0],o[e+0]),minY:Math.min(o[t+1],o[r+1],o[e+1]),maxY:Math.max(o[t+1],o[r+1],o[e+1]),p0:[o[t+0],o[t+1],o[t+2]],p1:[o[r+0],o[r+1],o[r+2]],p2:[o[e+0],o[e+1],o[e+2]]}}export{M as default}; diff --git a/assets/ExpandedCIM.f0b7f36d.js b/assets/ExpandedCIM.a372ce74.js similarity index 99% rename from assets/ExpandedCIM.f0b7f36d.js rename to assets/ExpandedCIM.a372ce74.js index 66cab0e..6b3e939 100644 --- a/assets/ExpandedCIM.f0b7f36d.js +++ b/assets/ExpandedCIM.a372ce74.js @@ -1,2 +1,2 @@ -import{at as gi,b9 as ss,b4 as R,aC as z,aV as O,aZ as Z,aY as ut,aW as $,ay as V,aO as Qt,bf as Rs,bg as yi,bh as We,bi as Pi,bj as xi,bk as bi,bl as Mi,u as Si,bm as Ci,m as wi,bn as ki,I as Kt,b3 as vi,J as Ue,bo as oe,bp as Es,bq as qe,br as fs,G as _e,bs as Ii,bt as ze,bu as ms,s as ce,bv as Li,c as q,j as at,bw as qt,bb as Ti,aD as Ni,n as Ai,bx as de,by as $s,bz as E,bA as ue}from"./index.d94abe07.js";import{C as zi}from"./BidiEngine.d8bba3fc.js";import{c as X,P as ve,R as I,k as B,f as ie,A as ge,X as st,o as ct,g as Oe,Z as Bt,K as ye,j as Fs,h as Gs,i as rt,l as nt,m as Oi,p as Ri,q as Ei,u as $i,t as Fi,v as ps,D as Gi,E as Hi,F as _s,G as Hs,H as Je,a as Re,n as Ee}from"./enums.0295eb81.js";import{t as ae,e as Pe,f as Di}from"./MaterialKey.229b1dd6.js";import{e as ot,b as xe,S as Xi}from"./Utils.7f6f3a6b.js";import{t as Yi}from"./Rect.95b0fd2e.js";import{q as Vi,C as Bi,B as Wi,v as Ui}from"./quantizationUtils.0d428d19.js";import{n as be}from"./GeometryUtils.4f19e772.js";import{o as qi}from"./floatRGBA.df11258c.js";function Ji(r){return typeof r=="function"}function Ds(r,t,e,s){return Ji(r)?r(t,e,s):r}const ji=` /-, +import{at as gi,b9 as ss,b4 as R,aC as z,aV as O,aZ as Z,aY as ut,aW as $,ay as V,aO as Qt,bf as Rs,bg as yi,bh as We,bi as Pi,bj as xi,bk as bi,bl as Mi,u as Si,bm as Ci,m as wi,bn as ki,I as Kt,b3 as vi,J as Ue,bo as oe,bp as Es,bq as qe,br as fs,G as _e,bs as Ii,bt as ze,bu as ms,s as ce,bv as Li,c as q,j as at,bw as qt,bb as Ti,aD as Ni,n as Ai,bx as de,by as $s,bz as E,bA as ue}from"./index.221827cd.js";import{C as zi}from"./BidiEngine.d8bba3fc.js";import{c as X,P as ve,R as I,k as B,f as ie,A as ge,X as st,o as ct,g as Oe,Z as Bt,K as ye,j as Fs,h as Gs,i as rt,l as nt,m as Oi,p as Ri,q as Ei,u as $i,t as Fi,v as ps,D as Gi,E as Hi,F as _s,G as Hs,H as Je,a as Re,n as Ee}from"./enums.0295eb81.js";import{t as ae,e as Pe,f as Di}from"./MaterialKey.0cadabc1.js";import{e as ot,b as xe,S as Xi}from"./Utils.2136650a.js";import{t as Yi}from"./Rect.95b0fd2e.js";import{q as Vi,C as Bi,B as Wi,v as Ui}from"./quantizationUtils.7ff797cc.js";import{n as be}from"./GeometryUtils.4f19e772.js";import{o as qi}from"./floatRGBA.3f71f8e9.js";function Ji(r){return typeof r=="function"}function Ds(r,t,e,s){return Ji(r)?r(t,e,s):r}const ji=` /-, `;function ds(r){let t=r.length;for(;t--;)if(!ji.includes(r.charAt(t)))return!1;return!0}function Xs(r,t){const e=[];let s=0,i=-1;do if(i=r.indexOf("[",s),i>=s){if(i>s){const n=r.substr(s,i-s);e.push([n,null,ds(n)])}if(s=i+1,i=r.indexOf("]",s),i>=s){if(i>s){const n=t[r.substr(s,i-s)];n&&e.push([null,n,!1])}s=i+1}}while(i!==-1);if(sYs(i,s,e)}function Vs(r,t){switch(typeof r!="string"&&(r=String(r)),t){case"LowerCase":return r.toLowerCase();case"Allcaps":return r.toUpperCase();default:return r}}function ga(r,t,e,s,i,n,a=!0){const o=t/i,h=e/n,l=Math.ceil(o/2),c=Math.ceil(h/2);for(let u=0;u=-1&&N<=1&&(_=2*N*N*N-3*N*N+1,_>0&&(w=4*(b+k*t),x+=_*r[w+3],d+=_,r[w+3]<255&&(_=_*r[w+3]/250),g+=_*r[w],y+=_*r[w+1],P+=_*r[w+2],p+=_))}}s[m]=g/p,s[m+1]=y/p,s[m+2]=P/p,s[m+3]=x/d}}function Y(r){return r?{r:r[0],g:r[1],b:r[2],a:r[3]/255}:{r:0,g:0,b:0,a:0}}function Zi(r){return r.type==="CIMMarkerPlacementAlongLineRandomSize"||r.type==="CIMMarkerPlacementAlongLineSameSize"||r.type==="CIMMarkerPlacementAlongLineVariableSize"||r.type==="CIMMarkerPlacementAtExtremities"||r.type==="CIMMarkerPlacementAtMeasuredUnits"||r.type==="CIMMarkerPlacementAtRatioPositions"||r.type==="CIMMarkerPlacementOnLine"||r.type==="CIMMarkerPlacementOnVertices"}const C=(r,t=0)=>isNaN(r)||r==null?t:r,Qi=r=>{if(!r)return!1;for(const t of r)switch(t.type){case"CIMGeometricEffectBuffer":case"CIMGeometricEffectOffset":return!0}return!1};function tr(){return gi(()=>import("./geometryEngineJSON.3d6e7890.js"),["assets/geometryEngineJSON.3d6e7890.js","assets/geometryEngineBase.82b25ca5.js","assets/geometryEngineJSON.f9e9a36f.js","assets/json.879c9adc.js"])}function er(r){if(!r)return"normal";switch(r.toLowerCase()){case"italic":return"italic";case"oblique":return"oblique";default:return"normal"}}function sr(r){if(!r)return"normal";switch(r.toLowerCase()){case"bold":return"bold";case"bolder":return"bolder";case"lighter":return"lighter";default:return"normal"}}function Bs(r){let t="",e="";if(r){const s=r.toLowerCase();s.includes("italic")?t="italic":s.includes("oblique")&&(t="oblique"),s.includes("bold")?e="bold":s.includes("light")&&(e="lighter")}return{style:t,weight:e}}function Ws(r){return r.underline?"underline":r.strikethrough?"line-through":"none"}function Dt(r){if(!r)return null;switch(r.type){case"CIMPolygonSymbol":if(r.symbolLayers)for(const t of r.symbolLayers){const e=Dt(t);if(e!=null)return e}break;case"CIMTextSymbol":return Dt(r.symbol);case"CIMSolidFill":return r.color}}function Xt(r){if(r)switch(r.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(r.symbolLayers)for(const t of r.symbolLayers){const e=Xt(t);if(e!==void 0)return e}break;case"CIMTextSymbol":return Xt(r.symbol);case"CIMSolidStroke":case"CIMSolidFill":return r.color}}function le(r){if(r)switch(r.type){case"CIMPolygonSymbol":case"CIMLineSymbol":if(r.symbolLayers)for(const t of r.symbolLayers){const e=le(t);if(e!==void 0)return e}break;case"CIMTextSymbol":return le(r.symbol);case"CIMSolidStroke":case"CIMGradientStroke":case"CIMPictureStroke":return r.width}}function Us(r){switch(r){case"Left":default:return"left";case"Right":return"right";case"Center":case"Justify":return"center"}}function qs(r){switch(r){case"Top":default:return"top";case"Center":return"middle";case"Baseline":return"baseline";case"Bottom":return"bottom"}}function ir(r){return(r?Object.keys(r):[]).map(t=>({name:t,alias:t,type:typeof r[t]=="string"?"esriFieldTypeString":"esriFieldTypeDouble"}))}const Wt=r=>r.includes("data:image/svg+xml");function is(r){if(!r)return"arial-unicode-ms";const t=r.toLowerCase().split(" ").join("-");switch(t){case"serif":return"noto-serif";case"sans-serif":return"arial-unicode-ms";case"monospace":return"ubuntu-mono";case"fantasy":return"cabin-sketch";case"cursive":return"redressed";default:return t}}function ya(r){const t=rr(r)+nr(r);return is(r.family)+(t.length>0?t:"-regular")}function rr(r){if(!r.weight)return"";switch(r.weight.toLowerCase()){case"bold":case"bolder":return"-bold"}return""}function nr(r){if(!r.style)return"";switch(r.style.toLowerCase()){case"italic":case"oblique":return"-italic"}return""}const $e=new zi;function rs(r){if(!$e.hasBidiChar(r))return[r,!1];let t;return t=$e.checkContextual(r)==="rtl"?"IDNNN":"ICNNN",[$e.bidiTransform(r,t,"VLYSN"),!0]}class te{constructor(){this.setIdentity()}getAngle(){return(this.rz==null||this.rz===0&&this.rzCos!==1&&this.rzSin!==0)&&(this.rz=Math.atan2(this.rzSin,this.rzCos)),this.rz}setIdentity(){this.tx=0,this.ty=0,this.tz=0,this.s=1,this.rx=0,this.ry=0,this.rz=0,this.rzCos=1,this.rzSin=0}setTranslate(t,e){this.tx=t,this.ty=e}setTranslateZ(t){this.tz=t}setRotateCS(t,e){this.rz=void 0,this.rzCos=t,this.rzSin=e}setRotate(t){this.rz=t,this.rzCos=void 0,this.rzSin=void 0}setRotateY(t){this.ry=t}setScale(t){this.s=t}setMeasure(t){this.m=t}}class je{constructor(t){this._geometry=t}next(){const t=this._geometry;return this._geometry=null,t}}class ar{applyColorSubstituition(t,e){if(!e)return t;this._rasterizationCanvas||(this._rasterizationCanvas=document.createElement("canvas"));const{width:s,height:i}=t,n=this._rasterizationCanvas,a=n.getContext("2d");t!==n&&(n.width=s,n.height=i,a.drawImage(t,0,0,s,i));const o=a.getImageData(0,0,s,i).data;if(e){for(const l of e)if(l&&l.oldColor&&l.oldColor.length===4&&l.newColor&&l.newColor.length===4){const[c,u,f,m]=l.oldColor,[_,p,d,g]=l.newColor;if(c===_&&u===p&&f===d&&m===g)continue;for(let y=0;y0;--t)r[t][0]-=r[t-1][0],r[t][1]-=r[t-1][1]}function ys(r){if(r)for(const t of r)Ks(t)}function Zs(r){if(r){const t=r.length;for(let e=1;e1&&_>0&&i>0&&(e*f+s*m)/_/i<=this._maxCosAngle&&Jt(l,1),c===1&&(n=f,a=m,o=_),_>0&&(l=u,e=f,s=m,i=_)}this._isClosed&&i>0&&o>0&&(e*n+s*a)/o/i<=this._maxCosAngle&&Jt(t[0],1)}}}const Zt=.03;class jt{constructor(){this._path=[]}path(){return this._path}addPath(t,e){e||t.reverse(),Array.prototype.push.apply(this._path,t),e||t.reverse()}static mergePath(t,e){e&&Array.prototype.push.apply(t,e)}startPath(t){this._path.push(t)}lineTo(t){this._path.push(t)}close(){const t=this._path;t.length>1&&(t[0][0]===t[t.length-1][0]&&t[0][1]===t[t.length-1][1]||t.push([t[0][0],t[0][1]]))}}class tt{constructor(t=0,e=!1){}normalize(t){const e=Math.sqrt(t[0]*t[0]+t[1]*t[1]);e!==0&&(t[0]/=e,t[1]/=e)}calculateLength(t,e){const s=e[0]-t[0],i=e[1]-t[1];return Math.sqrt(s*s+i*i)}calculateSegLength(t,e){return this.calculateLength(t[e],t[e+1])}calculatePathLength(t){let e=0;const s=t?t.length:0;for(let i=0;i0?[i/a,n/a]:[1,0]}getSegAngleCS(t,e,s){return this.getAngleCS(t[e],t[e+1],s)}cut(t,e,s,i){return[s<=0?t[e]:this.getSegCoord2D(t,e,s),i>=1?t[e+1]:this.getSegCoord2D(t,e,i)]}addSegment(t,e,s){s&&t.push(e[0]),t.push(e[1])}getSubCurve(t,e,s){const i=[];return this.appendSubCurve(i,t,e,s)?i:null}appendSubCurve(t,e,s,i){const n=e?e.length-1:0;let a=0,o=!0,h=0;for(;hs){const c=(s-a)/l;let u=1,f=!1;a+l>=i&&(u=(i-a)/l,f=!0);const m=this.cut(e,h,c,u);if(m&&this.addSegment(t,m,o),f)break;o=!1}}else{if(a+l>i){const c=this.cut(e,h,0,(i-a)/l);c&&this.addSegment(t,c,o);break}this.addSegment(t,[e[h],e[h+1]],o)}a+=l,++h}else++h}return!0}getCIMPointAlong(t,e){const s=t?t.length-1:0;let i=0,n=-1;for(;ne){const o=(e-i)/a;return this.getCoord2D(t[n],t[n+1],o)}i+=a}}return null}isEmpty(t,e){if(!t||t.length<=1)return!0;const s=t?t.length-1:0;let i=-1;for(;i=0==e<=0){if(g<1){const y=[_[0]-p[0],_[1]-p[1]];this.normalize(y);const P=Math.sqrt((1+g)/2);if(P>1/i){const x=-Math.abs(e)/P;c.push([u[0]-y[0]*x,u[1]-y[1]*x])}}}else switch(s){case X.Mitered:{const y=Math.sqrt((1+g)/2);if(y>0&&1/y0){const P=1/y;let x=P;for(let M=1;M0){const e=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]],s=this._curveHelper.offset(e,this._size,X.Rounded,4,this._offsetFlattenError);if(s)return{rings:[s]}}else{if(!(this._size<0))return t;if(Math.min(t.xmax-t.xmin,t.ymax-t.ymin)+2*this._size>0)return{xmin:t.xmin-this._size,xmax:t.xmax+this._size,ymin:t.ymin-this._size,ymax:t.ymax+this._size}}if(z(t)){if(this._size===0)return t;const e=[];for(const s of t.rings){const i=this._curveHelper.offset(s,this._size,X.Rounded,4,this._offsetFlattenError);i&&e.push(i)}if(e.length)return{rings:e}}if(O(t)&&this._size>0){const e=[];for(const s of t.paths)if(s&&s.length>1){const i=this._curveHelper.offset(s,this._size,X.Rounded,4,this._offsetFlattenError),n=this._curveHelper.offset(s,-this._size,X.Rounded,4,this._offsetFlattenError);if(i&&n){for(let a=n.length-1;a>=0;a--)i.push(n[a]);i.push([i[0][0],i[0][1]]),e.push(i)}}if(e.length)return{rings:e}}ut(t)&&this._size,t=this._inputGeometries.next()}return null}}class Mt{static local(){return Mt.instance===null&&(Mt.instance=new Mt),Mt.instance}execute(t,e,s,i){return new gr(t,e,s)}}Mt.instance=null;class gr{constructor(t,e,s){var i;this._defaultPointSize=20,this._inputGeometries=t,this._geomUnitsPerPoint=s,this._rule=(i=e.rule)!=null?i:I.FullGeometry,this._defaultSize=this._defaultPointSize*s}next(){let t;for(;t=this._inputGeometries.next();){let e;if(ut(t)?e=this._processGeom([[[t.x,t.y]]]):Z(t)?e=this._processGeom([t.points]):O(t)?e=this._processGeom(t.paths):z(t)&&(e=this._processGeom(t.rings)),e&&e.length)return{paths:e}}return null}_clone(t){return[t[0],t[1]]}_mid(t,e){return[(t[0]+e[0])/2,(t[1]+e[1])/2]}_mix(t,e,s,i){return[t[0]*e+s[0]*i,t[1]*e+s[1]*i]}_add(t,e){return[t[0]+e[0],t[1]+e[1]]}_add2(t,e,s){return[t[0]+e,t[1]+s]}_sub(t,e){return[t[0]-e[0],t[1]-e[1]]}_dist(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}_norm(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}_normalize(t,e=1){const s=e/this._norm(t);t[0]*=s,t[1]*=s}_leftPerpendicular(t){const e=-t[1],s=t[0];t[0]=e,t[1]=s}_leftPerp(t){return[-t[1],t[0]]}_rightPerpendicular(t){const e=t[1],s=-t[0];t[0]=e,t[1]=s}_rightPerp(t){return[t[1],-t[0]]}_dotProduct(t,e){return t[0]*e[0]+t[1]*e[1]}_crossProduct(t,e){return t[0]*e[1]-t[1]*e[0]}_rotateDirect(t,e,s){const i=t[0]*e-t[1]*s,n=t[0]*s+t[1]*e;t[0]=i,t[1]=n}_makeCtrlPt(t){const e=[t[0],t[1]];return Jt(e,1),e}_addAngledTicks(t,e,s,i){const n=this._sub(s,e);this._normalize(n);const a=this._crossProduct(n,this._sub(i,e));let o;o=a>0?this._rightPerp(n):this._leftPerp(n);const h=Math.abs(a)/2,l=[];l.push([e[0]+(o[0]-n[0])*h,e[1]+(o[1]-n[1])*h]),l.push(e),l.push(s),l.push([s[0]+(o[0]+n[0])*h,s[1]+(o[1]+n[1])*h]),t.push(l)}_addBezier2(t,e,s,i,n){if(n--==0)return void t.push(i);const a=this._mid(e,s),o=this._mid(s,i),h=this._mid(a,o);this._addBezier2(t,e,a,h,n),this._addBezier2(t,h,o,i,n)}_addBezier3(t,e,s,i,n,a){if(a--==0)return void t.push(n);const o=this._mid(e,s),h=this._mid(s,i),l=this._mid(i,n),c=this._mid(o,h),u=this._mid(h,l),f=this._mid(c,u);this._addBezier3(t,e,o,c,f,a),this._addBezier3(t,f,u,l,n,a)}_add90DegArc(t,e,s,i,n){const a=n!=null?n:this._crossProduct(this._sub(s,e),this._sub(i,e))>0,o=this._mid(e,s),h=this._sub(o,e);a?this._leftPerpendicular(h):this._rightPerpendicular(h),o[0]+=h[0],o[1]+=h[1],this._addBezier3(t,e,this._mix(e,.33333,o,.66667),this._mix(s,.33333,o,.66667),s,4)}_addArrow(t,e,s){const i=e[0],n=e[1],a=e[e.length-1],o=this._sub(i,n);this._normalize(o);const h=this._crossProduct(o,this._sub(a,n)),l=.5*h,c=this._leftPerp(o),u=[a[0]-c[0]*h,a[1]-c[1]*h],f=e.length-1,m=[];m.push(s?[-c[0],-c[1]]:c);let _=[-o[0],-o[1]];for(let p=1;p0;p--)t.push([e[p][0]+m[p][0]*l,e[p][1]+m[p][1]*l]);t.push([u[0]+m[0][0]*l,u[1]+m[0][1]*l]),t.push([u[0]+m[0][0]*h,u[1]+m[0][1]*h]),t.push(i),t.push([u[0]-m[0][0]*h,u[1]-m[0][1]*h]),t.push([u[0]-m[0][0]*l,u[1]-m[0][1]*l]);for(let p=1;p=2?t[1]:this._add2(t[0],e*this._defaultSize,s*this._defaultSize)}_cp3(t,e,s,i){if(t.length>=3)return t[2];const n=this._mix(t[0],1-s,e,s),a=this._sub(e,t[0]);return this._normalize(a),this._rightPerpendicular(a),[n[0]+a[0]*i*this._defaultSize,n[1]+a[1]*i*this._defaultSize]}_arrowPath(t){if(t.length>2)return t;const e=t[0],s=this._cp2(t,-4,0),i=this._sub(e,s);this._normalize(i);const n=this._rightPerp(i);return[e,s,[e[0]+(n[0]-i[0])*this._defaultSize,e[1]+(n[1]-i[1])*this._defaultSize]]}_arrowLastSeg(t){const e=t[0],s=this._cp2(t,-4,0);let i;if(t.length>=3)i=t[t.length-1];else{const n=this._sub(e,s);this._normalize(n);const a=this._rightPerp(n);i=[e[0]+(a[0]-n[0])*this._defaultSize,e[1]+(a[1]-n[1])*this._defaultSize]}return[s,i]}_processGeom(t){if(!t)return null;const e=[];for(const s of t){if(!s||s.length===0)continue;const i=s.length;let n=s[0];switch(this._rule){case I.PerpendicularFromFirstSegment:{const a=this._cp2(s,0,-1),o=this._cp3(s,a,.5,4),h=[];h.push(o),h.push(this._mid(n,a)),e.push(h);break}case I.ReversedFirstSegment:{const a=this._cp2(s,0,-1);e.push([a,n]);break}case I.PerpendicularToSecondSegment:{const a=this._cp2(s,-4,1),o=this._cp3(s,a,.882353,-1.94),h=[];h.push(this._mid(a,o)),h.push(n),e.push(h);break}case I.SecondSegmentWithTicks:{const a=this._cp2(s,-4,1),o=this._cp3(s,a,.882353,-1.94),h=this._sub(o,a);let l;l=this._crossProduct(h,this._sub(n,a))>0?this._rightPerp(l):this._leftPerp(h);const c=[];c.push([a[0]+(l[0]-h[0])/3,a[1]+(l[1]-h[1])/3]),c.push(a),c.push(o),c.push([o[0]+(l[0]+h[0])/3,o[1]+(l[1]+h[1])/3]),e.push(c);break}case I.DoublePerpendicular:{const a=this._cp2(s,0,-1),o=this._cp3(s,a,.5,3),h=this._mid(n,a),l=this._sub(h,o);this._normalize(l);const c=this._crossProduct(l,this._sub(n,o));this._leftPerpendicular(l);const u=[];u.push(n),u.push([o[0]+l[0]*c,o[1]+l[1]*c]),e.push(u);const f=[];f.push([o[0]-l[0]*c,o[1]-l[1]*c]),f.push(a),e.push(f);break}case I.OppositeToFirstSegment:{const a=this._cp2(s,0,-1),o=this._cp3(s,a,.5,3),h=this._mid(n,a),l=this._sub(h,o);this._normalize(l);const c=this._crossProduct(l,this._sub(n,o));this._leftPerpendicular(l);const u=[];u.push([o[0]+l[0]*c,o[1]+l[1]*c]),u.push([o[0]-l[0]*c,o[1]-l[1]*c]),e.push(u);break}case I.TriplePerpendicular:{const a=this._cp2(s,0,-1),o=this._cp3(s,a,.5,4),h=this._mid(n,a),l=this._sub(h,o);this._normalize(l);const c=this._crossProduct(l,this._sub(n,o));this._leftPerpendicular(l);const u=[];u.push([o[0]+l[0]*c*.8,o[1]+l[1]*c*.8]),u.push([h[0]+.8*(n[0]-h[0]),h[1]+.8*(n[1]-h[1])]),e.push(u),e.push([o,h]);const f=[];f.push([o[0]-l[0]*c*.8,o[1]-l[1]*c*.8]),f.push([h[0]+.8*(a[0]-h[0]),h[1]+.8*(a[1]-h[1])]),e.push(f);break}case I.HalfCircleFirstSegment:{const a=this._cp2(s,0,-1),o=this._cp3(s,a,.5,4),h=this._mid(n,a);let l=this._sub(a,n);const c=Math.cos(Math.PI/18),u=Math.sin(Math.PI/18),f=Math.sqrt((1+c)/2),m=Math.sqrt((1-c)/2),_=[];let p;this._crossProduct(l,this._sub(o,n))>0?(_.push(n),l=this._sub(n,h),p=a):(_.push(a),l=this._sub(a,h),p=n),this._rotateDirect(l,f,m),l[0]/=f,l[1]/=f;for(let d=1;d<=18;d++)_.push(this._add(h,l)),this._rotateDirect(l,c,u);_.push(p),e.push(_);break}case I.HalfCircleSecondSegment:{const a=this._cp2(s,0,-1),o=this._cp3(s,a,1,-1);let h=this._sub(n,a);this._normalize(h);const l=this._crossProduct(h,this._sub(o,a))/2;this._leftPerpendicular(h);const c=[a[0]+h[0]*l,a[1]+h[1]*l];h=this._sub(a,c);const u=Math.cos(Math.PI/18);let f=Math.sin(Math.PI/18);l>0&&(f=-f);const m=[a];for(let _=1;_<=18;_++)this._rotateDirect(h,u,f),m.push(this._add(c,h));e.push(m);break}case I.HalfCircleExtended:{const a=this._cp2(s,0,-2),o=this._cp3(s,a,1,-1);let h;if(i>=4)h=s[3];else{const _=this._sub(n,a);h=this._add(o,_)}const l=this._dist(a,o)/2/.75,c=this._sub(a,n);this._normalize(c,l);const u=this._sub(o,h);this._normalize(u,l);const f=[h,o];e.push(f);const m=[this._clone(o)];this._addBezier3(m,o,this._add(o,u),this._add(a,c),a,4),m.push(n),e.push(m);break}case I.OpenCircle:{const a=this._cp2(s,-2,0),o=this._sub(a,n),h=Math.cos(Math.PI/18),l=-Math.sin(Math.PI/18),c=[a];for(let u=1;u<=33;u++)this._rotateDirect(o,h,l),c.push(this._add(n,o));e.push(c);break}case I.CoverageEdgesWithTicks:{const a=this._cp2(s,0,-1);let o,h;if(i>=3)o=s[2];else{const f=this._sub(a,n),m=this._leftPerp(f);o=[n[0]+m[0]-.25*f[0],n[1]+m[1]-.25*f[1]]}if(i>=4)h=s[3];else{const f=this._mid(n,a),m=this._sub(n,a);this._normalize(m),this._leftPerpendicular(m);const _=this._crossProduct(m,this._sub(o,f));this._rightPerpendicular(m),h=[o[0]+m[0]*_*2,o[1]+m[1]*_*2]}const l=this._sub(a,n);let c,u;c=this._crossProduct(l,this._sub(o,n))>0?this._rightPerp(l):this._leftPerp(l),u=[],u.push(o),u.push(n),u.push([n[0]+(c[0]-l[0])/3,n[1]+(c[1]-l[1])/3]),e.push(u),c=this._crossProduct(l,this._sub(h,a))>0?this._rightPerp(c):this._leftPerp(l),u=[],u.push([a[0]+(c[0]+l[0])/3,a[1]+(c[1]+l[1])/3]),u.push(a),u.push(h),e.push(u);break}case I.GapExtentWithDoubleTicks:{const a=this._cp2(s,0,2),o=this._cp3(s,a,0,1);let h;if(i>=4)h=s[3];else{const l=this._sub(a,n);h=this._add(o,l)}this._addAngledTicks(e,n,a,this._mid(o,h)),this._addAngledTicks(e,o,h,this._mid(n,a));break}case I.GapExtentMidline:{const a=this._cp2(s,2,0),o=this._cp3(s,a,0,1);let h;if(i>=4)h=s[3];else{const c=this._sub(a,n);h=this._add(o,c)}const l=[];l.push(this._mid(n,o)),l.push(this._mid(a,h)),e.push(l);break}case I.Chevron:{const a=this._cp2(s,-1,-1);let o;if(i>=3)o=s[2];else{const h=this._sub(a,n);this._leftPerpendicular(h),o=this._add(n,h)}e.push([a,this._makeCtrlPt(n),o]);break}case I.PerpendicularWithArc:{const a=this._cp2(s,0,-2),o=this._cp3(s,a,.5,-1);let h=this._sub(a,n);const l=this._norm(h);h[0]/=l,h[1]/=l;const c=this._crossProduct(h,this._sub(o,n));let u=this._dotProduct(h,this._sub(o,n));u<.05*l?u=.05*l:u>.95*l&&(u=.95*l);const f=[n[0]+h[0]*u,n[1]+h[1]*u];this._leftPerpendicular(h);let m=[];m.push([f[0]-h[0]*c,f[1]-h[1]*c]),m.push([f[0]+h[0]*c,f[1]+h[1]*c]),e.push(m);const _=[a[0]+h[0]*c,a[1]+h[1]*c];h=this._sub(a,_);const p=Math.cos(Math.PI/18);let d=Math.sin(Math.PI/18);c<0&&(d=-d),m=[n,a];for(let g=1;g<=9;g++)this._rotateDirect(h,p,d),m.push(this._add(_,h));e.push(m);break}case I.ClosedHalfCircle:{const a=this._cp2(s,2,0),o=this._mid(n,a),h=this._sub(a,o),l=Math.cos(Math.PI/18),c=Math.sin(Math.PI/18),u=[n,a];for(let f=1;f<=18;f++)this._rotateDirect(h,l,c),u.push(this._add(o,h));e.push(u);break}case I.TripleParallelExtended:{const a=this._cp2(s,0,-2),o=this._cp3(s,a,1,-2),h=this._mid(n,a),l=this._sub(o,a);this._normalize(l);const c=Math.abs(this._crossProduct(l,this._sub(h,a)))/2,u=this._dist(a,o),f=[a,n];f.push([n[0]+l[0]*u*.5,n[1]+l[1]*u*.5]),e.push(f);const m=[];m.push([h[0]-l[0]*c,h[1]-l[1]*c]),m.push([h[0]+l[0]*u*.375,h[1]+l[1]*u*.375]),Jt(m[m.length-1],1),m.push([h[0]+l[0]*u*.75,h[1]+l[1]*u*.75]),e.push(m);const _=[a,o];e.push(_);break}case I.ParallelWithTicks:{const a=this._cp2(s,3,0),o=this._cp3(s,a,.5,-1),h=this._sub(o,a);this._normalize(h);const l=this._crossProduct(h,this._sub(o,n));this._leftPerpendicular(h),this._addAngledTicks(e,n,a,o),this._addAngledTicks(e,this._mix(n,1,h,l),this._mix(a,1,h,l),this._mid(n,a));break}case I.Parallel:{const a=this._cp2(s,3,0),o=this._cp3(s,a,.5,-1),h=this._sub(a,n);this._normalize(h);const l=this._leftPerp(h),c=this._crossProduct(h,this._sub(o,n));let u=[n,a];e.push(u),u=[],u.push([n[0]+l[0]*c,n[1]+l[1]*c]),u.push([a[0]+l[0]*c,a[1]+l[1]*c]),e.push(u);break}case I.PerpendicularToFirstSegment:{const a=this._cp2(s,3,0),o=this._cp3(s,a,.5,-1),h=this._mid(n,a),l=this._sub(a,n);this._normalize(l);const c=this._crossProduct(l,this._sub(o,n));this._leftPerpendicular(l);const u=[];u.push([h[0]-l[0]*c*.25,h[1]-l[1]*c*.25]),u.push([h[0]+l[0]*c*1.25,h[1]+l[1]*c*1.25]),e.push(u);break}case I.ParallelOffset:{const a=this._cp2(s,3,0),o=this._cp3(s,a,.5,-1),h=this._sub(a,n);this._normalize(h);const l=this._crossProduct(h,this._sub(o,n));this._leftPerpendicular(h);const c=[];c.push([n[0]-h[0]*l,n[1]-h[1]*l]),c.push([a[0]-h[0]*l,a[1]-h[1]*l]),e.push(c);const u=[];u.push([n[0]+h[0]*l,n[1]+h[1]*l]),u.push([a[0]+h[0]*l,a[1]+h[1]*l]),e.push(u);break}case I.OffsetOpposite:{const a=this._cp2(s,3,0),o=this._cp3(s,a,.5,-1),h=this._sub(a,n);this._normalize(h);const l=this._crossProduct(h,this._sub(o,n));this._leftPerpendicular(h);const c=[];c.push([n[0]-h[0]*l,n[1]-h[1]*l]),c.push([a[0]-h[0]*l,a[1]-h[1]*l]),e.push(c);break}case I.OffsetSame:{const a=this._cp2(s,3,0),o=this._cp3(s,a,.5,-1),h=this._sub(a,n);this._normalize(h);const l=this._crossProduct(h,this._sub(o,n));this._leftPerpendicular(h);const c=[];c.push([n[0]+h[0]*l,n[1]+h[1]*l]),c.push([a[0]+h[0]*l,a[1]+h[1]*l]),e.push(c);break}case I.CircleWithArc:{let a=this._cp2(s,3,0);const o=this._cp3(s,a,.5,-1);let h,l;if(i>=4)h=s[3],l=this._crossProduct(this._sub(h,a),this._sub(o,a))>0;else{h=a,l=this._crossProduct(this._sub(h,n),this._sub(o,n))>0;const _=24*this._geomUnitsPerPoint,p=this._sub(h,n);this._normalize(p,_);const d=Math.sqrt(2)/2;this._rotateDirect(p,d,l?d:-d),a=this._add(n,p)}const c=this._sub(a,n),u=Math.cos(Math.PI/18),f=Math.sin(Math.PI/18),m=[a];for(let _=1;_<=36;_++)this._rotateDirect(c,u,f),m.push(this._add(n,c));this._add90DegArc(m,a,h,o,l),Jt(m[m.length-8],1),e.push(m);break}case I.DoubleJog:{let a,o,h=this._cp2(s,-3,1);if(a=i>=3?s[2]:this._add(n,this._sub(n,h)),i>=4)o=s[3];else{const g=n;n=h,o=a;const y=this._dist(n,g),P=this._dist(o,g);let x=30*this._geomUnitsPerPoint;.5*y0?this._rotateDirect(p,_,-_):this._rotateDirect(p,_,_);let d=[];d.push(h),d.push(this._add(l,p)),d.push(this._sub(l,p)),d.push(n),e.push(d),p=this._sub(o,a),this._normalize(p,m),this._crossProduct(p,this._sub(n,a))<0?this._rotateDirect(p,_,_):this._rotateDirect(p,_,-_),d=[],d.push(a),d.push(this._add(c,p)),d.push(this._sub(c,p)),d.push(o),e.push(d);break}case I.PerpendicularOffset:{const a=this._cp2(s,-4,1),o=this._cp3(s,a,.882353,-1.94),h=this._sub(o,a);this._crossProduct(h,this._sub(n,a))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(a,o),l);e.push([c,n]);break}case I.LineExcludingLastSegment:{const a=this._arrowPath(s),o=[];let h=a.length-2;for(;h--;)o.push(a[h]);e.push(o);break}case I.MultivertexArrow:{const a=this._arrowPath(s),o=[];this._addArrow(o,a,!1),e.push(o);break}case I.CrossedArrow:{const a=this._arrowPath(s),o=[];this._addArrow(o,a,!0),e.push(o);break}case I.ChevronArrow:{const[a,o]=this._arrowLastSeg(s),h=10*this._geomUnitsPerPoint,l=this._sub(n,a);this._normalize(l);const c=this._crossProduct(l,this._sub(o,a)),u=this._leftPerp(l),f=[o[0]-u[0]*c*2,o[1]-u[1]*c*2],m=[];m.push([o[0]+l[0]*h,o[1]+l[1]*h]),m.push(n),m.push([f[0]+l[0]*h,f[1]+l[1]*h]),e.push(m);break}case I.ChevronArrowOffset:{const[a,o]=this._arrowLastSeg(s),h=this._sub(n,a);this._normalize(h);const l=this._crossProduct(h,this._sub(o,a));this._leftPerpendicular(h);const c=[o[0]-h[0]*l,o[1]-h[1]*l],u=[];u.push([c[0]+h[0]*l*.5,c[1]+h[1]*l*.5]),u.push(this._mid(c,n)),u.push([c[0]-h[0]*l*.5,c[1]-h[1]*l*.5]),e.push(u);break}case I.PartialFirstSegment:{const[a,o]=this._arrowLastSeg(s),h=this._sub(n,a);this._normalize(h);const l=this._crossProduct(h,this._sub(o,a));this._leftPerpendicular(h);const c=[o[0]-h[0]*l,o[1]-h[1]*l];e.push([a,c]);break}case I.Arch:{const a=this._cp2(s,0,-1),o=this._cp3(s,a,.5,1),h=this._sub(n,a),l=this._mix(o,1,h,.55),c=this._mix(o,1,h,-.55),u=[n];this._addBezier2(u,n,l,o,4),this._addBezier2(u,o,c,a,4),e.push(u);break}case I.CurvedParallelTicks:{const a=this._cp2(s,-4,1),o=this._cp3(s,a,.882353,-1.94),h=this._sub(o,a);this._crossProduct(h,this._sub(n,a))>0?this._rightPerpendicular(h):this._leftPerpendicular(h);const l=[h[0]/8,h[1]/8],c=this._sub(this._mid(a,o),l),u=this._sub(this._mix(a,.75,o,.25),l),f=this._sub(this._mix(a,.25,o,.75),l),m=[a];this._addBezier2(m,a,u,c,3),this._addBezier2(m,c,f,o,3),e.push(m);for(let _=0;_<8;_++){const p=m[2*_+1],d=[this._clone(p)];d.push(this._add(p,[h[0]/4,h[1]/4])),e.push(d)}break}case I.Arc90Degrees:{const a=this._cp2(s,0,-1),o=this._cp3(s,a,.5,1),h=[a];this._add90DegArc(h,a,n,o),e.push(h);break}case I.FullGeometry:default:e.push(s)}}return e}}class St{static local(){return St.instance===null&&(St.instance=new St),St.instance}execute(t,e,s,i){return new yr(t,e,s)}}St.instance=null;class yr extends Te{constructor(t,e,s){super(t,!0,!0),this._curveHelper=new tt,this._beginCut=(e.beginCut!==void 0?e.beginCut:1)*s,this._endCut=(e.endCut!==void 0?e.endCut:1)*s,this._middleCut=(e.middleCut!==void 0?e.middleCut:0)*s,this._invert=e.invert!==void 0&&e.invert,this._beginCut<0&&(this._beginCut=0),this._endCut<0&&(this._endCut=0),this._middleCut<0&&(this._middleCut=0)}processPath(t){const e=this._beginCut,s=this._endCut,i=this._middleCut,n=this._curveHelper.calculatePathLength(t),a=[];if(this._invert){if(!(e===0&&s===0&&i===0))if(e+s+i>=n)a.push(t);else{let o=this._curveHelper.getSubCurve(t,0,e);o&&a.push(o),o=this._curveHelper.getSubCurve(t,.5*(n-i),.5*(n+i)),o&&a.push(o),o=this._curveHelper.getSubCurve(t,n-s,s),o&&a.push(o)}}else if(e===0&&s===0&&i===0)a.push(t);else if(!(e+s+i>=n))if(i===0){const o=this._curveHelper.getSubCurve(t,e,n-s);o&&a.push(o)}else{let o=this._curveHelper.getSubCurve(t,e,.5*(n-i));o&&a.push(o),o=this._curveHelper.getSubCurve(t,.5*(n+i),n-s),o&&a.push(o)}return a.length===0?null:{paths:a}}}const xs=1e-7;class Ne{constructor(){this._values=[],this.extPtGap=0,this.ctrlPtGap=0,this._length=0,this._currentValue=0}isEmpty(){return this._values.length===0}size(){return this._values.length}init(t,e,s=!0){if(this._setEmpty(),!t||t.length===0)return!1;for(let i=0;i0&&(n/=this._currentPosition.segmentLength),this._currentPosition.copyTo(e);e.abscissa+t*this._partLengthRatio>e.segmentLength+this._tolerance;){if(s){if(s.length===0)if(n===0){const o=this._path[e.segment];s.push([o[0],o[1]])}else s.push(this.getSegCoord2D(this._path,e.segment,n));const a=this._path[e.segment+1];s.push([a[0],a[1]])}if(n=0,t-=(e.segmentLength-e.abscissa)/this._partLengthRatio,this._partSegCount)e.segment=this._nextSegment(),e.segmentLength=this.calculateSegLength(this._path,e.segment),e.abscissa=0,this._partSegCount--;else{if(!this._setPosAtNextPart())return i!==lt.FAIL&&(e.segmentLength=this.calculateSegLength(this._path,e.segment),e.isPartEnd=!0,i===lt.END?(e.abscissa=e.segmentLength,e.isPathEnd=!0):e.abscissa=e.segmentLength+t,!0);this._currentPosition.copyTo(e)}}if(e.abscissa+=t*this._partLengthRatio,s){if(s.length===0)if(n===0){const o=this._path[e.segment];s.push([o[0],o[1]])}else s.push(this.getSegCoord2D(this._path,e.segment,n));const a=e.abscissa/e.segmentLength;if(a===1){const o=this._path[e.segment+1];s.push([o[0],o[1]])}else s.push(this.getSegCoord2D(this._path,e.segment,a))}return this._partSegCount||Math.abs(e.abscissa-e.segmentLength)=this._path.length&&(s=0),this._ctrlPtEnd=he(this._path[s])===1,this._patternLength>0){const i=this._ctrlPtBegin?this._partCtrlPtGap:this._partExtPtGap,n=this._ctrlPtEnd?this._partCtrlPtGap:this._partExtPtGap;let a=Math.round((this._partLength-(i+n))/this._patternLength);a<=0&&(a=i+n>0?0:1),this._partLengthRatio=this._partLength/(i+n+a*this._patternLength),this._partLengthRatio<.01&&(this._partLengthRatio=1)}else this._partLengthRatio=1;return!0}_hasNextSegment(){return this._seg=e;)i-=e,e=this._pattern.nextValue(),a=!a;e-=i,a?(this._walker.nextPosition(e),e=this._pattern.nextValue()):this.isClosed&&(this._firstCurve=this._walker.nextCurve(e),e=this._pattern.nextValue(),this._walker.nextPosition(e),e=this._pattern.nextValue())}let s=this._walker.nextCurve(e);return s?this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(this._firstCurve.splice(0,1),jt.mergePath(s,this._firstCurve),this._firstCurve=null)):(e=this._pattern.nextValue(),!this._walker.nextPosition(e)||this._walker.isPathEnd()?(this.iteratePath=!1,this._firstCurve&&(s=this._firstCurve,this._firstCurve=null)):this.iteratePath=!0):(this.iteratePath=!1,s=this._firstCurve,this._firstCurve=null),{paths:[s]}}}class wt{static local(){return wt.instance===null&&(wt.instance=new wt),wt.instance}execute(t,e,s,i){return new xr(t,e,s)}}wt.instance=null;class xr{constructor(t,e,s){switch(this._inputGeometries=t,this._curveHelper=new tt,this._width=(e.width!==void 0?e.width:2)*s,e.method){case ie.Mitered:default:this._method=X.Mitered;break;case ie.Bevelled:this._method=X.Bevelled;break;case ie.Rounded:case ie.TrueBuffer:this._method=X.Rounded;break;case ie.Square:this._method=X.Square}this._option=e.option,this._offsetFlattenError=Zt*s}next(){let t=this._inputGeometries.next();for(;t;){if($(t)&&this._width>0){if(Math.min(t.xmax-t.xmin,t.ymax-t.ymin)-2*this._width<0)return t;const e=[];return e.push([[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]),e.push([[t.xmin+this._width,t.ymin+this._width],[t.xmax-this._width,t.ymin+this._width],[t.xmax-this._width,t.ymax-this._width],[t.xmin+this._width,t.ymax-this._width],[t.xmin+this._width,t.ymin+this._width]]),{rings:e}}if(z(t)&&this._width>0){const e=[];for(const s of t.rings){const i=this._curveHelper.calculatePathLength(s),n=this._curveHelper.offset(s,this._width,this._method,4,this._offsetFlattenError);n&&(i<0&&n.reverse(),e.push(n))}if(e.length)return{rings:e}}t=this._inputGeometries.next()}return null}}class kt{static local(){return kt.instance===null&&(kt.instance=new kt),kt.instance}execute(t,e,s,i){return new br(t,e,s)}}kt.instance=null;class br extends Te{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new tt,this._length=(e.length!==void 0?e.length:20)*s,this._angle=e.angle!==void 0?e.angle:225,this._position=e.position!==void 0?e.position:50,this._length<0&&(this._length=-this._length),this._position<20&&(this._position=20),this._position>80&&(this._position=80),this._mirror=!1}processPath(t){if(this._curveHelper.isEmpty(t,!1))return null;const e=t[0],s=t[t.length-1],i=[s[0]-e[0],s[1]-e[1]];this._curveHelper.normalize(i);const n=[e[0]+(s[0]-e[0])*this._position/100,e[1]+(s[1]-e[1])*this._position/100],a=Math.cos((90-this._angle)/180*Math.PI);let o=Math.sin((90-this._angle)/180*Math.PI);return this._mirror&&(o=-o),this._mirror=!this._mirror,{paths:[[e,[n[0]-this._length/2*a,n[1]-this._length/2*o],[n[0]+this._length/2*a,n[1]+this._length/2*o],s]]}}}class vt{static local(){return vt.instance===null&&(vt.instance=new vt),vt.instance}execute(t,e,s,i){return new Mr(t,e,s)}}vt.instance=null;class Mr{constructor(t,e,s){this._inputGeometries=t,this._offsetX=e.offsetX!==void 0?e.offsetX*s:0,this._offsetY=e.offsetY!==void 0?-e.offsetY*s:0}next(){let t=this._inputGeometries.next();for(;t;){if($(t))return{xmin:t.xmin+this._offsetX,xmax:t.xmax+this._offsetX,ymin:t.ymin+this._offsetY,ymax:t.ymax+this._offsetY};if(z(t)){const e=R(t);return this._moveMultipath(e.rings,this._offsetX,this._offsetY),e}if(O(t)){const e=R(t);return this._moveMultipath(e.paths,this._offsetX,this._offsetY),e}if(Z(t)){const e=R(t);return this._movePath(e.points,this._offsetX,this._offsetY),e}if(ut(t))return{x:t.x+this._offsetX,y:t.y+this._offsetY};t=this._inputGeometries.next()}return null}_moveMultipath(t,e,s){if(t)for(const i of t)this._movePath(i,e,s)}_movePath(t,e,s){if(t)for(const i of t)i[0]+=e,i[1]+=s}}class It{static local(){return It.instance===null&&(It.instance=new It),It.instance}execute(t,e,s,i){return new Sr(t,e,s)}}It.instance=null;class Sr{constructor(t,e,s){var i;this._inputGeometries=t,this._curveHelper=new tt,this._offset=((i=e.offset)!=null?i:1)*s,this._method=e.method,this._option=e.option,this._offsetFlattenError=Zt*s}next(){let t=this._inputGeometries.next();for(;t;){if(this._offset===0)return t;if($(t)){if(this._method===X.Rounded&&this._offset>0){const e=[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]],s=this._curveHelper.offset(e,-this._offset,this._method,4,this._offsetFlattenError);return s?{rings:[s]}:null}if(Math.min(t.xmax-t.xmin,t.ymax-t.ymin)+2*this._offset>0)return{xmin:t.xmin-this._offset,xmax:t.xmax+this._offset,ymin:t.ymin-this._offset,ymax:t.ymax+this._offset}}if(z(t)){const e=[];for(const s of t.rings){const i=this._curveHelper.offset(s,-this._offset,this._method,4,this._offsetFlattenError);i&&e.push(i)}if(e.length)return{rings:e}}if(O(t)){const e=[];for(const s of t.paths){const i=this._curveHelper.offset(s,-this._offset,this._method,4,this._offsetFlattenError);i&&e.push(i)}if(e.length)return{paths:e}}t=this._inputGeometries.next()}return null}}class Lt{static local(){return Lt.instance===null&&(Lt.instance=new Lt),Lt.instance}execute(t,e,s,i){return new Cr(t,e,s)}}Lt.instance=null;class Cr{constructor(t,e,s){this._inputGeometries=t,this._reverse=e.reverse===void 0||e.reverse}next(){let t=this._inputGeometries.next();for(;t;){if(!this._reverse)return t;if(O(t)){const e=R(t);return cr(e.paths),e}t=this._inputGeometries.next()}return null}}class Tt{static local(){return Tt.instance===null&&(Tt.instance=new Tt),Tt.instance}execute(t,e,s,i){return new wr(t,e,s)}}Tt.instance=null;class wr{constructor(t,e,s){this._inputGeometries=t,this._rotateAngle=e.angle!==void 0?e.angle*Math.PI/180:0}next(){let t=this._inputGeometries.next();for(;t;){if(this._rotateAngle===0)return t;const e=V();Qt(e,t);const s=(e[2]+e[0])/2,i=(e[3]+e[1])/2;if($(t)){const n={rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]};return this._rotateMultipath(n.rings,s,i),n}if(z(t)){const n=R(t);return this._rotateMultipath(n.rings,s,i),n}if(O(t)){const n=R(t);return this._rotateMultipath(n.paths,s,i),n}if(Z(t)){const n=R(t);return this._rotatePath(n.points,s,i),n}if(ut(t))return t;t=this._inputGeometries.next()}return null}_rotateMultipath(t,e,s){if(t)for(const i of t)this._rotatePath(i,e,s)}_rotatePath(t,e,s){if(t){const i=Math.cos(this._rotateAngle),n=Math.sin(this._rotateAngle);for(const a of t){const o=a[0]-e,h=a[1]-s;a[0]=e+o*i-h*n,a[1]=s+o*n+h*i}}}}class Nt{static local(){return Nt.instance===null&&(Nt.instance=new Nt),Nt.instance}execute(t,e,s,i){return new kr(t,e,s)}}Nt.instance=null;class kr{constructor(t,e,s){this._inputGeometries=t,this._xFactor=e.xScaleFactor!==void 0?e.xScaleFactor:1.15,this._yFactor=e.yScaleFactor!==void 0?e.yScaleFactor:1.15}next(){let t=this._inputGeometries.next();for(;t;){if(this._xFactor===1&&this._yFactor===1)return t;const e=V();Qt(e,t);const s=(e[2]+e[0])/2,i=(e[3]+e[1])/2;if($(t)){const n={rings:[[[t.xmin,t.ymin],[t.xmin,t.ymax],[t.xmax,t.ymax],[t.xmax,t.ymin],[t.xmin,t.ymin]]]};return this._scaleMultipath(n.rings,s,i),n}if(z(t)){const n=R(t);return this._scaleMultipath(n.rings,s,i),n}if(O(t)){const n=R(t);return this._scaleMultipath(n.paths,s,i),n}if(Z(t)){const n=R(t);return this._scalePath(n.points,s,i),n}if(ut(t))return t;t=this._inputGeometries.next()}return null}_scaleMultipath(t,e,s){if(t)for(const i of t)this._scalePath(i,e,s)}_scalePath(t,e,s){if(t)for(const i of t){const n=(i[0]-e)*this._xFactor,a=(i[1]-s)*this._yFactor;i[0]=e+n,i[1]=s+a}}}class At{static local(){return At.instance===null&&(At.instance=new At),At.instance}execute(t,e,s,i){return new vr(t,e,s)}}At.instance=null;class vr{constructor(t,e,s){this._inputGeometries=t,this._height=(e.amplitude!==void 0?e.amplitude:2)*s,this._period=(e.period!==void 0?e.period:3)*s,this._style=e.waveform,this._height<=0&&(this._height=Math.abs(this._height)),this._period<=0&&(this._period=Math.abs(this._period)),this._pattern=new Ne,this._pattern.addValue(this._period),this._pattern.addValue(this._period),this._walker=new Ae,this._walker.updateTolerance(s)}next(){let t=this._inputGeometries.next();for(;t;){if(this._height===0||this._period===0)return t;if(O(t)){const e=this._processGeom(t.paths);if(e.length)return{paths:e}}if(z(t)){const e=this._processGeom(t.rings);if(e.length)return{rings:e}}t=this._inputGeometries.next()}return null}_processGeom(t){const e=[];for(const s of t)if(this._walker.init(s,this._pattern))switch(this._style){case ge.Sinus:default:e.push(this._constructCurve(s,!1));break;case ge.Square:e.push(this._constructSquare(s));break;case ge.Triangle:e.push(this._constructTriangle(s));break;case ge.Random:e.push(this._constructCurve(s,!0))}else e.push(s);return e}_constructCurve(t,e){const s=new jt,i=this._walker.calculatePathLength(t);let n=Math.round(i/this._period);n===0&&(n=1);const a=n*16+1,o=i/n,h=this._period/16,l=1/a,c=2*Math.PI*i/o,u=2*Math.PI*Math.random(),f=2*Math.PI*Math.random(),m=2*Math.PI*Math.random(),_=.75-Math.random()/2,p=.75-Math.random()/2,d=new it;this._walker.curPointAndAngle(d),s.startPath(d.pt);let g=0;for(;;){if(!this._walker.nextPointAndAngle(h,d)){s.lineTo(t[t.length-1]);break}{const y=g;let P;if(g+=l,e){const x=this._height/2*(1+.3*Math.sin(_*c*y+u));P=x*Math.sin(c*y+f),P+=x*Math.sin(p*c*y+m),P/=2}else P=.5*this._height*Math.sin(.5*c*y);s.lineTo([d.pt[0]-P*d.sa,d.pt[1]+P*d.ca])}}return s.path()}_constructSquare(t){const e=new jt,s=this._walker.calculatePathLength(t);Math.round(s/this._period);let i=!0;for(;;){let n=!1;if(this._walker.curPositionIsValid()){const a=new it;this._walker.curPointAndAngle(a);const o=new it;if(this._walker.nextPointAndAngle(this._period,o)){const h=new it;this._walker.nextPointAndAngle(this._period,h)&&(i?(e.startPath(a.pt),i=!1):e.lineTo(a.pt),e.lineTo([a.pt[0]-this._height/2*a.sa,a.pt[1]+this._height/2*a.ca]),e.lineTo([o.pt[0]-this._height/2*o.sa,o.pt[1]+this._height/2*o.ca]),e.lineTo([o.pt[0]+this._height/2*o.sa,o.pt[1]-this._height/2*o.ca]),e.lineTo([h.pt[0]+this._height/2*h.sa,h.pt[1]-this._height/2*h.ca]),n=!0)}}if(!n){e.lineTo(this._walker.getPathEnd());break}}return e.path()}_constructTriangle(t){const e=new jt,s=this._walker.calculatePathLength(t);Math.round(s/this._period);let i=!0;for(;;){let n=!1;if(this._walker.curPositionIsValid()){const a=new it;this._walker.curPointAndAngle(a);const o=new it;if(this._walker.nextPointAndAngle(this._period/2,o)){const h=new it;this._walker.nextPointAndAngle(this._period,h)&&(this._walker.nextPosition(this._period/2)&&(i?(e.startPath(a.pt),i=!1):e.lineTo(a.pt),e.lineTo([o.pt[0]-this._height/2*o.sa,o.pt[1]+this._height/2*o.ca]),e.lineTo([h.pt[0]+this._height/2*h.sa,h.pt[1]-this._height/2*h.ca])),n=!0)}}if(!n){e.lineTo(this._walker.getPathEnd());break}}return e.path()}}class zt{static local(){return zt.instance===null&&(zt.instance=new zt),zt.instance}execute(t,e,s,i){return new Ir(t,e,s)}}zt.instance=null;class Ir extends fe{constructor(t,e,s){var i;super(t,!0,!0),this._geometryWalker=new Ae,this._geometryWalker.updateTolerance(s),this._angleToLine=(i=e.angleToLine)!=null?i:!0,this._offset=(e.offset?e.offset:0)*s,this._originalEndings=e.endings,this._offsetAtEnd=(e.customEndingOffset?e.customEndingOffset:0)*s,this._position=-(e.offsetAlongLine?e.offsetAlongLine:0)*s,this._pattern=new Ne,this._pattern.init(e.placementTemplate,!1),this._pattern.scale(s),this._endings=this._originalEndings}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath)e=this._pattern.nextValue();else{this._originalEndings===st.WithFullGap&&this.isClosed?this._endings=st.WithMarkers:this._endings=this._originalEndings,this._pattern.extPtGap=0;let i,n=!0;switch(this._endings){case st.NoConstraint:i=-this._position,i=this._adjustPosition(i),n=!1;break;case st.WithHalfGap:default:i=-this._pattern.lastValue()/2;break;case st.WithFullGap:i=-this._pattern.lastValue(),this._pattern.extPtGap=this._pattern.lastValue();break;case st.WithMarkers:i=0;break;case st.Custom:i=-this._position,i=this._adjustPosition(i),this._pattern.extPtGap=.5*this._offsetAtEnd}if(!this._geometryWalker.init(t,this._pattern,n))return null;this._pattern.reset();let a=0;for(;i>a;)i-=a,a=this._pattern.nextValue();a-=i,e=a,this.iteratePath=!0}const s=new it;return this._geometryWalker.nextPointAndAngle(e,s)?this._endings===st.WithFullGap&&this._geometryWalker.isPathEnd()?(this.iteratePath=!1,null):this._endings===st.WithMarkers&&this._geometryWalker.isPathEnd()&&(this.iteratePath=!1,this.isClosed)?null:(this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca),this._angleToLine&&this.internalPlacement.setRotateCS(s.ca,s.sa),this.internalPlacement):(this.iteratePath=!1,null)}_adjustPosition(t){let e=t/this._pattern.length();return e-=Math.floor(e),e*this._pattern.length()}}class Ot{static local(){return Ot.instance===null&&(Ot.instance=new Ot),Ot.instance}execute(t,e,s,i){return new Lr(t,e,s)}}Ot.instance=null;class Lr extends fe{constructor(t,e,s){super(t,!1,!0),this._curveHelper=new tt,this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._type=e.extremityPlacement,this._position=e.offsetAlongLine!==void 0?e.offsetAlongLine*s:0,this._beginProcessed=!1}processPath(t){let e;switch(this._type){case ct.Both:default:this._beginProcessed?(e=this._atExtremities(t,this._position,!1),this._beginProcessed=!1,this.iteratePath=!1):(e=this._atExtremities(t,this._position,!0),this._beginProcessed=!0,this.iteratePath=!0);break;case ct.JustBegin:e=this._atExtremities(t,this._position,!0);break;case ct.JustEnd:e=this._atExtremities(t,this._position,!1);case ct.None:}return e}_atExtremities(t,e,s){const i=t.length;if(i<2)return null;const n=s?1:i-2,a=s?i:-1,o=s?1:-1;let h,l=0,c=s?t[0]:t[i-1];for(let u=n;u!==a;u+=o){h=c,c=t[u];const f=this._curveHelper.calculateLength(h,c);if(l+f>e){const m=(e-l)/f,[_,p]=this._curveHelper.getAngleCS(h,c,m),d=Ze(h,c,m);return this.internalPlacement.setTranslate(d[0]-this._offset*p,d[1]+this._offset*_),this._angleToLine&&this.internalPlacement.setRotateCS(-_,-p),this.internalPlacement}l+=f}return null}}class Rt{static local(){return Rt.instance===null&&(Rt.instance=new Rt),Rt.instance}execute(t,e,s,i){return new Tr(t,e,s)}}Rt.instance=null;class Tr extends fe{constructor(t,e,s){super(t,!0,!0),this._walker=new Ae,this._walker.updateTolerance(s),this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._beginGap=e.beginPosition!==void 0?e.beginPosition*s:0,this._endGap=e.endPosition!==void 0?e.endPosition*s:0,this._flipFirst=e.flipFirst===void 0||e.flipFirst,this._pattern=new Ne,this._pattern.init(e.positionArray,!1,!1),this._subPathLen=0,this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0}processPath(t){if(this._pattern.isEmpty())return null;let e;if(this.iteratePath){const o=this._pattern.nextValue()*this._subPathLen,h=this._beginGap+o;e=h-this._prevPos,this._prevPos=h}else{if(this._posCount=this._pattern.size(),this._isFirst=!0,this._prevPos=0,this._subPathLen=this._walker.calculatePathLength(t)-this._beginGap-this._endGap,this._subPathLen<0)return this.iteratePath=!1,null;if(!this._walker.init(t,this._pattern,!1))return null;this._pattern.reset();const o=this._pattern.nextValue()*this._subPathLen,h=this._beginGap+o;e=h-this._prevPos,this._prevPos=h,this.iteratePath=!0}const s=new it;if(!this._walker.nextPointAndAngle(e,s,lt.END))return this.iteratePath=!1,null;this.internalPlacement.setTranslate(s.pt[0]-this._offset*s.sa,s.pt[1]+this._offset*s.ca);const i=this._isFirst&&this._flipFirst;let n,a;return this._angleToLine?(n=s.ca,a=s.sa):(n=1,a=0),i&&(n=-n,a=-a),this.internalPlacement.setRotateCS(n,a),this._isFirst=!1,this._posCount--,this._posCount===0&&(this.iteratePath=!1),this.internalPlacement}}function Nr(r){return r.rings!==void 0}class Et{static local(){return Et.instance===null&&(Et.instance=new Et),Et.instance}execute(t,e,s,i){return new Ar(t,e,s,i)}}Et.instance=null;class Ar{constructor(t,e,s,i){var n,a,o,h,l,c,u,f,m;if(this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,this._currentX=0,this._currentY=0,this._stepX=Math.abs((n=e.stepX)!=null?n:16)*s,this._stepY=Math.abs((a=e.stepY)!=null?a:16)*s,this._stepX!==0&&this._stepY!==0&&t&&Nr(t)&&t.rings){if(this._gridType=(o=e.gridType)!=null?o:Oe.Fixed,this._gridType===Oe.Random){const _=(h=e.seed)!=null?h:13,p=1;this._randomLCG=new Rs(_*p),this._randomness=((l=e.randomness)!=null?l:100)/100,this._gridAngle=0,this._shiftOddRows=!1,this._cosAngle=1,this._sinAngle=0,this._offsetX=0,this._offsetY=0}else{if(this._randomness=0,this._gridAngle=(c=e.gridAngle)!=null?c:0,this._shiftOddRows=(u=e.shiftOddRows)!=null?u:!1,this._offsetX=((f=e.offsetX)!=null?f:0)*s,this._offsetY=((m=e.offsetY)!=null?m:0)*s,this._cosAngle=Math.cos(this._gridAngle/180*Math.PI),this._sinAngle=-Math.sin(this._gridAngle/180*Math.PI),this._stepX)if(this._offsetX<0)for(;this._offsetX<-.5*this._stepX;)this._offsetX+=this._stepX;else for(;this._offsetX>=.5*this._stepX;)this._offsetX-=this._stepX;if(this._stepY)if(this._offsetY<0)for(;this._offsetY<-.5*this._stepY;)this._offsetY+=this._stepY;else for(;this._offsetY>=.5*this._stepY;)this._offsetY-=this._stepY}this._graphicOriginX=0,this._graphicOriginY=0,this._internalPlacement=new te,this._calculateMinMax(t),this._geometry=t}}next(){return this._geometry?this._nextInside():null}_calculateMinMax(t){let e,s,i,n,a,o,h,l;this._xMin=0,this._xMax=0,this._yMin=0,this._yMax=0,a=o=Number.MAX_VALUE,h=l=-Number.MAX_VALUE;for(const c of t.rings){const u=c?c.length:0;for(let f=0;fthis._xMax){if(this._currentY++,this._currentY>this._yMax)return null;this._currentX=this._xMin,this._shiftOddRows&&this._currentY%2&&this._currentX--}let t=this._currentX*this._stepX+this._offsetX;this._shiftOddRows&&this._currentY%2&&(t+=.5*this._stepX);const e=this._currentY*this._stepY+this._offsetY;let s,i;return this._currentX++,this._gridType===Oe.Random?(s=this._graphicOriginX+t+this._stepX*this._randomness*(.5-this._randomLCG.getFloat())*2/3,i=this._graphicOriginY+e+this._stepY*this._randomness*(.5-this._randomLCG.getFloat())*2/3):(s=this._graphicOriginX+this._cosAngle*t+this._sinAngle*e,i=this._graphicOriginY-this._sinAngle*t+this._cosAngle*e),this._internalPlacement.setTranslate(s,i),this._internalPlacement}}}const zr=.001;class $t{static local(){return $t.instance===null&&($t.instance=new $t),$t.instance}execute(t,e,s,i){return new Or(t,e,s)}}$t.instance=null;class Or extends fe{constructor(t,e,s){super(t,!0,!0),this._curveHelper=new tt,this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._relativeTo=e.relativeTo,this._position=e.startPointOffset!==void 0?e.startPointOffset*s:0,this._epsilon=zr*s}processPath(t){const e=this._position;if(this._relativeTo===Bt.SegmentMidpoint){for(this.iteratePath||(this._segmentCount=t.length,this._curSegment=1,this.iteratePath=!0);this._curSegments){const u=(s-o)/c,[f,m]=this._curveHelper.getAngleCS(a,h,u),_=Ze(a,h,u),p=i?-this._offset:this._offset;return this.internalPlacement.setTranslate(_[0]-p*m,_[1]+p*f),this._angleToLine&&(i?this.internalPlacement.setRotateCS(-f,-m):this.internalPlacement.setRotateCS(f,m)),this.internalPlacement}o+=c}return null}}class Ft{static local(){return Ft.instance===null&&(Ft.instance=new Ft),Ft.instance}execute(t,e,s,i){return new Er(t,e,s)}}Ft.instance=null;const Rr=1e-15;class Er extends fe{constructor(t,e,s){super(t,!0,!0),this._curveHelper=new tt,this._angleToLine=e.angleToLine===void 0||e.angleToLine,this._offset=e.offset!==void 0?e.offset*s:0,this._endPoints=e.placeOnEndPoints===void 0||e.placeOnEndPoints,this._controlPoints=e.placeOnControlPoints===void 0||e.placeOnControlPoints,this._regularVertices=e.placeOnRegularVertices===void 0||e.placeOnRegularVertices,this._tags=[],this._tagIterator=0}processPath(t){if(this.iteratePath||(this._preparePath(t),this.iteratePath=!0),this._tagIterator>=this._tags.length)return this._tags.length=0,this._tagIterator=0,this.iteratePath=!1,null;const e=this._tags[this._tagIterator];this._angleToLine&&this.internalPlacement.setRotate(e[2]);let s=e[0],i=e[1];if(this._offset!==0){const n=Math.cos(e[2]),a=Math.sin(e[2]);s-=this._offset*a,i+=this._offset*n}return this.internalPlacement.setTranslate(s,i),this._tagIterator++,this.internalPlacement}_preparePath(t){this._tags.length=0,this._tagIterator=0;const e=ur(t),s=t.length-1;let i,n,a=0,o=0,h=0,l=0,c=0;for(;ae+2*Rr;)t-r>e?t-=2*e:t+=2*e;return(r+t)/2}class $r{constructor(t=Fr){this._data=[],this._compare=t}get size(){return this._data.length}enqueue(t){if(t==null)return;const{_data:e,_compare:s}=this;e.push(t);let i=e.length-1>>>0;const n=e[i];for(;i>0;){const a=i-1>>1,o=e[a];if(!(s(o,n)<=0))break;e[a]=n,e[i]=o,i=a}}dequeue(){const{_data:t,_compare:e}=this,s=t[0],i=t.pop();if(t.length===0)return s;t[0]=i;let n=0;const a=t.length,o=t[0];let h,l,c=null;for(;;){const u=2*n+1,f=2*n+2;if(c=null,u0&&(c=u)),frt?1:0,Gr=100*222045e-21;function Hr(r){const{rings:t}=r;if(!t||t.length===0)return null;const e=Qt(V(),r);if(!e)return null;const s=4*(Math.abs(e[0])+Math.abs(e[2])+Math.abs(e[1])+Math.abs(e[3])+1)*Gr;let i=0,n=0;for(let b=0;bn&&(n=w,i=b)}if(Math.abs(n)<=2*s*s){const b=We(V(),t[i]);return[(b[0]+b[2])/2,(b[1]+b[3])/2]}const a=Pi(t[i],!1,V());if(a===null)return null;if(t.length===1&&t[0].length<4)return a;const o=[[NaN,NaN],[NaN,NaN],[NaN,NaN],[NaN,NaN]],h=[NaN,NaN,NaN,NaN],l=[NaN,NaN,NaN,NaN];let c=!1,u=re(a,r,!0);u.distance===0&&(c=!0,o[0][0]=a[0],o[0][1]=a[1],u=re(a,r,!1)),h[0]=u.distance,l[0]=0;const f=[NaN,NaN];let m=!1,_=.25,p=-1;const d=We(V(),t[i]);let g=NaN;do if(g=NaN,o[1]=Ge(r,He(d[0],d[2],_),s,e),isNaN(o[1][0])||isNaN(o[1][1])||(u=re(o[1],r,!1),g=u.distance),!isNaN(g)&&g>s&&Ie(o[1],r))m=!0,h[1]=g,l[1]=gt(o[1],a);else if(!isNaN(g)&&g>p&&(p=g,f[0]=o[1][0],f[1]=o[1][1]),_-=.01,_<.1){if(!(p>=0))break;m=!0,h[1]=p,o[1][0]=f[0],o[1][1]=f[1],l[1]=gt(o[1],a)}while(!m);m=!1,_=.5,p=-1;let y=.01,P=1;do if(g=NaN,o[2]=Ge(r,He(d[0],d[2],_),s,e),isNaN(o[2][0])||isNaN(o[2][1])||(u=re(o[2],r,!1),g=u.distance),!isNaN(g)&&g>s&&Ie(o[2],r))m=!0,h[2]=g,l[2]=gt(o[2],a);else if(!isNaN(g)&&g>p)p=g,f[0]=o[2][0],f[1]=o[2][1];else if(g>p&&(p=g,f[0]=o[2][0],f[1]=o[2][1]),_=.5+y*P,y+=.01,P*=-1,_<.3||_>.7){if(!(p>=0))break;m=!0,h[2]=p,o[2][0]=f[0],o[2][1]=f[1],l[2]=gt(o[2],a)}while(!m);m=!1,_=.75,p=-1;do if(g=NaN,o[3]=Ge(r,He(d[0],d[2],_),s,e),isNaN(o[3][0])||isNaN(o[3][1])||(u=re(o[3],r,!1),g=u.distance),!isNaN(g)&&g>s&&Ie(o[3],r))m=!0,h[3]=g,l[3]=gt(o[3],a);else if(g>p&&(p=g,f[0]=o[3][0],f[1]=o[3][1]),_+=.01,_>.9){if(!(p>=0))break;m=!0,h[3]=p,o[3][0]=f[0],o[3][1]=f[1],l[3]=gt(o[3],a)}while(!m);const x=[0,1,2,3],M=c?0:1;let k;for(let b=M;b<4;b++)for(let w=M;w<3;w++){const N=l[w],H=l[w+1];Yr(N,H)>0&&(k=x[w],x[w]=x[w+1],x[w+1]=k,l[w]=H,l[w+1]=N)}let v=M,T=0,L=0;for(let b=M;b<4;b++){switch(b){case 0:L=2*h[x[b]];break;case 1:L=1.66666666*h[x[b]];break;case 2:L=1.33333333*h[x[b]];break;case 3:L=h[x[b]]}L>T&&(T=L,v=x[b])}return o[v]}function Ie(r,t){const{rings:e}=t;let s=0;for(const i of e){const n=i.length;for(let a=1;ar[1]!=h[1]>r[1]&&((h[0]-o[0])*(r[1]-o[1])-(h[1]-o[1])*(r[0]-o[0])>0?s++:s--)}}return s!==0}function re(r,t,e){if(e&&Ie(r,t))return{coord:r,distance:0};let s=1/0,i=0,n=0;const a=[0,0],{rings:o}=t;for(const h of o)if(!(h.length<2))for(let l=0;la?yu)s&bs?(s&Ce?(t[1]+=u*(n-t[0])/c,t[0]=n):(t[1]+=u*(o-t[0])/c,t[0]=o),s=j(t,r)):i&bs?(i&Ce?(e[1]+=u*(n-e[0])/c,e[0]=n):(e[1]+=u*(o-e[0])/c,e[0]=o),i=j(e,r)):s?(s&we?(t[0]+=c*(a-t[1])/u,t[1]=a):(t[0]+=c*(h-t[1])/u,t[1]=h),s=j(t,r)):(i&we?(e[0]+=c*(a-e[1])/u,e[1]=a):(e[0]+=c*(h-e[1])/u,e[1]=h),i=j(e,r));else if(s&Ms?(s&we?(t[0]+=c*(a-t[1])/u,t[1]=a):(t[0]+=c*(h-t[1])/u,t[1]=h),s=j(t,r)):i&Ms?(i&we?(e[0]+=c*(a-e[1])/u,e[1]=a):(e[0]+=c*(h-e[1])/u,e[1]=h),i=j(e,r)):s?(s&Ce?(t[1]+=u*(n-t[0])/c,t[0]=n):(t[1]+=u*(o-t[0])/c,t[0]=o),s=j(t,r)):(i&Ce?(e[1]+=u*(n-e[0])/c,e[0]=n):(e[1]+=u*(o-e[0])/c,e[0]=o),i=j(e,r)),s&i)return 0}while(s|i);return l}function j(r,t){return(r[0]t[2]?1:0)<<1|(r[1]t[3]?1:0)<<3}function He(r,t,e){return r+(t-r)*e}function gt(r,t){return(r[0]-t[0])*(r[0]-t[0])+(r[1]-t[1])*(r[1]-t[1])}function Yr(r,t){if(rt)return 1;if(r===t)return 0;const e=isNaN(r),s=isNaN(t);return es?1:0}class Ut{constructor(t,e,s,i){this.x=t,this.y=e,this.cellSize=s,this.distancefromCellCenter=Ci(t,e,i),this.maxDistanceToPolygon=this.distancefromCellCenter+this.cellSize*Math.SQRT2}}const Vr=1,Br=100;function Wr(r){if(!r||!r.rings||r.rings.length===0)return null;const t=We(V(),r.rings[0]);if(!t)return null;const e=t[2]-t[0],s=t[3]-t[1];if(e===0||s===0)return[t[0]+e/2,t[1]+s/2];const i=Math.max(Math.min(e,s)/Br,Vr),n=new $r((m,_)=>_.maxDistanceToPolygon-m.maxDistanceToPolygon),a=Math.min(e,s);let o=a/2,h=0,l=0;for(h=t[0];h0;)u=Si(n.dequeue()),u.distancefromCellCenter>f.distancefromCellCenter&&(f=u),u.maxDistanceToPolygon-f.distancefromCellCenter<=i||(o=u.cellSize/2,n.enqueue(new Ut(u.x-o,u.y-o,o,r)),n.enqueue(new Ut(u.x+o,u.y-o,o,r)),n.enqueue(new Ut(u.x-o,u.y+o,o,r)),n.enqueue(new Ut(u.x+o,u.y+o,o,r)));return[f.x,f.y]}function Ur(r){return r.rings!==void 0}class Gt{static local(){return Gt.instance===null&&(Gt.instance=new Gt),Gt.instance}execute(t,e,s,i){return new qr(t,e,s)}}Gt.instance=null;class qr{constructor(t,e,s){this._geometry=t,this._offsetX=e.offsetX!==void 0?e.offsetX*s:0,this._offsetY=e.offsetY!==void 0?e.offsetY*s:0,this._method=e.method!==void 0?e.method:ye.OnPolygon,this._internalPlacement=new te}next(){const t=this._geometry;return this._geometry=null,t&&Ur(t)?this._polygonCenter(t):null}_polygonCenter(t){let e=!1;switch(this._method){case ye.CenterOfMass:{const s=ki(t);s&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),e=!0)}break;case ye.BoundingBoxCenter:{const s=V();Qt(s,t),s&&(this._internalPlacement.setTranslate((s[2]+s[0])/2+this._offsetX,(s[3]+s[1])/2+this._offsetY),e=!0)}break;case ye.OnPolygon:default:{let s;s=wi("polylabel-placement-enabled")?Wr(t):Hr(t),s!==null&&(this._internalPlacement.setTranslate(s[0]+this._offsetX,s[1]+this._offsetY),e=!0)}}return e?this._internalPlacement:null}}function Qe(r){if(!r)return null;switch(r.type){case"CIMGeometricEffectAddControlPoints":return Pt.local();case"CIMGeometricEffectArrow":return xt.local();case"CIMGeometricEffectBuffer":return bt.local();case"CIMGeometricEffectControlMeasureLine":return Mt.local();case"CIMGeometricEffectCut":return St.local();case"CIMGeometricEffectDashes":return Ct.local();case"CIMGeometricEffectDonut":return wt.local();case"CIMGeometricEffectJog":return kt.local();case"CIMGeometricEffectMove":return vt.local();case"CIMGeometricEffectOffset":return It.local();case"CIMGeometricEffectReverse":return Lt.local();case"CIMGeometricEffectRotate":return Tt.local();case"CIMGeometricEffectScale":return Nt.local();case"CIMGeometricEffectWave":return At.local()}return null}function Jr(r){if(!r)return null;switch(r.type){case"CIMMarkerPlacementAlongLineSameSize":return zt.local();case"CIMMarkerPlacementAtExtremities":return Ot.local();case"CIMMarkerPlacementAtRatioPositions":return Rt.local();case"CIMMarkerPlacementInsidePolygon":return Et.local();case"CIMMarkerPlacementOnLine":return $t.local();case"CIMMarkerPlacementOnVertices":return Ft.local();case"CIMMarkerPlacementPolygonCenter":return Gt.local()}return null}function De(r){const t=r.getFrame(0);if(t instanceof HTMLImageElement||t instanceof HTMLCanvasElement)return t;const e=document.createElement("canvas");e.width=r.width,e.height=r.height;const s=e.getContext("2d");return t instanceof ImageData?s.putImageData(t,0,0):s.drawImage(t,0,0),e}class ti{constructor(t=0,e=0,s=0,i=0){this.x=t,this.y=e,this.width=s,this.height=i}get isEmpty(){return this.width<=0||this.height<=0}union(t){this.x=Math.min(this.x,t.x),this.y=Math.min(this.y,t.y),this.width=Math.max(this.width,t.width),this.height=Math.max(this.height,t.height)}}function jr(r){return`rgb(${r.slice(0,3).toString()})`}function Kr(r){return`rgba(${r.slice(0,3).toString()},${r[3]})`}class ei{constructor(t){t&&(this._textRasterizationCanvas=t)}rasterizeText(t,e){var T;this._textRasterizationCanvas||(this._textRasterizationCanvas=document.createElement("canvas"));const s=this._textRasterizationCanvas,i=s.getContext("2d");this._setFontProperties(i,e),this._parameters=e,this._textLines=t.split(/\r?\n/),this._lineHeight=this._computeLineHeight();const n=this._computeTextWidth(i,e),{decoration:a,weight:o}=e.font;this._lineThroughWidthOffset=a&&a==="line-through"?.1*this._lineHeight:0;const h=this._lineHeight*this._textLines.length;s.width=n+2*this._lineThroughWidthOffset,s.height=h,this._renderedLineHeight=Math.round(this._lineHeight*e.pixelRatio),this._renderedHaloSize=e.halo.size*e.pixelRatio,this._renderedWidth=n*e.pixelRatio,this._renderedHeight=h*e.pixelRatio,this._lineThroughWidthOffset*=e.pixelRatio;const l=(T=e.color)!=null?T:[0,0,0,0],c=e.halo&&e.halo.color?e.halo.color:[0,0,0,0];this._fillStyle=Kr(l),this._haloStyle=jr(c);const u=this._renderedLineHeight,f=this._renderedHaloSize;i.save(),i.clearRect(0,0,s.width,s.height),this._setFontProperties(i,e);const m=Zr(i.textAlign,this._renderedWidth)+f,_=f,p=f>0;let d=this._lineThroughWidthOffset,g=0;p&&this._renderHalo(i,m,_,d,g,e),g+=_,d+=m;for(const L of this._textLines)p?(i.globalCompositeOperation="destination-out",i.fillStyle="rgb(0, 0, 0)",i.fillText(L,d,g),i.globalCompositeOperation="source-over",i.fillStyle=this._fillStyle,i.fillText(L,d,g)):(i.fillStyle=this._fillStyle,i.fillText(L,d,g)),a&&a!=="none"&&this._renderDecoration(i,d,g,a,o),g+=u;i.restore();const y=this._renderedWidth+2*this._lineThroughWidthOffset,P=this._renderedHeight,x=i.getImageData(0,0,y,P),M=new Uint8Array(x.data);if(e.premultiplyColors){let L;for(let b=0;b600)&&(s+=.3*t.measureText("w").width),s+=2*this._parameters.halo.size,Math.round(s)}_computeLineHeight(){let t=1.275*this._parameters.size;const e=this._parameters.font.decoration;return e&&e==="underline"&&(t*=1.3),Math.round(t+2*this._parameters.halo.size)}_renderDecoration(t,e,s,i,n,a){const o=.9*this._lineHeight,h=n==="bold"?.06:n==="bolder"?.09:.04;switch(t.textAlign){case"center":e-=this._renderedWidth/2;break;case"right":e-=this._renderedWidth}const l=t.textBaseline;if(i==="underline")switch(l){case"top":s+=o;break;case"middle":s+=o/2}else if(i==="line-through")switch(l){case"top":s+=o/1.5;break;case"middle":s+=o/3}const c=a?1.5*a:Math.ceil(o*h);t.save(),t.beginPath(),t.strokeStyle=t.fillStyle,t.lineWidth=c,t.moveTo(e-this._lineThroughWidthOffset,s),t.lineTo(e+this._renderedWidth+2*this._lineThroughWidthOffset,s),t.stroke(),t.restore()}}function Zr(r,t){return r==="center"?.5*t:r==="right"?t:0}class Ht{constructor(t,e,s,i){this.center=vi(t,e),this.centerT=Ue(),this.halfWidth=s/2,this.halfHeight=i/2,this.width=s,this.height=i}get x(){return this.center[0]}get y(){return this.center[1]}get blX(){return this.center[0]+this.halfWidth}get blY(){return this.center[1]+this.halfHeight}get trX(){return this.center[0]-this.halfWidth}get trY(){return this.center[1]-this.halfHeight}get xmin(){return this.x-this.halfWidth}get xmax(){return this.x+this.halfWidth}get ymin(){return this.y-this.halfHeight}get ymax(){return this.y+this.halfHeight}set x(t){this.center[0]=t}set y(t){this.center[1]=t}clone(){return new Ht(this.x,this.y,this.width,this.height)}serialize(t){return t.writeF32(this.center[0]),t.writeF32(this.center[1]),t.push(this.width),t.push(this.height),t}findCollisionDelta(t,e=4){const s=Math.abs(t.centerT[0]-this.centerT[0]),i=Math.abs(t.centerT[1]-this.centerT[1]),n=(t.halfWidth+this.halfWidth+e)/s,a=(t.halfHeight+this.halfHeight+e)/i,o=Math.min(n,a);return Math.log2(o)}extend(t){const e=Math.min(this.xmin,t.xmin),s=Math.min(this.ymin,t.ymin),i=Math.max(this.xmax,t.xmax)-e,n=Math.max(this.ymax,t.ymax)-s,a=e+i/2,o=s+n/2;this.width=i,this.height=n,this.halfWidth=i/2,this.halfHeight=n/2,this.x=a,this.y=o}static deserialize(t){const e=t.readF32(),s=t.readF32(),i=t.readInt32(),n=t.readInt32();return new Ht(e,s,i,n)}}const ns=26,si=4,Qr=ns+si,tn=ns-6,Ss=3,ht=8,en=Math.PI/180;class ii{constructor(t,e,s,i){this._rotationT=oe(),this._xBounds=0,this._yBounds=0,this.minZoom=0,this.maxZoom=255,this._bounds=null;const n=s.rect,a=new Float32Array(8);t*=i,e*=i;const o=s.code?n.width*i:s.metrics.width,h=s.code?n.height*i:s.metrics.height;a[0]=t,a[1]=e,a[2]=t+o,a[3]=e,a[4]=t,a[5]=e+h,a[6]=t+o,a[7]=e+h,this._data=a,this._setTextureCoords(n),this._scale=i,this._mosaic=s,this.x=t,this.y=e,this.maxOffset=Math.max(t+o,e+h)}get width(){return this._mosaic.metrics.width*this._scale}get mosaic(){return this._mosaic}set angle(t){this._angle=t,Es(this._rotationT,-t),this._setOffsets(this._data)}get angle(){return this._angle}get xTopLeft(){return this._data[0]}get yTopLeft(){return this._data[1]}get xBottomRight(){return this._data[6]}get yBottomRight(){return this._data[7]}get texcoords(){return this._texcoords}get textureBinding(){return this._mosaic.textureBinding}get offsets(){return this._offsets||this._setOffsets(this._data),this._offsets}get char(){return String.fromCharCode(this._mosaic.code)}get code(){return this._mosaic.code}get bounds(){if(!this._bounds){const{height:t,width:e}=this._mosaic.metrics,s=e*this._scale,i=Math.abs(t)*this._scale,n=new Float32Array(8);n[0]=this.x,n[1]=this.y,n[2]=this.x+s,n[3]=this.y,n[4]=this.x,n[5]=this.y+i,n[6]=this.x+s,n[7]=this.y+i;const a=qe(oe(),this._rotationT,this._transform);fs(n,n,a);let o=1/0,h=1/0,l=0,c=0;for(let p=0;p<4;p++){const d=n[2*p],g=n[2*p+1];o=Math.min(o,d),h=Math.min(h,g),l=Math.max(l,d),c=Math.max(c,g)}const u=l-o,f=c-h,m=o+u/2,_=h+f/2;this._bounds=new Ht(m,_,u,f)}return this._bounds}setTransform(t){this._transform=t,this._offsets=null}_setOffsets(t){this._offsets||(this._offsets={upperLeft:0,upperRight:0,lowerLeft:0,lowerRight:0});const e=this._offsets,s=new Float32Array(8),i=qe(oe(),this._rotationT,this._transform);fs(s,t,i),e.upperLeft=ot(s[0]*ht,s[1]*ht),e.upperRight=ot(s[2]*ht,s[3]*ht),e.lowerLeft=ot(s[4]*ht,s[5]*ht),e.lowerRight=ot(s[6]*ht,s[7]*ht)}_setTextureCoords({x:t,y:e,width:s,height:i}){this._texcoords={upperLeft:ot(t,e),upperRight:ot(t+s,e),lowerLeft:ot(t,e+i),lowerRight:ot(t+s,e+i)}}}const sn=(r,t)=>({code:0,page:0,sdf:!0,rect:new Yi(0,0,11,8),textureBinding:t,metrics:{advance:0,height:4,width:r,left:0,top:0}});class rn{constructor(t,e,s){this._rotation=0,this._decorate(t,e,s),this.glyphs=t,this.bounds=this._createBounds(t),this.isMultiline=e.length>1,this._hasRotation=s.angle!==0,this._transform=this._createGlyphTransform(this.bounds,s);for(const i of t)i.setTransform(this._transform)}setRotation(t){if(t===0&&this._rotation===0)return;this._rotation=t;const e=this._transform,s=Es(oe(),t);qe(e,s,e);for(const i of this.glyphs)i.setTransform(this._transform)}_decorate(t,e,s){if(!s.decoration||s.decoration==="none"||!t.length)return;const i=s.scale,n=s.decoration==="underline"?Qr:tn,a=t[0].textureBinding;for(const o of e){const h=o.startX*i,l=o.startY*i,c=(o.width+o.glyphWidthEnd)*i;t.push(new ii(h,l+n*i,sn(c,a),1))}}get boundsT(){const t=this.bounds,e=_e(Ue(),t.x,t.y);if(Ii(e,e,this._transform),this._hasRotation){const s=Math.max(t.width,t.height);return new Ht(e[0],e[1],s,s)}return new Ht(e[0],e[1],t.width,t.height)}_createBounds(t){let e=1/0,s=1/0,i=0,n=0;for(const h of t)e=Math.min(e,h.xTopLeft),s=Math.min(s,h.yTopLeft),i=Math.max(i,h.xTopLeft+h.width),n=Math.max(n,h.yBottomRight);const a=i-e,o=n-s;return new Ht(e+a/2,s+o/2,a,o)}_createGlyphTransform(t,e){const s=en*e.angle,i=oe(),n=Ue();return ze(i,i,_e(n,e.xOffset,-e.yOffset)),e.isCIM?ms(i,i,s):(ze(i,i,_e(n,t.x,t.y)),ms(i,i,s),ze(i,i,_e(n,-t.x,-t.y))),i}}class ke{constructor(t,e,s,i,n,a){this.glyphWidthEnd=0,this.startX=0,this.startY=0,this.start=Math.max(0,Math.min(e,s)),this.end=Math.max(0,Math.max(e,s)),this.endr===10,Cs=r=>r===32;function nn(r,t,e){const s=new Array,i=1/e.scale,n=e.maxLineWidth*i,a=t?r.length-1:0,o=t?-1:r.length,h=t?-1:1;let l=a,c=0,u=0,f=l,m=f,_=0,p=1/0,d=0;for(;l!==o;){const{code:y,metrics:P}=r[l],x=Math.abs(P.top);if(ts(y)||Cs(y)||(p=Math.min(p,x),d=Math.max(d,x+P.height)),ts(y))l!==a&&(s.push(new ke(r,f,l-h,c,p,d)),p=1/0,d=0),c=0,f=l+h,m=l+h,u=0;else if(Cs(y))m=l+h,u=0,_=P.advance,c+=P.advance;else if(c>n){if(m!==f){const M=m-2*h;c-=_,s.push(new ke(r,f,M,c-u,p,d)),p=1/0,d=0,f=m,c=u}else s.push(new ke(r,f,l-h,c,p,d)),p=1/0,d=0,f=l,m=l,c=0;c+=P.advance,u+=P.advance}else c+=P.advance,u+=P.advance;l+=h}const g=new ke(r,f,l-h,c,p,d);return g.start>=0&&g.end1}back(){return this._transfos[this._transfos.length-1]}push(t,e){const s=e?t.scaleRatio():1;F.multiply(t,this.back(),t),this._transfos.push(t),this._sizeTransfos.push(this._sizeTransfos[this._sizeTransfos.length-1]*s)}pop(){this._transfos.splice(-1,1),this._sizeTransfos.splice(-1,1)}drawSymbol(t,e,s){if(t)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":this.drawMultiLayerSymbol(t,e);break;case"CIMTextSymbol":this.drawTextSymbol(t,e,s)}}drawMultiLayerSymbol(t,e){if(!t)return;const s=t.symbolLayers;if(!s)return;const i=t.effects;if(i&&i.length>0){const n=this.executeEffects(i,e);if(n){let a=n.next();for(;a;)this.drawSymbolLayers(s,a),a=n.next()}}else this.drawSymbolLayers(s,e)}executeEffects(t,e){const s=this._resourceManager.geometryEngine;let i=new je(e);for(const n of t){const a=Qe(n);a&&(i=a.execute(i,n,this.geomUnitsPerPoint(),s))}return i}drawSymbolLayers(t,e){let s=t.length;for(;s--;){const i=t[s];if(!i||i.enable===!1)continue;const n=i.effects;if(n&&n.length>0){const a=this.executeEffects(n,e);if(a){let o=null;for(;(o=a.next())&&(this.drawSymbolLayer(i,o),!this._earlyReturn););}}else this.drawSymbolLayer(i,e);if(this._earlyReturn)return}}drawSymbolLayer(t,e){switch(t.type){case"CIMSolidFill":this.drawSolidFill(e,t.color);break;case"CIMHatchFill":this.drawHatchFill(e,t);break;case"CIMPictureFill":this.drawPictureFill(e,t);break;case"CIMGradientFill":this.drawGradientFill(e,t);break;case"CIMSolidStroke":this.drawSolidStroke(e,t.color,t.width,t.capStyle,t.joinStyle,t.miterLimit);break;case"CIMPictureStroke":this.drawPictureStroke(e,t);break;case"CIMGradientStroke":this.drawGradientStroke(e,t);break;case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":this.drawMarkerLayer(t,e)}}drawHatchFill(t,e){const s=this._buildHatchPolyline(e,t,this.geomUnitsPerPoint());s&&(this.pushClipPath(t),this.drawMultiLayerSymbol(e.lineSymbol,s),this.popClipPath())}drawPictureFill(t,e){}drawGradientFill(t,e){}drawPictureStroke(t,e){}drawGradientStroke(t,e){}drawMarkerLayer(t,e){const s=t.markerPlacement;if(s){const i=Jr(s);if(i){const n=s.type==="CIMMarkerPlacementInsidePolygon"||s.type==="CIMMarkerPlacementPolygonCenter"&&s.clipAtBoundary;n&&this.pushClipPath(e);const a=i.execute(e,s,this.geomUnitsPerPoint(),this._resourceManager.geometryEngine);if(a){let o=null;for(;(o=a.next())&&(this.drawMarker(t,o),!this._earlyReturn););}n&&this.popClipPath()}}else{const i=this._placementPool.acquire();if(ut(e))i.tx=e.x,i.ty=e.y,this.drawMarker(t,i);else if(z(e))[i.tx,i.ty]=Ni(e),this.drawMarker(t,i);else for(const n of e.points)if(i.tx=n[0],i.ty=n[1],this.drawMarker(t,i),this._earlyReturn)break;this._placementPool.release(i)}}drawMarker(t,e){switch(t.type){case"CIMCharacterMarker":case"CIMPictureMarker":this.drawPictureMarker(t,e);break;case"CIMVectorMarker":this.drawVectorMarker(t,e)}}drawPictureMarker(t,e){var d,g,y,P,x;if(!t)return;const s=this._resourceManager.getResource(t.url),i=(d=t.size)!=null?d:10;if(at(s)||i<=0)return;const n=s.width,a=s.height;if(!n||!a)return;const o=n/a,h=(g=t.scaleX)!=null?g:1,l=F.createIdentity(),c=t.anchorPoint;if(c){let M=c.x,k=c.y;t.anchorPointUnits!=="Absolute"&&(M*=i*o*h,k*=i),l.translate(-M,-k)}let u=(y=t.rotation)!=null?y:0;t.rotateClockwise&&(u=-u),this._mapRotation&&(u+=this._mapRotation),u&&l.rotate(u*dt);let f=(P=t.offsetX)!=null?P:0,m=(x=t.offsetY)!=null?x:0;if(f||m){if(this._mapRotation){const M=dt*this._mapRotation,k=Math.cos(M),v=Math.sin(M),T=f*v+m*k;f=f*k-m*v,m=T}l.translate(f,m)}const _=this.geomUnitsPerPoint();_!==1&&l.scale(_,_);const p=e.getAngle();p&&l.rotate(p),l.translate(e.tx,e.ty),this.push(l,!1),this.drawImage(t,i),this.pop()}drawVectorMarker(t,e){var p,d,g,y;if(!t)return;const s=t.markerGraphics;if(!s)return;const i=(p=t.size)!=null?p:10,n=t.frame,a=n?n.ymax-n.ymin:0,o=i&&a?i/a:1,h=F.createIdentity();n&&h.translate(.5*-(n.xmax+n.xmin),.5*-(n.ymax+n.ymin));const l=t.anchorPoint;if(l){let P=l.x,x=l.y;t.anchorPointUnits!=="Absolute"?n&&(P*=n.xmax-n.xmin,x*=n.ymax-n.ymin):(P/=o,x/=o),h.translate(-P,-x)}o!==1&&h.scale(o,o);let c=(d=t.rotation)!=null?d:0;t.rotateClockwise&&(c=-c),this._mapRotation&&(c+=this._mapRotation),c&&h.rotate(c*dt);let u=(g=t.offsetX)!=null?g:0,f=(y=t.offsetY)!=null?y:0;if(u||f){if(this._mapRotation){const P=dt*this._mapRotation,x=Math.cos(P),M=Math.sin(P),k=u*M+f*x;u=u*x-f*M,f=k}h.translate(u,f)}const m=this.geomUnitsPerPoint();m!==1&&h.scale(m,m);const _=e.getAngle();_&&h.rotate(_),h.translate(e.tx,e.ty),this.push(h,t.scaleSymbolsProportionally);for(const P of s)if(P&&P.symbol&&P.geometry||ni.error("Invalid marker graphic",P),this.drawSymbol(P.symbol,P.geometry,P.textString),this._earlyReturn)break;this.pop()}drawTextSymbol(t,e,s){var l,c,u,f;if(!t||!ut(e)||((l=t.height)!=null?l:10)<=0)return;const i=F.createIdentity();let n=(c=t.angle)!=null?c:0;n=-n,n&&i.rotate(n*dt);const a=(u=t.offsetX)!=null?u:0,o=(f=t.offsetY)!=null?f:0;(a||o)&&i.translate(a,o);const h=this.geomUnitsPerPoint();h!==1&&i.scale(h,h),i.translate(e.x,e.y),this.push(i,!1),this.drawText(t,s),this.pop()}_buildHatchPolyline(t,e,s){let i=(t.separation!==void 0?t.separation:4)*s,n=t.rotation!==void 0?t.rotation:0;if(i===0)return null;i<0&&(i=-i);let a=0;const o=.5*i;for(;a>o;)a-=i;for(;a<-o;)a+=i;const h=V();Qt(h,e),h[0]-=o,h[1]-=o,h[2]+=o,h[3]+=o;const l=[[h[0],h[1]],[h[0],h[3]],[h[2],h[3]],[h[2],h[1]]];for(;n>180;)n-=180;for(;n<0;)n+=180;const c=Math.cos(n*dt),u=Math.sin(n*dt),f=-i*u,m=i*c;let _,p,d,g;a=(t.offsetX!==void 0?t.offsetX*s:0)*u-(t.offsetY!==void 0?t.offsetY*s:0)*c,_=d=Number.MAX_VALUE,p=g=-Number.MAX_VALUE;for(const T of l){const L=T[0],b=T[1],w=c*L+u*b,N=-u*L+c*b;_=Math.min(_,w),d=Math.min(d,N),p=Math.max(p,w),g=Math.max(g,N)}d=Math.floor(d/i)*i;let y=c*_-u*d-f*a/i,P=u*_+c*d-m*a/i,x=c*p-u*d-f*a/i,M=u*p+c*d-m*a/i;const k=1+Math.round((g-d)/i),v=[];for(let T=0;T0))if(z(t))this._processPath(t.rings,0);else if(O(t))this._processPath(t.paths,0);else if($(t)){const e=yt(t);e&&this._processPath(e.rings,0)}else console.error("drawSolidFill Unexpected geometry type!")}drawSolidStroke(t,e,s){if(!t||this._clipCount>0)return;const i=.5*this.transformSize(s);if(z(t))this._processPath(t.rings,i);else if(O(t))this._processPath(t.paths,i);else if($(t)){const n=yt(t);n&&this._processPath(n.rings,i)}else console.error("drawSolidStroke unexpected geometry type!")}drawMarkerLayer(t,e){z(e)&&t.markerPlacement&&(t.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||t.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&t.markerPlacement.clipAtBoundary)?this._processPath(e.rings,0):super.drawMarkerLayer(t,e)}drawHatchFill(t,e){this.drawSolidFill(t)}drawPictureFill(t,e){this.drawSolidFill(t)}drawGradientFill(t,e){this.drawSolidFill(t)}drawPictureStroke(t,e){this.drawSolidStroke(t,null,e.width)}drawGradientStroke(t,e){this.drawSolidStroke(t,null,e.width)}pushClipPath(t){this.drawSolidFill(t),this._clipCount++}popClipPath(){this._clipCount--}drawImage(t,e){var h;const{url:s}=t,i=(h=t.scaleX)!=null?h:1;let n=i*e,a=e;const o=this._resourceManager.getResource(s);!e&&q(o)&&(n=i*o.width,a=o.height),this._merge(this.transformPt([-n/2,-a/2]),0),this._merge(this.transformPt([-n/2,a/2]),0),this._merge(this.transformPt([n/2,-a/2]),0),this._merge(this.transformPt([n/2,a/2]),0)}drawText(t,e){if(!e||e.length===0)return;this._textRasterizer||(this._textRasterizer=new ei);const s=li(t),[i,n]=this._textRasterizer.computeTextSize(e,s);let a=0;switch(t.horizontalAlignment){case"Left":a=i/2;break;case"Right":a=-i/2}let o=0;switch(t.verticalAlignment){case"Bottom":o=n/2;break;case"Top":o=-n/2;break;case"Baseline":o=n/6}this._merge(this.transformPt([-i/2+a,-n/2+o]),0),this._merge(this.transformPt([-i/2+a,n/2+o]),0),this._merge(this.transformPt([i/2+a,-n/2+o]),0),this._merge(this.transformPt([i/2+a,n/2+o]),0)}_processPath(t,e){if(t)for(const s of t){const i=s?s.length:0;if(i>1){this._merge(this.transformPt(s[0]),e);for(let n=1;nthis._xmax&&(this._xmax=t[0]+e),t[1]-ethis._ymax&&(this._ymax=t[1]+e)}}class Pa extends as{constructor(){super(...arguments),this._searchPoint=[0,0],this._searchDistPoint=0}hitTest(t,e,s,i,n,a){const o=a*Kt(1);this.setTransform(),this.setGeomUnitsPerPoint(o),this._searchPoint=[(t[0]+t[2])/2,(t[1]+t[3])/2],this._searchDistPoint=(t[2]-t[0])/2/o,this._textInfo=i;const h=e&&(e.type==="CIMPointSymbol"&&e.angleAlignment!=="Map"||e.type==="CIMTextSymbol");return this._mapRotation=h?n:0,this._earlyReturn=!1,this.drawSymbol(e,s),this._earlyReturn}drawSolidFill(t,e){this._hitTestFill(t)}drawHatchFill(t,e){this._hitTestFill(t)}drawPictureFill(t,e){this._hitTestFill(t)}drawGradientFill(t,e){this._hitTestFill(t)}drawSolidStroke(t,e,s,i,n,a){this._hitTestStroke(t,s)}drawPictureStroke(t,e){this._hitTestStroke(t,e.width)}drawGradientStroke(t,e){this._hitTestStroke(t,e.width)}drawMarkerLayer(t,e){t.markerPlacement&&(t.markerPlacement.type==="CIMMarkerPlacementInsidePolygon"||t.markerPlacement.type==="CIMMarkerPlacementPolygonCenter"&&t.markerPlacement.clipAtBoundary)?this._hitTestFill(e):super.drawMarkerLayer(t,e)}pushClipPath(t){}popClipPath(){}drawImage(t,e){var c;const{url:s}=t,i=(c=t.scaleX)!=null?c:1,n=this._resourceManager.getResource(s);if(at(n)||n.height===0||e===0)return;const a=e*this.geomUnitsPerPoint(),o=a*i*(n.width/n.height),h=this.reverseTransformPt(this._searchPoint),l=this._searchDistPoint;Math.abs(h[0])g.xTopLeft&&m-g.yBottomRight&&_<-g.yTopLeft){this._earlyReturn=!0;break}}_hitTestFill(t){let e=null;if($(t)){const i=t;e=[[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]]]}else if(z(t))e=t.rings;else{if(!O(t))return;e=t.paths}const s=this.reverseTransformPt(this._searchPoint);if(this._pointInPolygon(s,e)&&(this._earlyReturn=!0),!this._earlyReturn){const i=this.reverseTransformSize(this._searchDistPoint)*this.geomUnitsPerPoint();this._nearLine(s,e,i)&&(this._earlyReturn=!0)}}_hitTestStroke(t,e){let s=null;if($(t)){const o=t;s=[[[o.xmin,o.ymin],[o.xmin,o.ymax],[o.xmax,o.ymax],[o.xmax,o.ymin],[o.xmin,o.ymin]]]}else if(z(t))s=t.rings;else{if(!O(t))return;s=t.paths}const i=this.reverseTransformPt(this._searchPoint),n=e*this.geomUnitsPerPoint(),a=this.reverseTransformSize(this._searchDistPoint)*this.geomUnitsPerPoint();this._nearLine(i,s,n/2+a)&&(this._earlyReturn=!0)}_pointInPolygon(t,e){let s=0;for(const i of e){const n=i.length;for(let a=1;at[1]!=h[1]>t[1]&&((h[0]-o[0])*(t[1]-o[1])-(h[1]-o[1])*(t[0]-o[0])>0?s++:s--)}}return s!==0}_nearLine(t,e,s){for(const i of e){const n=i.length;for(let a=1;a-s&&u1){let a=this.transformPt(i[0]);s.moveTo(a[0],a[1]);for(let o=1;or?{spatialReference:r.spatialReference,rings:[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]}:null,ai=r=>{switch(r){case"Left":return Pe.Left;case"Right":return Pe.Right;case"Center":return Pe.Center;case"Justify":return ni.warnOnce("Horizontal alignment 'justify' is not implemented. Falling back to 'center'."),Pe.Center}},oi=r=>{switch(r){case"Top":return ae.Top;case"Center":return ae.Center;case"Bottom":return ae.Bottom;case"Baseline":return ae.Baseline}},hi=(r,t,e)=>{switch(r){case"ExtraLeading":return 1+t/e;case"Multiple":return t;case"Exact":return t/e}};function li(r,t=1){const e=Ws(r),s=Bs(r.fontStyleName),i=is(r.fontFamilyName),{weight:n,style:a}=s,o=t*(r.height||5),h=Us(r.horizontalAlignment),l=qs(r.verticalAlignment),c=Dt(r),u=Xt(r.haloSymbol),f=u?t*(0|r.haloSize):0;return{color:c,size:o,horizontalAlignment:h,verticalAlignment:l,font:{family:i,style:er(a),weight:sr(n),decoration:e},halo:{size:f||0,color:u,style:a},pixelRatio:1,premultiplyColors:!0}}const un=1e-4;function fn(r){let t,e,s,i,n,a=r[0],o=1;for(;oUi(s,t,e,i,n);case"esriGeometryPolygon":return(e,s,i,n)=>Wi(s,t,e,i,n);case"esriGeometryPolyline":return(e,s,i,n)=>Bi(s,t,e,i,n);case"esriGeometryMultipoint":return(e,s,i,n)=>Vi(s,t,e,i,n);default:return ce.getLogger("esri.views.2d.support.arcadeOnDemand").error(new Ai("mapview-arcade",`Unable to handle geometryType: ${r}`)),e=>e}}const ci=Math.PI,_n=ci/2,dn=4,gn=10,K=96/72,ws=Math.PI/180,es=ce.getLogger("esri.symbols.cim.CIMSymbolHelper");function xa(r){if(!r||!r.type)return null;let t;switch(r.type){case"cim":return r.data;case"web-style":return r;case"simple-marker":t=U.fromSimpleMarker(r);break;case"picture-marker":t=U.fromPictureMarker(r);break;case"simple-line":t=U.fromSimpleLineSymbol(r);break;case"simple-fill":t=U.fromSimpleFillSymbol(r);break;case"picture-fill":t=U.fromPictureFillSymbol(r);break;case"text":t=U.fromTextSymbol(r)}return{type:"CIMSymbolReference",symbol:t}}function Le(r,t,e){switch(t.type){case"CIMSymbolReference":return Le(r,t.symbol,e);case"CIMPointSymbol":e==null&&(e={x:0,y:0}),r.drawSymbol(t,e);break;case"CIMLineSymbol":e==null&&(e={paths:[[[0,0],[10,0]]]}),r.drawSymbol(t,e);break;case"CIMPolygonSymbol":e==null&&(e={rings:[[[0,0],[0,10],[10,10],[10,0],[0,0]]]}),r.drawSymbol(t,e);break;case"CIMTextSymbol":{const s={x:0,y:0};r.drawSymbol(t,s);break}case"CIMVectorMarker":{const s=new te;r.drawMarker(t,s);break}}return r.envelope()}function yn(r){if(!r)return 0;switch(r.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAtExtremities":case"CIMMarkerPlacementAtMeasuredUnits":case"CIMMarkerPlacementAtRatioPositions":case"CIMMarkerPlacementOnLine":case"CIMMarkerPlacementOnVertices":return Math.abs(r.offset);default:return 0}}function Pn(r){if(!r)return 0;switch(r.type){case"CIMGeometricEffectArrow":return Math.abs(.5*r.width);case"CIMGeometricEffectBuffer":return Math.abs(r.size);case"CIMGeometricEffectExtension":case"CIMGeometricEffectRadial":return Math.abs(r.length);case"CIMGeometricEffectJog":return Math.abs(.5*r.length);case"CIMGeometricEffectMove":return Math.max(Math.abs(C(r.offsetX)),Math.abs(C(r.offsetY)));case"CIMGeometricEffectOffset":case"CIMGeometricEffectOffsetTangent":return Math.abs(r.offset);case"CIMGeometricEffectRegularPolygon":return Math.abs(r.radius);case"CIMGeometricEffectRotate":case"CIMGeometricEffectScale":default:return 0;case"CIMGeometricEffectTaperedPolygon":return .5*Math.max(Math.abs(r.fromWidth),Math.abs(r.toWidth));case"CIMGeometricEffectWave":return Math.abs(r.amplitude)}}function ks(r){if(!r)return 0;let t=0;for(const e of r)t+=Pn(e);return t}class ba{getSymbolInflateSize(t,e,s,i,n){return t||(t=[0,0,0,0]),e?this._getInflateSize(t,e,s,i,n):t}static safeSize(t){const e=Math.max(Math.abs(t[0]),Math.abs(t[2])),s=Math.max(Math.abs(t[1]),Math.abs(t[3]));return Math.sqrt(e*e+s*s)}_vectorMarkerBounds(t,e,s,i){let n=!0;const a=V();if(e&&e.markerGraphics)for(const o of e.markerGraphics){const h=[0,0,0,0];o.geometry&&(Qt(a,o.geometry),h[0]=0,h[1]=0,h[2]=0,h[3]=0,this.getSymbolInflateSize(h,o.symbol,s,0,i),a[0]+=h[0],a[1]+=h[1],a[2]+=h[2],a[3]+=h[3],n?(t[0]=a[0],t[1]=a[1],t[2]=a[2],t[3]=a[3],n=!1):(t[0]=Math.min(t[0],a[0]),t[1]=Math.min(t[1],a[1]),t[2]=Math.max(t[2],a[2]),t[3]=Math.max(t[3],a[3])))}return t}_getInflateSize(t,e,s,i,n){if(wn(e)){const a=this._getLayersInflateSize(t,e.symbolLayers,s,i,n),o=ks(e.effects);return o>0&&(a[0]-=o,a[1]-=o,a[2]+=o,a[3]+=o),a}return this._getTextInflatedSize(t,e,n)}_getLayersInflateSize(t,e,s,i,n){let a=!0;if(!e)return t;for(const o of e){if(!o)continue;let h=[0,0,0,0];switch(o.type){case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const c=o;let u=c.width;c.capStyle===rt.Square||c.joinStyle===nt.Miter?u/=1.4142135623730951:u/=2,h[0]=-u,h[1]=-u,h[2]=u,h[3]=u;break}case"CIMCharacterMarker":case"CIMVectorMarker":case"CIMPictureMarker":{const c=o;if(o.type==="CIMVectorMarker"){const p=o;if(h=this._vectorMarkerBounds(h,p,s,n),p.frame){const d=(p.frame.xmin+p.frame.xmax)/2,g=(p.frame.ymin+p.frame.ymax)/2;h[0]-=d,h[1]-=g,h[2]-=d,h[3]-=g;const y=p.size/(p.frame.ymax-p.frame.ymin);h[0]*=y,h[1]*=y,h[2]*=y,h[3]*=y}}else if(o.type==="CIMPictureMarker"){const p=o,d=s.getResource(p.url);let g=1;q(d)&&d.height&&(g=d.width/d.height);const y=c.size/2,P=c.size*g*p.scaleX/2;h=[-P,-y,P,y]}else{const p=c.size/2;h=[-p,-p,p,p]}if(c.anchorPoint){let p,d;c.anchorPointUnits==="Absolute"?(p=c.anchorPoint.x,d=c.anchorPoint.y):(p=c.anchorPoint.x*(h[2]-h[0]),d=c.anchorPoint.y*(h[3]-h[1])),h[0]-=p,h[1]-=d,h[2]-=p,h[3]-=d}let u=C(c.rotation);if(c.rotateClockwise&&(u=-u),i&&(u-=i),u){const p=ws*u,d=Math.cos(p),g=Math.sin(p),y=V([be,be,-be,-be]);de(y,[h[0]*d-h[1]*g,h[0]*g+h[1]*d]),de(y,[h[0]*d-h[3]*g,h[0]*g+h[3]*d]),de(y,[h[2]*d-h[1]*g,h[2]*g+h[1]*d]),de(y,[h[2]*d-h[3]*g,h[2]*g+h[3]*d]),h=y}let f=C(c.offsetX),m=C(c.offsetY);if(i){const p=ws*i,d=Math.cos(p),g=Math.sin(p),y=f*g+m*d;f=f*d-m*g,m=y}h[0]+=f,h[1]+=m,h[2]+=f,h[3]+=m;const _=yn(c.markerPlacement);_>0&&(h[0]-=_,h[1]-=_,h[2]+=_,h[3]+=_);break}}const l=ks(o.effects);l>0&&(h[0]-=l,h[1]-=l,h[2]+=l,h[3]+=l),a?(t[0]=h[0],t[1]=h[1],t[2]=h[2],t[3]=h[3],a=!1):(t[0]=Math.min(t[0],h[0]),t[1]=Math.min(t[1],h[1]),t[2]=Math.max(t[2],h[2]),t[3]=Math.max(t[3],h[3]))}return t}_getTextInflatedSize(t,e,s){var f,m;const i=(f=e.height)!=null?f:gn;if(t[0]=-i/2,t[1]=-i/2,t[2]=i/2,t[3]=i/2,!s)return t;const n=s.get(e);if(!n)return t;const{text:a,mosaicItem:o}=n;if(!o||o.glyphMosaicItems.length===0)return t;const h=hi(e.lineGapType,(m=e.lineGap)!=null?m:0,i),l=rs(a)[1],c=o.glyphMosaicItems,u=ri(c,l,{scale:i/Fs,angle:C(e.angle),xOffset:C(e.offsetX),yOffset:C(e.offsetY),hAlign:ai(e.horizontalAlignment),vAlign:oi(e.verticalAlignment),maxLineWidth:512,lineHeight:Gs*Math.max(.25,Math.min(h||1,4)),decoration:e.font.decoration||"none",isCIM:!0}).boundsT;return t[0]=u.x-u.halfWidth,t[1]=-u.y-u.halfHeight,t[2]=u.x+u.halfWidth,t[3]=-u.y+u.halfHeight,t}}class U{static getEnvelope(t,e,s){const i=new hn(s);if(Array.isArray(t)){let n;for(const a of t)n?n.union(Le(i,a,e)):n=Le(i,a,e);return n}return Le(i,t,e)}static getTextureAnchor(t,e){const s=this.getEnvelope(t,null,e);if(!s)return[0,0,0];const i=(s.x+.5*s.width)*K,n=(s.y+.5*s.height)*K,a=s.width*K+2,o=s.height*K+2;return[-i/a,-n/o,o]}static rasterize(t,e,s,i,n=!0){const a=s||this.getEnvelope(e,null,i);if(!a)return[null,0,0,0,0];const o=(a.x+.5*a.width)*K,h=(a.y+.5*a.height)*K;t.width=a.width*K,t.height=a.height*K,s||(t.width+=2,t.height+=2);const l=t.getContext("2d"),c=F.createScale(K,-K);c.translate(.5*t.width-o,.5*t.height+h);const u=new ln(l,i,c);switch(e.type){case"CIMPointSymbol":{const _={type:"point",x:0,y:0};u.drawSymbol(e,_);break}case"CIMVectorMarker":{const _=new te;u.drawMarker(e,_);break}}const f=l.getImageData(0,0,t.width,t.height),m=new Uint8Array(f.data);if(n){let _;for(let p=0;p.667?Kt(Math.round(qt(f.width))):f.width,color:W(f.color)})}else!e||t.type!=="line-marker"||t.style!=="cross"&&t.style!=="x"||c.push({type:"CIMSolidStroke",enable:!0,width:e,color:W(n)});c.push({type:"CIMSolidFill",enable:!0,color:W(n)});const u={type:"CIMPolygonSymbol",symbolLayers:c};h={type:"CIMPointSymbol",symbolLayers:[{type:"CIMVectorMarker",enable:!0,rotation:C(-t.angle),size:C(t.size||6*e),offsetX:C(t.xoffset),offsetY:C(t.yoffset),frame:a,markerGraphics:[{type:"CIMMarkerGraphic",geometry:o,symbol:u}]}]}}return h}static fromCIMHatchFill(t,e){var u;const s=e*((u=t.separation)!=null?u:dn),i=s/2,n=4,a=R(t.lineSymbol);let o=this._getLineSymbolPeriod(a)||n;for(;of.type==="CIMSolidStroke");return c&&(c.width*=e),{type:"CIMVectorMarker",frame:l,markerGraphics:[{type:"CIMMarkerGraphic",geometry:{paths:[[[-h,0],[h,0]]]},symbol:a}],size:s}}static fetchResources(t,e,s){if(t&&e)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":{const i=t.symbolLayers;if(!i)return;for(const n of i)switch(In(n,e,s),n.type){case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMCharacterMarker":case"CIMPictureMarker":"url"in n&&n.url&&s.push(e.fetchResource(n.url,null));break;case"CIMVectorMarker":{const a=n.markerGraphics;if(!a)continue;for(const o of a)if(o){const h=o.symbol;h&&U.fetchResources(h,e,s)}}}}}}static _getLineSymbolPeriod(t){if(t){const e=this._getEffectsRepeat(t.effects);if(e)return e;if(t.symbolLayers){for(const s of t.symbolLayers)if(s){const i=this._getEffectsRepeat(s.effects);if(i)return i;switch(s.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const n=this._getPlacementRepeat(s.markerPlacement);if(n)return n}}}}}return 0}static _getEffectsRepeat(t){if(t){for(const e of t)if(e)switch(e.type){case"CIMGeometricEffectDashes":{const s=e.dashTemplate;if(s&&s.length){let i=0;for(const n of s)i+=n;return 1&s.length&&(i*=2),i}break}case"CIMGeometricEffectWave":return e.period;default:es.error(`unsupported geometric effect type ${e.type}`)}}return 0}static _getPlacementRepeat(t){if(t)switch(t.type){case"CIMMarkerPlacementAlongLineSameSize":case"CIMMarkerPlacementAlongLineRandomSize":case"CIMMarkerPlacementAlongLineVariableSize":{const e=t.placementTemplate;if(e&&e.length){let s=0;for(const i of e)s+=i;return 1&e.length&&(s*=2),s}break}}return 0}static fromCIMInsidePolygon(t){var u;const e=t.markerPlacement,s={type:t.type,...t};s.markerPlacement=null,s.anchorPoint=null;const i=Math.abs(e.stepX),n=Math.abs(e.stepY),a=((u=e.randomness)!=null?u:100)/100;let o,h,l,c;if(e.gridType==="Random"){const f=qt(Hs),m=Math.max(Math.floor(f/i),1),_=Math.max(Math.floor(f/n),1);o=m*i/2,h=_*n/2,l=2*h;const p=new Rs(e.seed),d=a*i/1.5,g=a*n/1.5;c=[];for(let y=0;y({type:"CIMMarkerGraphic",geometry:f,symbol:{type:"CIMPointSymbol",symbolLayers:[s]}})),size:l}}static getSize(t){if(t)switch(t.type){case"CIMTextSymbol":return t.height;case"CIMPointSymbol":{let e=0;if(t.symbolLayers){for(const s of t.symbolLayers)if(s)switch(s.type){case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":{const i=s.size;i>e&&(e=i);break}}}return e}case"CIMLineSymbol":case"CIMPolygonSymbol":{let e=0;if(t.symbolLayers){for(const s of t.symbolLayers)if(s)switch(s.type){case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":{const i=s.width;i>e&&(e=i);break}case"CIMCharacterMarker":case"CIMPictureMarker":case"CIMVectorMarker":case"CIMObjectMarker3D":case"CIMglTFMarker3D":if(Zi(s.markerPlacement)){const i=s.size;i>e&&(e=i)}}}return e}}}static getMarkerScaleRatio(t){if(t&&t.type==="CIMVectorMarker"&&t.scaleSymbolsProportionally!==!1&&t.frame){const e=t.frame.ymax-t.frame.ymin;return t.size/e}return 1}}class A{static findApplicableOverrides(t,e,s){if(t&&e){if(t.primitiveName){let i=!1;for(const n of s)if(n.primitiveName===t.primitiveName){i=!0;break}if(!i)for(const n of e)n.primitiveName===t.primitiveName&&s.push(n)}switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(t.effects)for(const i of t.effects)A.findApplicableOverrides(i,e,s);if(t.symbolLayers)for(const i of t.symbolLayers)A.findApplicableOverrides(i,e,s);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMPictureStroke":case"CIMGradientStroke":case"CIMSolidFill":case"CIMPictureFill":case"CIMHatchFill":case"CIMGradientFill":case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":if(t.effects)for(const i of t.effects)A.findApplicableOverrides(i,e,s);if(t.markerPlacement&&A.findApplicableOverrides(t.markerPlacement,e,s),t.type==="CIMVectorMarker"){if(t.markerGraphics)for(const i of t.markerGraphics)A.findApplicableOverrides(i,e,s),A.findApplicableOverrides(i.symbol,e,s)}else t.type==="CIMCharacterMarker"?A.findApplicableOverrides(t.symbol,e,s):t.type==="CIMHatchFill"?A.findApplicableOverrides(t.lineSymbol,e,s):t.type==="CIMPictureMarker"&&A.findApplicableOverrides(t.animatedSymbolProperties,e,s)}}}static findEffectOverrides(t,e,s){var n;if(!e||!t)return;const i=t.length;for(let a=0;a{var m;return!((m=f.valueExpressionInfo)!=null&&m.expression.includes("$feature"))})),o||(l=l.filter(f=>{var m;return!((m=f.valueExpressionInfo)!=null&&m.expression.includes("$view"))})),l.length>0){const f=ir(e.attributes);await A.evaluateOverrides(l,e,{spatialReference:s,fields:f,geometryType:n},a,o)}A.applyOverrides(h,l)}return i&&A.applyDictionaryTextOverrides(h,e,i),h}static async evaluateOverrides(t,e,s,i,n){if(!e)return;let a;for(const o of t){const h=o.valueExpressionInfo;if(h&&s){a||(a=[]),o.value=void 0;const l=$s(h.expression,s.spatialReference,s.fields).then(c=>{o.value=ee(c,e,{$view:n},s.geometryType,i)});a.push(l)}}a!==void 0&&a.length>0&&await Promise.all(a)}static applyDictionaryTextOverrides(t,e,s,i="Normal"){if(t&&t.type)switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":case"CIMTextSymbol":{const n=t.symbolLayers;if(!n)return;for(const a of n)a&&a.type==="CIMVectorMarker"&&A.applyDictionaryTextOverrides(a,e,s,t.type==="CIMTextSymbol"?t.textCase:i)}break;case"CIMVectorMarker":{const n=t.markerGraphics;if(!n)return;for(const a of n)a&&A.applyDictionaryTextOverrides(a,e,s)}break;case"CIMMarkerGraphic":{const n=t.textString;if(n&&n.includes("[")){const a=Xs(n,s);t.textString=Ys(e,a,i)}}}}static applyOverrides(t,e,s,i){if(t.primitiveName){for(const n of e)if(n.primitiveName===t.primitiveName){const a=vn(n.propertyName);if(i&&i.push({cim:t,nocapPropertyName:a,value:t[a]}),n.expression&&(n.value=A.toValue(n.propertyName,n.expression)),s){let o=!1;for(const h of s)h.primitiveName===t.primitiveName&&(o=!0);o||s.push(n)}q(n.value)&&(t[a]=n.value)}}switch(t.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":if(t.effects)for(const n of t.effects)A.applyOverrides(n,e,s,i);if(t.symbolLayers)for(const n of t.symbolLayers)A.applyOverrides(n,e,s,i);break;case"CIMTextSymbol":break;case"CIMSolidStroke":case"CIMSolidFill":case"CIMVectorMarker":if(t.effects)for(const n of t.effects)A.applyOverrides(n,e,s,i);if(t.type==="CIMVectorMarker"&&t.markerGraphics)for(const n of t.markerGraphics)A.applyOverrides(n,e,s,i),A.applyOverrides(n.symbol,e,s,i)}}static restoreOverrides(t){for(const e of t)e.cim[e.nocapPropertyName]=e.value}static buildOverrideKey(t){let e="";for(const s of t)s.value!==void 0&&(e+=`${s.primitiveName}${s.propertyName}${JSON.stringify(s.value)}`);return e}static toValue(t,e){if(t==="DashTemplate")return e.split(" ").map(s=>Number(s));if(t==="Color"){const s=new ss(e).toRgba();return s[3]*=255,s}return e}}const Ye=r=>{if(!r)return rt.Butt;switch(r){case"butt":return rt.Butt;case"square":return rt.Square;case"round":return rt.Round}},Ve=r=>{if(!r)return nt.Miter;switch(r){case"miter":return nt.Miter;case"round":return nt.Round;case"bevel":return nt.Bevel}},xn=r=>{if(at(r))return"Center";switch(r){case"left":return"Left";case"right":return"Right";case"center":return"Center"}},bn=r=>{if(at(r))return"Center";switch(r){case"baseline":return"Baseline";case"top":return"Top";case"middle":return"Center";case"bottom":return"Bottom"}},W=r=>{if(!r)return[0,0,0,0];const{r:t,g:e,b:s,a:i}=r;return[t,e,s,255*i]},Mn=(r,t)=>{const e=Sn(t),s=Cn(r);return e&&s?`${e}-${s}`:`${e}${s}`},Sn=r=>{if(!r)return"";switch(r.toLowerCase()){case"bold":case"bolder":return"bold"}return""},Cn=r=>{if(!r)return"";switch(r.toLowerCase()){case"italic":case"oblique":return"italic"}return""},vs=(r,t)=>{const e=t==="butt";switch(r){case"dash":case"esriSLSDash":return e?[4,3]:[3,4];case"dash-dot":case"esriSLSDashDot":return e?[4,3,1,3]:[3,4,0,4];case"dot":case"esriSLSDot":return e?[1,3]:[0,4];case"long-dash":case"esriSLSLongDash":return e?[8,3]:[7,4];case"long-dash-dot":case"esriSLSLongDashDot":return e?[8,3,1,3]:[7,4,0,4];case"long-dash-dot-dot":case"esriSLSDashDotDot":return e?[8,3,1,3,1,3]:[7,4,0,4,0,4];case"short-dash":case"esriSLSShortDash":return e?[4,1]:[3,2];case"short-dash-dot":case"esriSLSShortDashDot":return e?[4,1,1,1]:[3,2,0,2];case"short-dash-dot-dot":case"esriSLSShortDashDotDot":return e?[4,1,1,1,1,1]:[3,2,0,2,0,2];case"short-dot":case"esriSLSShortDot":return e?[1,1]:[0,2];case"solid":case"esriSLSSolid":case"none":return es.error("Unexpected: style does not require rasterization"),[0,0];default:return es.error(`Tried to rasterize SLS, but found an unexpected style: ${r}!`),[0,0]}};function wn(r){return r.symbolLayers!==void 0}const Is=r=>{let s,i;const n=r;if(n==="circle"||n==="esriSMSCircle"){let o=Math.acos(.995),h=Math.ceil(ci/o/4);h===0&&(h=1),o=_n/h,h*=4;const l=[];l.push([50,0]);for(let c=1;cr==="vertical"||r==="horizontal"||r==="cross"||r==="esriSFSCross"||r==="esriSFSVertical"||r==="esriSFSHorizontal",vn=r=>r&&r.charAt(0).toLowerCase()+r.substr(1);let ne;function In(r,t,e){if(!(!r.effects||q(t.geometryEngine))){if(ne)return void e.push(ne);Qi(r.effects)&&(ne=tr(),e.push(ne),ne.then(s=>t.geometryEngine=s))}}const Ls=.05;function Ln(r){return Math.max(Math.round(r/Ls),1)*Ls}const Tn=new Set(["StartTimeOffset","Duration","RepeatDelay"]);function Nn(r,t){return Tn.has(t)?Ln(r):r}function An(r){var t;if(!r)return null;switch(r.type){case"CIMPointSymbol":{const e=r.symbolLayers;return e&&e.length===1?An(e[0]):null}case"CIMVectorMarker":{const e=r.markerGraphics;if(!e||e.length!==1)return null;const s=e[0];if(!s)return null;const i=s.geometry;if(!i)return null;const n=s.symbol;return!n||n.type!=="CIMPolygonSymbol"&&n.type!=="CIMLineSymbol"||((t=n.symbolLayers)==null?void 0:t.some(a=>!!a.effects))?null:{geom:i,asFill:n.type==="CIMPolygonSymbol"}}case"sdf":return{geom:r.geom,asFill:r.asFill}}return null}function zn(r){return r?r.rings?r.rings:r.paths?r.paths:r.xmin!==void 0&&r.ymin!==void 0&&r.xmax!==void 0&&r.ymax!==void 0?[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]:null:null}function On(r){let t=1/0,e=-1/0,s=1/0,i=-1/0;for(const n of r)for(const a of n)a[0]e&&(e=a[0]),a[1]i&&(i=a[1]);return new ti(t,s,e-t,i-s)}function Ts(r){let t=1/0,e=-1/0,s=1/0,i=-1/0;for(const n of r)for(const a of n)a[0]e&&(e=a[0]),a[1]i&&(i=a[1]);return[t,s,e,i]}function ui(r){return r?r.rings?Ts(r.rings):r.paths?Ts(r.paths):$(r)?[r.xmin,r.ymin,r.xmax,r.ymax]:null:null}function fi(r,t,e,s,i){const[n,a,o,h]=r;if(o0&&(x=(t.xmax-t.xmin)/(t.ymax-t.ymin),y=s.x/(e*x),P=s.y/e):(y=s.x,P=s.y)),y=.5*(t.xmax+t.xmin)+y*(t.xmax-t.xmin),P=.5*(t.ymax+t.ymin)+P*(t.ymax-t.ymin),y-=n,P-=a,y*=_,P*=_,y+=m,P+=m;let M=y/p-.5,k=P/d-.5;return i&&(M*=e*x,k*=e),[g,M,k]}function Ma(r){const t=zn(r.geom),e=On(t),s=128,i=1,n=Math.floor(.5*(.5*s-i)),a=(s-2*(n+i))/Math.max(e.width,e.height),o=Math.round(e.width*a)+2*n,h=Math.round(e.height*a)+2*n,l=[];for(const u of t)if(u&&u.length>1){const f=[];for(const m of u){let[_,p]=m;_-=e.x,p-=e.y,_*=a,p*=a,_+=n-.5,p+=n-.5,r.asFill?f.push([_,p]):f.push([Math.round(_),Math.round(p)])}if(r.asFill){const m=f.length-1;f[0][0]===f[m][0]&&f[0][1]===f[m][1]||f.push(f[0])}l.push(f)}const c=Rn(l,o,h,n);return r.asFill&&En(l,o,h,n,c),[$n(c,n),o,h]}function Rn(r,t,e,s){const i=t*e,n=new Array(i),a=s*s+1;for(let o=0;ot&&(g=t),y<0&&(y=0),P>e&&(P=e);const x=u[0]-c[0],M=u[1]-c[1],k=x*x+M*M;for(let v=d;vk?(L=u[0],b=u[1]):(w/=k,L=c[0]+w*x,b=c[1]+w*M);const N=(v-L)*(v-L)+(T-b)*(T-b),H=(e-T-1)*t+v;Nt-s&&(p=t-s),de-s&&(g=e-s);for(let y=d;yy==l[1]>y)continue;const P=(e-y-1)*t;for(let x=_;x>8^e)+s|0;while(--s!=0)}return(1+e/(1<<31))/2}function Hn(r){return Math.floor(Gn(r,Dn)*Xn)}const Dn=53290320,Xn=10,mi=ce.getLogger("esri.symbols.cim.cimAnalyzer");function os(r){switch(r){case"Butt":return Re.BUTT;case"Square":return Re.SQUARE;default:return Re.ROUND}}function hs(r){switch(r){case"Bevel":return Ee.BEVEL;case"Miter":return Ee.MITER;default:return Ee.ROUND}}function As(r,t,e,s){let i;r[t]?i=r[t]:(i={},r[t]=i),i[e]=s}function zs(r){const t=r.markerPlacement;return t&&t.angleToLine?Je.MAP:Je.SCREEN}async function Sa(r,t,e,s,i){const n=s!=null?s:[];if(!r)return n;let a,o;const h={};if(r.type!=="CIMSymbolReference")return mi.error("Expect cim type to be 'CIMSymbolReference'"),n;if(a=r.symbol,o=r.primitiveOverrides,o){const c=[];for(const u of o){const f=u.valueExpressionInfo;if(f&&t){const m=f.expression,_=$s(m,t.spatialReference,t.fields).then(p=>{at(p)||As(h,u.primitiveName,u.propertyName,p)});c.push(_)}else u.value!=null&&As(h,u.primitiveName,u.propertyName,u.value)}c.length>0&&await Promise.all(c)}const l=[];switch(U.fetchResources(a,e,l),l.length>0&&await Promise.all(l),a.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":Yn(a,o,h,t,n,e,i)}return n}function Yn(r,t,e,s,i,n,a){if(!r)return;const o=r.symbolLayers;if(!o)return;const h=r.effects;let l;const c=U.getSize(r);r.type==="CIMPointSymbol"&&r.angleAlignment==="Map"&&(l=Je.MAP);let u=o.length;for(;u--;){const f=o[u];if(!f||f.enable===!1)continue;let m;h&&h.length&&(m=[...h]);const _=f.effects;_&&_.length&&(h?m.push(..._):m=[..._]);const p=[];let d;A.findEffectOverrides(m,t,p),d=p.length>0?ia(m,p,e,s):m;const g=[];switch(A.findApplicableOverrides(f,t,g),f.type){case"CIMSolidFill":Vn(f,d,e,g,s,i);break;case"CIMPictureFill":Bn(f,d,e,g,s,n,i);break;case"CIMHatchFill":Wn(f,d,e,g,s,i);break;case"CIMGradientFill":Un(f,d,e,g,s,i);break;case"CIMSolidStroke":qn(f,d,e,g,s,i,r.type==="CIMPolygonSymbol",c);break;case"CIMPictureStroke":Jn(f,d,e,g,s,i,r.type==="CIMPolygonSymbol",c);break;case"CIMGradientStroke":jn(f,d,e,g,s,i,r.type==="CIMPolygonSymbol",c);break;case"CIMCharacterMarker":if(Be(f,d,e,g,s,i))break;break;case"CIMPictureMarker":if(Be(f,d,e,g,s,i))break;r.type==="CIMLineSymbol"&&(l=zs(f)),Kn(f,d,e,g,s,n,i,l,c);break;case"CIMVectorMarker":if(Be(f,d,e,g,s,i))break;r.type==="CIMLineSymbol"&&(l=zs(f)),Zn(f,d,e,g,s,i,n,l,c,a);break;default:mi.error("Cannot analyze CIM layer",f.type)}}}function Vn(r,t,e,s,i,n){const a=r.primitiveName,o=Y(r.color),[h,l]=et(s,a,t,null,null),c=E(JSON.stringify(r)+l).toString();n.push({type:"fill",templateHash:c,materialHash:h?()=>c:c,cim:r,materialOverrides:null,colorLocked:r.colorLocked,color:S(a,e,"Color",i,o,Q),height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,effects:t,applyRandomOffset:!1,sampleAlphaOnly:!0})}function Bn(r,t,e,s,i,n,a){const o=r.primitiveName,h=r.tintColor?Y(r.tintColor):{r:255,g:255,b:255,a:1},[l,c]=et(s,o,t,null,null),u=E(JSON.stringify(r)+c).toString(),f=E(`${r.url}${JSON.stringify(r.colorSubstitutions)}`).toString();let m=C(r.scaleX);if("width"in r){const _=r.width;let p=1;const d=n.getResource(r.url);q(d)&&(p=d.width/d.height),m/=p*(r.height/_)}a.push({type:"fill",templateHash:u,materialHash:l?()=>f:f,cim:r,materialOverrides:null,colorLocked:r.colorLocked,effects:t,color:S(o,e,"TintColor",i,h,Q),height:S(o,e,"Height",i,r.height),scaleX:S(o,e,"ScaleX",i,m),angle:S(o,e,"Rotation",i,C(r.rotation)),offsetX:S(o,e,"OffsetX",i,C(r.offsetX)),offsetY:S(o,e,"OffsetY",i,C(r.offsetY)),url:r.url,applyRandomOffset:!1,sampleAlphaOnly:!1})}function Wn(r,t,e,s,i,n){var _;const a=["Rotation","OffsetX","OffsetY"],o=s.filter(p=>p.primitiveName!==r.primitiveName||!a.includes(p.propertyName)),h=r.primitiveName,[l,c]=et(s,h,t,null,null),u=E(JSON.stringify(r)+c).toString(),f=E(`${r.separation}${JSON.stringify(r.lineSymbol)}`).toString();let m={r:255,g:255,b:255,a:1};if(r.lineSymbol){const p=(_=r.lineSymbol)==null?void 0:_.symbolLayers.find(d=>d.type==="CIMSolidStroke");p&&(m=Y(p.color))}n.push({type:"fill",templateHash:u,materialHash:l?me(f,e,o,i):f,cim:r,materialOverrides:o,colorLocked:r.colorLocked,effects:t,color:m,height:S(h,e,"Separation",i,r.separation),scaleX:1,angle:S(h,e,"Rotation",i,C(r.rotation)),offsetX:S(h,e,"OffsetX",i,C(r.offsetX)),offsetY:S(h,e,"OffsetY",i,C(r.offsetY)),applyRandomOffset:!1,sampleAlphaOnly:!0})}function Un(r,t,e,s,i,n){const a=r.primitiveName,[o,h]=et(s,a,t,null,null),l=E(JSON.stringify(r)+h).toString();n.push({type:"fill",templateHash:l,materialHash:o?me(l,e,s,i):l,cim:r,materialOverrides:null,colorLocked:r.colorLocked,effects:t,color:{r:128,g:128,b:128,a:1},height:0,angle:0,offsetX:0,offsetY:0,scaleX:1,applyRandomOffset:!1,sampleAlphaOnly:!1})}function qn(r,t,e,s,i,n,a,o){const h=r.primitiveName,l=Y(r.color),c=r.width!==void 0?r.width:4,u=os(r.capStyle),f=hs(r.joinStyle),m=r.miterLimit,[_,p]=et(s,h,t,null,null),d=E(JSON.stringify(r)+p).toString();let g,y;if(t&&t instanceof Array&&t.length>0){const P=t[t.length-1];if(P.type==="CIMGeometricEffectDashes"&&P.lineDashEnding==="NoConstraint"&&P.offsetAlongLine===null){const x=(t=[...t]).pop();g=x.dashTemplate,y=x.scaleDash}}n.push({type:"line",templateHash:d,materialHash:_?()=>d:d,cim:r,materialOverrides:null,isOutline:a,colorLocked:r.colorLocked,effects:t,color:S(h,e,"Color",i,l,Q),width:S(h,e,"Width",i,c),cap:S(h,e,"CapStyle",i,u),join:S(h,e,"JoinStyle",i,f),miterLimit:S(h,e,"MiterLimit",i,m),referenceWidth:o,zOrder:ls(r.name),dashTemplate:g,scaleDash:y,sampleAlphaOnly:!0})}function Jn(r,t,e,s,i,n,a,o){const h=E(`${r.url}${JSON.stringify(r.colorSubstitutions)}`).toString(),l=r.primitiveName,c=Y(r.tintColor),u=r.width!==void 0?r.width:4,f=os(r.capStyle),m=hs(r.joinStyle),_=r.miterLimit,[p,d]=et(s,l,t,null,null),g=E(JSON.stringify(r)+d).toString();n.push({type:"line",templateHash:g,materialHash:p?()=>h:h,cim:r,materialOverrides:null,isOutline:a,colorLocked:r.colorLocked,effects:t,color:S(l,e,"TintColor",i,c,Q),width:S(l,e,"Width",i,u),cap:S(l,e,"CapStyle",i,f),join:S(l,e,"JoinStyle",i,m),miterLimit:S(l,e,"MiterLimit",i,_),referenceWidth:o,zOrder:ls(r.name),dashTemplate:null,scaleDash:!1,url:r.url,sampleAlphaOnly:!1})}function jn(r,t,e,s,i,n,a,o){const h=r.primitiveName,l=r.width!==void 0?r.width:4,c=os(r.capStyle),u=hs(r.joinStyle),f=r.miterLimit,[m,_]=et(s,h,t,null,null),p=E(JSON.stringify(r)+_).toString();n.push({type:"line",templateHash:p,materialHash:m?me(p,e,s,i):p,cim:r,materialOverrides:null,isOutline:a,colorLocked:r.colorLocked,effects:t,color:{r:128,g:128,b:128,a:1},width:S(h,e,"Width",i,l),cap:S(h,e,"CapStyle",i,c),join:S(h,e,"JoinStyle",i,u),miterLimit:S(h,e,"MiterLimit",i,f),referenceWidth:o,zOrder:ls(r.name),dashTemplate:null,scaleDash:!1,sampleAlphaOnly:!1})}function Be(r,t,e,s,i,n){const a=r.markerPlacement;if(!a||a.type!=="CIMMarkerPlacementInsidePolygon")return!1;const o=a,h=Math.abs(o.stepX),l=Math.abs(o.stepY);if(h===0||l===0)return!0;const c=["Rotation","OffsetX","OffsetY"],u=s.filter(x=>x.primitiveName!==r.primitiveName||!c.includes(x.propertyName)),f="url"in r?r.url:null,[m,_]=et(s,o.primitiveName,t,null,null),p=E(JSON.stringify(r)+_).toString();let d,g,y=null;if(a.gridType==="Random"){const x=qt(Hs),M=Math.max(Math.floor(x/h),1),k=Math.max(Math.floor(x/l),1);d=l*k,y=v=>v?v*k:0,g=M*h/d}else a.shiftOddRows?(d=2*l,y=x=>x?2*x:0,g=h/l*.5):(d=l,y=null,g=h/l);let P={r:255,g:255,b:255,a:1};return"tintColor"in r&&(P=Y(r.tintColor)),n.push({type:"fill",templateHash:p,materialHash:m?me(p,e,u,i):p,cim:r,materialOverrides:u,colorLocked:r.colorLocked,effects:t,color:S(o.primitiveName,e,"TintColor",i,P,Q),height:S(o.primitiveName,e,"StepY",i,d,y),scaleX:g,angle:S(o.primitiveName,e,"GridAngle",i,o.gridAngle),offsetX:S(o.primitiveName,e,"OffsetX",i,C(o.offsetX)),offsetY:S(o.primitiveName,e,"OffsetY",i,C(o.offsetY)),url:f,applyRandomOffset:a.gridType==="Random",sampleAlphaOnly:!f}),!0}function Kn(r,t,e,s,i,n,a,o,h){var L;const l=r.primitiveName,c=C(r.size);let u=C(r.scaleX,1);const f=C(r.rotation),m=C(r.offsetX),_=C(r.offsetY),p=r.tintColor?Y(r.tintColor):{r:255,g:255,b:255,a:1},d=E(`${r.url}${JSON.stringify(r.colorSubstitutions)}${JSON.stringify(r.animatedSymbolProperties)}`).toString(),g=pi(r.markerPlacement,s,e,i),y=ra(r.animatedSymbolProperties,s,e,i),[P,x]=et(s,l,t,g,y),M=E(JSON.stringify(r)+x).toString(),k=(L=r.anchorPoint)!=null?L:{x:0,y:0};if("width"in r){const b=r.width;let w=1;const N=n.getResource(r.url);q(N)&&(w=N.width/N.height),u/=w*(c/b)}function v(b,w){return Ds(y,b,w)}const T=r.animatedSymbolProperties&&r.animatedSymbolProperties.randomizeStartTime===!0?(b,w,N,H)=>{const ft=Hn(H),mt=v(b,w);return d+`-MATERIALGROUP(${ft})-ASP(${JSON.stringify(mt)})`}:P?(b,w)=>{const N=v(b,w);return d+`-ASP(${JSON.stringify(N)})`}:d;a.push({type:"marker",templateHash:M,materialHash:T,cim:r,materialOverrides:null,colorLocked:r.colorLocked,effects:t,scaleSymbolsProportionally:!1,alignment:o,size:S(l,e,"Size",i,c),scaleX:S(l,e,"ScaleX",i,u),rotation:S(l,e,"Rotation",i,f),offsetX:S(l,e,"OffsetX",i,m),offsetY:S(l,e,"OffsetY",i,_),color:S(l,e,"TintColor",i,p,Q),anchorPoint:{x:k.x,y:-k.y},isAbsoluteAnchorPoint:r.anchorPointUnits!=="Relative",outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,frameHeight:0,rotateClockwise:r.rotateClockwise,referenceSize:h,sizeRatio:1,markerPlacement:g,url:r.url,animatedSymbolProperties:y})}function Zn(r,t,e,s,i,n,a,o,h,l){const c=r.markerGraphics;if(!c)return;let u=0;if(r.scaleSymbolsProportionally){const m=r.frame;m&&(u=m.ymax-m.ymin)}const f=pi(r.markerPlacement,s,e,i);for(const m of c)if(m){const _=m.symbol;if(!_)continue;switch(_.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":ta(r,t,f,null,m,s,e,i,n,a,o,h,u,l);break;case"CIMTextSymbol":Qn(r,t,f,m,e,s,i,n,o,h,u)}}}function Qn(r,t,e,s,i,n,a,o,h,l,c){const u=[];A.findApplicableOverrides(s,n,u);const f=s.geometry;if(!("x"in f)||!("y"in f))return;const m=s.symbol,_=Ws(m),p=Bs(m.fontStyleName),d=is(m.fontFamilyName);m.font={family:d,decoration:_,...p};const g=r.frame,y=f.x-.5*(g.xmin+g.xmax),P=f.y-.5*(g.ymin+g.ymax),x=r.size/c,M=r.primitiveName,k=C(m.height)*x,v=C(m.angle),T=C(r.offsetX)+(C(m.offsetX)+y)*x,L=C(r.offsetY)+(C(m.offsetY)+P)*x,b=Y(Dt(m));let w=Y(Xt(m)),N=le(m);N||(w=Y(Dt(m.haloSymbol)),N=m.haloSize*x);const[H,ft]=et(n,M,t,e,null),mt=JSON.stringify(r.effects)+Number(r.colorLocked).toString()+JSON.stringify(r.anchorPoint)+r.anchorPointUnits+JSON.stringify(r.markerPlacement)+r.size.toString(),se=E(JSON.stringify(s)+mt+ft).toString();let G=S(s.primitiveName,i,"TextString",a,s.textString,Vs,m.textCase);if(G==null)return;const{fontStyleName:J}=m,Yt=d+(J?"-"+J.toLowerCase():"-regular"),pt=Yt;typeof G=="string"&&G.includes("[")&&m.fieldMap&&(G=Ki(m.fieldMap,G,m.textCase)),o.push({type:"text",templateHash:se,materialHash:H||typeof G=="function"||G.match(/\[(.*?)\]/)?(Vt,D,pe)=>pt+"-"+Ds(G,Vt,D,pe):pt+"-"+E(G),cim:m,materialOverrides:null,colorLocked:r.colorLocked,effects:t,alignment:h,anchorPoint:{x:r.anchorPoint?r.anchorPoint.x:0,y:r.anchorPoint?r.anchorPoint.y:0},isAbsoluteAnchorPoint:r.anchorPointUnits!=="Relative",fontName:Yt,decoration:_,weight:S(M,i,"Weight",a,p.weight),style:S(M,i,"Size",a,p.style),size:S(M,i,"Size",a,k),angle:S(M,i,"Rotation",a,v),offsetX:S(M,i,"OffsetX",a,T),offsetY:S(M,i,"OffsetY",a,L),horizontalAlignment:Us(m.horizontalAlignment),verticalAlignment:qs(m.verticalAlignment),text:G,color:b,outlineColor:w,outlineSize:N,referenceSize:l,sizeRatio:1,markerPlacement:e})}function ta(r,t,e,s,i,n,a,o,h,l,c,u,f,m){var y;const _=i.symbol,p=_.symbolLayers;if(!p)return;if(m)return void Os(r,t,e,s,i,a,n,o,h,l,c,u,f);let d=p.length;if(na(p))return void ea(r,t,e,s,i,p,n,a,o,h,c,u,f);const g=Ns.applyEffects(_.effects,i.geometry,l.geometryEngine);if(g)for(;d--;){const P=p[d];if(P&&P.enable!==!1)switch(P.type){case"CIMSolidFill":case"CIMSolidStroke":{const x=Ns.applyEffects(P.effects,g,l.geometryEngine),M=ui(x);if(!M)continue;const k=r.anchorPointUnits!=="Relative",[v,T,L]=fi(M,r.frame,r.size,r.anchorPoint,k),b=P.type==="CIMSolidFill",w={type:"sdf",geom:x,asFill:b},N=r.primitiveName,H=(y=C(r.size))!=null?y:10,ft=C(r.rotation),mt=C(r.offsetX),se=C(r.offsetY),G=P.path,J=P.primitiveName,Yt=Y(b?Dt(P):Xt(P)),pt=b?{r:0,g:0,b:0,a:0}:Y(Xt(P)),Vt=le(P);if(!b&&!Vt)break;let D=!1,pe="";for(const _t of n)_t.primitiveName!==J&&_t.primitiveName!==N||(_t.value!==void 0?pe+=`-${_t.primitiveName}-${_t.propertyName}-${JSON.stringify(_t.value)}`:_t.valueExpressionInfo&&(D=!0));q(t)&&typeof t=="function"&&(D=!0);const _i=JSON.stringify({...r,markerGraphics:null}),us=E(JSON.stringify(w)+G).toString(),di={type:"marker",templateHash:E(JSON.stringify(i)+JSON.stringify(P)+_i+pe).toString(),materialHash:D?()=>us:us,cim:w,materialOverrides:null,colorLocked:r.colorLocked,effects:t,scaleSymbolsProportionally:r.scaleSymbolsProportionally,alignment:c,anchorPoint:{x:T,y:L},isAbsoluteAnchorPoint:k,size:S(r.primitiveName,a,"Size",o,H),rotation:S(r.primitiveName,a,"Rotation",o,ft),offsetX:S(r.primitiveName,a,"OffsetX",o,mt),offsetY:S(r.primitiveName,a,"OffsetY",o,se),scaleX:1,frameHeight:f,rotateClockwise:r.rotateClockwise,referenceSize:u,sizeRatio:v,color:S(J,a,"Color",o,Yt,Q),outlineColor:S(J,a,"Color",o,pt,Q),outlineWidth:S(J,a,"Width",o,Vt),markerPlacement:e,animatedSymbolProperties:s,path:G};h.push(di);break}default:Os(r,t,e,s,i,a,n,o,h,l,c,u,f)}}}function ea(r,t,e,s,i,n,a,o,h,l,c,u,f){const m=i.geometry,_=n[0],p=n[1],d=ui(m);if(!d)return;const g=r.anchorPointUnits!=="Relative",[y,P,x]=fi(d,r.frame,r.size,r.anchorPoint,g),M={type:"sdf",geom:m,asFill:!0},k=r.primitiveName,v=C(r.size),T=C(r.rotation),L=C(r.offsetX),b=C(r.offsetY),w=p.path,N=p.primitiveName,H=_.primitiveName,ft=Y(Dt(p)),mt=Y(Xt(_)),se=le(_);let G=!1,J="";for(const D of a)D.primitiveName!==N&&D.primitiveName!==H&&D.primitiveName!==k||(D.value!==void 0?J+=`-${D.primitiveName}-${D.propertyName}-${JSON.stringify(D.value)}`:D.valueExpressionInfo&&(G=!0));const Yt=JSON.stringify({...r,markerGraphics:null}),pt=E(JSON.stringify(M)+w).toString(),Vt={type:"marker",templateHash:E(JSON.stringify(i)+JSON.stringify(p)+JSON.stringify(_)+Yt+J).toString(),materialHash:G?()=>pt:pt,cim:M,materialOverrides:null,colorLocked:r.colorLocked,effects:t,scaleSymbolsProportionally:r.scaleSymbolsProportionally,alignment:c,anchorPoint:{x:P,y:x},isAbsoluteAnchorPoint:g,size:S(r.primitiveName,o,"Size",h,v),rotation:S(r.primitiveName,o,"Rotation",h,T),offsetX:S(r.primitiveName,o,"OffsetX",h,L),offsetY:S(r.primitiveName,o,"OffsetY",h,b),scaleX:1,frameHeight:f,rotateClockwise:r.rotateClockwise,referenceSize:u,sizeRatio:y,color:S(N,o,"Color",h,ft,Q),outlineColor:S(H,o,"Color",h,mt,Q),outlineWidth:S(H,o,"Width",h,se),markerPlacement:e,path:w,animatedSymbolProperties:s};l.push(Vt)}function Os(r,t,e,s,i,n,a,o,h,l,c,u,f){const m=sa(r,i),_=["Rotation","OffsetX","OffsetY"],p=a.filter(b=>b.primitiveName!==r.primitiveName||!_.includes(b.propertyName));let d="";for(const b of a)b.value!==void 0&&(d+=`-${b.primitiveName}-${b.propertyName}-${JSON.stringify(b.value)}`);const[g,y,P]=U.getTextureAnchor(m,l),x=r.primitiveName,M=C(r.rotation),k=C(r.offsetX),v=C(r.offsetY),T=E(JSON.stringify(m)+d).toString(),L={type:"marker",templateHash:T,materialHash:p.length>0||q(t)&&typeof t=="function"?me(T,n,p,o):T,cim:m,materialOverrides:p,colorLocked:r.colorLocked,effects:t,scaleSymbolsProportionally:r.scaleSymbolsProportionally,alignment:c,anchorPoint:{x:g,y},isAbsoluteAnchorPoint:!1,size:r.size,rotation:S(x,n,"Rotation",o,M),offsetX:S(x,n,"OffsetX",o,k),offsetY:S(x,n,"OffsetY",o,v),color:{r:255,g:255,b:255,a:1},outlineColor:{r:0,g:0,b:0,a:0},outlineWidth:0,scaleX:1,frameHeight:f,rotateClockwise:r.rotateClockwise,referenceSize:u,sizeRatio:P/Kt(r.size),markerPlacement:e,animatedSymbolProperties:s};h.push(L)}function sa(r,t){return{type:r.type,enable:!0,name:r.name,colorLocked:r.colorLocked,primitiveName:r.primitiveName,anchorPoint:r.anchorPoint,anchorPointUnits:r.anchorPointUnits,offsetX:0,offsetY:0,rotateClockwise:r.rotateClockwise,rotation:0,size:r.size,billboardMode3D:r.billboardMode3D,depth3D:r.depth3D,frame:r.frame,markerGraphics:[t],scaleSymbolsProportionally:r.scaleSymbolsProportionally,respectFrame:r.respectFrame,clippingPath:r.clippingPath}}function ls(r){if(r&&r.indexOf("Level_")===0){const t=parseInt(r.substr(6),10);if(!isNaN(t))return t}return 0}function Q(r){if(!r||r.length===0)return null;const t=new ss(r).toRgba();return{r:t[0],g:t[1],b:t[2],a:t[3]}}function S(r,t,e,s,i,n,a){const o=t[r];if(o){const h=o[e];if(typeof h=="string"||typeof h=="number"||h instanceof Array)return n?n.call(null,h,a):h;if(h!=null&&h instanceof ue)return(l,c,u)=>{let f=ee(h,l,{$view:u},s.geometryType,c);return f!==null&&n&&(f=n.call(null,f,a)),f!==null?f:i}}return i}function cs(r){return r&&r.charAt(0).toLowerCase()+r.substr(1)}function ia(r,t,e,s){for(const i of t)if(i.valueExpressionInfo){const n=e[i.primitiveName]&&e[i.primitiveName][i.propertyName];n instanceof ue&&(i.fn=(a,o,h)=>ee(n,a,{$view:h},s.geometryType,o))}return(i,n,a)=>{for(const h of t)h.fn&&(h.value=h.fn(i,n,a));const o=[];for(let h of r){const l=h==null?void 0:h.primitiveName;if(l){let c=!1;for(const u of t)if(u.primitiveName===l){const f=cs(u.propertyName);u.value!=null&&u.value!==h[f]&&(c||(h=R(h),c=!0),h[f]=u.value)}}o.push(h)}return o}}function pi(r,t,e,s){const i=[];if(A.findApplicableOverrides(r,t,i),i.length===0)return r;for(const n of i)if(n.valueExpressionInfo){const a=e[n.primitiveName]&&e[n.primitiveName][n.propertyName];a instanceof ue&&(n.fn=(o,h,l)=>ee(a,o,{$view:l},s.geometryType,h))}return(n,a,o)=>{for(const c of i)c.fn&&(c.value=c.fn(n,a,o));const h=R(r),l=r.primitiveName;for(const c of i)if(c.primitiveName===l){const u=cs(c.propertyName);c.value!=null&&c.value!==h[u]&&(h[u]=c.value)}return h}}function ra(r,t,e,s){const i=[];if(A.findApplicableOverrides(r,t,i),i.length===0)return r;for(const n of i)if(n.valueExpressionInfo){const a=e[n.primitiveName]&&e[n.primitiveName][n.propertyName];a instanceof ue&&(n.fn=(o,h,l)=>ee(a,o,{$view:l},s.geometryType,h))}return(n,a,o)=>{for(const c of i)c.fn&&(c.value=c.fn(n,a,o));const h=R(r),l=r.primitiveName;for(const c of i)if(c.primitiveName===l){const u=cs(c.propertyName);if(c.value!=null){const f=Nn(c.value,c.propertyName);f!==h[u]&&(h[u]=f)}}return h}}function me(r,t,e,s){for(const i of e)if(i.valueExpressionInfo){const n=t[i.primitiveName]&&t[i.primitiveName][i.propertyName];n instanceof ue&&(i.fn=(a,o,h)=>ee(n,a,{$view:h},s.geometryType,o))}return(i,n,a)=>{for(const o of e)o.fn&&(o.value=o.fn(i,n,a));return E(r+A.buildOverrideKey(e)).toString()}}function Ca(r,t){if(!t||t.length===0)return r;const e=R(r);return A.applyOverrides(e,t),e}function et(r,t,e,s,i){let n=!1,a="";for(const o of r)o.primitiveName===t&&(o.value!==void 0?a+=`-${o.primitiveName}-${o.propertyName}-${JSON.stringify(o.value)}`:o.valueExpressionInfo&&(n=!0));return q(e)&&typeof e=="function"&&(n=!0),q(s)&&typeof s=="function"&&(n=!0),q(i)&&typeof i=="function"&&(n=!0),[n,a]}const na=r=>r&&r.length===2&&r[0].enable&&r[1].enable&&r[0].type==="CIMSolidStroke"&&r[1].type==="CIMSolidFill"&&!r[0].effects&&!r[1].effects,aa={marker:xe.MARKER,fill:xe.FILL,line:xe.LINE,text:xe.TEXT};class wa{constructor(t,e,s,i){const n={minScale:e==null?void 0:e.minScale,maxScale:e==null?void 0:e.maxScale},a=oa(n);this.layers=t,this.data=e,this.hash=this._createHash()+a,this.rendererKey=s;const o={isOutline:!1,placement:null,symbologyType:Xi.DEFAULT,vvFlags:s};for(const h of t){const l=aa[h.type];o.isOutline=h.type==="line"&&h.isOutline,h.materialKey=Di(l,o),h.maxVVSize=i,h.scaleInfo=n,h.templateHash+=a}}get type(){return"expanded-cim"}_createHash(){let t="";for(const e of this.layers)t+=e.templateHash;return t}}function oa(r){return r.minScale||r.maxScale?r.minScale+"-"+r.maxScale:""}export{xa as Q,Sa as T,Pa as V,ga as a,Ma as b,Hn as c,ba as d,Gn as e,or as f,Jr as g,Ns as h,ya as i,ri as j,Ds as k,wa as l,Ca as m,rs as n,U as o,vs as p,ee as q,An as r,ti as t}; diff --git a/assets/ExportImageParameters.0ebe2d44.js b/assets/ExportImageParameters.65ee285f.js similarity index 95% rename from assets/ExportImageParameters.0ebe2d44.js rename to assets/ExportImageParameters.65ee285f.js index ed890b6..44e0491 100644 --- a/assets/ExportImageParameters.0ebe2d44.js +++ b/assets/ExportImageParameters.65ee285f.js @@ -1 +1 @@ -import{a4 as p,c4 as u,c as b,a6 as a,a7 as l,da as d,a8 as g,a9 as f}from"./index.d94abe07.js";import{n as m}from"./floorFilterUtils.05eb8c6a.js";import{i as S}from"./sublayerUtils.9d6cbcc3.js";const v={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let t=class extends p(f){constructor(e){super(e),this.floors=null,this.scale=0}destroy(){this.layer=null}get dynamicLayers(){if(!this.hasDynamicLayers)return null;const e=this.visibleSublayers.map(s=>{const n=m(this.floors,s);return s.toExportImageJSON(n)});return e.length?JSON.stringify(e):null}get hasDynamicLayers(){return this.layer&&S(this.visibleSublayers,this.layer.serviceSublayers,this.layer.gdbVersion)}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.handles.remove("layer"),e&&this.handles.add([e.allSublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("sublayer-update",s=>this.notifyChange(v[s.propertyName]))],"layer"))}get layers(){const e=this.visibleSublayers;return e?e.length?"show:"+e.map(s=>s.id).join(","):"show:-1":null}get layerDefs(){var n;const e=!!((n=this.floors)!=null&&n.length),s=this.visibleSublayers.filter(i=>i.definitionExpression!=null||e&&i.floorInfo!=null);return s.length?JSON.stringify(s.reduce((i,r)=>{const o=m(this.floors,r),y=u(o,r.definitionExpression);return b(y)&&(i[r.id]=y),i},{})):null}get version(){this.commitProperty("layers"),this.commitProperty("layerDefs"),this.commitProperty("dynamicLayers"),this.commitProperty("timeExtent");const e=this.layer;return e&&(e.commitProperty("dpi"),e.commitProperty("imageFormat"),e.commitProperty("imageTransparency"),e.commitProperty("gdbVersion")),(this._get("version")||0)+1}get visibleSublayers(){const e=[];if(!this.layer)return e;const s=this.layer.sublayers,n=r=>{const o=this.scale,y=o===0,h=r.minScale===0||o<=r.minScale,c=r.maxScale===0||o>=r.maxScale;r.visible&&(y||h&&c)&&(r.sublayers?r.sublayers.forEach(n):e.unshift(r))};s&&s.forEach(n);const i=this._get("visibleSublayers");return!i||i.length!==e.length||i.some((r,o)=>e[o]!==r)?e:i}toJSON(){const e=this.layer;let s={dpi:e.dpi,format:e.imageFormat,transparent:e.imageTransparency,gdbVersion:e.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?s.dynamicLayers=this.dynamicLayers:s={...s,layers:this.layers,layerDefs:this.layerDefs},s}};a([l({readOnly:!0})],t.prototype,"dynamicLayers",null),a([l()],t.prototype,"floors",void 0),a([l({readOnly:!0})],t.prototype,"hasDynamicLayers",null),a([l()],t.prototype,"layer",null),a([l({readOnly:!0})],t.prototype,"layers",null),a([l({readOnly:!0})],t.prototype,"layerDefs",null),a([l({type:Number})],t.prototype,"scale",void 0),a([l(d)],t.prototype,"timeExtent",void 0),a([l({readOnly:!0})],t.prototype,"version",null),a([l({readOnly:!0})],t.prototype,"visibleSublayers",null),t=a([g("esri.layers.mixins.ExportImageParameters")],t);export{t as c}; +import{a4 as p,c4 as u,c as b,a6 as a,a7 as l,da as d,a8 as g,a9 as f}from"./index.221827cd.js";import{n as m}from"./floorFilterUtils.05eb8c6a.js";import{i as S}from"./sublayerUtils.59f5d9da.js";const v={visible:"visibleSublayers",definitionExpression:"layerDefs",labelingInfo:"hasDynamicLayers",labelsVisible:"hasDynamicLayers",opacity:"hasDynamicLayers",minScale:"visibleSublayers",maxScale:"visibleSublayers",renderer:"hasDynamicLayers",source:"hasDynamicLayers"};let t=class extends p(f){constructor(e){super(e),this.floors=null,this.scale=0}destroy(){this.layer=null}get dynamicLayers(){if(!this.hasDynamicLayers)return null;const e=this.visibleSublayers.map(s=>{const n=m(this.floors,s);return s.toExportImageJSON(n)});return e.length?JSON.stringify(e):null}get hasDynamicLayers(){return this.layer&&S(this.visibleSublayers,this.layer.serviceSublayers,this.layer.gdbVersion)}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.handles.remove("layer"),e&&this.handles.add([e.allSublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("sublayer-update",s=>this.notifyChange(v[s.propertyName]))],"layer"))}get layers(){const e=this.visibleSublayers;return e?e.length?"show:"+e.map(s=>s.id).join(","):"show:-1":null}get layerDefs(){var n;const e=!!((n=this.floors)!=null&&n.length),s=this.visibleSublayers.filter(i=>i.definitionExpression!=null||e&&i.floorInfo!=null);return s.length?JSON.stringify(s.reduce((i,r)=>{const o=m(this.floors,r),y=u(o,r.definitionExpression);return b(y)&&(i[r.id]=y),i},{})):null}get version(){this.commitProperty("layers"),this.commitProperty("layerDefs"),this.commitProperty("dynamicLayers"),this.commitProperty("timeExtent");const e=this.layer;return e&&(e.commitProperty("dpi"),e.commitProperty("imageFormat"),e.commitProperty("imageTransparency"),e.commitProperty("gdbVersion")),(this._get("version")||0)+1}get visibleSublayers(){const e=[];if(!this.layer)return e;const s=this.layer.sublayers,n=r=>{const o=this.scale,y=o===0,h=r.minScale===0||o<=r.minScale,c=r.maxScale===0||o>=r.maxScale;r.visible&&(y||h&&c)&&(r.sublayers?r.sublayers.forEach(n):e.unshift(r))};s&&s.forEach(n);const i=this._get("visibleSublayers");return!i||i.length!==e.length||i.some((r,o)=>e[o]!==r)?e:i}toJSON(){const e=this.layer;let s={dpi:e.dpi,format:e.imageFormat,transparent:e.imageTransparency,gdbVersion:e.gdbVersion||null};return this.hasDynamicLayers&&this.dynamicLayers?s.dynamicLayers=this.dynamicLayers:s={...s,layers:this.layers,layerDefs:this.layerDefs},s}};a([l({readOnly:!0})],t.prototype,"dynamicLayers",null),a([l()],t.prototype,"floors",void 0),a([l({readOnly:!0})],t.prototype,"hasDynamicLayers",null),a([l()],t.prototype,"layer",null),a([l({readOnly:!0})],t.prototype,"layers",null),a([l({readOnly:!0})],t.prototype,"layerDefs",null),a([l({type:Number})],t.prototype,"scale",void 0),a([l(d)],t.prototype,"timeExtent",void 0),a([l({readOnly:!0})],t.prototype,"version",null),a([l({readOnly:!0})],t.prototype,"visibleSublayers",null),t=a([g("esri.layers.mixins.ExportImageParameters")],t);export{t as c}; diff --git a/assets/ExportStrategy.e65233e4.js b/assets/ExportStrategy.fb59ab52.js similarity index 98% rename from assets/ExportStrategy.e65233e4.js rename to assets/ExportStrategy.fb59ab52.js index e438e39..df7203f 100644 --- a/assets/ExportStrategy.e65233e4.js +++ b/assets/ExportStrategy.fb59ab52.js @@ -1 +1 @@ -import{ay as z,bN as b,a6 as d,a7 as m,a8 as E,a9 as W,dn as R,v as S,ax as N,aU as $,cB as H,cJ as P,du as q,cV as T}from"./index.d94abe07.js";import{R as B}from"./Bitmap.43defcb1.js";const C=Math.PI/180;function I(e){return e*C}function U(e,i){const s=I(i.rotation),t=Math.abs(Math.cos(s)),r=Math.abs(Math.sin(s)),[o,h]=i.size;return e[0]=Math.round(h*r+o*t),e[1]=Math.round(h*t+o*r),e}function O(e,i,s,t){const[r,o]=i,[h,a]=t,l=.5*s;return e[0]=r-l*h,e[1]=o-l*a,e[2]=r+l*h,e[3]=o+l*a,e}const u=z(),c=[0,0],_=new b(0,0,0,0),f={container:null,fetchSource:null,requestUpdate:null,imageMaxWidth:2048,imageMaxHeight:2048,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1};let p=class extends W{constructor(e){super(e),this._imagePromise=null,this.bitmaps=[],this.hidpi=f.hidpi,this.imageMaxWidth=f.imageMaxWidth,this.imageMaxHeight=f.imageMaxHeight,this.imageRotationSupported=f.imageRotationSupported,this.imageNormalizationSupported=f.imageNormalizationSupported,this.update=R(async(i,s)=>{if(S(s),!i.stationary||this.destroyed)return;const t=i.state,r=N(t.spatialReference),o=this.hidpi?i.pixelRatio:1,h=this.imageNormalizationSupported&&t.worldScreenWidth&&t.worldScreenWidththis.imageMaxWidth||Math.floor(c[1]*o)>this.imageMaxHeight,l=r&&(t.extent.xminr.valid[1]),x=!this.imageNormalizationSupported&&l,y=!a&&!x,M=this.imageRotationSupported?t.rotation:0,v=this.container.children.slice();if(y){const n=h?t.paddedViewState.center:t.center;this._imagePromise&&console.error("Image promise was not defined!"),this._imagePromise=this._singleExport(t,c,n,t.resolution,M,o,s)}else{let n=Math.min(this.imageMaxWidth,this.imageMaxHeight);x&&(n=Math.min(t.worldScreenWidth,n)),this._imagePromise=this._tiledExport(t,n,o,s)}try{const n=await this._imagePromise;S(s);const w=[];if(this._imagePromise=null,this.destroyed)return;this.bitmaps=n!=null?n:[];for(const g of v)n.includes(g)||w.push(g.fadeOut().then(()=>{g.remove(),g.destroy()}));for(const g of n)w.push(g.fadeIn());await Promise.all(w)}catch(n){this._imagePromise=null,$(n)}},5e3),this.updateExports=R(async i=>{const s=[];for(const t of this.container.children){if(!t.visible||!t.stage)return;s.push(i(t).then(()=>{t.invalidateTexture(),t.requestRender()}))}this._imagePromise=H(s).then(()=>this._imagePromise=null),await this._imagePromise})}destroy(){this.bitmaps.forEach(e=>e.destroy()),this.bitmaps=[]}get updating(){return!this.destroyed&&this._imagePromise!==null}async _export(e,i,s,t,r,o){const h=await this.fetchSource(e,Math.floor(i*r),Math.floor(s*r),{rotation:t,pixelRatio:r,signal:o});S(o);const a=new B(null,{immutable:!0,requestRenderOnSourceChangedEnabled:!0});return a.x=e.xmin,a.y=e.ymax,a.resolution=e.width/i,a.rotation=t,a.pixelRatio=r,a.opacity=0,this.container.addChild(a),await a.setSourceAsync(h,o),S(o),a}async _singleExport(e,i,s,t,r,o,h){O(u,s,t,i);const a=P(u,e.spatialReference);return[await this._export(a,i[0],i[1],r,o,h)]}_tiledExport(e,i,s,t){const r=q.create({size:i,spatialReference:e.spatialReference,scales:[e.scale]}),o=new T(r),h=o.getTileCoverage(e);if(!h)return null;const a=[];return h.forEach((l,x,y,M)=>{_.set(l,x,y,0),o.getTileBounds(u,_);const v=P(u,e.spatialReference);a.push(this._export(v,i,i,0,s,t).then(n=>(M!==0&&(_.set(l,x,y,M),o.getTileBounds(u,_),n.x=u[0],n.y=u[3]),n)))}),Promise.all(a)}};d([m()],p.prototype,"_imagePromise",void 0),d([m()],p.prototype,"bitmaps",void 0),d([m()],p.prototype,"container",void 0),d([m()],p.prototype,"fetchSource",void 0),d([m()],p.prototype,"hidpi",void 0),d([m()],p.prototype,"imageMaxWidth",void 0),d([m()],p.prototype,"imageMaxHeight",void 0),d([m()],p.prototype,"imageRotationSupported",void 0),d([m()],p.prototype,"imageNormalizationSupported",void 0),d([m()],p.prototype,"requestUpdate",void 0),d([m()],p.prototype,"updating",null),p=d([E("esri.views.2d.layers.support.ExportStrategy")],p);const A=p;export{A as v}; +import{ay as z,bN as b,a6 as d,a7 as m,a8 as E,a9 as W,dn as R,v as S,ax as N,aU as $,cB as H,cJ as P,du as q,cV as T}from"./index.221827cd.js";import{R as B}from"./Bitmap.72a3702e.js";const C=Math.PI/180;function I(e){return e*C}function U(e,i){const s=I(i.rotation),t=Math.abs(Math.cos(s)),r=Math.abs(Math.sin(s)),[o,h]=i.size;return e[0]=Math.round(h*r+o*t),e[1]=Math.round(h*t+o*r),e}function O(e,i,s,t){const[r,o]=i,[h,a]=t,l=.5*s;return e[0]=r-l*h,e[1]=o-l*a,e[2]=r+l*h,e[3]=o+l*a,e}const u=z(),c=[0,0],_=new b(0,0,0,0),f={container:null,fetchSource:null,requestUpdate:null,imageMaxWidth:2048,imageMaxHeight:2048,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1};let p=class extends W{constructor(e){super(e),this._imagePromise=null,this.bitmaps=[],this.hidpi=f.hidpi,this.imageMaxWidth=f.imageMaxWidth,this.imageMaxHeight=f.imageMaxHeight,this.imageRotationSupported=f.imageRotationSupported,this.imageNormalizationSupported=f.imageNormalizationSupported,this.update=R(async(i,s)=>{if(S(s),!i.stationary||this.destroyed)return;const t=i.state,r=N(t.spatialReference),o=this.hidpi?i.pixelRatio:1,h=this.imageNormalizationSupported&&t.worldScreenWidth&&t.worldScreenWidththis.imageMaxWidth||Math.floor(c[1]*o)>this.imageMaxHeight,l=r&&(t.extent.xminr.valid[1]),x=!this.imageNormalizationSupported&&l,y=!a&&!x,M=this.imageRotationSupported?t.rotation:0,v=this.container.children.slice();if(y){const n=h?t.paddedViewState.center:t.center;this._imagePromise&&console.error("Image promise was not defined!"),this._imagePromise=this._singleExport(t,c,n,t.resolution,M,o,s)}else{let n=Math.min(this.imageMaxWidth,this.imageMaxHeight);x&&(n=Math.min(t.worldScreenWidth,n)),this._imagePromise=this._tiledExport(t,n,o,s)}try{const n=await this._imagePromise;S(s);const w=[];if(this._imagePromise=null,this.destroyed)return;this.bitmaps=n!=null?n:[];for(const g of v)n.includes(g)||w.push(g.fadeOut().then(()=>{g.remove(),g.destroy()}));for(const g of n)w.push(g.fadeIn());await Promise.all(w)}catch(n){this._imagePromise=null,$(n)}},5e3),this.updateExports=R(async i=>{const s=[];for(const t of this.container.children){if(!t.visible||!t.stage)return;s.push(i(t).then(()=>{t.invalidateTexture(),t.requestRender()}))}this._imagePromise=H(s).then(()=>this._imagePromise=null),await this._imagePromise})}destroy(){this.bitmaps.forEach(e=>e.destroy()),this.bitmaps=[]}get updating(){return!this.destroyed&&this._imagePromise!==null}async _export(e,i,s,t,r,o){const h=await this.fetchSource(e,Math.floor(i*r),Math.floor(s*r),{rotation:t,pixelRatio:r,signal:o});S(o);const a=new B(null,{immutable:!0,requestRenderOnSourceChangedEnabled:!0});return a.x=e.xmin,a.y=e.ymax,a.resolution=e.width/i,a.rotation=t,a.pixelRatio=r,a.opacity=0,this.container.addChild(a),await a.setSourceAsync(h,o),S(o),a}async _singleExport(e,i,s,t,r,o,h){O(u,s,t,i);const a=P(u,e.spatialReference);return[await this._export(a,i[0],i[1],r,o,h)]}_tiledExport(e,i,s,t){const r=q.create({size:i,spatialReference:e.spatialReference,scales:[e.scale]}),o=new T(r),h=o.getTileCoverage(e);if(!h)return null;const a=[];return h.forEach((l,x,y,M)=>{_.set(l,x,y,0),o.getTileBounds(u,_);const v=P(u,e.spatialReference);a.push(this._export(v,i,i,0,s,t).then(n=>(M!==0&&(_.set(l,x,y,M),o.getTileBounds(u,_),n.x=u[0],n.y=u[3]),n)))}),Promise.all(a)}};d([m()],p.prototype,"_imagePromise",void 0),d([m()],p.prototype,"bitmaps",void 0),d([m()],p.prototype,"container",void 0),d([m()],p.prototype,"fetchSource",void 0),d([m()],p.prototype,"hidpi",void 0),d([m()],p.prototype,"imageMaxWidth",void 0),d([m()],p.prototype,"imageMaxHeight",void 0),d([m()],p.prototype,"imageRotationSupported",void 0),d([m()],p.prototype,"imageNormalizationSupported",void 0),d([m()],p.prototype,"requestUpdate",void 0),d([m()],p.prototype,"updating",null),p=d([E("esri.views.2d.layers.support.ExportStrategy")],p);const A=p;export{A as v}; diff --git a/assets/ExportWMSImageParameters.bc1ac1a0.js b/assets/ExportWMSImageParameters.013012f9.js similarity index 90% rename from assets/ExportWMSImageParameters.bc1ac1a0.js rename to assets/ExportWMSImageParameters.013012f9.js index 84bbfd5..eb5fe2e 100644 --- a/assets/ExportWMSImageParameters.bc1ac1a0.js +++ b/assets/ExportWMSImageParameters.013012f9.js @@ -1 +1 @@ -import{a4 as c,a6 as a,a7 as l,a8 as h,a9 as b}from"./index.d94abe07.js";const v={visible:"visibleSublayers"};let s=class extends c(b){constructor(e){super(e),this.scale=0}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.handles.remove("layer"),e&&this.handles.add([e.sublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("wms-sublayer-update",r=>this.notifyChange(v[r.propertyName]))],"layer"))}get layers(){return this.visibleSublayers.filter(({name:e})=>e).map(({name:e})=>e).join()}get version(){this.commitProperty("layers");const e=this.layer;return e&&e.commitProperty("imageTransparency"),(this._get("version")||0)+1}get visibleSublayers(){const{layer:e,scale:r}=this,t=e==null?void 0:e.sublayers,i=[],o=n=>{const{minScale:y,maxScale:p,sublayers:u,visible:m}=n;m&&(r===0||(y===0||r<=y)&&(p===0||r>=p))&&(u?u.forEach(o):i.push(n))};return t==null||t.forEach(o),i}toJSON(){const{layer:e,layers:r}=this,{imageFormat:t,imageTransparency:i,version:o}=e;return{format:t,request:"GetMap",service:"WMS",styles:"",transparent:i?"TRUE":"FALSE",version:o,layers:r}}};a([l()],s.prototype,"layer",null),a([l({readOnly:!0})],s.prototype,"layers",null),a([l({type:Number})],s.prototype,"scale",void 0),a([l({readOnly:!0})],s.prototype,"version",null),a([l({readOnly:!0})],s.prototype,"visibleSublayers",null),s=a([h("esri.layers.support.ExportWMSImageParameters")],s);export{s as l}; +import{a4 as c,a6 as a,a7 as l,a8 as h,a9 as b}from"./index.221827cd.js";const v={visible:"visibleSublayers"};let s=class extends c(b){constructor(e){super(e),this.scale=0}set layer(e){this._get("layer")!==e&&(this._set("layer",e),this.handles.remove("layer"),e&&this.handles.add([e.sublayers.on("change",()=>this.notifyChange("visibleSublayers")),e.on("wms-sublayer-update",r=>this.notifyChange(v[r.propertyName]))],"layer"))}get layers(){return this.visibleSublayers.filter(({name:e})=>e).map(({name:e})=>e).join()}get version(){this.commitProperty("layers");const e=this.layer;return e&&e.commitProperty("imageTransparency"),(this._get("version")||0)+1}get visibleSublayers(){const{layer:e,scale:r}=this,t=e==null?void 0:e.sublayers,i=[],o=n=>{const{minScale:y,maxScale:p,sublayers:u,visible:m}=n;m&&(r===0||(y===0||r<=y)&&(p===0||r>=p))&&(u?u.forEach(o):i.push(n))};return t==null||t.forEach(o),i}toJSON(){const{layer:e,layers:r}=this,{imageFormat:t,imageTransparency:i,version:o}=e;return{format:t,request:"GetMap",service:"WMS",styles:"",transparent:i?"TRUE":"FALSE",version:o,layers:r}}};a([l()],s.prototype,"layer",null),a([l({readOnly:!0})],s.prototype,"layers",null),a([l({type:Number})],s.prototype,"scale",void 0),a([l({readOnly:!0})],s.prototype,"version",null),a([l({readOnly:!0})],s.prototype,"visibleSublayers",null),s=a([h("esri.layers.support.ExportWMSImageParameters")],s);export{s as l}; diff --git a/assets/FeatureContainer.4ca52b51.js b/assets/FeatureContainer.b427dd87.js similarity index 97% rename from assets/FeatureContainer.4ca52b51.js rename to assets/FeatureContainer.b427dd87.js index 5c68fa8..4cccddd 100644 --- a/assets/FeatureContainer.4ca52b51.js +++ b/assets/FeatureContainer.b427dd87.js @@ -1,2 +1,2 @@ -import{N as k,cn as rt,b2 as at,co as nt,bo as ot,bq as ht,c as _,j as c,s as dt,cg as L,bc as f,m as D,u as l,n as j,K as H,ch as ut,cp as x,bd as O,aQ as lt,I as m,cq as ct,a3 as _t,cr as pt}from"./index.d94abe07.js";import{Q as A,L as X,ab as N,B as I,C as $,ae as U,af as q,ag as z,ah as C,an as B,ao as Et,O as xt,N as ft,ap as Rt}from"./enums.0295eb81.js";import{r as mt,i as vt}from"./TileContainer.8b7fafe2.js";import{n as gt,l as Tt,f as K}from"./visualVariablesUtils.32e27706.js";import{m as T,o as bt,J as Y,Q as G}from"./Utils.7f6f3a6b.js";import{D as Z,P as J,G as W,L as tt,M as yt,Y as St,V as kt}from"./enums.2d9e6f64.js";import{x as zt}from"./VertexArrayObject.a4c1d809.js";import{E as et}from"./Texture.4c97bad5.js";import{e as Ct,c as wt}from"./utils.4b023c9d.js";class Mt{acquire(t){return{refCount:1,version:-1,labelMat2d:k(),tileMat3:k(),dvs:k()}}release(t){}}class y extends mt{constructor(t,e,s,i){super(t,e,s,i,A,A)}destroy(){super.destroy(),this._transforms&&y.TransformCache.release(this.key.hash)}setTransform(t){const e=this.resolution/t.resolution,s=this.transforms.tileMat3,[i,r]=t.toScreenNoRotation([0,0],[this.x,this.y]),a=this.width/this.rangeX*e,n=this.height/this.rangeY*e;rt(s,a,0,0,0,n,0,i,r,1),at(this.transforms.dvs,t.displayViewMat3,s);const o=this.transforms.labelMat2d,d=window.devicePixelRatio,u=nt(ot(),a*d,0,0,n*d,i*d,r*d);ht(o,t.viewMat2d,u)}_createTransforms(){return y.TransformCache.acquire(this.key.hash)}}y.TransformCache=new Mt;const b=2147483647;class R{constructor(t){this._head=t,this._cursor=t}static from(t,e=0,s=t.byteLength/h.BYTES_PER_RECORD-e){const i=new h(new Int32Array(t,e*h.BYTES_PER_RECORD,s*h.ELEMENTS_PER_RECORD));return new R(i)}size(){let t=this._cursor,e=0;for(;t;)e+=t.size(),t=t._link;return e}get id(){return this._cursor.id}set id(t){this._cursor.id=t}get materialKey(){return this._cursor.materialKey}set materialKey(t){this._cursor.materialKey=t}get insertAfter(){return this._cursor.insertAfter}get indexFrom(){return this._cursor.indexFrom}set indexFrom(t){this._cursor.indexFrom=t}get indexCount(){return this._cursor.indexCount}set indexCount(t){this._cursor.indexCount=t}get vertexFrom(){return this._cursor.vertexFrom}set vertexFrom(t){this._cursor.vertexFrom=t}get vertexCount(){return this._cursor.vertexCount}set vertexCount(t){this._cursor.vertexCount=t}get sortKey(){return this._cursor.sortKey}set sortKey(t){this._cursor.sortKey=t}get index(){return this._cursor._indexStart+this._cursor._index}seekIndex(t){let e=t;for(this._cursor=this._head;this._cursor;){const s=this._cursor.size();if(e=this._packedRecords.length?0:this._packedRecords[t]}getCursor(){return this.copy()}copy(){const t=new h(this._packedRecords);return t._indexStart=this._indexStart,t._link=this._link,t._index=this._index,t._offsets=this._offsets,t._deletedCount=this._deletedCount,t}}h.ELEMENTS_PER_RECORD=X,h.BYTES_PER_RECORD=h.ELEMENTS_PER_RECORD*Int32Array.BYTES_PER_ELEMENT;const P=dt.getLogger("esri.views.2d.engine.webgl.AttributeStoreView"),w=gt(Tt,P);class Q{constructor(t,e,s){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:i,pixelType:r,textureOnly:a}=t,n=T(r);this.shared=s,this.pixelType=r,this.size=e,this.textureOnly=a,a||(this.data=new n(l(i))),this._resetRange()}destroy(){f(this._texture,t=>t.dispose());for(const t in this._fbos)f(this._fbos[t],e=>{t==="0"&&e.detachColorTexture(),e.dispose()}),this._fbos[t]=null;this._texture=null}get _textureDesc(){return{target:yt.TEXTURE_2D,wrapMode:Z.CLAMP_TO_EDGE,pixelFormat:J.RGBA,dataType:this.pixelType,samplingMode:tt.NEAREST,width:this.size,height:this.size}}setData(t,e,s){const i=K(t),r=l(this.data),a=i*this.texelSize+e;!r||a>=r.length||(r[a]=s,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i))}getData(t,e){if(c(this.data))return null;const s=K(t)*this.texelSize+e;return!this.data||s>=this.data.length?null:this.data[s]}getTexture(t){return O(this._texture,()=>this._initTexture(t))}getFBO(t,e=0){if(c(this._fbos[e])){const s={colorTarget:St.TEXTURE,depthStencilTarget:kt.NONE},i=e===0?this.getTexture(t):this._textureDesc;this._fbos[e]=new zt(t,s,i)}return this._fbos[e]}get locked(){return!(this.pixelType!==W.UNSIGNED_BYTE||!this.shared||this.textureOnly||!D("esri-atomics")||!this.data)&&Atomics.load(this.data,0)===1}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(t,e){if(!this.locked){try{const s=this.dirtyStart,i=this.dirtyEnd;if(!this.hasDirty)return;this._resetRange();const r=l(this.data).buffer,a=this.getTexture(t),n=4,o=(s-s%this.size)/this.size,d=(i-i%this.size)/this.size,u=o,E=this.size,v=d,g=o*this.size*n,S=(E+v*this.size)*n-g,F=T(this.pixelType),st=new F(r,g*F.BYTES_PER_ELEMENT,S),it=this.size,V=v-u+1;if(V>this.size)return void P.error(new j("mapview-webgl","Out-of-bounds index when updating AttributeData"));a.updateData(0,0,u,it,V,st)}catch{}e()}}update(t){const{data:e,start:s,end:i}=t;if(_(e)){const r=this.data,a=s*this.texelSize;for(let n=0;nnew Q(r,i,s));else for(let r=0;rL(t,e=>e.destroy())),f(this._defaultTexture,t=>t.dispose())}isEmpty(){const t=this._data;return c(t)}isUpdating(){const t=_(this._pendingAttributeUpdate),e=t;return D("esri-2d-log-updating")&&console.log(`Updating AttributeStoreView ${e} +import{N as k,cn as rt,b2 as at,co as nt,bo as ot,bq as ht,c as _,j as c,s as dt,cg as L,bc as f,m as D,u as l,n as j,K as H,ch as ut,cp as x,bd as O,aQ as lt,I as m,cq as ct,a3 as _t,cr as pt}from"./index.221827cd.js";import{Q as A,L as X,ab as N,B as I,C as $,ae as U,af as q,ag as z,ah as C,an as B,ao as Et,O as xt,N as ft,ap as Rt}from"./enums.0295eb81.js";import{r as mt,i as vt}from"./TileContainer.5aeb32d6.js";import{n as gt,l as Tt,f as K}from"./visualVariablesUtils.061b7a4e.js";import{m as T,o as bt,J as Y,Q as G}from"./Utils.2136650a.js";import{D as Z,P as J,G as W,L as tt,M as yt,Y as St,V as kt}from"./enums.2d9e6f64.js";import{x as zt}from"./VertexArrayObject.53cf1857.js";import{E as et}from"./Texture.940076b2.js";import{e as Ct,c as wt}from"./utils.0160becb.js";class Mt{acquire(t){return{refCount:1,version:-1,labelMat2d:k(),tileMat3:k(),dvs:k()}}release(t){}}class y extends mt{constructor(t,e,s,i){super(t,e,s,i,A,A)}destroy(){super.destroy(),this._transforms&&y.TransformCache.release(this.key.hash)}setTransform(t){const e=this.resolution/t.resolution,s=this.transforms.tileMat3,[i,r]=t.toScreenNoRotation([0,0],[this.x,this.y]),a=this.width/this.rangeX*e,n=this.height/this.rangeY*e;rt(s,a,0,0,0,n,0,i,r,1),at(this.transforms.dvs,t.displayViewMat3,s);const o=this.transforms.labelMat2d,d=window.devicePixelRatio,u=nt(ot(),a*d,0,0,n*d,i*d,r*d);ht(o,t.viewMat2d,u)}_createTransforms(){return y.TransformCache.acquire(this.key.hash)}}y.TransformCache=new Mt;const b=2147483647;class R{constructor(t){this._head=t,this._cursor=t}static from(t,e=0,s=t.byteLength/h.BYTES_PER_RECORD-e){const i=new h(new Int32Array(t,e*h.BYTES_PER_RECORD,s*h.ELEMENTS_PER_RECORD));return new R(i)}size(){let t=this._cursor,e=0;for(;t;)e+=t.size(),t=t._link;return e}get id(){return this._cursor.id}set id(t){this._cursor.id=t}get materialKey(){return this._cursor.materialKey}set materialKey(t){this._cursor.materialKey=t}get insertAfter(){return this._cursor.insertAfter}get indexFrom(){return this._cursor.indexFrom}set indexFrom(t){this._cursor.indexFrom=t}get indexCount(){return this._cursor.indexCount}set indexCount(t){this._cursor.indexCount=t}get vertexFrom(){return this._cursor.vertexFrom}set vertexFrom(t){this._cursor.vertexFrom=t}get vertexCount(){return this._cursor.vertexCount}set vertexCount(t){this._cursor.vertexCount=t}get sortKey(){return this._cursor.sortKey}set sortKey(t){this._cursor.sortKey=t}get index(){return this._cursor._indexStart+this._cursor._index}seekIndex(t){let e=t;for(this._cursor=this._head;this._cursor;){const s=this._cursor.size();if(e=this._packedRecords.length?0:this._packedRecords[t]}getCursor(){return this.copy()}copy(){const t=new h(this._packedRecords);return t._indexStart=this._indexStart,t._link=this._link,t._index=this._index,t._offsets=this._offsets,t._deletedCount=this._deletedCount,t}}h.ELEMENTS_PER_RECORD=X,h.BYTES_PER_RECORD=h.ELEMENTS_PER_RECORD*Int32Array.BYTES_PER_ELEMENT;const P=dt.getLogger("esri.views.2d.engine.webgl.AttributeStoreView"),w=gt(Tt,P);class Q{constructor(t,e,s){this._texture=null,this._lastTexture=null,this._fbos={},this.texelSize=4;const{buffer:i,pixelType:r,textureOnly:a}=t,n=T(r);this.shared=s,this.pixelType=r,this.size=e,this.textureOnly=a,a||(this.data=new n(l(i))),this._resetRange()}destroy(){f(this._texture,t=>t.dispose());for(const t in this._fbos)f(this._fbos[t],e=>{t==="0"&&e.detachColorTexture(),e.dispose()}),this._fbos[t]=null;this._texture=null}get _textureDesc(){return{target:yt.TEXTURE_2D,wrapMode:Z.CLAMP_TO_EDGE,pixelFormat:J.RGBA,dataType:this.pixelType,samplingMode:tt.NEAREST,width:this.size,height:this.size}}setData(t,e,s){const i=K(t),r=l(this.data),a=i*this.texelSize+e;!r||a>=r.length||(r[a]=s,this.dirtyStart=Math.min(this.dirtyStart,i),this.dirtyEnd=Math.max(this.dirtyEnd,i))}getData(t,e){if(c(this.data))return null;const s=K(t)*this.texelSize+e;return!this.data||s>=this.data.length?null:this.data[s]}getTexture(t){return O(this._texture,()=>this._initTexture(t))}getFBO(t,e=0){if(c(this._fbos[e])){const s={colorTarget:St.TEXTURE,depthStencilTarget:kt.NONE},i=e===0?this.getTexture(t):this._textureDesc;this._fbos[e]=new zt(t,s,i)}return this._fbos[e]}get locked(){return!(this.pixelType!==W.UNSIGNED_BYTE||!this.shared||this.textureOnly||!D("esri-atomics")||!this.data)&&Atomics.load(this.data,0)===1}get hasDirty(){const t=this.dirtyStart;return this.dirtyEnd>=t}updateTexture(t,e){if(!this.locked){try{const s=this.dirtyStart,i=this.dirtyEnd;if(!this.hasDirty)return;this._resetRange();const r=l(this.data).buffer,a=this.getTexture(t),n=4,o=(s-s%this.size)/this.size,d=(i-i%this.size)/this.size,u=o,E=this.size,v=d,g=o*this.size*n,S=(E+v*this.size)*n-g,F=T(this.pixelType),st=new F(r,g*F.BYTES_PER_ELEMENT,S),it=this.size,V=v-u+1;if(V>this.size)return void P.error(new j("mapview-webgl","Out-of-bounds index when updating AttributeData"));a.updateData(0,0,u,it,V,st)}catch{}e()}}update(t){const{data:e,start:s,end:i}=t;if(_(e)){const r=this.data,a=s*this.texelSize;for(let n=0;nnew Q(r,i,s));else for(let r=0;rL(t,e=>e.destroy())),f(this._defaultTexture,t=>t.dispose())}isEmpty(){const t=this._data;return c(t)}isUpdating(){const t=_(this._pendingAttributeUpdate),e=t;return D("esri-2d-log-updating")&&console.log(`Updating AttributeStoreView ${e} -> hasPendingUpdate ${t}`),e}getBlock(t){return c(this._data)?null:this._data[t]}setLabelMinZoom(t,e){this.setData(t,0,1,e)}getLabelMinZoom(t){return this.getData(t,0,1,255)}getFilterFlags(t){return this.getData(t,0,0,0)}getVVSize(t){return this.getData(t,N,0,0)}getData(t,e,s,i){if(!this._data)return 0;const r=l(this._data)[e];if(c(r))return 0;const a=r.getData(t,s);return _(a)?a:i}setData(t,e,s,i){const r=l(this._data)[e];l(r).setData(t,s,i)}lockTextureUpload(){this._locked=!0}unlockTextureUpload(){this._locked=!1}forceTextureUpload(){this._forceNextUpload=!0}async requestUpdate(t){if(this._pendingAttributeUpdate)return void P.error(new j("mapview-webgl","Tried to update attribute data with a pending update"));const e=H();return w("AttributeStoreView Update Requested",t),this._pendingAttributeUpdate={data:t,resolver:e},this._onUpdate(),e.promise}update(){if(this._initialized&&_(this._pendingAttributeUpdate)){D("esri-2d-update-debug")&&console.debug("AttributeStoreView::update");const{data:t,resolver:e}=this._pendingAttributeUpdate,s=l(this._data);for(let i=0;if(r,o=>{w(`Updating block ${i}`,o),n.update(o)}))}this._pendingAttributeUpdate=null,e(),this._onUpdate()}}bindTextures(t,e=!0){const s=this._getDefaultTexture(t);if(!this._initialized)return t.bindTexture(s,I),void(e&&(t.bindTexture(s,$),t.bindTexture(s,U),t.bindTexture(s,q),t.bindTexture(s,z),t.bindTexture(s,C),t.bindTexture(s,B)));const i=l(this._data);this._locked&&!this._forceNextUpload||(ut(i,r=>r.updateTexture(t,()=>this._onUpdate())),this._forceNextUpload=!1),t.bindTexture(x(i[Et],s,r=>r.getTexture(t)),I),e&&(t.bindTexture(x(i[xt],s,r=>r.getTexture(t)),B),t.bindTexture(x(i[ft],s,r=>r.getTexture(t)),$),t.bindTexture(x(i[N],s,r=>r.getTexture(t)),U),t.bindTexture(x(i[Rt],s,r=>r.getTexture(t)),q),t.bindTexture(x(i[z],s,r=>r.getTexture(t)),z),t.bindTexture(x(i[C],s,r=>r.getTexture(t)),C))}_getDefaultTexture(t){if(c(this._defaultTexture)){const e={wrapMode:Z.CLAMP_TO_EDGE,pixelFormat:J.RGBA,dataType:W.UNSIGNED_BYTE,samplingMode:tt.NEAREST,width:1,height:1};this._defaultTexture=new et(t,e,new Uint8Array(4))}return this._defaultTexture}}function M(p,t){const e=t.length;if(p{let s=1/0,i=0;for(const o in e.levels){const d=parseFloat(o),u=Math.abs(t-d);uthis.onAttributeStoreUpdate())}destroy(){this.children.forEach(t=>t.destroy()),this.removeAllChildren(),this.attributeView.destroy(),this._materialItemsRequestQueue.clear()}setRendererInfo(t,e,s){this._rendererInfo.setInfo(t,e,s),this.requestRender()}async getMaterialItems(t,e){if(!t||t.length===0)return null;const s=H();return this._materialItemsRequestQueue.push({items:t,abortOptions:e,resolver:s}),this.requestRender(),s.promise}doRender(t){if(t.context.capabilities.enable("textureFloat"),t.context.capabilities.enable("vao"),this._materialItemsRequestQueue.length>0){let e=this._materialItemsRequestQueue.pop();for(;e;)this._processMaterialItemRequest(t,e),e=this._materialItemsRequestQueue.pop()}super.doRender(t)}renderChildren(t){for(const e of this.children)e.commit(t);this._rendererInfo.update(t.state),super.renderChildren(t)}updateTransforms(t){if(this.children.some(e=>e.hasData))for(const e of this.children)e.setTransform(t)}createRenderParams(t){const e=super.createRenderParams(t);return e.rendererInfo=this._rendererInfo,e.attributeView=this.attributeView,e}onAttributeStoreUpdate(){}_processMaterialItemRequest(t,{items:e,abortOptions:s,resolver:i}){const{painter:r,pixelRatio:a}=t,n=e.map(o=>r.textureManager.rasterizeItem(o.symbol,a,o.glyphIds,s));Promise.all(n).then(o=>{if(!this.stage)return void i.reject();const d=o.map((u,E)=>({id:e[E].id,mosaicItem:u}));i.resolve(d)},i.reject)}}export{R as i,y as m,qt as o}; diff --git a/assets/FeatureFilter.d7d1bf79.js b/assets/FeatureFilter.c87783c2.js similarity index 82% rename from assets/FeatureFilter.d7d1bf79.js rename to assets/FeatureFilter.c87783c2.js index d0343a2..8fcb714 100644 --- a/assets/FeatureFilter.d7d1bf79.js +++ b/assets/FeatureFilter.c87783c2.js @@ -1 +1 @@ -import{s as _,at as u,n as m,ay as c,dd as p,aO as y,j as f}from"./index.d94abe07.js";import{v as w,n as I}from"./timeSupport.668a2439.js";import{J as b}from"./utils.399e6089.js";import{u as T}from"./FeatureStore2D.eebd57c6.js";import"./projectionSupport.0542c13b.js";import"./json.879c9adc.js";import"./CircularArray.a4d7e1c2.js";import"./ComputedAttributeStorage.c1cb22b3.js";import"./centroid.cc817cc5.js";import"./enums.0295eb81.js";import"./visualVariablesUtils.32e27706.js";import"./Utils.7f6f3a6b.js";import"./enums.2d9e6f64.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./visualVariablesUtils.aff73e6d.js";const d=_.getLogger("esri.views.2d.layers.features.support.whereUtils"),g={getAttribute:(r,e)=>r.field(e)};async function v(r,e){const t=await u(()=>import("./WhereClause.253310fe.js"),["assets/WhereClause.253310fe.js","assets/index.d94abe07.js","assets/index.f5419ca5.css"]);try{const i=t.WhereClause.create(r,e);if(!i.isStandardized){const s=new m("mapview - bad input","Unable to apply filter's definition expression, as expression is not standardized.",i);d.error(s)}return s=>{const n=s.readArcadeFeature();return i.testFeature(n,g)}}catch{return d.warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",r),s=>!0}}const a=1,E=2;class P{constructor(e){this._geometryBounds=c(),this._idToVisibility=new Map,this._serviceInfo=e}get hash(){return this._hash}check(e){return this._applyFilter(e)}clear(){const e=this._resetAllHiddenIds();return this.update(),{show:e,hide:[]}}invalidate(){this._idToVisibility.forEach((e,t)=>{this._idToVisibility.set(t,0)})}setKnownIds(e){for(const t of e)this._idToVisibility.set(t,a)}setTrue(e){const t=[],i=[],s=new Set(e);return this._idToVisibility.forEach((n,o)=>{const l=!!(this._idToVisibility.get(o)&a),h=s.has(o);!l&&h?t.push(o):l&&!h&&i.push(o),this._idToVisibility.set(o,h?a|E:0)}),{show:t,hide:i}}createQuery(){const{geometry:e,spatialRel:t,where:i,timeExtent:s,objectIds:n}=this;return p.fromJSON({geometry:e,spatialRel:t,where:i,timeExtent:s,objectIds:n})}async update(e,t){this._hash=JSON.stringify(e);const i=await b(e,null,t);await Promise.all([this._setGeometryFilter(i),this._setIdFilter(i),this._setAttributeFilter(i),this._setTimeFilter(i)])}async _setAttributeFilter(e){if(!e||!e.where)return this._clause=null,void(this.where=null);this._clause=await v(e.where,this._serviceInfo.fieldsIndex),this.where=e.where}_setIdFilter(e){this._idsToShow=e&&e.objectIds&&new Set(e.objectIds),this._idsToHide=e&&e.hiddenIds&&new Set(e.hiddenIds),this.objectIds=e&&e.objectIds}async _setGeometryFilter(e){if(!e||!e.geometry)return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const t=e.geometry,i=e.spatialRel||"esriSpatialRelIntersects",s=await w(i,t,this._serviceInfo.geometryType,this._serviceInfo.hasZ,this._serviceInfo.hasM);y(this._geometryBounds,t),this._spatialQueryOperator=s,this.geometry=t,this.spatialRel=i}_setTimeFilter(e){if(this.timeExtent=this._timeOperator=null,e&&e.timeExtent)if(this._serviceInfo.timeInfo)this.timeExtent=e.timeExtent,this._timeOperator=I(this._serviceInfo.timeInfo,e.timeExtent,T);else{const t=new m("feature-layer-view:time-filter-not-available","Unable to apply time filter, as layer doesn't have time metadata.",e.timeExtent);_.getLogger("esri.views.2d.layers.features.controllers.FeatureFilter").error(t)}}_applyFilter(e){return this._filterByGeometry(e)&&this._filterById(e)&&this._filterByTime(e)&&this._filterByExpression(e)}_filterByExpression(e){return!this.where||this._clause(e)}_filterById(e){return(!this._idsToHide||!this._idsToHide.size||!this._idsToHide.has(e.getObjectId()))&&(!this._idsToShow||!this._idsToShow.size||this._idsToShow.has(e.getObjectId()))}_filterByGeometry(e){if(!this.geometry)return!0;const t=e.readHydratedGeometry();return!!t&&this._spatialQueryOperator(t)}_filterByTime(e){return!!f(this._timeOperator)||this._timeOperator(e)}_resetAllHiddenIds(){const e=[];return this._idToVisibility.forEach((t,i)=>{t&a||(this._idToVisibility.set(i,a),e.push(i))}),e}}export{P as default}; +import{s as _,at as u,n as m,ay as c,dd as p,aO as y,j as f}from"./index.221827cd.js";import{v as w,n as I}from"./timeSupport.968e62fc.js";import{J as b}from"./utils.e42485ea.js";import{u as T}from"./FeatureStore2D.3fea35f0.js";import"./projectionSupport.4f5da4af.js";import"./json.879c9adc.js";import"./CircularArray.62f75f43.js";import"./ComputedAttributeStorage.29767acd.js";import"./centroid.06db4b74.js";import"./enums.0295eb81.js";import"./visualVariablesUtils.061b7a4e.js";import"./Utils.2136650a.js";import"./enums.2d9e6f64.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./visualVariablesUtils.62efda9d.js";const d=_.getLogger("esri.views.2d.layers.features.support.whereUtils"),g={getAttribute:(r,e)=>r.field(e)};async function v(r,e){const t=await u(()=>import("./WhereClause.5b749615.js"),["assets/WhereClause.5b749615.js","assets/index.221827cd.js","assets/index.f5419ca5.css"]);try{const i=t.WhereClause.create(r,e);if(!i.isStandardized){const s=new m("mapview - bad input","Unable to apply filter's definition expression, as expression is not standardized.",i);d.error(s)}return s=>{const n=s.readArcadeFeature();return i.testFeature(n,g)}}catch{return d.warn("mapview-bad-where-clause","Encountered an error when evaluating where clause",r),s=>!0}}const a=1,E=2;class P{constructor(e){this._geometryBounds=c(),this._idToVisibility=new Map,this._serviceInfo=e}get hash(){return this._hash}check(e){return this._applyFilter(e)}clear(){const e=this._resetAllHiddenIds();return this.update(),{show:e,hide:[]}}invalidate(){this._idToVisibility.forEach((e,t)=>{this._idToVisibility.set(t,0)})}setKnownIds(e){for(const t of e)this._idToVisibility.set(t,a)}setTrue(e){const t=[],i=[],s=new Set(e);return this._idToVisibility.forEach((n,o)=>{const l=!!(this._idToVisibility.get(o)&a),h=s.has(o);!l&&h?t.push(o):l&&!h&&i.push(o),this._idToVisibility.set(o,h?a|E:0)}),{show:t,hide:i}}createQuery(){const{geometry:e,spatialRel:t,where:i,timeExtent:s,objectIds:n}=this;return p.fromJSON({geometry:e,spatialRel:t,where:i,timeExtent:s,objectIds:n})}async update(e,t){this._hash=JSON.stringify(e);const i=await b(e,null,t);await Promise.all([this._setGeometryFilter(i),this._setIdFilter(i),this._setAttributeFilter(i),this._setTimeFilter(i)])}async _setAttributeFilter(e){if(!e||!e.where)return this._clause=null,void(this.where=null);this._clause=await v(e.where,this._serviceInfo.fieldsIndex),this.where=e.where}_setIdFilter(e){this._idsToShow=e&&e.objectIds&&new Set(e.objectIds),this._idsToHide=e&&e.hiddenIds&&new Set(e.hiddenIds),this.objectIds=e&&e.objectIds}async _setGeometryFilter(e){if(!e||!e.geometry)return this._spatialQueryOperator=null,this.geometry=null,void(this.spatialRel=null);const t=e.geometry,i=e.spatialRel||"esriSpatialRelIntersects",s=await w(i,t,this._serviceInfo.geometryType,this._serviceInfo.hasZ,this._serviceInfo.hasM);y(this._geometryBounds,t),this._spatialQueryOperator=s,this.geometry=t,this.spatialRel=i}_setTimeFilter(e){if(this.timeExtent=this._timeOperator=null,e&&e.timeExtent)if(this._serviceInfo.timeInfo)this.timeExtent=e.timeExtent,this._timeOperator=I(this._serviceInfo.timeInfo,e.timeExtent,T);else{const t=new m("feature-layer-view:time-filter-not-available","Unable to apply time filter, as layer doesn't have time metadata.",e.timeExtent);_.getLogger("esri.views.2d.layers.features.controllers.FeatureFilter").error(t)}}_applyFilter(e){return this._filterByGeometry(e)&&this._filterById(e)&&this._filterByTime(e)&&this._filterByExpression(e)}_filterByExpression(e){return!this.where||this._clause(e)}_filterById(e){return(!this._idsToHide||!this._idsToHide.size||!this._idsToHide.has(e.getObjectId()))&&(!this._idsToShow||!this._idsToShow.size||this._idsToShow.has(e.getObjectId()))}_filterByGeometry(e){if(!this.geometry)return!0;const t=e.readHydratedGeometry();return!!t&&this._spatialQueryOperator(t)}_filterByTime(e){return!!f(this._timeOperator)||this._timeOperator(e)}_resetAllHiddenIds(){const e=[];return this._idToVisibility.forEach((t,i)=>{t&a||(this._idToVisibility.set(i,a),e.push(i))}),e}}export{P as default}; diff --git a/assets/FeatureLayerSource.99e97c87.js b/assets/FeatureLayerSource.98dc2955.js similarity index 97% rename from assets/FeatureLayerSource.99e97c87.js rename to assets/FeatureLayerSource.98dc2955.js index 943b984..d32f682 100644 --- a/assets/FeatureLayerSource.99e97c87.js +++ b/assets/FeatureLayerSource.98dc2955.js @@ -1 +1 @@ -import{gF as oe,j as S,cN as ne,cf as ie,c8 as ue,ba as L,dQ as R,dd as k,gl as le,hJ as de,hK as ce,hL as he,hM as M,U as p,hN as ye,gk as pe,cU as Q,hO as C,d3 as U,hP as fe,c,bX as K,e2 as me,eP as J,aA as ge,hQ as v,a6 as y,a7 as g,a8 as V,a9 as Fe,hR as H,m as G,hS as _e,cO as be,at as Re,n as O,ct as W,hT as Oe,dn as Se,hU as Ie,u as qe,d_ as we,gj as xe,hV as je,aT as Ee,d1 as Te,c9 as De,cv as Z}from"./index.d94abe07.js";import{o as Ae}from"./clientSideDefaults.f5f7bfa0.js";import{n as Ce,s as ve}from"./executeForIds.bade5c1b.js";import"./QueryEngineCapabilities.78217f95.js";var $;(function(t){t[t.PROJECT_VERTICES=1]="PROJECT_VERTICES"})($||($={}));function Ne(t,e){return e}function B(t,e,s,r){switch(s){case 0:return j(t,e+r,0);case 1:return t.originPosition==="lowerLeft"?j(t,e+r,1):Ge(t,e+r,1)}}function ee(t,e,s,r){return s===2?j(t,e,2):B(t,e,s,r)}function Pe(t,e,s,r){return s===2?j(t,e,3):B(t,e,s,r)}function Je(t,e,s,r){return s===3?j(t,e,3):ee(t,e,s,r)}function j({translate:t,scale:e},s,r){return t[r]+s*e[r]}function Ge({translate:t,scale:e},s,r){return t[r]-s*e[r]}class $e{constructor(e){this._options=e,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=Ne,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const s=oe(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(!S(s))for(const r of e.features)s(r.geometry)}createSpatialReference(){return{}}addField(e,s){const r=e.fields;ne(r),r.push(s);const a=r.map(o=>o.name);this._attributesConstructor=function(){for(const o of a)this[o]=null}}addFeature(e,s){e.features.push(s)}prepareFeatures(e){switch(this._transform=e.transform,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"esriGeometryPoint":this.addCoordinate=(s,r,a)=>this.addCoordinatePoint(s,r,a),this.createGeometry=s=>this.createPointGeometry(s);break;case"esriGeometryPolygon":this.addCoordinate=(s,r,a)=>this._addCoordinatePolygon(s,r,a),this.createGeometry=s=>this._createPolygonGeometry(s);break;case"esriGeometryPolyline":this.addCoordinate=(s,r,a)=>this._addCoordinatePolyline(s,r,a),this.createGeometry=s=>this._createPolylineGeometry(s);break;case"esriGeometryMultipoint":this.addCoordinate=(s,r,a)=>this._addCoordinateMultipoint(s,r,a),this.createGeometry=s=>this._createMultipointGeometry(s)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(e,s,r){this._lengths.length===0&&(this._toAddInCurrentPath=s),this._lengths.push(s)}addQueryGeometry(e,s){const{queryGeometry:r,queryGeometryType:a}=s,o=ie(r.clone(),r,!1,!1,this._transform),n=ue(o,a,!1,!1);e.queryGeometryType=a,e.queryGeometry={...n}}createPointGeometry(e){const s={x:0,y:0,spatialReference:e.spatialReference};return e.hasZ&&(s.z=0),e.hasM&&(s.m=0),s}addCoordinatePoint(e,s,r){const a=L(this._transform,"transform");switch(s=this._applyTransform(a,s,r,0),r){case 0:e.x=s;break;case 1:e.y=s;break;case 2:"z"in e?e.z=s:e.m=s;break;case 3:e.m=s}}_transformPathLikeValue(e,s){let r=0;s<=1&&(r=this._previousCoordinate[s],this._previousCoordinate[s]+=e);const a=L(this._transform,"transform");return this._applyTransform(a,e,s,r)}_addCoordinatePolyline(e,s,r){this._dehydratedAddPointsCoordinate(e.paths,s,r)}_addCoordinatePolygon(e,s,r){this._dehydratedAddPointsCoordinate(e.rings,s,r)}_addCoordinateMultipoint(e,s,r){r===0&&e.points.push([]);const a=this._transformPathLikeValue(s,r);e.points[e.points.length-1].push(a)}_createPolygonGeometry(e){return{rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,s,r){r===0&&this._toAddInCurrentPath--==0&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const a=this._transformPathLikeValue(s,r),o=e[e.length-1];r===0&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),o.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=a}_deriveApplyTransform(e){const{hasZ:s,hasM:r}=e;return s&&r?Je:s?ee:r?Pe:B}}async function ke(t,e,s){const r=R(t),a={...s},o=k.from(e),n=!o.quantizationParameters,{data:i}=await le(r,o,new $e({sourceSpatialReference:o.sourceSpatialReference,applyTransform:n}),a);return i}function Me(t){const e=t.toJSON();return e.attachmentTypes&&(e.attachmentTypes=e.attachmentTypes.join(",")),e.keywords&&(e.keywords=e.keywords.join(",")),e.globalIds&&(e.globalIds=e.globalIds.join(",")),e.objectIds&&(e.objectIds=e.objectIds.join(",")),e.size&&(e.size=e.size.join(",")),e}function te(t,e){const s={};for(const r of t){const{parentObjectId:a,parentGlobalId:o,attachmentInfos:n}=r;for(const i of n){const{id:u}=i,l=de(ce(`${e}/${a}/attachments/${u}`)),d=he.fromJSON(i);d.set({url:l,parentObjectId:a,parentGlobalId:o}),s[a]?s[a].push(d):s[a]=[d]}}return s}function Qe(t,e,s){let r={query:M({...t.query,f:"json",...Me(e)})};return s&&(r={...s,...r,query:{...s.query,...r.query}}),p(t.path+"/queryAttachments",r)}async function Ue(t,e,s){const r=R(t);return Qe(r,ye.from(e),{...s}).then(a=>te(a.data.attachmentGroups,r.path))}async function Ve(t,e,s){const r=R(t);return pe(r,k.from(e),{...s}).then(a=>({count:a.data.count,extent:Q.fromJSON(a.data.extent)}))}function Be(t,e){const s=t.toJSON();return s.objectIds&&(s.objectIds=s.objectIds.join(",")),s.orderByFields&&(s.orderByFields=s.orderByFields.join(",")),s.outFields&&!(e!=null&&e.returnCountOnly)?s.outFields.includes("*")?s.outFields="*":s.outFields=s.outFields.join(","):delete s.outFields,s.outSpatialReference&&(s.outSR=s.outSR.wkid||JSON.stringify(s.outSR.toJSON()),delete s.outSpatialReference),s.dynamicDataSource&&(s.layer=JSON.stringify({source:s.dynamicDataSource}),delete s.dynamicDataSource),s}async function ze(t,e,s){const r=await se(t,e,s),a=r.data,o=a.geometryType,n=a.spatialReference,i={};for(const u of a.relatedRecordGroups){const l={fields:void 0,objectIdFieldName:void 0,geometryType:o,spatialReference:n,hasZ:!!a.hasZ,hasM:!!a.hasM,features:u.relatedRecords};if(u.objectId!=null)i[u.objectId]=l;else for(const d in u)u.hasOwnProperty(d)&&d!=="relatedRecords"&&(i[u[d]]=l)}return{...r,data:i}}async function Le(t,e,s){const r=await se(t,e,s,{returnCountOnly:!0}),a=r.data,o={};for(const n of a.relatedRecordGroups)n.objectId!=null&&(o[n.objectId]=n.count);return{...r,data:o}}async function se(t,e,s={},r){const a=M({...t.query,f:"json",...r,...Be(e,r)});return p(t.path+"/queryRelatedRecords",{...s,query:{...s.query,...a}})}async function Ze(t,e,s){e=C.from(e);const r=R(t);return ze(r,e,s).then(a=>{const o=a.data,n={};return Object.keys(o).forEach(i=>n[i]=U.fromJSON(o[i])),n})}async function Xe(t,e,s){e=C.from(e);const r=R(t);return Le(r,e,{...s}).then(a=>a.data)}const X="Layer does not support extent calculation.";function Ye(t,e){var o,n;const s=t.geometry,r=t.toJSON(),a=r;if(c(s)&&(a.geometry=JSON.stringify(s),a.geometryType=ge(s),a.inSR=s.spatialReference.wkid||JSON.stringify(s.spatialReference)),(o=r.topFilter)!=null&&o.groupByFields&&(a.topFilter.groupByFields=r.topFilter.groupByFields.join(",")),(n=r.topFilter)!=null&&n.orderByFields&&(a.topFilter.orderByFields=r.topFilter.orderByFields.join(",")),r.topFilter&&(a.topFilter=JSON.stringify(a.topFilter)),r.objectIds&&(a.objectIds=r.objectIds.join(",")),r.orderByFields&&(a.orderByFields=r.orderByFields.join(",")),r.outFields&&!((e==null?void 0:e.returnCountOnly)||(e==null?void 0:e.returnExtentOnly)||(e==null?void 0:e.returnIdsOnly))?r.outFields.includes("*")?a.outFields="*":a.outFields=r.outFields.join(","):delete a.outFields,r.outSR?a.outSR=r.outSR.wkid||JSON.stringify(r.outSR):s&&r.returnGeometry&&(a.outSR=a.inSR),r.returnGeometry&&delete r.returnGeometry,r.timeExtent){const i=r.timeExtent,{start:u,end:l}=i;u==null&&l==null||(a.time=u===l?u:`${u!=null?u:"null"},${l!=null?l:"null"}`),delete r.timeExtent}return a}async function Ke(t,e,s,r){const a=await N(t,e,"json",r);return fe(e,s,a.data),a}async function He(t,e,s){return c(e.timeExtent)&&e.timeExtent.isEmpty?{data:{objectIds:[]}}:N(t,e,"json",s,{returnIdsOnly:!0})}async function We(t,e,s){return c(e.timeExtent)&&e.timeExtent.isEmpty?{data:{count:0,extent:null}}:N(t,e,"json",s,{returnExtentOnly:!0,returnCountOnly:!0}).then(r=>{const a=r.data;if(a.hasOwnProperty("extent"))return r;if(a.features)throw new Error(X);if(a.hasOwnProperty("count"))throw new Error(X);return r})}function et(t,e,s){return c(e.timeExtent)&&e.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):N(t,e,"json",s,{returnIdsOnly:!0,returnCountOnly:!0})}function N(t,e,s,r={},a={}){const o=typeof t=="string"?K(t):t,n=e.geometry?[e.geometry]:[];return r.responseType=s==="pbf"?"array-buffer":"json",me(n,null,r).then(i=>{const u=i&&i[0];c(u)&&((e=e.clone()).geometry=u);const l=M({...o.query,f:s,...a,...Ye(e,a)});return p(J(o.path,"queryTopFeatures"),{...r,query:{...l,...r.query}})})}async function tt(t,e,s,r){const a=R(t),o={...r},{data:n}=await Ke(a,v.from(e),s,o);return U.fromJSON(n)}async function st(t,e,s){const r=R(t);return(await He(r,v.from(e),{...s})).data.objectIds}async function rt(t,e,s){const r=R(t),a=await We(r,v.from(e),{...s});return{count:a.data.count,extent:Q.fromJSON(a.data.extent)}}async function at(t,e,s){const r=R(t);return(await et(r,v.from(e),{...s})).data.count}let q=class extends Fe{constructor(...t){super(...t),this.requestOptions=null,this.url=null}normalizeCtorArgs(t,e){return typeof t!="string"?t:{url:t,...e}}get parsedUrl(){return this._parseUrl(this.url)}_parseUrl(t){return K(t)}_encode(t,e,s){const r={};for(const a in t){if(a==="declaredClass")continue;const o=t[a];if(o!=null&&typeof o!="function")if(Array.isArray(o)){r[a]=[];for(let n=0;nimport("./meshFeatureSet.81c1d5a6.js").then(function(a){return a.a}),["assets/meshFeatureSet.81c1d5a6.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/georeference.c844666d.js","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/quat.b3994f2f.js","assets/quatf64.4ae3e6f1.js","assets/BufferView.89055914.js","assets/vec33.4564cd5b.js","assets/imageUtils.753f41b1.js","assets/earcut.afc1d357.js","assets/deduplicate.17ab7923.js"]),s);return r(t,this.infoFor3D,e)}executeForCount(t,e){const s={...this.requestOptions,...e},r=this._normalizeQuery(t);return Ce(this.url,r,s)}executeForExtent(t,e){const s={...this.requestOptions,...e},r=this._normalizeQuery(t);return Ve(this.url,r,s)}executeForIds(t,e){const s={...this.requestOptions,...e},r=this._normalizeQuery(t);return ve(this.url,r,s)}executeRelationshipQuery(t,e){t=C.from(t);const s={...this.requestOptions,...e};return(this.gdbVersion||this.dynamicDataSource)&&((t=t.clone()).gdbVersion=t.gdbVersion||this.gdbVersion,t.dynamicDataSource=t.dynamicDataSource||this.dynamicDataSource),Ze(this.url,t,s)}executeRelationshipQueryForCount(t,e){t=C.from(t);const s={...this.requestOptions,...e};return(this.gdbVersion||this.dynamicDataSource)&&((t=t.clone()).gdbVersion=t.gdbVersion||this.gdbVersion,t.dynamicDataSource=t.dynamicDataSource||this.dynamicDataSource),Xe(this.url,t,s)}executeAttachmentQuery(t,e){const s={...this.requestOptions,...e};return Ue(this.url,t,s)}executeTopFeaturesQuery(t,e){const s={...this.requestOptions,...e};return tt(this.parsedUrl,t,this.sourceSpatialReference,s)}executeForTopIds(t,e){const s={...this.requestOptions,...e};return st(this.parsedUrl,t,s)}executeForTopExtents(t,e){const s={...this.requestOptions,...e};return rt(this.parsedUrl,t,s)}executeForTopCount(t,e){const s={...this.requestOptions,...e};return at(this.parsedUrl,t,s)}_normalizeQuery(t){let e=k.from(t);if(e.sourceSpatialReference=e.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(e=e===t?e.clone():e,e.gdbVersion=t.gdbVersion||this.gdbVersion,e.dynamicDataSource=t.dynamicDataSource?H.from(t.dynamicDataSource):this.dynamicDataSource),c(this.infoFor3D)&&this._queryIs3DObjectFormat(t)){e=e===t?e.clone():e,e.formatOf3DObjects=null;for(const s of this.infoFor3D.queryFormats){if(s==="3D_glb"){e.formatOf3DObjects=s;break}s!=="3D_gltf"||e.formatOf3DObjects||(e.formatOf3DObjects=s)}if(!e.formatOf3DObjects)throw new O("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(S(e.outFields)||!e.outFields.includes("*")){e=e===t?e.clone():e,S(e.outFields)&&(e.outFields=[]);const{originX:s,originY:r,originZ:a,translationX:o,translationY:n,translationZ:i,scaleX:u,scaleY:l,scaleZ:d,rotationX:_,rotationY:h,rotationZ:f,rotationDeg:F}=this.infoFor3D.transformFieldRoles;e.outFields.push(s,r,a,o,n,i,u,l,d,_,h,f,F)}}return e}_normalizeFields(t){if(c(this.fieldsIndex)&&c(t))for(const e of t){const s=this.fieldsIndex.get(e.name);s&&Object.assign(e,s.toJSON())}}_queryIs3DObjectFormat(t){return c(this.infoFor3D)&&t.returnGeometry&&t.multipatchOption!=="xyFootprint"&&!t.outStatistics}};y([g({type:H})],b.prototype,"dynamicDataSource",void 0),y([g()],b.prototype,"fieldsIndex",void 0),y([g()],b.prototype,"format",void 0),y([g()],b.prototype,"gdbVersion",void 0),y([g()],b.prototype,"infoFor3D",void 0),y([g()],b.prototype,"sourceSpatialReference",void 0),b=y([V("esri.tasks.QueryTask")],b);const nt=b,it=new W({originalAndCurrentFeatures:"original-and-current-features",none:"none"});async function Y(t){return typeof t=="string"?Z(t)||{data:t}:new Promise((e,s)=>{const r=new FileReader;r.readAsDataURL(t),r.onload=()=>e(Z(r.result)),r.onerror=a=>s(a)})}const ut=new Set(["Feature Layer","Table"]),lt=new W({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let w=class extends Oe{constructor(){super(...arguments),this.type="feature-layer",this.refresh=Se(async()=>{var s,r;await this.load();const t=(s=this.sourceJSON.editingInfo)==null?void 0:s.lastEditDate;if(t==null)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const e=t!==((r=this.sourceJSON.editingInfo)==null?void 0:r.lastEditDate);return{dataChanged:e,updates:e?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}})}load(t){const e=c(t)?t.signal:null;return this.addResolvingPromise(this._fetchService(this.layer.sourceJSON,e)),Promise.resolve(this)}get queryTask(){const{capabilities:{query:{supportsFormatPBF:t}},parsedUrl:e,dynamicDataSource:s,infoFor3D:r,gdbVersion:a,spatialReference:o,fieldsIndex:n}=this.layer,i=G("featurelayer-pbf")&&t&&S(r)?"pbf":"json";return new nt({url:e.path,format:i,fieldsIndex:n,infoFor3D:r,dynamicDataSource:s,gdbVersion:a,sourceSpatialReference:o})}async addAttachment(t,e){await this.load();const s=t.attributes[this.layer.objectIdField],r=this.layer.parsedUrl.path+"/"+s+"/addAttachment",a=this._getLayerRequestOptions(),o=this._getFormDataForAttachment(e,a.query);try{const n=await p(r,{body:o});return this._createFeatureEditResult(n.data.addAttachmentResult)}catch(n){throw this._createAttachmentErrorResult(s,n)}}async updateAttachment(t,e,s){await this.load();const r=t.attributes[this.layer.objectIdField],a=this.layer.parsedUrl.path+"/"+r+"/updateAttachment",o=this._getLayerRequestOptions({query:{attachmentId:e}}),n=this._getFormDataForAttachment(s,o.query);try{const i=await p(a,{body:n});return this._createFeatureEditResult(i.data.updateAttachmentResult)}catch(i){throw this._createAttachmentErrorResult(r,i)}}async applyEdits(t,e){await this.load();const s=this.layer.infoFor3D,r=c(s),a=r||(e==null?void 0:e.globalIdUsed),o=t.addFeatures.map(m=>this._serializeFeature(m,s)),n=t.updateFeatures.map(m=>this._serializeFeature(m,s)),i=this._getFeatureIds(t.deleteFeatures,a);Ie(o,n,this.layer.spatialReference);const u=[],l=[],d=[...t.deleteAttachments];for(const m of t.addAttachments)u.push(await this._serializeAttachment(m));for(const m of t.updateAttachments)l.push(await this._serializeAttachment(m));const _=u.length||l.length||d.length?{adds:u,updates:l,deletes:d}:null;let h,f=null;if(r){f=new Map;const m=[];for(const x of t.addAssets)m.push(this._serializeAssetMapEditAndUploadAssets(x,f));const T=await Promise.all(m);h=T.length?{adds:T,updates:[],deletes:[]}:void 0}const F={gdbVersion:(e==null?void 0:e.gdbVersion)||this.layer.gdbVersion,rollbackOnFailure:e==null?void 0:e.rollbackOnFailureEnabled,useGlobalIds:a,returnEditMoment:e==null?void 0:e.returnEditMoment,usePreviousEditMoment:e==null?void 0:e.usePreviousEditMoment,sessionId:e==null?void 0:e.sessionId};e!=null&&e.returnServiceEditsOption?(F.edits=JSON.stringify([{id:this.layer.layerId,adds:o,updates:n,deletes:i,attachments:_,assetMaps:qe(h)}]),F.returnServiceEditsOption=it.toJSON(e==null?void 0:e.returnServiceEditsOption),F.returnServiceEditsInSourceSR=e==null?void 0:e.returnServiceEditsInSourceSR):(F.adds=o.length?JSON.stringify(o):null,F.updates=n.length?JSON.stringify(n):null,F.deletes=i.length?a?JSON.stringify(i):i.join(","):null,F.attachments=_&&JSON.stringify(_),F.assetMaps=c(h)?JSON.stringify(h):void 0);const re=this._getLayerRequestOptions({method:"post",query:F}),z=e!=null&&e.returnServiceEditsOption?this.layer.url:this.layer.parsedUrl.path,E=await p(z+"/applyEdits",re);if(r&&E.data!=null&&E.data.assetMaps!=null){const m=E.data,T=this.layer.objectIdField,x=[];for(const I of m.addResults)I.success&&x.push(I.objectId);for(const I of m.updateResults)I.success&&x.push(I.objectId);const ae=this._createRequestQueryOptions(),D=await p(z+"/query",{...ae,query:{f:"json",formatOf3DObjects:"3D_glb",where:`OBJECTID IN (${x.join(",")})`,outFields:`${T}`}});if(D&&D.data&&D.data.assetMaps&&c(f)){const I=D.data.assetMaps;for(const P of I){const A=f.get(P.parentGlobalId).geometry;c(A)&&A.type==="mesh"&&A.updateExternalSource({source:[{name:P.assetName,source:P.assetName}],extent:A.extent})}}}return this._createEditsResult(E)}async deleteAttachments(t,e){await this.load();const s=t.attributes[this.layer.objectIdField],r=this.layer.parsedUrl.path+"/"+s+"/deleteAttachments";try{return(await p(r,this._getLayerRequestOptions({query:{attachmentIds:e.join(",")},method:"post"}))).data.deleteAttachmentResults.map(this._createFeatureEditResult)}catch(a){throw this._createAttachmentErrorResult(s,a)}}fetchRecomputedExtents(t={}){const e=t.signal;return this.load({signal:e}).then(async()=>{const s=this._getLayerRequestOptions({...t,query:{returnUpdates:!0}}),{layerId:r,url:a}=this.layer,{data:o}=await p(`${a}/${r}`,s),{id:n,extent:i,fullExtent:u,timeExtent:l}=o,d=i||u;return{id:n,fullExtent:d&&Q.fromJSON(d),timeExtent:l&&we.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(t,e={}){const{parsedUrl:s}=this.layer,r=s.path;await this.load();const a=this._getLayerRequestOptions(e);if(!this.layer.get("capabilities.operations.supportsQueryAttachments")){const{objectIds:o}=t,n=[];for(const i of o){const u=r+"/"+i+"/attachments";n.push(p(u,a))}return Promise.all(n).then(i=>o.map((u,l)=>({parentObjectId:u,attachmentInfos:i[l].data.attachmentInfos}))).then(i=>te(i,r))}return this.queryTask.executeAttachmentQuery(t,a)}async queryFeatures(t,e){return await this.load(),this.queryTask.execute(t,{...e,query:this._createRequestQueryOptions(e)})}async queryFeaturesJSON(t,e){return await this.load(),this.queryTask.executeJSON(t,{...e,query:this._createRequestQueryOptions(e)})}async queryObjectIds(t,e){return await this.load(),this.queryTask.executeForIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryFeatureCount(t,e){return await this.load(),this.queryTask.executeForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryExtent(t,e){return await this.load(),this.queryTask.executeForExtent(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeatures(t,e){return await this.load(),this.queryTask.executeRelationshipQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeaturesCount(t,e){return await this.load(),this.queryTask.executeRelationshipQueryForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopFeatures(t,e){return await this.load(),this.queryTask.executeTopFeaturesQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopObjectIds(t,e){return await this.load(),this.queryTask.executeForTopIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopExtents(t,e){return await this.load(),this.queryTask.executeForTopExtents(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopCount(t,e){return await this.load(),this.queryTask.executeForTopCount(t,{...e,query:this._createRequestQueryOptions(e)})}async fetchPublishingStatus(){if(!xe(this.layer.url))return"unavailable";const t=J(this.layer.url,"status"),e=await p(t,{query:{f:"json"}});return lt.fromJSON(e.data.status)}_createRequestQueryOptions(t){const e={...this.layer.customParameters,token:this.layer.apiKey,...t==null?void 0:t.query};return this.layer.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),e}async _fetchService(t,e){if(!t){const{data:r}=await p(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:G("featurelayer-advanced-symbols")?{returnAdvancedSymbols:!0}:{},signal:e}));t=r}this.sourceJSON=this._patchServiceJSON(t);const s=t.type;if(!ut.has(s))throw new O("feature-layer-source:unsupported-type",`Source type "${s}" is not supported`)}_patchServiceJSON(t){var e;if(t.type!=="Table"&&t.geometryType&&!((e=t==null?void 0:t.drawingInfo)!=null&&e.renderer)&&!t.defaultSymbol){const s=Ae(t.geometryType).renderer;je("drawingInfo.renderer",s,t)}return t.geometryType==="esriGeometryMultiPatch"&&t.infoFor3D&&(t.geometryType="mesh"),t}_serializeFeature(t,e){const{geometry:s,attributes:r}=t;if(c(e)&&c(t.geometry)&&t.geometry.type==="mesh"){const a={...r},o=t.geometry,n=o.origin,i=o.transform;if(a[e.transformFieldRoles.originX]=n.x,a[e.transformFieldRoles.originY]=n.y,a[e.transformFieldRoles.originZ]=n.z,c(i)){const u=i.translation,l=i.scale,d=i.rotation;a[e.transformFieldRoles.translationX]=u[0],a[e.transformFieldRoles.translationY]=u[1],a[e.transformFieldRoles.translationZ]=u[2],a[e.transformFieldRoles.scaleX]=l[0],a[e.transformFieldRoles.scaleY]=l[1],a[e.transformFieldRoles.scaleZ]=l[2],a[e.transformFieldRoles.rotationX]=d[0],a[e.transformFieldRoles.rotationY]=d[1],a[e.transformFieldRoles.rotationZ]=d[2],a[e.transformFieldRoles.rotationDeg]=d[3]}return{geometry:null,attributes:a}}return S(s)?{attributes:r}:s.type==="mesh"||s.type==="extent"?null:{geometry:s.toJSON(),attributes:r}}async _serializeAttachment(t){const{feature:e,attachment:s}=t,{globalId:r,name:a,contentType:o,data:n,uploadId:i}=s,u={globalId:r,parentGlobalId:null,contentType:null,name:null,uploadId:null,data:null};if(e&&(u.parentGlobalId="attributes"in e?e.attributes&&e.attributes[this.layer.globalIdField]:e.globalId),i)u.uploadId=i;else if(n){const l=await Y(n);u.contentType=l.mediaType,u.data=l.data,n instanceof File&&(u.name=n.name)}return a&&(u.name=a),o&&(u.contentType=o),u}async _serializeAssetMapEditAndUploadAssets(t,e){const s=this.layer.url;let r=null;try{const l=new Blob([t.data],{type:t.mimeType}),d=new FormData;d.append("f","json"),d.append("file",l,`${t.assetName}`);const _={body:d,method:"post",responseType:"json"},{data:h}=await p(`${s}/uploads/upload`,_);if(!h.success)throw new O("feature-layer-source:upload-failure","Expected upload to be successfull.");r={assetType:t.assetType,assetUploadId:h.item.itemID}}catch{r=null}if(S(r)){const l=await Y(new Blob([t.data]));if(!l.isBase64)throw new O("feature-layer-source:uploadAssets-failure","Expected gltf data in base64 format after conversion.");r={assetType:t.assetType,assetData:l.data}}if(S(r))throw new O("feature-layer-source:uploadAssets-failure","Unable to prepare uploadAsset request options.");const a={method:"post",query:{f:"json",assets:JSON.stringify([r])},responseType:"json"},o=await p(J(this.layer.parsedUrl.path,"uploadAssets"),a);if(o.data.uploadResults.length!==1||!o.data.uploadResults[0].success)throw new O("feature-layer-source:uploadAssets-failure","Bad response.");const n=o.data.uploadResults[0].assetHash,i=[];t.flags&$.PROJECT_VERTICES&&i.push("PROJECT_VERTICES");const u={globalId:t.assetMapGlobalId,parentGlobalId:t.featureGlobalId,assetName:t.assetName,assetHash:n,flags:i};return e.set(t.featureGlobalId,t.feature),u}_getFeatureIds(t,e){const s=t[0];return s?this._canUseGlobalIds(e,t)?this._getGlobalIdsFromFeatureIdentifier(t):"objectId"in s?this._getObjectIdsFromFeatureIdentifier(t):this._getIdsFromFeatures(t):[]}_getIdsFromFeatures(t){const e=this.layer.objectIdField;return t.map(s=>s.attributes&&s.attributes[e])}_canUseGlobalIds(t,e){return t&&"globalId"in e[0]}_getObjectIdsFromFeatureIdentifier(t){return t.map(e=>e.objectId)}_getGlobalIdsFromFeatureIdentifier(t){return t.map(e=>e.globalId)}_createEditsResult(t){const e=t.data,{layerId:s}=this.layer,r=[];let a=null;if(Array.isArray(e))for(const i of e)r.push({id:i.id,editedFeatures:i.editedFeatures}),i.id===s&&(a={addResults:i.addResults,updateResults:i.updateResults,deleteResults:i.deleteResults,attachments:i.attachments,editMoment:i.editMoment});else a=e;const o=a==null?void 0:a.attachments,n={addFeatureResults:a.addResults?a.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:a.updateResults?a.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:a.deleteResults?a.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:o&&o.addResults?o.addResults.map(this._createFeatureEditResult,this):[],updateAttachmentResults:o&&o.updateResults?o.updateResults.map(this._createFeatureEditResult,this):[],deleteAttachmentResults:o&&o.deleteResults?o.deleteResults.map(this._createFeatureEditResult,this):[]};if(a.editMoment&&(n.editMoment=a.editMoment),r.length>0){n.editedFeatureResults=[];for(const i of r){const{adds:u,updates:l,deletes:d,spatialReference:_}=i.editedFeatures,h=_?new Ee(_):null;n.editedFeatureResults.push({layerId:i.id,editedFeatures:{adds:(u==null?void 0:u.map(f=>this._createEditedFeature(f,h)))||[],updates:(l==null?void 0:l.map(f=>({original:this._createEditedFeature(f[0],h),current:this._createEditedFeature(f[1],h)})))||[],deletes:(d==null?void 0:d.map(f=>this._createEditedFeature(f,h)))||[],spatialReference:h}})}}return n}_createEditedFeature(t,e){return new Te({attributes:t.attributes,geometry:De({...t.geometry,spatialReference:e})})}_createFeatureEditResult(t){const e=t.success===!0?null:t.error||{code:void 0,description:void 0};return{objectId:t.objectId,globalId:t.globalId,error:e?new O("feature-layer-source:edit-failure",e.description,{code:e.code}):null}}_createAttachmentErrorResult(t,e){const s=e.details.messages&&e.details.messages[0]||e.message,r=e.details.httpStatus||e.details.messageCode;return{objectId:t,globalId:null,error:new O("feature-layer-source:attachment-failure",s,{code:r})}}_getFormDataForAttachment(t,e){const s=t instanceof FormData?t:t&&t.elements?new FormData(t):null;if(s)for(const r in e){const a=e[r];a!=null&&(s.set?s.set(r,a):s.append(r,a))}return s}_getLayerRequestOptions(t={}){const{parsedUrl:e,gdbVersion:s,dynamicDataSource:r}=this.layer;return{...t,query:{gdbVersion:s,layer:r?JSON.stringify({source:r}):void 0,...e.query,f:"json",...this._createRequestQueryOptions(t)},responseType:"json"}}};y([g()],w.prototype,"type",void 0),y([g({constructOnly:!0})],w.prototype,"layer",void 0),y([g({readOnly:!0})],w.prototype,"queryTask",null),w=y([V("esri.layers.graphics.sources.FeatureLayerSource")],w);const pt=w;export{pt as default}; +import{gF as oe,j as S,cN as ne,cf as ie,c8 as ue,ba as L,dQ as R,dd as k,gl as le,hJ as de,hK as ce,hL as he,hM as M,U as p,hN as ye,gk as pe,cU as Q,hO as C,d3 as U,hP as fe,c,bX as K,e2 as me,eP as J,aA as ge,hQ as v,a6 as y,a7 as g,a8 as V,a9 as Fe,hR as H,m as G,hS as _e,cO as be,at as Re,n as O,ct as W,hT as Oe,dn as Se,hU as Ie,u as qe,d_ as we,gj as xe,hV as je,aT as Ee,d1 as Te,c9 as De,cv as Z}from"./index.221827cd.js";import{o as Ae}from"./clientSideDefaults.d40b9315.js";import{n as Ce,s as ve}from"./executeForIds.9f78e2a6.js";import"./QueryEngineCapabilities.78217f95.js";var $;(function(t){t[t.PROJECT_VERTICES=1]="PROJECT_VERTICES"})($||($={}));function Ne(t,e){return e}function B(t,e,s,r){switch(s){case 0:return j(t,e+r,0);case 1:return t.originPosition==="lowerLeft"?j(t,e+r,1):Ge(t,e+r,1)}}function ee(t,e,s,r){return s===2?j(t,e,2):B(t,e,s,r)}function Pe(t,e,s,r){return s===2?j(t,e,3):B(t,e,s,r)}function Je(t,e,s,r){return s===3?j(t,e,3):ee(t,e,s,r)}function j({translate:t,scale:e},s,r){return t[r]+s*e[r]}function Ge({translate:t,scale:e},s,r){return t[r]-s*e[r]}class $e{constructor(e){this._options=e,this.geometryTypes=["esriGeometryPoint","esriGeometryMultipoint","esriGeometryPolyline","esriGeometryPolygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=Ne,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return{fields:[],features:[]}}finishFeatureResult(e){if(this._options.applyTransform&&(e.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!e.hasZ)return;const s=oe(e.geometryType,this._options.sourceSpatialReference,e.spatialReference);if(!S(s))for(const r of e.features)s(r.geometry)}createSpatialReference(){return{}}addField(e,s){const r=e.fields;ne(r),r.push(s);const a=r.map(o=>o.name);this._attributesConstructor=function(){for(const o of a)this[o]=null}}addFeature(e,s){e.features.push(s)}prepareFeatures(e){switch(this._transform=e.transform,this._options.applyTransform&&e.transform&&(this._applyTransform=this._deriveApplyTransform(e)),this._vertexDimension=2,e.hasZ&&this._vertexDimension++,e.hasM&&this._vertexDimension++,e.geometryType){case"esriGeometryPoint":this.addCoordinate=(s,r,a)=>this.addCoordinatePoint(s,r,a),this.createGeometry=s=>this.createPointGeometry(s);break;case"esriGeometryPolygon":this.addCoordinate=(s,r,a)=>this._addCoordinatePolygon(s,r,a),this.createGeometry=s=>this._createPolygonGeometry(s);break;case"esriGeometryPolyline":this.addCoordinate=(s,r,a)=>this._addCoordinatePolyline(s,r,a),this.createGeometry=s=>this._createPolylineGeometry(s);break;case"esriGeometryMultipoint":this.addCoordinate=(s,r,a)=>this._addCoordinateMultipoint(s,r,a),this.createGeometry=s=>this._createMultipointGeometry(s)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,{attributes:new this._attributesConstructor}}allocateCoordinates(){}addLength(e,s,r){this._lengths.length===0&&(this._toAddInCurrentPath=s),this._lengths.push(s)}addQueryGeometry(e,s){const{queryGeometry:r,queryGeometryType:a}=s,o=ie(r.clone(),r,!1,!1,this._transform),n=ue(o,a,!1,!1);e.queryGeometryType=a,e.queryGeometry={...n}}createPointGeometry(e){const s={x:0,y:0,spatialReference:e.spatialReference};return e.hasZ&&(s.z=0),e.hasM&&(s.m=0),s}addCoordinatePoint(e,s,r){const a=L(this._transform,"transform");switch(s=this._applyTransform(a,s,r,0),r){case 0:e.x=s;break;case 1:e.y=s;break;case 2:"z"in e?e.z=s:e.m=s;break;case 3:e.m=s}}_transformPathLikeValue(e,s){let r=0;s<=1&&(r=this._previousCoordinate[s],this._previousCoordinate[s]+=e);const a=L(this._transform,"transform");return this._applyTransform(a,e,s,r)}_addCoordinatePolyline(e,s,r){this._dehydratedAddPointsCoordinate(e.paths,s,r)}_addCoordinatePolygon(e,s,r){this._dehydratedAddPointsCoordinate(e.rings,s,r)}_addCoordinateMultipoint(e,s,r){r===0&&e.points.push([]);const a=this._transformPathLikeValue(s,r);e.points[e.points.length-1].push(a)}_createPolygonGeometry(e){return{rings:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createPolylineGeometry(e){return{paths:[[]],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_createMultipointGeometry(e){return{points:[],spatialReference:e.spatialReference,hasZ:!!e.hasZ,hasM:!!e.hasM}}_dehydratedAddPointsCoordinate(e,s,r){r===0&&this._toAddInCurrentPath--==0&&(e.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const a=this._transformPathLikeValue(s,r),o=e[e.length-1];r===0&&(this._coordinateBufferPtr=0,this._coordinateBuffer=new Array(this._vertexDimension),o.push(this._coordinateBuffer)),this._coordinateBuffer[this._coordinateBufferPtr++]=a}_deriveApplyTransform(e){const{hasZ:s,hasM:r}=e;return s&&r?Je:s?ee:r?Pe:B}}async function ke(t,e,s){const r=R(t),a={...s},o=k.from(e),n=!o.quantizationParameters,{data:i}=await le(r,o,new $e({sourceSpatialReference:o.sourceSpatialReference,applyTransform:n}),a);return i}function Me(t){const e=t.toJSON();return e.attachmentTypes&&(e.attachmentTypes=e.attachmentTypes.join(",")),e.keywords&&(e.keywords=e.keywords.join(",")),e.globalIds&&(e.globalIds=e.globalIds.join(",")),e.objectIds&&(e.objectIds=e.objectIds.join(",")),e.size&&(e.size=e.size.join(",")),e}function te(t,e){const s={};for(const r of t){const{parentObjectId:a,parentGlobalId:o,attachmentInfos:n}=r;for(const i of n){const{id:u}=i,l=de(ce(`${e}/${a}/attachments/${u}`)),d=he.fromJSON(i);d.set({url:l,parentObjectId:a,parentGlobalId:o}),s[a]?s[a].push(d):s[a]=[d]}}return s}function Qe(t,e,s){let r={query:M({...t.query,f:"json",...Me(e)})};return s&&(r={...s,...r,query:{...s.query,...r.query}}),p(t.path+"/queryAttachments",r)}async function Ue(t,e,s){const r=R(t);return Qe(r,ye.from(e),{...s}).then(a=>te(a.data.attachmentGroups,r.path))}async function Ve(t,e,s){const r=R(t);return pe(r,k.from(e),{...s}).then(a=>({count:a.data.count,extent:Q.fromJSON(a.data.extent)}))}function Be(t,e){const s=t.toJSON();return s.objectIds&&(s.objectIds=s.objectIds.join(",")),s.orderByFields&&(s.orderByFields=s.orderByFields.join(",")),s.outFields&&!(e!=null&&e.returnCountOnly)?s.outFields.includes("*")?s.outFields="*":s.outFields=s.outFields.join(","):delete s.outFields,s.outSpatialReference&&(s.outSR=s.outSR.wkid||JSON.stringify(s.outSR.toJSON()),delete s.outSpatialReference),s.dynamicDataSource&&(s.layer=JSON.stringify({source:s.dynamicDataSource}),delete s.dynamicDataSource),s}async function ze(t,e,s){const r=await se(t,e,s),a=r.data,o=a.geometryType,n=a.spatialReference,i={};for(const u of a.relatedRecordGroups){const l={fields:void 0,objectIdFieldName:void 0,geometryType:o,spatialReference:n,hasZ:!!a.hasZ,hasM:!!a.hasM,features:u.relatedRecords};if(u.objectId!=null)i[u.objectId]=l;else for(const d in u)u.hasOwnProperty(d)&&d!=="relatedRecords"&&(i[u[d]]=l)}return{...r,data:i}}async function Le(t,e,s){const r=await se(t,e,s,{returnCountOnly:!0}),a=r.data,o={};for(const n of a.relatedRecordGroups)n.objectId!=null&&(o[n.objectId]=n.count);return{...r,data:o}}async function se(t,e,s={},r){const a=M({...t.query,f:"json",...r,...Be(e,r)});return p(t.path+"/queryRelatedRecords",{...s,query:{...s.query,...a}})}async function Ze(t,e,s){e=C.from(e);const r=R(t);return ze(r,e,s).then(a=>{const o=a.data,n={};return Object.keys(o).forEach(i=>n[i]=U.fromJSON(o[i])),n})}async function Xe(t,e,s){e=C.from(e);const r=R(t);return Le(r,e,{...s}).then(a=>a.data)}const X="Layer does not support extent calculation.";function Ye(t,e){var o,n;const s=t.geometry,r=t.toJSON(),a=r;if(c(s)&&(a.geometry=JSON.stringify(s),a.geometryType=ge(s),a.inSR=s.spatialReference.wkid||JSON.stringify(s.spatialReference)),(o=r.topFilter)!=null&&o.groupByFields&&(a.topFilter.groupByFields=r.topFilter.groupByFields.join(",")),(n=r.topFilter)!=null&&n.orderByFields&&(a.topFilter.orderByFields=r.topFilter.orderByFields.join(",")),r.topFilter&&(a.topFilter=JSON.stringify(a.topFilter)),r.objectIds&&(a.objectIds=r.objectIds.join(",")),r.orderByFields&&(a.orderByFields=r.orderByFields.join(",")),r.outFields&&!((e==null?void 0:e.returnCountOnly)||(e==null?void 0:e.returnExtentOnly)||(e==null?void 0:e.returnIdsOnly))?r.outFields.includes("*")?a.outFields="*":a.outFields=r.outFields.join(","):delete a.outFields,r.outSR?a.outSR=r.outSR.wkid||JSON.stringify(r.outSR):s&&r.returnGeometry&&(a.outSR=a.inSR),r.returnGeometry&&delete r.returnGeometry,r.timeExtent){const i=r.timeExtent,{start:u,end:l}=i;u==null&&l==null||(a.time=u===l?u:`${u!=null?u:"null"},${l!=null?l:"null"}`),delete r.timeExtent}return a}async function Ke(t,e,s,r){const a=await N(t,e,"json",r);return fe(e,s,a.data),a}async function He(t,e,s){return c(e.timeExtent)&&e.timeExtent.isEmpty?{data:{objectIds:[]}}:N(t,e,"json",s,{returnIdsOnly:!0})}async function We(t,e,s){return c(e.timeExtent)&&e.timeExtent.isEmpty?{data:{count:0,extent:null}}:N(t,e,"json",s,{returnExtentOnly:!0,returnCountOnly:!0}).then(r=>{const a=r.data;if(a.hasOwnProperty("extent"))return r;if(a.features)throw new Error(X);if(a.hasOwnProperty("count"))throw new Error(X);return r})}function et(t,e,s){return c(e.timeExtent)&&e.timeExtent.isEmpty?Promise.resolve({data:{count:0}}):N(t,e,"json",s,{returnIdsOnly:!0,returnCountOnly:!0})}function N(t,e,s,r={},a={}){const o=typeof t=="string"?K(t):t,n=e.geometry?[e.geometry]:[];return r.responseType=s==="pbf"?"array-buffer":"json",me(n,null,r).then(i=>{const u=i&&i[0];c(u)&&((e=e.clone()).geometry=u);const l=M({...o.query,f:s,...a,...Ye(e,a)});return p(J(o.path,"queryTopFeatures"),{...r,query:{...l,...r.query}})})}async function tt(t,e,s,r){const a=R(t),o={...r},{data:n}=await Ke(a,v.from(e),s,o);return U.fromJSON(n)}async function st(t,e,s){const r=R(t);return(await He(r,v.from(e),{...s})).data.objectIds}async function rt(t,e,s){const r=R(t),a=await We(r,v.from(e),{...s});return{count:a.data.count,extent:Q.fromJSON(a.data.extent)}}async function at(t,e,s){const r=R(t);return(await et(r,v.from(e),{...s})).data.count}let q=class extends Fe{constructor(...t){super(...t),this.requestOptions=null,this.url=null}normalizeCtorArgs(t,e){return typeof t!="string"?t:{url:t,...e}}get parsedUrl(){return this._parseUrl(this.url)}_parseUrl(t){return K(t)}_encode(t,e,s){const r={};for(const a in t){if(a==="declaredClass")continue;const o=t[a];if(o!=null&&typeof o!="function")if(Array.isArray(o)){r[a]=[];for(let n=0;nimport("./meshFeatureSet.eec93388.js").then(function(a){return a.a}),["assets/meshFeatureSet.eec93388.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/georeference.1d7480c1.js","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/quat.d9562009.js","assets/quatf64.4ae3e6f1.js","assets/BufferView.6eee27cd.js","assets/vec33.46fc6802.js","assets/imageUtils.753f41b1.js","assets/earcut.afc1d357.js","assets/deduplicate.ef93b18a.js"]),s);return r(t,this.infoFor3D,e)}executeForCount(t,e){const s={...this.requestOptions,...e},r=this._normalizeQuery(t);return Ce(this.url,r,s)}executeForExtent(t,e){const s={...this.requestOptions,...e},r=this._normalizeQuery(t);return Ve(this.url,r,s)}executeForIds(t,e){const s={...this.requestOptions,...e},r=this._normalizeQuery(t);return ve(this.url,r,s)}executeRelationshipQuery(t,e){t=C.from(t);const s={...this.requestOptions,...e};return(this.gdbVersion||this.dynamicDataSource)&&((t=t.clone()).gdbVersion=t.gdbVersion||this.gdbVersion,t.dynamicDataSource=t.dynamicDataSource||this.dynamicDataSource),Ze(this.url,t,s)}executeRelationshipQueryForCount(t,e){t=C.from(t);const s={...this.requestOptions,...e};return(this.gdbVersion||this.dynamicDataSource)&&((t=t.clone()).gdbVersion=t.gdbVersion||this.gdbVersion,t.dynamicDataSource=t.dynamicDataSource||this.dynamicDataSource),Xe(this.url,t,s)}executeAttachmentQuery(t,e){const s={...this.requestOptions,...e};return Ue(this.url,t,s)}executeTopFeaturesQuery(t,e){const s={...this.requestOptions,...e};return tt(this.parsedUrl,t,this.sourceSpatialReference,s)}executeForTopIds(t,e){const s={...this.requestOptions,...e};return st(this.parsedUrl,t,s)}executeForTopExtents(t,e){const s={...this.requestOptions,...e};return rt(this.parsedUrl,t,s)}executeForTopCount(t,e){const s={...this.requestOptions,...e};return at(this.parsedUrl,t,s)}_normalizeQuery(t){let e=k.from(t);if(e.sourceSpatialReference=e.sourceSpatialReference||this.sourceSpatialReference,(this.gdbVersion||this.dynamicDataSource)&&(e=e===t?e.clone():e,e.gdbVersion=t.gdbVersion||this.gdbVersion,e.dynamicDataSource=t.dynamicDataSource?H.from(t.dynamicDataSource):this.dynamicDataSource),c(this.infoFor3D)&&this._queryIs3DObjectFormat(t)){e=e===t?e.clone():e,e.formatOf3DObjects=null;for(const s of this.infoFor3D.queryFormats){if(s==="3D_glb"){e.formatOf3DObjects=s;break}s!=="3D_gltf"||e.formatOf3DObjects||(e.formatOf3DObjects=s)}if(!e.formatOf3DObjects)throw new O("query:unsupported-3d-query-formats","Could not find any supported 3D object query format. Only supported formats are 3D_glb and 3D_gltf");if(S(e.outFields)||!e.outFields.includes("*")){e=e===t?e.clone():e,S(e.outFields)&&(e.outFields=[]);const{originX:s,originY:r,originZ:a,translationX:o,translationY:n,translationZ:i,scaleX:u,scaleY:l,scaleZ:d,rotationX:_,rotationY:h,rotationZ:f,rotationDeg:F}=this.infoFor3D.transformFieldRoles;e.outFields.push(s,r,a,o,n,i,u,l,d,_,h,f,F)}}return e}_normalizeFields(t){if(c(this.fieldsIndex)&&c(t))for(const e of t){const s=this.fieldsIndex.get(e.name);s&&Object.assign(e,s.toJSON())}}_queryIs3DObjectFormat(t){return c(this.infoFor3D)&&t.returnGeometry&&t.multipatchOption!=="xyFootprint"&&!t.outStatistics}};y([g({type:H})],b.prototype,"dynamicDataSource",void 0),y([g()],b.prototype,"fieldsIndex",void 0),y([g()],b.prototype,"format",void 0),y([g()],b.prototype,"gdbVersion",void 0),y([g()],b.prototype,"infoFor3D",void 0),y([g()],b.prototype,"sourceSpatialReference",void 0),b=y([V("esri.tasks.QueryTask")],b);const nt=b,it=new W({originalAndCurrentFeatures:"original-and-current-features",none:"none"});async function Y(t){return typeof t=="string"?Z(t)||{data:t}:new Promise((e,s)=>{const r=new FileReader;r.readAsDataURL(t),r.onload=()=>e(Z(r.result)),r.onerror=a=>s(a)})}const ut=new Set(["Feature Layer","Table"]),lt=new W({Started:"published",Publishing:"publishing",Stopped:"unavailable"});let w=class extends Oe{constructor(){super(...arguments),this.type="feature-layer",this.refresh=Se(async()=>{var s,r;await this.load();const t=(s=this.sourceJSON.editingInfo)==null?void 0:s.lastEditDate;if(t==null)return{dataChanged:!0,updates:{}};try{await this._fetchService(null)}catch{return{dataChanged:!0,updates:{}}}const e=t!==((r=this.sourceJSON.editingInfo)==null?void 0:r.lastEditDate);return{dataChanged:e,updates:e?{editingInfo:this.sourceJSON.editingInfo,extent:this.sourceJSON.extent}:null}})}load(t){const e=c(t)?t.signal:null;return this.addResolvingPromise(this._fetchService(this.layer.sourceJSON,e)),Promise.resolve(this)}get queryTask(){const{capabilities:{query:{supportsFormatPBF:t}},parsedUrl:e,dynamicDataSource:s,infoFor3D:r,gdbVersion:a,spatialReference:o,fieldsIndex:n}=this.layer,i=G("featurelayer-pbf")&&t&&S(r)?"pbf":"json";return new nt({url:e.path,format:i,fieldsIndex:n,infoFor3D:r,dynamicDataSource:s,gdbVersion:a,sourceSpatialReference:o})}async addAttachment(t,e){await this.load();const s=t.attributes[this.layer.objectIdField],r=this.layer.parsedUrl.path+"/"+s+"/addAttachment",a=this._getLayerRequestOptions(),o=this._getFormDataForAttachment(e,a.query);try{const n=await p(r,{body:o});return this._createFeatureEditResult(n.data.addAttachmentResult)}catch(n){throw this._createAttachmentErrorResult(s,n)}}async updateAttachment(t,e,s){await this.load();const r=t.attributes[this.layer.objectIdField],a=this.layer.parsedUrl.path+"/"+r+"/updateAttachment",o=this._getLayerRequestOptions({query:{attachmentId:e}}),n=this._getFormDataForAttachment(s,o.query);try{const i=await p(a,{body:n});return this._createFeatureEditResult(i.data.updateAttachmentResult)}catch(i){throw this._createAttachmentErrorResult(r,i)}}async applyEdits(t,e){await this.load();const s=this.layer.infoFor3D,r=c(s),a=r||(e==null?void 0:e.globalIdUsed),o=t.addFeatures.map(m=>this._serializeFeature(m,s)),n=t.updateFeatures.map(m=>this._serializeFeature(m,s)),i=this._getFeatureIds(t.deleteFeatures,a);Ie(o,n,this.layer.spatialReference);const u=[],l=[],d=[...t.deleteAttachments];for(const m of t.addAttachments)u.push(await this._serializeAttachment(m));for(const m of t.updateAttachments)l.push(await this._serializeAttachment(m));const _=u.length||l.length||d.length?{adds:u,updates:l,deletes:d}:null;let h,f=null;if(r){f=new Map;const m=[];for(const x of t.addAssets)m.push(this._serializeAssetMapEditAndUploadAssets(x,f));const T=await Promise.all(m);h=T.length?{adds:T,updates:[],deletes:[]}:void 0}const F={gdbVersion:(e==null?void 0:e.gdbVersion)||this.layer.gdbVersion,rollbackOnFailure:e==null?void 0:e.rollbackOnFailureEnabled,useGlobalIds:a,returnEditMoment:e==null?void 0:e.returnEditMoment,usePreviousEditMoment:e==null?void 0:e.usePreviousEditMoment,sessionId:e==null?void 0:e.sessionId};e!=null&&e.returnServiceEditsOption?(F.edits=JSON.stringify([{id:this.layer.layerId,adds:o,updates:n,deletes:i,attachments:_,assetMaps:qe(h)}]),F.returnServiceEditsOption=it.toJSON(e==null?void 0:e.returnServiceEditsOption),F.returnServiceEditsInSourceSR=e==null?void 0:e.returnServiceEditsInSourceSR):(F.adds=o.length?JSON.stringify(o):null,F.updates=n.length?JSON.stringify(n):null,F.deletes=i.length?a?JSON.stringify(i):i.join(","):null,F.attachments=_&&JSON.stringify(_),F.assetMaps=c(h)?JSON.stringify(h):void 0);const re=this._getLayerRequestOptions({method:"post",query:F}),z=e!=null&&e.returnServiceEditsOption?this.layer.url:this.layer.parsedUrl.path,E=await p(z+"/applyEdits",re);if(r&&E.data!=null&&E.data.assetMaps!=null){const m=E.data,T=this.layer.objectIdField,x=[];for(const I of m.addResults)I.success&&x.push(I.objectId);for(const I of m.updateResults)I.success&&x.push(I.objectId);const ae=this._createRequestQueryOptions(),D=await p(z+"/query",{...ae,query:{f:"json",formatOf3DObjects:"3D_glb",where:`OBJECTID IN (${x.join(",")})`,outFields:`${T}`}});if(D&&D.data&&D.data.assetMaps&&c(f)){const I=D.data.assetMaps;for(const P of I){const A=f.get(P.parentGlobalId).geometry;c(A)&&A.type==="mesh"&&A.updateExternalSource({source:[{name:P.assetName,source:P.assetName}],extent:A.extent})}}}return this._createEditsResult(E)}async deleteAttachments(t,e){await this.load();const s=t.attributes[this.layer.objectIdField],r=this.layer.parsedUrl.path+"/"+s+"/deleteAttachments";try{return(await p(r,this._getLayerRequestOptions({query:{attachmentIds:e.join(",")},method:"post"}))).data.deleteAttachmentResults.map(this._createFeatureEditResult)}catch(a){throw this._createAttachmentErrorResult(s,a)}}fetchRecomputedExtents(t={}){const e=t.signal;return this.load({signal:e}).then(async()=>{const s=this._getLayerRequestOptions({...t,query:{returnUpdates:!0}}),{layerId:r,url:a}=this.layer,{data:o}=await p(`${a}/${r}`,s),{id:n,extent:i,fullExtent:u,timeExtent:l}=o,d=i||u;return{id:n,fullExtent:d&&Q.fromJSON(d),timeExtent:l&&we.fromJSON({start:l[0],end:l[1]})}})}async queryAttachments(t,e={}){const{parsedUrl:s}=this.layer,r=s.path;await this.load();const a=this._getLayerRequestOptions(e);if(!this.layer.get("capabilities.operations.supportsQueryAttachments")){const{objectIds:o}=t,n=[];for(const i of o){const u=r+"/"+i+"/attachments";n.push(p(u,a))}return Promise.all(n).then(i=>o.map((u,l)=>({parentObjectId:u,attachmentInfos:i[l].data.attachmentInfos}))).then(i=>te(i,r))}return this.queryTask.executeAttachmentQuery(t,a)}async queryFeatures(t,e){return await this.load(),this.queryTask.execute(t,{...e,query:this._createRequestQueryOptions(e)})}async queryFeaturesJSON(t,e){return await this.load(),this.queryTask.executeJSON(t,{...e,query:this._createRequestQueryOptions(e)})}async queryObjectIds(t,e){return await this.load(),this.queryTask.executeForIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryFeatureCount(t,e){return await this.load(),this.queryTask.executeForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryExtent(t,e){return await this.load(),this.queryTask.executeForExtent(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeatures(t,e){return await this.load(),this.queryTask.executeRelationshipQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryRelatedFeaturesCount(t,e){return await this.load(),this.queryTask.executeRelationshipQueryForCount(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopFeatures(t,e){return await this.load(),this.queryTask.executeTopFeaturesQuery(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopObjectIds(t,e){return await this.load(),this.queryTask.executeForTopIds(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopExtents(t,e){return await this.load(),this.queryTask.executeForTopExtents(t,{...e,query:this._createRequestQueryOptions(e)})}async queryTopCount(t,e){return await this.load(),this.queryTask.executeForTopCount(t,{...e,query:this._createRequestQueryOptions(e)})}async fetchPublishingStatus(){if(!xe(this.layer.url))return"unavailable";const t=J(this.layer.url,"status"),e=await p(t,{query:{f:"json"}});return lt.fromJSON(e.data.status)}_createRequestQueryOptions(t){const e={...this.layer.customParameters,token:this.layer.apiKey,...t==null?void 0:t.query};return this.layer.datesInUnknownTimezone&&(e.timeReferenceUnknownClient=!0),e}async _fetchService(t,e){if(!t){const{data:r}=await p(this.layer.parsedUrl.path,this._getLayerRequestOptions({query:G("featurelayer-advanced-symbols")?{returnAdvancedSymbols:!0}:{},signal:e}));t=r}this.sourceJSON=this._patchServiceJSON(t);const s=t.type;if(!ut.has(s))throw new O("feature-layer-source:unsupported-type",`Source type "${s}" is not supported`)}_patchServiceJSON(t){var e;if(t.type!=="Table"&&t.geometryType&&!((e=t==null?void 0:t.drawingInfo)!=null&&e.renderer)&&!t.defaultSymbol){const s=Ae(t.geometryType).renderer;je("drawingInfo.renderer",s,t)}return t.geometryType==="esriGeometryMultiPatch"&&t.infoFor3D&&(t.geometryType="mesh"),t}_serializeFeature(t,e){const{geometry:s,attributes:r}=t;if(c(e)&&c(t.geometry)&&t.geometry.type==="mesh"){const a={...r},o=t.geometry,n=o.origin,i=o.transform;if(a[e.transformFieldRoles.originX]=n.x,a[e.transformFieldRoles.originY]=n.y,a[e.transformFieldRoles.originZ]=n.z,c(i)){const u=i.translation,l=i.scale,d=i.rotation;a[e.transformFieldRoles.translationX]=u[0],a[e.transformFieldRoles.translationY]=u[1],a[e.transformFieldRoles.translationZ]=u[2],a[e.transformFieldRoles.scaleX]=l[0],a[e.transformFieldRoles.scaleY]=l[1],a[e.transformFieldRoles.scaleZ]=l[2],a[e.transformFieldRoles.rotationX]=d[0],a[e.transformFieldRoles.rotationY]=d[1],a[e.transformFieldRoles.rotationZ]=d[2],a[e.transformFieldRoles.rotationDeg]=d[3]}return{geometry:null,attributes:a}}return S(s)?{attributes:r}:s.type==="mesh"||s.type==="extent"?null:{geometry:s.toJSON(),attributes:r}}async _serializeAttachment(t){const{feature:e,attachment:s}=t,{globalId:r,name:a,contentType:o,data:n,uploadId:i}=s,u={globalId:r,parentGlobalId:null,contentType:null,name:null,uploadId:null,data:null};if(e&&(u.parentGlobalId="attributes"in e?e.attributes&&e.attributes[this.layer.globalIdField]:e.globalId),i)u.uploadId=i;else if(n){const l=await Y(n);u.contentType=l.mediaType,u.data=l.data,n instanceof File&&(u.name=n.name)}return a&&(u.name=a),o&&(u.contentType=o),u}async _serializeAssetMapEditAndUploadAssets(t,e){const s=this.layer.url;let r=null;try{const l=new Blob([t.data],{type:t.mimeType}),d=new FormData;d.append("f","json"),d.append("file",l,`${t.assetName}`);const _={body:d,method:"post",responseType:"json"},{data:h}=await p(`${s}/uploads/upload`,_);if(!h.success)throw new O("feature-layer-source:upload-failure","Expected upload to be successfull.");r={assetType:t.assetType,assetUploadId:h.item.itemID}}catch{r=null}if(S(r)){const l=await Y(new Blob([t.data]));if(!l.isBase64)throw new O("feature-layer-source:uploadAssets-failure","Expected gltf data in base64 format after conversion.");r={assetType:t.assetType,assetData:l.data}}if(S(r))throw new O("feature-layer-source:uploadAssets-failure","Unable to prepare uploadAsset request options.");const a={method:"post",query:{f:"json",assets:JSON.stringify([r])},responseType:"json"},o=await p(J(this.layer.parsedUrl.path,"uploadAssets"),a);if(o.data.uploadResults.length!==1||!o.data.uploadResults[0].success)throw new O("feature-layer-source:uploadAssets-failure","Bad response.");const n=o.data.uploadResults[0].assetHash,i=[];t.flags&$.PROJECT_VERTICES&&i.push("PROJECT_VERTICES");const u={globalId:t.assetMapGlobalId,parentGlobalId:t.featureGlobalId,assetName:t.assetName,assetHash:n,flags:i};return e.set(t.featureGlobalId,t.feature),u}_getFeatureIds(t,e){const s=t[0];return s?this._canUseGlobalIds(e,t)?this._getGlobalIdsFromFeatureIdentifier(t):"objectId"in s?this._getObjectIdsFromFeatureIdentifier(t):this._getIdsFromFeatures(t):[]}_getIdsFromFeatures(t){const e=this.layer.objectIdField;return t.map(s=>s.attributes&&s.attributes[e])}_canUseGlobalIds(t,e){return t&&"globalId"in e[0]}_getObjectIdsFromFeatureIdentifier(t){return t.map(e=>e.objectId)}_getGlobalIdsFromFeatureIdentifier(t){return t.map(e=>e.globalId)}_createEditsResult(t){const e=t.data,{layerId:s}=this.layer,r=[];let a=null;if(Array.isArray(e))for(const i of e)r.push({id:i.id,editedFeatures:i.editedFeatures}),i.id===s&&(a={addResults:i.addResults,updateResults:i.updateResults,deleteResults:i.deleteResults,attachments:i.attachments,editMoment:i.editMoment});else a=e;const o=a==null?void 0:a.attachments,n={addFeatureResults:a.addResults?a.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:a.updateResults?a.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:a.deleteResults?a.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:o&&o.addResults?o.addResults.map(this._createFeatureEditResult,this):[],updateAttachmentResults:o&&o.updateResults?o.updateResults.map(this._createFeatureEditResult,this):[],deleteAttachmentResults:o&&o.deleteResults?o.deleteResults.map(this._createFeatureEditResult,this):[]};if(a.editMoment&&(n.editMoment=a.editMoment),r.length>0){n.editedFeatureResults=[];for(const i of r){const{adds:u,updates:l,deletes:d,spatialReference:_}=i.editedFeatures,h=_?new Ee(_):null;n.editedFeatureResults.push({layerId:i.id,editedFeatures:{adds:(u==null?void 0:u.map(f=>this._createEditedFeature(f,h)))||[],updates:(l==null?void 0:l.map(f=>({original:this._createEditedFeature(f[0],h),current:this._createEditedFeature(f[1],h)})))||[],deletes:(d==null?void 0:d.map(f=>this._createEditedFeature(f,h)))||[],spatialReference:h}})}}return n}_createEditedFeature(t,e){return new Te({attributes:t.attributes,geometry:De({...t.geometry,spatialReference:e})})}_createFeatureEditResult(t){const e=t.success===!0?null:t.error||{code:void 0,description:void 0};return{objectId:t.objectId,globalId:t.globalId,error:e?new O("feature-layer-source:edit-failure",e.description,{code:e.code}):null}}_createAttachmentErrorResult(t,e){const s=e.details.messages&&e.details.messages[0]||e.message,r=e.details.httpStatus||e.details.messageCode;return{objectId:t,globalId:null,error:new O("feature-layer-source:attachment-failure",s,{code:r})}}_getFormDataForAttachment(t,e){const s=t instanceof FormData?t:t&&t.elements?new FormData(t):null;if(s)for(const r in e){const a=e[r];a!=null&&(s.set?s.set(r,a):s.append(r,a))}return s}_getLayerRequestOptions(t={}){const{parsedUrl:e,gdbVersion:s,dynamicDataSource:r}=this.layer;return{...t,query:{gdbVersion:s,layer:r?JSON.stringify({source:r}):void 0,...e.query,f:"json",...this._createRequestQueryOptions(t)},responseType:"json"}}};y([g()],w.prototype,"type",void 0),y([g({constructOnly:!0})],w.prototype,"layer",void 0),y([g({readOnly:!0})],w.prototype,"queryTask",null),w=y([V("esri.layers.graphics.sources.FeatureLayerSource")],w);const pt=w;export{pt as default}; diff --git a/assets/FeatureLayerView2D.c0de0a56.js b/assets/FeatureLayerView2D.7c1a650d.js similarity index 94% rename from assets/FeatureLayerView2D.c0de0a56.js rename to assets/FeatureLayerView2D.7c1a650d.js index 65597b9..eb37190 100644 --- a/assets/FeatureLayerView2D.c0de0a56.js +++ b/assets/FeatureLayerView2D.7c1a650d.js @@ -1,4 +1,4 @@ -import{a6 as d,a7 as c,a8 as R,d1 as j,a9 as le,m as E,u as O,d2 as pe,d3 as B,aT as ye,c as p,at as K,E as fe,d4 as ge,K as _e,d5 as b,d6 as me,z as ve,bN as W,d7 as we,s as S,d8 as be,d9 as ue,da as Re,_ as A,c_ as de,c$ as Z,db as X,dc as Y,dd as P,de as qe,cB as ee,df as te,dg as Ee,dh as ie,di as Se,dj as xe,dk as N,dl as J,j as k,n as F,dm as Fe,dn as Ie,bc as Q,cE as Ce,cU as Oe,$ as Te,b4 as Ue,x as I,dp as Ae,dq as ke,c6 as Ve,dr as $e,c7 as Pe,aQ as Ne,ds as Je}from"./index.d94abe07.js";import{a as re}from"./utils.4b023c9d.js";import{a9 as Qe}from"./enums.0295eb81.js";import{y as Le,u as ze}from"./LayerView.42d17220.js";import{F as He,h as je}from"./schemaUtils.69ad92d2.js";import{e as Be}from"./util.ab699fea.js";import{o as se}from"./floorFilterUtils.05eb8c6a.js";import{s as L,d as Me}from"./popupUtils.4abb3ffd.js";import{i as Ge}from"./RefreshableLayerView.28a00159.js";import"./Utils.7f6f3a6b.js";import"./enums.2d9e6f64.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.229b1dd6.js";import"./visualVariablesUtils.aff73e6d.js";import"./createSymbolSchema.e54d2060.js";import"./ExpandedCIM.f0b7f36d.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.0d428d19.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.df11258c.js";let V=class extends j{constructor(){super(...arguments),this.isAggregate=!0}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=this.sourceLayer&&this.sourceLayer.featureReduction;return t&&"popupTemplate"in t&&t.popupEnabled?t.popupTemplate:null}getObjectId(){return this.attributes.aggregateId}};d([c({type:Boolean})],V.prototype,"isAggregate",void 0),V=d([R("esri.AggregateGraphic")],V);const M=V;let m=class extends le{constructor(e){super(e),this._filter=null,this.duration=E("mapview-transitions-duration"),this._excludedEffectView=new re(e),this._includedEffectView=new re(e)}get excludedEffects(){return this._excludedEffectView.effects}set featureEffect(e){this._get("featureEffect")!==e&&this._transitionTo(e)}get filter(){var e;return this._filter||((e=O(this.featureEffect))==null?void 0:e.filter)||null}get hasEffects(){return this._excludedEffectView.hasEffects||this._includedEffectView.hasEffects}get includedEffects(){return this._includedEffectView.effects}set scale(e){this._set("scale",e),this._excludedEffectView.scale=e,this._includedEffectView.scale=e}get transitioning(){return this._excludedEffectView.transitioning||this._includedEffectView.transitioning}transitionStep(e,t){this._set("scale",t),this.transitioning?(this._includedEffectView.transitionStep(e,t),this._excludedEffectView.transitionStep(e,t),this.transitioning||(this._filter=null)):(this._excludedEffectView.scale=t,this._includedEffectView.scale=t)}endTransitions(){this._includedEffectView.endTransitions(),this._excludedEffectView.endTransitions(),this._filter=null}_transitionTo(e){const t=this._get("featureEffect"),i=O(e),r=O(i==null?void 0:i.includedEffect),s=O(i==null?void 0:i.excludedEffect),a=this._includedEffectView.canTransitionTo(r)&&this._excludedEffectView.canTransitionTo(s);this._includedEffectView.effect=r,this._excludedEffectView.effect=s,this._set("featureEffect",i),this._filter=(i==null?void 0:i.filter)||(t==null?void 0:t.filter)||null,a||this.endTransitions()}};d([c()],m.prototype,"_filter",void 0),d([c()],m.prototype,"_excludedEffectView",void 0),d([c()],m.prototype,"_includedEffectView",void 0),d([c()],m.prototype,"duration",void 0),d([c()],m.prototype,"excludedEffects",null),d([c()],m.prototype,"featureEffect",null),d([c()],m.prototype,"filter",null),d([c()],m.prototype,"hasEffects",null),d([c()],m.prototype,"includedEffects",null),d([c({value:0})],m.prototype,"scale",null),d([c()],m.prototype,"transitioning",null),m=d([R("esri.layers.effects.FeatureEffectView")],m);const De=m;let T=class extends B{constructor(){super(...arguments),this.features=[]}readFeatures(e,t){var s;const i=ye.fromJSON(t.spatialReference),r=[];for(let a=0;aimport("./SymbolTileRenderer.a57bd090.js"),["assets/SymbolTileRenderer.a57bd090.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/CircularArray.a4d7e1c2.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/FeatureContainer.4ca52b51.js","assets/TileContainer.8b7fafe2.js","assets/utils.4b023c9d.js","assets/MaterialKey.229b1dd6.js","assets/WGLContainer.1850619d.js","assets/pixelUtils.82950e1a.js","assets/VertexArrayObject.a4c1d809.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/visualVariablesUtils.32e27706.js","assets/visualVariablesUtils.aff73e6d.js","assets/BufferPool.ff53b3f4.js","assets/schemaUtils.69ad92d2.js","assets/createSymbolSchema.e54d2060.js","assets/ExpandedCIM.f0b7f36d.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.0d428d19.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.df11258c.js","assets/util.ab699fea.js","assets/BaseTileRenderer.5cd35765.js"])).default(t);case"heatmap":return new(await K(()=>import("./HeatmapTileRenderer.3cbc266c.js"),["assets/HeatmapTileRenderer.3cbc266c.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/BitmapTileContainer.3a622161.js","assets/Bitmap.43defcb1.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/TileContainer.8b7fafe2.js","assets/WGLContainer.1850619d.js","assets/pixelUtils.82950e1a.js","assets/VertexArrayObject.a4c1d809.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/BaseTileRenderer.5cd35765.js"])).default(t)}}function z(e){return e.some(t=>t.globalId)}function C(e){return e.filter(t=>!t.error).map(t=>{var i;return(i=t.objectId)!=null?i:t.globalId})}function ae(e,t){const i=new Set(e);for(const r of t.values())i.add(r);return i}function ne(e,t){const i=new Set(e);for(const r of t.values())i.delete(r);return i}let $=class extends le{constructor(e){super(e),this._hasGlobalIds=!1}normalizeCtorArgs(e){return this._queueProcessor=new fe({concurrency:1,process:e.process}),{}}destroy(){this.clear()}get updating(){return this._queueProcessor.length>0}clear(){this._queueProcessor.clear()}push(e){const t=this._queueProcessor,i=t.last();switch(e.type){case"update":case"refresh":if((i==null?void 0:i.type)===e.type)return;t.push(e).finally(()=>this.notifyChange("updating"));break;case"edit":{const r=(i==null?void 0:i.type)==="processed-edit"?i:null;r&&t.popLast();const s=this._mergeEdits(r,e);for(const a of s)t.push(a).finally(()=>this.notifyChange("updating"));break}}this.notifyChange("updating")}_mergeEdits(e,t){var u,h;const{addedFeatures:i,deletedFeatures:r,updatedFeatures:s}=t.edits;if(this._hasGlobalIds=this._hasGlobalIds||z(i)||z(s)||z(r),this._hasGlobalIds)return[e,{type:"processed-edit",edits:{addOrModified:[...i,...s],removed:r}}];const a=new Set(C((u=e==null?void 0:e.edits.addOrModified)!=null?u:[])),n=new Set(C((h=e==null?void 0:e.edits.removed)!=null?h:[])),o=new Set([...C(i),...C(s)]),l=new Set(C(r));return[{type:"processed-edit",edits:{addOrModified:Array.from(ae(ne(a,l),o)).map(y=>({objectId:y})),removed:Array.from(ae(ne(n,o),l)).map(y=>({objectId:y}))}}]}};d([c({readOnly:!0})],$.prototype,"updating",null),$=d([R("esri.views.2d.layers.support.FeatureCommandQueue")],$);const Ze=$;function Xe(e){return Array.isArray(e)}let x=class extends ge{constructor(e){super(e),this._startupResolver=_e(),this.isReady=!1}initialize(){this._controller=new AbortController,this.addResolvingPromise(this._startWorker(this._controller.signal))}destroy(){this._controller.abort(),this._connection&&this._connection.close()}set tileRenderer(e){this.client.tileRenderer=e}get closed(){return this._connection.closed}async startup(e,t,i,r){await this.when();const s=this._controller.signal,a=Xe(i.source)?{transferList:i.source,signal:s}:void 0,n={service:i,config:t,tileInfo:e.tileInfo.toJSON(),tiles:r};await this._connection.invoke("startup",n,a),this._startupResolver.resolve(),this._set("isReady",!0)}async updateTiles(e){return await this._startupResolver.promise,b(this._connection.invoke("updateTiles",e))}async update(e){const t={config:e};return await this._startupResolver.promise,this._connection.invoke("update",t)}async applyUpdate(e){return await this._startupResolver.promise,this._connection.invoke("applyUpdate",e)}async setHighlight(e){return await this._startupResolver.promise,b(this._connection.invoke("controller.setHighlight",e))}async stop(){if(await this._startupResolver.promise,!this.closed)return b(this._connection.invoke("stop"))}async refresh(e){return await this._startupResolver.promise,b(this._connection.invoke("controller.refresh",e))}async querySummaryStatistics(e,t,i){return await this._startupResolver.promise,this._connection.invoke("controller.querySummaryStatistics",{query:e.toJSON(),params:t},i)}async queryAggregateSummaryStatistics(e,t,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateSummaryStatistics",{query:e.toJSON(),params:t},i)}async queryUniqueValues(e,t,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryUniqueValues",{query:e.toJSON(),params:t},i)}async queryAggregateUniqueValues(e,t,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateUniqueValues",{query:e.toJSON(),params:t},i)}async queryClassBreaks(e,t,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryClassBreaks",{query:e.toJSON(),params:t},i)}async queryAggregateClassBreaks(e,t,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateClassBreaks",{query:e.toJSON(),params:t},i)}async queryHistogram(e,t,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryHistogram",{query:e.toJSON(),params:t},i)}async queryAggregateHistogram(e,t,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateHistogram",{query:e.toJSON(),params:t},i)}async queryFeatures(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryFeatures",e.toJSON(),t)}async queryVisibleFeatures(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryVisibleFeatures",e.toJSON(),t)}async queryObjectIds(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryObjectIds",e.toJSON(),t)}async queryFeatureCount(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryFeatureCount",e.toJSON(),t)}async queryExtent(e,t){return this._connection.invoke("controller.queryExtent",e.toJSON(),t)}async queryLatestObservations(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryLatestObservations",e.toJSON(),t)}async queryStatistics(e){return await this._startupResolver.promise,this._connection.invoke("controller.queryStatistics",e)}async queryAggregates(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregates",e.toJSON(),t)}async queryAggregateCount(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateCount",e.toJSON(),t)}async queryAggregateIds(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateIds",e.toJSON(),t)}async getObjectId(e){return await this._startupResolver.promise,this._connection.invoke("controller.getObjectId",e)}async getDisplayId(e){return await this._startupResolver.promise,this._connection.invoke("controller.getDisplayId",e)}async getFeatures(e){return await this._startupResolver.promise,this._connection.invoke("controller.getFeatures",e)}async getAggregates(){return await this._startupResolver.promise,this._connection.invoke("controller.getAggregates")}async getAggregateValueRanges(){return await this._startupResolver.promise,this._connection.invoke("controller.getAggregateValueRanges")}async mapValidDisplayIds(e){return await this._startupResolver.promise,this._connection.invoke("controller.mapValidDisplayIds",e)}async onEdits(e){return await this._startupResolver.promise,b(this._connection.invoke("controller.onEdits",e))}async enableEvent(e,t){return await this._startupResolver.promise,b(this._connection.invoke("controller.enableEvent",{name:e,value:t}))}pauseStream(){return b(this._connection.invoke("controller.pauseStream"))}resumeStream(){return b(this._connection.invoke("controller.resumeStream"))}async _startWorker(e){try{this._connection=await me("Pipeline",{client:this.client,strategy:"dedicated",signal:e})}catch(t){ve(t)}}};d([c()],x.prototype,"isReady",void 0),d([c({constructOnly:!0})],x.prototype,"client",void 0),d([c()],x.prototype,"tileRenderer",null),x=d([R("esri.views.2d.layers.support.FeatureLayerProxy")],x);const Ye=x,et=1e-6;class tt{constructor(t){this._tiles=new Map,this.buffer=0,this.acquireTile=t.acquireTile,this.releaseTile=t.releaseTile,this.tileInfoView=t.tileInfoView,this.buffer=t.buffer}destroy(){}clear(){this._tiles.forEach(t=>this._releaseTile(t))}tileKeys(){const t=[];return this._tiles.forEach((i,r)=>t.push(r)),t}update(t){const i=this.tileInfoView.getTileCoverage(t.state,this.buffer,"closest"),{spans:r,lodInfo:s}=i,{level:a}=s,n=[],o=[],l=new Set,u=new Set;for(const{row:h,colFrom:y,colTo:f}of r)for(let g=y;g<=f;g++){const v=W.getId(a,h,s.normalizeCol(g),s.getWorldForColumn(g)),w=this._getOrAcquireTile(n,v);l.add(v),w.isReady?w.visible=!0:u.add(w.key)}return u.forEach(h=>this._addPlaceholders(l,h)),this._tiles.forEach(h=>{l.has(h.key.id)||(o.push(h.key.id),this._releaseTile(h))}),we.pool.release(i),{hasMissingTiles:u.size>0,added:n,removed:o}}_getOrAcquireTile(t,i){if(!this._tiles.has(i)){const r=this.acquireTile(new W(i));t.push(i),this._tiles.set(i,r),r.visible=!1}return this._tiles.get(i)}_getTile(t){return this._tiles.get(t)}_releaseTile(t){this._tiles.delete(t.key.id),this.releaseTile(t)}_addPlaceholders(t,i){const r=this._addPlaceholderChildren(t,i);Math.abs(1-r){r+=this._addPlaceholderChild(t,s,i)}),r}_addPlaceholderChild(t,i,r){return i.key.level<=r.level||!i.hasData||!r.contains(i.key)?0:(i.visible=!0,t.add(i.key.id),1/(1<<2*(i.key.level-r.level)))}_addPlaceholderParent(t,i){let r=i.getParentKey(),s=0,a=null;for(;p(r);){if(t.has(r.id))return!0;const n=this._getTile(r.id);if(n!=null&&n.isReady){for(const o of t){const l=this._getTile(o);r.contains(l.key)&&(l.visible=!1)}return n.visible=!0,t.add(n.key.id),!0}(n==null?void 0:n.hasData)&&n.patchCount>s&&(s=n.patchCount,a=n),r=r.getParentKey()}return!!a&&(a.visible=!0,t.add(a.key.id),!0)}}const ce="esri.views.layers.FeatureLayerView",H=S.getLogger(ce),it=e=>{let t=class extends e{constructor(...i){super(...i),this._updatingRequiredFieldsPromise=null,this.filter=null,this.timeExtent=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.handles.add([A(()=>{var r;const i=this.layer;return[(r=i==null?void 0:i.elevationInfo)==null?void 0:r.featureExpressionInfo,i&&"displayField"in i?i.displayField:null,i==null?void 0:i.timeInfo,i&&"renderer"in i&&i.renderer,i&&"labelingInfo"in i&&i.labelingInfo,i&&"floorInfo"in i&&i.floorInfo,this.filter,this.featureEffect,this.timeExtent]},()=>this._handleRequiredFieldsChange(),de),Z(()=>{var i;return(i=this.view)==null?void 0:i.floors},"change",()=>this._handleRequiredFieldsChange()),Z(()=>{const i=this.layer;return i&&"sublayers"in i&&i.sublayers},"change",()=>this._handleRequiredFieldsChange())])}get availableFields(){const{layer:i,layer:{fieldsIndex:r},requiredFields:s}=this;return"outFields"in i&&i.outFields?X(r,[...Y(r,i.outFields),...s]):X(r,s)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(i){this._override("featureEffect",i)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(i){H.error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(i){throw new Error("missing implementation")}createQuery(){const i={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},r=p(this.filter)?this.filter.createQuery(i):new P(i);if(this.layer.type==="feature"){const s=se(this);p(s)&&(r.where=r.where?`(${r.where}) AND (${s})`:s)}return p(this.timeExtent)&&(r.timeExtent=p(r.timeExtent)?r.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),r}createAggregateQuery(){const i={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new P(i)}queryFeatures(i,r){throw new Error("missing implementation")}queryObjectIds(i,r){throw new Error("missing implementation")}queryFeatureCount(i,r){throw new Error("missing implementation")}queryExtent(i,r){throw new Error("missing implementation")}async fetchPopupFeatures(i,r){const s=this.validateFetchPopupFeatures(r);if(s)throw s;return this.fetchClientPopupFeatures(r)}_loadArcadeModules(i){if(i.get("expressionInfos.length")||Array.isArray(i.content)&&i.content.some(r=>r.type==="expression"))return qe()}_handleRequiredFieldsChange(){const i=this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",i),i.then(()=>{this._updatingRequiredFieldsPromise===i&&this._set("_updatingRequiredFieldsPromise",null)})}async _updateRequiredFields(){if(!this.layer||!this.view)return;const i=this.view.type==="3d",{layer:r,layer:{fieldsIndex:s,objectIdField:a}}=this,n="renderer"in r&&r.renderer,o="orderBy"in r&&r.orderBy,l="featureReduction"in r?r.featureReduction:null,u=new Set,h=await ee([n?n.collectRequiredFields(u,s):null,te(u,r),i?Ee(u,r):null,p(this.filter)?ie(u,r,this.filter):null,p(this.featureEffect)?ie(u,r,this.featureEffect.filter):null,l?Se(u,r,l):null,o?xe(u,r,o):null]);if(r.timeInfo&&this.timeExtent&&N(u,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),r.type==="feature"&&(r.floorInfo&&N(u,r.fieldsIndex,[r.floorInfo.floorField]),i&&p(r.infoFor3D)&&(r.globalIdField==null&&H.error("globalIdField missing on 3DObjectFeatureLayer"),N(u,r.fieldsIndex,[r.globalIdField]))),r.type==="subtype-group"){J(u,s,r.subtypeField);const f=r.sublayers.map(g=>{var v;return Promise.all([(v=g.renderer)==null?void 0:v.collectRequiredFields(u,s),te(u,g)])});await ee(f)}for(const f of h)f.error&&H.error(f.error);J(u,s,a),i&&"displayField"in r&&r.displayField&&J(u,s,r.displayField);const y=Array.from(u).sort();this._set("requiredFields",y)}validateFetchPopupFeatures(i){if(k(i))return null;for(const r of i.clientGraphics){const s=r.layer;if("popupEnabled"in s&&!s.popupEnabled)return new F("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:s});if(r.isAggregate){const a="featureReduction"in s?s.featureReduction:null;if(!(a&&"popupTemplate"in a&&a.popupEnabled&&a.popupTemplate))return new F("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:s})}else if("popupTemplate"in s&&!L(s,i))return new F("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:s})}}async fetchClientPopupFeatures(i){const r=p(i)?i.clientGraphics:null;if(!r||r.length===0)return[];const s=new Array(r.length),a=new Map,n=await this.createPopupQuery(i);for(let o=0;oo.layer):[this.layer];for(const o of n){if(!("popupEnabled"in o))continue;const l=L(o,i);if(k(l))continue;const u=await this._loadArcadeModules(l),h=u&&u.arcadeUtils.hasGeometryOperations(l);a=!(this.layer.geometryType!=="point"&&!h);const y=await Me(this.layer,l);for(const f of y)s.add(f)}if(r.returnGeometry=a,r.returnZ=a,r.returnM=a,r.outFields=Array.from(s),r.outSpatialReference=this.view.spatialReference,this.layer.type==="feature"){const o=se(this);p(o)&&(r.where=r.where?`(${r.where}) AND (${o})`:o)}return r}canResume(){return!!super.canResume()&&(!p(this.timeExtent)||!this.timeExtent.isEmpty)}};return d([c()],t.prototype,"_updatingRequiredFieldsPromise",void 0),d([c({readOnly:!0})],t.prototype,"availableFields",null),d([c({type:be})],t.prototype,"featureEffect",null),d([c({type:ue})],t.prototype,"filter",void 0),d([c(Re)],t.prototype,"timeExtent",void 0),d([c()],t.prototype,"layer",void 0),d([c({type:Number})],t.prototype,"maximumNumberOfFeatures",null),d([c({readOnly:!0,type:Boolean})],t.prototype,"maximumNumberOfFeaturesExceeded",null),d([c({readOnly:!0})],t.prototype,"requiredFields",void 0),d([c()],t.prototype,"suspended",void 0),d([c()],t.prototype,"view",void 0),t=d([R(ce)],t),t};function oe(e){return e&&"openPorts"in e}let _=class extends it(Ge(Le(ze))){constructor(){super(...arguments),this._pipelineIsUpdating=!0,this._commandsQueue=new Ze({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"refresh":return this._doRefresh(e.dataChanged);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=Ie(async()=>this._proxy.setHighlight(Array.from(this._highlightIds.keys()))),this._uploadsLocked=!1,this._needsClusterSizeUpdate=!1,this.featureEffectView=new De,this._lastDefinitionExpression=null}destroy(){var e;Q(this._updateClusterSizeTask,t=>t.remove()),(e=this._proxy)==null||e.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(Promise.all([this._initProxy(),this._initServiceOptions()])),this.handles.add([this.on("valueRangesChanged",e=>{this._set("_aggregateValueRanges",e.valueRanges)}),A(()=>this.featureEffect,e=>{this.featureEffectView.featureEffect=e},de)]),this.featureEffectView.endTransitions()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new F("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:this.layer});const t=e.type==="feature"||e.type==="subtype-group",i="capabilities"in e&&e.capabilities.operations.supportsQuery;if(t&&!i)throw new F("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._proxy&&this._proxy.destroy();const r=this._createClientOptions();return this._set("_proxy",new Ye({client:r})),this._proxy.when()}async _initServiceOptions(){return this._set("_serviceOptions",await this._createServiceOptions()),this._serviceOptions}get orderByFields(){return this._serviceOptions.type!=="stream"&&this._serviceOptions.orderByFields}get labelsVisible(){const e=this.layer.type==="subtype-group"?this.layer.sublayers.items:[this.layer];return!this.suspended&&e.some(t=>t.labelingInfo&&t.labelsVisible)}get queryMode(){return this._serviceOptions.type}get renderingConfigHash(){var G,D;if(!this.layer)return null;const e=this.availableFields,t=this.layer,i=this.view.floors,{definitionExpression:r}=t,s=this.layer.type!=="subtype-group"&&this.layer.labelsVisible&&this.layer.labelingInfo,a="renderer"in t&&t.renderer,n="gdbVersion"in t?t.gdbVersion:void 0,o="historicMoment"in t?(G=t.historicMoment)==null?void 0:G.getTime():void 0,{timeExtent:l}=this,u="customParameters"in t?JSON.stringify(t.customParameters):void 0,h="apiKey"in t?t.apiKey:void 0,y=t.type==="stream"?`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`:null,f=JSON.stringify(this.clips),g="featureReduction"in t?(D=t.featureReduction)==null?void 0:D.toJSON():null,v="orderBy"in this.layer&&JSON.stringify(this.layer.orderBy),w="sublayers"in this.layer&&this.layer.sublayers.items.reduce((he,U)=>he+`${U.visible?1:0}.${JSON.stringify(U.renderer)}.${U.labelsVisible} +import{a6 as d,a7 as c,a8 as R,d1 as j,a9 as le,m as E,u as O,d2 as pe,d3 as B,aT as ye,c as p,at as K,E as fe,d4 as ge,K as _e,d5 as b,d6 as me,z as ve,bN as W,d7 as we,s as S,d8 as be,d9 as ue,da as Re,_ as A,c_ as de,c$ as Z,db as X,dc as Y,dd as P,de as qe,cB as ee,df as te,dg as Ee,dh as ie,di as Se,dj as xe,dk as N,dl as J,j as k,n as F,dm as Fe,dn as Ie,bc as Q,cE as Ce,cU as Oe,$ as Te,b4 as Ue,x as I,dp as Ae,dq as ke,c6 as Ve,dr as $e,c7 as Pe,aQ as Ne,ds as Je}from"./index.221827cd.js";import{a as re}from"./utils.0160becb.js";import{a9 as Qe}from"./enums.0295eb81.js";import{y as Le,u as ze}from"./LayerView.ce6e0535.js";import{F as He,h as je}from"./schemaUtils.d20994fa.js";import{e as Be}from"./util.520a352e.js";import{o as se}from"./floorFilterUtils.05eb8c6a.js";import{s as L,d as Me}from"./popupUtils.c6371f3a.js";import{i as Ge}from"./RefreshableLayerView.887ed8c3.js";import"./Utils.2136650a.js";import"./enums.2d9e6f64.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.0cadabc1.js";import"./visualVariablesUtils.62efda9d.js";import"./createSymbolSchema.827eb617.js";import"./ExpandedCIM.a372ce74.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.7ff797cc.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.3f71f8e9.js";let V=class extends j{constructor(){super(...arguments),this.isAggregate=!0}getEffectivePopupTemplate(e=!1){if(this.popupTemplate)return this.popupTemplate;const t=this.sourceLayer&&this.sourceLayer.featureReduction;return t&&"popupTemplate"in t&&t.popupEnabled?t.popupTemplate:null}getObjectId(){return this.attributes.aggregateId}};d([c({type:Boolean})],V.prototype,"isAggregate",void 0),V=d([R("esri.AggregateGraphic")],V);const M=V;let m=class extends le{constructor(e){super(e),this._filter=null,this.duration=E("mapview-transitions-duration"),this._excludedEffectView=new re(e),this._includedEffectView=new re(e)}get excludedEffects(){return this._excludedEffectView.effects}set featureEffect(e){this._get("featureEffect")!==e&&this._transitionTo(e)}get filter(){var e;return this._filter||((e=O(this.featureEffect))==null?void 0:e.filter)||null}get hasEffects(){return this._excludedEffectView.hasEffects||this._includedEffectView.hasEffects}get includedEffects(){return this._includedEffectView.effects}set scale(e){this._set("scale",e),this._excludedEffectView.scale=e,this._includedEffectView.scale=e}get transitioning(){return this._excludedEffectView.transitioning||this._includedEffectView.transitioning}transitionStep(e,t){this._set("scale",t),this.transitioning?(this._includedEffectView.transitionStep(e,t),this._excludedEffectView.transitionStep(e,t),this.transitioning||(this._filter=null)):(this._excludedEffectView.scale=t,this._includedEffectView.scale=t)}endTransitions(){this._includedEffectView.endTransitions(),this._excludedEffectView.endTransitions(),this._filter=null}_transitionTo(e){const t=this._get("featureEffect"),i=O(e),r=O(i==null?void 0:i.includedEffect),s=O(i==null?void 0:i.excludedEffect),a=this._includedEffectView.canTransitionTo(r)&&this._excludedEffectView.canTransitionTo(s);this._includedEffectView.effect=r,this._excludedEffectView.effect=s,this._set("featureEffect",i),this._filter=(i==null?void 0:i.filter)||(t==null?void 0:t.filter)||null,a||this.endTransitions()}};d([c()],m.prototype,"_filter",void 0),d([c()],m.prototype,"_excludedEffectView",void 0),d([c()],m.prototype,"_includedEffectView",void 0),d([c()],m.prototype,"duration",void 0),d([c()],m.prototype,"excludedEffects",null),d([c()],m.prototype,"featureEffect",null),d([c()],m.prototype,"filter",null),d([c()],m.prototype,"hasEffects",null),d([c()],m.prototype,"includedEffects",null),d([c({value:0})],m.prototype,"scale",null),d([c()],m.prototype,"transitioning",null),m=d([R("esri.layers.effects.FeatureEffectView")],m);const De=m;let T=class extends B{constructor(){super(...arguments),this.features=[]}readFeatures(e,t){var s;const i=ye.fromJSON(t.spatialReference),r=[];for(let a=0;aimport("./SymbolTileRenderer.5a8a4597.js"),["assets/SymbolTileRenderer.5a8a4597.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/CircularArray.62f75f43.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/FeatureContainer.b427dd87.js","assets/TileContainer.5aeb32d6.js","assets/utils.0160becb.js","assets/MaterialKey.0cadabc1.js","assets/WGLContainer.347cc5cd.js","assets/pixelUtils.9c6f8dae.js","assets/VertexArrayObject.53cf1857.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/visualVariablesUtils.061b7a4e.js","assets/visualVariablesUtils.62efda9d.js","assets/BufferPool.98277e4b.js","assets/schemaUtils.d20994fa.js","assets/createSymbolSchema.827eb617.js","assets/ExpandedCIM.a372ce74.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.7ff797cc.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.3f71f8e9.js","assets/util.520a352e.js","assets/BaseTileRenderer.f04a8f8b.js"])).default(t);case"heatmap":return new(await K(()=>import("./HeatmapTileRenderer.f9ecd2b7.js"),["assets/HeatmapTileRenderer.f9ecd2b7.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/BitmapTileContainer.f5b20598.js","assets/Bitmap.72a3702e.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/TileContainer.5aeb32d6.js","assets/WGLContainer.347cc5cd.js","assets/pixelUtils.9c6f8dae.js","assets/VertexArrayObject.53cf1857.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/BaseTileRenderer.f04a8f8b.js"])).default(t)}}function z(e){return e.some(t=>t.globalId)}function C(e){return e.filter(t=>!t.error).map(t=>{var i;return(i=t.objectId)!=null?i:t.globalId})}function ae(e,t){const i=new Set(e);for(const r of t.values())i.add(r);return i}function ne(e,t){const i=new Set(e);for(const r of t.values())i.delete(r);return i}let $=class extends le{constructor(e){super(e),this._hasGlobalIds=!1}normalizeCtorArgs(e){return this._queueProcessor=new fe({concurrency:1,process:e.process}),{}}destroy(){this.clear()}get updating(){return this._queueProcessor.length>0}clear(){this._queueProcessor.clear()}push(e){const t=this._queueProcessor,i=t.last();switch(e.type){case"update":case"refresh":if((i==null?void 0:i.type)===e.type)return;t.push(e).finally(()=>this.notifyChange("updating"));break;case"edit":{const r=(i==null?void 0:i.type)==="processed-edit"?i:null;r&&t.popLast();const s=this._mergeEdits(r,e);for(const a of s)t.push(a).finally(()=>this.notifyChange("updating"));break}}this.notifyChange("updating")}_mergeEdits(e,t){var u,h;const{addedFeatures:i,deletedFeatures:r,updatedFeatures:s}=t.edits;if(this._hasGlobalIds=this._hasGlobalIds||z(i)||z(s)||z(r),this._hasGlobalIds)return[e,{type:"processed-edit",edits:{addOrModified:[...i,...s],removed:r}}];const a=new Set(C((u=e==null?void 0:e.edits.addOrModified)!=null?u:[])),n=new Set(C((h=e==null?void 0:e.edits.removed)!=null?h:[])),o=new Set([...C(i),...C(s)]),l=new Set(C(r));return[{type:"processed-edit",edits:{addOrModified:Array.from(ae(ne(a,l),o)).map(y=>({objectId:y})),removed:Array.from(ae(ne(n,o),l)).map(y=>({objectId:y}))}}]}};d([c({readOnly:!0})],$.prototype,"updating",null),$=d([R("esri.views.2d.layers.support.FeatureCommandQueue")],$);const Ze=$;function Xe(e){return Array.isArray(e)}let x=class extends ge{constructor(e){super(e),this._startupResolver=_e(),this.isReady=!1}initialize(){this._controller=new AbortController,this.addResolvingPromise(this._startWorker(this._controller.signal))}destroy(){this._controller.abort(),this._connection&&this._connection.close()}set tileRenderer(e){this.client.tileRenderer=e}get closed(){return this._connection.closed}async startup(e,t,i,r){await this.when();const s=this._controller.signal,a=Xe(i.source)?{transferList:i.source,signal:s}:void 0,n={service:i,config:t,tileInfo:e.tileInfo.toJSON(),tiles:r};await this._connection.invoke("startup",n,a),this._startupResolver.resolve(),this._set("isReady",!0)}async updateTiles(e){return await this._startupResolver.promise,b(this._connection.invoke("updateTiles",e))}async update(e){const t={config:e};return await this._startupResolver.promise,this._connection.invoke("update",t)}async applyUpdate(e){return await this._startupResolver.promise,this._connection.invoke("applyUpdate",e)}async setHighlight(e){return await this._startupResolver.promise,b(this._connection.invoke("controller.setHighlight",e))}async stop(){if(await this._startupResolver.promise,!this.closed)return b(this._connection.invoke("stop"))}async refresh(e){return await this._startupResolver.promise,b(this._connection.invoke("controller.refresh",e))}async querySummaryStatistics(e,t,i){return await this._startupResolver.promise,this._connection.invoke("controller.querySummaryStatistics",{query:e.toJSON(),params:t},i)}async queryAggregateSummaryStatistics(e,t,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateSummaryStatistics",{query:e.toJSON(),params:t},i)}async queryUniqueValues(e,t,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryUniqueValues",{query:e.toJSON(),params:t},i)}async queryAggregateUniqueValues(e,t,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateUniqueValues",{query:e.toJSON(),params:t},i)}async queryClassBreaks(e,t,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryClassBreaks",{query:e.toJSON(),params:t},i)}async queryAggregateClassBreaks(e,t,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateClassBreaks",{query:e.toJSON(),params:t},i)}async queryHistogram(e,t,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryHistogram",{query:e.toJSON(),params:t},i)}async queryAggregateHistogram(e,t,i){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateHistogram",{query:e.toJSON(),params:t},i)}async queryFeatures(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryFeatures",e.toJSON(),t)}async queryVisibleFeatures(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryVisibleFeatures",e.toJSON(),t)}async queryObjectIds(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryObjectIds",e.toJSON(),t)}async queryFeatureCount(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryFeatureCount",e.toJSON(),t)}async queryExtent(e,t){return this._connection.invoke("controller.queryExtent",e.toJSON(),t)}async queryLatestObservations(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryLatestObservations",e.toJSON(),t)}async queryStatistics(e){return await this._startupResolver.promise,this._connection.invoke("controller.queryStatistics",e)}async queryAggregates(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregates",e.toJSON(),t)}async queryAggregateCount(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateCount",e.toJSON(),t)}async queryAggregateIds(e,t){return await this._startupResolver.promise,this._connection.invoke("controller.queryAggregateIds",e.toJSON(),t)}async getObjectId(e){return await this._startupResolver.promise,this._connection.invoke("controller.getObjectId",e)}async getDisplayId(e){return await this._startupResolver.promise,this._connection.invoke("controller.getDisplayId",e)}async getFeatures(e){return await this._startupResolver.promise,this._connection.invoke("controller.getFeatures",e)}async getAggregates(){return await this._startupResolver.promise,this._connection.invoke("controller.getAggregates")}async getAggregateValueRanges(){return await this._startupResolver.promise,this._connection.invoke("controller.getAggregateValueRanges")}async mapValidDisplayIds(e){return await this._startupResolver.promise,this._connection.invoke("controller.mapValidDisplayIds",e)}async onEdits(e){return await this._startupResolver.promise,b(this._connection.invoke("controller.onEdits",e))}async enableEvent(e,t){return await this._startupResolver.promise,b(this._connection.invoke("controller.enableEvent",{name:e,value:t}))}pauseStream(){return b(this._connection.invoke("controller.pauseStream"))}resumeStream(){return b(this._connection.invoke("controller.resumeStream"))}async _startWorker(e){try{this._connection=await me("Pipeline",{client:this.client,strategy:"dedicated",signal:e})}catch(t){ve(t)}}};d([c()],x.prototype,"isReady",void 0),d([c({constructOnly:!0})],x.prototype,"client",void 0),d([c()],x.prototype,"tileRenderer",null),x=d([R("esri.views.2d.layers.support.FeatureLayerProxy")],x);const Ye=x,et=1e-6;class tt{constructor(t){this._tiles=new Map,this.buffer=0,this.acquireTile=t.acquireTile,this.releaseTile=t.releaseTile,this.tileInfoView=t.tileInfoView,this.buffer=t.buffer}destroy(){}clear(){this._tiles.forEach(t=>this._releaseTile(t))}tileKeys(){const t=[];return this._tiles.forEach((i,r)=>t.push(r)),t}update(t){const i=this.tileInfoView.getTileCoverage(t.state,this.buffer,"closest"),{spans:r,lodInfo:s}=i,{level:a}=s,n=[],o=[],l=new Set,u=new Set;for(const{row:h,colFrom:y,colTo:f}of r)for(let g=y;g<=f;g++){const v=W.getId(a,h,s.normalizeCol(g),s.getWorldForColumn(g)),w=this._getOrAcquireTile(n,v);l.add(v),w.isReady?w.visible=!0:u.add(w.key)}return u.forEach(h=>this._addPlaceholders(l,h)),this._tiles.forEach(h=>{l.has(h.key.id)||(o.push(h.key.id),this._releaseTile(h))}),we.pool.release(i),{hasMissingTiles:u.size>0,added:n,removed:o}}_getOrAcquireTile(t,i){if(!this._tiles.has(i)){const r=this.acquireTile(new W(i));t.push(i),this._tiles.set(i,r),r.visible=!1}return this._tiles.get(i)}_getTile(t){return this._tiles.get(t)}_releaseTile(t){this._tiles.delete(t.key.id),this.releaseTile(t)}_addPlaceholders(t,i){const r=this._addPlaceholderChildren(t,i);Math.abs(1-r){r+=this._addPlaceholderChild(t,s,i)}),r}_addPlaceholderChild(t,i,r){return i.key.level<=r.level||!i.hasData||!r.contains(i.key)?0:(i.visible=!0,t.add(i.key.id),1/(1<<2*(i.key.level-r.level)))}_addPlaceholderParent(t,i){let r=i.getParentKey(),s=0,a=null;for(;p(r);){if(t.has(r.id))return!0;const n=this._getTile(r.id);if(n!=null&&n.isReady){for(const o of t){const l=this._getTile(o);r.contains(l.key)&&(l.visible=!1)}return n.visible=!0,t.add(n.key.id),!0}(n==null?void 0:n.hasData)&&n.patchCount>s&&(s=n.patchCount,a=n),r=r.getParentKey()}return!!a&&(a.visible=!0,t.add(a.key.id),!0)}}const ce="esri.views.layers.FeatureLayerView",H=S.getLogger(ce),it=e=>{let t=class extends e{constructor(...i){super(...i),this._updatingRequiredFieldsPromise=null,this.filter=null,this.timeExtent=null,this.layer=null,this.requiredFields=[],this.view=null}initialize(){this.handles.add([A(()=>{var r;const i=this.layer;return[(r=i==null?void 0:i.elevationInfo)==null?void 0:r.featureExpressionInfo,i&&"displayField"in i?i.displayField:null,i==null?void 0:i.timeInfo,i&&"renderer"in i&&i.renderer,i&&"labelingInfo"in i&&i.labelingInfo,i&&"floorInfo"in i&&i.floorInfo,this.filter,this.featureEffect,this.timeExtent]},()=>this._handleRequiredFieldsChange(),de),Z(()=>{var i;return(i=this.view)==null?void 0:i.floors},"change",()=>this._handleRequiredFieldsChange()),Z(()=>{const i=this.layer;return i&&"sublayers"in i&&i.sublayers},"change",()=>this._handleRequiredFieldsChange())])}get availableFields(){const{layer:i,layer:{fieldsIndex:r},requiredFields:s}=this;return"outFields"in i&&i.outFields?X(r,[...Y(r,i.outFields),...s]):X(r,s)}get featureEffect(){return this.layer&&"featureEffect"in this.layer?this.layer.featureEffect:null}set featureEffect(i){this._override("featureEffect",i)}get maximumNumberOfFeatures(){return 0}set maximumNumberOfFeatures(i){H.error("#maximumNumberOfFeatures=","Setting maximum number of features is not supported")}get maximumNumberOfFeaturesExceeded(){return!1}highlight(i){throw new Error("missing implementation")}createQuery(){const i={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference},r=p(this.filter)?this.filter.createQuery(i):new P(i);if(this.layer.type==="feature"){const s=se(this);p(s)&&(r.where=r.where?`(${r.where}) AND (${s})`:s)}return p(this.timeExtent)&&(r.timeExtent=p(r.timeExtent)?r.timeExtent.intersection(this.timeExtent):this.timeExtent.clone()),r}createAggregateQuery(){const i={outFields:["*"],returnGeometry:!0,outSpatialReference:this.view.spatialReference};return new P(i)}queryFeatures(i,r){throw new Error("missing implementation")}queryObjectIds(i,r){throw new Error("missing implementation")}queryFeatureCount(i,r){throw new Error("missing implementation")}queryExtent(i,r){throw new Error("missing implementation")}async fetchPopupFeatures(i,r){const s=this.validateFetchPopupFeatures(r);if(s)throw s;return this.fetchClientPopupFeatures(r)}_loadArcadeModules(i){if(i.get("expressionInfos.length")||Array.isArray(i.content)&&i.content.some(r=>r.type==="expression"))return qe()}_handleRequiredFieldsChange(){const i=this._updateRequiredFields();this._set("_updatingRequiredFieldsPromise",i),i.then(()=>{this._updatingRequiredFieldsPromise===i&&this._set("_updatingRequiredFieldsPromise",null)})}async _updateRequiredFields(){if(!this.layer||!this.view)return;const i=this.view.type==="3d",{layer:r,layer:{fieldsIndex:s,objectIdField:a}}=this,n="renderer"in r&&r.renderer,o="orderBy"in r&&r.orderBy,l="featureReduction"in r?r.featureReduction:null,u=new Set,h=await ee([n?n.collectRequiredFields(u,s):null,te(u,r),i?Ee(u,r):null,p(this.filter)?ie(u,r,this.filter):null,p(this.featureEffect)?ie(u,r,this.featureEffect.filter):null,l?Se(u,r,l):null,o?xe(u,r,o):null]);if(r.timeInfo&&this.timeExtent&&N(u,r.fieldsIndex,[r.timeInfo.startField,r.timeInfo.endField]),r.type==="feature"&&(r.floorInfo&&N(u,r.fieldsIndex,[r.floorInfo.floorField]),i&&p(r.infoFor3D)&&(r.globalIdField==null&&H.error("globalIdField missing on 3DObjectFeatureLayer"),N(u,r.fieldsIndex,[r.globalIdField]))),r.type==="subtype-group"){J(u,s,r.subtypeField);const f=r.sublayers.map(g=>{var v;return Promise.all([(v=g.renderer)==null?void 0:v.collectRequiredFields(u,s),te(u,g)])});await ee(f)}for(const f of h)f.error&&H.error(f.error);J(u,s,a),i&&"displayField"in r&&r.displayField&&J(u,s,r.displayField);const y=Array.from(u).sort();this._set("requiredFields",y)}validateFetchPopupFeatures(i){if(k(i))return null;for(const r of i.clientGraphics){const s=r.layer;if("popupEnabled"in s&&!s.popupEnabled)return new F("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:s});if(r.isAggregate){const a="featureReduction"in s?s.featureReduction:null;if(!(a&&"popupTemplate"in a&&a.popupEnabled&&a.popupTemplate))return new F("featurelayerview:fetchPopupFeatures","Popups are disabled",{layer:s})}else if("popupTemplate"in s&&!L(s,i))return new F("featurelayerview:fetchPopupFeatures","Layer does not define a popup template",{layer:s})}}async fetchClientPopupFeatures(i){const r=p(i)?i.clientGraphics:null;if(!r||r.length===0)return[];const s=new Array(r.length),a=new Map,n=await this.createPopupQuery(i);for(let o=0;oo.layer):[this.layer];for(const o of n){if(!("popupEnabled"in o))continue;const l=L(o,i);if(k(l))continue;const u=await this._loadArcadeModules(l),h=u&&u.arcadeUtils.hasGeometryOperations(l);a=!(this.layer.geometryType!=="point"&&!h);const y=await Me(this.layer,l);for(const f of y)s.add(f)}if(r.returnGeometry=a,r.returnZ=a,r.returnM=a,r.outFields=Array.from(s),r.outSpatialReference=this.view.spatialReference,this.layer.type==="feature"){const o=se(this);p(o)&&(r.where=r.where?`(${r.where}) AND (${o})`:o)}return r}canResume(){return!!super.canResume()&&(!p(this.timeExtent)||!this.timeExtent.isEmpty)}};return d([c()],t.prototype,"_updatingRequiredFieldsPromise",void 0),d([c({readOnly:!0})],t.prototype,"availableFields",null),d([c({type:be})],t.prototype,"featureEffect",null),d([c({type:ue})],t.prototype,"filter",void 0),d([c(Re)],t.prototype,"timeExtent",void 0),d([c()],t.prototype,"layer",void 0),d([c({type:Number})],t.prototype,"maximumNumberOfFeatures",null),d([c({readOnly:!0,type:Boolean})],t.prototype,"maximumNumberOfFeaturesExceeded",null),d([c({readOnly:!0})],t.prototype,"requiredFields",void 0),d([c()],t.prototype,"suspended",void 0),d([c()],t.prototype,"view",void 0),t=d([R(ce)],t),t};function oe(e){return e&&"openPorts"in e}let _=class extends it(Ge(Le(ze))){constructor(){super(...arguments),this._pipelineIsUpdating=!0,this._commandsQueue=new Ze({process:e=>{switch(e.type){case"processed-edit":return this._doEdit(e);case"refresh":return this._doRefresh(e.dataChanged);case"update":return this._doUpdate()}}}),this._visibilityOverrides=new Set,this._highlightIds=new Map,this._updateHighlight=Ie(async()=>this._proxy.setHighlight(Array.from(this._highlightIds.keys()))),this._uploadsLocked=!1,this._needsClusterSizeUpdate=!1,this.featureEffectView=new De,this._lastDefinitionExpression=null}destroy(){var e;Q(this._updateClusterSizeTask,t=>t.remove()),(e=this._proxy)==null||e.destroy(),this._commandsQueue.destroy()}initialize(){this.addResolvingPromise(Promise.all([this._initProxy(),this._initServiceOptions()])),this.handles.add([this.on("valueRangesChanged",e=>{this._set("_aggregateValueRanges",e.valueRanges)}),A(()=>this.featureEffect,e=>{this.featureEffectView.featureEffect=e},de)]),this.featureEffectView.endTransitions()}async _initProxy(){const e=this.layer;if("isTable"in e&&e.isTable)throw new F("featurelayerview:table-not-supported","table feature layer can't be displayed",{layer:this.layer});const t=e.type==="feature"||e.type==="subtype-group",i="capabilities"in e&&e.capabilities.operations.supportsQuery;if(t&&!i)throw new F("featurelayerview:query-not-supported","layer view requires a layer with query capability",{layer:e});this._proxy&&this._proxy.destroy();const r=this._createClientOptions();return this._set("_proxy",new Ye({client:r})),this._proxy.when()}async _initServiceOptions(){return this._set("_serviceOptions",await this._createServiceOptions()),this._serviceOptions}get orderByFields(){return this._serviceOptions.type!=="stream"&&this._serviceOptions.orderByFields}get labelsVisible(){const e=this.layer.type==="subtype-group"?this.layer.sublayers.items:[this.layer];return!this.suspended&&e.some(t=>t.labelingInfo&&t.labelsVisible)}get queryMode(){return this._serviceOptions.type}get renderingConfigHash(){var G,D;if(!this.layer)return null;const e=this.availableFields,t=this.layer,i=this.view.floors,{definitionExpression:r}=t,s=this.layer.type!=="subtype-group"&&this.layer.labelsVisible&&this.layer.labelingInfo,a="renderer"in t&&t.renderer,n="gdbVersion"in t?t.gdbVersion:void 0,o="historicMoment"in t?(G=t.historicMoment)==null?void 0:G.getTime():void 0,{timeExtent:l}=this,u="customParameters"in t?JSON.stringify(t.customParameters):void 0,h="apiKey"in t?t.apiKey:void 0,y=t.type==="stream"?`${JSON.stringify(t.geometryDefinition)}${t.definitionExpression}`:null,f=JSON.stringify(this.clips),g="featureReduction"in t?(D=t.featureReduction)==null?void 0:D.toJSON():null,v="orderBy"in this.layer&&JSON.stringify(this.layer.orderBy),w="sublayers"in this.layer&&this.layer.sublayers.items.reduce((he,U)=>he+`${U.visible?1:0}.${JSON.stringify(U.renderer)}.${U.labelsVisible} .${JSON.stringify(U.labelingInfo)}`,""),q="subtypeCode"in this.layer&&this.layer.subtypeCode;return JSON.stringify({orderBy:v,sublayerHash:w,subtypeCode:q,filterHash:p(this.filter)&&this.filter.toJSON(),effectHash:p(this.featureEffect)&&this.featureEffect.toJSON(),streamFilter:y,gdbVersion:n,definitionExpression:r,historicMoment:o,availableFields:e,renderer:a,labelingInfo:s,timeExtent:l,floors:i,clipsHash:f,featureReduction:g,customParameters:u,apiKey:h})}highlight(e){let t;return e instanceof j?t=[e.getObjectId()]:typeof e=="number"||typeof e=="string"?t=[e]:Ce.isCollection(e)&&e.length>0?t=e.map(i=>i==null?void 0:i.getObjectId()).toArray():Array.isArray(e)&&e.length>0&&(t=typeof e[0]=="number"||typeof e[0]=="string"?e:e.map(i=>i==null?void 0:i.getObjectId())),t=t==null?void 0:t.filter(i=>i!=null),t&&t.length?(this._addHighlight(t),{remove:()=>this._removeHighlight(t)}):{remove:()=>{}}}hasHighlight(){return!!this._highlightIds.size}async hitTest(e,t){if(!this.tileRenderer)return null;const i=await this.tileRenderer.hitTest(t);if(i.length===0)return null;const{features:r,aggregates:s}=await this._proxy.getFeatures(i);return[...s.map(a=>this._createGraphicHit(e,M.fromJSON(a))),...r.map(a=>this._createGraphicHit(e,j.fromJSON(a)))]}queryStatistics(){return this._proxy.queryStatistics()}async querySummaryStatistics(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.querySummaryStatistics(this._cleanUpQuery(e),r,i)}async queryAggregateSummaryStatistics(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryAggregateSummaryStatistics(this._cleanUpAggregateQuery(e),r,i)}async queryUniqueValues(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryUniqueValues(this._cleanUpQuery(e),r,i)}async queryAggregateUniqueValues(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryAggregateUniqueValues(this._cleanUpAggregateQuery(e),r,i)}async queryClassBreaks(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryClassBreaks(this._cleanUpQuery(e),r,i)}async queryAggregateClassBreaks(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryAggregateClassBreaks(this._cleanUpAggregateQuery(e),r,i)}async queryHistogram(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryHistogram(this._cleanUpQuery(e),r,i)}async queryAggregateHistogram(e,t,i){const r={...t,scale:this.view.scale};return this._proxy.queryAggregateHistogram(this._cleanUpAggregateQuery(e),r,i)}queryFeatures(e,t){return this.queryFeaturesJSON(e,t).then(i=>{const r=B.fromJSON(i);return r.features.forEach(s=>this._setLayersForFeature(s)),r})}queryVisibleFeatures(e,t){return this._proxy.queryVisibleFeatures(this._cleanUpQuery(e),t).then(i=>{const r=B.fromJSON(i);return r.features.forEach(s=>this._setLayersForFeature(s)),r})}async queryAggregates(e,t){const i=await this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),t),r=Ke.fromJSON(i);return r.features.forEach(s=>this._setLayersForFeature(s)),r}queryAggregateIds(e,t){return this._proxy.queryAggregateIds(this._cleanUpAggregateQuery(e),t)}queryAggregateCount(e,t){return this._proxy.queryAggregateCount(this._cleanUpAggregateQuery(e),t)}queryAggregateJSON(e,t){return this._proxy.queryAggregates(this._cleanUpAggregateQuery(e),t)}queryFeaturesJSON(e,t){return this._proxy.queryFeatures(this._cleanUpQuery(e),t)}queryObjectIds(e,t){return this._proxy.queryObjectIds(this._cleanUpQuery(e),t)}queryFeatureCount(e,t){return this._proxy.queryFeatureCount(this._cleanUpQuery(e),t)}queryExtent(e,t){return this._proxy.queryExtent(this._cleanUpQuery(e),t).then(i=>({count:i.count,extent:Oe.fromJSON(i.extent)}))}setVisibility(e,t){t?this._visibilityOverrides.delete(e):this._visibilityOverrides.add(e),this._update()}update(e){if(!this._tileStrategy||!this.tileRenderer)return;const{hasMissingTiles:t,added:i,removed:r}=this._tileStrategy.update(e);(i.length||r.length)&&this._proxy.updateTiles({added:i,removed:r}),t&&this.requestUpdate(),this.notifyChange("updating")}attach(){this.view.timeline.record(`${this.layer.title} (FeatureLayer) Attach`),this._tileStrategy=new tt({acquireTile:e=>this._acquireTile(e),releaseTile:e=>this._releaseTile(e),tileInfoView:this.view.featuresTilingScheme,buffer:0}),this.handles.add(A(()=>this.renderingConfigHash,()=>this._update(),Te),"attach"),this.layer.type!=="stream"&&this.handles.add(this.layer.on("edits",e=>this._edit(e)),"attach")}detach(){var e;this._commandsQueue.clear(),(e=this._proxy)==null||e.stop(),this.container.removeAllChildren(),this.handles.remove("attach"),this.tileRenderer&&(this.tileRenderer.uninstall(this.container),this.tileRenderer=null),this._tileStrategy&&(this._tileStrategy.destroy(),this._tileStrategy=null),this._tileRendererHash=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}isUpdating(){var o;const e="renderer"in this.layer&&this.layer.renderer!=null,t=this._commandsQueue.updating,i=this._updatingRequiredFieldsPromise!=null,r=!this._proxy||!this._proxy.isReady,s=this._pipelineIsUpdating,a=this.tileRenderer==null||((o=this.tileRenderer)==null?void 0:o.updating),n=e&&(t||i||r||s||a);return E("esri-2d-log-updating")&&console.log(`Updating FLV2D: ${n} -> hasRenderer ${e} -> hasPendingCommand ${t} diff --git a/assets/FeatureServiceSnappingSourceWorker.5ab08ebc.js b/assets/FeatureServiceSnappingSourceWorker.1a7b44d8.js similarity index 98% rename from assets/FeatureServiceSnappingSourceWorker.5ab08ebc.js rename to assets/FeatureServiceSnappingSourceWorker.1a7b44d8.js index 2a66cb3..c13a651 100644 --- a/assets/FeatureServiceSnappingSourceWorker.5ab08ebc.js +++ b/assets/FeatureServiceSnappingSourceWorker.1a7b44d8.js @@ -1 +1 @@ -import{c2 as W,g1 as et,c as p,j as y,gg as st,e6 as it,v as m,b4 as D,bz as H,a6 as h,a7 as d,a8 as O,a9 as X,ay as Y,av as $,gh as N,cM as P,aM as z,dA as rt,gi as nt,dz as K,gj as at,gk as ot,dd as I,cU as lt,aU as ct,s as ut,er as ht,u as dt,gl as pt,gm as ft,gn as _t,go as gt,cb as yt,cJ as mt,eM as Et,f1 as Ct,gp as Ft,du as x,gq as Tt,gr as U,gs as tt,cP as vt,W as St,gt as M,au as bt,gu as j,aT as q,gv as It,gw as wt,_ as B,ds as xt}from"./index.d94abe07.js";import{o as Ot,u as At}from"./FeatureStore.27890cc9.js";import{Y as $t}from"./QueryEngine.5a5ece4a.js";import"./PooledRBush.04520070.js";import"./centroid.cc817cc5.js";import"./QueryEngineResult.7611d68a.js";import"./quantizationUtils.0d428d19.js";import"./WhereClause.253310fe.js";import"./utils.8c53cad2.js";import"./generateRendererUtils.ebdde5b7.js";import"./projectionSupport.0542c13b.js";import"./json.879c9adc.js";import"./utils.399e6089.js";import"./QueryEngineCapabilities.78217f95.js";import"./timeSupport.668a2439.js";function V(t=!1,e){if(t){const{elevationInfo:s,alignPointsInFeatures:i,spatialReference:r}=e;return new zt(s,i,r)}return new Rt}class Rt{async alignCandidates(e,s){return e}notifyElevationSourceChange(){}}const Pt=1024;class zt{constructor(e,s,i){this._elevationInfo=e,this._alignPointsInFeatures=s,this.spatialReference=i,this._alignmentsCache=new W(Pt),this._cacheVersion=0,this._metersPerVerticalUnit=et(i)}async alignCandidates(e,s){const i=this._elevationInfo;return p(i)&&i.mode==="absolute-height"&&!i.featureExpressionInfo?(this._alignAbsoluteElevationCandidates(e,i),e):this._alignComputedElevationCandidates(e,s)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}_alignAbsoluteElevationCandidates(e,s){const{offset:i,unit:r}=s;if(y(i))return;const n=i*(st(r!=null?r:"meters")/this._metersPerVerticalUnit);for(const a of e)switch(a.type){case"edge":a.start.z+=n,a.end.z+=n;continue;case"vertex":a.target.z+=n;continue}}async _alignComputedElevationCandidates(e,s){const i=new Map;for(const g of e)it(i,g.objectId,Ht).push(g);const[r,n,a]=this._prepareQuery(i),o=await this._alignPointsInFeatures(r,s);if(m(s),a!==this._cacheVersion)return this._alignComputedElevationCandidates(e,s);this._applyCacheAndResponse(r,o,n);const{drapedObjectIds:u,failedObjectIds:l}=o,_=[];for(const g of e){const{objectId:E}=g;u.has(E)&&g.type==="edge"&&(g.draped=!0),l.has(E)||_.push(g)}return _}_prepareQuery(e){const s=[],i=[];for(const[r,n]of e){const a=[];for(const o of n)this._addToQueriesOrCachedResult(r,o.target,a,i),o.type==="edge"&&(this._addToQueriesOrCachedResult(r,o.start,a,i),this._addToQueriesOrCachedResult(r,o.end,a,i));a.length!==0&&s.push({objectId:r,points:a})}return[s,i,this._cacheVersion]}_addToQueriesOrCachedResult(e,s,i,r){const n=k(e,s),a=this._alignmentsCache.get(n);p(a)?r.push(new Dt(s,a)):i.push(s)}_applyCacheAndResponse(e,{elevations:s,drapedObjectIds:i,failedObjectIds:r},n){for(const u of n)u.apply();let a=0;const o=this._alignmentsCache;for(const{objectId:u,points:l}of e){if(r.has(u)){a+=l.length;continue}const _=!i.has(u);for(const g of l){const E=k(u,g),C=s[a++];g.z=C,_&&o.put(E,C,1)}}}}class Dt{constructor(e,s){this.point=e,this.z=s}apply(){this.point.z=this.z}}function k(t,{x:e,y:s,z:i}){return`${t}-${e}-${s}-${i!=null?i:0}}`}function Ht(){return[]}class Nt{filter(e,s){return s}notifyElevationSourceChange(){}}class Ut{filter(e,s){const{point:i,distance:r}=e,{z:n}=i;if(n==null||s.length===0)return s;const a=Vt(r),o=this._updateCandidatesTo3D(s,i,a).filter(Mt);return o.sort(kt),o}_updateCandidatesTo3D(e,s,i){for(const r of e)switch(r.type){case"edge":jt(r,s,i);continue;case"vertex":Bt(r,s,i);continue}return e}}function Mt(t){return t.distance<=1}function J(t=!1){return t?new Ut:new Nt}function jt(t,e,{x:s,y:i,z:r}){const{start:n,end:a,target:o}=t;t.draped||qt(o,e,n,a);const u=(e.x-o.x)/s,l=(e.y-o.y)/i,_=(e.z-o.z)/r;t.distance=Math.sqrt(u*u+l*l+_*_)}function qt(t,e,s,i){const r=i.x-s.x,n=i.y-s.y,a=i.z-s.z,o=r*r+n*n+a*a,u=(e.x-s.x)*r+(e.y-s.y)*n+a*(e.z-s.z),l=Math.min(1,Math.max(0,u/o)),_=s.x+r*l,g=s.y+n*l,E=s.z+a*l;t.x=_,t.y=g,t.z=E}function Bt(t,e,{x:s,y:i,z:r}){const{target:n}=t,a=(e.x-n.x)/s,o=(e.y-n.y)/i,u=(e.z-n.z)/r,l=Math.sqrt(a*a+o*o+u*u);t.distance=l}function Vt(t){return typeof t=="number"?{x:t,y:t,z:t}:t}function kt(t,e){return t.distance-e.distance}function L(t=!1,e){return t?new Qt(e):new Jt}class Jt{async fetch(){return[]}notifySymbologyChange(){}}const Lt=1024;class Qt{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new W(Lt),this._cacheVersion=0}async fetch(e,s){if(e.length===0)return[];const i=[],r=[],n=this._candidatesCache;for(const g of e){const E=Q(g),C=n.get(E);if(C)for(const b of C)r.push(D(b));else i.push(g),n.put(E,[],1)}if(i.length===0)return r;const a=this._cacheVersion,{candidates:o,sourceCandidateIndices:u}=await this._getSymbologyCandidates(i,s);if(m(s),a!==this._cacheVersion)return this.fetch(e,s);const l=[],{length:_}=o;for(let g=0;g<_;++g){const E=o[g],C=Q(i[u[g]]),b=n.get(C);b.push(E),n.put(C,b,b.length),l.push(D(E))}return r.concat(l)}notifySymbologyChange(){this._candidatesCache.clear(),this._cacheVersion++}}function Q(t){var e,s,i;switch(t.type){case"vertex":{const{objectId:r,target:n}=t,a=`${r}-vertex-${n.x}-${n.y}-${(e=n.z)!=null?e:0}`;return H(a).toString()}case"edge":{const{objectId:r,start:n,end:a}=t,o=`${r}-edge-${n.x}-${n.y}-${(s=n.z)!=null?s:0}-to-${a.x}-${a.y}-${(i=a.z)!=null?i:0}`;return H(o).toString()}default:return""}}let w=class extends X{constructor(){super(...arguments),this.updating=!1,this._pending=[]}push(t,e){this._pending.push({promise:t,callback:e}),this._pending.length===1&&this._process()}_process(){if(!this._pending.length)return void(this.updating=!1);this.updating=!0;const t=this._pending[0];t.promise.then(e=>t.callback(e)).catch(()=>{}).then(()=>{this._pending.shift(),this._process()})}};h([d()],w.prototype,"updating",void 0),w=h([O("esri.core.AsyncSequence")],w);class Gt{constructor(e,s){this.data=e,this.resolution=s,this.state={type:c.CREATED},this.alive=!0}process(e){switch(this.state.type){case c.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case c.FETCH_COUNT:break;case c.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case c.FETCH_FEATURES:break;case c.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case c.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case c.CREATED:case c.FETCH_COUNT:return 0;case c.FETCHED_COUNT:return this.state.featureCount;case c.FETCH_FEATURES:return this.state.previous.featureCount;case c.FETCHED_FEATURES:return this.state.features.length;case c.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case c.CREATED:return"created";case c.FETCH_COUNT:return"fetch-count";case c.FETCHED_COUNT:return"fetched-count";case c.FETCH_FEATURES:return"fetch-features";case c.FETCHED_FEATURES:return"fetched-features";case c.DONE:return"done"}}_gotoFetchCount(e,s){return{type:c.FETCH_COUNT,previous:e,task:$(async i=>{const r=await N(s.fetchCount(this,i));this.state.type===c.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,r.ok?r.value:1/0))})}}_gotoFetchedCount(e,s){return{type:c.FETCHED_COUNT,featureCount:s,previous:e}}_gotoFetchFeatures(e,s){return{type:c.FETCH_FEATURES,previous:e,task:$(async i=>{const r=await N(s.fetchFeatures(this,e.featureCount,i));this.state.type===c.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,r.ok?r.value:[]))})}}_gotoFetchedFeatures(e,s){return{type:c.FETCHED_FEATURES,previous:e,features:s}}_goToDone(e,s){return s.finish(this,e.features),{type:c.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:c.CREATED},e.type){case c.CREATED:case c.FETCHED_COUNT:case c.FETCHED_FEATURES:case c.DONE:break;case c.FETCH_COUNT:case c.FETCH_FEATURES:e.task.abort()}}intersects(e){return!(!y(e)&&this.data.extent)||(P(e,G),z(this.data.extent,G))}}var c;(function(t){t[t.CREATED=0]="CREATED",t[t.FETCH_COUNT=1]="FETCH_COUNT",t[t.FETCHED_COUNT=2]="FETCHED_COUNT",t[t.FETCH_FEATURES=3]="FETCH_FEATURES",t[t.FETCHED_FEATURES=4]="FETCHED_FEATURES",t[t.DONE=5]="DONE"})(c||(c={}));const G=Y();let f=class extends rt{constructor(t){super(t),this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._pendingEdits=new w,this._pendingEditsAbortController=new AbortController}get _minimumVerticesPerFeature(){var t;switch((t=this.store)==null?void 0:t.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}set filter(t){const e=this._get("filter"),s=this._filterProperties(t);JSON.stringify(e)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(t){const e=this._get("customParameters");JSON.stringify(e)!==JSON.stringify(t)&&this._set("customParameters",t)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(t){const e=this._get("tileInfo");e!==t&&(p(t)&&p(e)&&JSON.stringify(t)===JSON.stringify(e)||(this._set("tileInfo",t),this.store.tileInfo=t))}set tileSize(t){this._get("tileSize")!==t&&this._set("tileSize",t)}get updating(){return this.updatingExcludingEdits||this._pendingEdits.updating}get updatingExcludingEdits(){return this.updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}initialize(){this._initializeFetchExtent(),this.updatingHandles.add(()=>this._configuration,()=>this.refresh()),this.updatingHandles.add(()=>this.tilesOfInterest,(t,e)=>{nt(t,e,({id:s},{id:i})=>s===i)||this._process()},K)}destroy(){this._pendingTiles.forEach(t=>this._deletePendingTile(t)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null}refresh(){this.store.refresh(),this._pendingTiles.forEach(t=>this._deletePendingTile(t)),this._process()}applyEdits(t){this._pendingEdits.push(t,async e=>{if(e.addedFeatures.length===0&&e.updatedFeatures.length===0&&e.deletedFeatures.length===0)return;for(const[,i]of this._pendingTiles)i.reset();const s={...e,deletedFeatures:e.deletedFeatures.map(({objectId:i,globalId:r})=>i&&i!==-1?i:this._lookupObjectIdByGlobalId(r))};await this.updatingHandles.addPromise(this.store.processEdits(s,(i,r)=>this._queryFeaturesById(i,r),this._pendingEditsAbortController.signal)),this._processPendingTiles()})}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!at(this.url))return;const t=$(async e=>{var s;try{const i=await ot(this.url,new I({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:!!this.capabilities.query.supportsCacheHint||void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=lt.fromJSON((s=i.data)==null?void 0:s.extent)}catch(i){ct(i),ut.getLogger(this.declaredClass).warn("Failed to fetch data extent",i)}});this.updatingHandles.addPromise(t.promise.then(()=>this._process())),this.handles.add(ht(()=>t.abort()))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(t=>t.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,t]of this._pendingTiles)t.alive=!1}_createPendingTiles(){const t=this._collectMissingTilesInfo();if(this._setAvailability(y(t)?1:t.coveredArea/t.fullArea),!y(t))for(const{data:e,resolution:s}of t.missingTiles){const i=this._pendingTiles.get(e.id);i?(i.resolution=s,i.alive=!0):this._createPendingTile(e,s)}}_collectMissingTilesInfo(){let t=null;for(let e=this.tilesOfInterest.length-1;e>=0;e--){const s=this.tilesOfInterest[e],i=this.store.process(s,(r,n)=>this._verifyTileComplexity(r,n));y(t)?t=i:t.prepend(i)}return t}_deletePendingTiles(){for(const[,t]of this._pendingTiles)t.alive||this._deletePendingTile(t)}_processPendingTiles(){const t={fetchCount:(e,s)=>this._fetchCount(e,s),fetchFeatures:(e,s,i)=>this._fetchFeatures(e,s,i),finish:(e,s)=>this._finishPendingTile(e,s),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(t))for(const[,e]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(e.data),e.resolution)&&this.updatingHandles.addPromise(e.process(t))}_verifyTileComplexity(t,e){return this._verifyVertexComplexity(t)&&this._verifyFeatureDensity(t,e)}_verifyVertexComplexity(t){return t*this._minimumVerticesPerFeature{var n;t===r.attributes[e]&&(i=(n=r.objectId)!=null?n:r.attributes[s])}),y(i))throw new Error(`Expected to find a feature with globalId ${t}`);return i}_queryFeaturesById(t,e){const s=this._createFeaturesQuery();return s.objectIds=t,this._queryFeatures(s,e)}_queryFeatures(t,e){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(t,e):this._queryFeaturesJSON(t,e)}async _queryFeaturesPBF(t,e){const{sourceSpatialReference:s}=this,{data:i}=await pt(this.url,t,new ft({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:A,signal:e});return _t(i)}async _queryFeaturesJSON(t,e){const{sourceSpatialReference:s}=this,{data:i}=await gt(this.url,t,s,{query:this._configuration.customParameters,timeout:A,signal:e});return yt(i,this.objectIdField)}_createCountQuery(t){const e=this._createBaseQuery(t);return this.capabilities.query.supportsCacheHint&&(e.cacheHint=!0),e}_createFeaturesQuery(t=null){const e=this._createBaseQuery(t);return e.outFields=this.globalIdField?[this.globalIdField,this.objectIdField]:[this.objectIdField],e.returnGeometry=!0,p(t)&&(this.capabilities.query.supportsResultType?e.resultType="tile":this.capabilities.query.supportsCacheHint&&(e.cacheHint=!0)),e}_createBaseQuery(t){const e=new I({returnZ:this.hasZ,returnM:!1,geometry:p(this.tileInfo)&&p(t)?mt(t.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return p(s)&&(e.where=s.where,e.gdbVersion=s.gdbVersion,e.timeExtent=s.timeExtent),e.outSpatialReference=this.spatialReference,e}_setPagingParameters(t,e,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:r,tileMaxRecordCount:n,maxRecordCount:a,supportsResultType:o}=this.capabilities.query,u=i?I.MAX_MAX_RECORD_COUNT_FACTOR:1,l=u*((o||r)&&n?n:a||Zt);return t.start=e,i?(t.maxRecordCountFactor=Math.min(u,Math.ceil(s/l)),t.num=Math.min(s,t.maxRecordCountFactor*l)):t.num=Math.min(s,l),!0}};h([d({constructOnly:!0})],f.prototype,"url",void 0),h([d({constructOnly:!0})],f.prototype,"objectIdField",void 0),h([d({constructOnly:!0})],f.prototype,"globalIdField",void 0),h([d({constructOnly:!0})],f.prototype,"capabilities",void 0),h([d({constructOnly:!0})],f.prototype,"sourceSpatialReference",void 0),h([d({constructOnly:!0})],f.prototype,"spatialReference",void 0),h([d({constructOnly:!0})],f.prototype,"store",void 0),h([d({readOnly:!0})],f.prototype,"_minimumVerticesPerFeature",null),h([d()],f.prototype,"filter",null),h([d()],f.prototype,"customParameters",null),h([d({readOnly:!0})],f.prototype,"_configuration",null),h([d()],f.prototype,"tileInfo",null),h([d()],f.prototype,"tileSize",null),h([d()],f.prototype,"tilesOfInterest",void 0),h([d({readOnly:!0})],f.prototype,"updating",null),h([d({readOnly:!0})],f.prototype,"updatingExcludingEdits",null),h([d({readOnly:!0})],f.prototype,"availability",void 0),h([d()],f.prototype,"hasZ",null),f=h([O("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],f);const Zt=2e3,A=6e5,Wt=1e6,Xt=25,Yt=1;class Kt{constructor(){this._store=new Map,this._byteSize=0}set(e,s){this.delete(e),this._store.set(e,s),this._byteSize+=s.byteSize}delete(e){const s=this._store.get(e);return!!this._store.delete(e)&&(s!=null&&(this._byteSize-=s.byteSize),!0)}get(e){return this._used(e),this._store.get(e)}has(e){return this._used(e),this._store.has(e)}clear(){this._store.clear()}applyByteSizeLimit(e,s){for(const[i,r]of this._store){if(this._byteSize<=e)break;this.delete(i),s(r)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const s=this._store.get(e);s&&(this._store.delete(e),this._store.set(e,s))}}let v=class extends X{constructor(t){super(t),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*Et.MEGABYTES,this._tileBounds=new Ot,this._tiles=new Kt,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=Y()}add(t,e){const s=[];for(const i of e)this._referenceFeature(i.objectId)===T.ADDED&&s.push(i);this._addTileStorage(t,new Set(e.map(({objectId:i})=>i)),te(e)),this.featureStore.addMany(s),this._tiles.applyByteSizeLimit(this.maximumByteSize,i=>this._removeTileStorage(i))}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(t,e,s){return this._processEditsDelete(t.deletedFeatures.concat(t.updatedFeatures)),this._processEditsRefetch(t.addedFeatures.concat(t.updatedFeatures),e,s)}_addTileStorage(t,e,s){this._tiles.set(t.id,new ie(t,e,s)),this._tileBounds.set(t.id,t.extent),this._tileFeatureCounts.set(t.id,e.size)}_remove({id:t}){const e=this._tiles.get(t);e&&this._removeTileStorage(e)}_removeTileStorage(t){const e=[];for(const i of t.objectIds)this._unreferenceFeature(i)===T.REMOVED&&e.push(i);this.featureStore.removeManyById(e);const s=t.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(t){this.featureStore.removeManyById(t);for(const[,e]of this._tiles){for(const s of t)e.objectIds.delete(s);this._tileFeatureCounts.set(e.data.id,e.objectIds.size)}for(const e of t)this._refCounts.delete(e)}async _processEditsRefetch(t,e,s){const i=(await e(t,s)).features,{hasZ:r,hasM:n}=this.featureStore;for(const a of i){const o=Ct(this._tmpBoundingRect,a.geometry,r,n);y(o)||this._tileBounds.forEachInBounds(o,u=>{const l=this._tiles.get(u);this.featureStore.add(a),l.objectIds.has(a.objectId)||(l.objectIds.add(a.objectId),this._referenceFeature(a.objectId),this._tileFeatureCounts.set(l.data.id,l.objectIds.size))})}}process(t,e=()=>!0){if(y(this.tileInfo)||!t.extent||p(this.extent)&&!z(P(this.extent,this._tmpBoundingRect),t.extent))return new R(t);if(this._tiles.has(t.id))return new R(t);const s=this._createTileTree(t,this.tileInfo);return this._simplify(s,e,null,0,1),this._collectMissingTiles(t,s,this.tileInfo)}get debugInfo(){return Array.from(this._tiles.values()).map(({data:t})=>({data:t,featureCount:this._tileFeatureCounts.get(t.id)||0}))}getFeatureCount(t){var e;return(e=this._tileFeatureCounts.get(t.id))!=null?e:0}async fetchCount(t,e,s,i){const r=this._tileFeatureCounts.get(t.id);if(r!=null)return r;const n=await Ft(e,s,i);return this._tileFeatureCounts.set(t.id,n.data.count),n.data.count}_createTileTree(t,e){const s=new Z(t.level,t.row,t.col);return e.updateTileInfo(s,x.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(t.extent,i=>{const r=this._tiles.get(i).data;this._tilesAreRelated(t,r)&&this._populateChildren(s,r,e,this._tileFeatureCounts.get(r.id)||0)}),s}_tilesAreRelated(t,e){if(!t||!e)return!1;if(t.level===e.level)return t.row===e.row&&t.col===e.col;const s=t.level>r,a=e.col>>r,o=t.row<<1,u=a-(t.col<<1)+(n-o<<1),l=t.children[u];if(p(l))this._populateChildren(l,e,s,i);else{const _=new Z(t.level+1,n,a);s.updateTileInfo(_,x.ExtrapolateOptions.POWER_OF_TWO),t.children[u]=_,this._populateChildren(_,e,s,i)}}_simplify(t,e,s,i,r){const n=r*r;if(t.isLeaf)return e(this.getFeatureCount(t),r)?0:(this._remove(t),p(s)&&(s.children[i]=null),n);const a=r/2,o=a*a;let u=0;for(let l=0;l{const r=this._tiles.get(i.id);if(r){s+=r.byteSize;for(const n of r.objectIds)e.has(n)||(e.add(n),this._referenceFeature(n));this._remove(i)}}),this._addTileStorage(t,e,s),t.isLeaf=!0,t.children[0]=t.children[1]=t.children[2]=t.children[3]=null,this._tileFeatureCounts.set(t.id,e.size)}_forEachLeaf(t,e){for(const s of t.children)y(s)||(s.isLeaf?e(s):this._forEachLeaf(s,e))}_purge(t){if(!y(t))if(t.isLeaf)this._remove(t);else for(let e=0;e>1),(t.col<<1)+(1&r),i):this._collectMissingTilesRecurse(n,e,i)}}_referenceFeature(t){const e=(this._refCounts.get(t)||0)+1;return this._refCounts.set(t,e),e===1?T.ADDED:T.UNCHANGED}_unreferenceFeature(t){const e=(this._refCounts.get(t)||0)-1;return e===0?(this._refCounts.delete(t),T.REMOVED):(e>0&&this._refCounts.set(t,e),T.UNCHANGED)}get test(){return{tiles:Array.from(this._tiles.values()).map(t=>`${t.data.id}:[${Array.from(t.objectIds)}]`),featureReferences:Array.from(this._refCounts.keys()).map(t=>`${t}:${this._refCounts.get(t)}`)}}};function te(t){return t.reduce((e,s)=>e+ee(s),0)}function ee(t){return 32+se(t.geometry)+Tt(t.attributes)}function se(t){if(y(t))return 0;const e=U(t.lengths,4);return 32+U(t.coords,8)+e}h([d({constructOnly:!0})],v.prototype,"featureStore",void 0),h([d()],v.prototype,"tileInfo",void 0),h([d()],v.prototype,"extent",void 0),h([d()],v.prototype,"maximumByteSize",void 0),v=h([O("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],v);class ie{constructor(e,s,i){this.data=e,this.objectIds=s,this.byteSize=i}}class Z{constructor(e,s,i){this.level=e,this.row=s,this.col=i,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(p(this.children[0])||p(this.children[1])||p(this.children[2])||p(this.children[3]))}}class R{constructor(e,s=[]){this.missingTiles=s,this.fullArea=0,this.coveredArea=0,this.fullArea=tt(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class re{constructor(e,s,i){this._tileInfo=e,this._extent=null,this.info=new R(s),p(i)&&(this._extent=P(i))}addMissing(e,s,i,r){const n=new vt(null,e,s,i);this._tileInfo.updateTileInfo(n,x.ExtrapolateOptions.POWER_OF_TWO),y(n.extent)||p(this._extent)&&!z(this._extent,n.extent)||(this.info.missingTiles.push({data:n,resolution:r}),this.info.coveredArea-=tt(n.extent))}}const ne=.18751;var T;(function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.UNCHANGED=2]="UNCHANGED"})(T||(T={}));let S=class extends St.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=M(),this._elevationAligner=V(),this._elevationFilter=J(),this._symbologyCandidatesFetcher=L(),this._handles=new bt,this._updatingHandles=new j,this._editsUpdatingHandles=new j,this._pendingApplyEdits=new Map,this._alignPointsInFeatures=async(t,e)=>{const s={points:t},i=await this.remoteClient.invoke("alignElevation",s,{signal:e});return m(e),i},this._getSymbologyCandidates=async(t,e)=>{const s={candidates:t,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:e});return m(e),i}}get updating(){return this.updatingExcludingEdits||this._editsUpdatingHandles.updating||this._featureFetcher.updating}get updatingExcludingEdits(){return this._featureFetcher.updatingExcludingEdits||this._isInitializing||this._updatingHandles.updating}destroy(){this._featureFetcher.destroy(),this._queryEngine.destroy(),this._featureStore.clear(),this._handles.destroy()}async setup(t){const{geometryType:e,objectIdField:s,timeInfo:i,fields:r}=t.serviceInfo,{hasZ:n}=t,a=q.fromJSON(t.spatialReference);this._spatialReference=a,this._featureStore=new At({...t.serviceInfo,hasZ:n,hasM:!1}),this._queryEngine=new $t({spatialReference:t.spatialReference,featureStore:this._featureStore,geometryType:e,fields:r,hasZ:n,hasM:!1,objectIdField:s,timeInfo:i?It.fromJSON(i):null}),this._featureFetcher=new f({store:new v({featureStore:this._featureStore}),url:t.serviceInfo.url,objectIdField:t.serviceInfo.objectIdField,globalIdField:t.serviceInfo.globalIdField,capabilities:t.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:q.fromJSON(t.serviceInfo.spatialReference)});const o=t.configuration.viewType==="3d";return this._elevationAligner=V(o,{elevationInfo:p(t.elevationInfo)?wt.fromJSON(t.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures,spatialReference:a}),this._elevationFilter=J(o),this._handles.add([B(()=>this._featureFetcher.availability,u=>this.emit("notify-availability",{availability:u}),K),B(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(t.configuration)}async configure(t){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(t),{result:{}}}async fetchCandidates(t,e){await this._whenSetup.promise,m(e);const s=ae(t),i=p(e)?e.signal:null,r=await this._queryEngine.executeQueryForSnapping(s,i);m(i);const n=await this._elevationAligner.alignCandidates(r.candidates,i);m(i);const a=await this._symbologyCandidatesFetcher.fetch(n,i);m(i);const o=a.length===0?n:n.concat(a);return{result:{candidates:this._elevationFilter.filter(s,o)}}}async updateTiles(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),m(e),this._featureFetcher.tileSize=t.tileSize,this._featureFetcher.tilesOfInterest=t.tiles,this._featureFetcher.tileInfo=p(t.tileInfo)?x.fromJSON(t.tileInfo):null,F}async refresh(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),m(e),this._featureFetcher.refresh(),F}async whenNotUpdating(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),m(e),await xt(()=>!this.updatingExcludingEdits,e),m(e),F}async getDebugInfo(t,e){return m(e),{result:this._featureFetcher.debugInfo}}async beginApplyEdits(t,e){this._updatingHandles.addPromise(this._whenSetup.promise),m(e);const s=M();return this._pendingApplyEdits.set(t.id,s),this._featureFetcher.applyEdits(s.promise),this._editsUpdatingHandles.addPromise(s.promise),F}async endApplyEdits(t,e){const s=this._pendingApplyEdits.get(t.id);return s&&s.resolve(t.edits),m(e),F}async notifyElevationSourceChange(t,e){return this._elevationAligner.notifyElevationSourceChange(),F}async notifySymbologyChange(t,e){return F}async setSymbologySnappingSupported(t){return this._symbologyCandidatesFetcher=L(t,this._getSymbologyCandidates),F}_updateFeatureFetcherConfiguration(t){this._featureFetcher.filter=p(t.filter)?I.fromJSON(t.filter):null,this._featureFetcher.customParameters=t.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};h([d({readOnly:!0})],S.prototype,"updating",null),h([d({readOnly:!0})],S.prototype,"updatingExcludingEdits",null),h([d()],S.prototype,"_isInitializing",void 0),S=h([O("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],S);const Te=S;function ae(t){return{point:t.point,distance:t.distance,types:t.types,query:p(t.filter)?t.filter:{where:"1=1"}}}const F={result:{}};export{Te as default}; +import{c2 as W,g1 as et,c as p,j as y,gg as st,e6 as it,v as m,b4 as D,bz as H,a6 as h,a7 as d,a8 as O,a9 as X,ay as Y,av as $,gh as N,cM as P,aM as z,dA as rt,gi as nt,dz as K,gj as at,gk as ot,dd as I,cU as lt,aU as ct,s as ut,er as ht,u as dt,gl as pt,gm as ft,gn as _t,go as gt,cb as yt,cJ as mt,eM as Et,f1 as Ct,gp as Ft,du as x,gq as Tt,gr as U,gs as tt,cP as vt,W as St,gt as M,au as bt,gu as j,aT as q,gv as It,gw as wt,_ as B,ds as xt}from"./index.221827cd.js";import{o as Ot,u as At}from"./FeatureStore.99d80f36.js";import{Y as $t}from"./QueryEngine.ac81c46d.js";import"./PooledRBush.e6a31ee9.js";import"./centroid.06db4b74.js";import"./QueryEngineResult.2fc58178.js";import"./quantizationUtils.7ff797cc.js";import"./WhereClause.5b749615.js";import"./utils.83e0b804.js";import"./generateRendererUtils.5c972fdb.js";import"./projectionSupport.4f5da4af.js";import"./json.879c9adc.js";import"./utils.e42485ea.js";import"./QueryEngineCapabilities.78217f95.js";import"./timeSupport.968e62fc.js";function V(t=!1,e){if(t){const{elevationInfo:s,alignPointsInFeatures:i,spatialReference:r}=e;return new zt(s,i,r)}return new Rt}class Rt{async alignCandidates(e,s){return e}notifyElevationSourceChange(){}}const Pt=1024;class zt{constructor(e,s,i){this._elevationInfo=e,this._alignPointsInFeatures=s,this.spatialReference=i,this._alignmentsCache=new W(Pt),this._cacheVersion=0,this._metersPerVerticalUnit=et(i)}async alignCandidates(e,s){const i=this._elevationInfo;return p(i)&&i.mode==="absolute-height"&&!i.featureExpressionInfo?(this._alignAbsoluteElevationCandidates(e,i),e):this._alignComputedElevationCandidates(e,s)}notifyElevationSourceChange(){this._alignmentsCache.clear(),this._cacheVersion++}_alignAbsoluteElevationCandidates(e,s){const{offset:i,unit:r}=s;if(y(i))return;const n=i*(st(r!=null?r:"meters")/this._metersPerVerticalUnit);for(const a of e)switch(a.type){case"edge":a.start.z+=n,a.end.z+=n;continue;case"vertex":a.target.z+=n;continue}}async _alignComputedElevationCandidates(e,s){const i=new Map;for(const g of e)it(i,g.objectId,Ht).push(g);const[r,n,a]=this._prepareQuery(i),o=await this._alignPointsInFeatures(r,s);if(m(s),a!==this._cacheVersion)return this._alignComputedElevationCandidates(e,s);this._applyCacheAndResponse(r,o,n);const{drapedObjectIds:u,failedObjectIds:l}=o,_=[];for(const g of e){const{objectId:E}=g;u.has(E)&&g.type==="edge"&&(g.draped=!0),l.has(E)||_.push(g)}return _}_prepareQuery(e){const s=[],i=[];for(const[r,n]of e){const a=[];for(const o of n)this._addToQueriesOrCachedResult(r,o.target,a,i),o.type==="edge"&&(this._addToQueriesOrCachedResult(r,o.start,a,i),this._addToQueriesOrCachedResult(r,o.end,a,i));a.length!==0&&s.push({objectId:r,points:a})}return[s,i,this._cacheVersion]}_addToQueriesOrCachedResult(e,s,i,r){const n=k(e,s),a=this._alignmentsCache.get(n);p(a)?r.push(new Dt(s,a)):i.push(s)}_applyCacheAndResponse(e,{elevations:s,drapedObjectIds:i,failedObjectIds:r},n){for(const u of n)u.apply();let a=0;const o=this._alignmentsCache;for(const{objectId:u,points:l}of e){if(r.has(u)){a+=l.length;continue}const _=!i.has(u);for(const g of l){const E=k(u,g),C=s[a++];g.z=C,_&&o.put(E,C,1)}}}}class Dt{constructor(e,s){this.point=e,this.z=s}apply(){this.point.z=this.z}}function k(t,{x:e,y:s,z:i}){return`${t}-${e}-${s}-${i!=null?i:0}}`}function Ht(){return[]}class Nt{filter(e,s){return s}notifyElevationSourceChange(){}}class Ut{filter(e,s){const{point:i,distance:r}=e,{z:n}=i;if(n==null||s.length===0)return s;const a=Vt(r),o=this._updateCandidatesTo3D(s,i,a).filter(Mt);return o.sort(kt),o}_updateCandidatesTo3D(e,s,i){for(const r of e)switch(r.type){case"edge":jt(r,s,i);continue;case"vertex":Bt(r,s,i);continue}return e}}function Mt(t){return t.distance<=1}function J(t=!1){return t?new Ut:new Nt}function jt(t,e,{x:s,y:i,z:r}){const{start:n,end:a,target:o}=t;t.draped||qt(o,e,n,a);const u=(e.x-o.x)/s,l=(e.y-o.y)/i,_=(e.z-o.z)/r;t.distance=Math.sqrt(u*u+l*l+_*_)}function qt(t,e,s,i){const r=i.x-s.x,n=i.y-s.y,a=i.z-s.z,o=r*r+n*n+a*a,u=(e.x-s.x)*r+(e.y-s.y)*n+a*(e.z-s.z),l=Math.min(1,Math.max(0,u/o)),_=s.x+r*l,g=s.y+n*l,E=s.z+a*l;t.x=_,t.y=g,t.z=E}function Bt(t,e,{x:s,y:i,z:r}){const{target:n}=t,a=(e.x-n.x)/s,o=(e.y-n.y)/i,u=(e.z-n.z)/r,l=Math.sqrt(a*a+o*o+u*u);t.distance=l}function Vt(t){return typeof t=="number"?{x:t,y:t,z:t}:t}function kt(t,e){return t.distance-e.distance}function L(t=!1,e){return t?new Qt(e):new Jt}class Jt{async fetch(){return[]}notifySymbologyChange(){}}const Lt=1024;class Qt{constructor(e){this._getSymbologyCandidates=e,this._candidatesCache=new W(Lt),this._cacheVersion=0}async fetch(e,s){if(e.length===0)return[];const i=[],r=[],n=this._candidatesCache;for(const g of e){const E=Q(g),C=n.get(E);if(C)for(const b of C)r.push(D(b));else i.push(g),n.put(E,[],1)}if(i.length===0)return r;const a=this._cacheVersion,{candidates:o,sourceCandidateIndices:u}=await this._getSymbologyCandidates(i,s);if(m(s),a!==this._cacheVersion)return this.fetch(e,s);const l=[],{length:_}=o;for(let g=0;g<_;++g){const E=o[g],C=Q(i[u[g]]),b=n.get(C);b.push(E),n.put(C,b,b.length),l.push(D(E))}return r.concat(l)}notifySymbologyChange(){this._candidatesCache.clear(),this._cacheVersion++}}function Q(t){var e,s,i;switch(t.type){case"vertex":{const{objectId:r,target:n}=t,a=`${r}-vertex-${n.x}-${n.y}-${(e=n.z)!=null?e:0}`;return H(a).toString()}case"edge":{const{objectId:r,start:n,end:a}=t,o=`${r}-edge-${n.x}-${n.y}-${(s=n.z)!=null?s:0}-to-${a.x}-${a.y}-${(i=a.z)!=null?i:0}`;return H(o).toString()}default:return""}}let w=class extends X{constructor(){super(...arguments),this.updating=!1,this._pending=[]}push(t,e){this._pending.push({promise:t,callback:e}),this._pending.length===1&&this._process()}_process(){if(!this._pending.length)return void(this.updating=!1);this.updating=!0;const t=this._pending[0];t.promise.then(e=>t.callback(e)).catch(()=>{}).then(()=>{this._pending.shift(),this._process()})}};h([d()],w.prototype,"updating",void 0),w=h([O("esri.core.AsyncSequence")],w);class Gt{constructor(e,s){this.data=e,this.resolution=s,this.state={type:c.CREATED},this.alive=!0}process(e){switch(this.state.type){case c.CREATED:return this.state=this._gotoFetchCount(this.state,e),this.state.task.promise.then(e.resume,e.resume);case c.FETCH_COUNT:break;case c.FETCHED_COUNT:return this.state=this._gotoFetchFeatures(this.state,e),this.state.task.promise.then(e.resume,e.resume);case c.FETCH_FEATURES:break;case c.FETCHED_FEATURES:this.state=this._goToDone(this.state,e);case c.DONE:}return null}get debugInfo(){return{data:this.data,featureCount:this._featureCount,state:this._stateToString}}get _featureCount(){switch(this.state.type){case c.CREATED:case c.FETCH_COUNT:return 0;case c.FETCHED_COUNT:return this.state.featureCount;case c.FETCH_FEATURES:return this.state.previous.featureCount;case c.FETCHED_FEATURES:return this.state.features.length;case c.DONE:return this.state.previous.features.length}}get _stateToString(){switch(this.state.type){case c.CREATED:return"created";case c.FETCH_COUNT:return"fetch-count";case c.FETCHED_COUNT:return"fetched-count";case c.FETCH_FEATURES:return"fetch-features";case c.FETCHED_FEATURES:return"fetched-features";case c.DONE:return"done"}}_gotoFetchCount(e,s){return{type:c.FETCH_COUNT,previous:e,task:$(async i=>{const r=await N(s.fetchCount(this,i));this.state.type===c.FETCH_COUNT&&(this.state=this._gotoFetchedCount(this.state,r.ok?r.value:1/0))})}}_gotoFetchedCount(e,s){return{type:c.FETCHED_COUNT,featureCount:s,previous:e}}_gotoFetchFeatures(e,s){return{type:c.FETCH_FEATURES,previous:e,task:$(async i=>{const r=await N(s.fetchFeatures(this,e.featureCount,i));this.state.type===c.FETCH_FEATURES&&(this.state=this._gotoFetchedFeatures(this.state,r.ok?r.value:[]))})}}_gotoFetchedFeatures(e,s){return{type:c.FETCHED_FEATURES,previous:e,features:s}}_goToDone(e,s){return s.finish(this,e.features),{type:c.DONE,previous:e}}reset(){const e=this.state;switch(this.state={type:c.CREATED},e.type){case c.CREATED:case c.FETCHED_COUNT:case c.FETCHED_FEATURES:case c.DONE:break;case c.FETCH_COUNT:case c.FETCH_FEATURES:e.task.abort()}}intersects(e){return!(!y(e)&&this.data.extent)||(P(e,G),z(this.data.extent,G))}}var c;(function(t){t[t.CREATED=0]="CREATED",t[t.FETCH_COUNT=1]="FETCH_COUNT",t[t.FETCHED_COUNT=2]="FETCHED_COUNT",t[t.FETCH_FEATURES=3]="FETCH_FEATURES",t[t.FETCHED_FEATURES=4]="FETCHED_FEATURES",t[t.DONE=5]="DONE"})(c||(c={}));const G=Y();let f=class extends rt{constructor(t){super(t),this.tilesOfInterest=[],this.availability=0,this._pendingTiles=new Map,this._pendingEdits=new w,this._pendingEditsAbortController=new AbortController}get _minimumVerticesPerFeature(){var t;switch((t=this.store)==null?void 0:t.featureStore.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":return 1;case"esriGeometryPolygon":return 4;case"esriGeometryPolyline":return 2}}set filter(t){const e=this._get("filter"),s=this._filterProperties(t);JSON.stringify(e)!==JSON.stringify(s)&&this._set("filter",s)}set customParameters(t){const e=this._get("customParameters");JSON.stringify(e)!==JSON.stringify(t)&&this._set("customParameters",t)}get _configuration(){return{filter:this.filter,customParameters:this.customParameters,tileInfo:this.tileInfo,tileSize:this.tileSize}}set tileInfo(t){const e=this._get("tileInfo");e!==t&&(p(t)&&p(e)&&JSON.stringify(t)===JSON.stringify(e)||(this._set("tileInfo",t),this.store.tileInfo=t))}set tileSize(t){this._get("tileSize")!==t&&this._set("tileSize",t)}get updating(){return this.updatingExcludingEdits||this._pendingEdits.updating}get updatingExcludingEdits(){return this.updatingHandles.updating}get hasZ(){return this.store.featureStore.hasZ}initialize(){this._initializeFetchExtent(),this.updatingHandles.add(()=>this._configuration,()=>this.refresh()),this.updatingHandles.add(()=>this.tilesOfInterest,(t,e)=>{nt(t,e,({id:s},{id:i})=>s===i)||this._process()},K)}destroy(){this._pendingTiles.forEach(t=>this._deletePendingTile(t)),this._pendingTiles.clear(),this.store.destroy(),this.tilesOfInterest.length=0,this._pendingEditsAbortController.abort(),this._pendingEditsAbortController=null}refresh(){this.store.refresh(),this._pendingTiles.forEach(t=>this._deletePendingTile(t)),this._process()}applyEdits(t){this._pendingEdits.push(t,async e=>{if(e.addedFeatures.length===0&&e.updatedFeatures.length===0&&e.deletedFeatures.length===0)return;for(const[,i]of this._pendingTiles)i.reset();const s={...e,deletedFeatures:e.deletedFeatures.map(({objectId:i,globalId:r})=>i&&i!==-1?i:this._lookupObjectIdByGlobalId(r))};await this.updatingHandles.addPromise(this.store.processEdits(s,(i,r)=>this._queryFeaturesById(i,r),this._pendingEditsAbortController.signal)),this._processPendingTiles()})}_initializeFetchExtent(){if(!this.capabilities.query.supportsExtent||!at(this.url))return;const t=$(async e=>{var s;try{const i=await ot(this.url,new I({where:"1=1",outSpatialReference:this.spatialReference,cacheHint:!!this.capabilities.query.supportsCacheHint||void 0}),{query:this._configuration.customParameters,signal:e});this.store.extent=lt.fromJSON((s=i.data)==null?void 0:s.extent)}catch(i){ct(i),ut.getLogger(this.declaredClass).warn("Failed to fetch data extent",i)}});this.updatingHandles.addPromise(t.promise.then(()=>this._process())),this.handles.add(ht(()=>t.abort()))}get debugInfo(){return{numberOfFeatures:this.store.featureStore.numFeatures,tilesOfInterest:this.tilesOfInterest,pendingTiles:Array.from(this._pendingTiles.values()).map(t=>t.debugInfo),storedTiles:this.store.debugInfo}}_process(){this._markTilesNotAlive(),this._createPendingTiles(),this._deletePendingTiles(),this._processPendingTiles()}_markTilesNotAlive(){for(const[,t]of this._pendingTiles)t.alive=!1}_createPendingTiles(){const t=this._collectMissingTilesInfo();if(this._setAvailability(y(t)?1:t.coveredArea/t.fullArea),!y(t))for(const{data:e,resolution:s}of t.missingTiles){const i=this._pendingTiles.get(e.id);i?(i.resolution=s,i.alive=!0):this._createPendingTile(e,s)}}_collectMissingTilesInfo(){let t=null;for(let e=this.tilesOfInterest.length-1;e>=0;e--){const s=this.tilesOfInterest[e],i=this.store.process(s,(r,n)=>this._verifyTileComplexity(r,n));y(t)?t=i:t.prepend(i)}return t}_deletePendingTiles(){for(const[,t]of this._pendingTiles)t.alive||this._deletePendingTile(t)}_processPendingTiles(){const t={fetchCount:(e,s)=>this._fetchCount(e,s),fetchFeatures:(e,s,i)=>this._fetchFeatures(e,s,i),finish:(e,s)=>this._finishPendingTile(e,s),resume:()=>this._processPendingTiles()};if(this._ensureFetchAllCounts(t))for(const[,e]of this._pendingTiles)this._verifyTileComplexity(this.store.getFeatureCount(e.data),e.resolution)&&this.updatingHandles.addPromise(e.process(t))}_verifyTileComplexity(t,e){return this._verifyVertexComplexity(t)&&this._verifyFeatureDensity(t,e)}_verifyVertexComplexity(t){return t*this._minimumVerticesPerFeature{var n;t===r.attributes[e]&&(i=(n=r.objectId)!=null?n:r.attributes[s])}),y(i))throw new Error(`Expected to find a feature with globalId ${t}`);return i}_queryFeaturesById(t,e){const s=this._createFeaturesQuery();return s.objectIds=t,this._queryFeatures(s,e)}_queryFeatures(t,e){return this.capabilities.query.supportsFormatPBF?this._queryFeaturesPBF(t,e):this._queryFeaturesJSON(t,e)}async _queryFeaturesPBF(t,e){const{sourceSpatialReference:s}=this,{data:i}=await pt(this.url,t,new ft({sourceSpatialReference:s}),{query:this._configuration.customParameters,timeout:A,signal:e});return _t(i)}async _queryFeaturesJSON(t,e){const{sourceSpatialReference:s}=this,{data:i}=await gt(this.url,t,s,{query:this._configuration.customParameters,timeout:A,signal:e});return yt(i,this.objectIdField)}_createCountQuery(t){const e=this._createBaseQuery(t);return this.capabilities.query.supportsCacheHint&&(e.cacheHint=!0),e}_createFeaturesQuery(t=null){const e=this._createBaseQuery(t);return e.outFields=this.globalIdField?[this.globalIdField,this.objectIdField]:[this.objectIdField],e.returnGeometry=!0,p(t)&&(this.capabilities.query.supportsResultType?e.resultType="tile":this.capabilities.query.supportsCacheHint&&(e.cacheHint=!0)),e}_createBaseQuery(t){const e=new I({returnZ:this.hasZ,returnM:!1,geometry:p(this.tileInfo)&&p(t)?mt(t.data.extent,this.tileInfo.spatialReference):void 0}),s=this._configuration.filter;return p(s)&&(e.where=s.where,e.gdbVersion=s.gdbVersion,e.timeExtent=s.timeExtent),e.outSpatialReference=this.spatialReference,e}_setPagingParameters(t,e,s){if(!this.capabilities.query.supportsPagination)return!1;const{supportsMaxRecordCountFactor:i,supportsCacheHint:r,tileMaxRecordCount:n,maxRecordCount:a,supportsResultType:o}=this.capabilities.query,u=i?I.MAX_MAX_RECORD_COUNT_FACTOR:1,l=u*((o||r)&&n?n:a||Zt);return t.start=e,i?(t.maxRecordCountFactor=Math.min(u,Math.ceil(s/l)),t.num=Math.min(s,t.maxRecordCountFactor*l)):t.num=Math.min(s,l),!0}};h([d({constructOnly:!0})],f.prototype,"url",void 0),h([d({constructOnly:!0})],f.prototype,"objectIdField",void 0),h([d({constructOnly:!0})],f.prototype,"globalIdField",void 0),h([d({constructOnly:!0})],f.prototype,"capabilities",void 0),h([d({constructOnly:!0})],f.prototype,"sourceSpatialReference",void 0),h([d({constructOnly:!0})],f.prototype,"spatialReference",void 0),h([d({constructOnly:!0})],f.prototype,"store",void 0),h([d({readOnly:!0})],f.prototype,"_minimumVerticesPerFeature",null),h([d()],f.prototype,"filter",null),h([d()],f.prototype,"customParameters",null),h([d({readOnly:!0})],f.prototype,"_configuration",null),h([d()],f.prototype,"tileInfo",null),h([d()],f.prototype,"tileSize",null),h([d()],f.prototype,"tilesOfInterest",void 0),h([d({readOnly:!0})],f.prototype,"updating",null),h([d({readOnly:!0})],f.prototype,"updatingExcludingEdits",null),h([d({readOnly:!0})],f.prototype,"availability",void 0),h([d()],f.prototype,"hasZ",null),f=h([O("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTiledFetcher")],f);const Zt=2e3,A=6e5,Wt=1e6,Xt=25,Yt=1;class Kt{constructor(){this._store=new Map,this._byteSize=0}set(e,s){this.delete(e),this._store.set(e,s),this._byteSize+=s.byteSize}delete(e){const s=this._store.get(e);return!!this._store.delete(e)&&(s!=null&&(this._byteSize-=s.byteSize),!0)}get(e){return this._used(e),this._store.get(e)}has(e){return this._used(e),this._store.has(e)}clear(){this._store.clear()}applyByteSizeLimit(e,s){for(const[i,r]of this._store){if(this._byteSize<=e)break;this.delete(i),s(r)}}values(){return this._store.values()}[Symbol.iterator](){return this._store[Symbol.iterator]()}_used(e){const s=this._store.get(e);s&&(this._store.delete(e),this._store.set(e,s))}}let v=class extends X{constructor(t){super(t),this.tileInfo=null,this.extent=null,this.maximumByteSize=10*Et.MEGABYTES,this._tileBounds=new Ot,this._tiles=new Kt,this._refCounts=new Map,this._tileFeatureCounts=new Map,this._tmpBoundingRect=Y()}add(t,e){const s=[];for(const i of e)this._referenceFeature(i.objectId)===T.ADDED&&s.push(i);this._addTileStorage(t,new Set(e.map(({objectId:i})=>i)),te(e)),this.featureStore.addMany(s),this._tiles.applyByteSizeLimit(this.maximumByteSize,i=>this._removeTileStorage(i))}destroy(){this.clear(),this._tileFeatureCounts.clear()}clear(){this.featureStore.clear(),this._tileBounds.clear(),this._tiles.clear(),this._refCounts.clear()}refresh(){this.clear(),this._tileFeatureCounts.clear()}processEdits(t,e,s){return this._processEditsDelete(t.deletedFeatures.concat(t.updatedFeatures)),this._processEditsRefetch(t.addedFeatures.concat(t.updatedFeatures),e,s)}_addTileStorage(t,e,s){this._tiles.set(t.id,new ie(t,e,s)),this._tileBounds.set(t.id,t.extent),this._tileFeatureCounts.set(t.id,e.size)}_remove({id:t}){const e=this._tiles.get(t);e&&this._removeTileStorage(e)}_removeTileStorage(t){const e=[];for(const i of t.objectIds)this._unreferenceFeature(i)===T.REMOVED&&e.push(i);this.featureStore.removeManyById(e);const s=t.data.id;this._tiles.delete(s),this._tileBounds.delete(s)}_processEditsDelete(t){this.featureStore.removeManyById(t);for(const[,e]of this._tiles){for(const s of t)e.objectIds.delete(s);this._tileFeatureCounts.set(e.data.id,e.objectIds.size)}for(const e of t)this._refCounts.delete(e)}async _processEditsRefetch(t,e,s){const i=(await e(t,s)).features,{hasZ:r,hasM:n}=this.featureStore;for(const a of i){const o=Ct(this._tmpBoundingRect,a.geometry,r,n);y(o)||this._tileBounds.forEachInBounds(o,u=>{const l=this._tiles.get(u);this.featureStore.add(a),l.objectIds.has(a.objectId)||(l.objectIds.add(a.objectId),this._referenceFeature(a.objectId),this._tileFeatureCounts.set(l.data.id,l.objectIds.size))})}}process(t,e=()=>!0){if(y(this.tileInfo)||!t.extent||p(this.extent)&&!z(P(this.extent,this._tmpBoundingRect),t.extent))return new R(t);if(this._tiles.has(t.id))return new R(t);const s=this._createTileTree(t,this.tileInfo);return this._simplify(s,e,null,0,1),this._collectMissingTiles(t,s,this.tileInfo)}get debugInfo(){return Array.from(this._tiles.values()).map(({data:t})=>({data:t,featureCount:this._tileFeatureCounts.get(t.id)||0}))}getFeatureCount(t){var e;return(e=this._tileFeatureCounts.get(t.id))!=null?e:0}async fetchCount(t,e,s,i){const r=this._tileFeatureCounts.get(t.id);if(r!=null)return r;const n=await Ft(e,s,i);return this._tileFeatureCounts.set(t.id,n.data.count),n.data.count}_createTileTree(t,e){const s=new Z(t.level,t.row,t.col);return e.updateTileInfo(s,x.ExtrapolateOptions.POWER_OF_TWO),this._tileBounds.forEachInBounds(t.extent,i=>{const r=this._tiles.get(i).data;this._tilesAreRelated(t,r)&&this._populateChildren(s,r,e,this._tileFeatureCounts.get(r.id)||0)}),s}_tilesAreRelated(t,e){if(!t||!e)return!1;if(t.level===e.level)return t.row===e.row&&t.col===e.col;const s=t.level>r,a=e.col>>r,o=t.row<<1,u=a-(t.col<<1)+(n-o<<1),l=t.children[u];if(p(l))this._populateChildren(l,e,s,i);else{const _=new Z(t.level+1,n,a);s.updateTileInfo(_,x.ExtrapolateOptions.POWER_OF_TWO),t.children[u]=_,this._populateChildren(_,e,s,i)}}_simplify(t,e,s,i,r){const n=r*r;if(t.isLeaf)return e(this.getFeatureCount(t),r)?0:(this._remove(t),p(s)&&(s.children[i]=null),n);const a=r/2,o=a*a;let u=0;for(let l=0;l{const r=this._tiles.get(i.id);if(r){s+=r.byteSize;for(const n of r.objectIds)e.has(n)||(e.add(n),this._referenceFeature(n));this._remove(i)}}),this._addTileStorage(t,e,s),t.isLeaf=!0,t.children[0]=t.children[1]=t.children[2]=t.children[3]=null,this._tileFeatureCounts.set(t.id,e.size)}_forEachLeaf(t,e){for(const s of t.children)y(s)||(s.isLeaf?e(s):this._forEachLeaf(s,e))}_purge(t){if(!y(t))if(t.isLeaf)this._remove(t);else for(let e=0;e>1),(t.col<<1)+(1&r),i):this._collectMissingTilesRecurse(n,e,i)}}_referenceFeature(t){const e=(this._refCounts.get(t)||0)+1;return this._refCounts.set(t,e),e===1?T.ADDED:T.UNCHANGED}_unreferenceFeature(t){const e=(this._refCounts.get(t)||0)-1;return e===0?(this._refCounts.delete(t),T.REMOVED):(e>0&&this._refCounts.set(t,e),T.UNCHANGED)}get test(){return{tiles:Array.from(this._tiles.values()).map(t=>`${t.data.id}:[${Array.from(t.objectIds)}]`),featureReferences:Array.from(this._refCounts.keys()).map(t=>`${t}:${this._refCounts.get(t)}`)}}};function te(t){return t.reduce((e,s)=>e+ee(s),0)}function ee(t){return 32+se(t.geometry)+Tt(t.attributes)}function se(t){if(y(t))return 0;const e=U(t.lengths,4);return 32+U(t.coords,8)+e}h([d({constructOnly:!0})],v.prototype,"featureStore",void 0),h([d()],v.prototype,"tileInfo",void 0),h([d()],v.prototype,"extent",void 0),h([d()],v.prototype,"maximumByteSize",void 0),v=h([O("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceTileStore")],v);class ie{constructor(e,s,i){this.data=e,this.objectIds=s,this.byteSize=i}}class Z{constructor(e,s,i){this.level=e,this.row=s,this.col=i,this.isLeaf=!1,this.extent=null,this.children=[null,null,null,null]}get hasChildren(){return!this.isLeaf&&(p(this.children[0])||p(this.children[1])||p(this.children[2])||p(this.children[3]))}}class R{constructor(e,s=[]){this.missingTiles=s,this.fullArea=0,this.coveredArea=0,this.fullArea=tt(e.extent),this.coveredArea=this.fullArea}prepend(e){this.missingTiles=e.missingTiles.concat(this.missingTiles),this.coveredArea+=e.coveredArea,this.fullArea+=e.fullArea}}class re{constructor(e,s,i){this._tileInfo=e,this._extent=null,this.info=new R(s),p(i)&&(this._extent=P(i))}addMissing(e,s,i,r){const n=new vt(null,e,s,i);this._tileInfo.updateTileInfo(n,x.ExtrapolateOptions.POWER_OF_TWO),y(n.extent)||p(this._extent)&&!z(this._extent,n.extent)||(this.info.missingTiles.push({data:n,resolution:r}),this.info.coveredArea-=tt(n.extent))}}const ne=.18751;var T;(function(t){t[t.ADDED=0]="ADDED",t[t.REMOVED=1]="REMOVED",t[t.UNCHANGED=2]="UNCHANGED"})(T||(T={}));let S=class extends St.EventedAccessor{constructor(){super(...arguments),this._isInitializing=!0,this.remoteClient=null,this._whenSetup=M(),this._elevationAligner=V(),this._elevationFilter=J(),this._symbologyCandidatesFetcher=L(),this._handles=new bt,this._updatingHandles=new j,this._editsUpdatingHandles=new j,this._pendingApplyEdits=new Map,this._alignPointsInFeatures=async(t,e)=>{const s={points:t},i=await this.remoteClient.invoke("alignElevation",s,{signal:e});return m(e),i},this._getSymbologyCandidates=async(t,e)=>{const s={candidates:t,spatialReference:this._spatialReference.toJSON()},i=await this.remoteClient.invoke("getSymbologyCandidates",s,{signal:e});return m(e),i}}get updating(){return this.updatingExcludingEdits||this._editsUpdatingHandles.updating||this._featureFetcher.updating}get updatingExcludingEdits(){return this._featureFetcher.updatingExcludingEdits||this._isInitializing||this._updatingHandles.updating}destroy(){this._featureFetcher.destroy(),this._queryEngine.destroy(),this._featureStore.clear(),this._handles.destroy()}async setup(t){const{geometryType:e,objectIdField:s,timeInfo:i,fields:r}=t.serviceInfo,{hasZ:n}=t,a=q.fromJSON(t.spatialReference);this._spatialReference=a,this._featureStore=new At({...t.serviceInfo,hasZ:n,hasM:!1}),this._queryEngine=new $t({spatialReference:t.spatialReference,featureStore:this._featureStore,geometryType:e,fields:r,hasZ:n,hasM:!1,objectIdField:s,timeInfo:i?It.fromJSON(i):null}),this._featureFetcher=new f({store:new v({featureStore:this._featureStore}),url:t.serviceInfo.url,objectIdField:t.serviceInfo.objectIdField,globalIdField:t.serviceInfo.globalIdField,capabilities:t.serviceInfo.capabilities,spatialReference:a,sourceSpatialReference:q.fromJSON(t.serviceInfo.spatialReference)});const o=t.configuration.viewType==="3d";return this._elevationAligner=V(o,{elevationInfo:p(t.elevationInfo)?wt.fromJSON(t.elevationInfo):null,alignPointsInFeatures:this._alignPointsInFeatures,spatialReference:a}),this._elevationFilter=J(o),this._handles.add([B(()=>this._featureFetcher.availability,u=>this.emit("notify-availability",{availability:u}),K),B(()=>this.updating,()=>this._notifyUpdating())]),this._whenSetup.resolve(),this._isInitializing=!1,this.configure(t.configuration)}async configure(t){return await this._updatingHandles.addPromise(this._whenSetup.promise),this._updateFeatureFetcherConfiguration(t),{result:{}}}async fetchCandidates(t,e){await this._whenSetup.promise,m(e);const s=ae(t),i=p(e)?e.signal:null,r=await this._queryEngine.executeQueryForSnapping(s,i);m(i);const n=await this._elevationAligner.alignCandidates(r.candidates,i);m(i);const a=await this._symbologyCandidatesFetcher.fetch(n,i);m(i);const o=a.length===0?n:n.concat(a);return{result:{candidates:this._elevationFilter.filter(s,o)}}}async updateTiles(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),m(e),this._featureFetcher.tileSize=t.tileSize,this._featureFetcher.tilesOfInterest=t.tiles,this._featureFetcher.tileInfo=p(t.tileInfo)?x.fromJSON(t.tileInfo):null,F}async refresh(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),m(e),this._featureFetcher.refresh(),F}async whenNotUpdating(t,e){return await this._updatingHandles.addPromise(this._whenSetup.promise),m(e),await xt(()=>!this.updatingExcludingEdits,e),m(e),F}async getDebugInfo(t,e){return m(e),{result:this._featureFetcher.debugInfo}}async beginApplyEdits(t,e){this._updatingHandles.addPromise(this._whenSetup.promise),m(e);const s=M();return this._pendingApplyEdits.set(t.id,s),this._featureFetcher.applyEdits(s.promise),this._editsUpdatingHandles.addPromise(s.promise),F}async endApplyEdits(t,e){const s=this._pendingApplyEdits.get(t.id);return s&&s.resolve(t.edits),m(e),F}async notifyElevationSourceChange(t,e){return this._elevationAligner.notifyElevationSourceChange(),F}async notifySymbologyChange(t,e){return F}async setSymbologySnappingSupported(t){return this._symbologyCandidatesFetcher=L(t,this._getSymbologyCandidates),F}_updateFeatureFetcherConfiguration(t){this._featureFetcher.filter=p(t.filter)?I.fromJSON(t.filter):null,this._featureFetcher.customParameters=t.customParameters}_notifyUpdating(){this.emit("notify-updating",{updating:this.updating})}};h([d({readOnly:!0})],S.prototype,"updating",null),h([d({readOnly:!0})],S.prototype,"updatingExcludingEdits",null),h([d()],S.prototype,"_isInitializing",void 0),S=h([O("esri.views.interactive.snapping.featureSources.featureServiceSource.FeatureServiceSnappingSourceWorker")],S);const Te=S;function ae(t){return{point:t.point,distance:t.distance,types:t.types,query:p(t.filter)?t.filter:{where:"1=1"}}}const F={result:{}};export{Te as default}; diff --git a/assets/FeatureStore.27890cc9.js b/assets/FeatureStore.99d80f36.js similarity index 96% rename from assets/FeatureStore.27890cc9.js rename to assets/FeatureStore.99d80f36.js index 5fccc6b..16db5c8 100644 --- a/assets/FeatureStore.27890cc9.js +++ b/assets/FeatureStore.99d80f36.js @@ -1 +1 @@ -import{m as h,e$ as u,eZ as _,j as a,aJ as l,W as I,c as o,f0 as m,s as y,n as c,f1 as g,ay as f}from"./index.d94abe07.js";import{h as B}from"./PooledRBush.04520070.js";import{e as b}from"./centroid.cc817cc5.js";const x=5e4,n={minX:0,minY:0,maxX:0,maxY:0};function v(s){n.minX=s[0],n.minY=s[1],n.maxX=s[2],n.maxY=s[3]}function p(s,e,t){v(e),s.search(n,t)}class M{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new B(9,h("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach((d,i)=>{e[t++]=i}),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(this._boundsToLoad.filter(e=>this._idByBounds.has(e))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=u();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),p(this._index,e,d=>t(this._idByBounds.get(d)))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const d=this._boundsById.get(e);d&&(this._index.remove(d),this._idByBounds.delete(d))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>x&&this._loadIndex()))}}const S={getObjectId:s=>s.objectId,getAttributes:s=>s.attributes,getAttribute:(s,e)=>s.attributes[e],cloneWithGeometry:(s,e)=>new _(e,s.attributes,null,s.objectId),getGeometry:s=>s.geometry,getCentroid:(s,e)=>(a(s.centroid)&&(s.centroid=b(new l,s.geometry,e.hasZ,e.hasM)),s.centroid)};class j{constructor(e){this.geometryInfo=e,this._boundsStore=new M,this._featuresById=new Map,this._markedIds=new Set,this.events=new I,this.featureAdapter=S}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach(t=>{o(t.geometry)&&t.geometry.coords&&(e+=t.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const d=this._featuresById.get(t);d&&this._remove(d)}this._emitChanged()}forEachBounds(e,t,d){for(const i of e){const r=this._boundsStore.get(i.objectId);r&&t(m(d,r))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}toArray(){return Array.from(this._featuresById.values())}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,d=>{t(this._featuresById.get(d))})}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach((t,d)=>{this._markedIds.has(d)||(e=!0,this._remove(t))}),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(t==null)return void y.getLogger("esri.layers.graphics.data.FeatureStore").error(new c("featurestore:invalid-feature","feature id is missing",{feature:e}));const d=this._featuresById.get(t);let i;if(this._markedIds.add(t),d?(e.displayId=d.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t)):o(this.onFeatureAdd)&&this.onFeatureAdd(e),a(e.geometry)||!e.geometry.coords||!e.geometry.coords.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=g(o(i)?i:f(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),o(i)&&this._boundsStore.set(t,i),this._featuresById.set(t,e)}_remove(e){return o(this.onFeatureRemove)&&this.onFeatureRemove(e),this._markedIds.delete(e.objectId),this._boundsStore.delete(e.objectId),this._featuresById.delete(e.objectId),e}}export{M as o,j as u}; +import{m as h,e$ as u,eZ as _,j as a,aJ as l,W as I,c as o,f0 as m,s as y,n as c,f1 as g,ay as f}from"./index.221827cd.js";import{h as B}from"./PooledRBush.e6a31ee9.js";import{e as b}from"./centroid.06db4b74.js";const x=5e4,n={minX:0,minY:0,maxX:0,maxY:0};function v(s){n.minX=s[0],n.minY=s[1],n.maxX=s[2],n.maxY=s[3]}function p(s,e,t){v(e),s.search(n,t)}class M{constructor(){this._indexInvalid=!1,this._boundsToLoad=[],this._boundsById=new Map,this._idByBounds=new Map,this._index=new B(9,h("esri-csp-restrictions")?e=>({minX:e[0],minY:e[1],maxX:e[2],maxY:e[3]}):["[0]","[1]","[2]","[3]"]),this._loadIndex=()=>{if(this._indexInvalid){const e=new Array(this._idByBounds.size);let t=0;this._idByBounds.forEach((d,i)=>{e[t++]=i}),this._indexInvalid=!1,this._index.clear(),this._index.load(e)}else this._boundsToLoad.length&&(this._index.load(this._boundsToLoad.filter(e=>this._idByBounds.has(e))),this._boundsToLoad.length=0)}}get fullBounds(){if(!this._boundsById.size)return null;const e=u();for(const t of this._boundsById.values())t&&(e[0]=Math.min(t[0],e[0]),e[1]=Math.min(t[1],e[1]),e[2]=Math.max(t[2],e[2]),e[3]=Math.max(t[3],e[3]));return e}get valid(){return!this._indexInvalid}clear(){this._indexInvalid=!1,this._boundsToLoad.length=0,this._boundsById.clear(),this._idByBounds.clear(),this._index.clear()}delete(e){const t=this._boundsById.get(e);this._boundsById.delete(e),t&&(this._idByBounds.delete(t),this._indexInvalid||this._index.remove(t))}forEachInBounds(e,t){this._loadIndex(),p(this._index,e,d=>t(this._idByBounds.get(d)))}get(e){return this._boundsById.get(e)}has(e){return this._boundsById.has(e)}invalidateIndex(){this._indexInvalid||(this._indexInvalid=!0,this._boundsToLoad.length=0)}set(e,t){if(!this._indexInvalid){const d=this._boundsById.get(e);d&&(this._index.remove(d),this._idByBounds.delete(d))}this._boundsById.set(e,t),t&&(this._idByBounds.set(t,e),this._indexInvalid||(this._boundsToLoad.push(t),this._boundsToLoad.length>x&&this._loadIndex()))}}const S={getObjectId:s=>s.objectId,getAttributes:s=>s.attributes,getAttribute:(s,e)=>s.attributes[e],cloneWithGeometry:(s,e)=>new _(e,s.attributes,null,s.objectId),getGeometry:s=>s.geometry,getCentroid:(s,e)=>(a(s.centroid)&&(s.centroid=b(new l,s.geometry,e.hasZ,e.hasM)),s.centroid)};class j{constructor(e){this.geometryInfo=e,this._boundsStore=new M,this._featuresById=new Map,this._markedIds=new Set,this.events=new I,this.featureAdapter=S}get geometryType(){return this.geometryInfo.geometryType}get hasM(){return this.geometryInfo.hasM}get hasZ(){return this.geometryInfo.hasZ}get numFeatures(){return this._featuresById.size}get fullBounds(){return this._boundsStore.fullBounds}get storeStatistics(){let e=0;return this._featuresById.forEach(t=>{o(t.geometry)&&t.geometry.coords&&(e+=t.geometry.coords.length)}),{featureCount:this._featuresById.size,vertexCount:e/(this.hasZ?this.hasM?4:3:this.hasM?3:2)}}add(e){this._add(e),this._emitChanged()}addMany(e){for(const t of e)this._add(t);this._emitChanged()}clear(){this._featuresById.clear(),this._boundsStore.clear(),this._emitChanged()}removeById(e){const t=this._featuresById.get(e);return t?(this._remove(t),this._emitChanged(),t):null}removeManyById(e){this._boundsStore.invalidateIndex();for(const t of e){const d=this._featuresById.get(t);d&&this._remove(d)}this._emitChanged()}forEachBounds(e,t,d){for(const i of e){const r=this._boundsStore.get(i.objectId);r&&t(m(d,r))}}getFeature(e){return this._featuresById.get(e)}has(e){return this._featuresById.has(e)}toArray(){return Array.from(this._featuresById.values())}forEach(e){this._featuresById.forEach(t=>e(t))}forEachInBounds(e,t){this._boundsStore.forEachInBounds(e,d=>{t(this._featuresById.get(d))})}startMarkingUsedFeatures(){this._boundsStore.invalidateIndex(),this._markedIds.clear()}sweep(){let e=!1;this._featuresById.forEach((t,d)=>{this._markedIds.has(d)||(e=!0,this._remove(t))}),this._markedIds.clear(),e&&this._emitChanged()}_emitChanged(){this.events.emit("changed",void 0)}_add(e){if(!e)return;const t=e.objectId;if(t==null)return void y.getLogger("esri.layers.graphics.data.FeatureStore").error(new c("featurestore:invalid-feature","feature id is missing",{feature:e}));const d=this._featuresById.get(t);let i;if(this._markedIds.add(t),d?(e.displayId=d.displayId,i=this._boundsStore.get(t),this._boundsStore.delete(t)):o(this.onFeatureAdd)&&this.onFeatureAdd(e),a(e.geometry)||!e.geometry.coords||!e.geometry.coords.length)return this._boundsStore.set(t,null),void this._featuresById.set(t,e);i=g(o(i)?i:f(),e.geometry,this.geometryInfo.hasZ,this.geometryInfo.hasM),o(i)&&this._boundsStore.set(t,i),this._featuresById.set(t,e)}_remove(e){return o(this.onFeatureRemove)&&this.onFeatureRemove(e),this._markedIds.delete(e.objectId),this._boundsStore.delete(e.objectId),this._featuresById.delete(e.objectId),e}}export{M as o,j as u}; diff --git a/assets/FeatureStore2D.eebd57c6.js b/assets/FeatureStore2D.3fea35f0.js similarity index 97% rename from assets/FeatureStore2D.eebd57c6.js rename to assets/FeatureStore2D.3fea35f0.js index cd37987..c5313bc 100644 --- a/assets/FeatureStore2D.eebd57c6.js +++ b/assets/FeatureStore2D.3fea35f0.js @@ -1 +1 @@ -import{s as y}from"./CircularArray.a4d7e1c2.js";import{j as _,s as x,at as f,c3 as b,ek as A,m as C,c as p,by as S,W as F,aK as D,u as v,f0 as T}from"./index.d94abe07.js";import{b as g}from"./ComputedAttributeStorage.c1cb22b3.js";function E(n,e,t){if(_(n))return null;const r=e.readArcadeFeature();try{return n.evaluate({...t,$feature:r})}catch(s){return x.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",s),null}}const j=f(()=>import("./labelFormatUtils.24133ce3.js"),["assets/labelFormatUtils.24133ce3.js","assets/index.d94abe07.js","assets/index.f5419ca5.css"]);class w{constructor(e,t){this._canCacheExpressionValue=!1,this._sourceInfo=e,this._storage=t,this._bitsets={computed:t.getBitset(t.createBitset())}}get storage(){return this._storage}invalidate(){this._bitsets.computed.clear()}async updateSchema(e,t){const r=b(this._schema,t);if(this._schema=t,!t||_(r)||!A(r,"attributes"))return;C("esri-2d-update-debug")&&console.debug("Applying Update - Store:",r),this._bitsets.computed.clear(),e.targets[t.name]=!0;const s=t.attributes,a=[],i=[];for(const d in s){const o=s[d];switch(o.type){case"field":break;case"expression":a.push(this._createArcadeComputedField(o));break;case"label-expression":a.push(this._createLabelArcadeComputedField(o));break;case"statistic":i.push(o)}}this._computedFields=await Promise.all(a),this._canCacheExpressionValue=!this._computedFields.some(d=>d.type==="expression"&&p(d.expression)&&d.expression.referencesScale()),this._statisticFields=i}setComputedAttributes(e,t,r,s){const a=this._bitsets.computed;if(!this._canCacheExpressionValue||!a.has(r)){a.set(r);for(const i of this._computedFields){const d=this._evaluateField(t,i,s);switch(i.resultType){case"numeric":e.setComputedNumericAtIndex(r,i.fieldIndex,d);break;case"string":e.setComputedStringAtIndex(r,i.fieldIndex,d)}}}}async _createArcadeComputedField(e){const t=this._sourceInfo.spatialReference,r=this._sourceInfo.fieldsIndex;return{...e,expression:await S(e.valueExpression,t,r)}}async _createLabelArcadeComputedField(e){const t=this._sourceInfo.spatialReference,r=this._sourceInfo.fieldsIndex,{createLabelFunction:s}=await j,a=await s(e.label,r,t);return{...e,builder:a}}_evaluateField(e,t,r){switch(t.type){case"label-expression":{const s=e.readArcadeFeature();return t.builder.evaluate(s)||""}case"expression":{const{expression:s}=t;return E(s,e,{$view:{scale:r}})}}}}class l extends g{constructor(e,t){super(g.createInstance(),e.fullSchema()),this._currentIndex=-1,this._reader=e,this._indices=t}static from(e,t){return new l(e.copy(),t)}get hasNext(){return this._currentIndex+1>>16}function h(n){return 65535&n}const G={getObjectId:n=>n.getObjectId(),getAttributes:n=>n.readAttributes(),getAttribute:(n,e)=>n.readAttribute(e),cloneWithGeometry:(n,e)=>n,getGeometry:n=>n.readHydratedGeometry(),getCentroid:(n,e)=>n.readCentroid()};class L extends w{constructor(e,t,r){super(e,t),this.featureAdapter=G,this.events=new F,this._featureSetsByInstance=new Map,this._objectIdToDisplayId=new Map,this._spatialIndexInvalid=!0,this._indexSearchCache=new y(50),this._index=D(9,s=>({minX:this._storage.getXMin(s),minY:this._storage.getYMin(s),maxX:this._storage.getXMax(s),maxY:this._storage.getYMax(s)})),this.mode=r}get storeStatistics(){let e=0,t=0,r=0;return this.forEach(s=>{const a=s.readGeometry();a&&(t+=a.isPoint?1:a.lengths.reduce((i,d)=>i+d,0),r+=a.isPoint?1:a.lengths.length,e+=1)}),{featureCount:e,vertexCount:t,ringCount:r}}hasInstance(e){return this._featureSetsByInstance.has(e)}onTileData(e,t){if(_(t.addOrUpdate))return t;if(t.addOrUpdate.attachStorage(this._storage),this.mode==="snapshot"){const s=t.addOrUpdate.getCursor();for(;s.next();){const a=s.getDisplayId();this.setComputedAttributes(this._storage,s,a,e.scale)}return t}this._featureSetsByInstance.set(t.addOrUpdate.instance,t.addOrUpdate);const r=t.addOrUpdate.getCursor();for(;r.next();)this._insertFeature(r,e.scale);return this._spatialIndexInvalid=!0,this.events.emit("changed"),t}search(e){this._rebuildIndex();const t=e.id,r=this._indexSearchCache.find(d=>d.tileId===t);if(p(r))return r.readers;const s=new Map,a=this._searchIndex(e.bounds),i=[];for(const d of a){const o=this._storage.getInstanceId(d),u=c(o),m=h(o);s.has(u)||s.set(u,[]),s.get(u).push(m)}return s.forEach((d,o)=>{const u=this._featureSetsByInstance.get(o);i.push(l.from(u,d))}),this._indexSearchCache.enqueue({tileId:t,readers:i}),i}insert(e){var s;const t=e.getCursor(),r=this._storage;for(;t.next();){const a=I(t.instance,t.getIndex()),i=t.getObjectId(),d=(s=this._objectIdToDisplayId.get(i))!=null?s:this._storage.createDisplayId();t.setDisplayId(d),r.setInstanceId(d,a),this._objectIdToDisplayId.set(i,d)}this._featureSetsByInstance.set(e.instance,e),this._spatialIndexInvalid=!0}remove(e){const t=this._objectIdToDisplayId.get(e);if(!t)return;const r=this._storage.getInstanceId(t),s=h(r),a=c(r),i=this._featureSetsByInstance.get(a);this._objectIdToDisplayId.delete(e),this._storage.releaseDisplayId(t),i.removeAtIndex(s),i.isEmpty&&this._featureSetsByInstance.delete(a),this._spatialIndexInvalid=!0}toArray(){const e=new Array;return this.forEach(t=>e.push(t)),e}forEach(e){this._objectIdToDisplayId.forEach(t=>{const r=this._storage.getInstanceId(t),s=this._lookupFeature(r);e(s)})}forEachUnsafe(e){this._objectIdToDisplayId.forEach(t=>{const r=this._storage.getInstanceId(t),s=c(r),a=h(r),i=this._getFeatureSet(s);i.setIndex(a),e(i)})}forEachInBounds(e,t){const r=this._searchIndex(e);for(const s of r){const a=this.lookupFeatureByDisplayId(s,this._storage);t(v(a))}}forEachBounds(e,t,r){this._rebuildIndex();const s=[0,0,0,0];for(const a of e){if(!a.readGeometry())continue;const i=a.getDisplayId();s[0]=this._storage.getXMin(i),s[1]=this._storage.getYMin(i),s[2]=this._storage.getXMax(i),s[3]=this._storage.getYMax(i),t(T(r,s))}}sweepFeatures(e,t,r){this._spatialIndexInvalid=!0,this._objectIdToDisplayId.forEach((s,a)=>{e.has(s)||(t.releaseDisplayId(s),r&&r.unsetAttributeData(s),this._objectIdToDisplayId.delete(a))}),this.events.emit("changed")}sweepFeatureSets(e){this._spatialIndexInvalid=!0,this._featureSetsByInstance.forEach((t,r)=>{e.has(r)||this._featureSetsByInstance.delete(r)})}lookupObjectId(e,t){const r=this.lookupFeatureByDisplayId(e,t);return _(r)?null:r.getObjectId()}lookupDisplayId(e){return this._objectIdToDisplayId.get(e)}lookupFeatureByDisplayId(e,t){const r=t.getInstanceId(e);return this._lookupFeature(r)}lookupByDisplayIdUnsafe(e){const t=this._storage.getInstanceId(e),r=c(t),s=h(t),a=this._getFeatureSet(r);return a?(a.setIndex(s),a):null}_insertFeature(e,t){const r=this._storage,s=e.getObjectId(),a=I(e.instance,e.getIndex());r.getInstanceId(e.getDisplayId());let i=this._objectIdToDisplayId.get(s);i||(i=r.createDisplayId(),this._objectIdToDisplayId.set(s,i),this._spatialIndexInvalid=!0),e.setDisplayId(i),r.setInstanceId(i,a),this.setComputedAttributes(r,e,i,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=[];this.mode==="snapshot"?this._featureSetsByInstance.forEach(t=>{const r=t.getCursor();for(;r.next();){const s=r.getDisplayId();this._storage.setBounds(s,r)&&e.push(s)}}):this._objectIdToDisplayId.forEach(t=>{const r=this._storage.getInstanceId(t);this._storage.setBounds(t,this._lookupFeature(r))&&e.push(t)}),this._index.clear(),this._index.load(e),this._indexSearchCache.clear(),this._spatialIndexInvalid=!1}_lookupFeature(e){const t=c(e),r=this._getFeatureSet(t);if(!r)return null;const s=r.getCursor(),a=h(e);return s.setIndex(a),s}_getFeatureSet(e){return this._featureSetsByInstance.get(e)}}export{w as c,L as l,l as r,G as u}; +import{s as y}from"./CircularArray.62f75f43.js";import{j as _,s as x,at as f,c3 as b,ek as A,m as C,c as p,by as S,W as F,aK as D,u as v,f0 as T}from"./index.221827cd.js";import{b as g}from"./ComputedAttributeStorage.29767acd.js";function E(n,e,t){if(_(n))return null;const r=e.readArcadeFeature();try{return n.evaluate({...t,$feature:r})}catch(s){return x.getLogger("esri.views.2d.support.arcadeOnDemand").warn("Feature arcade evaluation failed:",s),null}}const j=f(()=>import("./labelFormatUtils.1d67a85b.js"),["assets/labelFormatUtils.1d67a85b.js","assets/index.221827cd.js","assets/index.f5419ca5.css"]);class w{constructor(e,t){this._canCacheExpressionValue=!1,this._sourceInfo=e,this._storage=t,this._bitsets={computed:t.getBitset(t.createBitset())}}get storage(){return this._storage}invalidate(){this._bitsets.computed.clear()}async updateSchema(e,t){const r=b(this._schema,t);if(this._schema=t,!t||_(r)||!A(r,"attributes"))return;C("esri-2d-update-debug")&&console.debug("Applying Update - Store:",r),this._bitsets.computed.clear(),e.targets[t.name]=!0;const s=t.attributes,a=[],i=[];for(const d in s){const o=s[d];switch(o.type){case"field":break;case"expression":a.push(this._createArcadeComputedField(o));break;case"label-expression":a.push(this._createLabelArcadeComputedField(o));break;case"statistic":i.push(o)}}this._computedFields=await Promise.all(a),this._canCacheExpressionValue=!this._computedFields.some(d=>d.type==="expression"&&p(d.expression)&&d.expression.referencesScale()),this._statisticFields=i}setComputedAttributes(e,t,r,s){const a=this._bitsets.computed;if(!this._canCacheExpressionValue||!a.has(r)){a.set(r);for(const i of this._computedFields){const d=this._evaluateField(t,i,s);switch(i.resultType){case"numeric":e.setComputedNumericAtIndex(r,i.fieldIndex,d);break;case"string":e.setComputedStringAtIndex(r,i.fieldIndex,d)}}}}async _createArcadeComputedField(e){const t=this._sourceInfo.spatialReference,r=this._sourceInfo.fieldsIndex;return{...e,expression:await S(e.valueExpression,t,r)}}async _createLabelArcadeComputedField(e){const t=this._sourceInfo.spatialReference,r=this._sourceInfo.fieldsIndex,{createLabelFunction:s}=await j,a=await s(e.label,r,t);return{...e,builder:a}}_evaluateField(e,t,r){switch(t.type){case"label-expression":{const s=e.readArcadeFeature();return t.builder.evaluate(s)||""}case"expression":{const{expression:s}=t;return E(s,e,{$view:{scale:r}})}}}}class l extends g{constructor(e,t){super(g.createInstance(),e.fullSchema()),this._currentIndex=-1,this._reader=e,this._indices=t}static from(e,t){return new l(e.copy(),t)}get hasNext(){return this._currentIndex+1>>16}function h(n){return 65535&n}const G={getObjectId:n=>n.getObjectId(),getAttributes:n=>n.readAttributes(),getAttribute:(n,e)=>n.readAttribute(e),cloneWithGeometry:(n,e)=>n,getGeometry:n=>n.readHydratedGeometry(),getCentroid:(n,e)=>n.readCentroid()};class L extends w{constructor(e,t,r){super(e,t),this.featureAdapter=G,this.events=new F,this._featureSetsByInstance=new Map,this._objectIdToDisplayId=new Map,this._spatialIndexInvalid=!0,this._indexSearchCache=new y(50),this._index=D(9,s=>({minX:this._storage.getXMin(s),minY:this._storage.getYMin(s),maxX:this._storage.getXMax(s),maxY:this._storage.getYMax(s)})),this.mode=r}get storeStatistics(){let e=0,t=0,r=0;return this.forEach(s=>{const a=s.readGeometry();a&&(t+=a.isPoint?1:a.lengths.reduce((i,d)=>i+d,0),r+=a.isPoint?1:a.lengths.length,e+=1)}),{featureCount:e,vertexCount:t,ringCount:r}}hasInstance(e){return this._featureSetsByInstance.has(e)}onTileData(e,t){if(_(t.addOrUpdate))return t;if(t.addOrUpdate.attachStorage(this._storage),this.mode==="snapshot"){const s=t.addOrUpdate.getCursor();for(;s.next();){const a=s.getDisplayId();this.setComputedAttributes(this._storage,s,a,e.scale)}return t}this._featureSetsByInstance.set(t.addOrUpdate.instance,t.addOrUpdate);const r=t.addOrUpdate.getCursor();for(;r.next();)this._insertFeature(r,e.scale);return this._spatialIndexInvalid=!0,this.events.emit("changed"),t}search(e){this._rebuildIndex();const t=e.id,r=this._indexSearchCache.find(d=>d.tileId===t);if(p(r))return r.readers;const s=new Map,a=this._searchIndex(e.bounds),i=[];for(const d of a){const o=this._storage.getInstanceId(d),u=c(o),m=h(o);s.has(u)||s.set(u,[]),s.get(u).push(m)}return s.forEach((d,o)=>{const u=this._featureSetsByInstance.get(o);i.push(l.from(u,d))}),this._indexSearchCache.enqueue({tileId:t,readers:i}),i}insert(e){var s;const t=e.getCursor(),r=this._storage;for(;t.next();){const a=I(t.instance,t.getIndex()),i=t.getObjectId(),d=(s=this._objectIdToDisplayId.get(i))!=null?s:this._storage.createDisplayId();t.setDisplayId(d),r.setInstanceId(d,a),this._objectIdToDisplayId.set(i,d)}this._featureSetsByInstance.set(e.instance,e),this._spatialIndexInvalid=!0}remove(e){const t=this._objectIdToDisplayId.get(e);if(!t)return;const r=this._storage.getInstanceId(t),s=h(r),a=c(r),i=this._featureSetsByInstance.get(a);this._objectIdToDisplayId.delete(e),this._storage.releaseDisplayId(t),i.removeAtIndex(s),i.isEmpty&&this._featureSetsByInstance.delete(a),this._spatialIndexInvalid=!0}toArray(){const e=new Array;return this.forEach(t=>e.push(t)),e}forEach(e){this._objectIdToDisplayId.forEach(t=>{const r=this._storage.getInstanceId(t),s=this._lookupFeature(r);e(s)})}forEachUnsafe(e){this._objectIdToDisplayId.forEach(t=>{const r=this._storage.getInstanceId(t),s=c(r),a=h(r),i=this._getFeatureSet(s);i.setIndex(a),e(i)})}forEachInBounds(e,t){const r=this._searchIndex(e);for(const s of r){const a=this.lookupFeatureByDisplayId(s,this._storage);t(v(a))}}forEachBounds(e,t,r){this._rebuildIndex();const s=[0,0,0,0];for(const a of e){if(!a.readGeometry())continue;const i=a.getDisplayId();s[0]=this._storage.getXMin(i),s[1]=this._storage.getYMin(i),s[2]=this._storage.getXMax(i),s[3]=this._storage.getYMax(i),t(T(r,s))}}sweepFeatures(e,t,r){this._spatialIndexInvalid=!0,this._objectIdToDisplayId.forEach((s,a)=>{e.has(s)||(t.releaseDisplayId(s),r&&r.unsetAttributeData(s),this._objectIdToDisplayId.delete(a))}),this.events.emit("changed")}sweepFeatureSets(e){this._spatialIndexInvalid=!0,this._featureSetsByInstance.forEach((t,r)=>{e.has(r)||this._featureSetsByInstance.delete(r)})}lookupObjectId(e,t){const r=this.lookupFeatureByDisplayId(e,t);return _(r)?null:r.getObjectId()}lookupDisplayId(e){return this._objectIdToDisplayId.get(e)}lookupFeatureByDisplayId(e,t){const r=t.getInstanceId(e);return this._lookupFeature(r)}lookupByDisplayIdUnsafe(e){const t=this._storage.getInstanceId(e),r=c(t),s=h(t),a=this._getFeatureSet(r);return a?(a.setIndex(s),a):null}_insertFeature(e,t){const r=this._storage,s=e.getObjectId(),a=I(e.instance,e.getIndex());r.getInstanceId(e.getDisplayId());let i=this._objectIdToDisplayId.get(s);i||(i=r.createDisplayId(),this._objectIdToDisplayId.set(s,i),this._spatialIndexInvalid=!0),e.setDisplayId(i),r.setInstanceId(i,a),this.setComputedAttributes(r,e,i,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=[];this.mode==="snapshot"?this._featureSetsByInstance.forEach(t=>{const r=t.getCursor();for(;r.next();){const s=r.getDisplayId();this._storage.setBounds(s,r)&&e.push(s)}}):this._objectIdToDisplayId.forEach(t=>{const r=this._storage.getInstanceId(t);this._storage.setBounds(t,this._lookupFeature(r))&&e.push(t)}),this._index.clear(),this._index.load(e),this._indexSearchCache.clear(),this._spatialIndexInvalid=!1}_lookupFeature(e){const t=c(e),r=this._getFeatureSet(t);if(!r)return null;const s=r.getCursor(),a=h(e);return s.setIndex(a),s}_getFeatureSet(e){return this._featureSetsByInstance.get(e)}}export{w as c,L as l,l as r,G as u}; diff --git a/assets/FetchAssociatedFeatureLayer.7dd7fa59.js b/assets/FetchAssociatedFeatureLayer.f6cbad39.js similarity index 95% rename from assets/FetchAssociatedFeatureLayer.7dd7fa59.js rename to assets/FetchAssociatedFeatureLayer.f6cbad39.js index 0bba647..ebf3a49 100644 --- a/assets/FetchAssociatedFeatureLayer.7dd7fa59.js +++ b/assets/FetchAssociatedFeatureLayer.f6cbad39.js @@ -1 +1 @@ -import{hd as E,fU as T,ay as f,cB as R,U as h,iu as P,iv as U,j as d,c as I,dS as w,aU as m,hZ as g,cD as A,bW as D}from"./index.d94abe07.js";import"./mat3f64.6d32a1d7.js";import"./mat4f64.ff2a477c.js";import"./quat.b3994f2f.js";import{r as v,e as C,I as F}from"./I3SBinaryReader.9c0bbe1b.js";import"./quatf64.4ae3e6f1.js";import"./symbolColorUtils.d5fe1bd7.js";import{t as $}from"./vec3f32.1121a836.js";import"./plane.86573aee.js";const V={analytics:{supportsCacheHint:!1},attachment:{supportsContentType:!1,supportsExifInfo:!1,supportsKeywords:!1,supportsName:!1,supportsSize:!1,supportsCacheHint:!1,supportsResize:!1},data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUpdateWithoutM:!1,supportsUploadWithItemId:!1},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},query:{maxRecordCount:0,maxRecordCountFactor:0,standardMaxRecordCount:0,supportsCacheHint:!1,supportsCentroid:!1,supportsCompactGeometry:!1,supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsSqlExpression:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsStatistics:!1,tileMaxRecordCount:0}};var y;(function(s){s[s.INVISIBLE=0]="INVISIBLE",s[s.TRANSPARENT=1]="TRANSPARENT",s[s.OPAQUE=2]="OPAQUE"})(y||(y={}));function N(s){return{...O,...s,type:"solid"}}const O={color:E(0,0,0,.2),size:1,extensionLength:0,opacity:1,objectTransparency:y.OPAQUE,hasSlicePlane:!1};E(0,0,0,.2),y.OPAQUE;function x(s=[0,0,0],r=[-1,-1,-1],t=[0,0,0,1]){return{center:T(s),halfSize:$(r),quaternion:v(t)}}(()=>{const s=new Int8Array(162);let r=0;const t=e=>{for(let a=0;ah(o.url,{responseType:"array-buffer"}).then(p=>F(o.storageInfo,p.data)))).then(o=>{const p=[];for(const l of e){const u={};for(let i=0;it.type==="Feature Service")||null}catch(t){return m(t),null}}async _loadFeatureLayerFromPortalItem(r){var e;await r.load({signal:this.signal});const t=await this._findMatchingAssociatedSublayerUrl((e=r.url)!=null?e:"");return new g({url:t,portalItem:r}).load({signal:this.signal})}async _loadFromUrl(){var t;const r=await this._findMatchingAssociatedSublayerUrl(`${(t=this._urlParts)==null?void 0:t.root}/FeatureServer`);return new g({url:r}).load({signal:this.signal})}async _findMatchingAssociatedSublayerUrl(r){var S;const t=r.replace(/^(.*FeatureServer)(\/[\d]*\/?)?$/i,"$1"),e={query:{f:"json"},responseType:"json",authMode:"no-prompt",signal:this.signal},a=(S=this._urlParts)==null?void 0:S.layerId,n=this._fetchRootDocument(),o=h(t,e),[p,l]=await Promise.all([o,n]),u=l&&l.layers,i=p.data&&p.data.layers;if(!Array.isArray(i))throw new Error("expected layers array");if(Array.isArray(u)){for(let c=0;c{const s=new Int8Array(162);let r=0;const t=e=>{for(let a=0;ah(o.url,{responseType:"array-buffer"}).then(p=>F(o.storageInfo,p.data)))).then(o=>{const p=[];for(const l of e){const u={};for(let i=0;it.type==="Feature Service")||null}catch(t){return m(t),null}}async _loadFeatureLayerFromPortalItem(r){var e;await r.load({signal:this.signal});const t=await this._findMatchingAssociatedSublayerUrl((e=r.url)!=null?e:"");return new g({url:t,portalItem:r}).load({signal:this.signal})}async _loadFromUrl(){var t;const r=await this._findMatchingAssociatedSublayerUrl(`${(t=this._urlParts)==null?void 0:t.root}/FeatureServer`);return new g({url:r}).load({signal:this.signal})}async _findMatchingAssociatedSublayerUrl(r){var S;const t=r.replace(/^(.*FeatureServer)(\/[\d]*\/?)?$/i,"$1"),e={query:{f:"json"},responseType:"json",authMode:"no-prompt",signal:this.signal},a=(S=this._urlParts)==null?void 0:S.layerId,n=this._fetchRootDocument(),o=h(t,e),[p,l]=await Promise.all([o,n]),u=l&&l.layers,i=p.data&&p.data.layers;if(!Array.isArray(i))throw new Error("expected layers array");if(Array.isArray(u)){for(let c=0;c{await this.load();const{extent:t,timeExtent:s}=await this._connection.invoke("refresh",e);return this.sourceJSON.extent=t,s&&(this.sourceJSON.timeInfo.timeExtent=[s.start,s.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){const t=O(e)?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}queryFeatures(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t)).then(s=>N.fromJSON(s))}queryFeaturesJSON(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t))}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(s=>({count:s.count,extent:I.fromJSON(s.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}_applyEdits(e){if(!this._connection)throw new m("geojson-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField,s=[],n=[],d=[];if(e.addFeatures)for(const a of e.addFeatures)s.push(this._serializeFeature(a));if(e.deleteFeatures)for(const a of e.deleteFeatures)"objectId"in a&&a.objectId!=null?n.push(a.objectId):"attributes"in a&&a.attributes[t]!=null&&n.push(a.attributes[t]);if(e.updateFeatures)for(const a of e.updateFeatures)d.push(this._serializeFeature(a));return this._connection.invoke("applyEdits",{adds:s,updates:d,deletes:n}).then(({extent:a,timeExtent:l,featureEditResults:u})=>(this.sourceJSON.extent=a,l&&(this.sourceJSON.timeInfo.timeExtent=[l.start,l.end]),this._createEditsResult(u)))}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new m("geojson-layer-source:edit-failure",t.description,{code:t.code}):null}}_serializeFeature(e){const{attributes:t}=e,s=this._geometryForSerialization(e);return s?{geometry:s.toJSON(),attributes:t}:{attributes:t}}_geometryForSerialization(e){const{geometry:t}=e;return R(t)?null:t.type==="mesh"||t.type==="extent"?P.fromExtent(t.extent):t}async _startWorker(e){this._connection=await q("GeoJSONSourceWorker",{strategy:T("feature-layers-workers")?"dedicated":"local",signal:e});const{fields:t,spatialReference:s,hasZ:n,geometryType:d,objectIdField:a,url:l,timeInfo:u,customParameters:S}=this.layer,_=this.layer.originOf("spatialReference")==="defaults",w={url:l,customParameters:S,fields:t&&t.map(y=>y.toJSON()),geometryType:F.toJSON(d),hasZ:n,objectIdField:a,timeInfo:u?u.toJSON():null,spatialReference:_?null:s&&s.toJSON()},h=await this._connection.invoke("load",w,{signal:e});for(const y of h.warnings)v.warn(y.message,{layer:this.layer,warning:y});h.featureErrors.length&&v.warn(`Encountered ${h.featureErrors.length} validation errors while loading features`,h.featureErrors),this.sourceJSON=h.layerDefinition,this.capabilities=me(this.sourceJSON.hasZ,!0)}};i([r()],p.prototype,"capabilities",void 0),i([r()],p.prototype,"type",void 0),i([r({constructOnly:!0})],p.prototype,"layer",void 0),i([r()],p.prototype,"sourceJSON",void 0),p=i([b(x)],p);const fe=ce();let o=class extends k(D(G(L(Q(z(Z(C(U(V(W(ye))))))))))){constructor(e){super(e),this.copyright=null,this.definitionExpression=null,this.displayField=null,this.editingEnabled=!1,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="GeoJSON",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new p({layer:this}),this.spatialReference=E.WGS84,this.templates=null,this.title="GeoJSON",this.type="geojson",this.typeIdField=null,this.types=null}destroy(){var e;(e=this.source)==null||e.destroy()}load(e){const t=this.loadFromPortal({supportedTypes:["GeoJson"],supportsData:!1},e).catch(A).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo"],"service"),f(this.renderer,this.fieldsIndex),M(this.timeInfo,this.fieldsIndex)});return this.addResolvingPromise(t),Promise.resolve(this)}get capabilities(){return this.source?this.source.capabilities:null}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return this.loaded&&this.geometryType==null}get parsedUrl(){return this.url?g(this.url):null}set renderer(e){f(e,this.fieldsIndex),this._set("renderer",e)}set url(e){if(!e)return void this._set("url",e);const t=g(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async applyEdits(e,t){const s=await B(()=>import("./editingSupport.b066c126.js"),["assets/editingSupport.b066c126.js","assets/index.d94abe07.js","assets/index.f5419ca5.css"]);await this.load();const n=await s.applyEdits(this,this.source,e,t);return this.read({extent:this.source.sourceJSON.extent,timeInfo:this.source.sourceJSON.timeInfo},{origin:"service",ignoreDefaults:!0}),n}on(e,t){return super.on(e,t)}createPopupTemplate(e){return K(this,e)}createQuery(){const e=new c,t=this.get("capabilities.data");e.returnGeometry=!0,t&&t.supportsZ&&(e.returnZ=!0),e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:s,timeExtent:n}=this;return e.timeExtent=s!=null&&n!=null?n.offset(-s.value,s.unit):n||null,e}getFieldDomain(e,t){let s,n=!1;const d=t&&t.feature,a=d&&d.attributes,l=this.typeIdField&&a&&a[this.typeIdField];return l!=null&&this.types&&(n=this.types.some(u=>u.id==l&&(s=u.domains&&u.domains[e],s&&s.type==="inherited"&&(s=this._getLayerDomain(e)),!0))),n||s||(s=this._getLayerDomain(e)),s}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(c.from(e)||this.createQuery(),t)).then(s=>{if(s!=null&&s.features)for(const n of s.features)n.layer=n.sourceLayer=this;return s})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(c.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(c.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(c.from(e)||this.createQuery(),t))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return O(t)&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}_getLayerDomain(e){if(!this.fields)return null;let t=null;return this.fields.some(s=>(s.name===e&&(t=s.domain),!!t)),t}};i([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"capabilities",null),i([r({type:String})],o.prototype,"copyright",void 0),i([r({readOnly:!0})],o.prototype,"createQueryVersion",null),i([r({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),i([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),i([r({type:String})],o.prototype,"displayField",void 0),i([r({type:Boolean})],o.prototype,"editingEnabled",void 0),i([r(H)],o.prototype,"elevationInfo",void 0),i([r({type:[X],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],o.prototype,"fields",void 0),i([r(fe.fieldsIndex)],o.prototype,"fieldsIndex",void 0),i([r({type:I,json:{name:"extent"}})],o.prototype,"fullExtent",void 0),i([r({type:["point","polygon","polyline","multipoint"],json:{read:{reader:F.read}}})],o.prototype,"geometryType",void 0),i([r({type:Boolean})],o.prototype,"hasZ",void 0),i([r(Y)],o.prototype,"id",void 0),i([r({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),i([r(ee)],o.prototype,"labelsVisible",void 0),i([r({type:[te],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ie},write:!0}})],o.prototype,"labelingInfo",void 0),i([r(se)],o.prototype,"legendEnabled",void 0),i([r({type:["show","hide"]})],o.prototype,"listMode",void 0),i([r({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],o.prototype,"objectIdField",void 0),i([r(re)],o.prototype,"opacity",void 0),i([r({type:["GeoJSON"]})],o.prototype,"operationalLayerType",void 0),i([r({readOnly:!0})],o.prototype,"parsedUrl",null),i([r(oe)],o.prototype,"popupEnabled",void 0),i([r({type:ne,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),i([r({types:ae,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:le}}}})],o.prototype,"renderer",null),i([r(ue)],o.prototype,"screenSizePerspectiveEnabled",void 0),i([r({readOnly:!0})],o.prototype,"source",void 0),i([r({type:E})],o.prototype,"spatialReference",void 0),i([r({type:[de]})],o.prototype,"templates",void 0),i([r()],o.prototype,"title",void 0),i([r({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),i([r({type:String,readOnly:!0})],o.prototype,"typeIdField",void 0),i([r({type:[pe]})],o.prototype,"types",void 0),i([r(he)],o.prototype,"url",null),o=i([b("esri.layers.GeoJSONLayer")],o);const Oe=o;export{Oe as default}; +import{s as j,a6 as i,a7 as r,a8 as b,hT as $,dn as J,c as O,d3 as N,cU as I,n as m,j as R,az as P,d6 as q,m as T,hl as F,iI as k,iJ as D,iK as G,iL as L,i2 as Q,iM as z,i3 as Z,ia as C,eF as U,eG as V,eH as W,aT as E,aU as A,iN as f,iO as M,bX as g,at as B,id as K,dd as c,io as H,gG as X,ip as Y,iP as ee,iQ as te,iR as ie,iE as se,iS as re,ig as oe,dv as ne,iT as ae,ie as le,iU as ue,iV as de,iW as pe,eK as he,ih as ce,cF as ye}from"./index.221827cd.js";import{l as me}from"./clientSideDefaults.d40b9315.js";import"./QueryEngineCapabilities.78217f95.js";const x="esri.layers.graphics.sources.GeoJSONSource",v=j.getLogger(x);let p=class extends ${constructor(){super(...arguments),this.type="geojson",this.refresh=J(async e=>{await this.load();const{extent:t,timeExtent:s}=await this._connection.invoke("refresh",e);return this.sourceJSON.extent=t,s&&(this.sourceJSON.timeInfo.timeExtent=[s.start,s.end]),{dataChanged:!0,updates:{extent:this.sourceJSON.extent,timeInfo:this.sourceJSON.timeInfo}}})}load(e){const t=O(e)?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}queryFeatures(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t)).then(s=>N.fromJSON(s))}queryFeaturesJSON(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatures",e?e.toJSON():null,t))}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(s=>({count:s.count,extent:I.fromJSON(s.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}_applyEdits(e){if(!this._connection)throw new m("geojson-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField,s=[],n=[],d=[];if(e.addFeatures)for(const a of e.addFeatures)s.push(this._serializeFeature(a));if(e.deleteFeatures)for(const a of e.deleteFeatures)"objectId"in a&&a.objectId!=null?n.push(a.objectId):"attributes"in a&&a.attributes[t]!=null&&n.push(a.attributes[t]);if(e.updateFeatures)for(const a of e.updateFeatures)d.push(this._serializeFeature(a));return this._connection.invoke("applyEdits",{adds:s,updates:d,deletes:n}).then(({extent:a,timeExtent:l,featureEditResults:u})=>(this.sourceJSON.extent=a,l&&(this.sourceJSON.timeInfo.timeExtent=[l.start,l.end]),this._createEditsResult(u)))}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new m("geojson-layer-source:edit-failure",t.description,{code:t.code}):null}}_serializeFeature(e){const{attributes:t}=e,s=this._geometryForSerialization(e);return s?{geometry:s.toJSON(),attributes:t}:{attributes:t}}_geometryForSerialization(e){const{geometry:t}=e;return R(t)?null:t.type==="mesh"||t.type==="extent"?P.fromExtent(t.extent):t}async _startWorker(e){this._connection=await q("GeoJSONSourceWorker",{strategy:T("feature-layers-workers")?"dedicated":"local",signal:e});const{fields:t,spatialReference:s,hasZ:n,geometryType:d,objectIdField:a,url:l,timeInfo:u,customParameters:S}=this.layer,_=this.layer.originOf("spatialReference")==="defaults",w={url:l,customParameters:S,fields:t&&t.map(y=>y.toJSON()),geometryType:F.toJSON(d),hasZ:n,objectIdField:a,timeInfo:u?u.toJSON():null,spatialReference:_?null:s&&s.toJSON()},h=await this._connection.invoke("load",w,{signal:e});for(const y of h.warnings)v.warn(y.message,{layer:this.layer,warning:y});h.featureErrors.length&&v.warn(`Encountered ${h.featureErrors.length} validation errors while loading features`,h.featureErrors),this.sourceJSON=h.layerDefinition,this.capabilities=me(this.sourceJSON.hasZ,!0)}};i([r()],p.prototype,"capabilities",void 0),i([r()],p.prototype,"type",void 0),i([r({constructOnly:!0})],p.prototype,"layer",void 0),i([r()],p.prototype,"sourceJSON",void 0),p=i([b(x)],p);const fe=ce();let o=class extends k(D(G(L(Q(z(Z(C(U(V(W(ye))))))))))){constructor(e){super(e),this.copyright=null,this.definitionExpression=null,this.displayField=null,this.editingEnabled=!1,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="GeoJSON",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new p({layer:this}),this.spatialReference=E.WGS84,this.templates=null,this.title="GeoJSON",this.type="geojson",this.typeIdField=null,this.types=null}destroy(){var e;(e=this.source)==null||e.destroy()}load(e){const t=this.loadFromPortal({supportedTypes:["GeoJson"],supportsData:!1},e).catch(A).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo"],"service"),f(this.renderer,this.fieldsIndex),M(this.timeInfo,this.fieldsIndex)});return this.addResolvingPromise(t),Promise.resolve(this)}get capabilities(){return this.source?this.source.capabilities:null}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}get isTable(){return this.loaded&&this.geometryType==null}get parsedUrl(){return this.url?g(this.url):null}set renderer(e){f(e,this.fieldsIndex),this._set("renderer",e)}set url(e){if(!e)return void this._set("url",e);const t=g(e);this._set("url",t.path),t.query&&(this.customParameters={...this.customParameters,...t.query})}async applyEdits(e,t){const s=await B(()=>import("./editingSupport.7278fc9c.js"),["assets/editingSupport.7278fc9c.js","assets/index.221827cd.js","assets/index.f5419ca5.css"]);await this.load();const n=await s.applyEdits(this,this.source,e,t);return this.read({extent:this.source.sourceJSON.extent,timeInfo:this.source.sourceJSON.timeInfo},{origin:"service",ignoreDefaults:!0}),n}on(e,t){return super.on(e,t)}createPopupTemplate(e){return K(this,e)}createQuery(){const e=new c,t=this.get("capabilities.data");e.returnGeometry=!0,t&&t.supportsZ&&(e.returnZ=!0),e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:s,timeExtent:n}=this;return e.timeExtent=s!=null&&n!=null?n.offset(-s.value,s.unit):n||null,e}getFieldDomain(e,t){let s,n=!1;const d=t&&t.feature,a=d&&d.attributes,l=this.typeIdField&&a&&a[this.typeIdField];return l!=null&&this.types&&(n=this.types.some(u=>u.id==l&&(s=u.domains&&u.domains[e],s&&s.type==="inherited"&&(s=this._getLayerDomain(e)),!0))),n||s||(s=this._getLayerDomain(e)),s}getField(e){return this.fieldsIndex.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(c.from(e)||this.createQuery(),t)).then(s=>{if(s!=null&&s.features)for(const n of s.features)n.layer=n.sourceLayer=this;return s})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(c.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(c.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(c.from(e)||this.createQuery(),t))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return O(t)&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}_getLayerDomain(e){if(!this.fields)return null;let t=null;return this.fields.some(s=>(s.name===e&&(t=s.domain),!!t)),t}};i([r({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"capabilities",null),i([r({type:String})],o.prototype,"copyright",void 0),i([r({readOnly:!0})],o.prototype,"createQueryVersion",null),i([r({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),i([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],o.prototype,"definitionExpression",void 0),i([r({type:String})],o.prototype,"displayField",void 0),i([r({type:Boolean})],o.prototype,"editingEnabled",void 0),i([r(H)],o.prototype,"elevationInfo",void 0),i([r({type:[X],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],o.prototype,"fields",void 0),i([r(fe.fieldsIndex)],o.prototype,"fieldsIndex",void 0),i([r({type:I,json:{name:"extent"}})],o.prototype,"fullExtent",void 0),i([r({type:["point","polygon","polyline","multipoint"],json:{read:{reader:F.read}}})],o.prototype,"geometryType",void 0),i([r({type:Boolean})],o.prototype,"hasZ",void 0),i([r(Y)],o.prototype,"id",void 0),i([r({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),i([r(ee)],o.prototype,"labelsVisible",void 0),i([r({type:[te],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:ie},write:!0}})],o.prototype,"labelingInfo",void 0),i([r(se)],o.prototype,"legendEnabled",void 0),i([r({type:["show","hide"]})],o.prototype,"listMode",void 0),i([r({type:String,json:{name:"layerDefinition.objectIdField",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"objectIdField"}}}})],o.prototype,"objectIdField",void 0),i([r(re)],o.prototype,"opacity",void 0),i([r({type:["GeoJSON"]})],o.prototype,"operationalLayerType",void 0),i([r({readOnly:!0})],o.prototype,"parsedUrl",null),i([r(oe)],o.prototype,"popupEnabled",void 0),i([r({type:ne,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),i([r({types:ae,json:{name:"layerDefinition.drawingInfo.renderer",write:!0,origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:le}}}})],o.prototype,"renderer",null),i([r(ue)],o.prototype,"screenSizePerspectiveEnabled",void 0),i([r({readOnly:!0})],o.prototype,"source",void 0),i([r({type:E})],o.prototype,"spatialReference",void 0),i([r({type:[de]})],o.prototype,"templates",void 0),i([r()],o.prototype,"title",void 0),i([r({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),i([r({type:String,readOnly:!0})],o.prototype,"typeIdField",void 0),i([r({type:[pe]})],o.prototype,"types",void 0),i([r(he)],o.prototype,"url",null),o=i([b("esri.layers.GeoJSONLayer")],o);const Oe=o;export{Oe as default}; diff --git a/assets/GeoJSONSourceWorker.2e44a17b.js b/assets/GeoJSONSourceWorker.5dfffbc8.js similarity index 91% rename from assets/GeoJSONSourceWorker.2e44a17b.js rename to assets/GeoJSONSourceWorker.5dfffbc8.js index 6f57731..a93cc69 100644 --- a/assets/GeoJSONSourceWorker.2e44a17b.js +++ b/assets/GeoJSONSourceWorker.5dfffbc8.js @@ -1 +1 @@ -import{e_ as _,ci as x,n as I,gx as k,eY as C,av as D,x as $,s as Q,bK as P,c as F,bP as A,c8 as G,U as M,aA as S,ca as Z,cc as v,gy as N}from"./index.d94abe07.js";import{u as z}from"./FeatureStore.27890cc9.js";import{f as b,g as w}from"./projectionSupport.0542c13b.js";import{Y as B}from"./QueryEngine.5a5ece4a.js";import{L,I as U,T as Y}from"./geojson.8a0cb9d1.js";import{o as J,a as V,i as W}from"./clientSideDefaults.f5f7bfa0.js";import{w as H,m as T,f as j,a as E,g as R}from"./sourceUtils.61cd5549.js";import"./PooledRBush.04520070.js";import"./centroid.cc817cc5.js";import"./json.879c9adc.js";import"./QueryEngineResult.7611d68a.js";import"./quantizationUtils.0d428d19.js";import"./WhereClause.253310fe.js";import"./utils.8c53cad2.js";import"./generateRendererUtils.ebdde5b7.js";import"./utils.399e6089.js";import"./QueryEngineCapabilities.78217f95.js";import"./timeSupport.668a2439.js";const K={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};class _e{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){var e;(e=this._queryEngine)==null||e.destroy(),this._queryEngine=this._fieldsIndex=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const i=[];await this._checkProjection(e.spatialReference);let s=null;e.url&&(s=await this._fetch(t==null?void 0:t.signal));const a=L(s,{geometryType:e.geometryType}),l=e.fields||a.fields||[],u=e.hasZ!=null?e.hasZ:a.hasZ,d=a.geometryType;let c=e.objectIdField||a.objectIdFieldName||"__OBJECTID";const m=e.spatialReference||_;let r=e.timeInfo;l===a.fields&&a.unknownFields.length>0&&i.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:a.unknownFields}});let n=new x(l).get(c);n?(n.type!=="esriFieldTypeString"&&(n.type="esriFieldTypeOID"),n.editable=!1,n.nullable=!1,c=n.name):(n={alias:c,name:c,type:a.objectIdFieldType==="string"?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},l.unshift(n));const p={};for(const o of l){if(o.name==null&&(o.name=o.alias),o.alias==null&&(o.alias=o.name),!o.name)throw new I("geojson-layer:invalid-field-name","field name is missing",{field:o});if(!k.jsonValues.includes(o.type))throw new I("geojson-layer:invalid-field-type",`invalid type for field "${o.name}"`,{field:o});if(o.name!==n.name){const g=C(o);g!==void 0&&(p[o.name]=g)}}this._fieldsIndex=new x(l);const y=this._fieldsIndex.requiredFields.indexOf(n);if(y>-1&&this._fieldsIndex.requiredFields.splice(y,1),r){if(r.startTimeField){const o=this._fieldsIndex.get(r.startTimeField);o?(r.startTimeField=o.name,o.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const o=this._fieldsIndex.get(r.endTimeField);o?(r.endTimeField=o.name,o.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const o=this._fieldsIndex.get(r.trackIdField);o?r.trackIdField=o.name:(r.trackIdField=null,i.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:r}}))}r.startTimeField||r.endTimeField||(i.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:r}}),r=null)}const h=d?J(d):null,f={warnings:i,featureErrors:[],layerDefinition:{...K,drawingInfo:h,templates:V(p),extent:null,geometryType:d,objectIdField:c,fields:l,hasZ:!!u,timeInfo:r}};this._queryEngine=new B({fields:l,geometryType:d,hasM:!1,hasZ:u,objectIdField:c,spatialReference:m,timeInfo:r,featureStore:new z({geometryType:d,hasM:!1,hasZ:u}),cacheSpatialQueries:!0}),this._createDefaultAttributes=W(p,c);const q=await this._createFeatures(s);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,q);const O=this._normalizeFeatures(q,f.warnings,f.featureErrors);if(this._queryEngine.featureStore.addMany(O),f.layerDefinition.extent=this._queryEngine.fullExtent,f.layerDefinition.timeInfo){const{start:o,end:g}=this._queryEngine.timeExtent;f.layerDefinition.timeInfo.timeExtent=[o,g]}return f}async applyEdits(e){const{spatialReference:t,geometryType:i}=this._queryEngine;return await Promise.all([H(t,i),b(e.adds,t),b(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){var t;return this._loadOptions.customParameters=e,(t=this._snapshotTask)==null||t.abort(),this._snapshotTask=D(this._snapshotFeatures),this._snapshotTask.promise.then(i=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,i);const s=this._normalizeFeatures(i);s&&this._queryEngine.featureStore.addMany(s)},i=>{this._queryEngine.featureStore.clear(),$(i)||Q.getLogger("esri.layers.GeoJSONLayer").error(new I("geojson-layer:refresh","An error occurred during refresh",{error:i}))}),await this._waitSnapshotComplete(),{extent:this._queryEngine.fullExtent,timeExtent:this._queryEngine.timeExtent}}async _createFeatures(e){const{geometryType:t,hasZ:i,objectIdField:s}=this._queryEngine,a=U(e,{geometryType:t,hasZ:i,objectIdField:s});if(!P(this._queryEngine.spatialReference,_))for(const l of a)F(l.geometry)&&(l.geometry=A(w(G(l.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),_,this._queryEngine.spatialReference)));return a}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:i}=this._loadOptions,s=(await M(t,{responseType:"json",query:{...i},signal:e})).data;return await Y(s),s}_normalizeFeatures(e,t,i){const{objectIdField:s}=this._queryEngine,a=[];for(const l of e){const u=this._createDefaultAttributes(),d=T(this._fieldsIndex,u,l.attributes,!0,t);d?i==null||i.push(d):(this._assignObjectId(u,l.attributes,!0),l.attributes=u,l.objectId=u[s],a.push(l))}return a}_applyEdits(e){const{adds:t,updates:i,deletes:s}=e,a={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t&&t.length&&this._applyAddEdits(a,t),i&&i.length&&this._applyUpdateEdits(a,i),s&&s.length){for(const l of s)a.deleteResults.push(j(l));this._queryEngine.featureStore.removeManyById(s)}return{extent:this._queryEngine.fullExtent,timeExtent:this._queryEngine.timeExtent,featureEditResults:a}}_applyAddEdits(e,t){var r;const{addResults:i}=e,{geometryType:s,hasM:a,hasZ:l,objectIdField:u,spatialReference:d,featureStore:c}=this._queryEngine,m=[];for(const n of t){if(n.geometry&&s!==S(n.geometry)){i.push(E("Incorrect geometry type."));continue}const p=this._createDefaultAttributes(),y=T(this._fieldsIndex,p,n.attributes);if(y)i.push(y);else{if(this._assignObjectId(p,n.attributes),n.attributes=p,n.uid!=null){const h=n.attributes[u];e.uidToObjectId[n.uid]=h}if(F(n.geometry)){const h=(r=n.geometry.spatialReference)!=null?r:d;n.geometry=w(R(n.geometry,h),h,d)}m.push(n),i.push(j(n.attributes[u]))}}c.addMany(Z([],m,s,l,a,u))}_applyUpdateEdits({updateResults:e},t){var c;const{geometryType:i,hasM:s,hasZ:a,objectIdField:l,spatialReference:u,featureStore:d}=this._queryEngine;for(const m of t){const{attributes:r,geometry:n}=m,p=r&&r[l];if(p==null){e.push(E(`Identifier field ${l} missing`));continue}if(!d.has(p)){e.push(E(`Feature with object id ${p} missing`));continue}const y=v(d.getFeature(p),i,a,s);if(F(n)){if(i!==S(n)){e.push(E("Incorrect geometry type."));continue}const h=(c=n.spatialReference)!=null?c:u;y.geometry=w(R(n,h),h,u)}if(r){const h=T(this._fieldsIndex,y.attributes,r);if(h){e.push(h);continue}}d.add(N(y,i,a,s,l)),e.push(j(p))}}_createObjectIdGenerator(e,t){const i=e.fieldsIndex.get(e.objectIdField);if(i.type==="esriFieldTypeString")return()=>i.name+"-"+Date.now().toString(16);let s=Number.NEGATIVE_INFINITY;for(const a of t)a.objectId&&(s=Math.max(s,a.objectId));return s=Math.max(0,s)+1,()=>s++}_assignObjectId(e,t,i=!1){const s=this._queryEngine.objectIdField;e[s]=i&&s in t?t[s]:this._objectIdGenerator()}async _checkProjection(e){try{await b(_,e)}catch{throw new I("geojson-layer","Projection not supported")}}}export{_e as default}; +import{e_ as _,ci as x,n as I,gx as k,eY as C,av as D,x as $,s as Q,bK as P,c as F,bP as A,c8 as G,U as M,aA as S,ca as Z,cc as v,gy as N}from"./index.221827cd.js";import{u as z}from"./FeatureStore.99d80f36.js";import{f as b,g as w}from"./projectionSupport.4f5da4af.js";import{Y as B}from"./QueryEngine.ac81c46d.js";import{L,I as U,T as Y}from"./geojson.7d18026b.js";import{o as J,a as V,i as W}from"./clientSideDefaults.d40b9315.js";import{w as H,m as T,f as j,a as E,g as R}from"./sourceUtils.ed369a2c.js";import"./PooledRBush.e6a31ee9.js";import"./centroid.06db4b74.js";import"./json.879c9adc.js";import"./QueryEngineResult.2fc58178.js";import"./quantizationUtils.7ff797cc.js";import"./WhereClause.5b749615.js";import"./utils.83e0b804.js";import"./generateRendererUtils.5c972fdb.js";import"./utils.e42485ea.js";import"./QueryEngineCapabilities.78217f95.js";import"./timeSupport.968e62fc.js";const K={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};class _e{constructor(){this._queryEngine=null,this._snapshotFeatures=async e=>{const t=await this._fetch(e);return this._createFeatures(t)}}destroy(){var e;(e=this._queryEngine)==null||e.destroy(),this._queryEngine=this._fieldsIndex=this._createDefaultAttributes=null}async load(e,t={}){this._loadOptions={url:e.url,customParameters:e.customParameters};const i=[];await this._checkProjection(e.spatialReference);let s=null;e.url&&(s=await this._fetch(t==null?void 0:t.signal));const a=L(s,{geometryType:e.geometryType}),l=e.fields||a.fields||[],u=e.hasZ!=null?e.hasZ:a.hasZ,d=a.geometryType;let c=e.objectIdField||a.objectIdFieldName||"__OBJECTID";const m=e.spatialReference||_;let r=e.timeInfo;l===a.fields&&a.unknownFields.length>0&&i.push({name:"geojson-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:a.unknownFields}});let n=new x(l).get(c);n?(n.type!=="esriFieldTypeString"&&(n.type="esriFieldTypeOID"),n.editable=!1,n.nullable=!1,c=n.name):(n={alias:c,name:c,type:a.objectIdFieldType==="string"?"esriFieldTypeString":"esriFieldTypeOID",editable:!1,nullable:!1},l.unshift(n));const p={};for(const o of l){if(o.name==null&&(o.name=o.alias),o.alias==null&&(o.alias=o.name),!o.name)throw new I("geojson-layer:invalid-field-name","field name is missing",{field:o});if(!k.jsonValues.includes(o.type))throw new I("geojson-layer:invalid-field-type",`invalid type for field "${o.name}"`,{field:o});if(o.name!==n.name){const g=C(o);g!==void 0&&(p[o.name]=g)}}this._fieldsIndex=new x(l);const y=this._fieldsIndex.requiredFields.indexOf(n);if(y>-1&&this._fieldsIndex.requiredFields.splice(y,1),r){if(r.startTimeField){const o=this._fieldsIndex.get(r.startTimeField);o?(r.startTimeField=o.name,o.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const o=this._fieldsIndex.get(r.endTimeField);o?(r.endTimeField=o.name,o.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const o=this._fieldsIndex.get(r.trackIdField);o?r.trackIdField=o.name:(r.trackIdField=null,i.push({name:"geojson-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:r}}))}r.startTimeField||r.endTimeField||(i.push({name:"geojson-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:r}}),r=null)}const h=d?J(d):null,f={warnings:i,featureErrors:[],layerDefinition:{...K,drawingInfo:h,templates:V(p),extent:null,geometryType:d,objectIdField:c,fields:l,hasZ:!!u,timeInfo:r}};this._queryEngine=new B({fields:l,geometryType:d,hasM:!1,hasZ:u,objectIdField:c,spatialReference:m,timeInfo:r,featureStore:new z({geometryType:d,hasM:!1,hasZ:u}),cacheSpatialQueries:!0}),this._createDefaultAttributes=W(p,c);const q=await this._createFeatures(s);this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,q);const O=this._normalizeFeatures(q,f.warnings,f.featureErrors);if(this._queryEngine.featureStore.addMany(O),f.layerDefinition.extent=this._queryEngine.fullExtent,f.layerDefinition.timeInfo){const{start:o,end:g}=this._queryEngine.timeExtent;f.layerDefinition.timeInfo.timeExtent=[o,g]}return f}async applyEdits(e){const{spatialReference:t,geometryType:i}=this._queryEngine;return await Promise.all([H(t,i),b(e.adds,t),b(e.updates,t)]),await this._waitSnapshotComplete(),this._applyEdits(e)}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){var t;return this._loadOptions.customParameters=e,(t=this._snapshotTask)==null||t.abort(),this._snapshotTask=D(this._snapshotFeatures),this._snapshotTask.promise.then(i=>{this._queryEngine.featureStore.clear(),this._objectIdGenerator=this._createObjectIdGenerator(this._queryEngine,i);const s=this._normalizeFeatures(i);s&&this._queryEngine.featureStore.addMany(s)},i=>{this._queryEngine.featureStore.clear(),$(i)||Q.getLogger("esri.layers.GeoJSONLayer").error(new I("geojson-layer:refresh","An error occurred during refresh",{error:i}))}),await this._waitSnapshotComplete(),{extent:this._queryEngine.fullExtent,timeExtent:this._queryEngine.timeExtent}}async _createFeatures(e){const{geometryType:t,hasZ:i,objectIdField:s}=this._queryEngine,a=U(e,{geometryType:t,hasZ:i,objectIdField:s});if(!P(this._queryEngine.spatialReference,_))for(const l of a)F(l.geometry)&&(l.geometry=A(w(G(l.geometry,this._queryEngine.geometryType,this._queryEngine.hasZ,!1),_,this._queryEngine.spatialReference)));return a}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _fetch(e){const{url:t,customParameters:i}=this._loadOptions,s=(await M(t,{responseType:"json",query:{...i},signal:e})).data;return await Y(s),s}_normalizeFeatures(e,t,i){const{objectIdField:s}=this._queryEngine,a=[];for(const l of e){const u=this._createDefaultAttributes(),d=T(this._fieldsIndex,u,l.attributes,!0,t);d?i==null||i.push(d):(this._assignObjectId(u,l.attributes,!0),l.attributes=u,l.objectId=u[s],a.push(l))}return a}_applyEdits(e){const{adds:t,updates:i,deletes:s}=e,a={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t&&t.length&&this._applyAddEdits(a,t),i&&i.length&&this._applyUpdateEdits(a,i),s&&s.length){for(const l of s)a.deleteResults.push(j(l));this._queryEngine.featureStore.removeManyById(s)}return{extent:this._queryEngine.fullExtent,timeExtent:this._queryEngine.timeExtent,featureEditResults:a}}_applyAddEdits(e,t){var r;const{addResults:i}=e,{geometryType:s,hasM:a,hasZ:l,objectIdField:u,spatialReference:d,featureStore:c}=this._queryEngine,m=[];for(const n of t){if(n.geometry&&s!==S(n.geometry)){i.push(E("Incorrect geometry type."));continue}const p=this._createDefaultAttributes(),y=T(this._fieldsIndex,p,n.attributes);if(y)i.push(y);else{if(this._assignObjectId(p,n.attributes),n.attributes=p,n.uid!=null){const h=n.attributes[u];e.uidToObjectId[n.uid]=h}if(F(n.geometry)){const h=(r=n.geometry.spatialReference)!=null?r:d;n.geometry=w(R(n.geometry,h),h,d)}m.push(n),i.push(j(n.attributes[u]))}}c.addMany(Z([],m,s,l,a,u))}_applyUpdateEdits({updateResults:e},t){var c;const{geometryType:i,hasM:s,hasZ:a,objectIdField:l,spatialReference:u,featureStore:d}=this._queryEngine;for(const m of t){const{attributes:r,geometry:n}=m,p=r&&r[l];if(p==null){e.push(E(`Identifier field ${l} missing`));continue}if(!d.has(p)){e.push(E(`Feature with object id ${p} missing`));continue}const y=v(d.getFeature(p),i,a,s);if(F(n)){if(i!==S(n)){e.push(E("Incorrect geometry type."));continue}const h=(c=n.spatialReference)!=null?c:u;y.geometry=w(R(n,h),h,u)}if(r){const h=T(this._fieldsIndex,y.attributes,r);if(h){e.push(h);continue}}d.add(N(y,i,a,s,l)),e.push(j(p))}}_createObjectIdGenerator(e,t){const i=e.fieldsIndex.get(e.objectIdField);if(i.type==="esriFieldTypeString")return()=>i.name+"-"+Date.now().toString(16);let s=Number.NEGATIVE_INFINITY;for(const a of t)a.objectId&&(s=Math.max(s,a.objectId));return s=Math.max(0,s)+1,()=>s++}_assignObjectId(e,t,i=!1){const s=this._queryEngine.objectIdField;e[s]=i&&s in t?t[s]:this._objectIdGenerator()}async _checkProjection(e){try{await b(_,e)}catch{throw new I("geojson-layer","Projection not supported")}}}export{_e as default}; diff --git a/assets/GeoRSSLayer.cfaccd23.js b/assets/GeoRSSLayer.705a427d.js similarity index 98% rename from assets/GeoRSSLayer.cfaccd23.js rename to assets/GeoRSSLayer.705a427d.js index c3ba273..4c5f960 100644 --- a/assets/GeoRSSLayer.cfaccd23.js +++ b/assets/GeoRSSLayer.705a427d.js @@ -1 +1 @@ -import{i2 as p,ia as u,eF as c,eG as d,i3 as h,eH as S,cA as m,c as v,aU as g,U as f,iD as b,F as C,a6 as o,a7 as s,d2 as G,cU as F,ip as w,iE as _,eK as x,a8 as P,eV as n,iF as R,iG as k,e5 as j,iH as E,cF as $}from"./index.d94abe07.js";const L=["atom","xml"],M={base:n,key:"type",typeMap:{"simple-line":R},errorContext:"symbol"},U={base:n,key:"type",typeMap:{"picture-marker":k,"simple-marker":j},errorContext:"symbol"},D={base:n,key:"type",typeMap:{"simple-fill":E},errorContext:"symbol"};let t=class extends p(u(c(d(h(S($)))))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.legendEnabled=!0,this.lineSymbol=null,this.pointSymbol=null,this.polygonSymbol=null,this.operationalLayerType="GeoRSS",this.url=null,this.type="geo-rss"}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}readFeatureCollections(e,r){return r.featureCollection.layers.forEach(l=>{var a;const i=l.layerDefinition.drawingInfo.renderer.symbol;i&&i.type==="esriSFS"&&((a=i.outline)==null?void 0:a.style.includes("esriSFS"))&&(i.outline.style="esriSLSSolid")}),r.featureCollection.layers}get hasPoints(){return this._hasGeometry("esriGeometryPoint")}get hasPolylines(){return this._hasGeometry("esriGeometryPolyline")}get hasPolygons(){return this._hasGeometry("esriGeometryPolygon")}get title(){const e=this._get("title");return e&&this.originOf("title")!=="defaults"?e:this.url?m(this.url,L)||"GeoRSS":e||""}set title(e){this._set("title",e)}load(e){const r=v(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service","Feature Service","Feature Collection","Scene Service"]},e).catch(g).then(()=>this._fetchService(r)).then(l=>{this.read(l,{origin:"service"})})),Promise.resolve(this)}async hasDataChanged(){const e=await this._fetchService();return this.read(e,{origin:"service",ignoreDefaults:!0}),!0}async _fetchService(e){var i;const r=this.spatialReference,{data:l}=await f(C.geoRSSServiceUrl,{query:{url:this.url,refresh:!!this.loaded||void 0,outSR:b(r)?void 0:(i=r.wkid)!=null?i:JSON.stringify(r)},signal:e});return l}_hasGeometry(e){var r,l;return(l=(r=this.featureCollections)==null?void 0:r.some(i=>{var a,y;return((a=i.featureSet)==null?void 0:a.geometryType)===e&&((y=i.featureSet.features)==null?void 0:y.length)>0}))!=null?l:!1}};o([s()],t.prototype,"description",void 0),o([s()],t.prototype,"featureCollections",void 0),o([G("service","featureCollections",["featureCollection.layers"])],t.prototype,"readFeatureCollections",null),o([s({type:F,json:{name:"lookAtExtent"}})],t.prototype,"fullExtent",void 0),o([s(w)],t.prototype,"id",void 0),o([s(_)],t.prototype,"legendEnabled",void 0),o([s({types:M,json:{write:!0}})],t.prototype,"lineSymbol",void 0),o([s({type:["show","hide"]})],t.prototype,"listMode",void 0),o([s({types:U,json:{write:!0}})],t.prototype,"pointSymbol",void 0),o([s({types:D,json:{write:!0}})],t.prototype,"polygonSymbol",void 0),o([s({type:["GeoRSS"]})],t.prototype,"operationalLayerType",void 0),o([s(x)],t.prototype,"url",void 0),o([s({json:{origins:{service:{read:{source:"name",reader:e=>e||void 0}}}}})],t.prototype,"title",null),o([s({readOnly:!0,json:{read:!1},value:"geo-rss"})],t.prototype,"type",void 0),t=o([P("esri.layers.GeoRSSLayer")],t);const T=t;export{T as default}; +import{i2 as p,ia as u,eF as c,eG as d,i3 as h,eH as S,cA as m,c as v,aU as g,U as f,iD as b,F as C,a6 as o,a7 as s,d2 as G,cU as F,ip as w,iE as _,eK as x,a8 as P,eV as n,iF as R,iG as k,e5 as j,iH as E,cF as $}from"./index.221827cd.js";const L=["atom","xml"],M={base:n,key:"type",typeMap:{"simple-line":R},errorContext:"symbol"},U={base:n,key:"type",typeMap:{"picture-marker":k,"simple-marker":j},errorContext:"symbol"},D={base:n,key:"type",typeMap:{"simple-fill":E},errorContext:"symbol"};let t=class extends p(u(c(d(h(S($)))))){constructor(...e){super(...e),this.description=null,this.fullExtent=null,this.legendEnabled=!0,this.lineSymbol=null,this.pointSymbol=null,this.polygonSymbol=null,this.operationalLayerType="GeoRSS",this.url=null,this.type="geo-rss"}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}readFeatureCollections(e,r){return r.featureCollection.layers.forEach(l=>{var a;const i=l.layerDefinition.drawingInfo.renderer.symbol;i&&i.type==="esriSFS"&&((a=i.outline)==null?void 0:a.style.includes("esriSFS"))&&(i.outline.style="esriSLSSolid")}),r.featureCollection.layers}get hasPoints(){return this._hasGeometry("esriGeometryPoint")}get hasPolylines(){return this._hasGeometry("esriGeometryPolyline")}get hasPolygons(){return this._hasGeometry("esriGeometryPolygon")}get title(){const e=this._get("title");return e&&this.originOf("title")!=="defaults"?e:this.url?m(this.url,L)||"GeoRSS":e||""}set title(e){this._set("title",e)}load(e){const r=v(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service","Feature Service","Feature Collection","Scene Service"]},e).catch(g).then(()=>this._fetchService(r)).then(l=>{this.read(l,{origin:"service"})})),Promise.resolve(this)}async hasDataChanged(){const e=await this._fetchService();return this.read(e,{origin:"service",ignoreDefaults:!0}),!0}async _fetchService(e){var i;const r=this.spatialReference,{data:l}=await f(C.geoRSSServiceUrl,{query:{url:this.url,refresh:!!this.loaded||void 0,outSR:b(r)?void 0:(i=r.wkid)!=null?i:JSON.stringify(r)},signal:e});return l}_hasGeometry(e){var r,l;return(l=(r=this.featureCollections)==null?void 0:r.some(i=>{var a,y;return((a=i.featureSet)==null?void 0:a.geometryType)===e&&((y=i.featureSet.features)==null?void 0:y.length)>0}))!=null?l:!1}};o([s()],t.prototype,"description",void 0),o([s()],t.prototype,"featureCollections",void 0),o([G("service","featureCollections",["featureCollection.layers"])],t.prototype,"readFeatureCollections",null),o([s({type:F,json:{name:"lookAtExtent"}})],t.prototype,"fullExtent",void 0),o([s(w)],t.prototype,"id",void 0),o([s(_)],t.prototype,"legendEnabled",void 0),o([s({types:M,json:{write:!0}})],t.prototype,"lineSymbol",void 0),o([s({type:["show","hide"]})],t.prototype,"listMode",void 0),o([s({types:U,json:{write:!0}})],t.prototype,"pointSymbol",void 0),o([s({types:D,json:{write:!0}})],t.prototype,"polygonSymbol",void 0),o([s({type:["GeoRSS"]})],t.prototype,"operationalLayerType",void 0),o([s(x)],t.prototype,"url",void 0),o([s({json:{origins:{service:{read:{source:"name",reader:e=>e||void 0}}}}})],t.prototype,"title",null),o([s({readOnly:!0,json:{read:!1},value:"geo-rss"})],t.prototype,"type",void 0),t=o([P("esri.layers.GeoRSSLayer")],t);const T=t;export{T as default}; diff --git a/assets/GeoRSSLayerView2D.e15a9a7b.js b/assets/GeoRSSLayerView2D.f2cd7f86.js similarity index 67% rename from assets/GeoRSSLayerView2D.e15a9a7b.js rename to assets/GeoRSSLayerView2D.f2cd7f86.js index 6934a52..71ae12f 100644 --- a/assets/GeoRSSLayerView2D.e15a9a7b.js +++ b/assets/GeoRSSLayerView2D.f2cd7f86.js @@ -1 +1 @@ -import{_ as l,$ as h,d3 as g,cE as w,dv as d,dw as f,dx as n,a6 as u,a8 as b}from"./index.d94abe07.js";import{y as S,u as V}from"./LayerView.42d17220.js";import{i as v}from"./GraphicContainer.618d10e5.js";import{o as _}from"./BaseGraphicContainer.6b1c597d.js";import"./utils.4b023c9d.js";import"./Utils.7f6f3a6b.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.229b1dd6.js";import"./ExpandedCIM.f0b7f36d.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.0d428d19.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.df11258c.js";import"./normalizeUtilsSync.757b5fd1.js";import"./projectionSupport.0542c13b.js";import"./json.879c9adc.js";import"./VertexArrayObject.a4c1d809.js";import"./FeatureContainer.4ca52b51.js";import"./TileContainer.8b7fafe2.js";import"./WGLContainer.1850619d.js";import"./pixelUtils.82950e1a.js";import"./ProgramTemplate.e9a5aa54.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./visualVariablesUtils.32e27706.js";import"./visualVariablesUtils.aff73e6d.js";import"./Matcher.fe0c3dcf.js";import"./tileUtils.44921ab9.js";import"./TileClipper.8c399a8a.js";import"./Geometry.d049a63c.js";import"./devEnvironmentUtils.d8d0484c.js";import"./schemaUtils.69ad92d2.js";import"./createSymbolSchema.e54d2060.js";import"./util.ab699fea.js";import"./ComputedAttributeStorage.c1cb22b3.js";import"./centroid.cc817cc5.js";import"./vec3f32.1121a836.js";let y=class extends S(V){constructor(){super(...arguments),this._graphicsViewMap={},this._popupTemplates=new Map,this.graphicsViews=[]}async hitTest(e,r){if(!this.graphicsViews.length)return null;const o=this.layer;return this.graphicsViews.reverse().map(t=>{const i=this._popupTemplates.get(t),p=t.hitTest(e);for(const s of p)s.layer=o,s.sourceLayer=o,s.popupTemplate=i;return p}).flat().map(t=>({type:"graphic",graphic:t,layer:o,mapPoint:e}))}update(e){if(this.graphicsViews)for(const r of this.graphicsViews)r.processUpdate(e)}attach(){this.handles.add([l(()=>{var e;return(e=this.layer)==null?void 0:e.featureCollections},e=>{this._clear();for(const{popupInfo:r,featureSet:o,layerDefinition:t}of e){const i=g.fromJSON(o),p=new w(i.features),s=t.drawingInfo,c=r?d.fromJSON(r):null,a=f(s.renderer),m=new _({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:p,renderer:a,container:new v(this.view.featuresTilingScheme)});this._graphicsViewMap[i.geometryType]=m,this._popupTemplates.set(m,c),i.geometryType!=="polygon"||this.layer.polygonSymbol?i.geometryType!=="polyline"||this.layer.lineSymbol?i.geometryType!=="point"||this.layer.pointSymbol||(this.layer.pointSymbol=a.symbol):this.layer.lineSymbol=a.symbol:this.layer.polygonSymbol=a.symbol,this.graphicsViews.push(m),this.container.addChild(m.container)}},h),l(()=>{var e;return(e=this.layer)==null?void 0:e.polygonSymbol},e=>{this._graphicsViewMap.polygon.renderer=new n({symbol:e})},h),l(()=>{var e;return(e=this.layer)==null?void 0:e.lineSymbol},e=>{this._graphicsViewMap.polyline.renderer=new n({symbol:e})},h),l(()=>{var e;return(e=this.layer)==null?void 0:e.pointSymbol},e=>{this._graphicsViewMap.point.renderer=new n({symbol:e})},h)],"georsslayerview")}detach(){this.handles.remove("georsslayerview"),this._clear()}moveStart(){}moveEnd(){}viewChange(){for(const e of this.graphicsViews)e.viewChange()}_clear(){this.container.removeAllChildren();for(const e of this.graphicsViews)e.destroy();this._graphicsViewMap={},this._popupTemplates.clear(),this.graphicsViews.length=0}};y=u([b("esri.views.2d.layers.GeoRSSLayerView2D")],y);const ce=y;export{ce as default}; +import{_ as l,$ as h,d3 as g,cE as w,dv as d,dw as f,dx as n,a6 as u,a8 as b}from"./index.221827cd.js";import{y as S,u as V}from"./LayerView.ce6e0535.js";import{i as v}from"./GraphicContainer.b0be80ad.js";import{o as _}from"./BaseGraphicContainer.7704bbc1.js";import"./utils.0160becb.js";import"./Utils.2136650a.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.0cadabc1.js";import"./ExpandedCIM.a372ce74.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.7ff797cc.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.3f71f8e9.js";import"./normalizeUtilsSync.4d52fbd0.js";import"./projectionSupport.4f5da4af.js";import"./json.879c9adc.js";import"./VertexArrayObject.53cf1857.js";import"./FeatureContainer.b427dd87.js";import"./TileContainer.5aeb32d6.js";import"./WGLContainer.347cc5cd.js";import"./pixelUtils.9c6f8dae.js";import"./ProgramTemplate.cf9dd4e8.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./visualVariablesUtils.061b7a4e.js";import"./visualVariablesUtils.62efda9d.js";import"./Matcher.6586928a.js";import"./tileUtils.332711ed.js";import"./TileClipper.77103a2e.js";import"./Geometry.d049a63c.js";import"./devEnvironmentUtils.d8d0484c.js";import"./schemaUtils.d20994fa.js";import"./createSymbolSchema.827eb617.js";import"./util.520a352e.js";import"./ComputedAttributeStorage.29767acd.js";import"./centroid.06db4b74.js";import"./vec3f32.1121a836.js";let y=class extends S(V){constructor(){super(...arguments),this._graphicsViewMap={},this._popupTemplates=new Map,this.graphicsViews=[]}async hitTest(e,r){if(!this.graphicsViews.length)return null;const o=this.layer;return this.graphicsViews.reverse().map(t=>{const i=this._popupTemplates.get(t),p=t.hitTest(e);for(const s of p)s.layer=o,s.sourceLayer=o,s.popupTemplate=i;return p}).flat().map(t=>({type:"graphic",graphic:t,layer:o,mapPoint:e}))}update(e){if(this.graphicsViews)for(const r of this.graphicsViews)r.processUpdate(e)}attach(){this.handles.add([l(()=>{var e;return(e=this.layer)==null?void 0:e.featureCollections},e=>{this._clear();for(const{popupInfo:r,featureSet:o,layerDefinition:t}of e){const i=g.fromJSON(o),p=new w(i.features),s=t.drawingInfo,c=r?d.fromJSON(r):null,a=f(s.renderer),m=new _({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:p,renderer:a,container:new v(this.view.featuresTilingScheme)});this._graphicsViewMap[i.geometryType]=m,this._popupTemplates.set(m,c),i.geometryType!=="polygon"||this.layer.polygonSymbol?i.geometryType!=="polyline"||this.layer.lineSymbol?i.geometryType!=="point"||this.layer.pointSymbol||(this.layer.pointSymbol=a.symbol):this.layer.lineSymbol=a.symbol:this.layer.polygonSymbol=a.symbol,this.graphicsViews.push(m),this.container.addChild(m.container)}},h),l(()=>{var e;return(e=this.layer)==null?void 0:e.polygonSymbol},e=>{this._graphicsViewMap.polygon.renderer=new n({symbol:e})},h),l(()=>{var e;return(e=this.layer)==null?void 0:e.lineSymbol},e=>{this._graphicsViewMap.polyline.renderer=new n({symbol:e})},h),l(()=>{var e;return(e=this.layer)==null?void 0:e.pointSymbol},e=>{this._graphicsViewMap.point.renderer=new n({symbol:e})},h)],"georsslayerview")}detach(){this.handles.remove("georsslayerview"),this._clear()}moveStart(){}moveEnd(){}viewChange(){for(const e of this.graphicsViews)e.viewChange()}_clear(){this.container.removeAllChildren();for(const e of this.graphicsViews)e.destroy();this._graphicsViewMap={},this._popupTemplates.clear(),this.graphicsViews.length=0}};y=u([b("esri.views.2d.layers.GeoRSSLayerView2D")],y);const ce=y;export{ce as default}; diff --git a/assets/GraphicContainer.618d10e5.js b/assets/GraphicContainer.b0be80ad.js similarity index 77% rename from assets/GraphicContainer.618d10e5.js rename to assets/GraphicContainer.b0be80ad.js index 0927379..79815d8 100644 --- a/assets/GraphicContainer.618d10e5.js +++ b/assets/GraphicContainer.b0be80ad.js @@ -1 +1 @@ -import{I as r}from"./Utils.7f6f3a6b.js";import{t as h}from"./BaseGraphicContainer.6b1c597d.js";class a extends h{renderChildren(e){this.attributeView.update(),this.children.some(t=>t.hasData)&&(this.attributeView.bindTextures(e.context,!1),super.renderChildren(e),e.drawPhase===r.MAP&&this._renderChildren(e),this.hasHighlight()&&e.drawPhase===r.HIGHLIGHT&&this._renderHighlight(e),this._boundsRenderer&&this._boundsRenderer.doRender(e))}_renderHighlight(e){const{painter:t}=e,i=t.effects.highlight;i.bind(e),this._renderChildren(e,i.defines),i.draw(e),i.unbind()}}export{a as i}; +import{I as r}from"./Utils.2136650a.js";import{t as h}from"./BaseGraphicContainer.7704bbc1.js";class a extends h{renderChildren(e){this.attributeView.update(),this.children.some(t=>t.hasData)&&(this.attributeView.bindTextures(e.context,!1),super.renderChildren(e),e.drawPhase===r.MAP&&this._renderChildren(e),this.hasHighlight()&&e.drawPhase===r.HIGHLIGHT&&this._renderHighlight(e),this._boundsRenderer&&this._boundsRenderer.doRender(e))}_renderHighlight(e){const{painter:t}=e,i=t.effects.highlight;i.bind(e),this._renderChildren(e,i.defines),i.draw(e),i.unbind()}}export{a as i}; diff --git a/assets/GraphicsLayerView2D.3b31f4c0.js b/assets/GraphicsLayerView2D.a23860d1.js similarity index 57% rename from assets/GraphicsLayerView2D.3b31f4c0.js rename to assets/GraphicsLayerView2D.a23860d1.js index fa37e67..d9078d7 100644 --- a/assets/GraphicsLayerView2D.3b31f4c0.js +++ b/assets/GraphicsLayerView2D.a23860d1.js @@ -1 +1 @@ -import{d1 as s,cE as p,a6 as h,a7 as a,a8 as o}from"./index.d94abe07.js";import{y as g,u as m}from"./LayerView.42d17220.js";import{i as l}from"./GraphicContainer.618d10e5.js";import{o as c}from"./BaseGraphicContainer.6b1c597d.js";import"./utils.4b023c9d.js";import"./Utils.7f6f3a6b.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.229b1dd6.js";import"./ExpandedCIM.f0b7f36d.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.0d428d19.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.df11258c.js";import"./normalizeUtilsSync.757b5fd1.js";import"./projectionSupport.0542c13b.js";import"./json.879c9adc.js";import"./VertexArrayObject.a4c1d809.js";import"./FeatureContainer.4ca52b51.js";import"./TileContainer.8b7fafe2.js";import"./WGLContainer.1850619d.js";import"./pixelUtils.82950e1a.js";import"./ProgramTemplate.e9a5aa54.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./visualVariablesUtils.32e27706.js";import"./visualVariablesUtils.aff73e6d.js";import"./Matcher.fe0c3dcf.js";import"./tileUtils.44921ab9.js";import"./TileClipper.8c399a8a.js";import"./Geometry.d049a63c.js";import"./devEnvironmentUtils.d8d0484c.js";import"./schemaUtils.69ad92d2.js";import"./createSymbolSchema.e54d2060.js";import"./util.ab699fea.js";import"./ComputedAttributeStorage.c1cb22b3.js";import"./centroid.cc817cc5.js";import"./vec3f32.1121a836.js";const n={remove(){},pause(){},resume(){}};let r=class extends g(m){constructor(){super(...arguments),this._highlightIds=new Map}attach(){this.graphicsView=new c({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new l(this.view.featuresTilingScheme)}),this._updateHighlight(),this.container.addChild(this.graphicsView.container),this.handles.add(this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler),"graphicslayerview2d")}detach(){this.container.removeAllChildren(),this.graphicsView.destroy(),this.graphicsView=null,this.handles.remove("graphicslayerview2d")}async hitTest(i){return this.graphicsView?this.graphicsView.hitTest(i).map(t=>({type:"graphic",graphic:t,mapPoint:i,layer:this.layer})):null}async fetchPopupFeatures(i){if(this.graphicsView)return this.graphicsView.hitTest(i).filter(t=>!!t.popupTemplate)}queryGraphics(){return Promise.resolve(this.graphicsView.graphics)}update(i){this.graphicsView.processUpdate(i)}moveStart(){}viewChange(){this.graphicsView.viewChange()}moveEnd(){}isUpdating(){return!this.graphicsView||this.graphicsView.updating}highlight(i){let t;return typeof i=="number"?t=[i]:i instanceof s?t=[i.uid]:Array.isArray(i)&&i.length>0?t=typeof i[0]=="number"?i:i.map(e=>e&&e.uid):p.isCollection(i)&&i.length>0&&(t=i.map(e=>e&&e.uid).toArray()),t=t==null?void 0:t.filter(e=>e!=null),t.length?(this._addHighlight(t),{remove:()=>this._removeHighlight(t)}):n}_addHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight()}_removeHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;e===0?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight()}_updateHighlight(){var i;(i=this.graphicsView)==null||i.setHighlight(Array.from(this._highlightIds.keys()))}};h([a()],r.prototype,"graphicsView",void 0),r=h([o("esri.views.2d.layers.GraphicsLayerView2D")],r);const ri=r;export{ri as default}; +import{d1 as s,cE as p,a6 as h,a7 as a,a8 as o}from"./index.221827cd.js";import{y as g,u as m}from"./LayerView.ce6e0535.js";import{i as l}from"./GraphicContainer.b0be80ad.js";import{o as c}from"./BaseGraphicContainer.7704bbc1.js";import"./utils.0160becb.js";import"./Utils.2136650a.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.0cadabc1.js";import"./ExpandedCIM.a372ce74.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.7ff797cc.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.3f71f8e9.js";import"./normalizeUtilsSync.4d52fbd0.js";import"./projectionSupport.4f5da4af.js";import"./json.879c9adc.js";import"./VertexArrayObject.53cf1857.js";import"./FeatureContainer.b427dd87.js";import"./TileContainer.5aeb32d6.js";import"./WGLContainer.347cc5cd.js";import"./pixelUtils.9c6f8dae.js";import"./ProgramTemplate.cf9dd4e8.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./visualVariablesUtils.061b7a4e.js";import"./visualVariablesUtils.62efda9d.js";import"./Matcher.6586928a.js";import"./tileUtils.332711ed.js";import"./TileClipper.77103a2e.js";import"./Geometry.d049a63c.js";import"./devEnvironmentUtils.d8d0484c.js";import"./schemaUtils.d20994fa.js";import"./createSymbolSchema.827eb617.js";import"./util.520a352e.js";import"./ComputedAttributeStorage.29767acd.js";import"./centroid.06db4b74.js";import"./vec3f32.1121a836.js";const n={remove(){},pause(){},resume(){}};let r=class extends g(m){constructor(){super(...arguments),this._highlightIds=new Map}attach(){this.graphicsView=new c({requestUpdateCallback:()=>this.requestUpdate(),view:this.view,graphics:this.layer.graphics,container:new l(this.view.featuresTilingScheme)}),this._updateHighlight(),this.container.addChild(this.graphicsView.container),this.handles.add(this.layer.on("graphic-update",this.graphicsView.graphicUpdateHandler),"graphicslayerview2d")}detach(){this.container.removeAllChildren(),this.graphicsView.destroy(),this.graphicsView=null,this.handles.remove("graphicslayerview2d")}async hitTest(i){return this.graphicsView?this.graphicsView.hitTest(i).map(t=>({type:"graphic",graphic:t,mapPoint:i,layer:this.layer})):null}async fetchPopupFeatures(i){if(this.graphicsView)return this.graphicsView.hitTest(i).filter(t=>!!t.popupTemplate)}queryGraphics(){return Promise.resolve(this.graphicsView.graphics)}update(i){this.graphicsView.processUpdate(i)}moveStart(){}viewChange(){this.graphicsView.viewChange()}moveEnd(){}isUpdating(){return!this.graphicsView||this.graphicsView.updating}highlight(i){let t;return typeof i=="number"?t=[i]:i instanceof s?t=[i.uid]:Array.isArray(i)&&i.length>0?t=typeof i[0]=="number"?i:i.map(e=>e&&e.uid):p.isCollection(i)&&i.length>0&&(t=i.map(e=>e&&e.uid).toArray()),t=t==null?void 0:t.filter(e=>e!=null),t.length?(this._addHighlight(t),{remove:()=>this._removeHighlight(t)}):n}_addHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight()}_removeHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;e===0?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight()}_updateHighlight(){var i;(i=this.graphicsView)==null||i.setHighlight(Array.from(this._highlightIds.keys()))}};h([a()],r.prototype,"graphicsView",void 0),r=h([o("esri.views.2d.layers.GraphicsLayerView2D")],r);const ri=r;export{ri as default}; diff --git a/assets/GroupContainer.b2a77ceb.js b/assets/GroupContainer.f412d859.js similarity index 95% rename from assets/GroupContainer.b2a77ceb.js rename to assets/GroupContainer.f412d859.js index 3b461bd..8bf384a 100644 --- a/assets/GroupContainer.b2a77ceb.js +++ b/assets/GroupContainer.f412d859.js @@ -1 +1 @@ -import{o as c}from"./WGLContainer.1850619d.js";import{L as d}from"./enums.2d9e6f64.js";class h extends c{constructor(){super(...arguments),this.requiresDedicatedFBO=!1}dispose(){}doRender(r){const o=this.createRenderParams(r),{context:e,painter:t,profiler:n}=o;this._prevFBO=e.getBoundFramebufferObject(),n.recordContainerStart(this.name);const i=this._getFbo(o),a=t.getRenderTarget();e.bindFramebuffer(i),t.setRenderTarget(i),e.setDepthWriteEnabled(!0),e.setColorMask(!0,!0,!0,!0),e.setClearColor(0,0,0,0),e.setClearDepth(1),e.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT),e.setDepthWriteEnabled(!1);for(const s of this.children)s.beforeRender(r);for(const s of this.children)s.processRender(o);for(const s of this.children)s.afterRender(r);t.setRenderTarget(a),t.releaseFbo(i),e.bindFramebuffer(this._prevFBO),t.beforeRenderLayer(o,this._clippingInfos?255:0,this.computedOpacity),e.setStencilTestEnabled(!1),e.setStencilWriteMask(0),t.blitTexture(e,i.colorTexture,d.NEAREST),t.compositeLayer(o,this.computedOpacity),n.recordContainerEnd()}createRenderParams(r){return{...super.createRenderParams(r),blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:1}}_getFbo(r){const{context:o,painter:e}=r,{width:t,height:n}=o.getViewport();return e.acquireFbo(t,n)}}export{h as r}; +import{o as c}from"./WGLContainer.347cc5cd.js";import{L as d}from"./enums.2d9e6f64.js";class h extends c{constructor(){super(...arguments),this.requiresDedicatedFBO=!1}dispose(){}doRender(r){const o=this.createRenderParams(r),{context:e,painter:t,profiler:n}=o;this._prevFBO=e.getBoundFramebufferObject(),n.recordContainerStart(this.name);const i=this._getFbo(o),a=t.getRenderTarget();e.bindFramebuffer(i),t.setRenderTarget(i),e.setDepthWriteEnabled(!0),e.setColorMask(!0,!0,!0,!0),e.setClearColor(0,0,0,0),e.setClearDepth(1),e.clear(e.gl.COLOR_BUFFER_BIT|e.gl.DEPTH_BUFFER_BIT),e.setDepthWriteEnabled(!1);for(const s of this.children)s.beforeRender(r);for(const s of this.children)s.processRender(o);for(const s of this.children)s.afterRender(r);t.setRenderTarget(a),t.releaseFbo(i),e.bindFramebuffer(this._prevFBO),t.beforeRenderLayer(o,this._clippingInfos?255:0,this.computedOpacity),e.setStencilTestEnabled(!1),e.setStencilWriteMask(0),t.blitTexture(e,i.colorTexture,d.NEAREST),t.compositeLayer(o,this.computedOpacity),n.recordContainerEnd()}createRenderParams(r){return{...super.createRenderParams(r),blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:1}}_getFbo(r){const{context:o,painter:e}=r,{width:t,height:n}=o.getViewport();return e.acquireFbo(t,n)}}export{h as r}; diff --git a/assets/GroupLayer.04359856.js b/assets/GroupLayer.d2d54b11.js similarity index 96% rename from assets/GroupLayer.04359856.js rename to assets/GroupLayer.d2d54b11.js index 28cb13d..8ae5347 100644 --- a/assets/GroupLayer.04359856.js +++ b/assets/GroupLayer.d2d54b11.js @@ -1 +1 @@ -import{i2 as p,i3 as v,eF as b,eG as u,i4 as c,i5 as f,eH as _,ee as m,i6 as g,_ as d,i7 as L,c as O,i8 as w,i9 as M,a6 as t,a7 as l,e0 as V,dz as h,a8 as C,cF as x}from"./index.d94abe07.js";import{a as F}from"./lazyLayerLoader.f961f278.js";let s=class extends p(v(b(u(c(f(_(x))))))){constructor(i){super(i),this._visibilityHandles={},this.allLayers=new m({getCollections:()=>[this.layers],getChildrenFunction:e=>"layers"in e?e.layers:null}),this.allTables=g(this),this.fullExtent=void 0,this.operationalLayerType="GroupLayer",this.spatialReference=void 0,this.type="group"}initialize(){this._enforceVisibility(this.visibilityMode,this.visible),this.addHandles(d(()=>this.visible,this._onVisibilityChange.bind(this),h))}_writeLayers(i,e,o,r){const a=[];if(!i)return a;i.forEach(y=>{const n=L(y,r.webmap?r.webmap.getLayerJSONFromResourceInfo(y):null,r);O(n)&&n.layerType&&a.push(n)}),e.layers=a}set portalItem(i){this._set("portalItem",i)}set visibilityMode(i){const e=this._get("visibilityMode")!==i;this._set("visibilityMode",i),e&&this._enforceVisibility(i,this.visible)}load(i){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"],layerModuleTypeMap:F},i)),Promise.resolve(this)}loadAll(){return w(this,i=>{i(this.layers,this.tables)})}layerAdded(i){i.visible&&this.visibilityMode==="exclusive"?this._turnOffOtherLayers(i):this.visibilityMode==="inherited"&&(i.visible=this.visible),this._visibilityHandles[i.uid]=d(()=>i.visible,e=>this._onChildVisibilityChange(i,e),h)}layerRemoved(i){const e=this._visibilityHandles[i.uid];e&&(e.remove(),delete this._visibilityHandles[i.uid]),this._enforceVisibility(this.visibilityMode,this.visible)}_turnOffOtherLayers(i){this.layers.forEach(e=>{e!==i&&(e.visible=!1)})}_enforceVisibility(i,e){if(!M(this).initialized)return;const o=this.layers;let r=o.find(a=>a.visible);switch(i){case"exclusive":o.length&&!r&&(r=o.getItemAt(0),r.visible=!0),this._turnOffOtherLayers(r);break;case"inherited":o.forEach(a=>{a.visible=e})}}_onVisibilityChange(i){this.visibilityMode==="inherited"&&this.layers.forEach(e=>{e.visible=i})}_onChildVisibilityChange(i,e){switch(this.visibilityMode){case"exclusive":e?this._turnOffOtherLayers(i):this._isAnyLayerVisible()||(i.visible=!0);break;case"inherited":i.visible=this.visible}}_isAnyLayerVisible(){return this.layers.some(i=>i.visible)}};t([l({readOnly:!0,dependsOn:[]})],s.prototype,"allLayers",void 0),t([l({readOnly:!0})],s.prototype,"allTables",void 0),t([l()],s.prototype,"fullExtent",void 0),t([l({json:{read:!0,write:!0}})],s.prototype,"blendMode",void 0),t([l({json:{read:!1,write:{ignoreOrigin:!0}}})],s.prototype,"layers",void 0),t([V("layers")],s.prototype,"_writeLayers",null),t([l({type:["GroupLayer"]})],s.prototype,"operationalLayerType",void 0),t([l({json:{origins:{"web-document":{read:!1,write:!1}}}})],s.prototype,"portalItem",null),t([l()],s.prototype,"spatialReference",void 0),t([l({json:{read:!1},readOnly:!0,value:"group"})],s.prototype,"type",void 0),t([l({type:["independent","inherited","exclusive"],value:"independent",json:{write:!0,origins:{"web-map":{read:!1,write:!1}}}})],s.prototype,"visibilityMode",null),s=t([C("esri.layers.GroupLayer")],s);const H=s;export{H as default}; +import{i2 as p,i3 as v,eF as b,eG as u,i4 as c,i5 as f,eH as _,ee as m,i6 as g,_ as d,i7 as L,c as O,i8 as w,i9 as M,a6 as t,a7 as l,e0 as V,dz as h,a8 as C,cF as x}from"./index.221827cd.js";import{a as F}from"./lazyLayerLoader.4d2df2af.js";let s=class extends p(v(b(u(c(f(_(x))))))){constructor(i){super(i),this._visibilityHandles={},this.allLayers=new m({getCollections:()=>[this.layers],getChildrenFunction:e=>"layers"in e?e.layers:null}),this.allTables=g(this),this.fullExtent=void 0,this.operationalLayerType="GroupLayer",this.spatialReference=void 0,this.type="group"}initialize(){this._enforceVisibility(this.visibilityMode,this.visible),this.addHandles(d(()=>this.visible,this._onVisibilityChange.bind(this),h))}_writeLayers(i,e,o,r){const a=[];if(!i)return a;i.forEach(y=>{const n=L(y,r.webmap?r.webmap.getLayerJSONFromResourceInfo(y):null,r);O(n)&&n.layerType&&a.push(n)}),e.layers=a}set portalItem(i){this._set("portalItem",i)}set visibilityMode(i){const e=this._get("visibilityMode")!==i;this._set("visibilityMode",i),e&&this._enforceVisibility(i,this.visible)}load(i){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection","Scene Service"],layerModuleTypeMap:F},i)),Promise.resolve(this)}loadAll(){return w(this,i=>{i(this.layers,this.tables)})}layerAdded(i){i.visible&&this.visibilityMode==="exclusive"?this._turnOffOtherLayers(i):this.visibilityMode==="inherited"&&(i.visible=this.visible),this._visibilityHandles[i.uid]=d(()=>i.visible,e=>this._onChildVisibilityChange(i,e),h)}layerRemoved(i){const e=this._visibilityHandles[i.uid];e&&(e.remove(),delete this._visibilityHandles[i.uid]),this._enforceVisibility(this.visibilityMode,this.visible)}_turnOffOtherLayers(i){this.layers.forEach(e=>{e!==i&&(e.visible=!1)})}_enforceVisibility(i,e){if(!M(this).initialized)return;const o=this.layers;let r=o.find(a=>a.visible);switch(i){case"exclusive":o.length&&!r&&(r=o.getItemAt(0),r.visible=!0),this._turnOffOtherLayers(r);break;case"inherited":o.forEach(a=>{a.visible=e})}}_onVisibilityChange(i){this.visibilityMode==="inherited"&&this.layers.forEach(e=>{e.visible=i})}_onChildVisibilityChange(i,e){switch(this.visibilityMode){case"exclusive":e?this._turnOffOtherLayers(i):this._isAnyLayerVisible()||(i.visible=!0);break;case"inherited":i.visible=this.visible}}_isAnyLayerVisible(){return this.layers.some(i=>i.visible)}};t([l({readOnly:!0,dependsOn:[]})],s.prototype,"allLayers",void 0),t([l({readOnly:!0})],s.prototype,"allTables",void 0),t([l()],s.prototype,"fullExtent",void 0),t([l({json:{read:!0,write:!0}})],s.prototype,"blendMode",void 0),t([l({json:{read:!1,write:{ignoreOrigin:!0}}})],s.prototype,"layers",void 0),t([V("layers")],s.prototype,"_writeLayers",null),t([l({type:["GroupLayer"]})],s.prototype,"operationalLayerType",void 0),t([l({json:{origins:{"web-document":{read:!1,write:!1}}}})],s.prototype,"portalItem",null),t([l()],s.prototype,"spatialReference",void 0),t([l({json:{read:!1},readOnly:!0,value:"group"})],s.prototype,"type",void 0),t([l({type:["independent","inherited","exclusive"],value:"independent",json:{write:!0,origins:{"web-map":{read:!1,write:!1}}}})],s.prototype,"visibilityMode",null),s=t([C("esri.layers.GroupLayer")],s);const H=s;export{H as default}; diff --git a/assets/GroupLayerView2D.4f483153.js b/assets/GroupLayerView2D.f66e97aa.js similarity index 85% rename from assets/GroupLayerView2D.4f483153.js rename to assets/GroupLayerView2D.f66e97aa.js index fb34e16..a71e8d6 100644 --- a/assets/GroupLayerView2D.4f483153.js +++ b/assets/GroupLayerView2D.f66e97aa.js @@ -1 +1 @@ -import{a6 as a,a7 as l,dy as p,a8 as d,cE as V,_ as y,dz as h,cZ as w,j as o}from"./index.d94abe07.js";import{r as v}from"./GroupContainer.b2a77ceb.js";import{u,y as b}from"./LayerView.42d17220.js";import"./WGLContainer.1850619d.js";import"./enums.2d9e6f64.js";import"./pixelUtils.82950e1a.js";import"./utils.4b023c9d.js";import"./Utils.7f6f3a6b.js";import"./enums.0295eb81.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.229b1dd6.js";import"./VertexArrayObject.a4c1d809.js";import"./ProgramTemplate.e9a5aa54.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";let t=class extends u{constructor(i){super(i),this.type="group",this.layerViews=new V}_allLayerViewVisibility(i){this.layerViews.forEach(e=>{e.visible=i})}initialize(){this.handles.add([this.layerViews.on("change",i=>this._layerViewsChangeHandler(i)),y(()=>this.layer.visibilityMode,()=>this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(null)),h),y(()=>this.visible,i=>{this._applyVisibility(()=>this._allLayerViewVisibility(i),()=>{})},h)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}set layerViews(i){this._set("layerViews",w(i,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((i,e)=>i+e.updatingProgress,0)/this.layerViews.length}isUpdating(){return this.layerViews.some(i=>i.updating)}_hasLayerViewVisibleOverrides(){return this.layerViews.some(i=>i._isOverridden("visible"))}_findLayerViewForLayer(i){return i&&this.layerViews.find(e=>e.layer===i)}_firstVisibleOnLayerOrder(){const i=this.layer.layers.find(e=>{var s;return(s=this._findLayerViewForLayer(e))==null?void 0:s.visible});return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){o(i)&&(i=this._firstVisibleOnLayerOrder(),o(i)&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.getItemAt(0)))),this.layerViews.forEach(e=>{e.visible=e===i})}_layerViewsChangeHandler(i){this.handles.remove("grouplayerview:visible"),this.handles.add(this.layerViews.map(s=>y(()=>s.visible,r=>this._applyVisibility(()=>{r!==this.visible&&(s.visible=this.visible)},()=>this._applyExclusiveVisibility(r?s:null)),h)).toArray(),"grouplayerview:visible");const e=i.added[i.added.length-1];this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(e!=null&&e.visible?e:null))}_applyVisibility(i,e){var s,r;this._hasLayerViewVisibleOverrides()&&(((s=this.layer)==null?void 0:s.visibilityMode)==="inherited"?i():((r=this.layer)==null?void 0:r.visibilityMode)==="exclusive"&&e())}};a([l({cast:p})],t.prototype,"layerViews",null),a([l({readOnly:!0})],t.prototype,"updatingProgress",null),a([l()],t.prototype,"view",void 0),t=a([d("esri.views.layers.GroupLayerView")],t);const m=t;let n=class extends b(m){constructor(){super(...arguments),this.container=new v}attach(){this._updateStageChildren(),this.handles.add(this.layerViews.on("after-changes",()=>this._updateStageChildren()),"grouplayerview2d")}detach(){this.handles.remove("grouplayerview2d"),this.container.removeAllChildren()}update(i){}moveStart(){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((i,e)=>this.container.addChildAt(i.container,e))}};n=a([d("esri.views.2d.layers.GroupLayerView2D")],n);const G=n;export{G as default}; +import{a6 as a,a7 as l,dy as p,a8 as d,cE as V,_ as y,dz as h,cZ as w,j as o}from"./index.221827cd.js";import{r as v}from"./GroupContainer.f412d859.js";import{u,y as b}from"./LayerView.ce6e0535.js";import"./WGLContainer.347cc5cd.js";import"./enums.2d9e6f64.js";import"./pixelUtils.9c6f8dae.js";import"./utils.0160becb.js";import"./Utils.2136650a.js";import"./enums.0295eb81.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.0cadabc1.js";import"./VertexArrayObject.53cf1857.js";import"./ProgramTemplate.cf9dd4e8.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";let t=class extends u{constructor(i){super(i),this.type="group",this.layerViews=new V}_allLayerViewVisibility(i){this.layerViews.forEach(e=>{e.visible=i})}initialize(){this.handles.add([this.layerViews.on("change",i=>this._layerViewsChangeHandler(i)),y(()=>this.layer.visibilityMode,()=>this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(null)),h),y(()=>this.visible,i=>{this._applyVisibility(()=>this._allLayerViewVisibility(i),()=>{})},h)],"grouplayerview"),this._layerViewsChangeHandler({target:null,added:this.layerViews.toArray(),removed:[],moved:[]})}set layerViews(i){this._set("layerViews",w(i,this._get("layerViews")))}get updatingProgress(){return this.layerViews.length===0?1:this.layerViews.reduce((i,e)=>i+e.updatingProgress,0)/this.layerViews.length}isUpdating(){return this.layerViews.some(i=>i.updating)}_hasLayerViewVisibleOverrides(){return this.layerViews.some(i=>i._isOverridden("visible"))}_findLayerViewForLayer(i){return i&&this.layerViews.find(e=>e.layer===i)}_firstVisibleOnLayerOrder(){const i=this.layer.layers.find(e=>{var s;return(s=this._findLayerViewForLayer(e))==null?void 0:s.visible});return i&&this._findLayerViewForLayer(i)}_applyExclusiveVisibility(i){o(i)&&(i=this._firstVisibleOnLayerOrder(),o(i)&&this.layerViews.length>0&&(i=this._findLayerViewForLayer(this.layer.layers.getItemAt(0)))),this.layerViews.forEach(e=>{e.visible=e===i})}_layerViewsChangeHandler(i){this.handles.remove("grouplayerview:visible"),this.handles.add(this.layerViews.map(s=>y(()=>s.visible,r=>this._applyVisibility(()=>{r!==this.visible&&(s.visible=this.visible)},()=>this._applyExclusiveVisibility(r?s:null)),h)).toArray(),"grouplayerview:visible");const e=i.added[i.added.length-1];this._applyVisibility(()=>this._allLayerViewVisibility(this.visible),()=>this._applyExclusiveVisibility(e!=null&&e.visible?e:null))}_applyVisibility(i,e){var s,r;this._hasLayerViewVisibleOverrides()&&(((s=this.layer)==null?void 0:s.visibilityMode)==="inherited"?i():((r=this.layer)==null?void 0:r.visibilityMode)==="exclusive"&&e())}};a([l({cast:p})],t.prototype,"layerViews",null),a([l({readOnly:!0})],t.prototype,"updatingProgress",null),a([l()],t.prototype,"view",void 0),t=a([d("esri.views.layers.GroupLayerView")],t);const m=t;let n=class extends b(m){constructor(){super(...arguments),this.container=new v}attach(){this._updateStageChildren(),this.handles.add(this.layerViews.on("after-changes",()=>this._updateStageChildren()),"grouplayerview2d")}detach(){this.handles.remove("grouplayerview2d"),this.container.removeAllChildren()}update(i){}moveStart(){}viewChange(){}moveEnd(){}_updateStageChildren(){this.container.removeAllChildren(),this.layerViews.forEach((i,e)=>this.container.addChildAt(i.container,e))}};n=a([d("esri.views.2d.layers.GroupLayerView2D")],n);const G=n;export{G as default}; diff --git a/assets/HeatmapProcessor.5f3f2029.js b/assets/HeatmapProcessor.ceb8669d.js similarity index 91% rename from assets/HeatmapProcessor.5f3f2029.js rename to assets/HeatmapProcessor.ceb8669d.js index 99c3080..d7d2686 100644 --- a/assets/HeatmapProcessor.5f3f2029.js +++ b/assets/HeatmapProcessor.ceb8669d.js @@ -1 +1 @@ -import{a6 as _,a8 as F,c3 as S,c as U,bc as m,kr as v}from"./index.d94abe07.js";import{Q as E}from"./enums.0295eb81.js";import{p as O}from"./BaseProcessor.fe0bade4.js";import{l as n}from"./tileUtils.44921ab9.js";class o{constructor(t,i){this.offset=t,this.extent=i}}function g(s){const t=s.key,i=new Map,a=256,e=E,r=s.tileInfoView.tileInfo.isWrappable;return i.set(n(t,-1,-1,r).id,new o([-e,-e],[e-a,e-a,e,e])),i.set(n(t,0,-1,r).id,new o([0,-e],[0,e-a,e,e])),i.set(n(t,1,-1,r).id,new o([e,-e],[0,e-a,a,e])),i.set(n(t,-1,0,r).id,new o([-e,0],[e-a,0,e,e])),i.set(n(t,1,0,r).id,new o([e,0],[0,0,a,e])),i.set(n(t,-1,1,r).id,new o([-e,e],[e-a,0,e,a])),i.set(n(t,0,1,r).id,new o([0,e],[0,0,e,a])),i.set(n(t,1,1,r).id,new o([e,e],[0,0,a,a])),i}let c=class extends O{constructor(){super(...arguments),this.type="heatmap",this._tileKeyToFeatureSets=new Map}initialize(){this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this))])}async update(s,t){const i=t.schema.processors[0];i.type==="heatmap"&&S(this._schema,i)&&(s.mesh=!0,this._schema=i)}onTileUpdate(s){for(const t of s.removed)this._tileKeyToFeatureSets.delete(t.key.id)}onTileClear(s){const t={clear:!0};return this._tileKeyToFeatureSets.delete(s.key.id),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:s.id,data:t})}async onTileMessage(s,t,i){this._tileKeyToFeatureSets.has(s.key.id)||this._tileKeyToFeatureSets.set(s.key.id,new Map);const a=this._tileKeyToFeatureSets.get(s.key.id);if(U(t.addOrUpdate)&&t.addOrUpdate.hasFeatures&&a.set(t.addOrUpdate.instance,t),t.end){const e=[],r=g(s);this._tileKeyToFeatureSets.forEach((f,d)=>{if(d===s.key.id)f.forEach(l=>m(l.addOrUpdate,h=>e.push(h)));else if(r.has(d)){const l=r.get(d),[h,T]=l.offset;f.forEach(w=>m(w.addOrUpdate,k=>{const K=k.transform(h,T,1,1);e.push(K)}))}});const p=v(e,this._schema.mesh,512,512),u={tileKey:s.key.id,intensityInfo:p},y=[p.matrix];return this.remoteClient.invoke("tileRenderer.onTileData",u,{...i,transferList:y})}}onTileError(s,t,i){return this.remoteClient.invoke("tileRenderer.onTileError",{tileKey:s.id,error:t},i)}};c=_([F("esri.views.2d.layers.features.processors.HeatmapProcessor")],c);const I=c;export{I as default}; +import{a6 as _,a8 as F,c3 as S,c as U,bc as m,kr as v}from"./index.221827cd.js";import{Q as E}from"./enums.0295eb81.js";import{p as O}from"./BaseProcessor.f4010bc0.js";import{l as n}from"./tileUtils.332711ed.js";class o{constructor(t,i){this.offset=t,this.extent=i}}function g(s){const t=s.key,i=new Map,a=256,e=E,r=s.tileInfoView.tileInfo.isWrappable;return i.set(n(t,-1,-1,r).id,new o([-e,-e],[e-a,e-a,e,e])),i.set(n(t,0,-1,r).id,new o([0,-e],[0,e-a,e,e])),i.set(n(t,1,-1,r).id,new o([e,-e],[0,e-a,a,e])),i.set(n(t,-1,0,r).id,new o([-e,0],[e-a,0,e,e])),i.set(n(t,1,0,r).id,new o([e,0],[0,0,a,e])),i.set(n(t,-1,1,r).id,new o([-e,e],[e-a,0,e,a])),i.set(n(t,0,1,r).id,new o([0,e],[0,0,e,a])),i.set(n(t,1,1,r).id,new o([e,e],[0,0,a,a])),i}let c=class extends O{constructor(){super(...arguments),this.type="heatmap",this._tileKeyToFeatureSets=new Map}initialize(){this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this))])}async update(s,t){const i=t.schema.processors[0];i.type==="heatmap"&&S(this._schema,i)&&(s.mesh=!0,this._schema=i)}onTileUpdate(s){for(const t of s.removed)this._tileKeyToFeatureSets.delete(t.key.id)}onTileClear(s){const t={clear:!0};return this._tileKeyToFeatureSets.delete(s.key.id),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:s.id,data:t})}async onTileMessage(s,t,i){this._tileKeyToFeatureSets.has(s.key.id)||this._tileKeyToFeatureSets.set(s.key.id,new Map);const a=this._tileKeyToFeatureSets.get(s.key.id);if(U(t.addOrUpdate)&&t.addOrUpdate.hasFeatures&&a.set(t.addOrUpdate.instance,t),t.end){const e=[],r=g(s);this._tileKeyToFeatureSets.forEach((f,d)=>{if(d===s.key.id)f.forEach(l=>m(l.addOrUpdate,h=>e.push(h)));else if(r.has(d)){const l=r.get(d),[h,T]=l.offset;f.forEach(w=>m(w.addOrUpdate,k=>{const K=k.transform(h,T,1,1);e.push(K)}))}});const p=v(e,this._schema.mesh,512,512),u={tileKey:s.key.id,intensityInfo:p},y=[p.matrix];return this.remoteClient.invoke("tileRenderer.onTileData",u,{...i,transferList:y})}}onTileError(s,t,i){return this.remoteClient.invoke("tileRenderer.onTileError",{tileKey:s.id,error:t},i)}};c=_([F("esri.views.2d.layers.features.processors.HeatmapProcessor")],c);const I=c;export{I as default}; diff --git a/assets/HeatmapTileRenderer.3cbc266c.js b/assets/HeatmapTileRenderer.f9ecd2b7.js similarity index 76% rename from assets/HeatmapTileRenderer.3cbc266c.js rename to assets/HeatmapTileRenderer.f9ecd2b7.js index b4f2ffb..fc11c73 100644 --- a/assets/HeatmapTileRenderer.3cbc266c.js +++ b/assets/HeatmapTileRenderer.f9ecd2b7.js @@ -1 +1 @@ -import{kq as a,a6 as m,a8 as l,b8 as h}from"./index.d94abe07.js";import{n as p}from"./BitmapTileContainer.3a622161.js";import{o as d}from"./BaseTileRenderer.5cd35765.js";import"./Bitmap.43defcb1.js";import"./utils.4b023c9d.js";import"./Utils.7f6f3a6b.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.229b1dd6.js";import"./TileContainer.8b7fafe2.js";import"./WGLContainer.1850619d.js";import"./pixelUtils.82950e1a.js";import"./VertexArrayObject.a4c1d809.js";import"./ProgramTemplate.e9a5aa54.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";class c{constructor(){this.gradient=null,this.height=512,this.width=512}render(i){a(i,512,this.intensities,this.gradient,this.minDensity,this.maxDensity)}}let o=class extends d{constructor(t){super(t),this._intensityInfo={minDensity:0,maxDensity:0},this.type="heatmap",this.featuresView={attributeView:{initialize:()=>{},requestUpdate:()=>{}},requestRender:()=>{}},this._container=new p(t.tileInfoView)}createTile(t){const i=this._container.createTile(t);return this.tileInfoView.getTileCoords(i.bitmap,t),i.bitmap.resolution=this.tileInfoView.getTileResolution(t),i}onConfigUpdate(){const t=this.layer.renderer;if(t.type==="heatmap"){const{minDensity:i,maxDensity:s,colorStops:r}=t;this._intensityInfo.minDensity=i,this._intensityInfo.maxDensity=s,this._gradient=h(r),this.tiles.forEach(n=>{const e=n.bitmap.source;e&&(e.minDensity=i,e.maxDensity=s,e.gradient=this._gradient,n.bitmap.invalidateTexture())})}}hitTest(){return Promise.resolve([])}install(t){t.addChild(this._container)}uninstall(t){this._container.removeAllChildren(),t.removeChild(this._container)}disposeTile(t){this._container.removeChild(t),t.destroy()}supportsRenderer(t){return t&&t.type==="heatmap"}onTileData(t){const i=this.tiles.get(t.tileKey);if(!i)return;const s=t.intensityInfo,{minDensity:r,maxDensity:n}=this._intensityInfo,e=i.bitmap.source||new c;e.intensities=s&&s.matrix||null,e.minDensity=r,e.maxDensity=n,e.gradient=this._gradient,i.bitmap.source=e,this._container.addChild(i),this._container.requestRender(),this.requestUpdate()}onTileError(t){console.error(t)}lockGPUUploads(){}unlockGPUUploads(){}fetchResource(t,i){return console.error(t),Promise.reject()}};o=m([l("esri.views.2d.layers.features.tileRenderers.HeatmapTileRenderer")],o);const E=o;export{E as default}; +import{kq as a,a6 as m,a8 as l,b8 as h}from"./index.221827cd.js";import{n as p}from"./BitmapTileContainer.f5b20598.js";import{o as d}from"./BaseTileRenderer.f04a8f8b.js";import"./Bitmap.72a3702e.js";import"./utils.0160becb.js";import"./Utils.2136650a.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.0cadabc1.js";import"./TileContainer.5aeb32d6.js";import"./WGLContainer.347cc5cd.js";import"./pixelUtils.9c6f8dae.js";import"./VertexArrayObject.53cf1857.js";import"./ProgramTemplate.cf9dd4e8.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";class c{constructor(){this.gradient=null,this.height=512,this.width=512}render(i){a(i,512,this.intensities,this.gradient,this.minDensity,this.maxDensity)}}let o=class extends d{constructor(t){super(t),this._intensityInfo={minDensity:0,maxDensity:0},this.type="heatmap",this.featuresView={attributeView:{initialize:()=>{},requestUpdate:()=>{}},requestRender:()=>{}},this._container=new p(t.tileInfoView)}createTile(t){const i=this._container.createTile(t);return this.tileInfoView.getTileCoords(i.bitmap,t),i.bitmap.resolution=this.tileInfoView.getTileResolution(t),i}onConfigUpdate(){const t=this.layer.renderer;if(t.type==="heatmap"){const{minDensity:i,maxDensity:s,colorStops:r}=t;this._intensityInfo.minDensity=i,this._intensityInfo.maxDensity=s,this._gradient=h(r),this.tiles.forEach(n=>{const e=n.bitmap.source;e&&(e.minDensity=i,e.maxDensity=s,e.gradient=this._gradient,n.bitmap.invalidateTexture())})}}hitTest(){return Promise.resolve([])}install(t){t.addChild(this._container)}uninstall(t){this._container.removeAllChildren(),t.removeChild(this._container)}disposeTile(t){this._container.removeChild(t),t.destroy()}supportsRenderer(t){return t&&t.type==="heatmap"}onTileData(t){const i=this.tiles.get(t.tileKey);if(!i)return;const s=t.intensityInfo,{minDensity:r,maxDensity:n}=this._intensityInfo,e=i.bitmap.source||new c;e.intensities=s&&s.matrix||null,e.minDensity=r,e.maxDensity=n,e.gradient=this._gradient,i.bitmap.source=e,this._container.addChild(i),this._container.requestRender(),this.requestUpdate()}onTileError(t){console.error(t)}lockGPUUploads(){}unlockGPUUploads(){}fetchResource(t,i){return console.error(t),Promise.reject()}};o=m([l("esri.views.2d.layers.features.tileRenderers.HeatmapTileRenderer")],o);const E=o;export{E as default}; diff --git a/assets/HighlightGraphicContainer.9bc65ba9.js b/assets/HighlightGraphicContainer.a4fdc946.js similarity index 73% rename from assets/HighlightGraphicContainer.9bc65ba9.js rename to assets/HighlightGraphicContainer.a4fdc946.js index e4186c2..63a6338 100644 --- a/assets/HighlightGraphicContainer.9bc65ba9.js +++ b/assets/HighlightGraphicContainer.a4fdc946.js @@ -1 +1 @@ -import{a6 as s,a8 as o}from"./index.d94abe07.js";import{I as a}from"./Utils.7f6f3a6b.js";import{t as d}from"./BaseGraphicContainer.6b1c597d.js";import{_ as h}from"./enums.2d9e6f64.js";let e=class extends d{doRender(r){r.drawPhase===a.HIGHLIGHT&&super.doRender(r)}renderChildren(r){if(this.attributeView.update(),!this.children.some(n=>n.hasData))return;this.attributeView.bindTextures(r.context),super.renderChildren(r);const{painter:i}=r,t=i.effects.highlight;t.bind(r),r.context.setColorMask(!0,!0,!0,!0),r.context.clear(h.COLOR_BUFFER_BIT),this._renderChildren(r,t.defines.concat(["highlightAll"])),t.draw(r),t.unbind()}};e=s([o("esri.views.2d.layers.support.HighlightGraphicContainer")],e);const u=e;export{u as n}; +import{a6 as s,a8 as o}from"./index.221827cd.js";import{I as a}from"./Utils.2136650a.js";import{t as d}from"./BaseGraphicContainer.7704bbc1.js";import{_ as h}from"./enums.2d9e6f64.js";let e=class extends d{doRender(r){r.drawPhase===a.HIGHLIGHT&&super.doRender(r)}renderChildren(r){if(this.attributeView.update(),!this.children.some(n=>n.hasData))return;this.attributeView.bindTextures(r.context),super.renderChildren(r);const{painter:i}=r,t=i.effects.highlight;t.bind(r),r.context.setColorMask(!0,!0,!0,!0),r.context.clear(h.COLOR_BUFFER_BIT),this._renderChildren(r,t.defines.concat(["highlightAll"])),t.draw(r),t.unbind()}};e=s([o("esri.views.2d.layers.support.HighlightGraphicContainer")],e);const u=e;export{u as n}; diff --git a/assets/I3SBinaryReader.9c0bbe1b.js b/assets/I3SBinaryReader.2f855706.js similarity index 99% rename from assets/I3SBinaryReader.9c0bbe1b.js rename to assets/I3SBinaryReader.2f855706.js index f136423..964118b 100644 --- a/assets/I3SBinaryReader.9c0bbe1b.js +++ b/assets/I3SBinaryReader.2f855706.js @@ -1,2 +1,2 @@ -import{n as f,s as E,b4 as D}from"./index.d94abe07.js";import{O as U}from"./VertexAttribute.42396f25.js";function V(){const e=new Float32Array(4);return e[3]=1,e}function $(e){const t=new Float32Array(4);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}function k(e,t,r,i){const o=new Float32Array(4);return o[0]=e,o[1]=t,o[2]=r,o[3]=i,o}function Y(e,t){return new Float32Array(e,t,4)}Object.freeze(Object.defineProperty({__proto__:null,create:V,clone:$,fromValues:k,createView:Y},Symbol.toStringTag,{value:"Module"}));const d=!0,m={identifierOffset:0,identifierLength:10,versionOffset:10,checksumOffset:12,byteCount:16};function F(e,t,r){return{identifier:String.fromCharCode.apply(null,new Uint8Array(e,r+m.identifierOffset,m.identifierLength)),version:t.getUint16(r+m.versionOffset,d),checksum:t.getUint32(r+m.checksumOffset,d)}}const y={sizeLo:0,sizeHi:4,minX:8,minY:16,minZ:24,maxX:32,maxY:40,maxZ:48,errorX:56,errorY:64,errorZ:72,count:80,reserved:84,byteCount:88};function X(e,t){return{sizeLo:e.getUint32(t+y.sizeLo,d),sizeHi:e.getUint32(t+y.sizeHi,d),minX:e.getFloat64(t+y.minX,d),minY:e.getFloat64(t+y.minY,d),minZ:e.getFloat64(t+y.minZ,d),maxX:e.getFloat64(t+y.maxX,d),maxY:e.getFloat64(t+y.maxY,d),maxZ:e.getFloat64(t+y.maxZ,d),errorX:e.getFloat64(t+y.errorX,d),errorY:e.getFloat64(t+y.errorY,d),errorZ:e.getFloat64(t+y.errorZ,d),count:e.getUint32(t+y.count,d),reserved:e.getUint32(t+y.reserved,d)}}function Q(e){const t=new DataView(e,0);let r=0;const{identifier:i,version:o}=F(e,t,r);if(r+=m.byteCount,i!=="LEPCC ")throw new f("lepcc-decode-error","Bad identifier");if(o>1)throw new f("lepcc-decode-error","Unknown version");const n=X(t,r);if(r+=y.byteCount,n.sizeHi*2**32+n.sizeLo!==e.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Float64Array(3*n.count),u=[],c=[],a=[],l=[];if(r=A(e,r,u),r=A(e,r,c),r=A(e,r,a),r=A(e,r,l),r!==e.byteLength)throw new f("lepcc-decode-error","Bad length");let w=0,g=0;for(let b=0;b>6;let c=0;if(u===0)c=i.getUint32(1,d),t+=5;else if(u===1)c=i.getUint16(1,d),t+=3;else{if(u!==2)throw new f("lepcc-decode-error","Bad count type");c=i.getUint8(1),t+=2}if(s)throw new f("lepcc-decode-error","LUT not implemented");const a=Math.ceil(c*n/8),l=new Uint8Array(e,t,a);let w=0,g=0,b=0;const v=-1>>>32-n;for(let C=0;C>>=n,g-=n,g+n>32&&(w|=l[b-1]>>8-g)}return t+b}const h={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function Z(e,t){return{sizeLo:e.getUint32(t+h.sizeLo,d),sizeHi:e.getUint32(t+h.sizeHi,d),count:e.getUint32(t+h.count,d),colorMapCount:e.getUint16(t+h.colorMapCount,d),lookupMethod:e.getUint8(t+h.lookupMethod),compressionMethod:e.getUint8(t+h.compressionMethod)}}function H(e){const t=new DataView(e,0);let r=0;const{identifier:i,version:o}=F(e,t,r);if(r+=m.byteCount,i!=="ClusterRGB")throw new f("lepcc-decode-error","Bad identifier");if(o>1)throw new f("lepcc-decode-error","Unknown version");const n=Z(t,r);if(r+=h.byteCount,n.sizeHi*2**32+n.sizeLo!==e.byteLength)throw new f("lepcc-decode-error","Bad size");if((n.lookupMethod===2||n.lookupMethod===1)&&n.compressionMethod===0){if(3*n.colorMapCount+n.count+r!==e.byteLength||n.colorMapCount>256)throw new f("lepcc-decode-error","Bad count");const s=new Uint8Array(e,r,3*n.colorMapCount),u=new Uint8Array(e,r+3*n.colorMapCount,n.count),c=new Uint8Array(3*n.count);for(let a=0;a1)throw new f("lepcc-decode-error","Unknown version");const n=j(t,r);if(r+=p.byteCount,n.sizeHi*2**32+n.sizeLo!==e.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Uint16Array(n.count);if(n.bitsPerPoint===8){if(n.count+r!==e.byteLength)throw new f("lepcc-decode-error","Bad size");const u=new Uint8Array(e,r,n.count);for(let c=0;c=192&&n<224){if(o+1>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const s=(31&n)<<6|63&e[t+o+1];i+=String.fromCharCode(s),o+=2}else if(n>=224&&n<240){if(o+2>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const s=(15&n)<<12|(63&e[t+o+1])<<6|63&e[t+o+2];i+=String.fromCharCode(s),o+=3}else{if(!(n>=240&&n<248))throw new f("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(o+3>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const s=(7&n)<<18|(63&e[t+o+1])<<12|(63&e[t+o+2])<<6|63&e[t+o+3];if(s>=65536){const u=55296+(s-65536>>10),c=56320+(1023&s);i+=String.fromCharCode(u,c)}else i+=String.fromCharCode(s);o+=4}}}return i}function T(e,t){const r={byteOffset:0,byteCount:0,fields:Object.create(null)};let i=0;for(let o=0;o0){if(i.push(R(r,s,o-1)),r[s+o-1]!==0)throw new f("string-array-error","Invalid string array: missing null termination.")}else i.push(null);s+=o}return i}function L(e,t){return new I[t.valueType](e,t.byteOffset,t.count*t.valuesPerElement)}function G(e,t){return new Uint8Array(e,t.byteOffset,t.byteCount)}function W(e,t,r){const i=t.header!=null?T(e,t.header):{byteOffset:0,byteCount:0,fields:{count:r}},o={header:i,byteOffset:i.byteCount,byteCount:0,entries:Object.create(null)};let n=i.byteCount;for(let s=0;s1)throw new f("lepcc-decode-error","Unknown version");const n=X(t,r);if(r+=y.byteCount,n.sizeHi*2**32+n.sizeLo!==e.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Float64Array(3*n.count),u=[],c=[],a=[],l=[];if(r=A(e,r,u),r=A(e,r,c),r=A(e,r,a),r=A(e,r,l),r!==e.byteLength)throw new f("lepcc-decode-error","Bad length");let w=0,g=0;for(let b=0;b>6;let c=0;if(u===0)c=i.getUint32(1,d),t+=5;else if(u===1)c=i.getUint16(1,d),t+=3;else{if(u!==2)throw new f("lepcc-decode-error","Bad count type");c=i.getUint8(1),t+=2}if(s)throw new f("lepcc-decode-error","LUT not implemented");const a=Math.ceil(c*n/8),l=new Uint8Array(e,t,a);let w=0,g=0,b=0;const v=-1>>>32-n;for(let C=0;C>>=n,g-=n,g+n>32&&(w|=l[b-1]>>8-g)}return t+b}const h={sizeLo:0,sizeHi:4,count:8,colorMapCount:12,lookupMethod:14,compressionMethod:15,byteCount:16};function Z(e,t){return{sizeLo:e.getUint32(t+h.sizeLo,d),sizeHi:e.getUint32(t+h.sizeHi,d),count:e.getUint32(t+h.count,d),colorMapCount:e.getUint16(t+h.colorMapCount,d),lookupMethod:e.getUint8(t+h.lookupMethod),compressionMethod:e.getUint8(t+h.compressionMethod)}}function H(e){const t=new DataView(e,0);let r=0;const{identifier:i,version:o}=F(e,t,r);if(r+=m.byteCount,i!=="ClusterRGB")throw new f("lepcc-decode-error","Bad identifier");if(o>1)throw new f("lepcc-decode-error","Unknown version");const n=Z(t,r);if(r+=h.byteCount,n.sizeHi*2**32+n.sizeLo!==e.byteLength)throw new f("lepcc-decode-error","Bad size");if((n.lookupMethod===2||n.lookupMethod===1)&&n.compressionMethod===0){if(3*n.colorMapCount+n.count+r!==e.byteLength||n.colorMapCount>256)throw new f("lepcc-decode-error","Bad count");const s=new Uint8Array(e,r,3*n.colorMapCount),u=new Uint8Array(e,r+3*n.colorMapCount,n.count),c=new Uint8Array(3*n.count);for(let a=0;a1)throw new f("lepcc-decode-error","Unknown version");const n=j(t,r);if(r+=p.byteCount,n.sizeHi*2**32+n.sizeLo!==e.byteLength)throw new f("lepcc-decode-error","Bad size");const s=new Uint16Array(n.count);if(n.bitsPerPoint===8){if(n.count+r!==e.byteLength)throw new f("lepcc-decode-error","Bad size");const u=new Uint8Array(e,r,n.count);for(let c=0;c=192&&n<224){if(o+1>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Two byte character was truncated.");const s=(31&n)<<6|63&e[t+o+1];i+=String.fromCharCode(s),o+=2}else if(n>=224&&n<240){if(o+2>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const s=(15&n)<<12|(63&e[t+o+1])<<6|63&e[t+o+2];i+=String.fromCharCode(s),o+=3}else{if(!(n>=240&&n<248))throw new f("utf8-decode-error","UTF-8 Decode failed. Invalid multi byte sequence.");{if(o+3>=r)throw new f("utf8-decode-error","UTF-8 Decode failed. Multi byte character was truncated.");const s=(7&n)<<18|(63&e[t+o+1])<<12|(63&e[t+o+2])<<6|63&e[t+o+3];if(s>=65536){const u=55296+(s-65536>>10),c=56320+(1023&s);i+=String.fromCharCode(u,c)}else i+=String.fromCharCode(s);o+=4}}}return i}function T(e,t){const r={byteOffset:0,byteCount:0,fields:Object.create(null)};let i=0;for(let o=0;o0){if(i.push(R(r,s,o-1)),r[s+o-1]!==0)throw new f("string-array-error","Invalid string array: missing null termination.")}else i.push(null);s+=o}return i}function L(e,t){return new I[t.valueType](e,t.byteOffset,t.count*t.valuesPerElement)}function G(e,t){return new Uint8Array(e,t.byteOffset,t.byteCount)}function W(e,t,r){const i=t.header!=null?T(e,t.header):{byteOffset:0,byteCount:0,fields:{count:r}},o={header:i,byteOffset:i.byteCount,byteCount:0,entries:Object.create(null)};let n=i.byteCount;for(let s=0;snew DataView(e,0).getFloat32(t,!0),Float64:(e,t)=>new DataView(e,0).getFloat64(t,!0),UInt8:(e,t)=>new DataView(e,0).getUint8(t),Int8:(e,t)=>new DataView(e,0).getInt8(t),UInt16:(e,t)=>new DataView(e,0).getUint16(t,!0),Int16:(e,t)=>new DataView(e,0).getInt16(t,!0),UInt32:(e,t)=>new DataView(e,0).getUint32(t,!0),Int32:(e,t)=>new DataView(e,0).getInt32(t,!0)};function x(e){return I.hasOwnProperty(e)}function O(e){return x(e)?I[e].BYTES_PER_ELEMENT:0}export{te as I,Q as c,V as e,L as f,ee as g,$ as r}; diff --git a/assets/I3SLayerDefinitions.96f4da60.js b/assets/I3SLayerDefinitions.0127897b.js similarity index 96% rename from assets/I3SLayerDefinitions.96f4da60.js rename to assets/I3SLayerDefinitions.0127897b.js index 59168f7..e702069 100644 --- a/assets/I3SLayerDefinitions.96f4da60.js +++ b/assets/I3SLayerDefinitions.0127897b.js @@ -1 +1 @@ -import{a6 as e,a7 as t,a8 as s,ei as n,cx as i}from"./index.d94abe07.js";let u=class extends i{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};e([t({type:Number})],u.prototype,"nodesPerPage",void 0),e([t({type:Number})],u.prototype,"rootIndex",void 0),e([t({type:String})],u.prototype,"lodSelectionMetricType",void 0),u=e([s("esri.layer.support.I3SNodePageDefinition")],u);let a=class extends i{constructor(){super(...arguments),this.factor=1}};e([t({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],a.prototype,"id",void 0),e([t({type:Number})],a.prototype,"factor",void 0),a=e([s("esri.layer.support.I3SMaterialTexture")],a);let l=class extends i{constructor(){super(...arguments),this.baseColorFactor=[1,1,1,1],this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.metallicFactor=1,this.roughnessFactor=1}};e([t({type:[Number]})],l.prototype,"baseColorFactor",void 0),e([t({type:a})],l.prototype,"baseColorTexture",void 0),e([t({type:a})],l.prototype,"metallicRoughnessTexture",void 0),e([t({type:Number})],l.prototype,"metallicFactor",void 0),e([t({type:Number})],l.prototype,"roughnessFactor",void 0),l=e([s("esri.layer.support.I3SMaterialPBRMetallicRoughness")],l);let o=class extends i{constructor(){super(...arguments),this.alphaMode="opaque",this.alphaCutoff=.25,this.doubleSided=!1,this.cullFace="none",this.normalTexture=null,this.occlusionTexture=null,this.emissiveTexture=null,this.emissiveFactor=null,this.pbrMetallicRoughness=null}};e([n({opaque:"opaque",mask:"mask",blend:"blend"})],o.prototype,"alphaMode",void 0),e([t({type:Number})],o.prototype,"alphaCutoff",void 0),e([t({type:Boolean})],o.prototype,"doubleSided",void 0),e([n({none:"none",back:"back",front:"front"})],o.prototype,"cullFace",void 0),e([t({type:a})],o.prototype,"normalTexture",void 0),e([t({type:a})],o.prototype,"occlusionTexture",void 0),e([t({type:a})],o.prototype,"emissiveTexture",void 0),e([t({type:[Number]})],o.prototype,"emissiveFactor",void 0),e([t({type:l})],o.prototype,"pbrMetallicRoughness",void 0),o=e([s("esri.layer.support.I3SMaterialDefinition")],o);let y=class extends i{};e([t({type:String,json:{read:{source:["name","index"],reader:(v,x)=>v!=null?v:`${x.index}`}}})],y.prototype,"name",void 0),e([n({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],y.prototype,"format",void 0),y=e([s("esri.layer.support.I3STextureFormat")],y);let c=class extends i{constructor(){super(...arguments),this.atlas=!1}};e([t({type:[y]})],c.prototype,"formats",void 0),e([t({type:Boolean})],c.prototype,"atlas",void 0),c=e([s("esri.layer.support.I3STextureSetDefinition")],c);let p=class extends i{};e([n({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],p.prototype,"type",void 0),e([t({type:Number})],p.prototype,"component",void 0),p=e([s("esri.layer.support.I3SGeometryAttribute")],p);let d=class extends i{};e([n({draco:"draco"})],d.prototype,"encoding",void 0),e([t({type:[String]})],d.prototype,"attributes",void 0),d=e([s("esri.layer.support.I3SGeometryCompressedAttributes")],d);let r=class extends i{constructor(){super(...arguments),this.offset=0}};e([t({type:Number})],r.prototype,"offset",void 0),e([t({type:p})],r.prototype,"position",void 0),e([t({type:p})],r.prototype,"normal",void 0),e([t({type:p})],r.prototype,"uv0",void 0),e([t({type:p})],r.prototype,"color",void 0),e([t({type:p})],r.prototype,"uvRegion",void 0),e([t({type:p})],r.prototype,"featureId",void 0),e([t({type:p})],r.prototype,"faceRange",void 0),e([t({type:d})],r.prototype,"compressedAttributes",void 0),r=e([s("esri.layer.support.I3SGeometryBuffer")],r);let m=class extends i{};e([n({triangle:"triangle"})],m.prototype,"topology",void 0),e([t()],m.prototype,"geometryBuffers",void 0),m=e([s("esri.layer.support.I3SGeometryDefinition")],m);export{o as l,m,u as s,c as u}; +import{a6 as e,a7 as t,a8 as s,ei as n,cx as i}from"./index.221827cd.js";let u=class extends i{constructor(){super(...arguments),this.nodesPerPage=null,this.rootIndex=0,this.lodSelectionMetricType=null}};e([t({type:Number})],u.prototype,"nodesPerPage",void 0),e([t({type:Number})],u.prototype,"rootIndex",void 0),e([t({type:String})],u.prototype,"lodSelectionMetricType",void 0),u=e([s("esri.layer.support.I3SNodePageDefinition")],u);let a=class extends i{constructor(){super(...arguments),this.factor=1}};e([t({type:Number,json:{read:{source:"textureSetDefinitionId"}}})],a.prototype,"id",void 0),e([t({type:Number})],a.prototype,"factor",void 0),a=e([s("esri.layer.support.I3SMaterialTexture")],a);let l=class extends i{constructor(){super(...arguments),this.baseColorFactor=[1,1,1,1],this.baseColorTexture=null,this.metallicRoughnessTexture=null,this.metallicFactor=1,this.roughnessFactor=1}};e([t({type:[Number]})],l.prototype,"baseColorFactor",void 0),e([t({type:a})],l.prototype,"baseColorTexture",void 0),e([t({type:a})],l.prototype,"metallicRoughnessTexture",void 0),e([t({type:Number})],l.prototype,"metallicFactor",void 0),e([t({type:Number})],l.prototype,"roughnessFactor",void 0),l=e([s("esri.layer.support.I3SMaterialPBRMetallicRoughness")],l);let o=class extends i{constructor(){super(...arguments),this.alphaMode="opaque",this.alphaCutoff=.25,this.doubleSided=!1,this.cullFace="none",this.normalTexture=null,this.occlusionTexture=null,this.emissiveTexture=null,this.emissiveFactor=null,this.pbrMetallicRoughness=null}};e([n({opaque:"opaque",mask:"mask",blend:"blend"})],o.prototype,"alphaMode",void 0),e([t({type:Number})],o.prototype,"alphaCutoff",void 0),e([t({type:Boolean})],o.prototype,"doubleSided",void 0),e([n({none:"none",back:"back",front:"front"})],o.prototype,"cullFace",void 0),e([t({type:a})],o.prototype,"normalTexture",void 0),e([t({type:a})],o.prototype,"occlusionTexture",void 0),e([t({type:a})],o.prototype,"emissiveTexture",void 0),e([t({type:[Number]})],o.prototype,"emissiveFactor",void 0),e([t({type:l})],o.prototype,"pbrMetallicRoughness",void 0),o=e([s("esri.layer.support.I3SMaterialDefinition")],o);let y=class extends i{};e([t({type:String,json:{read:{source:["name","index"],reader:(v,x)=>v!=null?v:`${x.index}`}}})],y.prototype,"name",void 0),e([n({jpg:"jpg",png:"png",dds:"dds","ktx-etc2":"ktx-etc2",ktx2:"ktx2",basis:"basis"})],y.prototype,"format",void 0),y=e([s("esri.layer.support.I3STextureFormat")],y);let c=class extends i{constructor(){super(...arguments),this.atlas=!1}};e([t({type:[y]})],c.prototype,"formats",void 0),e([t({type:Boolean})],c.prototype,"atlas",void 0),c=e([s("esri.layer.support.I3STextureSetDefinition")],c);let p=class extends i{};e([n({Float32:"Float32",UInt64:"UInt64",UInt32:"UInt32",UInt16:"UInt16",UInt8:"UInt8"})],p.prototype,"type",void 0),e([t({type:Number})],p.prototype,"component",void 0),p=e([s("esri.layer.support.I3SGeometryAttribute")],p);let d=class extends i{};e([n({draco:"draco"})],d.prototype,"encoding",void 0),e([t({type:[String]})],d.prototype,"attributes",void 0),d=e([s("esri.layer.support.I3SGeometryCompressedAttributes")],d);let r=class extends i{constructor(){super(...arguments),this.offset=0}};e([t({type:Number})],r.prototype,"offset",void 0),e([t({type:p})],r.prototype,"position",void 0),e([t({type:p})],r.prototype,"normal",void 0),e([t({type:p})],r.prototype,"uv0",void 0),e([t({type:p})],r.prototype,"color",void 0),e([t({type:p})],r.prototype,"uvRegion",void 0),e([t({type:p})],r.prototype,"featureId",void 0),e([t({type:p})],r.prototype,"faceRange",void 0),e([t({type:d})],r.prototype,"compressedAttributes",void 0),r=e([s("esri.layer.support.I3SGeometryBuffer")],r);let m=class extends i{};e([n({triangle:"triangle"})],m.prototype,"topology",void 0),e([t()],m.prototype,"geometryBuffers",void 0),m=e([s("esri.layer.support.I3SGeometryDefinition")],m);export{o as l,m,u as s,c as u}; diff --git a/assets/IdentityManager.9f244ffe.js b/assets/IdentityManager.0784430d.js similarity index 99% rename from assets/IdentityManager.9f244ffe.js rename to assets/IdentityManager.0784430d.js index 5fd541e..9d991ea 100644 --- a/assets/IdentityManager.9f244ffe.js +++ b/assets/IdentityManager.0784430d.js @@ -1,4 +1,4 @@ -import{a6 as g,a7 as m,em as Pe,a8 as Y,en as De,eo as x,ep as Ke,eq as we,_ as ge,er as Ye,es as Xe,cx as Ne,W as Ee,dS as T,et as Fe,bX as ce,K as X,C as W,n as U,c1 as Qe,eu as B,ev as M,U as q,dP as Q,ew as he,Z as ue,dR as Se,ex as Ze,F as de,ey as $e,ez as et,eA as Z,eB as Ie,dT as tt,eC as rt}from"./index.d94abe07.js";const P={base:"esri-identity-form",group:"esri-identity-form__group",label:"esri-identity-form__label",footer:"esri-identity-form__footer",esriInput:"esri-input",esriButton:"esri-button",esriButtonSecondary:"esri-button--secondary"},st="ArcGIS Online";let L=class extends De{constructor(n,e){super(n,e),this._usernameInputNode=null,this._passwordInputNode=null,this.signingIn=!1,this.server=null,this.resource=null,this.error=null,this.oAuthPrompt=!1}render(){const{error:n,server:e,resource:t,signingIn:r,oAuthPrompt:i,messages:s}=this,o=x("div",{class:P.group},Ke(i?s.oAuthInfo:s.info,{server:e&&/\.arcgis\.com/i.test(e)?st:e,resource:`(${t||s.lblItem})`})),l=i?null:x("div",{class:P.group,key:"username"},x("label",{class:P.label},s.lblUser,x("input",{value:"",required:!0,autocomplete:"off",spellcheck:!1,type:"text",bind:this,afterCreate:we,"data-node-ref":"_usernameInputNode",class:P.esriInput}))),d=i?null:x("div",{class:P.group,key:"password"},x("label",{class:P.label},s.lblPwd,x("input",{value:"",required:!0,type:"password",bind:this,afterCreate:we,"data-node-ref":"_passwordInputNode",class:P.esriInput}))),a=x("div",{class:this.classes(P.group,P.footer)},x("input",{type:"submit",disabled:!!r,value:r?s.lblSigning:s.lblOk,class:P.esriButton}),x("input",{type:"button",value:s.lblCancel,bind:this,onclick:this._cancel,class:this.classes(P.esriButton,P.esriButtonSecondary)})),p=n?x("div",null,n.details&&n.details.httpStatus?s.invalidUser:s.noAuthService):null;return x("form",{class:P.base,bind:this,onsubmit:this._submit},o,p,l,d,a)}_cancel(){this._set("signingIn",!1),this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(n){n.preventDefault(),this._set("signingIn",!0);const e=this.oAuthPrompt?{}:{username:this._usernameInputNode&&this._usernameInputNode.value,password:this._passwordInputNode&&this._passwordInputNode.value};this.emit("submit",e)}};g([m(),Pe("esri/identity/t9n/identity")],L.prototype,"messages",void 0),g([m()],L.prototype,"signingIn",void 0),g([m()],L.prototype,"server",void 0),g([m()],L.prototype,"resource",void 0),g([m()],L.prototype,"error",void 0),g([m()],L.prototype,"oAuthPrompt",void 0),L=g([Y("esri.identity.IdentityForm")],L);const it=L;/*! +import{a6 as g,a7 as m,em as Pe,a8 as Y,en as De,eo as x,ep as Ke,eq as we,_ as ge,er as Ye,es as Xe,cx as Ne,W as Ee,dS as T,et as Fe,bX as ce,K as X,C as W,n as U,c1 as Qe,eu as B,ev as M,U as q,dP as Q,ew as he,Z as ue,dR as Se,ex as Ze,F as de,ey as $e,ez as et,eA as Z,eB as Ie,dT as tt,eC as rt}from"./index.221827cd.js";const P={base:"esri-identity-form",group:"esri-identity-form__group",label:"esri-identity-form__label",footer:"esri-identity-form__footer",esriInput:"esri-input",esriButton:"esri-button",esriButtonSecondary:"esri-button--secondary"},st="ArcGIS Online";let L=class extends De{constructor(n,e){super(n,e),this._usernameInputNode=null,this._passwordInputNode=null,this.signingIn=!1,this.server=null,this.resource=null,this.error=null,this.oAuthPrompt=!1}render(){const{error:n,server:e,resource:t,signingIn:r,oAuthPrompt:i,messages:s}=this,o=x("div",{class:P.group},Ke(i?s.oAuthInfo:s.info,{server:e&&/\.arcgis\.com/i.test(e)?st:e,resource:`(${t||s.lblItem})`})),l=i?null:x("div",{class:P.group,key:"username"},x("label",{class:P.label},s.lblUser,x("input",{value:"",required:!0,autocomplete:"off",spellcheck:!1,type:"text",bind:this,afterCreate:we,"data-node-ref":"_usernameInputNode",class:P.esriInput}))),d=i?null:x("div",{class:P.group,key:"password"},x("label",{class:P.label},s.lblPwd,x("input",{value:"",required:!0,type:"password",bind:this,afterCreate:we,"data-node-ref":"_passwordInputNode",class:P.esriInput}))),a=x("div",{class:this.classes(P.group,P.footer)},x("input",{type:"submit",disabled:!!r,value:r?s.lblSigning:s.lblOk,class:P.esriButton}),x("input",{type:"button",value:s.lblCancel,bind:this,onclick:this._cancel,class:this.classes(P.esriButton,P.esriButtonSecondary)})),p=n?x("div",null,n.details&&n.details.httpStatus?s.invalidUser:s.noAuthService):null;return x("form",{class:P.base,bind:this,onsubmit:this._submit},o,p,l,d,a)}_cancel(){this._set("signingIn",!1),this._usernameInputNode&&(this._usernameInputNode.value=""),this._passwordInputNode&&(this._passwordInputNode.value=""),this.emit("cancel")}_submit(n){n.preventDefault(),this._set("signingIn",!0);const e=this.oAuthPrompt?{}:{username:this._usernameInputNode&&this._usernameInputNode.value,password:this._passwordInputNode&&this._passwordInputNode.value};this.emit("submit",e)}};g([m(),Pe("esri/identity/t9n/identity")],L.prototype,"messages",void 0),g([m()],L.prototype,"signingIn",void 0),g([m()],L.prototype,"server",void 0),g([m()],L.prototype,"resource",void 0),g([m()],L.prototype,"error",void 0),g([m()],L.prototype,"oAuthPrompt",void 0),L=g([Y("esri.identity.IdentityForm")],L);const it=L;/*! * tabbable 6.0.1 * @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE */var qe=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],ie=qe.join(","),Le=typeof Element=="undefined",z=Le?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,ne=!Le&&Element.prototype.getRootNode?function(n){return n.getRootNode()}:function(n){return n.ownerDocument},je=function(e,t,r){var i=Array.prototype.slice.apply(e.querySelectorAll(ie));return t&&z.call(e,ie)&&i.unshift(e),i=i.filter(r),i},Be=function n(e,t,r){for(var i=[],s=Array.from(e);s.length;){var o=s.shift();if(o.tagName==="SLOT"){var l=o.assignedElements(),d=l.length?l:o.children,a=n(d,!0,r);r.flatten?i.push.apply(i,a):i.push({scopeParent:o,candidates:a})}else{var p=z.call(o,ie);p&&r.filter(o)&&(t||!e.includes(o))&&i.push(o);var f=o.shadowRoot||typeof r.getShadowRoot=="function"&&r.getShadowRoot(o),u=!r.shadowRootFilter||r.shadowRootFilter(o);if(f&&u){var v=n(f===!0?o.children:f.children,!0,r);r.flatten?i.push.apply(i,v):i.push({scopeParent:o,candidates:v})}else s.unshift.apply(s,o.children)}}return i},Ve=function(e,t){return e.tabIndex<0&&(t||/^(AUDIO|VIDEO|DETAILS)$/.test(e.tagName)||e.isContentEditable)&&isNaN(parseInt(e.getAttribute("tabindex"),10))?0:e.tabIndex},nt=function(e,t){return e.tabIndex===t.tabIndex?e.documentOrder-t.documentOrder:e.tabIndex-t.tabIndex},Me=function(e){return e.tagName==="INPUT"},ot=function(e){return Me(e)&&e.type==="hidden"},at=function(e){var t=e.tagName==="DETAILS"&&Array.prototype.slice.apply(e.children).some(function(r){return r.tagName==="SUMMARY"});return t},lt=function(e,t){for(var r=0;rsummary:first-of-type"),o=s?e.parentElement:e;if(z.call(o,"details:not([open]) *"))return!0;if(!r||r==="full"||r==="legacy-full"){if(typeof i=="function"){for(var l=e;e;){var d=e.parentElement,a=ne(e);if(d&&!d.shadowRoot&&i(d)===!0)return ke(e);e.assignedSlot?e=e.assignedSlot:!d&&a!==e.ownerDocument?e=a.host:e=d}e=l}if(dt(e))return!e.getClientRects().length;if(r!=="legacy-full")return!0}else if(r==="non-zero-area")return ke(e);return!1},ft=function(e){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(e.tagName))for(var t=e.parentElement;t;){if(t.tagName==="FIELDSET"&&t.disabled){for(var r=0;r=0)},gt=function n(e){var t=[],r=[];return e.forEach(function(i,s){var o=!!i.scopeParent,l=o?i.scopeParent:i,d=Ve(l,o),a=o?n(i.candidates):l;d===0?o?t.push.apply(t,a):t.push(l):r.push({documentOrder:s,tabIndex:d,item:i,isScope:o,content:a})}),r.sort(nt).reduce(function(i,s){return s.isScope?i.push.apply(i,s.content):i.push(s.content),i},[]).concat(t)},_t=function(e,t){t=t||{};var r;return t.getShadowRoot?r=Be([e],t.includeContainer,{filter:_e.bind(null,t),flatten:!1,getShadowRoot:t.getShadowRoot,shadowRootFilter:vt}):r=je(e,t.includeContainer,_e.bind(null,t)),gt(r)},mt=function(e,t){t=t||{};var r;return t.getShadowRoot?r=Be([e],t.includeContainer,{filter:oe.bind(null,t),flatten:!0,getShadowRoot:t.getShadowRoot}):r=je(e,t.includeContainer,oe.bind(null,t)),r},$=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return z.call(e,ie)===!1?!1:_e(t,e)},bt=qe.concat("iframe").join(","),pe=function(e,t){if(t=t||{},!e)throw new Error("No node provided");return z.call(e,bt)===!1?!1:oe(t,e)};/*! diff --git a/assets/ImageryLayer.f621acf5.js b/assets/ImageryLayer.e44f33f4.js similarity index 99% rename from assets/ImageryLayer.f621acf5.js rename to assets/ImageryLayer.e44f33f4.js index 02d2e02..c6b1705 100644 --- a/assets/ImageryLayer.f621acf5.js +++ b/assets/ImageryLayer.e44f33f4.js @@ -1 +1 @@ -import{b4 as J,iX as nt,j as z,ef as Ve,a6 as a,a7 as u,d2 as M,h0 as pe,cw as at,af as X,a8 as E,cx as k,e0 as V,aT as oe,d3 as Ue,c as I,dQ as ee,e3 as ce,e4 as me,U as O,e2 as je,cU as fe,dZ as Ge,c9 as Be,d_ as Me,aA as Ae,cR as ot,gG as se,iS as lt,eK as ut,ci as pt,bX as ct,s as Le,n as L,d$ as ne,u as mt,dd as we,iY as dt,az as ht,_ as yt,d1 as gt,iZ as ft,iB as Rt,i2 as bt,iM as vt,i3 as wt,eF as St,eG as xt,ia as It,iJ as Ft,eE as Tt,eH as Dt,aU as Nt,id as Pt,i_ as Ct,iE as _t,ig as Ot,dv as Vt,cF as jt}from"./index.d94abe07.js";import{w as x,o as Y,i as ye,c as Mt,l as At,a as $t,u as Jt,m as Et,k as Lt,L as zt,j as qt,$ as Ht,f as kt,n as Qt}from"./fetchRasterInfo.d4fdc8d4.js";import{p as Fe,m as ze,d as Ut,c as Gt}from"./multidimensionalUtils.4f713da1.js";import{_ as We,h as Ze,n as Bt,f as Wt,k as Zt,b as Kt,e as Ke,T as Xt,S as qe,P as Yt}from"./RasterSymbolizer.4ee6ff2c.js";import{g as Se}from"./pixelUtils.82950e1a.js";import{f as ei,b as ti}from"./dataUtils.0f9b810f.js";import{s as ii,n as ri}from"./executeForIds.bade5c1b.js";import"./generateRendererUtils.ebdde5b7.js";import"./colorUtils.bb6424b7.js";const si={StretchFunction:{arguments:{ComputeGamma:{isDataset:!1,isPublic:!1,name:"ComputeGamma",type:"RasterFunctionVariable",value:!1},DRA:{isDataset:!1,isPublic:!1,name:"DRA",type:"RasterFunctionVariable",value:!1},EstimateStatsHistogram:{isDataset:!1,isPublic:!1,name:"EstimateStatsHistogram",type:"RasterFunctionVariable",value:!1},Gamma:{displayName:"Gamma",isDataset:!1,isPublic:!1,name:"Gamma",type:"RasterFunctionVariable"},Histograms:{isDataset:!1,isPublic:!1,name:"Histograms",type:"RasterFunctionVariable"},Max:{isDataset:!1,isPublic:!1,name:"Max",type:"RasterFunctionVariable",value:255},MaxPercent:{isDataset:!1,isPublic:!1,name:"MaxPercent",type:"RasterFunctionVariable",value:.5},Min:{isDataset:!1,isPublic:!1,name:"Min",type:"RasterFunctionVariable",value:0},MinPercent:{isDataset:!1,isPublic:!1,name:"MinPercent",type:"RasterFunctionVariable",value:.25},NumberOfStandardDeviations:{isDataset:!1,isPublic:!1,name:"NumberOfStandardDeviation",type:"RasterFunctionVariable",value:2},Raster:{isDataset:!0,isPublic:!1,name:"Raster",type:"RasterFunctionVariable"},SigmoidStrengthLevel:{isDataset:!1,isPublic:!1,name:"SigmoidStrengthLevel",type:"RasterFunctionVariable",value:2},Statistics:{isDataset:!1,isPublic:!1,name:"Statistics",type:"RasterFunctionVariable"},StretchType:{isDataset:!1,isPublic:!1,name:"StretchType",type:"RasterFunctionVariable",value:0},type:"StretchFunctionArguments",UseGamma:{isDataset:!1,isPublic:!1,name:"UseGamma",type:"RasterFunctionVariable",value:!1}},description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",function:{description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",name:"Stretch",pixelType:"UNKNOWN",type:"StretchFunction"},functionType:0,name:"Stretch",thumbnail:""},RemapFunction:{name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table.",function:{type:"RemapFunction",pixelType:"UNKNOWN",name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},UseTable:{name:"UseTable",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},InputRanges:{name:"InputRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Input Ranges"},OutputValues:{name:"OutputValues",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Output Values"},NoDataRanges:{name:"NoDataRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"NoData Ranges"},Table:{name:"Table",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputField:{name:"InputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},OutputField:{name:"OutputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputMaxField:{name:"InputMaxField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},RemapTableType:{name:"RemapTableType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},AllowUnmatched:{name:"AllowUnmatched",isPublic:!1,isDataset:!1,value:!0,type:"RasterFunctionVariable"},type:"RemapFunctionArguments"},functionType:0,thumbnail:""},ColormapFunction:{name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.",function:{type:"ColormapFunction",pixelType:"UNKNOWN",name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},ColormapName:{name:"ColormapName",isPublic:!1,isDataset:!1,value:"Gray",type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},type:"ColormapFunctionArguments"},functionType:0,thumbnail:""},ShadedReliefFunction:{name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.",function:{type:"ShadedReliefFunction",pixelType:"UNKNOWN",name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"ShadedReliefFunctionArguments"},functionType:0,thumbnail:""},HillshadeFunction:{name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image",function:{type:"HillshadeFunction",pixelType:"UNKNOWN",name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image"},arguments:{DEM:{name:"DEM",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"HillshadeFunctionArguments"},functionType:0,thumbnail:""},ResampleFunction:{name:"Resample",description:"Changes the cell size of a raster.",function:{type:"ResampleFunction",pixelType:"UNKNOWN",name:"Resample",description:"Changes the cell size of a raster."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ResamplingType:{name:"ResamplingType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},InputCellSize:{name:"InputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},OutputCellSize:{name:"OutputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},type:"ResampleFunctionArguments"},functionType:0,thumbnail:""}},ni={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767]},ai={simple_scalar:"Simple Scalar",wind_barb:"Wind Barb",single_arrow:"Single Arrow",beaufort_kn:"Beaufort Wind (Knots)",beaufort_m:"Beaufort Wind (MetersPerSecond)",ocean_current_m:"Ocean Current (MetersPerSecond)",ocean_current_kn:"Ocean Current (Knots)"},oi=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function Xe(r){return oi.has(r.type)}function xe(r,i){if(!r||!i)return J(r||i);const o=J(r);if(i.rasterFunctionDefinition){const e=i.rasterFunctionDefinition;(e.thumbnail||e.thumbnailEx)&&(e.thumbnail=e.thumbnailEx=null),Ye(o.rasterFunctionDefinition.arguments,i)}else i.functionName.toLowerCase()!=="none"&&(et(o.functionArguments).Raster=i);return o}function Ye(r,i){for(const o in r)o.toLowerCase()==="raster"&&(r[o].type==="RasterFunctionVariable"?(r[o]=i.rasterFunctionDefinition,r[o].type="RasterFunctionTemplate"):r[o].type==="RasterFunctionTemplate"&&Ye(r[o].arguments,i))}function W(r){const i=J(si[r.functionName+"Function"]),o=r.functionArguments;for(const e in o)e.toLowerCase()==="raster"?(i.arguments[e]=W(o[e]),i.arguments[e].type="RasterFunctionTemplate"):e.toLowerCase()==="colormap"?(i.arguments[e].value=gi(o[e]),i.arguments.ColorSchemeType.value=0):i.arguments[e].value=o[e];return i}function li(r,i){switch(i=i||{},r.type){case"raster-stretch":return ci(r,i);case"class-breaks":return mi(r,i);case"unique-value":return di(r,i);case"raster-colormap":return hi(r,i);case"vector-field":return ui(r,i);case"raster-shaded-relief":return pi(r,i);case"flow":throw new Error("Unsupported rendering rule.")}}function et(r){const i=r==null?void 0:r.Raster;return i&&i.declaredClass==="esri.layers.support.RasterFunction"?et(i.functionArguments):r}const he={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function ui(r,i){const o=new x;o.functionName="VectorFieldRenderer";const{dataType:e,bandProperties:t}=i,s=e==="vector-uv";let n,l;t&&t.length===2&&(n=t.map(h=>h.BandName.toLowerCase()).indexOf("magnitude"),l=t.map(h=>h.BandName.toLowerCase()).indexOf("direction")),n!==-1&&n!==null||(n=0,l=1);const p=r.rotationType==="arithmetic"?1:2,m=r.flowRepresentation==="flow-from"?0:1,c=r.visualVariables?r.visualVariables.find(h=>h.field==="Magnitude"):new nt,d={magnitudeBandID:n,directionBandID:l,isUVComponents:s,referenceSystem:p,massFlowAngleRepresentation:m,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:ai[r.style.toLowerCase().replace("-","_")],minimumMagnitude:c.minDataValue,maximumMagnitude:c.maxDataValue,minimumSymbolSize:c.minSize,maximumSymbolSize:c.maxSize};return o.functionArguments=d,i.convertToRFT?new x({rasterFunctionDefinition:W(o)}):o}function pi(r,i){const o=i.convertToRFT;if(i.dataType!=="elevation"&&(i.dataType!=="generic"||i.bandCount!==1||i.pixelType!=="s16"&&i.pixelType!=="s32"&&i.pixelType!=="f32"&&i.pixelType!=="f64"))return new x;const e=new x;e.functionName="Hillshade";const t=r.hillshadeType==="traditional"?0:1,s=r.scalingType==="none"?1:3,n={HillshadeType:t,SlopeType:s,ZFactor:r.zFactor};return t===0&&(n.Azimuth=r.azimuth,n.Altitude=r.altitude),s===3&&(n.PSPower=r.pixelSizePower,n.PSZFactor=r.pixelSizeFactor),e.functionArguments=n,e.variableName="Raster",r.colorRamp&&(e.functionName="ShadedRelief",o?n.ColorRamp=We(r.colorRamp):n.Colormap=Ze(r.colorRamp,256)),o?new x({rasterFunctionDefinition:W(e)}):e}function ci(r,i){var l;const o=i.convertToRFT,e=new x;e.functionName="Stretch";const t=he[Bt.toJSON(r.stretchType)],s="u8",n={StretchType:t,Statistics:yi(r.statistics),DRA:r.dynamicRangeAdjustment,UseGamma:r.useGamma,Gamma:r.gamma,ComputeGamma:r.computeGamma};if(r.outputMin!=null&&(n.Min=r.outputMin),r.outputMax!=null&&(n.Max=r.outputMax),t===he.standardDeviation?(n.NumberOfStandardDeviations=r.numberOfStandardDeviations,e.outputPixelType=s):t===he.percentClip?(n.MinPercent=r.minPercent,n.MaxPercent=r.maxPercent,e.outputPixelType=s):t===he.minMax?e.outputPixelType=s:t===he.sigmoid&&(n.SigmoidStrengthLevel=r.sigmoidStrengthLevel),e.functionArguments=n,e.variableName="Raster",r.colorRamp){const p=r.colorRamp,m=new x;if(o)m.functionArguments={ColorRamp:We(p)};else{const c=Wt(p);if(c)m.functionArguments={colorRamp:c};else if(!i.convertColorRampToColormap||p.type!=="algorithmic"&&p.type!=="multipart"){const d=r.colorRamp.toJSON();d.type==="algorithmic"?d.algorithm=d.algorithm||"esriCIELabAlgorithm":d.type==="multipart"&&((l=d.colorRamps)==null?void 0:l.length)&&d.colorRamps.forEach(h=>h.algorithm=h.algorithm||"esriCIELabAlgorithm"),m.functionArguments={colorRamp:d}}else m.functionArguments={Colormap:Ze(p,256)}}return m.variableName="Raster",m.functionName="Colormap",m.functionArguments.Raster=e,o?new x({rasterFunctionDefinition:W(m)}):m}return o?new x({rasterFunctionDefinition:W(e)}):e}function mi(r,i){const o=[],e=[],t=[],s=[],{pixelType:l,rasterAttributeTable:p}=i,m=z(p)?null:p.features,c=tt(p);if(m&&Array.isArray(m)&&r.classBreakInfos){r.classBreakInfos.forEach((g,F)=>{const T=g.symbol.color;let P;T.a&&m.forEach(f=>{P=f.attributes[r.field],(P>=g.minValue&&P=g.minValue)&&s.push([f.attributes[c],T.r,T.g,T.b])})});const b=l?ve(s,l):s,y=new x;return y.functionName="Colormap",y.functionArguments={},y.functionArguments.Colormap=b,y.variableName="Raster",i.convertToRFT?new x({rasterFunctionDefinition:W(y)}):y}r.classBreakInfos.forEach((b,y)=>{const g=b.symbol&&b.symbol.color;g.a?(y===0?o.push(b.minValue,b.maxValue+1e-6):o.push(b.minValue+1e-6,b.maxValue+1e-6),e.push(y),s.push([y,g.r,g.g,g.b])):t.push(b.minValue,b.maxValue)});const d=l?ve(s,l):s,h=new x;h.functionName="Remap",h.functionArguments={InputRanges:o,OutputValues:e,NoDataRanges:t},h.variableName="Raster";const R=new x;return R.functionName="Colormap",R.functionArguments={Colormap:d,Raster:h},i.convertToRFT?new x({rasterFunctionDefinition:W(R)}):R}function ve(r,i){const o=ni[String(i).toLowerCase()];return o&&r.push([Math.floor(o[0]-1),0,0,0],[Math.ceil(o[1]+1),0,0,0]),r}function tt(r){if(z(r))return;const{fields:i}=r,o=i&&i.find(e=>e&&e.name&&e.name.toLowerCase()==="value");return o&&o.name}function di(r,i){var d,h;const o=[],{pixelType:e,rasterAttributeTable:t}=i,s=z(t)?null:t.features,n=tt(t),l=(h=(d=r.defaultSymbol)==null?void 0:d.color)==null?void 0:h.toRgb(),p=r.uniqueValueInfos;if(p)if(s){const R=new Map;p.forEach(y=>{const g=y.value,F=y.symbol.color;g!=null&&F&&F.a&&R.set(String(g),F.toRgb())});const b=r.field;s.forEach(({attributes:y})=>{const g=String(y[b]),F=y[n];if(R.has(g)){const T=R.get(g);o.push([F,...T])}else l&&o.push([F,...l])})}else for(let R=0;R0?ve(o,e):o,c=new x;return c.functionName="Colormap",c.functionArguments={},c.functionArguments.Colormap=m,c.variableName="Raster",i.convertToRFT?new x({rasterFunctionDefinition:W(c)}):c}function hi(r,i){const o=r.extractColormap();if(!o||o.length===0)return;const{pixelType:e}=i,t=e?ve(o,e):o,s=new x;return s.functionName="Colormap",s.functionArguments={},s.functionArguments.Colormap=t,i.convertToRFT?new x({rasterFunctionDefinition:W(s)}):s}function yi(r){const i=[];return r.forEach(o=>{const e=o;if(Array.isArray(e))i.push(e);else{if(e.min==null||e.max==null)return;const t=[e.min,e.max,e.avg||0,e.stddev||0];i.push(t)}}),i}function gi(r){const i=[],o=[];return r.forEach(e=>{i.push(e[0]),o.push(Zt([...e.slice(1),255]))}),{type:"RasterColormap",values:i,colors:o}}var Te;const ge=Ve()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),De=Ve()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});function fi(r){let i;switch(r?r.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":i="esriMosaicAttribute";break;case"lockraster":i="esriMosaicLockRaster";break;case"center":i="esriMosaicCenter";break;case"northwest":i="esriMosaicNorthwest";break;case"nadir":i="esriMosaicNadir";break;case"viewpoint":i="esriMosaicViewpoint";break;case"seamline":i="esriMosaicSeamline";break;default:i="esriMosaicNone"}return De.fromJSON(i)}let j=Te=class extends k{constructor(r){super(r),this.ascending=!0,this.itemRenderingRule=null,this.lockRasterIds=null,this.method=null,this.multidimensionalDefinition=null,this.objectIds=null,this.operation=null,this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(r,i){return i.ascending!=null?i.ascending:i.sortAscending==null||i.sortAscending}readMethod(r,i){return fi(i.mosaicMethod||i.defaultMosaicMethod)}readOperation(r,i){const o=i.mosaicOperation,e=i.mosaicOperator&&i.mosaicOperator.toLowerCase(),t=o||(e?ge.toJSON(e):null);return ge.fromJSON(t)||"first"}castSortValue(r){return r==null||typeof r=="string"||typeof r=="number"?r:`${r}`}clone(){return new Te({ascending:this.ascending,itemRenderingRule:J(this.itemRenderingRule),lockRasterIds:J(this.lockRasterIds),method:this.method,multidimensionalDefinition:J(this.multidimensionalDefinition),objectIds:J(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:J(this.viewpoint),where:this.where})}};a([u({type:Boolean,json:{write:!0}})],j.prototype,"ascending",void 0),a([M("ascending",["ascending","sortAscending"])],j.prototype,"readAscending",null),a([u({type:x,json:{write:!0}})],j.prototype,"itemRenderingRule",void 0),a([u({type:[pe],json:{write:{overridePolicy(){return{enabled:this.method==="lock-raster"}}}}})],j.prototype,"lockRasterIds",void 0),a([u({type:String,json:{type:De.jsonValues,write:{target:"mosaicMethod",writer:De.write}}})],j.prototype,"method",void 0),a([M("method",["mosaicMethod","defaultMosaicMethod"])],j.prototype,"readMethod",null),a([u({type:[Fe],json:{write:!0}})],j.prototype,"multidimensionalDefinition",void 0),a([u({type:[pe],json:{name:"fids",write:!0}})],j.prototype,"objectIds",void 0),a([u({json:{type:ge.jsonValues,read:{reader:ge.read},write:{target:"mosaicOperation",writer:ge.write}}})],j.prototype,"operation",void 0),a([M("operation",["mosaicOperation","mosaicOperator"])],j.prototype,"readOperation",null),a([u({type:String,json:{write:{overridePolicy(){return{enabled:this.method==="attribute"}}}}})],j.prototype,"sortField",void 0),a([u({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:this.method==="attribute",allowNull:!0}}}}})],j.prototype,"sortValue",void 0),a([at("sortValue")],j.prototype,"castSortValue",null),a([u({type:X,json:{write:!0}})],j.prototype,"viewpoint",void 0),a([u({type:String,json:{write:!0}})],j.prototype,"where",void 0),j=Te=a([E("esri.layers.support.MosaicRule")],j);const H=j;let C=class extends k{constructor(){super(...arguments),this.layer=null,this.adjustAspectRatio=void 0,this.compression=void 0,this.pixelType=void 0,this.lercVersion=2}writeAdjustAspectRatio(r,i,o){this.layer.version<10.3||(i[o]=r)}get bandIds(){return this.layer.bandIds}set bandIds(r){this.layer&&(this.layer.bandIds=r)}get compressionQuality(){var r;return(r=this.layer)==null?void 0:r.compressionQuality}set compressionQuality(r){this.layer&&(this.layer.compressionQuality=r)}writeCompressionQuality(r,i,o){this.format&&this.format.toLowerCase().includes("jpg")&&r!=null&&(i[o]=r)}get compressionTolerance(){var r;return(r=this.layer)==null?void 0:r.compressionTolerance}set compressionTolerance(r){this.layer&&(this.layer.compressionTolerance=r)}writeCompressionTolerance(r,i,o){this.format==="lerc"&&r!=null&&(i[o]=r)}get format(){var r;return((r=this.layer.renderer)==null?void 0:r.type)==="vector-field"?"lerc":this.layer.format}get interpolation(){var r;return(r=this.layer)==null?void 0:r.interpolation}set interpolation(r){this.layer&&(this.layer.interpolation=r)}get noData(){var r;return(r=this.layer)==null?void 0:r.noData}set noData(r){this.layer&&(this.layer.noData=r)}get noDataInterpretation(){var r;return(r=this.layer)==null?void 0:r.noDataInterpretation}set noDataInterpretation(r){this.layer&&(this.layer.noDataInterpretation=r)}writeLercVersion(r,i,o){this.format==="lerc"&&this.layer.version>=10.5&&(i[o]=r)}get version(){const r=this.layer;return r.commitProperty("bandIds"),r.commitProperty("format"),r.commitProperty("compressionQuality"),r.commitProperty("compressionTolerance"),r.commitProperty("interpolation"),r.commitProperty("noData"),r.commitProperty("noDataInterpretation"),r.commitProperty("mosaicRule"),r.commitProperty("renderingRule"),r.commitProperty("adjustAspectRatio"),r.commitProperty("pixelFilter"),r.commitProperty("definitionExpression"),r.commitProperty("multidimensionalSubset"),(this._get("version")||0)+1}set version(r){this._set("version",r)}get mosaicRule(){const r=this.layer;let i=r.mosaicRule;const o=r.definitionExpression;return i?o&&o!==i.where&&(i=i.clone(),i.where=o):o&&(i=new H({where:o})),i}get renderingRule(){var s,n;const r=this.layer;let i=r.renderingRule;const o=r.pixelFilter,e=!r.format||r.format.includes("jpg")||r.format.includes("png");i=this._addResampleRasterFunction(i);const t=(s=r.multidimensionalSubset)==null?void 0:s.areaOfInterest;return t&&(i=this._addClipFunction(i,t)),e&&!o&&((n=r.renderer)==null?void 0:n.type)!=="vector-field"&&(i=this.combineRendererWithRenderingRule(i)),i}combineRendererWithRenderingRule(r){var t;const i=this.layer,{rasterInfo:o,renderer:e}=i;return r=r||i.renderingRule,!e||!Xe(e)?r:xe(li(e,{rasterAttributeTable:o.attributeTable,pixelType:o.pixelType,dataType:o.dataType,bandProperties:(t=o.keyProperties)==null?void 0:t.BandProperties,convertColorRampToColormap:i.version<10.6,convertToRFT:!!(r!=null&&r.rasterFunctionDefinition),bandCount:o.bandCount}),r)}_addResampleRasterFunction(r){var t;if(((t=this.layer.renderer)==null?void 0:t.type)!=="vector-field"||(r==null?void 0:r.functionName)==="Resample")return r;const i=this.layer.serviceDataType==="esriImageServiceDataTypeVector-UV"?7:10,o=this.layer.serviceRasterInfo.pixelSize;let e=new x({functionName:"Resample",functionArguments:{ResamplingType:i,InputCellSize:o}});return e=r!=null&&r.rasterFunctionDefinition?new x({rasterFunctionDefinition:W(e)}):e,xe(e,r)}_addClipFunction(r,i){const o=new x({functionName:"Clip",functionArguments:{ClippingGeometry:i.toJSON(),ClippingType:1}});return xe(o,r)}};a([u()],C.prototype,"layer",void 0),a([u({json:{write:!0}})],C.prototype,"adjustAspectRatio",void 0),a([V("adjustAspectRatio")],C.prototype,"writeAdjustAspectRatio",null),a([u({json:{write:!0}})],C.prototype,"bandIds",null),a([u({json:{write:!0}})],C.prototype,"compression",void 0),a([u({json:{write:!0}})],C.prototype,"compressionQuality",null),a([V("compressionQuality")],C.prototype,"writeCompressionQuality",null),a([u({json:{write:!0}})],C.prototype,"compressionTolerance",null),a([V("compressionTolerance")],C.prototype,"writeCompressionTolerance",null),a([u({json:{write:!0}})],C.prototype,"format",null),a([u({type:String,json:{read:{reader:Y.read},write:{writer:Y.write}}})],C.prototype,"interpolation",null),a([u({json:{write:!0}})],C.prototype,"noData",null),a([u({type:String,json:{read:{reader:ye.read},write:{writer:ye.write}}})],C.prototype,"noDataInterpretation",null),a([u({json:{write:!0}})],C.prototype,"pixelType",void 0),a([u({json:{write:!0}})],C.prototype,"lercVersion",void 0),a([V("lercVersion")],C.prototype,"writeLercVersion",null),a([u({type:Number})],C.prototype,"version",null),a([u({json:{write:!0}})],C.prototype,"mosaicRule",null),a([u({json:{write:!0}})],C.prototype,"renderingRule",null),C=a([E("esri.layers.mixins.ExportImageServiceParameters")],C);let le=class extends k{constructor(){super(...arguments),this.north=null,this.up=null,this.spatialReference=null}};a([u({type:Number,json:{write:!0}})],le.prototype,"north",void 0),a([u({type:Number,json:{write:!0}})],le.prototype,"up",void 0),a([u({type:oe,json:{write:!0}})],le.prototype,"spatialReference",void 0),le=a([E("esri.rest.support.ImageAngleResult")],le);const Ri=le;let Q=class extends k{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};a([u({json:{write:!0}})],Q.prototype,"catalogItemVisibilities",void 0),a([u({type:Ue,json:{write:!0}})],Q.prototype,"catalogItems",void 0),a([u({type:X,json:{write:!0}})],Q.prototype,"location",void 0),a([u({json:{write:!0}})],Q.prototype,"name",void 0),a([u({json:{write:!0}})],Q.prototype,"objectId",void 0),a([u({json:{write:!0}})],Q.prototype,"processedValues",void 0),a([u({json:{write:!0}})],Q.prototype,"properties",void 0),a([u({json:{write:!0}})],Q.prototype,"value",void 0),Q=a([E("esri.rest.support.ImageIdentifyResult")],Q);const bi=Q;let Re=class extends k{constructor(){super(...arguments),this.geometries=null}};a([u({json:{write:!0}})],Re.prototype,"geometries",void 0),Re=a([E("esri.rest.support.ImagePixelLocationResult")],Re);const vi=Re;let K=class extends k{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};a([u({json:{write:!0}})],K.prototype,"attributes",void 0),a([u({type:X,json:{write:!0}})],K.prototype,"location",void 0),a([u({json:{write:!0}})],K.prototype,"locationId",void 0),a([u({json:{write:!0}})],K.prototype,"rasterId",void 0),a([u({json:{write:!0}})],K.prototype,"resolution",void 0),a([u({json:{write:!0}})],K.prototype,"pixelValue",void 0),K=a([E("esri.rest.support.ImageSample")],K);const wi=K;let be=class extends k{constructor(){super(...arguments),this.samples=null}};a([u({type:[wi],json:{write:!0}})],be.prototype,"samples",void 0),be=a([E("esri.rest.support.ImageSampleResult")],be);const Si=be;function it(r){const i=r==null?void 0:r.time;if(i&&(i.start!=null||i.end!=null)){const o=[];i.start!=null&&o.push(i.start),i.end==null||o.includes(i.end)||o.push(i.end),r.time=o.join(",")}}async function rt(r,i,o){const e=ee(r),t=i.geometry?[i.geometry]:[],s=await je(t),n=i.toJSON();it(n);const l=s&&s[0];I(l)&&(n.geometry=l.toJSON());const p=ce({...e.query,f:"json",...n});return me(p,o)}async function xi(r,i,o){var p;const e=i.toJSON();I(e.angleName)&&(e.angleName=e.angleName.join(",")),I(i.point)&&((p=i.point.spatialReference)==null?void 0:p.imageCoordinateSystem)&&(e.point.spatialReference=$e(i.point.spatialReference)),I(i.spatialReference)&&i.spatialReference.imageCoordinateSystem&&(e.spatialReference=st(i.spatialReference));const t=ee(r),s=ce({...t.query,f:"json",...e}),n=me(s,o),{data:l}=await O(`${t.path}/computeAngles`,n);return l.spatialReference=l.spatialReference?l.spatialReference.geodataXform!=null?new oe({wkid:0,imageCoordinateSystem:l.spatialReference}):oe.fromJSON(l.spatialReference):null,l.north==="NaN"&&(l.north=null),l.up==="NaN"&&(l.up=null),new Ri(l)}async function Ii(r,i,o){var m;const e=i.toJSON(),{geometries:t}=i;if(t)for(let c=0;c{l.avg=l.mean,l.stddev=l.standardDeviation}),{statistics:n,histograms:s.histograms}}async function Ti(r,i,o){const e=await rt(r,i,o),t=ee(r),{data:s}=await O(`${t.path}/computeHistograms`,e);return{histograms:s.histograms}}async function Di(r,i,o){var c,d,h;const e=i.toJSON();it(e),(c=e.outFields)!=null&&c.length&&(e.outFields=e.outFields.join(","));const t=(d=await je(i.geometry))==null?void 0:d[0];I(t)&&(e.geometry=t.toJSON());const s=ee(r),n=ce({...s.query,f:"json",...e}),l=me(n,o),{data:p}=await O(`${s.path}/getSamples`,l),m=(h=p==null?void 0:p.samples)==null?void 0:h.map(R=>{const b=R.value==="NaN"||R.value===""?null:R.value.split(" ").map(y=>Number(y));return{...R,pixelValue:b}});return Si.fromJSON({samples:m})}async function He(r,i,o){const e=ee(r),t=i.geometry?[i.geometry]:[];return je(t).then(s=>{const n=i.toJSON(),l=s&&s[0];I(l)&&(n.geometry=JSON.stringify(l.toJSON()));const p=ce({...e.query,f:"json",...n}),m=me(p,o);return O(e.path+"/identify",m)}).then(s=>bi.fromJSON(s.data))}function $e(r){const{imageCoordinateSystem:i}=r;if(i){const{id:o,referenceServiceName:e}=i;return o!=null?e?{icsid:o,icsns:e}:{icsid:o}:{ics:i}}return r.toJSON()}function st(r,i){const o=$e(r),{icsid:e,icsns:t,wkid:s}=o;return e!=null?t==null||(i==null?void 0:i.toLowerCase().includes("/"+t.toLowerCase()+"/"))?`0:${e}`:JSON.stringify(o):s?s.toString():JSON.stringify(o)}async function Ni(r,i,o){var f,w;const e=ee(r),t=ce({...e==null?void 0:e.query,f:"json"}),s=me(t,o),n=`${e==null?void 0:e.path}/${i}/info`,l=O(`${n}`,s),p=O(`${n}/keyProperties`,s),m=await Promise.allSettled([l,p]),c=m[0].status==="fulfilled"?m[0].value.data:null,d=m[1].status==="fulfilled"?m[1].value.data:null;let h=null;(f=c.statistics)!=null&&f.length&&(h=c.statistics.map(v=>({min:v[0],max:v[1],avg:v[2],stddev:v[3]})));const R=fe.fromJSON(c.extent),b=Math.ceil(R.width/c.pixelSizeX-.1),y=Math.ceil(R.height/c.pixelSizeY-.1),g=R.spatialReference,F=new X({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:g}),T=(w=c.histograms)!=null&&w.length?c.histograms:null,P=new Kt({origin:c.origin,blockWidth:c.blockWidth,blockHeight:c.blockHeight,firstPyramidLevel:c.firstPyramidLevel,maximumPyramidLevel:c.maxPyramidLevel});return new Ke({width:b,height:y,bandCount:c.bandCount,extent:R,spatialReference:g,pixelSize:F,pixelType:c.pixelType.toLowerCase(),statistics:h,histograms:T,keyProperties:d,storageInfo:P})}var Ne;let ae=Ne=class extends k{constructor(){super(...arguments),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new Ne(J({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};a([u({type:[String],json:{name:"angleName",write:!0}})],ae.prototype,"angleNames",void 0),a([u({type:X,json:{write:!0}})],ae.prototype,"point",void 0),a([u({type:oe,json:{write:!0}})],ae.prototype,"spatialReference",void 0),a([u({type:pe,json:{write:!0}})],ae.prototype,"rasterId",void 0),ae=Ne=a([E("esri.rest.support.ImageAngleParameters")],ae);const Pi=ae;var Pe;let B=Pe=class extends k{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.renderingRule=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(r,i,o){r!=null&&(i.geometryType=Ae(r),i[o]=r.toJSON())}clone(){return new Pe(J({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};a([u({types:Ge,json:{read:Be}})],B.prototype,"geometry",void 0),a([V("geometry")],B.prototype,"writeGeometry",null),a([u({type:H,json:{write:!0}})],B.prototype,"mosaicRule",void 0),a([u({type:x,json:{write:!0}})],B.prototype,"renderingRule",void 0),a([u({type:X,json:{write:!0}})],B.prototype,"pixelSize",void 0),a([u({json:{write:!0}})],B.prototype,"raster",void 0),a([u({type:Me,json:{read:{source:"time"},write:{target:"time"}}})],B.prototype,"timeExtent",void 0),B=Pe=a([E("esri.rest.support.ImageHistogramParameters")],B);const ke=B;var Ce;let _=Ce=class extends k{constructor(){super(...arguments),this.geometry=null,this.renderingRules=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(r,i,o){r!=null&&(i.geometryType=Ae(r),i[o]=JSON.stringify(r.toJSON()))}set mosaicRule(r){let i=r;i&&i.mosaicMethod&&(i=H.fromJSON({...i.toJSON(),mosaicMethod:i.mosaicMethod,mosaicOperation:i.mosaicOperation})),this._set("mosaicRule",i)}writeMosaicRule(r,i,o){r!=null&&(i[o]=JSON.stringify(r.toJSON()))}set renderingRule(r){let i=r;i&&i.rasterFunction&&(i=x.fromJSON({...i.toJSON(),rasterFunction:i.rasterFunction,rasterFunctionArguments:i.rasterFunctionArguments})),this._set("renderingRule",i)}writeRenderingRule(r,i,o){r!=null&&(i[o]=JSON.stringify(r.toJSON())),r.rasterFunctionDefinition&&(i[o]=JSON.stringify(r.rasterFunctionDefinition))}writeRenderingRules(r,i,o){r!=null&&(i[o]=JSON.stringify(r.map(e=>e.rasterFunctionDefinition||e.toJSON())))}writePixelSize(r,i,o){r!=null&&(i[o]=JSON.stringify(r))}writeTimeExtent(r,i,o){if(r!=null){const e=I(r.start)?r.start.getTime():null,t=I(r.end)?r.end.getTime():null;i[o]=e!=null?t!=null?`${e},${t}`:`${e}`:null}}clone(){return new Ce(J({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};a([u({json:{write:!0}})],_.prototype,"geometry",void 0),a([V("geometry")],_.prototype,"writeGeometry",null),a([u({type:H,json:{write:!0}})],_.prototype,"mosaicRule",null),a([V("mosaicRule")],_.prototype,"writeMosaicRule",null),a([u({type:x,json:{write:!0}})],_.prototype,"renderingRule",null),a([V("renderingRule")],_.prototype,"writeRenderingRule",null),a([u({type:[x],json:{write:!0}})],_.prototype,"renderingRules",void 0),a([V("renderingRules")],_.prototype,"writeRenderingRules",null),a([u({type:X,json:{write:!0}})],_.prototype,"pixelSize",void 0),a([V("pixelSize")],_.prototype,"writePixelSize",null),a([u({type:Boolean,json:{write:!0}})],_.prototype,"returnGeometry",void 0),a([u({type:Boolean,json:{write:!0}})],_.prototype,"returnCatalogItems",void 0),a([u({type:Boolean,json:{write:!0}})],_.prototype,"returnPixelValues",void 0),a([u({type:Number,json:{write:!0}})],_.prototype,"maxItemCount",void 0),a([u({type:Me,json:{write:{target:"time"}}})],_.prototype,"timeExtent",void 0),a([V("timeExtent")],_.prototype,"writeTimeExtent",null),a([u({json:{write:!0}})],_.prototype,"raster",void 0),a([u({json:{write:!0}})],_.prototype,"viewId",void 0),a([u({type:Boolean,json:{write:!0}})],_.prototype,"processAsMultidimensional",void 0),_=Ce=a([E("esri.rest.support.ImageIdentifyParameters")],_);const Qe=_;var _e;let ue=_e=class extends k{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(r,i,o){i.geometries={geometryType:"esriGeometryPoint",geometries:r.map(e=>e.toJSON())}}clone(){var r,i;return new _e({geometries:(i=(r=this.geometries)==null?void 0:r.map(o=>o.clone()))!=null?i:[],rasterId:this.rasterId})}};a([u({type:[X],json:{write:!0}})],ue.prototype,"geometries",void 0),a([V("geometries")],ue.prototype,"writeGeometry",null),a([u({type:pe,json:{write:!0}})],ue.prototype,"rasterId",void 0),ue=_e=a([E("esri.rest.support.ImagePixelLocationParameters")],ue);const Ci=ue;var Oe;let $=Oe=class extends k{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(r,i,o){r!=null&&(i.geometryType=Ae(r),i[o]=r.toJSON())}set locations(r){if(r!=null&&r.length){const i=new ot({spatialReference:r[0].spatialReference});i.points=r.map(o=>[o.x,o.y]),this._set("locations",r),this.geometry=i}}clone(){return new Oe(J({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};a([u({types:Ge,json:{read:Be}})],$.prototype,"geometry",void 0),a([V("geometry")],$.prototype,"writeGeometry",null),a([u()],$.prototype,"locations",null),a([u({type:String,json:{type:Y.jsonValues,read:Y.read,write:Y.write}})],$.prototype,"interpolation",void 0),a([u({type:H,json:{write:!0}})],$.prototype,"mosaicRule",void 0),a([u({type:[String],json:{write:!0}})],$.prototype,"outFields",void 0),a([u({type:X,json:{write:!0}})],$.prototype,"pixelSize",void 0),a([u({type:String,json:{write:!0}})],$.prototype,"raster",void 0),a([u({type:Boolean,json:{write:!0}})],$.prototype,"returnFirstValueOnly",void 0),a([u({type:Number,json:{write:!0}})],$.prototype,"sampleDistance",void 0),a([u({type:Number,json:{write:!0}})],$.prototype,"sampleCount",void 0),a([u({type:Number,json:{write:!0}})],$.prototype,"sliceId",void 0),a([u({type:Me,json:{read:{source:"time"},write:{target:"time"}}})],$.prototype,"timeExtent",void 0),$=Oe=a([E("esri.rest.support.ImageSampleParameters")],$);const _i=$,Ie=Ve()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"}),Oi=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),Vi=ft(Rt,{min:0,max:255});function ji(r){var o;if(!r)return null;const i=(o=JSON.stringify(r).match(/"rasterFunction":"(.*?")/gi))==null?void 0:o.map(e=>e.replace('"rasterFunction":"',"").replace('"',""));return i?i.join("/"):null}const Mi=r=>{let i=class extends r{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._cachedRendererJson=null,this._serviceSupportsMosaicRule=null,this._rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new C({layer:this}))}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||I(this.rasterFunctionInfos)&&this.rasterFunctionInfos.length<1||I(this.rasterFunctionInfos)&&this.rasterFunctionInfos.forEach(t=>{e.set(t.name.toLowerCase().replace(/ /gi,"_"),t.name)}),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every(s=>typeof s=="number"))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,s){e!=null&&this.format!=="lerc"&&(t[s]=e)}writeCompressionTolerance(e,t,s){this.format==="lerc"&&e!=null&&(t[s]=e)}readDefaultMosaicRule(e,t){return this._serviceSupportsMosaicRule?H.fromJSON(t):null}get fieldsIndex(){return this.fields?new pt(this.fields):null}set format(e){e&&Oi.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,t){return t.serviceDataType==="esriImageServiceDataTypeVector-UV"||t.serviceDataType==="esriImageServiceDataTypeVector-MagDir"||this.pixelFilter!=null?"lerc":"jpgpng"}readMinScale(e,t){return t.minLOD!=null&&t.maxLOD!=null?e:0}readMaxScale(e,t){return t.minLOD!=null&&t.maxLOD!=null?e:0}set mosaicRule(e){let t=e;t&&t.mosaicMethod&&(t=H.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}readMosaicRule(e,t){const s=e||t.mosaicRule;return s?H.fromJSON(s):this._isMosaicRuleSupported(t)?H.fromJSON(t):null}writeMosaicRule(e,t,s){let n=this.mosaicRule;const l=this.definitionExpression;n?l&&l!==n.where&&(n=n.clone(),n.where=l):l&&(n=new H({where:l})),this._isValidCustomizedMosaicRule(n)&&(t[s]=n.toJSON())}get multidimensionalInfo(){return I(this.serviceRasterInfo)?this.serviceRasterInfo.multidimensionalInfo:null}writeNoData(e,t,s){e!=null&&typeof e=="number"&&(t[s]=Vi(e))}readObjectIdField(e,t){if(!e){const s=t.fields.filter(n=>n.type==="esriFieldTypeOID"||n.type==="oid");e=s&&s[0]&&s[0].name}return e}get parsedUrl(){return ct(this.url)}readSourceType(e,t){return this._isMosaicDataset(t)?"mosaic-dataset":"raster-dataset"}set renderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("renderer",e)}readRenderer(e,t,s){var p,m;const n=(m=(p=t==null?void 0:t.layerDefinition)==null?void 0:p.drawingInfo)==null?void 0:m.renderer,l=Jt(n,s);return l==null?null:(l.type==="vector-field"&&t.symbolTileSize&&!n.symbolTileSize&&(l.symbolTileSize=t.symbolTileSize),Xe(l)||Le.getLogger(this.declaredClass).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),l)}writeRenderer(e,t,s){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON(),e.type==="vector-field"&&(t.symbolTileSize=e.symbolTileSize)}get rasterFields(){var m,c;const e=this._rasterAttributeTableFieldPrefix||"Raster.",t=new se({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),s=new se({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),n=new se({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let l=this.fields?J(this.fields):[];l.push(s),((m=this.capabilities)==null?void 0:m.operations.supportsQuery)&&this.fields&&this.fields.length>0&&l.push(t),this.version>=10.4&&I(this.rasterFunctionInfos)&&this.rasterFunctionInfos.some(d=>d.name.toLowerCase()==="none")&&l.push(n),I(this.rasterFunctionInfos)&&this.rasterFunctionInfos.filter(d=>d.name.toLowerCase()!=="none").forEach(d=>{l.push(new se({name:"Raster.ServicePixelValue."+d.name,alias:d.name,domain:null,editable:!1,length:50,type:"string"}))}),this._isVectorDataSet()&&(l.push(new se({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),l.push(new se({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:p}=(c=this.rasterInfo)!=null?c:{};if(I(p)){const d=p.fields.filter(h=>h.type!=="esriFieldTypeOID"&&h.name.toLowerCase()!=="value").map(h=>{const R=J(h);return R.name=e+h.name,R});l=l.concat(d)}return l}set renderingRule(e){let t=e;t&&t.rasterFunction&&(t=x.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("renderingRule",t)}readRenderingRule(e,t){const s=t.rasterFunctionInfos;return t.renderingRule||s&&s.length&&s[0].name!=="None"?this._isRFTJson(t.renderingRule)?x.fromJSON({rasterFunctionDefinition:t.renderingRule}):x.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}writeRenderingRule(e,t,s){const n=e.toJSON();n.rasterFunctionDefinition?t[s]=n.rasterFunctionDefinition:t[s]=n}readSpatialReference(e,t){const s=e||t.extent.spatialReference;return s?oe.fromJSON(s):null}readPixelType(e){return Ie.fromJSON(e)||e}writePixelType(e,t,s){(z(this.serviceRasterInfo)||this.pixelType!==this.serviceRasterInfo.pixelType)&&(t[s]=Ie.toJSON(e))}readVersion(e,t){let s=t.currentVersion;return s||(s=t.hasOwnProperty("fields")||t.hasOwnProperty("timeInfo")?10:9.3),s}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let s=e;const{renderer:n,symbolizer:l,pixelFilter:p,bandIds:m}=this;if(!this._isPicture()&&n&&l&&!p){const c=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(n.toJSON()),d=this._rasterJobHandler.instance;if(d){c&&(l.bind(),await d.updateSymbolizer(l,t),this._cachedRendererJson=n.toJSON());const h=await d.symbolize({bandIds:m,...e},t);s={extent:e.extent,pixelBlock:h}}else s={extent:e.extent,pixelBlock:l.symbolize({bandIds:m,...e})}}return s}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputeAngles)throw new L("imagery-layer:compute-angles","this operation is not supported on the input image service");return e=ne(Pi,e).clone(),xi(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputePixelLocation)throw new L("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return e=ne(Ci,e).clone(),Ii(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputeHistograms)throw new L("imagery-layer:compute-histograms","this operation is not supported on the input image service");e=ne(ke,e).clone();const{raster:s,mosaicRule:n,renderingRule:l}=this;return l&&e.renderingRule==null&&(e.renderingRule=l),n&&e.mosaicRule==null&&(e.mosaicRule=n),s&&e.raster==null&&(e.raster=s),Ti(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputeStatisticsHistograms)throw new L("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");e=ne(ke,e).clone();const{raster:s,mosaicRule:n,renderingRule:l}=this;return l&&e.renderingRule==null&&(e.renderingRule=l),n&&e.mosaicRule==null&&(e.mosaicRule=n),s&&e.raster==null&&(e.raster=s),Fi(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return I(t)?t.get(e):void 0}getFieldDomain(e,t){const s=this.getField(e);return s?s.domain:null}async fetchImage(e,t,s,n={}){var m,c,d,h,R;if(e==null||t==null||s==null)throw new L("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required.");if(this.renderer||this.symbolizer){const b=await this.generateRasterInfo(this.renderingRule,{signal:n.signal});b&&(this.rasterInfo=b)}const l=this.getExportImageServiceParameters(e,t,s,n.timeExtent);if(l==null){if(n.requestAsImageElement&&this._canRequestImageElement(this.format)){const T=document.createElement("canvas");return T.width=t,T.height=s,{imageOrCanvasElement:T}}const b=(d=((m=this.bandIds)==null?void 0:m.length)||((c=this.rasterInfo)==null?void 0:c.bandCount))!=null?d:0,y=t*s,g=(R=(h=this.rasterInfo)==null?void 0:h.pixelType)!=null?R:"unknown",F=[];for(let T=0;T=10.3?e==null?void 0:e.renderingRule:null})}).then(t=>t.data)}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new L("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):O(o(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e==null?void 0:e.renderingRule:null})}).then(t=>Ue.fromJSON(t.data))}getCatalogItemRasterInfo(e,t){const s={...t,query:this._getQueryParams()};return Ni(o(this.parsedUrl),e,s)}async getCatalogItemICSInfo(e,t){var Z,Je,Ee;const{data:s}=await O(o(this.parsedUrl)+"/"+e+"/info/ics",{query:this._getQueryParams(),...t}),n=s&&s.ics;if(!n)return;let l=null;try{l=(await O(o(this.parsedUrl)+"/"+e+"/info",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!l||!l.spatialReference)return{ics:n,icsToPixelTransform:null,icsExtent:null,northDirection:null};const p=this.version>=10.7?O(o(this.parsedUrl)+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...t}).then(S=>S.data).catch(()=>({})):{},m=l.spatialReference,c={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[l]}),inSR:m.wkid||JSON.stringify(m),outSR:"0:"+e},d=O(o(this.parsedUrl)+"/project",{query:this._getQueryParams(c),...t}).then(S=>S.data).catch(()=>({})),h=5,R=(l.xmin+l.xmax)/2,b=(l.ymax-l.ymin)/(h+1),y=l.ymin+b,g=[];for(let S=0;SS.data).catch(()=>({})),P=await Promise.all([p,d,T]);let f=P[0].ipxf;if(f==null){const S=(Z=n.geodataXform)==null?void 0:Z.xf_0;((Je=S==null?void 0:S.name)==null?void 0:Je.toLowerCase())==="topup"&&((Ee=S==null?void 0:S.coefficients)==null?void 0:Ee.length)===6&&(f={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:S.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const w=fe.fromJSON(P[1]&&P[1].geometries&&P[1].geometries[0]);w&&(w.spatialReference=new oe({wkid:0,imageCoordinateSystem:n}));const v=P[2].geometries?P[2].geometries.filter(S=>S!=null&&S.x!=null&&S.y!=null&&S.x!=="NaN"&&S.y!=="NaN"):[],D=v.length;if(D<3)return{ics:n,icsToPixelTransform:f,icsExtent:w,northDirection:null};let N=0,A=0,U=0,de=0;for(let S=0;Sv[0].x,re=v[h-1].y>v[0].y;return G===1/0?te=re?90:270:G===0?te=ie?0:180:G>0?te=ie?180*Math.atan(G)/Math.PI:180*Math.atan(G)/Math.PI+180:G<0&&(te=re?180+180*Math.atan(G)/Math.PI:360+180*Math.atan(G)/Math.PI),{ics:n,icsToPixelTransform:f,icsExtent:w,northDirection:te}}async generateRasterInfo(e,t){var l;if(this.serviceRasterInfo&&(!e||((l=e.functionName)==null?void 0:l.toLowerCase())==="none"||this._isVectorFieldResampleFunction(e)))return this.serviceRasterInfo;const s=ji(e);if(!s)return null;if(this._functionRasterInfos[s])return this._functionRasterInfos[s];const n=this._generateRasterInfo(e,t);this._functionRasterInfos[s]=n;try{return await n}catch{return this._functionRasterInfos[s]=null,null}}getExportImageServiceParameters(e,t,s,n){var F,T,P;e=e.clone().shiftCentralMeridian();const l=st(e.spatialReference,o(this.parsedUrl));this.pixelType!==((F=this.serviceRasterInfo)==null?void 0:F.pixelType)&&(this.exportImageServiceParameters.pixelType=this.pixelType);const p=this.exportImageServiceParameters.toJSON(),{bandIds:m,noData:c}=p;let{renderingRule:d}=p;const h=(T=this.renderingRule)==null?void 0:T.rasterFunctionDefinition,R=!this.renderer||this.renderer.type==="raster-stretch";if((m==null?void 0:m.length)&&this._hasRenderingRule(this.renderingRule)&&!h&&R){const f={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:m}};if(d.rasterFunction==="Stretch")f.rasterFunctionArguments.Raster=d.rasterFunctionArguments.Raster,d.rasterFunctionArguments.Raster=f;else if(d.rasterFunction==="Colormap"){const w=d.rasterFunctionArguments.Raster;(w==null?void 0:w.rasterFunction)==="Stretch"?(f.rasterFunctionArguments.Raster=w.rasterFunctionArguments.Raster,w.rasterFunctionArguments.Raster=f):(f.rasterFunctionArguments.Raster=w,d.rasterFunctionArguments.Raster=f)}else f.rasterFunctionArguments.Raster=d,d=f;p.bandIds=void 0}else p.bandIds=m==null?void 0:m.join(",");c instanceof Array&&c.length>0&&(p.noData=c.join(","));const b=this._serviceSupportsMosaicRule?this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,n):null;p.mosaicRule=I(b)?JSON.stringify(b):null;const{multidimensionalSubset:y}=this;if(y&&I(b)&&b.multidimensionalDefinition&&ze(b.multidimensionalDefinition,y,!0))return null;p.renderingRule=this._getRenderingRuleString(x.fromJSON(d));const g={};if(n){const{start:f,end:w}=n.toJSON();let v;if(f&&w&&f===w?(g.time=""+f,v=[f]):f==null&&w==null||(g.time=`${f!=null?f:"null"},${w!=null?w:"null"}`,v=f!=null&&w!=null?[f,w]:[f!=null?f:w]),v&&y){const D=y.dimensions.find(({name:A})=>A==="StdTime");if(v.length===2&&D.extent.length){if(v[0]=Math.max(v[0],D.extent[0]),v[1]=Math.min(v[1],(P=D.extent[1])!=null?P:D.extent[0]),v[1]!D.toLowerCase().includes(h)),this.version>=10.4)){const D=e.outFields.filter(A=>A.toLowerCase().includes(h)&&A.length>h.length).map(A=>{const U=A.slice(h.length+1);return[this._updateRenderingRulesFunctionName(U,R),U]});c=D.map(A=>new x({functionName:A[0]})),d=D.map(A=>A[1]);const{renderingRule:N}=this;c.length===0?N!=null&&N.functionName?(c.push(N),d.push(N.functionName)):c=null:(N==null?void 0:N.functionName)&&!c.some(A=>A.functionName===N.functionName)&&(c.push(N),d.push(N.functionName))}const b=z(e.outSpatialReference)||e.outSpatialReference.equals(this.spatialReference),y=e.timeExtent||this.timeExtent,g=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,y),F=this._getQueryParams({geometry:e.geometry,timeExtent:y,mosaicRule:g,renderingRule:this.version<10.4?this.renderingRule:null,renderingRules:c,pixelSize:s,returnCatalogItems:m,returnGeometry:b,raster:this.raster,maxItemCount:l?1:null});delete F.f;const T=new Qe(F);try{await this.generateRasterInfo(this.renderingRule);const D=await He(this.url,T,{signal:t==null?void 0:t.signal,query:{...this.customParameters}}),N=e.outFields,A=D.value!=null&&D.value.toLowerCase().includes("nodata");if(!(m&&!b&&((P=D==null?void 0:D.catalogItems)==null?void 0:P.features.length)&&(p||!A)))return this._processVisibleRastersResponse(D,{returnDomainValues:n,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:N});const U=this.objectIdField||"ObjectId",de=(w=(f=D.catalogItems)==null?void 0:f.features)!=null?w:[],G=de.map(re=>{var Z;return(Z=re.attributes)==null?void 0:Z[U]}),te=new we({objectIds:G,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[U]}),ie=await this.queryRasters(te);return(v=ie==null?void 0:ie.features)!=null&&v.length&&ie.features.forEach(re=>{de.forEach(Z=>{Z.attributes[U]===re.attributes[U]&&(Z.geometry=new ht(re.geometry),I(e.outSpatialReference)&&(Z.geometry.spatialReference=e.outSpatialReference))})}),this._processVisibleRastersResponse(D,{returnDomainValues:n,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:N})}catch{throw new L("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,t){const s=O(o(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:e}),signal:t}).then(p=>{var m;return(m=p.data)==null?void 0:m.statistics}),n=O(o(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:e}),signal:t}).then(p=>{var m;return(m=p.data)==null?void 0:m.histograms}),l=await Promise.all([s,n]);return l[0]&&l[0].forEach(p=>{p.avg=p.mean,p.stddev=p.standardDeviation}),{statistics:l[0]||null,histograms:l[1]||null}}async createFlowMesh(e,t){const s=this._rasterJobHandler.instance;return s?s.createFlowMesh(e,t):ei(e.meshType,e.simulationSettings,e.flowData,I(t.signal)?t.signal:new AbortController().signal)}getMultidimensionalSubsetVariables(e){const t=e!=null?e:this.multidimensionalInfo;return Ut(this.multidimensionalSubset,t)}async _fetchService(e){await this._fetchServiceInfo(e),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,s=I(this.serviceRasterInfo)?Promise.resolve(this.serviceRasterInfo):Et(o(this.parsedUrl),t,{signal:e,query:this._getQueryParams()}).then(p=>(this._set("serviceRasterInfo",p),p)),n=this._hasRenderingRule(this.renderingRule)?this.generateRasterInfo(this.renderingRule,{signal:e}):null,l=this._getRasterFunctionInfos();return Promise.all([s,n,l]).then(p=>{p[1]?this._set("rasterInfo",p[1]):this._set("rasterInfo",p[0]),p[2]&&this._set("rasterFunctionInfos",p[2]),this.renderer&&!this._isSupportedRenderer(this.renderer)&&(this._set("renderer",null),Le.getLogger(this.declaredClass).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("renderer",this._configRenderer(this.renderer)),this.addHandles([yt(()=>this.renderingRule,c=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this.generateRasterInfo(c).then(d=>{d&&(this.rasterInfo=d)})})]);const{serviceRasterInfo:m}=this;m&&I(m.multidimensionalInfo)&&this._updateMultidimensionalDefinition(m)})}_combineMosaicRuleWithTimeExtent(e,t){var b;const s=this.timeInfo;if(z(e)||z(this.multidimensionalInfo)||z(t)||z(s==null?void 0:s.startField))return e;const{startField:n}=s,l=this.multidimensionalInfo.variables.some(y=>y.dimensions.some(g=>g.name===n))?n:"StdTime";if(e=e.clone(),this.sourceType==="mosaic-dataset")return e.multidimensionalDefinition=(b=e.multidimensionalDefinition)==null?void 0:b.filter(y=>y.dimensionName!==l),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const p=e.multidimensionalDefinition.filter(y=>y.dimensionName===l),m=I(t.start)?t.start.getTime():null,c=I(t.end)?t.end.getTime():null,d=m==null||c==null||m===c,h=d?[m||c]:[[m,c]],R=this.version>=10.8;if(p.length)p.forEach(y=>{y.dimensionName===l&&(R?(y.dimensionName=null,y.isSlice=!1,y.values=[]):(y.isSlice=d,y.values=h))});else if(!R){const y=e.multidimensionalDefinition.filter(g=>g.variableName!=null&&g.dimensionName==null);y.length?y.forEach(g=>{g.dimensionName=l,g.isSlice=d,g.values=h}):e.multidimensionalDefinition.push(new Fe({variableName:"",dimensionName:l,isSlice:d,values:h}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return z(e)?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter(t=>!(!t.variableName&&!t.dimensionName)),e.multidimensionalDefinition.length===0&&(e.multidimensionalDefinition=null)),this.sourceType!=="mosaic-dataset"&&e.multidimensionalDefinition==null?null:e)}async _prepareForQuery(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsQuery)throw new L("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=I(e)?ne(we,e):this.createQuery(),t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:e,requestOptions:t}}async _initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const e=new Qt;this._rasterJobHandler.connectionPromise=e.initialize().then(()=>{this._rasterJobHandler.instance=e},()=>{}),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null}_isSupportedRenderer(e){const{rasterInfo:t,renderingRule:s}=this;return e.type==="unique-value"&&this._hasRenderingRule(s)&&(t==null?void 0:t.bandCount)===1&&["u8","s8"].includes(t.pixelType)||t!=null&&e!=null&&Lt(t).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){var s;let t=this.sourceJSON;if(!t){const{data:n,ssl:l}=await O(o(this.parsedUrl),{query:this._getQueryParams(),signal:e});t=n,this.sourceJSON=t,l&&(this.url=this.url.replace(/^http:/i,"https:"))}if(((s=t.capabilities)==null?void 0:s.toLowerCase().split(",").map(n=>n.trim()).indexOf("tilesonly"))>-1)throw new L("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(t,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){var t;return e.serviceSourceType?e.serviceSourceType==="esriImageServiceSourceTypeMosaicDataset":((t=e.fields)==null?void 0:t.length)>0}_isMosaicRuleSupported(e){var n;if(!e)return!1;const t=this._isMosaicDataset(e),s=e.currentVersion>=10.71&&e.hasMultidimensions&&!(((n=e.fields)==null?void 0:n.length)>1);return t||s}_isVectorFieldResampleFunction(e){if(z(e))return!1;const{functionName:t,functionArguments:s}=e,n=(t==null?void 0:t.toLowerCase())==="resample",l=(s==null?void 0:s.ResampleType)||(s==null?void 0:s.resampleType);return n&&(l===7||l===10)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){var t,s;if(!this._isPicture()&&!this.pixelFilter||this._isVectorDataSet()){if(!this.bandIds&&this.rasterInfo&&this.rasterInfo.bandCount>=3){const l=zt(this.rasterInfo);!l||this.rasterInfo.bandCount===3&&l[0]===0&&l[1]===1&&l[2]===2||(this.bandIds=l)}e||(e=qt(this.rasterInfo,{bandIds:this.bandIds,variableName:this.renderingRule?null:(s=(t=this.mosaicRule)==null?void 0:t.multidimensionalDefinition)==null?void 0:s[0].variableName}));const n=Ht(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=n,this.symbolizer.rasterInfo=this.rasterInfo):this.symbolizer=new Xt({rendererJSON:n,rasterInfo:this.rasterInfo}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return e==null?e:{extent:e.extent&&e.extent.clone(),pixelBlock:I(e.pixelBlock)?e.pixelBlock.clone():null}}_getQueryParams(e){e&&I(e.renderingRule)&&typeof e.renderingRule!="string"&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:t,viewId:s}=this;return{raster:t,viewId:s,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e==null?void 0:e.query,...this.customParameters}}}_decodePixelBlock(e,t,s){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:t}):qe(e,t,s)}async _getRasterFunctionInfos(e){var s;const t=this.sourceJSON.rasterFunctionInfos;return this.loaded?t:t&&this.version>=10.3?t.length===1&&t[0].name.toLowerCase()==="none"?t:(s=(await O(o(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e})).data)==null?void 0:s.rasterFunctionInfos:null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes("png"))}async _requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:s,signal:n}=e;if(s&&this._canRequestImageElement(t.format))return{imageOrCanvasElement:(await O(o(this.parsedUrl)+"/exportImage",{responseType:"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...e.imageServiceParameters}),signal:n})).data,params:t};const l=this._initJobHandler(),p=O(o(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:n}),m=(await Promise.all([p,l]))[0].data,c=t.format||"jpgpng";let d=c;if(d!=="bsq"&&d!=="bip"&&(d=Yt(m)),!d)throw new L("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(m)));const h={signal:n};return{pixelData:{pixelBlock:await(c==="gif"||c==="bmp"||c.includes("png")&&(d==="png"||d==="jpg")?qe(m,{useCanvas:!0,...t},h):this._decodePixelBlock(m,{width:t.width,height:t.height,planes:null,pixelType:null,noDataValue:null,format:c},h)),extent:t.extent},params:t}}_generateRasterInfo(e,t){const s={...t,query:this._getQueryParams()};return kt(o(this.parsedUrl),e,s)}_isValidCustomizedMosaicRule(e){var t;return e&&JSON.stringify(e.toJSON())!==JSON.stringify((t=this.defaultMosaicRule)==null?void 0:t.toJSON())}_updateMultidimensionalDefinition(e){var s;if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;const t=Gt(e,{multidimensionalSubset:this.multidimensionalSubset});if(I(t)&&t.length>0){this.mosaicRule=this.mosaicRule||new H;const n=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.renderingRule&&((s=this.renderingRule.functionName)==null?void 0:s.toLowerCase())!=="none"&&t.forEach(l=>l.variableName=""),(!n||n&&n.length<=0)&&(this.mosaicRule.multidimensionalDefinition=t)}}_processVisibleRastersResponse(e,t){var P;t=t||{};const s=e.value,{templateRRFunctionNames:n,showNoDataRecords:l,returnDomainValues:p,templateFields:m}=t,c=e.processedValues;let d=e.catalogItems&&e.catalogItems.features,h=e.properties&&e.properties.Values&&e.properties.Values.map(f=>f.replace(/ /gi,", "))||[];const R=this.objectIdField||"ObjectId",b=typeof s=="string"&&s.toLowerCase().includes("nodata"),y=[];if(s&&!d&&!b){const f={};f[R]=0,h=[s],d=[new gt(this.fullExtent,null,f)]}if(!d)return[];let g,F,T;this._updateResponseFieldNames(d,m),b&&!l&&(d=[]);for(let f=0;f0&&n&&n.length>0&&n.includes(this.renderingRule.functionName)?c[n.indexOf(this.renderingRule.functionName)]:s,F.toLowerCase()==="nodata"&&!l)continue;const w="Raster.ItemPixelValue",v="Raster.ServicePixelValue";g.attributes[w]=F,g.attributes[v]=T,this._updateFeatureWithMagDirValues(g,F);const D=this.fields&&this.fields.length>0;let N=this.renderingRule&&I((P=this.serviceRasterInfo)==null?void 0:P.attributeTable)?D?F:s:T;this.renderingRule||(N=D?F:s),this._updateFeatureWithRasterAttributeTableValues(g,N)}if(g.sourceLayer=g.layer=this,p&&this._updateFeatureWithDomainValues(g),n&&c&&n.length===c.length)for(let w=0;wh.name).filter(h=>h.toLowerCase()==="value"),m=p&&p[0];if(!m)return;const c=n.filter(h=>h.attributes[m]===(t!=null?parseInt(t,10):null));c&&c[0]&&l.forEach(h=>{const R=this._rasterAttributeTableFieldPrefix+h.name;e.attributes[R]=c[0].attributes[h.name]})}_updateFeatureWithMagDirValues(e,t){if(!this._isVectorDataSet())return;const s=t.split(/,\s*/).map(c=>parseFloat(c)),n=s.map(c=>[c]),l=s.map(c=>({minValue:c,maxValue:c,noDataValue:null})),p=new Se({height:1,width:1,pixelType:"f32",pixels:n,statistics:l});this.pixelFilter!=null&&this.pixelFilter({pixelBlock:p,extent:new fe(0,0,0,0,this.spatialReference)});const m=this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"?[p.pixels[0][0],p.pixels[1][0]]:ti([p.pixels[0][0],p.pixels[1][0]]);e.attributes["Raster.Magnitude"]=m[0],e.attributes["Raster.Direction"]=m[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter(s=>s.domain&&s.domain.type==="coded-value");t!=null&&t.forEach(s=>{const n=e.attributes[s.name];if(n!=null){const l=s.domain.codedValues.find(p=>p.code===n);l&&(e.attributes[s.name]=l.name)}})}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const s=this.fieldsIndex;z(s)||e.forEach(n=>{var l;if(n&&n.attributes)for(const p of t){const m=(l=s.get(p))==null?void 0:l.name;m&&m!==p&&(n.attributes[p]=n.attributes[m],delete n.attributes[m])}})}_getRenderingRuleString(e){var t;if(this._hasRenderingRule(e)){let s=e.toJSON();return s=(t=s.rasterFunctionDefinition)!=null?t:s,(s.thumbnail||s.thumbnailEx)&&(s.thumbnail=s.thumbnailEx=null),JSON.stringify(s)}return null}_hasRenderingRule(e){return e!=null&&e.functionName!=null&&e.functionName.toLowerCase()!=="none"}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if(e==="Raw")return e.replace("Raw","None");const s=e.toLowerCase().replace(/ /gi,"_");return t.has(s)?t.get(s):e}_isRFTJson(e){return e&&e.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"}_readCapabilities(e){const t=e.capabilities?e.capabilities.toLowerCase().split(",").map(h=>h.trim()):["image","catalog"],{currentVersion:s,advancedQueryCapabilities:n,maxRecordCount:l}=e,p=t.includes("image"),m=e.serviceDataType==="esriImageServiceDataTypeElevation",c=!!(e.spatialReference||e.extent&&e.extent.spatialReference),d=t.includes("edit");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:p,supportsExportImage:p,supportsIdentify:p,supportsMeasure:t.includes("mensuration")&&c,supportsDownload:t.includes("download"),supportsQuery:t.includes("catalog")&&e.fields&&e.fields.length>0,supportsGetSamples:s>=10.2&&p,supportsProject:s>=10.3&&p,supportsComputeStatisticsHistograms:s>=10.4&&p,supportsQueryBoundary:s>=10.6&&p,supportsCalculateVolume:s>=10.7&&m,supportsComputePixelLocation:s>=10.7&&t.includes("catalog"),supportsComputeAngles:s>=10.91,supportsAdd:d,supportsDelete:d,supportsEditing:d,supportsUpdate:d,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryTopFeatures:!1},query:{maxRecordCount:l,maxRecordCountFactor:void 0,supportsStatistics:!!(n!=null&&n.supportsStatistics),supportsOrderBy:!!(n!=null&&n.supportsOrderBy),supportsDistinct:!!(n!=null&&n.supportsDistinct),supportsPagination:!!(n!=null&&n.supportsPagination),supportsStandardizedQueriesOnly:!!(n!=null&&n.useStandardizedQueries),supportsPercentileStatistics:!!(n!=null&&n.supportsPercentileStatistics),supportsCentroid:!!(n!=null&&n.supportsReturningGeometryCentroid),supportsDistance:!!(n!=null&&n.supportsQueryWithDistance),supportsExtent:!!(n!=null&&n.supportsReturningQueryExtent),supportsGeometryProperties:!!(n!=null&&n.supportsReturningGeometryProperties),supportsHavingClause:!!(n!=null&&n.supportsHavingClause),supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!(n!=null&&n.supportsDefaultSR),supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}}}};function o(e){var t;return(t=e==null?void 0:e.path)!=null?t:""}return a([u()],i.prototype,"_functionRasterInfos",void 0),a([u()],i.prototype,"_rasterJobHandler",void 0),a([u()],i.prototype,"_cachedRendererJson",void 0),a([u({readOnly:!0})],i.prototype,"_serviceSupportsMosaicRule",void 0),a([M("_serviceSupportsMosaicRule",["currentVersion","fields"])],i.prototype,"readServiceSupportsMosaicRule",null),a([u()],i.prototype,"_rasterAttributeTableFieldPrefix",void 0),a([u({readOnly:!0})],i.prototype,"_rasterFunctionNamesIndex",null),a([u()],i.prototype,"adjustAspectRatio",void 0),a([u({type:[pe],json:{write:!0}})],i.prototype,"bandIds",void 0),a([M("bandIds")],i.prototype,"readBandIds",null),a([u({readOnly:!0,json:{read:!1}})],i.prototype,"capabilities",void 0),a([M("service","capabilities",["capabilities","currentVersion","serviceDataType"])],i.prototype,"readCapabilities",null),a([u({type:Number})],i.prototype,"compressionQuality",void 0),a([V("compressionQuality")],i.prototype,"writeCompressionQuality",null),a([u({type:Number})],i.prototype,"compressionTolerance",void 0),a([V("compressionTolerance")],i.prototype,"writeCompressionTolerance",null),a([u({json:{read:{source:"copyrightText"}}})],i.prototype,"copyright",void 0),a([u({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],i.prototype,"defaultMosaicRule",void 0),a([M("defaultMosaicRule",["defaultMosaicMethod"])],i.prototype,"readDefaultMosaicRule",null),a([u({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),a([u({readOnly:!0,constructOnly:!0})],i.prototype,"exportImageServiceParameters",void 0),a([u()],i.prototype,"rasterInfo",void 0),a([u({readOnly:!0,type:[se]})],i.prototype,"fields",void 0),a([u({readOnly:!0})],i.prototype,"fieldsIndex",null),a([u({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"],json:{write:!0}})],i.prototype,"format",null),a([M("service","format",["serviceDataType"])],i.prototype,"readFormat",null),a([u({type:fe})],i.prototype,"fullExtent",void 0),a([u({readOnly:!0})],i.prototype,"hasMultidimensions",void 0),a([u({json:{read:{source:"maxImageHeight"}}})],i.prototype,"imageMaxHeight",void 0),a([u({json:{read:{source:"maxImageWidth"}}})],i.prototype,"imageMaxWidth",void 0),a([u({type:String,json:{type:Y.jsonValues,read:Y.read,write:Y.write}})],i.prototype,"interpolation",void 0),a([u()],i.prototype,"minScale",void 0),a([M("service","minScale")],i.prototype,"readMinScale",null),a([u()],i.prototype,"maxScale",void 0),a([M("service","maxScale")],i.prototype,"readMaxScale",null),a([u({type:H})],i.prototype,"mosaicRule",null),a([M("mosaicRule",["mosaicRule","defaultMosaicMethod"])],i.prototype,"readMosaicRule",null),a([V("mosaicRule")],i.prototype,"writeMosaicRule",null),a([u()],i.prototype,"multidimensionalInfo",null),a([u({type:Mt,json:{write:!0}})],i.prototype,"multidimensionalSubset",void 0),a([u({json:{type:pe}})],i.prototype,"noData",void 0),a([V("noData")],i.prototype,"writeNoData",null),a([u({type:String,json:{type:ye.jsonValues,read:ye.read,write:ye.write}})],i.prototype,"noDataInterpretation",void 0),a([u({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],i.prototype,"objectIdField",void 0),a([M("objectIdField")],i.prototype,"readObjectIdField",null),a([u({})],i.prototype,"geometryType",void 0),a([u({})],i.prototype,"typeIdField",void 0),a([u({})],i.prototype,"types",void 0),a([u({readOnly:!0})],i.prototype,"parsedUrl",null),a([u({type:Function})],i.prototype,"pixelFilter",void 0),a([u()],i.prototype,"raster",void 0),a([u({readOnly:!0})],i.prototype,"sourceType",void 0),a([M("sourceType",["serviceSourceType","fields"])],i.prototype,"readSourceType",null),a([u()],i.prototype,"viewId",void 0),a([u({types:At,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:$t,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],i.prototype,"renderer",null),a([M("renderer")],i.prototype,"readRenderer",null),a([V("renderer")],i.prototype,"writeRenderer",null),a([u()],i.prototype,"symbolizer",void 0),a([u(lt)],i.prototype,"opacity",void 0),a([u({readOnly:!0})],i.prototype,"rasterFields",null),a([u({constructOnly:!0})],i.prototype,"rasterFunctionInfos",void 0),a([u({type:x})],i.prototype,"renderingRule",null),a([M("renderingRule",["renderingRule","rasterFunctionInfos"])],i.prototype,"readRenderingRule",null),a([V("renderingRule")],i.prototype,"writeRenderingRule",null),a([u()],i.prototype,"serviceDataType",void 0),a([u({readOnly:!0,type:oe})],i.prototype,"spatialReference",void 0),a([M("spatialReference",["spatialReference","extent"])],i.prototype,"readSpatialReference",null),a([u({json:{type:Ie.jsonValues}})],i.prototype,"pixelType",void 0),a([M("pixelType")],i.prototype,"readPixelType",null),a([V("pixelType")],i.prototype,"writePixelType",null),a([u({constructOnly:!0,type:Ke})],i.prototype,"serviceRasterInfo",void 0),a([u()],i.prototype,"sourceJSON",void 0),a([u(ut)],i.prototype,"url",void 0),a([u({readOnly:!0})],i.prototype,"version",void 0),a([M("version",["currentVersion","fields","timeInfo"])],i.prototype,"readVersion",null),i=a([E("esri.layers.mixins.ArcGISImageService")],i),i};let q=class extends bt(vt(wt(St(xt(Mi(It(Ft(Tt(Dt(jt)))))))))){constructor(...r){super(...r),this.legendEnabled=!0,this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery"}normalizeCtorArgs(r,i){return typeof r=="string"?{url:r,...i}:r}load(r){const i=I(r)?r.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},r).catch(Nt).then(()=>this._fetchService(i))),Promise.resolve(this)}writeOperationalLayerType(r,i,o){var t;const e=((t=this.renderer)==null?void 0:t.type)==="vector-field";i[o]=e?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(r){const i=this.rasterFields,o=this.title,e=new Set;let t=!1,s=!1;this.capabilities&&(t=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,s=this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir");const n=new Set;t&&n.add("raster.itempixelvalue");for(const l of i){const p=l.name.toLowerCase();n.has(p)||p.includes("raster.servicepixelvalue.")||e.add(l.name)}return s&&e.add("raster.magnitude").add("raster.direction"),Pt({fields:i,title:o},{...r,visibleFieldNames:e})}queryFeatures(r,i){return this.queryRasters(r,i).then(o=>{if(o!=null&&o.features)for(const e of o.features)e.layer=e.sourceLayer=this;return o})}queryFeatureCount(r,i){return this.queryRasterCount(r,i)}redraw(){this.emit("redraw")}serviceSupportsSpatialReference(r){return Ct(this,r)}};a([u(_t)],q.prototype,"legendEnabled",void 0),a([u({type:["show","hide"]})],q.prototype,"listMode",void 0),a([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],q.prototype,"isReference",void 0),a([u({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],q.prototype,"operationalLayerType",void 0),a([V("web-map","operationalLayerType")],q.prototype,"writeOperationalLayerType",null),a([u(Ot)],q.prototype,"popupEnabled",void 0),a([u({type:Vt,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],q.prototype,"popupTemplate",void 0),a([u({readOnly:!0})],q.prototype,"defaultPopupTemplate",null),a([u({readOnly:!0,json:{read:!1}})],q.prototype,"type",void 0),q=a([E("esri.layers.ImageryLayer")],q);const Qi=q;export{Qi as default}; +import{b4 as J,iX as nt,j as z,ef as Ve,a6 as a,a7 as u,d2 as M,h0 as pe,cw as at,af as X,a8 as E,cx as k,e0 as V,aT as oe,d3 as Ue,c as I,dQ as ee,e3 as ce,e4 as me,U as O,e2 as je,cU as fe,dZ as Ge,c9 as Be,d_ as Me,aA as Ae,cR as ot,gG as se,iS as lt,eK as ut,ci as pt,bX as ct,s as Le,n as L,d$ as ne,u as mt,dd as we,iY as dt,az as ht,_ as yt,d1 as gt,iZ as ft,iB as Rt,i2 as bt,iM as vt,i3 as wt,eF as St,eG as xt,ia as It,iJ as Ft,eE as Tt,eH as Dt,aU as Nt,id as Pt,i_ as Ct,iE as _t,ig as Ot,dv as Vt,cF as jt}from"./index.221827cd.js";import{w as x,o as Y,i as ye,c as Mt,l as At,a as $t,u as Jt,m as Et,k as Lt,L as zt,j as qt,$ as Ht,f as kt,n as Qt}from"./fetchRasterInfo.3f6af61b.js";import{p as Fe,m as ze,d as Ut,c as Gt}from"./multidimensionalUtils.59c05ac5.js";import{_ as We,h as Ze,n as Bt,f as Wt,k as Zt,b as Kt,e as Ke,T as Xt,S as qe,P as Yt}from"./RasterSymbolizer.093b1748.js";import{g as Se}from"./pixelUtils.9c6f8dae.js";import{f as ei,b as ti}from"./dataUtils.e7623e56.js";import{s as ii,n as ri}from"./executeForIds.9f78e2a6.js";import"./generateRendererUtils.5c972fdb.js";import"./colorUtils.bb6424b7.js";const si={StretchFunction:{arguments:{ComputeGamma:{isDataset:!1,isPublic:!1,name:"ComputeGamma",type:"RasterFunctionVariable",value:!1},DRA:{isDataset:!1,isPublic:!1,name:"DRA",type:"RasterFunctionVariable",value:!1},EstimateStatsHistogram:{isDataset:!1,isPublic:!1,name:"EstimateStatsHistogram",type:"RasterFunctionVariable",value:!1},Gamma:{displayName:"Gamma",isDataset:!1,isPublic:!1,name:"Gamma",type:"RasterFunctionVariable"},Histograms:{isDataset:!1,isPublic:!1,name:"Histograms",type:"RasterFunctionVariable"},Max:{isDataset:!1,isPublic:!1,name:"Max",type:"RasterFunctionVariable",value:255},MaxPercent:{isDataset:!1,isPublic:!1,name:"MaxPercent",type:"RasterFunctionVariable",value:.5},Min:{isDataset:!1,isPublic:!1,name:"Min",type:"RasterFunctionVariable",value:0},MinPercent:{isDataset:!1,isPublic:!1,name:"MinPercent",type:"RasterFunctionVariable",value:.25},NumberOfStandardDeviations:{isDataset:!1,isPublic:!1,name:"NumberOfStandardDeviation",type:"RasterFunctionVariable",value:2},Raster:{isDataset:!0,isPublic:!1,name:"Raster",type:"RasterFunctionVariable"},SigmoidStrengthLevel:{isDataset:!1,isPublic:!1,name:"SigmoidStrengthLevel",type:"RasterFunctionVariable",value:2},Statistics:{isDataset:!1,isPublic:!1,name:"Statistics",type:"RasterFunctionVariable"},StretchType:{isDataset:!1,isPublic:!1,name:"StretchType",type:"RasterFunctionVariable",value:0},type:"StretchFunctionArguments",UseGamma:{isDataset:!1,isPublic:!1,name:"UseGamma",type:"RasterFunctionVariable",value:!1}},description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",function:{description:"Enhances an image by adjusting the range of values displayed. This does not alter the underlying pixel values. If a pixel has a value outside of the specified range, it will appear as either the minimum or maximum value.",name:"Stretch",pixelType:"UNKNOWN",type:"StretchFunction"},functionType:0,name:"Stretch",thumbnail:""},RemapFunction:{name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table.",function:{type:"RemapFunction",pixelType:"UNKNOWN",name:"Remap",description:"Changes pixel values by assigning new values to ranges of pixel values or using an external table."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},UseTable:{name:"UseTable",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},InputRanges:{name:"InputRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Input Ranges"},OutputValues:{name:"OutputValues",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"Output Values"},NoDataRanges:{name:"NoDataRanges",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable",displayName:"NoData Ranges"},Table:{name:"Table",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputField:{name:"InputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},OutputField:{name:"OutputField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},InputMaxField:{name:"InputMaxField",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},RemapTableType:{name:"RemapTableType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},AllowUnmatched:{name:"AllowUnmatched",isPublic:!1,isDataset:!1,value:!0,type:"RasterFunctionVariable"},type:"RemapFunctionArguments"},functionType:0,thumbnail:""},ColormapFunction:{name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp.",function:{type:"ColormapFunction",pixelType:"UNKNOWN",name:"Colormap",description:"Changes pixel values to display the raster data as either a grayscale or a red, green, blue (RGB) image, based on a colormap or a color ramp."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},ColormapName:{name:"ColormapName",isPublic:!1,isDataset:!1,value:"Gray",type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},type:"ColormapFunctionArguments"},functionType:0,thumbnail:""},ShadedReliefFunction:{name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image.",function:{type:"ShadedReliefFunction",pixelType:"UNKNOWN",name:"Shaded Relief",description:"Creates a multiband, color coded, 3D representation of the surface, with the sun's relative position taken into account for shading the image."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ColorSchemeType:{name:"ColorSchemeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ColorRamp:{name:"ColorRamp",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Colormap:{name:"Colormap",isPublic:!1,isDataset:!1,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"ShadedReliefFunctionArguments"},functionType:0,thumbnail:""},HillshadeFunction:{name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image",function:{type:"HillshadeFunction",pixelType:"UNKNOWN",name:"Hillshade",description:"Creates a 3D representation of the surface, with the sun's relative position taken into account for shading the image"},arguments:{DEM:{name:"DEM",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},HillshadeType:{name:"HillshadeType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},Azimuth:{name:"Azimuth",isPublic:!1,isDataset:!1,value:315,type:"RasterFunctionVariable"},Altitude:{name:"Altitude",isPublic:!1,isDataset:!1,value:45,type:"RasterFunctionVariable"},SlopeType:{name:"SlopeType",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},ZFactor:{name:"ZFactor",isPublic:!1,isDataset:!1,value:1,type:"RasterFunctionVariable"},PSPower:{name:"PSPower",isPublic:!1,isDataset:!1,value:.664,type:"RasterFunctionVariable"},PSZFactor:{name:"PSZFactor",isPublic:!1,isDataset:!1,value:.024,type:"RasterFunctionVariable"},RemoveEdgeEffect:{name:"RemoveEdgeEffect",isPublic:!1,isDataset:!1,value:!1,type:"RasterFunctionVariable"},type:"HillshadeFunctionArguments"},functionType:0,thumbnail:""},ResampleFunction:{name:"Resample",description:"Changes the cell size of a raster.",function:{type:"ResampleFunction",pixelType:"UNKNOWN",name:"Resample",description:"Changes the cell size of a raster."},arguments:{Raster:{name:"Raster",isPublic:!1,isDataset:!0,type:"RasterFunctionVariable"},ResamplingType:{name:"ResamplingType",isPublic:!1,isDataset:!1,value:0,type:"RasterFunctionVariable"},InputCellSize:{name:"InputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},OutputCellSize:{name:"OutputCellsize",isPublic:!1,isDataset:!1,value:{x:0,y:0},type:"RasterFunctionVariable"},type:"ResampleFunctionArguments"},functionType:0,thumbnail:""}},ni={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767]},ai={simple_scalar:"Simple Scalar",wind_barb:"Wind Barb",single_arrow:"Single Arrow",beaufort_kn:"Beaufort Wind (Knots)",beaufort_m:"Beaufort Wind (MetersPerSecond)",ocean_current_m:"Ocean Current (MetersPerSecond)",ocean_current_kn:"Ocean Current (Knots)"},oi=new Set(["raster-stretch","unique-value","class-breaks","raster-shaded-relief","vector-field","raster-colormap"]);function Xe(r){return oi.has(r.type)}function xe(r,i){if(!r||!i)return J(r||i);const o=J(r);if(i.rasterFunctionDefinition){const e=i.rasterFunctionDefinition;(e.thumbnail||e.thumbnailEx)&&(e.thumbnail=e.thumbnailEx=null),Ye(o.rasterFunctionDefinition.arguments,i)}else i.functionName.toLowerCase()!=="none"&&(et(o.functionArguments).Raster=i);return o}function Ye(r,i){for(const o in r)o.toLowerCase()==="raster"&&(r[o].type==="RasterFunctionVariable"?(r[o]=i.rasterFunctionDefinition,r[o].type="RasterFunctionTemplate"):r[o].type==="RasterFunctionTemplate"&&Ye(r[o].arguments,i))}function W(r){const i=J(si[r.functionName+"Function"]),o=r.functionArguments;for(const e in o)e.toLowerCase()==="raster"?(i.arguments[e]=W(o[e]),i.arguments[e].type="RasterFunctionTemplate"):e.toLowerCase()==="colormap"?(i.arguments[e].value=gi(o[e]),i.arguments.ColorSchemeType.value=0):i.arguments[e].value=o[e];return i}function li(r,i){switch(i=i||{},r.type){case"raster-stretch":return ci(r,i);case"class-breaks":return mi(r,i);case"unique-value":return di(r,i);case"raster-colormap":return hi(r,i);case"vector-field":return ui(r,i);case"raster-shaded-relief":return pi(r,i);case"flow":throw new Error("Unsupported rendering rule.")}}function et(r){const i=r==null?void 0:r.Raster;return i&&i.declaredClass==="esri.layers.support.RasterFunction"?et(i.functionArguments):r}const he={none:0,standardDeviation:3,histogramEqualization:4,minMax:5,percentClip:6,sigmoid:9};function ui(r,i){const o=new x;o.functionName="VectorFieldRenderer";const{dataType:e,bandProperties:t}=i,s=e==="vector-uv";let n,l;t&&t.length===2&&(n=t.map(h=>h.BandName.toLowerCase()).indexOf("magnitude"),l=t.map(h=>h.BandName.toLowerCase()).indexOf("direction")),n!==-1&&n!==null||(n=0,l=1);const p=r.rotationType==="arithmetic"?1:2,m=r.flowRepresentation==="flow-from"?0:1,c=r.visualVariables?r.visualVariables.find(h=>h.field==="Magnitude"):new nt,d={magnitudeBandID:n,directionBandID:l,isUVComponents:s,referenceSystem:p,massFlowAngleRepresentation:m,symbolTileSize:50,symbolTileSizeUnits:100,calculationMethod:"Vector Average",symbologyName:ai[r.style.toLowerCase().replace("-","_")],minimumMagnitude:c.minDataValue,maximumMagnitude:c.maxDataValue,minimumSymbolSize:c.minSize,maximumSymbolSize:c.maxSize};return o.functionArguments=d,i.convertToRFT?new x({rasterFunctionDefinition:W(o)}):o}function pi(r,i){const o=i.convertToRFT;if(i.dataType!=="elevation"&&(i.dataType!=="generic"||i.bandCount!==1||i.pixelType!=="s16"&&i.pixelType!=="s32"&&i.pixelType!=="f32"&&i.pixelType!=="f64"))return new x;const e=new x;e.functionName="Hillshade";const t=r.hillshadeType==="traditional"?0:1,s=r.scalingType==="none"?1:3,n={HillshadeType:t,SlopeType:s,ZFactor:r.zFactor};return t===0&&(n.Azimuth=r.azimuth,n.Altitude=r.altitude),s===3&&(n.PSPower=r.pixelSizePower,n.PSZFactor=r.pixelSizeFactor),e.functionArguments=n,e.variableName="Raster",r.colorRamp&&(e.functionName="ShadedRelief",o?n.ColorRamp=We(r.colorRamp):n.Colormap=Ze(r.colorRamp,256)),o?new x({rasterFunctionDefinition:W(e)}):e}function ci(r,i){var l;const o=i.convertToRFT,e=new x;e.functionName="Stretch";const t=he[Bt.toJSON(r.stretchType)],s="u8",n={StretchType:t,Statistics:yi(r.statistics),DRA:r.dynamicRangeAdjustment,UseGamma:r.useGamma,Gamma:r.gamma,ComputeGamma:r.computeGamma};if(r.outputMin!=null&&(n.Min=r.outputMin),r.outputMax!=null&&(n.Max=r.outputMax),t===he.standardDeviation?(n.NumberOfStandardDeviations=r.numberOfStandardDeviations,e.outputPixelType=s):t===he.percentClip?(n.MinPercent=r.minPercent,n.MaxPercent=r.maxPercent,e.outputPixelType=s):t===he.minMax?e.outputPixelType=s:t===he.sigmoid&&(n.SigmoidStrengthLevel=r.sigmoidStrengthLevel),e.functionArguments=n,e.variableName="Raster",r.colorRamp){const p=r.colorRamp,m=new x;if(o)m.functionArguments={ColorRamp:We(p)};else{const c=Wt(p);if(c)m.functionArguments={colorRamp:c};else if(!i.convertColorRampToColormap||p.type!=="algorithmic"&&p.type!=="multipart"){const d=r.colorRamp.toJSON();d.type==="algorithmic"?d.algorithm=d.algorithm||"esriCIELabAlgorithm":d.type==="multipart"&&((l=d.colorRamps)==null?void 0:l.length)&&d.colorRamps.forEach(h=>h.algorithm=h.algorithm||"esriCIELabAlgorithm"),m.functionArguments={colorRamp:d}}else m.functionArguments={Colormap:Ze(p,256)}}return m.variableName="Raster",m.functionName="Colormap",m.functionArguments.Raster=e,o?new x({rasterFunctionDefinition:W(m)}):m}return o?new x({rasterFunctionDefinition:W(e)}):e}function mi(r,i){const o=[],e=[],t=[],s=[],{pixelType:l,rasterAttributeTable:p}=i,m=z(p)?null:p.features,c=tt(p);if(m&&Array.isArray(m)&&r.classBreakInfos){r.classBreakInfos.forEach((g,F)=>{const T=g.symbol.color;let P;T.a&&m.forEach(f=>{P=f.attributes[r.field],(P>=g.minValue&&P=g.minValue)&&s.push([f.attributes[c],T.r,T.g,T.b])})});const b=l?ve(s,l):s,y=new x;return y.functionName="Colormap",y.functionArguments={},y.functionArguments.Colormap=b,y.variableName="Raster",i.convertToRFT?new x({rasterFunctionDefinition:W(y)}):y}r.classBreakInfos.forEach((b,y)=>{const g=b.symbol&&b.symbol.color;g.a?(y===0?o.push(b.minValue,b.maxValue+1e-6):o.push(b.minValue+1e-6,b.maxValue+1e-6),e.push(y),s.push([y,g.r,g.g,g.b])):t.push(b.minValue,b.maxValue)});const d=l?ve(s,l):s,h=new x;h.functionName="Remap",h.functionArguments={InputRanges:o,OutputValues:e,NoDataRanges:t},h.variableName="Raster";const R=new x;return R.functionName="Colormap",R.functionArguments={Colormap:d,Raster:h},i.convertToRFT?new x({rasterFunctionDefinition:W(R)}):R}function ve(r,i){const o=ni[String(i).toLowerCase()];return o&&r.push([Math.floor(o[0]-1),0,0,0],[Math.ceil(o[1]+1),0,0,0]),r}function tt(r){if(z(r))return;const{fields:i}=r,o=i&&i.find(e=>e&&e.name&&e.name.toLowerCase()==="value");return o&&o.name}function di(r,i){var d,h;const o=[],{pixelType:e,rasterAttributeTable:t}=i,s=z(t)?null:t.features,n=tt(t),l=(h=(d=r.defaultSymbol)==null?void 0:d.color)==null?void 0:h.toRgb(),p=r.uniqueValueInfos;if(p)if(s){const R=new Map;p.forEach(y=>{const g=y.value,F=y.symbol.color;g!=null&&F&&F.a&&R.set(String(g),F.toRgb())});const b=r.field;s.forEach(({attributes:y})=>{const g=String(y[b]),F=y[n];if(R.has(g)){const T=R.get(g);o.push([F,...T])}else l&&o.push([F,...l])})}else for(let R=0;R0?ve(o,e):o,c=new x;return c.functionName="Colormap",c.functionArguments={},c.functionArguments.Colormap=m,c.variableName="Raster",i.convertToRFT?new x({rasterFunctionDefinition:W(c)}):c}function hi(r,i){const o=r.extractColormap();if(!o||o.length===0)return;const{pixelType:e}=i,t=e?ve(o,e):o,s=new x;return s.functionName="Colormap",s.functionArguments={},s.functionArguments.Colormap=t,i.convertToRFT?new x({rasterFunctionDefinition:W(s)}):s}function yi(r){const i=[];return r.forEach(o=>{const e=o;if(Array.isArray(e))i.push(e);else{if(e.min==null||e.max==null)return;const t=[e.min,e.max,e.avg||0,e.stddev||0];i.push(t)}}),i}function gi(r){const i=[],o=[];return r.forEach(e=>{i.push(e[0]),o.push(Zt([...e.slice(1),255]))}),{type:"RasterColormap",values:i,colors:o}}var Te;const ge=Ve()({MT_FIRST:"first",MT_LAST:"last",MT_MIN:"min",MT_MAX:"max",MT_MEAN:"mean",MT_BLEND:"blend",MT_SUM:"sum"}),De=Ve()({esriMosaicNone:"none",esriMosaicCenter:"center",esriMosaicNadir:"nadir",esriMosaicViewpoint:"viewpoint",esriMosaicAttribute:"attribute",esriMosaicLockRaster:"lock-raster",esriMosaicNorthwest:"northwest",esriMosaicSeamline:"seamline"});function fi(r){let i;switch(r?r.toLowerCase().replace("esrimosaic",""):""){case"byattribute":case"attribute":i="esriMosaicAttribute";break;case"lockraster":i="esriMosaicLockRaster";break;case"center":i="esriMosaicCenter";break;case"northwest":i="esriMosaicNorthwest";break;case"nadir":i="esriMosaicNadir";break;case"viewpoint":i="esriMosaicViewpoint";break;case"seamline":i="esriMosaicSeamline";break;default:i="esriMosaicNone"}return De.fromJSON(i)}let j=Te=class extends k{constructor(r){super(r),this.ascending=!0,this.itemRenderingRule=null,this.lockRasterIds=null,this.method=null,this.multidimensionalDefinition=null,this.objectIds=null,this.operation=null,this.sortField=null,this.sortValue=null,this.viewpoint=null,this.where=null}readAscending(r,i){return i.ascending!=null?i.ascending:i.sortAscending==null||i.sortAscending}readMethod(r,i){return fi(i.mosaicMethod||i.defaultMosaicMethod)}readOperation(r,i){const o=i.mosaicOperation,e=i.mosaicOperator&&i.mosaicOperator.toLowerCase(),t=o||(e?ge.toJSON(e):null);return ge.fromJSON(t)||"first"}castSortValue(r){return r==null||typeof r=="string"||typeof r=="number"?r:`${r}`}clone(){return new Te({ascending:this.ascending,itemRenderingRule:J(this.itemRenderingRule),lockRasterIds:J(this.lockRasterIds),method:this.method,multidimensionalDefinition:J(this.multidimensionalDefinition),objectIds:J(this.objectIds),operation:this.operation,sortField:this.sortField,sortValue:this.sortValue,viewpoint:J(this.viewpoint),where:this.where})}};a([u({type:Boolean,json:{write:!0}})],j.prototype,"ascending",void 0),a([M("ascending",["ascending","sortAscending"])],j.prototype,"readAscending",null),a([u({type:x,json:{write:!0}})],j.prototype,"itemRenderingRule",void 0),a([u({type:[pe],json:{write:{overridePolicy(){return{enabled:this.method==="lock-raster"}}}}})],j.prototype,"lockRasterIds",void 0),a([u({type:String,json:{type:De.jsonValues,write:{target:"mosaicMethod",writer:De.write}}})],j.prototype,"method",void 0),a([M("method",["mosaicMethod","defaultMosaicMethod"])],j.prototype,"readMethod",null),a([u({type:[Fe],json:{write:!0}})],j.prototype,"multidimensionalDefinition",void 0),a([u({type:[pe],json:{name:"fids",write:!0}})],j.prototype,"objectIds",void 0),a([u({json:{type:ge.jsonValues,read:{reader:ge.read},write:{target:"mosaicOperation",writer:ge.write}}})],j.prototype,"operation",void 0),a([M("operation",["mosaicOperation","mosaicOperator"])],j.prototype,"readOperation",null),a([u({type:String,json:{write:{overridePolicy(){return{enabled:this.method==="attribute"}}}}})],j.prototype,"sortField",void 0),a([u({type:[String,Number],json:{write:{allowNull:!0,overridePolicy(){return{enabled:this.method==="attribute",allowNull:!0}}}}})],j.prototype,"sortValue",void 0),a([at("sortValue")],j.prototype,"castSortValue",null),a([u({type:X,json:{write:!0}})],j.prototype,"viewpoint",void 0),a([u({type:String,json:{write:!0}})],j.prototype,"where",void 0),j=Te=a([E("esri.layers.support.MosaicRule")],j);const H=j;let C=class extends k{constructor(){super(...arguments),this.layer=null,this.adjustAspectRatio=void 0,this.compression=void 0,this.pixelType=void 0,this.lercVersion=2}writeAdjustAspectRatio(r,i,o){this.layer.version<10.3||(i[o]=r)}get bandIds(){return this.layer.bandIds}set bandIds(r){this.layer&&(this.layer.bandIds=r)}get compressionQuality(){var r;return(r=this.layer)==null?void 0:r.compressionQuality}set compressionQuality(r){this.layer&&(this.layer.compressionQuality=r)}writeCompressionQuality(r,i,o){this.format&&this.format.toLowerCase().includes("jpg")&&r!=null&&(i[o]=r)}get compressionTolerance(){var r;return(r=this.layer)==null?void 0:r.compressionTolerance}set compressionTolerance(r){this.layer&&(this.layer.compressionTolerance=r)}writeCompressionTolerance(r,i,o){this.format==="lerc"&&r!=null&&(i[o]=r)}get format(){var r;return((r=this.layer.renderer)==null?void 0:r.type)==="vector-field"?"lerc":this.layer.format}get interpolation(){var r;return(r=this.layer)==null?void 0:r.interpolation}set interpolation(r){this.layer&&(this.layer.interpolation=r)}get noData(){var r;return(r=this.layer)==null?void 0:r.noData}set noData(r){this.layer&&(this.layer.noData=r)}get noDataInterpretation(){var r;return(r=this.layer)==null?void 0:r.noDataInterpretation}set noDataInterpretation(r){this.layer&&(this.layer.noDataInterpretation=r)}writeLercVersion(r,i,o){this.format==="lerc"&&this.layer.version>=10.5&&(i[o]=r)}get version(){const r=this.layer;return r.commitProperty("bandIds"),r.commitProperty("format"),r.commitProperty("compressionQuality"),r.commitProperty("compressionTolerance"),r.commitProperty("interpolation"),r.commitProperty("noData"),r.commitProperty("noDataInterpretation"),r.commitProperty("mosaicRule"),r.commitProperty("renderingRule"),r.commitProperty("adjustAspectRatio"),r.commitProperty("pixelFilter"),r.commitProperty("definitionExpression"),r.commitProperty("multidimensionalSubset"),(this._get("version")||0)+1}set version(r){this._set("version",r)}get mosaicRule(){const r=this.layer;let i=r.mosaicRule;const o=r.definitionExpression;return i?o&&o!==i.where&&(i=i.clone(),i.where=o):o&&(i=new H({where:o})),i}get renderingRule(){var s,n;const r=this.layer;let i=r.renderingRule;const o=r.pixelFilter,e=!r.format||r.format.includes("jpg")||r.format.includes("png");i=this._addResampleRasterFunction(i);const t=(s=r.multidimensionalSubset)==null?void 0:s.areaOfInterest;return t&&(i=this._addClipFunction(i,t)),e&&!o&&((n=r.renderer)==null?void 0:n.type)!=="vector-field"&&(i=this.combineRendererWithRenderingRule(i)),i}combineRendererWithRenderingRule(r){var t;const i=this.layer,{rasterInfo:o,renderer:e}=i;return r=r||i.renderingRule,!e||!Xe(e)?r:xe(li(e,{rasterAttributeTable:o.attributeTable,pixelType:o.pixelType,dataType:o.dataType,bandProperties:(t=o.keyProperties)==null?void 0:t.BandProperties,convertColorRampToColormap:i.version<10.6,convertToRFT:!!(r!=null&&r.rasterFunctionDefinition),bandCount:o.bandCount}),r)}_addResampleRasterFunction(r){var t;if(((t=this.layer.renderer)==null?void 0:t.type)!=="vector-field"||(r==null?void 0:r.functionName)==="Resample")return r;const i=this.layer.serviceDataType==="esriImageServiceDataTypeVector-UV"?7:10,o=this.layer.serviceRasterInfo.pixelSize;let e=new x({functionName:"Resample",functionArguments:{ResamplingType:i,InputCellSize:o}});return e=r!=null&&r.rasterFunctionDefinition?new x({rasterFunctionDefinition:W(e)}):e,xe(e,r)}_addClipFunction(r,i){const o=new x({functionName:"Clip",functionArguments:{ClippingGeometry:i.toJSON(),ClippingType:1}});return xe(o,r)}};a([u()],C.prototype,"layer",void 0),a([u({json:{write:!0}})],C.prototype,"adjustAspectRatio",void 0),a([V("adjustAspectRatio")],C.prototype,"writeAdjustAspectRatio",null),a([u({json:{write:!0}})],C.prototype,"bandIds",null),a([u({json:{write:!0}})],C.prototype,"compression",void 0),a([u({json:{write:!0}})],C.prototype,"compressionQuality",null),a([V("compressionQuality")],C.prototype,"writeCompressionQuality",null),a([u({json:{write:!0}})],C.prototype,"compressionTolerance",null),a([V("compressionTolerance")],C.prototype,"writeCompressionTolerance",null),a([u({json:{write:!0}})],C.prototype,"format",null),a([u({type:String,json:{read:{reader:Y.read},write:{writer:Y.write}}})],C.prototype,"interpolation",null),a([u({json:{write:!0}})],C.prototype,"noData",null),a([u({type:String,json:{read:{reader:ye.read},write:{writer:ye.write}}})],C.prototype,"noDataInterpretation",null),a([u({json:{write:!0}})],C.prototype,"pixelType",void 0),a([u({json:{write:!0}})],C.prototype,"lercVersion",void 0),a([V("lercVersion")],C.prototype,"writeLercVersion",null),a([u({type:Number})],C.prototype,"version",null),a([u({json:{write:!0}})],C.prototype,"mosaicRule",null),a([u({json:{write:!0}})],C.prototype,"renderingRule",null),C=a([E("esri.layers.mixins.ExportImageServiceParameters")],C);let le=class extends k{constructor(){super(...arguments),this.north=null,this.up=null,this.spatialReference=null}};a([u({type:Number,json:{write:!0}})],le.prototype,"north",void 0),a([u({type:Number,json:{write:!0}})],le.prototype,"up",void 0),a([u({type:oe,json:{write:!0}})],le.prototype,"spatialReference",void 0),le=a([E("esri.rest.support.ImageAngleResult")],le);const Ri=le;let Q=class extends k{constructor(){super(...arguments),this.catalogItemVisibilities=null,this.catalogItems=null,this.location=null,this.name=null,this.objectId=null,this.processedValues=null,this.properties=null,this.value=null}};a([u({json:{write:!0}})],Q.prototype,"catalogItemVisibilities",void 0),a([u({type:Ue,json:{write:!0}})],Q.prototype,"catalogItems",void 0),a([u({type:X,json:{write:!0}})],Q.prototype,"location",void 0),a([u({json:{write:!0}})],Q.prototype,"name",void 0),a([u({json:{write:!0}})],Q.prototype,"objectId",void 0),a([u({json:{write:!0}})],Q.prototype,"processedValues",void 0),a([u({json:{write:!0}})],Q.prototype,"properties",void 0),a([u({json:{write:!0}})],Q.prototype,"value",void 0),Q=a([E("esri.rest.support.ImageIdentifyResult")],Q);const bi=Q;let Re=class extends k{constructor(){super(...arguments),this.geometries=null}};a([u({json:{write:!0}})],Re.prototype,"geometries",void 0),Re=a([E("esri.rest.support.ImagePixelLocationResult")],Re);const vi=Re;let K=class extends k{constructor(){super(...arguments),this.attributes=null,this.location=null,this.locationId=null,this.rasterId=null,this.resolution=null,this.pixelValue=null}};a([u({json:{write:!0}})],K.prototype,"attributes",void 0),a([u({type:X,json:{write:!0}})],K.prototype,"location",void 0),a([u({json:{write:!0}})],K.prototype,"locationId",void 0),a([u({json:{write:!0}})],K.prototype,"rasterId",void 0),a([u({json:{write:!0}})],K.prototype,"resolution",void 0),a([u({json:{write:!0}})],K.prototype,"pixelValue",void 0),K=a([E("esri.rest.support.ImageSample")],K);const wi=K;let be=class extends k{constructor(){super(...arguments),this.samples=null}};a([u({type:[wi],json:{write:!0}})],be.prototype,"samples",void 0),be=a([E("esri.rest.support.ImageSampleResult")],be);const Si=be;function it(r){const i=r==null?void 0:r.time;if(i&&(i.start!=null||i.end!=null)){const o=[];i.start!=null&&o.push(i.start),i.end==null||o.includes(i.end)||o.push(i.end),r.time=o.join(",")}}async function rt(r,i,o){const e=ee(r),t=i.geometry?[i.geometry]:[],s=await je(t),n=i.toJSON();it(n);const l=s&&s[0];I(l)&&(n.geometry=l.toJSON());const p=ce({...e.query,f:"json",...n});return me(p,o)}async function xi(r,i,o){var p;const e=i.toJSON();I(e.angleName)&&(e.angleName=e.angleName.join(",")),I(i.point)&&((p=i.point.spatialReference)==null?void 0:p.imageCoordinateSystem)&&(e.point.spatialReference=$e(i.point.spatialReference)),I(i.spatialReference)&&i.spatialReference.imageCoordinateSystem&&(e.spatialReference=st(i.spatialReference));const t=ee(r),s=ce({...t.query,f:"json",...e}),n=me(s,o),{data:l}=await O(`${t.path}/computeAngles`,n);return l.spatialReference=l.spatialReference?l.spatialReference.geodataXform!=null?new oe({wkid:0,imageCoordinateSystem:l.spatialReference}):oe.fromJSON(l.spatialReference):null,l.north==="NaN"&&(l.north=null),l.up==="NaN"&&(l.up=null),new Ri(l)}async function Ii(r,i,o){var m;const e=i.toJSON(),{geometries:t}=i;if(t)for(let c=0;c{l.avg=l.mean,l.stddev=l.standardDeviation}),{statistics:n,histograms:s.histograms}}async function Ti(r,i,o){const e=await rt(r,i,o),t=ee(r),{data:s}=await O(`${t.path}/computeHistograms`,e);return{histograms:s.histograms}}async function Di(r,i,o){var c,d,h;const e=i.toJSON();it(e),(c=e.outFields)!=null&&c.length&&(e.outFields=e.outFields.join(","));const t=(d=await je(i.geometry))==null?void 0:d[0];I(t)&&(e.geometry=t.toJSON());const s=ee(r),n=ce({...s.query,f:"json",...e}),l=me(n,o),{data:p}=await O(`${s.path}/getSamples`,l),m=(h=p==null?void 0:p.samples)==null?void 0:h.map(R=>{const b=R.value==="NaN"||R.value===""?null:R.value.split(" ").map(y=>Number(y));return{...R,pixelValue:b}});return Si.fromJSON({samples:m})}async function He(r,i,o){const e=ee(r),t=i.geometry?[i.geometry]:[];return je(t).then(s=>{const n=i.toJSON(),l=s&&s[0];I(l)&&(n.geometry=JSON.stringify(l.toJSON()));const p=ce({...e.query,f:"json",...n}),m=me(p,o);return O(e.path+"/identify",m)}).then(s=>bi.fromJSON(s.data))}function $e(r){const{imageCoordinateSystem:i}=r;if(i){const{id:o,referenceServiceName:e}=i;return o!=null?e?{icsid:o,icsns:e}:{icsid:o}:{ics:i}}return r.toJSON()}function st(r,i){const o=$e(r),{icsid:e,icsns:t,wkid:s}=o;return e!=null?t==null||(i==null?void 0:i.toLowerCase().includes("/"+t.toLowerCase()+"/"))?`0:${e}`:JSON.stringify(o):s?s.toString():JSON.stringify(o)}async function Ni(r,i,o){var f,w;const e=ee(r),t=ce({...e==null?void 0:e.query,f:"json"}),s=me(t,o),n=`${e==null?void 0:e.path}/${i}/info`,l=O(`${n}`,s),p=O(`${n}/keyProperties`,s),m=await Promise.allSettled([l,p]),c=m[0].status==="fulfilled"?m[0].value.data:null,d=m[1].status==="fulfilled"?m[1].value.data:null;let h=null;(f=c.statistics)!=null&&f.length&&(h=c.statistics.map(v=>({min:v[0],max:v[1],avg:v[2],stddev:v[3]})));const R=fe.fromJSON(c.extent),b=Math.ceil(R.width/c.pixelSizeX-.1),y=Math.ceil(R.height/c.pixelSizeY-.1),g=R.spatialReference,F=new X({x:c.pixelSizeX,y:c.pixelSizeY,spatialReference:g}),T=(w=c.histograms)!=null&&w.length?c.histograms:null,P=new Kt({origin:c.origin,blockWidth:c.blockWidth,blockHeight:c.blockHeight,firstPyramidLevel:c.firstPyramidLevel,maximumPyramidLevel:c.maxPyramidLevel});return new Ke({width:b,height:y,bandCount:c.bandCount,extent:R,spatialReference:g,pixelSize:F,pixelType:c.pixelType.toLowerCase(),statistics:h,histograms:T,keyProperties:d,storageInfo:P})}var Ne;let ae=Ne=class extends k{constructor(){super(...arguments),this.angleNames=null,this.point=null,this.spatialReference=null,this.rasterId=null}clone(){return new Ne(J({angleNames:this.angleNames,point:this.point,spatialReference:this.spatialReference,rasterId:this.rasterId}))}};a([u({type:[String],json:{name:"angleName",write:!0}})],ae.prototype,"angleNames",void 0),a([u({type:X,json:{write:!0}})],ae.prototype,"point",void 0),a([u({type:oe,json:{write:!0}})],ae.prototype,"spatialReference",void 0),a([u({type:pe,json:{write:!0}})],ae.prototype,"rasterId",void 0),ae=Ne=a([E("esri.rest.support.ImageAngleParameters")],ae);const Pi=ae;var Pe;let B=Pe=class extends k{constructor(){super(...arguments),this.geometry=null,this.mosaicRule=null,this.renderingRule=null,this.pixelSize=null,this.raster=void 0,this.timeExtent=null}writeGeometry(r,i,o){r!=null&&(i.geometryType=Ae(r),i[o]=r.toJSON())}clone(){return new Pe(J({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,raster:this.raster,timeExtent:this.timeExtent}))}};a([u({types:Ge,json:{read:Be}})],B.prototype,"geometry",void 0),a([V("geometry")],B.prototype,"writeGeometry",null),a([u({type:H,json:{write:!0}})],B.prototype,"mosaicRule",void 0),a([u({type:x,json:{write:!0}})],B.prototype,"renderingRule",void 0),a([u({type:X,json:{write:!0}})],B.prototype,"pixelSize",void 0),a([u({json:{write:!0}})],B.prototype,"raster",void 0),a([u({type:Me,json:{read:{source:"time"},write:{target:"time"}}})],B.prototype,"timeExtent",void 0),B=Pe=a([E("esri.rest.support.ImageHistogramParameters")],B);const ke=B;var Ce;let _=Ce=class extends k{constructor(){super(...arguments),this.geometry=null,this.renderingRules=null,this.pixelSize=null,this.returnGeometry=!0,this.returnCatalogItems=!0,this.returnPixelValues=!0,this.maxItemCount=null,this.timeExtent=null,this.raster=void 0,this.viewId=void 0,this.processAsMultidimensional=!1}writeGeometry(r,i,o){r!=null&&(i.geometryType=Ae(r),i[o]=JSON.stringify(r.toJSON()))}set mosaicRule(r){let i=r;i&&i.mosaicMethod&&(i=H.fromJSON({...i.toJSON(),mosaicMethod:i.mosaicMethod,mosaicOperation:i.mosaicOperation})),this._set("mosaicRule",i)}writeMosaicRule(r,i,o){r!=null&&(i[o]=JSON.stringify(r.toJSON()))}set renderingRule(r){let i=r;i&&i.rasterFunction&&(i=x.fromJSON({...i.toJSON(),rasterFunction:i.rasterFunction,rasterFunctionArguments:i.rasterFunctionArguments})),this._set("renderingRule",i)}writeRenderingRule(r,i,o){r!=null&&(i[o]=JSON.stringify(r.toJSON())),r.rasterFunctionDefinition&&(i[o]=JSON.stringify(r.rasterFunctionDefinition))}writeRenderingRules(r,i,o){r!=null&&(i[o]=JSON.stringify(r.map(e=>e.rasterFunctionDefinition||e.toJSON())))}writePixelSize(r,i,o){r!=null&&(i[o]=JSON.stringify(r))}writeTimeExtent(r,i,o){if(r!=null){const e=I(r.start)?r.start.getTime():null,t=I(r.end)?r.end.getTime():null;i[o]=e!=null?t!=null?`${e},${t}`:`${e}`:null}}clone(){return new Ce(J({geometry:this.geometry,mosaicRule:this.mosaicRule,renderingRule:this.renderingRule,pixelSize:this.pixelSize,returnGeometry:this.returnGeometry,returnCatalogItems:this.returnCatalogItems,returnPixelValues:this.returnPixelValues,maxItemCount:this.maxItemCount,processAsMultidimensional:this.processAsMultidimensional,raster:this.raster,viewId:this.viewId,timeExtent:this.timeExtent}))}};a([u({json:{write:!0}})],_.prototype,"geometry",void 0),a([V("geometry")],_.prototype,"writeGeometry",null),a([u({type:H,json:{write:!0}})],_.prototype,"mosaicRule",null),a([V("mosaicRule")],_.prototype,"writeMosaicRule",null),a([u({type:x,json:{write:!0}})],_.prototype,"renderingRule",null),a([V("renderingRule")],_.prototype,"writeRenderingRule",null),a([u({type:[x],json:{write:!0}})],_.prototype,"renderingRules",void 0),a([V("renderingRules")],_.prototype,"writeRenderingRules",null),a([u({type:X,json:{write:!0}})],_.prototype,"pixelSize",void 0),a([V("pixelSize")],_.prototype,"writePixelSize",null),a([u({type:Boolean,json:{write:!0}})],_.prototype,"returnGeometry",void 0),a([u({type:Boolean,json:{write:!0}})],_.prototype,"returnCatalogItems",void 0),a([u({type:Boolean,json:{write:!0}})],_.prototype,"returnPixelValues",void 0),a([u({type:Number,json:{write:!0}})],_.prototype,"maxItemCount",void 0),a([u({type:Me,json:{write:{target:"time"}}})],_.prototype,"timeExtent",void 0),a([V("timeExtent")],_.prototype,"writeTimeExtent",null),a([u({json:{write:!0}})],_.prototype,"raster",void 0),a([u({json:{write:!0}})],_.prototype,"viewId",void 0),a([u({type:Boolean,json:{write:!0}})],_.prototype,"processAsMultidimensional",void 0),_=Ce=a([E("esri.rest.support.ImageIdentifyParameters")],_);const Qe=_;var _e;let ue=_e=class extends k{constructor(){super(...arguments),this.geometries=null,this.rasterId=null}writeGeometry(r,i,o){i.geometries={geometryType:"esriGeometryPoint",geometries:r.map(e=>e.toJSON())}}clone(){var r,i;return new _e({geometries:(i=(r=this.geometries)==null?void 0:r.map(o=>o.clone()))!=null?i:[],rasterId:this.rasterId})}};a([u({type:[X],json:{write:!0}})],ue.prototype,"geometries",void 0),a([V("geometries")],ue.prototype,"writeGeometry",null),a([u({type:pe,json:{write:!0}})],ue.prototype,"rasterId",void 0),ue=_e=a([E("esri.rest.support.ImagePixelLocationParameters")],ue);const Ci=ue;var Oe;let $=Oe=class extends k{constructor(){super(...arguments),this.geometry=null,this.interpolation="nearest",this.mosaicRule=null,this.outFields=null,this.pixelSize=null,this.returnFirstValueOnly=!0,this.sampleDistance=null,this.sampleCount=null,this.sliceId=null,this.timeExtent=null}writeGeometry(r,i,o){r!=null&&(i.geometryType=Ae(r),i[o]=r.toJSON())}set locations(r){if(r!=null&&r.length){const i=new ot({spatialReference:r[0].spatialReference});i.points=r.map(o=>[o.x,o.y]),this._set("locations",r),this.geometry=i}}clone(){return new Oe(J({geometry:this.geometry,locations:this.locations,interpolation:this.interpolation,mosaicRule:this.mosaicRule,outFields:this.outFields,raster:this.raster,returnFirstValueOnly:this.returnFirstValueOnly,sampleDistance:this.sampleDistance,sampleCount:this.sampleCount,sliceId:this.sliceId,pixelSize:this.pixelSize,timeExtent:this.timeExtent}))}};a([u({types:Ge,json:{read:Be}})],$.prototype,"geometry",void 0),a([V("geometry")],$.prototype,"writeGeometry",null),a([u()],$.prototype,"locations",null),a([u({type:String,json:{type:Y.jsonValues,read:Y.read,write:Y.write}})],$.prototype,"interpolation",void 0),a([u({type:H,json:{write:!0}})],$.prototype,"mosaicRule",void 0),a([u({type:[String],json:{write:!0}})],$.prototype,"outFields",void 0),a([u({type:X,json:{write:!0}})],$.prototype,"pixelSize",void 0),a([u({type:String,json:{write:!0}})],$.prototype,"raster",void 0),a([u({type:Boolean,json:{write:!0}})],$.prototype,"returnFirstValueOnly",void 0),a([u({type:Number,json:{write:!0}})],$.prototype,"sampleDistance",void 0),a([u({type:Number,json:{write:!0}})],$.prototype,"sampleCount",void 0),a([u({type:Number,json:{write:!0}})],$.prototype,"sliceId",void 0),a([u({type:Me,json:{read:{source:"time"},write:{target:"time"}}})],$.prototype,"timeExtent",void 0),$=Oe=a([E("esri.rest.support.ImageSampleParameters")],$);const _i=$,Ie=Ve()({U1:"u1",U2:"u2",U4:"u4",U8:"u8",S8:"s8",U16:"u16",S16:"s16",U32:"u32",S32:"s32",F32:"f32",F64:"f64",C64:"c64",C128:"c128",UNKNOWN:"unknown"}),Oi=new Set(["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"]),Vi=ft(Rt,{min:0,max:255});function ji(r){var o;if(!r)return null;const i=(o=JSON.stringify(r).match(/"rasterFunction":"(.*?")/gi))==null?void 0:o.map(e=>e.replace('"rasterFunction":"',"").replace('"',""));return i?i.join("/"):null}const Mi=r=>{let i=class extends r{constructor(){super(...arguments),this._functionRasterInfos={},this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this._cachedRendererJson=null,this._serviceSupportsMosaicRule=null,this._rasterAttributeTableFieldPrefix="Raster.",this.adjustAspectRatio=null,this.bandIds=void 0,this.capabilities=null,this.compressionQuality=void 0,this.compressionTolerance=.01,this.copyright=null,this.defaultMosaicRule=null,this.definitionExpression=null,this.exportImageServiceParameters=null,this.rasterInfo=null,this.fields=null,this.fullExtent=null,this.hasMultidimensions=!1,this.imageMaxHeight=4100,this.imageMaxWidth=4100,this.interpolation=void 0,this.minScale=0,this.maxScale=0,this.multidimensionalSubset=null,this.noData=null,this.noDataInterpretation=void 0,this.objectIdField=null,this.geometryType="polygon",this.typeIdField=null,this.types=[],this.pixelFilter=null,this.raster=void 0,this.sourceType=null,this.viewId=void 0,this.symbolizer=null,this.rasterFunctionInfos=null,this.serviceDataType=null,this.spatialReference=null,this.pixelType=null,this.serviceRasterInfo=null,this.sourceJSON=null,this.url=null,this.version=void 0}initialize(){this._set("exportImageServiceParameters",new C({layer:this}))}readServiceSupportsMosaicRule(e,t){return this._isMosaicRuleSupported(t)}get _rasterFunctionNamesIndex(){const e=new Map;return!this.rasterFunctionInfos||I(this.rasterFunctionInfos)&&this.rasterFunctionInfos.length<1||I(this.rasterFunctionInfos)&&this.rasterFunctionInfos.forEach(t=>{e.set(t.name.toLowerCase().replace(/ /gi,"_"),t.name)}),e}readBandIds(e,t){if(Array.isArray(e)&&e.length>0&&e.every(s=>typeof s=="number"))return e}readCapabilities(e,t){return this._readCapabilities(t)}writeCompressionQuality(e,t,s){e!=null&&this.format!=="lerc"&&(t[s]=e)}writeCompressionTolerance(e,t,s){this.format==="lerc"&&e!=null&&(t[s]=e)}readDefaultMosaicRule(e,t){return this._serviceSupportsMosaicRule?H.fromJSON(t):null}get fieldsIndex(){return this.fields?new pt(this.fields):null}set format(e){e&&Oi.has(e.toLowerCase())&&this._set("format",e.toLowerCase())}readFormat(e,t){return t.serviceDataType==="esriImageServiceDataTypeVector-UV"||t.serviceDataType==="esriImageServiceDataTypeVector-MagDir"||this.pixelFilter!=null?"lerc":"jpgpng"}readMinScale(e,t){return t.minLOD!=null&&t.maxLOD!=null?e:0}readMaxScale(e,t){return t.minLOD!=null&&t.maxLOD!=null?e:0}set mosaicRule(e){let t=e;t&&t.mosaicMethod&&(t=H.fromJSON({...t.toJSON(),mosaicMethod:t.mosaicMethod,mosaicOperation:t.mosaicOperation})),this._set("mosaicRule",t)}readMosaicRule(e,t){const s=e||t.mosaicRule;return s?H.fromJSON(s):this._isMosaicRuleSupported(t)?H.fromJSON(t):null}writeMosaicRule(e,t,s){let n=this.mosaicRule;const l=this.definitionExpression;n?l&&l!==n.where&&(n=n.clone(),n.where=l):l&&(n=new H({where:l})),this._isValidCustomizedMosaicRule(n)&&(t[s]=n.toJSON())}get multidimensionalInfo(){return I(this.serviceRasterInfo)?this.serviceRasterInfo.multidimensionalInfo:null}writeNoData(e,t,s){e!=null&&typeof e=="number"&&(t[s]=Vi(e))}readObjectIdField(e,t){if(!e){const s=t.fields.filter(n=>n.type==="esriFieldTypeOID"||n.type==="oid");e=s&&s[0]&&s[0].name}return e}get parsedUrl(){return ct(this.url)}readSourceType(e,t){return this._isMosaicDataset(t)?"mosaic-dataset":"raster-dataset"}set renderer(e){this.loaded&&(e=this._configRenderer(e)),this._set("renderer",e)}readRenderer(e,t,s){var p,m;const n=(m=(p=t==null?void 0:t.layerDefinition)==null?void 0:p.drawingInfo)==null?void 0:m.renderer,l=Jt(n,s);return l==null?null:(l.type==="vector-field"&&t.symbolTileSize&&!n.symbolTileSize&&(l.symbolTileSize=t.symbolTileSize),Xe(l)||Le.getLogger(this.declaredClass).warn("ArcGISImageService","Imagery layer doesn't support given renderer type."),l)}writeRenderer(e,t,s){t.layerDefinition=t.layerDefinition||{},t.layerDefinition.drawingInfo=t.layerDefinition.drawingInfo||{},t.layerDefinition.drawingInfo.renderer=e.toJSON(),e.type==="vector-field"&&(t.symbolTileSize=e.symbolTileSize)}get rasterFields(){var m,c;const e=this._rasterAttributeTableFieldPrefix||"Raster.",t=new se({name:"Raster.ItemPixelValue",alias:"Item Pixel Value",domain:null,editable:!1,length:50,type:"string"}),s=new se({name:"Raster.ServicePixelValue",alias:"Service Pixel Value",domain:null,editable:!1,length:50,type:"string"}),n=new se({name:"Raster.ServicePixelValue.Raw",alias:"Raw Service Pixel Value",domain:null,editable:!1,length:50,type:"string"});let l=this.fields?J(this.fields):[];l.push(s),((m=this.capabilities)==null?void 0:m.operations.supportsQuery)&&this.fields&&this.fields.length>0&&l.push(t),this.version>=10.4&&I(this.rasterFunctionInfos)&&this.rasterFunctionInfos.some(d=>d.name.toLowerCase()==="none")&&l.push(n),I(this.rasterFunctionInfos)&&this.rasterFunctionInfos.filter(d=>d.name.toLowerCase()!=="none").forEach(d=>{l.push(new se({name:"Raster.ServicePixelValue."+d.name,alias:d.name,domain:null,editable:!1,length:50,type:"string"}))}),this._isVectorDataSet()&&(l.push(new se({name:"Raster.Magnitude",alias:"Magnitude",domain:null,editable:!1,type:"double"})),l.push(new se({name:"Raster.Direction",alias:"Direction",domain:null,editable:!1,type:"double"})));const{attributeTable:p}=(c=this.rasterInfo)!=null?c:{};if(I(p)){const d=p.fields.filter(h=>h.type!=="esriFieldTypeOID"&&h.name.toLowerCase()!=="value").map(h=>{const R=J(h);return R.name=e+h.name,R});l=l.concat(d)}return l}set renderingRule(e){let t=e;t&&t.rasterFunction&&(t=x.fromJSON({...t.toJSON(),rasterFunction:t.rasterFunction,rasterFunctionArguments:t.rasterFunctionArguments})),this._set("renderingRule",t)}readRenderingRule(e,t){const s=t.rasterFunctionInfos;return t.renderingRule||s&&s.length&&s[0].name!=="None"?this._isRFTJson(t.renderingRule)?x.fromJSON({rasterFunctionDefinition:t.renderingRule}):x.fromJSON(t.renderingRule||{rasterFunctionInfos:t.rasterFunctionInfos}):null}writeRenderingRule(e,t,s){const n=e.toJSON();n.rasterFunctionDefinition?t[s]=n.rasterFunctionDefinition:t[s]=n}readSpatialReference(e,t){const s=e||t.extent.spatialReference;return s?oe.fromJSON(s):null}readPixelType(e){return Ie.fromJSON(e)||e}writePixelType(e,t,s){(z(this.serviceRasterInfo)||this.pixelType!==this.serviceRasterInfo.pixelType)&&(t[s]=Ie.toJSON(e))}readVersion(e,t){let s=t.currentVersion;return s||(s=t.hasOwnProperty("fields")||t.hasOwnProperty("timeInfo")?10:9.3),s}applyFilter(e){let t=e;return this.pixelFilter&&(t=this._clonePixelData(e),this.pixelFilter(t)),t}async applyRenderer(e,t){let s=e;const{renderer:n,symbolizer:l,pixelFilter:p,bandIds:m}=this;if(!this._isPicture()&&n&&l&&!p){const c=JSON.stringify(this._cachedRendererJson)!==JSON.stringify(n.toJSON()),d=this._rasterJobHandler.instance;if(d){c&&(l.bind(),await d.updateSymbolizer(l,t),this._cachedRendererJson=n.toJSON());const h=await d.symbolize({bandIds:m,...e},t);s={extent:e.extent,pixelBlock:h}}else s={extent:e.extent,pixelBlock:l.symbolize({bandIds:m,...e})}}return s}destroy(){this._shutdownJobHandler()}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}async computeAngles(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputeAngles)throw new L("imagery-layer:compute-angles","this operation is not supported on the input image service");return e=ne(Pi,e).clone(),xi(this.url,e,this._getRequestOptions(t))}async computePixelSpaceLocations(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputePixelLocation)throw new L("imagery-layer:compute-pixel-space-locations","this operation is not supported on the input image service");return e=ne(Ci,e).clone(),Ii(this.url,e,this._getRequestOptions(t))}async computeHistograms(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputeHistograms)throw new L("imagery-layer:compute-histograms","this operation is not supported on the input image service");e=ne(ke,e).clone();const{raster:s,mosaicRule:n,renderingRule:l}=this;return l&&e.renderingRule==null&&(e.renderingRule=l),n&&e.mosaicRule==null&&(e.mosaicRule=n),s&&e.raster==null&&(e.raster=s),Ti(this.url,e,this._getRequestOptions(t))}async computeStatisticsHistograms(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsComputeStatisticsHistograms)throw new L("imagery-layer:compute-statistics-histograms","this operation is not supported on the input image service");e=ne(ke,e).clone();const{raster:s,mosaicRule:n,renderingRule:l}=this;return l&&e.renderingRule==null&&(e.renderingRule=l),n&&e.mosaicRule==null&&(e.mosaicRule=n),s&&e.raster==null&&(e.raster=s),Fi(this.url,e,this._getRequestOptions(t))}getField(e){const{fieldsIndex:t}=this;return I(t)?t.get(e):void 0}getFieldDomain(e,t){const s=this.getField(e);return s?s.domain:null}async fetchImage(e,t,s,n={}){var m,c,d,h,R;if(e==null||t==null||s==null)throw new L("imagery-layer:fetch-image","Insufficient parameters for requesting an image. A valid extent, width and height values are required.");if(this.renderer||this.symbolizer){const b=await this.generateRasterInfo(this.renderingRule,{signal:n.signal});b&&(this.rasterInfo=b)}const l=this.getExportImageServiceParameters(e,t,s,n.timeExtent);if(l==null){if(n.requestAsImageElement&&this._canRequestImageElement(this.format)){const T=document.createElement("canvas");return T.width=t,T.height=s,{imageOrCanvasElement:T}}const b=(d=((m=this.bandIds)==null?void 0:m.length)||((c=this.rasterInfo)==null?void 0:c.bandCount))!=null?d:0,y=t*s,g=(R=(h=this.rasterInfo)==null?void 0:h.pixelType)!=null?R:"unknown",F=[];for(let T=0;T=10.3?e==null?void 0:e.renderingRule:null})}).then(t=>t.data)}fetchRasterAttributeTable(e){return this.version<10.1?Promise.reject(new L("#fetchRasterAttributeTable()","Failed to get rasterAttributeTable")):O(o(this.parsedUrl)+"/rasterAttributeTable",{query:this._getQueryParams({renderingRule:this.version>=10.3?e==null?void 0:e.renderingRule:null})}).then(t=>Ue.fromJSON(t.data))}getCatalogItemRasterInfo(e,t){const s={...t,query:this._getQueryParams()};return Ni(o(this.parsedUrl),e,s)}async getCatalogItemICSInfo(e,t){var Z,Je,Ee;const{data:s}=await O(o(this.parsedUrl)+"/"+e+"/info/ics",{query:this._getQueryParams(),...t}),n=s&&s.ics;if(!n)return;let l=null;try{l=(await O(o(this.parsedUrl)+"/"+e+"/info",{query:this._getQueryParams(),...t})).data.extent}catch{}if(!l||!l.spatialReference)return{ics:n,icsToPixelTransform:null,icsExtent:null,northDirection:null};const p=this.version>=10.7?O(o(this.parsedUrl)+"/"+e+"/info/icstopixel",{query:this._getQueryParams(),...t}).then(S=>S.data).catch(()=>({})):{},m=l.spatialReference,c={geometries:JSON.stringify({geometryType:"esriGeometryEnvelope",geometries:[l]}),inSR:m.wkid||JSON.stringify(m),outSR:"0:"+e},d=O(o(this.parsedUrl)+"/project",{query:this._getQueryParams(c),...t}).then(S=>S.data).catch(()=>({})),h=5,R=(l.xmin+l.xmax)/2,b=(l.ymax-l.ymin)/(h+1),y=l.ymin+b,g=[];for(let S=0;SS.data).catch(()=>({})),P=await Promise.all([p,d,T]);let f=P[0].ipxf;if(f==null){const S=(Z=n.geodataXform)==null?void 0:Z.xf_0;((Je=S==null?void 0:S.name)==null?void 0:Je.toLowerCase())==="topup"&&((Ee=S==null?void 0:S.coefficients)==null?void 0:Ee.length)===6&&(f={affine:{name:"ics [sensor: Frame] to pixel (column, row) transformation",coefficients:S.coefficients,cellsizeRatio:0,type:"GeometricXform"}})}const w=fe.fromJSON(P[1]&&P[1].geometries&&P[1].geometries[0]);w&&(w.spatialReference=new oe({wkid:0,imageCoordinateSystem:n}));const v=P[2].geometries?P[2].geometries.filter(S=>S!=null&&S.x!=null&&S.y!=null&&S.x!=="NaN"&&S.y!=="NaN"):[],D=v.length;if(D<3)return{ics:n,icsToPixelTransform:f,icsExtent:w,northDirection:null};let N=0,A=0,U=0,de=0;for(let S=0;Sv[0].x,re=v[h-1].y>v[0].y;return G===1/0?te=re?90:270:G===0?te=ie?0:180:G>0?te=ie?180*Math.atan(G)/Math.PI:180*Math.atan(G)/Math.PI+180:G<0&&(te=re?180+180*Math.atan(G)/Math.PI:360+180*Math.atan(G)/Math.PI),{ics:n,icsToPixelTransform:f,icsExtent:w,northDirection:te}}async generateRasterInfo(e,t){var l;if(this.serviceRasterInfo&&(!e||((l=e.functionName)==null?void 0:l.toLowerCase())==="none"||this._isVectorFieldResampleFunction(e)))return this.serviceRasterInfo;const s=ji(e);if(!s)return null;if(this._functionRasterInfos[s])return this._functionRasterInfos[s];const n=this._generateRasterInfo(e,t);this._functionRasterInfos[s]=n;try{return await n}catch{return this._functionRasterInfos[s]=null,null}}getExportImageServiceParameters(e,t,s,n){var F,T,P;e=e.clone().shiftCentralMeridian();const l=st(e.spatialReference,o(this.parsedUrl));this.pixelType!==((F=this.serviceRasterInfo)==null?void 0:F.pixelType)&&(this.exportImageServiceParameters.pixelType=this.pixelType);const p=this.exportImageServiceParameters.toJSON(),{bandIds:m,noData:c}=p;let{renderingRule:d}=p;const h=(T=this.renderingRule)==null?void 0:T.rasterFunctionDefinition,R=!this.renderer||this.renderer.type==="raster-stretch";if((m==null?void 0:m.length)&&this._hasRenderingRule(this.renderingRule)&&!h&&R){const f={rasterFunction:"ExtractBand",rasterFunctionArguments:{BandIds:m}};if(d.rasterFunction==="Stretch")f.rasterFunctionArguments.Raster=d.rasterFunctionArguments.Raster,d.rasterFunctionArguments.Raster=f;else if(d.rasterFunction==="Colormap"){const w=d.rasterFunctionArguments.Raster;(w==null?void 0:w.rasterFunction)==="Stretch"?(f.rasterFunctionArguments.Raster=w.rasterFunctionArguments.Raster,w.rasterFunctionArguments.Raster=f):(f.rasterFunctionArguments.Raster=w,d.rasterFunctionArguments.Raster=f)}else f.rasterFunctionArguments.Raster=d,d=f;p.bandIds=void 0}else p.bandIds=m==null?void 0:m.join(",");c instanceof Array&&c.length>0&&(p.noData=c.join(","));const b=this._serviceSupportsMosaicRule?this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,n):null;p.mosaicRule=I(b)?JSON.stringify(b):null;const{multidimensionalSubset:y}=this;if(y&&I(b)&&b.multidimensionalDefinition&&ze(b.multidimensionalDefinition,y,!0))return null;p.renderingRule=this._getRenderingRuleString(x.fromJSON(d));const g={};if(n){const{start:f,end:w}=n.toJSON();let v;if(f&&w&&f===w?(g.time=""+f,v=[f]):f==null&&w==null||(g.time=`${f!=null?f:"null"},${w!=null?w:"null"}`,v=f!=null&&w!=null?[f,w]:[f!=null?f:w]),v&&y){const D=y.dimensions.find(({name:A})=>A==="StdTime");if(v.length===2&&D.extent.length){if(v[0]=Math.max(v[0],D.extent[0]),v[1]=Math.min(v[1],(P=D.extent[1])!=null?P:D.extent[0]),v[1]!D.toLowerCase().includes(h)),this.version>=10.4)){const D=e.outFields.filter(A=>A.toLowerCase().includes(h)&&A.length>h.length).map(A=>{const U=A.slice(h.length+1);return[this._updateRenderingRulesFunctionName(U,R),U]});c=D.map(A=>new x({functionName:A[0]})),d=D.map(A=>A[1]);const{renderingRule:N}=this;c.length===0?N!=null&&N.functionName?(c.push(N),d.push(N.functionName)):c=null:(N==null?void 0:N.functionName)&&!c.some(A=>A.functionName===N.functionName)&&(c.push(N),d.push(N.functionName))}const b=z(e.outSpatialReference)||e.outSpatialReference.equals(this.spatialReference),y=e.timeExtent||this.timeExtent,g=this._combineMosaicRuleWithTimeExtent(this.exportImageServiceParameters.mosaicRule,y),F=this._getQueryParams({geometry:e.geometry,timeExtent:y,mosaicRule:g,renderingRule:this.version<10.4?this.renderingRule:null,renderingRules:c,pixelSize:s,returnCatalogItems:m,returnGeometry:b,raster:this.raster,maxItemCount:l?1:null});delete F.f;const T=new Qe(F);try{await this.generateRasterInfo(this.renderingRule);const D=await He(this.url,T,{signal:t==null?void 0:t.signal,query:{...this.customParameters}}),N=e.outFields,A=D.value!=null&&D.value.toLowerCase().includes("nodata");if(!(m&&!b&&((P=D==null?void 0:D.catalogItems)==null?void 0:P.features.length)&&(p||!A)))return this._processVisibleRastersResponse(D,{returnDomainValues:n,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:N});const U=this.objectIdField||"ObjectId",de=(w=(f=D.catalogItems)==null?void 0:f.features)!=null?w:[],G=de.map(re=>{var Z;return(Z=re.attributes)==null?void 0:Z[U]}),te=new we({objectIds:G,returnGeometry:!0,outSpatialReference:e.outSpatialReference,outFields:[U]}),ie=await this.queryRasters(te);return(v=ie==null?void 0:ie.features)!=null&&v.length&&ie.features.forEach(re=>{de.forEach(Z=>{Z.attributes[U]===re.attributes[U]&&(Z.geometry=new ht(re.geometry),I(e.outSpatialReference)&&(Z.geometry.spatialReference=e.outSpatialReference))})}),this._processVisibleRastersResponse(D,{returnDomainValues:n,templateRRFunctionNames:d,showNoDataRecords:p,templateFields:N})}catch{throw new L("imagery-layer:query-visible-rasters","encountered error when querying visible rasters")}}async fetchVariableStatisticsHistograms(e,t){const s=O(o(this.parsedUrl)+"/statistics",{query:this._getQueryParams({variable:e}),signal:t}).then(p=>{var m;return(m=p.data)==null?void 0:m.statistics}),n=O(o(this.parsedUrl)+"/histograms",{query:this._getQueryParams({variable:e}),signal:t}).then(p=>{var m;return(m=p.data)==null?void 0:m.histograms}),l=await Promise.all([s,n]);return l[0]&&l[0].forEach(p=>{p.avg=p.mean,p.stddev=p.standardDeviation}),{statistics:l[0]||null,histograms:l[1]||null}}async createFlowMesh(e,t){const s=this._rasterJobHandler.instance;return s?s.createFlowMesh(e,t):ei(e.meshType,e.simulationSettings,e.flowData,I(t.signal)?t.signal:new AbortController().signal)}getMultidimensionalSubsetVariables(e){const t=e!=null?e:this.multidimensionalInfo;return Ut(this.multidimensionalSubset,t)}async _fetchService(e){await this._fetchServiceInfo(e),this.rasterInfo||(this.rasterInfo=this.serviceRasterInfo);const t=this.sourceJSON,s=I(this.serviceRasterInfo)?Promise.resolve(this.serviceRasterInfo):Et(o(this.parsedUrl),t,{signal:e,query:this._getQueryParams()}).then(p=>(this._set("serviceRasterInfo",p),p)),n=this._hasRenderingRule(this.renderingRule)?this.generateRasterInfo(this.renderingRule,{signal:e}):null,l=this._getRasterFunctionInfos();return Promise.all([s,n,l]).then(p=>{p[1]?this._set("rasterInfo",p[1]):this._set("rasterInfo",p[0]),p[2]&&this._set("rasterFunctionInfos",p[2]),this.renderer&&!this._isSupportedRenderer(this.renderer)&&(this._set("renderer",null),Le.getLogger(this.declaredClass).warn("ArcGISImageService","Switching to the default renderer. Renderer applied is not valid for this Imagery Layer")),this._set("renderer",this._configRenderer(this.renderer)),this.addHandles([yt(()=>this.renderingRule,c=>{(this.renderer||this.symbolizer||this.popupEnabled&&this.popupTemplate)&&this.generateRasterInfo(c).then(d=>{d&&(this.rasterInfo=d)})})]);const{serviceRasterInfo:m}=this;m&&I(m.multidimensionalInfo)&&this._updateMultidimensionalDefinition(m)})}_combineMosaicRuleWithTimeExtent(e,t){var b;const s=this.timeInfo;if(z(e)||z(this.multidimensionalInfo)||z(t)||z(s==null?void 0:s.startField))return e;const{startField:n}=s,l=this.multidimensionalInfo.variables.some(y=>y.dimensions.some(g=>g.name===n))?n:"StdTime";if(e=e.clone(),this.sourceType==="mosaic-dataset")return e.multidimensionalDefinition=(b=e.multidimensionalDefinition)==null?void 0:b.filter(y=>y.dimensionName!==l),this._cleanupMultidimensionalDefinition(e);e.multidimensionalDefinition=e.multidimensionalDefinition||[];const p=e.multidimensionalDefinition.filter(y=>y.dimensionName===l),m=I(t.start)?t.start.getTime():null,c=I(t.end)?t.end.getTime():null,d=m==null||c==null||m===c,h=d?[m||c]:[[m,c]],R=this.version>=10.8;if(p.length)p.forEach(y=>{y.dimensionName===l&&(R?(y.dimensionName=null,y.isSlice=!1,y.values=[]):(y.isSlice=d,y.values=h))});else if(!R){const y=e.multidimensionalDefinition.filter(g=>g.variableName!=null&&g.dimensionName==null);y.length?y.forEach(g=>{g.dimensionName=l,g.isSlice=d,g.values=h}):e.multidimensionalDefinition.push(new Fe({variableName:"",dimensionName:l,isSlice:d,values:h}))}return this._cleanupMultidimensionalDefinition(e)}_cleanupMultidimensionalDefinition(e){return z(e)?null:(e.multidimensionalDefinition&&(e.multidimensionalDefinition=e.multidimensionalDefinition.filter(t=>!(!t.variableName&&!t.dimensionName)),e.multidimensionalDefinition.length===0&&(e.multidimensionalDefinition=null)),this.sourceType!=="mosaic-dataset"&&e.multidimensionalDefinition==null?null:e)}async _prepareForQuery(e,t){if(!(await this._fetchCapabilities(t==null?void 0:t.signal)).operations.supportsQuery)throw new L("imagery-layer:query-rasters","query operation is not supported on the input image service");return e=I(e)?ne(we,e):this.createQuery(),t=this._getRequestOptions(t),this.raster&&(t.query={...t.query,raster:this.raster}),{query:e,requestOptions:t}}async _initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const e=new Qt;this._rasterJobHandler.connectionPromise=e.initialize().then(()=>{this._rasterJobHandler.instance=e},()=>{}),await this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null}_isSupportedRenderer(e){const{rasterInfo:t,renderingRule:s}=this;return e.type==="unique-value"&&this._hasRenderingRule(s)&&(t==null?void 0:t.bandCount)===1&&["u8","s8"].includes(t.pixelType)||t!=null&&e!=null&&Lt(t).includes(e.type)}async _fetchCapabilities(e){return this.capabilities||await this._fetchServiceInfo(e),this.capabilities}async _fetchServiceInfo(e){var s;let t=this.sourceJSON;if(!t){const{data:n,ssl:l}=await O(o(this.parsedUrl),{query:this._getQueryParams(),signal:e});t=n,this.sourceJSON=t,l&&(this.url=this.url.replace(/^http:/i,"https:"))}if(((s=t.capabilities)==null?void 0:s.toLowerCase().split(",").map(n=>n.trim()).indexOf("tilesonly"))>-1)throw new L("imagery-layer:fetch-service-info","use ImageryTileLayer to open tiles-only image services");this.read(t,{origin:"service",url:this.parsedUrl})}_isMosaicDataset(e){var t;return e.serviceSourceType?e.serviceSourceType==="esriImageServiceSourceTypeMosaicDataset":((t=e.fields)==null?void 0:t.length)>0}_isMosaicRuleSupported(e){var n;if(!e)return!1;const t=this._isMosaicDataset(e),s=e.currentVersion>=10.71&&e.hasMultidimensions&&!(((n=e.fields)==null?void 0:n.length)>1);return t||s}_isVectorFieldResampleFunction(e){if(z(e))return!1;const{functionName:t,functionArguments:s}=e,n=(t==null?void 0:t.toLowerCase())==="resample",l=(s==null?void 0:s.ResampleType)||(s==null?void 0:s.resampleType);return n&&(l===7||l===10)}_isPicture(){return!this.format||this.format.includes("jpg")||this.format.includes("png")}_configRenderer(e){var t,s;if(!this._isPicture()&&!this.pixelFilter||this._isVectorDataSet()){if(!this.bandIds&&this.rasterInfo&&this.rasterInfo.bandCount>=3){const l=zt(this.rasterInfo);!l||this.rasterInfo.bandCount===3&&l[0]===0&&l[1]===1&&l[2]===2||(this.bandIds=l)}e||(e=qt(this.rasterInfo,{bandIds:this.bandIds,variableName:this.renderingRule?null:(s=(t=this.mosaicRule)==null?void 0:t.multidimensionalDefinition)==null?void 0:s[0].variableName}));const n=Ht(e.toJSON());this.symbolizer?(this.symbolizer.rendererJSON=n,this.symbolizer.rasterInfo=this.rasterInfo):this.symbolizer=new Xt({rendererJSON:n,rasterInfo:this.rasterInfo}),this.symbolizer.bind().success||(this.symbolizer=null)}return e}_clonePixelData(e){return e==null?e:{extent:e.extent&&e.extent.clone(),pixelBlock:I(e.pixelBlock)?e.pixelBlock.clone():null}}_getQueryParams(e){e&&I(e.renderingRule)&&typeof e.renderingRule!="string"&&(e.renderingRule=this._getRenderingRuleString(e.renderingRule));const{raster:t,viewId:s}=this;return{raster:t,viewId:s,f:"json",...e,...this.customParameters}}_getRequestOptions(e){return{...e,query:{...e==null?void 0:e.query,...this.customParameters}}}_decodePixelBlock(e,t,s){return this._rasterJobHandler.instance?this._rasterJobHandler.instance.decode({data:e,options:t}):qe(e,t,s)}async _getRasterFunctionInfos(e){var s;const t=this.sourceJSON.rasterFunctionInfos;return this.loaded?t:t&&this.version>=10.3?t.length===1&&t[0].name.toLowerCase()==="none"?t:(s=(await O(o(this.parsedUrl)+"/rasterFunctionInfos",{query:this._getQueryParams(),signal:e})).data)==null?void 0:s.rasterFunctionInfos:null}_canRequestImageElement(e){return!this.pixelFilter&&(!e||e.includes("png"))}async _requestArrayBuffer(e){const{imageProps:t,requestAsImageElement:s,signal:n}=e;if(s&&this._canRequestImageElement(t.format))return{imageOrCanvasElement:(await O(o(this.parsedUrl)+"/exportImage",{responseType:"image",query:this._getQueryParams({f:"image",...this.refreshParameters,...e.imageServiceParameters}),signal:n})).data,params:t};const l=this._initJobHandler(),p=O(o(this.parsedUrl)+"/exportImage",{responseType:"array-buffer",query:this._getQueryParams({f:"image",...e.imageServiceParameters}),signal:n}),m=(await Promise.all([p,l]))[0].data,c=t.format||"jpgpng";let d=c;if(d!=="bsq"&&d!=="bip"&&(d=Yt(m)),!d)throw new L("imagery-layer:fetch-image","unsupported format signature "+String.fromCharCode.apply(null,new Uint8Array(m)));const h={signal:n};return{pixelData:{pixelBlock:await(c==="gif"||c==="bmp"||c.includes("png")&&(d==="png"||d==="jpg")?qe(m,{useCanvas:!0,...t},h):this._decodePixelBlock(m,{width:t.width,height:t.height,planes:null,pixelType:null,noDataValue:null,format:c},h)),extent:t.extent},params:t}}_generateRasterInfo(e,t){const s={...t,query:this._getQueryParams()};return kt(o(this.parsedUrl),e,s)}_isValidCustomizedMosaicRule(e){var t;return e&&JSON.stringify(e.toJSON())!==JSON.stringify((t=this.defaultMosaicRule)==null?void 0:t.toJSON())}_updateMultidimensionalDefinition(e){var s;if(this._isValidCustomizedMosaicRule(this.mosaicRule))return;const t=Gt(e,{multidimensionalSubset:this.multidimensionalSubset});if(I(t)&&t.length>0){this.mosaicRule=this.mosaicRule||new H;const n=this.mosaicRule.multidimensionalDefinition;!this.sourceJSON.defaultVariableName&&this.renderingRule&&((s=this.renderingRule.functionName)==null?void 0:s.toLowerCase())!=="none"&&t.forEach(l=>l.variableName=""),(!n||n&&n.length<=0)&&(this.mosaicRule.multidimensionalDefinition=t)}}_processVisibleRastersResponse(e,t){var P;t=t||{};const s=e.value,{templateRRFunctionNames:n,showNoDataRecords:l,returnDomainValues:p,templateFields:m}=t,c=e.processedValues;let d=e.catalogItems&&e.catalogItems.features,h=e.properties&&e.properties.Values&&e.properties.Values.map(f=>f.replace(/ /gi,", "))||[];const R=this.objectIdField||"ObjectId",b=typeof s=="string"&&s.toLowerCase().includes("nodata"),y=[];if(s&&!d&&!b){const f={};f[R]=0,h=[s],d=[new gt(this.fullExtent,null,f)]}if(!d)return[];let g,F,T;this._updateResponseFieldNames(d,m),b&&!l&&(d=[]);for(let f=0;f0&&n&&n.length>0&&n.includes(this.renderingRule.functionName)?c[n.indexOf(this.renderingRule.functionName)]:s,F.toLowerCase()==="nodata"&&!l)continue;const w="Raster.ItemPixelValue",v="Raster.ServicePixelValue";g.attributes[w]=F,g.attributes[v]=T,this._updateFeatureWithMagDirValues(g,F);const D=this.fields&&this.fields.length>0;let N=this.renderingRule&&I((P=this.serviceRasterInfo)==null?void 0:P.attributeTable)?D?F:s:T;this.renderingRule||(N=D?F:s),this._updateFeatureWithRasterAttributeTableValues(g,N)}if(g.sourceLayer=g.layer=this,p&&this._updateFeatureWithDomainValues(g),n&&c&&n.length===c.length)for(let w=0;wh.name).filter(h=>h.toLowerCase()==="value"),m=p&&p[0];if(!m)return;const c=n.filter(h=>h.attributes[m]===(t!=null?parseInt(t,10):null));c&&c[0]&&l.forEach(h=>{const R=this._rasterAttributeTableFieldPrefix+h.name;e.attributes[R]=c[0].attributes[h.name]})}_updateFeatureWithMagDirValues(e,t){if(!this._isVectorDataSet())return;const s=t.split(/,\s*/).map(c=>parseFloat(c)),n=s.map(c=>[c]),l=s.map(c=>({minValue:c,maxValue:c,noDataValue:null})),p=new Se({height:1,width:1,pixelType:"f32",pixels:n,statistics:l});this.pixelFilter!=null&&this.pixelFilter({pixelBlock:p,extent:new fe(0,0,0,0,this.spatialReference)});const m=this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"?[p.pixels[0][0],p.pixels[1][0]]:ti([p.pixels[0][0],p.pixels[1][0]]);e.attributes["Raster.Magnitude"]=m[0],e.attributes["Raster.Direction"]=m[1]}_updateFeatureWithDomainValues(e){const t=this.fields&&this.fields.filter(s=>s.domain&&s.domain.type==="coded-value");t!=null&&t.forEach(s=>{const n=e.attributes[s.name];if(n!=null){const l=s.domain.codedValues.find(p=>p.code===n);l&&(e.attributes[s.name]=l.name)}})}_updateResponseFieldNames(e,t){if(!t||t.length<1)return;const s=this.fieldsIndex;z(s)||e.forEach(n=>{var l;if(n&&n.attributes)for(const p of t){const m=(l=s.get(p))==null?void 0:l.name;m&&m!==p&&(n.attributes[p]=n.attributes[m],delete n.attributes[m])}})}_getRenderingRuleString(e){var t;if(this._hasRenderingRule(e)){let s=e.toJSON();return s=(t=s.rasterFunctionDefinition)!=null?t:s,(s.thumbnail||s.thumbnailEx)&&(s.thumbnail=s.thumbnailEx=null),JSON.stringify(s)}return null}_hasRenderingRule(e){return e!=null&&e.functionName!=null&&e.functionName.toLowerCase()!=="none"}_updateRenderingRulesFunctionName(e,t){if(!e||e.length<1)return;if(e==="Raw")return e.replace("Raw","None");const s=e.toLowerCase().replace(/ /gi,"_");return t.has(s)?t.get(s):e}_isRFTJson(e){return e&&e.name&&e.arguments&&e.function&&e.hasOwnProperty("functionType")}_isVectorDataSet(){return this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir"}_readCapabilities(e){const t=e.capabilities?e.capabilities.toLowerCase().split(",").map(h=>h.trim()):["image","catalog"],{currentVersion:s,advancedQueryCapabilities:n,maxRecordCount:l}=e,p=t.includes("image"),m=e.serviceDataType==="esriImageServiceDataTypeElevation",c=!!(e.spatialReference||e.extent&&e.extent.spatialReference),d=t.includes("edit");return{data:{supportsAttachment:!1},operations:{supportsComputeHistograms:p,supportsExportImage:p,supportsIdentify:p,supportsMeasure:t.includes("mensuration")&&c,supportsDownload:t.includes("download"),supportsQuery:t.includes("catalog")&&e.fields&&e.fields.length>0,supportsGetSamples:s>=10.2&&p,supportsProject:s>=10.3&&p,supportsComputeStatisticsHistograms:s>=10.4&&p,supportsQueryBoundary:s>=10.6&&p,supportsCalculateVolume:s>=10.7&&m,supportsComputePixelLocation:s>=10.7&&t.includes("catalog"),supportsComputeAngles:s>=10.91,supportsAdd:d,supportsDelete:d,supportsEditing:d,supportsUpdate:d,supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsChangeTracking:!1,supportsQueryAttachments:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsExceedsLimitStatistics:!1,supportsQueryAnalytics:!1,supportsQueryTopFeatures:!1},query:{maxRecordCount:l,maxRecordCountFactor:void 0,supportsStatistics:!!(n!=null&&n.supportsStatistics),supportsOrderBy:!!(n!=null&&n.supportsOrderBy),supportsDistinct:!!(n!=null&&n.supportsDistinct),supportsPagination:!!(n!=null&&n.supportsPagination),supportsStandardizedQueriesOnly:!!(n!=null&&n.useStandardizedQueries),supportsPercentileStatistics:!!(n!=null&&n.supportsPercentileStatistics),supportsCentroid:!!(n!=null&&n.supportsReturningGeometryCentroid),supportsDistance:!!(n!=null&&n.supportsQueryWithDistance),supportsExtent:!!(n!=null&&n.supportsReturningQueryExtent),supportsGeometryProperties:!!(n!=null&&n.supportsReturningGeometryProperties),supportsHavingClause:!!(n!=null&&n.supportsHavingClause),supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsMaxRecordCountFactor:!1,supportsSqlExpression:!1,supportsTopFeaturesQuery:!1,supportsQueryByOthers:!1,supportsHistoricMoment:!1,supportsFormatPBF:!1,supportsDisjointSpatialRelationship:!1,supportsCacheHint:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!!(n!=null&&n.supportsDefaultSR),supportsFullTextSearch:!1,supportsCompactGeometry:!1,standardMaxRecordCount:void 0,tileMaxRecordCount:void 0}}}};function o(e){var t;return(t=e==null?void 0:e.path)!=null?t:""}return a([u()],i.prototype,"_functionRasterInfos",void 0),a([u()],i.prototype,"_rasterJobHandler",void 0),a([u()],i.prototype,"_cachedRendererJson",void 0),a([u({readOnly:!0})],i.prototype,"_serviceSupportsMosaicRule",void 0),a([M("_serviceSupportsMosaicRule",["currentVersion","fields"])],i.prototype,"readServiceSupportsMosaicRule",null),a([u()],i.prototype,"_rasterAttributeTableFieldPrefix",void 0),a([u({readOnly:!0})],i.prototype,"_rasterFunctionNamesIndex",null),a([u()],i.prototype,"adjustAspectRatio",void 0),a([u({type:[pe],json:{write:!0}})],i.prototype,"bandIds",void 0),a([M("bandIds")],i.prototype,"readBandIds",null),a([u({readOnly:!0,json:{read:!1}})],i.prototype,"capabilities",void 0),a([M("service","capabilities",["capabilities","currentVersion","serviceDataType"])],i.prototype,"readCapabilities",null),a([u({type:Number})],i.prototype,"compressionQuality",void 0),a([V("compressionQuality")],i.prototype,"writeCompressionQuality",null),a([u({type:Number})],i.prototype,"compressionTolerance",void 0),a([V("compressionTolerance")],i.prototype,"writeCompressionTolerance",null),a([u({json:{read:{source:"copyrightText"}}})],i.prototype,"copyright",void 0),a([u({readOnly:!0,dependsOn:["_serviceSupportsMosaicRule"]})],i.prototype,"defaultMosaicRule",void 0),a([M("defaultMosaicRule",["defaultMosaicMethod"])],i.prototype,"readDefaultMosaicRule",null),a([u({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),a([u({readOnly:!0,constructOnly:!0})],i.prototype,"exportImageServiceParameters",void 0),a([u()],i.prototype,"rasterInfo",void 0),a([u({readOnly:!0,type:[se]})],i.prototype,"fields",void 0),a([u({readOnly:!0})],i.prototype,"fieldsIndex",null),a([u({type:["png","png8","png24","png32","jpg","bmp","gif","jpgpng","lerc","tiff"],json:{write:!0}})],i.prototype,"format",null),a([M("service","format",["serviceDataType"])],i.prototype,"readFormat",null),a([u({type:fe})],i.prototype,"fullExtent",void 0),a([u({readOnly:!0})],i.prototype,"hasMultidimensions",void 0),a([u({json:{read:{source:"maxImageHeight"}}})],i.prototype,"imageMaxHeight",void 0),a([u({json:{read:{source:"maxImageWidth"}}})],i.prototype,"imageMaxWidth",void 0),a([u({type:String,json:{type:Y.jsonValues,read:Y.read,write:Y.write}})],i.prototype,"interpolation",void 0),a([u()],i.prototype,"minScale",void 0),a([M("service","minScale")],i.prototype,"readMinScale",null),a([u()],i.prototype,"maxScale",void 0),a([M("service","maxScale")],i.prototype,"readMaxScale",null),a([u({type:H})],i.prototype,"mosaicRule",null),a([M("mosaicRule",["mosaicRule","defaultMosaicMethod"])],i.prototype,"readMosaicRule",null),a([V("mosaicRule")],i.prototype,"writeMosaicRule",null),a([u()],i.prototype,"multidimensionalInfo",null),a([u({type:Mt,json:{write:!0}})],i.prototype,"multidimensionalSubset",void 0),a([u({json:{type:pe}})],i.prototype,"noData",void 0),a([V("noData")],i.prototype,"writeNoData",null),a([u({type:String,json:{type:ye.jsonValues,read:ye.read,write:ye.write}})],i.prototype,"noDataInterpretation",void 0),a([u({type:String,readOnly:!0,json:{read:{source:["fields"]}}})],i.prototype,"objectIdField",void 0),a([M("objectIdField")],i.prototype,"readObjectIdField",null),a([u({})],i.prototype,"geometryType",void 0),a([u({})],i.prototype,"typeIdField",void 0),a([u({})],i.prototype,"types",void 0),a([u({readOnly:!0})],i.prototype,"parsedUrl",null),a([u({type:Function})],i.prototype,"pixelFilter",void 0),a([u()],i.prototype,"raster",void 0),a([u({readOnly:!0})],i.prototype,"sourceType",void 0),a([M("sourceType",["serviceSourceType","fields"])],i.prototype,"readSourceType",null),a([u()],i.prototype,"viewId",void 0),a([u({types:At,json:{name:"layerDefinition.drawingInfo.renderer",origins:{"web-scene":{types:$t,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],i.prototype,"renderer",null),a([M("renderer")],i.prototype,"readRenderer",null),a([V("renderer")],i.prototype,"writeRenderer",null),a([u()],i.prototype,"symbolizer",void 0),a([u(lt)],i.prototype,"opacity",void 0),a([u({readOnly:!0})],i.prototype,"rasterFields",null),a([u({constructOnly:!0})],i.prototype,"rasterFunctionInfos",void 0),a([u({type:x})],i.prototype,"renderingRule",null),a([M("renderingRule",["renderingRule","rasterFunctionInfos"])],i.prototype,"readRenderingRule",null),a([V("renderingRule")],i.prototype,"writeRenderingRule",null),a([u()],i.prototype,"serviceDataType",void 0),a([u({readOnly:!0,type:oe})],i.prototype,"spatialReference",void 0),a([M("spatialReference",["spatialReference","extent"])],i.prototype,"readSpatialReference",null),a([u({json:{type:Ie.jsonValues}})],i.prototype,"pixelType",void 0),a([M("pixelType")],i.prototype,"readPixelType",null),a([V("pixelType")],i.prototype,"writePixelType",null),a([u({constructOnly:!0,type:Ke})],i.prototype,"serviceRasterInfo",void 0),a([u()],i.prototype,"sourceJSON",void 0),a([u(ut)],i.prototype,"url",void 0),a([u({readOnly:!0})],i.prototype,"version",void 0),a([M("version",["currentVersion","fields","timeInfo"])],i.prototype,"readVersion",null),i=a([E("esri.layers.mixins.ArcGISImageService")],i),i};let q=class extends bt(vt(wt(St(xt(Mi(It(Ft(Tt(Dt(jt)))))))))){constructor(...r){super(...r),this.legendEnabled=!0,this.isReference=null,this.operationalLayerType="ArcGISImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.type="imagery"}normalizeCtorArgs(r,i){return typeof r=="string"?{url:r,...i}:r}load(r){const i=I(r)?r.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},r).catch(Nt).then(()=>this._fetchService(i))),Promise.resolve(this)}writeOperationalLayerType(r,i,o){var t;const e=((t=this.renderer)==null?void 0:t.type)==="vector-field";i[o]=e?"ArcGISImageServiceVectorLayer":"ArcGISImageServiceLayer"}get defaultPopupTemplate(){return this.createPopupTemplate()}createPopupTemplate(r){const i=this.rasterFields,o=this.title,e=new Set;let t=!1,s=!1;this.capabilities&&(t=this.capabilities.operations.supportsQuery&&this.fields&&this.fields.length>0,s=this.serviceDataType==="esriImageServiceDataTypeVector-UV"||this.serviceDataType==="esriImageServiceDataTypeVector-MagDir");const n=new Set;t&&n.add("raster.itempixelvalue");for(const l of i){const p=l.name.toLowerCase();n.has(p)||p.includes("raster.servicepixelvalue.")||e.add(l.name)}return s&&e.add("raster.magnitude").add("raster.direction"),Pt({fields:i,title:o},{...r,visibleFieldNames:e})}queryFeatures(r,i){return this.queryRasters(r,i).then(o=>{if(o!=null&&o.features)for(const e of o.features)e.layer=e.sourceLayer=this;return o})}queryFeatureCount(r,i){return this.queryRasterCount(r,i)}redraw(){this.emit("redraw")}serviceSupportsSpatialReference(r){return Ct(this,r)}};a([u(_t)],q.prototype,"legendEnabled",void 0),a([u({type:["show","hide"]})],q.prototype,"listMode",void 0),a([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],q.prototype,"isReference",void 0),a([u({type:["ArcGISImageServiceLayer"],json:{origins:{"web-map":{type:["ArcGISImageServiceLayer","ArcGISImageServiceVectorLayer"],read:!1,write:{target:"layerType",ignoreOrigin:!0}}}}})],q.prototype,"operationalLayerType",void 0),a([V("web-map","operationalLayerType")],q.prototype,"writeOperationalLayerType",null),a([u(Ot)],q.prototype,"popupEnabled",void 0),a([u({type:Vt,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],q.prototype,"popupTemplate",void 0),a([u({readOnly:!0})],q.prototype,"defaultPopupTemplate",null),a([u({readOnly:!0,json:{read:!1}})],q.prototype,"type",void 0),q=a([E("esri.layers.ImageryLayer")],q);const Qi=q;export{Qi as default}; diff --git a/assets/ImageryLayerView2D.52654f54.js b/assets/ImageryLayerView2D.f0826692.js similarity index 86% rename from assets/ImageryLayerView2D.52654f54.js rename to assets/ImageryLayerView2D.f0826692.js index edf5ca5..c3762bb 100644 --- a/assets/ImageryLayerView2D.52654f54.js +++ b/assets/ImageryLayerView2D.f0826692.js @@ -1 +1 @@ -import{a6 as a,a7 as o,a8 as v,a9 as T,x as _,s as P,d1 as f,c as b,dn as z,cU as k,j as E,dA as A,u as I,_ as g,c_ as R,U,da as M,n as $,dd as O,af as V,dB as j,dz as S,cE as q}from"./index.d94abe07.js";import{y as N,d as J}from"./RasterVFDisplayObject.3d75d94d.js";import{y as L,u as G}from"./LayerView.42d17220.js";import{o as H}from"./BaseGraphicContainer.6b1c597d.js";import{n as W}from"./HighlightGraphicContainer.9bc65ba9.js";import{A as K}from"./pixelUtils.82950e1a.js";import{a as Q}from"./BitmapContainer.3274be0c.js";import{i as X}from"./utils.4b023c9d.js";import{i as Y}from"./Bitmap.43defcb1.js";import{v as Z}from"./ExportStrategy.e65233e4.js";import{J as ee}from"./rasterProjectionHelper.0a540f3d.js";import{x as te,d as ie}from"./dataUtils.0f9b810f.js";import{o as re,d as se}from"./WGLContainer.1850619d.js";import{I as D}from"./Utils.7f6f3a6b.js";import{s as ae}from"./popupUtils.4abb3ffd.js";import{i as oe}from"./RefreshableLayerView.28a00159.js";import"./VertexArrayObject.a4c1d809.js";import"./Texture.4c97bad5.js";import"./enums.2d9e6f64.js";import"./VertexElementDescriptor.1fdca6da.js";import"./ExpandedCIM.f0b7f36d.js";import"./BidiEngine.d8bba3fc.js";import"./enums.0295eb81.js";import"./MaterialKey.229b1dd6.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.0d428d19.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.df11258c.js";import"./normalizeUtilsSync.757b5fd1.js";import"./projectionSupport.0542c13b.js";import"./json.879c9adc.js";import"./FeatureContainer.4ca52b51.js";import"./TileContainer.8b7fafe2.js";import"./visualVariablesUtils.32e27706.js";import"./visualVariablesUtils.aff73e6d.js";import"./Matcher.fe0c3dcf.js";import"./tileUtils.44921ab9.js";import"./TileClipper.8c399a8a.js";import"./Geometry.d049a63c.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./devEnvironmentUtils.d8d0484c.js";import"./schemaUtils.69ad92d2.js";import"./createSymbolSchema.e54d2060.js";import"./util.ab699fea.js";import"./ComputedAttributeStorage.c1cb22b3.js";import"./centroid.cc817cc5.js";import"./vec3f32.1121a836.js";import"./ProgramTemplate.e9a5aa54.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";let h=class extends T{constructor(){super(...arguments),this.attached=!1,this.container=new X,this.updateRequested=!1,this.type="imagery",this._bitmapView=new Q}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(e){this.strategy.update(e).catch(t=>{_(t)||P.getLogger(this.declaredClass).error(t)})}hitTest(e){return new f({attributes:{},geometry:e.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const e=this.layer.version>=10,t=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,i=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new Z({container:this._bitmapView,imageNormalizationSupported:e,imageMaxHeight:t,imageMaxWidth:i,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports(async e=>{var r;if(e.source instanceof HTMLImageElement)return;const t=await this.layer.applyRenderer({extent:e.source.extent,pixelBlock:(r=e.source.originalPixelBlock)!=null?r:e.source.pixelBlock}),i=e.source;i.filter=s=>this.layer.pixelFilter?this.layer.applyFilter(s):{...t,extent:i.extent}}).catch(e=>{_(e)||P.getLogger(this.declaredClass).error(e)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const e=this.strategy.bitmaps;if(e.length===1&&e[0].source)return{extent:e[0].source.extent,pixelBlock:e[0].source.originalPixelBlock};if(e.length>1){const t=this.view.extent,i=e.map(s=>s.source).filter(s=>s.extent&&s.extent.intersects(t)).map(s=>({extent:s.extent,pixelBlock:s.originalPixelBlock})),r=K(i,t);return b(r)?{extent:r.extent,pixelBlock:r.pixelBlock}:null}return null}_fetchImage(e,t,i,r){return(r=r||{}).timeExtent=this.timeExtent,r.requestAsImageElement=!0,this.layer.fetchImage(e,t,i,r).then(s=>s.imageOrCanvasElement?s.imageOrCanvasElement:this.layer.applyRenderer(s.pixelData,{signal:r.signal}).then(n=>{const l=new Y(n.pixelBlock,n.extent.clone(),s.pixelData.pixelBlock);return l.filter=u=>this.layer.applyFilter(u),l}))}};a([o()],h.prototype,"attached",void 0),a([o()],h.prototype,"container",void 0),a([o()],h.prototype,"layer",void 0),a([o()],h.prototype,"strategy",void 0),a([o()],h.prototype,"timeExtent",void 0),a([o()],h.prototype,"view",void 0),a([o()],h.prototype,"updateRequested",void 0),a([o()],h.prototype,"updating",null),a([o()],h.prototype,"type",void 0),h=a([v("esri.views.2d.layers.imagery.ImageryView2D")],h);const ne=h;class le extends re{constructor(){super(...arguments),this.symbolTypes=["triangle"]}get requiresDedicatedFBO(){return!1}prepareRenderPasses(t){const i=t.registerRenderPass({name:"imagery (vf)",brushes:[se],target:()=>this.children,drawPhase:D.MAP});return[...super.prepareRenderPasses(t),i]}doRender(t){this.visible&&t.drawPhase===D.MAP&&this.symbolTypes.forEach(i=>{t.renderPass=i,super.doRender(t)})}}let y=class extends T{constructor(e){super(e),this.update=z((t,i)=>this._update(t,i).catch(r=>{_(r)||P.getLogger(this.declaredClass).error(r)}))}get updating(){return!!this._loading}redraw(e){if(!this.container.children.length)return;const t=this.container.children[0];t.symbolizerParameters=e,t.invalidateVAO(),this.container.symbolTypes=e.style==="wind_speed"?["scalar","triangle"]:e.style==="simple_scalar"?["scalar"]:["triangle"],this.container.requestRender()}async _update(e,t,i){if(!e.stationary)return;const{extent:r,spatialReference:s}=e.state,n=new k({xmin:r.xmin,ymin:r.ymin,xmax:r.xmax,ymax:r.ymax,spatialReference:s}),[l,u]=e.state.size;this._loading=this.fetchPixels(n,l,u,i);const d=await this._loading;this._addToDisplay(d,t,e.state),this._loading=null}_addToDisplay(e,t,i){if(E(e.pixelBlock))return this.container.children.forEach(l=>l.destroy()),void this.container.removeAllChildren();const{extent:r,pixelBlock:s}=e,n=new N(s);n.offset=[0,0],n.symbolizerParameters=t,n.rawPixelData=e,n.invalidateVAO(),n.x=r.xmin,n.y=r.ymax,n.pixelRatio=i.pixelRatio,n.rotation=i.rotation,n.resolution=i.resolution,n.width=s.width*t.symbolTileSize,n.height=s.height*t.symbolTileSize,this.container.children.forEach(l=>l.destroy()),this.container.removeAllChildren(),this.container.symbolTypes=t.style==="wind_speed"?["scalar","triangle"]:t.style==="simple_scalar"?["scalar"]:["triangle"],this.container.addChild(n)}};a([o()],y.prototype,"fetchPixels",void 0),a([o()],y.prototype,"container",void 0),a([o()],y.prototype,"_loading",void 0),a([o()],y.prototype,"updating",null),y=a([v("esri.views.2d.layers.imagery.ImageryVFStrategy")],y);const he=y;let p=class extends A{constructor(){super(...arguments),this.attached=!1,this.container=new le,this.type="imageryVF",this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""},this._fetchpixels=async(e,t,i,r)=>{const s=await this._projectFullExtentPromise,{symbolTileSize:n}=this.layer.renderer,{extent:l,width:u,height:d}=te(e,t,i,n,s);if(b(s)&&!s.intersects(e))return{extent:l,pixelBlock:null};const c={bbox:`${l.xmin}, ${l.ymin}, ${l.xmax}, ${l.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:n,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(c)){const m=this.getPixelData();if(b(m)&&`${m.extent.xmin}, ${m.extent.ymin}, ${m.extent.xmax}, ${m.extent.ymax}`===c.bbox)return m}const{pixelData:w}=await this.layer.fetchImage(l,u,d,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:r});return this._dataParameters=c,E(w.pixelBlock)?{extent:l,pixelBlock:null}:{extent:l,pixelBlock:this.layer.rasterInfo.dataType==="vector-uv"?I(ie(w.pixelBlock,"vector-uv")):w.pixelBlock}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference),this._strategy=new he({container:this.container,fetchPixels:this._fetchpixels}),this.handles.add(g(()=>this.layer.renderer,e=>this._updateSymbolizerParams(e),R),"vector-field-view-update")}detach(){this._strategy.destroy(),this.container.children.forEach(e=>e.destroy()),this.container.removeAllChildren(),this.handles.remove("vector-field-view-update"),this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){if(this.updating||!this.container.children.length)return null;const{extent:e,pixelBlock:t}=this.container.children[0].rawPixelData;return{extent:e,pixelBlock:t}}hitTest(e){return new f({attributes:{},geometry:e.clone(),layer:this.layer})}update(e){this._strategy.update(e,this._symbolizerParams)}redraw(){this._updateSymbolizerParams(this.layer.renderer),this._strategy.redraw(this._symbolizerParams)}_canReuseVectorFieldData(e){const t=this._dataParameters.exportParametersVersion===e.exportParametersVersion,i=this._dataParameters.time===e.time,r=this._dataParameters.symbolTileSize===e.symbolTileSize,s=this._dataParameters.bbox===e.bbox;return t&&i&&r&&s}async _getProjectedFullExtent(e){try{return await ee(this.layer.fullExtent,e)}catch{try{const i=(await U(this.layer.url,{query:{option:"footprints",outSR:e.wkid||JSON.stringify(e.toJSON()),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return i?k.fromJSON(i):null}catch{return null}}}_updateSymbolizerParams(e){e.type==="vector-field"&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};a([o()],p.prototype,"attached",void 0),a([o()],p.prototype,"container",void 0),a([o()],p.prototype,"layer",void 0),a([o()],p.prototype,"timeExtent",void 0),a([o()],p.prototype,"type",void 0),a([o()],p.prototype,"view",void 0),a([o()],p.prototype,"updating",null),p=a([v("esri.views.2d.layers.imagery.VectorFieldView2D")],p);const pe=p,de=e=>{let t=class extends e{constructor(){super(...arguments),this.view=null}async fetchPopupFeatures(i,r){const{layer:s}=this;if(!i)throw new $("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:n}=s,l=ae(s,r);if(!n||E(l))throw new $("imagerylayerview:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:n,popupTemplate:l});const u=await l.getRequiredFields(),d=new O;d.timeExtent=this.timeExtent,d.geometry=i,d.outFields=u,d.outSpatialReference=i.spatialReference;const c=this.view.resolution,w=this.view.type==="2d"?new V(c,c,this.view.spatialReference):new V(.5*c,.5*c,this.view.spatialReference),{returnTopmostRaster:m,showNoDataRecords:B}=l.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},C={returnDomainValues:!0,returnTopmostRaster:m,pixelSize:w,showNoDataRecords:B,signal:b(r)?r.signal:null};return s.queryVisibleRasters(d,C).then(F=>F)}canResume(){var i;return!!super.canResume()&&!((i=this.timeExtent)!=null&&i.isEmpty)}};return a([o()],t.prototype,"layer",void 0),a([o()],t.prototype,"suspended",void 0),a([o(M)],t.prototype,"timeExtent",void 0),a([o()],t.prototype,"view",void 0),t=a([v("esri.views.layers.ImageryLayerView")],t),t};let x=class extends de(oe(L(G))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new j,this.subview=null}get pixelData(){return this.updating?null:"getPixelData"in this.subview?this.subview.getPixelData():null}async hitTest(e,t){return this.subview?[{type:"graphic",graphic:this.subview.hitTest(e),layer:this.layer,mapPoint:e}]:null}update(e){var t;(t=this.subview)==null||t.update(e)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new H({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new W(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.handles.add([g(()=>{var e;return(e=this.layer.blendMode)!=null?e:"normal"},e=>this.subview.container.blendMode=e,R),g(()=>{var e;return(e=this.layer.effect)!=null?e:null},e=>this.subview.container.effect=e,R),g(()=>this.layer.exportImageServiceParameters.version,e=>{e&&this._exportImageVersion!==e&&(this._exportImageVersion=e,this.requestUpdate())},S),g(()=>this.timeExtent,e=>{this.subview.timeExtent=e,"redraw"in this.subview?this.requestUpdate():this.subview.redrawOrRefetch()},S),this.layer.on("redraw",()=>{"redraw"in this.subview?this.subview.redraw():this.subview.redrawOrRefetch()}),g(()=>this.layer.renderer,()=>this._setSubView())],"imagerylayerview-update")}detach(){var e,t;this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),(e=this.subview)==null||e.destroy(),this.handles.remove("imagerylayerview-update"),this.subview=null,(t=this._highlightView)==null||t.destroy(),this._exportImageVersion=-1}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}highlight(e,t){if(!((Array.isArray(e)?e[0]:q.isCollection(e)?e.getItemAt(0):e)instanceof f))return{remove:()=>{}};let i=[];return Array.isArray(e)||q.isCollection(e)?i=e.map(r=>r.clone()):e instanceof f&&(i=[e.clone()]),this._highlightGraphics.addMany(i),{remove:()=>{this._highlightGraphics.removeMany(i)}}}async doRefresh(){this.requestUpdate()}isUpdating(){return!this.subview||this.subview.updating}_setSubView(){var i,r;if(!this.view)return;const e=(i=this.layer.renderer)==null?void 0:i.type;let t="imagery";if(e==="vector-field"?t="imageryVF":e==="flow"&&(t="flow"),this.subview){const{type:s}=this.subview;if(s===t)return this._attachSubview(this.subview),void(s==="flow"?this.subview.redrawOrRefetch():s==="imagery"&&this.layer.format==="lerc"?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),(r=this.subview)==null||r.destroy()}this.subview=t==="imagery"?new ne({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):t==="imageryVF"?new pe({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new J({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0),e.container.blendMode=this.layer.blendMode,e.container.effect=this.layer.effect)}_detachSubview(e){e!=null&&e.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}};a([o()],x.prototype,"pixelData",null),a([o()],x.prototype,"subview",void 0),x=a([v("esri.views.2d.layers.ImageryLayerView2D")],x);const ht=x;export{ht as default}; +import{a6 as a,a7 as o,a8 as v,a9 as T,x as _,s as P,d1 as f,c as b,dn as z,cU as k,j as E,dA as A,u as I,_ as g,c_ as R,U,da as M,n as $,dd as O,af as V,dB as j,dz as S,cE as q}from"./index.221827cd.js";import{y as N,d as J}from"./RasterVFDisplayObject.da692284.js";import{y as L,u as G}from"./LayerView.ce6e0535.js";import{o as H}from"./BaseGraphicContainer.7704bbc1.js";import{n as W}from"./HighlightGraphicContainer.a4fdc946.js";import{A as K}from"./pixelUtils.9c6f8dae.js";import{a as Q}from"./BitmapContainer.9e943f6d.js";import{i as X}from"./utils.0160becb.js";import{i as Y}from"./Bitmap.72a3702e.js";import{v as Z}from"./ExportStrategy.fb59ab52.js";import{J as ee}from"./rasterProjectionHelper.f3c10be2.js";import{x as te,d as ie}from"./dataUtils.e7623e56.js";import{o as re,d as se}from"./WGLContainer.347cc5cd.js";import{I as D}from"./Utils.2136650a.js";import{s as ae}from"./popupUtils.c6371f3a.js";import{i as oe}from"./RefreshableLayerView.887ed8c3.js";import"./VertexArrayObject.53cf1857.js";import"./Texture.940076b2.js";import"./enums.2d9e6f64.js";import"./VertexElementDescriptor.1fdca6da.js";import"./ExpandedCIM.a372ce74.js";import"./BidiEngine.d8bba3fc.js";import"./enums.0295eb81.js";import"./MaterialKey.0cadabc1.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.7ff797cc.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.3f71f8e9.js";import"./normalizeUtilsSync.4d52fbd0.js";import"./projectionSupport.4f5da4af.js";import"./json.879c9adc.js";import"./FeatureContainer.b427dd87.js";import"./TileContainer.5aeb32d6.js";import"./visualVariablesUtils.061b7a4e.js";import"./visualVariablesUtils.62efda9d.js";import"./Matcher.6586928a.js";import"./tileUtils.332711ed.js";import"./TileClipper.77103a2e.js";import"./Geometry.d049a63c.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./devEnvironmentUtils.d8d0484c.js";import"./schemaUtils.d20994fa.js";import"./createSymbolSchema.827eb617.js";import"./util.520a352e.js";import"./ComputedAttributeStorage.29767acd.js";import"./centroid.06db4b74.js";import"./vec3f32.1121a836.js";import"./ProgramTemplate.cf9dd4e8.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";let h=class extends T{constructor(){super(...arguments),this.attached=!1,this.container=new X,this.updateRequested=!1,this.type="imagery",this._bitmapView=new Q}destroy(){this.attached&&(this.detach(),this.attached=!1),this.updateRequested=!1}get updating(){return!this.attached||this.isUpdating()}update(e){this.strategy.update(e).catch(t=>{_(t)||P.getLogger(this.declaredClass).error(t)})}hitTest(e){return new f({attributes:{},geometry:e.clone(),layer:this.layer})}attach(){this.container.addChild(this._bitmapView);const e=this.layer.version>=10,t=this.layer.version>=10.1?this.layer.imageMaxHeight:2048,i=this.layer.version>=10.1?this.layer.imageMaxWidth:2048;this.strategy=new Z({container:this._bitmapView,imageNormalizationSupported:e,imageMaxHeight:t,imageMaxWidth:i,fetchSource:this._fetchImage.bind(this),requestUpdate:()=>this.requestUpdate()})}detach(){this.strategy.destroy(),this._bitmapView.removeAllChildren(),this.container.removeAllChildren(),this.updateRequested=!1}redraw(){this.strategy.updateExports(async e=>{var r;if(e.source instanceof HTMLImageElement)return;const t=await this.layer.applyRenderer({extent:e.source.extent,pixelBlock:(r=e.source.originalPixelBlock)!=null?r:e.source.pixelBlock}),i=e.source;i.filter=s=>this.layer.pixelFilter?this.layer.applyFilter(s):{...t,extent:i.extent}}).catch(e=>{_(e)||P.getLogger(this.declaredClass).error(e)})}requestUpdate(){this.updateRequested||(this.updateRequested=!0,this.view.requestUpdate())}isUpdating(){return this.strategy.updating||this.updateRequested}getPixelData(){if(this.updating)return null;const e=this.strategy.bitmaps;if(e.length===1&&e[0].source)return{extent:e[0].source.extent,pixelBlock:e[0].source.originalPixelBlock};if(e.length>1){const t=this.view.extent,i=e.map(s=>s.source).filter(s=>s.extent&&s.extent.intersects(t)).map(s=>({extent:s.extent,pixelBlock:s.originalPixelBlock})),r=K(i,t);return b(r)?{extent:r.extent,pixelBlock:r.pixelBlock}:null}return null}_fetchImage(e,t,i,r){return(r=r||{}).timeExtent=this.timeExtent,r.requestAsImageElement=!0,this.layer.fetchImage(e,t,i,r).then(s=>s.imageOrCanvasElement?s.imageOrCanvasElement:this.layer.applyRenderer(s.pixelData,{signal:r.signal}).then(n=>{const l=new Y(n.pixelBlock,n.extent.clone(),s.pixelData.pixelBlock);return l.filter=u=>this.layer.applyFilter(u),l}))}};a([o()],h.prototype,"attached",void 0),a([o()],h.prototype,"container",void 0),a([o()],h.prototype,"layer",void 0),a([o()],h.prototype,"strategy",void 0),a([o()],h.prototype,"timeExtent",void 0),a([o()],h.prototype,"view",void 0),a([o()],h.prototype,"updateRequested",void 0),a([o()],h.prototype,"updating",null),a([o()],h.prototype,"type",void 0),h=a([v("esri.views.2d.layers.imagery.ImageryView2D")],h);const ne=h;class le extends re{constructor(){super(...arguments),this.symbolTypes=["triangle"]}get requiresDedicatedFBO(){return!1}prepareRenderPasses(t){const i=t.registerRenderPass({name:"imagery (vf)",brushes:[se],target:()=>this.children,drawPhase:D.MAP});return[...super.prepareRenderPasses(t),i]}doRender(t){this.visible&&t.drawPhase===D.MAP&&this.symbolTypes.forEach(i=>{t.renderPass=i,super.doRender(t)})}}let y=class extends T{constructor(e){super(e),this.update=z((t,i)=>this._update(t,i).catch(r=>{_(r)||P.getLogger(this.declaredClass).error(r)}))}get updating(){return!!this._loading}redraw(e){if(!this.container.children.length)return;const t=this.container.children[0];t.symbolizerParameters=e,t.invalidateVAO(),this.container.symbolTypes=e.style==="wind_speed"?["scalar","triangle"]:e.style==="simple_scalar"?["scalar"]:["triangle"],this.container.requestRender()}async _update(e,t,i){if(!e.stationary)return;const{extent:r,spatialReference:s}=e.state,n=new k({xmin:r.xmin,ymin:r.ymin,xmax:r.xmax,ymax:r.ymax,spatialReference:s}),[l,u]=e.state.size;this._loading=this.fetchPixels(n,l,u,i);const d=await this._loading;this._addToDisplay(d,t,e.state),this._loading=null}_addToDisplay(e,t,i){if(E(e.pixelBlock))return this.container.children.forEach(l=>l.destroy()),void this.container.removeAllChildren();const{extent:r,pixelBlock:s}=e,n=new N(s);n.offset=[0,0],n.symbolizerParameters=t,n.rawPixelData=e,n.invalidateVAO(),n.x=r.xmin,n.y=r.ymax,n.pixelRatio=i.pixelRatio,n.rotation=i.rotation,n.resolution=i.resolution,n.width=s.width*t.symbolTileSize,n.height=s.height*t.symbolTileSize,this.container.children.forEach(l=>l.destroy()),this.container.removeAllChildren(),this.container.symbolTypes=t.style==="wind_speed"?["scalar","triangle"]:t.style==="simple_scalar"?["scalar"]:["triangle"],this.container.addChild(n)}};a([o()],y.prototype,"fetchPixels",void 0),a([o()],y.prototype,"container",void 0),a([o()],y.prototype,"_loading",void 0),a([o()],y.prototype,"updating",null),y=a([v("esri.views.2d.layers.imagery.ImageryVFStrategy")],y);const he=y;let p=class extends A{constructor(){super(...arguments),this.attached=!1,this.container=new le,this.type="imageryVF",this._dataParameters={exportParametersVersion:0,bbox:"",symbolTileSize:0,time:""},this._fetchpixels=async(e,t,i,r)=>{const s=await this._projectFullExtentPromise,{symbolTileSize:n}=this.layer.renderer,{extent:l,width:u,height:d}=te(e,t,i,n,s);if(b(s)&&!s.intersects(e))return{extent:l,pixelBlock:null};const c={bbox:`${l.xmin}, ${l.ymin}, ${l.xmax}, ${l.ymax}`,exportParametersVersion:this.layer.exportImageServiceParameters.version,symbolTileSize:n,time:JSON.stringify(this.timeExtent||"")};if(this._canReuseVectorFieldData(c)){const m=this.getPixelData();if(b(m)&&`${m.extent.xmin}, ${m.extent.ymin}, ${m.extent.xmax}, ${m.extent.ymax}`===c.bbox)return m}const{pixelData:w}=await this.layer.fetchImage(l,u,d,{timeExtent:this.timeExtent,requestAsImageElement:!1,signal:r});return this._dataParameters=c,E(w.pixelBlock)?{extent:l,pixelBlock:null}:{extent:l,pixelBlock:this.layer.rasterInfo.dataType==="vector-uv"?I(ie(w.pixelBlock,"vector-uv")):w.pixelBlock}}}get updating(){return!this.attached||this._strategy.updating}attach(){this._projectFullExtentPromise=this._getProjectedFullExtent(this.view.spatialReference),this._strategy=new he({container:this.container,fetchPixels:this._fetchpixels}),this.handles.add(g(()=>this.layer.renderer,e=>this._updateSymbolizerParams(e),R),"vector-field-view-update")}detach(){this._strategy.destroy(),this.container.children.forEach(e=>e.destroy()),this.container.removeAllChildren(),this.handles.remove("vector-field-view-update"),this._strategy=this.container=this._projectFullExtentPromise=null}getPixelData(){if(this.updating||!this.container.children.length)return null;const{extent:e,pixelBlock:t}=this.container.children[0].rawPixelData;return{extent:e,pixelBlock:t}}hitTest(e){return new f({attributes:{},geometry:e.clone(),layer:this.layer})}update(e){this._strategy.update(e,this._symbolizerParams)}redraw(){this._updateSymbolizerParams(this.layer.renderer),this._strategy.redraw(this._symbolizerParams)}_canReuseVectorFieldData(e){const t=this._dataParameters.exportParametersVersion===e.exportParametersVersion,i=this._dataParameters.time===e.time,r=this._dataParameters.symbolTileSize===e.symbolTileSize,s=this._dataParameters.bbox===e.bbox;return t&&i&&r&&s}async _getProjectedFullExtent(e){try{return await ee(this.layer.fullExtent,e)}catch{try{const i=(await U(this.layer.url,{query:{option:"footprints",outSR:e.wkid||JSON.stringify(e.toJSON()),f:"json"}})).data.featureCollection.layers[0].layerDefinition.extent;return i?k.fromJSON(i):null}catch{return null}}}_updateSymbolizerParams(e){e.type==="vector-field"&&(this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null}))}};a([o()],p.prototype,"attached",void 0),a([o()],p.prototype,"container",void 0),a([o()],p.prototype,"layer",void 0),a([o()],p.prototype,"timeExtent",void 0),a([o()],p.prototype,"type",void 0),a([o()],p.prototype,"view",void 0),a([o()],p.prototype,"updating",null),p=a([v("esri.views.2d.layers.imagery.VectorFieldView2D")],p);const pe=p,de=e=>{let t=class extends e{constructor(){super(...arguments),this.view=null}async fetchPopupFeatures(i,r){const{layer:s}=this;if(!i)throw new $("imagerylayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const{popupEnabled:n}=s,l=ae(s,r);if(!n||E(l))throw new $("imagerylayerview:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:n,popupTemplate:l});const u=await l.getRequiredFields(),d=new O;d.timeExtent=this.timeExtent,d.geometry=i,d.outFields=u,d.outSpatialReference=i.spatialReference;const c=this.view.resolution,w=this.view.type==="2d"?new V(c,c,this.view.spatialReference):new V(.5*c,.5*c,this.view.spatialReference),{returnTopmostRaster:m,showNoDataRecords:B}=l.layerOptions||{returnTopmostRaster:!0,showNoDataRecords:!1},C={returnDomainValues:!0,returnTopmostRaster:m,pixelSize:w,showNoDataRecords:B,signal:b(r)?r.signal:null};return s.queryVisibleRasters(d,C).then(F=>F)}canResume(){var i;return!!super.canResume()&&!((i=this.timeExtent)!=null&&i.isEmpty)}};return a([o()],t.prototype,"layer",void 0),a([o()],t.prototype,"suspended",void 0),a([o(M)],t.prototype,"timeExtent",void 0),a([o()],t.prototype,"view",void 0),t=a([v("esri.views.layers.ImageryLayerView")],t),t};let x=class extends de(oe(L(G))){constructor(){super(...arguments),this._exportImageVersion=-1,this._highlightGraphics=new j,this.subview=null}get pixelData(){return this.updating?null:"getPixelData"in this.subview?this.subview.getPixelData():null}async hitTest(e,t){return this.subview?[{type:"graphic",graphic:this.subview.hitTest(e),layer:this.layer,mapPoint:e}]:null}update(e){var t;(t=this.subview)==null||t.update(e)}attach(){this.layer.increaseRasterJobHandlerUsage(),this._setSubView(),this.view&&(this._highlightView=new H({view:this.view,graphics:this._highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new W(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container)),this.handles.add([g(()=>{var e;return(e=this.layer.blendMode)!=null?e:"normal"},e=>this.subview.container.blendMode=e,R),g(()=>{var e;return(e=this.layer.effect)!=null?e:null},e=>this.subview.container.effect=e,R),g(()=>this.layer.exportImageServiceParameters.version,e=>{e&&this._exportImageVersion!==e&&(this._exportImageVersion=e,this.requestUpdate())},S),g(()=>this.timeExtent,e=>{this.subview.timeExtent=e,"redraw"in this.subview?this.requestUpdate():this.subview.redrawOrRefetch()},S),this.layer.on("redraw",()=>{"redraw"in this.subview?this.subview.redraw():this.subview.redrawOrRefetch()}),g(()=>this.layer.renderer,()=>this._setSubView())],"imagerylayerview-update")}detach(){var e,t;this.layer.decreaseRasterJobHandlerUsage(),this.container.removeAllChildren(),this._detachSubview(this.subview),(e=this.subview)==null||e.destroy(),this.handles.remove("imagerylayerview-update"),this.subview=null,(t=this._highlightView)==null||t.destroy(),this._exportImageVersion=-1}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}highlight(e,t){if(!((Array.isArray(e)?e[0]:q.isCollection(e)?e.getItemAt(0):e)instanceof f))return{remove:()=>{}};let i=[];return Array.isArray(e)||q.isCollection(e)?i=e.map(r=>r.clone()):e instanceof f&&(i=[e.clone()]),this._highlightGraphics.addMany(i),{remove:()=>{this._highlightGraphics.removeMany(i)}}}async doRefresh(){this.requestUpdate()}isUpdating(){return!this.subview||this.subview.updating}_setSubView(){var i,r;if(!this.view)return;const e=(i=this.layer.renderer)==null?void 0:i.type;let t="imagery";if(e==="vector-field"?t="imageryVF":e==="flow"&&(t="flow"),this.subview){const{type:s}=this.subview;if(s===t)return this._attachSubview(this.subview),void(s==="flow"?this.subview.redrawOrRefetch():s==="imagery"&&this.layer.format==="lerc"?this.subview.redraw():this.requestUpdate());this._detachSubview(this.subview),(r=this.subview)==null||r.destroy()}this.subview=t==="imagery"?new ne({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):t==="imageryVF"?new pe({layer:this.layer,view:this.view,timeExtent:this.timeExtent}):new J({layer:this.layer,layerView:this}),this._attachSubview(this.subview),this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0),e.container.blendMode=this.layer.blendMode,e.container.effect=this.layer.effect)}_detachSubview(e){e!=null&&e.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}};a([o()],x.prototype,"pixelData",null),a([o()],x.prototype,"subview",void 0),x=a([v("esri.views.2d.layers.ImageryLayerView2D")],x);const ht=x;export{ht as default}; diff --git a/assets/ImageryTileLayer.f9fb83b4.js b/assets/ImageryTileLayer.e6833128.js similarity index 99% rename from assets/ImageryTileLayer.f9fb83b4.js rename to assets/ImageryTileLayer.e6833128.js index f48918d..60ea9f6 100644 --- a/assets/ImageryTileLayer.f9fb83b4.js +++ b/assets/ImageryTileLayer.e6833128.js @@ -1,2 +1,2 @@ -import{d0 as nt,du as fe,c as C,jb as qe,s as Ue,n as $,d$ as at,af as J,u as X,j as M,cU as q,U as Ve,ba as ot,C as lt,a6 as I,a7 as S,eK as Xe,a8 as Q,cx as ct,aT as H,ax as ut,d3 as Ye,cB as Ke,m as ht,D as ft,cN as dt,bX as mt,i2 as pt,i3 as yt,eF as gt,eG as xt,iJ as It,iM as wt,ia as bt,eH as St,aU as vt,gG as he,id as Tt,_ as Rt,h0 as _t,ei as kt,iE as Ct,dv as Ft,d2 as Pt,cF as Mt}from"./index.d94abe07.js";import{c as $t,w as Ot,l as Qe,$ as Be,V as Bt,L as Dt,j as Et,n as Nt,m as zt,u as Jt,o as Ht,a as Lt}from"./fetchRasterInfo.d4fdc8d4.js";import{f as Ze,g as At,i as Wt,s as jt,p as et,c as De,m as Gt,d as qt}from"./multidimensionalUtils.4f713da1.js";import{S as Ut,b as de,T as Vt,r as Ee,e as me,p as Xt,j as Fe,P as Yt,l as Kt,N as Qt,D as Zt,m as ye,G as ei,q as ti,O as ii}from"./RasterSymbolizer.4ee6ff2c.js";import{a as Ne,x as ze,h as Je,d as si,m as ri}from"./RawBlockCache.73929591.js";import{T as ve,D as ni,j as ai,W as oi,b as li,g as ci}from"./pixelUtils.82950e1a.js";import{T as He,U as ge,j as Le,o as Ae,n as ui,Q as Te,J as Re,$ as hi,V as fi,C as di}from"./rasterProjectionHelper.0a540f3d.js";import{m as mi,b as pi,d as yi,f as gi}from"./dataUtils.0f9b810f.js";import{l as tt,f as xi,i as Ii,m as Pe,c as wi}from"./utils.9731fda2.js";import{n as bi,z as Si}from"./TilemapCache.11964483.js";import"./generateRendererUtils.ebdde5b7.js";import"./colorUtils.bb6424b7.js";const xe=8;let V=class extends nt(ct){constructor(){super(...arguments),this.rasterJobHandler=null,this.datasetName=null,this.datasetFormat=null,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=He();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:fe.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=ge(e.spatialReference);return C(t)&&e.extent.width>=t/2}set url(e){this._set("url",qe(e,Ue.getLogger(this.declaredClass)))}async open(e){throw new $("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,t,s,i={}){const r=i.tileInfo||this.rasterInfo.storageInfo.tileInfo,n=this.getTileExtentFromTileInfo(e,t,s,r);return this.fetchPixels(n,r.size[0],r.size[1],i)}async identify(e,t={}){var _,P;e=at(J,e).clone().normalize();const{multidimensionalDefinition:s,timeExtent:i}=t,{hasMultidimensionalTranspose:r,multidimensionalInfo:n}=this.rasterInfo;let{transposedVariableName:a}=t;const c=C(n)&&r&&(i!=null||Ze(s));c&&!a&&(a=C(s)&&s.length>0?(_=s[0].variableName)!=null?_:void 0:n.variables[0].name,t={...t,transposedVariableName:a}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:o,extent:l}=this.rasterInfo,{datumTransformation:u}=t;let h=Le(e,o,u);if(!l.intersects(h))return{location:h,value:null};if(C(this.rasterInfo.transform)){const B=this.rasterInfo.transform.inverseTransform(h);if(!this.rasterInfo.nativeExtent.intersects(B))return{location:B,value:null};h=B}let f=0;const d=C(a)&&C(n)&&this.rasterInfo.hasMultidimensionalTranspose;if(!d){if(t.srcResolution)f=Ae(t.srcResolution,this.rasterInfo,this.ioConfig.sampling).pyramidLevel;else if(f=await this.computeBestPyramidLevelForLocation(e,t),f==null)return{location:h,value:null}}const p=this.identifyPixelLocation(h,f,null,d);if(p===null)return{location:h,value:null};const{row:y,col:m,rowOffset:g,colOffset:w,blockWidth:x}=p,F=a!=null?a:X(t.sliceId),k=Ne(this.url,F),T=`${f}/${y}/${m}`;let v=ze(k,null,T);M(v)&&(v=this.fetchRawTile(f,y,m,t),Je(k,null,T,v));const R=await v;if(M(R)||!((P=R.pixels)!=null&&P.length))return{location:h,value:null};const b=g*x+w;return this._processIdentifyResult(R,{srcLocation:h,position:b,pyramidLevel:f,useTransposedTile:!!d,requestSomeSlices:c,identifyOptions:t})}async fetchPixels(e,t,s,i={}){if(e=ui(e),(i=this._getRequestOptionsWithSliceId(i)).requestRawData)return this._fetchPixels(e,t,s,i);const r=ge(e.spatialReference),n=Te(e);if(M(r)||n===0||n===1&&this._isGlobalWrappableSource)return this._fetchPixels(e,t,s,i);if(n>=3)return{extent:e,pixelBlock:null};const a=[],{xmin:c,xmax:o}=e,l=Math.round(r/(o-c)*t),u=l-Math.round((r/2-c)/(o-c)*t);let h=0;const f=[];for(let m=0;m<=n;m++){const g=new q({xmin:m===0?c:-r/2,xmax:m===n?o-r*m:r/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),w=m===0?l-u:m===n?t-h:l;h+=w,f.push(w);const x=i.disableWrapAround&&m>0?null:this._fetchPixels(g,w,s,i);a.push(x)}const d=(await Promise.all(a)).map(m=>m==null?void 0:m.pixelBlock);let p=null;const y={width:t,height:s};return this.rasterJobHandler?p=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:y,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:f},i)).pixelBlock:p=ve(d,y,{blockWidths:f}),{extent:e,srcExtent:Re(e,this.rasterInfo.spatialReference,i.datumTransformation),pixelBlock:p}}async fetchRawPixels(e,t,s,i={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const r=await this._fetchRawTiles(e,t,s,i),{nativeExtent:n,nativePixelSize:a,storageInfo:c}=this.rasterInfo,o=2**e,l=a.x*o,u=a.y*o,h=new q({xmin:n.xmin+l*t.x,xmax:n.xmin+l*(t.x+s.width-1),ymin:n.ymax-u*(t.y+s.height-1),ymax:n.ymax-u*t.y,spatialReference:n.spatialReference});if(!r)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:f,mosaicSize:d}=r;if(f.length===1&&C(f[0])&&f[0].width===s.width&&f[0].height===s.height)return{extent:h,srcExtent:h,pixelBlock:r.pixelBlocks[0]};const p=e>0?c.pyramidBlockWidth:c.blockWidth,y=e>0?c.pyramidBlockHeight:c.blockHeight,m={x:t.x%p,y:t.y%y};let g;return this.rasterJobHandler?g=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:f,srcMosaicSize:d,destDimension:s,clipOffset:m,clipSize:s,coefs:null,sampleSpacing:null,interpolation:i.interpolation,alignmentInfo:null,blockWidths:null},i)).pixelBlock:g=ve(f,d,{clipOffset:m,clipSize:s}),{extent:h,srcExtent:h,pixelBlock:g}}fetchRawTile(e,t,s,i){throw new $("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return Re(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?Ut(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,s=0){var o;const{customFetchParameters:i}=this.ioConfig,{range:r,query:n,headers:a}=t;s=(o=s!=null?s:t.retryCount)!=null?o:this.ioConfig.retryCount;const c=r?{Range:`bytes=${r.from}-${r.to}`}:null;try{return await Ve(e,{...t,query:{...n,...i},headers:{...a,...c}})}catch(l){if(s>0)return s--,this.request(e,t,s);throw l}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return M(t)||M(e)||e.length===0?null:At(e,t)}getTileExtentFromTileInfo(e,t,s,i){const r=ot(i.lodAt(e));return this.getTileExtent({x:r.resolution,y:r.resolution},t,s,i.origin,i.spatialReference,i.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:s,pixelSize:i}=this.rasterInfo;if(!e.tileInfo){const r=[],n=e.maximumPyramidLevel||0;let a=Math.max(i.x,i.y),c=1/.0254*96*a;for(let l=0;l<=n;l++)r.push({level:n-l,resolution:a,scale:c}),a*=2,c*=2;const o=new J({x:s.xmin,y:s.ymax,spatialReference:t});e.tileInfo=new fe({origin:o,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:r}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,s=512,i){const{width:r,height:n,nativeExtent:a,pixelSize:c,spatialReference:o}=e,l=new J({x:a.xmin,y:a.ymax,spatialReference:o});i==null&&(i=Math.max(0,Math.round(Math.log(Math.max(r,n))/Math.LN2-8)));const u=this.computeBlockBoundary(a,512,512,{x:a.xmin,y:a.ymax},[c],i);e.storageInfo=new de({blockWidth:t,blockHeight:s,pyramidBlockWidth:t,pyramidBlockHeight:s,origin:l,firstPyramidLevel:1,maximumPyramidLevel:i,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,s,i,r,n=0,a=2){if(r.length===1&&n>0){r=[...r];let{x:u,y:h}=r[0];for(let f=0;fc)return null;const d=this.getPyramidPixelSize(t),{x:p,y}=d,m=(o.y-f.y)/y/h,g=(f.x-o.x)/p/u,w=Math.min(h-1,Math.floor((m-Math.floor(m))*h)),x=Math.min(u-1,Math.floor((g-Math.floor(g))*u));return{pyramidLevel:t,row:Math.floor(m),col:Math.floor(g),rowOffset:w,colOffset:x,blockWidth:u,srcLocation:f}}getTileExtent(e,t,s,i,r,n){const[a,c]=n,o=i.x+s*a*e.x,l=o+a*e.x,u=i.y-t*c*e.y,h=u-c*e.y;return new q({xmin:o,xmax:l,ymin:h,ymax:u,spatialReference:r})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,s){const i=this.rasterInfo.storageInfo.blockBoundary[e];return!i||i.maxRowt||i.minCol>s}async _fetchPixels(e,t,s,i={}){let r=Te(e);if(r>=2)return{extent:e,pixelBlock:null};const n=this._getSourceDataInfo(e,t,s,i),{pyramidLevel:a,pyramidResolution:c,srcResolution:o,srcExtent:l,srcWidth:u,srcHeight:h}=n;if(u===0||h===0)return{extent:e,srcExtent:l,pixelBlock:null};const f=X(this.rasterInfo.transform),d=(f==null?void 0:f.type)==="gcs-shift",p=C(ge(e.spatialReference));!d&&p||(r=Te(n.srcExtent,d));const y=this.rasterInfo.storageInfo,m={x:Math.floor((l.xmin-y.origin.x)/c.x+.1),y:Math.floor((y.origin.y-l.ymax)/c.y+.1)},g=await this._fetchRawTiles(a,m,{width:u,height:h,wrapCount:r},i);if(!g)return{extent:e,srcExtent:l,pixelBlock:null};const w=a>0?y.pyramidBlockWidth:y.blockWidth,x=a>0?y.pyramidBlockHeight:y.blockHeight,F=w===u&&x===h&&m.x%w==0&&m.y%x==0,k=new J({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/s,spatialReference:e.spatialReference}),T=!e.spatialReference.equals(this.rasterInfo.spatialReference),{datumTransformation:v}=i;if(!T&&F&&g.pixelBlocks.length===1&&w===t&&x===s&&o.x===k.x&&o.y===k.y)return{extent:e,srcExtent:l,pixelBlock:g.pixelBlocks[0]};const R=p&&C(ge(l.spatialReference)),b=i.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");b&&!this.rasterJobHandler&&await He();const _=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:g.extent,pixelSize:k.toJSON(),datumTransformation:v,rasterTransform:f,hasWrapAround:r>0||R,isAdaptive:this.ioConfig.optimizeProjectionAccuracy!==!1,includeGCSGrid:b},i):hi({projectedExtent:e,srcBufferExtent:g.extent,pixelSize:k,datumTransformation:v,rasterTransform:f,hasWrapAround:r>0||R,isAdaptive:!1,includeGCSGrid:b});let P;const B=!i.requestRawData,U={rows:_.spacing[0],cols:_.spacing[1]},L=X(this._getRasterTileAlignmentInfo(a,g.extent.xmin)),{pixelBlocks:D,mosaicSize:A,isPartiallyFilled:W}=g;let N=null;if(this.rasterJobHandler)({pixelBlock:P,localNorthDirections:N}=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:D,srcMosaicSize:A,destDimension:B?{width:t,height:s}:null,coefs:B?_.coefficients:null,sampleSpacing:B?U:null,projectDirections:b,gcsGrid:b?_.gcsGrid:null,isUV:this.rasterInfo.dataType==="vector-uv",interpolation:i.interpolation,alignmentInfo:L,blockWidths:null},i));else{const j=ve(D,A,{alignmentInfo:L});P=B?ni(j,{width:t,height:s},_.coefficients,U,i.interpolation):j,b&&_.gcsGrid&&(N=ai({width:t,height:s},_.gcsGrid),P=mi(P,this.rasterInfo.dataType,N))}return i.requestRawData||b?{srcExtent:l,pixelBlock:P,transformGrid:_,localNorthDirections:N,extent:e,isPartiallyFilled:W}:{srcExtent:l,extent:e,pixelBlock:P}}async _fetchRawTiles(e,t,s,i){const{origin:r,blockBoundary:n}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:c}=this.getBlockWidthHeight(e);let{x:o,y:l}=t,{width:u,height:h,wrapCount:f}=s;const d=this._getRasterTileAlignmentInfo(e,0);i.buffer&&(o-=i.buffer.cols,l-=i.buffer.rows,u+=2*i.buffer.cols,h+=2*i.buffer.rows);let p=0,y=0,m=0;f&&C(d)&&({worldColumnCountFromOrigin:y,originColumnOffset:m,rightPadding:p}=d,y*d.blockWidth-p>=o+u&&(p=0));const g=Math.floor(o/a),w=Math.floor(l/c),x=Math.floor((o+u+p-1)/a),F=Math.floor((l+h+p-1)/c),k=n[e];if(!k)return null;const{minRow:T,minCol:v,maxCol:R,maxRow:b}=k;if(f===0&&(Fb||g>R))return null;const _=new Array;let P=!1;const B=this.ioConfig.allowPartialFill==null?i.allowPartialFill:this.ioConfig.allowPartialFill;for(let j=w;j<=F;j++)for(let E=g;E<=x;E++){let pe=E;if(!i.disableWrapAround&&f&&C(d)&&y<=E&&(pe=E-y-m),j>=T&&pe>=v&&b>=j&&R>=pe){const $e=this._fetchRawTile(e,j,pe,i);B?_.push(new Promise(Oe=>{$e.then(rt=>Oe(rt)).catch(()=>{P=!0,Oe(null)})})):_.push($e)}else _.push(Promise.resolve(null))}if(_.length===0)return null;const U=await Promise.all(_),L={height:(F-w+1)*c,width:(x-g+1)*a},{spatialReference:D}=this.rasterInfo,A=this.getPyramidPixelSize(e),{x:W,y:N}=A;return{extent:new q({xmin:r.x+g*a*W,xmax:r.x+(x+1)*a*W,ymin:r.y-(F+1)*c*N,ymax:r.y-w*c*N,spatialReference:D}),pixelBlocks:U,mosaicSize:L,isPartiallyFilled:P}}_fetchRawTile(e,t,s,i){const r=this.rasterInfo.storageInfo.blockBoundary[e];if(!r)return Promise.resolve(null);const{minRow:n,minCol:a,maxCol:c,maxRow:o}=r;if(to||s>c)return Promise.resolve(null);const l=Ne(this.url,i.sliceId),u=`${e}/${t}/${s}`;let h=ze(l,i.registryId,u);if(M(h)){const f=new AbortController;h=this.fetchRawTile(e,t,s,{...i,signal:f.signal}),Je(l,i.registryId,u,h,f),h.catch(()=>si(l,i.registryId,u))}return i.signal&<(i,()=>{ri(l,i.registryId,u)}),h}_computeMagDirValues(e){var o;const{bandCount:t,dataType:s}=this.rasterInfo;if(!(t===2&&s==="vector-magdir"||s==="vector-uv")||(e==null?void 0:e.length)!==2||!((o=e[0])!=null&&o.length))return null;const i=e[0].length;if(s==="vector-magdir"){const l=e[1].map(u=>(u+360)%360);return[e[0],l]}const[r,n]=e,a=[],c=[];for(let l=0;l=16;if(h||o===n&&(l>xe||u>xe)||a===0||c===0){const f=new J({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/s,spatialReference:e.spatialReference});let d=di(f,this.rasterInfo.spatialReference,e,r.datumTransformation);const p=!d||i.srcResolution&&d.x+d.y=y){const m=2**y;d={x:i.srcResolution.x*m,y:i.srcResolution.y*m}}}d&&(r.srcResolution=d,this._updateSourceDataInfo(e,r))}return(r.srcWidth/t>xe||r.srcHeight/s>xe)&&(r.srcWidth=0,r.srcHeight=0),r}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const s=this.rasterInfo.spatialReference,{srcResolution:i,datumTransformation:r}=t,{pyramidLevel:n,pyramidResolution:a,excessiveReading:c}=Ae(i,this.rasterInfo,this.ioConfig.sampling);if(c)return;let o=t.srcExtent||Re(e,s,r);if(o==null)return;const l=X(this.rasterInfo.transform);l&&(o=l.inverseTransform(o)),t.srcExtent=o;const u=Math.ceil((o.xmax-o.xmin)/a.x-.1),h=Math.ceil((o.ymax-o.ymin)/a.y-.1);t.pyramidLevel=n,t.pyramidResolution=a,t.srcWidth=u,t.srcHeight=h}_getRequestOptionsWithSliceId(e){return C(this.rasterInfo.multidimensionalInfo)&&e.sliceId==null&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:s,position:i,pyramidLevel:r,useTransposedTile:n}=t,a=e.pixels[0].length/e.width/e.height;if(!(!e.mask||e.mask[i]))return{location:s,value:null};const{multidimensionalInfo:c}=this.rasterInfo;if(M(c)||!n){const d=e.pixels.map(m=>m[i]),p={location:s,value:d,pyramidLevel:r},y=this._computeMagDirValues(d.map(m=>[m]));return y!=null&&y.length&&(p.magdirValue=y.map(m=>m[0])),p}let o=e.pixels.map(d=>Array.prototype.slice.call(d,i*a,i*a+a)),l=this._computeMagDirValues(o);const{requestSomeSlices:u,identifyOptions:h}=t;let f=Wt(c,h.transposedVariableName);if(u){const d=jt(f,X(h.multidimensionalDefinition),X(h.timeExtent));o=o.map(p=>d.map(y=>p[y])),l=l==null?void 0:l.map(p=>d.map(y=>p[y])),f=d.map(p=>f[p])}return{location:s,value:null,dataSeries:f.map((d,p)=>{const y={value:o.map(m=>m[p]),multidimensionalDefinition:d.multidimensionalDefinition.map(m=>new et({...m,isSlice:!0}))};return l!=null&&l.length&&(y.magdirValue=[l[0][p],l[1][p]]),y}),pyramidLevel:r}}};I([S()],V.prototype,"_rasterTileAlighmentInfo",void 0),I([S({readOnly:!0})],V.prototype,"_isGlobalWrappableSource",null),I([S(Xe)],V.prototype,"url",null),I([S({type:String,json:{write:!0}})],V.prototype,"datasetName",void 0),I([S({type:String,json:{write:!0}})],V.prototype,"datasetFormat",void 0),I([S()],V.prototype,"rasterInfo",void 0),I([S()],V.prototype,"ioConfig",void 0),I([S()],V.prototype,"sourceJSON",void 0),V=I([Q("esri.layers.support.rasterDatasets.BaseRaster")],V);const se=V;let re=class extends se{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._primaryRasters=null}async open(e){var c;await this.init();const{rasterFunction:t}=this,{rasters:s,rasterIds:i}=t.getPrimaryRasters(),r=s.map(o=>o.rasterInfo?void 0:o.open(e));await Promise.all(r);const n=s.map(({rasterInfo:o})=>o),a=t.bind({rasterInfos:n,rasterIds:i});if(!a.success)throw new $("raster-function:open",`cannot bind the function: ${(c=a.error)!=null?c:""}`);await this.syncJobHandler(),this.set("sourceJSON",s[0].sourceJSON),this.set("rasterInfo",t.rasterInfo)}async syncJobHandler(){const{rasterFunction:e}=this;if(this._primaryRasters=e.getPrimaryRasters(),this.rasterJobHandler)return this.rasterJobHandler.updateRasterFunction(e)}async fetchPixels(e,t,s,i={}){var h,f;const{rasters:r,rasterIds:n}=this._primaryRasters,a=r.map(d=>d.fetchPixels(e,t,s,i)),c=await Promise.all(a),o=c.map(d=>d.pixelBlock);if(o.every(d=>M(d)))return c[0];const l=(f=(h=c.find(d=>C(d.pixelBlock)))==null?void 0:h.extent)!=null?f:e,u=this.rasterJobHandler?await this.rasterJobHandler.process({extent:l,primaryPixelBlocks:o,primaryRasterIds:n}):this.rasterFunction.process({extent:l,primaryPixelBlocks:o,primaryRasterIds:n});return{...c[0],pixelBlock:u}}};I([S({type:String,json:{write:!0}})],re.prototype,"datasetFormat",void 0),I([S()],re.prototype,"tileType",void 0),I([S()],re.prototype,"rasterFunction",void 0),re=I([Q("esri.layers.support.rasterDatasets.FunctionRaster")],re);const it=re,We=Ue.getLogger("esri.layers.mixins.ImageryTileMixin"),vi=e=>{let t=class extends e{constructor(){super(...arguments),this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation="nearest",this.multidimensionalDefinition=null,this.multidimensionalSubset=null,this.raster=null,this.rasterFunction=null,this.sourceJSON=null,this.symbolizer=null}get fullExtent(){var i;return(i=this.rasterInfo)==null?void 0:i.extent}get rasterInfo(){var i;return(i=this.raster)==null?void 0:i.rasterInfo}get spatialReference(){var i,r;return(r=(i=this.rasterInfo)==null?void 0:i.spatialReference)!=null?r:H.WGS84}get tileInfo(){var i;return(i=this.rasterInfo)==null?void 0:i.storageInfo.tileInfo}set url(i){this._set("url",qe(i,We))}set renderer(i){this._set("renderer",i),this.updateRenderer()}async convertVectorFieldData(i,r){if(M(i)||!this.rasterInfo)return null;const n=this._rasterJobHandler.instance,a=this.rasterInfo.dataType;return n?n.convertVectorFieldData({pixelBlock:i,dataType:a},r):yi(i,a)}async createFlowMesh(i,r){const n=this._rasterJobHandler.instance;return n?n.createFlowMesh(i,r):gi(i.meshType,i.simulationSettings,i.flowData,C(r.signal)?r.signal:new AbortController().signal)}normalizeRasterFetchOptions(i){var c,o,l;const{multidimensionalInfo:r}=(c=this.rasterInfo)!=null?c:{};if(M(r))return i;let n=i.multidimensionalDefinition||this.multidimensionalDefinition;!M(n)&&n.length||(n=De(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const a=i.timeExtent||this.timeExtent;if(C(n)&&C(a)&&(C(a.start)||C(a.end))){n=n.map(w=>w.clone());const u=(l=(o=r.variables.find(({name:w})=>w===n[0].variableName))==null?void 0:o.dimensions)==null?void 0:l.find(({name:w})=>w==="StdTime"),h=n.find(({dimensionName:w})=>w==="StdTime");if(!u||!h)return{...i,multidimensionalDefinition:null};const{start:f,end:d}=a,p=M(f)?null:f.getTime(),y=M(d)?null:d.getTime(),m=p!=null?p:y,g=y!=null?y:p;if(C(u.values)){const w=u.values.filter(x=>{if(Array.isArray(x)){if(m===g)return x[0]<=m&&x[1]>=m;const F=x[0]<=m&&x[1]>m||x[0]=g,k=x[0]>=m&&x[1]<=g||x[0]g;return F||k}return m===g?x===m:x>=m&&x<=g});if(w.length){const x=w.sort((F,k)=>{var T,v,R,b;return m===g?((T=F[0])!=null?T:F)-((v=k[0])!=null?v:k):Math.abs(((R=F[1])!=null?R:F)-g)-Math.abs(((b=k[1])!=null?b:k)-g)})[0];h.values=[x]}else n=null}else if(u.hasRegularIntervals&&u.extent){const[w,x]=u.extent;m>x||g0))return null;let a;await this.updateRenderer();const c=this._rasterJobHandler.instance,o=(l=this.bandIds)!=null?l:[];return a=c?await c.symbolize({...i,simpleStretchParams:r,bandIds:o}):this.symbolizer.symbolize({...i,simpleStretchParams:r,bandIds:o}),a}getTileUrl(i,r,n){var a;return((a=this.raster)==null?void 0:a.datasetFormat)==="RasterTileServer"?`${this.url}/tile/${i}/${r}/${n}`:""}getCompatibleTileInfo(i,r,n=!1){if(!this.loaded||M(r))return null;if(n&&i.equals(this.spatialReference))return this.tileInfo;const a=ut(i);return fe.create({size:256,spatialReference:i,origin:a?{x:a.origin[0],y:a.origin[1]}:{x:r.xmin,y:r.ymax}})}getCompatibleFullExtent(i){return this.loaded?(this._compatibleFullExtent&&this._compatibleFullExtent.spatialReference.equals(i)||(this._compatibleFullExtent=this.raster.computeExtent(i)),this._compatibleFullExtent):null}async fetchTile(i,r,n,a={}){if(s(this),a.requestAsImageElement){const c=this.getTileUrl(i,r,n);return Ve(c,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:a.signal}).then(o=>o.data)}if(C(this.rasterInfo.multidimensionalInfo)&&(a=this.normalizeRasterFetchOptions(a),M(a.multidimensionalDefinition))){const c=a.tileInfo||this.rasterInfo.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(i,r,n,c),pixelBlock:null}}return await this._initJobHandler(),await this._updateRasterFunction(),this.renderer.type==="raster-shaded-relief"&&(a={...a,buffer:{cols:1,rows:1}}),this.raster.fetchTile(i,r,n,a)}async fetchPixels(i,r,n,a={}){return C(this.rasterInfo.multidimensionalInfo)&&(a=this.normalizeRasterFetchOptions(a),M(a.multidimensionalDefinition))?{extent:i,pixelBlock:null}:(await this._initJobHandler(),await this._updateRasterFunction(),this.raster.fetchPixels(i,r,n,a))}async identify(i,r={}){return s(this),C(this.rasterInfo.multidimensionalInfo)&&!(this.rasterInfo.hasMultidimensionalTranspose&&!!(Ze(r.multidimensionalDefinition)||r.transposedVariableName||r.timeExtent))&&(r=this.normalizeRasterFetchOptions(r),M(r.multidimensionalDefinition))?{location:i,value:null}:this.raster.identify(i,r)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){var a,c,o;const i=(a=this.rasterInfo)==null?void 0:a.multidimensionalInfo;if(M(i)||((c=this.rasterInfo)==null?void 0:c.dataType)!=="standard-time")return!1;const r=this.multidimensionalDefinition,n=(o=r==null?void 0:r[0])==null?void 0:o.variableName;return i.variables.some(l=>l.name===n&&(!(r!=null&&r[0].dimensionName)||l.dimensions.some(u=>u.name==="StdTime")))}getStandardTimeValue(i){return new Date(24*(i-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(i){const r=i!=null?i:this.rasterInfo.multidimensionalInfo;return qt(this.multidimensionalSubset,r)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=De(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this._configDefaultRenderer()}_initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const i=new Nt;return this._rasterJobHandler.connectionPromise=i.initialize().then(()=>{s(this),this._rasterJobHandler.instance=i,this.raster.rasterJobHandler=i,this.renderer&&this.updateRenderer(),this.raster.datasetFormat==="Function"&&this.raster.syncJobHandler()}).catch(()=>{}),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null,this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){var i;if(this.interpolation==null){s(this);const r=Bt(this.rasterInfo,this.raster.tileType,(i=this.sourceJSON)==null?void 0:i.defaultResamplingMethod);this._set("interpolation",r)}}_configDefaultRenderer(){var n,a,c,o,l;s(this);const i=this.raster.rasterInfo;if(this.bandIds||(this.bandIds=Dt(i)),!this.renderer){const u=Et(i,{bandIds:this.bandIds,variableName:C(this.multidimensionalDefinition)?(n=this.multidimensionalDefinition[0])==null?void 0:n.variableName:null});this.raster.datasetFormat==="WCSServer"&&u.type==="raster-stretch"&&(((c=(a=i.statistics)==null?void 0:a[0].max)!=null?c:0)>1e24||((l=(o=i.statistics)==null?void 0:o[0].min)!=null?l:0)<-1e24)&&(u.dynamicRangeAdjustment=!0,u.statistics=null,u.stretchType==="none"&&(u.stretchType="min-max")),this.renderer=u}this.symbolizer?(this.symbolizer.rendererJSON=Be(this.renderer.toJSON()),this.symbolizer.rasterInfo=i):this.symbolizer=new Vt({rendererJSON:this.renderer.toJSON(),rasterInfo:i});const r=this.symbolizer.bind();r.success||We.warn("imagery-tile-mixin",r.error||"The given renderer is not supported by the layer.")}async _updateRasterFunction(){var n;if(this.type!=="imagery-tile"||JSON.stringify(this.rasterFunction)===JSON.stringify(this._cachedRasterFunctionJson))return;let i=this.raster;(i==null?void 0:i.datasetFormat)==="Function"&&(i=i.rasterFunction.getPrimaryRasters().rasters[0]);const{rasterFunction:r}=this;if(r){const a=tt(r.toJSON(),{raster:i}),c=new it({rasterFunction:a});c.rasterJobHandler=this._rasterJobHandler.instance,await c.open(),this._cachedRasterFunctionJson=(n=this.rasterFunction)==null?void 0:n.toJSON(),this.raster=c}else this.raster=i}};function s(i){if(!i.raster||!i.rasterInfo)throw new $("imagery-tile","no raster")}return I([S()],t.prototype,"_cachedRendererJson",void 0),I([S()],t.prototype,"_cachedRasterFunctionJson",void 0),I([S()],t.prototype,"_compatibleFullExtent",void 0),I([S()],t.prototype,"_rasterJobHandler",void 0),I([S()],t.prototype,"bandIds",void 0),I([S({json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),I([S({json:{read:!1}})],t.prototype,"fullExtent",null),I([S()],t.prototype,"interpolation",void 0),I([S()],t.prototype,"ioConfig",void 0),I([S({type:[et]})],t.prototype,"multidimensionalDefinition",void 0),I([S({type:$t,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),I([S()],t.prototype,"raster",void 0),I([S({type:Ot})],t.prototype,"rasterFunction",void 0),I([S()],t.prototype,"rasterInfo",null),I([S()],t.prototype,"sourceJSON",void 0),I([S({json:{read:!1}})],t.prototype,"spatialReference",null),I([S({json:{read:!1}})],t.prototype,"tileInfo",null),I([S(Xe)],t.prototype,"url",null),I([S({types:Qe})],t.prototype,"renderer",null),I([S()],t.prototype,"symbolizer",void 0),t=I([Q("esri.layers.ImageryTileMixin")],t),t};function Ti(e){const t=e.fields,s=e.records,i=t.some(l=>l.name.toLowerCase()==="oid")?"OBJECTID":"OID",r=[{name:i,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map(l=>({name:l.name,type:"esriFieldType"+l.typeName,alias:l.name}))),n=r.map(l=>l.name),a=[];let c=0,o=0;return s.forEach(l=>{const u={};for(u[i]=c++,o=1;o0)for(;u.lengtha;){const f=[];s.getUint8(o)===32?(o+=1,l.forEach(d=>{if(d.type==="C")f.push(Ee(new Uint8Array(t,o,d.length)).trim());else if(d.type==="N")f.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(t,o,d.length)).trim(),10));else if(d.type==="F")f.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(t,o,d.length)).trim()));else if(d.type==="D"){const p=String.fromCharCode.apply(null,new Uint8Array(t,o,d.length)).trim();f.push(new Date(parseInt(p.substring(0,4),10),parseInt(p.substring(4,6),10)-1,parseInt(p.substring(6,8),10)))}o+=d.length}),u.push(f)):o+=a}}return{header:c,fields:l,records:u,recordSet:Ti({fields:l,records:u})}}}const ee=new Map;ee.set("int16","esriFieldTypeSmallInteger"),ee.set("int32","esriFieldTypeInteger"),ee.set("int64","esriFieldTypeInteger"),ee.set("float32","esriFieldTypeSingle"),ee.set("float64","esriFieldTypeDouble"),ee.set("text","esriFieldTypeString");const je=8;let le=class extends se{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:t}=await this.request(this.url+"/conf.json",{signal:e==null?void 0:e.signal});if(!this._validateHeader(t))throw new $("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:s,rasterInfo:i}=this._parseHeader(t);if(i.dataType==="thematic"){const r=await this._fetchAuxiliaryInformation();i.attributeTable=r}this._set("storageInfo",s),this._set("rasterInfo",i),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,t,s,i={}){const{transposeInfo:r}=this.rasterInfo.storageInfo,{transposedVariableName:n}=i,a=!(!r||!n),c=a?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(c<0)return null;const o=this._buildCacheFilePath(c,t,s,i.multidimensionalDefinition,n),l=this._getIndexRecordFromBundle(t,s,a),u=await this.request(o,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:i.signal});if(!u)return null;const h=new Uint8Array(u.data),f=this._getTileEndAndContentType(h,l);if(f.recordSize===0)return null;const d=await this.request(o,{range:{from:f.position,to:f.position+f.recordSize},responseType:"array-buffer",signal:i.signal});if(!d)return null;const[p,y]=this._getTileSize(a);return this.decodePixelBlock(d.data,{width:p,height:y,planes:null,pixelType:null,returnInterleaved:a})}_validateHeader(e){const t=["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"];return e&&e.type==="RasterInfo"&&!t.some(s=>!e[s])}_parseHeader(e){var N,j;const t=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:s,histograms:i,colormap:r,blockWidth:n,blockHeight:a,firstPyramidLevel:c,maximumPyramidLevel:o}=e,l=e.statistics&&e.statistics.map(E=>({min:E.min,max:E.max,avg:E.mean,stddev:E.standardDeviation,median:E.median,mode:E.mode})),u=e.extent.spatialReference,h=(N=e.geodataXform)==null?void 0:N.spatialReference,f=new H((u==null?void 0:u.wkid)||(u==null?void 0:u.wkt)?u:h);let d=new q({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:f});const p=new J({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:f}),y=Math.round((d.xmax-d.xmin)/p.x),m=Math.round((d.ymax-d.ymin)/p.y),g=this._parseTransform(e.geodataXform),w=g?d:null;g&&(d=g.forwardTransform(d),p.x=(d.xmax-d.xmin)/y,p.y=(d.ymax-d.ymin)/m);const x=(j=e.properties)!=null?j:{},F=e.format.toLowerCase().replace("cache/",""),k=new J(e.origin.x,e.origin.y,f);let T,v,R,b;if(r&&r.colors)for(T=[],v=0;v>>24,R<<8>>>24,R>>>24]);const _=e.LODInfos,P=[];for(v=0;v<_.levels.length;v++)P.push({level:_.levels[v],resolution:_.resolutions[v],scale:96/.0254*_.resolutions[v]});const B=new fe({dpi:96,lods:P,format:F,origin:k,size:[n,a],spatialReference:f}),U={recordSize:je,packetSize:e.packetSize,headerSize:e.packetSize*e.packetSize*je+64},L=[{maxCol:Math.ceil(y/n)-1,maxRow:Math.ceil(m/a)-1,minCol:0,minRow:0}];let D=2;if(o>0)for(v=0;vn.data).catch(()=>null),s=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then(n=>n.data).catch(()=>null),i=await Promise.all([t,s]);let r;if(i[0]){let n=i[0].fields;const a=i[0].values;if(n&&a){n=n.map(o=>({type:o.name==="OID"?"esriFieldTypeOID":ee.get(o.type),name:o.name,alias:o.alias||o.name}));const c=a.map(o=>({attributes:o}));n&&a&&(r={fields:n,features:c})}}return!r&&i[1]&&(r=st.parse(i[1]).recordSet),Ye.fromJSON(r)}_buildCacheFilePath(e,t,s,i,r){const n=this._getPackageSize(!!r),a=Math.floor(t/n)*n,c=Math.floor(s/n)*n,o="R"+this._toHexString4(a)+"C"+this._toHexString4(c);let l="L";l+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:u}=this.rasterInfo,h=i==null?void 0:i[0];if(M(u)||!h)return`${this.url}/_alllayers/${l}/${o}.bundle`;let f="_yxs";if(!r){f=u.variables.find(y=>y.name===h.variableName).dimensions[0].values.indexOf(h.values[0]).toString(16);const p=4-f.length;for(let y=0;y0;)t="0"+t}return t}};I([S({readOnly:!0})],le.prototype,"storageInfo",void 0),I([S({type:String,json:{write:!0}})],le.prototype,"datasetFormat",void 0),le=I([Q("esri.layers.support.rasterDatasets.CloudRaster")],le);const Ri=le;let ce=class extends se{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.data=null}async open(e){var m,g;await this.init();const t=this.data,{pixelBlock:s,statistics:i,histograms:r,name:n,keyProperties:a,nativeExtent:c,transform:o}=this.data,{width:l,height:u,pixelType:h}=s,f=(m=t.extent)!=null?m:new q({xmin:-.5,ymin:.5,xmax:l-.5,ymax:u-.5,spatialReference:new H({wkid:3857})}),d=(g=t.isPseudoSpatialReference)!=null?g:!t.extent,p={x:f.width/l,y:f.height/u},y=new me({width:l,height:u,pixelType:h,extent:f,nativeExtent:c,transform:o,pixelSize:p,spatialReference:f.spatialReference,bandCount:3,keyProperties:a||{},statistics:i,isPseudoSpatialReference:d,histograms:r});this.createRemoteDatasetStorageInfo(y,512,512),this._set("rasterInfo",y),this.updateTileInfo(),await this._buildInMemoryRaster(s,{width:512,height:512},e),this.datasetName=n,this.url="/InMemory/"+n}fetchRawTile(e,t,s,i={}){const r=this._pixelBlockTiles.get(`${e}/${t}/${s}`);return Promise.resolve(r)}async _buildInMemoryRaster(e,t,s){var l,u;const i=this.rasterInfo.storageInfo.maximumPyramidLevel,r=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:i},s):Promise.resolve(oi(e,t,i)),n=C(this.rasterInfo.statistics),a=C(this.rasterInfo.histograms),c=n?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},s):Promise.resolve(Xt(e)),o=await Ke([r,c]);if(!o[0].value&&o[1].value)throw new $("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=o[0].value,n||(this.rasterInfo.statistics=(l=o[1].value)==null?void 0:l.statistics),a||(this.rasterInfo.histograms=(u=o[1].value)==null?void 0:u.histograms)}};I([S({type:String,json:{write:!0}})],ce.prototype,"datasetFormat",void 0),I([S()],ce.prototype,"data",void 0),ce=I([Q("esri.layers.support.rasterDatasets.InMemoryRaster")],ce);const _i=ce;function ae(e,t){if(!e||!t)return[];let s=t;t.includes("/")?(s=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const i=[];if(t){const n=ae(e,s);for(let a=0;ai.push(c));return i}const r=e.getElementsByTagNameNS("*",s);if(!r||r.length===0)return[];for(let n=0;n0?t?G(i[0],t):i[0]:null}function K(e,t=null){const s=t?G(e,t):e;let i;return s?(i=s.textContent||s.nodeValue,i?i.trim():null):null}function ki(e,t){const s=ae(e,t),i=[];let r;for(let n=0;nNumber(s))}function ie(e,t){const s=K(e,t);return Number(s)}function _e(e,t){var r;const s=(r=e==null?void 0:e.nodeName)==null?void 0:r.toLowerCase(),i=t.toLowerCase();return s.slice(s.lastIndexOf(":")+1)===i}function Ge(e,t){if(!e||!t)return null;const s=[];for(let i=0;iNumber(d));let c,o,l,u;ae(e,"Metadata/MDI").forEach(d=>{var y;const p=Number((y=d.textContent)!=null?y:d.nodeValue);switch(d.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":c=p;break;case"STATISTICS_MAXIMUM":o=p;break;case"STATISTICS_MEAN":l=p;break;case"STATISTICS_STDDEV":u=p}});const h=ie(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:(a==null?void 0:a.length)&&i!=null&&r!=null?{min:i,max:r,size:n||a.length,counts:a}:null,sourceBandIndex:h,statistics:c!=null&&o!=null?{min:c,max:o,avg:l,stddev:u}:null}}function Se(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&t!==0)return new H({wkid:t});if((e=String(e)).startsWith("COMPD_CS")){if(!e.includes("VERTCS")||!e.includes("GEOGCS")&&!e.startsWith("PROJCS"))return null;const s=e.indexOf("VERTCS"),i=e.indexOf("PROJCS"),r=i>-1?i:e.indexOf("GEOGCS");if(r===-1)return null;const n=e.slice(r,e.lastIndexOf("]",s)+1).trim(),a=e.slice(s,e.lastIndexOf("]")).trim();t=ke(n);const c=new H(t?{wkid:t}:{wkt:n}),o=ke(a);return o&&(c.vcsWkid=o),c}return e.startsWith("GEOGCS")||e.startsWith("PROJCS")?(t=ke(e),new H(t!==0?{wkid:t}:{wkt:e})):null}function ke(e){var r;const t=e.replace(/\]/g,"[").replace(/\"/g,"").split("[").map(n=>n.trim()).filter(n=>n!==""),s=t[t.length-1].split(","),i=(r=s[0])==null?void 0:r.toLowerCase();if((i==="epsg"||i==="esri")&&e.endsWith('"]]')){const n=Number(s[1]);if(!isNaN(n)&&n!==0)return n}return 0}function Me(e){var i;if(((i=e==null?void 0:e.documentElement.tagName)==null?void 0:i.toLowerCase())!=="pamdataset")return{};const t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach(r=>{if(r.nodeType===1){if(_e(r,"SRS")){if(!t.spatialReference){const n=K(r);t.spatialReference=Se(n)}}else if(_e(r,"Metadata"))if(r.getAttribute("domain")==="xml:ESRI"){const{spatialReference:n,transform:a}=Ci(r);t.transform=a,t.spatialReference||(t.spatialReference=n)}else ae(r,"MDI").forEach(n=>t.metadata[n.getAttribute("key")]=K(n));else if(_e(r,"PAMRasterBand")){const n=Fi(r);n.sourceBandIndex!=null&&t.rasterBands[n.sourceBandIndex]==null?t.rasterBands[n.sourceBandIndex]=n:t.rasterBands.push(n)}}});const s=t.rasterBands;if(s.length){const r=!!s[0].statistics;t.statistics=r?s.map(a=>a.statistics).filter(C):null;const n=!!s[0].histogram;t.histograms=n?s.map(a=>a.histogram).filter(C):null}return t}let be=class extends se{async open(e){await this.init();const t=await this._fetchData(e);let{spatialReference:s,statistics:i,histograms:r,transform:n}=await this._fetchAuxiliaryData(e);const a=!s;a&&(s=new H({wkid:3857})),(r==null?void 0:r.length)&&i==null&&(i=Fe(r));const{width:c,height:o}=t;let l=new q({xmin:-.5,ymin:.5-o,xmax:c-.5,ymax:.5,spatialReference:s});const u=n?n.forwardTransform(l):l;let h=!0;if(n){const d=n.forwardCoefficients;h=d&&d[1]===0&&d[2]===0,h&&(n=null,l=u)}const f=new _i({data:{extent:u,nativeExtent:l,transform:n,pixelBlock:t,statistics:i,histograms:r,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:a}});await f.open(),f.data=null,this._set("rasterInfo",f.rasterInfo),this._inMemoryRaster=f}fetchRawTile(e,t,s,i={}){return this._inMemoryRaster.fetchRawTile(e,t,s,i)}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e==null?void 0:e.signal}),s=Yt(t).toUpperCase();if(s!=="JPG"&&s!=="PNG"&&s!=="GIF"&&s!=="BMP")throw new $("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",s);const i=s.toLowerCase(),r=i==="gif"||i==="bmp"||!ht("ios");return await this.decodePixelBlock(t,{format:i,useCanvas:r,hasNoZlibMask:!0})}async _fetchAuxiliaryData(e){var l,u;const t=X(e==null?void 0:e.signal),s=(l=this.ioConfig.skipExtensions)!=null?l:[],i=s.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),r=this.datasetFormat,n=r==="JPG"?"jgw":r==="PNG"?"pgw":r==="BMP"?"bpw":null,a=n&&s.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:t}),c=await Ke([i,a]);if(t!=null&&t.aborted)throw ft();const o=Me((u=c[0].value)==null?void 0:u.data);if(!o.transform){const h=c[1].value?c[1].value.data.split(` +import{d0 as nt,du as fe,c as C,jb as qe,s as Ue,n as $,d$ as at,af as J,u as X,j as M,cU as q,U as Ve,ba as ot,C as lt,a6 as I,a7 as S,eK as Xe,a8 as Q,cx as ct,aT as H,ax as ut,d3 as Ye,cB as Ke,m as ht,D as ft,cN as dt,bX as mt,i2 as pt,i3 as yt,eF as gt,eG as xt,iJ as It,iM as wt,ia as bt,eH as St,aU as vt,gG as he,id as Tt,_ as Rt,h0 as _t,ei as kt,iE as Ct,dv as Ft,d2 as Pt,cF as Mt}from"./index.221827cd.js";import{c as $t,w as Ot,l as Qe,$ as Be,V as Bt,L as Dt,j as Et,n as Nt,m as zt,u as Jt,o as Ht,a as Lt}from"./fetchRasterInfo.3f6af61b.js";import{f as Ze,g as At,i as Wt,s as jt,p as et,c as De,m as Gt,d as qt}from"./multidimensionalUtils.59c05ac5.js";import{S as Ut,b as de,T as Vt,r as Ee,e as me,p as Xt,j as Fe,P as Yt,l as Kt,N as Qt,D as Zt,m as ye,G as ei,q as ti,O as ii}from"./RasterSymbolizer.093b1748.js";import{a as Ne,x as ze,h as Je,d as si,m as ri}from"./RawBlockCache.e5f26f22.js";import{T as ve,D as ni,j as ai,W as oi,b as li,g as ci}from"./pixelUtils.9c6f8dae.js";import{T as He,U as ge,j as Le,o as Ae,n as ui,Q as Te,J as Re,$ as hi,V as fi,C as di}from"./rasterProjectionHelper.f3c10be2.js";import{m as mi,b as pi,d as yi,f as gi}from"./dataUtils.e7623e56.js";import{l as tt,f as xi,i as Ii,m as Pe,c as wi}from"./utils.bc3381b3.js";import{n as bi,z as Si}from"./TilemapCache.b64a2ea8.js";import"./generateRendererUtils.5c972fdb.js";import"./colorUtils.bb6424b7.js";const xe=8;let V=class extends nt(ct){constructor(){super(...arguments),this.rasterJobHandler=null,this.datasetName=null,this.datasetFormat=null,this.rasterInfo=null,this.ioConfig={sampling:"closest"}}async init(){const e=He();this.addResolvingPromise(e),await this.when()}normalizeCtorArgs(e){return e&&e.ioConfig&&(e={...e,ioConfig:{resolution:null,bandIds:null,sampling:"closest",tileInfo:fe.create(),...e.ioConfig}}),e}get _isGlobalWrappableSource(){const{rasterInfo:e}=this,t=ge(e.spatialReference);return C(t)&&e.extent.width>=t/2}set url(e){this._set("url",qe(e,Ue.getLogger(this.declaredClass)))}async open(e){throw new $("BaseRaster:open-not-implemented","open() is not implemented")}async fetchTile(e,t,s,i={}){const r=i.tileInfo||this.rasterInfo.storageInfo.tileInfo,n=this.getTileExtentFromTileInfo(e,t,s,r);return this.fetchPixels(n,r.size[0],r.size[1],i)}async identify(e,t={}){var _,P;e=at(J,e).clone().normalize();const{multidimensionalDefinition:s,timeExtent:i}=t,{hasMultidimensionalTranspose:r,multidimensionalInfo:n}=this.rasterInfo;let{transposedVariableName:a}=t;const c=C(n)&&r&&(i!=null||Ze(s));c&&!a&&(a=C(s)&&s.length>0?(_=s[0].variableName)!=null?_:void 0:n.variables[0].name,t={...t,transposedVariableName:a}),t=this._getRequestOptionsWithSliceId(t);const{spatialReference:o,extent:l}=this.rasterInfo,{datumTransformation:u}=t;let h=Le(e,o,u);if(!l.intersects(h))return{location:h,value:null};if(C(this.rasterInfo.transform)){const B=this.rasterInfo.transform.inverseTransform(h);if(!this.rasterInfo.nativeExtent.intersects(B))return{location:B,value:null};h=B}let f=0;const d=C(a)&&C(n)&&this.rasterInfo.hasMultidimensionalTranspose;if(!d){if(t.srcResolution)f=Ae(t.srcResolution,this.rasterInfo,this.ioConfig.sampling).pyramidLevel;else if(f=await this.computeBestPyramidLevelForLocation(e,t),f==null)return{location:h,value:null}}const p=this.identifyPixelLocation(h,f,null,d);if(p===null)return{location:h,value:null};const{row:y,col:m,rowOffset:g,colOffset:w,blockWidth:x}=p,F=a!=null?a:X(t.sliceId),k=Ne(this.url,F),T=`${f}/${y}/${m}`;let v=ze(k,null,T);M(v)&&(v=this.fetchRawTile(f,y,m,t),Je(k,null,T,v));const R=await v;if(M(R)||!((P=R.pixels)!=null&&P.length))return{location:h,value:null};const b=g*x+w;return this._processIdentifyResult(R,{srcLocation:h,position:b,pyramidLevel:f,useTransposedTile:!!d,requestSomeSlices:c,identifyOptions:t})}async fetchPixels(e,t,s,i={}){if(e=ui(e),(i=this._getRequestOptionsWithSliceId(i)).requestRawData)return this._fetchPixels(e,t,s,i);const r=ge(e.spatialReference),n=Te(e);if(M(r)||n===0||n===1&&this._isGlobalWrappableSource)return this._fetchPixels(e,t,s,i);if(n>=3)return{extent:e,pixelBlock:null};const a=[],{xmin:c,xmax:o}=e,l=Math.round(r/(o-c)*t),u=l-Math.round((r/2-c)/(o-c)*t);let h=0;const f=[];for(let m=0;m<=n;m++){const g=new q({xmin:m===0?c:-r/2,xmax:m===n?o-r*m:r/2,ymin:e.ymin,ymax:e.ymax,spatialReference:e.spatialReference}),w=m===0?l-u:m===n?t-h:l;h+=w,f.push(w);const x=i.disableWrapAround&&m>0?null:this._fetchPixels(g,w,s,i);a.push(x)}const d=(await Promise.all(a)).map(m=>m==null?void 0:m.pixelBlock);let p=null;const y={width:t,height:s};return this.rasterJobHandler?p=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:d,srcMosaicSize:y,destDimension:null,coefs:null,sampleSpacing:null,interpolation:"nearest",alignmentInfo:null,blockWidths:f},i)).pixelBlock:p=ve(d,y,{blockWidths:f}),{extent:e,srcExtent:Re(e,this.rasterInfo.spatialReference,i.datumTransformation),pixelBlock:p}}async fetchRawPixels(e,t,s,i={}){t={x:Math.floor(t.x),y:Math.floor(t.y)};const r=await this._fetchRawTiles(e,t,s,i),{nativeExtent:n,nativePixelSize:a,storageInfo:c}=this.rasterInfo,o=2**e,l=a.x*o,u=a.y*o,h=new q({xmin:n.xmin+l*t.x,xmax:n.xmin+l*(t.x+s.width-1),ymin:n.ymax-u*(t.y+s.height-1),ymax:n.ymax-u*t.y,spatialReference:n.spatialReference});if(!r)return{extent:h,srcExtent:h,pixelBlock:null};const{pixelBlocks:f,mosaicSize:d}=r;if(f.length===1&&C(f[0])&&f[0].width===s.width&&f[0].height===s.height)return{extent:h,srcExtent:h,pixelBlock:r.pixelBlocks[0]};const p=e>0?c.pyramidBlockWidth:c.blockWidth,y=e>0?c.pyramidBlockHeight:c.blockHeight,m={x:t.x%p,y:t.y%y};let g;return this.rasterJobHandler?g=(await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:f,srcMosaicSize:d,destDimension:s,clipOffset:m,clipSize:s,coefs:null,sampleSpacing:null,interpolation:i.interpolation,alignmentInfo:null,blockWidths:null},i)).pixelBlock:g=ve(f,d,{clipOffset:m,clipSize:s}),{extent:h,srcExtent:h,pixelBlock:g}}fetchRawTile(e,t,s,i){throw new $("BaseRaster:read-not-implemented","fetchRawTile() is not implemented")}computeExtent(e){return Re(this.rasterInfo.extent,e)}decodePixelBlock(e,t){return!this.rasterJobHandler||t.useCanvas?Ut(e,t):this.rasterJobHandler.decode({data:e,options:t})}async request(e,t,s=0){var o;const{customFetchParameters:i}=this.ioConfig,{range:r,query:n,headers:a}=t;s=(o=s!=null?s:t.retryCount)!=null?o:this.ioConfig.retryCount;const c=r?{Range:`bytes=${r.from}-${r.to}`}:null;try{return await Ve(e,{...t,query:{...n,...i},headers:{...a,...c}})}catch(l){if(s>0)return s--,this.request(e,t,s);throw l}}getSliceIndex(e){const{multidimensionalInfo:t}=this.rasterInfo;return M(t)||M(e)||e.length===0?null:At(e,t)}getTileExtentFromTileInfo(e,t,s,i){const r=ot(i.lodAt(e));return this.getTileExtent({x:r.resolution,y:r.resolution},t,s,i.origin,i.spatialReference,i.size)}updateTileInfo(){const{storageInfo:e,spatialReference:t,extent:s,pixelSize:i}=this.rasterInfo;if(!e.tileInfo){const r=[],n=e.maximumPyramidLevel||0;let a=Math.max(i.x,i.y),c=1/.0254*96*a;for(let l=0;l<=n;l++)r.push({level:n-l,resolution:a,scale:c}),a*=2,c*=2;const o=new J({x:s.xmin,y:s.ymax,spatialReference:t});e.tileInfo=new fe({origin:o,size:[e.blockWidth,e.blockHeight],spatialReference:t,lods:r}),e.isVirtualTileInfo=!0}}createRemoteDatasetStorageInfo(e,t=512,s=512,i){const{width:r,height:n,nativeExtent:a,pixelSize:c,spatialReference:o}=e,l=new J({x:a.xmin,y:a.ymax,spatialReference:o});i==null&&(i=Math.max(0,Math.round(Math.log(Math.max(r,n))/Math.LN2-8)));const u=this.computeBlockBoundary(a,512,512,{x:a.xmin,y:a.ymax},[c],i);e.storageInfo=new de({blockWidth:t,blockHeight:s,pyramidBlockWidth:t,pyramidBlockHeight:s,origin:l,firstPyramidLevel:1,maximumPyramidLevel:i,blockBoundary:u})}async computeBestPyramidLevelForLocation(e,t={}){return 0}computeBlockBoundary(e,t,s,i,r,n=0,a=2){if(r.length===1&&n>0){r=[...r];let{x:u,y:h}=r[0];for(let f=0;fc)return null;const d=this.getPyramidPixelSize(t),{x:p,y}=d,m=(o.y-f.y)/y/h,g=(f.x-o.x)/p/u,w=Math.min(h-1,Math.floor((m-Math.floor(m))*h)),x=Math.min(u-1,Math.floor((g-Math.floor(g))*u));return{pyramidLevel:t,row:Math.floor(m),col:Math.floor(g),rowOffset:w,colOffset:x,blockWidth:u,srcLocation:f}}getTileExtent(e,t,s,i,r,n){const[a,c]=n,o=i.x+s*a*e.x,l=o+a*e.x,u=i.y-t*c*e.y,h=u-c*e.y;return new q({xmin:o,xmax:l,ymin:h,ymax:u,spatialReference:r})}getBlockWidthHeight(e){return{blockWidth:e>0?this.rasterInfo.storageInfo.pyramidBlockWidth:this.rasterInfo.storageInfo.blockWidth,blockHeight:e>0?this.rasterInfo.storageInfo.pyramidBlockHeight:this.rasterInfo.storageInfo.blockHeight}}isBlockOutside(e,t,s){const i=this.rasterInfo.storageInfo.blockBoundary[e];return!i||i.maxRowt||i.minCol>s}async _fetchPixels(e,t,s,i={}){let r=Te(e);if(r>=2)return{extent:e,pixelBlock:null};const n=this._getSourceDataInfo(e,t,s,i),{pyramidLevel:a,pyramidResolution:c,srcResolution:o,srcExtent:l,srcWidth:u,srcHeight:h}=n;if(u===0||h===0)return{extent:e,srcExtent:l,pixelBlock:null};const f=X(this.rasterInfo.transform),d=(f==null?void 0:f.type)==="gcs-shift",p=C(ge(e.spatialReference));!d&&p||(r=Te(n.srcExtent,d));const y=this.rasterInfo.storageInfo,m={x:Math.floor((l.xmin-y.origin.x)/c.x+.1),y:Math.floor((y.origin.y-l.ymax)/c.y+.1)},g=await this._fetchRawTiles(a,m,{width:u,height:h,wrapCount:r},i);if(!g)return{extent:e,srcExtent:l,pixelBlock:null};const w=a>0?y.pyramidBlockWidth:y.blockWidth,x=a>0?y.pyramidBlockHeight:y.blockHeight,F=w===u&&x===h&&m.x%w==0&&m.y%x==0,k=new J({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/s,spatialReference:e.spatialReference}),T=!e.spatialReference.equals(this.rasterInfo.spatialReference),{datumTransformation:v}=i;if(!T&&F&&g.pixelBlocks.length===1&&w===t&&x===s&&o.x===k.x&&o.y===k.y)return{extent:e,srcExtent:l,pixelBlock:g.pixelBlocks[0]};const R=p&&C(ge(l.spatialReference)),b=i.requestProjectedLocalDirections&&this.rasterInfo.dataType.startsWith("vector");b&&!this.rasterJobHandler&&await He();const _=this.rasterJobHandler?await this.rasterJobHandler.getProjectionOffsetGrid({projectedExtent:e,srcBufferExtent:g.extent,pixelSize:k.toJSON(),datumTransformation:v,rasterTransform:f,hasWrapAround:r>0||R,isAdaptive:this.ioConfig.optimizeProjectionAccuracy!==!1,includeGCSGrid:b},i):hi({projectedExtent:e,srcBufferExtent:g.extent,pixelSize:k,datumTransformation:v,rasterTransform:f,hasWrapAround:r>0||R,isAdaptive:!1,includeGCSGrid:b});let P;const B=!i.requestRawData,U={rows:_.spacing[0],cols:_.spacing[1]},L=X(this._getRasterTileAlignmentInfo(a,g.extent.xmin)),{pixelBlocks:D,mosaicSize:A,isPartiallyFilled:W}=g;let N=null;if(this.rasterJobHandler)({pixelBlock:P,localNorthDirections:N}=await this.rasterJobHandler.mosaicAndTransform({srcPixelBlocks:D,srcMosaicSize:A,destDimension:B?{width:t,height:s}:null,coefs:B?_.coefficients:null,sampleSpacing:B?U:null,projectDirections:b,gcsGrid:b?_.gcsGrid:null,isUV:this.rasterInfo.dataType==="vector-uv",interpolation:i.interpolation,alignmentInfo:L,blockWidths:null},i));else{const j=ve(D,A,{alignmentInfo:L});P=B?ni(j,{width:t,height:s},_.coefficients,U,i.interpolation):j,b&&_.gcsGrid&&(N=ai({width:t,height:s},_.gcsGrid),P=mi(P,this.rasterInfo.dataType,N))}return i.requestRawData||b?{srcExtent:l,pixelBlock:P,transformGrid:_,localNorthDirections:N,extent:e,isPartiallyFilled:W}:{srcExtent:l,extent:e,pixelBlock:P}}async _fetchRawTiles(e,t,s,i){const{origin:r,blockBoundary:n}=this.rasterInfo.storageInfo,{blockWidth:a,blockHeight:c}=this.getBlockWidthHeight(e);let{x:o,y:l}=t,{width:u,height:h,wrapCount:f}=s;const d=this._getRasterTileAlignmentInfo(e,0);i.buffer&&(o-=i.buffer.cols,l-=i.buffer.rows,u+=2*i.buffer.cols,h+=2*i.buffer.rows);let p=0,y=0,m=0;f&&C(d)&&({worldColumnCountFromOrigin:y,originColumnOffset:m,rightPadding:p}=d,y*d.blockWidth-p>=o+u&&(p=0));const g=Math.floor(o/a),w=Math.floor(l/c),x=Math.floor((o+u+p-1)/a),F=Math.floor((l+h+p-1)/c),k=n[e];if(!k)return null;const{minRow:T,minCol:v,maxCol:R,maxRow:b}=k;if(f===0&&(Fb||g>R))return null;const _=new Array;let P=!1;const B=this.ioConfig.allowPartialFill==null?i.allowPartialFill:this.ioConfig.allowPartialFill;for(let j=w;j<=F;j++)for(let E=g;E<=x;E++){let pe=E;if(!i.disableWrapAround&&f&&C(d)&&y<=E&&(pe=E-y-m),j>=T&&pe>=v&&b>=j&&R>=pe){const $e=this._fetchRawTile(e,j,pe,i);B?_.push(new Promise(Oe=>{$e.then(rt=>Oe(rt)).catch(()=>{P=!0,Oe(null)})})):_.push($e)}else _.push(Promise.resolve(null))}if(_.length===0)return null;const U=await Promise.all(_),L={height:(F-w+1)*c,width:(x-g+1)*a},{spatialReference:D}=this.rasterInfo,A=this.getPyramidPixelSize(e),{x:W,y:N}=A;return{extent:new q({xmin:r.x+g*a*W,xmax:r.x+(x+1)*a*W,ymin:r.y-(F+1)*c*N,ymax:r.y-w*c*N,spatialReference:D}),pixelBlocks:U,mosaicSize:L,isPartiallyFilled:P}}_fetchRawTile(e,t,s,i){const r=this.rasterInfo.storageInfo.blockBoundary[e];if(!r)return Promise.resolve(null);const{minRow:n,minCol:a,maxCol:c,maxRow:o}=r;if(to||s>c)return Promise.resolve(null);const l=Ne(this.url,i.sliceId),u=`${e}/${t}/${s}`;let h=ze(l,i.registryId,u);if(M(h)){const f=new AbortController;h=this.fetchRawTile(e,t,s,{...i,signal:f.signal}),Je(l,i.registryId,u,h,f),h.catch(()=>si(l,i.registryId,u))}return i.signal&<(i,()=>{ri(l,i.registryId,u)}),h}_computeMagDirValues(e){var o;const{bandCount:t,dataType:s}=this.rasterInfo;if(!(t===2&&s==="vector-magdir"||s==="vector-uv")||(e==null?void 0:e.length)!==2||!((o=e[0])!=null&&o.length))return null;const i=e[0].length;if(s==="vector-magdir"){const l=e[1].map(u=>(u+360)%360);return[e[0],l]}const[r,n]=e,a=[],c=[];for(let l=0;l=16;if(h||o===n&&(l>xe||u>xe)||a===0||c===0){const f=new J({x:(e.xmax-e.xmin)/t,y:(e.ymax-e.ymin)/s,spatialReference:e.spatialReference});let d=di(f,this.rasterInfo.spatialReference,e,r.datumTransformation);const p=!d||i.srcResolution&&d.x+d.y=y){const m=2**y;d={x:i.srcResolution.x*m,y:i.srcResolution.y*m}}}d&&(r.srcResolution=d,this._updateSourceDataInfo(e,r))}return(r.srcWidth/t>xe||r.srcHeight/s>xe)&&(r.srcWidth=0,r.srcHeight=0),r}_updateSourceDataInfo(e,t){t.srcWidth=0,t.srcHeight=0;const s=this.rasterInfo.spatialReference,{srcResolution:i,datumTransformation:r}=t,{pyramidLevel:n,pyramidResolution:a,excessiveReading:c}=Ae(i,this.rasterInfo,this.ioConfig.sampling);if(c)return;let o=t.srcExtent||Re(e,s,r);if(o==null)return;const l=X(this.rasterInfo.transform);l&&(o=l.inverseTransform(o)),t.srcExtent=o;const u=Math.ceil((o.xmax-o.xmin)/a.x-.1),h=Math.ceil((o.ymax-o.ymin)/a.y-.1);t.pyramidLevel=n,t.pyramidResolution=a,t.srcWidth=u,t.srcHeight=h}_getRequestOptionsWithSliceId(e){return C(this.rasterInfo.multidimensionalInfo)&&e.sliceId==null&&(e={...e,sliceId:this.getSliceIndex(e.multidimensionalDefinition)}),e}_processIdentifyResult(e,t){const{srcLocation:s,position:i,pyramidLevel:r,useTransposedTile:n}=t,a=e.pixels[0].length/e.width/e.height;if(!(!e.mask||e.mask[i]))return{location:s,value:null};const{multidimensionalInfo:c}=this.rasterInfo;if(M(c)||!n){const d=e.pixels.map(m=>m[i]),p={location:s,value:d,pyramidLevel:r},y=this._computeMagDirValues(d.map(m=>[m]));return y!=null&&y.length&&(p.magdirValue=y.map(m=>m[0])),p}let o=e.pixels.map(d=>Array.prototype.slice.call(d,i*a,i*a+a)),l=this._computeMagDirValues(o);const{requestSomeSlices:u,identifyOptions:h}=t;let f=Wt(c,h.transposedVariableName);if(u){const d=jt(f,X(h.multidimensionalDefinition),X(h.timeExtent));o=o.map(p=>d.map(y=>p[y])),l=l==null?void 0:l.map(p=>d.map(y=>p[y])),f=d.map(p=>f[p])}return{location:s,value:null,dataSeries:f.map((d,p)=>{const y={value:o.map(m=>m[p]),multidimensionalDefinition:d.multidimensionalDefinition.map(m=>new et({...m,isSlice:!0}))};return l!=null&&l.length&&(y.magdirValue=[l[0][p],l[1][p]]),y}),pyramidLevel:r}}};I([S()],V.prototype,"_rasterTileAlighmentInfo",void 0),I([S({readOnly:!0})],V.prototype,"_isGlobalWrappableSource",null),I([S(Xe)],V.prototype,"url",null),I([S({type:String,json:{write:!0}})],V.prototype,"datasetName",void 0),I([S({type:String,json:{write:!0}})],V.prototype,"datasetFormat",void 0),I([S()],V.prototype,"rasterInfo",void 0),I([S()],V.prototype,"ioConfig",void 0),I([S()],V.prototype,"sourceJSON",void 0),V=I([Q("esri.layers.support.rasterDatasets.BaseRaster")],V);const se=V;let re=class extends se{constructor(){super(...arguments),this.datasetFormat="Function",this.tileType="Raster",this.rasterFunction=null,this._primaryRasters=null}async open(e){var c;await this.init();const{rasterFunction:t}=this,{rasters:s,rasterIds:i}=t.getPrimaryRasters(),r=s.map(o=>o.rasterInfo?void 0:o.open(e));await Promise.all(r);const n=s.map(({rasterInfo:o})=>o),a=t.bind({rasterInfos:n,rasterIds:i});if(!a.success)throw new $("raster-function:open",`cannot bind the function: ${(c=a.error)!=null?c:""}`);await this.syncJobHandler(),this.set("sourceJSON",s[0].sourceJSON),this.set("rasterInfo",t.rasterInfo)}async syncJobHandler(){const{rasterFunction:e}=this;if(this._primaryRasters=e.getPrimaryRasters(),this.rasterJobHandler)return this.rasterJobHandler.updateRasterFunction(e)}async fetchPixels(e,t,s,i={}){var h,f;const{rasters:r,rasterIds:n}=this._primaryRasters,a=r.map(d=>d.fetchPixels(e,t,s,i)),c=await Promise.all(a),o=c.map(d=>d.pixelBlock);if(o.every(d=>M(d)))return c[0];const l=(f=(h=c.find(d=>C(d.pixelBlock)))==null?void 0:h.extent)!=null?f:e,u=this.rasterJobHandler?await this.rasterJobHandler.process({extent:l,primaryPixelBlocks:o,primaryRasterIds:n}):this.rasterFunction.process({extent:l,primaryPixelBlocks:o,primaryRasterIds:n});return{...c[0],pixelBlock:u}}};I([S({type:String,json:{write:!0}})],re.prototype,"datasetFormat",void 0),I([S()],re.prototype,"tileType",void 0),I([S()],re.prototype,"rasterFunction",void 0),re=I([Q("esri.layers.support.rasterDatasets.FunctionRaster")],re);const it=re,We=Ue.getLogger("esri.layers.mixins.ImageryTileMixin"),vi=e=>{let t=class extends e{constructor(){super(...arguments),this._rasterJobHandler={instance:null,refCount:0,connectionPromise:null},this.bandIds=null,this.copyright=null,this.interpolation="nearest",this.multidimensionalDefinition=null,this.multidimensionalSubset=null,this.raster=null,this.rasterFunction=null,this.sourceJSON=null,this.symbolizer=null}get fullExtent(){var i;return(i=this.rasterInfo)==null?void 0:i.extent}get rasterInfo(){var i;return(i=this.raster)==null?void 0:i.rasterInfo}get spatialReference(){var i,r;return(r=(i=this.rasterInfo)==null?void 0:i.spatialReference)!=null?r:H.WGS84}get tileInfo(){var i;return(i=this.rasterInfo)==null?void 0:i.storageInfo.tileInfo}set url(i){this._set("url",qe(i,We))}set renderer(i){this._set("renderer",i),this.updateRenderer()}async convertVectorFieldData(i,r){if(M(i)||!this.rasterInfo)return null;const n=this._rasterJobHandler.instance,a=this.rasterInfo.dataType;return n?n.convertVectorFieldData({pixelBlock:i,dataType:a},r):yi(i,a)}async createFlowMesh(i,r){const n=this._rasterJobHandler.instance;return n?n.createFlowMesh(i,r):gi(i.meshType,i.simulationSettings,i.flowData,C(r.signal)?r.signal:new AbortController().signal)}normalizeRasterFetchOptions(i){var c,o,l;const{multidimensionalInfo:r}=(c=this.rasterInfo)!=null?c:{};if(M(r))return i;let n=i.multidimensionalDefinition||this.multidimensionalDefinition;!M(n)&&n.length||(n=De(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset}));const a=i.timeExtent||this.timeExtent;if(C(n)&&C(a)&&(C(a.start)||C(a.end))){n=n.map(w=>w.clone());const u=(l=(o=r.variables.find(({name:w})=>w===n[0].variableName))==null?void 0:o.dimensions)==null?void 0:l.find(({name:w})=>w==="StdTime"),h=n.find(({dimensionName:w})=>w==="StdTime");if(!u||!h)return{...i,multidimensionalDefinition:null};const{start:f,end:d}=a,p=M(f)?null:f.getTime(),y=M(d)?null:d.getTime(),m=p!=null?p:y,g=y!=null?y:p;if(C(u.values)){const w=u.values.filter(x=>{if(Array.isArray(x)){if(m===g)return x[0]<=m&&x[1]>=m;const F=x[0]<=m&&x[1]>m||x[0]=g,k=x[0]>=m&&x[1]<=g||x[0]g;return F||k}return m===g?x===m:x>=m&&x<=g});if(w.length){const x=w.sort((F,k)=>{var T,v,R,b;return m===g?((T=F[0])!=null?T:F)-((v=k[0])!=null?v:k):Math.abs(((R=F[1])!=null?R:F)-g)-Math.abs(((b=k[1])!=null?b:k)-g)})[0];h.values=[x]}else n=null}else if(u.hasRegularIntervals&&u.extent){const[w,x]=u.extent;m>x||g0))return null;let a;await this.updateRenderer();const c=this._rasterJobHandler.instance,o=(l=this.bandIds)!=null?l:[];return a=c?await c.symbolize({...i,simpleStretchParams:r,bandIds:o}):this.symbolizer.symbolize({...i,simpleStretchParams:r,bandIds:o}),a}getTileUrl(i,r,n){var a;return((a=this.raster)==null?void 0:a.datasetFormat)==="RasterTileServer"?`${this.url}/tile/${i}/${r}/${n}`:""}getCompatibleTileInfo(i,r,n=!1){if(!this.loaded||M(r))return null;if(n&&i.equals(this.spatialReference))return this.tileInfo;const a=ut(i);return fe.create({size:256,spatialReference:i,origin:a?{x:a.origin[0],y:a.origin[1]}:{x:r.xmin,y:r.ymax}})}getCompatibleFullExtent(i){return this.loaded?(this._compatibleFullExtent&&this._compatibleFullExtent.spatialReference.equals(i)||(this._compatibleFullExtent=this.raster.computeExtent(i)),this._compatibleFullExtent):null}async fetchTile(i,r,n,a={}){if(s(this),a.requestAsImageElement){const c=this.getTileUrl(i,r,n);return Ve(c,{responseType:"image",query:{...this.refreshParameters,...this.raster.ioConfig.customFetchParameters},signal:a.signal}).then(o=>o.data)}if(C(this.rasterInfo.multidimensionalInfo)&&(a=this.normalizeRasterFetchOptions(a),M(a.multidimensionalDefinition))){const c=a.tileInfo||this.rasterInfo.storageInfo.tileInfo;return{extent:this.raster.getTileExtentFromTileInfo(i,r,n,c),pixelBlock:null}}return await this._initJobHandler(),await this._updateRasterFunction(),this.renderer.type==="raster-shaded-relief"&&(a={...a,buffer:{cols:1,rows:1}}),this.raster.fetchTile(i,r,n,a)}async fetchPixels(i,r,n,a={}){return C(this.rasterInfo.multidimensionalInfo)&&(a=this.normalizeRasterFetchOptions(a),M(a.multidimensionalDefinition))?{extent:i,pixelBlock:null}:(await this._initJobHandler(),await this._updateRasterFunction(),this.raster.fetchPixels(i,r,n,a))}async identify(i,r={}){return s(this),C(this.rasterInfo.multidimensionalInfo)&&!(this.rasterInfo.hasMultidimensionalTranspose&&!!(Ze(r.multidimensionalDefinition)||r.transposedVariableName||r.timeExtent))&&(r=this.normalizeRasterFetchOptions(r),M(r.multidimensionalDefinition))?{location:i,value:null}:this.raster.identify(i,r)}increaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount++}decreaseRasterJobHandlerUsage(){this._rasterJobHandler.refCount--,this._rasterJobHandler.refCount<=0&&this._shutdownJobHandler()}hasStandardTime(){var a,c,o;const i=(a=this.rasterInfo)==null?void 0:a.multidimensionalInfo;if(M(i)||((c=this.rasterInfo)==null?void 0:c.dataType)!=="standard-time")return!1;const r=this.multidimensionalDefinition,n=(o=r==null?void 0:r[0])==null?void 0:o.variableName;return i.variables.some(l=>l.name===n&&(!(r!=null&&r[0].dimensionName)||l.dimensions.some(u=>u.name==="StdTime")))}getStandardTimeValue(i){return new Date(24*(i-25569)*3600*1e3).toString()}getMultidimensionalSubsetVariables(i){const r=i!=null?i:this.rasterInfo.multidimensionalInfo;return qt(this.multidimensionalSubset,r)}_configDefaultSettings(){this._configDefaultInterpolation(),this.multidimensionalDefinition||(this.multidimensionalDefinition=De(this.raster.rasterInfo,{multidimensionalSubset:this.multidimensionalSubset})),this._configDefaultRenderer()}_initJobHandler(){if(this._rasterJobHandler.connectionPromise!=null)return this._rasterJobHandler.connectionPromise;const i=new Nt;return this._rasterJobHandler.connectionPromise=i.initialize().then(()=>{s(this),this._rasterJobHandler.instance=i,this.raster.rasterJobHandler=i,this.renderer&&this.updateRenderer(),this.raster.datasetFormat==="Function"&&this.raster.syncJobHandler()}).catch(()=>{}),this._rasterJobHandler.connectionPromise}_shutdownJobHandler(){this._rasterJobHandler.instance&&this._rasterJobHandler.instance.destroy(),this._rasterJobHandler.instance=null,this._rasterJobHandler.connectionPromise=null,this._rasterJobHandler.refCount=0,this._cachedRendererJson=null,this.raster&&(this.raster.rasterJobHandler=null)}_configDefaultInterpolation(){var i;if(this.interpolation==null){s(this);const r=Bt(this.rasterInfo,this.raster.tileType,(i=this.sourceJSON)==null?void 0:i.defaultResamplingMethod);this._set("interpolation",r)}}_configDefaultRenderer(){var n,a,c,o,l;s(this);const i=this.raster.rasterInfo;if(this.bandIds||(this.bandIds=Dt(i)),!this.renderer){const u=Et(i,{bandIds:this.bandIds,variableName:C(this.multidimensionalDefinition)?(n=this.multidimensionalDefinition[0])==null?void 0:n.variableName:null});this.raster.datasetFormat==="WCSServer"&&u.type==="raster-stretch"&&(((c=(a=i.statistics)==null?void 0:a[0].max)!=null?c:0)>1e24||((l=(o=i.statistics)==null?void 0:o[0].min)!=null?l:0)<-1e24)&&(u.dynamicRangeAdjustment=!0,u.statistics=null,u.stretchType==="none"&&(u.stretchType="min-max")),this.renderer=u}this.symbolizer?(this.symbolizer.rendererJSON=Be(this.renderer.toJSON()),this.symbolizer.rasterInfo=i):this.symbolizer=new Vt({rendererJSON:this.renderer.toJSON(),rasterInfo:i});const r=this.symbolizer.bind();r.success||We.warn("imagery-tile-mixin",r.error||"The given renderer is not supported by the layer.")}async _updateRasterFunction(){var n;if(this.type!=="imagery-tile"||JSON.stringify(this.rasterFunction)===JSON.stringify(this._cachedRasterFunctionJson))return;let i=this.raster;(i==null?void 0:i.datasetFormat)==="Function"&&(i=i.rasterFunction.getPrimaryRasters().rasters[0]);const{rasterFunction:r}=this;if(r){const a=tt(r.toJSON(),{raster:i}),c=new it({rasterFunction:a});c.rasterJobHandler=this._rasterJobHandler.instance,await c.open(),this._cachedRasterFunctionJson=(n=this.rasterFunction)==null?void 0:n.toJSON(),this.raster=c}else this.raster=i}};function s(i){if(!i.raster||!i.rasterInfo)throw new $("imagery-tile","no raster")}return I([S()],t.prototype,"_cachedRendererJson",void 0),I([S()],t.prototype,"_cachedRasterFunctionJson",void 0),I([S()],t.prototype,"_compatibleFullExtent",void 0),I([S()],t.prototype,"_rasterJobHandler",void 0),I([S()],t.prototype,"bandIds",void 0),I([S({json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),I([S({json:{read:!1}})],t.prototype,"fullExtent",null),I([S()],t.prototype,"interpolation",void 0),I([S()],t.prototype,"ioConfig",void 0),I([S({type:[et]})],t.prototype,"multidimensionalDefinition",void 0),I([S({type:$t,json:{write:!0}})],t.prototype,"multidimensionalSubset",void 0),I([S()],t.prototype,"raster",void 0),I([S({type:Ot})],t.prototype,"rasterFunction",void 0),I([S()],t.prototype,"rasterInfo",null),I([S()],t.prototype,"sourceJSON",void 0),I([S({json:{read:!1}})],t.prototype,"spatialReference",null),I([S({json:{read:!1}})],t.prototype,"tileInfo",null),I([S(Xe)],t.prototype,"url",null),I([S({types:Qe})],t.prototype,"renderer",null),I([S()],t.prototype,"symbolizer",void 0),t=I([Q("esri.layers.ImageryTileMixin")],t),t};function Ti(e){const t=e.fields,s=e.records,i=t.some(l=>l.name.toLowerCase()==="oid")?"OBJECTID":"OID",r=[{name:i,type:"esriFieldTypeOID",alias:"OID"}].concat(t.map(l=>({name:l.name,type:"esriFieldType"+l.typeName,alias:l.name}))),n=r.map(l=>l.name),a=[];let c=0,o=0;return s.forEach(l=>{const u={};for(u[i]=c++,o=1;o0)for(;u.lengtha;){const f=[];s.getUint8(o)===32?(o+=1,l.forEach(d=>{if(d.type==="C")f.push(Ee(new Uint8Array(t,o,d.length)).trim());else if(d.type==="N")f.push(parseInt(String.fromCharCode.apply(null,new Uint8Array(t,o,d.length)).trim(),10));else if(d.type==="F")f.push(parseFloat(String.fromCharCode.apply(null,new Uint8Array(t,o,d.length)).trim()));else if(d.type==="D"){const p=String.fromCharCode.apply(null,new Uint8Array(t,o,d.length)).trim();f.push(new Date(parseInt(p.substring(0,4),10),parseInt(p.substring(4,6),10)-1,parseInt(p.substring(6,8),10)))}o+=d.length}),u.push(f)):o+=a}}return{header:c,fields:l,records:u,recordSet:Ti({fields:l,records:u})}}}const ee=new Map;ee.set("int16","esriFieldTypeSmallInteger"),ee.set("int32","esriFieldTypeInteger"),ee.set("int64","esriFieldTypeInteger"),ee.set("float32","esriFieldTypeSingle"),ee.set("float64","esriFieldTypeDouble"),ee.set("text","esriFieldTypeString");const je=8;let le=class extends se{constructor(){super(...arguments),this.storageInfo=null,this.datasetFormat="CRF"}async open(e){await this.init();const{data:t}=await this.request(this.url+"/conf.json",{signal:e==null?void 0:e.signal});if(!this._validateHeader(t))throw new $("cloudraster:open","Invalid or unsupported conf.json.");this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{storageInfo:s,rasterInfo:i}=this._parseHeader(t);if(i.dataType==="thematic"){const r=await this._fetchAuxiliaryInformation();i.attributeTable=r}this._set("storageInfo",s),this._set("rasterInfo",i),this.ioConfig.retryCount=this.ioConfig.retryCount||0}async fetchRawTile(e,t,s,i={}){const{transposeInfo:r}=this.rasterInfo.storageInfo,{transposedVariableName:n}=i,a=!(!r||!n),c=a?0:this.rasterInfo.storageInfo.maximumPyramidLevel-e;if(c<0)return null;const o=this._buildCacheFilePath(c,t,s,i.multidimensionalDefinition,n),l=this._getIndexRecordFromBundle(t,s,a),u=await this.request(o,{range:{from:0,to:this.storageInfo.headerSize-1},responseType:"array-buffer",signal:i.signal});if(!u)return null;const h=new Uint8Array(u.data),f=this._getTileEndAndContentType(h,l);if(f.recordSize===0)return null;const d=await this.request(o,{range:{from:f.position,to:f.position+f.recordSize},responseType:"array-buffer",signal:i.signal});if(!d)return null;const[p,y]=this._getTileSize(a);return this.decodePixelBlock(d.data,{width:p,height:y,planes:null,pixelType:null,returnInterleaved:a})}_validateHeader(e){const t=["origin","extent","geodataXform","LODInfos","blockWidth","blockHeight","bandCount","pixelType","pixelSizeX","pixelSizeY","format","packetSize"];return e&&e.type==="RasterInfo"&&!t.some(s=>!e[s])}_parseHeader(e){var N,j;const t=["u1","u2","u4","u8","s8","u16","s16","u32","s32","f32","f64"][e.pixelType],{bandCount:s,histograms:i,colormap:r,blockWidth:n,blockHeight:a,firstPyramidLevel:c,maximumPyramidLevel:o}=e,l=e.statistics&&e.statistics.map(E=>({min:E.min,max:E.max,avg:E.mean,stddev:E.standardDeviation,median:E.median,mode:E.mode})),u=e.extent.spatialReference,h=(N=e.geodataXform)==null?void 0:N.spatialReference,f=new H((u==null?void 0:u.wkid)||(u==null?void 0:u.wkt)?u:h);let d=new q({xmin:e.extent.xmin,ymin:e.extent.ymin,xmax:e.extent.xmax,ymax:e.extent.ymax,spatialReference:f});const p=new J({x:e.pixelSizeX,y:e.pixelSizeY,spatialReference:f}),y=Math.round((d.xmax-d.xmin)/p.x),m=Math.round((d.ymax-d.ymin)/p.y),g=this._parseTransform(e.geodataXform),w=g?d:null;g&&(d=g.forwardTransform(d),p.x=(d.xmax-d.xmin)/y,p.y=(d.ymax-d.ymin)/m);const x=(j=e.properties)!=null?j:{},F=e.format.toLowerCase().replace("cache/",""),k=new J(e.origin.x,e.origin.y,f);let T,v,R,b;if(r&&r.colors)for(T=[],v=0;v>>24,R<<8>>>24,R>>>24]);const _=e.LODInfos,P=[];for(v=0;v<_.levels.length;v++)P.push({level:_.levels[v],resolution:_.resolutions[v],scale:96/.0254*_.resolutions[v]});const B=new fe({dpi:96,lods:P,format:F,origin:k,size:[n,a],spatialReference:f}),U={recordSize:je,packetSize:e.packetSize,headerSize:e.packetSize*e.packetSize*je+64},L=[{maxCol:Math.ceil(y/n)-1,maxRow:Math.ceil(m/a)-1,minCol:0,minRow:0}];let D=2;if(o>0)for(v=0;vn.data).catch(()=>null),s=this.request(this.url+"/conf.vat.dbf",{responseType:"array-buffer",signal:e}).then(n=>n.data).catch(()=>null),i=await Promise.all([t,s]);let r;if(i[0]){let n=i[0].fields;const a=i[0].values;if(n&&a){n=n.map(o=>({type:o.name==="OID"?"esriFieldTypeOID":ee.get(o.type),name:o.name,alias:o.alias||o.name}));const c=a.map(o=>({attributes:o}));n&&a&&(r={fields:n,features:c})}}return!r&&i[1]&&(r=st.parse(i[1]).recordSet),Ye.fromJSON(r)}_buildCacheFilePath(e,t,s,i,r){const n=this._getPackageSize(!!r),a=Math.floor(t/n)*n,c=Math.floor(s/n)*n,o="R"+this._toHexString4(a)+"C"+this._toHexString4(c);let l="L";l+=e>=10?e.toString():"0"+e.toString();const{multidimensionalInfo:u}=this.rasterInfo,h=i==null?void 0:i[0];if(M(u)||!h)return`${this.url}/_alllayers/${l}/${o}.bundle`;let f="_yxs";if(!r){f=u.variables.find(y=>y.name===h.variableName).dimensions[0].values.indexOf(h.values[0]).toString(16);const p=4-f.length;for(let y=0;y0;)t="0"+t}return t}};I([S({readOnly:!0})],le.prototype,"storageInfo",void 0),I([S({type:String,json:{write:!0}})],le.prototype,"datasetFormat",void 0),le=I([Q("esri.layers.support.rasterDatasets.CloudRaster")],le);const Ri=le;let ce=class extends se{constructor(){super(...arguments),this.datasetFormat="MEMORY",this.data=null}async open(e){var m,g;await this.init();const t=this.data,{pixelBlock:s,statistics:i,histograms:r,name:n,keyProperties:a,nativeExtent:c,transform:o}=this.data,{width:l,height:u,pixelType:h}=s,f=(m=t.extent)!=null?m:new q({xmin:-.5,ymin:.5,xmax:l-.5,ymax:u-.5,spatialReference:new H({wkid:3857})}),d=(g=t.isPseudoSpatialReference)!=null?g:!t.extent,p={x:f.width/l,y:f.height/u},y=new me({width:l,height:u,pixelType:h,extent:f,nativeExtent:c,transform:o,pixelSize:p,spatialReference:f.spatialReference,bandCount:3,keyProperties:a||{},statistics:i,isPseudoSpatialReference:d,histograms:r});this.createRemoteDatasetStorageInfo(y,512,512),this._set("rasterInfo",y),this.updateTileInfo(),await this._buildInMemoryRaster(s,{width:512,height:512},e),this.datasetName=n,this.url="/InMemory/"+n}fetchRawTile(e,t,s,i={}){const r=this._pixelBlockTiles.get(`${e}/${t}/${s}`);return Promise.resolve(r)}async _buildInMemoryRaster(e,t,s){var l,u;const i=this.rasterInfo.storageInfo.maximumPyramidLevel,r=this.rasterJobHandler?this.rasterJobHandler.split({pixelBlock:e,tileSize:t,maximumPyramidLevel:i},s):Promise.resolve(oi(e,t,i)),n=C(this.rasterInfo.statistics),a=C(this.rasterInfo.histograms),c=n?Promise.resolve({statistics:null,histograms:null}):this.rasterJobHandler?this.rasterJobHandler.estimateStatisticsHistograms({pixelBlock:e},s):Promise.resolve(Xt(e)),o=await Ke([r,c]);if(!o[0].value&&o[1].value)throw new $("inmemory-raster:open","failed to build in memory raster");this._pixelBlockTiles=o[0].value,n||(this.rasterInfo.statistics=(l=o[1].value)==null?void 0:l.statistics),a||(this.rasterInfo.histograms=(u=o[1].value)==null?void 0:u.histograms)}};I([S({type:String,json:{write:!0}})],ce.prototype,"datasetFormat",void 0),I([S()],ce.prototype,"data",void 0),ce=I([Q("esri.layers.support.rasterDatasets.InMemoryRaster")],ce);const _i=ce;function ae(e,t){if(!e||!t)return[];let s=t;t.includes("/")?(s=t.slice(0,t.indexOf("/")),t=t.slice(t.indexOf("/")+1)):t="";const i=[];if(t){const n=ae(e,s);for(let a=0;ai.push(c));return i}const r=e.getElementsByTagNameNS("*",s);if(!r||r.length===0)return[];for(let n=0;n0?t?G(i[0],t):i[0]:null}function K(e,t=null){const s=t?G(e,t):e;let i;return s?(i=s.textContent||s.nodeValue,i?i.trim():null):null}function ki(e,t){const s=ae(e,t),i=[];let r;for(let n=0;nNumber(s))}function ie(e,t){const s=K(e,t);return Number(s)}function _e(e,t){var r;const s=(r=e==null?void 0:e.nodeName)==null?void 0:r.toLowerCase(),i=t.toLowerCase();return s.slice(s.lastIndexOf(":")+1)===i}function Ge(e,t){if(!e||!t)return null;const s=[];for(let i=0;iNumber(d));let c,o,l,u;ae(e,"Metadata/MDI").forEach(d=>{var y;const p=Number((y=d.textContent)!=null?y:d.nodeValue);switch(d.getAttribute("key").toUpperCase()){case"STATISTICS_MINIMUM":c=p;break;case"STATISTICS_MAXIMUM":o=p;break;case"STATISTICS_MEAN":l=p;break;case"STATISTICS_STDDEV":u=p}});const h=ie(e,"Metadata/SourceBandIndex");return{noDataValue:t,histogram:(a==null?void 0:a.length)&&i!=null&&r!=null?{min:i,max:r,size:n||a.length,counts:a}:null,sourceBandIndex:h,statistics:c!=null&&o!=null?{min:c,max:o,avg:l,stddev:u}:null}}function Se(e){if(!e)return null;let t=Number(e);if(!isNaN(t)&&t!==0)return new H({wkid:t});if((e=String(e)).startsWith("COMPD_CS")){if(!e.includes("VERTCS")||!e.includes("GEOGCS")&&!e.startsWith("PROJCS"))return null;const s=e.indexOf("VERTCS"),i=e.indexOf("PROJCS"),r=i>-1?i:e.indexOf("GEOGCS");if(r===-1)return null;const n=e.slice(r,e.lastIndexOf("]",s)+1).trim(),a=e.slice(s,e.lastIndexOf("]")).trim();t=ke(n);const c=new H(t?{wkid:t}:{wkt:n}),o=ke(a);return o&&(c.vcsWkid=o),c}return e.startsWith("GEOGCS")||e.startsWith("PROJCS")?(t=ke(e),new H(t!==0?{wkid:t}:{wkt:e})):null}function ke(e){var r;const t=e.replace(/\]/g,"[").replace(/\"/g,"").split("[").map(n=>n.trim()).filter(n=>n!==""),s=t[t.length-1].split(","),i=(r=s[0])==null?void 0:r.toLowerCase();if((i==="epsg"||i==="esri")&&e.endsWith('"]]')){const n=Number(s[1]);if(!isNaN(n)&&n!==0)return n}return 0}function Me(e){var i;if(((i=e==null?void 0:e.documentElement.tagName)==null?void 0:i.toLowerCase())!=="pamdataset")return{};const t={spatialReference:null,transform:null,metadata:{},rasterBands:[],statistics:null,histograms:null};e.documentElement.childNodes.forEach(r=>{if(r.nodeType===1){if(_e(r,"SRS")){if(!t.spatialReference){const n=K(r);t.spatialReference=Se(n)}}else if(_e(r,"Metadata"))if(r.getAttribute("domain")==="xml:ESRI"){const{spatialReference:n,transform:a}=Ci(r);t.transform=a,t.spatialReference||(t.spatialReference=n)}else ae(r,"MDI").forEach(n=>t.metadata[n.getAttribute("key")]=K(n));else if(_e(r,"PAMRasterBand")){const n=Fi(r);n.sourceBandIndex!=null&&t.rasterBands[n.sourceBandIndex]==null?t.rasterBands[n.sourceBandIndex]=n:t.rasterBands.push(n)}}});const s=t.rasterBands;if(s.length){const r=!!s[0].statistics;t.statistics=r?s.map(a=>a.statistics).filter(C):null;const n=!!s[0].histogram;t.histograms=n?s.map(a=>a.histogram).filter(C):null}return t}let be=class extends se{async open(e){await this.init();const t=await this._fetchData(e);let{spatialReference:s,statistics:i,histograms:r,transform:n}=await this._fetchAuxiliaryData(e);const a=!s;a&&(s=new H({wkid:3857})),(r==null?void 0:r.length)&&i==null&&(i=Fe(r));const{width:c,height:o}=t;let l=new q({xmin:-.5,ymin:.5-o,xmax:c-.5,ymax:.5,spatialReference:s});const u=n?n.forwardTransform(l):l;let h=!0;if(n){const d=n.forwardCoefficients;h=d&&d[1]===0&&d[2]===0,h&&(n=null,l=u)}const f=new _i({data:{extent:u,nativeExtent:l,transform:n,pixelBlock:t,statistics:i,histograms:r,keyProperties:{DateType:"Processed"},isPseudoSpatialReference:a}});await f.open(),f.data=null,this._set("rasterInfo",f.rasterInfo),this._inMemoryRaster=f}fetchRawTile(e,t,s,i={}){return this._inMemoryRaster.fetchRawTile(e,t,s,i)}async _fetchData(e){const{data:t}=await this.request(this.url,{responseType:"array-buffer",signal:e==null?void 0:e.signal}),s=Yt(t).toUpperCase();if(s!=="JPG"&&s!=="PNG"&&s!=="GIF"&&s!=="BMP")throw new $("image-aux-raster:open","the data is not a supported format");this._set("datasetFormat",s);const i=s.toLowerCase(),r=i==="gif"||i==="bmp"||!ht("ios");return await this.decodePixelBlock(t,{format:i,useCanvas:r,hasNoZlibMask:!0})}async _fetchAuxiliaryData(e){var l,u;const t=X(e==null?void 0:e.signal),s=(l=this.ioConfig.skipExtensions)!=null?l:[],i=s.includes("aux.xml")?null:this.request(this.url+".aux.xml",{responseType:"xml",signal:t}),r=this.datasetFormat,n=r==="JPG"?"jgw":r==="PNG"?"pgw":r==="BMP"?"bpw":null,a=n&&s.includes(n)?null:this.request(this.url.slice(0,this.url.lastIndexOf("."))+"."+n,{responseType:"text",signal:t}),c=await Ke([i,a]);if(t!=null&&t.aborted)throw ft();const o=Me((u=c[0].value)==null?void 0:u.data);if(!o.transform){const h=c[1].value?c[1].value.data.split(` `).slice(0,6).map(f=>Number(f)):null;o.transform=(h==null?void 0:h.length)===6?new Pe({forwardCoefficients:[h[4],h[5],h[0],-h[1],h[2],-h[3]]}):null}return o}};I([S({type:String,json:{write:!0}})],be.prototype,"datasetFormat",void 0),be=I([Q("esri.layers.support.rasterDatasets.ImageAuxRaster")],be);const we=be;let ue=class extends se{constructor(){super(...arguments),this._levelOffset=0,this._tilemapCache=null,this._slices=null,this.datasetFormat="RasterTileServer",this.tileType=null}async open(e){var k,T,v,R;await this.init();const t=e&&e.signal,s=this.sourceJSON?{data:this.sourceJSON}:await this.request(this.url,{query:{f:"json"},signal:t});s.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));const i=s.data;if(this.sourceJSON=i,!i)throw new $("imageserverraster:open","cannot initialize tiled image service, missing service info");if(!i.tileInfo)throw new $("imageserverraster:open","use ImageryLayer to open non-tiled image services");this._fixScaleInServiceInfo();const r=["jpg","jpeg","png","png8","png24","png32","mixed"];this.tileType=i.cacheType,this.tileType==null&&(r.includes(i.tileInfo.format.toLowerCase())?this.tileType="Map":i.tileInfo.format.toLowerCase()==="lerc"?this.tileType="Elevation":this.tileType="Raster"),this.datasetName=(T=(k=i.name)==null?void 0:k.slice(i.name.indexOf("/")+1))!=null?T:"";const n=await this._fetchRasterInfo({signal:t});if(M(n))throw new $("image-server-raster:open","cannot initialize image service");const a=this.tileType==="Map"?bi(i.tileInfo,i):fe.fromJSON(i.tileInfo);dt(a);const[c,o]=this._computeMinMaxLOD(n,a),{extent:l,pixelSize:u}=n,h=.5/n.width*u.x,f=Math.max(u.x,u.y),{lods:d}=a;(this.tileType!=="Map"&&i.maxScale!==0||Math.abs(u.x-u.y)>h||!d.some(b=>Math.abs(b.resolution-f){b.level>=o.level&&b.level<=c.level&&g.push({x:b.resolution,y:b.resolution})}),g.sort((b,_)=>b.x-_.x);const w=this.computeBlockBoundary(l,y,m,a.origin,g,p),x=g.length>1?g.slice(1):null;let F;if(i.transposeInfo&&(F={tileSize:[i.transposeInfo.rows,i.transposeInfo.cols],packetSize:(R=(v=n.keyProperties)==null?void 0:v._yxs.PacketSize)!=null?R:0}),n.storageInfo=new de({blockWidth:a.size[0],blockHeight:a.size[1],pyramidBlockWidth:a.size[0],pyramidBlockHeight:a.size[1],pyramidResolutions:x,compression:a.format,origin:a.origin,firstPyramidLevel:1,maximumPyramidLevel:p,tileInfo:a,transposeInfo:F,blockBoundary:w}),this._fixGCSShift(n),this._set("rasterInfo",n),i.capabilities.toLowerCase().includes("tilemap")){const b={tileInfo:n.storageInfo.tileInfo,parsedUrl:mt(this.url),url:this.url,tileServers:[],type:"tile"};this._tilemapCache=new Si({layer:b})}}async fetchRawTile(e,t,s,i={}){const{storageInfo:r,extent:n}=this.rasterInfo,{transposeInfo:a}=r,c=C(a)&&!!i.transposedVariableName;if(this._slices&&!c&&i.sliceId==null)return null;const o=c?0:r.maximumPyramidLevel-e+this._levelOffset,l=`${this.url}/tile/${o}/${t}/${s}`,u=this._slices?c?{variable:i.transposedVariableName}:{sliceId:i.sliceId||0}:null,{data:h}=await this.request(l,{query:u,responseType:"array-buffer",signal:i.signal});if(!h)return null;const f=c?a.tileSize:r.tileInfo.size,d=await this.decodePixelBlock(h,{width:f[0],height:f[1],planes:null,pixelType:null,isPoint:this.tileType==="Elevation",returnInterleaved:c}),p=r.blockBoundary[e];if(r.compression!=="jpg"||s>p.minCol&&sp.minRow&&t{const n=t.find(a=>r.variableName===a.variableName&&a.dimensionName===r.dimensionName);return n?(Array.isArray(r.values[0])?`${r.values[0][0]}-${r.values[0][1]}`:r.values[0])!==(Array.isArray(n.values[0])?`${n.values[0][0]}-${n.values[0][1]}`:n.values[0]):!0}))return s}return null}async fetchVariableStatisticsHistograms(e,t){const s=this.request(this.url+"/statistics",{query:{variable:e,f:"json"},signal:t}).then(n=>{var a;return(a=n.data)==null?void 0:a.statistics}),i=this.request(this.url+"/histograms",{query:{variable:e,f:"json"},signal:t}).then(n=>{var a;return(a=n.data)==null?void 0:a.histograms}),r=await Promise.all([s,i]);return r[0]&&r[0].forEach(n=>{n.avg=n.mean,n.stddev=n.standardDeviation}),{statistics:r[0]||null,histograms:r[1]||null}}async computeBestPyramidLevelForLocation(e,t={}){if(!this._tilemapCache)return 0;let s=this.identifyPixelLocation(e,0,X(t.datumTransformation));if(s===null)return null;let i=0;const{maximumPyramidLevel:r}=this.rasterInfo.storageInfo;let n=r-i+this._levelOffset;const a=s.srcLocation;for(;n>=0;){try{if(await this._tilemapCache.fetchAvailability(n,s.row,s.col,t)==="available")break}catch{}if(n--,i++,s=this.identifyPixelLocation(a,i,X(t.datumTransformation)),s===null)return null}return n===-1||s==null?null:i}async _fetchRasterInfo(e){const t=this.sourceJSON;if(this.tileType==="Map"){const a=t.fullExtent||t.extent,c=Math.ceil((a.xmax-a.xmin)/t.pixelSizeX-.1),o=Math.ceil((a.ymax-a.ymin)/t.pixelSizeY-.1),l=H.fromJSON(t.spatialReference||a.spatialReference),u=new J({x:t.pixelSizeX,y:t.pixelSizeY,spatialReference:l});return new me({width:c,height:o,bandCount:3,extent:q.fromJSON(a),spatialReference:l,pixelSize:u,pixelType:"u8",statistics:null,keyProperties:{DataType:"processed"}})}const{signal:s}=e,i=zt(this.url,this.sourceJSON,{signal:s,query:this.ioConfig.customFetchParameters}),r=t.hasMultidimensions?this.request(`${this.url}/slices`,{query:{f:"json"},signal:s}).then(a=>a.data&&a.data.slices).catch(()=>null):null,n=await Promise.all([i,r]);return this._slices=n[1],n[0]}_fixScaleInServiceInfo(){const{sourceJSON:e}=this;e.minScale&&e.minScale<0&&(e.minScale=0),e.maxScale&&e.maxScale<0&&(e.maxScale=0)}_fixGCSShift(e){const{extent:t,spatialReference:s}=e;t.xmin>-1&&t.xmax>181&&(s==null?void 0:s.wkid)&&s.isGeographic&&(e.nativeExtent=e.extent,e.transform=new wi,e.extent=e.transform.forwardTransform(t))}_computeMinMaxLOD(e,t){var f,d,p;const{pixelSize:s}=e,i=.5/e.width*s.x,{lods:r}=t,n=t.lodAt(Math.max.apply(null,r.map(y=>y.level))),a=t.lodAt(Math.min.apply(null,r.map(y=>y.level))),{tileType:c}=this;if(c==="Map")return this._levelOffset=r[0].level,[n,a];if(c==="Raster")return[(f=r.find(y=>y.resolution===s.x))!=null?f:n,a];const{minScale:o,maxScale:l}=this.sourceJSON;let u=n;l>0&&(u=r.find(y=>Math.abs(y.scale-l)y.scale>l).sort((y,m)=>y.scale>m.scale?1:-1)[0])!=null?d:n));let h=a;return o>0&&(h=(p=r.find(y=>Math.abs(y.scale-o)0&&(this.rasterInfo.storageInfo.firstPyramidLevel=1,this.rasterInfo.storageInfo.maximumPyramidLevel=p),this.updateTileInfo()}async fetchRawTile(e,t,s,i={}){const{blockWidth:r,blockHeight:n,blockBoundary:a}=this.rasterInfo.storageInfo,c=a[e];if(!c||c.maxRowt||c.minCol>s)return null;const{bandCount:o,pixelType:l}=this.rasterInfo,{ranges:u,actualTileWidth:h,actualTileHeight:f}=this._getTileLocation(e,t,s);if(!u||u.length===0)return null;if(u[0].from===0&&u[0].to===0){const b=new Uint8Array(r*n);return new ci({width:r,height:n,pixels:null,mask:b,validPixelCount:0})}const{bandIds:d}=this.ioConfig,p=this._getBandSegmentCount(),y=[];let m=0;for(m=0;m-1)&&y.push(this.request(this._files.data,{range:{from:u[m].from,to:u[m].to},responseType:"array-buffer",signal:i.signal}));const g=await Promise.all(y),w=g.map(b=>b.data.byteLength).reduce((b,_)=>b+_),x=new Uint8Array(w);let F=0;for(m=0;m1e24)for(m=0;m<_;m++)Math.abs((T.pixels[0][m]-b)/b)>1e-6&&(P[m]=1);else for(m=0;m<_;m++)T.pixels[0][m]!==b&&(P[m]=1);T.mask=P}}let v=0,R=0;if(h!==r||f!==n){let b=T.mask;if(b)for(m=0;m0)throw"invalid array buffer must be multiples of 16";let t,s,i,r,n,a;if(Kt){for(s=new Uint8Array(e),r=new ArrayBuffer(e.byteLength),i=new Uint8Array(r),n=0;nparseFloat(B)))),G(e,"MRF_META/CachedSource"))throw new $("mrf:open","currently does not support MRF referencing other data files");const y=G(e,"MRF_META/GeoTags"),m=G(y,"BoundingBox");let g,w=!1;if(m!=null){const B=parseFloat(m.getAttribute("minx")),U=parseFloat(m.getAttribute("miny")),L=parseFloat(m.getAttribute("maxx")),D=parseFloat(m.getAttribute("maxy")),A=K(y,"Projection")||"";let W=H.WGS84;if(A!=="LOCAL_CS[]")if(A.toLowerCase().startsWith("epsg:")){const N=Number(A.slice(5));isNaN(N)||N===0||(W=new H({wkid:N}))}else W=(P=Se(A))!=null?P:H.WGS84;else w=!0,W=new H({wkid:3857});g=new q(B,U,L,D),g.spatialReference=W}else w=!0,g=new q({xmin:-.5,ymin:.5-r,xmax:i-.5,ymax:.5,spatialReference:new H({wkid:3857})});const x=G(e,"MRF_META/Rsets"),F=parseInt(x&&x.getAttribute("scale")||"2",10),k=g.spatialReference,T=new de({origin:new J({x:g.xmin,y:g.ymax,spatialReference:k}),blockWidth:u,blockHeight:h,pyramidBlockWidth:u,pyramidBlockHeight:h,compression:a,pyramidScalingFactor:F}),v=new J({x:g.width/i,y:g.height/r,spatialReference:k}),R=new me({width:i,height:r,extent:g,isPseudoSpatialReference:w,spatialReference:k,bandCount:n,pixelType:o,pixelSize:v,noDataValue:d,storageInfo:T}),b=K(e,"datafile"),_=K(e,"IndexFile");return{rasterInfo:R,files:{mrf:this.url,index:_||this.url.replace(".mrf",".idx"),data:b||this.url.replace(".mrf",Z.get(a).blobExtension)}}}async _fetchAuxiliaryData(e){try{const{data:t}=await this.request(this.url+".aux.xml",{responseType:"xml",signal:e==null?void 0:e.signal});return Me(t)}catch{return null}}};I([S()],ne.prototype,"_files",void 0),I([S()],ne.prototype,"_storageIndex",void 0),I([S({type:String,json:{write:!0}})],ne.prototype,"datasetFormat",void 0),ne=I([Q("esri.layers.support.rasterIO.MRFRaster")],ne);const Mi=ne,Ce=(e,t)=>{var s;return(s=e.get(t))==null?void 0:s.values},oe=(e,t)=>{var s,i;return(i=(s=e.get(t))==null?void 0:s.values)==null?void 0:i[0]};let te=class extends se{constructor(){super(...arguments),this._files=null,this._headerInfo=null,this._bufferSize=1048576,this.datasetFormat="TIFF"}async open(e){await this.init();const t=e?X(e.signal):null,{data:s}=await this.request(this.url,{range:{from:0,to:this._bufferSize},responseType:"array-buffer",signal:t});if(!s)throw new $("tiffraster:open","failed to open url "+this.url);this.datasetName=this.url.slice(this.url.lastIndexOf("/")+1);const{littleEndian:i,firstIFDPos:r,isBigTiff:n}=Qt(s),a=[];await this._readIFDs(a,s,i,r,0,n?8:4,t);const{imageInfo:c,rasterInfo:o}=this._parseIFDs(a);if(this._headerInfo={littleEndian:i,isBigTiff:n,ifds:a,...c},this._set("rasterInfo",o),!c.isSupported)throw new $("tiffraster:open","this tiff is not supported: "+c.message);if(!c.tileWidth)throw new $("tiffraster:open","none-tiled tiff is not optimized for access, convert to COG and retry.");const{skipExtensions:l=[]}=this.ioConfig;if(!l.includes("aux.xml")){const u=await this._fetchAuxiliaryMetaData(e);u!=null&&this._processPAMInfo(u,o)}l.includes("vat.dbf")||o.bandCount!==1||o.pixelType!=="u8"||(o.attributeTable=await this._fetchAuxiliaryTable(e),C(o.attributeTable)&&(o.keyProperties.DataType="thematic")),this.updateTileInfo()}async fetchRawTile(e,t,s,i={}){var k;if(!((k=this._headerInfo)!=null&&k.isSupported)||this.isBlockOutside(e,t,s))return null;const r=this._getTileLocation(e,t,s);if(!r)return null;const{ranges:n,actualTileWidth:a,actualTileHeight:c,ifd:o}=r,l=n.map(T=>this.request(this.url,{range:T,responseType:"array-buffer",signal:i.signal})),u=await Promise.all(l),h=u.map(T=>T.data.byteLength).reduce((T,v)=>T+v),f=u.length===1?u[0].data:new ArrayBuffer(h),d=[0],p=[0];if(u.length>1){const T=new Uint8Array(f);for(let v=0,R=0;v3&&_.length%3==0){R=[];const L=_.length/3;for(let D=0;D>>8,_[D+L]>>>8,_[D+2*L]>>>8])}const P=new me({width:s,height:i,bandCount:a,pixelType:c,pixelSize:T,storageInfo:k,spatialReference:g,isPseudoSpatialReference:w,keyProperties:v,extent:x,colormap:R,statistics:y?y.statistics:null});return p!=null&&p.length&&(P.nativeExtent=new q({xmin:-.5,ymin:.5-i,xmax:s-.5,ymax:.5,spatialReference:g}),P.transform=new Pe({polynomialOrder:1,forwardCoefficients:[p[2]+p[0]/2,p[5]-p[3]/2,p[0],p[3],-p[1],-p[4]]}),P.extent=P.transform.forwardTransform(P.nativeExtent),P.pixelSize=new J({x:(x.xmax-x.xmin)/s,y:(x.ymax-x.ymin)/i,spatialReference:g}),k.origin.x=-.5,k.origin.y=.5),{imageInfo:t,rasterInfo:P}}_processPAMInfo(e,t){var s;if(t.statistics=(s=e.statistics)!=null?s:t.statistics,t.histograms=e.histograms,e.histograms&&M(t.statistics)&&(t.statistics=Fe(e.histograms)),e.transform&&M(t.transform)){t.transform=e.transform,t.nativeExtent=t.extent;const i=t.transform.forwardTransform(t.nativeExtent);t.pixelSize=new J({x:(i.xmax-i.xmin)/t.width,y:(i.ymax-i.ymin)/t.height,spatialReference:t.spatialReference}),t.extent=i}t.spatialReference||(t.spatialReference=e.spatialReference)}async _readIFDs(e,t,s,i,r,n=4,a){if(!i)return null;(i>=t.byteLength||i<0)&&(t=(await this.request(this.url,{range:{from:i+r,to:i+r+this._bufferSize},responseType:"array-buffer",signal:a})).data,r=i+r,i=0);const c=await this._readIFD(t,s,i,r,ye.TIFF_TAGS,n,a);if(e.push(c.ifd),!c.nextIFD)return null;await this._readIFDs(e,t,s,c.nextIFD-r,r,n,a)}async _readIFD(e,t,s,i,r=ye.TIFF_TAGS,n=4,a){var o,l;if(!e)return null;const c=ei(e,t,s,i,r,n);if(c.success){const u=[];if((o=c.ifd)==null||o.forEach(h=>{h.values||u.push(h)}),u.length>0){const h=u.map(d=>d.offlineOffsetSize).filter(C),f=Math.min.apply(null,h.map(d=>d[0]));if(Math.min.apply(null,h.map(d=>d[0]+d[1]))-f<=this._bufferSize){const{data:d}=await this.request(this.url,{range:{from:f,to:f+this._bufferSize},responseType:"array-buffer",signal:a});e=d,i=f,u.forEach(p=>ti(e,t,p,i))}}if((l=c.ifd)!=null&&l.has("GEOKEYDIRECTORY")){const h=c.ifd.get("GEOKEYDIRECTORY"),f=h==null?void 0:h.values;if(f&&f.length>4){const d=f[0]+"."+f[1]+"."+f[2],p=await this._readIFD(e,t,h.valueOffset+6-i,i,ye.GEO_KEYS,2,a);h.data=p.ifd,h.data&&h.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[d]})}}return c}if(c.requiredBufferSize&&c.requiredBufferSize!==e.byteLength)return(e=(await this.request(this.url,{range:{from:i,to:i+c.requiredBufferSize+4},responseType:"array-buffer",signal:a})).data).byteLengthf||s>d||tt.add(i)),t}static async open(t){const{url:s,ioConfig:i,sourceJSON:r}=t;let n=t.datasetFormat;n==null&&s.lastIndexOf(".")&&(n=s.slice(s.lastIndexOf(".")+1).toUpperCase()),n==="OVR"||n==="TIF"?n="TIFF":n!=="JPG"&&n!=="JPEG"&&n!=="JFIF"||(n="JPG"),s.toLowerCase().includes("/imageserver")&&!s.toLowerCase().includes("/wcsserver")&&(n="RasterTileServer");const a={url:s,sourceJSON:r,datasetFormat:n,ioConfig:i!=null?i:{bandIds:null,sampling:null}};let c,o;if(n&&this.supportedFormats.has(n)){if(n==="CRF"&&!(i!=null&&i.enableCRF))throw new $("rasterfactory:open",`cannot open raster: ${s}`);return c=z.get(n).constructor,o=new c(a),await o.open({signal:t.signal}),o}if(n)throw new $("rasterfactory:open","not a supported format "+n);const l=Array.from(z.keys());let u=0;const h=()=>(n=l[u++],n&&(n!=="CRF"||(i==null?void 0:i.enableCRF))?(c=z.get(n).constructor,o=new c(a),o.open({signal:t.signal}).then(()=>o).catch(()=>h())):null);return h()}static register(t,s,i){z.has(t.toUpperCase())||z.set(t.toUpperCase(),{desc:s,constructor:i})}}let O=class extends pt(yt(gt(xt(It(vi(wt(bt(St(Mt))))))))){constructor(...e){super(...e),this.bandIds=null,this.interpolation=null,this.legendEnabled=!0,this.isReference=null,this.listMode="show",this.sourceJSON=null,this.version=null,this.title=null,this.type="imagery-tile",this.operationalLayerType="ArcGISTiledImageServiceLayer",this.popupEnabled=!0,this.popupTemplate=null,this.fields=null}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=C(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Image Service"]},e).catch(vt).then(()=>this._openRaster(t))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}get rasterFields(){var c;let e=[new he({name:"Raster.ServicePixelValue",alias:"Pixel Value",domain:null,editable:!1,length:50,type:"string"})];const{rasterInfo:t}=this,{attributeTable:s}=t,i=C(s)?s.fields:null,r="Raster.";if(i){const o=i.filter(l=>l.type!=="oid"&&l.name.toLowerCase()!=="value").map(l=>{const u=l.clone();return u.name=r+l.name,u});e=e.concat(o)}const{dataType:n,multidimensionalInfo:a}=t;if((n==="vector-magdir"||n==="vector-uv")&&C(a)){const o=(c=a.variables[0].unit)==null?void 0:c.trim(),l="Magnitude"+(o?` (${o})`:"");e.push(new he({name:"Raster.Magnitude",alias:l,domain:null,editable:!1,type:"double"})),e.push(new he({name:"Raster.Direction",alias:"Direction (\xB0)",domain:null,editable:!1,type:"double"}))}return e}set renderer(e){this._set("renderer",e),this.updateRenderer()}readRenderer(e,t,s){const i=t&&t.layerDefinition&&t.layerDefinition.drawingInfo&&t.layerDefinition.drawingInfo.renderer,r=Jt(i,s)||void 0;if(r!=null)return r}createPopupTemplate(e){return Tt({fields:this.rasterFields,title:this.title},e)}write(e,t){const{raster:s}=this;if(this.loaded?s.datasetFormat==="RasterTileServer"&&(s.tileType==="Raster"||s.tileType==="Map"):this.url&&/\/ImageServer(\/|\/?$)/i.test(this.url))return super.write(e,t);if(t&&t.messages){const i=`${t.origin}/${t.layerContainerType||"operational-layers"}`;t.messages.push(new $("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${i}'`,{layer:this}))}return null}async _openRaster(e){if(this.raster)this.raster.rasterInfo||await this.raster.open(),this.url=this.raster.url;else{const s=await Oi.open({url:this.url,sourceJSON:this.sourceJSON,ioConfig:{sampling:"closest",...this.ioConfig,customFetchParameters:this.customParameters},signal:e});if(this.rasterFunction){const i=tt(this.rasterFunction.toJSON(),{raster:s}),r=new it({rasterFunction:i});await r.open(),this.raster=r}else this.raster=s}const{rasterInfo:t}=this.raster;if(!t)throw new $("imagery-tile-layer:load","cannot load resources on "+this.url);if(this.sourceJSON=this.sourceJSON||this.raster.sourceJSON,this.sourceJSON!=null){const s=this.raster.tileType==="Map"&&this.sourceJSON.minLOD!=null&&this.sourceJSON.maxLOD!=null?this.sourceJSON:{...this.sourceJSON,minScale:0,maxScale:0};this.read(s,{origin:"service"})}this.title==null&&(this.title=this.raster.datasetName),this.raster.tileType==="Map"&&(this.popupEnabled=!1),this._configDefaultSettings(),this.addHandles(Rt(()=>this.customParameters,s=>{this.raster.ioConfig.customFetchParameters=s}))}};I([S({type:[_t],json:{write:{overridePolicy(){var e;return{enabled:!this.loaded||this.raster.tileType==="Raster"||((e=this.bandIds)==null?void 0:e.join(","))!=="0,1,2"}}}}})],O.prototype,"bandIds",void 0),I([S({json:{write:{overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"||this.interpolation!=="bilinear"}}}}}),kt(Ht)],O.prototype,"interpolation",void 0),I([S({json:{write:!0}})],O.prototype,"multidimensionalDefinition",void 0),I([S(Ct)],O.prototype,"legendEnabled",void 0),I([S({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],O.prototype,"isReference",void 0),I([S({type:["show","hide"]})],O.prototype,"listMode",void 0),I([S({json:{read:!0,write:!0}})],O.prototype,"blendMode",void 0),I([S()],O.prototype,"sourceJSON",void 0),I([S({readOnly:!0,json:{origins:{service:{read:{source:"currentVersion"}}}}})],O.prototype,"version",void 0),I([S()],O.prototype,"title",void 0),I([S({readOnly:!0,json:{read:!1}})],O.prototype,"type",void 0),I([S({type:["ArcGISTiledImageServiceLayer"]})],O.prototype,"operationalLayerType",void 0),I([S({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(e,t)=>!t.disablePopup},write:{target:"disablePopup",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}},writer(e,t,s){t[s]=!e}}}})],O.prototype,"popupEnabled",void 0),I([S({type:Ft,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy(){return{enabled:!this.loaded||this.raster.tileType==="Raster"}}}}})],O.prototype,"popupTemplate",void 0),I([S({readOnly:!0})],O.prototype,"defaultPopupTemplate",null),I([S({readOnly:!0,type:[he]})],O.prototype,"fields",void 0),I([S({readOnly:!0,type:[he]})],O.prototype,"rasterFields",null),I([S({types:Qe,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy(){var t;const e=((t=this.renderer)==null?void 0:t.type)==="raster-stretch"&&this.renderer.stretchType==="none"&&!this.renderer.useGamma;return{enabled:!this.loaded||this.raster.tileType==="Raster"||!e}}},origins:{"web-scene":{types:Lt,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:e=>({enabled:e&&e.type!=="vector-field"&&e.type!=="flow"})}}}}})],O.prototype,"renderer",null),I([Pt("renderer")],O.prototype,"readRenderer",null),O=I([Q("esri.layers.ImageryTileLayer")],O);const qi=O;export{qi as default}; diff --git a/assets/ImageryTileLayerView2D.687f9a67.js b/assets/ImageryTileLayerView2D.14079c8d.js similarity index 96% rename from assets/ImageryTileLayerView2D.687f9a67.js rename to assets/ImageryTileLayerView2D.14079c8d.js index 49254be..adbef80 100644 --- a/assets/ImageryTileLayerView2D.687f9a67.js +++ b/assets/ImageryTileLayerView2D.14079c8d.js @@ -1 +1 @@ -import{N as S,ay as W,dM as H,a6 as n,a7 as u,a8 as R,dA as J,dn as N,cX as F,cU as X,aQ as Y,cV as K,cW as Z,c as y,u as z,af as ee,du as te,x as T,s as I,cB as L,cn as ie,b2 as se,_ as w,da as re,n as D,j as ae,d1 as O,c_ as E,dz as le,$ as oe}from"./index.d94abe07.js";import{m as $}from"./multidimensionalUtils.4f713da1.js";import{y as ne,d as he}from"./RasterVFDisplayObject.3d75d94d.js";import{y as ue,u as ce}from"./LayerView.42d17220.js";import{p as de,c as pe,d as ye}from"./WGLContainer.1850619d.js";import{r as M,i as A}from"./TileContainer.8b7fafe2.js";import{I as C}from"./Utils.7f6f3a6b.js";import{g as me,s as ge}from"./pixelUtils.82950e1a.js";import{g as G,f as B,u as fe,a as be}from"./RawBlockCache.73929591.js";import{U as we,i as _e,v as q,J as ve}from"./rasterProjectionHelper.0a540f3d.js";import{r as j}from"./util.ab699fea.js";import{j as Pe}from"./dataUtils.0f9b810f.js";import{s as Te}from"./popupUtils.4abb3ffd.js";import{i as Ie}from"./RefreshableLayerView.28a00159.js";import"./VertexArrayObject.a4c1d809.js";import"./Texture.4c97bad5.js";import"./enums.2d9e6f64.js";import"./VertexElementDescriptor.1fdca6da.js";import"./utils.4b023c9d.js";import"./MaterialKey.229b1dd6.js";import"./enums.0295eb81.js";import"./ProgramTemplate.e9a5aa54.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";class Re extends M{constructor(t,i,s,r,a,l,o=null){super(t,i,s,r,a,l),this.bitmap=new de(o,null,null),this.bitmap.coordScale=[a,l],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy(),this.bitmap=null,this.stage=null}set stencilRef(t){this.bitmap.stencilRef=t}get stencilRef(){return this.bitmap.stencilRef}setTransform(t){super.setTransform(t),this.bitmap.transforms.dvs=this.transforms.dvs}_createTransforms(){return{dvs:S(),tileMat3:S()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap.stage=null}}class xe extends A{constructor(){super(...arguments),this.isCustomTilingScheme=!1}createTile(t){const i=this._getTileBounds(t),[s,r]=this._tileInfoView.tileInfo.size,a=this._tileInfoView.getTileResolution(t.level);return new Re(t,a,i[0],i[3],s,r)}prepareRenderPasses(t){const i=t.registerRenderPass({name:"imagery (tile)",brushes:[pe.raster],target:()=>this.children.map(s=>s.bitmap),drawPhase:C.MAP});return[...super.prepareRenderPasses(t),i]}doRender(t){this.visible&&t.drawPhase===C.MAP&&super.doRender(t)}_getTileBounds(t){const i=this._tileInfoView.getTileBounds(W(),t);if(this.isCustomTilingScheme&&t.world){const{tileInfo:s}=this._tileInfoView,r=H(s.spatialReference);if(r){const{resolution:a}=s.lodAt(t.level),l=r/a%s.size[0],o=l?(s.size[0]-l)*a:0;i[0]-=o*t.world,i[2]-=o*t.world}}return i}}const Ve=[0,0];let p=class extends J{constructor(){super(...arguments),this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=null,this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._globalUpdateRequested=!1,this.attached=!1,this.container=null,this.layer=null,this.timeExtent=null,this.redrawOrRefetch=N((e,t)=>!this.previousLOD||this.layerView.suspended?Promise.resolve():e?this.updatingHandles.addPromise(this.doRefresh()):this.updatingHandles.addPromise(this._redrawImage(t)))}get useWebGLForProcessing(){var e;return(e=this._get("useWebGLForProcessing"))!=null?e:!0}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")==null||this._get("useProgressiveUpdate")}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new F({cachePolicy:"purge",acquireTile:i=>this.acquireTile(i),releaseTile:i=>this.releaseTile(i),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){var a;this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:i,scale:s}=e.state,r=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const l=this._srcResolutions[r.level],o=t.toJSON?t:X.fromJSON(t);G(this._blockCacheRegistryUrl,this._blockCacheRegistryId,o,i,l,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,((a=this.previousLOD)==null?void 0:a.level)!==r.level&&(this.previousLOD=r,this._symbolizerParams==null||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,this._fetchQueue.length===0&&this._redrawImage(this._abortController.signal).then(()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()}));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){var e;return((e=this._fetchQueue)==null?void 0:e.updating)||this._globalUpdateRequested||!(!this.updatingHandles||!this.updatingHandles.updating)}attach(){Y("2d").supportsTextureFloat||(this.useWebGLForProcessing=!1),this._initializeTileInfo(),this._tileInfoView=new K(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new Z({tileInfoView:this._tileInfoView,concurrency:e,process:(i,s)=>this._fetchTile1(i,s)});const t=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new F({cachePolicy:"purge",acquireTile:i=>this.acquireTile(i),releaseTile:i=>this.releaseTile(i),cacheSize:t,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,B(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(e){const t=this.container.createTile(e);return this._enqueueTileFetch(t),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",()=>{e.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(e=null){const t=e==null||e.join(",")===this._tileInfoView.tileInfo.size.join(",");if(t&&y(this._emptyTilePixelBlock))return this._emptyTilePixelBlock;e=e||this._tileInfoView.tileInfo.size;const[i,s]=e,r=new me({width:i,height:s,pixels:[new Uint8Array(i*s)],mask:new Uint8Array(i*s),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=r),r}_fetchTile1(e,t){const i=y(t)&&t.signal,s=this.canUseWebGLForProcessing(),{layerView:r}=this,a=!r.tileInfo.isWrappable&&y(we(r.view.spatialReference)),l={allowPartialFill:!0,datumTransformation:r.datumTransformation,interpolation:s?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:s,signal:z(i),srcResolution:this._srcResolutions[e.level],timeExtent:r.timeExtent,tileInfo:r.tileInfo,disableWrapAround:a};return this.fetchTile(e,l)}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const e=this.layerView.view.spatialReference,t=new ee({x:this.layerView.fullExtent.xmin,y:this.layerView.fullExtent.ymax,spatialReference:e}),{scales:i,srcResolutions:s,isCustomTilingScheme:r}=_e(this.layer.rasterInfo,e),a=te.create({spatialReference:e,size:512,scales:i});(a.origin.x===0||a.origin.x>t.x)&&(a.origin=t),this._isCustomTilingScheme=r,this.layerView.set("tileInfo",a),this._srcResolutions=s!=null?s:[]}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.rasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){this.updatingHandles.addPromise(this._enqueueTileFetch1(e,t))}async _enqueueTileFetch1(e,t){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key),{bandIds:s}=this.layer;let r=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&this._fetchQueue.length===0){r=!1;try{await this._redrawImage(this._abortController&&this._abortController.signal)}catch(o){T(o)&&I.getLogger(this.declaredClass).error(o)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&this.type!=="rasterVF"||this.layerView.hasTilingEffects||this._symbolizerParams!=null||this._updateSymbolizerParams();const a=this._tileInfoView.getTileCoords(Ve,e.key),l=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:i,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:r,bandIds:s,coords:a,resolution:l}),e.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(e)}catch(i){T(i)||I.getLogger(this.declaredClass).error(i)}this.layerView.requestUpdate()}}async _redrawImage(e){if(this.container.children.length===0)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(e):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const t=this.container.children.map(async i=>this.updateTileSymbolizerParameters(i,{local:this._symbolizerParams,global:this._globalSymbolizerParams}));await L(t),this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const t={srcResolution:this._srcResolutions[this.previousLOD.level],registryId:this._blockCacheRegistryId,signal:e},i=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,t);if(!i||!i.pixelBlock)return;const s=this.layer.symbolizer.generateWebGLParameters({pixelBlock:ge(i.pixelBlock,this.layer.bandIds),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:this.previousLOD.resolution,y:this.previousLOD.resolution},bandIds:this.layer.bandIds});!this.canUseWebGLForProcessing()&&s&&s.type==="stretch"&&this.layer.renderer&&this.layer.renderer.type==="raster-stretch"&&(s.factor=s.factor.map(r=>255*r),s.outMin=Math.round(255*s.outMin),s.outMax=Math.round(255*s.outMax)),this._globalSymbolizerParams=s}_updateSymbolizerParams(){this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:this.previousLOD.resolution,y:this.previousLOD.resolution},bandIds:this.layer.bandIds})}_updateBlockCacheRegistry(e=!1){const{url:t,rasterInfo:i,raster:s}=this.layer,{multidimensionalDefinition:r}=this.layer.normalizeRasterFetchOptions({multidimensionalDefinition:this.layer.multidimensionalDefinition,timeExtent:this.layerView.timeExtent}),a=i!=null&&i.multidimensionalInfo?s.getSliceIndex(r):null,l=be(t,a);if(l!==this._blockCacheRegistryUrl){if(this._blockCacheRegistryUrl!=null&&B(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=fe(l,this.layer.raster.rasterInfo),e){const o=this._tileInfoView.getClosestInfoForScale(this.layerView.view.scale),c=this._srcResolutions[o.level];G(l,this._blockCacheRegistryId,this.layerView.view.extent,this.layerView.view.resolution,c,this.layer.raster.ioConfig.sampling)}this._blockCacheRegistryUrl=l}}async doRefresh(){if(!this.attached)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const e=[];this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,this._tileStrategy.tiles.forEach(t=>e.push(this._enqueueTileFetch(t))),await L(e)}};n([u()],p.prototype,"_fetchQueue",void 0),n([u()],p.prototype,"_globalUpdateRequested",void 0),n([u()],p.prototype,"attached",void 0),n([u()],p.prototype,"container",void 0),n([u()],p.prototype,"layer",void 0),n([u()],p.prototype,"layerView",void 0),n([u()],p.prototype,"type",void 0),n([u()],p.prototype,"useWebGLForProcessing",null),n([u()],p.prototype,"useProgressiveUpdate",null),n([u()],p.prototype,"timeExtent",void 0),n([u()],p.prototype,"updating",null),p=n([R("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],p);let _=class extends p{constructor(){super(...arguments),this.container=null,this.layer=null,this.type="raster"}attach(){super.attach(),this.container=new xe(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}canUseWebGLForProcessing(){return this.useWebGLForProcessing&&this.layer.symbolizer.canRenderInWebGL&&!(this.layer.interpolation==="majority"&&j(this.layer))}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}async updateTileSource(e,t){const{bandIds:i}=this.layer,s=this._getLayerInterpolation(),r=this.canUseWebGLForProcessing(),{source:a,globalSymbolizerParams:l,suspended:o,coords:c,resolution:d}=t,g=this.layerView.hasTilingEffects?l:t.symbolizerParams,{bitmap:h}=e;if([h.x,h.y]=c,h.resolution=d,a&&y(a)&&y(a.pixelBlock)){const m={extent:a.extent,pixelBlock:a.pixelBlock};if(h.rawPixelData=m,r)h.source=a.pixelBlock,h.isRendereredSource=!1;else{const b=await this.layer.applyRenderer(m,(l==null?void 0:l.type)==="stretch"?l:null);h.source=b,h.isRendereredSource=!0}h.symbolizerParameters=r?g:null,r?h.transformGrid||(h.transformGrid=a.transformGrid):h.transformGrid=null}else{const m=this.createEmptyTilePixelBlock();h.source=m,h.symbolizerParameters=r?g:null,h.transformGrid=null}h.bandIds=r?i:null,h.width=this._tileInfoView.tileInfo.size[0],h.height=this._tileInfoView.tileInfo.size[1],h.interpolation=s,h.suspended=o,h.invalidateTexture()}async updateTileSymbolizerParameters(e,t){const{local:i,global:s}=t,{bandIds:r}=this.layer,a=this._getLayerInterpolation(),l=this.canUseWebGLForProcessing(),{bitmap:o}=e,{rawPixelData:c}=o;!l&&y(c)?(o.source=await this.layer.applyRenderer(c,(s==null?void 0:s.type)==="stretch"?s:null),o.isRendereredSource=!0):(o.isRendereredSource&&y(c)&&(o.source=c.pixelBlock),o.isRendereredSource=!1),o.symbolizerParameters=l?this.layerView.hasTilingEffects?s:i:null,o.bandIds=l?r:null,o.interpolation=a,o.suspended=!1}_getLayerInterpolation(){const e=this.layer.renderer.type;if(e==="raster-colormap"||e==="unique-value"||e==="class-breaks")return"nearest";const{interpolation:t}=this.layer,{renderer:i}=this.layer;return i.type==="raster-stretch"&&i.colorRamp!=null?t==="bilinear"||t==="cubic"?"bilinear":"nearest":t}};n([u()],_.prototype,"container",void 0),n([u()],_.prototype,"layer",void 0),n([u()],_.prototype,"type",void 0),_=n([R("esri.views.2d.layers.imagery.ImageryTileView2D")],_);const Se=_;class Ce extends M{constructor(t,i,s,r,a,l,o=null){super(t,i,s,r,a,l),this.tileData=new ne(o),this.tileData.coordScale=[a,l],this.tileData.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.tileData.destroy(),this.tileData=null,this.stage=null}set stencilRef(t){this.tileData.stencilRef=t}get stencilRef(){return this.tileData.stencilRef}_createTransforms(){return{dvs:S(),tileMat3:S()}}setTransform(t){super.setTransform(t);const i=this.resolution/(t.resolution*t.pixelRatio),s=this.transforms.tileMat3,[r,a]=this.tileData.offset,l=[this.x+r*this.resolution,this.y-a*this.resolution],[o,c]=t.toScreenNoRotation([0,0],l),{symbolTileSize:d}=this.tileData.symbolizerParameters,g=Math.round((this.width-this.tileData.offset[0])/d)*d,h=Math.round((this.height-this.tileData.offset[1])/d)*d,m=g/this.rangeX*i,b=h/this.rangeY*i;ie(s,m,0,0,0,b,0,o,c,1),se(this.transforms.dvs,t.displayViewMat3,s),this.tileData.transforms.dvs=this.transforms.dvs}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}}class Ue extends A{constructor(){super(...arguments),this.isCustomTilingScheme=!1,this.symbolTypes=["triangle"]}createTile(t){const i=this._tileInfoView.getTileBounds(W(),t),[s,r]=this._tileInfoView.tileInfo.size,a=this._tileInfoView.getTileResolution(t.level);return new Ce(t,a,i[0],i[3],s,r)}prepareRenderPasses(t){const i=t.registerRenderPass({name:"imagery (vf tile)",brushes:[ye],target:()=>this.children.map(s=>s.tileData),drawPhase:C.MAP});return[...super.prepareRenderPasses(t),i]}doRender(t){this.visible&&t.drawPhase===C.MAP&&this.symbolTypes.forEach(i=>{t.renderPass=i,super.doRender(t)})}}let v=class extends p{constructor(){super(...arguments),this._handle=null,this.container=null,this.layer=null,this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(e,t){t={...t,interpolation:"nearest",requestProjectedLocalDirections:!0};const i=await this.layer.fetchTile(e.level,e.row,e.col,t);return this.layer.rasterInfo.dataType==="vector-magdir"&&(i==null?void 0:i.pixelBlock)&&(i.pixelBlock=await this.layer.convertVectorFieldData(i.pixelBlock,t)),i}updateTileSource(e,t){const i=t.symbolizerParams,{tileData:s}=e;s.key=e.key,s.width=this._tileInfoView.tileInfo.size[0],s.height=this._tileInfoView.tileInfo.size[1];const{symbolTileSize:r}=i,{source:a}=t;if(s.offset=this._getTileSymbolOffset(s.key,r),y(a)&&y(a.pixelBlock)){const l={extent:a.extent,pixelBlock:a.pixelBlock};s.rawPixelData=l,s.symbolizerParameters=i,s.source=this._sampleVectorFieldData(a.pixelBlock,i,s.offset)}else{const l=[Math.round((this._tileInfoView.tileInfo[0]-s.offset[0])/r),Math.round((this._tileInfoView.tileInfo[1]-s.offset[1])/r)],o=this.createEmptyTilePixelBlock(l);s.source=o,s.symbolizerParameters=i}return s.invalidateVAO(),Promise.resolve(null)}updateTileSymbolizerParameters(e,t){var l;const i=t.local,{symbolTileSize:s}=i,{tileData:r}=e;r.offset=this._getTileSymbolOffset(r.key,s);const a=r.symbolizerParameters.symbolTileSize;return r.symbolizerParameters=i,y((l=r.rawPixelData)==null?void 0:l.pixelBlock)&&a!==s&&(r.source=this._sampleVectorFieldData(r.rawPixelData.pixelBlock,r.symbolizerParameters,r.offset)),Promise.resolve(null)}attach(){super.attach(),this.container=new Ue(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this._updateSymbolType(this.layer.renderer),this._handle=w(()=>this.layer.renderer,e=>this._updateSymbolType(e))}detach(){super.detach(),this.container.removeAllChildren(),this._handle.remove(),this._handle=null}_getTileSymbolOffset(e,t){const i=e.col*this._tileInfoView.tileInfo.size[0]%t,s=e.row*this._tileInfoView.tileInfo.size[1]%t;return[i>t/2?t-i:-i,s>t/2?t-s:-s]}_sampleVectorFieldData(e,t,i){const{symbolTileSize:s}=t;return Pe(e,"vector-uv",s,i)}_updateSymbolType(e){e.type==="vector-field"&&(this.container.symbolTypes=e.style==="wind-barb"?["scalar","triangle"]:e.style==="simple-scalar"?["scalar"]:["triangle"])}};n([u()],v.prototype,"container",void 0),n([u()],v.prototype,"layer",void 0),n([u()],v.prototype,"type",void 0),v=n([R("esri.views.2d.layers.imagery.VectorFieldTileView2D")],v);const ze=v,ke=e=>{let t=class extends e{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.tileInfo=null}get fullExtent(){return this._getfullExtent()}_getfullExtent(){return this.projectFullExtent(this.view.spatialReference)}get hasTilingEffects(){return this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment}get datumTransformation(){return q(z(this.layer.fullExtent),this.view.spatialReference,!0)}supportsSpatialReference(i){return!!this.projectFullExtent(i)}projectFullExtent(i){const s=z(this.layer.fullExtent),r=q(s,i,!1);return ve(s,i,r)}async fetchPopupFeatures(i,s){const{layer:r}=this;if(!i)throw new D("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:r});const{popupEnabled:a}=r,l=Te(r,s);if(!a||ae(l))throw new D("imageryTileLayerView:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:a,popupTemplate:l});const o=[],{value:c,magdirValue:d}=await r.identify(i,{timeExtent:this.timeExtent});let g="";if(c&&c.length){g=r.type==="imagery-tile"&&r.hasStandardTime()&&c[0]!=null?c.map(U=>r.getStandardTimeValue(U)).join(", "):c.join(", ");const h={ObjectId:0};h["Raster.ServicePixelValue"]=g;const m=r.rasterInfo.attributeTable;if(y(m)){const{fields:U,features:Q}=m,k=U.find(({name:f})=>f.toLowerCase()==="value"),V=k?Q.find(f=>String(f.attributes[k.name])===g):null;if(V)for(const f in V.attributes)V.attributes.hasOwnProperty(f)&&(h[this._rasterFieldPrefix+f]=V.attributes[f])}const b=r.rasterInfo.dataType;b!=="vector-magdir"&&b!=="vector-uv"||(h["Raster.Magnitude"]=d==null?void 0:d[0],h["Raster.Direction"]=d==null?void 0:d[1]);const x=new O(this.fullExtent.clone(),null,h);x.layer=r,x.sourceLayer=x.layer,o.push(x)}return o}};return n([u()],t.prototype,"layer",void 0),n([u(re)],t.prototype,"timeExtent",void 0),n([u()],t.prototype,"view",void 0),n([u()],t.prototype,"fullExtent",null),n([u()],t.prototype,"tileInfo",void 0),n([u({readOnly:!0})],t.prototype,"hasTilingEffects",null),t=n([R("esri.views.layers.ImageryTileLayerView")],t),t};let P=class extends ke(Ie(ue(ce))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(e){this._useWebGLForProcessing=e,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=e)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(e){this._useProgressiveUpdate=e,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=e)}update(e){this.subview.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.handles.add([w(()=>{const{layer:e}=this;return{bandIds:e.bandIds,renderer:e.renderer,interpolation:e.interpolation,multidimensionalDefinition:e.multidimensionalDefinition,rasterFunction:e.type==="imagery-tile"?e.rasterFunction:null}},(e,t)=>{var o,c;const i=e.interpolation!==t.interpolation&&(e.interpolation==="majority"||t.interpolation==="majority")&&j(this.layer),s=e.renderer!==t.renderer&&((o=t.renderer)==null?void 0:o.type)!==((c=e.renderer)==null?void 0:c.type);s&&this._updateSubview();const r=e.multidimensionalDefinition!==t.multidimensionalDefinition,a=e.rasterFunction!==t.rasterFunction,l=r||i||s||a;this.subview.redrawOrRefetch(l).catch(d=>{T(d)||I.getLogger(this.declaredClass).error(d)}),this.notifyChange("updating")}),w(()=>{var e;return(e=this.layer.blendMode)!=null?e:"normal"},e=>{this.subview.container.blendMode=e},E),w(()=>{var e;return(e=this.layer.effect)!=null?e:null},e=>{this.subview.container.effect=e},E),w(()=>{var e;return(e=this.layer.multidimensionalSubset)!=null?e:null},(e,t)=>{const{multidimensionalDefinition:i}=this.layer;y(i)&&$(i,e)!==$(i,t)&&(this.subview.redrawOrRefetch(!0).catch(s=>{T(s)||I.getLogger(this.declaredClass).error(s)}),this.notifyChange("updating"))},le),w(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch(!0).catch(e=>{T(e)||I.getLogger(this.declaredClass).error(e)})},oe)],"attach")}detach(){var e;this.handles.remove("attach"),this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),(e=this.subview)==null||e.destroy(),this.subview=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}async hitTest(e,t){return[{type:"graphic",layer:this.layer,mapPoint:e,graphic:new O({attributes:{},geometry:e.clone()})}]}doRefresh(){var e;return(e=this.subview)==null?void 0:e.doRefresh()}_updateSubview(){var s;const e=this.layer.renderer.type==="vector-field"?"rasterVF":this.layer.renderer.type==="flow"?"flow":"raster";if(this.subview){if(this.subview.type===e)return void this._attachSubview(this.subview);this._detachSubview(this.subview),(s=this.subview)==null||s.destroy(),this.subview=null}const{layer:t}=this;let i;i=e==="rasterVF"?new ze({layer:t,layerView:this}):e==="flow"?new he({layer:t,layerView:this}):new Se({layer:t,layerView:this}),"useWebGLForProcessing"in i&&(i.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in i&&(i.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in i&&(i.previousLOD=this.subview&&"previousLOD"in this.subview&&this.subview.previousLOD),this._attachSubview(i),this.subview=i,this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0),e.container.blendMode=this.layer.blendMode,e.container.effect=this.layer.effect)}_detachSubview(e){e!=null&&e.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}};n([u()],P.prototype,"subview",void 0),n([u()],P.prototype,"useWebGLForProcessing",null),n([u()],P.prototype,"useProgressiveUpdate",null),P=n([R("esri.views.2d.layers.ImageryTileLayerView2D")],P);const at=P;export{at as default}; +import{N as S,ay as W,dM as H,a6 as n,a7 as u,a8 as R,dA as J,dn as N,cX as F,cU as X,aQ as Y,cV as K,cW as Z,c as y,u as z,af as ee,du as te,x as T,s as I,cB as L,cn as ie,b2 as se,_ as w,da as re,n as D,j as ae,d1 as O,c_ as E,dz as le,$ as oe}from"./index.221827cd.js";import{m as $}from"./multidimensionalUtils.59c05ac5.js";import{y as ne,d as he}from"./RasterVFDisplayObject.da692284.js";import{y as ue,u as ce}from"./LayerView.ce6e0535.js";import{p as de,c as pe,d as ye}from"./WGLContainer.347cc5cd.js";import{r as M,i as A}from"./TileContainer.5aeb32d6.js";import{I as C}from"./Utils.2136650a.js";import{g as me,s as ge}from"./pixelUtils.9c6f8dae.js";import{g as G,f as B,u as fe,a as be}from"./RawBlockCache.e5f26f22.js";import{U as we,i as _e,v as q,J as ve}from"./rasterProjectionHelper.f3c10be2.js";import{r as j}from"./util.520a352e.js";import{j as Pe}from"./dataUtils.e7623e56.js";import{s as Te}from"./popupUtils.c6371f3a.js";import{i as Ie}from"./RefreshableLayerView.887ed8c3.js";import"./VertexArrayObject.53cf1857.js";import"./Texture.940076b2.js";import"./enums.2d9e6f64.js";import"./VertexElementDescriptor.1fdca6da.js";import"./utils.0160becb.js";import"./MaterialKey.0cadabc1.js";import"./enums.0295eb81.js";import"./ProgramTemplate.cf9dd4e8.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";class Re extends M{constructor(t,i,s,r,a,l,o=null){super(t,i,s,r,a,l),this.bitmap=new de(o,null,null),this.bitmap.coordScale=[a,l],this.bitmap.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.bitmap.destroy(),this.bitmap=null,this.stage=null}set stencilRef(t){this.bitmap.stencilRef=t}get stencilRef(){return this.bitmap.stencilRef}setTransform(t){super.setTransform(t),this.bitmap.transforms.dvs=this.transforms.dvs}_createTransforms(){return{dvs:S(),tileMat3:S()}}onAttach(){this.bitmap.stage=this.stage}onDetach(){this.bitmap.stage=null}}class xe extends A{constructor(){super(...arguments),this.isCustomTilingScheme=!1}createTile(t){const i=this._getTileBounds(t),[s,r]=this._tileInfoView.tileInfo.size,a=this._tileInfoView.getTileResolution(t.level);return new Re(t,a,i[0],i[3],s,r)}prepareRenderPasses(t){const i=t.registerRenderPass({name:"imagery (tile)",brushes:[pe.raster],target:()=>this.children.map(s=>s.bitmap),drawPhase:C.MAP});return[...super.prepareRenderPasses(t),i]}doRender(t){this.visible&&t.drawPhase===C.MAP&&super.doRender(t)}_getTileBounds(t){const i=this._tileInfoView.getTileBounds(W(),t);if(this.isCustomTilingScheme&&t.world){const{tileInfo:s}=this._tileInfoView,r=H(s.spatialReference);if(r){const{resolution:a}=s.lodAt(t.level),l=r/a%s.size[0],o=l?(s.size[0]-l)*a:0;i[0]-=o*t.world,i[2]-=o*t.world}}return i}}const Ve=[0,0];let p=class extends J{constructor(){super(...arguments),this._emptyTilePixelBlock=null,this._tileStrategy=null,this._tileInfoView=null,this._fetchQueue=null,this._blockCacheRegistryUrl=null,this._blockCacheRegistryId=null,this._srcResolutions=null,this.previousLOD=null,this._needBlockCacheUpdate=!1,this._globalSymbolizerParams=null,this._symbolizerParams=null,this._abortController=null,this._isCustomTilingScheme=!1,this._globalUpdateRequested=!1,this.attached=!1,this.container=null,this.layer=null,this.timeExtent=null,this.redrawOrRefetch=N((e,t)=>!this.previousLOD||this.layerView.suspended?Promise.resolve():e?this.updatingHandles.addPromise(this.doRefresh()):this.updatingHandles.addPromise(this._redrawImage(t)))}get useWebGLForProcessing(){var e;return(e=this._get("useWebGLForProcessing"))!=null?e:!0}set useWebGLForProcessing(e){this._set("useWebGLForProcessing",e)}get useProgressiveUpdate(){return this._get("useProgressiveUpdate")==null||this._get("useProgressiveUpdate")}set useProgressiveUpdate(e){if(this._tileStrategy&&this.useProgressiveUpdate!==e){this._tileStrategy.destroy(),this.container.removeAllChildren();const t=this._getCacheSize(e);this._tileStrategy=new F({cachePolicy:"purge",acquireTile:i=>this.acquireTile(i),releaseTile:i=>this.releaseTile(i),cacheSize:t,tileInfoView:this._tileInfoView}),this._set("useProgressiveUpdate",e),this.layerView.requestUpdate()}}update(e){var a;this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume();const{extent:t,resolution:i,scale:s}=e.state,r=this._tileInfoView.getClosestInfoForScale(s);if(this.layer.raster){if(!this.useProgressiveUpdate||this._needBlockCacheUpdate){const l=this._srcResolutions[r.level],o=t.toJSON?t:X.fromJSON(t);G(this._blockCacheRegistryUrl,this._blockCacheRegistryId,o,i,l,this.layer.raster.ioConfig.sampling)}this._needBlockCacheUpdate=!1,((a=this.previousLOD)==null?void 0:a.level)!==r.level&&(this.previousLOD=r,this._symbolizerParams==null||this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._tileStrategy.updateCacheSize(0))}}moveEnd(){!this.layerView.hasTilingEffects&&this.useProgressiveUpdate||(this._abortController&&this._abortController.abort(),this._abortController=new AbortController,this._fetchQueue.length===0&&this._redrawImage(this._abortController.signal).then(()=>{this._globalUpdateRequested=!1,this.layerView.requestUpdate()}));const e=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy.updateCacheSize(e),this.layerView.requestUpdate()}get updating(){var e;return((e=this._fetchQueue)==null?void 0:e.updating)||this._globalUpdateRequested||!(!this.updatingHandles||!this.updatingHandles.updating)}attach(){Y("2d").supportsTextureFloat||(this.useWebGLForProcessing=!1),this._initializeTileInfo(),this._tileInfoView=new K(this.layerView.tileInfo,this.layerView.fullExtent);const e=this._computeFetchConcurrency();this._fetchQueue=new Z({tileInfoView:this._tileInfoView,concurrency:e,process:(i,s)=>this._fetchTile1(i,s)});const t=this._getCacheSize(this.useProgressiveUpdate);this._tileStrategy=new F({cachePolicy:"purge",acquireTile:i=>this.acquireTile(i),releaseTile:i=>this.releaseTile(i),cacheSize:t,tileInfoView:this._tileInfoView}),this._updateBlockCacheRegistry()}detach(){this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null,B(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryUrl=this._blockCacheRegistryId=null}acquireTile(e){const t=this.container.createTile(e);return this._enqueueTileFetch(t),this.layerView.requestUpdate(),this._needBlockCacheUpdate=!0,this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,t}releaseTile(e){this._fetchQueue.abort(e.key.id),this.container.removeChild(e),e.once("detach",()=>{e.destroy(),this.layerView.requestUpdate()}),this.layerView.requestUpdate()}createEmptyTilePixelBlock(e=null){const t=e==null||e.join(",")===this._tileInfoView.tileInfo.size.join(",");if(t&&y(this._emptyTilePixelBlock))return this._emptyTilePixelBlock;e=e||this._tileInfoView.tileInfo.size;const[i,s]=e,r=new me({width:i,height:s,pixels:[new Uint8Array(i*s)],mask:new Uint8Array(i*s),pixelType:"u8"});return t&&(this._emptyTilePixelBlock=r),r}_fetchTile1(e,t){const i=y(t)&&t.signal,s=this.canUseWebGLForProcessing(),{layerView:r}=this,a=!r.tileInfo.isWrappable&&y(we(r.view.spatialReference)),l={allowPartialFill:!0,datumTransformation:r.datumTransformation,interpolation:s?"nearest":this.layer.interpolation,registryId:this._blockCacheRegistryId,requestRawData:s,signal:z(i),srcResolution:this._srcResolutions[e.level],timeExtent:r.timeExtent,tileInfo:r.tileInfo,disableWrapAround:a};return this.fetchTile(e,l)}_getCacheSize(e){return e?40:0}_initializeTileInfo(){const e=this.layerView.view.spatialReference,t=new ee({x:this.layerView.fullExtent.xmin,y:this.layerView.fullExtent.ymax,spatialReference:e}),{scales:i,srcResolutions:s,isCustomTilingScheme:r}=_e(this.layer.rasterInfo,e),a=te.create({spatialReference:e,size:512,scales:i});(a.origin.x===0||a.origin.x>t.x)&&(a.origin=t),this._isCustomTilingScheme=r,this.layerView.set("tileInfo",a),this._srcResolutions=s!=null?s:[]}_computeFetchConcurrency(){const{blockBoundary:e}=this.layer.rasterInfo.storageInfo,t=e[e.length-1];return(t.maxCol-t.minCol+1)*(t.maxRow-t.minRow+1)>64?2:10}async _enqueueTileFetch(e,t){this.updatingHandles.addPromise(this._enqueueTileFetch1(e,t))}async _enqueueTileFetch1(e,t){if(!this._fetchQueue.has(e.key.id)){try{const i=await this._fetchQueue.push(e.key),{bandIds:s}=this.layer;let r=!this.useProgressiveUpdate||this.layerView.hasTilingEffects&&!this._globalSymbolizerParams;if(this._globalUpdateRequested&&!this.layerView.moving&&this._fetchQueue.length===0){r=!1;try{await this._redrawImage(this._abortController&&this._abortController.signal)}catch(o){T(o)&&I.getLogger(this.declaredClass).error(o)}this._globalUpdateRequested=!1}!this.canUseWebGLForProcessing()&&this.type!=="rasterVF"||this.layerView.hasTilingEffects||this._symbolizerParams!=null||this._updateSymbolizerParams();const a=this._tileInfoView.getTileCoords(Ve,e.key),l=this._tileInfoView.getTileResolution(e.key);await this.updateTileSource(e,{source:i,symbolizerParams:this._symbolizerParams,globalSymbolizerParams:this._globalSymbolizerParams,suspended:r,bandIds:s,coords:a,resolution:l}),e.once("attach",()=>this.layerView.requestUpdate()),this.container.addChild(e)}catch(i){T(i)||I.getLogger(this.declaredClass).error(i)}this.layerView.requestUpdate()}}async _redrawImage(e){if(this.container.children.length===0)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects?await this._updateGlobalSymbolizerParams(e):(this._updateSymbolizerParams(),this._globalSymbolizerParams=null);const t=this.container.children.map(async i=>this.updateTileSymbolizerParameters(i,{local:this._symbolizerParams,global:this._globalSymbolizerParams}));await L(t),this.container.requestRender()}async _updateGlobalSymbolizerParams(e){const t={srcResolution:this._srcResolutions[this.previousLOD.level],registryId:this._blockCacheRegistryId,signal:e},i=await this.layer.fetchPixels(this.layerView.view.extent,this.layerView.view.width,this.layerView.view.height,t);if(!i||!i.pixelBlock)return;const s=this.layer.symbolizer.generateWebGLParameters({pixelBlock:ge(i.pixelBlock,this.layer.bandIds),isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:this.previousLOD.resolution,y:this.previousLOD.resolution},bandIds:this.layer.bandIds});!this.canUseWebGLForProcessing()&&s&&s.type==="stretch"&&this.layer.renderer&&this.layer.renderer.type==="raster-stretch"&&(s.factor=s.factor.map(r=>255*r),s.outMin=Math.round(255*s.outMin),s.outMax=Math.round(255*s.outMax)),this._globalSymbolizerParams=s}_updateSymbolizerParams(){this._symbolizerParams=this.layer.symbolizer.generateWebGLParameters({pixelBlock:null,isGCS:this.layerView.view.spatialReference.isGeographic,resolution:{x:this.previousLOD.resolution,y:this.previousLOD.resolution},bandIds:this.layer.bandIds})}_updateBlockCacheRegistry(e=!1){const{url:t,rasterInfo:i,raster:s}=this.layer,{multidimensionalDefinition:r}=this.layer.normalizeRasterFetchOptions({multidimensionalDefinition:this.layer.multidimensionalDefinition,timeExtent:this.layerView.timeExtent}),a=i!=null&&i.multidimensionalInfo?s.getSliceIndex(r):null,l=be(t,a);if(l!==this._blockCacheRegistryUrl){if(this._blockCacheRegistryUrl!=null&&B(this._blockCacheRegistryUrl,this._blockCacheRegistryId),this._blockCacheRegistryId=fe(l,this.layer.raster.rasterInfo),e){const o=this._tileInfoView.getClosestInfoForScale(this.layerView.view.scale),c=this._srcResolutions[o.level];G(l,this._blockCacheRegistryId,this.layerView.view.extent,this.layerView.view.resolution,c,this.layer.raster.ioConfig.sampling)}this._blockCacheRegistryUrl=l}}async doRefresh(){if(!this.attached)return;await this.layer.updateRenderer(),this.layerView.hasTilingEffects||this._updateSymbolizerParams(),this._updateBlockCacheRegistry(!0),this._fetchQueue.reset();const e=[];this._globalUpdateRequested=this.layerView.hasTilingEffects||!this.useProgressiveUpdate,this._tileStrategy.tiles.forEach(t=>e.push(this._enqueueTileFetch(t))),await L(e)}};n([u()],p.prototype,"_fetchQueue",void 0),n([u()],p.prototype,"_globalUpdateRequested",void 0),n([u()],p.prototype,"attached",void 0),n([u()],p.prototype,"container",void 0),n([u()],p.prototype,"layer",void 0),n([u()],p.prototype,"layerView",void 0),n([u()],p.prototype,"type",void 0),n([u()],p.prototype,"useWebGLForProcessing",null),n([u()],p.prototype,"useProgressiveUpdate",null),n([u()],p.prototype,"timeExtent",void 0),n([u()],p.prototype,"updating",null),p=n([R("esri.views.2d.layers.imagery.BaseImageryTileSubView2D")],p);let _=class extends p{constructor(){super(...arguments),this.container=null,this.layer=null,this.type="raster"}attach(){super.attach(),this.container=new xe(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme}detach(){super.detach(),this.container.removeAllChildren(),this.container=null}canUseWebGLForProcessing(){return this.useWebGLForProcessing&&this.layer.symbolizer.canRenderInWebGL&&!(this.layer.interpolation==="majority"&&j(this.layer))}fetchTile(e,t){return this.layer.fetchTile(e.level,e.row,e.col,t)}async updateTileSource(e,t){const{bandIds:i}=this.layer,s=this._getLayerInterpolation(),r=this.canUseWebGLForProcessing(),{source:a,globalSymbolizerParams:l,suspended:o,coords:c,resolution:d}=t,g=this.layerView.hasTilingEffects?l:t.symbolizerParams,{bitmap:h}=e;if([h.x,h.y]=c,h.resolution=d,a&&y(a)&&y(a.pixelBlock)){const m={extent:a.extent,pixelBlock:a.pixelBlock};if(h.rawPixelData=m,r)h.source=a.pixelBlock,h.isRendereredSource=!1;else{const b=await this.layer.applyRenderer(m,(l==null?void 0:l.type)==="stretch"?l:null);h.source=b,h.isRendereredSource=!0}h.symbolizerParameters=r?g:null,r?h.transformGrid||(h.transformGrid=a.transformGrid):h.transformGrid=null}else{const m=this.createEmptyTilePixelBlock();h.source=m,h.symbolizerParameters=r?g:null,h.transformGrid=null}h.bandIds=r?i:null,h.width=this._tileInfoView.tileInfo.size[0],h.height=this._tileInfoView.tileInfo.size[1],h.interpolation=s,h.suspended=o,h.invalidateTexture()}async updateTileSymbolizerParameters(e,t){const{local:i,global:s}=t,{bandIds:r}=this.layer,a=this._getLayerInterpolation(),l=this.canUseWebGLForProcessing(),{bitmap:o}=e,{rawPixelData:c}=o;!l&&y(c)?(o.source=await this.layer.applyRenderer(c,(s==null?void 0:s.type)==="stretch"?s:null),o.isRendereredSource=!0):(o.isRendereredSource&&y(c)&&(o.source=c.pixelBlock),o.isRendereredSource=!1),o.symbolizerParameters=l?this.layerView.hasTilingEffects?s:i:null,o.bandIds=l?r:null,o.interpolation=a,o.suspended=!1}_getLayerInterpolation(){const e=this.layer.renderer.type;if(e==="raster-colormap"||e==="unique-value"||e==="class-breaks")return"nearest";const{interpolation:t}=this.layer,{renderer:i}=this.layer;return i.type==="raster-stretch"&&i.colorRamp!=null?t==="bilinear"||t==="cubic"?"bilinear":"nearest":t}};n([u()],_.prototype,"container",void 0),n([u()],_.prototype,"layer",void 0),n([u()],_.prototype,"type",void 0),_=n([R("esri.views.2d.layers.imagery.ImageryTileView2D")],_);const Se=_;class Ce extends M{constructor(t,i,s,r,a,l,o=null){super(t,i,s,r,a,l),this.tileData=new ne(o),this.tileData.coordScale=[a,l],this.tileData.once("isReady",()=>this.ready())}destroy(){super.destroy(),this.tileData.destroy(),this.tileData=null,this.stage=null}set stencilRef(t){this.tileData.stencilRef=t}get stencilRef(){return this.tileData.stencilRef}_createTransforms(){return{dvs:S(),tileMat3:S()}}setTransform(t){super.setTransform(t);const i=this.resolution/(t.resolution*t.pixelRatio),s=this.transforms.tileMat3,[r,a]=this.tileData.offset,l=[this.x+r*this.resolution,this.y-a*this.resolution],[o,c]=t.toScreenNoRotation([0,0],l),{symbolTileSize:d}=this.tileData.symbolizerParameters,g=Math.round((this.width-this.tileData.offset[0])/d)*d,h=Math.round((this.height-this.tileData.offset[1])/d)*d,m=g/this.rangeX*i,b=h/this.rangeY*i;ie(s,m,0,0,0,b,0,o,c,1),se(this.transforms.dvs,t.displayViewMat3,s),this.tileData.transforms.dvs=this.transforms.dvs}onAttach(){this.tileData.stage=this.stage}onDetach(){this.tileData.stage=null}}class Ue extends A{constructor(){super(...arguments),this.isCustomTilingScheme=!1,this.symbolTypes=["triangle"]}createTile(t){const i=this._tileInfoView.getTileBounds(W(),t),[s,r]=this._tileInfoView.tileInfo.size,a=this._tileInfoView.getTileResolution(t.level);return new Ce(t,a,i[0],i[3],s,r)}prepareRenderPasses(t){const i=t.registerRenderPass({name:"imagery (vf tile)",brushes:[ye],target:()=>this.children.map(s=>s.tileData),drawPhase:C.MAP});return[...super.prepareRenderPasses(t),i]}doRender(t){this.visible&&t.drawPhase===C.MAP&&this.symbolTypes.forEach(i=>{t.renderPass=i,super.doRender(t)})}}let v=class extends p{constructor(){super(...arguments),this._handle=null,this.container=null,this.layer=null,this.type="rasterVF"}canUseWebGLForProcessing(){return!1}async fetchTile(e,t){t={...t,interpolation:"nearest",requestProjectedLocalDirections:!0};const i=await this.layer.fetchTile(e.level,e.row,e.col,t);return this.layer.rasterInfo.dataType==="vector-magdir"&&(i==null?void 0:i.pixelBlock)&&(i.pixelBlock=await this.layer.convertVectorFieldData(i.pixelBlock,t)),i}updateTileSource(e,t){const i=t.symbolizerParams,{tileData:s}=e;s.key=e.key,s.width=this._tileInfoView.tileInfo.size[0],s.height=this._tileInfoView.tileInfo.size[1];const{symbolTileSize:r}=i,{source:a}=t;if(s.offset=this._getTileSymbolOffset(s.key,r),y(a)&&y(a.pixelBlock)){const l={extent:a.extent,pixelBlock:a.pixelBlock};s.rawPixelData=l,s.symbolizerParameters=i,s.source=this._sampleVectorFieldData(a.pixelBlock,i,s.offset)}else{const l=[Math.round((this._tileInfoView.tileInfo[0]-s.offset[0])/r),Math.round((this._tileInfoView.tileInfo[1]-s.offset[1])/r)],o=this.createEmptyTilePixelBlock(l);s.source=o,s.symbolizerParameters=i}return s.invalidateVAO(),Promise.resolve(null)}updateTileSymbolizerParameters(e,t){var l;const i=t.local,{symbolTileSize:s}=i,{tileData:r}=e;r.offset=this._getTileSymbolOffset(r.key,s);const a=r.symbolizerParameters.symbolTileSize;return r.symbolizerParameters=i,y((l=r.rawPixelData)==null?void 0:l.pixelBlock)&&a!==s&&(r.source=this._sampleVectorFieldData(r.rawPixelData.pixelBlock,r.symbolizerParameters,r.offset)),Promise.resolve(null)}attach(){super.attach(),this.container=new Ue(this._tileInfoView),this.container.isCustomTilingScheme=this._isCustomTilingScheme,this._updateSymbolType(this.layer.renderer),this._handle=w(()=>this.layer.renderer,e=>this._updateSymbolType(e))}detach(){super.detach(),this.container.removeAllChildren(),this._handle.remove(),this._handle=null}_getTileSymbolOffset(e,t){const i=e.col*this._tileInfoView.tileInfo.size[0]%t,s=e.row*this._tileInfoView.tileInfo.size[1]%t;return[i>t/2?t-i:-i,s>t/2?t-s:-s]}_sampleVectorFieldData(e,t,i){const{symbolTileSize:s}=t;return Pe(e,"vector-uv",s,i)}_updateSymbolType(e){e.type==="vector-field"&&(this.container.symbolTypes=e.style==="wind-barb"?["scalar","triangle"]:e.style==="simple-scalar"?["scalar"]:["triangle"])}};n([u()],v.prototype,"container",void 0),n([u()],v.prototype,"layer",void 0),n([u()],v.prototype,"type",void 0),v=n([R("esri.views.2d.layers.imagery.VectorFieldTileView2D")],v);const ze=v,ke=e=>{let t=class extends e{constructor(){super(...arguments),this._rasterFieldPrefix="Raster.",this.layer=null,this.view=null,this.tileInfo=null}get fullExtent(){return this._getfullExtent()}_getfullExtent(){return this.projectFullExtent(this.view.spatialReference)}get hasTilingEffects(){return this.layer.renderer&&"dynamicRangeAdjustment"in this.layer.renderer&&this.layer.renderer.dynamicRangeAdjustment}get datumTransformation(){return q(z(this.layer.fullExtent),this.view.spatialReference,!0)}supportsSpatialReference(i){return!!this.projectFullExtent(i)}projectFullExtent(i){const s=z(this.layer.fullExtent),r=q(s,i,!1);return ve(s,i,r)}async fetchPopupFeatures(i,s){const{layer:r}=this;if(!i)throw new D("imageryTileLayerView:fetchPopupFeatures","Nothing to fetch without area",{layer:r});const{popupEnabled:a}=r,l=Te(r,s);if(!a||ae(l))throw new D("imageryTileLayerView:fetchPopupFeatures","Missing required popupTemplate or popupEnabled",{popupEnabled:a,popupTemplate:l});const o=[],{value:c,magdirValue:d}=await r.identify(i,{timeExtent:this.timeExtent});let g="";if(c&&c.length){g=r.type==="imagery-tile"&&r.hasStandardTime()&&c[0]!=null?c.map(U=>r.getStandardTimeValue(U)).join(", "):c.join(", ");const h={ObjectId:0};h["Raster.ServicePixelValue"]=g;const m=r.rasterInfo.attributeTable;if(y(m)){const{fields:U,features:Q}=m,k=U.find(({name:f})=>f.toLowerCase()==="value"),V=k?Q.find(f=>String(f.attributes[k.name])===g):null;if(V)for(const f in V.attributes)V.attributes.hasOwnProperty(f)&&(h[this._rasterFieldPrefix+f]=V.attributes[f])}const b=r.rasterInfo.dataType;b!=="vector-magdir"&&b!=="vector-uv"||(h["Raster.Magnitude"]=d==null?void 0:d[0],h["Raster.Direction"]=d==null?void 0:d[1]);const x=new O(this.fullExtent.clone(),null,h);x.layer=r,x.sourceLayer=x.layer,o.push(x)}return o}};return n([u()],t.prototype,"layer",void 0),n([u(re)],t.prototype,"timeExtent",void 0),n([u()],t.prototype,"view",void 0),n([u()],t.prototype,"fullExtent",null),n([u()],t.prototype,"tileInfo",void 0),n([u({readOnly:!0})],t.prototype,"hasTilingEffects",null),t=n([R("esri.views.layers.ImageryTileLayerView")],t),t};let P=class extends ke(Ie(ue(ce))){constructor(){super(...arguments),this._useWebGLForProcessing=!0,this._useProgressiveUpdate=!0,this.subview=null}get useWebGLForProcessing(){return this._useWebGLForProcessing}set useWebGLForProcessing(e){this._useWebGLForProcessing=e,this.subview&&"useWebGLForProcessing"in this.subview&&(this.subview.useWebGLForProcessing=e)}get useProgressiveUpdate(){return this._useWebGLForProcessing}set useProgressiveUpdate(e){this._useProgressiveUpdate=e,this.subview&&"useProgressiveUpdate"in this.subview&&(this.subview.useProgressiveUpdate=e)}update(e){this.subview.update(e),this.notifyChange("updating")}isUpdating(){return!this.subview||this.subview.updating}attach(){this.layer.increaseRasterJobHandlerUsage(),this._updateSubview(),this.handles.add([w(()=>{const{layer:e}=this;return{bandIds:e.bandIds,renderer:e.renderer,interpolation:e.interpolation,multidimensionalDefinition:e.multidimensionalDefinition,rasterFunction:e.type==="imagery-tile"?e.rasterFunction:null}},(e,t)=>{var o,c;const i=e.interpolation!==t.interpolation&&(e.interpolation==="majority"||t.interpolation==="majority")&&j(this.layer),s=e.renderer!==t.renderer&&((o=t.renderer)==null?void 0:o.type)!==((c=e.renderer)==null?void 0:c.type);s&&this._updateSubview();const r=e.multidimensionalDefinition!==t.multidimensionalDefinition,a=e.rasterFunction!==t.rasterFunction,l=r||i||s||a;this.subview.redrawOrRefetch(l).catch(d=>{T(d)||I.getLogger(this.declaredClass).error(d)}),this.notifyChange("updating")}),w(()=>{var e;return(e=this.layer.blendMode)!=null?e:"normal"},e=>{this.subview.container.blendMode=e},E),w(()=>{var e;return(e=this.layer.effect)!=null?e:null},e=>{this.subview.container.effect=e},E),w(()=>{var e;return(e=this.layer.multidimensionalSubset)!=null?e:null},(e,t)=>{const{multidimensionalDefinition:i}=this.layer;y(i)&&$(i,e)!==$(i,t)&&(this.subview.redrawOrRefetch(!0).catch(s=>{T(s)||I.getLogger(this.declaredClass).error(s)}),this.notifyChange("updating"))},le),w(()=>this.timeExtent,()=>{this.subview.timeExtent=this.timeExtent,this.subview.redrawOrRefetch(!0).catch(e=>{T(e)||I.getLogger(this.declaredClass).error(e)})},oe)],"attach")}detach(){var e;this.handles.remove("attach"),this.layer.decreaseRasterJobHandlerUsage(),this._detachSubview(this.subview),(e=this.subview)==null||e.destroy(),this.subview=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.subview.moveEnd()}async hitTest(e,t){return[{type:"graphic",layer:this.layer,mapPoint:e,graphic:new O({attributes:{},geometry:e.clone()})}]}doRefresh(){var e;return(e=this.subview)==null?void 0:e.doRefresh()}_updateSubview(){var s;const e=this.layer.renderer.type==="vector-field"?"rasterVF":this.layer.renderer.type==="flow"?"flow":"raster";if(this.subview){if(this.subview.type===e)return void this._attachSubview(this.subview);this._detachSubview(this.subview),(s=this.subview)==null||s.destroy(),this.subview=null}const{layer:t}=this;let i;i=e==="rasterVF"?new ze({layer:t,layerView:this}):e==="flow"?new he({layer:t,layerView:this}):new Se({layer:t,layerView:this}),"useWebGLForProcessing"in i&&(i.useWebGLForProcessing=this._useWebGLForProcessing),"useProgressiveUpdate"in i&&(i.useProgressiveUpdate=this._useProgressiveUpdate),"previousLOD"in i&&(i.previousLOD=this.subview&&"previousLOD"in this.subview&&this.subview.previousLOD),this._attachSubview(i),this.subview=i,this.requestUpdate()}_attachSubview(e){e&&!e.attached&&(e.attach(),e.attached=!0,this.container.addChildAt(e.container,0),e.container.blendMode=this.layer.blendMode,e.container.effect=this.layer.effect)}_detachSubview(e){e!=null&&e.attached&&(this.container.removeChild(e.container),e.detach(),e.attached=!1)}};n([u()],P.prototype,"subview",void 0),n([u()],P.prototype,"useWebGLForProcessing",null),n([u()],P.prototype,"useProgressiveUpdate",null),P=n([R("esri.views.2d.layers.ImageryTileLayerView2D")],P);const at=P;export{at as default}; diff --git a/assets/IntegratedMeshLayer.3a48c634.js b/assets/IntegratedMeshLayer.23dae716.js similarity index 94% rename from assets/IntegratedMeshLayer.3a48c634.js rename to assets/IntegratedMeshLayer.23dae716.js index d1ef19f..e2e46e8 100644 --- a/assets/IntegratedMeshLayer.3a48c634.js +++ b/assets/IntegratedMeshLayer.23dae716.js @@ -1 +1 @@ -import{a6 as t,a7 as a,az as S,e0 as O,a8 as u,cx as $,dF as x,ii as b,jc as N,b4 as L,iy as R,cE as I,bX as M,U as A,eQ as w,eE as j,eF as J,eG as U,i3 as D,eH as V,il as E,au as K,c$ as P,dz as z,bY as F,aU as G,c as q,j as k,n as d,d2 as C,io as H,cF as Q}from"./index.d94abe07.js";import{g as m}from"./persistable.5f665309.js";import{N as X,L as v}from"./SceneService.0f3bf01a.js";import{s as Y,l as B,u as W,m as Z}from"./I3SLayerDefinitions.96f4da60.js";import"./multiOriginJSONSupportUtils.38b69b9c.js";import"./originUtils.2d0aad75.js";import"./resourceUtils.6d10bf82.js";var h;let n=h=class extends ${constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,i,r,o){if(o.layer&&o.layer.spatialReference&&!o.layer.spatialReference.equals(this.geometry.spatialReference)){if(!x(e.spatialReference,o.layer.spatialReference))return void(o&&o.messages&&o.messages.push(new b("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:o.layer.spatialReference,context:o})));const l=new S;N(e,l,o.layer.spatialReference),i[r]=l.toJSON(o)}else i[r]=e.toJSON(o);delete i[r].spatialReference}clone(){return new h({geometry:L(this.geometry),type:this.type})}};t([a({type:S}),m()],n.prototype,"geometry",void 0),t([O(["web-scene","portal-item"],"geometry")],n.prototype,"writeGeometry",null),t([a({type:["clip","mask","replace"],nonNullable:!0}),m()],n.prototype,"type",void 0),n=h=t([u("esri.layers.support.SceneModification")],n);const c=n;var p;let y=p=class extends R(I.ofType(c)){constructor(e){super(e),this.url=null}clone(){return new p({url:this.url,items:this.items.map(e=>e.clone())})}toJSON(e){return this.toArray().map(i=>i.toJSON(e)).filter(i=>!!i.geometry)}static fromJSON(e,i){const r=new p;for(const o of e)r.add(c.fromJSON(o,i));return r}static async fromUrl(e,i,r){const o={url:M(e),origin:"service"},l=await A(e,{responseType:"json",signal:w(r,"signal")}),_=i.toJSON(),f=[];for(const g of l.data)f.push(c.fromJSON({...g,geometry:{...g.geometry,spatialReference:_}},o));return new p({url:e,items:f})}};t([a({type:String})],y.prototype,"url",void 0),y=p=t([u("esri.layers.support.SceneModifications")],y);const T=y;let s=class extends X(j(J(U(D(V(E(Q))))))){constructor(...e){super(...e),this._handles=new K,this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this._modificationsSource=null,this.elevationInfo=null,this.path=null}destroy(){this._handles.destroy()}initialize(){this._handles.add(P(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,z))}normalizeCtorArgs(e,i){return typeof e=="string"?{url:e,...i}:e}readModifications(e,i,r){this._modificationsSource={url:F(e,r),context:r}}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const i=w(e,"signal");try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(r){G(r)}if(await this._fetchService(i),q(this._modificationsSource)){const r=await T.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",r,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,i)}beforeSave(){if(!k(this._modificationsSource))return this.load().then(()=>{},()=>{})}async saveAs(e,i){return this._debouncedSaveOperations(v.SAVE_AS,{...i,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(v.SAVE,e)}validateLayer(e){if(e.layerType&&e.layerType!=="IntegratedMesh")throw new d("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new d("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new d("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}};t([a({type:String,readOnly:!0})],s.prototype,"geometryType",void 0),t([a({type:["show","hide"]})],s.prototype,"listMode",void 0),t([a({type:["IntegratedMeshLayer"]})],s.prototype,"operationalLayerType",void 0),t([a({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),t([a({type:Y,readOnly:!0})],s.prototype,"nodePages",void 0),t([a({type:[B],readOnly:!0})],s.prototype,"materialDefinitions",void 0),t([a({type:[W],readOnly:!0})],s.prototype,"textureSetDefinitions",void 0),t([a({type:[Z],readOnly:!0})],s.prototype,"geometryDefinitions",void 0),t([a({readOnly:!0})],s.prototype,"serviceUpdateTimeStamp",void 0),t([a({type:T}),m({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],s.prototype,"modifications",void 0),t([C(["web-scene","portal-item"],"modifications")],s.prototype,"readModifications",null),t([a(H)],s.prototype,"elevationInfo",void 0),t([a({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),s=t([u("esri.layers.IntegratedMeshLayer")],s);const ne=s;export{ne as default}; +import{a6 as t,a7 as a,az as S,e0 as O,a8 as u,cx as $,dF as x,ii as b,jc as N,b4 as L,iy as R,cE as I,bX as M,U as A,eQ as w,eE as j,eF as J,eG as U,i3 as D,eH as V,il as E,au as K,c$ as P,dz as z,bY as F,aU as G,c as q,j as k,n as d,d2 as C,io as H,cF as Q}from"./index.221827cd.js";import{g as m}from"./persistable.6b292e5e.js";import{N as X,L as v}from"./SceneService.9c2e5b40.js";import{s as Y,l as B,u as W,m as Z}from"./I3SLayerDefinitions.0127897b.js";import"./multiOriginJSONSupportUtils.38b69b9c.js";import"./originUtils.2d0aad75.js";import"./resourceUtils.f4b6e42a.js";var h;let n=h=class extends ${constructor(e){super(e),this.geometry=null,this.type="clip"}writeGeometry(e,i,r,o){if(o.layer&&o.layer.spatialReference&&!o.layer.spatialReference.equals(this.geometry.spatialReference)){if(!x(e.spatialReference,o.layer.spatialReference))return void(o&&o.messages&&o.messages.push(new b("scenemodification:unsupported","Scene modifications with incompatible spatial references are not supported",{modification:this,spatialReference:o.layer.spatialReference,context:o})));const l=new S;N(e,l,o.layer.spatialReference),i[r]=l.toJSON(o)}else i[r]=e.toJSON(o);delete i[r].spatialReference}clone(){return new h({geometry:L(this.geometry),type:this.type})}};t([a({type:S}),m()],n.prototype,"geometry",void 0),t([O(["web-scene","portal-item"],"geometry")],n.prototype,"writeGeometry",null),t([a({type:["clip","mask","replace"],nonNullable:!0}),m()],n.prototype,"type",void 0),n=h=t([u("esri.layers.support.SceneModification")],n);const c=n;var p;let y=p=class extends R(I.ofType(c)){constructor(e){super(e),this.url=null}clone(){return new p({url:this.url,items:this.items.map(e=>e.clone())})}toJSON(e){return this.toArray().map(i=>i.toJSON(e)).filter(i=>!!i.geometry)}static fromJSON(e,i){const r=new p;for(const o of e)r.add(c.fromJSON(o,i));return r}static async fromUrl(e,i,r){const o={url:M(e),origin:"service"},l=await A(e,{responseType:"json",signal:w(r,"signal")}),_=i.toJSON(),f=[];for(const g of l.data)f.push(c.fromJSON({...g,geometry:{...g.geometry,spatialReference:_}},o));return new p({url:e,items:f})}};t([a({type:String})],y.prototype,"url",void 0),y=p=t([u("esri.layers.support.SceneModifications")],y);const T=y;let s=class extends X(j(J(U(D(V(E(Q))))))){constructor(...e){super(...e),this._handles=new K,this.geometryType="mesh",this.operationalLayerType="IntegratedMeshLayer",this.type="integrated-mesh",this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.profile="mesh-pyramids",this.modifications=null,this._modificationsSource=null,this.elevationInfo=null,this.path=null}destroy(){this._handles.destroy()}initialize(){this._handles.add(P(()=>this.modifications,"after-changes",()=>this.modifications=this.modifications,z))}normalizeCtorArgs(e,i){return typeof e=="string"?{url:e,...i}:e}readModifications(e,i,r){this._modificationsSource={url:F(e,r),context:r}}async load(e){return this.addResolvingPromise(this._doLoad(e)),this}async _doLoad(e){const i=w(e,"signal");try{await this.loadFromPortal({supportedTypes:["Scene Service"]},e)}catch(r){G(r)}if(await this._fetchService(i),q(this._modificationsSource)){const r=await T.fromUrl(this._modificationsSource.url,this.spatialReference,e);this.setAtOrigin("modifications",r,this._modificationsSource.context.origin),this._modificationsSource=null}await this._fetchIndexAndUpdateExtent(this.nodePages,i)}beforeSave(){if(!k(this._modificationsSource))return this.load().then(()=>{},()=>{})}async saveAs(e,i){return this._debouncedSaveOperations(v.SAVE_AS,{...i,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"integrated-mesh"};return this._debouncedSaveOperations(v.SAVE,e)}validateLayer(e){if(e.layerType&&e.layerType!=="IntegratedMesh")throw new d("integrated-mesh-layer:layer-type-not-supported","IntegratedMeshLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new d("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"});if(this.version.major>1)throw new d("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x"})}_getTypeKeywords(){return["IntegratedMeshLayer"]}};t([a({type:String,readOnly:!0})],s.prototype,"geometryType",void 0),t([a({type:["show","hide"]})],s.prototype,"listMode",void 0),t([a({type:["IntegratedMeshLayer"]})],s.prototype,"operationalLayerType",void 0),t([a({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),t([a({type:Y,readOnly:!0})],s.prototype,"nodePages",void 0),t([a({type:[B],readOnly:!0})],s.prototype,"materialDefinitions",void 0),t([a({type:[W],readOnly:!0})],s.prototype,"textureSetDefinitions",void 0),t([a({type:[Z],readOnly:!0})],s.prototype,"geometryDefinitions",void 0),t([a({readOnly:!0})],s.prototype,"serviceUpdateTimeStamp",void 0),t([a({type:T}),m({origins:["web-scene","portal-item"],type:"resource",prefix:"modifications"})],s.prototype,"modifications",void 0),t([C(["web-scene","portal-item"],"modifications")],s.prototype,"readModifications",null),t([a(H)],s.prototype,"elevationInfo",void 0),t([a({type:String,json:{origins:{"web-scene":{read:!0,write:!0},"portal-item":{read:!0,write:!0}},read:!1}})],s.prototype,"path",void 0),s=t([u("esri.layers.IntegratedMeshLayer")],s);const ne=s;export{ne as default}; diff --git a/assets/InterleavedLayout.f9d79992.js b/assets/InterleavedLayout.30cdc193.js similarity index 97% rename from assets/InterleavedLayout.f9d79992.js rename to assets/InterleavedLayout.30cdc193.js index 816d57e..63005e9 100644 --- a/assets/InterleavedLayout.f9d79992.js +++ b/assets/InterleavedLayout.30cdc193.js @@ -1 +1 @@ -import{u,m as f,i as l,T as p,c as a,h as o,l as c,a as F,p as m,b as _,x as y,y as b,o as w,d as v,g,j as T,V as A,q as N,A as B,L as E,B as L}from"./BufferView.89055914.js";import{e as U}from"./types.44c7402c.js";class n{constructor(e,t){this.layout=e,this.buffer=typeof t=="number"?new ArrayBuffer(t*e.stride):t;for(const i of e.fieldNames){const r=e.fields.get(i);this[i]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const i=this[e];return i&&i.elementCount===t.ElementCount&&i.elementType===t.ElementType?i:null}slice(e,t){return new n(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t,i,r){const s=this.stride;if(s%4==0){const h=new Uint32Array(e.buffer,t*s,r*s/4);new Uint32Array(this.buffer,i*s,r*s/4).set(h)}else{const h=new Uint8Array(e.buffer,t*s,r*s);new Uint8Array(this.buffer,i*s,r*s).set(h)}}}class d{constructor(){this.stride=0,this.fields=new Map,this.fieldNames=[]}vec2f(e,t){return this._appendField(e,u,t),this}vec2f64(e,t){return this._appendField(e,f,t),this}vec3f(e,t){return this._appendField(e,l,t),this}vec3f64(e,t){return this._appendField(e,p,t),this}vec4f(e,t){return this._appendField(e,a,t),this}vec4f64(e,t){return this._appendField(e,o,t),this}mat3f(e,t){return this._appendField(e,c,t),this}mat3f64(e,t){return this._appendField(e,F,t),this}mat4f(e,t){return this._appendField(e,m,t),this}mat4f64(e,t){return this._appendField(e,_,t),this}vec4u8(e,t){return this._appendField(e,y,t),this}f32(e,t){return this._appendField(e,b,t),this}f64(e,t){return this._appendField(e,w,t),this}u8(e,t){return this._appendField(e,v,t),this}u16(e,t){return this._appendField(e,g,t),this}i8(e,t){return this._appendField(e,T,t),this}vec2i8(e,t){return this._appendField(e,A,t),this}vec2i16(e,t){return this._appendField(e,N,t),this}vec2u8(e,t){return this._appendField(e,B,t),this}vec4u16(e,t){return this._appendField(e,E,t),this}u32(e,t){return this._appendField(e,L,t),this}_appendField(e,t,i){const r=t.ElementCount*U(t.ElementType),s=this.stride;this.fields.set(e,{size:r,constructor:t,offset:s,optional:i}),this.stride+=r,this.fieldNames.push(e)}alignTo(e){return this.stride=Math.floor((this.stride+e-1)/e)*e,this}hasField(e){return this.fieldNames.includes(e)}createBuffer(e){return new n(this,e)}createView(e){return new n(this,e)}clone(){const e=new d;return e.stride=this.stride,e.fields=new Map,this.fields.forEach((t,i)=>e.fields.set(i,t)),e.fieldNames=this.fieldNames.slice(),e.BufferType=this.BufferType,e}}function x(){return new d}export{x as T}; +import{u,m as f,i as l,T as p,c as a,h as o,l as c,a as F,p as m,b as _,x as y,y as b,o as w,d as v,g,j as T,V as A,q as N,A as B,L as E,B as L}from"./BufferView.6eee27cd.js";import{e as U}from"./types.44c7402c.js";class n{constructor(e,t){this.layout=e,this.buffer=typeof t=="number"?new ArrayBuffer(t*e.stride):t;for(const i of e.fieldNames){const r=e.fields.get(i);this[i]=new r.constructor(this.buffer,r.offset,this.stride)}}get stride(){return this.layout.stride}get count(){return this.buffer.byteLength/this.stride}get byteLength(){return this.buffer.byteLength}getField(e,t){const i=this[e];return i&&i.elementCount===t.ElementCount&&i.elementType===t.ElementType?i:null}slice(e,t){return new n(this.layout,this.buffer.slice(e*this.stride,t*this.stride))}copyFrom(e,t,i,r){const s=this.stride;if(s%4==0){const h=new Uint32Array(e.buffer,t*s,r*s/4);new Uint32Array(this.buffer,i*s,r*s/4).set(h)}else{const h=new Uint8Array(e.buffer,t*s,r*s);new Uint8Array(this.buffer,i*s,r*s).set(h)}}}class d{constructor(){this.stride=0,this.fields=new Map,this.fieldNames=[]}vec2f(e,t){return this._appendField(e,u,t),this}vec2f64(e,t){return this._appendField(e,f,t),this}vec3f(e,t){return this._appendField(e,l,t),this}vec3f64(e,t){return this._appendField(e,p,t),this}vec4f(e,t){return this._appendField(e,a,t),this}vec4f64(e,t){return this._appendField(e,o,t),this}mat3f(e,t){return this._appendField(e,c,t),this}mat3f64(e,t){return this._appendField(e,F,t),this}mat4f(e,t){return this._appendField(e,m,t),this}mat4f64(e,t){return this._appendField(e,_,t),this}vec4u8(e,t){return this._appendField(e,y,t),this}f32(e,t){return this._appendField(e,b,t),this}f64(e,t){return this._appendField(e,w,t),this}u8(e,t){return this._appendField(e,v,t),this}u16(e,t){return this._appendField(e,g,t),this}i8(e,t){return this._appendField(e,T,t),this}vec2i8(e,t){return this._appendField(e,A,t),this}vec2i16(e,t){return this._appendField(e,N,t),this}vec2u8(e,t){return this._appendField(e,B,t),this}vec4u16(e,t){return this._appendField(e,E,t),this}u32(e,t){return this._appendField(e,L,t),this}_appendField(e,t,i){const r=t.ElementCount*U(t.ElementType),s=this.stride;this.fields.set(e,{size:r,constructor:t,offset:s,optional:i}),this.stride+=r,this.fieldNames.push(e)}alignTo(e){return this.stride=Math.floor((this.stride+e-1)/e)*e,this}hasField(e){return this.fieldNames.includes(e)}createBuffer(e){return new n(this,e)}createView(e){return new n(this,e)}clone(){const e=new d;return e.stride=this.stride,e.fields=new Map,this.fields.forEach((t,i)=>e.fields.set(i,t)),e.fieldNames=this.fieldNames.slice(),e.BufferType=this.BufferType,e}}function x(){return new d}export{x as T}; diff --git a/assets/KMLLayer.c732c888.js b/assets/KMLLayer.5fd7c195.js similarity index 96% rename from assets/KMLLayer.c732c888.js rename to assets/KMLLayer.5fd7c195.js index d0c6e76..d7d2d79 100644 --- a/assets/KMLLayer.c732c888.js +++ b/assets/KMLLayer.5fd7c195.js @@ -1 +1 @@ -import{W as L,iy as O,c$ as g,dz as y,_ as S,ds as m,c as h,cU as b,hB as j,cE as c,a6 as s,a7 as l,jn as M,d2 as d,a8 as w,hT as T,i2 as I,ia as K,i3 as C,eF as N,eG as P,eH as R,ee as z,aT as E,cA as A,aU as J,e0 as U,eK as W,cF as H}from"./index.d94abe07.js";import{j as G,S as x,g as k,d as _}from"./kmlUtils.abf45fa2.js";var u;let o=u=class extends L.EventedMixin(O(T)){constructor(...e){super(...e),this.description=null,this.id=null,this.networkLink=null,this.sublayers=null,this.title=null,this.sourceJSON=null,this.fullExtent=null,this.addHandles([g(()=>this.sublayers,"after-add",({item:t})=>{t.parent=this,t.layer=this.layer},y),g(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},y),S(()=>this.sublayers,(t,i)=>{if(i)for(const r of i)r.layer=r.parent=null;if(t)for(const r of t)r.parent=this,r.layer=this.layer},y)])}initialize(){m(()=>this.networkLink).then(()=>m(()=>this.visible===!0)).then(()=>this.load())}load(e){var r,n;if(!this.networkLink||this.networkLink.viewFormat)return;const t=h(e)?e.signal:null,i=this._fetchService((n=(r=this._get("networkLink"))==null?void 0:r.href)!=null?n:"",t).then(p=>{var f;const F=G(p.sublayers);this.fullExtent=b.fromJSON(F),this.sourceJSON=p;const v=j(c.ofType(u),x(u,p));this.sublayers?this.sublayers.addMany(v):this.sublayers=v,(f=this.layer)==null||f.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")});return this.addResolvingPromise(i),Promise.resolve(this)}get visible(){return this._get("visible")}set visible(e){this._get("visible")!==e&&(this._set("visible",e),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(e,t){return!!t.visibility}set layer(e){this._set("layer",e),this.sublayers&&this.sublayers.forEach(t=>t.layer=e)}_fetchService(e,t){return k(e,this.layer.outSpatialReference,this.layer.refreshInterval,t).then(i=>_(i.data))}};s([l()],o.prototype,"description",void 0),s([l()],o.prototype,"id",void 0),s([l({readOnly:!0,value:null})],o.prototype,"networkLink",void 0),s([l({json:{write:{allowNull:!0}}})],o.prototype,"parent",void 0),s([l({type:c.ofType(u),json:{write:{allowNull:!0}}})],o.prototype,"sublayers",void 0),s([l({value:null,json:{read:{source:"name",reader:e=>M(e)}}})],o.prototype,"title",void 0),s([l({value:!0})],o.prototype,"visible",null),s([d("visible",["visibility"])],o.prototype,"readVisible",null),s([l()],o.prototype,"sourceJSON",void 0),s([l({value:null})],o.prototype,"layer",null),s([l({type:b})],o.prototype,"fullExtent",void 0),o=u=s([w("esri.layers.support.KMLSublayer")],o);const $=o,V=["kml","xml"];let a=class extends I(K(C(N(P(R(H)))))){constructor(...e){super(...e),this._visibleFolders=[],this.allSublayers=new z({getCollections:()=>[this.sublayers],getChildrenFunction:t=>t.sublayers}),this.outSpatialReference=E.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.addHandles([S(()=>this.sublayers,(e,t)=>{t&&t.forEach(i=>{i.parent=null,i.layer=null}),e&&e.forEach(i=>{i.parent=this,i.layer=this})},y),this.on("sublayer-update",()=>this.notifyChange("fullExtent"))])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}readSublayersFromItemOrWebMap(e,t){this._visibleFolders=t.visibleFolders}readSublayers(e,t,i){return x($,t,i,this._visibleFolders)}writeSublayers(e,t){const i=[],r=e.toArray();for(;r.length;){const n=r[0];n.networkLink||(n.visible&&i.push(n.id),n.sublayers&&r.push(...n.sublayers.toArray())),r.shift()}t.visibleFolders=i}get title(){const e=this._get("title");return e&&this.originOf("title")!=="defaults"?e:this.url?A(this.url,V)||"KML":e||""}set title(e){this._set("title",e)}get visibleSublayers(){const e=this.sublayers,t=[],i=r=>{r.visible&&(t.push(r),r.sublayers&&r.sublayers.forEach(i))};return e&&e.forEach(i),t}get fullExtent(){return this._recomputeFullExtent()}load(e){const t=h(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},e).catch(J).then(()=>this._fetchService(t))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(e){const t=await Promise.resolve().then(()=>{var r;return this.resourceInfo?{ssl:!1,data:this.resourceInfo}:k((r=this.url)!=null?r:"",this.outSpatialReference,this.refreshInterval,e)}),i=_(t.data);i&&this.read(i,{origin:"service"})}_recomputeFullExtent(){let e=null;h(this.extent)&&(e=this.extent.clone());const t=i=>{if(i.sublayers)for(const r of i.sublayers.items)t(r),r.visible&&r.fullExtent&&(h(e)?e.union(r.fullExtent):e=r.fullExtent.clone())};return t(this),e}};s([l({readOnly:!0})],a.prototype,"allSublayers",void 0),s([l({type:E})],a.prototype,"outSpatialReference",void 0),s([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],a.prototype,"path",void 0),s([l({readOnly:!0,json:{read:!1,write:!1}})],a.prototype,"legendEnabled",void 0),s([l({type:["show","hide","hide-children"]})],a.prototype,"listMode",void 0),s([l({type:["KML"]})],a.prototype,"operationalLayerType",void 0),s([l({})],a.prototype,"resourceInfo",void 0),s([l({type:c.ofType($),json:{write:{ignoreOrigin:!0}}})],a.prototype,"sublayers",void 0),s([d(["web-map","portal-item"],"sublayers",["visibleFolders"])],a.prototype,"readSublayersFromItemOrWebMap",null),s([d("service","sublayers",["sublayers"])],a.prototype,"readSublayers",null),s([U("sublayers")],a.prototype,"writeSublayers",null),s([l({readOnly:!0,json:{read:!1}})],a.prototype,"type",void 0),s([l({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],a.prototype,"title",null),s([l(W)],a.prototype,"url",void 0),s([l({readOnly:!0})],a.prototype,"visibleSublayers",null),s([l({type:b})],a.prototype,"extent",void 0),s([l()],a.prototype,"fullExtent",null),a=s([w("esri.layers.KMLLayer")],a);const q=a;export{q as default}; +import{W as L,iy as O,c$ as g,dz as y,_ as S,ds as m,c as h,cU as b,hB as j,cE as c,a6 as s,a7 as l,jn as M,d2 as d,a8 as w,hT as T,i2 as I,ia as K,i3 as C,eF as N,eG as P,eH as R,ee as z,aT as E,cA as A,aU as J,e0 as U,eK as W,cF as H}from"./index.221827cd.js";import{j as G,S as x,g as k,d as _}from"./kmlUtils.3e458b80.js";var u;let o=u=class extends L.EventedMixin(O(T)){constructor(...e){super(...e),this.description=null,this.id=null,this.networkLink=null,this.sublayers=null,this.title=null,this.sourceJSON=null,this.fullExtent=null,this.addHandles([g(()=>this.sublayers,"after-add",({item:t})=>{t.parent=this,t.layer=this.layer},y),g(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=t.parent=null},y),S(()=>this.sublayers,(t,i)=>{if(i)for(const r of i)r.layer=r.parent=null;if(t)for(const r of t)r.parent=this,r.layer=this.layer},y)])}initialize(){m(()=>this.networkLink).then(()=>m(()=>this.visible===!0)).then(()=>this.load())}load(e){var r,n;if(!this.networkLink||this.networkLink.viewFormat)return;const t=h(e)?e.signal:null,i=this._fetchService((n=(r=this._get("networkLink"))==null?void 0:r.href)!=null?n:"",t).then(p=>{var f;const F=G(p.sublayers);this.fullExtent=b.fromJSON(F),this.sourceJSON=p;const v=j(c.ofType(u),x(u,p));this.sublayers?this.sublayers.addMany(v):this.sublayers=v,(f=this.layer)==null||f.emit("sublayer-update"),this.layer&&this.layer.notifyChange("visibleSublayers")});return this.addResolvingPromise(i),Promise.resolve(this)}get visible(){return this._get("visible")}set visible(e){this._get("visible")!==e&&(this._set("visible",e),this.layer&&this.layer.notifyChange("visibleSublayers"))}readVisible(e,t){return!!t.visibility}set layer(e){this._set("layer",e),this.sublayers&&this.sublayers.forEach(t=>t.layer=e)}_fetchService(e,t){return k(e,this.layer.outSpatialReference,this.layer.refreshInterval,t).then(i=>_(i.data))}};s([l()],o.prototype,"description",void 0),s([l()],o.prototype,"id",void 0),s([l({readOnly:!0,value:null})],o.prototype,"networkLink",void 0),s([l({json:{write:{allowNull:!0}}})],o.prototype,"parent",void 0),s([l({type:c.ofType(u),json:{write:{allowNull:!0}}})],o.prototype,"sublayers",void 0),s([l({value:null,json:{read:{source:"name",reader:e=>M(e)}}})],o.prototype,"title",void 0),s([l({value:!0})],o.prototype,"visible",null),s([d("visible",["visibility"])],o.prototype,"readVisible",null),s([l()],o.prototype,"sourceJSON",void 0),s([l({value:null})],o.prototype,"layer",null),s([l({type:b})],o.prototype,"fullExtent",void 0),o=u=s([w("esri.layers.support.KMLSublayer")],o);const $=o,V=["kml","xml"];let a=class extends I(K(C(N(P(R(H)))))){constructor(...e){super(...e),this._visibleFolders=[],this.allSublayers=new z({getCollections:()=>[this.sublayers],getChildrenFunction:t=>t.sublayers}),this.outSpatialReference=E.WGS84,this.path=null,this.legendEnabled=!1,this.operationalLayerType="KML",this.sublayers=null,this.type="kml",this.url=null}initialize(){this.addHandles([S(()=>this.sublayers,(e,t)=>{t&&t.forEach(i=>{i.parent=null,i.layer=null}),e&&e.forEach(i=>{i.parent=this,i.layer=this})},y),this.on("sublayer-update",()=>this.notifyChange("fullExtent"))])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}readSublayersFromItemOrWebMap(e,t){this._visibleFolders=t.visibleFolders}readSublayers(e,t,i){return x($,t,i,this._visibleFolders)}writeSublayers(e,t){const i=[],r=e.toArray();for(;r.length;){const n=r[0];n.networkLink||(n.visible&&i.push(n.id),n.sublayers&&r.push(...n.sublayers.toArray())),r.shift()}t.visibleFolders=i}get title(){const e=this._get("title");return e&&this.originOf("title")!=="defaults"?e:this.url?A(this.url,V)||"KML":e||""}set title(e){this._set("title",e)}get visibleSublayers(){const e=this.sublayers,t=[],i=r=>{r.visible&&(t.push(r),r.sublayers&&r.sublayers.forEach(i))};return e&&e.forEach(i),t}get fullExtent(){return this._recomputeFullExtent()}load(e){const t=h(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["KML"],supportsData:!1},e).catch(J).then(()=>this._fetchService(t))),Promise.resolve(this)}destroy(){super.destroy(),this.allSublayers.destroy()}async _fetchService(e){const t=await Promise.resolve().then(()=>{var r;return this.resourceInfo?{ssl:!1,data:this.resourceInfo}:k((r=this.url)!=null?r:"",this.outSpatialReference,this.refreshInterval,e)}),i=_(t.data);i&&this.read(i,{origin:"service"})}_recomputeFullExtent(){let e=null;h(this.extent)&&(e=this.extent.clone());const t=i=>{if(i.sublayers)for(const r of i.sublayers.items)t(r),r.visible&&r.fullExtent&&(h(e)?e.union(r.fullExtent):e=r.fullExtent.clone())};return t(this),e}};s([l({readOnly:!0})],a.prototype,"allSublayers",void 0),s([l({type:E})],a.prototype,"outSpatialReference",void 0),s([l({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],a.prototype,"path",void 0),s([l({readOnly:!0,json:{read:!1,write:!1}})],a.prototype,"legendEnabled",void 0),s([l({type:["show","hide","hide-children"]})],a.prototype,"listMode",void 0),s([l({type:["KML"]})],a.prototype,"operationalLayerType",void 0),s([l({})],a.prototype,"resourceInfo",void 0),s([l({type:c.ofType($),json:{write:{ignoreOrigin:!0}}})],a.prototype,"sublayers",void 0),s([d(["web-map","portal-item"],"sublayers",["visibleFolders"])],a.prototype,"readSublayersFromItemOrWebMap",null),s([d("service","sublayers",["sublayers"])],a.prototype,"readSublayers",null),s([U("sublayers")],a.prototype,"writeSublayers",null),s([l({readOnly:!0,json:{read:!1}})],a.prototype,"type",void 0),s([l({json:{origins:{"web-map":{read:{source:"title"}}},write:{ignoreOrigin:!0}}})],a.prototype,"title",null),s([l(W)],a.prototype,"url",void 0),s([l({readOnly:!0})],a.prototype,"visibleSublayers",null),s([l({type:b})],a.prototype,"extent",void 0),s([l()],a.prototype,"fullExtent",null),a=s([w("esri.layers.KMLLayer")],a);const q=a;export{q as default}; diff --git a/assets/KMLLayerView2D.bb939d29.js b/assets/KMLLayerView2D.5351cad6.js similarity index 85% rename from assets/KMLLayerView2D.bb939d29.js rename to assets/KMLLayerView2D.5351cad6.js index 9c54ea4..e5cfdd7 100644 --- a/assets/KMLLayerView2D.bb939d29.js +++ b/assets/KMLLayerView2D.5351cad6.js @@ -1 +1 @@ -import{cI as P,af as U,U as $,dB as S,cE as z,_ as F,cU as A,c as C,j as W,dE as Y,aT as L,dO as H,dP as j,dQ as K,dR as J,a6 as x,a7 as f,a8 as Q}from"./index.d94abe07.js";import{b as I,g as X,d as Z}from"./kmlUtils.abf45fa2.js";import{S as tt,T as et,R as it}from"./Bitmap.43defcb1.js";import{a as at}from"./BitmapContainer.3274be0c.js";import{y as st,u as rt}from"./LayerView.42d17220.js";import{i as D}from"./GraphicContainer.618d10e5.js";import{o as R}from"./BaseGraphicContainer.6b1c597d.js";import{C as ot,$ as nt}from"./rasterProjectionHelper.0a540f3d.js";import{a as lt,e as ht}from"./WGLContainer.1850619d.js";import{y as pt,o as mt}from"./RenderingContext.6e624525.js";import{P as T,G as M,D as q,L as N,Y as ct,V as dt,f as B}from"./enums.2d9e6f64.js";import{x as gt}from"./VertexArrayObject.a4c1d809.js";import{E as G}from"./Texture.4c97bad5.js";import"./utils.4b023c9d.js";import"./Utils.7f6f3a6b.js";import"./enums.0295eb81.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.229b1dd6.js";import"./ExpandedCIM.f0b7f36d.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.0d428d19.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.df11258c.js";import"./normalizeUtilsSync.757b5fd1.js";import"./projectionSupport.0542c13b.js";import"./json.879c9adc.js";import"./FeatureContainer.4ca52b51.js";import"./TileContainer.8b7fafe2.js";import"./visualVariablesUtils.32e27706.js";import"./visualVariablesUtils.aff73e6d.js";import"./Matcher.fe0c3dcf.js";import"./tileUtils.44921ab9.js";import"./TileClipper.8c399a8a.js";import"./Geometry.d049a63c.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./devEnvironmentUtils.d8d0484c.js";import"./schemaUtils.69ad92d2.js";import"./createSymbolSchema.e54d2060.js";import"./util.ab699fea.js";import"./ComputedAttributeStorage.c1cb22b3.js";import"./centroid.cc817cc5.js";import"./vec3f32.1121a836.js";import"./pixelUtils.82950e1a.js";import"./ProgramTemplate.e9a5aa54.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./programUtils.956e69db.js";import"./OrderIndependentTransparency.4d1575c0.js";class p{constructor(t){if(t)this._ownsRctx=!1,this._rctx=t;else{if(p._instance)return p._instanceRefCount++,p._instance;p._instanceRefCount=1,p._instance=this,this._ownsRctx=!0;const i=document.createElement("canvas").getContext("webgl");i.getExtension("OES_texture_float"),this._rctx=new pt(i,{})}const a={applyProjection:!0,bilinear:!1,bicubic:!1},r=mt("raster/reproject","raster/reproject",new Map([["a_position",0]]),a);this._program=this._rctx.programCache.acquire(r.shaders.vertexShader,r.shaders.fragmentShader,r.attributes),this._rctx.useProgram(this._program),this._program.setUniform1f("u_opacity",1),this._program.setUniform1i("u_image",0),this._program.setUniform1i("u_flipY",0),this._program.setUniform1i("u_transformGrid",1),this._quad=new lt(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(t,a,r=!1){const i=P(t.extent,a),s=new U({x:(t.extent.xmax-t.extent.xmin)/t.texture.descriptor.width,y:(t.extent.ymax-t.extent.ymin)/t.texture.descriptor.height,spatialReference:t.extent.spatialReference}),{x:o,y:m}=ot(s,a,t.extent);let h=(o+m)/2;const n=Math.round((i.xmax-i.xmin)/h),c=Math.round((i.ymax-i.ymin)/h);h=(i.width/n+i.height/c)/2;const b=new U({x:h,y:h,spatialReference:i.spatialReference}),w=nt({projectedExtent:i,srcBufferExtent:t.extent,pixelSize:b,hasWrapAround:!0,spacing:[16,16]}),y=ht(this._rctx,w),g=new G(this._rctx,{width:n,height:c,pixelFormat:T.RGBA,dataType:M.UNSIGNED_BYTE,wrapMode:q.CLAMP_TO_EDGE,samplingMode:N.LINEAR,hasMipmap:!1}),l=new gt(this._rctx,{colorTarget:ct.TEXTURE,depthStencilTarget:dt.NONE,width:n,height:c},g);if(this._rctx.bindFramebuffer(l),this._rctx.setViewport(0,0,n,c),this._rctx.useProgram(this._program),this._rctx.bindTexture(t.texture,0),this._rctx.bindTexture(y,1),this._quad.bind(),this._program.setUniform2f("u_srcImageSize",t.texture.descriptor.width,t.texture.descriptor.height),this._program.setUniform2fv("u_transformSpacing",w.spacing),this._program.setUniform2fv("u_transformGridSize",w.size),this._program.setUniform2f("u_targetImageSize",n,c),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),y.dispose(),r){const u=new ImageData(l.descriptor.width,l.descriptor.height);return l.readPixels(0,0,l.descriptor.width,l.descriptor.height,T.RGBA,M.UNSIGNED_BYTE,u.data),l.detachColorTexture(B.COLOR_ATTACHMENT0),l.dispose(),{texture:g,extent:i,imageData:u}}return l.detachColorTexture(B.COLOR_ATTACHMENT0),l.dispose(),{texture:g,extent:i}}reprojectBitmapData(t,a){const r=tt(t.bitmapData)?et(t.bitmapData):t.bitmapData,i=new G(this._rctx,{width:t.bitmapData.width,height:t.bitmapData.height,pixelFormat:T.RGBA,dataType:M.UNSIGNED_BYTE,wrapMode:q.CLAMP_TO_EDGE,samplingMode:N.LINEAR,hasMipmap:!1},r),s=this.reprojectTexture({texture:i,extent:t.extent},a,!0);s.texture.dispose();const o=document.createElement("canvas");return o.width=s.imageData.width,o.height=s.imageData.height,o.getContext("2d").putImageData(s.imageData,0,0),{bitmapData:o,extent:s.extent}}async loadAndReprojectBitmapData(t,a,r){const i=(await $(t,{responseType:"image"})).data,s=document.createElement("canvas");s.width=i.width,s.height=i.height;const o=s.getContext("2d");o.drawImage(i,0,0);const m=o.getImageData(0,0,s.width,s.height);if(a.spatialReference.equals(r))return{bitmapData:m,extent:a};const h=this.reprojectBitmapData({bitmapData:m,extent:a},r);return{bitmapData:h.bitmapData,extent:h.extent}}destroy(){this._ownsRctx?(p._instanceRefCount--,p._instanceRefCount===0&&(this._quad.dispose(),this._program.dispose(),this._rctx.dispose(),p._instance=null)):(this._quad.dispose(),this._program.dispose())}}p._instanceRefCount=0;class O{constructor(){this.allSublayers=new Map,this.allPoints=[],this.allPolylines=[],this.allPolygons=[],this.allMapImages=[]}}let d=class extends st(rt){constructor(){super(...arguments),this._bitmapIndex=new Map,this._mapImageContainer=new at,this._kmlVisualData=new O,this.allVisiblePoints=new S,this.allVisiblePolylines=new S,this.allVisiblePolygons=new S,this.allVisibleMapImages=new z}async hitTest(e,t){var r,i,s;const a=this.layer;return[(r=this._pointsView)==null?void 0:r.hitTest(e),(i=this._polylinesView)==null?void 0:i.hitTest(e),(s=this._polygonsView)==null?void 0:s.hitTest(e)].flat().filter(Boolean).map(o=>(o.layer=a,o.sourceLayer=a,{type:"graphic",graphic:o,layer:a,mapPoint:e}))}update(e){this._polygonsView&&this._polygonsView.processUpdate(e),this._polylinesView&&this._polylinesView.processUpdate(e),this._pointsView&&this._pointsView.processUpdate(e)}attach(){this._fetchController=new AbortController,this.container.addChild(this._mapImageContainer),this._polygonsView=new R({view:this.view,graphics:this.allVisiblePolygons,requestUpdateCallback:()=>this.requestUpdate(),container:new D(this.view.featuresTilingScheme)}),this.container.addChild(this._polygonsView.container),this._polylinesView=new R({view:this.view,graphics:this.allVisiblePolylines,requestUpdateCallback:()=>this.requestUpdate(),container:new D(this.view.featuresTilingScheme)}),this.container.addChild(this._polylinesView.container),this._pointsView=new R({view:this.view,graphics:this.allVisiblePoints,requestUpdateCallback:()=>this.requestUpdate(),container:new D(this.view.featuresTilingScheme)}),this.container.addChild(this._pointsView.container),this.handles.add([this.allVisibleMapImages.on("change",e=>{e.added.forEach(t=>this._addMapImage(t)),e.removed.forEach(t=>this._removeMapImage(t))}),F(()=>this.layer.visibleSublayers,e=>{for(const[t,a]of this._kmlVisualData.allSublayers)a.visibility=0;for(const t of e){const a=this._kmlVisualData.allSublayers.get(t.id);a&&(a.visibility=1)}this._refreshCollections()})]),this.updatingHandles.addPromise(this._fetchService(this._fetchController.signal)),this._imageReprojector=new p}detach(){this._fetchController.abort(),this._fetchController=null,this._mapImageContainer.removeAllChildren(),this.container.removeAllChildren(),this._bitmapIndex.clear(),this._polygonsView&&(this._polygonsView.destroy(),this._polygonsView=null),this._polylinesView&&(this._polylinesView.destroy(),this._polylinesView=null),this._pointsView&&(this._pointsView.destroy(),this._pointsView=null),this._imageReprojector&&(this._imageReprojector.destroy(),this._imageReprojector=null)}moveStart(){}viewChange(){this._polygonsView.viewChange(),this._polylinesView.viewChange(),this._pointsView.viewChange()}moveEnd(){}isUpdating(){return this._pointsView.updating||this._polygonsView.updating||this._polylinesView.updating}_addMapImage(e){(this.view.spatialReference.isWGS84||this.view.spatialReference.isWebMercator)&&this._imageReprojector.loadAndReprojectBitmapData(e.href,A.fromJSON(e.extent),this.view.spatialReference).then(t=>{const a=new it(t.bitmapData,{immutable:!1,requestRenderOnSourceChangedEnabled:!0});a.x=t.extent.xmin,a.y=t.extent.ymax,a.resolution=t.extent.width/t.bitmapData.width,a.rotation=e.rotation,this._mapImageContainer.addChild(a),this._bitmapIndex.set(e,a)})}async _getViewDependentUrl(e,t){const{viewFormat:a,viewBoundScale:r,httpQuery:i}=e;if(C(a)){if(W(t))throw new Error("Loading this network link requires a view state.");let s;if(await Y(),C(r)&&r!==1){const _=new A(t.extent);_.expand(r),s=_}else s=t.extent;s=P(s,L.WGS84);const o=P(s,L.WebMercator),m=s.xmin,h=s.xmax,n=s.ymin,c=s.ymax,b=t.size[0]*t.pixelRatio,w=t.size[1]*t.pixelRatio,y=Math.max(o.width,o.height),g={"[bboxWest]":m.toString(),"[bboxEast]":h.toString(),"[bboxSouth]":n.toString(),"[bboxNorth]":c.toString(),"[lookatLon]":s.center.x.toString(),"[lookatLat]":s.center.y.toString(),"[lookatRange]":y.toString(),"[lookatTilt]":"0","[lookatHeading]":t.rotation.toString(),"[lookatTerrainLon]":s.center.x.toString(),"[lookatTerrainLat]":s.center.y.toString(),"[lookatTerrainAlt]":"0","[cameraLon]":s.center.x.toString(),"[cameraLat]":s.center.y.toString(),"[cameraAlt]":y.toString(),"[horizFov]":"60","[vertFov]":"60","[horizPixels]":b.toString(),"[vertPixels]":w.toString(),"[terrainEnabled]":"0","[clientVersion]":H,"[kmlVersion]":"2.2","[clientName]":"ArcGIS API for JavaScript","[language]":"en-US"},l=_=>{for(const E in _)for(const k in g)_[E]=_[E].replace(k,g[k])},u=j(a);l(u);let V={};C(i)&&(V=j(i),l(V));const v=K(e.href);return v.query={...v.query,...u,...V},`${v.path}?${J(u)}`}return e.href}async _fetchService(e){const t=new O;await this._loadVisualData(this.layer.url,t,e),this._kmlVisualData=t,this._refreshCollections()}_refreshCollections(){this.allVisiblePoints.removeAll(),this.allVisiblePolylines.removeAll(),this.allVisiblePolygons.removeAll(),this.allVisibleMapImages.removeAll(),this.allVisiblePoints.addMany(this._kmlVisualData.allPoints.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisiblePolylines.addMany(this._kmlVisualData.allPolylines.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisiblePolygons.addMany(this._kmlVisualData.allPolygons.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisibleMapImages.addMany(this._kmlVisualData.allMapImages.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e))}_isSublayerVisible(e){const t=this._kmlVisualData.allSublayers.get(e);return!!t.visibility&&(t.parentFolderId===-1||this._isSublayerVisible(t.parentFolderId))}_loadVisualData(e,t,a){return this._fetchParsedKML(e,a).then(async r=>{for(const i of r.sublayers){t.allSublayers.set(i.id,i);const s=i.points?await I(i.points):[],o=i.polylines?await I(i.polylines):[],m=i.polygons?await I(i.polygons):[],h=i.mapImages||[];if(t.allPoints.push(...s.map(n=>({item:n,sublayerId:i.id}))),t.allPolylines.push(...o.map(n=>({item:n,sublayerId:i.id}))),t.allPolygons.push(...m.map(n=>({item:n,sublayerId:i.id}))),t.allMapImages.push(...h.map(n=>({item:n,sublayerId:i.id}))),i.networkLink){const n=await this._getViewDependentUrl(i.networkLink,this.view.state);await this._loadVisualData(n,t,a)}}})}_fetchParsedKML(e,t){return X(e,this.layer.spatialReference,this.layer.refreshInterval,t).then(a=>Z(a.data))}_removeMapImage(e){const t=this._bitmapIndex.get(e);t&&(this._mapImageContainer.removeChild(t),this._bitmapIndex.delete(e))}};x([f()],d.prototype,"_pointsView",void 0),x([f()],d.prototype,"_polylinesView",void 0),x([f()],d.prototype,"_polygonsView",void 0),x([f()],d.prototype,"updating",void 0),d=x([Q("esri.views.2d.layers.KMLLayerView2D")],d);const me=d;export{me as default}; +import{cI as P,af as U,U as $,dB as S,cE as z,_ as F,cU as A,c as C,j as W,dE as Y,aT as L,dO as H,dP as j,dQ as K,dR as J,a6 as x,a7 as f,a8 as Q}from"./index.221827cd.js";import{b as I,g as X,d as Z}from"./kmlUtils.3e458b80.js";import{S as tt,T as et,R as it}from"./Bitmap.72a3702e.js";import{a as at}from"./BitmapContainer.9e943f6d.js";import{y as st,u as rt}from"./LayerView.ce6e0535.js";import{i as D}from"./GraphicContainer.b0be80ad.js";import{o as R}from"./BaseGraphicContainer.7704bbc1.js";import{C as ot,$ as nt}from"./rasterProjectionHelper.f3c10be2.js";import{a as lt,e as ht}from"./WGLContainer.347cc5cd.js";import{y as pt,o as mt}from"./RenderingContext.8853f4cd.js";import{P as T,G as M,D as q,L as N,Y as ct,V as dt,f as B}from"./enums.2d9e6f64.js";import{x as gt}from"./VertexArrayObject.53cf1857.js";import{E as G}from"./Texture.940076b2.js";import"./utils.0160becb.js";import"./Utils.2136650a.js";import"./enums.0295eb81.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.0cadabc1.js";import"./ExpandedCIM.a372ce74.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.7ff797cc.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.3f71f8e9.js";import"./normalizeUtilsSync.4d52fbd0.js";import"./projectionSupport.4f5da4af.js";import"./json.879c9adc.js";import"./FeatureContainer.b427dd87.js";import"./TileContainer.5aeb32d6.js";import"./visualVariablesUtils.061b7a4e.js";import"./visualVariablesUtils.62efda9d.js";import"./Matcher.6586928a.js";import"./tileUtils.332711ed.js";import"./TileClipper.77103a2e.js";import"./Geometry.d049a63c.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./devEnvironmentUtils.d8d0484c.js";import"./schemaUtils.d20994fa.js";import"./createSymbolSchema.827eb617.js";import"./util.520a352e.js";import"./ComputedAttributeStorage.29767acd.js";import"./centroid.06db4b74.js";import"./vec3f32.1121a836.js";import"./pixelUtils.9c6f8dae.js";import"./ProgramTemplate.cf9dd4e8.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./programUtils.10ecfb8b.js";import"./OrderIndependentTransparency.4d1575c0.js";class p{constructor(t){if(t)this._ownsRctx=!1,this._rctx=t;else{if(p._instance)return p._instanceRefCount++,p._instance;p._instanceRefCount=1,p._instance=this,this._ownsRctx=!0;const i=document.createElement("canvas").getContext("webgl");i.getExtension("OES_texture_float"),this._rctx=new pt(i,{})}const a={applyProjection:!0,bilinear:!1,bicubic:!1},r=mt("raster/reproject","raster/reproject",new Map([["a_position",0]]),a);this._program=this._rctx.programCache.acquire(r.shaders.vertexShader,r.shaders.fragmentShader,r.attributes),this._rctx.useProgram(this._program),this._program.setUniform1f("u_opacity",1),this._program.setUniform1i("u_image",0),this._program.setUniform1i("u_flipY",0),this._program.setUniform1i("u_transformGrid",1),this._quad=new lt(this._rctx,[0,0,1,0,0,1,1,1])}reprojectTexture(t,a,r=!1){const i=P(t.extent,a),s=new U({x:(t.extent.xmax-t.extent.xmin)/t.texture.descriptor.width,y:(t.extent.ymax-t.extent.ymin)/t.texture.descriptor.height,spatialReference:t.extent.spatialReference}),{x:o,y:m}=ot(s,a,t.extent);let h=(o+m)/2;const n=Math.round((i.xmax-i.xmin)/h),c=Math.round((i.ymax-i.ymin)/h);h=(i.width/n+i.height/c)/2;const b=new U({x:h,y:h,spatialReference:i.spatialReference}),w=nt({projectedExtent:i,srcBufferExtent:t.extent,pixelSize:b,hasWrapAround:!0,spacing:[16,16]}),y=ht(this._rctx,w),g=new G(this._rctx,{width:n,height:c,pixelFormat:T.RGBA,dataType:M.UNSIGNED_BYTE,wrapMode:q.CLAMP_TO_EDGE,samplingMode:N.LINEAR,hasMipmap:!1}),l=new gt(this._rctx,{colorTarget:ct.TEXTURE,depthStencilTarget:dt.NONE,width:n,height:c},g);if(this._rctx.bindFramebuffer(l),this._rctx.setViewport(0,0,n,c),this._rctx.useProgram(this._program),this._rctx.bindTexture(t.texture,0),this._rctx.bindTexture(y,1),this._quad.bind(),this._program.setUniform2f("u_srcImageSize",t.texture.descriptor.width,t.texture.descriptor.height),this._program.setUniform2fv("u_transformSpacing",w.spacing),this._program.setUniform2fv("u_transformGridSize",w.size),this._program.setUniform2f("u_targetImageSize",n,c),this._quad.draw(),this._quad.unbind(),this._rctx.useProgram(null),this._rctx.bindFramebuffer(null),y.dispose(),r){const u=new ImageData(l.descriptor.width,l.descriptor.height);return l.readPixels(0,0,l.descriptor.width,l.descriptor.height,T.RGBA,M.UNSIGNED_BYTE,u.data),l.detachColorTexture(B.COLOR_ATTACHMENT0),l.dispose(),{texture:g,extent:i,imageData:u}}return l.detachColorTexture(B.COLOR_ATTACHMENT0),l.dispose(),{texture:g,extent:i}}reprojectBitmapData(t,a){const r=tt(t.bitmapData)?et(t.bitmapData):t.bitmapData,i=new G(this._rctx,{width:t.bitmapData.width,height:t.bitmapData.height,pixelFormat:T.RGBA,dataType:M.UNSIGNED_BYTE,wrapMode:q.CLAMP_TO_EDGE,samplingMode:N.LINEAR,hasMipmap:!1},r),s=this.reprojectTexture({texture:i,extent:t.extent},a,!0);s.texture.dispose();const o=document.createElement("canvas");return o.width=s.imageData.width,o.height=s.imageData.height,o.getContext("2d").putImageData(s.imageData,0,0),{bitmapData:o,extent:s.extent}}async loadAndReprojectBitmapData(t,a,r){const i=(await $(t,{responseType:"image"})).data,s=document.createElement("canvas");s.width=i.width,s.height=i.height;const o=s.getContext("2d");o.drawImage(i,0,0);const m=o.getImageData(0,0,s.width,s.height);if(a.spatialReference.equals(r))return{bitmapData:m,extent:a};const h=this.reprojectBitmapData({bitmapData:m,extent:a},r);return{bitmapData:h.bitmapData,extent:h.extent}}destroy(){this._ownsRctx?(p._instanceRefCount--,p._instanceRefCount===0&&(this._quad.dispose(),this._program.dispose(),this._rctx.dispose(),p._instance=null)):(this._quad.dispose(),this._program.dispose())}}p._instanceRefCount=0;class O{constructor(){this.allSublayers=new Map,this.allPoints=[],this.allPolylines=[],this.allPolygons=[],this.allMapImages=[]}}let d=class extends st(rt){constructor(){super(...arguments),this._bitmapIndex=new Map,this._mapImageContainer=new at,this._kmlVisualData=new O,this.allVisiblePoints=new S,this.allVisiblePolylines=new S,this.allVisiblePolygons=new S,this.allVisibleMapImages=new z}async hitTest(e,t){var r,i,s;const a=this.layer;return[(r=this._pointsView)==null?void 0:r.hitTest(e),(i=this._polylinesView)==null?void 0:i.hitTest(e),(s=this._polygonsView)==null?void 0:s.hitTest(e)].flat().filter(Boolean).map(o=>(o.layer=a,o.sourceLayer=a,{type:"graphic",graphic:o,layer:a,mapPoint:e}))}update(e){this._polygonsView&&this._polygonsView.processUpdate(e),this._polylinesView&&this._polylinesView.processUpdate(e),this._pointsView&&this._pointsView.processUpdate(e)}attach(){this._fetchController=new AbortController,this.container.addChild(this._mapImageContainer),this._polygonsView=new R({view:this.view,graphics:this.allVisiblePolygons,requestUpdateCallback:()=>this.requestUpdate(),container:new D(this.view.featuresTilingScheme)}),this.container.addChild(this._polygonsView.container),this._polylinesView=new R({view:this.view,graphics:this.allVisiblePolylines,requestUpdateCallback:()=>this.requestUpdate(),container:new D(this.view.featuresTilingScheme)}),this.container.addChild(this._polylinesView.container),this._pointsView=new R({view:this.view,graphics:this.allVisiblePoints,requestUpdateCallback:()=>this.requestUpdate(),container:new D(this.view.featuresTilingScheme)}),this.container.addChild(this._pointsView.container),this.handles.add([this.allVisibleMapImages.on("change",e=>{e.added.forEach(t=>this._addMapImage(t)),e.removed.forEach(t=>this._removeMapImage(t))}),F(()=>this.layer.visibleSublayers,e=>{for(const[t,a]of this._kmlVisualData.allSublayers)a.visibility=0;for(const t of e){const a=this._kmlVisualData.allSublayers.get(t.id);a&&(a.visibility=1)}this._refreshCollections()})]),this.updatingHandles.addPromise(this._fetchService(this._fetchController.signal)),this._imageReprojector=new p}detach(){this._fetchController.abort(),this._fetchController=null,this._mapImageContainer.removeAllChildren(),this.container.removeAllChildren(),this._bitmapIndex.clear(),this._polygonsView&&(this._polygonsView.destroy(),this._polygonsView=null),this._polylinesView&&(this._polylinesView.destroy(),this._polylinesView=null),this._pointsView&&(this._pointsView.destroy(),this._pointsView=null),this._imageReprojector&&(this._imageReprojector.destroy(),this._imageReprojector=null)}moveStart(){}viewChange(){this._polygonsView.viewChange(),this._polylinesView.viewChange(),this._pointsView.viewChange()}moveEnd(){}isUpdating(){return this._pointsView.updating||this._polygonsView.updating||this._polylinesView.updating}_addMapImage(e){(this.view.spatialReference.isWGS84||this.view.spatialReference.isWebMercator)&&this._imageReprojector.loadAndReprojectBitmapData(e.href,A.fromJSON(e.extent),this.view.spatialReference).then(t=>{const a=new it(t.bitmapData,{immutable:!1,requestRenderOnSourceChangedEnabled:!0});a.x=t.extent.xmin,a.y=t.extent.ymax,a.resolution=t.extent.width/t.bitmapData.width,a.rotation=e.rotation,this._mapImageContainer.addChild(a),this._bitmapIndex.set(e,a)})}async _getViewDependentUrl(e,t){const{viewFormat:a,viewBoundScale:r,httpQuery:i}=e;if(C(a)){if(W(t))throw new Error("Loading this network link requires a view state.");let s;if(await Y(),C(r)&&r!==1){const _=new A(t.extent);_.expand(r),s=_}else s=t.extent;s=P(s,L.WGS84);const o=P(s,L.WebMercator),m=s.xmin,h=s.xmax,n=s.ymin,c=s.ymax,b=t.size[0]*t.pixelRatio,w=t.size[1]*t.pixelRatio,y=Math.max(o.width,o.height),g={"[bboxWest]":m.toString(),"[bboxEast]":h.toString(),"[bboxSouth]":n.toString(),"[bboxNorth]":c.toString(),"[lookatLon]":s.center.x.toString(),"[lookatLat]":s.center.y.toString(),"[lookatRange]":y.toString(),"[lookatTilt]":"0","[lookatHeading]":t.rotation.toString(),"[lookatTerrainLon]":s.center.x.toString(),"[lookatTerrainLat]":s.center.y.toString(),"[lookatTerrainAlt]":"0","[cameraLon]":s.center.x.toString(),"[cameraLat]":s.center.y.toString(),"[cameraAlt]":y.toString(),"[horizFov]":"60","[vertFov]":"60","[horizPixels]":b.toString(),"[vertPixels]":w.toString(),"[terrainEnabled]":"0","[clientVersion]":H,"[kmlVersion]":"2.2","[clientName]":"ArcGIS API for JavaScript","[language]":"en-US"},l=_=>{for(const E in _)for(const k in g)_[E]=_[E].replace(k,g[k])},u=j(a);l(u);let V={};C(i)&&(V=j(i),l(V));const v=K(e.href);return v.query={...v.query,...u,...V},`${v.path}?${J(u)}`}return e.href}async _fetchService(e){const t=new O;await this._loadVisualData(this.layer.url,t,e),this._kmlVisualData=t,this._refreshCollections()}_refreshCollections(){this.allVisiblePoints.removeAll(),this.allVisiblePolylines.removeAll(),this.allVisiblePolygons.removeAll(),this.allVisibleMapImages.removeAll(),this.allVisiblePoints.addMany(this._kmlVisualData.allPoints.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisiblePolylines.addMany(this._kmlVisualData.allPolylines.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisiblePolygons.addMany(this._kmlVisualData.allPolygons.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e)),this.allVisibleMapImages.addMany(this._kmlVisualData.allMapImages.filter(e=>this._isSublayerVisible(e.sublayerId)).map(({item:e})=>e))}_isSublayerVisible(e){const t=this._kmlVisualData.allSublayers.get(e);return!!t.visibility&&(t.parentFolderId===-1||this._isSublayerVisible(t.parentFolderId))}_loadVisualData(e,t,a){return this._fetchParsedKML(e,a).then(async r=>{for(const i of r.sublayers){t.allSublayers.set(i.id,i);const s=i.points?await I(i.points):[],o=i.polylines?await I(i.polylines):[],m=i.polygons?await I(i.polygons):[],h=i.mapImages||[];if(t.allPoints.push(...s.map(n=>({item:n,sublayerId:i.id}))),t.allPolylines.push(...o.map(n=>({item:n,sublayerId:i.id}))),t.allPolygons.push(...m.map(n=>({item:n,sublayerId:i.id}))),t.allMapImages.push(...h.map(n=>({item:n,sublayerId:i.id}))),i.networkLink){const n=await this._getViewDependentUrl(i.networkLink,this.view.state);await this._loadVisualData(n,t,a)}}})}_fetchParsedKML(e,t){return X(e,this.layer.spatialReference,this.layer.refreshInterval,t).then(a=>Z(a.data))}_removeMapImage(e){const t=this._bitmapIndex.get(e);t&&(this._mapImageContainer.removeChild(t),this._bitmapIndex.delete(e))}};x([f()],d.prototype,"_pointsView",void 0),x([f()],d.prototype,"_polylinesView",void 0),x([f()],d.prototype,"_polygonsView",void 0),x([f()],d.prototype,"updating",void 0),d=x([Q("esri.views.2d.layers.KMLLayerView2D")],d);const me=d;export{me as default}; diff --git a/assets/LayerView.42d17220.js b/assets/LayerView.ce6e0535.js similarity index 98% rename from assets/LayerView.42d17220.js rename to assets/LayerView.ce6e0535.js index ebb7e24..6f2b7d9 100644 --- a/assets/LayerView.42d17220.js +++ b/assets/LayerView.ce6e0535.js @@ -1 +1 @@ -import{a6 as t,a7 as s,a8 as d,cx as q,c9 as A,cY as O,cU as x,az as I,cE as U,cZ as V,n as C,_ as y,c_ as h,c$ as j,a4 as N,aP as _,d0 as L,W as E,a9 as M,s as T,bd as P}from"./index.d94abe07.js";import{i as k}from"./utils.4b023c9d.js";let v=class extends q{get version(){return this.commitVersionProperties(),(this._get("version")||0)+1}};t([s({readOnly:!0})],v.prototype,"version",null),v=t([d("esri.views.layers.support.ClipArea")],v);const R=v;var w;let l=w=class extends R{constructor(e){super(e),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new w({left:this.left,right:this.right,top:this.top,bottom:this.bottom})}commitVersionProperties(){this.commitProperty("left"),this.commitProperty("right"),this.commitProperty("top"),this.commitProperty("bottom")}};t([s({type:[Number,String],json:{write:!0}})],l.prototype,"left",void 0),t([s({type:[Number,String],json:{write:!0}})],l.prototype,"right",void 0),t([s({type:[Number,String],json:{write:!0}})],l.prototype,"top",void 0),t([s({type:[Number,String],json:{write:!0}})],l.prototype,"bottom",void 0),l=w=t([d("esri.views.layers.support.ClipRect")],l);const z=l;var b;const D={base:O,key:"type",typeMap:{extent:x,polygon:I}};let g=b=class extends R{constructor(e){super(e),this.type="geometry",this.geometry=null}clone(){var e,r;return new b({geometry:(r=(e=this.geometry)==null?void 0:e.clone())!=null?r:null})}commitVersionProperties(){this.commitProperty("geometry")}};t([s({types:D,json:{read:A,write:!0}})],g.prototype,"geometry",void 0),g=b=t([d("esri.views.layers.support.Geometry")],g);const F=g;let m=class extends R{constructor(e){super(e),this.type="path",this.path=[]}commitVersionProperties(){this.commitProperty("path")}};t([s({type:[[[Number]]],json:{write:!0}})],m.prototype,"path",void 0),m=t([d("esri.views.layers.support.Path")],m);const H=m,f=U.ofType({key:"type",base:null,typeMap:{rect:z,path:H,geometry:F}}),W=e=>{let r=class extends e{constructor(){super(...arguments),this.attached=!1,this.clips=new f,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this.visibleAtCurrentScale=!1}initialize(){var p,c,S,$;const i=(c=(p=this.view)==null?void 0:p.spatialReferenceLocked)!=null?c:!0;((S=this.view)==null?void 0:S.spatialReference)&&i&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new C("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new k),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.handles.add([y(()=>this.suspended,a=>{this.container&&(this.container.visible=!a),this.view&&!a&&this.updateRequested&&this.view.requestUpdate()},h),y(()=>{var a,u;return(u=(a=this.layer)==null?void 0:a.opacity)!=null?u:1},a=>{this.container&&(this.container.opacity=a)},h),y(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",a=>{this.container&&(this.container.blendMode=a)},h),y(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,a=>{this.container&&(this.container.effect=a)},h),j(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)},h),y(()=>{var a;return{scale:(a=this.view)==null?void 0:a.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}},({scale:a})=>{const u=a&&this.isVisibleAtScale(a);u!==this.visibleAtCurrentScale&&this._set("visibleAtCurrentScale",u)},h)]),($=this.view)!=null&&$.whenLayerView?this.view.whenLayerView(this.layer).then(a=>{a===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach(),this.updateRequested=!1}get spatialReferenceSupported(){var o;const i=(o=this.view)==null?void 0:o.spatialReference;return i==null||this.supportsSpatialReference(i)}get updating(){var i;return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!!((i=this.updatingHandles)!=null&&i.updating))}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.detach(),this.updateRequested=!1)}isVisibleAtScale(i){const o=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;if(!o)return!0;const{minScale:p,maxScale:c}=o;return(p===0||i<=p)&&(c===0||i>=c)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.suspended||this.view.requestUpdate())}processUpdate(i){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",i),this.updateRequested&&!this.suspended&&(this.updateRequested=!1,this.update(i))):this.updateRequested=!1}hitTest(i,o){return Promise.resolve(null)}supportsSpatialReference(i){return!0}canResume(){return!!this.spatialReferenceSupported&&!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const i=super.getSuspendInfo(),o=!this.spatialReferenceSupported,p=this.visibleAtCurrentScale;return o&&(i.spatialReferenceNotSupported=o),p&&(i.outsideScaleRange=p),i}};return t([s()],r.prototype,"attached",void 0),t([s({type:f,set(i){const o=V(i,this._get("clips"),f);this._set("clips",o)}})],r.prototype,"clips",void 0),t([s()],r.prototype,"container",void 0),t([s()],r.prototype,"moving",void 0),t([s({readOnly:!0})],r.prototype,"spatialReferenceSupported",null),t([s({readOnly:!0})],r.prototype,"updateParameters",void 0),t([s()],r.prototype,"updateRequested",void 0),t([s()],r.prototype,"updating",null),t([s()],r.prototype,"view",void 0),t([s({readOnly:!0})],r.prototype,"visibleAtCurrentScale",void 0),r=t([d("esri.views.2d.layers.LayerView2D")],r),r};let n=class extends N(_(L(E.EventedMixin(M)))){constructor(e){super(e),this.layer=null,this.parent=null}initialize(){this.when().catch(e=>{if(e.name!=="layerview:create-error"){const r=this.layer&&this.layer.id||"no id",i=this.layer&&this.layer.title||"no title";T.getLogger(this.declaredClass).error("#resolve()",`Failed to resolve layer view (layer title: '${i}', id: '${r}')`,e)}})}get fullOpacity(){return P(this.get("layer.opacity"),1)*P(this.get("parent.fullOpacity"),1)}get suspended(){return!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){var e;return!this.suspended&&((e=this.layer)==null?void 0:e.legendEnabled)===!0}get updating(){var e;return!(!((e=this.updatingHandles)!=null&&e.updating)&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get visible(){var e;return((e=this.layer)==null?void 0:e.visible)===!0}set visible(e){this._overrideIfSome("visible",e)}canResume(){var e,r,i;return this.visible&&((e=this.layer)==null?void 0:e.loaded)&&!((r=this.parent)!=null&&r.suspended)&&((i=this.view)==null?void 0:i.ready)||!1}getSuspendInfo(){const e=this.parent&&this.parent.suspended?this.parent.suspendInfo:{},r=this;return r.view&&r.view.ready||(e.viewNotReady=!0),this.layer&&this.layer.loaded||(e.layerNotLoaded=!0),this.visible||(e.layerInvisible=!0),e}isUpdating(){return!1}};t([s()],n.prototype,"fullOpacity",null),t([s()],n.prototype,"layer",void 0),t([s()],n.prototype,"parent",void 0),t([s({readOnly:!0})],n.prototype,"suspended",null),t([s({readOnly:!0})],n.prototype,"suspendInfo",null),t([s({readOnly:!0})],n.prototype,"legendEnabled",null),t([s({type:Boolean,readOnly:!0})],n.prototype,"updating",null),t([s({readOnly:!0})],n.prototype,"updatingProgress",null),t([s()],n.prototype,"visible",null),t([s()],n.prototype,"view",void 0),n=t([d("esri.views.layers.LayerView")],n);const Y=n;export{Y as u,W as y}; +import{a6 as t,a7 as s,a8 as d,cx as q,c9 as A,cY as O,cU as x,az as I,cE as U,cZ as V,n as C,_ as y,c_ as h,c$ as j,a4 as N,aP as _,d0 as L,W as E,a9 as M,s as T,bd as P}from"./index.221827cd.js";import{i as k}from"./utils.0160becb.js";let v=class extends q{get version(){return this.commitVersionProperties(),(this._get("version")||0)+1}};t([s({readOnly:!0})],v.prototype,"version",null),v=t([d("esri.views.layers.support.ClipArea")],v);const R=v;var w;let l=w=class extends R{constructor(e){super(e),this.type="rect",this.left=null,this.right=null,this.top=null,this.bottom=null}clone(){return new w({left:this.left,right:this.right,top:this.top,bottom:this.bottom})}commitVersionProperties(){this.commitProperty("left"),this.commitProperty("right"),this.commitProperty("top"),this.commitProperty("bottom")}};t([s({type:[Number,String],json:{write:!0}})],l.prototype,"left",void 0),t([s({type:[Number,String],json:{write:!0}})],l.prototype,"right",void 0),t([s({type:[Number,String],json:{write:!0}})],l.prototype,"top",void 0),t([s({type:[Number,String],json:{write:!0}})],l.prototype,"bottom",void 0),l=w=t([d("esri.views.layers.support.ClipRect")],l);const z=l;var b;const D={base:O,key:"type",typeMap:{extent:x,polygon:I}};let g=b=class extends R{constructor(e){super(e),this.type="geometry",this.geometry=null}clone(){var e,r;return new b({geometry:(r=(e=this.geometry)==null?void 0:e.clone())!=null?r:null})}commitVersionProperties(){this.commitProperty("geometry")}};t([s({types:D,json:{read:A,write:!0}})],g.prototype,"geometry",void 0),g=b=t([d("esri.views.layers.support.Geometry")],g);const F=g;let m=class extends R{constructor(e){super(e),this.type="path",this.path=[]}commitVersionProperties(){this.commitProperty("path")}};t([s({type:[[[Number]]],json:{write:!0}})],m.prototype,"path",void 0),m=t([d("esri.views.layers.support.Path")],m);const H=m,f=U.ofType({key:"type",base:null,typeMap:{rect:z,path:H,geometry:F}}),W=e=>{let r=class extends e{constructor(){super(...arguments),this.attached=!1,this.clips=new f,this.lastUpdateId=-1,this.moving=!1,this.updateRequested=!1,this.visibleAtCurrentScale=!1}initialize(){var p,c,S,$;const i=(c=(p=this.view)==null?void 0:p.spatialReferenceLocked)!=null?c:!0;((S=this.view)==null?void 0:S.spatialReference)&&i&&!this.spatialReferenceSupported?this.addResolvingPromise(Promise.reject(new C("layerview:spatial-reference-incompatible","The spatial reference of this layer does not meet the requirements of the view",{layer:this.layer}))):(this.container||(this.container=new k),this.container.fadeTransitionEnabled=!0,this.container.visible=!1,this.container.endTransitions(),this.handles.add([y(()=>this.suspended,a=>{this.container&&(this.container.visible=!a),this.view&&!a&&this.updateRequested&&this.view.requestUpdate()},h),y(()=>{var a,u;return(u=(a=this.layer)==null?void 0:a.opacity)!=null?u:1},a=>{this.container&&(this.container.opacity=a)},h),y(()=>this.layer&&"blendMode"in this.layer?this.layer.blendMode:"normal",a=>{this.container&&(this.container.blendMode=a)},h),y(()=>this.layer&&"effect"in this.layer?this.layer.effect:null,a=>{this.container&&(this.container.effect=a)},h),j(()=>this.clips,"change",()=>{this.container&&(this.container.clips=this.clips)},h),y(()=>{var a;return{scale:(a=this.view)==null?void 0:a.scale,scaleRange:this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null}},({scale:a})=>{const u=a&&this.isVisibleAtScale(a);u!==this.visibleAtCurrentScale&&this._set("visibleAtCurrentScale",u)},h)]),($=this.view)!=null&&$.whenLayerView?this.view.whenLayerView(this.layer).then(a=>{a===this&&this.processAttach()},()=>{}):this.when().then(()=>{this.processAttach()},()=>{}))}destroy(){this.processDetach(),this.updateRequested=!1}get spatialReferenceSupported(){var o;const i=(o=this.view)==null?void 0:o.spatialReference;return i==null||this.supportsSpatialReference(i)}get updating(){var i;return this.spatialReferenceSupported&&(!this.attached||!this.suspended&&(this.updateRequested||this.isUpdating())||!!((i=this.updatingHandles)!=null&&i.updating))}processAttach(){this.isResolved()&&!this.attached&&!this.destroyed&&this.spatialReferenceSupported&&(this.attach(),this.attached=!0,this.requestUpdate())}processDetach(){this.attached&&(this.attached=!1,this.detach(),this.updateRequested=!1)}isVisibleAtScale(i){const o=this.layer&&"effectiveScaleRange"in this.layer?this.layer.effectiveScaleRange:null;if(!o)return!0;const{minScale:p,maxScale:c}=o;return(p===0||i<=p)&&(c===0||i>=c)}requestUpdate(){this.destroyed||this.updateRequested||(this.updateRequested=!0,this.suspended||this.view.requestUpdate())}processUpdate(i){!this.isFulfilled()||this.isResolved()?(this._set("updateParameters",i),this.updateRequested&&!this.suspended&&(this.updateRequested=!1,this.update(i))):this.updateRequested=!1}hitTest(i,o){return Promise.resolve(null)}supportsSpatialReference(i){return!0}canResume(){return!!this.spatialReferenceSupported&&!!super.canResume()&&this.visibleAtCurrentScale}getSuspendInfo(){const i=super.getSuspendInfo(),o=!this.spatialReferenceSupported,p=this.visibleAtCurrentScale;return o&&(i.spatialReferenceNotSupported=o),p&&(i.outsideScaleRange=p),i}};return t([s()],r.prototype,"attached",void 0),t([s({type:f,set(i){const o=V(i,this._get("clips"),f);this._set("clips",o)}})],r.prototype,"clips",void 0),t([s()],r.prototype,"container",void 0),t([s()],r.prototype,"moving",void 0),t([s({readOnly:!0})],r.prototype,"spatialReferenceSupported",null),t([s({readOnly:!0})],r.prototype,"updateParameters",void 0),t([s()],r.prototype,"updateRequested",void 0),t([s()],r.prototype,"updating",null),t([s()],r.prototype,"view",void 0),t([s({readOnly:!0})],r.prototype,"visibleAtCurrentScale",void 0),r=t([d("esri.views.2d.layers.LayerView2D")],r),r};let n=class extends N(_(L(E.EventedMixin(M)))){constructor(e){super(e),this.layer=null,this.parent=null}initialize(){this.when().catch(e=>{if(e.name!=="layerview:create-error"){const r=this.layer&&this.layer.id||"no id",i=this.layer&&this.layer.title||"no title";T.getLogger(this.declaredClass).error("#resolve()",`Failed to resolve layer view (layer title: '${i}', id: '${r}')`,e)}})}get fullOpacity(){return P(this.get("layer.opacity"),1)*P(this.get("parent.fullOpacity"),1)}get suspended(){return!this.canResume()}get suspendInfo(){return this.getSuspendInfo()}get legendEnabled(){var e;return!this.suspended&&((e=this.layer)==null?void 0:e.legendEnabled)===!0}get updating(){var e;return!(!((e=this.updatingHandles)!=null&&e.updating)&&!this.isUpdating())}get updatingProgress(){return this.updating?0:1}get visible(){var e;return((e=this.layer)==null?void 0:e.visible)===!0}set visible(e){this._overrideIfSome("visible",e)}canResume(){var e,r,i;return this.visible&&((e=this.layer)==null?void 0:e.loaded)&&!((r=this.parent)!=null&&r.suspended)&&((i=this.view)==null?void 0:i.ready)||!1}getSuspendInfo(){const e=this.parent&&this.parent.suspended?this.parent.suspendInfo:{},r=this;return r.view&&r.view.ready||(e.viewNotReady=!0),this.layer&&this.layer.loaded||(e.layerNotLoaded=!0),this.visible||(e.layerInvisible=!0),e}isUpdating(){return!1}};t([s()],n.prototype,"fullOpacity",null),t([s()],n.prototype,"layer",void 0),t([s()],n.prototype,"parent",void 0),t([s({readOnly:!0})],n.prototype,"suspended",null),t([s({readOnly:!0})],n.prototype,"suspendInfo",null),t([s({readOnly:!0})],n.prototype,"legendEnabled",null),t([s({type:Boolean,readOnly:!0})],n.prototype,"updating",null),t([s({readOnly:!0})],n.prototype,"updatingProgress",null),t([s()],n.prototype,"visible",null),t([s()],n.prototype,"view",void 0),n=t([d("esri.views.layers.LayerView")],n);const Y=n;export{Y as u,W as y}; diff --git a/assets/LercWorker.7426541e.js b/assets/LercWorker.089f2d60.js similarity index 98% rename from assets/LercWorker.7426541e.js rename to assets/LercWorker.089f2d60.js index b5b2edd..bf4acf4 100644 --- a/assets/LercWorker.7426541e.js +++ b/assets/LercWorker.089f2d60.js @@ -1 +1 @@ -import{gE as Y}from"./index.d94abe07.js";var A={};A.defaultNoDataValue=Y(-1/0),A.decode=function(i,t){var r=(t=t||{}).encodedMaskData||t.encodedMaskData===null,e=D(i,t.inputOffset||0,r),c=t.noDataValue!=null?Y(t.noDataValue):A.defaultNoDataValue,n=F(e,t.pixelType||Float32Array,t.encodedMaskData,c,t.returnMask),s={width:e.width,height:e.height,pixelData:n.resultPixels,minValue:e.pixels.minValue,maxValue:e.pixels.maxValue,noDataValue:c};return n.resultMask&&(s.maskData=n.resultMask),t.returnEncodedMask&&e.mask&&(s.encodedMaskData=e.mask.bitset?e.mask.bitset:null),t.returnFileInfo&&(s.fileInfo=b(e,c),t.computeUsedBitDepths&&(s.fileInfo.bitDepths=E(e))),s};var F=function(i,t,r,e,c){var n,s,d=0,m=i.pixels.numBlocksX,x=i.pixels.numBlocksY,y=Math.floor(i.width/m),v=Math.floor(i.height/x),p=2*i.maxZError;r=r||(i.mask?i.mask.bitset:null),n=new t(i.width*i.height),c&&r&&(s=new Uint8Array(i.width*i.height));for(var g,k,h=new Float32Array(y*v),M=0;M<=x;M++){var B=M!==x?v:i.height%x;if(B!==0)for(var I=0;I<=m;I++){var o=I!==m?y:i.width%m;if(o!==0){var P,a,f,w,l=M*i.width*v+I*y,U=i.width-o,u=i.pixels.blocks[d];if(u.encoding<2?(u.encoding===0?P=u.rawData:(S(u.stuffedData,u.bitsPerPixel,u.numValidPixels,u.offset,p,h,i.pixels.maxValue),P=h),a=0):f=u.encoding===2?0:u.offset,r)for(k=0;k>3],w<<=7&l),g=0;g>3]),128&w?(s&&(s[l]=1),n[l++]=u.encoding<2?P[a++]:f):(s&&(s[l]=0),n[l++]=e),w<<=1;l+=U}else if(u.encoding<2)for(k=0;k0){var s=new Uint8Array(Math.ceil(e.width*e.height/8)),d=(n=new DataView(i,t,e.mask.numBytes)).getInt16(0,!0),m=2,x=0;do{if(d>0)for(;d--;)s[x++]=n.getUint8(m++);else{var y=n.getUint8(m++);for(d=-d;d--;)s[x++]=y}d=n.getInt16(m,!0),m+=2}while(m0?1:0),k=p+(e.height%p>0?1:0);e.pixels.blocks=new Array(g*k);for(var h=1e9,M=0,B=0;B3)throw"Invalid block encoding ("+a.encoding+")";if(a.encoding!==2){if(f!==0&&f!==2){if(f>>=6,a.offsetType=f,f===2)a.offset=n.getInt8(1),o++;else if(f===1)a.offset=n.getInt16(1,!0),o+=2;else{if(f!==0)throw"Invalid block offset type";a.offset=n.getFloat32(1,!0),o+=4}if(h=Math.min(a.offset,h),a.encoding===1)if(f=n.getUint8(o),o++,a.bitsPerPixel=63&f,f>>=6,a.numValidPixelsType=f,f===2)a.numValidPixels=n.getUint8(o),o++;else if(f===1)a.numValidPixels=n.getUint16(o,!0),o+=2;else{if(f!==0)throw"Invalid valid pixel count type";a.numValidPixels=n.getUint32(o,!0),o+=4}}var w;if(t+=o,a.encoding!=3){if(a.encoding===0){var l=(e.pixels.numBytes-1)/4;if(l!==Math.floor(l))throw"uncompressed block has invalid length";w=new ArrayBuffer(4*l),new Uint8Array(w).set(new Uint8Array(i,t,4*l));for(var U=new Float32Array(w),u=0;u=t)m=x>>>p-t&y,p-=t;else{var h=t-p;m=(x&y)<>>(p=32-h)}n[d]=m>3],w<<=7&l),g=0;g>3]),128&w?(s&&(s[l]=1),n[l++]=u.encoding<2?P[a++]:f):(s&&(s[l]=0),n[l++]=e),w<<=1;l+=U}else if(u.encoding<2)for(k=0;k0){var s=new Uint8Array(Math.ceil(e.width*e.height/8)),d=(n=new DataView(i,t,e.mask.numBytes)).getInt16(0,!0),m=2,x=0;do{if(d>0)for(;d--;)s[x++]=n.getUint8(m++);else{var y=n.getUint8(m++);for(d=-d;d--;)s[x++]=y}d=n.getInt16(m,!0),m+=2}while(m0?1:0),k=p+(e.height%p>0?1:0);e.pixels.blocks=new Array(g*k);for(var h=1e9,M=0,B=0;B3)throw"Invalid block encoding ("+a.encoding+")";if(a.encoding!==2){if(f!==0&&f!==2){if(f>>=6,a.offsetType=f,f===2)a.offset=n.getInt8(1),o++;else if(f===1)a.offset=n.getInt16(1,!0),o+=2;else{if(f!==0)throw"Invalid block offset type";a.offset=n.getFloat32(1,!0),o+=4}if(h=Math.min(a.offset,h),a.encoding===1)if(f=n.getUint8(o),o++,a.bitsPerPixel=63&f,f>>=6,a.numValidPixelsType=f,f===2)a.numValidPixels=n.getUint8(o),o++;else if(f===1)a.numValidPixels=n.getUint16(o,!0),o+=2;else{if(f!==0)throw"Invalid valid pixel count type";a.numValidPixels=n.getUint32(o,!0),o+=4}}var w;if(t+=o,a.encoding!=3){if(a.encoding===0){var l=(e.pixels.numBytes-1)/4;if(l!==Math.floor(l))throw"uncompressed block has invalid length";w=new ArrayBuffer(4*l),new Uint8Array(w).set(new Uint8Array(i,t,4*l));for(var U=new Float32Array(w),u=0;u=t)m=x>>>p-t&y,p-=t;else{var h=t-p;m=(x&y)<>>(p=32-h)}n[d]=mthis._computeExtent(),e=>{(l(e)||l(e.pending))&&this._set("extent",n(e)?e.extent:null)},L))}get targets(){return this._get("targets")||new v}set targets(e){this._set("targets",F(e,this.targets,v))}get spatialReference(){return n(this.observer)&&n(this.observer.position)?this.observer.position.spatialReference:null}get requiredPropertiesForEditing(){return[b(this.observer,e=>e.position)]}async waitComputeExtent(){const e=this._computeExtent();return n(e)?z(e.pending):null}_computeExtent(){const e=this.spatialReference;if(l(this.observer)||l(this.observer.position)||l(e))return null;const s=y=>Y(y.position,y.elevationInfo)==="absolute-height",r=this.observer.position,j=M(r.x,r.y,r.z,r.x,r.y,r.z);for(const y of this.targets)if(n(y.position)){const d=k(y.position,e);if(n(d.pending))return{pending:d.pending,extent:null};if(n(d.geometry)){const{x:A,y:T,z:N}=d.geometry;B(j,[A,T,N])}}const g=D(j,e);return s(this.observer)&&this.targets.every(s)||(g.zmin=null,g.zmax=null),{pending:null,extent:g}}clear(){this.observer=null,this.targets.removeAll()}};t([i({type:["line-of-sight"]})],a.prototype,"type",void 0),t([i({type:_,json:{read:!0,write:!0}})],a.prototype,"observer",void 0),t([i({cast:C,type:v,nonNullable:!0,json:{read:!0,write:!0}})],a.prototype,"targets",null),t([i({value:null,readOnly:!0})],a.prototype,"extent",void 0),t([i({readOnly:!0})],a.prototype,"spatialReference",null),t([i({readOnly:!0})],a.prototype,"requiredPropertiesForEditing",null),a=t([f("esri.analysis.LineOfSightAnalysis")],a);const I=a,se=m.ofType(q);let o=class extends G(J(K)){constructor(e){super(e),this.type="line-of-sight",this.operationalLayerType="LineOfSightLayer",this.analysis=new I,this.opacity=1}initialize(){this.addHandles(E(()=>this.analysis,(e,s)=>{n(s)&&s.parent===this&&(s.parent=null),n(e)&&(e.parent=this)},L))}async load(){return n(this.analysis)&&this.addResolvingPromise(this.analysis.waitComputeExtent()),this}get observer(){return b(this.analysis,e=>e.observer)}set observer(e){b(this.analysis,s=>s.observer=e)}get targets(){return n(this.analysis)?this.analysis.targets:new m}set targets(e){var s;F(e,(s=this.analysis)==null?void 0:s.targets)}get fullExtent(){return n(this.analysis)?this.analysis.extent:null}get spatialReference(){return n(this.analysis)?z(this.analysis.spatialReference):null}releaseAnalysis(e){this.analysis===e&&(this.analysis=new I)}};t([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),t([i({type:["LineOfSightLayer"]})],o.prototype,"operationalLayerType",void 0),t([i({type:_,json:{read:!0,write:{ignoreOrigin:!0}}})],o.prototype,"observer",null),t([i({type:se,json:{read:!0,write:{ignoreOrigin:!0}}})],o.prototype,"targets",null),t([i({nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"analysis",void 0),t([i({readOnly:!0})],o.prototype,"fullExtent",null),t([i({readOnly:!0})],o.prototype,"spatialReference",null),t([i({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],o.prototype,"opacity",void 0),t([i({type:["show","hide"]})],o.prototype,"listMode",void 0),o=t([f("esri.layers.LineOfSightLayer")],o);const ae=o;export{ae as default}; +import{j as l,iy as x,eg as H,jo as c,a6 as t,a7 as i,af as w,gw as O,a8 as f,a9 as P,iz as Z,c as n,cE as m,dy as C,_ as E,c_ as L,cZ as F,bc as b,u as z,jp as M,e9 as k,jq as B,jr as D,eF as G,eH as J,cF as K}from"./index.221827cd.js";import{c as Q}from"./Analysis.db10ad10.js";import{g as h}from"./persistable.6b292e5e.js";import"./multiOriginJSONSupportUtils.38b69b9c.js";function R(e,s){return $(e)===$(s)}function $(e){if(l(e))return null;const s=e.layer!=null?e.layer.id:"";let r=null;return r=e.objectId!=null?e.objectId:e.layer!=null&&"objectIdField"in e.layer&&e.layer.objectIdField!=null&&e.attributes!=null?e.attributes[e.layer.objectIdField]:e.uid,r==null?null:`o-${s}-${r}`}const S={json:{write:{writer:U,target:{"feature.layerId":{type:[Number,String]},"feature.objectId":{type:[Number,String]}}},origins:{"web-scene":{read:V}}}};function U(e,s){var r;l(e)||((r=e.layer)==null?void 0:r.objectIdField)==null||e.attributes==null||(s.feature={layerId:e.layer.id,objectId:e.attributes[e.layer.objectIdField]})}function V(e){if(e.layerId!=null&&e.objectId!=null)return{uid:null,layer:{id:e.layerId,objectIdField:"ObjectId"},attributes:{ObjectId:e.objectId}}}let u=class extends x(H(P)){constructor(e){super(e),this.position=null,this.elevationInfo=null,this.feature=null}equals(e){return c(this.position,e.position)&&c(this.elevationInfo,e.elevationInfo)&&R(this.feature,e.feature)}};t([i({type:w}),h()],u.prototype,"position",void 0),t([i({type:O}),h()],u.prototype,"elevationInfo",void 0),t([i(S)],u.prototype,"feature",void 0),u=t([f("esri.analysis.LineOfSightAnalysisObserver")],u);const _=u;let p=class extends x(Z){constructor(e){super(e),this.position=null,this.elevationInfo=null,this.feature=null}equals(e){return c(this.position,e.position)&&c(this.elevationInfo,e.elevationInfo)&&R(this.feature,e.feature)}};t([i({type:w}),h()],p.prototype,"position",void 0),t([i({type:O}),h()],p.prototype,"elevationInfo",void 0),t([i(S)],p.prototype,"feature",void 0),p=t([f("esri.analysis.LineOfSightAnalysisTarget")],p);const q=p;function W(e){return e?ee:te}function X(e,s){return l(s)||!s.mode?W(e).mode:s.mode}function Y(e,s){return X(!!n(e)&&e.hasZ,s)}const ee={mode:"absolute-height",offset:0},te={mode:"on-the-ground",offset:null},v=m.ofType(q);let a=class extends Q{constructor(e){super(e),this.type="line-of-sight",this.observer=null,this.extent=null}initialize(){this.addHandles(E(()=>this._computeExtent(),e=>{(l(e)||l(e.pending))&&this._set("extent",n(e)?e.extent:null)},L))}get targets(){return this._get("targets")||new v}set targets(e){this._set("targets",F(e,this.targets,v))}get spatialReference(){return n(this.observer)&&n(this.observer.position)?this.observer.position.spatialReference:null}get requiredPropertiesForEditing(){return[b(this.observer,e=>e.position)]}async waitComputeExtent(){const e=this._computeExtent();return n(e)?z(e.pending):null}_computeExtent(){const e=this.spatialReference;if(l(this.observer)||l(this.observer.position)||l(e))return null;const s=y=>Y(y.position,y.elevationInfo)==="absolute-height",r=this.observer.position,j=M(r.x,r.y,r.z,r.x,r.y,r.z);for(const y of this.targets)if(n(y.position)){const d=k(y.position,e);if(n(d.pending))return{pending:d.pending,extent:null};if(n(d.geometry)){const{x:A,y:T,z:N}=d.geometry;B(j,[A,T,N])}}const g=D(j,e);return s(this.observer)&&this.targets.every(s)||(g.zmin=null,g.zmax=null),{pending:null,extent:g}}clear(){this.observer=null,this.targets.removeAll()}};t([i({type:["line-of-sight"]})],a.prototype,"type",void 0),t([i({type:_,json:{read:!0,write:!0}})],a.prototype,"observer",void 0),t([i({cast:C,type:v,nonNullable:!0,json:{read:!0,write:!0}})],a.prototype,"targets",null),t([i({value:null,readOnly:!0})],a.prototype,"extent",void 0),t([i({readOnly:!0})],a.prototype,"spatialReference",null),t([i({readOnly:!0})],a.prototype,"requiredPropertiesForEditing",null),a=t([f("esri.analysis.LineOfSightAnalysis")],a);const I=a,se=m.ofType(q);let o=class extends G(J(K)){constructor(e){super(e),this.type="line-of-sight",this.operationalLayerType="LineOfSightLayer",this.analysis=new I,this.opacity=1}initialize(){this.addHandles(E(()=>this.analysis,(e,s)=>{n(s)&&s.parent===this&&(s.parent=null),n(e)&&(e.parent=this)},L))}async load(){return n(this.analysis)&&this.addResolvingPromise(this.analysis.waitComputeExtent()),this}get observer(){return b(this.analysis,e=>e.observer)}set observer(e){b(this.analysis,s=>s.observer=e)}get targets(){return n(this.analysis)?this.analysis.targets:new m}set targets(e){var s;F(e,(s=this.analysis)==null?void 0:s.targets)}get fullExtent(){return n(this.analysis)?this.analysis.extent:null}get spatialReference(){return n(this.analysis)?z(this.analysis.spatialReference):null}releaseAnalysis(e){this.analysis===e&&(this.analysis=new I)}};t([i({json:{read:!1},readOnly:!0})],o.prototype,"type",void 0),t([i({type:["LineOfSightLayer"]})],o.prototype,"operationalLayerType",void 0),t([i({type:_,json:{read:!0,write:{ignoreOrigin:!0}}})],o.prototype,"observer",null),t([i({type:se,json:{read:!0,write:{ignoreOrigin:!0}}})],o.prototype,"targets",null),t([i({nonNullable:!0,json:{read:!1,write:!1}})],o.prototype,"analysis",void 0),t([i({readOnly:!0})],o.prototype,"fullExtent",null),t([i({readOnly:!0})],o.prototype,"spatialReference",null),t([i({readOnly:!0,json:{read:!1,write:!1,origins:{service:{read:!1,write:!1},"portal-item":{read:!1,write:!1},"web-document":{read:!1,write:!1}}}})],o.prototype,"opacity",void 0),t([i({type:["show","hide"]})],o.prototype,"listMode",void 0),o=t([f("esri.layers.LineOfSightLayer")],o);const ae=o;export{ae as default}; diff --git a/assets/MapImageLayer.817bf3c0.js b/assets/MapImageLayer.09c43a61.js similarity index 95% rename from assets/MapImageLayer.817bf3c0.js rename to assets/MapImageLayer.09c43a61.js index 9230f18..7d3edc2 100644 --- a/assets/MapImageLayer.817bf3c0.js +++ b/assets/MapImageLayer.09c43a61.js @@ -1 +1 @@ -import{i2 as S,iM as w,i3 as I,eE as O,eF as $,eG as E,eH as M,ia as T,il as F,iJ as L,a4 as P,c as U,aU as j,jh as v,e8 as g,U as f,cU as J,d_ as N,i8 as R,i_ as q,n as b,x as _,a6 as s,a7 as n,d2 as A,e0 as k,eK as z,a8 as V,cF as B,h0 as G}from"./index.d94abe07.js";import{i as H}from"./scaleUtils.467c71f9.js";import{E as K,y as C,z as D}from"./SublayersOwner.8a52d000.js";import{c as W}from"./ExportImageParameters.0ebe2d44.js";import{n as x}from"./sublayerUtils.9d6cbcc3.js";import"./Version.59f2da65.js";import"./floorFilterUtils.05eb8c6a.js";let i=class extends S(w(I(K(C(O($(E(M(T(F(L(P(B))))))))))))){constructor(...e){super(...e),this.datesInUnknownTimezone=!1,this.dpi=96,this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}load(e){const r=U(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(j).then(()=>this._fetchService(r))),Promise.resolve(this)}readImageFormat(e,r){const p=r.supportedImageFormatTypes;return p&&p.includes("PNG32")?"png32":"png24"}writeSublayers(e,r,p,t){if(!this.loaded||!e)return;const o=e.slice().reverse().flatten(({sublayers:a})=>a&&a.toArray().reverse()).toArray();let l=!1;if(this.capabilities&&this.capabilities.operations.supportsExportMap&&this.capabilities.exportMap.supportsDynamicLayers){const a=v(t.origin);if(a===g.PORTAL_ITEM){const m=this.createSublayersForOrigin("service").sublayers;l=x(o,m,g.SERVICE)}else if(a>g.PORTAL_ITEM){const m=this.createSublayersForOrigin("portal-item");l=x(o,m.sublayers,v(m.origin))}}const c=[],y={writeSublayerStructure:l,...t};let h=l;o.forEach(a=>{const m=a.write({},y);c.push(m),h=h||a.originOf("visible")==="user"}),c.some(a=>Object.keys(a).length>1)&&(r.layers=c),h&&(r.visibleLayers=o.filter(a=>a.visible).map(a=>a.id))}createExportImageParameters(e,r,p,t){const o=t&&t.pixelRatio||1;e&&this.version>=10&&(e=e.clone().shiftCentralMeridian());const l=new W({layer:this,floors:t==null?void 0:t.floors,scale:H({extent:e,width:r})*o}),c=l.toJSON();l.destroy();const y=!t||!t.rotation||this.version<10.3?{}:{rotation:-t.rotation},h=e&&e.spatialReference,a=h.wkid||JSON.stringify(h.toJSON());c.dpi*=o;const m={};if(t!=null&&t.timeExtent){const{start:u,end:d}=t.timeExtent.toJSON();m.time=u&&d&&u===d?""+u:`${u!=null?u:"null"},${d!=null?d:"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(m.time="null,null");return{bbox:e&&e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:a,imageSR:a,size:r+","+p,...c,...y,...m}}async fetchImage(e,r,p,t){return this._fetchImage("image",e,r,p,t)}async fetchImageBitmap(e,r,p,t){const o=await this._fetchImage("blob",e,r,p,t);return createImageBitmap(o)}async fetchRecomputedExtents(e={}){const r={...e,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:p}=await f(this.url,r),{extent:t,fullExtent:o,timeExtent:l}=p,c=t||o;return{fullExtent:c&&J.fromJSON(c),timeExtent:l&&N.fromJSON({start:l[0],end:l[1]})}}loadAll(){return R(this,e=>{e(this.allSublayers)})}serviceSupportsSpatialReference(e){return q(this,e)}async _fetchImage(e,r,p,t,o){var y;const l={responseType:e,signal:(y=o==null?void 0:o.signal)!=null?y:null,query:{...this.parsedUrl.query,...this.createExportImageParameters(r,p,t,o),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},c=this.parsedUrl.path+"/export";if(l.query.dynamicLayers!=null&&!this.capabilities.exportMap.supportsDynamicLayers)throw new b("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:l.query});try{const{data:h}=await f(c,l);return h}catch(h){throw _(h)?h:new b("mapimagelayer:image-fetch-error",`Unable to load image: ${c}`,{error:h})}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:r,ssl:p}=await f(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:e});p&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=r,this.read(r,{origin:"service",url:this.parsedUrl})}};s([n({type:Boolean})],i.prototype,"datesInUnknownTimezone",void 0),s([n()],i.prototype,"dpi",void 0),s([n()],i.prototype,"gdbVersion",void 0),s([n()],i.prototype,"imageFormat",void 0),s([A("imageFormat",["supportedImageFormatTypes"])],i.prototype,"readImageFormat",null),s([n({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],i.prototype,"imageMaxHeight",void 0),s([n({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],i.prototype,"imageMaxWidth",void 0),s([n()],i.prototype,"imageTransparency",void 0),s([n({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],i.prototype,"isReference",void 0),s([n({json:{read:!1,write:!1}})],i.prototype,"labelsVisible",void 0),s([n({type:["ArcGISMapServiceLayer"]})],i.prototype,"operationalLayerType",void 0),s([n({json:{read:!1,write:!1}})],i.prototype,"popupEnabled",void 0),s([n()],i.prototype,"sourceJSON",void 0),s([n({json:{write:{ignoreOrigin:!0}}})],i.prototype,"sublayers",void 0),s([k("sublayers",{layers:{type:[D]},visibleLayers:{type:[G]}})],i.prototype,"writeSublayers",null),s([n({type:["show","hide","hide-children"]})],i.prototype,"listMode",void 0),s([n({json:{read:!1},readOnly:!0,value:"map-image"})],i.prototype,"type",void 0),s([n(z)],i.prototype,"url",void 0),i=s([V("esri.layers.MapImageLayer")],i);const ie=i;export{ie as default}; +import{i2 as S,iM as w,i3 as I,eE as O,eF as $,eG as E,eH as M,ia as T,il as F,iJ as L,a4 as P,c as U,aU as j,jh as v,e8 as g,U as f,cU as J,d_ as N,i8 as R,i_ as q,n as b,x as _,a6 as s,a7 as n,d2 as A,e0 as k,eK as z,a8 as V,cF as B,h0 as G}from"./index.221827cd.js";import{i as H}from"./scaleUtils.de5ad5a6.js";import{E as K,y as C,z as D}from"./SublayersOwner.fd9e3967.js";import{c as W}from"./ExportImageParameters.65ee285f.js";import{n as x}from"./sublayerUtils.59f5d9da.js";import"./Version.433fbe58.js";import"./floorFilterUtils.05eb8c6a.js";let i=class extends S(w(I(K(C(O($(E(M(T(F(L(P(B))))))))))))){constructor(...e){super(...e),this.datesInUnknownTimezone=!1,this.dpi=96,this.gdbVersion=null,this.imageFormat="png24",this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.isReference=null,this.labelsVisible=!1,this.operationalLayerType="ArcGISMapServiceLayer",this.sourceJSON=null,this.sublayers=null,this.type="map-image",this.url=null}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}load(e){const r=U(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(j).then(()=>this._fetchService(r))),Promise.resolve(this)}readImageFormat(e,r){const p=r.supportedImageFormatTypes;return p&&p.includes("PNG32")?"png32":"png24"}writeSublayers(e,r,p,t){if(!this.loaded||!e)return;const o=e.slice().reverse().flatten(({sublayers:a})=>a&&a.toArray().reverse()).toArray();let l=!1;if(this.capabilities&&this.capabilities.operations.supportsExportMap&&this.capabilities.exportMap.supportsDynamicLayers){const a=v(t.origin);if(a===g.PORTAL_ITEM){const m=this.createSublayersForOrigin("service").sublayers;l=x(o,m,g.SERVICE)}else if(a>g.PORTAL_ITEM){const m=this.createSublayersForOrigin("portal-item");l=x(o,m.sublayers,v(m.origin))}}const c=[],y={writeSublayerStructure:l,...t};let h=l;o.forEach(a=>{const m=a.write({},y);c.push(m),h=h||a.originOf("visible")==="user"}),c.some(a=>Object.keys(a).length>1)&&(r.layers=c),h&&(r.visibleLayers=o.filter(a=>a.visible).map(a=>a.id))}createExportImageParameters(e,r,p,t){const o=t&&t.pixelRatio||1;e&&this.version>=10&&(e=e.clone().shiftCentralMeridian());const l=new W({layer:this,floors:t==null?void 0:t.floors,scale:H({extent:e,width:r})*o}),c=l.toJSON();l.destroy();const y=!t||!t.rotation||this.version<10.3?{}:{rotation:-t.rotation},h=e&&e.spatialReference,a=h.wkid||JSON.stringify(h.toJSON());c.dpi*=o;const m={};if(t!=null&&t.timeExtent){const{start:u,end:d}=t.timeExtent.toJSON();m.time=u&&d&&u===d?""+u:`${u!=null?u:"null"},${d!=null?d:"null"}`}else this.timeInfo&&!this.timeInfo.hasLiveData&&(m.time="null,null");return{bbox:e&&e.xmin+","+e.ymin+","+e.xmax+","+e.ymax,bboxSR:a,imageSR:a,size:r+","+p,...c,...y,...m}}async fetchImage(e,r,p,t){return this._fetchImage("image",e,r,p,t)}async fetchImageBitmap(e,r,p,t){const o=await this._fetchImage("blob",e,r,p,t);return createImageBitmap(o)}async fetchRecomputedExtents(e={}){const r={...e,query:{returnUpdates:!0,f:"json",...this.customParameters,token:this.apiKey}},{data:p}=await f(this.url,r),{extent:t,fullExtent:o,timeExtent:l}=p,c=t||o;return{fullExtent:c&&J.fromJSON(c),timeExtent:l&&N.fromJSON({start:l[0],end:l[1]})}}loadAll(){return R(this,e=>{e(this.allSublayers)})}serviceSupportsSpatialReference(e){return q(this,e)}async _fetchImage(e,r,p,t,o){var y;const l={responseType:e,signal:(y=o==null?void 0:o.signal)!=null?y:null,query:{...this.parsedUrl.query,...this.createExportImageParameters(r,p,t,o),f:"image",...this.refreshParameters,...this.customParameters,token:this.apiKey}},c=this.parsedUrl.path+"/export";if(l.query.dynamicLayers!=null&&!this.capabilities.exportMap.supportsDynamicLayers)throw new b("mapimagelayer:dynamiclayer-not-supported",`service ${this.url} doesn't support dynamic layers, which is required to be able to change the sublayer's order, rendering, labeling or source.`,{query:l.query});try{const{data:h}=await f(c,l);return h}catch(h){throw _(h)?h:new b("mapimagelayer:image-fetch-error",`Unable to load image: ${c}`,{error:h})}}async _fetchService(e){if(this.sourceJSON)return void this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl});const{data:r,ssl:p}=await f(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},signal:e});p&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=r,this.read(r,{origin:"service",url:this.parsedUrl})}};s([n({type:Boolean})],i.prototype,"datesInUnknownTimezone",void 0),s([n()],i.prototype,"dpi",void 0),s([n()],i.prototype,"gdbVersion",void 0),s([n()],i.prototype,"imageFormat",void 0),s([A("imageFormat",["supportedImageFormatTypes"])],i.prototype,"readImageFormat",null),s([n({json:{origins:{service:{read:{source:"maxImageHeight"}}}}})],i.prototype,"imageMaxHeight",void 0),s([n({json:{origins:{service:{read:{source:"maxImageWidth"}}}}})],i.prototype,"imageMaxWidth",void 0),s([n()],i.prototype,"imageTransparency",void 0),s([n({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],i.prototype,"isReference",void 0),s([n({json:{read:!1,write:!1}})],i.prototype,"labelsVisible",void 0),s([n({type:["ArcGISMapServiceLayer"]})],i.prototype,"operationalLayerType",void 0),s([n({json:{read:!1,write:!1}})],i.prototype,"popupEnabled",void 0),s([n()],i.prototype,"sourceJSON",void 0),s([n({json:{write:{ignoreOrigin:!0}}})],i.prototype,"sublayers",void 0),s([k("sublayers",{layers:{type:[D]},visibleLayers:{type:[G]}})],i.prototype,"writeSublayers",null),s([n({type:["show","hide","hide-children"]})],i.prototype,"listMode",void 0),s([n({json:{read:!1},readOnly:!0,value:"map-image"})],i.prototype,"type",void 0),s([n(z)],i.prototype,"url",void 0),i=s([V("esri.layers.MapImageLayer")],i);const ie=i;export{ie as default}; diff --git a/assets/MapImageLayerView2D.af3159c8.js b/assets/MapImageLayerView2D.de2fd653.js similarity index 88% rename from assets/MapImageLayerView2D.af3159c8.js rename to assets/MapImageLayerView2D.de2fd653.js index 7c7b28b..b794f91 100644 --- a/assets/MapImageLayerView2D.af3159c8.js +++ b/assets/MapImageLayerView2D.de2fd653.js @@ -1 +1 @@ -import{c as P,aA as k,c4 as z,a6 as n,a7 as h,dZ as D,c9 as Z,cU as L,aT as W,d_ as K,a8 as F,cx as q,d$ as X,d1 as O,d2 as Y,e0 as ee,e1 as te,dQ as re,e2 as ie,e3 as se,e4 as oe,U as ae,da as ne,dB as le,dn as pe,c$ as he,n as G,at as ue,e5 as ye,e6 as me,cq as de,j as ce,m as fe,cB as ge,de as we,x as ve,s as xe,_ as A,cE as be}from"./index.d94abe07.js";import{a as $e}from"./BitmapContainer.3274be0c.js";import{y as _e,u as Ie}from"./LayerView.42d17220.js";import{o as Ee}from"./BaseGraphicContainer.6b1c597d.js";import{n as Se}from"./HighlightGraphicContainer.9bc65ba9.js";import{v as Pe}from"./ExportStrategy.e65233e4.js";import{i as Re,r as Fe}from"./scaleUtils.467c71f9.js";import{c as je}from"./ExportImageParameters.0ebe2d44.js";import{n as U}from"./floorFilterUtils.05eb8c6a.js";import{s as T,a as Ne}from"./drapedUtils.e64c9295.js";import{i as Oe}from"./sublayerUtils.9d6cbcc3.js";import{d as Ue,s as Ve}from"./popupUtils.4abb3ffd.js";import{i as Ge}from"./RefreshableLayerView.28a00159.js";import"./WGLContainer.1850619d.js";import"./enums.2d9e6f64.js";import"./pixelUtils.82950e1a.js";import"./utils.4b023c9d.js";import"./Utils.7f6f3a6b.js";import"./enums.0295eb81.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.229b1dd6.js";import"./VertexArrayObject.a4c1d809.js";import"./ProgramTemplate.e9a5aa54.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./ExpandedCIM.f0b7f36d.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.0d428d19.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.df11258c.js";import"./normalizeUtilsSync.757b5fd1.js";import"./projectionSupport.0542c13b.js";import"./json.879c9adc.js";import"./FeatureContainer.4ca52b51.js";import"./TileContainer.8b7fafe2.js";import"./visualVariablesUtils.32e27706.js";import"./visualVariablesUtils.aff73e6d.js";import"./Matcher.fe0c3dcf.js";import"./tileUtils.44921ab9.js";import"./TileClipper.8c399a8a.js";import"./Geometry.d049a63c.js";import"./devEnvironmentUtils.d8d0484c.js";import"./schemaUtils.69ad92d2.js";import"./createSymbolSchema.e54d2060.js";import"./util.ab699fea.js";import"./ComputedAttributeStorage.c1cb22b3.js";import"./centroid.cc817cc5.js";import"./vec3f32.1121a836.js";import"./Bitmap.43defcb1.js";const M=r=>r.spatialReference.wkid||JSON.stringify(r.spatialReference);function Ae(r,e){const{dpi:t,gdbVersion:i,geometry:s,geometryPrecision:o,height:m,layerOption:u,mapExtent:a,maxAllowableOffset:l,returnFieldName:p,returnGeometry:y,returnUnformattedValues:g,returnZ:_,spatialReference:b,timeExtent:$,tolerance:c,width:E}=r.toJSON(),{dynamicLayers:w,layerDefs:f,layerIds:v}=Te(r),V=e&&P(e.geometry)?e.geometry:null,x={geometryPrecision:o,maxAllowableOffset:l,returnFieldName:p,returnGeometry:y,returnUnformattedValues:g,returnZ:_,tolerance:c},S=V&&V.toJSON()||s;if(x.imageDisplay=`${E},${m},${t}`,i&&(x.gdbVersion=i),S&&(delete S.spatialReference,x.geometry=JSON.stringify(S),x.geometryType=k(S)),b?x.sr=b.wkid||JSON.stringify(b):S&&S.spatialReference?x.sr=M(S):a&&a.spatialReference&&(x.sr=M(a)),x.time=$?[$.start,$.end].join(","):null,a){const{xmin:B,ymin:C,xmax:H,ymax:Q}=a;x.mapExtent=`${B},${C},${H},${Q}`}return f&&(x.layerDefs=f),w&&!f&&(x.dynamicLayers=w),x.layers=u==="popup"?"visible":u,v&&!w&&(x.layers+=`:${v.join(",")}`),x}function Te(r){var b,$;const{mapExtent:e,floors:t,width:i,sublayers:s,layerIds:o,layerOption:m,gdbVersion:u}=r,a=($=(b=s==null?void 0:s.find(c=>c.layer!=null))==null?void 0:b.layer)==null?void 0:$.serviceSublayers,l=m==="popup",p={},y=Re({extent:e,width:i,spatialReference:e==null?void 0:e.spatialReference}),g=[],_=c=>{const E=y===0,w=c.minScale===0||y<=c.minScale,f=c.maxScale===0||y>=c.maxScale;if(c.visible&&(E||w&&f))if(c.sublayers)c.sublayers.forEach(_);else{if((o==null?void 0:o.includes(c.id))===!1||l&&(!c.popupTemplate||!c.popupEnabled))return;g.unshift(c)}};if(s==null||s.forEach(_),s&&!g.length)p.layerIds=[];else{const c=Oe(g,a,u),E=g.map(w=>{const f=U(t,w);return w.toExportImageJSON(f)});if(c)p.dynamicLayers=JSON.stringify(E);else{if(s){let f=g.map(({id:v})=>v);o&&(f=f.filter(v=>o.includes(v))),p.layerIds=f}else o!=null&&o.length&&(p.layerIds=o);const w=Me(t,g);if(P(w)&&w.length){const f={};for(const v of w)v.definitionExpression&&(f[v.id]=v.definitionExpression);Object.keys(f).length&&(p.layerDefs=JSON.stringify(f))}}}return p}function Me(r,e){const t=!!(r!=null&&r.length),i=e.filter(s=>s.definitionExpression!=null||t&&s.floorInfo!=null);return i.length?i.map(s=>{const o=U(r,s),m=z(o,s.definitionExpression);return{id:s.id,definitionExpression:m}}):null}var N;let d=N=class extends q{constructor(r){super(r),this.dpi=96,this.floors=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=null,this.height=400,this.layerIds=null,this.layerOption="top",this.mapExtent=null,this.maxAllowableOffset=null,this.returnFieldName=!0,this.returnGeometry=!1,this.returnM=!1,this.returnUnformattedValues=!0,this.returnZ=!1,this.spatialReference=null,this.sublayers=null,this.timeExtent=null,this.tolerance=null,this.width=400}static from(r){return X(N,r)}};n([h({type:Number,json:{write:!0}})],d.prototype,"dpi",void 0),n([h()],d.prototype,"floors",void 0),n([h({type:String,json:{write:!0}})],d.prototype,"gdbVersion",void 0),n([h({types:D,json:{read:Z,write:!0}})],d.prototype,"geometry",void 0),n([h({type:Number,json:{write:!0}})],d.prototype,"geometryPrecision",void 0),n([h({type:Number,json:{write:!0}})],d.prototype,"height",void 0),n([h({type:[Number],json:{write:!0}})],d.prototype,"layerIds",void 0),n([h({type:["top","visible","all","popup"],json:{write:!0}})],d.prototype,"layerOption",void 0),n([h({type:L,json:{write:!0}})],d.prototype,"mapExtent",void 0),n([h({type:Number,json:{write:!0}})],d.prototype,"maxAllowableOffset",void 0),n([h({type:Boolean,json:{write:!0}})],d.prototype,"returnFieldName",void 0),n([h({type:Boolean,json:{write:!0}})],d.prototype,"returnGeometry",void 0),n([h({type:Boolean,json:{write:!0}})],d.prototype,"returnM",void 0),n([h({type:Boolean,json:{write:!0}})],d.prototype,"returnUnformattedValues",void 0),n([h({type:Boolean,json:{write:!0}})],d.prototype,"returnZ",void 0),n([h({type:W,json:{write:!0}})],d.prototype,"spatialReference",void 0),n([h()],d.prototype,"sublayers",void 0),n([h({type:K,json:{write:!0}})],d.prototype,"timeExtent",void 0),n([h({type:Number,json:{write:!0}})],d.prototype,"tolerance",void 0),n([h({type:Number,json:{write:!0}})],d.prototype,"width",void 0),d=N=n([F("esri.rest.support.IdentifyParameters")],d);const J=d;let I=class extends q{constructor(r){super(r),this.displayFieldName=null,this.feature=null,this.layerId=null,this.layerName=null}readFeature(r,e){return O.fromJSON({attributes:{...e.attributes},geometry:{...e.geometry}})}writeFeature(r,e){if(!r)return;const{attributes:t,geometry:i}=r;t&&(e.attributes={...t}),P(i)&&(e.geometry=i.toJSON(),e.geometryType=te.toJSON(i.type))}};n([h({type:String,json:{write:!0}})],I.prototype,"displayFieldName",void 0),n([h({type:O})],I.prototype,"feature",void 0),n([Y("feature",["attributes","geometry"])],I.prototype,"readFeature",null),n([ee("feature")],I.prototype,"writeFeature",null),n([h({type:Number,json:{write:!0}})],I.prototype,"layerId",void 0),n([h({type:String,json:{write:!0}})],I.prototype,"layerName",void 0),I=n([F("esri.rest.support.IdentifyResult")],I);const Le=I;async function qe(r,e,t){const i=(e=Be(e)).geometry?[e.geometry]:[],s=re(r);return s.path+="/identify",ie(i).then(o=>{const m=Ae(e,{geometry:o&&o[0]}),u=se({...s.query,f:"json",...m}),a=oe(u,t);return ae(s.path,a).then(Je).then(l=>Ce(l,e.sublayers))})}function Je(r){const e=r.data;return e.results=e.results||[],e.exceededTransferLimit=Boolean(e.exceededTransferLimit),e.results=e.results.map(t=>Le.fromJSON(t)),e}function Be(r){return r=J.from(r)}function Ce(r,e){if(!(e!=null&&e.length))return r;const t=new Map;function i(s){t.set(s.id,s),s.sublayers&&s.sublayers.forEach(i)}e.forEach(i);for(const s of r.results)s.feature.sourceLayer=t.get(s.layerId);return r}let j=null;const He=r=>{let e=class extends r{constructor(){super(...arguments),this._featuresResolutions=new WeakMap,this.highlightGraphics=new le,this.updateHighlightedFeatures=pe(async t=>{this.destroyed||this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(t).catch(()=>{}))})}initialize(){this.exportImageParameters=new je({layer:this.layer}),this.handles.add([he(()=>this.highlightGraphics,"change",t=>{this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(t.added).catch(()=>{})),this.updateHighlightedFeatures(this._highlightGeometriesResolution)})])}destroy(){this.exportImageParameters.destroy(),this.exportImageParameters=null}get exportImageVersion(){var t;return(t=this.exportImageParameters)==null||t.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}async fetchPopupFeatures(t,i){var m,u,a,l,p,y;const{layer:s}=this;if(!t)throw new G("mapimagelayer:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const o=(a=(u=(m=this.layer.capabilities)==null?void 0:m.operations)==null?void 0:u.supportsQuery)!=null?a:!0;if(!(((y=(p=(l=this.layer.capabilities)==null?void 0:l.operations)==null?void 0:p.supportsIdentify)!=null?y:!0)&&this.layer.version>=10.5)&&!o)throw new G("mapimagelayer:fetchPopupFeatures-not-supported","query operation is disabled for this service",{layer:s});return o?this._fetchPopupFeaturesUsingQueries(t,i):this._fetchPopupFeaturesUsingIdentify(t,i)}canResume(){var t;return!!super.canResume()&&!((t=this.timeExtent)!=null&&t.isEmpty)}async _updateHighlightedFeaturesSymbols(t){for(const i of t){const s="renderer"in i.sourceLayer&&i.sourceLayer.renderer;"geometryType"in i.sourceLayer&&i.sourceLayer.geometryType==="point"&&s&&"getSymbolAsync"in s&&s.getSymbolAsync(i).then(async o=>{var a;let m="width"in o&&"height"in o&&o.width!=null&&o.height!=null?Math.max(o.width,o.height):"size"in o?o.size:null;const u="visualVariables"in s&&((a=s.visualVariables)==null?void 0:a.find(l=>l.type==="size"));u&&(j||(j=(await ue(()=>import("./index.d94abe07.js").then(function(l){return l.k_}),["assets/index.d94abe07.js","assets/index.f5419ca5.css"])).getSize),m=j(u,i,{view:this.view.type,scale:this.view.scale,shape:o.type==="simple-marker"?o.style:null})),this.highlightGraphics.includes(i)&&(i.symbol=new ye({style:"square",size:m,xoffset:"xoffset"in o?o.xoffset:0,yoffset:"yoffset"in o?o.yoffset:0}),i.visible=!0,this.highlightGraphicUpdated(i,"symbol"))})}}async _updateHighlightedFeaturesGeometries(t){this._highlightGeometriesResolution=t;const i=this.highlightGraphics;if(!i.length||!this.layer.capabilities.operations.supportsQuery)return;const s=this._getTargetResolution(t),o=new Map;for(const a of i)if(!this._featuresResolutions.has(a)||this._featuresResolutions.get(a)>s){const l=a.sourceLayer;me(o,l,()=>new Map).set(a.getObjectId(),a)}const m=Array.from(o,([a,l])=>{const p=a.createQuery();return p.objectIds=[...l.keys()],p.outFields=[a.objectIdField],p.returnGeometry=!0,p.maxAllowableOffset=s,p.outSpatialReference=this.view.spatialReference,a.queryFeatures(p)}),u=await Promise.all(m);if(!this.destroyed)for(const{features:a}of u)for(const l of a){const p=l.sourceLayer,y=o.get(p).get(l.getObjectId());y&&this.highlightGraphics.includes(y)&&(y.geometry=l.geometry,this.highlightGraphicUpdated(y,"geometry"),this._featuresResolutions.set(y,s))}}_getTargetResolution(t){const i=t*de(this.view.spatialReference),s=i/16;return s<=10?0:t/i*s}async _fetchPopupFeaturesUsingIdentify(t,i){const s=await this._createIdentifyParameters(t,i);if(ce(s))return[];const{results:o}=await qe(this.layer.parsedUrl,s);return o.map(m=>m.feature)}async _createIdentifyParameters(t,i){const{floors:s,spatialReference:o,scale:m}=this.view,u=P(i)?i.event:null,a=await this._collectPopupProviders(this.layer.sublayers,m,i);if(!a.length)return null;await Promise.all(a.map(({sublayer:b})=>b.load().catch(()=>{})));const l=Math.min(fe("mapimagelayer-popup-identify-max-tolerance"),this.layer.allSublayers.reduce((b,$)=>$.renderer?T({renderer:$.renderer,event:u}):b,2)),p=this.createFetchPopupFeaturesQueryGeometry(t,l),y=Fe(m,o),g=Math.round(p.width/y),_=new L({xmin:p.center.x-y*g,ymin:p.center.y-y*g,xmax:p.center.x+y*g,ymax:p.center.y+y*g,spatialReference:p.spatialReference});return new J({floors:s,gdbVersion:this.layer.gdbVersion,geometry:t,height:g,layerOption:"popup",mapExtent:_,returnGeometry:!0,spatialReference:o,sublayers:this.layer.sublayers,timeExtent:this.timeExtent,tolerance:l,width:g})}async _fetchPopupFeaturesUsingQueries(t,i){const s=await this._collectPopupProviders(this.layer.sublayers,this.view.scale,i),o=P(i)?i.event:null,m=s.map(async({sublayer:u,popupTemplate:a})=>{var E,w;await u.load().catch(()=>{});const l=u.createQuery(),p=T({renderer:u.renderer,event:o}),y=this.createFetchPopupFeaturesQueryGeometry(t,p);if(l.geometry=y,l.outFields=await Ue(u,a),l.timeExtent=this.timeExtent,"floors"in this.view){const f=(w=(E=this.view)==null?void 0:E.floors)==null?void 0:w.clone(),v=U(f,u);P(v)&&(l.where=l.where?`(${l.where}) AND (${v})`:v)}const g=this._getTargetResolution(y.width/p),_=await this._loadArcadeModules(a),b=u.geometryType==="point"||_&&_.arcadeUtils.hasGeometryOperations(a);b||(l.maxAllowableOffset=g);const{features:$}=await u.queryFeatures(l),c=b?0:g;for(const f of $)this._featuresResolutions.set(f,c);return $});return(await ge(m)).reverse().reduce((u,a)=>a.value?[...u,...a.value]:u,[]).filter(u=>u!=null)}async _collectPopupProviders(t,i,s){const o=[],m=async a=>{const l=a.minScale===0||i<=a.minScale,p=a.maxScale===0||i>=a.maxScale;if(a.visible&&l&&p){if(a.sublayers)a.sublayers.forEach(m);else if(a.popupEnabled){const y=Ve(a,{...s,defaultPopupTemplateEnabled:!1});P(y)&&o.unshift({sublayer:a,popupTemplate:y})}}},u=t.toArray().reverse().map(m);return await Promise.all(u),o}_loadArcadeModules(t){var i;if(((i=t.expressionInfos)==null?void 0:i.length)||Array.isArray(t.content)&&t.content.some(s=>s.type==="expression"))return we()}};return n([h()],e.prototype,"highlightGraphics",void 0),n([h()],e.prototype,"exportImageParameters",void 0),n([h({readOnly:!0})],e.prototype,"exportImageVersion",null),n([h()],e.prototype,"layer",void 0),n([h()],e.prototype,"suspended",void 0),n([h(ne)],e.prototype,"timeExtent",void 0),e=n([F("esri.views.layers.MapImageLayerView")],e),e};let R=class extends He(Ge(_e(Ie))){update(r){this.strategy.update(r).catch(e=>{ve(e)||xe.getLogger(this.declaredClass).error(e)}),r.stationary&&this.updateHighlightedFeatures(r.state.resolution),this._highlightView.processUpdate(r)}attach(){const{imageMaxWidth:r,imageMaxHeight:e,version:t}=this.layer,i=t>=10.3,s=t>=10;this._bitmapContainer=new $e,this.container.addChild(this._bitmapContainer),this._highlightView=new Ee({view:this.view,graphics:this.highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new Se(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container),this.strategy=new Pe({container:this._bitmapContainer,fetchSource:this.fetchImageBitmap.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxWidth:r,imageMaxHeight:e,imageRotationSupported:i,imageNormalizationSupported:s,hidpi:!0}),this.handles.add(A(()=>this.exportImageVersion,()=>this.requestUpdate()),"exportImageVersion"),this.handles.add(A(()=>{var o;return(o=this.view)==null?void 0:o.floors},()=>this.requestUpdate()),"view.floors"),this.requestUpdate()}detach(){this.handles.remove("exportImageVersion"),this.handles.remove("view.floors"),this.strategy.destroy(),this.container.removeAllChildren(),this._bitmapContainer.removeAllChildren(),this._highlightView.destroy()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}highlight(r){let e=null;if(r instanceof O?e=[r]:be.isCollection(r)&&r.length>0?e=r.toArray():Array.isArray(r)&&r.length>0&&(e=r),e=e==null?void 0:e.filter(Boolean),!e||!e.length)return{remove:()=>{}};for(const t of e)"geometryType"in t.sourceLayer&&t.sourceLayer.geometryType==="point"&&(t.visible=!1);return this.highlightGraphics.addMany(e),{remove:()=>{this.highlightGraphics.removeMany(e)}}}supportsSpatialReference(r){return this.layer.serviceSupportsSpatialReference(r)}createFetchPopupFeaturesQueryGeometry(r,e){return Ne(r,e,this.view)}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}highlightGraphicUpdated(r,e){this._highlightView.graphicUpdateHandler({graphic:r,property:e})}fetchImage(r,e,t,i){return this.layer.fetchImage(r,e,t,{timeExtent:this.timeExtent,floors:this.view.floors,...i})}fetchImageBitmap(r,e,t,i){return this.layer.fetchImageBitmap(r,e,t,{timeExtent:this.timeExtent,floors:this.view.floors,...i})}};n([h()],R.prototype,"strategy",void 0),n([h()],R.prototype,"updating",void 0),R=n([F("esri.views.2d.layers.MapImageLayerView2D")],R);const Ht=R;export{Ht as default}; +import{c as P,aA as k,c4 as z,a6 as n,a7 as h,dZ as D,c9 as Z,cU as L,aT as W,d_ as K,a8 as F,cx as q,d$ as X,d1 as O,d2 as Y,e0 as ee,e1 as te,dQ as re,e2 as ie,e3 as se,e4 as oe,U as ae,da as ne,dB as le,dn as pe,c$ as he,n as G,at as ue,e5 as ye,e6 as me,cq as de,j as ce,m as fe,cB as ge,de as we,x as ve,s as xe,_ as A,cE as be}from"./index.221827cd.js";import{a as $e}from"./BitmapContainer.9e943f6d.js";import{y as _e,u as Ie}from"./LayerView.ce6e0535.js";import{o as Ee}from"./BaseGraphicContainer.7704bbc1.js";import{n as Se}from"./HighlightGraphicContainer.a4fdc946.js";import{v as Pe}from"./ExportStrategy.fb59ab52.js";import{i as Re,r as Fe}from"./scaleUtils.de5ad5a6.js";import{c as je}from"./ExportImageParameters.65ee285f.js";import{n as U}from"./floorFilterUtils.05eb8c6a.js";import{s as T,a as Ne}from"./drapedUtils.0866c85c.js";import{i as Oe}from"./sublayerUtils.59f5d9da.js";import{d as Ue,s as Ve}from"./popupUtils.c6371f3a.js";import{i as Ge}from"./RefreshableLayerView.887ed8c3.js";import"./WGLContainer.347cc5cd.js";import"./enums.2d9e6f64.js";import"./pixelUtils.9c6f8dae.js";import"./utils.0160becb.js";import"./Utils.2136650a.js";import"./enums.0295eb81.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.0cadabc1.js";import"./VertexArrayObject.53cf1857.js";import"./ProgramTemplate.cf9dd4e8.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./ExpandedCIM.a372ce74.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.7ff797cc.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.3f71f8e9.js";import"./normalizeUtilsSync.4d52fbd0.js";import"./projectionSupport.4f5da4af.js";import"./json.879c9adc.js";import"./FeatureContainer.b427dd87.js";import"./TileContainer.5aeb32d6.js";import"./visualVariablesUtils.061b7a4e.js";import"./visualVariablesUtils.62efda9d.js";import"./Matcher.6586928a.js";import"./tileUtils.332711ed.js";import"./TileClipper.77103a2e.js";import"./Geometry.d049a63c.js";import"./devEnvironmentUtils.d8d0484c.js";import"./schemaUtils.d20994fa.js";import"./createSymbolSchema.827eb617.js";import"./util.520a352e.js";import"./ComputedAttributeStorage.29767acd.js";import"./centroid.06db4b74.js";import"./vec3f32.1121a836.js";import"./Bitmap.72a3702e.js";const M=r=>r.spatialReference.wkid||JSON.stringify(r.spatialReference);function Ae(r,e){const{dpi:t,gdbVersion:i,geometry:s,geometryPrecision:o,height:m,layerOption:u,mapExtent:a,maxAllowableOffset:l,returnFieldName:p,returnGeometry:y,returnUnformattedValues:g,returnZ:_,spatialReference:b,timeExtent:$,tolerance:c,width:E}=r.toJSON(),{dynamicLayers:w,layerDefs:f,layerIds:v}=Te(r),V=e&&P(e.geometry)?e.geometry:null,x={geometryPrecision:o,maxAllowableOffset:l,returnFieldName:p,returnGeometry:y,returnUnformattedValues:g,returnZ:_,tolerance:c},S=V&&V.toJSON()||s;if(x.imageDisplay=`${E},${m},${t}`,i&&(x.gdbVersion=i),S&&(delete S.spatialReference,x.geometry=JSON.stringify(S),x.geometryType=k(S)),b?x.sr=b.wkid||JSON.stringify(b):S&&S.spatialReference?x.sr=M(S):a&&a.spatialReference&&(x.sr=M(a)),x.time=$?[$.start,$.end].join(","):null,a){const{xmin:B,ymin:C,xmax:H,ymax:Q}=a;x.mapExtent=`${B},${C},${H},${Q}`}return f&&(x.layerDefs=f),w&&!f&&(x.dynamicLayers=w),x.layers=u==="popup"?"visible":u,v&&!w&&(x.layers+=`:${v.join(",")}`),x}function Te(r){var b,$;const{mapExtent:e,floors:t,width:i,sublayers:s,layerIds:o,layerOption:m,gdbVersion:u}=r,a=($=(b=s==null?void 0:s.find(c=>c.layer!=null))==null?void 0:b.layer)==null?void 0:$.serviceSublayers,l=m==="popup",p={},y=Re({extent:e,width:i,spatialReference:e==null?void 0:e.spatialReference}),g=[],_=c=>{const E=y===0,w=c.minScale===0||y<=c.minScale,f=c.maxScale===0||y>=c.maxScale;if(c.visible&&(E||w&&f))if(c.sublayers)c.sublayers.forEach(_);else{if((o==null?void 0:o.includes(c.id))===!1||l&&(!c.popupTemplate||!c.popupEnabled))return;g.unshift(c)}};if(s==null||s.forEach(_),s&&!g.length)p.layerIds=[];else{const c=Oe(g,a,u),E=g.map(w=>{const f=U(t,w);return w.toExportImageJSON(f)});if(c)p.dynamicLayers=JSON.stringify(E);else{if(s){let f=g.map(({id:v})=>v);o&&(f=f.filter(v=>o.includes(v))),p.layerIds=f}else o!=null&&o.length&&(p.layerIds=o);const w=Me(t,g);if(P(w)&&w.length){const f={};for(const v of w)v.definitionExpression&&(f[v.id]=v.definitionExpression);Object.keys(f).length&&(p.layerDefs=JSON.stringify(f))}}}return p}function Me(r,e){const t=!!(r!=null&&r.length),i=e.filter(s=>s.definitionExpression!=null||t&&s.floorInfo!=null);return i.length?i.map(s=>{const o=U(r,s),m=z(o,s.definitionExpression);return{id:s.id,definitionExpression:m}}):null}var N;let d=N=class extends q{constructor(r){super(r),this.dpi=96,this.floors=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=null,this.height=400,this.layerIds=null,this.layerOption="top",this.mapExtent=null,this.maxAllowableOffset=null,this.returnFieldName=!0,this.returnGeometry=!1,this.returnM=!1,this.returnUnformattedValues=!0,this.returnZ=!1,this.spatialReference=null,this.sublayers=null,this.timeExtent=null,this.tolerance=null,this.width=400}static from(r){return X(N,r)}};n([h({type:Number,json:{write:!0}})],d.prototype,"dpi",void 0),n([h()],d.prototype,"floors",void 0),n([h({type:String,json:{write:!0}})],d.prototype,"gdbVersion",void 0),n([h({types:D,json:{read:Z,write:!0}})],d.prototype,"geometry",void 0),n([h({type:Number,json:{write:!0}})],d.prototype,"geometryPrecision",void 0),n([h({type:Number,json:{write:!0}})],d.prototype,"height",void 0),n([h({type:[Number],json:{write:!0}})],d.prototype,"layerIds",void 0),n([h({type:["top","visible","all","popup"],json:{write:!0}})],d.prototype,"layerOption",void 0),n([h({type:L,json:{write:!0}})],d.prototype,"mapExtent",void 0),n([h({type:Number,json:{write:!0}})],d.prototype,"maxAllowableOffset",void 0),n([h({type:Boolean,json:{write:!0}})],d.prototype,"returnFieldName",void 0),n([h({type:Boolean,json:{write:!0}})],d.prototype,"returnGeometry",void 0),n([h({type:Boolean,json:{write:!0}})],d.prototype,"returnM",void 0),n([h({type:Boolean,json:{write:!0}})],d.prototype,"returnUnformattedValues",void 0),n([h({type:Boolean,json:{write:!0}})],d.prototype,"returnZ",void 0),n([h({type:W,json:{write:!0}})],d.prototype,"spatialReference",void 0),n([h()],d.prototype,"sublayers",void 0),n([h({type:K,json:{write:!0}})],d.prototype,"timeExtent",void 0),n([h({type:Number,json:{write:!0}})],d.prototype,"tolerance",void 0),n([h({type:Number,json:{write:!0}})],d.prototype,"width",void 0),d=N=n([F("esri.rest.support.IdentifyParameters")],d);const J=d;let I=class extends q{constructor(r){super(r),this.displayFieldName=null,this.feature=null,this.layerId=null,this.layerName=null}readFeature(r,e){return O.fromJSON({attributes:{...e.attributes},geometry:{...e.geometry}})}writeFeature(r,e){if(!r)return;const{attributes:t,geometry:i}=r;t&&(e.attributes={...t}),P(i)&&(e.geometry=i.toJSON(),e.geometryType=te.toJSON(i.type))}};n([h({type:String,json:{write:!0}})],I.prototype,"displayFieldName",void 0),n([h({type:O})],I.prototype,"feature",void 0),n([Y("feature",["attributes","geometry"])],I.prototype,"readFeature",null),n([ee("feature")],I.prototype,"writeFeature",null),n([h({type:Number,json:{write:!0}})],I.prototype,"layerId",void 0),n([h({type:String,json:{write:!0}})],I.prototype,"layerName",void 0),I=n([F("esri.rest.support.IdentifyResult")],I);const Le=I;async function qe(r,e,t){const i=(e=Be(e)).geometry?[e.geometry]:[],s=re(r);return s.path+="/identify",ie(i).then(o=>{const m=Ae(e,{geometry:o&&o[0]}),u=se({...s.query,f:"json",...m}),a=oe(u,t);return ae(s.path,a).then(Je).then(l=>Ce(l,e.sublayers))})}function Je(r){const e=r.data;return e.results=e.results||[],e.exceededTransferLimit=Boolean(e.exceededTransferLimit),e.results=e.results.map(t=>Le.fromJSON(t)),e}function Be(r){return r=J.from(r)}function Ce(r,e){if(!(e!=null&&e.length))return r;const t=new Map;function i(s){t.set(s.id,s),s.sublayers&&s.sublayers.forEach(i)}e.forEach(i);for(const s of r.results)s.feature.sourceLayer=t.get(s.layerId);return r}let j=null;const He=r=>{let e=class extends r{constructor(){super(...arguments),this._featuresResolutions=new WeakMap,this.highlightGraphics=new le,this.updateHighlightedFeatures=pe(async t=>{this.destroyed||this.updatingHandles.addPromise(this._updateHighlightedFeaturesGeometries(t).catch(()=>{}))})}initialize(){this.exportImageParameters=new je({layer:this.layer}),this.handles.add([he(()=>this.highlightGraphics,"change",t=>{this.updatingHandles.addPromise(this._updateHighlightedFeaturesSymbols(t.added).catch(()=>{})),this.updateHighlightedFeatures(this._highlightGeometriesResolution)})])}destroy(){this.exportImageParameters.destroy(),this.exportImageParameters=null}get exportImageVersion(){var t;return(t=this.exportImageParameters)==null||t.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}async fetchPopupFeatures(t,i){var m,u,a,l,p,y;const{layer:s}=this;if(!t)throw new G("mapimagelayer:fetchPopupFeatures","Nothing to fetch without area",{layer:s});const o=(a=(u=(m=this.layer.capabilities)==null?void 0:m.operations)==null?void 0:u.supportsQuery)!=null?a:!0;if(!(((y=(p=(l=this.layer.capabilities)==null?void 0:l.operations)==null?void 0:p.supportsIdentify)!=null?y:!0)&&this.layer.version>=10.5)&&!o)throw new G("mapimagelayer:fetchPopupFeatures-not-supported","query operation is disabled for this service",{layer:s});return o?this._fetchPopupFeaturesUsingQueries(t,i):this._fetchPopupFeaturesUsingIdentify(t,i)}canResume(){var t;return!!super.canResume()&&!((t=this.timeExtent)!=null&&t.isEmpty)}async _updateHighlightedFeaturesSymbols(t){for(const i of t){const s="renderer"in i.sourceLayer&&i.sourceLayer.renderer;"geometryType"in i.sourceLayer&&i.sourceLayer.geometryType==="point"&&s&&"getSymbolAsync"in s&&s.getSymbolAsync(i).then(async o=>{var a;let m="width"in o&&"height"in o&&o.width!=null&&o.height!=null?Math.max(o.width,o.height):"size"in o?o.size:null;const u="visualVariables"in s&&((a=s.visualVariables)==null?void 0:a.find(l=>l.type==="size"));u&&(j||(j=(await ue(()=>import("./index.221827cd.js").then(function(l){return l.k_}),["assets/index.221827cd.js","assets/index.f5419ca5.css"])).getSize),m=j(u,i,{view:this.view.type,scale:this.view.scale,shape:o.type==="simple-marker"?o.style:null})),this.highlightGraphics.includes(i)&&(i.symbol=new ye({style:"square",size:m,xoffset:"xoffset"in o?o.xoffset:0,yoffset:"yoffset"in o?o.yoffset:0}),i.visible=!0,this.highlightGraphicUpdated(i,"symbol"))})}}async _updateHighlightedFeaturesGeometries(t){this._highlightGeometriesResolution=t;const i=this.highlightGraphics;if(!i.length||!this.layer.capabilities.operations.supportsQuery)return;const s=this._getTargetResolution(t),o=new Map;for(const a of i)if(!this._featuresResolutions.has(a)||this._featuresResolutions.get(a)>s){const l=a.sourceLayer;me(o,l,()=>new Map).set(a.getObjectId(),a)}const m=Array.from(o,([a,l])=>{const p=a.createQuery();return p.objectIds=[...l.keys()],p.outFields=[a.objectIdField],p.returnGeometry=!0,p.maxAllowableOffset=s,p.outSpatialReference=this.view.spatialReference,a.queryFeatures(p)}),u=await Promise.all(m);if(!this.destroyed)for(const{features:a}of u)for(const l of a){const p=l.sourceLayer,y=o.get(p).get(l.getObjectId());y&&this.highlightGraphics.includes(y)&&(y.geometry=l.geometry,this.highlightGraphicUpdated(y,"geometry"),this._featuresResolutions.set(y,s))}}_getTargetResolution(t){const i=t*de(this.view.spatialReference),s=i/16;return s<=10?0:t/i*s}async _fetchPopupFeaturesUsingIdentify(t,i){const s=await this._createIdentifyParameters(t,i);if(ce(s))return[];const{results:o}=await qe(this.layer.parsedUrl,s);return o.map(m=>m.feature)}async _createIdentifyParameters(t,i){const{floors:s,spatialReference:o,scale:m}=this.view,u=P(i)?i.event:null,a=await this._collectPopupProviders(this.layer.sublayers,m,i);if(!a.length)return null;await Promise.all(a.map(({sublayer:b})=>b.load().catch(()=>{})));const l=Math.min(fe("mapimagelayer-popup-identify-max-tolerance"),this.layer.allSublayers.reduce((b,$)=>$.renderer?T({renderer:$.renderer,event:u}):b,2)),p=this.createFetchPopupFeaturesQueryGeometry(t,l),y=Fe(m,o),g=Math.round(p.width/y),_=new L({xmin:p.center.x-y*g,ymin:p.center.y-y*g,xmax:p.center.x+y*g,ymax:p.center.y+y*g,spatialReference:p.spatialReference});return new J({floors:s,gdbVersion:this.layer.gdbVersion,geometry:t,height:g,layerOption:"popup",mapExtent:_,returnGeometry:!0,spatialReference:o,sublayers:this.layer.sublayers,timeExtent:this.timeExtent,tolerance:l,width:g})}async _fetchPopupFeaturesUsingQueries(t,i){const s=await this._collectPopupProviders(this.layer.sublayers,this.view.scale,i),o=P(i)?i.event:null,m=s.map(async({sublayer:u,popupTemplate:a})=>{var E,w;await u.load().catch(()=>{});const l=u.createQuery(),p=T({renderer:u.renderer,event:o}),y=this.createFetchPopupFeaturesQueryGeometry(t,p);if(l.geometry=y,l.outFields=await Ue(u,a),l.timeExtent=this.timeExtent,"floors"in this.view){const f=(w=(E=this.view)==null?void 0:E.floors)==null?void 0:w.clone(),v=U(f,u);P(v)&&(l.where=l.where?`(${l.where}) AND (${v})`:v)}const g=this._getTargetResolution(y.width/p),_=await this._loadArcadeModules(a),b=u.geometryType==="point"||_&&_.arcadeUtils.hasGeometryOperations(a);b||(l.maxAllowableOffset=g);const{features:$}=await u.queryFeatures(l),c=b?0:g;for(const f of $)this._featuresResolutions.set(f,c);return $});return(await ge(m)).reverse().reduce((u,a)=>a.value?[...u,...a.value]:u,[]).filter(u=>u!=null)}async _collectPopupProviders(t,i,s){const o=[],m=async a=>{const l=a.minScale===0||i<=a.minScale,p=a.maxScale===0||i>=a.maxScale;if(a.visible&&l&&p){if(a.sublayers)a.sublayers.forEach(m);else if(a.popupEnabled){const y=Ve(a,{...s,defaultPopupTemplateEnabled:!1});P(y)&&o.unshift({sublayer:a,popupTemplate:y})}}},u=t.toArray().reverse().map(m);return await Promise.all(u),o}_loadArcadeModules(t){var i;if(((i=t.expressionInfos)==null?void 0:i.length)||Array.isArray(t.content)&&t.content.some(s=>s.type==="expression"))return we()}};return n([h()],e.prototype,"highlightGraphics",void 0),n([h()],e.prototype,"exportImageParameters",void 0),n([h({readOnly:!0})],e.prototype,"exportImageVersion",null),n([h()],e.prototype,"layer",void 0),n([h()],e.prototype,"suspended",void 0),n([h(ne)],e.prototype,"timeExtent",void 0),e=n([F("esri.views.layers.MapImageLayerView")],e),e};let R=class extends He(Ge(_e(Ie))){update(r){this.strategy.update(r).catch(e=>{ve(e)||xe.getLogger(this.declaredClass).error(e)}),r.stationary&&this.updateHighlightedFeatures(r.state.resolution),this._highlightView.processUpdate(r)}attach(){const{imageMaxWidth:r,imageMaxHeight:e,version:t}=this.layer,i=t>=10.3,s=t>=10;this._bitmapContainer=new $e,this.container.addChild(this._bitmapContainer),this._highlightView=new Ee({view:this.view,graphics:this.highlightGraphics,requestUpdateCallback:()=>this.requestUpdate(),container:new Se(this.view.featuresTilingScheme)}),this.container.addChild(this._highlightView.container),this.strategy=new Pe({container:this._bitmapContainer,fetchSource:this.fetchImageBitmap.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxWidth:r,imageMaxHeight:e,imageRotationSupported:i,imageNormalizationSupported:s,hidpi:!0}),this.handles.add(A(()=>this.exportImageVersion,()=>this.requestUpdate()),"exportImageVersion"),this.handles.add(A(()=>{var o;return(o=this.view)==null?void 0:o.floors},()=>this.requestUpdate()),"view.floors"),this.requestUpdate()}detach(){this.handles.remove("exportImageVersion"),this.handles.remove("view.floors"),this.strategy.destroy(),this.container.removeAllChildren(),this._bitmapContainer.removeAllChildren(),this._highlightView.destroy()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}highlight(r){let e=null;if(r instanceof O?e=[r]:be.isCollection(r)&&r.length>0?e=r.toArray():Array.isArray(r)&&r.length>0&&(e=r),e=e==null?void 0:e.filter(Boolean),!e||!e.length)return{remove:()=>{}};for(const t of e)"geometryType"in t.sourceLayer&&t.sourceLayer.geometryType==="point"&&(t.visible=!1);return this.highlightGraphics.addMany(e),{remove:()=>{this.highlightGraphics.removeMany(e)}}}supportsSpatialReference(r){return this.layer.serviceSupportsSpatialReference(r)}createFetchPopupFeaturesQueryGeometry(r,e){return Ne(r,e,this.view)}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}highlightGraphicUpdated(r,e){this._highlightView.graphicUpdateHandler({graphic:r,property:e})}fetchImage(r,e,t,i){return this.layer.fetchImage(r,e,t,{timeExtent:this.timeExtent,floors:this.view.floors,...i})}fetchImageBitmap(r,e,t,i){return this.layer.fetchImageBitmap(r,e,t,{timeExtent:this.timeExtent,floors:this.view.floors,...i})}};n([h()],R.prototype,"strategy",void 0),n([h()],R.prototype,"updating",void 0),R=n([F("esri.views.2d.layers.MapImageLayerView2D")],R);const Ht=R;export{Ht as default}; diff --git a/assets/MapNotesLayer.0d53edee.js b/assets/MapNotesLayer.52447f2c.js similarity index 99% rename from assets/MapNotesLayer.0d53edee.js rename to assets/MapNotesLayer.52447f2c.js index bf08186..8e7ff1c 100644 --- a/assets/MapNotesLayer.0d53edee.js +++ b/assets/MapNotesLayer.52447f2c.js @@ -1 +1 @@ -import{gG as M,a6 as i,a7 as n,a8 as E,iH as z,iF as A,e5 as x,jw as k,i2 as H,i3 as K,eF as W,eG as U,eH as Z,aT as O,cE as J,hZ as q,b4 as v,e$ as $,c as m,jx as L,e9 as w,jy as j,cJ as D,d1 as Q,j as f,n as V,hV as X,bK as Y,dF as ee,dD as te,dE as re,cI as oe,e2 as ie,ii as C,d2 as b,e0 as ae,cU as le,jz as ne,jA as R,cF as se}from"./index.d94abe07.js";import{n as ye}from"./objectIdUtils.83ac3f67.js";function S(t){return t.featureCollectionType==="markup"||t.layers.some(e=>e.layerDefinition.visibilityField!=null||!F(e))}function F({layerDefinition:t,featureSet:e}){var o;const r=(o=t.geometryType)!=null?o:e.geometryType;return T.find(a=>{var s,y,p;return r===a.geometryTypeJSON&&((p=(y=(s=t.drawingInfo)==null?void 0:s.renderer)==null?void 0:y.symbol)==null?void 0:p.type)===a.identifyingSymbol.type})}function G(){return new le({xmin:-180,ymin:-90,xmax:180,ymax:90})}const I=new M({name:"OBJECTID",alias:"OBJECTID",type:"oid",nullable:!1,editable:!1}),pe=new M({name:"title",alias:"Title",type:"string",nullable:!0,editable:!0});let d=class extends ne{constructor(t){super(t),this.visibilityMode="inherited"}initialize(){for(const t of this.graphics)t.sourceLayer=this.layer;this.graphics.on("after-add",t=>{t.item.sourceLayer=this.layer}),this.graphics.on("after-remove",t=>{t.item.sourceLayer=null})}get fullExtent(){var r;const t=(r=this.layer)==null?void 0:r.spatialReference,e=this.fullBounds;return t?f(e)?w(G(),t).geometry:D(e,t):null}get fullBounds(){var r;const t=(r=this.layer)==null?void 0:r.spatialReference;if(!t)return null;const e=$();return this.graphics.forEach(o=>{const a=m(o.geometry)?w(o.geometry,t).geometry:null;m(a)&&L(e,a.type==="point"?a:a.extent,e)}),j(e,R)?null:e}get sublayers(){return this.graphics}};i([n({readOnly:!0})],d.prototype,"fullExtent",null),i([n({readOnly:!0})],d.prototype,"fullBounds",null),i([n({readOnly:!0})],d.prototype,"sublayers",null),i([n()],d.prototype,"layer",void 0),i([n()],d.prototype,"layerId",void 0),i([n({readOnly:!0})],d.prototype,"visibilityMode",void 0),d=i([E("esri.layers.MapNotesLayer.MapNotesSublayer")],d);const T=[{geometryType:"polygon",geometryTypeJSON:"esriGeometryPolygon",id:"polygonLayer",layerId:0,title:"Polygons",identifyingSymbol:new z().toJSON()},{geometryType:"polyline",geometryTypeJSON:"esriGeometryPolyline",id:"polylineLayer",layerId:1,title:"Polylines",identifyingSymbol:new A().toJSON()},{geometryType:"multipoint",geometryTypeJSON:"esriGeometryMultipoint",id:"multipointLayer",layerId:2,title:"Multipoints",identifyingSymbol:new x().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"pointLayer",layerId:3,title:"Points",identifyingSymbol:new x().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"textLayer",layerId:4,title:"Text",identifyingSymbol:new k().toJSON()}];let l=class extends H(K(W(U(Z(se))))){constructor(t){super(t),this.capabilities={operations:{supportsMapNotesEditing:!0}},this.featureCollections=null,this.featureCollectionJSON=null,this.featureCollectionType="notes",this.legendEnabled=!1,this.listMode="hide-children",this.minScale=0,this.maxScale=0,this.spatialReference=O.WGS84,this.sublayers=new J(T.map(e=>new d({id:e.id,layerId:e.layerId,title:e.title,layer:this}))),this.title="Map Notes",this.type="map-notes",this.visibilityMode="inherited"}readCapabilities(t,e,r){return{operations:{supportsMapNotesEditing:!S(e)&&(r==null?void 0:r.origin)!=="portal-item"}}}readFeatureCollections(t,e,r){if(!S(e))return null;const o=e.layers.map(a=>{const s=new q;return s.read(a,r),s});return new J({items:o})}readLegacyfeatureCollectionJSON(t,e){return S(e)?v(e.featureCollection):null}get fullExtent(){var r;const t=this.spatialReference,e=$();return m(this.sublayers)?this.sublayers.forEach(({fullBounds:o})=>m(o)?L(e,o,e):e,e):(r=this.featureCollectionJSON)!=null&&r.layers.some(o=>o.layerDefinition.extent)&&this.featureCollectionJSON.layers.forEach(o=>{const a=w(o.layerDefinition.extent,t).geometry;m(a)&&L(e,a,e)}),j(e,R)?w(G(),t).geometry:D(e,t)}readMinScale(t,e){for(const r of e.layers)if(r.layerDefinition.minScale!=null)return r.layerDefinition.minScale;return 0}readMaxScale(t,e){for(const r of e.layers)if(r.layerDefinition.maxScale!=null)return r.layerDefinition.maxScale;return 0}get multipointLayer(){return this._findSublayer("multipointLayer")}get pointLayer(){return this._findSublayer("pointLayer")}get polygonLayer(){return this._findSublayer("polygonLayer")}get polylineLayer(){return this._findSublayer("polylineLayer")}readSpatialReference(t,e){return e.layers.length?O.fromJSON(e.layers[0].layerDefinition.spatialReference):O.WGS84}readSublayers(t,e,r){var s;if(S(e))return null;const o=[];let a=e.layers.reduce((y,p)=>{var u;return Math.max(y,(u=p.layerDefinition.id)!=null?u:-1)},-1)+1;for(const y of e.layers){const{layerDefinition:p,featureSet:u}=y,g=(s=p.id)!=null?s:a++,c=F(y);if(m(c)){const h=new d({id:c.id,title:p.name,layerId:g,layer:this,graphics:u.features.map(({geometry:N,symbol:_,attributes:P,popupInfo:B})=>Q.fromJSON({attributes:P,geometry:N,symbol:_,popupTemplate:B}))});o.push(h)}}return new J(o)}writeSublayers(t,e,r,o){var g;const{minScale:a,maxScale:s}=this;if(f(t))return;const y=t.some(c=>c.graphics.length>0);if(!this.capabilities.operations.supportsMapNotesEditing)return void(y&&((g=o==null?void 0:o.messages)==null?void 0:g.push(new V("map-notes-layer:editing-not-supported","New map notes cannot be added to this layer"))));const p=[];let u=this.spatialReference.toJSON();e:for(const c of t)for(const h of c.graphics)if(m(h.geometry)){u=h.geometry.spatialReference.toJSON();break e}for(const c of T){const h=t.find(N=>c.id===N.id);this._writeMapNoteSublayer(p,h,c,a,s,u,o)}X("featureCollection.layers",p,e)}get textLayer(){return this._findSublayer("textLayer")}load(t){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},t)),Promise.resolve(this)}read(t,e){"featureCollection"in t&&(t=v(t),Object.assign(t,t.featureCollection)),super.read(t,e)}async beforeSave(){if(f(this.sublayers))return;let t=null;const e=[];for(const o of this.sublayers)for(const a of o.graphics)if(m(a.geometry)){const s=a.geometry;t?Y(s.spatialReference,t)||(ee(s.spatialReference,t)||te()||await re(),a.geometry=oe(s,t)):t=s.spatialReference,e.push(a)}const r=await ie(e.map(o=>o.geometry));e.forEach((o,a)=>o.geometry=r[a])}_findSublayer(t){var e,r;return f(this.sublayers)?null:(r=(e=this.sublayers)==null?void 0:e.find(o=>o.id===t))!=null?r:null}_writeMapNoteSublayer(t,e,r,o,a,s,y){const p=[];if(!f(e)){for(const u of e.graphics)this._writeMapNote(p,u,r.geometryType,y);this._normalizeObjectIds(p,I),t.push({layerDefinition:{name:e.title,drawingInfo:{renderer:{type:"simple",symbol:v(r.identifyingSymbol)}},id:e.layerId,geometryType:r.geometryTypeJSON,minScale:o,maxScale:a,objectIdField:"OBJECTID",fields:[I.toJSON(),pe.toJSON()],spatialReference:s},featureSet:{features:p,geometryType:r.geometryTypeJSON}})}}_writeMapNote(t,e,r,o){var u,g;if(f(e))return;const{geometry:a,symbol:s,popupTemplate:y}=e;if(f(a))return;if(a.type!==r)return void((u=o==null?void 0:o.messages)==null?void 0:u.push(new C("map-notes-layer:invalid-geometry-type",`Geometry "${a.type}" cannot be saved in "${r}" layer`,{graphic:e})));if(f(s))return void((g=o==null?void 0:o.messages)==null?void 0:g.push(new C("map-notes-layer:no-symbol","Skipping map notes with no symbol",{graphic:e})));const p={attributes:{...e.attributes},geometry:a.toJSON(),symbol:s.toJSON()};m(y)&&(p.popupInfo=y.toJSON()),t.push(p)}_normalizeObjectIds(t,e){const r=e.name;let o=ye(r,t)+1;const a=new Set;for(const s of t){s.attributes||(s.attributes={});const{attributes:y}=s;(y[r]==null||a.has(y[r]))&&(y[r]=o++),a.add(y[r])}}};i([n({readOnly:!0})],l.prototype,"capabilities",void 0),i([b(["portal-item","web-map"],"capabilities",["layers"])],l.prototype,"readCapabilities",null),i([n({readOnly:!0})],l.prototype,"featureCollections",void 0),i([b(["web-map","portal-item"],"featureCollections",["layers"])],l.prototype,"readFeatureCollections",null),i([n({readOnly:!0,json:{origins:{"web-map":{write:{enabled:!0,target:"featureCollection"}}}}})],l.prototype,"featureCollectionJSON",void 0),i([b(["web-map","portal-item"],"featureCollectionJSON",["featureCollection"])],l.prototype,"readLegacyfeatureCollectionJSON",null),i([n({readOnly:!0,json:{read:!0,write:{enabled:!0,ignoreOrigin:!0}}})],l.prototype,"featureCollectionType",void 0),i([n({readOnly:!0})],l.prototype,"fullExtent",null),i([n({readOnly:!0,json:{origins:{"web-map":{write:{target:"featureCollection.showLegend",overridePolicy(){return{enabled:this.featureCollectionJSON!=null}}}}}}})],l.prototype,"legendEnabled",void 0),i([n({type:["show","hide","hide-children"]})],l.prototype,"listMode",void 0),i([n({type:Number,nonNullable:!0,json:{write:!1}})],l.prototype,"minScale",void 0),i([b(["web-map","portal-item"],"minScale",["layers"])],l.prototype,"readMinScale",null),i([n({type:Number,nonNullable:!0,json:{write:!1}})],l.prototype,"maxScale",void 0),i([b(["web-map","portal-item"],"maxScale",["layers"])],l.prototype,"readMaxScale",null),i([n({readOnly:!0})],l.prototype,"multipointLayer",null),i([n({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],l.prototype,"operationalLayerType",void 0),i([n({readOnly:!0})],l.prototype,"pointLayer",null),i([n({readOnly:!0})],l.prototype,"polygonLayer",null),i([n({readOnly:!0})],l.prototype,"polylineLayer",null),i([n({type:O})],l.prototype,"spatialReference",void 0),i([b(["web-map","portal-item"],"spatialReference",["layers"])],l.prototype,"readSpatialReference",null),i([n({readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],l.prototype,"sublayers",void 0),i([b("web-map","sublayers",["layers"])],l.prototype,"readSublayers",null),i([ae("web-map","sublayers")],l.prototype,"writeSublayers",null),i([n({readOnly:!0})],l.prototype,"textLayer",null),i([n()],l.prototype,"title",void 0),i([n({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),l=i([E("esri.layers.MapNotesLayer")],l);const ce=l;export{ce as default}; +import{gG as M,a6 as i,a7 as n,a8 as E,iH as z,iF as A,e5 as x,jw as k,i2 as H,i3 as K,eF as W,eG as U,eH as Z,aT as O,cE as J,hZ as q,b4 as v,e$ as $,c as m,jx as L,e9 as w,jy as j,cJ as D,d1 as Q,j as f,n as V,hV as X,bK as Y,dF as ee,dD as te,dE as re,cI as oe,e2 as ie,ii as C,d2 as b,e0 as ae,cU as le,jz as ne,jA as R,cF as se}from"./index.221827cd.js";import{n as ye}from"./objectIdUtils.83ac3f67.js";function S(t){return t.featureCollectionType==="markup"||t.layers.some(e=>e.layerDefinition.visibilityField!=null||!F(e))}function F({layerDefinition:t,featureSet:e}){var o;const r=(o=t.geometryType)!=null?o:e.geometryType;return T.find(a=>{var s,y,p;return r===a.geometryTypeJSON&&((p=(y=(s=t.drawingInfo)==null?void 0:s.renderer)==null?void 0:y.symbol)==null?void 0:p.type)===a.identifyingSymbol.type})}function G(){return new le({xmin:-180,ymin:-90,xmax:180,ymax:90})}const I=new M({name:"OBJECTID",alias:"OBJECTID",type:"oid",nullable:!1,editable:!1}),pe=new M({name:"title",alias:"Title",type:"string",nullable:!0,editable:!0});let d=class extends ne{constructor(t){super(t),this.visibilityMode="inherited"}initialize(){for(const t of this.graphics)t.sourceLayer=this.layer;this.graphics.on("after-add",t=>{t.item.sourceLayer=this.layer}),this.graphics.on("after-remove",t=>{t.item.sourceLayer=null})}get fullExtent(){var r;const t=(r=this.layer)==null?void 0:r.spatialReference,e=this.fullBounds;return t?f(e)?w(G(),t).geometry:D(e,t):null}get fullBounds(){var r;const t=(r=this.layer)==null?void 0:r.spatialReference;if(!t)return null;const e=$();return this.graphics.forEach(o=>{const a=m(o.geometry)?w(o.geometry,t).geometry:null;m(a)&&L(e,a.type==="point"?a:a.extent,e)}),j(e,R)?null:e}get sublayers(){return this.graphics}};i([n({readOnly:!0})],d.prototype,"fullExtent",null),i([n({readOnly:!0})],d.prototype,"fullBounds",null),i([n({readOnly:!0})],d.prototype,"sublayers",null),i([n()],d.prototype,"layer",void 0),i([n()],d.prototype,"layerId",void 0),i([n({readOnly:!0})],d.prototype,"visibilityMode",void 0),d=i([E("esri.layers.MapNotesLayer.MapNotesSublayer")],d);const T=[{geometryType:"polygon",geometryTypeJSON:"esriGeometryPolygon",id:"polygonLayer",layerId:0,title:"Polygons",identifyingSymbol:new z().toJSON()},{geometryType:"polyline",geometryTypeJSON:"esriGeometryPolyline",id:"polylineLayer",layerId:1,title:"Polylines",identifyingSymbol:new A().toJSON()},{geometryType:"multipoint",geometryTypeJSON:"esriGeometryMultipoint",id:"multipointLayer",layerId:2,title:"Multipoints",identifyingSymbol:new x().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"pointLayer",layerId:3,title:"Points",identifyingSymbol:new x().toJSON()},{geometryType:"point",geometryTypeJSON:"esriGeometryPoint",id:"textLayer",layerId:4,title:"Text",identifyingSymbol:new k().toJSON()}];let l=class extends H(K(W(U(Z(se))))){constructor(t){super(t),this.capabilities={operations:{supportsMapNotesEditing:!0}},this.featureCollections=null,this.featureCollectionJSON=null,this.featureCollectionType="notes",this.legendEnabled=!1,this.listMode="hide-children",this.minScale=0,this.maxScale=0,this.spatialReference=O.WGS84,this.sublayers=new J(T.map(e=>new d({id:e.id,layerId:e.layerId,title:e.title,layer:this}))),this.title="Map Notes",this.type="map-notes",this.visibilityMode="inherited"}readCapabilities(t,e,r){return{operations:{supportsMapNotesEditing:!S(e)&&(r==null?void 0:r.origin)!=="portal-item"}}}readFeatureCollections(t,e,r){if(!S(e))return null;const o=e.layers.map(a=>{const s=new q;return s.read(a,r),s});return new J({items:o})}readLegacyfeatureCollectionJSON(t,e){return S(e)?v(e.featureCollection):null}get fullExtent(){var r;const t=this.spatialReference,e=$();return m(this.sublayers)?this.sublayers.forEach(({fullBounds:o})=>m(o)?L(e,o,e):e,e):(r=this.featureCollectionJSON)!=null&&r.layers.some(o=>o.layerDefinition.extent)&&this.featureCollectionJSON.layers.forEach(o=>{const a=w(o.layerDefinition.extent,t).geometry;m(a)&&L(e,a,e)}),j(e,R)?w(G(),t).geometry:D(e,t)}readMinScale(t,e){for(const r of e.layers)if(r.layerDefinition.minScale!=null)return r.layerDefinition.minScale;return 0}readMaxScale(t,e){for(const r of e.layers)if(r.layerDefinition.maxScale!=null)return r.layerDefinition.maxScale;return 0}get multipointLayer(){return this._findSublayer("multipointLayer")}get pointLayer(){return this._findSublayer("pointLayer")}get polygonLayer(){return this._findSublayer("polygonLayer")}get polylineLayer(){return this._findSublayer("polylineLayer")}readSpatialReference(t,e){return e.layers.length?O.fromJSON(e.layers[0].layerDefinition.spatialReference):O.WGS84}readSublayers(t,e,r){var s;if(S(e))return null;const o=[];let a=e.layers.reduce((y,p)=>{var u;return Math.max(y,(u=p.layerDefinition.id)!=null?u:-1)},-1)+1;for(const y of e.layers){const{layerDefinition:p,featureSet:u}=y,g=(s=p.id)!=null?s:a++,c=F(y);if(m(c)){const h=new d({id:c.id,title:p.name,layerId:g,layer:this,graphics:u.features.map(({geometry:N,symbol:_,attributes:P,popupInfo:B})=>Q.fromJSON({attributes:P,geometry:N,symbol:_,popupTemplate:B}))});o.push(h)}}return new J(o)}writeSublayers(t,e,r,o){var g;const{minScale:a,maxScale:s}=this;if(f(t))return;const y=t.some(c=>c.graphics.length>0);if(!this.capabilities.operations.supportsMapNotesEditing)return void(y&&((g=o==null?void 0:o.messages)==null?void 0:g.push(new V("map-notes-layer:editing-not-supported","New map notes cannot be added to this layer"))));const p=[];let u=this.spatialReference.toJSON();e:for(const c of t)for(const h of c.graphics)if(m(h.geometry)){u=h.geometry.spatialReference.toJSON();break e}for(const c of T){const h=t.find(N=>c.id===N.id);this._writeMapNoteSublayer(p,h,c,a,s,u,o)}X("featureCollection.layers",p,e)}get textLayer(){return this._findSublayer("textLayer")}load(t){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},t)),Promise.resolve(this)}read(t,e){"featureCollection"in t&&(t=v(t),Object.assign(t,t.featureCollection)),super.read(t,e)}async beforeSave(){if(f(this.sublayers))return;let t=null;const e=[];for(const o of this.sublayers)for(const a of o.graphics)if(m(a.geometry)){const s=a.geometry;t?Y(s.spatialReference,t)||(ee(s.spatialReference,t)||te()||await re(),a.geometry=oe(s,t)):t=s.spatialReference,e.push(a)}const r=await ie(e.map(o=>o.geometry));e.forEach((o,a)=>o.geometry=r[a])}_findSublayer(t){var e,r;return f(this.sublayers)?null:(r=(e=this.sublayers)==null?void 0:e.find(o=>o.id===t))!=null?r:null}_writeMapNoteSublayer(t,e,r,o,a,s,y){const p=[];if(!f(e)){for(const u of e.graphics)this._writeMapNote(p,u,r.geometryType,y);this._normalizeObjectIds(p,I),t.push({layerDefinition:{name:e.title,drawingInfo:{renderer:{type:"simple",symbol:v(r.identifyingSymbol)}},id:e.layerId,geometryType:r.geometryTypeJSON,minScale:o,maxScale:a,objectIdField:"OBJECTID",fields:[I.toJSON(),pe.toJSON()],spatialReference:s},featureSet:{features:p,geometryType:r.geometryTypeJSON}})}}_writeMapNote(t,e,r,o){var u,g;if(f(e))return;const{geometry:a,symbol:s,popupTemplate:y}=e;if(f(a))return;if(a.type!==r)return void((u=o==null?void 0:o.messages)==null?void 0:u.push(new C("map-notes-layer:invalid-geometry-type",`Geometry "${a.type}" cannot be saved in "${r}" layer`,{graphic:e})));if(f(s))return void((g=o==null?void 0:o.messages)==null?void 0:g.push(new C("map-notes-layer:no-symbol","Skipping map notes with no symbol",{graphic:e})));const p={attributes:{...e.attributes},geometry:a.toJSON(),symbol:s.toJSON()};m(y)&&(p.popupInfo=y.toJSON()),t.push(p)}_normalizeObjectIds(t,e){const r=e.name;let o=ye(r,t)+1;const a=new Set;for(const s of t){s.attributes||(s.attributes={});const{attributes:y}=s;(y[r]==null||a.has(y[r]))&&(y[r]=o++),a.add(y[r])}}};i([n({readOnly:!0})],l.prototype,"capabilities",void 0),i([b(["portal-item","web-map"],"capabilities",["layers"])],l.prototype,"readCapabilities",null),i([n({readOnly:!0})],l.prototype,"featureCollections",void 0),i([b(["web-map","portal-item"],"featureCollections",["layers"])],l.prototype,"readFeatureCollections",null),i([n({readOnly:!0,json:{origins:{"web-map":{write:{enabled:!0,target:"featureCollection"}}}}})],l.prototype,"featureCollectionJSON",void 0),i([b(["web-map","portal-item"],"featureCollectionJSON",["featureCollection"])],l.prototype,"readLegacyfeatureCollectionJSON",null),i([n({readOnly:!0,json:{read:!0,write:{enabled:!0,ignoreOrigin:!0}}})],l.prototype,"featureCollectionType",void 0),i([n({readOnly:!0})],l.prototype,"fullExtent",null),i([n({readOnly:!0,json:{origins:{"web-map":{write:{target:"featureCollection.showLegend",overridePolicy(){return{enabled:this.featureCollectionJSON!=null}}}}}}})],l.prototype,"legendEnabled",void 0),i([n({type:["show","hide","hide-children"]})],l.prototype,"listMode",void 0),i([n({type:Number,nonNullable:!0,json:{write:!1}})],l.prototype,"minScale",void 0),i([b(["web-map","portal-item"],"minScale",["layers"])],l.prototype,"readMinScale",null),i([n({type:Number,nonNullable:!0,json:{write:!1}})],l.prototype,"maxScale",void 0),i([b(["web-map","portal-item"],"maxScale",["layers"])],l.prototype,"readMaxScale",null),i([n({readOnly:!0})],l.prototype,"multipointLayer",null),i([n({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],l.prototype,"operationalLayerType",void 0),i([n({readOnly:!0})],l.prototype,"pointLayer",null),i([n({readOnly:!0})],l.prototype,"polygonLayer",null),i([n({readOnly:!0})],l.prototype,"polylineLayer",null),i([n({type:O})],l.prototype,"spatialReference",void 0),i([b(["web-map","portal-item"],"spatialReference",["layers"])],l.prototype,"readSpatialReference",null),i([n({readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],l.prototype,"sublayers",void 0),i([b("web-map","sublayers",["layers"])],l.prototype,"readSublayers",null),i([ae("web-map","sublayers")],l.prototype,"writeSublayers",null),i([n({readOnly:!0})],l.prototype,"textLayer",null),i([n()],l.prototype,"title",void 0),i([n({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),l=i([E("esri.layers.MapNotesLayer")],l);const ce=l;export{ce as default}; diff --git a/assets/MapNotesLayerView2D.8d6b9dc0.js b/assets/MapNotesLayerView2D.c9456f55.js similarity index 74% rename from assets/MapNotesLayerView2D.8d6b9dc0.js rename to assets/MapNotesLayerView2D.c9456f55.js index f4b45a4..70d273c 100644 --- a/assets/MapNotesLayerView2D.8d6b9dc0.js +++ b/assets/MapNotesLayerView2D.c9456f55.js @@ -1 +1 @@ -import{c as o,d1 as f,cE as w,_ as p,$ as n,c$ as y,j as _,a6 as V,a8 as v}from"./index.d94abe07.js";import{i as C}from"./utils.4b023c9d.js";import{r as b}from"./GroupContainer.b2a77ceb.js";import{y as H,u as T}from"./LayerView.42d17220.js";import{i as g}from"./GraphicContainer.618d10e5.js";import{o as d}from"./BaseGraphicContainer.6b1c597d.js";import"./Utils.7f6f3a6b.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.229b1dd6.js";import"./WGLContainer.1850619d.js";import"./pixelUtils.82950e1a.js";import"./VertexArrayObject.a4c1d809.js";import"./ProgramTemplate.e9a5aa54.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./ExpandedCIM.f0b7f36d.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.0d428d19.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.df11258c.js";import"./normalizeUtilsSync.757b5fd1.js";import"./projectionSupport.0542c13b.js";import"./json.879c9adc.js";import"./FeatureContainer.4ca52b51.js";import"./TileContainer.8b7fafe2.js";import"./visualVariablesUtils.32e27706.js";import"./visualVariablesUtils.aff73e6d.js";import"./Matcher.fe0c3dcf.js";import"./tileUtils.44921ab9.js";import"./TileClipper.8c399a8a.js";import"./Geometry.d049a63c.js";import"./devEnvironmentUtils.d8d0484c.js";import"./schemaUtils.69ad92d2.js";import"./createSymbolSchema.e54d2060.js";import"./util.ab699fea.js";import"./ComputedAttributeStorage.c1cb22b3.js";import"./centroid.cc817cc5.js";import"./vec3f32.1121a836.js";const m="sublayers",l="layerView",I=Object.freeze({remove(){},pause(){},resume(){}});let c=class extends H(T){constructor(){super(...arguments),this._highlightIds=new Map,this.container=new b}async fetchPopupFeatures(i){return Array.from(this.graphicsViews(),t=>t.hitTest(i).filter(e=>!!e.popupTemplate)).flat()}*graphicsViews(){o(this._graphicsViewsFeatureCollectionMap)?yield*this._graphicsViewsFeatureCollectionMap.keys():o(this._graphicsViews)?yield*this._graphicsViews:yield*[]}async hitTest(i,t){return Array.from(this.graphicsViews(),e=>{const r=e.hitTest(i);if(o(this._graphicsViewsFeatureCollectionMap)){const h=this._graphicsViewsFeatureCollectionMap.get(e);for(const s of r)!s.popupTemplate&&h.popupTemplate&&(s.popupTemplate=h.popupTemplate),s.sourceLayer=s.layer=this.layer}return r}).flat().map(e=>({type:"graphic",graphic:e,layer:this.layer,mapPoint:i}))}highlight(i){let t;return typeof i=="number"?t=[i]:i instanceof f?t=[i.uid]:Array.isArray(i)&&i.length>0?t=typeof i[0]=="number"?i:i.map(e=>e&&e.uid):w.isCollection(i)&&(t=i.map(e=>e&&e.uid).toArray()),t=t.filter(e=>e!=null),t.length?(this._addHighlight(t),{remove:()=>{this._removeHighlight(t)}}):I}update(i){for(const t of this.graphicsViews())t.processUpdate(i)}attach(){const i=this.view,t=()=>this.requestUpdate(),e=this.layer.featureCollections;if(o(e)&&e.length){this._graphicsViewsFeatureCollectionMap=new Map;for(const r of e){const h=new g(this.view.featuresTilingScheme),s=new d({view:i,graphics:r.source,renderer:r.renderer,requestUpdateCallback:t,container:h});this._graphicsViewsFeatureCollectionMap.set(s,r),this.container.addChild(s.container),this.handles.add([p(()=>r.visible,a=>s.container.visible=a,n),p(()=>s.updating,()=>this.notifyChange("updating"),n)],l)}this._updateHighlight()}else o(this.layer.sublayers)&&this.handles.add(y(()=>this.layer.sublayers,"change",()=>this._createGraphicsViews(),{onListenerAdd:()=>this._createGraphicsViews(),onListenerRemove:()=>this._destroyGraphicsViews()}),m)}detach(){this._destroyGraphicsViews(),this.handles.remove(m)}moveStart(){}moveEnd(){}viewChange(){for(const i of this.graphicsViews())i.viewChange()}isUpdating(){for(const i of this.graphicsViews())if(i.updating)return!0;return!1}_destroyGraphicsViews(){this.container.removeAllChildren(),this.handles.remove(l);for(const i of this.graphicsViews())i.destroy();this._graphicsViews=null,this._graphicsViewsFeatureCollectionMap=null}_createGraphicsViews(){if(this._destroyGraphicsViews(),_(this.layer.sublayers))return;const i=[],t=this.view,e=()=>this.requestUpdate();for(const r of this.layer.sublayers){const h=new C,s=new g(this.view.featuresTilingScheme);s.fadeTransitionEnabled=!0;const a=new d({view:t,graphics:r.graphics,requestUpdateCallback:e,container:s});this.handles.add([r.on("graphic-update",a.graphicUpdateHandler),p(()=>r.visible,u=>a.container.visible=u,n),p(()=>a.updating,()=>this.notifyChange("updating"),n)],l),h.addChild(a.container),this.container.addChild(h),i.push(a)}this._graphicsViews=i,this._updateHighlight()}_addHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight()}_removeHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;e===0?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight()}_updateHighlight(){const i=Array.from(this._highlightIds.keys());for(const t of this.graphicsViews())t.setHighlight(i)}};c=V([v("esri.views.2d.layers.MapNotesLayerView2D")],c);const wi=c;export{wi as default}; +import{c as o,d1 as f,cE as w,_ as p,$ as n,c$ as y,j as _,a6 as V,a8 as v}from"./index.221827cd.js";import{i as C}from"./utils.0160becb.js";import{r as b}from"./GroupContainer.f412d859.js";import{y as H,u as T}from"./LayerView.ce6e0535.js";import{i as g}from"./GraphicContainer.b0be80ad.js";import{o as d}from"./BaseGraphicContainer.7704bbc1.js";import"./Utils.2136650a.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.0cadabc1.js";import"./WGLContainer.347cc5cd.js";import"./pixelUtils.9c6f8dae.js";import"./VertexArrayObject.53cf1857.js";import"./ProgramTemplate.cf9dd4e8.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./ExpandedCIM.a372ce74.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.7ff797cc.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.3f71f8e9.js";import"./normalizeUtilsSync.4d52fbd0.js";import"./projectionSupport.4f5da4af.js";import"./json.879c9adc.js";import"./FeatureContainer.b427dd87.js";import"./TileContainer.5aeb32d6.js";import"./visualVariablesUtils.061b7a4e.js";import"./visualVariablesUtils.62efda9d.js";import"./Matcher.6586928a.js";import"./tileUtils.332711ed.js";import"./TileClipper.77103a2e.js";import"./Geometry.d049a63c.js";import"./devEnvironmentUtils.d8d0484c.js";import"./schemaUtils.d20994fa.js";import"./createSymbolSchema.827eb617.js";import"./util.520a352e.js";import"./ComputedAttributeStorage.29767acd.js";import"./centroid.06db4b74.js";import"./vec3f32.1121a836.js";const m="sublayers",l="layerView",I=Object.freeze({remove(){},pause(){},resume(){}});let c=class extends H(T){constructor(){super(...arguments),this._highlightIds=new Map,this.container=new b}async fetchPopupFeatures(i){return Array.from(this.graphicsViews(),t=>t.hitTest(i).filter(e=>!!e.popupTemplate)).flat()}*graphicsViews(){o(this._graphicsViewsFeatureCollectionMap)?yield*this._graphicsViewsFeatureCollectionMap.keys():o(this._graphicsViews)?yield*this._graphicsViews:yield*[]}async hitTest(i,t){return Array.from(this.graphicsViews(),e=>{const r=e.hitTest(i);if(o(this._graphicsViewsFeatureCollectionMap)){const h=this._graphicsViewsFeatureCollectionMap.get(e);for(const s of r)!s.popupTemplate&&h.popupTemplate&&(s.popupTemplate=h.popupTemplate),s.sourceLayer=s.layer=this.layer}return r}).flat().map(e=>({type:"graphic",graphic:e,layer:this.layer,mapPoint:i}))}highlight(i){let t;return typeof i=="number"?t=[i]:i instanceof f?t=[i.uid]:Array.isArray(i)&&i.length>0?t=typeof i[0]=="number"?i:i.map(e=>e&&e.uid):w.isCollection(i)&&(t=i.map(e=>e&&e.uid).toArray()),t=t.filter(e=>e!=null),t.length?(this._addHighlight(t),{remove:()=>{this._removeHighlight(t)}}):I}update(i){for(const t of this.graphicsViews())t.processUpdate(i)}attach(){const i=this.view,t=()=>this.requestUpdate(),e=this.layer.featureCollections;if(o(e)&&e.length){this._graphicsViewsFeatureCollectionMap=new Map;for(const r of e){const h=new g(this.view.featuresTilingScheme),s=new d({view:i,graphics:r.source,renderer:r.renderer,requestUpdateCallback:t,container:h});this._graphicsViewsFeatureCollectionMap.set(s,r),this.container.addChild(s.container),this.handles.add([p(()=>r.visible,a=>s.container.visible=a,n),p(()=>s.updating,()=>this.notifyChange("updating"),n)],l)}this._updateHighlight()}else o(this.layer.sublayers)&&this.handles.add(y(()=>this.layer.sublayers,"change",()=>this._createGraphicsViews(),{onListenerAdd:()=>this._createGraphicsViews(),onListenerRemove:()=>this._destroyGraphicsViews()}),m)}detach(){this._destroyGraphicsViews(),this.handles.remove(m)}moveStart(){}moveEnd(){}viewChange(){for(const i of this.graphicsViews())i.viewChange()}isUpdating(){for(const i of this.graphicsViews())if(i.updating)return!0;return!1}_destroyGraphicsViews(){this.container.removeAllChildren(),this.handles.remove(l);for(const i of this.graphicsViews())i.destroy();this._graphicsViews=null,this._graphicsViewsFeatureCollectionMap=null}_createGraphicsViews(){if(this._destroyGraphicsViews(),_(this.layer.sublayers))return;const i=[],t=this.view,e=()=>this.requestUpdate();for(const r of this.layer.sublayers){const h=new C,s=new g(this.view.featuresTilingScheme);s.fadeTransitionEnabled=!0;const a=new d({view:t,graphics:r.graphics,requestUpdateCallback:e,container:s});this.handles.add([r.on("graphic-update",a.graphicUpdateHandler),p(()=>r.visible,u=>a.container.visible=u,n),p(()=>a.updating,()=>this.notifyChange("updating"),n)],l),h.addChild(a.container),this.container.addChild(h),i.push(a)}this._graphicsViews=i,this._updateHighlight()}_addHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t);this._highlightIds.set(t,e+1)}else this._highlightIds.set(t,1);this._updateHighlight()}_removeHighlight(i){for(const t of i)if(this._highlightIds.has(t)){const e=this._highlightIds.get(t)-1;e===0?this._highlightIds.delete(t):this._highlightIds.set(t,e)}this._updateHighlight()}_updateHighlight(){const i=Array.from(this._highlightIds.keys());for(const t of this.graphicsViews())t.setHighlight(i)}};c=V([v("esri.views.2d.layers.MapNotesLayerView2D")],c);const wi=c;export{wi as default}; diff --git a/assets/Matcher.fe0c3dcf.js b/assets/Matcher.6586928a.js similarity index 98% rename from assets/Matcher.fe0c3dcf.js rename to assets/Matcher.6586928a.js index b2f856d..2fe3735 100644 --- a/assets/Matcher.fe0c3dcf.js +++ b/assets/Matcher.6586928a.js @@ -1 +1 @@ -import{n as rt,bN as Li,bc as Pi,j as V,c as E,bO as re,bP as ne,u as ae,I as x,bQ as Ti,s as mt,a1 as je,bo as oe,bR as zi,b3 as Ii,bu as $i,G as bt,bs as St,J as le,bd as Ct,aJ as Wi,K as Ci,bS as Ei,v as he,bT as Ai,bU as Qe,bV as Je,bW as Ri,bX as ki,bY as Fi,bZ as Bi,b_ as Se,b$ as Le,c0 as Pe,x as Vi,c1 as Te,c2 as Oi,at as ti,by as Di}from"./index.d94abe07.js";import{L as Ht,M as Gi,Q as st,h as Zi,j as ei,H as B,S as C,T as Ki,W as Ni,_ as Xi,$ as it,a0 as Ui,a1 as Hi,e as I,o as Lt,a2 as ii,a3 as Yi,a as ze,a4 as qi,a5 as si,a6 as Vt,a7 as ri}from"./enums.0295eb81.js";import{f as ji,p as Qi}from"./visualVariablesUtils.32e27706.js";import{b as P,G as Yt,x as k,e as M,f as Y,j as $,S as Ot,k as Ji,t as ts}from"./Utils.7f6f3a6b.js";import{l as es}from"./tileUtils.44921ab9.js";import{n as ni,r as is,c as ss,i as rs}from"./TileClipper.8c399a8a.js";import{U as qt,s as ns,r as ai,n as oi,i as as,a as os,Z as ls,c as hs,o as cs,N as ce,C as Et,w as ft,O as At,b as li,P as us,f as ue}from"./MaterialKey.229b1dd6.js";import{g as fs,f as _s,j as ds,h as Xt,n as Ie,m as ms,k as Pt,l as ps,T as ys,q as xs}from"./ExpandedCIM.f0b7f36d.js";import{M as jt}from"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import{s as hi}from"./Geometry.d049a63c.js";import{c as gs,a as Ms}from"./devEnvironmentUtils.d8d0484c.js";function F(n,t){if(n&&"name"in n){const e=n;return t&&t.error(new rt(e.name,e.message,e.details)),!1}return!0}const vs=1.25;class Tt{constructor(t,e){this._pos=0;const i=e?this._roundToNearest(e,t.BYTES_PER_ELEMENT):40;this._array=new ArrayBuffer(i),this._buffer=new t(this._array),this._ctor=t,this._i16View=new Int16Array(this._array)}get length(){return this._pos}_roundToNearest(t,e){const i=Math.round(t);return i+(e-i%e)}_ensureSize(t){if(this._pos+t>=this._buffer.length){const e=this._roundToNearest((this._array.byteLength+t*this._buffer.BYTES_PER_ELEMENT)*vs,this._buffer.BYTES_PER_ELEMENT),i=new ArrayBuffer(e),s=new this._ctor(i);s.set(this._buffer,0),this._array=i,this._buffer=s,this._i16View=new Int16Array(this._array)}}ensureSize(t){this._ensureSize(t)}writeF32(t){this._ensureSize(1);const e=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=t,this._pos++,e}push(t){this._ensureSize(1);const e=this._pos;return this._buffer[this._pos++]=t,e}writeFixed(t){this._buffer[this._pos++]=t}setValue(t,e){this._buffer[t]=e}i1616Add(t,e,i){this._i16View[2*t]+=e,this._i16View[2*t+1]+=i}getValue(t){return this._buffer[t]}incr(t){if(this._buffer.length{const r=1<=st-i?Ee:Ae|Ee)|(e<0+s?ke:e>=st-s?Re:ke|Re));this._current.overlaps|=r}_getVertexWriter(t){if(!this._data.self.has(t)){const e=this._data.self,i=Yt(t,this._symbologyType).geometry;e.set(t,new $e(t,i,this.hint.records))}return this._data.self.get(t)}}const G=0,Z=100;function Fe(n,t,e){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n}function ci(n,t){return Math.sqrt(n*n+t*t)}function Be(n){const t=ci(n[0],n[1]);n[0]/=t,n[1]/=t}function bs(n,t){return ci(n[0]-t[0],n[1]-t[1])}function w(n){return typeof n=="function"}function Qt(n=2){return 1/Math.max(n,1)}function J(n,t){return[!!n.minScale&&t.scaleToZoom(n.minScale)||G,!!n.maxScale&&t.scaleToZoom(n.maxScale)||Z]}function Ss(n,t){return n[t+1]}function ui(n){return n.length-1}function Ls(n){let t=0;for(let e=0;et._index||this._index===t._index&&this._distance>=t._distance}get _segment(){return this._segments[this._index+1]}get angle(){const t=this.dy,e=(0*t+-1*-this.dx)/(1*this.length);let i=Math.acos(e);return t>0&&(i=2*Math.PI-i),i}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:t,dy:e}=this;return Math.sqrt(t*t+e*e)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1t)return this._seekBackwards(t-s);s+=this.length}return this._distance=0,e?this:null}seek(t,e=!1){if(t<0)return this._seekBackwards(Math.abs(t),e);if(t<=this.remainingLength)return this._distance=(this.backwardLength+t)/this.length,this;let i=this.remainingLength;for(;this.next();){if(i+this.length>t)return this.seek(t-i,e);i+=this.length}return this._distance=1,e?this:null}}function Ts(n,t,e,i=!0){const s=Ls(n),r=Rt.create(n),a=s/2;if(!i)return r.seek(a),void e(r.clone(),0,a+0*t,s);const o=Math.max((s-t)/2,0),l=Math.floor(o/t),h=a-l*t;r.seek(h);for(let u=-l;u<=l;u++)r.x<512&&r.x>=0&&r.y<512&&r.y>=0&&e(r.clone(),u,a+u*t,s),r.seek(t)}function zs(n,t){const e=t;for(let i=0;i=0&&!(s[d+1]s[c]+u);d++){const y=u-s[d-1]+s[c],p=s[d]-s[d-1],g=s[d]-s[c]class extends n{constructor(...t){super(...t),this._isCIM=!1,this._vertexBoundsScale=1,this.geometryType=P.TEXT,this._aux=k(0,0,this._referenceSize,this._bitset)}bindTextInfo(t,e){t&&t.length?this._shapingInfo=Pi(t,i=>ds(i,e,{scale:this._scale,angle:this._angle,xOffset:this._xOffset,yOffset:this._yOffset,hAlign:this._xAlignD,vAlign:this._yAlignD,maxLineWidth:Math.max(32,Math.min(this._lineWidth,512)),lineHeight:Zi*Math.max(.25,Math.min(this._lineHeight,4)),decoration:this._decoration,isCIM:this._isCIM})):this._shapingInfo=null}_write(t,e,i,s){const r=e.getDisplayId();this._writeGeometry(t,e,r,i,s)}_writeGeometry(t,e,i,s,r){const a=this._shapingInfo;if(V(a))return;if(E(this._textPlacement)){const l=r!=null?r:e.readLegacyGeometryForDisplay();return this._writePlacedText(t,i,l,a,s)}const o=r?re(ne(r),2):e.geometryType==="esriGeometryPolygon"?e.readCentroid():e.readGeometryForDisplay();if(!V(o)){if(o.isPoint){const[l,h]=o.coords;return!t.hasAggregates&&t.hasPixelBufferEnabled&&(l<0||l>=512||h<0||h>=512)?void 0:this._writeGlyphs(t,i,{x:l,y:h},a)}o.forEachVertex((l,h)=>this._writeGlyphs(t,i,{x:l,y:h},a))}}_writePlacedText(t,e,i,s,r){const a=ae(this._textPlacement),o=fi.getPlacement(i,a,x(1),r.geometryEngine);if(!o)return;let l=o.next();for(;l!=null;){const h=-l.getAngle();s.setRotation(h);const u=l.tx,c=-l.ty;u<0||u>=512||c<0||c>=512||(this._writeGlyphs(t,e,{x:u,y:c},s),s.setRotation(-h)),l=o.next()}}_writeGlyphs(t,e,i,s){const r=qt.load(this._materialKey),a=M(Math.round(zt*i.x),Math.round(zt*i.y)),o=this._vertexBoundsScale,l=s.bounds,h=2*Math.max(l.width,l.height);for(const u of s.glyphs)r.textureBinding=u.textureBinding,t.recordStart(e,r.data,this.geometryType,!0),t.vertexBounds(i.x+l.x+this._xOffset,i.y+l.y-this._yOffset,h*o,h*o),this._writeVertices(t,e,a,u),t.recordEnd()}_writeGlyph(t,e,i,s,r){const a=qt.load(this._materialKey),o=M(Math.round(zt*i),Math.round(zt*s));a.textureBinding=r.textureBinding,t.recordStart(e,a.data,this.geometryType,!0);const l=r.bounds,h=this._vertexBoundsScale;t.vertexBounds(i+l.x*h,s+l.y*h,l.width*h,l.height*h),this._writeVertices(t,e,o,r),t.recordEnd()}_writeVertices(t,e,i,s){const r=t.vertexCount();this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.upperLeft),t.vertexWrite(s.texcoords.upperLeft),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.upperRight),t.vertexWrite(s.texcoords.upperRight),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.lowerLeft),t.vertexWrite(s.texcoords.lowerLeft),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.lowerRight),t.vertexWrite(s.texcoords.lowerRight),t.vertexEnd(),t.indexWrite(r+0),t.indexWrite(r+1),t.indexWrite(r+2),t.indexWrite(r+1),t.indexWrite(r+3),t.indexWrite(r+2)}_writeVertexCommon(t,e,i,s){const r=this._color,a=this._haloColor,o=k(0,0,this._referenceSize,this._bitset),l=k(0,0,this._size,this._haloSize);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(a),t.vertexWrite(l),t.vertexWrite(o),t.vertexWrite(this._minMaxZoom)}};class wt{bindFeature(t,e,i){}write(t,e,i,s){var o;if(V(this._effects)||((o=this._effects)==null?void 0:o.length)===0)return this._write(t,e,s);const r=Xt.executeEffects(this._effects,e.readLegacyGeometryForDisplay(),s.geometryEngine);let a=Xt.next(r);for(;a;)this._write(t,e,s,a),a=Xt.next(r)}_write(t,e,i,s){}}const $s=5;class _t extends _i(wt){constructor(t,e,i,s,r,a,o,l,h,u,c,_,f,m,d,y,p,g,v=!1,b,L){super(),this._xOffset=x(f),this._yOffset=x(m),this._decoration=u||"none",this._color=r,this._haloColor=a,this._haloSize=Math.min(Math.floor($s*x(Ti(i))),127),this._size=Math.min(Math.round(x(e)),127);const S=Math.min(Math.round(x(s||e)),127);this._referenceSize=Math.round(Math.sqrt(256*S)),this._scale=this._size/ei,this._angle=_,this._justify=ns(o||"center"),this._xAlignD=ai(o||"center"),this._yAlignD=oi(l||"baseline"),this._baseline=(l||"baseline")==="baseline",this._bitset=(h===B.MAP?1:0)|(c?1:0)<<1;const T=qt.load(t);T.sdf=!0,this._materialKey=T.data,this._lineWidth=x(d)||512,this._lineHeight=y||1,this._textPlacement=p,this._effects=g,this._isCIM=v,this._minMaxZoom=M(Math.round(b*C),Math.round(L*C))}static fromText(t,e){const i=new _t(t.materialKey,t.font.size,t.haloSize||0,t.font.size,t.color&&Y(t.color)||0,t.haloColor&&Y(t.haloColor)||0,t.horizontalAlignment,t.verticalAlignment,B.SCREEN,t.font.decoration,!1,t.angle||0,t.xoffset,t.yoffset,t.lineWidth,t.lineHeight,null,null,!1,G,Z),[,s]=Ie(t.text);return i.bindTextInfo(e,s),i._vertexBoundsScale=t.maxVVSize?t.maxVVSize/t.font.size:1,i}static fromCIMText(t,e,i){const s=t.scaleFactor||1,r=t.size*t.sizeRatio*s,[a,o]=J(t.scaleInfo,i),l=new _t(t.materialKey,r,t.outlineSize*t.sizeRatio,t.referenceSize,$(t.color),$(t.outlineColor),t.horizontalAlignment,t.verticalAlignment,t.alignment,t.decoration,t.colorLocked,t.angle,t.offsetX*t.sizeRatio*s,t.offsetY*t.sizeRatio*s,512,1,t.markerPlacement,t.effects,!0,a,o),[,h]=Ie(t.text);return l.bindTextInfo(e,h),l._vertexBoundsScale=t.maxVVSize?t.maxVVSize/r:1,l}}const Ws=mt.getLogger("esri.views.2d.engine.webgl.WGLLabelTemplate"),Cs=(n,t="mapview-labeling")=>Ws.error(new rt(t,n)),It=1,ot=0,Es=4,Ve=25;function As(n,t){const e=!!n.minScale&&t.scaleToZoom(n.minScale)||0;return je(e,0,25.5)}function Rs(n,t){const e=!!n.maxScale&&t.scaleToZoom(n.maxScale)||255;return je(e,0,25.5)}function ks(n){const t=new Map;return e=>(t.has(e)||t.set(e,n(e)),t.get(e))}const Fs=ks(n=>{let t=0;if(n===0)return 1/0;for(;!(n%2);)t++,n/=2;return t}),$t=n=>Math.floor(127*n+127),pt=n=>Math.floor(10*n),lt=n=>Math.round(n*(254/360));class kt extends _t{constructor(t,e,i,s){var c,_,f;super(t,i.font.size,i.haloSize||0,i.font.size,i.color&&Y(i.color)||0,i.haloColor&&Y(i.haloColor)||0,i.horizontalAlignment,i.verticalAlignment,as(e.labelPlacement)?B.MAP:B.SCREEN,i.font.decoration,!1,i.angle||0,i.xoffset,i.yoffset,i.lineWidth,i.lineHeight,null,null,null,null,null),this._outLineLabelAngle=0,this._refPlacementPadding=0,this._refPlacementDirX=0,this._refPlacementDirY=0,this._refOffsetX=0,this._refOffsetY=0,this._zoomLevel=0,this.geometryType=P.LABEL,this._allowOverrun=(c=e.allowOverrun)!=null?c:!1,this._repeatLabel=(_=e.repeatLabel)!=null?_:!0,this._labelPosition=(f=e.labelPosition)!=null?f:"curved";const r=As(e,s),a=Rs(e,s),o=e.labelPlacement,[l,h]=os(o);this._xAlignD=l,this._yAlignD=h,this._minZoom=r,this._maxZoom=a,this._refPlacementPadding=x(i.haloSize)+Ki,this._repeatLabelDistance=e.repeatLabelDistance?x(e.repeatLabelDistance):128;const u=ls.load(t);u.sdf=!0,this._materialKey=u.data}static fromLabelClass(t,e){if(t.labelPlacement==="esriServerLinePlacementCenterAlong"){const i=t.symbol;i.xoffset=0,i.yoffset=0,i.angle=0,i.font.decoration="none"}return new kt(t.materialKey,t,t.symbol,e)}get _shapedBox(){return ae(this._shapingInfo).bounds}setZoomLevel(t){this._zoomLevel=t}bindReferenceTemplate(t){let e=hs(this._xAlignD),i=cs(this._yAlignD);if(this._refOffsetX=0,this._refOffsetY=0,V(t))return void(this._refSymbolAndPlacementOffset=k(0,0,$t(e),$t(i)));if(t.boundsType==="circle"&&(e||i)){const a=Math.sqrt(e*e+i*i);e/=a,i/=a}const s=Math.max(t.height,t.width),r=this._refPlacementPadding*Es;this._refSymbolAndPlacementOffset=k(r,s,$t(e),$t(i)),this._referenceSize=s,this._refPlacementDirX=e,this._refPlacementDirY=i,this._refOffsetX=t.xOffset,this._refOffsetY=t.yOffset}_write(t,e){if(V(this._shapingInfo))return;const i=this._shapingInfo,s=e.getDisplayId(),r=e.geometryType==="esriGeometryPolygon"?e.readLegacyCentroid():e.readLegacyGeometry();if(r)switch(this._current={out:t,inId:s,inShaping:i,zoomLevel:this._zoomLevel},e.geometryType){case"esriGeometryPolyline":this._placeLineLabels(r);break;case"esriGeometryPoint":case"esriGeometryPolygon":this._placePointLabels(r);break;default:Cs("mapview-labeling",`Geometry of type ${e.geometryType} is not supported`)}}_isVisible(t,e){const i=pt(this._current.zoomLevel);return pt(t)<=i&&i<=pt(e)}_placePointLabels(t){const{out:e,inId:i,inShaping:s}=this._current;this._writeGlyphs(e,i,t,s)}_placeLineLabels(t){const e=zs(t.paths,this._current.inShaping.bounds.width),i=this._placeSubdivGlyphs.bind(this),s=(this._shapedBox.width+this._repeatLabelDistance)/(1<=s);)this._placeOnSegment(a,e,o,i,-1,r),o+=a.length+ot}_placeForward(t,e,i,s,r){const a=t.clone();let o=t.remainingLength+ot;for(;a.next()&&!(o>=s);)this._placeOnSegment(a,e,o,i,1,r),o+=a.length+ot}_placeFirst(t,e,i,s=!1){const r=t,a=this._current.inShaping,o=a.glyphs,l=this._current.zoomLevel,{out:h,inId:u}=this._current;for(const c of o){const _=c.x>a.bounds.x?i:1-i,f=_*t.remainingLength+(1-_)*t.backwardLength,m=Math.abs(c.x+c.width/2-a.bounds.x),d=Math.max(0,l+Math.log2(m/(f+ot))),y=Math.max(e,s?0:d);if(c.maxZoom=Ve,c.angle=t.angle+(1-i)*Math.PI,c.minZoom=y,this._writeGlyph(h,u,r.x,r.y,c),i&&this._isVisible(c.minZoom,c.maxZoom)){const p=c.bounds;h.metricBoxWrite(p.center[0],p.center[1],p.width,p.height)}}}_placeOnSegment(t,e,i,s,r,a){const o=this._current.inShaping.glyphs,{out:l,inId:h}=this._current,u=this._current.inShaping,c=this._current.zoomLevel,_=t.dx/t.length,f=t.dy/t.length,m={x:t.x+i*-r*_,y:t.y+i*-r*f};for(const d of o){const y=d.x>u.bounds.x?a:1-a;if(!(y&&r===1||!y&&r===-1))continue;const p=Math.abs(d.x+d.width/2-u.bounds.x),g=Math.max(0,c+Math.log2(p/i)-.1),v=Math.max(s,c+Math.log2(p/(i+t.length+ot)));if(g!==0&&(d.angle=t.angle+(1-a)*Math.PI,d.minZoom=v,d.maxZoom=g,this._writeGlyph(l,h,m.x,m.y,d),a&&this._isVisible(d.minZoom,d.maxZoom))){const b=d.bounds,L=t.x-e.x,S=t.y-e.y;l.metricBoxWrite(b.center[0]+L,b.center[1]+S,b.width,b.height)}}}_writeGlyphs(t,e,i,s,r=this._minZoom){if(i.x<0||i.x>=512||i.y<0||i.y>=512)return;const a=i.x+this._refOffsetX,o=i.y-this._refOffsetY;for(const c of s.glyphs)c.minZoom=r,c.maxZoom=this._maxZoom,this._writeGlyph(t,e,a,o,c);const l=this._refPlacementDirX,h=this._refPlacementDirY,u=s.boundsT;t.metricStart(e,r,a,o,l,h,this._referenceSize,this._materialKey),t.metricBoxWrite(u.center[0],u.center[1],u.width,u.height),t.metricEnd()}_writeVertexCommon(t,e,i,s){const r=this._color,a=this._haloColor,o=k(0,0,this._size,this._haloSize),l=Math.max(s.minZoom,this._minZoom),h=Math.min(s.maxZoom,this._maxZoom),u=k(pt(l),pt(h),this._outLineLabelAngle,0);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(a),t.vertexWrite(o),t.vertexWrite(this._refSymbolAndPlacementOffset),t.vertexWrite(u)}}const Oe=3.14159265359/180,De=8,di=n=>class extends n{constructor(...t){super(...t),this.angle=0,this.xOffset=0,this.yOffset=0,this.width=0,this.height=0,this.boundsType="square",this._anchorX=0,this._anchorY=0,this._computedWidth=0,this._computedHeight=0,this._vertexBoundsScaleX=1,this._vertexBoundsScaleY=1,this._offsets={xUpperLeft:0,yUpperLeft:0,xUpperRight:0,yUpperRight:0,xBottomLeft:0,yBottomLeft:0,xBottomRight:0,yBottomRight:0},this.geometryType=P.MARKER}_write(t,e,i,s){const r=e.getDisplayId();t.recordStart(r,this._materialKey,this.geometryType,!0),this._writeGeometry(t,e,r,i,s),t.recordEnd()}_writeGeometry(t,e,i,s,r){if(E(this._markerPlacement))return this._writePlacedMarkers(t,e,s,r);if(!r&&e.geometryType==="esriGeometryPoint"){const o=e.getX(),l=e.getY();return!t.hasAggregates&&t.hasPixelBufferEnabled&&(o<0||o>=513||l<0||l>=513)?void 0:this._writeVertices(t,i,this._getPos(o,l),o,l)}const a=r?re(ne(r),2):e.geometryType==="esriGeometryPolygon"?e.readCentroid():e.readGeometryForDisplay();if(!V(a)){if(a.isPoint){const[o,l]=a.coords;return!t.hasAggregates&&t.hasPixelBufferEnabled&&(o<0||o>=512||l<0||l>=512)?void 0:this._writeVertices(t,i,this._getPos(o,l),o,l)}a.forEachVertex((o,l)=>{const h=2*st;o<-h||o>=h||l<-h||l>=h||this._writeVertices(t,i,this._getPos(o,l),o,l)})}}_writePlacedMarkers(t,e,i,s){const r=s!=null?s:e.readLegacyGeometryForDisplay(),a=fi.getPlacement(r,ae(this._markerPlacement),x(1),i.geometryEngine);if(!a)return;const o=e.getDisplayId(),l=le(),h=oe(),u=-128,c=640;let _=a.next();for(;_!=null;){const f=_.tx,m=-_.ty;f>=u&&f<=c&&m>=u&&m<=c&&(this._applyTransformation(h,l,-_.getAngle()/Oe),this._writeVertices(t,o,this._getPos(f,m),f,m)),_=a.next()}}_writeVertices(t,e,i,s,r){const a=ce.load(this._materialKey);return a.symbologyType===Ot.HEATMAP?this._writeHeatmapVertices(t,e,i):this._writeMarkerVertices(t,e,a,i,s,r)}_writeMarkerVertices(t,e,i,s,r,a){const o=i.vvRotation,l=t.vertexCount();let h=this._computedWidth*this._vertexBoundsScaleX,u=this._computedHeight*this._vertexBoundsScaleY;if(this.angle){const c=Math.max(h,u);h=c,u=c}if(o){const c=Math.max(this.xOffset,this.yOffset);h+=c,u+=c}t.vertexBounds(r+this.xOffset,a-this.yOffset,h,u),t.vertexWrite(s),t.vertexWrite(this._offsetUpperLeft),t.vertexWrite(this._texUpperLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(s),t.vertexWrite(this._offsetUpperRight),t.vertexWrite(this._texUpperRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(s),t.vertexWrite(this._offsetBottomLeft),t.vertexWrite(this._texBottomLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(s),t.vertexWrite(this._offsetBottomRight),t.vertexWrite(this._texBottomRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),this._writeIndices(t,l)}_writeHeatmapVertices(t,e,i){const s=t.vertexCount();t.vertexWrite(i),t.vertexWrite(this._offsetUpperLeft),t.vertexWrite(e),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetUpperRight),t.vertexWrite(e),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomLeft),t.vertexWrite(e),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomRight),t.vertexWrite(e),t.vertexEnd(),this._writeIndices(t,s)}_writeIndices(t,e){t.indexWrite(e+0),t.indexWrite(e+1),t.indexWrite(e+2),t.indexWrite(e+1),t.indexWrite(e+3),t.indexWrite(e+2)}_applyTransformation(t,e,i=0){zi(t,Ii(this.xOffset,-this.yOffset)),this.angle+i!==0&&$i(t,t,Oe*(this.angle+i));const s=this._computedWidth,r=this._computedHeight,a=-(.5+this._anchorX)*s,o=-(.5-this._anchorY)*r;bt(e,a,o),St(e,e,t),this._offsetUpperLeft=M(16*e[0],16*e[1]),this._offsets.xUpperLeft=e[0],this._offsets.yUpperLeft=e[1],bt(e,a+s,o),St(e,e,t),this._offsetUpperRight=M(16*e[0],16*e[1]),this._offsets.xUpperRight=e[0],this._offsets.yUpperRight=e[1],bt(e,a,o+r),St(e,e,t),this._offsetBottomLeft=M(16*e[0],16*e[1]),this._offsets.xBottomLeft=e[0],this._offsets.yBottomLeft=e[1],bt(e,a+s,o+r),St(e,e,t),this._offsetBottomRight=M(16*e[0],16*e[1]),this._offsets.xBottomRight=e[0],this._offsets.yBottomRight=e[1]}_getPos(t,e){return M(Math.round(De*t),Math.round(De*e))}};class D extends di(wt){constructor(t,e,i,s,r,a,o,l,h,u,c,_,f,m,d,y,p,g,v,b,L,S,T){super(),this.angle=s,this.height=o,this.width=a,this.xOffset=e*v,this.yOffset=i*v,this._markerPlacement=b,this._effects=L,this._anchorX=y,this._anchorY=p,this._minMaxZoom=M(Math.round(S*C),Math.round(T*C));const z=(m===B.MAP?Ni:Xi)|(c?it:0)|(f?Ui:0)|(_?Hi:0),N=d&&d.sdf,q=ce.load(t);q.sdf=N,q.pattern=!0,q.textureBinding=d.textureBinding,this._materialKey=q.data,this._fillColor=r,this._outlineColor=h,this._sizeOutlineWidth=k(Math.round(Math.min(Math.sqrt(128*a),255)),Math.round(Math.min(Math.sqrt(128*o),255)),Math.round(Math.min(Math.sqrt(128*u),255)),Math.round(Math.min(Math.sqrt(128*l),255)));const j=d.rect.x+I,O=d.rect.y+I,nt=j+d.width,at=O+d.height;this._offsets.xUpperLeft=j,this._offsets.yUpperLeft=O,this._offsets.xUpperRight=nt,this._offsets.yUpperRight=O,this._offsets.xBottomLeft=j,this._offsets.yBottomLeft=at,this._offsets.xBottomRight=nt,this._offsets.yBottomRight=at,q.symbologyType===Ot.PIE_CHART?(this._texUpperLeft=M(0,1),this._texUpperRight=M(1,1),this._texBottomLeft=M(0,0),this._texBottomRight=M(1,0)):(this._texUpperLeft=M(j,O),this._texUpperRight=M(nt,O),this._texBottomLeft=M(j,at),this._texBottomRight=M(nt,at)),a*=g,o*=g,a*=v,o*=v;const wi=Math.round(64*g);this._bitestAndDistRatio=M(z,wi),this._computedWidth=a,this._computedHeight=o;const bi=le(),Si=oe();this._applyTransformation(Si,bi)}static fromCIMMarker(t,e,i){const s=e&&e.width||1,r=e&&e.height||1,a=t.size,o=s/r*t.scaleX,l=t.scaleSymbolsProportionally&&t.frameHeight?a/t.frameHeight:1;let h=$(t.color);const u=$(t.outlineColor),c=x(a),_=c*o,f=x(t.offsetX||0),m=x(t.offsetY||0),d=x(t.outlineWidth||0)*l,y=t.alignment||B.SCREEN,p=x(t.referenceSize),[g,v]=J(t.scaleInfo,i);e.sdf||h!==0||(h=-1);let b=t.rotation||0;t.rotateClockwise||(b=-b);let L=0,S=0;const T=t.anchorPoint;T&&(t.isAbsoluteAnchorPoint?a&&(L=T.x/(a*o),S=T.y/a):(L=T.x,S=T.y));const z=new D(t.materialKey,f,m,b,h,_,c,p,u,d,t.colorLocked,t.scaleSymbolsProportionally,!1,y,e,L,S,t.sizeRatio,Ct(t.scaleFactor,1),t.markerPlacement,t.effects,g,v);return z._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/_:1,z._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/c:1,z}static fromPictureMarker(t,e){const i=Math.round(x(t.width)),s=Math.round(x(t.height)),r=ii,a=Math.round(x(t.xoffset||0)),o=Math.round(x(t.yoffset||0)),l=new D(t.materialKey,a,o,t.angle,r,i,s,s,0,0,!1,!1,!1,B.SCREEN,e,0,0,1,1,null,null,G,Z);return l._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.width:1,l._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.height:1,l}static fromSimpleMarker(t,e){const i=Y(t.color),s=Math.round(x(t.size)),r=s,a=Math.round(x(t.xoffset||0)),o=Math.round(x(t.yoffset||0)),l=t.style,h=t.outline,u=0|(h&&h.color&&Y(h.color)),c=0|(h&&h.width&&Math.round(x(h.width))),_=new D(t.materialKey,a,o,t.angle,i,s,r,r,u,c,!1,!1,l==="esriSMSCross"||l==="esriSMSX",B.SCREEN,e,0,0,126/64,1,null,null,G,Z);return _.boundsType=l==="esriSMSCircle"?"circle":"square",_._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.size:1,_._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.size:1,_}static fromLineSymbolMarker(t,e){const i=Y(t.color),s=6,r=Math.round(x(s*t.lineWidth)),a=r,o=t.style==="cross"||t.style==="x";let l;switch(t.placement){case"begin-end":l=Lt.Both;break;case"begin":l=Lt.JustBegin;break;case"end":l=Lt.JustEnd;break;default:l=Lt.None}const h={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:l,offsetAlongLine:0},u=new D(t.materialKey,0,0,0,i,r,a,a/s,i,o?Math.round(x(t.lineWidth)):0,!1,!1,o,B.MAP,e,0,0,126/64,1,h,null,G,Z);return u.boundsType=t.style==="circle"?"circle":"square",u}}function Bs(n,t,e,i,s,r,a){ee=0;const o=(i-e)*r,l=s&&s.length,h=l?(s[0]-e)*r:o;let u,c,_,f,m,d=mi(t,e,i,0,h,r,!0);if(d&&d.next!==d.prev){if(l&&(d=Gs(t,e,i,s,d,r)),o>80*r){u=_=t[0+e*r],c=f=t[1+e*r];for(let y=r;y0)for(let l=i;l=i;l-=r)o=Ge(l+t*r,n[l+t*r],n[l+1+t*r],o);return o&&et(o,o.next)&&(Mt(o),o=o.next),o}function xt(n,t=n){if(!n)return n;let e,i=n;do if(e=!1,i.steiner||!et(i,i.next)&&W(i.prev,i,i.next)!==0)i=i.next;else{if(Mt(i),i=t=i.prev,i===i.next)break;e=!0}while(e||i!==t);return t}function gt(n,t,e,i,s,r,a,o){if(!n)return;!o&&r&&(n=pi(n,i,s,r));let l=n;for(;n.prev!==n.next;){const h=n.prev,u=n.next;if(r?Os(n,i,s,r):Vs(n))t.push(h.index/e+a),t.push(n.index/e+a),t.push(u.index/e+a),Mt(n),n=u.next,l=u.next;else if((n=u)===l){o?o===1?gt(n=Ys(n,t,e,a),t,e,i,s,r,a,2):o===2&&qs(n,t,e,i,s,r,a):gt(xt(n),t,e,i,s,r,a,1);break}}}function Vs(n){const t=n.prev,e=n,i=n.next;if(W(t,e,i)>=0)return!1;let s=n.next.next;const r=s;let a=0;for(;s!==n.prev&&(a===0||s!==r);){if(a++,ut(t.x,t.y,e.x,e.y,i.x,i.y,s.x,s.y)&&W(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function Os(n,t,e,i){const s=n.prev,r=n,a=n.next;if(W(s,r,a)>=0)return!1;const o=s.xr.x?s.x>a.x?s.x:a.x:r.x>a.x?r.x:a.x,u=s.y>r.y?s.y>a.y?s.y:a.y:r.y>a.y?r.y:a.y,c=Jt(o,l,t,e,i),_=Jt(h,u,t,e,i);let f=n.prevZ,m=n.nextZ;for(;f&&f.z>=c&&m&&m.z<=_;){if(f!==n.prev&&f!==n.next&&ut(s.x,s.y,r.x,r.y,a.x,a.y,f.x,f.y)&&W(f.prev,f,f.next)>=0||(f=f.prevZ,m!==n.prev&&m!==n.next&&ut(s.x,s.y,r.x,r.y,a.x,a.y,m.x,m.y)&&W(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;f&&f.z>=c;){if(f!==n.prev&&f!==n.next&&ut(s.x,s.y,r.x,r.y,a.x,a.y,f.x,f.y)&&W(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;m&&m.z<=_;){if(m!==n.prev&&m!==n.next&&ut(s.x,s.y,r.x,r.y,a.x,a.y,m.x,m.y)&&W(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function Ge(n,t,e,i){const s=dt.create(n,t,e);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function Mt(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Ds(n){let t=n,e=n;do(t.x=e.next.y&&e.next.y!==e.y){const _=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(_<=i&&_>a){if(a=_,_===i){if(s===e.y)return e;if(s===e.next.y)return e.next}r=e.x=e.x&&e.x>=l&&i!==e.x&&ut(sr.x)&&vt(e,n)&&(r=e,c=u)),e=e.next;return r}function pi(n,t,e,i){for(let s;s!==n;s=s.next){if(s=s||n,s.z===null&&(s.z=Jt(s.x,s.y,t,e,i)),s.prev.next!==s||s.next.prev!==s)return s.prev.next=s,s.next.prev=s,pi(n,t,e,i);s.prevZ=s.prev,s.nextZ=s.next}return n.prevZ.nextZ=null,n.prevZ=null,Ns(n)}function Ns(n){let t,e=1;for(;;){let i,s=n;n=null,t=null;let r=0;for(;s;){r++,i=s;let a=0;for(;a0||o>0&&i;){let l;a===0?(l=i,i=i.nextZ,o--):o!==0&&i?s.z<=i.z?(l=s,s=s.nextZ,a--):(l=i,i=i.nextZ,o--):(l=s,s=s.nextZ,a--),t?t.nextZ=l:n=l,l.prevZ=t,t=l}s=i}if(t.nextZ=null,e*=2,r<2)return n}}function W(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function yi(n,t,e,i){return!!(et(n,t)&&et(e,i)||et(n,i)&&et(e,t))||W(n,t,e)>0!=W(n,t,i)>0&&W(e,i,n)>0!=W(e,i,t)>0}function Xs(n,t){let e=n;do{if(e.index!==n.index&&e.next.index!==n.index&&e.index!==t.index&&e.next.index!==t.index&&yi(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function Us(n,t,e,i,s,r){let a=0;for(let o=i,l=s-r;o=0&&(n-a)*(i-o)-(e-a)*(t-o)>=0&&(e-a)*(r-o)-(s-a)*(i-o)>=0}function vt(n,t){return W(n.prev,n,n.next)<0?W(n,t,n.next)>=0&&W(n,n.prev,t)>=0:W(n,t,n.prev)<0||W(n,n.next,t)<0}function Jt(n,t,e,i,s){return(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-e)*s)|n<<8))|n<<4))|n<<2))|n<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*s)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function et(n,t){return n.x===t.x&&n.y===t.y}function Hs(n,t){return n.x-t.x}function Ys(n,t,e,i){let s=n;do{const r=s.prev,a=s.next.next;!et(r,a)&&yi(r,s,s.next,a)&&vt(r,a)&&vt(a,r)&&(t.push(r.index/e+i),t.push(s.index/e+i),t.push(a.index/e+i),Mt(s),Mt(s.next),s=n=a),s=s.next}while(s!==n);return s}function qs(n,t,e,i,s,r,a){let o=n;do{let l=o.next.next;for(;l!==o.prev;){if(o.index!==l.index&&js(o,l)){let h=xi(o,l);return o=xt(o,o.next),h=xt(h,h.next),gt(o,t,e,i,s,r,a,0),void gt(h,t,e,i,s,r,a,0)}l=l.next}o=o.next}while(o!==n)}function js(n,t){return n.next.index!==t.index&&n.prev.index!==t.index&&!Xs(n,t)&&vt(n,t)&&vt(t,n)&&Qs(n,t)}function Qs(n,t){let e=n,i=!1;const s=(n.x+t.x)/2,r=(n.y+t.y)/2;do e.y>r!=e.next.y>r&&e.next.y!==e.y&&s<(e.next.x-e.x)*(r-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==n);return i}function xi(n,t){const e=dt.create(n.index,n.x,n.y),i=dt.create(t.index,t.x,t.y),s=n.next,r=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,i.next=e,e.prev=i,r.next=i,i.prev=r,i}class dt{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(t,e,i){const s=ee0))break;c+=p,_.push(o+u),u+=y}const f=a.length;Bs(a,e,o,o+u,_,2,r);const m=er(a,e,f,a.length,r),d=Math.abs(c);if(Math.abs((m-d)/Math.max(1e-7,d))>tr)return a.length=0,!1;l=h,o+=u}return!0}function sr(n){const{coords:t,lengths:e}=n,{buffer:i}=is(t,e);return i}function rr(n,t,e){let i=0;for(let s=0;se||le)return!0}i+=r}return!1}function nr(n,t){if(V(n))return null;if(!rr(n,-128,st+128))return n;tt.setPixelMargin(t),tt.reset(hi.Polygon);let e=0;for(let a=0;as||cs){a=!0;continue}l.push({x:u,y:c})}let _=!1;const f=h.length;for(let m=1;ms||cs){_=!0;break}l.push({x:u,y:c})}if(_)a=!0;else{if(a){const m=e.resultWithStarts();if(m)for(const d of m)r.push(d)}else r.push({line:l,start:0});o++,a=!1}}return r=r.filter(l=>l.line.length>1),r.length===0?null:r}tt.setExtent(st),ie.setExtent(st);const Ft=8,R=16,Ke=65535,gi=n=>class extends n{constructor(...t){super(...t),this.tessellationProperties={},this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0},this.geometryType=P.LINE}writeGeometry(t,e,i,s){this._writeGeometry(t,e,i,s)}_initializeTessellator(t){const e=Et.load(this._materialKey),i=ft.load(this._materialKey),s=this._tessellationOptions,r=e.vvSizeFieldStops||e.vvSizeMinMaxValue||e.vvSizeScaleStops||e.vvSizeUnitValue,a=this.tessellationProperties._halfWidth(i,s,r,a,o,l,h,u,c,_,f)=>{const m=M(f,Math.ceil(R*n._halfWidth)),d=k(Math.round(R*h),Math.round(R*u),Math.round(R*c),Math.round(R*_)),y=k(R*o,R*l,0,n._bitset),p=n.out;return p.vertexBounds(i,s,t,e),p.vertexWrite(M(Ft*i,Ft*s)),p.vertexWrite(n.id),p.vertexWrite(n._fillColor),p.vertexWrite(d),p.vertexWrite(m),p.vertexWrite(n._tl),p.vertexWrite(n._br),p.vertexWrite(y),p.vertexWrite(M(Math.ceil(R*n._halfReferenceWidth),0)),p.vertexWrite(n.minMaxZoom),p.vertexEnd(),n.offset+n.vertexCount++},lr=(n,t,e)=>(i,s,r,a,o,l,h,u,c,_,f)=>{const m=M(R*n._halfWidth,R*n._halfReferenceWidth),d=k(R*h+128,R*u+128,R*c+128,R*_+128),y=n.out,p=n._bitset<<24|n.id;y.vertexBounds(i,s,t,e),y.vertexWrite(M(Ft*i,Ft*s)),y.vertexWrite(p),y.vertexWrite(n._fillColor);const g=li(n.key);return g||(y.vertexWrite(0),y.vertexWrite(0)),y.vertexWrite(0),y.vertexWrite(m),y.vertexWrite(d),g||y.vertexWrite(n.minMaxZoom),y.vertexEnd(),n.offset+n.vertexCount++},hr=n=>(t,e,i)=>{const s=n.out;s.indexWrite(t),s.indexWrite(e),s.indexWrite(i),n.indexCount+=3};class U extends gi(wt){constructor(t,e,i,s,r,a,o,l,h,u,c,_,f,m,d,y,p,g,v,b){super();const L=Et.load(t);e&&(L.sdf=e.sdf,L.pattern=!0,L.textureBinding=e.textureBinding),this._capType=s,this._joinType=r,this._miterLimitCosine=Qt(a),this.tessellationProperties._fillColor=o,this.tessellationProperties._tl=l,this.tessellationProperties._br=h,this._hasPattern=u,this._isDashed=c,this._zOrder=p,this._effects=g,this._minMaxZoom=M(Math.round(v*C),Math.round(b*C)),this._materialKey=L.data;const S=(f?it:0)|(m?qi:0)|(_?si:0)|(d?Vt:0);this.tessellationProperties._bitset=S,this.tessellationProperties._halfWidth=.5*i,this.tessellationProperties._halfReferenceWidth=.5*y,this.tessellationProperties.offset=0,this._initializeTessellator(!1)}static fromCIMLine(t,e,i){const s=t.color,r=t.scaleFactor||1,a=!!t.dashTemplate;let o=t.cap;a&&o===ze.ROUND&&(o=ze.SQUARE);const l=t.join,h=x(t.width)*r,u=x(t.referenceWidth),c=x(t.miterLimit),_=s&&$(s)||0,[f,m]=J(t.scaleInfo,i),d=!1;if(!e)return new U(t.materialKey,e,h,o,l,c,_,0,0,!1,a,t.scaleDash,t.colorLocked,d,t.sampleAlphaOnly,u,t.zOrder,t.effects,f,m);const{rect:y,width:p,height:g}=e,v=y.x+I,b=y.y+I,L=v+p,S=b+g,T=M(v,b),z=M(L,S),N=!1;return new U(t.materialKey,e,h,o,l,c,_,T,z,!0,a,t.scaleDash,t.colorLocked,N,t.sampleAlphaOnly,u,t.zOrder,t.effects,f,m)}static fromFillOutline(t){var i;const e=ft.load(t.materialKey);return At(e)&&t.outline&&((i=t.outline)==null?void 0:i.style)==="esriSLSSolid"?U.fromSimpleLine({hash:"",materialKey:t.materialKey,...t.outline},null,!0):null}static fromSimpleLine(t,e,i=!1){const{color:s}=t,r=t.style!=="esriSLSSolid"&&t.style!=="esriSLSNull",a=Ji(t.cap||"round"),o=ts(t.join||"round");let l=s&&t.style!=="esriSLSNull"&&Y(s)||0;t.style==="esriSLSNull"&&(l=0);const h=x(t.width),u=t.miterLimit;if(!e)return new U(t.materialKey,e,h,a,o,u,l,0,0,!1,r,!0,!1,i,!1,h,0,null,G,Z);const{rect:c,width:_,height:f}=e,m=c.x+I,d=c.y+I,y=m+_,p=d+f,g=M(m,d),v=M(y,p);return new U(t.materialKey,e,h,a,o,u,l,g,v,!0,r,!0,!1,i,!1,h,0,null,G,Z)}static fromPictureLineSymbol(t,e,i,s){return mt.getLogger("esri.views.2d.engine.webgl.WGLLineTemplate").error("PictureLineSymbol support does not exist!"),null}}const cr=100,Ne=1,Mi=n=>class extends n{constructor(...t){super(...t),this.forceLibtess=!1,this._bitset=0,this._lineTemplate=null,this.geometryType=P.FILL}_maybeAddLineTemplate(t){this._lineTemplate=U.fromFillOutline(t)}_write(t,e,i,s){const r=e.geometryType==="esriGeometryPoint",a=ft.load(this._materialKey);t.recordStart(e.getDisplayId(),this._materialKey,this.geometryType,r),this._writeGeometry(t,e,a,s,r),At(a)&&E(this._lineTemplate)&&this._lineTemplate.writeGeometry(t,e,s,r),t.recordEnd()}_writeGeometry(t,e,i,s,r){const a=this._getGeometry(e,s,r);if(V(a))return;const o=[];if(!(a.maxLength>cr)&&!this.forceLibtess&&ir(o,a))return void(o.length&&this._writeVertices(t,e,a.coords,a.lengths,i,o));const l=sr(a);this._writeVertices(t,e,l,[l.length/2],i)}_writeVertex(t,e,i,s,r,a){const o=M(Ne*s,Ne*r);if(t.vertexBounds(s,r,0,0),t.vertexWrite(o),t.vertexWrite(e),i.symbologyType===Ot.DOT_DENSITY)t.vertexWriteF32(1/Math.abs(a.readGeometryArea()));else{t.vertexWrite(this.fillColor);const l=li(i);l||(t.vertexWrite(this.tl),t.vertexWrite(this.br)),t.vertexWrite(this.aux21),t.vertexWrite(this.aux22),t.vertexWrite(this.aux3),l||t.vertexWrite(this._minMaxZoom)}}_writeVertices(t,e,i,s,r,a){const o=e.getDisplayId(),l=this._bitset<<24|o,h=s.reduce((f,m)=>f+m),u=Yt(r.geometryType,r.symbologyType).geometry/4,c=t.vertexCount();t.vertexEnsureSize(u*h);let _=0;if(a)for(const f of a){const m=i[2*f],d=i[2*f+1];this._writeVertex(t,l,r,m,d,e),_++}else for(let f=0;f0,o=e.readLegacyFeature(),l=e.getObjectId(),h=this._materialCache,u=this._cimLayer.materialHash;if(!u)return Xe.error("A Dynamic mesh template must have a material hash value or function!"),Promise.reject(null);const c=typeof u=="function"?u(o,i,s,l):u;if(h.has(c)){const v=h.get(c);return Promise.resolve(v)}const _=this._ongoingMaterialRequestMap.get(c);if(_)return _;const f=this._cimLayer,m=ms(f.cim,this._cimLayer.materialOverrides);m.mosaicHash=c;const{type:d,url:y}=f,p={cim:m,type:d,mosaicHash:c,url:y,size:null,dashTemplate:null,text:null,fontName:null,objectId:l,animatedSymbolProperties:null};switch(d){case"marker":p.size=Pt(f.size,o,i,s),p.animatedSymbolProperties=Pt(f.animatedSymbolProperties,o,i,s);break;case"line":p.dashTemplate=f.dashTemplate;break;case"text":p.text=Pt(f.text,o,i,s),p.fontName=Pt(f.fontName,o,i,s)}const g=t.getMosaicItem(p,r).then(v=>(a||(this._ongoingMaterialRequestMap.delete(c),h.set(c,v)),v)).catch(v=>(this._ongoingMaterialRequestMap.delete(c),Xe.error(".analyze()",v.message),null));return a||this._ongoingMaterialRequestMap.set(c,g),g}}const Ue=128;class pe extends Mi(Nt){constructor(t,e,i){var u;if(super(t),this._minMaxZoom=M(Math.round(e*C),Math.round(i*C)),w(t.color)){const c=(_,f,m)=>{const d=t.color(_,f,m);return d&&$(d)||0};this._dynamicPropertyMap.set("fillColor",c)}else{const c=t.color;this.fillColor=c&&$(c)||0}const s=((u=t.cim.placement)==null?void 0:u.type)==="CIMMarkerPlacementInsidePolygon"&&t.cim.placement.shiftOddRows?2:1,r=t.height;if(w(r)){const c=(_,f,m)=>r(_,f,m)*s;this._dynamicPropertyMap.set("_height",c)}else this._height=(r||0)*s;const a=t.offsetX;if(w(a)){const c=(_,f,m)=>x(a(_,f,m));this._dynamicPropertyMap.set("_offsetX",c)}else this._offsetX=x(a||0);const o=t.offsetY;if(w(o)){const c=(_,f,m)=>x(-o(_,f,m));this._dynamicPropertyMap.set("_offsetY",c)}else this._offsetY=x(-o||0);const l=t.scaleX;w(l)?this._dynamicPropertyMap.set("_scaleX",l):this._scaleX=l||1;const h=t.angle;if(w(h)){const c=(_,f,m)=>jt(h(_,f,m));this._dynamicPropertyMap.set("_angle",c)}else this._angle=jt(h)||0;if(E(t.effects)){const c=t.effects;w(c)?this._dynamicPropertyMap.set("_effects",c):this._effects=c}this._cimFillLayer=t,this._bitset=(t.colorLocked?it:0)|(t.applyRandomOffset?ri:0)|(t.sampleAlphaOnly?Vt:0),this._fillMaterialKey=t.materialKey}static fromCIMFill(t,e){const[i,s]=J(t.scaleInfo,e);return new pe(t,i,s)}bindFeature(t,e,i){const s=t.readLegacyFeature();this._dynamicPropertyMap.forEach((u,c)=>{this[c]=u(s,e,i)});const r=ft.load(this._fillMaterialKey),a=this._materialCache,o=(0,this._cimFillLayer.materialHash)(s,e,i),l=a.get(o);let h=null;if(l&&F(l.spriteMosaicItem)&&(h=l.spriteMosaicItem),h){const{rect:u,width:c,height:_}=h,f=u.x+I,m=u.y+I,d=f+c,y=m+_;let p=Math.round(x(this._height));p<=0&&(p=y-m);let g=Math.round(x(this._height/_*c||0));g<=0&&(g=d-f);const v=this._scaleX,b=1;this.tl=M(f,m),this.br=M(d,y),this.aux21=M(g,p),this.aux22=M(this._offsetX,this._offsetY),this.aux3=k(v*Ue,b*Ue,this._angle,0),r.sdf=h.sdf,r.pattern=!0,r.textureBinding=h.textureBinding}else this.tl=0,this.br=0,this.aux21=0,this.aux22=0,this.aux3=0,r.sdf=!1,r.pattern=!1,r.textureBinding=0;this._materialKey=r.data}}class ye extends gi(Nt){constructor(t,e,i){super(t),this._minMaxZoom=M(Math.round(e*C),Math.round(i*C)),this._cimLineLayer=t;let s=0;w(t.width)||(s=.5*x(t.width));const r=(c,_,f)=>w(t.width)?.5*x(t.width(c,_,f)):s;this._dynamicPropertyMap.set("_halfWidth",r),w(t.cap)?this._dynamicPropertyMap.set("_capType",t.cap):this._capType=t.cap,w(t.join)?this._dynamicPropertyMap.set("_joinType",t.join):this._joinType=t.join;const a=t.color;if(w(a)){const c=(_,f,m)=>$(a(_,f,m));this._dynamicPropertyMap.set("_fillColor",c)}else this._fillColor=a&&$(a)||0;const o=t.miterLimit;if(w(o)){const c=(_,f,m)=>Qt(o(_,f,m));this._dynamicPropertyMap.set("_miterLimitCosine",c)}else this._miterLimitCosine=Qt(o);if(E(t.effects)){const c=t.effects;w(c)?this._dynamicPropertyMap.set("_effects",c):this._effects=c}this._scaleFactor=t.scaleFactor||1,this._isDashed=t.dashTemplate!=null;const l=t.colorLocked?it:0,h=t.scaleDash?si:0,u=t.sampleAlphaOnly?Vt:0;this.tessellationProperties._bitset=l|h|u,this._materialKey=t.materialKey,this._initializeTessellator(!0)}static fromCIMLine(t,e){const[i,s]=J(t.scaleInfo,e);return new ye(t,i,s)}bindFeature(t,e,i){const s=t.readLegacyFeature();this._dynamicPropertyMap.forEach((u,c)=>{this[c]=u(s,e,i)}),this._halfWidth*=this._scaleFactor;const r=this._materialCache,a=(0,this._cimLineLayer.materialHash)(s,e,i),o=r.get(a);let l=null;if(o&&F(o.spriteMosaicItem)&&(l=o.spriteMosaicItem),l){this._hasPattern=!0;const{rect:u,width:c,height:_}=l,f=u.x+I,m=u.y+I,d=f+c,y=m+_;this.tessellationProperties._tl=M(f,m),this.tessellationProperties._br=M(d,y)}else this._hasPattern=!1,this.tessellationProperties._tl=0,this.tessellationProperties._br=0;this.tessellationProperties._fillColor=this._fillColor,this.tessellationProperties._halfWidth=this._halfWidth,this.tessellationProperties.offset=0,this.tessellationProperties._halfReferenceWidth=this.tessellationProperties._halfWidth;const h=Et.load(this._materialKey);l&&(h.sdf=l.sdf,h.pattern=!0,h.textureBinding=l.textureBinding),this._materialKey=h.data}}const ur=le(),fr=oe();class xe extends di(Nt){constructor(t,e,i){super(t),this._cimMarkerLayer=t,this._minMaxZoom=M(Math.round(e*C),Math.round(i*C));const s=t.color;if(w(s)){const _=(f,m,d)=>$(s(f,m,d));this._dynamicPropertyMap.set("_fillColor",_)}else this._fillColor=$(s);const r=t.outlineColor;if(w(r)){const _=(f,m,d)=>$(r(f,m,d));this._dynamicPropertyMap.set("_outlineColor",_)}else this._outlineColor=$(r);const a=t.size;if(w(a)){const _=(f,m,d)=>x(a(f,m,d));this._dynamicPropertyMap.set("_size",_)}else this._size=x(a)||0;const o=t.scaleX;w(o)?this._dynamicPropertyMap.set("_scaleX",o):this._scaleX=o;const l=t.offsetX;if(w(l)){const _=(f,m,d)=>x(l(f,m,d));this._dynamicPropertyMap.set("xOffset",_)}else this.xOffset=x(l)||0;const h=t.offsetY;if(w(h)){const _=(f,m,d)=>x(h(f,m,d));this._dynamicPropertyMap.set("yOffset",_)}else this.yOffset=x(h)||0;const u=t.outlineWidth;if(w(u)){const _=(f,m,d)=>x(u(f,m,d));this._dynamicPropertyMap.set("_outlineWidth",_)}else this._outlineWidth=x(u)||0;const c=t.rotation;if(w(c)?this._dynamicPropertyMap.set("_angle",c):this._angle=c||0,E(t.effects)){const _=t.effects;w(_)?this._dynamicPropertyMap.set("_effects",_):this._effects=_}if(E(t.markerPlacement)){const _=t.markerPlacement;w(_)?this._dynamicPropertyMap.set("_markerPlacement",_):this._markerPlacement=_}this._scaleFactor=Ct(t.scaleFactor,1),this._bitSet=(t.alignment===B.MAP?1:0)|(t.colorLocked?1:0)<<1|(t.scaleSymbolsProportionally?1:0)<<3,this._materialKey=t.materialKey}static fromCIMMarker(t,e){const[i,s]=J(t.scaleInfo,e);return new xe(t,i,s)}bindFeature(t,e,i){const s=t.readLegacyFeature(),r=t.getObjectId();this._dynamicPropertyMap.forEach((nt,at)=>{this[at]=nt(s,e,i)});const a=this._cimMarkerLayer.materialHash,o=typeof a=="function"?a(s,e,i,r):a,l=this._materialCache.get(o);if(!l||!F(l.spriteMosaicItem)||!l.spriteMosaicItem)return void mt.getLogger("esri.views.2d.engine.webgl.WGLDynamicMarkerTemplate").error(new rt("mapview-cim","Encountered an error when binding feature"));const h=l.spriteMosaicItem,u=this._cimMarkerLayer.sizeRatio,c=h.width/h.height*this._scaleX,_=this._cimMarkerLayer.rotateClockwise?this._angle:-this._angle;let f=this._size,m=f*c;const d=this.xOffset,y=this.yOffset;this.xOffset*=this._scaleFactor,this.yOffset*=this._scaleFactor;const p=this._cimMarkerLayer.scaleSymbolsProportionally&&this._cimMarkerLayer.frameHeight?this._size/x(this._cimMarkerLayer.frameHeight):1,g=this._outlineWidth*p,v=x(this._cimMarkerLayer.referenceSize);let b=0,L=0;const S=this._cimMarkerLayer.anchorPoint;S&&(this._cimMarkerLayer.isAbsoluteAnchorPoint?this._size&&(b=x(S.x)/(this._size*c),L=x(S.y)/this._size):(b=S.x,L=S.y)),this._anchorX=b,this._anchorY=L,this._sizeOutlineWidth=k(Math.round(Math.min(Math.sqrt(128*m),255)),Math.round(Math.min(Math.sqrt(128*f),255)),Math.round(Math.min(Math.sqrt(128*g),255)),Math.round(Math.min(Math.sqrt(128*v),255))),this.angle=_;const T=Math.round(64*u);this._bitestAndDistRatio=M(this._bitSet,T);const z=h.rect.x+I,N=h.rect.y+I,q=z+h.width,j=N+h.height;this._texUpperLeft=M(z,N),this._texUpperRight=M(q,N),this._texBottomLeft=M(z,j),this._texBottomRight=M(q,j);const O=ce.load(this._materialKey);O.sdf=h.sdf,O.pattern=!0,O.textureBinding=h.textureBinding,this._materialKey=O.data,m*=u,f*=u,m*=this._scaleFactor,f*=this._scaleFactor,m*=h.rect.width/h.width,f*=h.rect.height/h.height,this._computedWidth=m,this._computedHeight=f,this._applyTransformation(fr,ur),this.xOffset=d,this.yOffset=y}}function vi(n){const t=new Array(n.length);for(let e=0;e$(r(y,p,g));this._dynamicPropertyMap.set("_color",d)}else this._color=$(r);const a=t.outlineColor;if(w(a)){const d=(y,p,g)=>$(a(y,p,g));this._dynamicPropertyMap.set("_haloColor",d)}else this._haloColor=$(a);let o;w(t.size)||(o=Math.min(Math.round(x(t.size*t.sizeRatio)),127));const l=(d,y,p)=>w(t.size)?Math.min(Math.round(x(t.size(d,y,p)*t.sizeRatio)),127):o;if(this._dynamicPropertyMap.set("_size",l),w(t.outlineSize)){const d=(y,p,g)=>Math.min(Math.floor(He*x(t.outlineSize(y,p,g)*t.sizeRatio)),127);this._dynamicPropertyMap.set("_haloSize",d)}else this._haloSize=Math.min(Math.floor(He*x(t.outlineSize*t.sizeRatio)),127);let h;w(t.offsetX)||(h=Math.round(x(t.offsetX*t.sizeRatio)));const u=(d,y,p)=>w(t.offsetX)?Math.round(x(t.offsetX(d,y,p)*t.sizeRatio)):h;let c;this._dynamicPropertyMap.set("_xOffset",u),w(t.offsetY)||(c=Math.round(x(t.offsetY*t.sizeRatio)));const _=(d,y,p)=>w(t.offsetY)?Math.round(x(t.offsetY(d,y,p)*t.sizeRatio)):c;if(this._dynamicPropertyMap.set("_yOffset",_),w(t.angle)?this._dynamicPropertyMap.set("_angle",t.angle):this._angle=t.angle,w(t.horizontalAlignment)?this._dynamicPropertyMap.set("_horizontalAlignment",t.horizontalAlignment):this._horizontalAlignment=t.horizontalAlignment,w(t.verticalAlignment)?this._dynamicPropertyMap.set("_verticalAlignment",t.verticalAlignment):this._verticalAlignment=t.verticalAlignment,E(t.effects)){const d=t.effects;w(d)?this._dynamicPropertyMap.set("_effects",d):this._effects=d}if(E(t.markerPlacement)){const d=t.markerPlacement;w(d)?this._dynamicPropertyMap.set("_markerPlacement",d):this._textPlacement=d}w(t.text)?this._dynamicPropertyMap.set("_text",t.text):this._text=t.text,this._scaleFactor=s;const f=Math.min(Math.round(x(t.referenceSize*t.sizeRatio)),127);this._referenceSize=Math.round(Math.sqrt(256*f)),this._materialKey=t.materialKey;const m=us.load(this._materialKey);m.sdf=!0,this._bitset=(t.alignment===B.MAP?1:0)|(t.colorLocked?1:0)<<1,this._materialKey=m.data,this._decoration="none",this._lineHeight=1,this._lineWidth=512,this._isCIM=!0}static fromCIMText(t,e){const[i,s]=J(t.scaleInfo,e);return new ge(t,i,s)}async analyze(t,e,i,s){const r=e.readLegacyFeature(),a=_r(this._cimTextLayer,r,i,s),o=await super.analyze(t,e,i,s,vi(a));return o&&o.glyphMosaicItems&&this._textToGlyphs.set(a,o.glyphMosaicItems),o}bindFeature(t,e,i){const s=t.readLegacyFeature();if(this._dynamicPropertyMap.forEach((a,o)=>{this[o]=a(s,e,i)}),!this._text||this._text.length===0)return void(this._shapingInfo=null);this._size*=this._scaleFactor,this._scale=this._size/ei,this._xOffset*=this._scaleFactor,this._yOffset*=this._scaleFactor,this._xAlignD=ai(Ct(this._horizontalAlignment,"center")),this._yAlignD=oi(Ct(this._verticalAlignment,"baseline"));const r=this._textToGlyphs.get(this._text);this.bindTextInfo(r,!1)}}const ht=128;class H extends Mi(wt){constructor(t,e,i,s,r,a,o,l,h,u,c,_,f,m,d,y){super(),this._effects=m;const p=ft.load(t);e&&(p.sdf=e.sdf,p.pattern=!0,p.textureBinding=e.textureBinding),this.fillColor=i,this.tl=s,this.br=r,this.aux21=M(a,o),this.aux22=M(l,h),this.aux3=k(u,c,_,0),this._bitset=f,this._minMaxZoom=M(Math.round(d*C),Math.round(y*C)),this._materialKey=p.data}static fromCIMFill(t,e,i){const s=t.color,r=s&&$(s)||0,a=t.materialKey,[o,l]=J(t.scaleInfo,i),h=(t.colorLocked?it:0)|(t.applyRandomOffset?ri:0)|(t.sampleAlphaOnly?Vt:0);if(!e)return new H(a,null,r,0,0,0,0,0,0,0,0,0,h,t.effects,o,l);const{rect:u,width:c,height:_}=e,f=t.scaleX||1,m=u.x+I,d=u.y+I,y=m+c,p=d+_,g=x(t.height),v=f*g;let b=Math.round(g);b<=0&&(b=p-d);let L=Math.round(v);L<=0&&(L=y-m);const S=x(t.offsetX||0),T=x(-t.offsetY||0),z=M(m,d),N=M(y,p);return new H(a,e,r,z,N,L,b,S,T,ht,ht,jt(t.angle),h,t.effects,o,l)}static fromSimpleFill(t,e,i=!1){const{color:s}=t,r=s&&t.style!=="esriSFSNull"&&Y(s)||0,a=i?it:0,o=t.materialKey;let l;if(e){const{rect:h,width:u,height:c,pixelRatio:_}=e,f=h.x+I,m=h.y+I,d=f+u,y=m+c,p=M(f,m),g=M(d,y);l=new H(o,e,r,p,g,u/_,c/_,0,0,ht,ht,0,a,null,G,Z)}else l=new H(o,null,r,0,0,0,0,0,0,0,0,0,a,null,G,Z);return l._maybeAddLineTemplate(t),l}static fromPictureFill(t,e,i=!1){const s=ii,{rect:r,width:a,height:o}=e,l=r.x+I,h=r.y+I,u=l+a,c=h+o,_=M(l,h),f=M(u,c),m=Math.round(x(t.width)),d=Math.round(x(t.height)),y=x(t.xoffset),p=x(-t.yoffset),g=t.materialKey,v=i?it:0,b=new H(g,e,s,_,f,m,d,y,p,ht*t.xscale,ht*t.yscale,0,v,null,G,Z);return b._maybeAddLineTemplate(t),b}}class dr{constructor(){this._resolver=null}isHeld(){return!!this._resolver}async acquire(){this._resolver?(await this._resolver.promise,await this.acquire()):this._resolver=Ci()}release(){const t=this._resolver;this._resolver=null,t==null||t.resolve()}}async function mr(n,t,e){try{await n.acquire(),await t(e),n.release()}catch(i){throw n.release(),i}}async function pr(n,t,e){if(!n.name)throw new rt("style-symbol-reference-name-missing","Missing name in style symbol reference");if(n.styleName&&n.styleName==="Esri2DPointSymbolsStyle")return yr(n,e);try{return xr(await Ei(n,t,e),n.name,t,e)}catch(i){return he(i),null}}async function yr(n,t){const e=Ai.replace(/\{SymbolName\}/gi,n.name);try{const i=await Qe(e,t);return Je(i.data)}catch(i){return he(i),null}}async function xr(n,t,e,i){const s=n.data,r={portal:e&&E(e.portal)?e.portal:Ri.getDefault(),url:ki(n.baseUrl),origin:"portal-item"},a=s.items.find(l=>l.name===t);if(!a)throw new rt("symbolstyleutils:symbol-name-not-found",`The symbol name '${t}' could not be found`,{symbolName:t});let o=Fi(Bi(a,"cimRef"),r);gs()&&(o=Ms(o));try{const l=await Qe(o,i);return Je(l.data)}catch(l){return he(l),null}}const Ye=async(n,t,e)=>new ps(await ys(n.data,t,e),n.data,n.rendererKey,n.maxVVSize),K=async(n,t,e,i)=>{if(!n)return null;if(n.type==="cim")return Ye(n,t,e);if(n.type==="web-style"){const s={type:"cim",data:await pr(n,null,i),rendererKey:n.rendererKey,maxVVSize:n.maxVVSize};return Ye(s,t,e)}return n};function Wt(n){if(!n)return null;const{type:t,cim:e,url:i,materialHash:s}=n,r={cim:e,type:t,mosaicHash:s,url:i,size:null,dashTemplate:null,path:null,text:null,fontName:null,animatedSymbolProperties:null};switch(t){case"marker":r.size=n.size,r.path=n.path,r.animatedSymbolProperties=n.animatedSymbolProperties;break;case"line":r.dashTemplate=n.dashTemplate;break;case"text":r.text=n.text,r.fontName=n.fontName}return r}const A=mt.getLogger("esri.views.2d.engine.webgl.mesh.templates.WGLTemplateStore"),qe=new Array,Me={isOutline:!1,placement:null,symbologyType:Ot.DEFAULT,vvFlags:0},gr={...Se,hash:JSON.stringify(Se),materialKey:ue(P.MARKER,Me)},Mr={...Le,hash:JSON.stringify(Le),materialKey:ue(P.LINE,Me)},vr={...Pe,hash:JSON.stringify(Pe),materialKey:ue(P.FILL,Me)};function X(n,t){const e=n.length;return n.push(null),t.then(i=>n[e]=i),n}function yt(n){return!!(1&n)}function wr(n){return n.name==="worker:port-closed"}class Or{constructor(t,e){this._idCounter=1,this._templateIdCounter=1,this._idToTemplateGroup=new Map,this._symbolToTemplate=new Map,this._fetchQueue=[],this._idToResolver=new Map,this._cimTemplateCache=new Map,this._cimAnalyses=[],this._lock=new dr,this._fetchResource=t,this._tileInfo=e}get _markerError(){return this._errorTemplates.marker[0]}get _fillError(){return this._errorTemplates.fill[0]}get _lineError(){return this._errorTemplates.line[0]}get _textError(){return this._errorTemplates.line[0]}createTemplateGroup(t,e){this._initErrorTemplates();const i=t.hash;if(this._symbolToTemplate.has(i))return this._symbolToTemplate.get(i);const s=new Array;e&&this._createMeshTemplates(s,e,!0),this._createMeshTemplates(s,t,!1);const r=this._createGroupId(t.type==="expanded-cim"&&br(t));return this._idToTemplateGroup.set(r,s),this._symbolToTemplate.set(i,r),r}getTemplateGroup(t){return this._idToTemplateGroup.has(t)?this._idToTemplateGroup.get(t):qe}getDynamicTemplateGroup(t){return this._idToTemplateGroup.has(t)?(yt(t)||A.error("mapview-template-store",`Id ${t} does not refer to a dynamic template`),this._idToTemplateGroup.get(t)):qe}getMosaicItem(t,e){const i=this._createTemplateId(),s=new Promise(r=>this._idToResolver.set(i,r));return this._fetchQueue.push({symbol:t,id:i,glyphIds:e}),s}finalize(t){return this._fetchQueue.length||this._lock.isHeld()?mr(this._lock,this._fetchAllQueuedResources.bind(this),t):Promise.resolve()}_initErrorTemplates(){this._errorTemplates||(this._errorTemplates={fill:this._createMeshTemplates([],vr,!1),marker:this._createMeshTemplates([],gr,!1),line:this._createMeshTemplates([],Mr,!1)})}_fetchAllQueuedResources(t){if(!this._fetchQueue.length)return Promise.resolve();const e=this._fetchQueue,i=this._cimAnalyses;return this._fetchQueue=[],this._cimAnalyses=[],Promise.all(i).then(()=>this._fetchResource(e,t).then(s=>{for(const{id:r,mosaicItem:a}of s)this._idToResolver.get(r)(a),this._idToResolver.delete(r)})).catch(s=>{Vi(s)?this._fetchQueue=this._fetchQueue.concat(e):wr(s)||A.error(new rt("mapview-template-store","Unable to fetch requested texture resources",s))})}_createGroupId(t){return this._idCounter++<<1|(t?1:0)}_createTemplateId(){return this._templateIdCounter++}async _createSMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return F(e,A)?D.fromSimpleMarker(t,e):this._markerError}async _createPMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return F(e,A)?D.fromPictureMarker(t,e):this._markerError}async _createSFS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return F(i,A)?H.fromSimpleFill(t,i,e):this._fillError}async _createPFS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return F(i,A)?H.fromPictureFill(t,i,e):this._fillError}async _createSLS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return F(i,A)?U.fromSimpleLine(t,i):this._lineError}async _createLMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return F(e,A)?D.fromLineSymbolMarker(t,e):this._markerError}async _createTS(t){const{glyphMosaicItems:e}=await this.getMosaicItem(t);return _t.fromText(t,e)}async _createCIMText(t){const{glyphMosaicItems:e}=await this.getMosaicItem(Wt(t),vi(t.text));return F(e,A)?_t.fromCIMText(t,e,this._tileInfo):this._textError}async _createCIMFill(t){const{spriteMosaicItem:e}=await this.getMosaicItem(Wt(t));return F(e,A)?H.fromCIMFill(t,e,this._tileInfo):this._fillError}async _createCIMLine(t){const{spriteMosaicItem:e}=await this.getMosaicItem(Wt(t));return F(e,A)?U.fromCIMLine(t,e,this._tileInfo):this._lineError}async _createCIMMarker(t){const{spriteMosaicItem:e}=await this.getMosaicItem(Wt(t));return F(e,A)?D.fromCIMMarker(t,e,this._tileInfo):this._markerError}async _createCIM(t){const e=t.templateHash;if(this._cimTemplateCache.has(e))return this._cimTemplateCache.get(e);let i;switch(t.type){case"marker":i=await this._createCIMMarker(t);break;case"line":i=await this._createCIMLine(t);break;case"fill":i=await this._createCIMFill(t);break;case"text":i=await this._createCIMText(t)}return this._cimTemplateCache.set(e,i),i}async _createDynamicCIM(t){const e=t.templateHash;if(this._cimTemplateCache.has(e))return this._cimTemplateCache.get(e);let i;switch(t.type){case"marker":i=xe.fromCIMMarker(t,this._tileInfo);break;case"line":i=ye.fromCIMLine(t,this._tileInfo);break;case"fill":i=pe.fromCIMFill(t,this._tileInfo);break;case"text":i=ge.fromCIMText(t,this._tileInfo)}return this._cimTemplateCache.set(e,i),i}_createPrimitiveMeshTemplates(t,e,i){switch(e.type){case"esriSMS":return X(t,this._createSMS(e));case"esriPMS":return X(t,this._createPMS(e));case"esriSFS":return X(t,this._createSFS(e,i));case"line-marker":return X(t,this._createLMS(e));case"esriPFS":return X(t,this._createPFS(e,i));case"esriSLS":return X(t,this._createSLS(e,!1));case"esriTS":return X(t,this._createTS(e));default:return A.error("Unable to create mesh template for unknown symbol type {: $ }{symbol.type}"),t}}_createMeshTemplates(t,e,i){if(e.type.includes("3d"))return A.error("3D symbols are not supported with MapView"),t;if(e.type==="expanded-cim"){for(const s of e.layers)typeof s.materialHash=="function"?X(t,this._createDynamicCIM(s)):X(t,this._createCIM(s));return t}if(e.type==="composite-symbol"){for(const s of e.layers)this._createPrimitiveMeshTemplates(t,s,i);return t}return e.type==="cim"||e.type==="label"||e.type==="web-style"?t:this._createPrimitiveMeshTemplates(t,e,i)}}const br=n=>{if(!n.layers)return!1;for(const t of n.layers)if(typeof t.materialHash=="function")return!0;return!1};class Dr{constructor(t,e,i){this._loadPromise=rs(),this._geometryType=t,this._idField=e,this._templateStore=i}update(t,e){E(t.mesh.labels)&&(this._labelTemplates=this._createLabelTemplates(t.mesh.labels,e)),this._schema=t}_createLabelTemplates(t,e){const i=new Map;if(t.type==="simple"){for(const s of t.classes){const r=kt.fromLabelClass(s,e);i.set(s.index,r)}return i}for(const s in t.classes){const r=t.classes[s];for(const a of r){const o=kt.fromLabelClass(a,e);i.set(a.index,o)}}return i}get templates(){return this._templateStore}async analyze(t,e,i,s,r,a,o){if(Te(o))return;let l;i.type==="dictionary"&&(l=await i.analyze(this._idField,t.copy(),e,r,a,o));let h=0;for(;t.next();){let u;if(u=l?l[h++]:E(s)&&Qi(t.getDisplayId())&&t.readAttribute("cluster_count")!==1?s.match(this._idField,t,this._geometryType,r,a):i.match(this._idField,t,this._geometryType,r,a),t.setGroupId(u),yt(u)){const c=this._templateStore.getDynamicTemplateGroup(u);for(const _ of c)_&&_.analyze&&_.analyze(this._templateStore,t,r,a)}}return await this._loadPromise,this._templateStore.finalize(o)}async analyzeGraphics(t,e,i,s,r,a){if(Te(a))return;const o=t.getCursor();for(i&&await i.analyze(this._idField,o.copy(),e,s,r,a);o.next();){let l=o.getGroupId();if(l!=null&&l!==-1||(l=i.match(this._idField,o,o.geometryType,s,r),o.setGroupId(l)),yt(l)){const h=this._templateStore.getDynamicTemplateGroup(l);for(const u of h)u&&u.analyze&&u.analyze(this._templateStore,o,s,r)}o.setGroupId(l)}return await this._loadPromise,this._templateStore.finalize(a)}writeGraphic(t,e,i,s){const r=e.getGroupId(),a=e.getDisplayId(),o=this._templateStore.getTemplateGroup(r);if(t.featureStart(e.insertAfter,0),a!=null){if(yt(r))for(const l of o)l&&l.bindFeature(e,null,null);if(o){for(const l of o)l&&l.write(t,e,i,s);t.featureEnd()}}}writeCursor(t,e,i,s,r,a,o){const l=e.getGroupId(),h=e.getDisplayId(),u=this._templateStore.getTemplateGroup(l),c=this._schema.mesh.sortKey;let _=0;if(E(c)&&(_=c.fieldIndex!=null?e.getComputedNumericAtIndex(c.fieldIndex):c.field!=null?e.readAttribute(c.field):e.readAttribute(this._idField),_*=c.order==="asc"?1:-1),t.featureStart(0,_==null||isNaN(_)?0:_),h!=null&&u){if(yt(l))for(const f of u)f.bindFeature(e,i,s);for(const f of u)f.write(t,e,r,o);if(E(a)&&t.hasRecords){const f=a&&this._findLabelRef(u);this._writeLabels(t,e,a,f,r,o)}t.featureEnd()}}_findLabelRef(t){for(const e of t)if(e instanceof D)return e;return null}_writeLabels(t,e,i,s,r,a){for(const o of i)if(E(o)&&o){const{glyphs:l,rtl:h,index:u}=o,c=this._labelTemplates.get(u);c.setZoomLevel(r),c.bindReferenceTemplate(s),c.bindTextInfo(l,h),c.write(t,e,null,a)}}}const se=mt.getLogger("esri/views/2d/engine/webgl/util/Matcher");async function Sr(n,t,e,i){switch(n.type){case"simple":case"heatmap":return Q.fromBasicRenderer(n,t,e,i);case"map":return we.fromUVRenderer(n,t,e,i);case"interval":return ve.fromCBRenderer(n,t,e,i);case"dictionary":return be.fromDictionaryRenderer(n,t,e,i);case"pie-chart":return Bt.fromPieChartRenderer(n,t,e,i);case"subtype":return Bt.fromSubtypes(n,t,e,i)}}class Q{constructor(){this.type="feature",this._defaultResult=null}static async fromBasicRenderer(t,e,i,s){const r=new Q;if(t.symbol){const a=await K(t.symbol,i,s),o=e.createTemplateGroup(a,null);r.setDefault(o)}return r}static async fromPieChartRenderer(t,e,i,s){const r=new Q;if(t.markerSymbol){const a=await K(t.markerSymbol,i,s);let o;t.fillSymbol&&(o=await K(t.fillSymbol,i,s));const l=e.createTemplateGroup(a,o);r.setDefault(l)}return r}size(){return 1}getDefault(){return this._defaultResult}setDefault(t){this._defaultResult=t}match(t,e,i,s,r){return this.getDefault()}async analyze(t,e,i,s,r,a){return null}}class Bt extends Q{constructor(t,e){super(),this._subMatchers=t,this._subtypeField=e}static async fromSubtypes(t,e,i,s){const r=new Map,a=[];for(const o in t.renderers){const l=parseInt(o,10),h=Sr(t.renderers[o],e,i,s).then(u=>r.set(l,u));a.push(h)}return await Promise.all(a),new Bt(r,t.subtypeField)}match(t,e,i,s,r){const a=e.readAttribute(this._subtypeField),o=this._subMatchers.get(a);return o?o.match(t,e,i,s,r):null}}class ve extends Q{constructor(t,e,i,s){super(),this.type="interval",this._intervals=[],this._isMaxInclusive=e,this._fieldIndex=s,this._field=t,this._normalizationInfo=i}static async fromCBRenderer(t,e,i,s){const{isMaxInclusive:r,normalizationField:a,normalizationTotal:o,normalizationType:l}=t,h=t.field,u=new ve(h,r,{normalizationField:a,normalizationTotal:o,normalizationType:l},t.fieldIndex),c=await K(t.backgroundFillSymbol,i,s);await Promise.all(t.intervals.map(async f=>{const m=await K(f.symbol,i,s),d=await e.createTemplateGroup(m,c),y={min:f.min,max:f.max};u.add(y,d)}));const _=await K(t.defaultSymbol,i,s);if(_){const f=await e.createTemplateGroup(_,c);u.setDefault(f)}return u}add(t,e){this._intervals.push({interval:t,result:e}),this._intervals.sort((i,s)=>i.interval.min-s.interval.min)}size(){return super.size()+this._intervals.length}match(t,e,i,s,r){if(this._fieldIndex==null&&!this._field)return this.getDefault();const a=this._fieldIndex!=null?e.getComputedNumericAtIndex(this._fieldIndex):this._getValueFromField(e);if(a==null||isNaN(a)||a===1/0||a===-1/0)return this.getDefault();for(let o=0;o=l.min,c=this._isMaxInclusive?a<=l.max:a{const c=await K(u.symbol,i,s),_=await e.createTemplateGroup(c,o);u.value===""?l.setNullResult(_):l.add(u.value,_)}));const h=await K(t.defaultSymbol,i,s);if(h){const u=await e.createTemplateGroup(h,o);l.setDefault(u)}return l}setNullResult(t){this._nullResult=t}add(t,e){this._resultsMap.set(t.toString(),e)}size(){return super.size()+this._resultsMap.size}match(t,e,i,s,r){if(this._fieldsIndex==null&&!this._fields)return this.getDefault();const a=this._fieldsIndex!=null?e.getComputedStringAtIndex(this._fieldsIndex):this._getValueFromFields(e);if(this._nullResult!==null&&(a==null||a===""||a===""))return this._nullResult;if(a==null)return this.getDefault();const o=a.toString();return this._resultsMap.has(o)?this._resultsMap.get(o):this.getDefault()}_getValueFromFields(t){const e=[];for(const i of this._fields){const s=t.readAttribute(i);s==null||s===""?e.push(""):e.push(s)}return e.join(this._seperator)}}async function Lr(n,t){const e=n||1;if(typeof e=="number")return(s,r,a)=>e;const i=await Di(e,t.spatialReference,t.fields);return(s,r,a)=>xs(i,s,{$view:a},t.geometryType,r)||1}let Ut;async function Pr(){return Ut||(Ut=ti(()=>import("./createSymbolSchema.e54d2060.js"),["assets/createSymbolSchema.e54d2060.js","assets/Utils.7f6f3a6b.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js"])),Ut}class be extends Q{constructor(t,e,i,s,r,a){super(),this.type="dictionary",this._groupIdCache=new Oi(100),this._loader=t,this._fieldMap=t.fieldMap,this._symbolFields=t.getSymbolFields(),this._templates=e,this._info=i,this._scaleFn=s,this._schemaUtilsModule=r,this._symbolOptions=a}static async fromDictionaryRenderer(t,e,i,s){const[{DictionaryLoader:r},a]=await Promise.all([ti(()=>import("./index.d94abe07.js").then(function(h){return h.k$}),["assets/index.d94abe07.js","assets/index.f5419ca5.css"]),Pr()]),o=new r(t.url,t.config,t.fieldMap);await o.fetchResources({spatialReference:i.spatialReference,fields:i.fields});const l=await Lr(t.scaleExpression,i);return new be(o,e,i,l,a,t.symbolOptions)}async _analyzeFeature(t,e,i,s,r){const a=t.readLegacyFeature(),o=this._scaleFn(a,i,s),l=this._attributeHash(a)+"-"+o,h=this._groupIdCache.get(l);if(h)return h;const u={...s,spatialReference:this._info.spatialReference,abortOptions:r,fields:this._info.fields},c=await this._loader.getSymbolAsync(a,u),_=this._schemaUtilsModule.createSymbolSchema(c,this._symbolOptions),f=K(_,this._info,e,r).then(m=>{if(m.type!=="expanded-cim")return se.error(new rt("mapview-bad-type",`Found unexpected type ${m.type} in dictionary response`)),null;m.hash+="-"+o;for(const d of m.layers)d.scaleFactor=o,d.templateHash+="-"+o;return this._templates.createTemplateGroup(m,null)});return this._groupIdCache.put(l,f,1),f}async analyze(t,e,i,s,r,a){const o=e.getCursor(),l=[];for(;o.next();)l.push(this._analyzeFeature(o,i,s,r,a));return Promise.all(l)}match(t,e,i,s,r){return null}_attributeHash(t){let e="";for(const i of this._symbolFields){const s=this._fieldMap[i];s&&(e+=t.attributes[s]+"-")}return e}}export{Vr as E,Tt as a,Dr as b,F as e,Sr as l,K as n,vi as t,Or as x}; +import{n as rt,bN as Li,bc as Pi,j as V,c as E,bO as re,bP as ne,u as ae,I as x,bQ as Ti,s as mt,a1 as je,bo as oe,bR as zi,b3 as Ii,bu as $i,G as bt,bs as St,J as le,bd as Ct,aJ as Wi,K as Ci,bS as Ei,v as he,bT as Ai,bU as Qe,bV as Je,bW as Ri,bX as ki,bY as Fi,bZ as Bi,b_ as Se,b$ as Le,c0 as Pe,x as Vi,c1 as Te,c2 as Oi,at as ti,by as Di}from"./index.221827cd.js";import{L as Ht,M as Gi,Q as st,h as Zi,j as ei,H as B,S as C,T as Ki,W as Ni,_ as Xi,$ as it,a0 as Ui,a1 as Hi,e as I,o as Lt,a2 as ii,a3 as Yi,a as ze,a4 as qi,a5 as si,a6 as Vt,a7 as ri}from"./enums.0295eb81.js";import{f as ji,p as Qi}from"./visualVariablesUtils.061b7a4e.js";import{b as P,G as Yt,x as k,e as M,f as Y,j as $,S as Ot,k as Ji,t as ts}from"./Utils.2136650a.js";import{l as es}from"./tileUtils.332711ed.js";import{n as ni,r as is,c as ss,i as rs}from"./TileClipper.77103a2e.js";import{U as qt,s as ns,r as ai,n as oi,i as as,a as os,Z as ls,c as hs,o as cs,N as ce,C as Et,w as ft,O as At,b as li,P as us,f as ue}from"./MaterialKey.0cadabc1.js";import{g as fs,f as _s,j as ds,h as Xt,n as Ie,m as ms,k as Pt,l as ps,T as ys,q as xs}from"./ExpandedCIM.a372ce74.js";import{M as jt}from"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import{s as hi}from"./Geometry.d049a63c.js";import{c as gs,a as Ms}from"./devEnvironmentUtils.d8d0484c.js";function F(n,t){if(n&&"name"in n){const e=n;return t&&t.error(new rt(e.name,e.message,e.details)),!1}return!0}const vs=1.25;class Tt{constructor(t,e){this._pos=0;const i=e?this._roundToNearest(e,t.BYTES_PER_ELEMENT):40;this._array=new ArrayBuffer(i),this._buffer=new t(this._array),this._ctor=t,this._i16View=new Int16Array(this._array)}get length(){return this._pos}_roundToNearest(t,e){const i=Math.round(t);return i+(e-i%e)}_ensureSize(t){if(this._pos+t>=this._buffer.length){const e=this._roundToNearest((this._array.byteLength+t*this._buffer.BYTES_PER_ELEMENT)*vs,this._buffer.BYTES_PER_ELEMENT),i=new ArrayBuffer(e),s=new this._ctor(i);s.set(this._buffer,0),this._array=i,this._buffer=s,this._i16View=new Int16Array(this._array)}}ensureSize(t){this._ensureSize(t)}writeF32(t){this._ensureSize(1);const e=this._pos;return new Float32Array(this._array,4*this._pos,1)[0]=t,this._pos++,e}push(t){this._ensureSize(1);const e=this._pos;return this._buffer[this._pos++]=t,e}writeFixed(t){this._buffer[this._pos++]=t}setValue(t,e){this._buffer[t]=e}i1616Add(t,e,i){this._i16View[2*t]+=e,this._i16View[2*t+1]+=i}getValue(t){return this._buffer[t]}incr(t){if(this._buffer.length{const r=1<=st-i?Ee:Ae|Ee)|(e<0+s?ke:e>=st-s?Re:ke|Re));this._current.overlaps|=r}_getVertexWriter(t){if(!this._data.self.has(t)){const e=this._data.self,i=Yt(t,this._symbologyType).geometry;e.set(t,new $e(t,i,this.hint.records))}return this._data.self.get(t)}}const G=0,Z=100;function Fe(n,t,e){return n[0]=t[0]-e[0],n[1]=t[1]-e[1],n}function ci(n,t){return Math.sqrt(n*n+t*t)}function Be(n){const t=ci(n[0],n[1]);n[0]/=t,n[1]/=t}function bs(n,t){return ci(n[0]-t[0],n[1]-t[1])}function w(n){return typeof n=="function"}function Qt(n=2){return 1/Math.max(n,1)}function J(n,t){return[!!n.minScale&&t.scaleToZoom(n.minScale)||G,!!n.maxScale&&t.scaleToZoom(n.maxScale)||Z]}function Ss(n,t){return n[t+1]}function ui(n){return n.length-1}function Ls(n){let t=0;for(let e=0;et._index||this._index===t._index&&this._distance>=t._distance}get _segment(){return this._segments[this._index+1]}get angle(){const t=this.dy,e=(0*t+-1*-this.dx)/(1*this.length);let i=Math.acos(e);return t>0&&(i=2*Math.PI-i),i}get xStart(){return this._xStart}get yStart(){return this._yStart}get x(){return this.xStart+this.distance*this.dx}get y(){return this.yStart+this.distance*this.dy}get dx(){return this._segment[0]}get dy(){return this._segment[1]}get xMidpoint(){return this.xStart+.5*this.dx}get yMidpoint(){return this.yStart+.5*this.dy}get xEnd(){return this.xStart+this.dx}get yEnd(){return this.yStart+this.dy}get length(){const{dx:t,dy:e}=this;return Math.sqrt(t*t+e*e)}get remainingLength(){return this.length*(1-this._distance)}get backwardLength(){return this.length*this._distance}get distance(){return this._distance}get done(){return this._done}hasPrev(){return this._index-1>=0}hasNext(){return this._index+1t)return this._seekBackwards(t-s);s+=this.length}return this._distance=0,e?this:null}seek(t,e=!1){if(t<0)return this._seekBackwards(Math.abs(t),e);if(t<=this.remainingLength)return this._distance=(this.backwardLength+t)/this.length,this;let i=this.remainingLength;for(;this.next();){if(i+this.length>t)return this.seek(t-i,e);i+=this.length}return this._distance=1,e?this:null}}function Ts(n,t,e,i=!0){const s=Ls(n),r=Rt.create(n),a=s/2;if(!i)return r.seek(a),void e(r.clone(),0,a+0*t,s);const o=Math.max((s-t)/2,0),l=Math.floor(o/t),h=a-l*t;r.seek(h);for(let u=-l;u<=l;u++)r.x<512&&r.x>=0&&r.y<512&&r.y>=0&&e(r.clone(),u,a+u*t,s),r.seek(t)}function zs(n,t){const e=t;for(let i=0;i=0&&!(s[d+1]s[c]+u);d++){const y=u-s[d-1]+s[c],p=s[d]-s[d-1],g=s[d]-s[c]class extends n{constructor(...t){super(...t),this._isCIM=!1,this._vertexBoundsScale=1,this.geometryType=P.TEXT,this._aux=k(0,0,this._referenceSize,this._bitset)}bindTextInfo(t,e){t&&t.length?this._shapingInfo=Pi(t,i=>ds(i,e,{scale:this._scale,angle:this._angle,xOffset:this._xOffset,yOffset:this._yOffset,hAlign:this._xAlignD,vAlign:this._yAlignD,maxLineWidth:Math.max(32,Math.min(this._lineWidth,512)),lineHeight:Zi*Math.max(.25,Math.min(this._lineHeight,4)),decoration:this._decoration,isCIM:this._isCIM})):this._shapingInfo=null}_write(t,e,i,s){const r=e.getDisplayId();this._writeGeometry(t,e,r,i,s)}_writeGeometry(t,e,i,s,r){const a=this._shapingInfo;if(V(a))return;if(E(this._textPlacement)){const l=r!=null?r:e.readLegacyGeometryForDisplay();return this._writePlacedText(t,i,l,a,s)}const o=r?re(ne(r),2):e.geometryType==="esriGeometryPolygon"?e.readCentroid():e.readGeometryForDisplay();if(!V(o)){if(o.isPoint){const[l,h]=o.coords;return!t.hasAggregates&&t.hasPixelBufferEnabled&&(l<0||l>=512||h<0||h>=512)?void 0:this._writeGlyphs(t,i,{x:l,y:h},a)}o.forEachVertex((l,h)=>this._writeGlyphs(t,i,{x:l,y:h},a))}}_writePlacedText(t,e,i,s,r){const a=ae(this._textPlacement),o=fi.getPlacement(i,a,x(1),r.geometryEngine);if(!o)return;let l=o.next();for(;l!=null;){const h=-l.getAngle();s.setRotation(h);const u=l.tx,c=-l.ty;u<0||u>=512||c<0||c>=512||(this._writeGlyphs(t,e,{x:u,y:c},s),s.setRotation(-h)),l=o.next()}}_writeGlyphs(t,e,i,s){const r=qt.load(this._materialKey),a=M(Math.round(zt*i.x),Math.round(zt*i.y)),o=this._vertexBoundsScale,l=s.bounds,h=2*Math.max(l.width,l.height);for(const u of s.glyphs)r.textureBinding=u.textureBinding,t.recordStart(e,r.data,this.geometryType,!0),t.vertexBounds(i.x+l.x+this._xOffset,i.y+l.y-this._yOffset,h*o,h*o),this._writeVertices(t,e,a,u),t.recordEnd()}_writeGlyph(t,e,i,s,r){const a=qt.load(this._materialKey),o=M(Math.round(zt*i),Math.round(zt*s));a.textureBinding=r.textureBinding,t.recordStart(e,a.data,this.geometryType,!0);const l=r.bounds,h=this._vertexBoundsScale;t.vertexBounds(i+l.x*h,s+l.y*h,l.width*h,l.height*h),this._writeVertices(t,e,o,r),t.recordEnd()}_writeVertices(t,e,i,s){const r=t.vertexCount();this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.upperLeft),t.vertexWrite(s.texcoords.upperLeft),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.upperRight),t.vertexWrite(s.texcoords.upperRight),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.lowerLeft),t.vertexWrite(s.texcoords.lowerLeft),t.vertexEnd(),this._writeVertexCommon(t,e,i,s),t.vertexWrite(s.offsets.lowerRight),t.vertexWrite(s.texcoords.lowerRight),t.vertexEnd(),t.indexWrite(r+0),t.indexWrite(r+1),t.indexWrite(r+2),t.indexWrite(r+1),t.indexWrite(r+3),t.indexWrite(r+2)}_writeVertexCommon(t,e,i,s){const r=this._color,a=this._haloColor,o=k(0,0,this._referenceSize,this._bitset),l=k(0,0,this._size,this._haloSize);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(a),t.vertexWrite(l),t.vertexWrite(o),t.vertexWrite(this._minMaxZoom)}};class wt{bindFeature(t,e,i){}write(t,e,i,s){var o;if(V(this._effects)||((o=this._effects)==null?void 0:o.length)===0)return this._write(t,e,s);const r=Xt.executeEffects(this._effects,e.readLegacyGeometryForDisplay(),s.geometryEngine);let a=Xt.next(r);for(;a;)this._write(t,e,s,a),a=Xt.next(r)}_write(t,e,i,s){}}const $s=5;class _t extends _i(wt){constructor(t,e,i,s,r,a,o,l,h,u,c,_,f,m,d,y,p,g,v=!1,b,L){super(),this._xOffset=x(f),this._yOffset=x(m),this._decoration=u||"none",this._color=r,this._haloColor=a,this._haloSize=Math.min(Math.floor($s*x(Ti(i))),127),this._size=Math.min(Math.round(x(e)),127);const S=Math.min(Math.round(x(s||e)),127);this._referenceSize=Math.round(Math.sqrt(256*S)),this._scale=this._size/ei,this._angle=_,this._justify=ns(o||"center"),this._xAlignD=ai(o||"center"),this._yAlignD=oi(l||"baseline"),this._baseline=(l||"baseline")==="baseline",this._bitset=(h===B.MAP?1:0)|(c?1:0)<<1;const T=qt.load(t);T.sdf=!0,this._materialKey=T.data,this._lineWidth=x(d)||512,this._lineHeight=y||1,this._textPlacement=p,this._effects=g,this._isCIM=v,this._minMaxZoom=M(Math.round(b*C),Math.round(L*C))}static fromText(t,e){const i=new _t(t.materialKey,t.font.size,t.haloSize||0,t.font.size,t.color&&Y(t.color)||0,t.haloColor&&Y(t.haloColor)||0,t.horizontalAlignment,t.verticalAlignment,B.SCREEN,t.font.decoration,!1,t.angle||0,t.xoffset,t.yoffset,t.lineWidth,t.lineHeight,null,null,!1,G,Z),[,s]=Ie(t.text);return i.bindTextInfo(e,s),i._vertexBoundsScale=t.maxVVSize?t.maxVVSize/t.font.size:1,i}static fromCIMText(t,e,i){const s=t.scaleFactor||1,r=t.size*t.sizeRatio*s,[a,o]=J(t.scaleInfo,i),l=new _t(t.materialKey,r,t.outlineSize*t.sizeRatio,t.referenceSize,$(t.color),$(t.outlineColor),t.horizontalAlignment,t.verticalAlignment,t.alignment,t.decoration,t.colorLocked,t.angle,t.offsetX*t.sizeRatio*s,t.offsetY*t.sizeRatio*s,512,1,t.markerPlacement,t.effects,!0,a,o),[,h]=Ie(t.text);return l.bindTextInfo(e,h),l._vertexBoundsScale=t.maxVVSize?t.maxVVSize/r:1,l}}const Ws=mt.getLogger("esri.views.2d.engine.webgl.WGLLabelTemplate"),Cs=(n,t="mapview-labeling")=>Ws.error(new rt(t,n)),It=1,ot=0,Es=4,Ve=25;function As(n,t){const e=!!n.minScale&&t.scaleToZoom(n.minScale)||0;return je(e,0,25.5)}function Rs(n,t){const e=!!n.maxScale&&t.scaleToZoom(n.maxScale)||255;return je(e,0,25.5)}function ks(n){const t=new Map;return e=>(t.has(e)||t.set(e,n(e)),t.get(e))}const Fs=ks(n=>{let t=0;if(n===0)return 1/0;for(;!(n%2);)t++,n/=2;return t}),$t=n=>Math.floor(127*n+127),pt=n=>Math.floor(10*n),lt=n=>Math.round(n*(254/360));class kt extends _t{constructor(t,e,i,s){var c,_,f;super(t,i.font.size,i.haloSize||0,i.font.size,i.color&&Y(i.color)||0,i.haloColor&&Y(i.haloColor)||0,i.horizontalAlignment,i.verticalAlignment,as(e.labelPlacement)?B.MAP:B.SCREEN,i.font.decoration,!1,i.angle||0,i.xoffset,i.yoffset,i.lineWidth,i.lineHeight,null,null,null,null,null),this._outLineLabelAngle=0,this._refPlacementPadding=0,this._refPlacementDirX=0,this._refPlacementDirY=0,this._refOffsetX=0,this._refOffsetY=0,this._zoomLevel=0,this.geometryType=P.LABEL,this._allowOverrun=(c=e.allowOverrun)!=null?c:!1,this._repeatLabel=(_=e.repeatLabel)!=null?_:!0,this._labelPosition=(f=e.labelPosition)!=null?f:"curved";const r=As(e,s),a=Rs(e,s),o=e.labelPlacement,[l,h]=os(o);this._xAlignD=l,this._yAlignD=h,this._minZoom=r,this._maxZoom=a,this._refPlacementPadding=x(i.haloSize)+Ki,this._repeatLabelDistance=e.repeatLabelDistance?x(e.repeatLabelDistance):128;const u=ls.load(t);u.sdf=!0,this._materialKey=u.data}static fromLabelClass(t,e){if(t.labelPlacement==="esriServerLinePlacementCenterAlong"){const i=t.symbol;i.xoffset=0,i.yoffset=0,i.angle=0,i.font.decoration="none"}return new kt(t.materialKey,t,t.symbol,e)}get _shapedBox(){return ae(this._shapingInfo).bounds}setZoomLevel(t){this._zoomLevel=t}bindReferenceTemplate(t){let e=hs(this._xAlignD),i=cs(this._yAlignD);if(this._refOffsetX=0,this._refOffsetY=0,V(t))return void(this._refSymbolAndPlacementOffset=k(0,0,$t(e),$t(i)));if(t.boundsType==="circle"&&(e||i)){const a=Math.sqrt(e*e+i*i);e/=a,i/=a}const s=Math.max(t.height,t.width),r=this._refPlacementPadding*Es;this._refSymbolAndPlacementOffset=k(r,s,$t(e),$t(i)),this._referenceSize=s,this._refPlacementDirX=e,this._refPlacementDirY=i,this._refOffsetX=t.xOffset,this._refOffsetY=t.yOffset}_write(t,e){if(V(this._shapingInfo))return;const i=this._shapingInfo,s=e.getDisplayId(),r=e.geometryType==="esriGeometryPolygon"?e.readLegacyCentroid():e.readLegacyGeometry();if(r)switch(this._current={out:t,inId:s,inShaping:i,zoomLevel:this._zoomLevel},e.geometryType){case"esriGeometryPolyline":this._placeLineLabels(r);break;case"esriGeometryPoint":case"esriGeometryPolygon":this._placePointLabels(r);break;default:Cs("mapview-labeling",`Geometry of type ${e.geometryType} is not supported`)}}_isVisible(t,e){const i=pt(this._current.zoomLevel);return pt(t)<=i&&i<=pt(e)}_placePointLabels(t){const{out:e,inId:i,inShaping:s}=this._current;this._writeGlyphs(e,i,t,s)}_placeLineLabels(t){const e=zs(t.paths,this._current.inShaping.bounds.width),i=this._placeSubdivGlyphs.bind(this),s=(this._shapedBox.width+this._repeatLabelDistance)/(1<=s);)this._placeOnSegment(a,e,o,i,-1,r),o+=a.length+ot}_placeForward(t,e,i,s,r){const a=t.clone();let o=t.remainingLength+ot;for(;a.next()&&!(o>=s);)this._placeOnSegment(a,e,o,i,1,r),o+=a.length+ot}_placeFirst(t,e,i,s=!1){const r=t,a=this._current.inShaping,o=a.glyphs,l=this._current.zoomLevel,{out:h,inId:u}=this._current;for(const c of o){const _=c.x>a.bounds.x?i:1-i,f=_*t.remainingLength+(1-_)*t.backwardLength,m=Math.abs(c.x+c.width/2-a.bounds.x),d=Math.max(0,l+Math.log2(m/(f+ot))),y=Math.max(e,s?0:d);if(c.maxZoom=Ve,c.angle=t.angle+(1-i)*Math.PI,c.minZoom=y,this._writeGlyph(h,u,r.x,r.y,c),i&&this._isVisible(c.minZoom,c.maxZoom)){const p=c.bounds;h.metricBoxWrite(p.center[0],p.center[1],p.width,p.height)}}}_placeOnSegment(t,e,i,s,r,a){const o=this._current.inShaping.glyphs,{out:l,inId:h}=this._current,u=this._current.inShaping,c=this._current.zoomLevel,_=t.dx/t.length,f=t.dy/t.length,m={x:t.x+i*-r*_,y:t.y+i*-r*f};for(const d of o){const y=d.x>u.bounds.x?a:1-a;if(!(y&&r===1||!y&&r===-1))continue;const p=Math.abs(d.x+d.width/2-u.bounds.x),g=Math.max(0,c+Math.log2(p/i)-.1),v=Math.max(s,c+Math.log2(p/(i+t.length+ot)));if(g!==0&&(d.angle=t.angle+(1-a)*Math.PI,d.minZoom=v,d.maxZoom=g,this._writeGlyph(l,h,m.x,m.y,d),a&&this._isVisible(d.minZoom,d.maxZoom))){const b=d.bounds,L=t.x-e.x,S=t.y-e.y;l.metricBoxWrite(b.center[0]+L,b.center[1]+S,b.width,b.height)}}}_writeGlyphs(t,e,i,s,r=this._minZoom){if(i.x<0||i.x>=512||i.y<0||i.y>=512)return;const a=i.x+this._refOffsetX,o=i.y-this._refOffsetY;for(const c of s.glyphs)c.minZoom=r,c.maxZoom=this._maxZoom,this._writeGlyph(t,e,a,o,c);const l=this._refPlacementDirX,h=this._refPlacementDirY,u=s.boundsT;t.metricStart(e,r,a,o,l,h,this._referenceSize,this._materialKey),t.metricBoxWrite(u.center[0],u.center[1],u.width,u.height),t.metricEnd()}_writeVertexCommon(t,e,i,s){const r=this._color,a=this._haloColor,o=k(0,0,this._size,this._haloSize),l=Math.max(s.minZoom,this._minZoom),h=Math.min(s.maxZoom,this._maxZoom),u=k(pt(l),pt(h),this._outLineLabelAngle,0);t.vertexWrite(i),t.vertexWrite(e),t.vertexWrite(r),t.vertexWrite(a),t.vertexWrite(o),t.vertexWrite(this._refSymbolAndPlacementOffset),t.vertexWrite(u)}}const Oe=3.14159265359/180,De=8,di=n=>class extends n{constructor(...t){super(...t),this.angle=0,this.xOffset=0,this.yOffset=0,this.width=0,this.height=0,this.boundsType="square",this._anchorX=0,this._anchorY=0,this._computedWidth=0,this._computedHeight=0,this._vertexBoundsScaleX=1,this._vertexBoundsScaleY=1,this._offsets={xUpperLeft:0,yUpperLeft:0,xUpperRight:0,yUpperRight:0,xBottomLeft:0,yBottomLeft:0,xBottomRight:0,yBottomRight:0},this.geometryType=P.MARKER}_write(t,e,i,s){const r=e.getDisplayId();t.recordStart(r,this._materialKey,this.geometryType,!0),this._writeGeometry(t,e,r,i,s),t.recordEnd()}_writeGeometry(t,e,i,s,r){if(E(this._markerPlacement))return this._writePlacedMarkers(t,e,s,r);if(!r&&e.geometryType==="esriGeometryPoint"){const o=e.getX(),l=e.getY();return!t.hasAggregates&&t.hasPixelBufferEnabled&&(o<0||o>=513||l<0||l>=513)?void 0:this._writeVertices(t,i,this._getPos(o,l),o,l)}const a=r?re(ne(r),2):e.geometryType==="esriGeometryPolygon"?e.readCentroid():e.readGeometryForDisplay();if(!V(a)){if(a.isPoint){const[o,l]=a.coords;return!t.hasAggregates&&t.hasPixelBufferEnabled&&(o<0||o>=512||l<0||l>=512)?void 0:this._writeVertices(t,i,this._getPos(o,l),o,l)}a.forEachVertex((o,l)=>{const h=2*st;o<-h||o>=h||l<-h||l>=h||this._writeVertices(t,i,this._getPos(o,l),o,l)})}}_writePlacedMarkers(t,e,i,s){const r=s!=null?s:e.readLegacyGeometryForDisplay(),a=fi.getPlacement(r,ae(this._markerPlacement),x(1),i.geometryEngine);if(!a)return;const o=e.getDisplayId(),l=le(),h=oe(),u=-128,c=640;let _=a.next();for(;_!=null;){const f=_.tx,m=-_.ty;f>=u&&f<=c&&m>=u&&m<=c&&(this._applyTransformation(h,l,-_.getAngle()/Oe),this._writeVertices(t,o,this._getPos(f,m),f,m)),_=a.next()}}_writeVertices(t,e,i,s,r){const a=ce.load(this._materialKey);return a.symbologyType===Ot.HEATMAP?this._writeHeatmapVertices(t,e,i):this._writeMarkerVertices(t,e,a,i,s,r)}_writeMarkerVertices(t,e,i,s,r,a){const o=i.vvRotation,l=t.vertexCount();let h=this._computedWidth*this._vertexBoundsScaleX,u=this._computedHeight*this._vertexBoundsScaleY;if(this.angle){const c=Math.max(h,u);h=c,u=c}if(o){const c=Math.max(this.xOffset,this.yOffset);h+=c,u+=c}t.vertexBounds(r+this.xOffset,a-this.yOffset,h,u),t.vertexWrite(s),t.vertexWrite(this._offsetUpperLeft),t.vertexWrite(this._texUpperLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(s),t.vertexWrite(this._offsetUpperRight),t.vertexWrite(this._texUpperRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(s),t.vertexWrite(this._offsetBottomLeft),t.vertexWrite(this._texBottomLeft),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),t.vertexWrite(s),t.vertexWrite(this._offsetBottomRight),t.vertexWrite(this._texBottomRight),t.vertexWrite(this._bitestAndDistRatio),t.vertexWrite(e),t.vertexWrite(this._fillColor),t.vertexWrite(this._outlineColor),t.vertexWrite(this._sizeOutlineWidth),t.vertexWrite(this._minMaxZoom),t.vertexEnd(),this._writeIndices(t,l)}_writeHeatmapVertices(t,e,i){const s=t.vertexCount();t.vertexWrite(i),t.vertexWrite(this._offsetUpperLeft),t.vertexWrite(e),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetUpperRight),t.vertexWrite(e),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomLeft),t.vertexWrite(e),t.vertexEnd(),t.vertexWrite(i),t.vertexWrite(this._offsetBottomRight),t.vertexWrite(e),t.vertexEnd(),this._writeIndices(t,s)}_writeIndices(t,e){t.indexWrite(e+0),t.indexWrite(e+1),t.indexWrite(e+2),t.indexWrite(e+1),t.indexWrite(e+3),t.indexWrite(e+2)}_applyTransformation(t,e,i=0){zi(t,Ii(this.xOffset,-this.yOffset)),this.angle+i!==0&&$i(t,t,Oe*(this.angle+i));const s=this._computedWidth,r=this._computedHeight,a=-(.5+this._anchorX)*s,o=-(.5-this._anchorY)*r;bt(e,a,o),St(e,e,t),this._offsetUpperLeft=M(16*e[0],16*e[1]),this._offsets.xUpperLeft=e[0],this._offsets.yUpperLeft=e[1],bt(e,a+s,o),St(e,e,t),this._offsetUpperRight=M(16*e[0],16*e[1]),this._offsets.xUpperRight=e[0],this._offsets.yUpperRight=e[1],bt(e,a,o+r),St(e,e,t),this._offsetBottomLeft=M(16*e[0],16*e[1]),this._offsets.xBottomLeft=e[0],this._offsets.yBottomLeft=e[1],bt(e,a+s,o+r),St(e,e,t),this._offsetBottomRight=M(16*e[0],16*e[1]),this._offsets.xBottomRight=e[0],this._offsets.yBottomRight=e[1]}_getPos(t,e){return M(Math.round(De*t),Math.round(De*e))}};class D extends di(wt){constructor(t,e,i,s,r,a,o,l,h,u,c,_,f,m,d,y,p,g,v,b,L,S,T){super(),this.angle=s,this.height=o,this.width=a,this.xOffset=e*v,this.yOffset=i*v,this._markerPlacement=b,this._effects=L,this._anchorX=y,this._anchorY=p,this._minMaxZoom=M(Math.round(S*C),Math.round(T*C));const z=(m===B.MAP?Ni:Xi)|(c?it:0)|(f?Ui:0)|(_?Hi:0),N=d&&d.sdf,q=ce.load(t);q.sdf=N,q.pattern=!0,q.textureBinding=d.textureBinding,this._materialKey=q.data,this._fillColor=r,this._outlineColor=h,this._sizeOutlineWidth=k(Math.round(Math.min(Math.sqrt(128*a),255)),Math.round(Math.min(Math.sqrt(128*o),255)),Math.round(Math.min(Math.sqrt(128*u),255)),Math.round(Math.min(Math.sqrt(128*l),255)));const j=d.rect.x+I,O=d.rect.y+I,nt=j+d.width,at=O+d.height;this._offsets.xUpperLeft=j,this._offsets.yUpperLeft=O,this._offsets.xUpperRight=nt,this._offsets.yUpperRight=O,this._offsets.xBottomLeft=j,this._offsets.yBottomLeft=at,this._offsets.xBottomRight=nt,this._offsets.yBottomRight=at,q.symbologyType===Ot.PIE_CHART?(this._texUpperLeft=M(0,1),this._texUpperRight=M(1,1),this._texBottomLeft=M(0,0),this._texBottomRight=M(1,0)):(this._texUpperLeft=M(j,O),this._texUpperRight=M(nt,O),this._texBottomLeft=M(j,at),this._texBottomRight=M(nt,at)),a*=g,o*=g,a*=v,o*=v;const wi=Math.round(64*g);this._bitestAndDistRatio=M(z,wi),this._computedWidth=a,this._computedHeight=o;const bi=le(),Si=oe();this._applyTransformation(Si,bi)}static fromCIMMarker(t,e,i){const s=e&&e.width||1,r=e&&e.height||1,a=t.size,o=s/r*t.scaleX,l=t.scaleSymbolsProportionally&&t.frameHeight?a/t.frameHeight:1;let h=$(t.color);const u=$(t.outlineColor),c=x(a),_=c*o,f=x(t.offsetX||0),m=x(t.offsetY||0),d=x(t.outlineWidth||0)*l,y=t.alignment||B.SCREEN,p=x(t.referenceSize),[g,v]=J(t.scaleInfo,i);e.sdf||h!==0||(h=-1);let b=t.rotation||0;t.rotateClockwise||(b=-b);let L=0,S=0;const T=t.anchorPoint;T&&(t.isAbsoluteAnchorPoint?a&&(L=T.x/(a*o),S=T.y/a):(L=T.x,S=T.y));const z=new D(t.materialKey,f,m,b,h,_,c,p,u,d,t.colorLocked,t.scaleSymbolsProportionally,!1,y,e,L,S,t.sizeRatio,Ct(t.scaleFactor,1),t.markerPlacement,t.effects,g,v);return z._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/_:1,z._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/c:1,z}static fromPictureMarker(t,e){const i=Math.round(x(t.width)),s=Math.round(x(t.height)),r=ii,a=Math.round(x(t.xoffset||0)),o=Math.round(x(t.yoffset||0)),l=new D(t.materialKey,a,o,t.angle,r,i,s,s,0,0,!1,!1,!1,B.SCREEN,e,0,0,1,1,null,null,G,Z);return l._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.width:1,l._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.height:1,l}static fromSimpleMarker(t,e){const i=Y(t.color),s=Math.round(x(t.size)),r=s,a=Math.round(x(t.xoffset||0)),o=Math.round(x(t.yoffset||0)),l=t.style,h=t.outline,u=0|(h&&h.color&&Y(h.color)),c=0|(h&&h.width&&Math.round(x(h.width))),_=new D(t.materialKey,a,o,t.angle,i,s,r,r,u,c,!1,!1,l==="esriSMSCross"||l==="esriSMSX",B.SCREEN,e,0,0,126/64,1,null,null,G,Z);return _.boundsType=l==="esriSMSCircle"?"circle":"square",_._vertexBoundsScaleX=t.maxVVSize?t.maxVVSize/t.size:1,_._vertexBoundsScaleY=t.maxVVSize?t.maxVVSize/t.size:1,_}static fromLineSymbolMarker(t,e){const i=Y(t.color),s=6,r=Math.round(x(s*t.lineWidth)),a=r,o=t.style==="cross"||t.style==="x";let l;switch(t.placement){case"begin-end":l=Lt.Both;break;case"begin":l=Lt.JustBegin;break;case"end":l=Lt.JustEnd;break;default:l=Lt.None}const h={type:"CIMMarkerPlacementAtExtremities",angleToLine:!0,offset:0,extremityPlacement:l,offsetAlongLine:0},u=new D(t.materialKey,0,0,0,i,r,a,a/s,i,o?Math.round(x(t.lineWidth)):0,!1,!1,o,B.MAP,e,0,0,126/64,1,h,null,G,Z);return u.boundsType=t.style==="circle"?"circle":"square",u}}function Bs(n,t,e,i,s,r,a){ee=0;const o=(i-e)*r,l=s&&s.length,h=l?(s[0]-e)*r:o;let u,c,_,f,m,d=mi(t,e,i,0,h,r,!0);if(d&&d.next!==d.prev){if(l&&(d=Gs(t,e,i,s,d,r)),o>80*r){u=_=t[0+e*r],c=f=t[1+e*r];for(let y=r;y0)for(let l=i;l=i;l-=r)o=Ge(l+t*r,n[l+t*r],n[l+1+t*r],o);return o&&et(o,o.next)&&(Mt(o),o=o.next),o}function xt(n,t=n){if(!n)return n;let e,i=n;do if(e=!1,i.steiner||!et(i,i.next)&&W(i.prev,i,i.next)!==0)i=i.next;else{if(Mt(i),i=t=i.prev,i===i.next)break;e=!0}while(e||i!==t);return t}function gt(n,t,e,i,s,r,a,o){if(!n)return;!o&&r&&(n=pi(n,i,s,r));let l=n;for(;n.prev!==n.next;){const h=n.prev,u=n.next;if(r?Os(n,i,s,r):Vs(n))t.push(h.index/e+a),t.push(n.index/e+a),t.push(u.index/e+a),Mt(n),n=u.next,l=u.next;else if((n=u)===l){o?o===1?gt(n=Ys(n,t,e,a),t,e,i,s,r,a,2):o===2&&qs(n,t,e,i,s,r,a):gt(xt(n),t,e,i,s,r,a,1);break}}}function Vs(n){const t=n.prev,e=n,i=n.next;if(W(t,e,i)>=0)return!1;let s=n.next.next;const r=s;let a=0;for(;s!==n.prev&&(a===0||s!==r);){if(a++,ut(t.x,t.y,e.x,e.y,i.x,i.y,s.x,s.y)&&W(s.prev,s,s.next)>=0)return!1;s=s.next}return!0}function Os(n,t,e,i){const s=n.prev,r=n,a=n.next;if(W(s,r,a)>=0)return!1;const o=s.xr.x?s.x>a.x?s.x:a.x:r.x>a.x?r.x:a.x,u=s.y>r.y?s.y>a.y?s.y:a.y:r.y>a.y?r.y:a.y,c=Jt(o,l,t,e,i),_=Jt(h,u,t,e,i);let f=n.prevZ,m=n.nextZ;for(;f&&f.z>=c&&m&&m.z<=_;){if(f!==n.prev&&f!==n.next&&ut(s.x,s.y,r.x,r.y,a.x,a.y,f.x,f.y)&&W(f.prev,f,f.next)>=0||(f=f.prevZ,m!==n.prev&&m!==n.next&&ut(s.x,s.y,r.x,r.y,a.x,a.y,m.x,m.y)&&W(m.prev,m,m.next)>=0))return!1;m=m.nextZ}for(;f&&f.z>=c;){if(f!==n.prev&&f!==n.next&&ut(s.x,s.y,r.x,r.y,a.x,a.y,f.x,f.y)&&W(f.prev,f,f.next)>=0)return!1;f=f.prevZ}for(;m&&m.z<=_;){if(m!==n.prev&&m!==n.next&&ut(s.x,s.y,r.x,r.y,a.x,a.y,m.x,m.y)&&W(m.prev,m,m.next)>=0)return!1;m=m.nextZ}return!0}function Ge(n,t,e,i){const s=dt.create(n,t,e);return i?(s.next=i.next,s.prev=i,i.next.prev=s,i.next=s):(s.prev=s,s.next=s),s}function Mt(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Ds(n){let t=n,e=n;do(t.x=e.next.y&&e.next.y!==e.y){const _=e.x+(s-e.y)*(e.next.x-e.x)/(e.next.y-e.y);if(_<=i&&_>a){if(a=_,_===i){if(s===e.y)return e;if(s===e.next.y)return e.next}r=e.x=e.x&&e.x>=l&&i!==e.x&&ut(sr.x)&&vt(e,n)&&(r=e,c=u)),e=e.next;return r}function pi(n,t,e,i){for(let s;s!==n;s=s.next){if(s=s||n,s.z===null&&(s.z=Jt(s.x,s.y,t,e,i)),s.prev.next!==s||s.next.prev!==s)return s.prev.next=s,s.next.prev=s,pi(n,t,e,i);s.prevZ=s.prev,s.nextZ=s.next}return n.prevZ.nextZ=null,n.prevZ=null,Ns(n)}function Ns(n){let t,e=1;for(;;){let i,s=n;n=null,t=null;let r=0;for(;s;){r++,i=s;let a=0;for(;a0||o>0&&i;){let l;a===0?(l=i,i=i.nextZ,o--):o!==0&&i?s.z<=i.z?(l=s,s=s.nextZ,a--):(l=i,i=i.nextZ,o--):(l=s,s=s.nextZ,a--),t?t.nextZ=l:n=l,l.prevZ=t,t=l}s=i}if(t.nextZ=null,e*=2,r<2)return n}}function W(n,t,e){return(t.y-n.y)*(e.x-t.x)-(t.x-n.x)*(e.y-t.y)}function yi(n,t,e,i){return!!(et(n,t)&&et(e,i)||et(n,i)&&et(e,t))||W(n,t,e)>0!=W(n,t,i)>0&&W(e,i,n)>0!=W(e,i,t)>0}function Xs(n,t){let e=n;do{if(e.index!==n.index&&e.next.index!==n.index&&e.index!==t.index&&e.next.index!==t.index&&yi(e,e.next,n,t))return!0;e=e.next}while(e!==n);return!1}function Us(n,t,e,i,s,r){let a=0;for(let o=i,l=s-r;o=0&&(n-a)*(i-o)-(e-a)*(t-o)>=0&&(e-a)*(r-o)-(s-a)*(i-o)>=0}function vt(n,t){return W(n.prev,n,n.next)<0?W(n,t,n.next)>=0&&W(n,n.prev,t)>=0:W(n,t,n.prev)<0||W(n,n.next,t)<0}function Jt(n,t,e,i,s){return(n=1431655765&((n=858993459&((n=252645135&((n=16711935&((n=32767*(n-e)*s)|n<<8))|n<<4))|n<<2))|n<<1))|(t=1431655765&((t=858993459&((t=252645135&((t=16711935&((t=32767*(t-i)*s)|t<<8))|t<<4))|t<<2))|t<<1))<<1}function et(n,t){return n.x===t.x&&n.y===t.y}function Hs(n,t){return n.x-t.x}function Ys(n,t,e,i){let s=n;do{const r=s.prev,a=s.next.next;!et(r,a)&&yi(r,s,s.next,a)&&vt(r,a)&&vt(a,r)&&(t.push(r.index/e+i),t.push(s.index/e+i),t.push(a.index/e+i),Mt(s),Mt(s.next),s=n=a),s=s.next}while(s!==n);return s}function qs(n,t,e,i,s,r,a){let o=n;do{let l=o.next.next;for(;l!==o.prev;){if(o.index!==l.index&&js(o,l)){let h=xi(o,l);return o=xt(o,o.next),h=xt(h,h.next),gt(o,t,e,i,s,r,a,0),void gt(h,t,e,i,s,r,a,0)}l=l.next}o=o.next}while(o!==n)}function js(n,t){return n.next.index!==t.index&&n.prev.index!==t.index&&!Xs(n,t)&&vt(n,t)&&vt(t,n)&&Qs(n,t)}function Qs(n,t){let e=n,i=!1;const s=(n.x+t.x)/2,r=(n.y+t.y)/2;do e.y>r!=e.next.y>r&&e.next.y!==e.y&&s<(e.next.x-e.x)*(r-e.y)/(e.next.y-e.y)+e.x&&(i=!i),e=e.next;while(e!==n);return i}function xi(n,t){const e=dt.create(n.index,n.x,n.y),i=dt.create(t.index,t.x,t.y),s=n.next,r=t.prev;return n.next=t,t.prev=n,e.next=s,s.prev=e,i.next=e,e.prev=i,r.next=i,i.prev=r,i}class dt{constructor(){this.index=0,this.x=0,this.y=0,this.prev=null,this.next=null,this.z=null,this.prevZ=null,this.nextZ=null,this.steiner=!1}static create(t,e,i){const s=ee0))break;c+=p,_.push(o+u),u+=y}const f=a.length;Bs(a,e,o,o+u,_,2,r);const m=er(a,e,f,a.length,r),d=Math.abs(c);if(Math.abs((m-d)/Math.max(1e-7,d))>tr)return a.length=0,!1;l=h,o+=u}return!0}function sr(n){const{coords:t,lengths:e}=n,{buffer:i}=is(t,e);return i}function rr(n,t,e){let i=0;for(let s=0;se||le)return!0}i+=r}return!1}function nr(n,t){if(V(n))return null;if(!rr(n,-128,st+128))return n;tt.setPixelMargin(t),tt.reset(hi.Polygon);let e=0;for(let a=0;as||cs){a=!0;continue}l.push({x:u,y:c})}let _=!1;const f=h.length;for(let m=1;ms||cs){_=!0;break}l.push({x:u,y:c})}if(_)a=!0;else{if(a){const m=e.resultWithStarts();if(m)for(const d of m)r.push(d)}else r.push({line:l,start:0});o++,a=!1}}return r=r.filter(l=>l.line.length>1),r.length===0?null:r}tt.setExtent(st),ie.setExtent(st);const Ft=8,R=16,Ke=65535,gi=n=>class extends n{constructor(...t){super(...t),this.tessellationProperties={},this._tessellationOptions={halfWidth:0,pixelCoordRatio:1,offset:0},this.geometryType=P.LINE}writeGeometry(t,e,i,s){this._writeGeometry(t,e,i,s)}_initializeTessellator(t){const e=Et.load(this._materialKey),i=ft.load(this._materialKey),s=this._tessellationOptions,r=e.vvSizeFieldStops||e.vvSizeMinMaxValue||e.vvSizeScaleStops||e.vvSizeUnitValue,a=this.tessellationProperties._halfWidth(i,s,r,a,o,l,h,u,c,_,f)=>{const m=M(f,Math.ceil(R*n._halfWidth)),d=k(Math.round(R*h),Math.round(R*u),Math.round(R*c),Math.round(R*_)),y=k(R*o,R*l,0,n._bitset),p=n.out;return p.vertexBounds(i,s,t,e),p.vertexWrite(M(Ft*i,Ft*s)),p.vertexWrite(n.id),p.vertexWrite(n._fillColor),p.vertexWrite(d),p.vertexWrite(m),p.vertexWrite(n._tl),p.vertexWrite(n._br),p.vertexWrite(y),p.vertexWrite(M(Math.ceil(R*n._halfReferenceWidth),0)),p.vertexWrite(n.minMaxZoom),p.vertexEnd(),n.offset+n.vertexCount++},lr=(n,t,e)=>(i,s,r,a,o,l,h,u,c,_,f)=>{const m=M(R*n._halfWidth,R*n._halfReferenceWidth),d=k(R*h+128,R*u+128,R*c+128,R*_+128),y=n.out,p=n._bitset<<24|n.id;y.vertexBounds(i,s,t,e),y.vertexWrite(M(Ft*i,Ft*s)),y.vertexWrite(p),y.vertexWrite(n._fillColor);const g=li(n.key);return g||(y.vertexWrite(0),y.vertexWrite(0)),y.vertexWrite(0),y.vertexWrite(m),y.vertexWrite(d),g||y.vertexWrite(n.minMaxZoom),y.vertexEnd(),n.offset+n.vertexCount++},hr=n=>(t,e,i)=>{const s=n.out;s.indexWrite(t),s.indexWrite(e),s.indexWrite(i),n.indexCount+=3};class U extends gi(wt){constructor(t,e,i,s,r,a,o,l,h,u,c,_,f,m,d,y,p,g,v,b){super();const L=Et.load(t);e&&(L.sdf=e.sdf,L.pattern=!0,L.textureBinding=e.textureBinding),this._capType=s,this._joinType=r,this._miterLimitCosine=Qt(a),this.tessellationProperties._fillColor=o,this.tessellationProperties._tl=l,this.tessellationProperties._br=h,this._hasPattern=u,this._isDashed=c,this._zOrder=p,this._effects=g,this._minMaxZoom=M(Math.round(v*C),Math.round(b*C)),this._materialKey=L.data;const S=(f?it:0)|(m?qi:0)|(_?si:0)|(d?Vt:0);this.tessellationProperties._bitset=S,this.tessellationProperties._halfWidth=.5*i,this.tessellationProperties._halfReferenceWidth=.5*y,this.tessellationProperties.offset=0,this._initializeTessellator(!1)}static fromCIMLine(t,e,i){const s=t.color,r=t.scaleFactor||1,a=!!t.dashTemplate;let o=t.cap;a&&o===ze.ROUND&&(o=ze.SQUARE);const l=t.join,h=x(t.width)*r,u=x(t.referenceWidth),c=x(t.miterLimit),_=s&&$(s)||0,[f,m]=J(t.scaleInfo,i),d=!1;if(!e)return new U(t.materialKey,e,h,o,l,c,_,0,0,!1,a,t.scaleDash,t.colorLocked,d,t.sampleAlphaOnly,u,t.zOrder,t.effects,f,m);const{rect:y,width:p,height:g}=e,v=y.x+I,b=y.y+I,L=v+p,S=b+g,T=M(v,b),z=M(L,S),N=!1;return new U(t.materialKey,e,h,o,l,c,_,T,z,!0,a,t.scaleDash,t.colorLocked,N,t.sampleAlphaOnly,u,t.zOrder,t.effects,f,m)}static fromFillOutline(t){var i;const e=ft.load(t.materialKey);return At(e)&&t.outline&&((i=t.outline)==null?void 0:i.style)==="esriSLSSolid"?U.fromSimpleLine({hash:"",materialKey:t.materialKey,...t.outline},null,!0):null}static fromSimpleLine(t,e,i=!1){const{color:s}=t,r=t.style!=="esriSLSSolid"&&t.style!=="esriSLSNull",a=Ji(t.cap||"round"),o=ts(t.join||"round");let l=s&&t.style!=="esriSLSNull"&&Y(s)||0;t.style==="esriSLSNull"&&(l=0);const h=x(t.width),u=t.miterLimit;if(!e)return new U(t.materialKey,e,h,a,o,u,l,0,0,!1,r,!0,!1,i,!1,h,0,null,G,Z);const{rect:c,width:_,height:f}=e,m=c.x+I,d=c.y+I,y=m+_,p=d+f,g=M(m,d),v=M(y,p);return new U(t.materialKey,e,h,a,o,u,l,g,v,!0,r,!0,!1,i,!1,h,0,null,G,Z)}static fromPictureLineSymbol(t,e,i,s){return mt.getLogger("esri.views.2d.engine.webgl.WGLLineTemplate").error("PictureLineSymbol support does not exist!"),null}}const cr=100,Ne=1,Mi=n=>class extends n{constructor(...t){super(...t),this.forceLibtess=!1,this._bitset=0,this._lineTemplate=null,this.geometryType=P.FILL}_maybeAddLineTemplate(t){this._lineTemplate=U.fromFillOutline(t)}_write(t,e,i,s){const r=e.geometryType==="esriGeometryPoint",a=ft.load(this._materialKey);t.recordStart(e.getDisplayId(),this._materialKey,this.geometryType,r),this._writeGeometry(t,e,a,s,r),At(a)&&E(this._lineTemplate)&&this._lineTemplate.writeGeometry(t,e,s,r),t.recordEnd()}_writeGeometry(t,e,i,s,r){const a=this._getGeometry(e,s,r);if(V(a))return;const o=[];if(!(a.maxLength>cr)&&!this.forceLibtess&&ir(o,a))return void(o.length&&this._writeVertices(t,e,a.coords,a.lengths,i,o));const l=sr(a);this._writeVertices(t,e,l,[l.length/2],i)}_writeVertex(t,e,i,s,r,a){const o=M(Ne*s,Ne*r);if(t.vertexBounds(s,r,0,0),t.vertexWrite(o),t.vertexWrite(e),i.symbologyType===Ot.DOT_DENSITY)t.vertexWriteF32(1/Math.abs(a.readGeometryArea()));else{t.vertexWrite(this.fillColor);const l=li(i);l||(t.vertexWrite(this.tl),t.vertexWrite(this.br)),t.vertexWrite(this.aux21),t.vertexWrite(this.aux22),t.vertexWrite(this.aux3),l||t.vertexWrite(this._minMaxZoom)}}_writeVertices(t,e,i,s,r,a){const o=e.getDisplayId(),l=this._bitset<<24|o,h=s.reduce((f,m)=>f+m),u=Yt(r.geometryType,r.symbologyType).geometry/4,c=t.vertexCount();t.vertexEnsureSize(u*h);let _=0;if(a)for(const f of a){const m=i[2*f],d=i[2*f+1];this._writeVertex(t,l,r,m,d,e),_++}else for(let f=0;f0,o=e.readLegacyFeature(),l=e.getObjectId(),h=this._materialCache,u=this._cimLayer.materialHash;if(!u)return Xe.error("A Dynamic mesh template must have a material hash value or function!"),Promise.reject(null);const c=typeof u=="function"?u(o,i,s,l):u;if(h.has(c)){const v=h.get(c);return Promise.resolve(v)}const _=this._ongoingMaterialRequestMap.get(c);if(_)return _;const f=this._cimLayer,m=ms(f.cim,this._cimLayer.materialOverrides);m.mosaicHash=c;const{type:d,url:y}=f,p={cim:m,type:d,mosaicHash:c,url:y,size:null,dashTemplate:null,text:null,fontName:null,objectId:l,animatedSymbolProperties:null};switch(d){case"marker":p.size=Pt(f.size,o,i,s),p.animatedSymbolProperties=Pt(f.animatedSymbolProperties,o,i,s);break;case"line":p.dashTemplate=f.dashTemplate;break;case"text":p.text=Pt(f.text,o,i,s),p.fontName=Pt(f.fontName,o,i,s)}const g=t.getMosaicItem(p,r).then(v=>(a||(this._ongoingMaterialRequestMap.delete(c),h.set(c,v)),v)).catch(v=>(this._ongoingMaterialRequestMap.delete(c),Xe.error(".analyze()",v.message),null));return a||this._ongoingMaterialRequestMap.set(c,g),g}}const Ue=128;class pe extends Mi(Nt){constructor(t,e,i){var u;if(super(t),this._minMaxZoom=M(Math.round(e*C),Math.round(i*C)),w(t.color)){const c=(_,f,m)=>{const d=t.color(_,f,m);return d&&$(d)||0};this._dynamicPropertyMap.set("fillColor",c)}else{const c=t.color;this.fillColor=c&&$(c)||0}const s=((u=t.cim.placement)==null?void 0:u.type)==="CIMMarkerPlacementInsidePolygon"&&t.cim.placement.shiftOddRows?2:1,r=t.height;if(w(r)){const c=(_,f,m)=>r(_,f,m)*s;this._dynamicPropertyMap.set("_height",c)}else this._height=(r||0)*s;const a=t.offsetX;if(w(a)){const c=(_,f,m)=>x(a(_,f,m));this._dynamicPropertyMap.set("_offsetX",c)}else this._offsetX=x(a||0);const o=t.offsetY;if(w(o)){const c=(_,f,m)=>x(-o(_,f,m));this._dynamicPropertyMap.set("_offsetY",c)}else this._offsetY=x(-o||0);const l=t.scaleX;w(l)?this._dynamicPropertyMap.set("_scaleX",l):this._scaleX=l||1;const h=t.angle;if(w(h)){const c=(_,f,m)=>jt(h(_,f,m));this._dynamicPropertyMap.set("_angle",c)}else this._angle=jt(h)||0;if(E(t.effects)){const c=t.effects;w(c)?this._dynamicPropertyMap.set("_effects",c):this._effects=c}this._cimFillLayer=t,this._bitset=(t.colorLocked?it:0)|(t.applyRandomOffset?ri:0)|(t.sampleAlphaOnly?Vt:0),this._fillMaterialKey=t.materialKey}static fromCIMFill(t,e){const[i,s]=J(t.scaleInfo,e);return new pe(t,i,s)}bindFeature(t,e,i){const s=t.readLegacyFeature();this._dynamicPropertyMap.forEach((u,c)=>{this[c]=u(s,e,i)});const r=ft.load(this._fillMaterialKey),a=this._materialCache,o=(0,this._cimFillLayer.materialHash)(s,e,i),l=a.get(o);let h=null;if(l&&F(l.spriteMosaicItem)&&(h=l.spriteMosaicItem),h){const{rect:u,width:c,height:_}=h,f=u.x+I,m=u.y+I,d=f+c,y=m+_;let p=Math.round(x(this._height));p<=0&&(p=y-m);let g=Math.round(x(this._height/_*c||0));g<=0&&(g=d-f);const v=this._scaleX,b=1;this.tl=M(f,m),this.br=M(d,y),this.aux21=M(g,p),this.aux22=M(this._offsetX,this._offsetY),this.aux3=k(v*Ue,b*Ue,this._angle,0),r.sdf=h.sdf,r.pattern=!0,r.textureBinding=h.textureBinding}else this.tl=0,this.br=0,this.aux21=0,this.aux22=0,this.aux3=0,r.sdf=!1,r.pattern=!1,r.textureBinding=0;this._materialKey=r.data}}class ye extends gi(Nt){constructor(t,e,i){super(t),this._minMaxZoom=M(Math.round(e*C),Math.round(i*C)),this._cimLineLayer=t;let s=0;w(t.width)||(s=.5*x(t.width));const r=(c,_,f)=>w(t.width)?.5*x(t.width(c,_,f)):s;this._dynamicPropertyMap.set("_halfWidth",r),w(t.cap)?this._dynamicPropertyMap.set("_capType",t.cap):this._capType=t.cap,w(t.join)?this._dynamicPropertyMap.set("_joinType",t.join):this._joinType=t.join;const a=t.color;if(w(a)){const c=(_,f,m)=>$(a(_,f,m));this._dynamicPropertyMap.set("_fillColor",c)}else this._fillColor=a&&$(a)||0;const o=t.miterLimit;if(w(o)){const c=(_,f,m)=>Qt(o(_,f,m));this._dynamicPropertyMap.set("_miterLimitCosine",c)}else this._miterLimitCosine=Qt(o);if(E(t.effects)){const c=t.effects;w(c)?this._dynamicPropertyMap.set("_effects",c):this._effects=c}this._scaleFactor=t.scaleFactor||1,this._isDashed=t.dashTemplate!=null;const l=t.colorLocked?it:0,h=t.scaleDash?si:0,u=t.sampleAlphaOnly?Vt:0;this.tessellationProperties._bitset=l|h|u,this._materialKey=t.materialKey,this._initializeTessellator(!0)}static fromCIMLine(t,e){const[i,s]=J(t.scaleInfo,e);return new ye(t,i,s)}bindFeature(t,e,i){const s=t.readLegacyFeature();this._dynamicPropertyMap.forEach((u,c)=>{this[c]=u(s,e,i)}),this._halfWidth*=this._scaleFactor;const r=this._materialCache,a=(0,this._cimLineLayer.materialHash)(s,e,i),o=r.get(a);let l=null;if(o&&F(o.spriteMosaicItem)&&(l=o.spriteMosaicItem),l){this._hasPattern=!0;const{rect:u,width:c,height:_}=l,f=u.x+I,m=u.y+I,d=f+c,y=m+_;this.tessellationProperties._tl=M(f,m),this.tessellationProperties._br=M(d,y)}else this._hasPattern=!1,this.tessellationProperties._tl=0,this.tessellationProperties._br=0;this.tessellationProperties._fillColor=this._fillColor,this.tessellationProperties._halfWidth=this._halfWidth,this.tessellationProperties.offset=0,this.tessellationProperties._halfReferenceWidth=this.tessellationProperties._halfWidth;const h=Et.load(this._materialKey);l&&(h.sdf=l.sdf,h.pattern=!0,h.textureBinding=l.textureBinding),this._materialKey=h.data}}const ur=le(),fr=oe();class xe extends di(Nt){constructor(t,e,i){super(t),this._cimMarkerLayer=t,this._minMaxZoom=M(Math.round(e*C),Math.round(i*C));const s=t.color;if(w(s)){const _=(f,m,d)=>$(s(f,m,d));this._dynamicPropertyMap.set("_fillColor",_)}else this._fillColor=$(s);const r=t.outlineColor;if(w(r)){const _=(f,m,d)=>$(r(f,m,d));this._dynamicPropertyMap.set("_outlineColor",_)}else this._outlineColor=$(r);const a=t.size;if(w(a)){const _=(f,m,d)=>x(a(f,m,d));this._dynamicPropertyMap.set("_size",_)}else this._size=x(a)||0;const o=t.scaleX;w(o)?this._dynamicPropertyMap.set("_scaleX",o):this._scaleX=o;const l=t.offsetX;if(w(l)){const _=(f,m,d)=>x(l(f,m,d));this._dynamicPropertyMap.set("xOffset",_)}else this.xOffset=x(l)||0;const h=t.offsetY;if(w(h)){const _=(f,m,d)=>x(h(f,m,d));this._dynamicPropertyMap.set("yOffset",_)}else this.yOffset=x(h)||0;const u=t.outlineWidth;if(w(u)){const _=(f,m,d)=>x(u(f,m,d));this._dynamicPropertyMap.set("_outlineWidth",_)}else this._outlineWidth=x(u)||0;const c=t.rotation;if(w(c)?this._dynamicPropertyMap.set("_angle",c):this._angle=c||0,E(t.effects)){const _=t.effects;w(_)?this._dynamicPropertyMap.set("_effects",_):this._effects=_}if(E(t.markerPlacement)){const _=t.markerPlacement;w(_)?this._dynamicPropertyMap.set("_markerPlacement",_):this._markerPlacement=_}this._scaleFactor=Ct(t.scaleFactor,1),this._bitSet=(t.alignment===B.MAP?1:0)|(t.colorLocked?1:0)<<1|(t.scaleSymbolsProportionally?1:0)<<3,this._materialKey=t.materialKey}static fromCIMMarker(t,e){const[i,s]=J(t.scaleInfo,e);return new xe(t,i,s)}bindFeature(t,e,i){const s=t.readLegacyFeature(),r=t.getObjectId();this._dynamicPropertyMap.forEach((nt,at)=>{this[at]=nt(s,e,i)});const a=this._cimMarkerLayer.materialHash,o=typeof a=="function"?a(s,e,i,r):a,l=this._materialCache.get(o);if(!l||!F(l.spriteMosaicItem)||!l.spriteMosaicItem)return void mt.getLogger("esri.views.2d.engine.webgl.WGLDynamicMarkerTemplate").error(new rt("mapview-cim","Encountered an error when binding feature"));const h=l.spriteMosaicItem,u=this._cimMarkerLayer.sizeRatio,c=h.width/h.height*this._scaleX,_=this._cimMarkerLayer.rotateClockwise?this._angle:-this._angle;let f=this._size,m=f*c;const d=this.xOffset,y=this.yOffset;this.xOffset*=this._scaleFactor,this.yOffset*=this._scaleFactor;const p=this._cimMarkerLayer.scaleSymbolsProportionally&&this._cimMarkerLayer.frameHeight?this._size/x(this._cimMarkerLayer.frameHeight):1,g=this._outlineWidth*p,v=x(this._cimMarkerLayer.referenceSize);let b=0,L=0;const S=this._cimMarkerLayer.anchorPoint;S&&(this._cimMarkerLayer.isAbsoluteAnchorPoint?this._size&&(b=x(S.x)/(this._size*c),L=x(S.y)/this._size):(b=S.x,L=S.y)),this._anchorX=b,this._anchorY=L,this._sizeOutlineWidth=k(Math.round(Math.min(Math.sqrt(128*m),255)),Math.round(Math.min(Math.sqrt(128*f),255)),Math.round(Math.min(Math.sqrt(128*g),255)),Math.round(Math.min(Math.sqrt(128*v),255))),this.angle=_;const T=Math.round(64*u);this._bitestAndDistRatio=M(this._bitSet,T);const z=h.rect.x+I,N=h.rect.y+I,q=z+h.width,j=N+h.height;this._texUpperLeft=M(z,N),this._texUpperRight=M(q,N),this._texBottomLeft=M(z,j),this._texBottomRight=M(q,j);const O=ce.load(this._materialKey);O.sdf=h.sdf,O.pattern=!0,O.textureBinding=h.textureBinding,this._materialKey=O.data,m*=u,f*=u,m*=this._scaleFactor,f*=this._scaleFactor,m*=h.rect.width/h.width,f*=h.rect.height/h.height,this._computedWidth=m,this._computedHeight=f,this._applyTransformation(fr,ur),this.xOffset=d,this.yOffset=y}}function vi(n){const t=new Array(n.length);for(let e=0;e$(r(y,p,g));this._dynamicPropertyMap.set("_color",d)}else this._color=$(r);const a=t.outlineColor;if(w(a)){const d=(y,p,g)=>$(a(y,p,g));this._dynamicPropertyMap.set("_haloColor",d)}else this._haloColor=$(a);let o;w(t.size)||(o=Math.min(Math.round(x(t.size*t.sizeRatio)),127));const l=(d,y,p)=>w(t.size)?Math.min(Math.round(x(t.size(d,y,p)*t.sizeRatio)),127):o;if(this._dynamicPropertyMap.set("_size",l),w(t.outlineSize)){const d=(y,p,g)=>Math.min(Math.floor(He*x(t.outlineSize(y,p,g)*t.sizeRatio)),127);this._dynamicPropertyMap.set("_haloSize",d)}else this._haloSize=Math.min(Math.floor(He*x(t.outlineSize*t.sizeRatio)),127);let h;w(t.offsetX)||(h=Math.round(x(t.offsetX*t.sizeRatio)));const u=(d,y,p)=>w(t.offsetX)?Math.round(x(t.offsetX(d,y,p)*t.sizeRatio)):h;let c;this._dynamicPropertyMap.set("_xOffset",u),w(t.offsetY)||(c=Math.round(x(t.offsetY*t.sizeRatio)));const _=(d,y,p)=>w(t.offsetY)?Math.round(x(t.offsetY(d,y,p)*t.sizeRatio)):c;if(this._dynamicPropertyMap.set("_yOffset",_),w(t.angle)?this._dynamicPropertyMap.set("_angle",t.angle):this._angle=t.angle,w(t.horizontalAlignment)?this._dynamicPropertyMap.set("_horizontalAlignment",t.horizontalAlignment):this._horizontalAlignment=t.horizontalAlignment,w(t.verticalAlignment)?this._dynamicPropertyMap.set("_verticalAlignment",t.verticalAlignment):this._verticalAlignment=t.verticalAlignment,E(t.effects)){const d=t.effects;w(d)?this._dynamicPropertyMap.set("_effects",d):this._effects=d}if(E(t.markerPlacement)){const d=t.markerPlacement;w(d)?this._dynamicPropertyMap.set("_markerPlacement",d):this._textPlacement=d}w(t.text)?this._dynamicPropertyMap.set("_text",t.text):this._text=t.text,this._scaleFactor=s;const f=Math.min(Math.round(x(t.referenceSize*t.sizeRatio)),127);this._referenceSize=Math.round(Math.sqrt(256*f)),this._materialKey=t.materialKey;const m=us.load(this._materialKey);m.sdf=!0,this._bitset=(t.alignment===B.MAP?1:0)|(t.colorLocked?1:0)<<1,this._materialKey=m.data,this._decoration="none",this._lineHeight=1,this._lineWidth=512,this._isCIM=!0}static fromCIMText(t,e){const[i,s]=J(t.scaleInfo,e);return new ge(t,i,s)}async analyze(t,e,i,s){const r=e.readLegacyFeature(),a=_r(this._cimTextLayer,r,i,s),o=await super.analyze(t,e,i,s,vi(a));return o&&o.glyphMosaicItems&&this._textToGlyphs.set(a,o.glyphMosaicItems),o}bindFeature(t,e,i){const s=t.readLegacyFeature();if(this._dynamicPropertyMap.forEach((a,o)=>{this[o]=a(s,e,i)}),!this._text||this._text.length===0)return void(this._shapingInfo=null);this._size*=this._scaleFactor,this._scale=this._size/ei,this._xOffset*=this._scaleFactor,this._yOffset*=this._scaleFactor,this._xAlignD=ai(Ct(this._horizontalAlignment,"center")),this._yAlignD=oi(Ct(this._verticalAlignment,"baseline"));const r=this._textToGlyphs.get(this._text);this.bindTextInfo(r,!1)}}const ht=128;class H extends Mi(wt){constructor(t,e,i,s,r,a,o,l,h,u,c,_,f,m,d,y){super(),this._effects=m;const p=ft.load(t);e&&(p.sdf=e.sdf,p.pattern=!0,p.textureBinding=e.textureBinding),this.fillColor=i,this.tl=s,this.br=r,this.aux21=M(a,o),this.aux22=M(l,h),this.aux3=k(u,c,_,0),this._bitset=f,this._minMaxZoom=M(Math.round(d*C),Math.round(y*C)),this._materialKey=p.data}static fromCIMFill(t,e,i){const s=t.color,r=s&&$(s)||0,a=t.materialKey,[o,l]=J(t.scaleInfo,i),h=(t.colorLocked?it:0)|(t.applyRandomOffset?ri:0)|(t.sampleAlphaOnly?Vt:0);if(!e)return new H(a,null,r,0,0,0,0,0,0,0,0,0,h,t.effects,o,l);const{rect:u,width:c,height:_}=e,f=t.scaleX||1,m=u.x+I,d=u.y+I,y=m+c,p=d+_,g=x(t.height),v=f*g;let b=Math.round(g);b<=0&&(b=p-d);let L=Math.round(v);L<=0&&(L=y-m);const S=x(t.offsetX||0),T=x(-t.offsetY||0),z=M(m,d),N=M(y,p);return new H(a,e,r,z,N,L,b,S,T,ht,ht,jt(t.angle),h,t.effects,o,l)}static fromSimpleFill(t,e,i=!1){const{color:s}=t,r=s&&t.style!=="esriSFSNull"&&Y(s)||0,a=i?it:0,o=t.materialKey;let l;if(e){const{rect:h,width:u,height:c,pixelRatio:_}=e,f=h.x+I,m=h.y+I,d=f+u,y=m+c,p=M(f,m),g=M(d,y);l=new H(o,e,r,p,g,u/_,c/_,0,0,ht,ht,0,a,null,G,Z)}else l=new H(o,null,r,0,0,0,0,0,0,0,0,0,a,null,G,Z);return l._maybeAddLineTemplate(t),l}static fromPictureFill(t,e,i=!1){const s=ii,{rect:r,width:a,height:o}=e,l=r.x+I,h=r.y+I,u=l+a,c=h+o,_=M(l,h),f=M(u,c),m=Math.round(x(t.width)),d=Math.round(x(t.height)),y=x(t.xoffset),p=x(-t.yoffset),g=t.materialKey,v=i?it:0,b=new H(g,e,s,_,f,m,d,y,p,ht*t.xscale,ht*t.yscale,0,v,null,G,Z);return b._maybeAddLineTemplate(t),b}}class dr{constructor(){this._resolver=null}isHeld(){return!!this._resolver}async acquire(){this._resolver?(await this._resolver.promise,await this.acquire()):this._resolver=Ci()}release(){const t=this._resolver;this._resolver=null,t==null||t.resolve()}}async function mr(n,t,e){try{await n.acquire(),await t(e),n.release()}catch(i){throw n.release(),i}}async function pr(n,t,e){if(!n.name)throw new rt("style-symbol-reference-name-missing","Missing name in style symbol reference");if(n.styleName&&n.styleName==="Esri2DPointSymbolsStyle")return yr(n,e);try{return xr(await Ei(n,t,e),n.name,t,e)}catch(i){return he(i),null}}async function yr(n,t){const e=Ai.replace(/\{SymbolName\}/gi,n.name);try{const i=await Qe(e,t);return Je(i.data)}catch(i){return he(i),null}}async function xr(n,t,e,i){const s=n.data,r={portal:e&&E(e.portal)?e.portal:Ri.getDefault(),url:ki(n.baseUrl),origin:"portal-item"},a=s.items.find(l=>l.name===t);if(!a)throw new rt("symbolstyleutils:symbol-name-not-found",`The symbol name '${t}' could not be found`,{symbolName:t});let o=Fi(Bi(a,"cimRef"),r);gs()&&(o=Ms(o));try{const l=await Qe(o,i);return Je(l.data)}catch(l){return he(l),null}}const Ye=async(n,t,e)=>new ps(await ys(n.data,t,e),n.data,n.rendererKey,n.maxVVSize),K=async(n,t,e,i)=>{if(!n)return null;if(n.type==="cim")return Ye(n,t,e);if(n.type==="web-style"){const s={type:"cim",data:await pr(n,null,i),rendererKey:n.rendererKey,maxVVSize:n.maxVVSize};return Ye(s,t,e)}return n};function Wt(n){if(!n)return null;const{type:t,cim:e,url:i,materialHash:s}=n,r={cim:e,type:t,mosaicHash:s,url:i,size:null,dashTemplate:null,path:null,text:null,fontName:null,animatedSymbolProperties:null};switch(t){case"marker":r.size=n.size,r.path=n.path,r.animatedSymbolProperties=n.animatedSymbolProperties;break;case"line":r.dashTemplate=n.dashTemplate;break;case"text":r.text=n.text,r.fontName=n.fontName}return r}const A=mt.getLogger("esri.views.2d.engine.webgl.mesh.templates.WGLTemplateStore"),qe=new Array,Me={isOutline:!1,placement:null,symbologyType:Ot.DEFAULT,vvFlags:0},gr={...Se,hash:JSON.stringify(Se),materialKey:ue(P.MARKER,Me)},Mr={...Le,hash:JSON.stringify(Le),materialKey:ue(P.LINE,Me)},vr={...Pe,hash:JSON.stringify(Pe),materialKey:ue(P.FILL,Me)};function X(n,t){const e=n.length;return n.push(null),t.then(i=>n[e]=i),n}function yt(n){return!!(1&n)}function wr(n){return n.name==="worker:port-closed"}class Or{constructor(t,e){this._idCounter=1,this._templateIdCounter=1,this._idToTemplateGroup=new Map,this._symbolToTemplate=new Map,this._fetchQueue=[],this._idToResolver=new Map,this._cimTemplateCache=new Map,this._cimAnalyses=[],this._lock=new dr,this._fetchResource=t,this._tileInfo=e}get _markerError(){return this._errorTemplates.marker[0]}get _fillError(){return this._errorTemplates.fill[0]}get _lineError(){return this._errorTemplates.line[0]}get _textError(){return this._errorTemplates.line[0]}createTemplateGroup(t,e){this._initErrorTemplates();const i=t.hash;if(this._symbolToTemplate.has(i))return this._symbolToTemplate.get(i);const s=new Array;e&&this._createMeshTemplates(s,e,!0),this._createMeshTemplates(s,t,!1);const r=this._createGroupId(t.type==="expanded-cim"&&br(t));return this._idToTemplateGroup.set(r,s),this._symbolToTemplate.set(i,r),r}getTemplateGroup(t){return this._idToTemplateGroup.has(t)?this._idToTemplateGroup.get(t):qe}getDynamicTemplateGroup(t){return this._idToTemplateGroup.has(t)?(yt(t)||A.error("mapview-template-store",`Id ${t} does not refer to a dynamic template`),this._idToTemplateGroup.get(t)):qe}getMosaicItem(t,e){const i=this._createTemplateId(),s=new Promise(r=>this._idToResolver.set(i,r));return this._fetchQueue.push({symbol:t,id:i,glyphIds:e}),s}finalize(t){return this._fetchQueue.length||this._lock.isHeld()?mr(this._lock,this._fetchAllQueuedResources.bind(this),t):Promise.resolve()}_initErrorTemplates(){this._errorTemplates||(this._errorTemplates={fill:this._createMeshTemplates([],vr,!1),marker:this._createMeshTemplates([],gr,!1),line:this._createMeshTemplates([],Mr,!1)})}_fetchAllQueuedResources(t){if(!this._fetchQueue.length)return Promise.resolve();const e=this._fetchQueue,i=this._cimAnalyses;return this._fetchQueue=[],this._cimAnalyses=[],Promise.all(i).then(()=>this._fetchResource(e,t).then(s=>{for(const{id:r,mosaicItem:a}of s)this._idToResolver.get(r)(a),this._idToResolver.delete(r)})).catch(s=>{Vi(s)?this._fetchQueue=this._fetchQueue.concat(e):wr(s)||A.error(new rt("mapview-template-store","Unable to fetch requested texture resources",s))})}_createGroupId(t){return this._idCounter++<<1|(t?1:0)}_createTemplateId(){return this._templateIdCounter++}async _createSMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return F(e,A)?D.fromSimpleMarker(t,e):this._markerError}async _createPMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return F(e,A)?D.fromPictureMarker(t,e):this._markerError}async _createSFS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return F(i,A)?H.fromSimpleFill(t,i,e):this._fillError}async _createPFS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return F(i,A)?H.fromPictureFill(t,i,e):this._fillError}async _createSLS(t,e){const{spriteMosaicItem:i}=await this.getMosaicItem(t);return F(i,A)?U.fromSimpleLine(t,i):this._lineError}async _createLMS(t){const{spriteMosaicItem:e}=await this.getMosaicItem(t);return F(e,A)?D.fromLineSymbolMarker(t,e):this._markerError}async _createTS(t){const{glyphMosaicItems:e}=await this.getMosaicItem(t);return _t.fromText(t,e)}async _createCIMText(t){const{glyphMosaicItems:e}=await this.getMosaicItem(Wt(t),vi(t.text));return F(e,A)?_t.fromCIMText(t,e,this._tileInfo):this._textError}async _createCIMFill(t){const{spriteMosaicItem:e}=await this.getMosaicItem(Wt(t));return F(e,A)?H.fromCIMFill(t,e,this._tileInfo):this._fillError}async _createCIMLine(t){const{spriteMosaicItem:e}=await this.getMosaicItem(Wt(t));return F(e,A)?U.fromCIMLine(t,e,this._tileInfo):this._lineError}async _createCIMMarker(t){const{spriteMosaicItem:e}=await this.getMosaicItem(Wt(t));return F(e,A)?D.fromCIMMarker(t,e,this._tileInfo):this._markerError}async _createCIM(t){const e=t.templateHash;if(this._cimTemplateCache.has(e))return this._cimTemplateCache.get(e);let i;switch(t.type){case"marker":i=await this._createCIMMarker(t);break;case"line":i=await this._createCIMLine(t);break;case"fill":i=await this._createCIMFill(t);break;case"text":i=await this._createCIMText(t)}return this._cimTemplateCache.set(e,i),i}async _createDynamicCIM(t){const e=t.templateHash;if(this._cimTemplateCache.has(e))return this._cimTemplateCache.get(e);let i;switch(t.type){case"marker":i=xe.fromCIMMarker(t,this._tileInfo);break;case"line":i=ye.fromCIMLine(t,this._tileInfo);break;case"fill":i=pe.fromCIMFill(t,this._tileInfo);break;case"text":i=ge.fromCIMText(t,this._tileInfo)}return this._cimTemplateCache.set(e,i),i}_createPrimitiveMeshTemplates(t,e,i){switch(e.type){case"esriSMS":return X(t,this._createSMS(e));case"esriPMS":return X(t,this._createPMS(e));case"esriSFS":return X(t,this._createSFS(e,i));case"line-marker":return X(t,this._createLMS(e));case"esriPFS":return X(t,this._createPFS(e,i));case"esriSLS":return X(t,this._createSLS(e,!1));case"esriTS":return X(t,this._createTS(e));default:return A.error("Unable to create mesh template for unknown symbol type {: $ }{symbol.type}"),t}}_createMeshTemplates(t,e,i){if(e.type.includes("3d"))return A.error("3D symbols are not supported with MapView"),t;if(e.type==="expanded-cim"){for(const s of e.layers)typeof s.materialHash=="function"?X(t,this._createDynamicCIM(s)):X(t,this._createCIM(s));return t}if(e.type==="composite-symbol"){for(const s of e.layers)this._createPrimitiveMeshTemplates(t,s,i);return t}return e.type==="cim"||e.type==="label"||e.type==="web-style"?t:this._createPrimitiveMeshTemplates(t,e,i)}}const br=n=>{if(!n.layers)return!1;for(const t of n.layers)if(typeof t.materialHash=="function")return!0;return!1};class Dr{constructor(t,e,i){this._loadPromise=rs(),this._geometryType=t,this._idField=e,this._templateStore=i}update(t,e){E(t.mesh.labels)&&(this._labelTemplates=this._createLabelTemplates(t.mesh.labels,e)),this._schema=t}_createLabelTemplates(t,e){const i=new Map;if(t.type==="simple"){for(const s of t.classes){const r=kt.fromLabelClass(s,e);i.set(s.index,r)}return i}for(const s in t.classes){const r=t.classes[s];for(const a of r){const o=kt.fromLabelClass(a,e);i.set(a.index,o)}}return i}get templates(){return this._templateStore}async analyze(t,e,i,s,r,a,o){if(Te(o))return;let l;i.type==="dictionary"&&(l=await i.analyze(this._idField,t.copy(),e,r,a,o));let h=0;for(;t.next();){let u;if(u=l?l[h++]:E(s)&&Qi(t.getDisplayId())&&t.readAttribute("cluster_count")!==1?s.match(this._idField,t,this._geometryType,r,a):i.match(this._idField,t,this._geometryType,r,a),t.setGroupId(u),yt(u)){const c=this._templateStore.getDynamicTemplateGroup(u);for(const _ of c)_&&_.analyze&&_.analyze(this._templateStore,t,r,a)}}return await this._loadPromise,this._templateStore.finalize(o)}async analyzeGraphics(t,e,i,s,r,a){if(Te(a))return;const o=t.getCursor();for(i&&await i.analyze(this._idField,o.copy(),e,s,r,a);o.next();){let l=o.getGroupId();if(l!=null&&l!==-1||(l=i.match(this._idField,o,o.geometryType,s,r),o.setGroupId(l)),yt(l)){const h=this._templateStore.getDynamicTemplateGroup(l);for(const u of h)u&&u.analyze&&u.analyze(this._templateStore,o,s,r)}o.setGroupId(l)}return await this._loadPromise,this._templateStore.finalize(a)}writeGraphic(t,e,i,s){const r=e.getGroupId(),a=e.getDisplayId(),o=this._templateStore.getTemplateGroup(r);if(t.featureStart(e.insertAfter,0),a!=null){if(yt(r))for(const l of o)l&&l.bindFeature(e,null,null);if(o){for(const l of o)l&&l.write(t,e,i,s);t.featureEnd()}}}writeCursor(t,e,i,s,r,a,o){const l=e.getGroupId(),h=e.getDisplayId(),u=this._templateStore.getTemplateGroup(l),c=this._schema.mesh.sortKey;let _=0;if(E(c)&&(_=c.fieldIndex!=null?e.getComputedNumericAtIndex(c.fieldIndex):c.field!=null?e.readAttribute(c.field):e.readAttribute(this._idField),_*=c.order==="asc"?1:-1),t.featureStart(0,_==null||isNaN(_)?0:_),h!=null&&u){if(yt(l))for(const f of u)f.bindFeature(e,i,s);for(const f of u)f.write(t,e,r,o);if(E(a)&&t.hasRecords){const f=a&&this._findLabelRef(u);this._writeLabels(t,e,a,f,r,o)}t.featureEnd()}}_findLabelRef(t){for(const e of t)if(e instanceof D)return e;return null}_writeLabels(t,e,i,s,r,a){for(const o of i)if(E(o)&&o){const{glyphs:l,rtl:h,index:u}=o,c=this._labelTemplates.get(u);c.setZoomLevel(r),c.bindReferenceTemplate(s),c.bindTextInfo(l,h),c.write(t,e,null,a)}}}const se=mt.getLogger("esri/views/2d/engine/webgl/util/Matcher");async function Sr(n,t,e,i){switch(n.type){case"simple":case"heatmap":return Q.fromBasicRenderer(n,t,e,i);case"map":return we.fromUVRenderer(n,t,e,i);case"interval":return ve.fromCBRenderer(n,t,e,i);case"dictionary":return be.fromDictionaryRenderer(n,t,e,i);case"pie-chart":return Bt.fromPieChartRenderer(n,t,e,i);case"subtype":return Bt.fromSubtypes(n,t,e,i)}}class Q{constructor(){this.type="feature",this._defaultResult=null}static async fromBasicRenderer(t,e,i,s){const r=new Q;if(t.symbol){const a=await K(t.symbol,i,s),o=e.createTemplateGroup(a,null);r.setDefault(o)}return r}static async fromPieChartRenderer(t,e,i,s){const r=new Q;if(t.markerSymbol){const a=await K(t.markerSymbol,i,s);let o;t.fillSymbol&&(o=await K(t.fillSymbol,i,s));const l=e.createTemplateGroup(a,o);r.setDefault(l)}return r}size(){return 1}getDefault(){return this._defaultResult}setDefault(t){this._defaultResult=t}match(t,e,i,s,r){return this.getDefault()}async analyze(t,e,i,s,r,a){return null}}class Bt extends Q{constructor(t,e){super(),this._subMatchers=t,this._subtypeField=e}static async fromSubtypes(t,e,i,s){const r=new Map,a=[];for(const o in t.renderers){const l=parseInt(o,10),h=Sr(t.renderers[o],e,i,s).then(u=>r.set(l,u));a.push(h)}return await Promise.all(a),new Bt(r,t.subtypeField)}match(t,e,i,s,r){const a=e.readAttribute(this._subtypeField),o=this._subMatchers.get(a);return o?o.match(t,e,i,s,r):null}}class ve extends Q{constructor(t,e,i,s){super(),this.type="interval",this._intervals=[],this._isMaxInclusive=e,this._fieldIndex=s,this._field=t,this._normalizationInfo=i}static async fromCBRenderer(t,e,i,s){const{isMaxInclusive:r,normalizationField:a,normalizationTotal:o,normalizationType:l}=t,h=t.field,u=new ve(h,r,{normalizationField:a,normalizationTotal:o,normalizationType:l},t.fieldIndex),c=await K(t.backgroundFillSymbol,i,s);await Promise.all(t.intervals.map(async f=>{const m=await K(f.symbol,i,s),d=await e.createTemplateGroup(m,c),y={min:f.min,max:f.max};u.add(y,d)}));const _=await K(t.defaultSymbol,i,s);if(_){const f=await e.createTemplateGroup(_,c);u.setDefault(f)}return u}add(t,e){this._intervals.push({interval:t,result:e}),this._intervals.sort((i,s)=>i.interval.min-s.interval.min)}size(){return super.size()+this._intervals.length}match(t,e,i,s,r){if(this._fieldIndex==null&&!this._field)return this.getDefault();const a=this._fieldIndex!=null?e.getComputedNumericAtIndex(this._fieldIndex):this._getValueFromField(e);if(a==null||isNaN(a)||a===1/0||a===-1/0)return this.getDefault();for(let o=0;o=l.min,c=this._isMaxInclusive?a<=l.max:a{const c=await K(u.symbol,i,s),_=await e.createTemplateGroup(c,o);u.value===""?l.setNullResult(_):l.add(u.value,_)}));const h=await K(t.defaultSymbol,i,s);if(h){const u=await e.createTemplateGroup(h,o);l.setDefault(u)}return l}setNullResult(t){this._nullResult=t}add(t,e){this._resultsMap.set(t.toString(),e)}size(){return super.size()+this._resultsMap.size}match(t,e,i,s,r){if(this._fieldsIndex==null&&!this._fields)return this.getDefault();const a=this._fieldsIndex!=null?e.getComputedStringAtIndex(this._fieldsIndex):this._getValueFromFields(e);if(this._nullResult!==null&&(a==null||a===""||a===""))return this._nullResult;if(a==null)return this.getDefault();const o=a.toString();return this._resultsMap.has(o)?this._resultsMap.get(o):this.getDefault()}_getValueFromFields(t){const e=[];for(const i of this._fields){const s=t.readAttribute(i);s==null||s===""?e.push(""):e.push(s)}return e.join(this._seperator)}}async function Lr(n,t){const e=n||1;if(typeof e=="number")return(s,r,a)=>e;const i=await Di(e,t.spatialReference,t.fields);return(s,r,a)=>xs(i,s,{$view:a},t.geometryType,r)||1}let Ut;async function Pr(){return Ut||(Ut=ti(()=>import("./createSymbolSchema.827eb617.js"),["assets/createSymbolSchema.827eb617.js","assets/Utils.2136650a.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js"])),Ut}class be extends Q{constructor(t,e,i,s,r,a){super(),this.type="dictionary",this._groupIdCache=new Oi(100),this._loader=t,this._fieldMap=t.fieldMap,this._symbolFields=t.getSymbolFields(),this._templates=e,this._info=i,this._scaleFn=s,this._schemaUtilsModule=r,this._symbolOptions=a}static async fromDictionaryRenderer(t,e,i,s){const[{DictionaryLoader:r},a]=await Promise.all([ti(()=>import("./index.221827cd.js").then(function(h){return h.k$}),["assets/index.221827cd.js","assets/index.f5419ca5.css"]),Pr()]),o=new r(t.url,t.config,t.fieldMap);await o.fetchResources({spatialReference:i.spatialReference,fields:i.fields});const l=await Lr(t.scaleExpression,i);return new be(o,e,i,l,a,t.symbolOptions)}async _analyzeFeature(t,e,i,s,r){const a=t.readLegacyFeature(),o=this._scaleFn(a,i,s),l=this._attributeHash(a)+"-"+o,h=this._groupIdCache.get(l);if(h)return h;const u={...s,spatialReference:this._info.spatialReference,abortOptions:r,fields:this._info.fields},c=await this._loader.getSymbolAsync(a,u),_=this._schemaUtilsModule.createSymbolSchema(c,this._symbolOptions),f=K(_,this._info,e,r).then(m=>{if(m.type!=="expanded-cim")return se.error(new rt("mapview-bad-type",`Found unexpected type ${m.type} in dictionary response`)),null;m.hash+="-"+o;for(const d of m.layers)d.scaleFactor=o,d.templateHash+="-"+o;return this._templates.createTemplateGroup(m,null)});return this._groupIdCache.put(l,f,1),f}async analyze(t,e,i,s,r,a){const o=e.getCursor(),l=[];for(;o.next();)l.push(this._analyzeFeature(o,i,s,r,a));return Promise.all(l)}match(t,e,i,s,r){return null}_attributeHash(t){let e="";for(const i of this._symbolFields){const s=this._fieldMap[i];s&&(e+=t.attributes[s]+"-")}return e}}export{Vr as E,Tt as a,Dr as b,F as e,Sr as l,K as n,vi as t,Or as x}; diff --git a/assets/MaterialKey.229b1dd6.js b/assets/MaterialKey.0cadabc1.js similarity index 98% rename from assets/MaterialKey.229b1dd6.js rename to assets/MaterialKey.0cadabc1.js index a7428e6..095cdea 100644 --- a/assets/MaterialKey.229b1dd6.js +++ b/assets/MaterialKey.0cadabc1.js @@ -1 +1 @@ -import{n as N}from"./index.d94abe07.js";import{S as l,b as i,l as v,q as S}from"./Utils.7f6f3a6b.js";var r,n;function k(t){switch(t){case"left":return r.Left;case"right":return r.Right;case"center":return r.Center}}function H(t){switch(t){case"top":return n.Top;case"middle":return n.Center;case"baseline":return n.Baseline;case"bottom":return n.Bottom}}function j(t){switch(t){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return[r.Right,n.Bottom];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return[r.Center,n.Bottom];case"above-right":case"esriServerPointLabelPlacementAboveRight":return[r.Left,n.Bottom];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return[r.Right,n.Center];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return[r.Center,n.Center];case"center-right":case"esriServerPointLabelPlacementCenterRight":return[r.Left,n.Center];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return[r.Right,n.Top];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return[r.Center,n.Top];case"below-right":case"esriServerPointLabelPlacementBelowRight":return[r.Left,n.Top];default:return console.debug(`Found invalid placement type ${t}`),[r.Center,n.Center]}}function q(t){switch(t){case r.Right:return-1;case r.Center:return 0;case r.Left:return 1;default:return console.debug(`Found invalid horizontal alignment ${t}`),0}}function J(t){switch(t){case n.Top:return 1;case n.Center:return 0;case n.Bottom:case n.Baseline:return-1;default:return console.debug(`Found invalid vertical alignment ${t}`),0}}function Q(t){switch(t){case"left":return r.Left;case"right":return r.Right;case"center":return r.Center}}function $(t){switch(t){case"above-along":case"below-along":case"center-along":case"esriServerLinePlacementAboveAlong":case"esriServerLinePlacementBelowAlong":case"esriServerLinePlacementCenterAlong":return!0;default:return!1}}(function(t){t[t.Left=-1]="Left",t[t.Center=0]="Center",t[t.Right=1]="Right"})(r||(r={})),function(t){t[t.Top=1]="Top",t[t.Center=0]="Center",t[t.Bottom=-1]="Bottom",t[t.Baseline=2]="Baseline"}(n||(n={}));function Z(t,e,s){const o=v.SIZE_FIELD_STOPS|v.SIZE_MINMAX_VALUE|v.SIZE_SCALE_STOPS|v.SIZE_UNIT_VALUE,a=(e&(S.FIELD_TARGETS_OUTLINE|S.MINMAX_TARGETS_OUTLINE|S.SCALE_TARGETS_OUTLINE|S.UNIT_TARGETS_OUTLINE))>>>4;return t===i.LINE&&s.isOutline||t===i.FILL&&U(s.symbologyType)?o&a:o&~a}const T=0,b=8,X=7,f=8,z=11,E=11,A=12,M=13,I=14,C=15,B=16,_=17,w=18,O=19,P=20,F=21,R=26,D=Object.keys(l).filter(t=>typeof l[t]=="number").reduce((t,e)=>({...t,[e]:l[e]}),{});function G(t){return t===l.SIMPLE||t===l.OUTLINE_FILL_SIMPLE}function U(t){return t===l.OUTLINE_FILL||t===l.OUTLINE_FILL_SIMPLE}function W(t){return G(t.symbologyType)}function ee(t){return U(t.symbologyType)}function te(t,e){switch(t){case i.FILL:return p.from(e);case i.LINE:return d.from(e);case i.MARKER:return g.from(e);case i.TEXT:return y.from(e);case i.LABEL:return V.from(e);default:throw new Error(`Unable to createMaterialKey for unknown geometryType ${t}`)}}function se(t){switch(c.load(t).geometryType){case i.MARKER:return new g(t);case i.FILL:return new p(t);case i.LINE:return new d(t);case i.TEXT:return new y(t);case i.LABEL:return new V(t)}}class c{constructor(e){this._data=0,this._data=e}static load(e){const s=this.shared;return s.data=e,s}set data(e){this._data=e}get data(){return this._data}get geometryType(){return this.bits(f,z)}set geometryType(e){this.setBits(e,f,z)}get mapAligned(){return!!this.bit(P)}set mapAligned(e){this.setBit(P,e)}get sdf(){return!!this.bit(E)}set sdf(e){this.setBit(E,e)}get pattern(){return!!this.bit(A)}set pattern(e){this.setBit(A,e)}get textureBinding(){return this.bits(T,b)}set textureBinding(e){this.setBits(e,T,b)}get symbologyType(){return this.bits(F,R)}set symbologyType(e){this.setBits(e,F,R)}get geometryTypeString(){switch(this.geometryType){case i.FILL:return"fill";case i.MARKER:return"marker";case i.LINE:return"line";case i.TEXT:return"text";case i.LABEL:return"label";default:throw new N(`Unable to handle unknown geometryType: ${this.geometryType}`)}}setBit(e,s){const o=1<>e}setBits(e,s,o){for(let a=s,u=0;aclass extends t{get vvSizeMinMaxValue(){return this.bit(B)!==0}set vvSizeMinMaxValue(e){this.setBit(B,e)}get vvSizeScaleStops(){return this.bit(_)!==0}set vvSizeScaleStops(e){this.setBit(_,e)}get vvSizeFieldStops(){return this.bit(w)!==0}set vvSizeFieldStops(e){this.setBit(w,e)}get vvSizeUnitValue(){return this.bit(O)!==0}set vvSizeUnitValue(e){this.setBit(O,e)}hasVV(){return super.hasVV()||this.vvSizeMinMaxValue||this.vvSizeScaleStops||this.vvSizeFieldStops||this.vvSizeUnitValue}setVV(e,s){super.setVV(e,s);const o=Z(this.geometryType,e,s)&e;this.vvSizeMinMaxValue=!!(o&v.SIZE_MINMAX_VALUE),this.vvSizeFieldStops=!!(o&v.SIZE_FIELD_STOPS),this.vvSizeUnitValue=!!(o&v.SIZE_UNIT_VALUE),this.vvSizeScaleStops=!!(o&v.SIZE_SCALE_STOPS)}},x=t=>class extends t{get vvRotation(){return this.bit(C)!==0}set vvRotation(e){this.setBit(C,e)}hasVV(){return super.hasVV()||this.vvRotation}setVV(e,s){super.setVV(e,s),this.vvRotation=!s.isOutline&&!!(e&v.ROTATION)}},m=t=>class extends t{get vvColor(){return this.bit(M)!==0}set vvColor(e){this.setBit(M,e)}hasVV(){return super.hasVV()||this.vvColor}setVV(e,s){super.setVV(e,s),this.vvColor=!s.isOutline&&!!(e&v.COLOR)}},L=t=>class extends t{get vvOpacity(){return this.bit(I)!==0}set vvOpacity(e){this.setBit(I,e)}hasVV(){return super.hasVV()||this.vvOpacity}setVV(e,s){super.setVV(e,s),this.vvOpacity=!s.isOutline&&!!(e&v.OPACITY)}};class p extends m(L(h(c))){static load(e){const s=this.shared;return s.data=e,s}static from(e){const{symbologyType:s,vvFlags:o}=e,a=this.load(0);return a.geometryType=i.FILL,a.symbologyType=s,s!==l.DOT_DENSITY&&a.setVV(o,e),a.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}p.shared=new p(0);class g extends m(L(x(h(c)))){static load(e){const s=this.shared;return s.data=e,s}static from(e){const{symbologyType:s,vvFlags:o}=e,a=this.load(0);return a.geometryType=i.MARKER,a.symbologyType=s,s!==l.HEATMAP&&a.setVV(o,e),a.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvRotation:this.vvRotation,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}g.shared=new g(0);class d extends m(L(h(c))){static load(e){const s=this.shared;return s.data=e,s}static from(e){const s=this.load(0);return s.geometryType=i.LINE,s.symbologyType=e.symbologyType,s.setVV(e.vvFlags,e),s.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}d.shared=new d(0);class y extends m(L(x(h(c)))){static load(e){const s=this.shared;return s.data=e,s}static from(e){const s=this.load(0);return s.geometryType=i.TEXT,s.symbologyType=e.symbologyType,s.setVV(e.vvFlags,e),s.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvRotation:this.vvRotation,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}y.shared=new y(0);class V extends h(c){static load(e){const s=this.shared;return s.data=e,s}static from(e){const s=this.load(0);return s.geometryType=i.LABEL,s.symbologyType=e.symbologyType,s.setVV(e.vvFlags,e),s.mapAligned=$(e.placement),s.data}getVariation(){return{...super.getVariation(),vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}V.shared=new V(0);export{se as A,d as C,g as N,ee as O,y as P,c as U,V as Z,U as _,j as a,W as b,q as c,r as e,te as f,$ as i,H as n,J as o,k as r,Q as s,n as t,p as w}; +import{n as N}from"./index.221827cd.js";import{S as l,b as i,l as v,q as S}from"./Utils.2136650a.js";var r,n;function k(t){switch(t){case"left":return r.Left;case"right":return r.Right;case"center":return r.Center}}function H(t){switch(t){case"top":return n.Top;case"middle":return n.Center;case"baseline":return n.Baseline;case"bottom":return n.Bottom}}function j(t){switch(t){case"above-left":case"esriServerPointLabelPlacementAboveLeft":return[r.Right,n.Bottom];case"above-center":case"above-along":case"esriServerPointLabelPlacementAboveCenter":case"esriServerLinePlacementAboveAlong":return[r.Center,n.Bottom];case"above-right":case"esriServerPointLabelPlacementAboveRight":return[r.Left,n.Bottom];case"center-left":case"esriServerPointLabelPlacementCenterLeft":return[r.Right,n.Center];case"center-center":case"center-along":case"esriServerPointLabelPlacementCenterCenter":case"esriServerLinePlacementCenterAlong":case"always-horizontal":case"esriServerPolygonPlacementAlwaysHorizontal":return[r.Center,n.Center];case"center-right":case"esriServerPointLabelPlacementCenterRight":return[r.Left,n.Center];case"below-left":case"esriServerPointLabelPlacementBelowLeft":return[r.Right,n.Top];case"below-center":case"below-along":case"esriServerPointLabelPlacementBelowCenter":case"esriServerLinePlacementBelowAlong":return[r.Center,n.Top];case"below-right":case"esriServerPointLabelPlacementBelowRight":return[r.Left,n.Top];default:return console.debug(`Found invalid placement type ${t}`),[r.Center,n.Center]}}function q(t){switch(t){case r.Right:return-1;case r.Center:return 0;case r.Left:return 1;default:return console.debug(`Found invalid horizontal alignment ${t}`),0}}function J(t){switch(t){case n.Top:return 1;case n.Center:return 0;case n.Bottom:case n.Baseline:return-1;default:return console.debug(`Found invalid vertical alignment ${t}`),0}}function Q(t){switch(t){case"left":return r.Left;case"right":return r.Right;case"center":return r.Center}}function $(t){switch(t){case"above-along":case"below-along":case"center-along":case"esriServerLinePlacementAboveAlong":case"esriServerLinePlacementBelowAlong":case"esriServerLinePlacementCenterAlong":return!0;default:return!1}}(function(t){t[t.Left=-1]="Left",t[t.Center=0]="Center",t[t.Right=1]="Right"})(r||(r={})),function(t){t[t.Top=1]="Top",t[t.Center=0]="Center",t[t.Bottom=-1]="Bottom",t[t.Baseline=2]="Baseline"}(n||(n={}));function Z(t,e,s){const o=v.SIZE_FIELD_STOPS|v.SIZE_MINMAX_VALUE|v.SIZE_SCALE_STOPS|v.SIZE_UNIT_VALUE,a=(e&(S.FIELD_TARGETS_OUTLINE|S.MINMAX_TARGETS_OUTLINE|S.SCALE_TARGETS_OUTLINE|S.UNIT_TARGETS_OUTLINE))>>>4;return t===i.LINE&&s.isOutline||t===i.FILL&&U(s.symbologyType)?o&a:o&~a}const T=0,b=8,X=7,f=8,z=11,E=11,A=12,M=13,I=14,C=15,B=16,_=17,w=18,O=19,P=20,F=21,R=26,D=Object.keys(l).filter(t=>typeof l[t]=="number").reduce((t,e)=>({...t,[e]:l[e]}),{});function G(t){return t===l.SIMPLE||t===l.OUTLINE_FILL_SIMPLE}function U(t){return t===l.OUTLINE_FILL||t===l.OUTLINE_FILL_SIMPLE}function W(t){return G(t.symbologyType)}function ee(t){return U(t.symbologyType)}function te(t,e){switch(t){case i.FILL:return p.from(e);case i.LINE:return d.from(e);case i.MARKER:return g.from(e);case i.TEXT:return y.from(e);case i.LABEL:return V.from(e);default:throw new Error(`Unable to createMaterialKey for unknown geometryType ${t}`)}}function se(t){switch(c.load(t).geometryType){case i.MARKER:return new g(t);case i.FILL:return new p(t);case i.LINE:return new d(t);case i.TEXT:return new y(t);case i.LABEL:return new V(t)}}class c{constructor(e){this._data=0,this._data=e}static load(e){const s=this.shared;return s.data=e,s}set data(e){this._data=e}get data(){return this._data}get geometryType(){return this.bits(f,z)}set geometryType(e){this.setBits(e,f,z)}get mapAligned(){return!!this.bit(P)}set mapAligned(e){this.setBit(P,e)}get sdf(){return!!this.bit(E)}set sdf(e){this.setBit(E,e)}get pattern(){return!!this.bit(A)}set pattern(e){this.setBit(A,e)}get textureBinding(){return this.bits(T,b)}set textureBinding(e){this.setBits(e,T,b)}get symbologyType(){return this.bits(F,R)}set symbologyType(e){this.setBits(e,F,R)}get geometryTypeString(){switch(this.geometryType){case i.FILL:return"fill";case i.MARKER:return"marker";case i.LINE:return"line";case i.TEXT:return"text";case i.LABEL:return"label";default:throw new N(`Unable to handle unknown geometryType: ${this.geometryType}`)}}setBit(e,s){const o=1<>e}setBits(e,s,o){for(let a=s,u=0;aclass extends t{get vvSizeMinMaxValue(){return this.bit(B)!==0}set vvSizeMinMaxValue(e){this.setBit(B,e)}get vvSizeScaleStops(){return this.bit(_)!==0}set vvSizeScaleStops(e){this.setBit(_,e)}get vvSizeFieldStops(){return this.bit(w)!==0}set vvSizeFieldStops(e){this.setBit(w,e)}get vvSizeUnitValue(){return this.bit(O)!==0}set vvSizeUnitValue(e){this.setBit(O,e)}hasVV(){return super.hasVV()||this.vvSizeMinMaxValue||this.vvSizeScaleStops||this.vvSizeFieldStops||this.vvSizeUnitValue}setVV(e,s){super.setVV(e,s);const o=Z(this.geometryType,e,s)&e;this.vvSizeMinMaxValue=!!(o&v.SIZE_MINMAX_VALUE),this.vvSizeFieldStops=!!(o&v.SIZE_FIELD_STOPS),this.vvSizeUnitValue=!!(o&v.SIZE_UNIT_VALUE),this.vvSizeScaleStops=!!(o&v.SIZE_SCALE_STOPS)}},x=t=>class extends t{get vvRotation(){return this.bit(C)!==0}set vvRotation(e){this.setBit(C,e)}hasVV(){return super.hasVV()||this.vvRotation}setVV(e,s){super.setVV(e,s),this.vvRotation=!s.isOutline&&!!(e&v.ROTATION)}},m=t=>class extends t{get vvColor(){return this.bit(M)!==0}set vvColor(e){this.setBit(M,e)}hasVV(){return super.hasVV()||this.vvColor}setVV(e,s){super.setVV(e,s),this.vvColor=!s.isOutline&&!!(e&v.COLOR)}},L=t=>class extends t{get vvOpacity(){return this.bit(I)!==0}set vvOpacity(e){this.setBit(I,e)}hasVV(){return super.hasVV()||this.vvOpacity}setVV(e,s){super.setVV(e,s),this.vvOpacity=!s.isOutline&&!!(e&v.OPACITY)}};class p extends m(L(h(c))){static load(e){const s=this.shared;return s.data=e,s}static from(e){const{symbologyType:s,vvFlags:o}=e,a=this.load(0);return a.geometryType=i.FILL,a.symbologyType=s,s!==l.DOT_DENSITY&&a.setVV(o,e),a.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}p.shared=new p(0);class g extends m(L(x(h(c)))){static load(e){const s=this.shared;return s.data=e,s}static from(e){const{symbologyType:s,vvFlags:o}=e,a=this.load(0);return a.geometryType=i.MARKER,a.symbologyType=s,s!==l.HEATMAP&&a.setVV(o,e),a.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvRotation:this.vvRotation,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}g.shared=new g(0);class d extends m(L(h(c))){static load(e){const s=this.shared;return s.data=e,s}static from(e){const s=this.load(0);return s.geometryType=i.LINE,s.symbologyType=e.symbologyType,s.setVV(e.vvFlags,e),s.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}d.shared=new d(0);class y extends m(L(x(h(c)))){static load(e){const s=this.shared;return s.data=e,s}static from(e){const s=this.load(0);return s.geometryType=i.TEXT,s.symbologyType=e.symbologyType,s.setVV(e.vvFlags,e),s.data}getVariation(){return{...super.getVariation(),vvColor:this.vvColor,vvOpacity:this.vvOpacity,vvRotation:this.vvRotation,vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}y.shared=new y(0);class V extends h(c){static load(e){const s=this.shared;return s.data=e,s}static from(e){const s=this.load(0);return s.geometryType=i.LABEL,s.symbologyType=e.symbologyType,s.setVV(e.vvFlags,e),s.mapAligned=$(e.placement),s.data}getVariation(){return{...super.getVariation(),vvSizeFieldStops:this.vvSizeFieldStops,vvSizeMinMaxValue:this.vvSizeMinMaxValue,vvSizeScaleStops:this.vvSizeScaleStops,vvSizeUnitValue:this.vvSizeUnitValue}}}V.shared=new V(0);export{se as A,d as C,g as N,ee as O,y as P,c as U,V as Z,U as _,j as a,W as b,q as c,r as e,te as f,$ as i,H as n,J as o,k as r,Q as s,n as t,p as w}; diff --git a/assets/MediaLayerView2D.09f1bca2.js b/assets/MediaLayerView2D.44f0fc2d.js similarity index 93% rename from assets/MediaLayerView2D.09f1bca2.js rename to assets/MediaLayerView2D.44f0fc2d.js index 07cf9fe..b8eeeaa 100644 --- a/assets/MediaLayerView2D.09f1bca2.js +++ b/assets/MediaLayerView2D.44f0fc2d.js @@ -1 +1 @@ -import{a6 as u,a7 as p,a8 as K,a9 as ne,j as _,cM as N,u as oe,e9 as le,az as he,c as x,b2 as j,ea as ee,cn as H,O as de,eb as ce,ec as ue,M as me,an as pe,_ as k,$ as O,ag as ye,Z as fe,s as te,n as _e,q as S,G as ve,ab as ge,N as we,aL as Re,b1 as Me,S as $e,b3 as xe,Q as Ee,R as Ce,ax as Te,dM as be,cE as Se,c$ as Ve,cW as qe,cX as Ae,ed as De,x as Pe,cU as Ie,e6 as Oe,ay as ze}from"./index.d94abe07.js";import{a as Ue}from"./normalizeUtilsSync.757b5fd1.js";import{e as V}from"./mat3f64.6d32a1d7.js";import{r as je}from"./utils.4b023c9d.js";import{E as F,a as Le}from"./VertexArrayObject.a4c1d809.js";import{P as We,G as Ge,L as Qe,D as Be,F as Y}from"./enums.2d9e6f64.js";import{n as J,E as Ne}from"./Texture.4c97bad5.js";import{r as He}from"./vec3f32.1121a836.js";import{o as ke,c as Fe}from"./WGLContainer.1850619d.js";import{I as Ye}from"./Utils.7f6f3a6b.js";import{y as Je,u as Xe}from"./LayerView.42d17220.js";import"./MaterialKey.229b1dd6.js";import"./enums.0295eb81.js";import"./pixelUtils.82950e1a.js";import"./VertexElementDescriptor.1fdca6da.js";import"./ProgramTemplate.e9a5aa54.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";let m=class extends ne{constructor(r){super(r)}get bounds(){const r=this.coords;return _(r)||_(r.extent)?null:N(r.extent)}get coords(){var e;const r=(e=oe(this.element.georeference))==null?void 0:e.coords;return le(r,this.spatialReference).geometry}get normalizedCoords(){return he.fromJSON(Ue(this.coords))}get normalizedBounds(){const r=x(this.normalizedCoords)?this.normalizedCoords.extent:null;return x(r)?N(r):null}};u([p()],m.prototype,"spatialReference",void 0),u([p()],m.prototype,"element",void 0),u([p()],m.prototype,"bounds",null),u([p()],m.prototype,"coords",null),u([p()],m.prototype,"normalizedCoords",null),u([p()],m.prototype,"normalizedBounds",null),m=u([K("esri.layers.support.media.MediaElementView")],m);const z=me(),R=V(),U=V(),X=V();function Ze(r,e,t){return Z(U,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]),Z(X,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]),j(r,ee(U,U),X)}function Z(r,e,t,s,a,i,n,h,y){H(r,e,s,i,t,a,n,1,1,1),de(z,h,y,1),ee(R,r);const[o,l,d]=ce(z,z,ue(R,R));return H(R,o,0,0,0,l,0,0,0,d),j(r,R,r)}const M=V();class Ke extends je{constructor(e){super(),this.elementView=e,this.isWrapAround=!1,this.perspectiveTransform=pe(),this._vertices=new Float32Array(20),this._handles=[],this._handles.push(k(()=>this.elementView.element.opacity,t=>this.opacity=t,O),k(()=>[this.elementView.coords],()=>{this.requestRender()},O),ye(()=>this.elementView.element.loaded,()=>{const t=this.elementView.element;this.ready(),t.type==="video"&&x(t.content)&&this._handles.push(fe(t.content,"play",()=>this.requestRender()))},O)),e.element.load().catch(t=>{te.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new _e("element-load-error","Element cannot be displayed",{element:e,error:t}))})}destroy(){var e;this._handles.forEach(t=>t.remove()),(e=this.texture)==null||e.dispose(),this.texture=null}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,s=this.elementView.element.content;if(x(s)){const a=s instanceof HTMLImageElement,i=s instanceof HTMLVideoElement,n=a?s.naturalWidth:i?s.videoWidth:s.width,h=a?s.naturalHeight:i?s.videoHeight:s.height;this._updatePerspectiveTransform(n,h),this.texture?i&&!s.paused&&(this.texture.setData(s),this.requestRender(),(J(t.gl)||S(n)&&S(h))&&this.texture.generateMipmap()):(this.texture=new Ne(t,{pixelFormat:We.RGBA,dataType:Ge.UNSIGNED_BYTE,samplingMode:Qe.LINEAR,wrapMode:Be.CLAMP_TO_EDGE,width:n,height:h,preMultiplyAlpha:!0},s),(J(t.gl)||S(n)&&S(h))&&this.texture.generateMipmap(),i&&!s.paused&&this.requestRender())}super.beforeRender(e)}_createTransforms(){return null}updateDrawCoords(e,t){const s=this.elementView.coords;if(_(s))return;const[a,i,n,h]=s.rings[0],y=this._vertices,{x:o,y:l}=e,d=t!==0;d?y.set([i[0]-o,i[1]-l,a[0]-o,a[1]-l,n[0]-o,n[1]-l,h[0]-o,h[1]-l,h[0]-o,h[1]-l,i[0]+t-o,i[1]-l,i[0]+t-o,i[1]-l,a[0]+t-o,a[1]-l,n[0]+t-o,n[1]-l,h[0]+t-o,h[1]-l]):y.set([i[0]-o,i[1]-l,a[0]-o,a[1]-l,n[0]-o,n[1]-l,h[0]-o,h[1]-l]),this.isWrapAround=d}getVAO(e,t,s){if(_(this.elementView.coords))return null;const a=this._vertices;if(this._vao)this._geometryVbo.setData(a);else{this._geometryVbo=F.createVertex(e,Y.DYNAMIC_DRAW,a);const i=F.createVertex(e,Y.STATIC_DRAW,new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]));this._vao=new Le(e,s,t,{geometry:this._geometryVbo,tex:i})}return this._vao}_updatePerspectiveTransform(e,t){const s=this._vertices;Ze(M,[0,0,e,0,0,t,e,t],[s[0],s[1],s[4],s[5],s[2],s[3],s[6],s[7]]),ve(this.perspectiveTransform,M[6]/M[8]*e,M[7]/M[8]*t)}}class et extends ke{constructor(){super(...arguments),this._localOrigin=ge(0,0),this._viewStateId=-1,this._dvsMat3=we(),this.requiresDedicatedFBO=!1}get dvsMat3(){return this._dvsMat3}beforeRender(e){this._updateMatrices(e),this._updateOverlays(e,this.children);for(const t of this.children)t.beforeRender(e)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"overlay",brushes:[Fe.overlay],target:()=>this.children,drawPhase:Ye.MAP});return[...super.prepareRenderPasses(e),t]}_updateMatrices(e){const{state:t}=e,{id:s,size:a,pixelRatio:i,resolution:n,rotation:h,viewpoint:y,displayMat3:o}=t;if(this._viewStateId===s)return;const l=Math.PI/180*h,d=i*a[0],g=i*a[1],{x:E,y:q}=y.targetGeometry,A=Re(E,t.spatialReference);this._localOrigin.x=A,this._localOrigin.y=q;const C=n*d,w=n*g,c=Me(this._dvsMat3);j(c,c,o),$e(c,c,xe(d/2,g/2)),Ee(c,c,He(d/C,-g/w,1)),Ce(c,c,-l),this._viewStateId=s}_updateOverlays(e,t){const{state:s}=e,{rotation:a,spatialReference:i,worldScreenWidth:n,size:h,viewpoint:y}=s,o=this._localOrigin;let l=0;if(i.isWrappable){const d=h[0],g=h[1],E=180/Math.PI*a,q=Math.abs(Math.cos(E)),A=Math.abs(Math.sin(E)),C=Math.round(d*q+g*A),[w,c]=Te(i).valid,f=be(i),{x:L,y:se}=y.targetGeometry,re=[L,se],D=[0,0];s.toScreen(D,re);const T=[0,0];let P;P=C>n?.5*n:.5*C;const W=Math.floor((L+.5*f)/f),ie=w+W*f,ae=c+W*f,I=[D[0]+P,0];s.toMap(T,I),T[0]>ae&&(l=f),I[0]=D[0]-P,s.toMap(T,I),T[0]w?b.updateDrawCoords(o,f):B>c&&Qthis.layer.source,"refresh",()=>{for(const r of this._tileStrategy.tiles)this._updateTile(r);this.requestUpdate()})),this._overlayContainer=new et,this.container.addChild(this._overlayContainer),this._fetchQueue=new qe({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(r,e)=>this._queryElements(r,e)}),this._tileStrategy=new Ae({cachePolicy:"purge",resampling:!0,acquireTile:r=>this._acquireTile(r),releaseTile:r=>this._releaseTile(r),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.handles.removeAll(),this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear()}supportsSpatialReference(r){return!0}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(r){this._tileStrategy.update(r)}async hitTest(r,e){const t=[],s=r.normalize(),a=[s.x,s.y];for(const{projectedElement:{normalizedCoords:i,element:n}}of this._elementReferences.values())x(i)&&De(i.rings,a)&&t.push({type:"media",element:n,layer:this.layer,mapPoint:r});return t.reverse()}canResume(){return this.layer.source!=null&&super.canResume()}async doRefresh(){}_acquireTile(r){const e=new tt(r.clone());return this._updateTile(e),e}_updateTile(r){this.updatingHandles.addPromise(this._fetchQueue.push(r.key).then(e=>{const[t,s]=r.setElements(e);this._acquireElements(r,t),this._releaseElements(r,s),this.requestUpdate()},e=>{Pe(e)||te.getLogger(this.declaredClass).error(e)}))}_releaseTile(r){this._fetchQueue.abort(r.key.id),r.elements&&this._releaseElements(r,r.elements),this.requestUpdate()}async _queryElements(r,e){const t=this.layer.source;if(_(t))return[];this.view.featuresTilingScheme.getTileBounds($,r,!0);const s=new Ie({xmin:$[0],ymin:$[1],xmax:$[2],ymax:$[3],spatialReference:this.view.spatialReference});return t.queryElements(s,e)}_acquireElements(r,e){const t=this.layer.source,s=this.view.spatialReference;if(!_(t))for(const a of e)Oe(this._elementReferences,a.uid,()=>{const i=new m({element:a,spatialReference:s}),n=new Ke(i);return this._overlayContainer.addChild(n),this.elements.add(a),{tiles:new Set,projectedElement:i,overlay:n}}).tiles.add(r)}_releaseElements(r,e){for(const t of e){const s=this._elementReferences.get(t.uid);s.tiles.delete(r),s.tiles.size||(this._overlayContainer.removeChild(s.overlay),s.overlay.destroy(),s.projectedElement.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t))}}};u([p()],v.prototype,"_fetchQueue",void 0),u([p()],v.prototype,"layer",void 0),u([p({readOnly:!0})],v.prototype,"elements",void 0),v=u([K("esri.views.2d.layers.MediaLayerView2D")],v);const $=ze();class tt{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],s=new Set(this.elements);this.elements=e;for(const a of e)s.has(a)?s.delete(a):t.push(a);return this.isReady=!0,[t,Array.from(s)]}}const Mt=v;export{Mt as default}; +import{a6 as u,a7 as p,a8 as K,a9 as ne,j as _,cM as N,u as oe,e9 as le,az as he,c as x,b2 as j,ea as ee,cn as H,O as de,eb as ce,ec as ue,M as me,an as pe,_ as k,$ as O,ag as ye,Z as fe,s as te,n as _e,q as S,G as ve,ab as ge,N as we,aL as Re,b1 as Me,S as $e,b3 as xe,Q as Ee,R as Ce,ax as Te,dM as be,cE as Se,c$ as Ve,cW as qe,cX as Ae,ed as De,x as Pe,cU as Ie,e6 as Oe,ay as ze}from"./index.221827cd.js";import{a as Ue}from"./normalizeUtilsSync.4d52fbd0.js";import{e as V}from"./mat3f64.6d32a1d7.js";import{r as je}from"./utils.0160becb.js";import{E as F,a as Le}from"./VertexArrayObject.53cf1857.js";import{P as We,G as Ge,L as Qe,D as Be,F as Y}from"./enums.2d9e6f64.js";import{n as J,E as Ne}from"./Texture.940076b2.js";import{r as He}from"./vec3f32.1121a836.js";import{o as ke,c as Fe}from"./WGLContainer.347cc5cd.js";import{I as Ye}from"./Utils.2136650a.js";import{y as Je,u as Xe}from"./LayerView.ce6e0535.js";import"./MaterialKey.0cadabc1.js";import"./enums.0295eb81.js";import"./pixelUtils.9c6f8dae.js";import"./VertexElementDescriptor.1fdca6da.js";import"./ProgramTemplate.cf9dd4e8.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";let m=class extends ne{constructor(r){super(r)}get bounds(){const r=this.coords;return _(r)||_(r.extent)?null:N(r.extent)}get coords(){var e;const r=(e=oe(this.element.georeference))==null?void 0:e.coords;return le(r,this.spatialReference).geometry}get normalizedCoords(){return he.fromJSON(Ue(this.coords))}get normalizedBounds(){const r=x(this.normalizedCoords)?this.normalizedCoords.extent:null;return x(r)?N(r):null}};u([p()],m.prototype,"spatialReference",void 0),u([p()],m.prototype,"element",void 0),u([p()],m.prototype,"bounds",null),u([p()],m.prototype,"coords",null),u([p()],m.prototype,"normalizedCoords",null),u([p()],m.prototype,"normalizedBounds",null),m=u([K("esri.layers.support.media.MediaElementView")],m);const z=me(),R=V(),U=V(),X=V();function Ze(r,e,t){return Z(U,e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]),Z(X,t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7]),j(r,ee(U,U),X)}function Z(r,e,t,s,a,i,n,h,y){H(r,e,s,i,t,a,n,1,1,1),de(z,h,y,1),ee(R,r);const[o,l,d]=ce(z,z,ue(R,R));return H(R,o,0,0,0,l,0,0,0,d),j(r,R,r)}const M=V();class Ke extends je{constructor(e){super(),this.elementView=e,this.isWrapAround=!1,this.perspectiveTransform=pe(),this._vertices=new Float32Array(20),this._handles=[],this._handles.push(k(()=>this.elementView.element.opacity,t=>this.opacity=t,O),k(()=>[this.elementView.coords],()=>{this.requestRender()},O),ye(()=>this.elementView.element.loaded,()=>{const t=this.elementView.element;this.ready(),t.type==="video"&&x(t.content)&&this._handles.push(fe(t.content,"play",()=>this.requestRender()))},O)),e.element.load().catch(t=>{te.getLogger("esri.views.2d.layers.MediaLayerView2D").error(new _e("element-load-error","Element cannot be displayed",{element:e,error:t}))})}destroy(){var e;this._handles.forEach(t=>t.remove()),(e=this.texture)==null||e.dispose(),this.texture=null}get dvsMat3(){return this.parent.dvsMat3}beforeRender(e){const{context:t}=e,s=this.elementView.element.content;if(x(s)){const a=s instanceof HTMLImageElement,i=s instanceof HTMLVideoElement,n=a?s.naturalWidth:i?s.videoWidth:s.width,h=a?s.naturalHeight:i?s.videoHeight:s.height;this._updatePerspectiveTransform(n,h),this.texture?i&&!s.paused&&(this.texture.setData(s),this.requestRender(),(J(t.gl)||S(n)&&S(h))&&this.texture.generateMipmap()):(this.texture=new Ne(t,{pixelFormat:We.RGBA,dataType:Ge.UNSIGNED_BYTE,samplingMode:Qe.LINEAR,wrapMode:Be.CLAMP_TO_EDGE,width:n,height:h,preMultiplyAlpha:!0},s),(J(t.gl)||S(n)&&S(h))&&this.texture.generateMipmap(),i&&!s.paused&&this.requestRender())}super.beforeRender(e)}_createTransforms(){return null}updateDrawCoords(e,t){const s=this.elementView.coords;if(_(s))return;const[a,i,n,h]=s.rings[0],y=this._vertices,{x:o,y:l}=e,d=t!==0;d?y.set([i[0]-o,i[1]-l,a[0]-o,a[1]-l,n[0]-o,n[1]-l,h[0]-o,h[1]-l,h[0]-o,h[1]-l,i[0]+t-o,i[1]-l,i[0]+t-o,i[1]-l,a[0]+t-o,a[1]-l,n[0]+t-o,n[1]-l,h[0]+t-o,h[1]-l]):y.set([i[0]-o,i[1]-l,a[0]-o,a[1]-l,n[0]-o,n[1]-l,h[0]-o,h[1]-l]),this.isWrapAround=d}getVAO(e,t,s){if(_(this.elementView.coords))return null;const a=this._vertices;if(this._vao)this._geometryVbo.setData(a);else{this._geometryVbo=F.createVertex(e,Y.DYNAMIC_DRAW,a);const i=F.createVertex(e,Y.STATIC_DRAW,new Uint16Array([0,0,0,1,1,0,1,1,1,1,0,0,0,0,0,1,1,0,1,1]));this._vao=new Le(e,s,t,{geometry:this._geometryVbo,tex:i})}return this._vao}_updatePerspectiveTransform(e,t){const s=this._vertices;Ze(M,[0,0,e,0,0,t,e,t],[s[0],s[1],s[4],s[5],s[2],s[3],s[6],s[7]]),ve(this.perspectiveTransform,M[6]/M[8]*e,M[7]/M[8]*t)}}class et extends ke{constructor(){super(...arguments),this._localOrigin=ge(0,0),this._viewStateId=-1,this._dvsMat3=we(),this.requiresDedicatedFBO=!1}get dvsMat3(){return this._dvsMat3}beforeRender(e){this._updateMatrices(e),this._updateOverlays(e,this.children);for(const t of this.children)t.beforeRender(e)}prepareRenderPasses(e){const t=e.registerRenderPass({name:"overlay",brushes:[Fe.overlay],target:()=>this.children,drawPhase:Ye.MAP});return[...super.prepareRenderPasses(e),t]}_updateMatrices(e){const{state:t}=e,{id:s,size:a,pixelRatio:i,resolution:n,rotation:h,viewpoint:y,displayMat3:o}=t;if(this._viewStateId===s)return;const l=Math.PI/180*h,d=i*a[0],g=i*a[1],{x:E,y:q}=y.targetGeometry,A=Re(E,t.spatialReference);this._localOrigin.x=A,this._localOrigin.y=q;const C=n*d,w=n*g,c=Me(this._dvsMat3);j(c,c,o),$e(c,c,xe(d/2,g/2)),Ee(c,c,He(d/C,-g/w,1)),Ce(c,c,-l),this._viewStateId=s}_updateOverlays(e,t){const{state:s}=e,{rotation:a,spatialReference:i,worldScreenWidth:n,size:h,viewpoint:y}=s,o=this._localOrigin;let l=0;if(i.isWrappable){const d=h[0],g=h[1],E=180/Math.PI*a,q=Math.abs(Math.cos(E)),A=Math.abs(Math.sin(E)),C=Math.round(d*q+g*A),[w,c]=Te(i).valid,f=be(i),{x:L,y:se}=y.targetGeometry,re=[L,se],D=[0,0];s.toScreen(D,re);const T=[0,0];let P;P=C>n?.5*n:.5*C;const W=Math.floor((L+.5*f)/f),ie=w+W*f,ae=c+W*f,I=[D[0]+P,0];s.toMap(T,I),T[0]>ae&&(l=f),I[0]=D[0]-P,s.toMap(T,I),T[0]w?b.updateDrawCoords(o,f):B>c&&Qthis.layer.source,"refresh",()=>{for(const r of this._tileStrategy.tiles)this._updateTile(r);this.requestUpdate()})),this._overlayContainer=new et,this.container.addChild(this._overlayContainer),this._fetchQueue=new qe({tileInfoView:this.view.featuresTilingScheme,concurrency:10,process:(r,e)=>this._queryElements(r,e)}),this._tileStrategy=new Ae({cachePolicy:"purge",resampling:!0,acquireTile:r=>this._acquireTile(r),releaseTile:r=>this._releaseTile(r),tileInfoView:this.view.featuresTilingScheme}),this.requestUpdate()}detach(){this.handles.removeAll(),this.elements.removeAll(),this._tileStrategy.destroy(),this._fetchQueue.destroy(),this._overlayContainer.removeAllChildren(),this.container.removeAllChildren(),this._elementReferences.clear()}supportsSpatialReference(r){return!0}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}update(r){this._tileStrategy.update(r)}async hitTest(r,e){const t=[],s=r.normalize(),a=[s.x,s.y];for(const{projectedElement:{normalizedCoords:i,element:n}}of this._elementReferences.values())x(i)&&De(i.rings,a)&&t.push({type:"media",element:n,layer:this.layer,mapPoint:r});return t.reverse()}canResume(){return this.layer.source!=null&&super.canResume()}async doRefresh(){}_acquireTile(r){const e=new tt(r.clone());return this._updateTile(e),e}_updateTile(r){this.updatingHandles.addPromise(this._fetchQueue.push(r.key).then(e=>{const[t,s]=r.setElements(e);this._acquireElements(r,t),this._releaseElements(r,s),this.requestUpdate()},e=>{Pe(e)||te.getLogger(this.declaredClass).error(e)}))}_releaseTile(r){this._fetchQueue.abort(r.key.id),r.elements&&this._releaseElements(r,r.elements),this.requestUpdate()}async _queryElements(r,e){const t=this.layer.source;if(_(t))return[];this.view.featuresTilingScheme.getTileBounds($,r,!0);const s=new Ie({xmin:$[0],ymin:$[1],xmax:$[2],ymax:$[3],spatialReference:this.view.spatialReference});return t.queryElements(s,e)}_acquireElements(r,e){const t=this.layer.source,s=this.view.spatialReference;if(!_(t))for(const a of e)Oe(this._elementReferences,a.uid,()=>{const i=new m({element:a,spatialReference:s}),n=new Ke(i);return this._overlayContainer.addChild(n),this.elements.add(a),{tiles:new Set,projectedElement:i,overlay:n}}).tiles.add(r)}_releaseElements(r,e){for(const t of e){const s=this._elementReferences.get(t.uid);s.tiles.delete(r),s.tiles.size||(this._overlayContainer.removeChild(s.overlay),s.overlay.destroy(),s.projectedElement.destroy(),this._elementReferences.delete(t.uid),this.elements.remove(t))}}};u([p()],v.prototype,"_fetchQueue",void 0),u([p()],v.prototype,"layer",void 0),u([p({readOnly:!0})],v.prototype,"elements",void 0),v=u([K("esri.views.2d.layers.MediaLayerView2D")],v);const $=ze();class tt{constructor(e){this.key=e,this.elements=null,this.isReady=!1,this.visible=!0}setElements(e){const t=[],s=new Set(this.elements);this.elements=e;for(const a of e)s.has(a)?s.delete(a):t.push(a);return this.isReady=!0,[t,Array.from(s)]}}const Mt=v;export{Mt as default}; diff --git a/assets/MemorySourceWorker.0c33bcc2.js b/assets/MemorySourceWorker.8d1364ce.js similarity index 90% rename from assets/MemorySourceWorker.0c33bcc2.js rename to assets/MemorySourceWorker.8d1364ce.js index b44aa2f..83bec0c 100644 --- a/assets/MemorySourceWorker.0c33bcc2.js +++ b/assets/MemorySourceWorker.8d1364ce.js @@ -1 +1 @@ -import{n as b,gx as v,eY as M,ci as Q,j as Z,aA as F,c as _,ca as q,cc as $,gy as A,e_ as D,aY as O}from"./index.d94abe07.js";import{t as k,n as C}from"./objectIdUtils.83ac3f67.js";import{u as P}from"./FeatureStore.27890cc9.js";import{f as E,g as j}from"./projectionSupport.0542c13b.js";import{Y as G}from"./QueryEngine.5a5ece4a.js";import{i as z,o as L,a as W}from"./clientSideDefaults.f5f7bfa0.js";import{w as Y,a as I,m as x,f as T,g as w}from"./sourceUtils.61cd5549.js";import"./PooledRBush.04520070.js";import"./centroid.cc817cc5.js";import"./json.879c9adc.js";import"./QueryEngineResult.7611d68a.js";import"./quantizationUtils.0d428d19.js";import"./WhereClause.253310fe.js";import"./utils.8c53cad2.js";import"./generateRendererUtils.ebdde5b7.js";import"./utils.399e6089.js";import"./QueryEngineCapabilities.78217f95.js";import"./timeSupport.668a2439.js";const B=D,U={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:D},H={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};function V(h){return O(h)?h.z!=null:!!h.hasZ}function X(h){return O(h)?h.m!=null:!!h.hasM}class me{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine&&this._queryEngine&&this._queryEngine.destroy(),this._queryEngine=this._fieldsIndex=this._createDefaultAttributes=null}async load(e){const t=[],{features:n}=e,i=this._inferLayerProperties(n,e.fields),l=e.fields||[],f=e.hasM!=null?e.hasM:i.hasM,y=e.hasZ!=null?e.hasZ:i.hasZ,c=!e.spatialReference&&!i.spatialReference,d=c?B:e.spatialReference||i.spatialReference,a=c?U:null,p=e.geometryType||i.geometryType,o=!p;let u=e.objectIdField||i.objectIdField,r=e.timeInfo;if(!o&&(c&&t.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!p))throw new b("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!u)throw new b("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(i.objectIdField&&u!==i.objectIdField&&(t.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${u}" doesn't match the field name "${i.objectIdField}", found in the provided fields`}),u=i.objectIdField),u&&!i.objectIdField){let s=null;l.some(g=>g.name===u&&(s=g,!0))?(s.type="esriFieldTypeOID",s.editable=!1,s.nullable=!1):l.unshift({alias:u,name:u,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const s of l){if(s.name==null&&(s.name=s.alias),s.alias==null&&(s.alias=s.name),!s.name)throw new b("feature-layer:invalid-field-name","field name is missing",{field:s});if(s.name===u&&(s.type="esriFieldTypeOID"),!v.jsonValues.includes(s.type))throw new b("feature-layer:invalid-field-type",`invalid type for field "${s.name}"`,{field:s})}const m={};for(const s of l)if(s.type!=="esriFieldTypeOID"&&s.type!=="esriFieldTypeGlobalID"){const g=M(s);g!==void 0&&(m[s.name]=g)}if(this._fieldsIndex=new Q(l),this._createDefaultAttributes=z(m,u),r){if(r.startTimeField){const s=this._fieldsIndex.get(r.startTimeField);s?(r.startTimeField=s.name,s.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const s=this._fieldsIndex.get(r.endTimeField);s?(r.endTimeField=s.name,s.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const s=this._fieldsIndex.get(r.trackIdField);s?r.trackIdField=s.name:(r.trackIdField=null,t.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:r}}))}r.startTimeField||r.endTimeField||(t.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:r}}),r=null)}const R={warnings:t,featureErrors:[],layerDefinition:{...H,drawingInfo:L(p),templates:W(m),extent:a,geometryType:p,objectIdField:u,fields:l,hasZ:!!y,hasM:!!f,timeInfo:r},assignedObjectIds:{}};if(this._queryEngine=new G({fields:l,geometryType:p,hasM:f,hasZ:y,objectIdField:u,spatialReference:d,featureStore:new P({geometryType:p,hasM:f,hasZ:y}),timeInfo:r,cacheSpatialQueries:!0}),!n||!n.length)return this._nextObjectId=k,R;const S=C(u,n);return this._nextObjectId=S+1,await E(n,d),this._loadInitialFeatures(R,n)}async applyEdits(e){const{spatialReference:t,geometryType:n}=this._queryEngine;return await Promise.all([Y(t,n),E(e.adds,t),E(e.updates,t)]),this._applyEdits(e)}queryFeatures(e,t={}){return this._queryEngine.executeQuery(e,t.signal)}queryFeatureCount(e,t={}){return this._queryEngine.executeQueryForCount(e,t.signal)}queryObjectIds(e,t={}){return this._queryEngine.executeQueryForIds(e,t.signal)}queryExtent(e,t={}){return this._queryEngine.executeQueryForExtent(e,t.signal)}querySnapping(e,t={}){return this._queryEngine.executeQueryForSnapping(e,t.signal)}_inferLayerProperties(e,t){let n,i,l=null,f=null,y=null;for(const c of e){const d=c.geometry;if(!Z(d)&&(l||(l=F(d)),f||(f=d.spatialReference),n==null&&(n=V(d)),i==null&&(i=X(d)),l&&f&&n!=null&&i!=null))break}if(t&&t.length){let c=null;t.some(d=>{const a=d.type==="esriFieldTypeOID",p=!d.type&&d.name&&d.name.toLowerCase()==="objectid";return c=d,a||p})&&(y=c.name)}return{geometryType:l,spatialReference:f,objectIdField:y,hasM:i,hasZ:n}}_loadInitialFeatures(e,t){const{geometryType:n,hasM:i,hasZ:l,objectIdField:f,spatialReference:y,featureStore:c}=this._queryEngine,d=[];for(const a of t){if(a.uid!=null&&(e.assignedObjectIds[a.uid]=-1),a.geometry&&n!==F(a.geometry)){e.featureErrors.push(I("Incorrect geometry type."));continue}const p=this._createDefaultAttributes(),o=x(this._fieldsIndex,p,a.attributes,!0,e.warnings);o?e.featureErrors.push(o):(this._assignObjectId(p,a.attributes,!0),a.attributes=p,a.uid!=null&&(e.assignedObjectIds[a.uid]=a.attributes[f]),_(a.geometry)&&(a.geometry=j(a.geometry,a.geometry.spatialReference,y)),d.push(a))}if(c.addMany(q([],d,n,l,i,f)),e.layerDefinition.extent=this._queryEngine.fullExtent,e.layerDefinition.timeInfo){const{start:a,end:p}=this._queryEngine.timeExtent;e.layerDefinition.timeInfo.timeExtent=[a,p]}return e}_applyEdits(e){const{adds:t,updates:n,deletes:i}=e,l={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t&&t.length&&this._applyAddEdits(l,t),n&&n.length&&this._applyUpdateEdits(l,n),i&&i.length){for(const f of i)l.deleteResults.push(T(f));this._queryEngine.featureStore.removeManyById(i)}return{fullExtent:this._queryEngine.fullExtent,featureEditResults:l}}_applyAddEdits(e,t){var p;const{addResults:n}=e,{geometryType:i,hasM:l,hasZ:f,objectIdField:y,spatialReference:c,featureStore:d}=this._queryEngine,a=[];for(const o of t){if(o.geometry&&i!==F(o.geometry)){n.push(I("Incorrect geometry type."));continue}const u=this._createDefaultAttributes(),r=x(this._fieldsIndex,u,o.attributes);if(r)n.push(r);else{if(this._assignObjectId(u,o.attributes),o.attributes=u,o.uid!=null){const m=o.attributes[y];e.uidToObjectId[o.uid]=m}if(_(o.geometry)){const m=(p=o.geometry.spatialReference)!=null?p:c;o.geometry=j(w(o.geometry,m),m,c)}a.push(o),n.push(T(o.attributes[y]))}}d.addMany(q([],a,i,f,l,y))}_applyUpdateEdits({updateResults:e},t){var d;const{geometryType:n,hasM:i,hasZ:l,objectIdField:f,spatialReference:y,featureStore:c}=this._queryEngine;for(const a of t){const{attributes:p,geometry:o}=a,u=p&&p[f];if(u==null){e.push(I(`Identifier field ${f} missing`));continue}if(!c.has(u)){e.push(I(`Feature with object id ${u} missing`));continue}const r=$(c.getFeature(u),n,l,i);if(_(o)){if(n!==F(o)){e.push(I("Incorrect geometry type."));continue}const m=(d=o.spatialReference)!=null?d:y;r.geometry=j(w(o,m),m,y)}if(p){const m=x(this._fieldsIndex,r.attributes,p);if(m){e.push(m);continue}}c.add(A(r,n,l,i,f)),e.push(T(u))}}_assignObjectId(e,t,n=!1){const i=this._queryEngine.objectIdField;n&&t&&isFinite(t[i])?e[i]=t[i]:e[i]=this._nextObjectId++}}export{me as default}; +import{n as b,gx as v,eY as M,ci as Q,j as Z,aA as F,c as _,ca as q,cc as $,gy as A,e_ as D,aY as O}from"./index.221827cd.js";import{t as k,n as C}from"./objectIdUtils.83ac3f67.js";import{u as P}from"./FeatureStore.99d80f36.js";import{f as E,g as j}from"./projectionSupport.4f5da4af.js";import{Y as G}from"./QueryEngine.ac81c46d.js";import{i as z,o as L,a as W}from"./clientSideDefaults.d40b9315.js";import{w as Y,a as I,m as x,f as T,g as w}from"./sourceUtils.ed369a2c.js";import"./PooledRBush.e6a31ee9.js";import"./centroid.06db4b74.js";import"./json.879c9adc.js";import"./QueryEngineResult.2fc58178.js";import"./quantizationUtils.7ff797cc.js";import"./WhereClause.5b749615.js";import"./utils.83e0b804.js";import"./generateRendererUtils.5c972fdb.js";import"./utils.e42485ea.js";import"./QueryEngineCapabilities.78217f95.js";import"./timeSupport.968e62fc.js";const B=D,U={xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:D},H={hasAttachments:!1,capabilities:"query, editing, create, delete, update",useStandardizedQueries:!0,supportsCoordinatesQuantization:!0,supportsReturningQueryGeometry:!0,advancedQueryCapabilities:{supportsQueryAttachments:!1,supportsStatistics:!0,supportsPercentileStatistics:!0,supportsReturningGeometryCentroid:!0,supportsQueryWithDistance:!0,supportsDistinct:!0,supportsReturningQueryExtent:!0,supportsReturningGeometryProperties:!1,supportsHavingClause:!0,supportsOrderBy:!0,supportsPagination:!0,supportsQueryWithResultType:!1,supportsSqlExpression:!0,supportsDisjointSpatialRel:!0}};function V(h){return O(h)?h.z!=null:!!h.hasZ}function X(h){return O(h)?h.m!=null:!!h.hasM}class me{constructor(){this._queryEngine=null,this._nextObjectId=null}destroy(){this._queryEngine&&this._queryEngine&&this._queryEngine.destroy(),this._queryEngine=this._fieldsIndex=this._createDefaultAttributes=null}async load(e){const t=[],{features:n}=e,i=this._inferLayerProperties(n,e.fields),l=e.fields||[],f=e.hasM!=null?e.hasM:i.hasM,y=e.hasZ!=null?e.hasZ:i.hasZ,c=!e.spatialReference&&!i.spatialReference,d=c?B:e.spatialReference||i.spatialReference,a=c?U:null,p=e.geometryType||i.geometryType,o=!p;let u=e.objectIdField||i.objectIdField,r=e.timeInfo;if(!o&&(c&&t.push({name:"feature-layer:spatial-reference-not-found",message:"Spatial reference not provided or found in features. Defaults to WGS84"}),!p))throw new b("feature-layer:missing-property","geometryType not set and couldn't be inferred from the provided features");if(!u)throw new b("feature-layer:missing-property","objectIdField not set and couldn't be found in the provided fields");if(i.objectIdField&&u!==i.objectIdField&&(t.push({name:"feature-layer:duplicated-oid-field",message:`Provided objectIdField "${u}" doesn't match the field name "${i.objectIdField}", found in the provided fields`}),u=i.objectIdField),u&&!i.objectIdField){let s=null;l.some(g=>g.name===u&&(s=g,!0))?(s.type="esriFieldTypeOID",s.editable=!1,s.nullable=!1):l.unshift({alias:u,name:u,type:"esriFieldTypeOID",editable:!1,nullable:!1})}for(const s of l){if(s.name==null&&(s.name=s.alias),s.alias==null&&(s.alias=s.name),!s.name)throw new b("feature-layer:invalid-field-name","field name is missing",{field:s});if(s.name===u&&(s.type="esriFieldTypeOID"),!v.jsonValues.includes(s.type))throw new b("feature-layer:invalid-field-type",`invalid type for field "${s.name}"`,{field:s})}const m={};for(const s of l)if(s.type!=="esriFieldTypeOID"&&s.type!=="esriFieldTypeGlobalID"){const g=M(s);g!==void 0&&(m[s.name]=g)}if(this._fieldsIndex=new Q(l),this._createDefaultAttributes=z(m,u),r){if(r.startTimeField){const s=this._fieldsIndex.get(r.startTimeField);s?(r.startTimeField=s.name,s.type="esriFieldTypeDate"):r.startTimeField=null}if(r.endTimeField){const s=this._fieldsIndex.get(r.endTimeField);s?(r.endTimeField=s.name,s.type="esriFieldTypeDate"):r.endTimeField=null}if(r.trackIdField){const s=this._fieldsIndex.get(r.trackIdField);s?r.trackIdField=s.name:(r.trackIdField=null,t.push({name:"feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:r}}))}r.startTimeField||r.endTimeField||(t.push({name:"feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing or invalid",details:{timeInfo:r}}),r=null)}const R={warnings:t,featureErrors:[],layerDefinition:{...H,drawingInfo:L(p),templates:W(m),extent:a,geometryType:p,objectIdField:u,fields:l,hasZ:!!y,hasM:!!f,timeInfo:r},assignedObjectIds:{}};if(this._queryEngine=new G({fields:l,geometryType:p,hasM:f,hasZ:y,objectIdField:u,spatialReference:d,featureStore:new P({geometryType:p,hasM:f,hasZ:y}),timeInfo:r,cacheSpatialQueries:!0}),!n||!n.length)return this._nextObjectId=k,R;const S=C(u,n);return this._nextObjectId=S+1,await E(n,d),this._loadInitialFeatures(R,n)}async applyEdits(e){const{spatialReference:t,geometryType:n}=this._queryEngine;return await Promise.all([Y(t,n),E(e.adds,t),E(e.updates,t)]),this._applyEdits(e)}queryFeatures(e,t={}){return this._queryEngine.executeQuery(e,t.signal)}queryFeatureCount(e,t={}){return this._queryEngine.executeQueryForCount(e,t.signal)}queryObjectIds(e,t={}){return this._queryEngine.executeQueryForIds(e,t.signal)}queryExtent(e,t={}){return this._queryEngine.executeQueryForExtent(e,t.signal)}querySnapping(e,t={}){return this._queryEngine.executeQueryForSnapping(e,t.signal)}_inferLayerProperties(e,t){let n,i,l=null,f=null,y=null;for(const c of e){const d=c.geometry;if(!Z(d)&&(l||(l=F(d)),f||(f=d.spatialReference),n==null&&(n=V(d)),i==null&&(i=X(d)),l&&f&&n!=null&&i!=null))break}if(t&&t.length){let c=null;t.some(d=>{const a=d.type==="esriFieldTypeOID",p=!d.type&&d.name&&d.name.toLowerCase()==="objectid";return c=d,a||p})&&(y=c.name)}return{geometryType:l,spatialReference:f,objectIdField:y,hasM:i,hasZ:n}}_loadInitialFeatures(e,t){const{geometryType:n,hasM:i,hasZ:l,objectIdField:f,spatialReference:y,featureStore:c}=this._queryEngine,d=[];for(const a of t){if(a.uid!=null&&(e.assignedObjectIds[a.uid]=-1),a.geometry&&n!==F(a.geometry)){e.featureErrors.push(I("Incorrect geometry type."));continue}const p=this._createDefaultAttributes(),o=x(this._fieldsIndex,p,a.attributes,!0,e.warnings);o?e.featureErrors.push(o):(this._assignObjectId(p,a.attributes,!0),a.attributes=p,a.uid!=null&&(e.assignedObjectIds[a.uid]=a.attributes[f]),_(a.geometry)&&(a.geometry=j(a.geometry,a.geometry.spatialReference,y)),d.push(a))}if(c.addMany(q([],d,n,l,i,f)),e.layerDefinition.extent=this._queryEngine.fullExtent,e.layerDefinition.timeInfo){const{start:a,end:p}=this._queryEngine.timeExtent;e.layerDefinition.timeInfo.timeExtent=[a,p]}return e}_applyEdits(e){const{adds:t,updates:n,deletes:i}=e,l={addResults:[],deleteResults:[],updateResults:[],uidToObjectId:{}};if(t&&t.length&&this._applyAddEdits(l,t),n&&n.length&&this._applyUpdateEdits(l,n),i&&i.length){for(const f of i)l.deleteResults.push(T(f));this._queryEngine.featureStore.removeManyById(i)}return{fullExtent:this._queryEngine.fullExtent,featureEditResults:l}}_applyAddEdits(e,t){var p;const{addResults:n}=e,{geometryType:i,hasM:l,hasZ:f,objectIdField:y,spatialReference:c,featureStore:d}=this._queryEngine,a=[];for(const o of t){if(o.geometry&&i!==F(o.geometry)){n.push(I("Incorrect geometry type."));continue}const u=this._createDefaultAttributes(),r=x(this._fieldsIndex,u,o.attributes);if(r)n.push(r);else{if(this._assignObjectId(u,o.attributes),o.attributes=u,o.uid!=null){const m=o.attributes[y];e.uidToObjectId[o.uid]=m}if(_(o.geometry)){const m=(p=o.geometry.spatialReference)!=null?p:c;o.geometry=j(w(o.geometry,m),m,c)}a.push(o),n.push(T(o.attributes[y]))}}d.addMany(q([],a,i,f,l,y))}_applyUpdateEdits({updateResults:e},t){var d;const{geometryType:n,hasM:i,hasZ:l,objectIdField:f,spatialReference:y,featureStore:c}=this._queryEngine;for(const a of t){const{attributes:p,geometry:o}=a,u=p&&p[f];if(u==null){e.push(I(`Identifier field ${f} missing`));continue}if(!c.has(u)){e.push(I(`Feature with object id ${u} missing`));continue}const r=$(c.getFeature(u),n,l,i);if(_(o)){if(n!==F(o)){e.push(I("Incorrect geometry type."));continue}const m=(d=o.spatialReference)!=null?d:y;r.geometry=j(w(o,m),m,y)}if(p){const m=x(this._fieldsIndex,r.attributes,p);if(m){e.push(m);continue}}c.add(A(r,n,l,i,f)),e.push(T(u))}}_assignObjectId(e,t,n=!1){const i=this._queryEngine.objectIdField;n&&t&&isFinite(t[i])?e[i]=t[i]:e[i]=this._nextObjectId++}}export{me as default}; diff --git a/assets/OGCFeatureLayer.a08e7e0a.js b/assets/OGCFeatureLayer.c9b31254.js similarity index 97% rename from assets/OGCFeatureLayer.a08e7e0a.js rename to assets/OGCFeatureLayer.c9b31254.js index 9c533eb..008e766 100644 --- a/assets/OGCFeatureLayer.a08e7e0a.js +++ b/assets/OGCFeatureLayer.c9b31254.js @@ -1 +1 @@ -import{a6 as r,a7 as i,a8 as P,hT as L,d3 as N,j as k,aT as w,c as I,e1 as H,n as b,il as J,iJ as U,iK as Z,iL as z,i2 as K,iI as V,iM as W,i3 as X,eF as Y,eG as ee,ia as te,eH as se,iN as O,id as re,dd as T,iO as oe,io as ie,gG as ne,cU as pe,hl as $,iQ as ae,iR as le,iP as ue,iE as de,ig as ce,dv as ye,iT as he,ie as fe,iU as me,iW as ge,eK as ve,ih as Se,cF as xe}from"./index.d94abe07.js";import{N as we,F as D,v as j,x as Ce,k as Fe,T as Re,S as Ie,I as be,j as Oe}from"./ogcFeatureUtils.ed8217a8.js";import"./geojson.8a0cb9d1.js";import"./clientSideDefaults.f5f7bfa0.js";import"./QueryEngineCapabilities.78217f95.js";let y=class extends L{constructor(){super(...arguments),this.featureDefinition=null,this.type="ogc-feature"}load(e){return this.addResolvingPromise(this._loadOGCServices(this.layer,e)),this.when()}getSource(){const{featureDefinition:{collection:e,layerDefinition:t,spatialReference:s,supportedCrs:n},layer:{apiKey:p,customParameters:l,effectiveMaxRecordCount:a}}=this;return{type:"ogc-source",collection:e,layerDefinition:t,maxRecordCount:a,queryParameters:{apiKey:p,customParameters:l},spatialReference:s,supportedCrs:n}}queryExtent(e,t={}){return null}queryFeatureCount(e,t={}){return null}queryFeatures(e,t={}){return this.queryFeaturesJSON(e,t).then(s=>N.fromJSON(s))}queryFeaturesJSON(e,t={}){const s=this.getSource();return this.load(t).then(()=>we(s,e,t))}queryObjectIds(e,t={}){return null}serviceSupportsSpatialReference(e){return!(!e.isWGS84&&!e.isWebMercator)||!!this.featureDefinition.supportedCrs[e.wkid]}_conformsToType(e,t){var n;const s=new RegExp(`^${t}$`,"i");return(n=e.conformsTo.some(p=>s.test(p)))!=null?n:!1}_getCapabilities(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1},query:{maxRecordCount:t,maxRecordCountFactor:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,tileMaxRecordCount:void 0},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1}}}_getMaxRecordCount(e){var t,s,n,p,l,a,u,d,m;return(m=(p=(n=(s=(t=e==null?void 0:e.components)==null?void 0:t.parameters)==null?void 0:s.limit)==null?void 0:n.schema)==null?void 0:p.maximum)!=null?m:(d=(u=(a=(l=e==null?void 0:e.components)==null?void 0:l.parameters)==null?void 0:a.limitFeatures)==null?void 0:u.schema)==null?void 0:d.maximum}_getStorageSpatialReference(e){var n;const t=(n=e.storageCrs)!=null?n:D,s=j(t);return k(s)?w.WGS84:new w({wkid:s})}_getSupportedSpatialReferences(e,t){var a;const s="#/crs",n=(a=e.crs)!=null?a:[D],p=n.includes(s)?n.filter(u=>u!==s).concat(t.crs):n,l=/^http:\/\/www\.opengis.net\/def\/crs\/epsg\/.*\/3785$/i;return p.filter(u=>!l.test(u))}async _loadOGCServices(e,t){const s=I(t)?t.signal:null,{apiKey:n,collectionId:p,customParameters:l,fields:a,geometryType:u,hasZ:d,objectIdField:m,timeInfo:g,url:E}=e,_={fields:a==null?void 0:a.map(c=>c.toJSON()),geometryType:H.toJSON(u),hasZ:d,objectIdField:m,timeInfo:g==null?void 0:g.toJSON()},h={apiKey:n,customParameters:l,signal:s},v=await Ce(E,h),[C,F]=await Promise.all([Fe(v,h),Re(v,h)]);if(!this._conformsToType(C,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"))throw new b("ogc-feature-layer:no-geojson-support","Server does not support geojson");const f=F.collections.find(c=>c.id===p);if(!f)throw new b("ogc-feature-layer:collection-not-found","Server does not contain the named collection");const q=this._conformsToType(C,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30")?await Ie(v,h):null,R=await be(f,_,h),G=this._getMaxRecordCount(q),M=this._getCapabilities(R.hasZ,G),Q=this._getStorageSpatialReference(f).toJSON(),A=this._getSupportedSpatialReferences(f,F),B=new RegExp(`^${Oe}`,"i"),S={};for(const c of A){const x=j(c);I(x)&&(S[x]||(S[x]=c.replace(B,"")))}this.featureDefinition={capabilities:M,collection:f,layerDefinition:R,spatialReference:Q,supportedCrs:S}}};r([i()],y.prototype,"featureDefinition",void 0),r([i({constructOnly:!0})],y.prototype,"layer",void 0),r([i()],y.prototype,"type",void 0),y=r([P("esri.layers.graphics.sources.OGCFeatureSource")],y);const Te=Se();let o=class extends J(U(Z(z(K(V(W(X(Y(ee(te(se(xe)))))))))))){constructor(e){super(e),this.collectionId=null,this.copyright=null,this.definitionExpression=null,this.description=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxRecordCount=null,this.objectIdField=null,this.operationalLayerType="OGCFeatureLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new y({layer:this}),this.spatialReference=null,this.title=null,this.type="ogc-feature",this.typeIdField=null,this.types=null,this.url=null}destroy(){var e;(e=this.source)==null||e.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["OGCFeatureServer"]},e).then(()=>this._fetchService(e))),this.when()}get defaultPopupTemplate(){return this.createPopupTemplate()}get effectiveMaxRecordCount(){var e,t,s;return(s=(t=this.maxRecordCount)!=null?t:(e=this.capabilities)==null?void 0:e.query.maxRecordCount)!=null?s:5e3}get isTable(){return this.loaded&&this.geometryType==null}set renderer(e){O(e,this.fieldsIndex),this._set("renderer",e)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return re(this,e)}createQuery(){return new T}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){var a;let s,n=!1;const p=(a=t==null?void 0:t.feature)==null?void 0:a.attributes,l=this.typeIdField&&(p==null?void 0:p[this.typeIdField]);return l!=null&&this.types&&(n=this.types.some(u=>{var d;return u.id==l&&(s=(d=u.domains)==null?void 0:d[e],(s==null?void 0:s.type)==="inherited"&&(s=this._getLayerDomain(e)),!0)})),n||s||(s=this._getLayerDomain(e)),s}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(T.from(e)||this.createQuery(),t)).then(s=>{var n;return(n=s==null?void 0:s.features)==null||n.forEach(p=>{p.layer=p.sourceLayer=this}),s})}serviceSupportsSpatialReference(e){var t,s;return(s=(t=this.source)==null?void 0:t.serviceSupportsSpatialReference(e))!=null?s:!1}async _fetchService(e){await this.source.load(e),this.read(this.source.featureDefinition,{origin:"service"}),O(this.renderer,this.fieldsIndex),oe(this.timeInfo,this.fieldsIndex)}_getLayerDomain(e){if(!this.fields)return null;for(const t of this.fields)if(t.name===e&&t.domain)return t.domain;return null}};r([i({readOnly:!0,json:{origins:{service:{read:!0}}}})],o.prototype,"capabilities",void 0),r([i({type:String,json:{write:!0}})],o.prototype,"collectionId",void 0),r([i({type:String})],o.prototype,"copyright",void 0),r([i({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),r([i({type:String})],o.prototype,"definitionExpression",void 0),r([i({readOnly:!0,type:String,json:{origins:{service:{name:"collection.description"}}}})],o.prototype,"description",void 0),r([i({type:String})],o.prototype,"displayField",void 0),r([i({type:Number})],o.prototype,"effectiveMaxRecordCount",null),r([i(ie)],o.prototype,"elevationInfo",void 0),r([i({type:[ne],json:{origins:{service:{name:"layerDefinition.fields"}}}})],o.prototype,"fields",void 0),r([i(Te.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([i({readOnly:!0,type:pe,json:{origins:{service:{name:"layerDefinition.extent"}}}})],o.prototype,"fullExtent",void 0),r([i({type:$.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:$.read}}}}})],o.prototype,"geometryType",void 0),r([i({type:Boolean,json:{origins:{service:{name:"layerDefinition.hasZ"}}}})],o.prototype,"hasZ",void 0),r([i({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),r([i({type:[ae],json:{origins:{"web-document":{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:le},write:!0}}}})],o.prototype,"labelingInfo",void 0),r([i(ue)],o.prototype,"labelsVisible",void 0),r([i(de)],o.prototype,"legendEnabled",void 0),r([i({type:Number})],o.prototype,"maxRecordCount",void 0),r([i({type:String,json:{origins:{service:{name:"layerDefinition.objectIdField"}}}})],o.prototype,"objectIdField",void 0),r([i({type:["OGCFeatureLayer"]})],o.prototype,"operationalLayerType",void 0),r([i(ce)],o.prototype,"popupEnabled",void 0),r([i({type:ye,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([i({types:he,json:{origins:{service:{name:"layerDefinition.drawingInfo.renderer",write:!1},"web-scene":{types:fe,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:!0}})],o.prototype,"renderer",null),r([i(me)],o.prototype,"screenSizePerspectiveEnabled",void 0),r([i({readOnly:!0})],o.prototype,"source",void 0),r([i({readOnly:!0,type:w,json:{origins:{service:{read:!0}}}})],o.prototype,"spatialReference",void 0),r([i({type:String,json:{write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"collection.title"}}}})],o.prototype,"title",void 0),r([i({readOnly:!0,json:{read:!1}})],o.prototype,"type",void 0),r([i({type:String,readOnly:!0})],o.prototype,"typeIdField",void 0),r([i({type:[ge]})],o.prototype,"types",void 0),r([i(ve)],o.prototype,"url",void 0),o=r([P("esri.layers.OGCFeatureLayer")],o);const _e=o;export{_e as default}; +import{a6 as r,a7 as i,a8 as P,hT as L,d3 as N,j as k,aT as w,c as I,e1 as H,n as b,il as J,iJ as U,iK as Z,iL as z,i2 as K,iI as V,iM as W,i3 as X,eF as Y,eG as ee,ia as te,eH as se,iN as O,id as re,dd as T,iO as oe,io as ie,gG as ne,cU as pe,hl as $,iQ as ae,iR as le,iP as ue,iE as de,ig as ce,dv as ye,iT as he,ie as fe,iU as me,iW as ge,eK as ve,ih as Se,cF as xe}from"./index.221827cd.js";import{N as we,F as D,v as j,x as Ce,k as Fe,T as Re,S as Ie,I as be,j as Oe}from"./ogcFeatureUtils.61a937b0.js";import"./geojson.7d18026b.js";import"./clientSideDefaults.d40b9315.js";import"./QueryEngineCapabilities.78217f95.js";let y=class extends L{constructor(){super(...arguments),this.featureDefinition=null,this.type="ogc-feature"}load(e){return this.addResolvingPromise(this._loadOGCServices(this.layer,e)),this.when()}getSource(){const{featureDefinition:{collection:e,layerDefinition:t,spatialReference:s,supportedCrs:n},layer:{apiKey:p,customParameters:l,effectiveMaxRecordCount:a}}=this;return{type:"ogc-source",collection:e,layerDefinition:t,maxRecordCount:a,queryParameters:{apiKey:p,customParameters:l},spatialReference:s,supportedCrs:n}}queryExtent(e,t={}){return null}queryFeatureCount(e,t={}){return null}queryFeatures(e,t={}){return this.queryFeaturesJSON(e,t).then(s=>N.fromJSON(s))}queryFeaturesJSON(e,t={}){const s=this.getSource();return this.load(t).then(()=>we(s,e,t))}queryObjectIds(e,t={}){return null}serviceSupportsSpatialReference(e){return!(!e.isWGS84&&!e.isWebMercator)||!!this.featureDefinition.supportedCrs[e.wkid]}_conformsToType(e,t){var n;const s=new RegExp(`^${t}$`,"i");return(n=e.conformsTo.some(p=>s.test(p)))!=null?n:!1}_getCapabilities(e,t){return{analytics:{supportsCacheHint:!1},attachment:null,data:{isVersioned:!1,supportsAttachment:!1,supportsM:!1,supportsZ:e},metadata:{supportsAdvancedFieldProperties:!1},operations:{supportsCalculate:!1,supportsTruncate:!1,supportsValidateSql:!1,supportsAdd:!1,supportsDelete:!1,supportsEditing:!1,supportsChangeTracking:!1,supportsQuery:!1,supportsQueryAnalytics:!1,supportsQueryAttachments:!1,supportsQueryTopFeatures:!1,supportsResizeAttachments:!1,supportsSync:!1,supportsUpdate:!1,supportsExceedsLimitStatistics:!1},query:{maxRecordCount:t,maxRecordCountFactor:void 0,standardMaxRecordCount:void 0,supportsCacheHint:!1,supportsCentroid:!1,supportsDisjointSpatialRelationship:!1,supportsDistance:!1,supportsDistinct:!1,supportsExtent:!1,supportsFormatPBF:!1,supportsGeometryProperties:!1,supportsHavingClause:!1,supportsHistoricMoment:!1,supportsMaxRecordCountFactor:!1,supportsOrderBy:!1,supportsPagination:!1,supportsPercentileStatistics:!1,supportsQuantization:!1,supportsQuantizationEditMode:!1,supportsQueryByOthers:!1,supportsQueryGeometry:!1,supportsResultType:!1,supportsStandardizedQueriesOnly:!1,supportsTopFeaturesQuery:!1,supportsStatistics:!1,supportsSpatialAggregationStatistics:!1,supportedSpatialAggregationStatistics:{envelope:!1,centroid:!1,convexHull:!1},supportsDefaultSpatialReference:!1,supportsFullTextSearch:!1,supportsCompactGeometry:!1,supportsSqlExpression:!1,tileMaxRecordCount:void 0},queryRelated:{supportsCount:!1,supportsOrderBy:!1,supportsPagination:!1,supportsCacheHint:!1},queryTopFeatures:{supportsCacheHint:!1},editing:{supportsDeleteByAnonymous:!1,supportsDeleteByOthers:!1,supportsGeometryUpdate:!1,supportsGlobalId:!1,supportsReturnServiceEditsInSourceSpatialReference:!1,supportsRollbackOnFailure:!1,supportsUpdateByAnonymous:!1,supportsUpdateByOthers:!1,supportsUploadWithItemId:!1,supportsUpdateWithoutM:!1}}}_getMaxRecordCount(e){var t,s,n,p,l,a,u,d,m;return(m=(p=(n=(s=(t=e==null?void 0:e.components)==null?void 0:t.parameters)==null?void 0:s.limit)==null?void 0:n.schema)==null?void 0:p.maximum)!=null?m:(d=(u=(a=(l=e==null?void 0:e.components)==null?void 0:l.parameters)==null?void 0:a.limitFeatures)==null?void 0:u.schema)==null?void 0:d.maximum}_getStorageSpatialReference(e){var n;const t=(n=e.storageCrs)!=null?n:D,s=j(t);return k(s)?w.WGS84:new w({wkid:s})}_getSupportedSpatialReferences(e,t){var a;const s="#/crs",n=(a=e.crs)!=null?a:[D],p=n.includes(s)?n.filter(u=>u!==s).concat(t.crs):n,l=/^http:\/\/www\.opengis.net\/def\/crs\/epsg\/.*\/3785$/i;return p.filter(u=>!l.test(u))}async _loadOGCServices(e,t){const s=I(t)?t.signal:null,{apiKey:n,collectionId:p,customParameters:l,fields:a,geometryType:u,hasZ:d,objectIdField:m,timeInfo:g,url:E}=e,_={fields:a==null?void 0:a.map(c=>c.toJSON()),geometryType:H.toJSON(u),hasZ:d,objectIdField:m,timeInfo:g==null?void 0:g.toJSON()},h={apiKey:n,customParameters:l,signal:s},v=await Ce(E,h),[C,F]=await Promise.all([Fe(v,h),Re(v,h)]);if(!this._conformsToType(C,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/geojson"))throw new b("ogc-feature-layer:no-geojson-support","Server does not support geojson");const f=F.collections.find(c=>c.id===p);if(!f)throw new b("ogc-feature-layer:collection-not-found","Server does not contain the named collection");const q=this._conformsToType(C,"http://www.opengis.net/spec/ogcapi-features-1/1.0/conf/oas30")?await Ie(v,h):null,R=await be(f,_,h),G=this._getMaxRecordCount(q),M=this._getCapabilities(R.hasZ,G),Q=this._getStorageSpatialReference(f).toJSON(),A=this._getSupportedSpatialReferences(f,F),B=new RegExp(`^${Oe}`,"i"),S={};for(const c of A){const x=j(c);I(x)&&(S[x]||(S[x]=c.replace(B,"")))}this.featureDefinition={capabilities:M,collection:f,layerDefinition:R,spatialReference:Q,supportedCrs:S}}};r([i()],y.prototype,"featureDefinition",void 0),r([i({constructOnly:!0})],y.prototype,"layer",void 0),r([i()],y.prototype,"type",void 0),y=r([P("esri.layers.graphics.sources.OGCFeatureSource")],y);const Te=Se();let o=class extends J(U(Z(z(K(V(W(X(Y(ee(te(se(xe)))))))))))){constructor(e){super(e),this.collectionId=null,this.copyright=null,this.definitionExpression=null,this.description=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.hasZ=void 0,this.labelingInfo=null,this.labelsVisible=!0,this.legendEnabled=!0,this.maxRecordCount=null,this.objectIdField=null,this.operationalLayerType="OGCFeatureLayer",this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new y({layer:this}),this.spatialReference=null,this.title=null,this.type="ogc-feature",this.typeIdField=null,this.types=null,this.url=null}destroy(){var e;(e=this.source)==null||e.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["OGCFeatureServer"]},e).then(()=>this._fetchService(e))),this.when()}get defaultPopupTemplate(){return this.createPopupTemplate()}get effectiveMaxRecordCount(){var e,t,s;return(s=(t=this.maxRecordCount)!=null?t:(e=this.capabilities)==null?void 0:e.query.maxRecordCount)!=null?s:5e3}get isTable(){return this.loaded&&this.geometryType==null}set renderer(e){O(e,this.fieldsIndex),this._set("renderer",e)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return re(this,e)}createQuery(){return new T}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){var a;let s,n=!1;const p=(a=t==null?void 0:t.feature)==null?void 0:a.attributes,l=this.typeIdField&&(p==null?void 0:p[this.typeIdField]);return l!=null&&this.types&&(n=this.types.some(u=>{var d;return u.id==l&&(s=(d=u.domains)==null?void 0:d[e],(s==null?void 0:s.type)==="inherited"&&(s=this._getLayerDomain(e)),!0)})),n||s||(s=this._getLayerDomain(e)),s}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(T.from(e)||this.createQuery(),t)).then(s=>{var n;return(n=s==null?void 0:s.features)==null||n.forEach(p=>{p.layer=p.sourceLayer=this}),s})}serviceSupportsSpatialReference(e){var t,s;return(s=(t=this.source)==null?void 0:t.serviceSupportsSpatialReference(e))!=null?s:!1}async _fetchService(e){await this.source.load(e),this.read(this.source.featureDefinition,{origin:"service"}),O(this.renderer,this.fieldsIndex),oe(this.timeInfo,this.fieldsIndex)}_getLayerDomain(e){if(!this.fields)return null;for(const t of this.fields)if(t.name===e&&t.domain)return t.domain;return null}};r([i({readOnly:!0,json:{origins:{service:{read:!0}}}})],o.prototype,"capabilities",void 0),r([i({type:String,json:{write:!0}})],o.prototype,"collectionId",void 0),r([i({type:String})],o.prototype,"copyright",void 0),r([i({readOnly:!0})],o.prototype,"defaultPopupTemplate",null),r([i({type:String})],o.prototype,"definitionExpression",void 0),r([i({readOnly:!0,type:String,json:{origins:{service:{name:"collection.description"}}}})],o.prototype,"description",void 0),r([i({type:String})],o.prototype,"displayField",void 0),r([i({type:Number})],o.prototype,"effectiveMaxRecordCount",null),r([i(ie)],o.prototype,"elevationInfo",void 0),r([i({type:[ne],json:{origins:{service:{name:"layerDefinition.fields"}}}})],o.prototype,"fields",void 0),r([i(Te.fieldsIndex)],o.prototype,"fieldsIndex",void 0),r([i({readOnly:!0,type:pe,json:{origins:{service:{name:"layerDefinition.extent"}}}})],o.prototype,"fullExtent",void 0),r([i({type:$.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:$.read}}}}})],o.prototype,"geometryType",void 0),r([i({type:Boolean,json:{origins:{service:{name:"layerDefinition.hasZ"}}}})],o.prototype,"hasZ",void 0),r([i({type:Boolean,readOnly:!0})],o.prototype,"isTable",null),r([i({type:[ae],json:{origins:{"web-document":{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:le},write:!0}}}})],o.prototype,"labelingInfo",void 0),r([i(ue)],o.prototype,"labelsVisible",void 0),r([i(de)],o.prototype,"legendEnabled",void 0),r([i({type:Number})],o.prototype,"maxRecordCount",void 0),r([i({type:String,json:{origins:{service:{name:"layerDefinition.objectIdField"}}}})],o.prototype,"objectIdField",void 0),r([i({type:["OGCFeatureLayer"]})],o.prototype,"operationalLayerType",void 0),r([i(ce)],o.prototype,"popupEnabled",void 0),r([i({type:ye,json:{name:"popupInfo",write:!0}})],o.prototype,"popupTemplate",void 0),r([i({types:he,json:{origins:{service:{name:"layerDefinition.drawingInfo.renderer",write:!1},"web-scene":{types:fe,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:!0}})],o.prototype,"renderer",null),r([i(me)],o.prototype,"screenSizePerspectiveEnabled",void 0),r([i({readOnly:!0})],o.prototype,"source",void 0),r([i({readOnly:!0,type:w,json:{origins:{service:{read:!0}}}})],o.prototype,"spatialReference",void 0),r([i({type:String,json:{write:{enabled:!0,ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"collection.title"}}}})],o.prototype,"title",void 0),r([i({readOnly:!0,json:{read:!1}})],o.prototype,"type",void 0),r([i({type:String,readOnly:!0})],o.prototype,"typeIdField",void 0),r([i({type:[ge]})],o.prototype,"types",void 0),r([i(ve)],o.prototype,"url",void 0),o=r([P("esri.layers.OGCFeatureLayer")],o);const _e=o;export{_e as default}; diff --git a/assets/OGCFeatureLayerView2D.5ee46b9c.js b/assets/OGCFeatureLayerView2D.5ee46b9c.js new file mode 100644 index 0000000..6ef3274 --- /dev/null +++ b/assets/OGCFeatureLayerView2D.5ee46b9c.js @@ -0,0 +1 @@ +import{a6 as r,a7 as o,a8 as p}from"./index.221827cd.js";import s from"./FeatureLayerView2D.7c1a650d.js";import"./utils.0160becb.js";import"./Utils.2136650a.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.0cadabc1.js";import"./LayerView.ce6e0535.js";import"./schemaUtils.d20994fa.js";import"./visualVariablesUtils.62efda9d.js";import"./createSymbolSchema.827eb617.js";import"./ExpandedCIM.a372ce74.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.7ff797cc.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.3f71f8e9.js";import"./util.520a352e.js";import"./floorFilterUtils.05eb8c6a.js";import"./popupUtils.c6371f3a.js";import"./RefreshableLayerView.887ed8c3.js";const m=t=>{let e=class extends t{get availableFields(){return this.layer.fieldsIndex.fields.map(a=>a.name)}};return r([o()],e.prototype,"layer",void 0),r([o({readOnly:!0})],e.prototype,"availableFields",null),e=r([p("esri.views.layers.OGCFeatureLayerView")],e),e};let i=class extends m(s){supportsSpatialReference(t){return this.layer.serviceSupportsSpatialReference(t)}};i=r([p("esri.views.2d.layers.OGCFeatureLayerView2D")],i);const I=i;export{I as default}; diff --git a/assets/OGCFeatureLayerView2D.f2b5dde2.js b/assets/OGCFeatureLayerView2D.f2b5dde2.js deleted file mode 100644 index 77b6b1b..0000000 --- a/assets/OGCFeatureLayerView2D.f2b5dde2.js +++ /dev/null @@ -1 +0,0 @@ -import{a6 as r,a7 as o,a8 as p}from"./index.d94abe07.js";import s from"./FeatureLayerView2D.c0de0a56.js";import"./utils.4b023c9d.js";import"./Utils.7f6f3a6b.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.229b1dd6.js";import"./LayerView.42d17220.js";import"./schemaUtils.69ad92d2.js";import"./visualVariablesUtils.aff73e6d.js";import"./createSymbolSchema.e54d2060.js";import"./ExpandedCIM.f0b7f36d.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.0d428d19.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.df11258c.js";import"./util.ab699fea.js";import"./floorFilterUtils.05eb8c6a.js";import"./popupUtils.4abb3ffd.js";import"./RefreshableLayerView.28a00159.js";const m=t=>{let e=class extends t{get availableFields(){return this.layer.fieldsIndex.fields.map(a=>a.name)}};return r([o()],e.prototype,"layer",void 0),r([o({readOnly:!0})],e.prototype,"availableFields",null),e=r([p("esri.views.layers.OGCFeatureLayerView")],e),e};let i=class extends m(s){supportsSpatialReference(t){return this.layer.serviceSupportsSpatialReference(t)}};i=r([p("esri.views.2d.layers.OGCFeatureLayerView2D")],i);const I=i;export{I as default}; diff --git a/assets/OpenStreetMapLayer.0dc3f11e.js b/assets/OpenStreetMapLayer.959d4b15.js similarity index 96% rename from assets/OpenStreetMapLayer.0dc3f11e.js rename to assets/OpenStreetMapLayer.959d4b15.js index 62de5aa..a30f29c 100644 --- a/assets/OpenStreetMapLayer.0dc3f11e.js +++ b/assets/OpenStreetMapLayer.959d4b15.js @@ -1 +1 @@ -import{a6 as t,a7 as l,cD as a,du as s,a8 as i,af as p,aT as r,jB as e,cU as c}from"./index.d94abe07.js";import{x as u}from"./WebTileLayer.ab421225.js";let o=class extends u{constructor(...n){super(...n),this.portalItem=null,this.isReference=null,this.tileInfo=new s({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new p({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:r.WebMercator}),spatialReference:r.WebMercator,lods:[new e({level:0,scale:591657527591555e-6,resolution:156543.033928}),new e({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new e({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new e({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new e({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new e({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new e({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new e({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new e({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new e({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new e({level:10,scale:577790.554289,resolution:152.874056570411}),new e({level:11,scale:288895.277144,resolution:76.4370282850732}),new e({level:12,scale:144447.638572,resolution:38.2185141425366}),new e({level:13,scale:72223.819286,resolution:19.1092570712683}),new e({level:14,scale:36111.909643,resolution:9.55462853563415}),new e({level:15,scale:18055.954822,resolution:4.77731426794937}),new e({level:16,scale:9027.977411,resolution:2.38865713397468}),new e({level:17,scale:4513.988705,resolution:1.19432856685505}),new e({level:18,scale:2256.994353,resolution:.597164283559817}),new e({level:19,scale:1128.497176,resolution:.298582141647617})]}),this.subDomains=["a","b","c"],this.fullExtent=new c(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,r.WebMercator),this.urlTemplate="https://{subDomain}.tile.openstreetmap.org/{level}/{col}/{row}.png",this.operationalLayerType="OpenStreetMap",this.type="open-street-map",this.copyright="Map data © OpenStreetMap contributors, CC-BY-SA"}get refreshInterval(){return 0}};t([l({type:a,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"portalItem",void 0),t([l({type:Boolean,json:{read:!1,write:!1}})],o.prototype,"isReference",void 0),t([l({type:Number,readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"refreshInterval",null),t([l({type:s,json:{write:!1}})],o.prototype,"tileInfo",void 0),t([l({type:["show","hide"]})],o.prototype,"listMode",void 0),t([l({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"subDomains",void 0),t([l({readOnly:!0,json:{read:!1,write:!1},nonNullable:!0})],o.prototype,"fullExtent",void 0),t([l({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"urlTemplate",void 0),t([l({type:["OpenStreetMap"]})],o.prototype,"operationalLayerType",void 0),t([l({json:{read:!1}})],o.prototype,"type",void 0),t([l({json:{read:!1,write:!1}})],o.prototype,"copyright",void 0),t([l({json:{read:!1,write:!1}})],o.prototype,"wmtsInfo",void 0),o=t([i("esri.layers.OpenStreetMapLayer")],o);const y=o;export{y as default}; +import{a6 as t,a7 as l,cD as a,du as s,a8 as i,af as p,aT as r,jB as e,cU as c}from"./index.221827cd.js";import{x as u}from"./WebTileLayer.b038b70d.js";let o=class extends u{constructor(...n){super(...n),this.portalItem=null,this.isReference=null,this.tileInfo=new s({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new p({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:r.WebMercator}),spatialReference:r.WebMercator,lods:[new e({level:0,scale:591657527591555e-6,resolution:156543.033928}),new e({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new e({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new e({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new e({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new e({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new e({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new e({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new e({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new e({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new e({level:10,scale:577790.554289,resolution:152.874056570411}),new e({level:11,scale:288895.277144,resolution:76.4370282850732}),new e({level:12,scale:144447.638572,resolution:38.2185141425366}),new e({level:13,scale:72223.819286,resolution:19.1092570712683}),new e({level:14,scale:36111.909643,resolution:9.55462853563415}),new e({level:15,scale:18055.954822,resolution:4.77731426794937}),new e({level:16,scale:9027.977411,resolution:2.38865713397468}),new e({level:17,scale:4513.988705,resolution:1.19432856685505}),new e({level:18,scale:2256.994353,resolution:.597164283559817}),new e({level:19,scale:1128.497176,resolution:.298582141647617})]}),this.subDomains=["a","b","c"],this.fullExtent=new c(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,r.WebMercator),this.urlTemplate="https://{subDomain}.tile.openstreetmap.org/{level}/{col}/{row}.png",this.operationalLayerType="OpenStreetMap",this.type="open-street-map",this.copyright="Map data © OpenStreetMap contributors, CC-BY-SA"}get refreshInterval(){return 0}};t([l({type:a,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"portalItem",void 0),t([l({type:Boolean,json:{read:!1,write:!1}})],o.prototype,"isReference",void 0),t([l({type:Number,readOnly:!0,json:{read:!1,write:!1,origins:{"web-document":{read:!1,write:!1}}}})],o.prototype,"refreshInterval",null),t([l({type:s,json:{write:!1}})],o.prototype,"tileInfo",void 0),t([l({type:["show","hide"]})],o.prototype,"listMode",void 0),t([l({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"subDomains",void 0),t([l({readOnly:!0,json:{read:!1,write:!1},nonNullable:!0})],o.prototype,"fullExtent",void 0),t([l({readOnly:!0,json:{read:!1,write:!1}})],o.prototype,"urlTemplate",void 0),t([l({type:["OpenStreetMap"]})],o.prototype,"operationalLayerType",void 0),t([l({json:{read:!1}})],o.prototype,"type",void 0),t([l({json:{read:!1,write:!1}})],o.prototype,"copyright",void 0),t([l({json:{read:!1,write:!1}})],o.prototype,"wmtsInfo",void 0),o=t([i("esri.layers.OpenStreetMapLayer")],o);const y=o;export{y as default}; diff --git a/assets/OrientedImageryLayer.928bb67a.js b/assets/OrientedImageryLayer.adb44f0f.js similarity index 87% rename from assets/OrientedImageryLayer.928bb67a.js rename to assets/OrientedImageryLayer.adb44f0f.js index de92086..bd78990 100644 --- a/assets/OrientedImageryLayer.928bb67a.js +++ b/assets/OrientedImageryLayer.adb44f0f.js @@ -1 +1 @@ -import{a6 as o,a7 as t,a8 as a,hZ as p,n as i}from"./index.d94abe07.js";let e=class extends p{constructor(r){super(r),this.geometryType="point",this.type="oriented-imagery",this.operationalLayerType="OrientedImageryLayer"}_verifySource(){if(super._verifySource(),this.geometryType!=="point")throw new i("feature-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};o([t()],e.prototype,"cameraProperties",void 0),o([t()],e.prototype,"coverage",void 0),o([t()],e.prototype,"coveragePercent",void 0),o([t()],e.prototype,"defaultSearchLocation",void 0),o([t()],e.prototype,"depthImage",void 0),o([t()],e.prototype,"digitalElevationModel",void 0),o([t()],e.prototype,"geometryType",void 0),o([t()],e.prototype,"imageProperties",void 0),o([t()],e.prototype,"maximumDistance",void 0),o([t({json:{read:!1},value:"oriented-imagery",readOnly:!0})],e.prototype,"type",void 0),o([t({type:["OrientedImageryLayer"]})],e.prototype,"operationalLayerType",void 0),e=o([a("esri.layers.OrientedImageryLayer")],e);const d=e;export{d as default}; +import{a6 as o,a7 as t,a8 as a,hZ as p,n as i}from"./index.221827cd.js";let e=class extends p{constructor(r){super(r),this.geometryType="point",this.type="oriented-imagery",this.operationalLayerType="OrientedImageryLayer"}_verifySource(){if(super._verifySource(),this.geometryType!=="point")throw new i("feature-layer:invalid-geometry-type","OrientedImageryLayer only supports point geometry type")}};o([t()],e.prototype,"cameraProperties",void 0),o([t()],e.prototype,"coverage",void 0),o([t()],e.prototype,"coveragePercent",void 0),o([t()],e.prototype,"defaultSearchLocation",void 0),o([t()],e.prototype,"depthImage",void 0),o([t()],e.prototype,"digitalElevationModel",void 0),o([t()],e.prototype,"geometryType",void 0),o([t()],e.prototype,"imageProperties",void 0),o([t()],e.prototype,"maximumDistance",void 0),o([t({json:{read:!1},value:"oriented-imagery",readOnly:!0})],e.prototype,"type",void 0),o([t({type:["OrientedImageryLayer"]})],e.prototype,"operationalLayerType",void 0),e=o([a("esri.layers.OrientedImageryLayer")],e);const d=e;export{d as default}; diff --git a/assets/PBFDecoderWorker.4eacb33a.js b/assets/PBFDecoderWorker.47cbd979.js similarity index 98% rename from assets/PBFDecoderWorker.4eacb33a.js rename to assets/PBFDecoderWorker.47cbd979.js index 51faf81..f968953 100644 --- a/assets/PBFDecoderWorker.4eacb33a.js +++ b/assets/PBFDecoderWorker.47cbd979.js @@ -1 +1 @@ -import{dU as d,ay as c,gF as p,j as f,aT as y,gG as _,cf as m,c8 as g,gH as P,gI as C,gJ as b}from"./index.d94abe07.js";class G{constructor(t,e,s){this.uid=t,this.geometry=e,this.attributes=s,this.visible=!0,this.objectId=null,this.centroid=null}}class T{constructor(){this.exceededTransferLimit=!1,this.features=[],this.fields=[],this.hasM=!1,this.hasZ=!1,this.geometryType=null,this.objectIdFieldName=null,this.globalIdFieldName=null,this.geometryProperties=null,this.geohashFieldName=null,this.spatialReference=null,this.transform=null}}d();c();function v(i,t){return t}function h(i,t,e,s){switch(e){case 0:return a(i,t+s,0);case 1:return i.originPosition==="lowerLeft"?a(i,t+s,1):x(i,t+s,1)}}function u(i,t,e,s){return e===2?a(i,t,2):h(i,t,e,s)}function M(i,t,e,s){return e===2?a(i,t,3):h(i,t,e,s)}function R(i,t,e,s){return e===3?a(i,t,3):u(i,t,e,s)}function a({translate:i,scale:t},e,s){return i[s]+e*t[s]}function x({translate:i,scale:t},e,s){return i[s]-e*t[s]}class k{constructor(t){this._options=t,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=v,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return new T}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=p(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(!f(e))for(const s of t.features)e(s.geometry)}createSpatialReference(){return new y}addField(t,e){t.fields.push(_.fromJSON(e));const s=t.fields.map(r=>r.name);this._attributesConstructor=function(){for(const r of s)this[r]=null}}addFeature(t,e){const s=this._options.maxStringAttributeLength?this._options.maxStringAttributeLength:0;if(s>0)for(const r in e.attributes){const o=e.attributes[r];typeof o=="string"&&o.length>s&&(e.attributes[r]="")}t.features.push(e)}addQueryGeometry(t,e){const{queryGeometry:s,queryGeometryType:r}=e,o=m(s.clone(),s,!1,!1,this._transform),l=g(o,r,!1,!1);let n=null;switch(r){case"esriGeometryPoint":n="point";break;case"esriGeometryPolygon":n="polygon";break;case"esriGeometryPolyline":n="polyline";break;case"esriGeometryMultipoint":n="multipoint"}l.type=n,t.queryGeometryType=r,t.queryGeometry=l}prepareFeatures(t){switch(this._transform=t.transform,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&this._vertexDimension++,t.geometryType){case"point":this.addCoordinate=(e,s,r)=>this.addCoordinatePoint(e,s,r),this.createGeometry=e=>this.createPointGeometry(e);break;case"polygon":this.addCoordinate=(e,s,r)=>this._addCoordinatePolygon(e,s,r),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"polyline":this.addCoordinate=(e,s,r)=>this._addCoordinatePolyline(e,s,r),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"multipoint":this.addCoordinate=(e,s,r)=>this._addCoordinateMultipoint(e,s,r),this.createGeometry=e=>this._createMultipointGeometry(e);break;case"mesh":case"extent":break;default:P(t.geometryType)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,new G(C(),null,new this._attributesConstructor)}allocateCoordinates(){const t=this._lengths.reduce((e,s)=>e+s,0);this._coordinateBuffer=new Float64Array(t*this._vertexDimension),this._coordinateBufferPtr=0}addLength(t,e,s){this._lengths.length===0&&(this._toAddInCurrentPath=e),this._lengths.push(e)}createPointGeometry(t){const e={type:"point",x:0,y:0,spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM};return e.hasZ&&(e.z=0),e.hasM&&(e.m=0),e}addCoordinatePoint(t,e,s){switch(e=this._applyTransform(this._transform,e,s,0),s){case 0:t.x=e;break;case 1:t.y=e;break;case 2:t.hasZ?t.z=e:t.m=e;break;case 3:t.m=e}}_transformPathLikeValue(t,e){let s=0;return e<=1&&(s=this._previousCoordinate[e],this._previousCoordinate[e]+=t),this._applyTransform(this._transform,t,e,s)}_addCoordinatePolyline(t,e,s){this._dehydratedAddPointsCoordinate(t.paths,e,s)}_addCoordinatePolygon(t,e,s){this._dehydratedAddPointsCoordinate(t.rings,e,s)}_addCoordinateMultipoint(t,e,s){s===0&&t.points.push([]);const r=this._transformPathLikeValue(e,s);t.points[t.points.length-1].push(r)}_createPolygonGeometry(t){return{type:"polygon",rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{type:"polyline",paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{type:"multipoint",points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,s){s===0&&this._toAddInCurrentPath--==0&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const r=this._transformPathLikeValue(e,s),o=t[t.length-1];s===0&&o.push(new Float64Array(this._coordinateBuffer.buffer,this._coordinateBufferPtr*Float64Array.BYTES_PER_ELEMENT,this._vertexDimension)),this._coordinateBuffer[this._coordinateBufferPtr++]=r}_deriveApplyTransform(t){const{hasZ:e,hasM:s}=t;return e&&s?R:e?u:s?M:h}}class A{_parseFeatureQuery(t){const e=b(t.buffer,new k(t.options)),s={...e,spatialReference:e.spatialReference.toJSON(),fields:e.fields?e.fields.map(r=>r.toJSON()):void 0};return Promise.resolve(s)}}function Z(){return new A}export{Z as default}; +import{dU as d,ay as c,gF as p,j as f,aT as y,gG as _,cf as m,c8 as g,gH as P,gI as C,gJ as b}from"./index.221827cd.js";class G{constructor(t,e,s){this.uid=t,this.geometry=e,this.attributes=s,this.visible=!0,this.objectId=null,this.centroid=null}}class T{constructor(){this.exceededTransferLimit=!1,this.features=[],this.fields=[],this.hasM=!1,this.hasZ=!1,this.geometryType=null,this.objectIdFieldName=null,this.globalIdFieldName=null,this.geometryProperties=null,this.geohashFieldName=null,this.spatialReference=null,this.transform=null}}d();c();function v(i,t){return t}function h(i,t,e,s){switch(e){case 0:return a(i,t+s,0);case 1:return i.originPosition==="lowerLeft"?a(i,t+s,1):x(i,t+s,1)}}function u(i,t,e,s){return e===2?a(i,t,2):h(i,t,e,s)}function M(i,t,e,s){return e===2?a(i,t,3):h(i,t,e,s)}function R(i,t,e,s){return e===3?a(i,t,3):u(i,t,e,s)}function a({translate:i,scale:t},e,s){return i[s]+e*t[s]}function x({translate:i,scale:t},e,s){return i[s]-e*t[s]}class k{constructor(t){this._options=t,this.geometryTypes=["point","multipoint","polyline","polygon"],this._previousCoordinate=[0,0],this._transform=null,this._applyTransform=v,this._lengths=[],this._currentLengthIndex=0,this._toAddInCurrentPath=0,this._vertexDimension=0,this._coordinateBuffer=null,this._coordinateBufferPtr=0,this._attributesConstructor=class{}}createFeatureResult(){return new T}finishFeatureResult(t){if(this._options.applyTransform&&(t.transform=null),this._attributesConstructor=class{},this._coordinateBuffer=null,this._lengths.length=0,!t.hasZ)return;const e=p(t.geometryType,this._options.sourceSpatialReference,t.spatialReference);if(!f(e))for(const s of t.features)e(s.geometry)}createSpatialReference(){return new y}addField(t,e){t.fields.push(_.fromJSON(e));const s=t.fields.map(r=>r.name);this._attributesConstructor=function(){for(const r of s)this[r]=null}}addFeature(t,e){const s=this._options.maxStringAttributeLength?this._options.maxStringAttributeLength:0;if(s>0)for(const r in e.attributes){const o=e.attributes[r];typeof o=="string"&&o.length>s&&(e.attributes[r]="")}t.features.push(e)}addQueryGeometry(t,e){const{queryGeometry:s,queryGeometryType:r}=e,o=m(s.clone(),s,!1,!1,this._transform),l=g(o,r,!1,!1);let n=null;switch(r){case"esriGeometryPoint":n="point";break;case"esriGeometryPolygon":n="polygon";break;case"esriGeometryPolyline":n="polyline";break;case"esriGeometryMultipoint":n="multipoint"}l.type=n,t.queryGeometryType=r,t.queryGeometry=l}prepareFeatures(t){switch(this._transform=t.transform,this._options.applyTransform&&t.transform&&(this._applyTransform=this._deriveApplyTransform(t)),this._vertexDimension=2,t.hasZ&&this._vertexDimension++,t.hasM&&this._vertexDimension++,t.geometryType){case"point":this.addCoordinate=(e,s,r)=>this.addCoordinatePoint(e,s,r),this.createGeometry=e=>this.createPointGeometry(e);break;case"polygon":this.addCoordinate=(e,s,r)=>this._addCoordinatePolygon(e,s,r),this.createGeometry=e=>this._createPolygonGeometry(e);break;case"polyline":this.addCoordinate=(e,s,r)=>this._addCoordinatePolyline(e,s,r),this.createGeometry=e=>this._createPolylineGeometry(e);break;case"multipoint":this.addCoordinate=(e,s,r)=>this._addCoordinateMultipoint(e,s,r),this.createGeometry=e=>this._createMultipointGeometry(e);break;case"mesh":case"extent":break;default:P(t.geometryType)}}createFeature(){return this._lengths.length=0,this._currentLengthIndex=0,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0,new G(C(),null,new this._attributesConstructor)}allocateCoordinates(){const t=this._lengths.reduce((e,s)=>e+s,0);this._coordinateBuffer=new Float64Array(t*this._vertexDimension),this._coordinateBufferPtr=0}addLength(t,e,s){this._lengths.length===0&&(this._toAddInCurrentPath=e),this._lengths.push(e)}createPointGeometry(t){const e={type:"point",x:0,y:0,spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM};return e.hasZ&&(e.z=0),e.hasM&&(e.m=0),e}addCoordinatePoint(t,e,s){switch(e=this._applyTransform(this._transform,e,s,0),s){case 0:t.x=e;break;case 1:t.y=e;break;case 2:t.hasZ?t.z=e:t.m=e;break;case 3:t.m=e}}_transformPathLikeValue(t,e){let s=0;return e<=1&&(s=this._previousCoordinate[e],this._previousCoordinate[e]+=t),this._applyTransform(this._transform,t,e,s)}_addCoordinatePolyline(t,e,s){this._dehydratedAddPointsCoordinate(t.paths,e,s)}_addCoordinatePolygon(t,e,s){this._dehydratedAddPointsCoordinate(t.rings,e,s)}_addCoordinateMultipoint(t,e,s){s===0&&t.points.push([]);const r=this._transformPathLikeValue(e,s);t.points[t.points.length-1].push(r)}_createPolygonGeometry(t){return{type:"polygon",rings:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createPolylineGeometry(t){return{type:"polyline",paths:[[]],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_createMultipointGeometry(t){return{type:"multipoint",points:[],spatialReference:t.spatialReference,hasZ:!!t.hasZ,hasM:!!t.hasM}}_dehydratedAddPointsCoordinate(t,e,s){s===0&&this._toAddInCurrentPath--==0&&(t.push([]),this._toAddInCurrentPath=this._lengths[++this._currentLengthIndex]-1,this._previousCoordinate[0]=0,this._previousCoordinate[1]=0);const r=this._transformPathLikeValue(e,s),o=t[t.length-1];s===0&&o.push(new Float64Array(this._coordinateBuffer.buffer,this._coordinateBufferPtr*Float64Array.BYTES_PER_ELEMENT,this._vertexDimension)),this._coordinateBuffer[this._coordinateBufferPtr++]=r}_deriveApplyTransform(t){const{hasZ:e,hasM:s}=t;return e&&s?R:e?u:s?M:h}}class A{_parseFeatureQuery(t){const e=b(t.buffer,new k(t.options)),s={...e,spatialReference:e.spatialReference.toJSON(),fields:e.fields?e.fields.map(r=>r.toJSON()):void 0};return Promise.resolve(s)}}function Z(){return new A}export{Z as default}; diff --git a/assets/Pipeline.4cffa97b.js b/assets/Pipeline.e5f0f177.js similarity index 97% rename from assets/Pipeline.4cffa97b.js rename to assets/Pipeline.e5f0f177.js index 01b4824..feabcb9 100644 --- a/assets/Pipeline.4cffa97b.js +++ b/assets/Pipeline.e5f0f177.js @@ -1,4 +1,4 @@ -import{at as Pe,gK as Ft,n as ye,gL as Tt,eZ as Ae,j as C,c8 as Ee,aJ as P,c as y,cf as Ct,cN as Qe,A as Mt,s as he,m as E,gM as kt,u as oe,go as Be,cb as qt,gN as at,gO as At,W as Re,K as Et,d5 as de,c3 as le,d_ as Rt,ek as ge,gP as Ut,dd as Ot,gQ as $t,cB as Lt,E as Ce,v as B,bd as nt,x as me,U as Gt,a1 as Pt,_ as Me,gy as Qt,aH as ke,gR as ot,gS as ht,aK as Bt,z as qe,bf as Dt,ba as De,be as ut,gj as jt,cp as dt,aT as te,cm as Ue,gT as zt,f1 as ct,f0 as lt,bc as re,gU as ee,az as gt,cU as pt,ax as ft,gV as Nt,a6 as G,a7 as z,a8 as _t,dA as yt,ag as Vt,ci as Xt,ds as ue,gW as Yt,bK as Ht,cV as Zt,du as Jt,gX as Wt}from"./index.d94abe07.js";import{Y as je}from"./QueryEngine.5a5ece4a.js";import{r as Kt,c as mt,u as It,l as es}from"./FeatureStore2D.eebd57c6.js";import{s as vt}from"./quantizationUtils.0d428d19.js";import{q as ze}from"./ogcFeatureUtils.ed8217a8.js";import{b as Ne,c as Q,r as ts,v as ss}from"./ComputedAttributeStorage.c1cb22b3.js";import{s as pe}from"./CircularArray.a4d7e1c2.js";import{createConnection as rs}from"./createConnection.60903ce1.js";import{g as ne,f as bt}from"./projectionSupport.0542c13b.js";import{s as is,a as Ve}from"./visualVariablesUtils.32e27706.js";import{Q as j}from"./enums.0295eb81.js";import"./QueryEngineResult.7611d68a.js";import"./WhereClause.253310fe.js";import"./utils.8c53cad2.js";import"./generateRendererUtils.ebdde5b7.js";import"./utils.399e6089.js";import"./QueryEngineCapabilities.78217f95.js";import"./timeSupport.668a2439.js";import"./geojson.8a0cb9d1.js";import"./clientSideDefaults.f5f7bfa0.js";import"./centroid.cc817cc5.js";import"./Utils.7f6f3a6b.js";import"./enums.2d9e6f64.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./json.879c9adc.js";import"./visualVariablesUtils.aff73e6d.js";function as(a){return a==="heatmap"?Pe(()=>import("./HeatmapProcessor.5f3f2029.js"),["assets/HeatmapProcessor.5f3f2029.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/enums.0295eb81.js","assets/BaseProcessor.fe0bade4.js","assets/tileUtils.44921ab9.js"]):Pe(()=>import("./SymbolProcessor.179a3ae5.js"),["assets/SymbolProcessor.179a3ae5.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/ExpandedCIM.f0b7f36d.js","assets/BidiEngine.d8bba3fc.js","assets/enums.0295eb81.js","assets/MaterialKey.229b1dd6.js","assets/Utils.7f6f3a6b.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.0d428d19.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.df11258c.js","assets/visualVariablesUtils.32e27706.js","assets/visualVariablesUtils.aff73e6d.js","assets/Matcher.fe0c3dcf.js","assets/tileUtils.44921ab9.js","assets/TileClipper.8c399a8a.js","assets/Geometry.d049a63c.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/devEnvironmentUtils.d8d0484c.js","assets/BaseProcessor.fe0bade4.js"])}const ve=268435455;class ns{constructor(){this.fieldMap=new Map,this.fields=[],this.hasFeatures=!1,this.exceededTransferLimit=!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,s;return(s=(t=this.fieldMap.get(e))==null?void 0:t.isDate)!=null?s:!1}getFieldIndex(e){var t;return(t=this.fieldMap.get(e))==null?void 0:t.index}}function os(a){const s=a.asUnsafe(),r=s.getLength(),i=s.pos()+r,n={name:"",isDate:!1};for(;s.pos()0}class fe extends Ne{constructor(e,t,s,r){super(e,r),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.geometryType,this._reader=t,this._header=s,this._hasNext=s.hasFeatures,this._isPoints=r.geometryType==="esriGeometryPoint"}static fromBuffer(e,t,s=!1){const r=t.geometryType,i=cs(e),n=us(i,r==="esriGeometryPoint",s),o=Ne.createInstance();return new fe(o,i,n,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}hasField(e){return this._header.hasField(e)||this._header.hasField(Ze(e))}getFieldNames(){return this._header.fields.map(e=>e.fieldName)}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(){var e;if(this._cache.legacyFeature===void 0){const t=this.readCentroid(),s={attributes:this.readAttributes(),geometry:this._isPoints?this.readLegacyPointGeometry():this.readLegacyGeometry(),centroid:(e=t&&{x:t.coords[0],y:t.coords[1]})!=null?e:null};return this._cache.legacyFeature=s,s}return this._cache.legacyFeature}readOptimizedFeature(){if(this._cache.optFeature===void 0){const e=new Ae(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 C(t)?e:e*t.scale[0]+t.translate[0]}getYHydrated(){const e=this._header.centroid[2*this._featureIndex+1],t=this.getQuantizationTransform();return C(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 Ee(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(this._cache.unquantGeometry===void 0){const t=this.readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;const s=He(t.coords.length).decoded,r=t.clone(s),i=r.coords;let n=0;for(const o of r.lengths){for(let u=1;u{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),gs(s)}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex]+this._tx,t=this._header.centroid[2*this._featureIndex+1]+this._ty;return e===be?null:new P([],[e,t])}_parseGeometry(e){const r=e.asUnsafe(),i=r.getLength(),n=r.pos()+i,o=[],u=[];for(;r.pos()d.length)for(let _=0;_=_?(l+=-.5*(w-I)*(T+x),m>1&&xe(d[c-2],d[c-1],F,S)?(d[c-2]+=F,d[c-1]+=S):(d[c++]=F,d[c++]=S,m++),I=w,x=T):(k+=F,q+=S),F=k,S=q,v++}m<3||b?c-=2*m:(l+=-.5*(I+F-I)*(x+S+x),xe(d[c-2],d[c-1],F,S)?(d[c-2]+=F,d[c-1]+=S,u.push(m)):(d[c++]=F,d[c++]=S,u.push(++m)))}else{let _=0,v=r.getSInt32(),m=r.getSInt32();this.hasZ&&r.getSInt32(),this.hasM&&r.getSInt32(),d[c++]=v,d[c++]=m,_+=1;for(let b=1;b2&&xe(d[c-2],d[c-1],I,x)?(d[c-2]+=I,d[c-1]+=x):(d[c++]=I,d[c++]=x,_+=1),v=F,m=S}u.push(_)}break}default:r.skip()}if(this._cache.area=l,!u.length)return null;if(this._tx||this._ty){let p=0;Qe(d);for(const f of u)d[2*p]+=this._tx,d[2*p+1]+=this._ty,p+=f}return new P(u,d)}}class Ie{constructor(e){this.service=e}destroy(){}}function fs(a){return Array.isArray(a.source)}function _s(a){return(a==null?void 0:a.type)==="ogc-source"}function ys(a){const{capabilities:e}=a;return _s(a.source)?new xs(a):fs(a)?new Is(a):e.query.supportsFormatPBF&&E("featurelayer-pbf")?new vs(a):new bs(a)}async function ms(a){const e=new At;return await e.open(a,{}),e}class Is extends Ie{constructor(e){super(e),this._portsOpen=ms(e.source).then(t=>this.client=t)}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 Q.fromFeatureSet(s,this.service)}}class vs extends Ie{async executeQuery(e,t){const{data:s}=await kt(this.service.source,e,t),r=!e.quantizationParameters;return fe.fromBuffer(s,this.service,r)}}class bs extends Ie{async executeQuery(e,t){var h;const{source:s,capabilities:r,spatialReference:i,objectIdField:n,geometryType:o}=this.service;if(y(e.quantizationParameters)&&!r.query.supportsQuantization){const c=e.clone(),d=vt(oe(c.quantizationParameters));c.quantizationParameters=null;const{data:l}=await Be(s,c,i,t),g=qt(l,n);return at(d,g),Q.fromOptimizedFeatureSet(g,this.service)}const{data:u}=await Be(s,e,this.service.spatialReference,t);return o==="esriGeometryPoint"&&(u.features=(h=u.features)==null?void 0:h.filter(c=>{if(y(c.geometry)){const d=c.geometry;return Number.isFinite(d.x)&&Number.isFinite(d.y)}return!0})),Q.fromFeatureSet(u,this.service)}}class xs extends Ie{async executeQuery(e,t){const{capabilities:s}=this.service;if(e.quantizationParameters&&!s.query.supportsQuantization){const i=e.clone(),n=vt(oe(i.quantizationParameters));i.quantizationParameters=null;const o=await ze(this.service.source,e,t);return at(n,o),Q.fromOptimizedFeatureSet(o,this.service)}const r=await ze(this.service.source,e,t);return Q.fromOptimizedFeatureSet(r,this.service)}}class R{constructor(){this.version=0,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 R;for(const s in e){const r=e[s];if(typeof r=="object")for(const i in r){const n=r[i];t[s][i]=n}t[s]=r}return t}static empty(){return R.create({})}static all(){return R.create({source:!0,targets:{feature:!0,aggregate:!0},storage:{filters:!0,data:!0},mesh:!0})}unset(e){this.version=e.version,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 +import{at as Pe,gK as Ft,n as ye,gL as Tt,eZ as Ae,j as C,c8 as Ee,aJ as P,c as y,cf as Ct,cN as Qe,A as Mt,s as he,m as E,gM as kt,u as oe,go as Be,cb as qt,gN as at,gO as At,W as Re,K as Et,d5 as de,c3 as le,d_ as Rt,ek as ge,gP as Ut,dd as Ot,gQ as $t,cB as Lt,E as Ce,v as B,bd as nt,x as me,U as Gt,a1 as Pt,_ as Me,gy as Qt,aH as ke,gR as ot,gS as ht,aK as Bt,z as qe,bf as Dt,ba as De,be as ut,gj as jt,cp as dt,aT as te,cm as Ue,gT as zt,f1 as ct,f0 as lt,bc as re,gU as ee,az as gt,cU as pt,ax as ft,gV as Nt,a6 as G,a7 as z,a8 as _t,dA as yt,ag as Vt,ci as Xt,ds as ue,gW as Yt,bK as Ht,cV as Zt,du as Jt,gX as Wt}from"./index.221827cd.js";import{Y as je}from"./QueryEngine.ac81c46d.js";import{r as Kt,c as mt,u as It,l as es}from"./FeatureStore2D.3fea35f0.js";import{s as vt}from"./quantizationUtils.7ff797cc.js";import{q as ze}from"./ogcFeatureUtils.61a937b0.js";import{b as Ne,c as Q,r as ts,v as ss}from"./ComputedAttributeStorage.29767acd.js";import{s as pe}from"./CircularArray.62f75f43.js";import{createConnection as rs}from"./createConnection.0e3796d4.js";import{g as ne,f as bt}from"./projectionSupport.4f5da4af.js";import{s as is,a as Ve}from"./visualVariablesUtils.061b7a4e.js";import{Q as j}from"./enums.0295eb81.js";import"./QueryEngineResult.2fc58178.js";import"./WhereClause.5b749615.js";import"./utils.83e0b804.js";import"./generateRendererUtils.5c972fdb.js";import"./utils.e42485ea.js";import"./QueryEngineCapabilities.78217f95.js";import"./timeSupport.968e62fc.js";import"./geojson.7d18026b.js";import"./clientSideDefaults.d40b9315.js";import"./centroid.06db4b74.js";import"./Utils.2136650a.js";import"./enums.2d9e6f64.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./json.879c9adc.js";import"./visualVariablesUtils.62efda9d.js";function as(a){return a==="heatmap"?Pe(()=>import("./HeatmapProcessor.ceb8669d.js"),["assets/HeatmapProcessor.ceb8669d.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/enums.0295eb81.js","assets/BaseProcessor.f4010bc0.js","assets/tileUtils.332711ed.js"]):Pe(()=>import("./SymbolProcessor.1465a4e3.js"),["assets/SymbolProcessor.1465a4e3.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/ExpandedCIM.a372ce74.js","assets/BidiEngine.d8bba3fc.js","assets/enums.0295eb81.js","assets/MaterialKey.0cadabc1.js","assets/Utils.2136650a.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.7ff797cc.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.3f71f8e9.js","assets/visualVariablesUtils.061b7a4e.js","assets/visualVariablesUtils.62efda9d.js","assets/Matcher.6586928a.js","assets/tileUtils.332711ed.js","assets/TileClipper.77103a2e.js","assets/Geometry.d049a63c.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/devEnvironmentUtils.d8d0484c.js","assets/BaseProcessor.f4010bc0.js"])}const ve=268435455;class ns{constructor(){this.fieldMap=new Map,this.fields=[],this.hasFeatures=!1,this.exceededTransferLimit=!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,s;return(s=(t=this.fieldMap.get(e))==null?void 0:t.isDate)!=null?s:!1}getFieldIndex(e){var t;return(t=this.fieldMap.get(e))==null?void 0:t.index}}function os(a){const s=a.asUnsafe(),r=s.getLength(),i=s.pos()+r,n={name:"",isDate:!1};for(;s.pos()0}class fe extends Ne{constructor(e,t,s,r){super(e,r),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.geometryType,this._reader=t,this._header=s,this._hasNext=s.hasFeatures,this._isPoints=r.geometryType==="esriGeometryPoint"}static fromBuffer(e,t,s=!1){const r=t.geometryType,i=cs(e),n=us(i,r==="esriGeometryPoint",s),o=Ne.createInstance();return new fe(o,i,n,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}hasField(e){return this._header.hasField(e)||this._header.hasField(Ze(e))}getFieldNames(){return this._header.fields.map(e=>e.fieldName)}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(){var e;if(this._cache.legacyFeature===void 0){const t=this.readCentroid(),s={attributes:this.readAttributes(),geometry:this._isPoints?this.readLegacyPointGeometry():this.readLegacyGeometry(),centroid:(e=t&&{x:t.coords[0],y:t.coords[1]})!=null?e:null};return this._cache.legacyFeature=s,s}return this._cache.legacyFeature}readOptimizedFeature(){if(this._cache.optFeature===void 0){const e=new Ae(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 C(t)?e:e*t.scale[0]+t.translate[0]}getYHydrated(){const e=this._header.centroid[2*this._featureIndex+1],t=this.getQuantizationTransform();return C(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 Ee(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(this._cache.unquantGeometry===void 0){const t=this.readGeometry(e);if(!t)return this._cache.unquantGeometry=void 0,null;const s=He(t.coords.length).decoded,r=t.clone(s),i=r.coords;let n=0;for(const o of r.lengths){for(let u=1;u{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),gs(s)}_readServerCentroid(){const e=this._header.centroid[2*this._featureIndex]+this._tx,t=this._header.centroid[2*this._featureIndex+1]+this._ty;return e===be?null:new P([],[e,t])}_parseGeometry(e){const r=e.asUnsafe(),i=r.getLength(),n=r.pos()+i,o=[],u=[];for(;r.pos()d.length)for(let _=0;_=_?(l+=-.5*(w-I)*(T+x),m>1&&xe(d[c-2],d[c-1],F,S)?(d[c-2]+=F,d[c-1]+=S):(d[c++]=F,d[c++]=S,m++),I=w,x=T):(k+=F,q+=S),F=k,S=q,v++}m<3||b?c-=2*m:(l+=-.5*(I+F-I)*(x+S+x),xe(d[c-2],d[c-1],F,S)?(d[c-2]+=F,d[c-1]+=S,u.push(m)):(d[c++]=F,d[c++]=S,u.push(++m)))}else{let _=0,v=r.getSInt32(),m=r.getSInt32();this.hasZ&&r.getSInt32(),this.hasM&&r.getSInt32(),d[c++]=v,d[c++]=m,_+=1;for(let b=1;b2&&xe(d[c-2],d[c-1],I,x)?(d[c-2]+=I,d[c-1]+=x):(d[c++]=I,d[c++]=x,_+=1),v=F,m=S}u.push(_)}break}default:r.skip()}if(this._cache.area=l,!u.length)return null;if(this._tx||this._ty){let p=0;Qe(d);for(const f of u)d[2*p]+=this._tx,d[2*p+1]+=this._ty,p+=f}return new P(u,d)}}class Ie{constructor(e){this.service=e}destroy(){}}function fs(a){return Array.isArray(a.source)}function _s(a){return(a==null?void 0:a.type)==="ogc-source"}function ys(a){const{capabilities:e}=a;return _s(a.source)?new xs(a):fs(a)?new Is(a):e.query.supportsFormatPBF&&E("featurelayer-pbf")?new vs(a):new bs(a)}async function ms(a){const e=new At;return await e.open(a,{}),e}class Is extends Ie{constructor(e){super(e),this._portsOpen=ms(e.source).then(t=>this.client=t)}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 Q.fromFeatureSet(s,this.service)}}class vs extends Ie{async executeQuery(e,t){const{data:s}=await kt(this.service.source,e,t),r=!e.quantizationParameters;return fe.fromBuffer(s,this.service,r)}}class bs extends Ie{async executeQuery(e,t){var h;const{source:s,capabilities:r,spatialReference:i,objectIdField:n,geometryType:o}=this.service;if(y(e.quantizationParameters)&&!r.query.supportsQuantization){const c=e.clone(),d=vt(oe(c.quantizationParameters));c.quantizationParameters=null;const{data:l}=await Be(s,c,i,t),g=qt(l,n);return at(d,g),Q.fromOptimizedFeatureSet(g,this.service)}const{data:u}=await Be(s,e,this.service.spatialReference,t);return o==="esriGeometryPoint"&&(u.features=(h=u.features)==null?void 0:h.filter(c=>{if(y(c.geometry)){const d=c.geometry;return Number.isFinite(d.x)&&Number.isFinite(d.y)}return!0})),Q.fromFeatureSet(u,this.service)}}class xs extends Ie{async executeQuery(e,t){const{capabilities:s}=this.service;if(e.quantizationParameters&&!s.query.supportsQuantization){const i=e.clone(),n=vt(oe(i.quantizationParameters));i.quantizationParameters=null;const o=await ze(this.service.source,e,t);return at(n,o),Q.fromOptimizedFeatureSet(o,this.service)}const r=await ze(this.service.source,e,t);return Q.fromOptimizedFeatureSet(r,this.service)}}class R{constructor(){this.version=0,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 R;for(const s in e){const r=e[s];if(typeof r=="object")for(const i in r){const n=r[i];t[s][i]=n}t[s]=r}return t}static empty(){return R.create({})}static all(){return R.create({source:!0,targets:{feature:!0,aggregate:!0},storage:{filters:!0,data:!0},mesh:!0})}unset(e){this.version=e.version,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 `;for(const r of this.why.mesh)t+=` + ${r} `}if(this.source){e+=10,t+=`-> (10) The source needs update `;for(const r of this.why.source)t+=` + ${r} diff --git a/assets/PointCloudLayer.9b3b72ab.js b/assets/PointCloudLayer.454ff7a9.js similarity index 97% rename from assets/PointCloudLayer.9b3b72ab.js rename to assets/PointCloudLayer.454ff7a9.js index 966a1c5..35f5794 100644 --- a/assets/PointCloudLayer.9b3b72ab.js +++ b/assets/PointCloudLayer.454ff7a9.js @@ -1,4 +1,4 @@ -import{a6 as r,a7 as i,a8 as y,cx as q,h0 as S,ei as g,b4 as u,eE as B,eF as E,eG as N,i3 as _,eH as L,il as V,gG as w,hV as A,c as O,aU as G,id as k,jE as C,n as l,eP as D,U as K,s as F,ig as M,dv as U,d2 as z,io as H,iE as J,e0 as Q,ih as W,cF as X}from"./index.d94abe07.js";import{N as Y,L as T}from"./SceneService.0f3bf01a.js";import{c as j,d as Z,b as ee,a as te}from"./PointCloudUniqueValueRenderer.345f2613.js";import"./originUtils.2d0aad75.js";import"./multiOriginJSONSupportUtils.38b69b9c.js";import"./resourceUtils.6d10bf82.js";let f=class extends q{constructor(e){super(e),this.field=null,this.type=null}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}};r([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"field",void 0),r([i({readOnly:!0,nonNullable:!0,json:{read:!1}})],f.prototype,"type",void 0),f=r([y("esri.layers.pointCloudFilters.PointCloudFilter")],f);const m=f;var b;let d=b=class extends m{constructor(e){super(e),this.requiredClearBits=null,this.requiredSetBits=null,this.type="bitfield"}clone(){return new b({field:this.field,requiredClearBits:u(this.requiredClearBits),requiredSetBits:u(this.requiredSetBits)})}};r([i({type:[S],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredSetBits}}}}})],d.prototype,"requiredClearBits",void 0),r([i({type:[S],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredClearBits}}}}})],d.prototype,"requiredSetBits",void 0),r([g({pointCloudBitfieldFilter:"bitfield"})],d.prototype,"type",void 0),d=b=r([y("esri.layers.pointCloudFilters.PointCloudBitfieldFilter")],d);const re=d;var I;let h=I=class extends m{constructor(e){super(e),this.includedReturns=[],this.type="return"}clone(){return new I({field:this.field,includedReturns:u(this.includedReturns)})}};r([i({type:[["firstOfMany","last","lastOfMany","single"]],json:{write:{enabled:!0,isRequired:!0}}})],h.prototype,"includedReturns",void 0),r([g({pointCloudReturnFilter:"return"})],h.prototype,"type",void 0),h=I=r([y("esri.layers.pointCloudFilters.PointCloudReturnFilter")],h);const ie=h;var x;let p=x=class extends m{constructor(e){super(e),this.mode="exclude",this.type="value",this.values=[]}clone(){return new x({field:this.field,mode:this.mode,values:u(this.values)})}};r([i({type:["exclude","include"],json:{write:{enabled:!0,isRequired:!0}}})],p.prototype,"mode",void 0),r([g({pointCloudValueFilter:"value"})],p.prototype,"type",void 0),r([i({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],p.prototype,"values",void 0),p=x=r([y("esri.layers.pointCloudFilters.PointCloudValueFilter")],p);const oe=p,se={key:"type",base:m,typeMap:{value:oe,bitfield:re,return:ie}};var $;let v=$=class extends j{constructor(e){super(e),this.type="point-cloud-rgb",this.field=null}clone(){return new $({...this.cloneProperties(),field:u(this.field)})}};r([g({pointCloudRGBRenderer:"point-cloud-rgb"})],v.prototype,"type",void 0),r([i({type:String,json:{write:!0}})],v.prototype,"field",void 0),v=$=r([y("esri.renderers.PointCloudRGBRenderer")],v);const ne=v,P={key:"type",base:j,typeMap:{"point-cloud-class-breaks":Z,"point-cloud-rgb":ne,"point-cloud-stretch":ee,"point-cloud-unique-value":te},errorContext:"renderer"},R=W();let o=class extends Y(B(E(N(_(L(V(X))))))){constructor(...e){super(...e),this.operationalLayerType="PointCloudLayer",this.popupEnabled=!0,this.popupTemplate=null,this.opacity=1,this.filters=[],this.fields=null,this.fieldsIndex=null,this.outFields=null,this.path=null,this.legendEnabled=!0,this.renderer=null,this.type="point-cloud"}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}get defaultPopupTemplate(){return this.attributeStorageInfo?this.createPopupTemplate():null}getFieldDomain(e){const t=this.fieldsIndex.get(e);return t&&t.domain?t.domain:null}readServiceFields(e,t,n){return Array.isArray(e)?e.map(s=>{const a=new w;return s.type==="FieldTypeInteger"&&((s=u(s)).type="esriFieldTypeInteger"),a.read(s,n),a}):Array.isArray(t.attributeStorageInfo)?t.attributeStorageInfo.map(s=>new w({name:s.name,type:s.name==="ELEVATION"?"double":"integer"})):null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}writeRenderer(e,t,n,s){A("layerDefinition.drawingInfo.renderer",e.write({},s),t)}load(e){const t=O(e)?e.signal:null,n=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(G).then(()=>this._fetchService(t));return this.addResolvingPromise(n),Promise.resolve(this)}createPopupTemplate(e){const t=k(this,e);return t&&(this._formatPopupTemplateReturnsField(t),this._formatPopupTemplateRGBField(t)),t}_formatPopupTemplateReturnsField(e){var a;const t=this.fieldsIndex.get("RETURNS");if(!t)return;const n=(a=e.fieldInfos)==null?void 0:a.find(c=>c.fieldName===t.name);if(!n)return;const s=new C({name:"pcl-returns-decoded",title:t.alias||t.name,expression:` +import{a6 as r,a7 as i,a8 as y,cx as q,h0 as S,ei as g,b4 as u,eE as B,eF as E,eG as N,i3 as _,eH as L,il as V,gG as w,hV as A,c as O,aU as G,id as k,jE as C,n as l,eP as D,U as K,s as F,ig as M,dv as U,d2 as z,io as H,iE as J,e0 as Q,ih as W,cF as X}from"./index.221827cd.js";import{N as Y,L as T}from"./SceneService.9c2e5b40.js";import{c as j,d as Z,b as ee,a as te}from"./PointCloudUniqueValueRenderer.32cfad84.js";import"./originUtils.2d0aad75.js";import"./multiOriginJSONSupportUtils.38b69b9c.js";import"./resourceUtils.f4b6e42a.js";let f=class extends q{constructor(e){super(e),this.field=null,this.type=null}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}};r([i({type:String,json:{write:{enabled:!0,isRequired:!0}}})],f.prototype,"field",void 0),r([i({readOnly:!0,nonNullable:!0,json:{read:!1}})],f.prototype,"type",void 0),f=r([y("esri.layers.pointCloudFilters.PointCloudFilter")],f);const m=f;var b;let d=b=class extends m{constructor(e){super(e),this.requiredClearBits=null,this.requiredSetBits=null,this.type="bitfield"}clone(){return new b({field:this.field,requiredClearBits:u(this.requiredClearBits),requiredSetBits:u(this.requiredSetBits)})}};r([i({type:[S],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredSetBits}}}}})],d.prototype,"requiredClearBits",void 0),r([i({type:[S],json:{write:{enabled:!0,overridePolicy(){return{enabled:!0,isRequired:!this.requiredClearBits}}}}})],d.prototype,"requiredSetBits",void 0),r([g({pointCloudBitfieldFilter:"bitfield"})],d.prototype,"type",void 0),d=b=r([y("esri.layers.pointCloudFilters.PointCloudBitfieldFilter")],d);const re=d;var I;let h=I=class extends m{constructor(e){super(e),this.includedReturns=[],this.type="return"}clone(){return new I({field:this.field,includedReturns:u(this.includedReturns)})}};r([i({type:[["firstOfMany","last","lastOfMany","single"]],json:{write:{enabled:!0,isRequired:!0}}})],h.prototype,"includedReturns",void 0),r([g({pointCloudReturnFilter:"return"})],h.prototype,"type",void 0),h=I=r([y("esri.layers.pointCloudFilters.PointCloudReturnFilter")],h);const ie=h;var x;let p=x=class extends m{constructor(e){super(e),this.mode="exclude",this.type="value",this.values=[]}clone(){return new x({field:this.field,mode:this.mode,values:u(this.values)})}};r([i({type:["exclude","include"],json:{write:{enabled:!0,isRequired:!0}}})],p.prototype,"mode",void 0),r([g({pointCloudValueFilter:"value"})],p.prototype,"type",void 0),r([i({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],p.prototype,"values",void 0),p=x=r([y("esri.layers.pointCloudFilters.PointCloudValueFilter")],p);const oe=p,se={key:"type",base:m,typeMap:{value:oe,bitfield:re,return:ie}};var $;let v=$=class extends j{constructor(e){super(e),this.type="point-cloud-rgb",this.field=null}clone(){return new $({...this.cloneProperties(),field:u(this.field)})}};r([g({pointCloudRGBRenderer:"point-cloud-rgb"})],v.prototype,"type",void 0),r([i({type:String,json:{write:!0}})],v.prototype,"field",void 0),v=$=r([y("esri.renderers.PointCloudRGBRenderer")],v);const ne=v,P={key:"type",base:j,typeMap:{"point-cloud-class-breaks":Z,"point-cloud-rgb":ne,"point-cloud-stretch":ee,"point-cloud-unique-value":te},errorContext:"renderer"},R=W();let o=class extends Y(B(E(N(_(L(V(X))))))){constructor(...e){super(...e),this.operationalLayerType="PointCloudLayer",this.popupEnabled=!0,this.popupTemplate=null,this.opacity=1,this.filters=[],this.fields=null,this.fieldsIndex=null,this.outFields=null,this.path=null,this.legendEnabled=!0,this.renderer=null,this.type="point-cloud"}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}get defaultPopupTemplate(){return this.attributeStorageInfo?this.createPopupTemplate():null}getFieldDomain(e){const t=this.fieldsIndex.get(e);return t&&t.domain?t.domain:null}readServiceFields(e,t,n){return Array.isArray(e)?e.map(s=>{const a=new w;return s.type==="FieldTypeInteger"&&((s=u(s)).type="esriFieldTypeInteger"),a.read(s,n),a}):Array.isArray(t.attributeStorageInfo)?t.attributeStorageInfo.map(s=>new w({name:s.name,type:s.name==="ELEVATION"?"double":"integer"})):null}set elevationInfo(e){this._set("elevationInfo",e),this._validateElevationInfo()}writeRenderer(e,t,n,s){A("layerDefinition.drawingInfo.renderer",e.write({},s),t)}load(e){const t=O(e)?e.signal:null,n=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(G).then(()=>this._fetchService(t));return this.addResolvingPromise(n),Promise.resolve(this)}createPopupTemplate(e){const t=k(this,e);return t&&(this._formatPopupTemplateReturnsField(t),this._formatPopupTemplateRGBField(t)),t}_formatPopupTemplateReturnsField(e){var a;const t=this.fieldsIndex.get("RETURNS");if(!t)return;const n=(a=e.fieldInfos)==null?void 0:a.find(c=>c.fieldName===t.name);if(!n)return;const s=new C({name:"pcl-returns-decoded",title:t.alias||t.name,expression:` var returnValue = $feature.${t.name}; return (returnValue % 16) + " / " + Floor(returnValue / 16); `});e.expressionInfos=[...e.expressionInfos||[],s],n.fieldName="expression/pcl-returns-decoded"}_formatPopupTemplateRGBField(e){var a;const t=this.fieldsIndex.get("RGB");if(!t)return;const n=(a=e.fieldInfos)==null?void 0:a.find(c=>c.fieldName===t.name);if(!n)return;const s=new C({name:"pcl-rgb-decoded",title:t.alias||t.name,expression:` diff --git a/assets/PointCloudUniqueValueRenderer.345f2613.js b/assets/PointCloudUniqueValueRenderer.32cfad84.js similarity index 99% rename from assets/PointCloudUniqueValueRenderer.345f2613.js rename to assets/PointCloudUniqueValueRenderer.32cfad84.js index 621eaac..1ac4b57 100644 --- a/assets/PointCloudUniqueValueRenderer.345f2613.js +++ b/assets/PointCloudUniqueValueRenderer.32cfad84.js @@ -1 +1 @@ -import{a6 as e,a7 as t,a8 as r,cx as f,ct as P,ei as m,ef as O,b4 as o,b9 as I,h0 as N,h1 as z,h2 as D}from"./index.d94abe07.js";var w;let c=w=class extends f{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new w({field:this.field,minValue:this.minValue,maxValue:this.maxValue})}};e([t({type:String,json:{write:!0}})],c.prototype,"field",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"minValue",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"maxValue",void 0),c=w=e([r("esri.renderers.support.pointCloud.ColorModulation")],c);const K=c,v=new P({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let b=class extends f{};e([t({type:v.apiValues,readOnly:!0,nonNullable:!0,json:{type:v.jsonValues,read:!1,write:v.write}})],b.prototype,"type",void 0),b=e([r("esri.renderers.support.pointCloud.PointSizeAlgorithm")],b);const R=b;var g;let y=g=class extends R{constructor(){super(...arguments),this.type="fixed-size",this.size=0,this.useRealWorldSymbolSizes=null}clone(){return new g({size:this.size,useRealWorldSymbolSizes:this.useRealWorldSymbolSizes})}};e([m({pointCloudFixedSizeAlgorithm:"fixed-size"})],y.prototype,"type",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],y.prototype,"size",void 0),e([t({type:Boolean,json:{write:!0}})],y.prototype,"useRealWorldSymbolSizes",void 0),y=g=e([r("esri.renderers.support.pointCloud.PointSizeFixedSizeAlgorithm")],y);const k=y;var V;let h=V=class extends R{constructor(){super(...arguments),this.type="splat",this.scaleFactor=1}clone(){return new V({scaleFactor:this.scaleFactor})}};e([m({pointCloudSplatAlgorithm:"splat"})],h.prototype,"type",void 0),e([t({type:Number,value:1,nonNullable:!0,json:{write:!0}})],h.prototype,"scaleFactor",void 0),h=V=e([r("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],h);const B=h,q={key:"type",base:R,typeMap:{"fixed-size":k,splat:B}},T=O()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let l=class extends f{constructor(s){super(s),this.type=void 0,this.pointSizeAlgorithm=null,this.colorModulation=null,this.pointsPerInch=10}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}cloneProperties(){return{pointSizeAlgorithm:o(this.pointSizeAlgorithm),colorModulation:o(this.colorModulation),pointsPerInch:o(this.pointsPerInch)}}};e([t({type:T.apiValues,readOnly:!0,nonNullable:!0,json:{type:T.jsonValues,read:!1,write:T.write}})],l.prototype,"type",void 0),e([t({types:q,json:{write:!0}})],l.prototype,"pointSizeAlgorithm",void 0),e([t({type:K,json:{write:!0}})],l.prototype,"colorModulation",void 0),e([t({json:{write:!0},nonNullable:!0,type:Number})],l.prototype,"pointsPerInch",void 0),l=e([r("esri.renderers.PointCloudRenderer")],l),function(s){s.fieldTransformTypeKebabDict=new P({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"})}(l||(l={}));const i=l;var j;let n=j=class extends f{constructor(){super(...arguments),this.description=null,this.label=null,this.minValue=0,this.maxValue=0,this.color=null}clone(){return new j({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,color:o(this.color)})}};e([t({type:String,json:{write:!0}})],n.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"label",void 0),e([t({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],n.prototype,"minValue",void 0),e([t({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],n.prototype,"maxValue",void 0),e([t({type:I,json:{type:[N],write:!0}})],n.prototype,"color",void 0),n=j=e([r("esri.renderers.support.pointCloud.ColorClassBreakInfo")],n);const A=n;var C;let p=C=class extends i{constructor(s){super(s),this.type="point-cloud-class-breaks",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.colorClassBreakInfos=null}clone(){return new C({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:o(this.colorClassBreakInfos),legendOptions:o(this.legendOptions)})}};e([m({pointCloudClassBreaksRenderer:"point-cloud-class-breaks"})],p.prototype,"type",void 0),e([t({json:{write:!0},type:String})],p.prototype,"field",void 0),e([t({type:z,json:{write:!0}})],p.prototype,"legendOptions",void 0),e([t({type:i.fieldTransformTypeKebabDict.apiValues,json:{type:i.fieldTransformTypeKebabDict.jsonValues,read:i.fieldTransformTypeKebabDict.read,write:i.fieldTransformTypeKebabDict.write}})],p.prototype,"fieldTransformType",void 0),e([t({type:[A],json:{write:!0}})],p.prototype,"colorClassBreakInfos",void 0),p=C=e([r("esri.renderers.PointCloudClassBreaksRenderer")],p);const U=p;var S;let a=S=class extends i{constructor(s){super(s),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new S({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),stops:o(this.stops),legendOptions:o(this.legendOptions)})}};e([m({pointCloudStretchRenderer:"point-cloud-stretch"})],a.prototype,"type",void 0),e([t({json:{write:!0},type:String})],a.prototype,"field",void 0),e([t({type:z,json:{write:!0}})],a.prototype,"legendOptions",void 0),e([t({type:i.fieldTransformTypeKebabDict.apiValues,json:{type:i.fieldTransformTypeKebabDict.jsonValues,read:i.fieldTransformTypeKebabDict.read,write:i.fieldTransformTypeKebabDict.write}})],a.prototype,"fieldTransformType",void 0),e([t({type:[D],json:{write:!0}})],a.prototype,"stops",void 0),a=S=e([r("esri.renderers.PointCloudStretchRenderer")],a);const W=a;var x;let u=x=class extends f{constructor(){super(...arguments),this.description=null,this.label=null,this.values=null,this.color=null}clone(){return new x({description:this.description,label:this.label,values:o(this.values),color:o(this.color)})}};e([t({type:String,json:{write:!0}})],u.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],u.prototype,"label",void 0),e([t({type:[String],json:{write:!0}})],u.prototype,"values",void 0),e([t({type:I,json:{type:[N],write:!0}})],u.prototype,"color",void 0),u=x=e([r("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],u);const M=u;var $;let d=$=class extends i{constructor(s){super(s),this.type="point-cloud-unique-value",this.field=null,this.fieldTransformType=null,this.colorUniqueValueInfos=null,this.legendOptions=null}clone(){return new $({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),colorUniqueValueInfos:o(this.colorUniqueValueInfos),legendOptions:o(this.legendOptions)})}};e([m({pointCloudUniqueValueRenderer:"point-cloud-unique-value"})],d.prototype,"type",void 0),e([t({json:{write:!0},type:String})],d.prototype,"field",void 0),e([t({type:i.fieldTransformTypeKebabDict.apiValues,json:{type:i.fieldTransformTypeKebabDict.jsonValues,read:i.fieldTransformTypeKebabDict.read,write:i.fieldTransformTypeKebabDict.write}})],d.prototype,"fieldTransformType",void 0),e([t({type:[M],json:{write:!0}})],d.prototype,"colorUniqueValueInfos",void 0),e([t({type:z,json:{write:!0}})],d.prototype,"legendOptions",void 0),d=$=e([r("esri.renderers.PointCloudUniqueValueRenderer")],d);const G=d;export{G as a,W as b,i as c,U as d}; +import{a6 as e,a7 as t,a8 as r,cx as f,ct as P,ei as m,ef as O,b4 as o,b9 as I,h0 as N,h1 as z,h2 as D}from"./index.221827cd.js";var w;let c=w=class extends f{constructor(){super(...arguments),this.field=null,this.minValue=0,this.maxValue=255}clone(){return new w({field:this.field,minValue:this.minValue,maxValue:this.maxValue})}};e([t({type:String,json:{write:!0}})],c.prototype,"field",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"minValue",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],c.prototype,"maxValue",void 0),c=w=e([r("esri.renderers.support.pointCloud.ColorModulation")],c);const K=c,v=new P({pointCloudFixedSizeAlgorithm:"fixed-size",pointCloudSplatAlgorithm:"splat"});let b=class extends f{};e([t({type:v.apiValues,readOnly:!0,nonNullable:!0,json:{type:v.jsonValues,read:!1,write:v.write}})],b.prototype,"type",void 0),b=e([r("esri.renderers.support.pointCloud.PointSizeAlgorithm")],b);const R=b;var g;let y=g=class extends R{constructor(){super(...arguments),this.type="fixed-size",this.size=0,this.useRealWorldSymbolSizes=null}clone(){return new g({size:this.size,useRealWorldSymbolSizes:this.useRealWorldSymbolSizes})}};e([m({pointCloudFixedSizeAlgorithm:"fixed-size"})],y.prototype,"type",void 0),e([t({type:Number,nonNullable:!0,json:{write:!0}})],y.prototype,"size",void 0),e([t({type:Boolean,json:{write:!0}})],y.prototype,"useRealWorldSymbolSizes",void 0),y=g=e([r("esri.renderers.support.pointCloud.PointSizeFixedSizeAlgorithm")],y);const k=y;var V;let h=V=class extends R{constructor(){super(...arguments),this.type="splat",this.scaleFactor=1}clone(){return new V({scaleFactor:this.scaleFactor})}};e([m({pointCloudSplatAlgorithm:"splat"})],h.prototype,"type",void 0),e([t({type:Number,value:1,nonNullable:!0,json:{write:!0}})],h.prototype,"scaleFactor",void 0),h=V=e([r("esri.renderers.support.pointCloud.PointSizeSplatAlgorithm")],h);const B=h,q={key:"type",base:R,typeMap:{"fixed-size":k,splat:B}},T=O()({pointCloudClassBreaksRenderer:"point-cloud-class-breaks",pointCloudRGBRenderer:"point-cloud-rgb",pointCloudStretchRenderer:"point-cloud-stretch",pointCloudUniqueValueRenderer:"point-cloud-unique-value"});let l=class extends f{constructor(s){super(s),this.type=void 0,this.pointSizeAlgorithm=null,this.colorModulation=null,this.pointsPerInch=10}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}cloneProperties(){return{pointSizeAlgorithm:o(this.pointSizeAlgorithm),colorModulation:o(this.colorModulation),pointsPerInch:o(this.pointsPerInch)}}};e([t({type:T.apiValues,readOnly:!0,nonNullable:!0,json:{type:T.jsonValues,read:!1,write:T.write}})],l.prototype,"type",void 0),e([t({types:q,json:{write:!0}})],l.prototype,"pointSizeAlgorithm",void 0),e([t({type:K,json:{write:!0}})],l.prototype,"colorModulation",void 0),e([t({json:{write:!0},nonNullable:!0,type:Number})],l.prototype,"pointsPerInch",void 0),l=e([r("esri.renderers.PointCloudRenderer")],l),function(s){s.fieldTransformTypeKebabDict=new P({none:"none",lowFourBit:"low-four-bit",highFourBit:"high-four-bit",absoluteValue:"absolute-value",moduloTen:"modulo-ten"})}(l||(l={}));const i=l;var j;let n=j=class extends f{constructor(){super(...arguments),this.description=null,this.label=null,this.minValue=0,this.maxValue=0,this.color=null}clone(){return new j({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,color:o(this.color)})}};e([t({type:String,json:{write:!0}})],n.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],n.prototype,"label",void 0),e([t({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],n.prototype,"minValue",void 0),e([t({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],n.prototype,"maxValue",void 0),e([t({type:I,json:{type:[N],write:!0}})],n.prototype,"color",void 0),n=j=e([r("esri.renderers.support.pointCloud.ColorClassBreakInfo")],n);const A=n;var C;let p=C=class extends i{constructor(s){super(s),this.type="point-cloud-class-breaks",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.colorClassBreakInfos=null}clone(){return new C({...this.cloneProperties(),field:this.field,fieldTransformType:this.fieldTransformType,colorClassBreakInfos:o(this.colorClassBreakInfos),legendOptions:o(this.legendOptions)})}};e([m({pointCloudClassBreaksRenderer:"point-cloud-class-breaks"})],p.prototype,"type",void 0),e([t({json:{write:!0},type:String})],p.prototype,"field",void 0),e([t({type:z,json:{write:!0}})],p.prototype,"legendOptions",void 0),e([t({type:i.fieldTransformTypeKebabDict.apiValues,json:{type:i.fieldTransformTypeKebabDict.jsonValues,read:i.fieldTransformTypeKebabDict.read,write:i.fieldTransformTypeKebabDict.write}})],p.prototype,"fieldTransformType",void 0),e([t({type:[A],json:{write:!0}})],p.prototype,"colorClassBreakInfos",void 0),p=C=e([r("esri.renderers.PointCloudClassBreaksRenderer")],p);const U=p;var S;let a=S=class extends i{constructor(s){super(s),this.type="point-cloud-stretch",this.field=null,this.legendOptions=null,this.fieldTransformType=null,this.stops=null}clone(){return new S({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),stops:o(this.stops),legendOptions:o(this.legendOptions)})}};e([m({pointCloudStretchRenderer:"point-cloud-stretch"})],a.prototype,"type",void 0),e([t({json:{write:!0},type:String})],a.prototype,"field",void 0),e([t({type:z,json:{write:!0}})],a.prototype,"legendOptions",void 0),e([t({type:i.fieldTransformTypeKebabDict.apiValues,json:{type:i.fieldTransformTypeKebabDict.jsonValues,read:i.fieldTransformTypeKebabDict.read,write:i.fieldTransformTypeKebabDict.write}})],a.prototype,"fieldTransformType",void 0),e([t({type:[D],json:{write:!0}})],a.prototype,"stops",void 0),a=S=e([r("esri.renderers.PointCloudStretchRenderer")],a);const W=a;var x;let u=x=class extends f{constructor(){super(...arguments),this.description=null,this.label=null,this.values=null,this.color=null}clone(){return new x({description:this.description,label:this.label,values:o(this.values),color:o(this.color)})}};e([t({type:String,json:{write:!0}})],u.prototype,"description",void 0),e([t({type:String,json:{write:!0}})],u.prototype,"label",void 0),e([t({type:[String],json:{write:!0}})],u.prototype,"values",void 0),e([t({type:I,json:{type:[N],write:!0}})],u.prototype,"color",void 0),u=x=e([r("esri.renderers.support.pointCloud.ColorUniqueValueInfo")],u);const M=u;var $;let d=$=class extends i{constructor(s){super(s),this.type="point-cloud-unique-value",this.field=null,this.fieldTransformType=null,this.colorUniqueValueInfos=null,this.legendOptions=null}clone(){return new $({...this.cloneProperties(),field:o(this.field),fieldTransformType:o(this.fieldTransformType),colorUniqueValueInfos:o(this.colorUniqueValueInfos),legendOptions:o(this.legendOptions)})}};e([m({pointCloudUniqueValueRenderer:"point-cloud-unique-value"})],d.prototype,"type",void 0),e([t({json:{write:!0},type:String})],d.prototype,"field",void 0),e([t({type:i.fieldTransformTypeKebabDict.apiValues,json:{type:i.fieldTransformTypeKebabDict.jsonValues,read:i.fieldTransformTypeKebabDict.read,write:i.fieldTransformTypeKebabDict.write}})],d.prototype,"fieldTransformType",void 0),e([t({type:[M],json:{write:!0}})],d.prototype,"colorUniqueValueInfos",void 0),e([t({type:z,json:{write:!0}})],d.prototype,"legendOptions",void 0),d=$=e([r("esri.renderers.PointCloudUniqueValueRenderer")],d);const G=d;export{G as a,W as b,i as c,U as d}; diff --git a/assets/PointCloudWorker.b6328283.js b/assets/PointCloudWorker.ac192dad.js similarity index 96% rename from assets/PointCloudWorker.b6328283.js rename to assets/PointCloudWorker.ac192dad.js index 0a39877..375b792 100644 --- a/assets/PointCloudWorker.b6328283.js +++ b/assets/PointCloudWorker.ac192dad.js @@ -1 +1 @@ -import{j as O,c as d,g_ as x,aT as A,fQ as k,g$ as D}from"./index.d94abe07.js";import{S as F}from"./quat.b3994f2f.js";import{g as R,f as U,c as z,I as B,e as J}from"./I3SBinaryReader.9c0bbe1b.js";import{r as N,n as S}from"./vec3f32.1121a836.js";import{a as T,b as V,d as _}from"./PointCloudUniqueValueRenderer.345f2613.js";import"./mat3f64.6d32a1d7.js";import"./quatf64.4ae3e6f1.js";import"./VertexAttribute.42396f25.js";function q(f,t,l,o){const{rendererJSON:u,isRGBRenderer:p}=f;let n=null,a=null;if(t&&p)n=t;else if(t&&u.type==="pointCloudUniqueValueRenderer"){a=T.fromJSON(u);const e=a.colorUniqueValueInfos;n=new Uint8Array(3*o);const s=v(a.fieldTransformType);for(let r=0;r=e[i].value)n[3*r]=e[i].color.r,n[3*r+1]=e[i].color.g,n[3*r+2]=e[i].color.b;else for(let b=1;b=e[i].minValue&&c<=e[i].maxValue){n[3*r]=e[i].color.r,n[3*r+1]=e[i].color.g,n[3*r+2]=e[i].color.b;break}}}else{n=new Uint8Array(3*o);for(let e=0;e=s?1:i<=e?r:r+(1-r)*(i-e)/(s-e);n[3*c]=b*n[3*c],n[3*c+1]=b*n[3*c+1],n[3*c+2]=b*n[3*c+2]}}return n}function E(f,t){if(f.encoding==null||f.encoding===""){const l=R(t,f);if(O(l.vertexAttributes.position))return;const o=U(t,l.vertexAttributes.position),u=l.header.fields,p=[u.offsetX,u.offsetY,u.offsetZ],n=[u.scaleX,u.scaleY,u.scaleZ],a=o.length/3,e=new Float64Array(3*a);for(let s=0;s>>4&15,m=b>1,C=i===1,y=i===b;let I=!1;for(const h of r.includedReturns)if(h==="last"&&y||h==="firstOfMany"&&C&&m||h==="lastOfMany"&&y&&m||h==="single"&&!m){I=!0;break}I||(e=!1);break}}}e&&(l[n]=a,f[3*n]=f[3*a],f[3*n+1]=f[3*a+1],f[3*n+2]=f[3*a+2],t[3*n]=t[3*a],t[3*n+1]=t[3*a+1],t[3*n+2]=t[3*a+2],n++)}return n}function v(f){return f==null||f==="none"?null:f==="low-four-bit"?t=>15&t:f==="high-four-bit"?t=>(240&t)>>4:f==="absolute-value"?t=>Math.abs(t):f==="modulo-ten"?t=>t%10:null}function M(f){let t=0;for(const l of f||[])t|=1<0&&d(t.filterAttributesData)){const r=t.filterAttributesData.map(c=>{const i=g(c,l,o),b={attributeInfo:c.attributeInfo,values:i};return p.push(b),b});u=new Uint32Array(o),o=j(l,e,u,t.filterInfo,r)}for(const r of t.userAttributesData){const c=g(r,l,o);p.push({attributeInfo:r.attributeInfo,values:c})}3*o=e[i].value)n[3*r]=e[i].color.r,n[3*r+1]=e[i].color.g,n[3*r+2]=e[i].color.b;else for(let b=1;b=e[i].minValue&&c<=e[i].maxValue){n[3*r]=e[i].color.r,n[3*r+1]=e[i].color.g,n[3*r+2]=e[i].color.b;break}}}else{n=new Uint8Array(3*o);for(let e=0;e=s?1:i<=e?r:r+(1-r)*(i-e)/(s-e);n[3*c]=b*n[3*c],n[3*c+1]=b*n[3*c+1],n[3*c+2]=b*n[3*c+2]}}return n}function E(f,t){if(f.encoding==null||f.encoding===""){const l=R(t,f);if(O(l.vertexAttributes.position))return;const o=U(t,l.vertexAttributes.position),u=l.header.fields,p=[u.offsetX,u.offsetY,u.offsetZ],n=[u.scaleX,u.scaleY,u.scaleZ],a=o.length/3,e=new Float64Array(3*a);for(let s=0;s>>4&15,m=b>1,C=i===1,y=i===b;let I=!1;for(const h of r.includedReturns)if(h==="last"&&y||h==="firstOfMany"&&C&&m||h==="lastOfMany"&&y&&m||h==="single"&&!m){I=!0;break}I||(e=!1);break}}}e&&(l[n]=a,f[3*n]=f[3*a],f[3*n+1]=f[3*a+1],f[3*n+2]=f[3*a+2],t[3*n]=t[3*a],t[3*n+1]=t[3*a+1],t[3*n+2]=t[3*a+2],n++)}return n}function v(f){return f==null||f==="none"?null:f==="low-four-bit"?t=>15&t:f==="high-four-bit"?t=>(240&t)>>4:f==="absolute-value"?t=>Math.abs(t):f==="modulo-ten"?t=>t%10:null}function M(f){let t=0;for(const l of f||[])t|=1<0&&d(t.filterAttributesData)){const r=t.filterAttributesData.map(c=>{const i=g(c,l,o),b={attributeInfo:c.attributeInfo,values:i};return p.push(b),b});u=new Uint32Array(o),o=j(l,e,u,t.filterInfo,r)}for(const r of t.userAttributesData){const c=g(r,l,o);p.push({attributeInfo:r.attributeInfo,values:c})}3*oe,this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),n&&(typeof n=="function"?this._toBBox=n:this._initFormat(n)),this.clear()}destroy(){this.clear(),_.prune(),X.prune(),d.prune(),Y.prune()}all(t){this._all(this._data,t)}search(t,n){let e=this._data;const i=this._toBBox;if(M(t,e))for(_.clear();e;){for(let h=0,a=e.children.length;h0;){if(e||(e=j(d.pop()),i=d.data[d.length-1],h=(o=Y.pop())!=null?o:0,a=!0),e.leaf&&(n=v(e.children,t,e.children.length,e.indexHint),n!==-1))return e.children.splice(n,1),d.push(e),this._condense(d),this;a||e.leaf||!E(e,r)?i?(h++,e=i.children[h],a=!1):e=null:(d.push(e),Y.push(h),h=0,i=e,e=e.children[0])}return this}toJSON(){return this._data}fromJSON(t){return this._data=t,this}_all(t,n){var i;let e=t;for(X.clear();e;){if(e.leaf===!0)for(const h of e.children)n(h);else X.pushArray(e.children);e=(i=X.pop())!=null?i:null}}_build(t,n,e,i){const h=e-n+1;let a=this._maxEntries;if(h<=a){const l=new B(t.slice(n,e+1));return x(l,this._toBBox),l}i||(i=Math.ceil(Math.log(h)/Math.log(a)),a=Math.ceil(h/a**(i-1)));const r=new S([]);r.height=i;const o=Math.ceil(h/a),c=o*Math.ceil(Math.sqrt(a));R(t,n,e,c,this._compareMinX);for(let l=n;l<=e;l+=c){const m=Math.min(l+c-1,e);R(t,l,m,o,this._compareMinY);for(let u=l;u<=m;u+=o){const A=Math.min(u+o-1,m);r.children.push(this._build(t,u,A,i-1))}}return x(r,this._toBBox),r}_chooseSubtree(t,n,e,i){for(;i.push(n),n.leaf!==!0&&i.length-1!==e;){let h,a=1/0,r=1/0;for(let o=0,c=n.children.length;o=0&&d.data[n].children.length>this._maxEntries;)this._split(d,n),n--;this._adjustParentBBoxes(h,d,n)}_split(t,n){const e=t.data[n],i=e.children.length,h=this._minEntries;this._chooseSplitAxis(e,h,i);const a=this._chooseSplitIndex(e,h,i);if(!a)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const r=e.children.splice(a,e.children.length-a),o=e.leaf?new B(r):new S(r);o.height=e.height,x(e,this._toBBox),x(o,this._toBBox),n?t.data[n-1].children.push(o):this._splitRoot(e,o)}_splitRoot(t,n){this._data=new S([t,n]),this._data.height=t.height+1,x(this._data,this._toBBox)}_chooseSplitIndex(t,n,e){let i,h,a;i=h=1/0;for(let r=n;r<=e-n;r++){const o=f(t,0,r,this._toBBox),c=f(t,r,e,this._toBBox),l=P(o,c),m=b(o)+b(c);l=n;c--){const l=t.children[c];p(r,t.leaf?h(l):l),o+=g(r)}return o}_adjustParentBBoxes(t,n,e){for(let i=e;i>=0;i--)p(n.data[i],t)}_condense(t){for(let n=t.length-1;n>=0;n--){const e=t.data[n];if(e.children.length===0)if(n>0){const i=t.data[n-1],h=i.children;h.splice(v(h,e,h.length,i.indexHint),1)}else this.clear();else x(e,this._toBBox)}}_initFormat(t){const n=["return a"," - b",";"];this._compareMinX=new Function("a","b",n.join(t[0])),this._compareMinY=new Function("a","b",n.join(t[1])),this._toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}function x(s,t){f(s,0,s.children.length,t,s)}function f(s,t,n,e,i){i||(i=new B([])),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let h,a=t;a=s.minX&&t.maxY>=s.minY}function R(s,t,n,e,i){const h=[t,n];for(;h.length;){const a=j(h.pop()),r=j(h.pop());if(a-r<=e)continue;const o=r+Math.ceil((a-r)/e/2)*e;D(s,o,r,a,i),h.push(r,o,o,a)}}const _=new w,X=new w,d=new w,Y=new w({deallocator:void 0});class I{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class y extends I{constructor(){super(...arguments),this.height=1,this.indexHint=new H}}class B extends y{constructor(t){super(),this.children=t,this.leaf=!0}}class S extends y{constructor(t){super(),this.children=t,this.leaf=!1}}export{N as h}; +import{eO as w,fu as j,f9 as v,fv as D,f8 as H}from"./index.221827cd.js";class N{constructor(t=9,n){this._compareMinX=F,this._compareMinY=$,this._toBBox=e=>e,this._maxEntries=Math.max(4,t||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),n&&(typeof n=="function"?this._toBBox=n:this._initFormat(n)),this.clear()}destroy(){this.clear(),_.prune(),X.prune(),d.prune(),Y.prune()}all(t){this._all(this._data,t)}search(t,n){let e=this._data;const i=this._toBBox;if(M(t,e))for(_.clear();e;){for(let h=0,a=e.children.length;h0;){if(e||(e=j(d.pop()),i=d.data[d.length-1],h=(o=Y.pop())!=null?o:0,a=!0),e.leaf&&(n=v(e.children,t,e.children.length,e.indexHint),n!==-1))return e.children.splice(n,1),d.push(e),this._condense(d),this;a||e.leaf||!E(e,r)?i?(h++,e=i.children[h],a=!1):e=null:(d.push(e),Y.push(h),h=0,i=e,e=e.children[0])}return this}toJSON(){return this._data}fromJSON(t){return this._data=t,this}_all(t,n){var i;let e=t;for(X.clear();e;){if(e.leaf===!0)for(const h of e.children)n(h);else X.pushArray(e.children);e=(i=X.pop())!=null?i:null}}_build(t,n,e,i){const h=e-n+1;let a=this._maxEntries;if(h<=a){const l=new B(t.slice(n,e+1));return x(l,this._toBBox),l}i||(i=Math.ceil(Math.log(h)/Math.log(a)),a=Math.ceil(h/a**(i-1)));const r=new S([]);r.height=i;const o=Math.ceil(h/a),c=o*Math.ceil(Math.sqrt(a));R(t,n,e,c,this._compareMinX);for(let l=n;l<=e;l+=c){const m=Math.min(l+c-1,e);R(t,l,m,o,this._compareMinY);for(let u=l;u<=m;u+=o){const A=Math.min(u+o-1,m);r.children.push(this._build(t,u,A,i-1))}}return x(r,this._toBBox),r}_chooseSubtree(t,n,e,i){for(;i.push(n),n.leaf!==!0&&i.length-1!==e;){let h,a=1/0,r=1/0;for(let o=0,c=n.children.length;o=0&&d.data[n].children.length>this._maxEntries;)this._split(d,n),n--;this._adjustParentBBoxes(h,d,n)}_split(t,n){const e=t.data[n],i=e.children.length,h=this._minEntries;this._chooseSplitAxis(e,h,i);const a=this._chooseSplitIndex(e,h,i);if(!a)return void console.log(" Error: assertion failed at PooledRBush._split: no valid split index");const r=e.children.splice(a,e.children.length-a),o=e.leaf?new B(r):new S(r);o.height=e.height,x(e,this._toBBox),x(o,this._toBBox),n?t.data[n-1].children.push(o):this._splitRoot(e,o)}_splitRoot(t,n){this._data=new S([t,n]),this._data.height=t.height+1,x(this._data,this._toBBox)}_chooseSplitIndex(t,n,e){let i,h,a;i=h=1/0;for(let r=n;r<=e-n;r++){const o=f(t,0,r,this._toBBox),c=f(t,r,e,this._toBBox),l=P(o,c),m=b(o)+b(c);l=n;c--){const l=t.children[c];p(r,t.leaf?h(l):l),o+=g(r)}return o}_adjustParentBBoxes(t,n,e){for(let i=e;i>=0;i--)p(n.data[i],t)}_condense(t){for(let n=t.length-1;n>=0;n--){const e=t.data[n];if(e.children.length===0)if(n>0){const i=t.data[n-1],h=i.children;h.splice(v(h,e,h.length,i.indexHint),1)}else this.clear();else x(e,this._toBBox)}}_initFormat(t){const n=["return a"," - b",";"];this._compareMinX=new Function("a","b",n.join(t[0])),this._compareMinY=new Function("a","b",n.join(t[1])),this._toBBox=new Function("a","return {minX: a"+t[0]+", minY: a"+t[1]+", maxX: a"+t[2]+", maxY: a"+t[3]+"};")}}function x(s,t){f(s,0,s.children.length,t,s)}function f(s,t,n,e,i){i||(i=new B([])),i.minX=1/0,i.minY=1/0,i.maxX=-1/0,i.maxY=-1/0;for(let h,a=t;a=s.minX&&t.maxY>=s.minY}function R(s,t,n,e,i){const h=[t,n];for(;h.length;){const a=j(h.pop()),r=j(h.pop());if(a-r<=e)continue;const o=r+Math.ceil((a-r)/e/2)*e;D(s,o,r,a,i),h.push(r,o,o,a)}}const _=new w,X=new w,d=new w,Y=new w({deallocator:void 0});class I{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}}class y extends I{constructor(){super(...arguments),this.height=1,this.indexHint=new H}}class B extends y{constructor(t){super(),this.children=t,this.leaf=!0}}class S extends y{constructor(t){super(),this.children=t,this.leaf=!1}}export{N as h}; diff --git a/assets/ProgramTemplate.e9a5aa54.js b/assets/ProgramTemplate.cf9dd4e8.js similarity index 99% rename from assets/ProgramTemplate.e9a5aa54.js rename to assets/ProgramTemplate.cf9dd4e8.js index c5d4cd9..f587e76 100644 --- a/assets/ProgramTemplate.e9a5aa54.js +++ b/assets/ProgramTemplate.cf9dd4e8.js @@ -1,4 +1,4 @@ -import{c as P,r as k,j as ie,l as se}from"./index.d94abe07.js";import{c as L}from"./Texture.4c97bad5.js";import{H as p,t as S}from"./enums.2d9e6f64.js";const le=["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"];var F,H={exports:{}};(F=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"])!==void 0&&(H.exports=F);const ce=H.exports;var j,z={exports:{}};j=z,function(o){var e=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"];e!==void 0&&(j.exports=e)}();const R=z.exports;var q={exports:{}};(function(o){(function(e){var r=function(){return["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT","textureSize","texelFetch"]}();r!==void 0&&(o.exports=r)})()})(q);const fe=q.exports;var _=999,$=9999,D=0,w=1,B=2,I=3,V=4,M=5,me=6,ue=7,he=8,O=9,ge=10,G=11,de=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function _e(){var o,e,r,t=0,i=0,n=_,a=[],m=[],l=1,s=0,c=0,u=!1,d=!1,h="";return function(f){return m=[],f!==null?Q(f.replace?f.replace(/\r\n/g,` +import{c as P,r as k,j as ie,l as se}from"./index.221827cd.js";import{c as L}from"./Texture.940076b2.js";import{H as p,t as S}from"./enums.2d9e6f64.js";const le=["layout","centroid","smooth","case","mat2x2","mat2x3","mat2x4","mat3x2","mat3x3","mat3x4","mat4x2","mat4x3","mat4x4","uint","uvec2","uvec3","uvec4","samplerCubeShadow","sampler2DArray","sampler2DArrayShadow","isampler2D","isampler3D","isamplerCube","isampler2DArray","usampler2D","usampler3D","usamplerCube","usampler2DArray","coherent","restrict","readonly","writeonly","resource","atomic_uint","noperspective","patch","sample","subroutine","common","partition","active","filter","image1D","image2D","image3D","imageCube","iimage1D","iimage2D","iimage3D","iimageCube","uimage1D","uimage2D","uimage3D","uimageCube","image1DArray","image2DArray","iimage1DArray","iimage2DArray","uimage1DArray","uimage2DArray","image1DShadow","image2DShadow","image1DArrayShadow","image2DArrayShadow","imageBuffer","iimageBuffer","uimageBuffer","sampler1DArray","sampler1DArrayShadow","isampler1D","isampler1DArray","usampler1D","usampler1DArray","isampler2DRect","usampler2DRect","samplerBuffer","isamplerBuffer","usamplerBuffer","sampler2DMS","isampler2DMS","usampler2DMS","sampler2DMSArray","isampler2DMSArray","usampler2DMSArray","trunc","round","roundEven","isnan","isinf","floatBitsToInt","floatBitsToUint","intBitsToFloat","uintBitsToFloat","packSnorm2x16","unpackSnorm2x16","packUnorm2x16","unpackUnorm2x16","packHalf2x16","unpackHalf2x16","outerProduct","transpose","determinant","inverse","texture","textureSize","textureProj","textureLod","textureOffset","texelFetch","texelFetchOffset","textureProjOffset","textureLodOffset","textureProjLod","textureProjLodOffset","textureGrad","textureGradOffset","textureProjGrad","textureProjGradOffset"];var F,H={exports:{}};(F=["precision","highp","mediump","lowp","attribute","const","uniform","varying","break","continue","do","for","while","if","else","in","out","inout","float","int","void","bool","true","false","discard","return","mat2","mat3","mat4","vec2","vec3","vec4","ivec2","ivec3","ivec4","bvec2","bvec3","bvec4","sampler1D","sampler2D","sampler3D","samplerCube","sampler1DShadow","sampler2DShadow","struct","asm","class","union","enum","typedef","template","this","packed","goto","switch","default","inline","noinline","volatile","public","static","extern","external","interface","long","short","double","half","fixed","unsigned","input","output","hvec2","hvec3","hvec4","dvec2","dvec3","dvec4","fvec2","fvec3","fvec4","sampler2DRect","sampler3DRect","sampler2DRectShadow","sizeof","cast","namespace","using"])!==void 0&&(H.exports=F);const ce=H.exports;var j,z={exports:{}};j=z,function(o){var e=["<<=",">>=","++","--","<<",">>","<=",">=","==","!=","&&","||","+=","-=","*=","/=","%=","&=","^^","^=","|=","(",")","[","]",".","!","~","*","/","%","+","-","<",">","&","^","|","?",":","=",",",";","{","}"];e!==void 0&&(j.exports=e)}();const R=z.exports;var q={exports:{}};(function(o){(function(e){var r=function(){return["abs","acos","all","any","asin","atan","ceil","clamp","cos","cross","dFdx","dFdy","degrees","distance","dot","equal","exp","exp2","faceforward","floor","fract","gl_BackColor","gl_BackLightModelProduct","gl_BackLightProduct","gl_BackMaterial","gl_BackSecondaryColor","gl_ClipPlane","gl_ClipVertex","gl_Color","gl_DepthRange","gl_DepthRangeParameters","gl_EyePlaneQ","gl_EyePlaneR","gl_EyePlaneS","gl_EyePlaneT","gl_Fog","gl_FogCoord","gl_FogFragCoord","gl_FogParameters","gl_FragColor","gl_FragCoord","gl_FragData","gl_FragDepth","gl_FragDepthEXT","gl_FrontColor","gl_FrontFacing","gl_FrontLightModelProduct","gl_FrontLightProduct","gl_FrontMaterial","gl_FrontSecondaryColor","gl_LightModel","gl_LightModelParameters","gl_LightModelProducts","gl_LightProducts","gl_LightSource","gl_LightSourceParameters","gl_MaterialParameters","gl_MaxClipPlanes","gl_MaxCombinedTextureImageUnits","gl_MaxDrawBuffers","gl_MaxFragmentUniformComponents","gl_MaxLights","gl_MaxTextureCoords","gl_MaxTextureImageUnits","gl_MaxTextureUnits","gl_MaxVaryingFloats","gl_MaxVertexAttribs","gl_MaxVertexTextureImageUnits","gl_MaxVertexUniformComponents","gl_ModelViewMatrix","gl_ModelViewMatrixInverse","gl_ModelViewMatrixInverseTranspose","gl_ModelViewMatrixTranspose","gl_ModelViewProjectionMatrix","gl_ModelViewProjectionMatrixInverse","gl_ModelViewProjectionMatrixInverseTranspose","gl_ModelViewProjectionMatrixTranspose","gl_MultiTexCoord0","gl_MultiTexCoord1","gl_MultiTexCoord2","gl_MultiTexCoord3","gl_MultiTexCoord4","gl_MultiTexCoord5","gl_MultiTexCoord6","gl_MultiTexCoord7","gl_Normal","gl_NormalMatrix","gl_NormalScale","gl_ObjectPlaneQ","gl_ObjectPlaneR","gl_ObjectPlaneS","gl_ObjectPlaneT","gl_Point","gl_PointCoord","gl_PointParameters","gl_PointSize","gl_Position","gl_ProjectionMatrix","gl_ProjectionMatrixInverse","gl_ProjectionMatrixInverseTranspose","gl_ProjectionMatrixTranspose","gl_SecondaryColor","gl_TexCoord","gl_TextureEnvColor","gl_TextureMatrix","gl_TextureMatrixInverse","gl_TextureMatrixInverseTranspose","gl_TextureMatrixTranspose","gl_Vertex","greaterThan","greaterThanEqual","inversesqrt","length","lessThan","lessThanEqual","log","log2","matrixCompMult","max","min","mix","mod","normalize","not","notEqual","pow","radians","reflect","refract","sign","sin","smoothstep","sqrt","step","tan","texture2D","texture2DLod","texture2DProj","texture2DProjLod","textureCube","textureCubeLod","texture2DLodEXT","texture2DProjLodEXT","textureCubeLodEXT","texture2DGradEXT","texture2DProjGradEXT","textureCubeGradEXT","textureSize","texelFetch"]}();r!==void 0&&(o.exports=r)})()})(q);const fe=q.exports;var _=999,$=9999,D=0,w=1,B=2,I=3,V=4,M=5,me=6,ue=7,he=8,O=9,ge=10,G=11,de=["block-comment","line-comment","preprocessor","operator","integer","float","ident","builtin","keyword","whitespace","eof","integer"];function _e(){var o,e,r,t=0,i=0,n=_,a=[],m=[],l=1,s=0,c=0,u=!1,d=!1,h="";return function(f){return m=[],f!==null?Q(f.replace?f.replace(/\r\n/g,` `):f):W()};function g(f){f.length&&m.push({type:de[n],data:f,position:c,line:l,column:s})}function Q(f){var v;for(t=0,r=(h+=f).length;o=h[t],t0)continue;T=f.slice(0,1).join("")}return g(T),c+=T.length,(a=a.slice(T.length)).length}}function re(){return/[^a-fA-F0-9]/.test(o)?(g(a.join("")),n=_,t):(a.push(o),e=o,t+1)}function oe(){return o==="."||/[eE]/.test(o)?(a.push(o),n=M,e=o,t+1):o==="x"&&a.length===1&&a[0]==="0"?(n=G,a.push(o),e=o,t+1):/[^\d]/.test(o)?(g(a.join("")),n=_,t):(a.push(o),e=o,t+1)}function ae(){return o==="f"&&(a.push(o),e=o,t+=1),/[eE]/.test(o)||o==="-"&&/[eE]/.test(e)?(a.push(o),e=o,t+1):/[^\d]/.test(o)?(g(a.join("")),n=_,t):(a.push(o),e=o,t+1)}function ne(){if(/[^\d\w_]/.test(o)){var f=a.join("");return n=ce.indexOf(f)>-1?he:fe.indexOf(f)>-1?ue:me,g(a.join("")),n=_,t}return a.push(o),e=o,t+1}}function pe(o){var e=_e(),r=[];return r=(r=r.concat(e(o))).concat(e(null))}function xe(o){return pe(o)}function ve(o){return o.map(e=>e.type!=="eof"?e.data:"").join("")}const E=["GL_OES_standard_derivatives","GL_EXT_frag_depth","GL_EXT_draw_buffers","GL_EXT_shader_texture_lod"];function Te(o,e="100",r="300 es"){const t=/^\s*\#version\s+([0-9]+(\s+[a-zA-Z]+)?)\s*/;for(const i of o)if(i.type==="preprocessor"){const n=t.exec(i.data);if(n){const a=n[1].replace(/\s\s+/g," ");if(a===r)return a;if(a===e)return i.data="#version "+r,e;throw new Error("unknown glsl version: "+a)}}return o.splice(0,0,{type:"preprocessor",data:"#version "+r},{type:"whitespace",data:` diff --git a/assets/QueryEngine.5a5ece4a.js b/assets/QueryEngine.ac81c46d.js similarity index 97% rename from assets/QueryEngine.5a5ece4a.js rename to assets/QueryEngine.ac81c46d.js index 4fb1119..38f7202 100644 --- a/assets/QueryEngine.5a5ece4a.js +++ b/assets/QueryEngine.ac81c46d.js @@ -1 +1 @@ -import{f2 as ee,dU as D,f3 as te,ci as se,f4 as P,f5 as G,j as g,f6 as ie,dV as re,dX as ae,cq as q,bK as I,e2 as M,c9 as Z,n as F,c as w,f7 as N,b4 as U,bJ as V,f8 as ne,f9 as ue,bP as ce,aW as oe,bv as H,aC as he,aO as le,ay as fe,de}from"./index.d94abe07.js";import{A as d,q as ye,l as me,c as A,o as pe,a as ge,f as xe}from"./QueryEngineResult.7611d68a.js";import{g as v,f as C,M as _e}from"./projectionSupport.0542c13b.js";import{t as we}from"./QueryEngineCapabilities.78217f95.js";import{t as Se,v as T,n as Fe,I as J,P as L}from"./timeSupport.668a2439.js";import{E as j,F as E,z as W,v as Re}from"./utils.399e6089.js";function Qe(B){return B.every(e=>e.statisticType!=="exceedslimit")}const R="feature-store:unsupported-query",Ie=new ee(2e6);let Ee=0;class Ce{constructor(e){this.capabilities={query:we},this.geometryType=e.geometryType,this.hasM=e.hasM,this.hasZ=e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",()=>this.clearCache()),this.timeInfo=e.timeInfo,e.cacheSpatialQueries&&(this._geometryQueryCache=new te(Ee+++"$$",Ie)),this.fieldsIndex=new se(e.fields),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=P(this._frameTask),this.clearCache(),G(this._geometryQueryCache),this._changeHandle=P(this._changeHandle),G(this.fieldsIndex)}get featureAdapter(){return this.featureStore.featureAdapter}get fullExtent(){const e=this.featureStore.fullBounds;return g(e)?null:{xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:j(this.spatialReference)}}get timeExtent(){return this.timeInfo?(this._timeExtent||(this._timeExtent=Se(this.timeInfo,this.featureStore)),this._timeExtent):null}clearCache(){var e;(e=this._geometryQueryCache)==null||e.clear(),this._allItems=null,this._timeExtent=null}async executeQuery(e,t){try{return(await this._executeQuery(e,{},t)).createQueryResponse()}catch(s){if(s!==E)throw s;return new d([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},t)).createQueryResponseForCount()}catch(s){if(s!==E)throw s;return 0}}async executeQueryForExtent(e,t){const s=e.outSR;try{const i=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},t),r=i.size;if(!r)return{count:0,extent:null};ie(x,re),this.featureStore.forEachBounds(i.items,u=>ae(x,u),be);const n={xmin:x[0],ymin:x[1],xmax:x[3],ymax:x[4],spatialReference:j(this.spatialReference)};this.hasZ&&isFinite(x[2])&&isFinite(x[5])&&(n.zmin=x[2],n.zmax=x[5]);const a=v(n,i.spatialReference,s);if(a.spatialReference=j(s||this.spatialReference),a.xmax-a.xmin==0){const u=q(a.spatialReference);a.xmin-=u,a.xmax+=u}if(a.ymax-a.ymin==0){const u=q(a.spatialReference);a.ymin-=u,a.ymax+=u}if(this.hasZ&&a.zmin!=null&&a.zmax!=null&&a.zmax-a.zmin==0){const u=q(a.spatialReference);a.zmin-=u,a.zmax+=u}return{count:r,extent:a}}catch(i){if(i===E)return{count:0,extent:null};throw i}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then(s=>Array.from(s))}async executeQueryForIdSet(e,t){try{const s=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},t),i=s.items,r=new Set;return await this._reschedule(()=>{for(const n of i)r.add(s.featureAdapter.getObjectId(n))},t),r}catch(s){if(s===E)return new Set;throw s}}async executeQueryForSnapping(e,t){const{point:s,distance:i,types:r}=e;if(r===ye.NONE)return{candidates:[]};const n=await this._reschedule(()=>this._checkQuerySupport(e.query),t),a=!I(s.spatialReference,this.spatialReference);a&&await C(s.spatialReference,this.spatialReference);const u=typeof i=="number"?i:i.x,h=typeof i=="number"?i:i.y,o={xmin:s.x-u,xmax:s.x+u,ymin:s.y-h,ymax:s.y+h,spatialReference:s.spatialReference},c=a?v(o,this.spatialReference):o;if(!c)return{candidates:[]};const y=(await M(Z(s),null,{signal:t}))[0],m=(await M(Z(c),null,{signal:t}))[0];if(g(y)||g(m))return{candidates:[]};const _=new d(this._searchFeatures(this._getQueryBBoxes(m.toJSON())),n,this);await this._reschedule(()=>this._executeObjectIdsQuery(_),t),await this._reschedule(()=>this._executeTimeQuery(_),t),await this._reschedule(()=>this._executeAttributesQuery(_),t);const l=y.toJSON(),S=a?v(l,this.spatialReference):l,p=a?Math.max(c.xmax-c.xmin,c.ymax-c.ymin)/2:i;return _.createSnappingResponse({...e,point:S,distance:p},s.spatialReference)}async executeQueryForLatestObservations(e,t){if(!this.timeInfo||!this.timeInfo.trackIdField)throw new F(R,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const s=await this._executeQuery(e,{},t);return await this._reschedule(()=>this._filterLatest(s),t),s.createQueryResponse()}catch(s){if(s!==E)throw s;return new d([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,s){const{field:i,normalizationField:r,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:i,normalizationField:r,valueExpression:n},s)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,s){const{field:i,field2:r,field3:n,valueExpression:a}=t;return(await this._getQueryEngineResultForStats(e,{field:i,field2:r,field3:n,valueExpression:a},s)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,s){const{field:i,normalizationField:r,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:i,normalizationField:r,valueExpression:n},s)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,s){const{field:i,normalizationField:r,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:i,normalizationField:r,valueExpression:n},s)).createHistogramResponse(t)}async _schedule(e,t){return w(this._frameTask)?this._frameTask.schedule(e,t):e(N)}async _reschedule(e,t){return w(this._frameTask)?this._frameTask.reschedule(e,t):e(N)}_getAll(e){return g(this._allItems)&&(this._allItems=this.featureStore.toArray()),new d(this._allItems,e,this)}async _executeQuery(e,t,s){e=U(e),e=await this._schedule(()=>W(e,this.definitionExpression,this.spatialReference),s),e=await this._reschedule(()=>this._checkQuerySupport(e),s),e={...e,...t};const i=await this._reschedule(()=>this._executeSceneFilterQuery(e,s),s),r=await this._reschedule(()=>this._executeGeometryQuery(e,i,s),s);return await this._reschedule(()=>this._executeAggregateIdsQuery(r),s),await this._reschedule(()=>this._executeObjectIdsQuery(r),s),await this._reschedule(()=>this._executeTimeQuery(r),s),await this._reschedule(()=>this._executeAttributesQuery(r),s),r}async _executeSceneFilterQuery(e,t){if(g(e.sceneFilter))return null;const{outSR:s,returnGeometry:i,returnCentroid:r}=e,n=this.featureStore.featureSpatialReference,a=e.sceneFilter.geometry,u=g(n)||I(n,a.spatialReference)?a:v(a,n);if(!u)return null;const h=i||r,o=V(s)&&!I(this.spatialReference,s)&&h?async l=>this._project(l,s):l=>l,c=this.featureAdapter,y=this._searchFeatures(this._getQueryBBoxes(u));if(e.sceneFilter.spatialRelationship==="disjoint"){if(!y.length)return null;const l=new Set;for(const b of y)l.add(c.getObjectId(b));const S=await this._reschedule(()=>this.featureStore.toArray(),t),p=await this._reschedule(async()=>{const b=await T("esriSpatialRelDisjoint",u,this.geometryType,this.hasZ,this.hasM),k=Q=>!l.has(c.getObjectId(Q))||b(c.getGeometry(Q)),f=await this._runSpatialFilter(S,k,t);return new d(f,e,this)},t);return o(p)}if(!y.length)return new d([],e,this);if(this._canExecuteSinglePass(u,e))return o(new d(y,e,this));const m=await T("esriSpatialRelContains",u,this.geometryType,this.hasZ,this.hasM),_=await this._runSpatialFilter(y,l=>m(c.getGeometry(l)),t);return o(new d(_,e,this))}async _executeGeometryQuery(e,t,s){if(w(t)&&t.items.length===0)return t;e=w(t)?t.query:e;const{geometry:i,outSR:r,spatialRel:n,returnGeometry:a,returnCentroid:u}=e,h=this.featureStore.featureSpatialReference,o=!i||g(h)||I(h,i.spatialReference)?i:v(i,h),c=a||u,y=V(r)&&!I(this.spatialReference,r),m=this._geometryQueryCache&&g(t)?y&&c?JSON.stringify({originalFilterGeometry:i,spatialRelationship:n,outSpatialReference:r}):JSON.stringify({originalFilterGeometry:i,spatialRelationship:n}):null,_=m?this._geometryQueryCache.get(m):null;if(w(_))return new d(_,e,this);const l=async f=>(y&&c&&await this._project(f,r),m&&this._geometryQueryCache.put(m,f.items,f.items.length+1),f);if(!o)return l(w(t)?t:this._getAll(e));const S=this.featureAdapter;let p=this._searchFeatures(this._getQueryBBoxes(i));if(n==="esriSpatialRelDisjoint"){if(!p.length)return l(w(t)?t:this._getAll(e));const f=new Set;for(const $ of p)f.add(S.getObjectId($));const Q=w(t)?t.items:await this._reschedule(()=>this.featureStore.toArray(),s),K=await this._reschedule(async()=>{const $=await T(n,o,this.geometryType,this.hasZ,this.hasM),X=O=>!f.has(S.getObjectId(O))||$(S.getGeometry(O)),Y=await this._runSpatialFilter(Q,X,s);return new d(Y,e,this)},s);return l(K)}if(w(t)){const f=new ne;p=p.filter(Q=>ue(t.items,Q,t.items.length,f)>=0)}if(!p.length){const f=new d([],e,this);return m&&this._geometryQueryCache.put(m,f.items,1),f}if(this._canExecuteSinglePass(o,e))return l(new d(p,e,this));const b=await T(n,o,this.geometryType,this.hasZ,this.hasM),k=await this._runSpatialFilter(p,f=>b(S.getGeometry(f)),s);return l(new d(k,e,this))}_executeAggregateIdsQuery(e){if(e.items.length===0||!e.query.aggregateIds||!e.query.aggregateIds.length||g(this.aggregateAdapter))return;const t=new Set;for(const i of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(i).forEach(r=>t.add(r));const s=this.featureAdapter.getObjectId;e.items=e.items.filter(i=>t.has(s(i)))}_executeObjectIdsQuery(e){if(e.items.length===0||!e.query.objectIds||!e.query.objectIds.length)return;const t=new Set(e.query.objectIds),s=this.featureAdapter.getObjectId;e.items=e.items.filter(i=>t.has(s(i)))}_executeTimeQuery(e){if(e.items.length===0)return;const t=Fe(this.timeInfo,e.query.timeExtent,this.featureAdapter);g(t)||(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(e.items.length===0)return;const t=me(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter(s=>t.testFeature(s,this.featureAdapter))}}async _runSpatialFilter(e,t,s){if(!t)return e;if(g(this._frameTask))return e.filter(a=>t(a));let i=0;const r=new Array,n=async a=>{for(;in(h),s)}};return this._reschedule(a=>n(a),s).then(()=>r)}_filterLatest(e){const{trackIdField:t,startTimeField:s,endTimeField:i}=this.timeInfo,r=i||s,n=new Map,a=this.featureAdapter.getAttribute;for(const u of e.items){const h=a(u,t),o=a(u,r),c=n.get(h);(!c||o>a(c,r))&&n.set(h,u)}e.items=Array.from(n.values())}_canExecuteSinglePass(e,t){const{spatialRel:s}=t;return J(e)&&(s==="esriSpatialRelEnvelopeIntersects"||this.geometryType==="esriGeometryPoint"&&(s==="esriSpatialRelIntersects"||s==="esriSpatialRelContains"||s==="esriSpatialRelWithin"))}async _project(e,t){if(!t||I(this.spatialReference,t))return e;const s=this.featureAdapter,i=await _e(e.items.map(r=>Re(this.geometryType,this.hasZ,this.hasM,s.getGeometry(r))),this.spatialReference,t);return e.items=i.map((r,n)=>s.cloneWithGeometry(e.items[n],ce(r,this.hasZ,this.hasM))),e}_getQueryBBoxes(e){if(J(e)){if(oe(e))return[H(e.xmin,e.ymin,e.xmax,e.ymax)];if(he(e))return e.rings.map(t=>H(Math.min(t[0][0],t[2][0]),Math.min(t[0][1],t[2][1]),Math.max(t[0][0],t[2][0]),Math.max(t[0][1],t[2][1])))}return[le(fe(),e)]}_searchFeatures(e){for(const s of e)this.featureStore.forEachInBounds(s,i=>z.add(i));const t=Array.from(z.values());return z.clear(),t}async _checkStatisticsSupport(e,t){if(e.distance<0||e.geometryPrecision!=null||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new F(R,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),Promise.all([this._checkStatisticsParamsSupport(t),L(e,this.geometryType,this.spatialReference),C(this.spatialReference,e.outSR)]).then(()=>e)}async _checkStatisticsParamsSupport(e){let t=[];if(e.valueExpression){const{arcadeUtils:s}=await de();t=s.extractFieldNames(e.valueExpression)}if(e.field&&t.push(e.field),e.field2&&t.push(e.field2),e.field3&&t.push(e.field3),e.normalizationField&&t.push(e.normalizationField),!t.length)throw new F(R,"params should have at least a field or valueExpression",{params:e});A(this.fieldsIndex,t,"params contains missing fields")}async _checkQuerySupport(e){if(e.distance<0||e.geometryPrecision!=null||e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new F(R,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),this._checkStatisticsQuerySupport(e),Promise.all([L(e,this.geometryType,this.spatialReference),C(this.spatialReference,e.outSR)]).then(()=>e)}_checkAttributesQuerySupport(e){const{outFields:t,orderByFields:s,returnDistinctValues:i,outStatistics:r}=e,n=r?r.map(a=>a.outStatisticFieldName&&a.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if(s&&s.length>0){const a=" asc",u=" desc",h=s.map(o=>{const c=o.toLowerCase();return c.includes(a)?c.split(a)[0]:c.includes(u)?c.split(u)[0]:o}).filter(o=>!n.includes(o));A(this.fieldsIndex,h,"orderByFields contains missing fields")}if(t&&t.length>0)A(this.fieldsIndex,t,"outFields contains missing fields");else if(i)throw new F(R,"outFields should be specified for returnDistinctValues",{query:e});pe(this.fieldsIndex,e.where)}_checkStatisticsQuerySupport(e){const{outStatistics:t,groupByFieldsForStatistics:s,having:i}=e,r=s&&s.length,n=t&&t.length;if(i){if(!r||!n)throw new F(R,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:e});ge(this.fieldsIndex,i,t)}if(n){if(!Qe(t))return;const a=t.map(u=>u.onStatisticField).filter(Boolean);A(this.fieldsIndex,a,"onStatisticFields contains missing fields"),r&&A(this.fieldsIndex,s,"groupByFieldsForStatistics contains missing fields");for(const u of t){const{onStatisticField:h,statisticType:o}=u;if((o==="percentile_disc"||o==="percentile_cont")&&"statisticParameters"in u){const{statisticParameters:c}=u;if(!c)throw new F(R,"statisticParamters should be set for percentile type",{definition:u,query:e})}else if(o!=="count"&&h&&xe(h,this.fieldsIndex))throw new F(R,"outStatistics contains non-numeric fields",{definition:u,query:e})}}}async _getQueryEngineResultForStats(e,t,s){e=U(e);try{e=await this._schedule(()=>W(e,this.definitionExpression,this.spatialReference),s),e=await this._reschedule(()=>this._checkStatisticsSupport(e,t),s);const i=await this._reschedule(()=>this._executeSceneFilterQuery(e,s),s),r=await this._reschedule(()=>this._executeGeometryQuery(e,i,s),s);return await this._reschedule(()=>this._executeAggregateIdsQuery(r),s),await this._reschedule(()=>this._executeObjectIdsQuery(r),s),await this._reschedule(()=>this._executeTimeQuery(r),s),await this._reschedule(()=>this._executeAttributesQuery(r),s),r}catch(i){if(i!==E)throw i;return new d([],e,this)}}}const be=D(),x=D(),z=new Set;export{Ce as Y}; +import{f2 as ee,dU as D,f3 as te,ci as se,f4 as P,f5 as G,j as g,f6 as ie,dV as re,dX as ae,cq as q,bK as I,e2 as M,c9 as Z,n as F,c as w,f7 as N,b4 as U,bJ as V,f8 as ne,f9 as ue,bP as ce,aW as oe,bv as H,aC as he,aO as le,ay as fe,de}from"./index.221827cd.js";import{A as d,q as ye,l as me,c as A,o as pe,a as ge,f as xe}from"./QueryEngineResult.2fc58178.js";import{g as v,f as C,M as _e}from"./projectionSupport.4f5da4af.js";import{t as we}from"./QueryEngineCapabilities.78217f95.js";import{t as Se,v as T,n as Fe,I as J,P as L}from"./timeSupport.968e62fc.js";import{E as j,F as E,z as W,v as Re}from"./utils.e42485ea.js";function Qe(B){return B.every(e=>e.statisticType!=="exceedslimit")}const R="feature-store:unsupported-query",Ie=new ee(2e6);let Ee=0;class Ce{constructor(e){this.capabilities={query:we},this.geometryType=e.geometryType,this.hasM=e.hasM,this.hasZ=e.hasZ,this.objectIdField=e.objectIdField,this.spatialReference=e.spatialReference,this.definitionExpression=e.definitionExpression,this.featureStore=e.featureStore,this.aggregateAdapter=e.aggregateAdapter,this._changeHandle=this.featureStore.events.on("changed",()=>this.clearCache()),this.timeInfo=e.timeInfo,e.cacheSpatialQueries&&(this._geometryQueryCache=new te(Ee+++"$$",Ie)),this.fieldsIndex=new se(e.fields),e.scheduler&&e.priority&&(this._frameTask=e.scheduler.registerTask(e.priority))}destroy(){this._frameTask=P(this._frameTask),this.clearCache(),G(this._geometryQueryCache),this._changeHandle=P(this._changeHandle),G(this.fieldsIndex)}get featureAdapter(){return this.featureStore.featureAdapter}get fullExtent(){const e=this.featureStore.fullBounds;return g(e)?null:{xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:j(this.spatialReference)}}get timeExtent(){return this.timeInfo?(this._timeExtent||(this._timeExtent=Se(this.timeInfo,this.featureStore)),this._timeExtent):null}clearCache(){var e;(e=this._geometryQueryCache)==null||e.clear(),this._allItems=null,this._timeExtent=null}async executeQuery(e,t){try{return(await this._executeQuery(e,{},t)).createQueryResponse()}catch(s){if(s!==E)throw s;return new d([],e,this).createQueryResponse()}}async executeQueryForCount(e={},t){try{return(await this._executeQuery(e,{returnGeometry:!1,returnCentroid:!1,outSR:null},t)).createQueryResponseForCount()}catch(s){if(s!==E)throw s;return 0}}async executeQueryForExtent(e,t){const s=e.outSR;try{const i=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},t),r=i.size;if(!r)return{count:0,extent:null};ie(x,re),this.featureStore.forEachBounds(i.items,u=>ae(x,u),be);const n={xmin:x[0],ymin:x[1],xmax:x[3],ymax:x[4],spatialReference:j(this.spatialReference)};this.hasZ&&isFinite(x[2])&&isFinite(x[5])&&(n.zmin=x[2],n.zmax=x[5]);const a=v(n,i.spatialReference,s);if(a.spatialReference=j(s||this.spatialReference),a.xmax-a.xmin==0){const u=q(a.spatialReference);a.xmin-=u,a.xmax+=u}if(a.ymax-a.ymin==0){const u=q(a.spatialReference);a.ymin-=u,a.ymax+=u}if(this.hasZ&&a.zmin!=null&&a.zmax!=null&&a.zmax-a.zmin==0){const u=q(a.spatialReference);a.zmin-=u,a.zmax+=u}return{count:r,extent:a}}catch(i){if(i===E)return{count:0,extent:null};throw i}}async executeQueryForIds(e,t){return this.executeQueryForIdSet(e,t).then(s=>Array.from(s))}async executeQueryForIdSet(e,t){try{const s=await this._executeQuery(e,{returnGeometry:!0,returnCentroid:!1,outSR:null},t),i=s.items,r=new Set;return await this._reschedule(()=>{for(const n of i)r.add(s.featureAdapter.getObjectId(n))},t),r}catch(s){if(s===E)return new Set;throw s}}async executeQueryForSnapping(e,t){const{point:s,distance:i,types:r}=e;if(r===ye.NONE)return{candidates:[]};const n=await this._reschedule(()=>this._checkQuerySupport(e.query),t),a=!I(s.spatialReference,this.spatialReference);a&&await C(s.spatialReference,this.spatialReference);const u=typeof i=="number"?i:i.x,h=typeof i=="number"?i:i.y,o={xmin:s.x-u,xmax:s.x+u,ymin:s.y-h,ymax:s.y+h,spatialReference:s.spatialReference},c=a?v(o,this.spatialReference):o;if(!c)return{candidates:[]};const y=(await M(Z(s),null,{signal:t}))[0],m=(await M(Z(c),null,{signal:t}))[0];if(g(y)||g(m))return{candidates:[]};const _=new d(this._searchFeatures(this._getQueryBBoxes(m.toJSON())),n,this);await this._reschedule(()=>this._executeObjectIdsQuery(_),t),await this._reschedule(()=>this._executeTimeQuery(_),t),await this._reschedule(()=>this._executeAttributesQuery(_),t);const l=y.toJSON(),S=a?v(l,this.spatialReference):l,p=a?Math.max(c.xmax-c.xmin,c.ymax-c.ymin)/2:i;return _.createSnappingResponse({...e,point:S,distance:p},s.spatialReference)}async executeQueryForLatestObservations(e,t){if(!this.timeInfo||!this.timeInfo.trackIdField)throw new F(R,"Missing timeInfo or timeInfo.trackIdField",{query:e,timeInfo:this.timeInfo});try{const s=await this._executeQuery(e,{},t);return await this._reschedule(()=>this._filterLatest(s),t),s.createQueryResponse()}catch(s){if(s!==E)throw s;return new d([],e,this).createQueryResponse()}}async executeQueryForSummaryStatistics(e={},t,s){const{field:i,normalizationField:r,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:i,normalizationField:r,valueExpression:n},s)).createSummaryStatisticsResponse(t)}async executeQueryForUniqueValues(e={},t,s){const{field:i,field2:r,field3:n,valueExpression:a}=t;return(await this._getQueryEngineResultForStats(e,{field:i,field2:r,field3:n,valueExpression:a},s)).createUniqueValuesResponse(t)}async executeQueryForClassBreaks(e={},t,s){const{field:i,normalizationField:r,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:i,normalizationField:r,valueExpression:n},s)).createClassBreaksResponse(t)}async executeQueryForHistogram(e={},t,s){const{field:i,normalizationField:r,valueExpression:n}=t;return(await this._getQueryEngineResultForStats(e,{field:i,normalizationField:r,valueExpression:n},s)).createHistogramResponse(t)}async _schedule(e,t){return w(this._frameTask)?this._frameTask.schedule(e,t):e(N)}async _reschedule(e,t){return w(this._frameTask)?this._frameTask.reschedule(e,t):e(N)}_getAll(e){return g(this._allItems)&&(this._allItems=this.featureStore.toArray()),new d(this._allItems,e,this)}async _executeQuery(e,t,s){e=U(e),e=await this._schedule(()=>W(e,this.definitionExpression,this.spatialReference),s),e=await this._reschedule(()=>this._checkQuerySupport(e),s),e={...e,...t};const i=await this._reschedule(()=>this._executeSceneFilterQuery(e,s),s),r=await this._reschedule(()=>this._executeGeometryQuery(e,i,s),s);return await this._reschedule(()=>this._executeAggregateIdsQuery(r),s),await this._reschedule(()=>this._executeObjectIdsQuery(r),s),await this._reschedule(()=>this._executeTimeQuery(r),s),await this._reschedule(()=>this._executeAttributesQuery(r),s),r}async _executeSceneFilterQuery(e,t){if(g(e.sceneFilter))return null;const{outSR:s,returnGeometry:i,returnCentroid:r}=e,n=this.featureStore.featureSpatialReference,a=e.sceneFilter.geometry,u=g(n)||I(n,a.spatialReference)?a:v(a,n);if(!u)return null;const h=i||r,o=V(s)&&!I(this.spatialReference,s)&&h?async l=>this._project(l,s):l=>l,c=this.featureAdapter,y=this._searchFeatures(this._getQueryBBoxes(u));if(e.sceneFilter.spatialRelationship==="disjoint"){if(!y.length)return null;const l=new Set;for(const b of y)l.add(c.getObjectId(b));const S=await this._reschedule(()=>this.featureStore.toArray(),t),p=await this._reschedule(async()=>{const b=await T("esriSpatialRelDisjoint",u,this.geometryType,this.hasZ,this.hasM),k=Q=>!l.has(c.getObjectId(Q))||b(c.getGeometry(Q)),f=await this._runSpatialFilter(S,k,t);return new d(f,e,this)},t);return o(p)}if(!y.length)return new d([],e,this);if(this._canExecuteSinglePass(u,e))return o(new d(y,e,this));const m=await T("esriSpatialRelContains",u,this.geometryType,this.hasZ,this.hasM),_=await this._runSpatialFilter(y,l=>m(c.getGeometry(l)),t);return o(new d(_,e,this))}async _executeGeometryQuery(e,t,s){if(w(t)&&t.items.length===0)return t;e=w(t)?t.query:e;const{geometry:i,outSR:r,spatialRel:n,returnGeometry:a,returnCentroid:u}=e,h=this.featureStore.featureSpatialReference,o=!i||g(h)||I(h,i.spatialReference)?i:v(i,h),c=a||u,y=V(r)&&!I(this.spatialReference,r),m=this._geometryQueryCache&&g(t)?y&&c?JSON.stringify({originalFilterGeometry:i,spatialRelationship:n,outSpatialReference:r}):JSON.stringify({originalFilterGeometry:i,spatialRelationship:n}):null,_=m?this._geometryQueryCache.get(m):null;if(w(_))return new d(_,e,this);const l=async f=>(y&&c&&await this._project(f,r),m&&this._geometryQueryCache.put(m,f.items,f.items.length+1),f);if(!o)return l(w(t)?t:this._getAll(e));const S=this.featureAdapter;let p=this._searchFeatures(this._getQueryBBoxes(i));if(n==="esriSpatialRelDisjoint"){if(!p.length)return l(w(t)?t:this._getAll(e));const f=new Set;for(const $ of p)f.add(S.getObjectId($));const Q=w(t)?t.items:await this._reschedule(()=>this.featureStore.toArray(),s),K=await this._reschedule(async()=>{const $=await T(n,o,this.geometryType,this.hasZ,this.hasM),X=O=>!f.has(S.getObjectId(O))||$(S.getGeometry(O)),Y=await this._runSpatialFilter(Q,X,s);return new d(Y,e,this)},s);return l(K)}if(w(t)){const f=new ne;p=p.filter(Q=>ue(t.items,Q,t.items.length,f)>=0)}if(!p.length){const f=new d([],e,this);return m&&this._geometryQueryCache.put(m,f.items,1),f}if(this._canExecuteSinglePass(o,e))return l(new d(p,e,this));const b=await T(n,o,this.geometryType,this.hasZ,this.hasM),k=await this._runSpatialFilter(p,f=>b(S.getGeometry(f)),s);return l(new d(k,e,this))}_executeAggregateIdsQuery(e){if(e.items.length===0||!e.query.aggregateIds||!e.query.aggregateIds.length||g(this.aggregateAdapter))return;const t=new Set;for(const i of e.query.aggregateIds)this.aggregateAdapter.getFeatureObjectIds(i).forEach(r=>t.add(r));const s=this.featureAdapter.getObjectId;e.items=e.items.filter(i=>t.has(s(i)))}_executeObjectIdsQuery(e){if(e.items.length===0||!e.query.objectIds||!e.query.objectIds.length)return;const t=new Set(e.query.objectIds),s=this.featureAdapter.getObjectId;e.items=e.items.filter(i=>t.has(s(i)))}_executeTimeQuery(e){if(e.items.length===0)return;const t=Fe(this.timeInfo,e.query.timeExtent,this.featureAdapter);g(t)||(e.items=e.items.filter(t))}_executeAttributesQuery(e){if(e.items.length===0)return;const t=me(e.query.where,this.fieldsIndex);if(t){if(!t.isStandardized)throw new TypeError("Where clause is not standardized");e.items=e.items.filter(s=>t.testFeature(s,this.featureAdapter))}}async _runSpatialFilter(e,t,s){if(!t)return e;if(g(this._frameTask))return e.filter(a=>t(a));let i=0;const r=new Array,n=async a=>{for(;in(h),s)}};return this._reschedule(a=>n(a),s).then(()=>r)}_filterLatest(e){const{trackIdField:t,startTimeField:s,endTimeField:i}=this.timeInfo,r=i||s,n=new Map,a=this.featureAdapter.getAttribute;for(const u of e.items){const h=a(u,t),o=a(u,r),c=n.get(h);(!c||o>a(c,r))&&n.set(h,u)}e.items=Array.from(n.values())}_canExecuteSinglePass(e,t){const{spatialRel:s}=t;return J(e)&&(s==="esriSpatialRelEnvelopeIntersects"||this.geometryType==="esriGeometryPoint"&&(s==="esriSpatialRelIntersects"||s==="esriSpatialRelContains"||s==="esriSpatialRelWithin"))}async _project(e,t){if(!t||I(this.spatialReference,t))return e;const s=this.featureAdapter,i=await _e(e.items.map(r=>Re(this.geometryType,this.hasZ,this.hasM,s.getGeometry(r))),this.spatialReference,t);return e.items=i.map((r,n)=>s.cloneWithGeometry(e.items[n],ce(r,this.hasZ,this.hasM))),e}_getQueryBBoxes(e){if(J(e)){if(oe(e))return[H(e.xmin,e.ymin,e.xmax,e.ymax)];if(he(e))return e.rings.map(t=>H(Math.min(t[0][0],t[2][0]),Math.min(t[0][1],t[2][1]),Math.max(t[0][0],t[2][0]),Math.max(t[0][1],t[2][1])))}return[le(fe(),e)]}_searchFeatures(e){for(const s of e)this.featureStore.forEachInBounds(s,i=>z.add(i));const t=Array.from(z.values());return z.clear(),t}async _checkStatisticsSupport(e,t){if(e.distance<0||e.geometryPrecision!=null||e.multipatchOption||e.pixelSize||e.relationParam||e.text||e.outStatistics||e.groupByFieldsForStatistics||e.having||e.orderByFields)throw new F(R,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),Promise.all([this._checkStatisticsParamsSupport(t),L(e,this.geometryType,this.spatialReference),C(this.spatialReference,e.outSR)]).then(()=>e)}async _checkStatisticsParamsSupport(e){let t=[];if(e.valueExpression){const{arcadeUtils:s}=await de();t=s.extractFieldNames(e.valueExpression)}if(e.field&&t.push(e.field),e.field2&&t.push(e.field2),e.field3&&t.push(e.field3),e.normalizationField&&t.push(e.normalizationField),!t.length)throw new F(R,"params should have at least a field or valueExpression",{params:e});A(this.fieldsIndex,t,"params contains missing fields")}async _checkQuerySupport(e){if(e.distance<0||e.geometryPrecision!=null||e.multipatchOption||e.pixelSize||e.relationParam||e.text)throw new F(R,"Unsupported query options",{query:e});return this._checkAttributesQuerySupport(e),this._checkStatisticsQuerySupport(e),Promise.all([L(e,this.geometryType,this.spatialReference),C(this.spatialReference,e.outSR)]).then(()=>e)}_checkAttributesQuerySupport(e){const{outFields:t,orderByFields:s,returnDistinctValues:i,outStatistics:r}=e,n=r?r.map(a=>a.outStatisticFieldName&&a.outStatisticFieldName.toLowerCase()).filter(Boolean):[];if(s&&s.length>0){const a=" asc",u=" desc",h=s.map(o=>{const c=o.toLowerCase();return c.includes(a)?c.split(a)[0]:c.includes(u)?c.split(u)[0]:o}).filter(o=>!n.includes(o));A(this.fieldsIndex,h,"orderByFields contains missing fields")}if(t&&t.length>0)A(this.fieldsIndex,t,"outFields contains missing fields");else if(i)throw new F(R,"outFields should be specified for returnDistinctValues",{query:e});pe(this.fieldsIndex,e.where)}_checkStatisticsQuerySupport(e){const{outStatistics:t,groupByFieldsForStatistics:s,having:i}=e,r=s&&s.length,n=t&&t.length;if(i){if(!r||!n)throw new F(R,"outStatistics and groupByFieldsForStatistics should be specified with having",{query:e});ge(this.fieldsIndex,i,t)}if(n){if(!Qe(t))return;const a=t.map(u=>u.onStatisticField).filter(Boolean);A(this.fieldsIndex,a,"onStatisticFields contains missing fields"),r&&A(this.fieldsIndex,s,"groupByFieldsForStatistics contains missing fields");for(const u of t){const{onStatisticField:h,statisticType:o}=u;if((o==="percentile_disc"||o==="percentile_cont")&&"statisticParameters"in u){const{statisticParameters:c}=u;if(!c)throw new F(R,"statisticParamters should be set for percentile type",{definition:u,query:e})}else if(o!=="count"&&h&&xe(h,this.fieldsIndex))throw new F(R,"outStatistics contains non-numeric fields",{definition:u,query:e})}}}async _getQueryEngineResultForStats(e,t,s){e=U(e);try{e=await this._schedule(()=>W(e,this.definitionExpression,this.spatialReference),s),e=await this._reschedule(()=>this._checkStatisticsSupport(e,t),s);const i=await this._reschedule(()=>this._executeSceneFilterQuery(e,s),s),r=await this._reschedule(()=>this._executeGeometryQuery(e,i,s),s);return await this._reschedule(()=>this._executeAggregateIdsQuery(r),s),await this._reschedule(()=>this._executeObjectIdsQuery(r),s),await this._reschedule(()=>this._executeTimeQuery(r),s),await this._reschedule(()=>this._executeAttributesQuery(r),s),r}catch(i){if(i!==E)throw i;return new d([],e,this)}}}const be=D(),x=D(),z=new Set;export{Ce as Y}; diff --git a/assets/QueryEngineResult.7611d68a.js b/assets/QueryEngineResult.2fc58178.js similarity index 98% rename from assets/QueryEngineResult.7611d68a.js rename to assets/QueryEngineResult.2fc58178.js index e06280f..846948c 100644 --- a/assets/QueryEngineResult.7611d68a.js +++ b/assets/QueryEngineResult.2fc58178.js @@ -1 +1 @@ -import{fd as Y,n as S,j as ae,bJ as ce,bK as H,c as U,fe as X,at as de,ff as he,fg as k,aD as fe,fh as me,de as ge}from"./index.d94abe07.js";import{s as J}from"./quantizationUtils.0d428d19.js";import{WhereClause as pe}from"./WhereClause.253310fe.js";import{c as G,x as ye,m as xe,f as K,d as W,V as Fe,T as Ie,F as _e,D as Ve,N as Te,S as De,v as ve,p as be}from"./utils.8c53cad2.js";import{g as ee}from"./projectionSupport.0542c13b.js";import{E as $,v as O,b as te}from"./utils.399e6089.js";class Ae{constructor(t,e){this._cache=new Y(t),this._invalidCache=new Y(e)}get(t,e){const i=`${e.uid}:${t}`,a=this._cache.get(i);if(a)return a;if(this._invalidCache.get(i)!==void 0)return null;try{const s=pe.create(t,e);return this._cache.put(i,s),s}catch{return this._invalidCache.put(i,null),null}}}const j=new Ae(50,500),w="feature-store:unsupported-query",re=" as ",ze=new Set(["esriFieldTypeOID","esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeLong","esriFieldTypeDate"]);function $e(c,t){if(!t)return!0;const e=j.get(t,c);if(!e)throw new S(w,"invalid SQL expression",{where:t});if(!e.isStandardized)throw new S(w,"where clause is not standard",{where:t});return Z(c,e.fieldNames,"where clause contains missing fields"),!0}function Oe(c,t,e){if(!t)return!0;const i=j.get(t,c);if(!i)throw new S(w,"invalid SQL expression",{having:t});if(!i.isAggregate)throw new S(w,"having does not contain a valid aggregate function",{having:t});const a=i.fieldNames;if(Z(c,a,"having contains missing fields"),!i.getExpressions().every(s=>{const{aggregateType:r,field:n}=s,o=c.has(n)&&c.get(n).name;return e.some(u=>{const{onStatisticField:l,statisticType:d}=u;return(c.has(l)&&c.get(l).name)===o&&d.toLowerCase().trim()===r})}))throw new S(w,"expressions in having should also exist in outStatistics",{having:t});return!0}function q(c,t){return c?j.get(c,t):null}function Z(c,t,e,i=!0){const a=[];for(const s of t)if(s!=="*"&&!c.has(s))if(i){const r=ne(s);try{const n=q(r,c);if(!n)throw new S(w,"invalid SQL expression",{where:r});if(!n.isStandardized)throw new S(w,"expression is not standard",{clause:n});Z(c,n.fieldNames,"expression contains missing fields")}catch(n){const o=n&&n.details;if(o&&(o.clause||o.where))throw n;o&&o.missingFields?a.push(...o.missingFields):a.push(s)}}else a.push(s);if(a.length)throw new S(w,e,{missingFields:a})}function ne(c){return c.split(re)[0]}function Se(c){return c.split(re)[1]}function je(c,t){const e=t.get(c);return!!e&&!ze.has(e.type)}class M{constructor(t,e,i){var s;this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=(s=t.returnDistinctValues)!=null?s:!1,this.fieldsIndex=i,this.featureAdapter=e;const a=t.outFields;if(a&&!a.includes("*")){this.outFields=a;let r=0;for(const n of a){const o=ne(n),u=this.fieldsIndex.get(o),l=u?null:q(o,i),d=u?u.name:Se(n)||"FIELD_EXP_"+r++;this._fieldDataCache.set(n,{alias:d,clause:l})}}}countDistinctValues(t){return this.returnDistinctValues?(t.forEach(e=>this.getAttributes(e)),this._returnDistinctMap.size):t.length}getAttributes(t){const e=this._processAttributesForOutFields(t);return this._processAttributesForDistinctValues(e)}getFieldValue(t,e,i){const a=i?i.name:e;let s=null;return this._fieldDataCache.has(a)?s=this._fieldDataCache.get(a).clause:i||(s=q(e,this.fieldsIndex),this._fieldDataCache.set(a,{alias:a,clause:s})),i?this.featureAdapter.getAttribute(t,a):s.calculateValue(t,this.featureAdapter)}getDataValue(t,e){const i=e.normalizationType,a=e.normalizationTotal;let s=this.getFieldValue(t,e.field,this.fieldsIndex.get(e.field));if(e.field2&&(s=`${G(s)}${e.fieldDelimiter}${G(this.getFieldValue(t,e.field2,this.fieldsIndex.get(e.field2)))}`,e.field3&&(s=`${s}${e.fieldDelimiter}${G(this.getFieldValue(t,e.field3,this.fieldsIndex.get(e.field3)))}`)),i&&Number.isFinite(s)){const r=i==="field"&&e.normalizationField?this.getFieldValue(t,e.normalizationField,this.fieldsIndex.get(e.normalizationField)):null;s=ye(s,i,r,a)}return s}getExpressionValue(t,e,i,a){const s={attributes:this.featureAdapter.getAttributes(t),layer:{fields:this.fieldsIndex.fields}},r=a.createExecContext(s,i);return a.executeFunction(e,r)}getExpressionValues(t,e,i,a){const s={fields:this.fieldsIndex.fields};return t.map(r=>{const n={attributes:this.featureAdapter.getAttributes(r),layer:s},o=a.createExecContext(n,i);return a.executeFunction(e,o)})}validateItem(t,e){return this._fieldDataCache.has(e)||this._fieldDataCache.set(e,{alias:e,clause:q(e,this.fieldsIndex)}),this._fieldDataCache.get(e).clause.testFeature(t,this.featureAdapter)}validateItems(t,e){return this._fieldDataCache.has(e)||this._fieldDataCache.set(e,{alias:e,clause:q(e,this.fieldsIndex)}),this._fieldDataCache.get(e).clause.testSet(t,this.featureAdapter)}_processAttributesForOutFields(t){const e=this.outFields;if(!e||!e.length)return this.featureAdapter.getAttributes(t);const i={};for(const a of e){const{alias:s,clause:r}=this._fieldDataCache.get(a);i[s]=r?r.calculateValue(t,this.featureAdapter):this.featureAdapter.getAttribute(t,s)}return i}_processAttributesForDistinctValues(t){if(ae(t)||!this.returnDistinctValues)return t;const e=this.outFields,i=[];if(e)for(const r of e){const{alias:n}=this._fieldDataCache.get(r);i.push(t[n])}else for(const r in t)i.push(t[r]);const a=`${(e||["*"]).join(",")}=${i.join(",")}`;let s=this._returnDistinctMap.get(a)||0;return this._returnDistinctMap.set(a,++s),s>1?null:t}}function we(c,t,e){return{objectId:c,target:t,distance:e,type:"vertex"}}function Ee(c,t,e,i,a,s=!1){return{objectId:c,target:t,distance:e,type:"edge",start:i,end:a,draped:s}}class Ze{constructor(t,e,i){this.items=t,this.query=e,this.geometryType=i.geometryType,this.hasM=i.hasM,this.hasZ=i.hasZ,this.fieldsIndex=i.fieldsIndex,this.objectIdField=i.objectIdField,this.spatialReference=i.spatialReference,this.featureAdapter=i.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const t=new M(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return t.countDistinctValues(this.items);const{groupByFieldsForStatistics:e,having:i,outStatistics:a}=this.query;if(!(e==null?void 0:e.length))return 1;const r=new Map,n=new Map,o=new Set;for(const u of a){const{statisticType:l}=u,d=l!=="exceedslimit"?u.onStatisticField:void 0;if(!n.has(d)){const h=[];for(const g of e){const x=this._getAttributeValues(t,g,r);h.push(x)}n.set(d,this._calculateUniqueValues(h,t.returnDistinctValues))}const f=n.get(d);for(const h in f){const{data:g,items:x}=f[h],V=g.join(",");i&&!t.validateItems(x,i)||o.add(V)}}return o.size}async createQueryResponse(){let t;return this.query.outStatistics?t=this.query.outStatistics.some(e=>e.statisticType==="exceedslimit")?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):t=this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry&&(ce(this.query.outSR)&&!H(this.query.geometry.spatialReference,this.query.outSR)?t.queryGeometry=$({spatialReference:this.query.outSR,...ee(this.query.geometry,this.query.geometry.spatialReference,this.query.outSR)}):t.queryGeometry=$({spatialReference:this.query.outSR,...this.query.geometry})),t}createSnappingResponse(t,e){const i=this.featureAdapter,a=ie(this.hasZ,this.hasM),{point:s}=t,r=typeof t.distance=="number"?t.distance:t.distance.x,n=typeof t.distance=="number"?t.distance:t.distance.y,o={candidates:[]},u=this.geometryType==="esriGeometryPolygon",l=s.z!=null,d=s.m!=null,f=this._getPointCreator(s,l,d,this.spatialReference,e),h=new se(null,0),g=new se(null,0),x={x:0,y:0,z:0};for(const V of this.items){const y=i.getGeometry(V);if(ae(y))continue;const{coords:I,lengths:_}=y;if(h.coords=I,g.coords=I,t.types&P.EDGE){let F=0;for(let p=0;p<_.length;p++){const m=_[p];for(let T=0;TV.distance-y.distance),o}_getPointCreator(t,e,i,a,s){const r=U(s)&&!H(a,s)?l=>ee(l,a,s):l=>l,{hasZ:n}=this,o=0,u=t.m;return e&&i?n?({x:l,y:d,z:f})=>r({x:l,y:d,z:f,m:u}):({x:l,y:d})=>r({x:l,y:d,z:o,m:u}):e?n?({x:l,y:d,z:f})=>r({x:l,y:d,z:f}):({x:l,y:d})=>r({x:l,y:d,z:o}):i?({x:l,y:d})=>r({x:l,y:d,m:u}):({x:l,y:d})=>r({x:l,y:d})}async createSummaryStatisticsResponse(t){const{field:e,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,minValue:n,maxValue:o,scale:u}=t,l=this.fieldsIndex.isDateField(e),d=await this._getDataValues({field:e,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,scale:u}),f=xe({normalizationType:s,normalizationField:a,minValue:n,maxValue:o}),h=this.fieldsIndex.get(e),g={value:.5,fieldType:h==null?void 0:h.type},x=X(h)?K({values:d,supportsNullCount:f,percentileParams:g}):W({values:d,minValue:n,maxValue:o,useSampleStdDev:!s,supportsNullCount:f,percentileParams:g});return Fe(x,l)}async createUniqueValuesResponse(t){const{field:e,valueExpression:i,domains:a,returnAllCodedValues:s,scale:r}=t,n=await this._getDataValues({field:e,field2:t.field2,field3:t.field3,fieldDelimiter:t.fieldDelimiter,valueExpression:i,scale:r}),o=Ie(n);return _e(o,a,s,t.fieldDelimiter)}async createClassBreaksResponse(t){const{field:e,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:u,maxValue:l,numClasses:d,scale:f}=t,h=await this._getDataValues({field:e,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,scale:f}),g=Ve(h,{field:e,normalizationField:a,normalizationType:s,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:u,maxValue:l,numClasses:d});return Te(g,n)}async createHistogramResponse(t){const{field:e,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:u,maxValue:l,numBins:d,scale:f}=t,h=await this._getDataValues({field:e,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,scale:f});return De(h,{field:e,normalizationField:a,normalizationType:s,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:u,maxValue:l,numBins:d})}_sortFeatures(t,e,i){if(t.length>1&&e&&e.length)for(const a of e.reverse()){const s=a.split(" "),r=s[0],n=this.fieldsIndex.get(r),o=s[1]&&s[1].toLowerCase()==="desc",u=ve(n==null?void 0:n.type,o);t.sort((l,d)=>{const f=i(l,r,n),h=i(d,r,n);return u(f,h)})}}_createFeatureQueryResponse(t){const e=this.items,{geometryType:i,hasM:a,hasZ:s,objectIdField:r,spatialReference:n}=this,{outFields:o,outSR:u,quantizationParameters:l,resultRecordCount:d,resultOffset:f,returnZ:h,returnM:g}=t,x=d!=null&&e.length>(f||0)+d,V=o&&(o.includes("*")?[...this.fieldsIndex.fields]:o.map(y=>this.fieldsIndex.get(y)));return{exceededTransferLimit:x,features:this._createFeatures(t,e),fields:V,geometryType:i,hasM:a&&g,hasZ:s&&h,objectIdFieldName:r,spatialReference:$(u||n),transform:l&&J(l)||null}}_createFeatures(t,e){const i=new M(t,this.featureAdapter,this.fieldsIndex),{hasM:a,hasZ:s}=this,{orderByFields:r,quantizationParameters:n,returnGeometry:o,returnCentroid:u,maxAllowableOffset:l,resultOffset:d,resultRecordCount:f,returnZ:h=!1,returnM:g=!1}=t,x=s&&h,V=a&&g;let y=[],I=0;const _=[...e];if(this._sortFeatures(_,r,(p,m,T)=>i.getFieldValue(p,m,T)),o||u){const p=J(n);if(o&&!u)for(const m of _)y[I++]={attributes:i.getAttributes(m),geometry:O(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(m),l,p,x,V)};else if(!o&&u)for(const m of _)y[I++]={attributes:i.getAttributes(m),centroid:te(this,this.featureAdapter.getCentroid(m,this),p)};else for(const m of _)y[I++]={attributes:i.getAttributes(m),centroid:te(this,this.featureAdapter.getCentroid(m,this),p),geometry:O(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(m),l,p,x,V)}}else for(const p of _){const m=i.getAttributes(p);m&&(y[I++]={attributes:m})}const F=d||0;if(f!=null){const p=F+f;y=y.slice(F,Math.min(y.length,p))}return y}_createExceedsLimitQueryResponse(t){let e=!1,i=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(const r of t.outStatistics)if(r.statisticType==="exceedslimit"){i=r.maxPointCount!=null?r.maxPointCount:Number.POSITIVE_INFINITY,a=r.maxRecordCount!=null?r.maxRecordCount:Number.POSITIVE_INFINITY,s=r.maxVertexCount!=null?r.maxVertexCount:Number.POSITIVE_INFINITY;break}if(this.geometryType==="esriGeometryPoint")e=this.items.length>i;else if(this.items.length>a)e=!0;else{const r=ie(this.hasZ,this.hasM),n=this.featureAdapter;e=this.items.reduce((o,u)=>{const l=n.getGeometry(u);return o+(U(l)&&l.coords.length||0)},0)/r>s}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(e)}}]}}async _createStatisticsQueryResponse(t){const e={attributes:{}},i=[],a=new Map,s=new Map,r=new Map,n=new Map,o=new M(t,this.featureAdapter,this.fieldsIndex),u=t.outStatistics,{groupByFieldsForStatistics:l,having:d,orderByFields:f}=t,h=l&&l.length,g=!!h,x=g&&l[0],V=g&&!this.fieldsIndex.get(x);for(const I of u){const{outStatisticFieldName:_,statisticType:F}=I,p=I,m=F!=="exceedslimit"?I.onStatisticField:void 0,T=F==="percentile_disc"||F==="percentile_cont",v=F==="EnvelopeAggregate"||F==="CentroidAggregate"||F==="ConvexHullAggregate",A=g&&h===1&&(m===x||V)&&F==="count";if(g){if(!r.has(m)){const b=[];for(const C of l){const E=this._getAttributeValues(o,C,a);b.push(E)}r.set(m,this._calculateUniqueValues(b,!v&&o.returnDistinctValues))}const D=r.get(m);for(const b in D){const{count:C,data:E,items:Q,itemPositions:oe}=D[b],L=E.join(",");if(!d||o.validateItems(Q,d)){const R=n.get(L)||{attributes:{}};if(v){R.aggregateGeometries||(R.aggregateGeometries={});const{aggregateGeometries:z,outStatisticFieldName:N}=await this._getAggregateGeometry(p,Q);R.aggregateGeometries[N]=z}else{let z=null;if(A)z=C;else{const N=this._getAttributeValues(o,m,a),B=oe.map(ue=>N[ue]);z=T&&"statisticParameters"in p?this._getPercentileValue(p,B):this._getStatisticValue(p,B,null,o.returnDistinctValues)}R.attributes[_]=z}let le=0;l.forEach((z,N)=>R.attributes[this.fieldsIndex.get(z)?z:"EXPR_"+ ++le]=E[N]),n.set(L,R)}}}else if(v){e.aggregateGeometries||(e.aggregateGeometries={});const{aggregateGeometries:D,outStatisticFieldName:b}=await this._getAggregateGeometry(p,this.items);e.aggregateGeometries[b]=D}else{const D=this._getAttributeValues(o,m,a);e.attributes[_]=T&&"statisticParameters"in p?this._getPercentileValue(p,D):this._getStatisticValue(p,D,s,o.returnDistinctValues)}i.push({name:_,alias:_,type:"esriFieldTypeDouble"})}const y=g?Array.from(n.values()):[e];return this._sortFeatures(y,f,(I,_)=>I.attributes[_]),{fields:i,features:y}}async _getAggregateGeometry(t,e){const i=await de(()=>import("./geometryEngineJSON.3d6e7890.js"),["assets/geometryEngineJSON.3d6e7890.js","assets/geometryEngineBase.82b25ca5.js","assets/geometryEngineJSON.f9e9a36f.js","assets/json.879c9adc.js"]),{statisticType:a,outStatisticFieldName:s}=t,{featureAdapter:r,spatialReference:n,geometryType:o,hasZ:u,hasM:l}=this,d=e.map(g=>O(o,u,l,r.getGeometry(g))),f=i.convexHull(n,d,!0)[0],h={aggregateGeometries:null,outStatisticFieldName:null};if(a==="EnvelopeAggregate"){const g=f?he(f):k(i.union(n,d));h.aggregateGeometries={...g,spatialReference:n},h.outStatisticFieldName=s||"extent"}else if(a==="CentroidAggregate"){const g=f?fe(f):me(k(i.union(n,d)));h.aggregateGeometries={x:g[0],y:g[1],spatialReference:n},h.outStatisticFieldName=s||"centroid"}else a==="ConvexHullAggregate"&&(h.aggregateGeometries=f,h.outStatisticFieldName=s||"convexHull");return h}_getStatisticValue(t,e,i,a){const{onStatisticField:s,statisticType:r}=t;let n=null;return n=i!=null&&i.has(s)?i.get(s):X(this.fieldsIndex.get(s))?K({values:e,returnDistinct:a}):W({values:e,minValue:null,maxValue:null,useSampleStdDev:!0}),i&&i.set(s,n),n[r==="var"?"variance":r]}_getPercentileValue(t,e){const{onStatisticField:i,statisticParameters:a,statisticType:s}=t,{value:r,orderBy:n}=a,o=this.fieldsIndex.get(i);return be(e,{value:r,orderBy:n,fieldType:o==null?void 0:o.type,isDiscrete:s==="percentile_disc"})}_getAttributeValues(t,e,i){if(i.has(e))return i.get(e);const a=this.fieldsIndex.get(e),s=this.items.map(r=>t.getFieldValue(r,e,a));return i.set(e,s),s}_getAttributeDataValues(t,e){return this.items.map(i=>t.getDataValue(i,{field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal}))}async _getAttributeExpressionValues(t,e,i){const{arcadeUtils:a}=await ge(),s=a.createFunction(e),r=i&&a.getViewInfo(i);return t.getExpressionValues(this.items,s,r,a)}_calculateUniqueValues(t,e){const i={},a=this.items,s=a.length;for(let r=0;r{const{aggregateType:r,field:n}=s,o=c.has(n)&&c.get(n).name;return e.some(u=>{const{onStatisticField:l,statisticType:d}=u;return(c.has(l)&&c.get(l).name)===o&&d.toLowerCase().trim()===r})}))throw new S(w,"expressions in having should also exist in outStatistics",{having:t});return!0}function q(c,t){return c?j.get(c,t):null}function Z(c,t,e,i=!0){const a=[];for(const s of t)if(s!=="*"&&!c.has(s))if(i){const r=ne(s);try{const n=q(r,c);if(!n)throw new S(w,"invalid SQL expression",{where:r});if(!n.isStandardized)throw new S(w,"expression is not standard",{clause:n});Z(c,n.fieldNames,"expression contains missing fields")}catch(n){const o=n&&n.details;if(o&&(o.clause||o.where))throw n;o&&o.missingFields?a.push(...o.missingFields):a.push(s)}}else a.push(s);if(a.length)throw new S(w,e,{missingFields:a})}function ne(c){return c.split(re)[0]}function Se(c){return c.split(re)[1]}function je(c,t){const e=t.get(c);return!!e&&!ze.has(e.type)}class M{constructor(t,e,i){var s;this._fieldDataCache=new Map,this._returnDistinctMap=new Map,this.returnDistinctValues=(s=t.returnDistinctValues)!=null?s:!1,this.fieldsIndex=i,this.featureAdapter=e;const a=t.outFields;if(a&&!a.includes("*")){this.outFields=a;let r=0;for(const n of a){const o=ne(n),u=this.fieldsIndex.get(o),l=u?null:q(o,i),d=u?u.name:Se(n)||"FIELD_EXP_"+r++;this._fieldDataCache.set(n,{alias:d,clause:l})}}}countDistinctValues(t){return this.returnDistinctValues?(t.forEach(e=>this.getAttributes(e)),this._returnDistinctMap.size):t.length}getAttributes(t){const e=this._processAttributesForOutFields(t);return this._processAttributesForDistinctValues(e)}getFieldValue(t,e,i){const a=i?i.name:e;let s=null;return this._fieldDataCache.has(a)?s=this._fieldDataCache.get(a).clause:i||(s=q(e,this.fieldsIndex),this._fieldDataCache.set(a,{alias:a,clause:s})),i?this.featureAdapter.getAttribute(t,a):s.calculateValue(t,this.featureAdapter)}getDataValue(t,e){const i=e.normalizationType,a=e.normalizationTotal;let s=this.getFieldValue(t,e.field,this.fieldsIndex.get(e.field));if(e.field2&&(s=`${G(s)}${e.fieldDelimiter}${G(this.getFieldValue(t,e.field2,this.fieldsIndex.get(e.field2)))}`,e.field3&&(s=`${s}${e.fieldDelimiter}${G(this.getFieldValue(t,e.field3,this.fieldsIndex.get(e.field3)))}`)),i&&Number.isFinite(s)){const r=i==="field"&&e.normalizationField?this.getFieldValue(t,e.normalizationField,this.fieldsIndex.get(e.normalizationField)):null;s=ye(s,i,r,a)}return s}getExpressionValue(t,e,i,a){const s={attributes:this.featureAdapter.getAttributes(t),layer:{fields:this.fieldsIndex.fields}},r=a.createExecContext(s,i);return a.executeFunction(e,r)}getExpressionValues(t,e,i,a){const s={fields:this.fieldsIndex.fields};return t.map(r=>{const n={attributes:this.featureAdapter.getAttributes(r),layer:s},o=a.createExecContext(n,i);return a.executeFunction(e,o)})}validateItem(t,e){return this._fieldDataCache.has(e)||this._fieldDataCache.set(e,{alias:e,clause:q(e,this.fieldsIndex)}),this._fieldDataCache.get(e).clause.testFeature(t,this.featureAdapter)}validateItems(t,e){return this._fieldDataCache.has(e)||this._fieldDataCache.set(e,{alias:e,clause:q(e,this.fieldsIndex)}),this._fieldDataCache.get(e).clause.testSet(t,this.featureAdapter)}_processAttributesForOutFields(t){const e=this.outFields;if(!e||!e.length)return this.featureAdapter.getAttributes(t);const i={};for(const a of e){const{alias:s,clause:r}=this._fieldDataCache.get(a);i[s]=r?r.calculateValue(t,this.featureAdapter):this.featureAdapter.getAttribute(t,s)}return i}_processAttributesForDistinctValues(t){if(ae(t)||!this.returnDistinctValues)return t;const e=this.outFields,i=[];if(e)for(const r of e){const{alias:n}=this._fieldDataCache.get(r);i.push(t[n])}else for(const r in t)i.push(t[r]);const a=`${(e||["*"]).join(",")}=${i.join(",")}`;let s=this._returnDistinctMap.get(a)||0;return this._returnDistinctMap.set(a,++s),s>1?null:t}}function we(c,t,e){return{objectId:c,target:t,distance:e,type:"vertex"}}function Ee(c,t,e,i,a,s=!1){return{objectId:c,target:t,distance:e,type:"edge",start:i,end:a,draped:s}}class Ze{constructor(t,e,i){this.items=t,this.query=e,this.geometryType=i.geometryType,this.hasM=i.hasM,this.hasZ=i.hasZ,this.fieldsIndex=i.fieldsIndex,this.objectIdField=i.objectIdField,this.spatialReference=i.spatialReference,this.featureAdapter=i.featureAdapter}get size(){return this.items.length}createQueryResponseForCount(){const t=new M(this.query,this.featureAdapter,this.fieldsIndex);if(!this.query.outStatistics)return t.countDistinctValues(this.items);const{groupByFieldsForStatistics:e,having:i,outStatistics:a}=this.query;if(!(e==null?void 0:e.length))return 1;const r=new Map,n=new Map,o=new Set;for(const u of a){const{statisticType:l}=u,d=l!=="exceedslimit"?u.onStatisticField:void 0;if(!n.has(d)){const h=[];for(const g of e){const x=this._getAttributeValues(t,g,r);h.push(x)}n.set(d,this._calculateUniqueValues(h,t.returnDistinctValues))}const f=n.get(d);for(const h in f){const{data:g,items:x}=f[h],V=g.join(",");i&&!t.validateItems(x,i)||o.add(V)}}return o.size}async createQueryResponse(){let t;return this.query.outStatistics?t=this.query.outStatistics.some(e=>e.statisticType==="exceedslimit")?this._createExceedsLimitQueryResponse(this.query):await this._createStatisticsQueryResponse(this.query):t=this._createFeatureQueryResponse(this.query),this.query.returnQueryGeometry&&(ce(this.query.outSR)&&!H(this.query.geometry.spatialReference,this.query.outSR)?t.queryGeometry=$({spatialReference:this.query.outSR,...ee(this.query.geometry,this.query.geometry.spatialReference,this.query.outSR)}):t.queryGeometry=$({spatialReference:this.query.outSR,...this.query.geometry})),t}createSnappingResponse(t,e){const i=this.featureAdapter,a=ie(this.hasZ,this.hasM),{point:s}=t,r=typeof t.distance=="number"?t.distance:t.distance.x,n=typeof t.distance=="number"?t.distance:t.distance.y,o={candidates:[]},u=this.geometryType==="esriGeometryPolygon",l=s.z!=null,d=s.m!=null,f=this._getPointCreator(s,l,d,this.spatialReference,e),h=new se(null,0),g=new se(null,0),x={x:0,y:0,z:0};for(const V of this.items){const y=i.getGeometry(V);if(ae(y))continue;const{coords:I,lengths:_}=y;if(h.coords=I,g.coords=I,t.types&P.EDGE){let F=0;for(let p=0;p<_.length;p++){const m=_[p];for(let T=0;TV.distance-y.distance),o}_getPointCreator(t,e,i,a,s){const r=U(s)&&!H(a,s)?l=>ee(l,a,s):l=>l,{hasZ:n}=this,o=0,u=t.m;return e&&i?n?({x:l,y:d,z:f})=>r({x:l,y:d,z:f,m:u}):({x:l,y:d})=>r({x:l,y:d,z:o,m:u}):e?n?({x:l,y:d,z:f})=>r({x:l,y:d,z:f}):({x:l,y:d})=>r({x:l,y:d,z:o}):i?({x:l,y:d})=>r({x:l,y:d,m:u}):({x:l,y:d})=>r({x:l,y:d})}async createSummaryStatisticsResponse(t){const{field:e,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,minValue:n,maxValue:o,scale:u}=t,l=this.fieldsIndex.isDateField(e),d=await this._getDataValues({field:e,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,scale:u}),f=xe({normalizationType:s,normalizationField:a,minValue:n,maxValue:o}),h=this.fieldsIndex.get(e),g={value:.5,fieldType:h==null?void 0:h.type},x=X(h)?K({values:d,supportsNullCount:f,percentileParams:g}):W({values:d,minValue:n,maxValue:o,useSampleStdDev:!s,supportsNullCount:f,percentileParams:g});return Fe(x,l)}async createUniqueValuesResponse(t){const{field:e,valueExpression:i,domains:a,returnAllCodedValues:s,scale:r}=t,n=await this._getDataValues({field:e,field2:t.field2,field3:t.field3,fieldDelimiter:t.fieldDelimiter,valueExpression:i,scale:r}),o=Ie(n);return _e(o,a,s,t.fieldDelimiter)}async createClassBreaksResponse(t){const{field:e,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:u,maxValue:l,numClasses:d,scale:f}=t,h=await this._getDataValues({field:e,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,scale:f}),g=Ve(h,{field:e,normalizationField:a,normalizationType:s,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:u,maxValue:l,numClasses:d});return Te(g,n)}async createHistogramResponse(t){const{field:e,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:u,maxValue:l,numBins:d,scale:f}=t,h=await this._getDataValues({field:e,valueExpression:i,normalizationField:a,normalizationType:s,normalizationTotal:r,scale:f});return De(h,{field:e,normalizationField:a,normalizationType:s,normalizationTotal:r,classificationMethod:n,standardDeviationInterval:o,minValue:u,maxValue:l,numBins:d})}_sortFeatures(t,e,i){if(t.length>1&&e&&e.length)for(const a of e.reverse()){const s=a.split(" "),r=s[0],n=this.fieldsIndex.get(r),o=s[1]&&s[1].toLowerCase()==="desc",u=ve(n==null?void 0:n.type,o);t.sort((l,d)=>{const f=i(l,r,n),h=i(d,r,n);return u(f,h)})}}_createFeatureQueryResponse(t){const e=this.items,{geometryType:i,hasM:a,hasZ:s,objectIdField:r,spatialReference:n}=this,{outFields:o,outSR:u,quantizationParameters:l,resultRecordCount:d,resultOffset:f,returnZ:h,returnM:g}=t,x=d!=null&&e.length>(f||0)+d,V=o&&(o.includes("*")?[...this.fieldsIndex.fields]:o.map(y=>this.fieldsIndex.get(y)));return{exceededTransferLimit:x,features:this._createFeatures(t,e),fields:V,geometryType:i,hasM:a&&g,hasZ:s&&h,objectIdFieldName:r,spatialReference:$(u||n),transform:l&&J(l)||null}}_createFeatures(t,e){const i=new M(t,this.featureAdapter,this.fieldsIndex),{hasM:a,hasZ:s}=this,{orderByFields:r,quantizationParameters:n,returnGeometry:o,returnCentroid:u,maxAllowableOffset:l,resultOffset:d,resultRecordCount:f,returnZ:h=!1,returnM:g=!1}=t,x=s&&h,V=a&&g;let y=[],I=0;const _=[...e];if(this._sortFeatures(_,r,(p,m,T)=>i.getFieldValue(p,m,T)),o||u){const p=J(n);if(o&&!u)for(const m of _)y[I++]={attributes:i.getAttributes(m),geometry:O(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(m),l,p,x,V)};else if(!o&&u)for(const m of _)y[I++]={attributes:i.getAttributes(m),centroid:te(this,this.featureAdapter.getCentroid(m,this),p)};else for(const m of _)y[I++]={attributes:i.getAttributes(m),centroid:te(this,this.featureAdapter.getCentroid(m,this),p),geometry:O(this.geometryType,this.hasZ,this.hasM,this.featureAdapter.getGeometry(m),l,p,x,V)}}else for(const p of _){const m=i.getAttributes(p);m&&(y[I++]={attributes:m})}const F=d||0;if(f!=null){const p=F+f;y=y.slice(F,Math.min(y.length,p))}return y}_createExceedsLimitQueryResponse(t){let e=!1,i=Number.POSITIVE_INFINITY,a=Number.POSITIVE_INFINITY,s=Number.POSITIVE_INFINITY;for(const r of t.outStatistics)if(r.statisticType==="exceedslimit"){i=r.maxPointCount!=null?r.maxPointCount:Number.POSITIVE_INFINITY,a=r.maxRecordCount!=null?r.maxRecordCount:Number.POSITIVE_INFINITY,s=r.maxVertexCount!=null?r.maxVertexCount:Number.POSITIVE_INFINITY;break}if(this.geometryType==="esriGeometryPoint")e=this.items.length>i;else if(this.items.length>a)e=!0;else{const r=ie(this.hasZ,this.hasM),n=this.featureAdapter;e=this.items.reduce((o,u)=>{const l=n.getGeometry(u);return o+(U(l)&&l.coords.length||0)},0)/r>s}return{fields:[{name:"exceedslimit",type:"esriFieldTypeInteger",alias:"exceedslimit",sqlType:"sqlTypeInteger",domain:null,defaultValue:null}],features:[{attributes:{exceedslimit:Number(e)}}]}}async _createStatisticsQueryResponse(t){const e={attributes:{}},i=[],a=new Map,s=new Map,r=new Map,n=new Map,o=new M(t,this.featureAdapter,this.fieldsIndex),u=t.outStatistics,{groupByFieldsForStatistics:l,having:d,orderByFields:f}=t,h=l&&l.length,g=!!h,x=g&&l[0],V=g&&!this.fieldsIndex.get(x);for(const I of u){const{outStatisticFieldName:_,statisticType:F}=I,p=I,m=F!=="exceedslimit"?I.onStatisticField:void 0,T=F==="percentile_disc"||F==="percentile_cont",v=F==="EnvelopeAggregate"||F==="CentroidAggregate"||F==="ConvexHullAggregate",A=g&&h===1&&(m===x||V)&&F==="count";if(g){if(!r.has(m)){const b=[];for(const C of l){const E=this._getAttributeValues(o,C,a);b.push(E)}r.set(m,this._calculateUniqueValues(b,!v&&o.returnDistinctValues))}const D=r.get(m);for(const b in D){const{count:C,data:E,items:Q,itemPositions:oe}=D[b],L=E.join(",");if(!d||o.validateItems(Q,d)){const R=n.get(L)||{attributes:{}};if(v){R.aggregateGeometries||(R.aggregateGeometries={});const{aggregateGeometries:z,outStatisticFieldName:N}=await this._getAggregateGeometry(p,Q);R.aggregateGeometries[N]=z}else{let z=null;if(A)z=C;else{const N=this._getAttributeValues(o,m,a),B=oe.map(ue=>N[ue]);z=T&&"statisticParameters"in p?this._getPercentileValue(p,B):this._getStatisticValue(p,B,null,o.returnDistinctValues)}R.attributes[_]=z}let le=0;l.forEach((z,N)=>R.attributes[this.fieldsIndex.get(z)?z:"EXPR_"+ ++le]=E[N]),n.set(L,R)}}}else if(v){e.aggregateGeometries||(e.aggregateGeometries={});const{aggregateGeometries:D,outStatisticFieldName:b}=await this._getAggregateGeometry(p,this.items);e.aggregateGeometries[b]=D}else{const D=this._getAttributeValues(o,m,a);e.attributes[_]=T&&"statisticParameters"in p?this._getPercentileValue(p,D):this._getStatisticValue(p,D,s,o.returnDistinctValues)}i.push({name:_,alias:_,type:"esriFieldTypeDouble"})}const y=g?Array.from(n.values()):[e];return this._sortFeatures(y,f,(I,_)=>I.attributes[_]),{fields:i,features:y}}async _getAggregateGeometry(t,e){const i=await de(()=>import("./geometryEngineJSON.3d6e7890.js"),["assets/geometryEngineJSON.3d6e7890.js","assets/geometryEngineBase.82b25ca5.js","assets/geometryEngineJSON.f9e9a36f.js","assets/json.879c9adc.js"]),{statisticType:a,outStatisticFieldName:s}=t,{featureAdapter:r,spatialReference:n,geometryType:o,hasZ:u,hasM:l}=this,d=e.map(g=>O(o,u,l,r.getGeometry(g))),f=i.convexHull(n,d,!0)[0],h={aggregateGeometries:null,outStatisticFieldName:null};if(a==="EnvelopeAggregate"){const g=f?he(f):k(i.union(n,d));h.aggregateGeometries={...g,spatialReference:n},h.outStatisticFieldName=s||"extent"}else if(a==="CentroidAggregate"){const g=f?fe(f):me(k(i.union(n,d)));h.aggregateGeometries={x:g[0],y:g[1],spatialReference:n},h.outStatisticFieldName=s||"centroid"}else a==="ConvexHullAggregate"&&(h.aggregateGeometries=f,h.outStatisticFieldName=s||"convexHull");return h}_getStatisticValue(t,e,i,a){const{onStatisticField:s,statisticType:r}=t;let n=null;return n=i!=null&&i.has(s)?i.get(s):X(this.fieldsIndex.get(s))?K({values:e,returnDistinct:a}):W({values:e,minValue:null,maxValue:null,useSampleStdDev:!0}),i&&i.set(s,n),n[r==="var"?"variance":r]}_getPercentileValue(t,e){const{onStatisticField:i,statisticParameters:a,statisticType:s}=t,{value:r,orderBy:n}=a,o=this.fieldsIndex.get(i);return be(e,{value:r,orderBy:n,fieldType:o==null?void 0:o.type,isDiscrete:s==="percentile_disc"})}_getAttributeValues(t,e,i){if(i.has(e))return i.get(e);const a=this.fieldsIndex.get(e),s=this.items.map(r=>t.getFieldValue(r,e,a));return i.set(e,s),s}_getAttributeDataValues(t,e){return this.items.map(i=>t.getDataValue(i,{field:e.field,field2:e.field2,field3:e.field3,fieldDelimiter:e.fieldDelimiter,normalizationField:e.normalizationField,normalizationType:e.normalizationType,normalizationTotal:e.normalizationTotal}))}async _getAttributeExpressionValues(t,e,i){const{arcadeUtils:a}=await ge(),s=a.createFunction(e),r=i&&a.getViewInfo(i);return t.getExpressionValues(this.items,s,r,a)}_calculateUniqueValues(t,e){const i={},a=this.items,s=a.length;for(let r=0;ra&&(c=a)}else{for(;!this.eof;)this.readBlock();c=this.bufferLength}return this.pos=c,this.buffer.subarray(r,c)},lookChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(t,r,c){for(var a=t+r;this.bufferLength<=a&&!this.eof;)this.readBlock();return new Stream(this.buffer,t,r,c)},skip:function(t){t||(t=1),this.pos+=t},reset:function(){this.pos=0}},e}(),(gt=function(){if(!self||!self.Uint32Array)return null;var e=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),t=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),r=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),c=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],a=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];function n(o){throw new Error(o)}function p(o){var i=0,l=o[i++],s=o[i++];l!=-1&&s!=-1||n("Invalid header in flate stream"),(15&l)!=8&&n("Unknown compression method in flate stream"),((l<<8)+s)%31!=0&&n("Bad FCHECK in flate stream"),32&s&&n("FDICT bit set in flate stream"),this.bytes=o,this.bytesPos=i,this.codeSize=0,this.codeBuf=0,je.call(this)}return p.prototype=Object.create(je.prototype),p.prototype.getBits=function(o){for(var i,l=this.codeSize,s=this.codeBuf,m=this.bytes,u=this.bytesPos;l>o,this.codeSize=l-=o,this.bytesPos=u,i},p.prototype.getCode=function(o){for(var i=o[0],l=o[1],s=this.codeSize,m=this.codeBuf,u=this.bytes,y=this.bytesPos;s>16,d=65535&h;return(s==0||s>g,this.codeSize=s-g,this.bytesPos=y,d},p.prototype.generateHuffmanTable=function(o){for(var i=o.length,l=0,s=0;sl&&(l=o[s]);for(var m=1<>=1;for(s=d;s0;)B[h++]=F}var i=this.getBits(3);if(1&i&&(this.eof=!0),(i>>=1)!=0){var l,s;if(i==1)l=c,s=a;else if(i==2){for(var m=this.getBits(5)+257,u=this.getBits(5)+1,y=this.getBits(4)+4,b=Array(e.length),h=0;h=w&&(w=(O=this.ensureBuffer(S+1)).length),O[S++]=v;else{if(v==256)return void(this.bufferLength=S);var A=(v=t[v-=257])>>16;A>0&&(A=this.getBits(A)),d=(65535&v)+A,v=this.getCode(s),(A=(v=r[v])>>16)>0&&(A=this.getBits(A));var k=(65535&v)+A;S+d>=w&&(w=(O=this.ensureBuffer(S+d)).length);for(var D=0;D{let s=null;p==="jpg"&&o&&(s=tt._getMask(t,{width:a,height:n}));const m=new Blob([new Uint8Array(t)],{type:"image/"+p=="jpg"?"jpeg":p}),u=URL.createObjectURL(m),y=new Image;let b;y.src=u,y.onload=()=>{if(URL.revokeObjectURL(u),Wt(c))return void l(Kt());a=y.width,n=y.height,this._canvas&&this._ctx?(this._canvas.width===a&&this._canvas.height===n||(this._canvas.width=a,this._canvas.height=n),this._ctx.clearRect(0,0,a,n)):(this._canvas=document.createElement("canvas"),this._canvas.width=a,this._canvas.height=n,this._ctx=this._canvas.getContext("2d")),this._ctx.drawImage(y,0,0);const h=this._ctx.getImageData(0,0,a,n);let g;if(b=h.data,r.renderOnCanvas){if(s)for(g=0;g{URL.revokeObjectURL(u),l("cannot load image")}})}static _getMask(t,r){let c=null;try{const a=new Uint8Array(t),n=Math.ceil(a.length/2);let p=0;const o=a.length-2;for(p=n;p=0;m--)c[l++]=i[s]>>m&1}}catch{}return c}}var yt,Ct,wt,Et={exports:{}};yt=Et,Ct=function(){var e=function(){function t(r){this.message="JPEG error: "+r}return t.prototype=new Error,t.prototype.name="JpegError",t.constructor=t,t}();return function(){if(!self||!self.Uint8ClampedArray)return null;var t=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),r=4017,c=799,a=3406,n=2276,p=1567,o=3784,i=5793,l=2896;function s(){this.decodeTransform=null,this.colorTransform=-1}function m(d,f){for(var C,T,w=0,S=[],v=16;v>0&&!d[v-1];)v--;S.push({children:[],index:0});var A,k=S[0];for(C=0;C0;)k=S.pop();for(k.index++,S.push(k);S.length<=C;)S.push(A={children:[],index:0}),k.children[k.index]=A.children,k=A;w++}C+10)return P--,L>>P&1;if((L=d[f++])===255){var U=d[f++];if(U)throw new e("unexpected marker "+(L<<8|U).toString(16))}return P=7,L>>>7}function x(U){for(var j=U;;){if(typeof(j=j[I()])=="number")return j;if(typeof j!="object")throw new e("invalid huffman sequence")}}function O(U){for(var j=0;U>0;)j=j<<1|I(),U--;return j}function N(U){if(U===1)return I()===1?1:-1;var j=O(U);return j>=1<>4;if(Q!==0){var zt=t[re+=ie];U.blockData[j+zt]=N(Q),re++}else{if(ie<15)break;re+=16}}}function M(U,j){var K=x(U.huffmanTableDC),Z=K===0?0:N(K)<0)_--;else for(var K=S,Z=v;K<=Z;){var re=x(U.huffmanTableAC),se=15&re,Q=re>>4;if(se!==0){var ie=t[K+=Q];U.blockData[j+ie]=N(se)*(1<>4,(K=15&Z)==0)Q<15?(_=O(Q)+(1<=65488&&ye<=65495))break;f+=2}return(ae=g(d,f))&&ae.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+ae.invalid),f=ae.offset),f-E}function b(d,f,C){var T,w,S,v,A,k,D,R,E,L,P,I,x,O,N,V,M,B=d.quantizationTable,_=d.blockData;if(!B)throw new e("missing required Quantization Table.");for(var G=0;G<64;G+=8)E=_[f+G],L=_[f+G+1],P=_[f+G+2],I=_[f+G+3],x=_[f+G+4],O=_[f+G+5],N=_[f+G+6],V=_[f+G+7],E*=B[G],(L|P|I|x|O|N|V)!=0?(L*=B[G+1],P*=B[G+2],I*=B[G+3],x*=B[G+4],O*=B[G+5],N*=B[G+6],V*=B[G+7],w=(T=(T=i*E+128>>8)+(w=i*x+128>>8)+1>>1)-w,M=(S=P)*o+(v=N)*p+128>>8,S=S*p-v*o+128>>8,D=(A=(A=l*(L-V)+128>>8)+(D=O<<4)+1>>1)-D,k=(R=(R=l*(L+V)+128>>8)+(k=I<<4)+1>>1)-k,v=(T=T+(v=M)+1>>1)-v,S=(w=w+S+1>>1)-S,M=A*n+R*a+2048>>12,A=A*a-R*n+2048>>12,R=M,M=k*c+D*r+2048>>12,k=k*r-D*c+2048>>12,D=M,C[G]=T+R,C[G+7]=T-R,C[G+1]=w+D,C[G+6]=w-D,C[G+2]=S+k,C[G+5]=S-k,C[G+3]=v+A,C[G+4]=v-A):(M=i*E+512>>10,C[G]=M,C[G+1]=M,C[G+2]=M,C[G+3]=M,C[G+4]=M,C[G+5]=M,C[G+6]=M,C[G+7]=M);for(var F=0;F<8;++F)E=C[F],((L=C[F+8])|(P=C[F+16])|(I=C[F+24])|(x=C[F+32])|(O=C[F+40])|(N=C[F+48])|(V=C[F+56]))!=0?(w=(T=4112+((T=i*E+2048>>12)+(w=i*x+2048>>12)+1>>1))-w,M=(S=P)*o+(v=N)*p+2048>>12,S=S*p-v*o+2048>>12,v=M,D=(A=(A=l*(L-V)+2048>>12)+(D=O)+1>>1)-D,k=(R=(R=l*(L+V)+2048>>12)+(k=I)+1>>1)-k,M=A*n+R*a+2048>>12,A=A*a-R*n+2048>>12,R=M,M=k*c+D*r+2048>>12,k=k*r-D*c+2048>>12,E=(E=(T=T+v+1>>1)+R)<16?0:E>=4080?255:E>>4,L=(L=(w=w+S+1>>1)+(D=M))<16?0:L>=4080?255:L>>4,P=(P=(S=w-S)+k)<16?0:P>=4080?255:P>>4,I=(I=(v=T-v)+A)<16?0:I>=4080?255:I>>4,x=(x=v-A)<16?0:x>=4080?255:x>>4,O=(O=S-k)<16?0:O>=4080?255:O>>4,N=(N=w-D)<16?0:N>=4080?255:N>>4,V=(V=T-R)<16?0:V>=4080?255:V>>4,_[f+F]=E,_[f+F+8]=L,_[f+F+16]=P,_[f+F+24]=I,_[f+F+32]=x,_[f+F+40]=O,_[f+F+48]=N,_[f+F+56]=V):(M=(M=i*E+8192>>14)<-2040?0:M>=2024?255:M+2056>>4,_[f+F]=M,_[f+F+8]=M,_[f+F+16]=M,_[f+F+24]=M,_[f+F+32]=M,_[f+F+40]=M,_[f+F+48]=M,_[f+F+56]=M)}function h(d,f){for(var C=f.blocksPerLine,T=f.blocksPerColumn,w=new Int16Array(64),S=0;S=w)return null;var v=T(f);if(v>=65472&&v<=65534)return{invalid:null,marker:v,offset:f};for(var A=T(S);!(A>=65472&&A<=65534);){if(++S>=w)return null;A=T(S)}return{invalid:v.toString(16),marker:A,offset:S}}return s.prototype={parse:function(d){function f(){var U=d[v]<<8|d[v+1];return v+=2,U}function C(){var U=f(),j=v+U-2,K=g(d,j,v);K&&K.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+K.invalid),j=K.offset);var Z=d.subarray(v,j);return v+=Z.length,Z}function T(U){for(var j=Math.ceil(U.samplesPerLine/8/U.maxH),K=Math.ceil(U.scanLines/8/U.maxV),Z=0;Z>4==0)for(I=0;I<64;I++)M[t[I]]=d[v++];else{if(V>>4!=1)throw new e("DQT - invalid table spec");for(I=0;I<64;I++)M[t[I]]=f()}D[15&V]=M}break;case 65472:case 65473:case 65474:if(w)throw new e("Only single frame JPEGs supported");f(),(w={}).extended=L===65473,w.progressive=L===65474,w.precision=d[v++],w.scanLines=f(),w.samplesPerLine=f(),w.components=[],w.componentIds={};var B,_=d[v++],G=0,F=0;for(P=0;P<_;P++){B=d[v];var q=d[v+1]>>4,X=15&d[v+1];G>4==0?E:R)[15&ce]=m(ne,pe)}break;case 65501:f(),S=f();break;case 65498:f();var J,De=d[v++],me=[];for(P=0;P>4],J.huffmanTableAC=R[15&ge],me.push(J)}var Le=d[v++],Me=d[v++],fe=d[v++],Oe=y(d,v,w,me,S,Le,Me,fe>>4,15&fe);v+=Oe;break;case 65535:d[v]!==255&&v--;break;default:if(d[v-3]===255&&d[v-2]>=192&&d[v-2]<=254){v-=3;break}throw new e("unknown marker "+L.toString(16))}L=f()}for(this.width=w.samplesPerLine,this.height=w.scanLines,this.jfif=A,this.eof=v,this.adobe=k,this.components=[],P=0;P>8)+_[R+1];return V},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this.colorTransform!==0:this.colorTransform===1},_convertYccToRgb:function(d){for(var f,C,T,w=0,S=d.length;w4)throw new e("Unsupported color mode");var T=this._getLinearizedBlockData(d,f);if(this.numComponents===1&&C){for(var w=T.length,S=new Uint8ClampedArray(3*w),v=0,A=0;A=0;h--)u[d++]=g[y]>>h&1}catch{}if(o===1&&l.length===n*p)m=[l,l,l];else{for(m=[],y=0;y<3;y++)m.push(new Uint8Array(s));for(h=0,b=0;bimport("./lerc-wasm.8ece762d.js"),[]).then(e=>e.l).then(({default:e})=>e({locateFile:t=>Yt(`esri/layers/support/rasterFormats/${t}`)})).then(e=>{rr(e)}),ze)}const Ne={getBlobInfo:null,decode:null};function tr(e){return 16+(e>>3<<3)}function he(e,t,r){r.set(e.slice(t,t+r.length))}function rr(e){const{_malloc:t,_free:r,_lerc_getBlobInfo:c,_lerc_getDataRanges:a,_lerc_decode_4D:n,asm:p}=e;let o;const i=Object.values(p).find(s=>s&&"buffer"in s&&s.buffer===e.HEAPU8.buffer),l=s=>{const m=s.map(h=>tr(h)),u=m.reduce((h,g)=>h+g),y=t(u);o=new Uint8Array(i.buffer);let b=m[0];m[0]=y;for(let h=1;h{const y=new Uint8Array(48),b=new Uint8Array(8*3),[h,g,d]=l([s.length,y.length,b.length]);o.set(s,h),o.set(y,g),o.set(b,d);let f=c(h,s.length,g,d,12,3);if(f)throw r(h),`lerc-getBlobInfo: error code is ${f}`;o=new Uint8Array(i.buffer),he(o,g,y),he(o,d,b);const C=new Uint32Array(y.buffer),T=new Float64Array(b.buffer),[w,S,,v,A,k,D,R,E,L,P]=C,I={version:w,depthCount:L,width:v,height:A,validPixelCount:D,bandCount:k,blobSize:R,maskCount:E,dataType:S,minValue:T[0],maxValue:T[1],maxZerror:T[2],statistics:[],bandCountWithNoData:P};if(P)return I;if(L===1&&k===1)return r(h),I.statistics.push({minValue:T[0],maxValue:T[1]}),I;const x=L*k*8,O=new Uint8Array(x),N=new Uint8Array(x);let V=h,M=0,B=0,_=!1;if(o.byteLength1){const ve=G.slice(X*L,(X+1)*L),Se=F.slice(X*L,(X+1)*L),ce=Math.min.apply(null,ve),ne=Math.max.apply(null,Se);q.push({minValue:ce,maxValue:ne,depthStats:{minValues:ve,maxValues:Se}})}else q.push({minValue:G[X],maxValue:F[X]});return r(V),_||r(M),I},Ne.decode=(s,m)=>{const{maskCount:u,depthCount:y,bandCount:b,width:h,height:g,dataType:d,bandCountWithNoData:f}=m,C=Lt[d],T=h*g,w=new Uint8Array(T*b),S=T*y*b*C.size,v=new Uint8Array(S),A=new Uint8Array(b),k=new Uint8Array(8*b),[D,R,E,L,P]=l([s.length,w.length,v.length,A.length,k.length]);o.set(s,D),o.set(w,R),o.set(v,E),o.set(A,L),o.set(k,P);const I=n(D,s.length,u,R,y,h,g,b,d,E,L,P);if(I)throw r(D),`lerc-decode: error code is ${I}`;o=new Uint8Array(i.buffer),he(o,E,v),he(o,R,w);let x=null;if(f){he(o,L,A),he(o,P,k),x=[];const O=new Float64Array(k.buffer);for(let N=0;N1){T.set(d[0]);for(let D=1;D=w;if(u>0&&S)for(let D=0;D1?d:null,{pixelType:A}=b;return{width:o,height:i,bandCount:l,pixelType:A,depthCount:s,statistics:y,pixels:g,mask:T,bandMasks:v}}function ir(e,t,r,c=!0){if(t%4!=0||r%4!=0){const a=new ArrayBuffer(4*Math.ceil(r/4)),n=new Uint8Array(a),p=new Uint8Array(e,t,r);if(c)for(let o=0;o=n)o-=n,u=m>>>32-n,m<<=n;else{u=m>>>32-o,m=a[s++];const d=n-o;o=32-d,u=(u<>>o),m<<=d}if(u===257)break;if(u===256){n=9,p=bt(),i=p.length,l=[];continue}const g=p[u];if(g==null){if(u>p.length)throw"data integrity issue: code does not exist on code page";l.push(l[0]),p[i++]=l.slice(),Tt(h,l)}else Tt(h,g),l.push(g[0]),l.length>1&&(p[i++]=l.slice()),l=g.slice();if(ke.has(i)&&n++,o===0&&(m=a[s++],o=32),s>y||s===y&&o<=b)break}return new Uint8Array(h)}ke.add(511),ke.add(1023),ke.add(2047),ke.add(4095),ke.add(8191);const vt=(e,t)=>{const r=t.width*t.height,c=t.pixelType;return Math.floor(e.byteLength/(r*Ut(c)))},Ut=e=>{let t=1;switch(e){case Uint8Array:case Int8Array:t=1;break;case Uint16Array:case Int16Array:t=2;break;case Uint32Array:case Int32Array:case Float32Array:t=4;break;case Float64Array:t=8}return t},nr=(e,t)=>{if(8*e.byteLength=0;o--)c[a++]=n>>o&1;for(o=7;a>o&1,o--;return c};class ar{static decode(t,r){const c=r.pixelType,a=[],n=r.width*r.height,p=vt(t,r),{bandIds:o,format:i}=r,l=o&&o.length||vt(t,r),s=t.byteLength-t.byteLength%(n*Ut(c)),m=new c(t,0,n*p);let u,y,b,h,g=null;if(i==="bip")for(u=0;u>4,a<8?a=1:a===15?(a=4,n=(7&n)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++]):a===14?(a=3,n=(15&n)<<12|(63&e[r++])<<6|63&e[r++]):(a=2,n=(31&n)<<6|63&e[r++]),(n!==0||t)&&(c+=String.fromCharCode(n));return c}const ot=(()=>{const e=[];return e[254]="NEWSUBFILETYPE",e[255]="SUBFILETYPE",e[256]="IMAGEWIDTH",e[257]="IMAGELENGTH",e[258]="BITSPERSAMPLE",e[259]="COMPRESSION",e[262]="PHOTOMETRICINTERPRETATION",e[263]="THRESHHOLDING",e[264]="CELLWIDTH",e[265]="CELLLENGTH",e[266]="FILLORDER",e[269]="DOCUMENTNAME",e[270]="IMAGEDESCRIPTION",e[271]="MAKE",e[272]="MODEL",e[273]="STRIPOFFSETS",e[274]="ORIENTATION",e[277]="SAMPLESPERPIXEL",e[278]="ROWSPERSTRIP",e[279]="STRIPBYTECOUNTS",e[280]="MINSAMPLEVALUE",e[281]="MAXSAMPLEVALUE",e[282]="XRESOLUTION",e[283]="YRESOLUTION",e[284]="PLANARCONFIGURATION",e[285]="PAGENAME",e[286]="XPOSITION",e[287]="YPOSITION",e[288]="FREEOFFSETS",e[289]="FREEBYTECOUNTS",e[290]="GRAYRESPONSEUNIT",e[291]="GRAYRESPONSECURVE",e[292]="T4OPTIONS",e[293]="T6OPTIONS",e[296]="RESOLUTIONUNIT",e[297]="PAGENUMBER",e[300]="COLORRESPONSEUNIT",e[301]="TRANSFERFUNCTION",e[305]="SOFTWARE",e[306]="DATETIME",e[315]="ARTIST",e[316]="HOSTCOMPUTER",e[317]="PREDICTOR",e[318]="WHITEPOINT",e[319]="PRIMARYCHROMATICITIES",e[320]="COLORMAP",e[321]="HALFTONEHINTS",e[322]="TILEWIDTH",e[323]="TILELENGTH",e[324]="TILEOFFSETS",e[325]="TILEBYTECOUNTS",e[326]="BADFAXLINES",e[327]="CLEANFAXDATA",e[328]="CONSECUTIVEBADFAXLINES",e[330]="SUBIFD",e[332]="INKSET",e[333]="INKNAMES",e[334]="NUMBEROFINKS",e[336]="DOTRANGE",e[337]="TARGETPRINTER",e[338]="EXTRASAMPLES",e[339]="SAMPLEFORMAT",e[340]="SMINSAMPLEVALUE",e[341]="SMAXSAMPLEVALUE",e[342]="TRANSFERRANGE",e[347]="JPEGTABLES",e[512]="JPEGPROC",e[513]="JPEGIFOFFSET",e[514]="JPEGIFBYTECOUNT",e[515]="JPEGRESTARTINTERVAL",e[517]="JPEGLOSSLESSPREDICTORS",e[518]="JPEGPOINTTRANSFORM",e[519]="JPEGQTABLES",e[520]="JPEGDCTABLES",e[521]="JPEGACTABLES",e[529]="YCBCRCOEFFICIENTS",e[530]="YCBCRSUBSAMPLING",e[531]="YCBCRPOSITIONING",e[532]="REFERENCEBLACKWHITE",e[700]="XMP",e[33550]="GEOPIXELSCALE",e[33922]="GEOTIEPOINTS",e[33432]="COPYRIGHT",e[42112]="GDAL_METADATA",e[42113]="GDAL_NODATA",e[50844]="RPCCOEFFICIENT",e[34264]="GEOTRANSMATRIX",e[34735]="GEOKEYDIRECTORY",e[34736]="GEODOUBLEPARAMS",e[34737]="GEOASCIIPARAMS",e[34665]="EXIFIFD",e[34853]="GPSIFD",e[40965]="INTEROPERABILITYIFD",e})(),lr=(()=>{const e=ot.slice();return e[36864]="ExifVersion",e[40960]="FlashpixVersion",e[40961]="ColorSpace",e[42240]="Gamma",e[37121]="ComponentsConfiguration",e[37122]="CompressedBitsPerPixel",e[40962]="PixelXDimension",e[40963]="PixelYDimension",e[37500]="MakerNote",e[37510]="UserComment",e[40964]="RelatedSoundFile",e[36867]="DateTimeOriginal",e[36868]="DateTimeDigitized",e[36880]="OffsetTime",e[36881]="OffsetTimeOriginal",e[36882]="OffsetTimeDigitized",e[37520]="SubSecTime",e[37521]="SubSecTimeOriginal",e[37522]="SubSecTimeDigitized",e[37888]="Temperature",e[37889]="Humidity",e[37890]="Pressure",e[37891]="WaterDepth",e[37892]="Acceleration",e[37893]="CameraElevationAngle",e[42016]="ImageUniqueID",e[42032]="CameraOwnerName",e[42033]="BodySerialNumber",e[42034]="LensSpecification",e[42035]="LensMake",e[42036]="LensModel",e[42037]="LensSerialNumber",e[33434]="ExposureTime",e[33437]="FNumber",e[34850]="ExposureProgram",e[34852]="SpectralSensitivity",e[34855]="PhotographicSensitivity",e[34856]="OECF",e[34864]="SensitivityType",e[34865]="StandardOutputSensitivity",e[34866]="RecommendedExposureIndex",e[34867]="ISOSpeed",e[34868]="ISOSpeedLatitudeyyy",e[34869]="ISOSpeedLatitudezzz",e[37377]="ShutterSpeedValue",e[37378]="ApertureValue",e[37379]="BrightnessValue",e[37380]="ExposureBiasValue",e[37381]="MaxApertureValue",e[37382]="SubjectDistance",e[37383]="MeteringMode",e[37384]="LightSource",e[37385]="Flash",e[37386]="FocalLength",e[37396]="SubjectArea",e[41483]="FlashEnergy",e[41484]="SpatialFrequencyResponse",e[41486]="FocalPlaneXResolution",e[41487]="FocalPlaneYResolution",e[41488]="FocalPlaneResolutionUnit",e[41492]="SubjectLocation",e[41493]="ExposureIndex",e[41495]="SensingMethod",e[41728]="FileSource",e[41729]="SceneType",e[41730]="CFAPattern",e[41985]="CustomRendered",e[41986]="ExposureMode",e[41987]="WhiteBalance",e[41988]="DigitalZoomRatio",e[41989]="FocalLengthIn35mmFilm",e[41990]="SceneCaptureType",e[41991]="GainControl",e[41992]="Contrast",e[41993]="Saturation",e[41994]="Sharpness",e[41995]="DeviceSettingDescription",e[41996]="SubjectDistanceRange",e})(),cr=["GPSVersionID","GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp","GPSSatellites","GPSStatus","GPSMeasureMode","GPSDOP","GPSSpeedRef","GPSSpeed","GPSTrackRef","GPSTrack","GPSImgDirectionRef","GPSImgDirection","GPSMapDatum","GPSDestLatitudeRef","GPSDestLatitude","GPSDestLongitudeRef","GPSDestLongitude","GPSDestBearingRef","GPSDestBearing","GPSDestDistanceRef","GPSDestDistance","GPSProcessingMethod","GPSAreaInformation","GPSDateStamp","GPSDifferential","GPSHPositioningError"],ur=(()=>{const e=[];return e[1024]="GTModelTypeGeoKey",e[1025]="GTRasterTypeGeoKey",e[1026]="GTCitationGeoKey",e[2048]="GeographicTypeGeoKey",e[2049]="GeogCitationGeoKey",e[2050]="GeogGeodeticDatumGeoKey",e[2051]="GeogPrimeMeridianGeoKey",e[2052]="GeogLinearUnitsGeoKey",e[2053]="GeogLinearUnitSizeGeoKey",e[2054]="GeogAngularUnitsGeoKey",e[2055]="GeogAngularUnitSizeGeoKey",e[2056]="GeogEllipsoidGeoKey",e[2057]="GeogSemiMajorAxisGeoKey",e[2058]="GeogSemiMinorAxisGeoKey",e[2059]="GeogInvFlatteningGeoKey",e[2061]="GeogPrimeMeridianLongGeoKey",e[2060]="GeogAzimuthUnitsGeoKey",e[3072]="ProjectedCSTypeGeoKey",e[3073]="PCSCitationGeoKey",e[3074]="ProjectionGeoKey",e[3075]="ProjCoordTransGeoKey",e[3076]="ProjLinearUnitsGeoKey",e[3077]="ProjLinearUnitSizeGeoKey",e[3078]="ProjStdParallel1GeoKey",e[3079]="ProjStdParallel2GeoKey",e[3080]="ProjNatOriginLongGeoKey",e[3081]="ProjNatOriginLatGeoKey",e[3082]="ProjFalseEastingGeoKey",e[3083]="ProjFalseNorthingGeoKey",e[3084]="ProjFalseOriginLongGeoKey",e[3085]="ProjFalseOriginLatGeoKey",e[3086]="ProjFalseOriginEastingGeoKey",e[3087]="ProjFalseOriginNorthingGeoKey",e[3088]="ProjCenterLongGeoKey",e[3090]="ProjCenterEastingGeoKey",e[3091]="ProjCenterNorthingGeoKey",e[3092]="ProjScaleAtNatOriginGeoKey",e[3093]="ProjScaleAtCenterGeoKey",e[3094]="ProjAzimuthAngleGeoKey",e[3095]="ProjStraightVertPoleLongGeoKey",e[4096]="VerticalCSTypeGeoKey",e[4097]="VerticalCitationGeoKey",e[4098]="VerticalDatumGeoKey",e[4099]="VerticalUnitsGeoKey",e})(),fr=(e,t)=>{let r=(t||ot)[e];return r===void 0&&(r="unknown"+String(e)),r},He=new Map;He.set("EXIFIFD",lr),He.set("GPSIFD",cr);const Ie={TIFF_TAGS:ot,ifdTags:He,GEO_KEYS:ur,getTagName:fr},it=(()=>{const e=new ArrayBuffer(4),t=new Uint8Array(e);return new Uint32Array(e)[0]=1,t[0]===1})(),St=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],xe=4294967296,hr=new Set([1,5,6,7,8,34712,34887]);function Gt(e,t){let r="unknown";return e===3?r=t===64?"f64":"f32":e===1?t===1?r="u1":t===2?r="u2":t===4?r="u4":t<=8?r="u8":t<=16?r="u16":t<=32&&(r="u32"):e===2&&(t<=8?r="s8":t<=16?r="s16":t<=32&&(r="s32")),r}function Ve(e){let t=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;case"f64":t=Float64Array;break;default:t=Float32Array}return t}function dr(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function _t(e,t){var r;return(r=e.get(t))==null?void 0:r.values}function be(e,t){var r;return(r=e.get(t))==null?void 0:r.values}function We(e,t){var r,c;return(c=(r=e.get(t))==null?void 0:r.values)==null?void 0:c[0]}function W(e,t){var r,c;return(c=(r=e.get(t))==null?void 0:r.values)==null?void 0:c[0]}function Ke(e,t,r,c=0,a=Ie.TIFF_TAGS,n=4){const p=n===8,o=p?st(new DataView(e,r,8),0,t):new DataView(e,r,2).getUint16(0,t),i=4+2*n,l=p?8:2,s=l+o*i;if(r+s>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:s};const m=r+s+4<=e.byteLength?Ge(new DataView(e,r+s,n===8?8:4),0,t,n===8):null,u=r+l,y=new Map;let b,h,g,d,f,C=0,T=0;for(let w=0;wOt(e,{inputOffset:t}).pixels[0];async function qe(e,t,r,c,a){var d,f;const n=it===t,p=W(r,"BITSPERSAMPLE"),o=Gt((d=W(r,"SAMPLEFORMAT"))!=null?d:1,p),i=(f=W(r,"COMPRESSION"))!=null?f:1,l=Ve(o);let s,m,u,y,b,h,g;if(i===34887)return await Mt(),pr(e,c);if(i===1)g=e.slice(c,c+a),u=new Uint8Array(g);else if(i===8||i===32946)u=new Uint8Array(e,c,a),b=new Te(u),h=b.getBytes(),g=new ArrayBuffer(h.length),u=new Uint8Array(g),u.set(h);else if(i===6){u=new Uint8Array(e,c,a);const C=new Be;C.parse(u);const T=C.getData(C.width,C.height,!0);g=new ArrayBuffer(T.length),u=new Uint8Array(g),u.set(T)}else if(i===7){const C=r.get("JPEGTABLES").values,T=C.length-2;u=new Uint8Array(T+a-2);for(let A=0;A1){const x=Math.round(c.length/m);for(d=0;d{var L;const c=it===t.littleEndian,a=be(r,"STRIPOFFSETS");if(a===void 0)return null;const{width:n,height:p,pixelType:o}=nt([r]),i=t.planes,l=n*p,s=W(r,"BITSPERSAMPLE"),m=Ve(o),u=new m(l*i),y=be(r,"STRIPBYTECOUNTS"),b=W(r,"ROWSPERSTRIP"),h=(L=W(r,"COMPRESSION"))!=null?L:1;let g,d,f,C,T,w,S,v,A,k,D,R=b;if(s%8==0)for(g=0;gp?p-g*b:b,o==="u8"||o==="s8"||c){if(h===8||h===32946)S=new Uint8Array(e,a[g],y[g]),k=new Te(S),D=k.getBytes(),w=new ArrayBuffer(D.length),S=new Uint8Array(w),S.set(D),S.length!==R*n*i*s/8&&console.log("strip byte counts is different than expected");else if(h===6){S=new Uint8Array(e,a[g],y[g]);const P=new Be;P.parse(S);const I=P.getData(P.width,P.height,!0);w=new ArrayBuffer(I.length),S=new Uint8Array(w),S.set(I)}else h===5?(S=rt(e,a[g],y[g],t.littleEndian),w=S.buffer):(y[g]!==R*n*i*s/8&&console.log("strip byte counts is different than expected"),w=e.slice(a[g],a[g]+y[g]));C=new m(w)}else{switch(h===6||h===8||h===32946?(S=new Uint8Array(e,a[g],y[g]),k=new Te(S),S=k.getBytes(),w=new ArrayBuffer(S.length),v=new Uint8Array(w),S.length!==R*n*i*s/8&&console.log("strip byte counts is different than expected")):(y[g]!==R*n*i*s/8&&console.log("strip byte counts is different than expected"),w=new ArrayBuffer(y[g]),S=new Uint8Array(e,a[g],y[g]),v=new Uint8Array(w)),o){case"u16":case"s16":for(f=0;f{if(!(e&&e.length>0&&t&&r))return null;let c,a,n;const p=e[0].length,o=e.length,i=new Uint8Array(p);for(let l=0;ln?0:1;else for(let s=0;sn?0:1);return i},Cr=e=>{if(!e)return null;const t=e.match(//gi);if(!t||t.length===0)return null;const r=new Map;let c,a,n,p,o;for(let d=0;d")),p=c.indexOf("sample="),p>-1&&(o=c.slice(p+8,c.indexOf('"',p+8))),p=c.indexOf("name="),p>-1&&(a=c.slice(p+6,c.indexOf('"',p+6))),a&&(n=c.slice(c.indexOf(">")+1,c.indexOf("")).trim(),o!=null?r.has(a)?r.get(a)[o]=n:r.set(a,[n]):r.set(a,n)),o=null;const i=r.get("STATISTICS_MINIMUM"),l=r.get("STATISTICS_MAXIMUM"),s=r.get("STATISTICS_MEAN"),m=r.get("STATISTICS_STDDEV");let u=null;if(i&&l){u=[];for(let d=0;dg&&u>(a?e.byteLength:e?e.byteLength-i+c:0))return r.offlineOffsetSize=[i,u],r.values=null,!1;if(y<=g){if(!t)if(g<=32)i>>>=32-y;else{const f=d!=null&&d.length?d[0]:i>>>0,C=d!=null&&d.length?d[1]:Math.round((i-f)/xe);y<=32?(i=f>>>32-y,d[0]=i):(i=f*2**(32-y)+(C>>>32-y),d[0]=f,d[1]=C>>>32-y)}if(o===1&&m===g)l=[i];else if(g===64){const f=d!=null&&d.length?d[0]:i>>>0,C=d!=null&&d.length?d[1]:Math.round((i-f)/xe);let T=f,w=32;for(h=1;h<=o;h++){const S=32-m*h%32;if(w>>32-w,A=C<<32-w>>>32-w;T=C,l.push(v+A*2**(m-w)),w-=32-(m-w)}else l.push(T<>>32-m),w-=m;w===0&&(w=32,T=C)}}else for(h=1;h<=o;h++){const f=32-m*h;l.push(i<>>32-m)}}else{i-=c,a&&(i=0);for(let f=i;fparseFloat(M)),u.some(M=>isNaN(M))&&(u=null));const y=(V=W(t,"COMPRESSION"))!=null?V:1;let b;switch(y){case 1:b="NONE";break;case 2:case 3:case 4:case 32771:b="CCITT";break;case 5:b="LZW";break;case 6:case 7:b="JPEG";break;case 32773:b="PACKBITS";break;case 8:case 32946:b="DEFLATE";break;case 34712:b="JPEG2000";break;case 34887:b="LERC";break;default:b=String(y)}let h=!0,g="";hr.has(y)||(h=!1,g+="unsupported tag compression "+y),i>3&&(h=!1,g+="unsupported tag sampleFormat "+i),p%8!=0&&(h=!1,g+="unsupported tag bitsPerSample "+p);const d=We(t,"GEOASCIIPARAMS");let f;if(d){const M=d.split("|").find(_=>_.includes("ESRI PE String = ")),B=M?M.replace("ESRI PE String = ",""):"";f=B.startsWith("COMPD_CS")||B.startsWith("PROJCS")||B.startsWith("GEOGCS")?{wkid:null,wkt:B}:null}const C=be(t,"GEOTIEPOINTS"),T=be(t,"GEOPIXELSCALE"),w=be(t,"GEOTRANSMATRIX"),S=t.has("GEOKEYDIRECTORY")?t.get("GEOKEYDIRECTORY").data:null;let v,A,k=!1;if(S){k=W(S,"GTRasterTypeGeoKey")===2;const M=W(S,"GTModelTypeGeoKey");if(M===2){const B=W(S,"GeographicTypeGeoKey");B>=1024&&B<=32766&&(f={wkid:B})}else if(M===1){const B=W(S,"ProjectedCSTypeGeoKey");B>=1024&&B<=32766&&(f={wkid:B})}}if(T&&C&&C.length>=6?(v=[T[0],0,C[3]-C[0]*T[0],0,-Math.abs(T[1]),C[4]-C[1]*T[1]],k&&(v[2]-=.5*v[0]+.5*v[1],v[5]-=.5*v[3]+.5*v[4])):w&&w.length===16&&(v=k?[w[0],w[1],w[3]-.5*w[0],w[4],w[5],w[7]-.5*w[5]]:[w[0],w[1],w[3],w[4],w[5],w[7]]),v){const M=[{x:0,y:n},{x:0,y:0},{x:a,y:n},{x:a,y:0}];let B,_=Number.POSITIVE_INFINITY,G=Number.POSITIVE_INFINITY,F=Number.NEGATIVE_INFINITY,q=Number.NEGATIVE_INFINITY;for(let X=0;X_?_:B.x,F=B.xG?G:B.y,q=B.yWe(M,"NEWSUBFILETYPE")===1);let R,E,L,P,I;if(D.length>0){L=Math.round(Math.log(a/W(D[0],"IMAGEWIDTH"))/Math.LN2);const M=D[D.length-1];P=Math.round(Math.log(a/W(M,"IMAGEWIDTH"))/Math.LN2),R=W(M,"TILEWIDTH"),E=W(M,"TILELENGTH")}R=P!=null&&P>0?R||r:null,E=P!=null&&P>0?E||c:null,r&&(I=[{maxCol:Math.ceil(a/r)-1,maxRow:Math.ceil(n/c)-1,minRow:0,minCol:0}],D.forEach(M=>{I.push({maxCol:Math.ceil(W(M,"IMAGEWIDTH")/W(M,"TILEWIDTH"))-1,maxRow:Math.ceil(W(M,"IMAGELENGTH")/W(M,"TILELENGTH"))-1,minRow:0,minCol:0})}));const x=We(e[0],"GDAL_METADATA"),O=Cr(x);return g+=" "+Bt({width:a,height:n,tileWidth:r,tileHeight:c,planes:o,ifds:e}),{width:a,height:n,tileWidth:r,tileHeight:c,planes:o,isBSQ:s,pixelType:l,compression:b,noData:u,isSupported:h,message:g,extent:A,affine:T?null:v,firstPyramidLevel:L,maximumPyramidLevel:P,pyramidBlockWidth:R,pyramidBlockHeight:E,tileBoundary:I,metadata:O}}function at(e,t){const r=_t(e,"PLANARCONFIGURATION");return r?r[0]===2:!!t&&t.isBSQ}function br(e){const{littleEndian:t,isBigTiff:r,firstIFDPos:c}=vr(e);let a=c;const n=[];do{const p=Sr(e,t,a,0,Ie.TIFF_TAGS,r?8:4);if(!p.success)break;n.push(p.ifd),a=p.nextIFD}while(a>0);return{...nt(n),littleEndian:t,isBigTiff:r,ifds:n}}function st(e,t,r){const c=e.getUint32(t,r),a=e.getUint32(t+4,r);return r?a*xe+c:c*xe+a}function Tr(e,t,r){let c=r?e.getInt32(t,r):e.getUint32(t,r),a=r?e.getUint32(t+4,r):e.getInt32(t+4,r);const n=(r?c:a)>=0?1:-1;return r?c*=n:a*=n,n*(r?a*xe+c:c*xe+a)}function Ge(e,t,r,c){return c?st(e,t,r):e.getUint32(t,r)}function vr(e){const t=new DataView(e,0,16),r=t.getUint16(0,!1);let c=null;if(r===18761)c=!0;else{if(r!==19789)throw"unexpected endianess byte";c=!1}const a=t.getUint16(2,c);if(a!==42&&a!==43)throw"unexpected tiff identifier";let n=4;const p=a===43;if(p){const o=t.getUint16(n,c);if(n+=2,o!==8||t.getUint16(n,c)!==0)throw"unsupported bigtiff version";n+=2}return{littleEndian:c,isBigTiff:p,firstIFDPos:Ge(t,n,c,p)}}function Sr(e,t,r,c=0,a=Ie.TIFF_TAGS,n=4){const p=Ke(e,t,r,c,a,n);let o;const i=p.ifd;if(i){if(Ie.ifdTags.forEach((l,s)=>{i.has(s)&&(o=i.get(s),o.data=Ke(e,t,o.valueOffset-c,c,l).ifd)}),i.has("GEOKEYDIRECTORY")){o=i.get("GEOKEYDIRECTORY");const l=o.values;if(l&&l.length>4){const s=l[0]+"."+l[1]+"."+l[2];o.data=Ke(e,t,o.valueOffset+6-c,c,Ie.GEO_KEYS,2).ifd,o.data&&o.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[s]})}}if(i.has("XMP")){o=i.get("XMP");const l=o.values;typeof l[0]=="number"&&o.type===7&&(o.values=[sr(new Uint8Array(l))])}}return p}function Bt(e){const{width:t,height:r,tileHeight:c,tileWidth:a}=e,n=e.planes,p=a?a*c:t*r,o=W(e.ifds[0],"BITSPERSAMPLE");let i="";return p*n>2**30/(o>8?o/8:1)&&(i=a?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),i}async function kr(e,t){var k;const{headerInfo:r,ifd:c,offsets:a,sizes:n}=t,p=[];for(let D=0;DD.min):null,S=T?T.map(D=>D.max):null;let v,A=null;if(C!=null)if(A=new Uint8Array(b),Math.abs(C)>1e24)for(v=0;v1e24)for(o=0;ol;0<=l?++C:--C)i.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(l),(d=255-this.transparency.indexed.length)>0)for(T=0;0<=d?Td;0<=d?++T:--T)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(l)[0];break;case 2:this.transparency.rgb=this.read(l)}break;case"tEXt":b=(f=this.read(l)).indexOf(0),h=String.fromCharCode.apply(String,f.slice(0,b)),this.text[h]=String.fromCharCode.apply(String,f.slice(b+1));break;case"IEND":return y&&this.animation.frames.push(y),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=(w=this.colorType)===4||w===6,s=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*s,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=l}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return o.load=function(i,l,s){var m;return typeof l=="function"&&(s=l),(m=new XMLHttpRequest).open("GET",i,!0),m.responseType="arraybuffer",m.onload=function(){var u;return u=new o(new Uint8Array(m.response||m.mozResponseArrayBuffer)),typeof(l!=null?l.getContext:void 0)=="function"&&u.render(l),typeof s=="function"?s(u):void 0},m.send(null)},r=1,c=2,t=0,o.prototype.read=function(i){var l,s;for(s=[],l=0;0<=i?li;0<=i?++l:--l)s.push(this.data[this.pos++]);return s},o.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},o.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},o.prototype.decodePixels=function(i){var l,s,m,u,y,b,h,g,d,f,C,T,w,S,v,A,k,D,R,E,L,P,I;if(i==null&&(i=this.imgData),i.length===0)return new Uint8Array(0);for(i=(i=new Te(i)).getBytes(),A=(T=this.pixelBitlength/8)*this.width,w=new Uint8Array(A*this.height),b=i.length,v=0,S=0,s=0;S1&&s/uMr(r,c,e);break;case"tiff":t=Pr;break;case"deflate":t=Er;break;case"lzw":t=Lr;break;case"error":t=()=>{throw new de("rasterCodec:decode","input data contains error")};break;default:t=()=>{throw new de("rasterCodec:decode","unsupported raster format")}}return t}function Br(e){let t=null,r=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":r=255,t=Uint8Array;break;case"u16":r=r||65535,t=Uint16Array;break;case"u32":r=r||2**32-1,t=Uint32Array;break;case"s8":r=r||-128,t=Int8Array;break;case"s16":r=r||-32768,t=Int16Array;break;case"s32":r=r||0-2**31,t=Int32Array;break;default:t=Float32Array}return{pixelTypeCtor:t,noDataValue:r}}function Nr(e,t=1){if(!e)return;const{pixels:r,width:c,height:a,mask:n}=e;if(!r||r.length===0)return;const p=r.length,o=c-1,i=a-1,l=[];let s,m,u,y,b,h,g=null;const d=oe.getPixelArrayConstructor(e.pixelType);if(t===0){for(s=0;s.001&&(u/=111e3,y/=111e3),p==="adjusted")if(o){const E=111e3*s,L=111e3*m;u=(l+E**a*n)/(8*E),y=(l+L**a*n)/(8*L)}else u=(l+s**a*n)/(8*s),y=(l+m**a*n)/(8*m);let b=(90-t)*Math.PI/180,h=Math.cos(b),g=(360-r+90)*Math.PI/180,d=Math.sin(b)*Math.cos(g),f=Math.sin(b)*Math.sin(g);const C=[315,270,225,360,180,0],T=[60,60,60,60,60,90],w=new Float32Array([3,5,3,2,1,4]),S=w.reduce((E,L)=>E+L),v=w.map(E=>E/S),A=c==="multi-directional"?C.length:1,k=new Float32Array(6),D=new Float32Array(6),R=new Float32Array(6);if(c==="multi-directional")for(let E=0;Eb?b:g],C=p[h],T=C*f,w=T*(1-Math.abs(d%2-1)),S=C-T;switch(Math.floor(d)){case 0:m[h]=T+S,u[h]=w+S,y[h]=S;break;case 1:m[h]=w+S,u[h]=T+S,y[h]=S;break;case 2:m[h]=S,u[h]=T+S,y[h]=w+S;break;case 3:m[h]=S,u[h]=w+S,y[h]=T+S;break;case 4:m[h]=w+S,u[h]=S,y[h]=T+S;break;case 5:case 6:m[h]=T+S,u[h]=S,y[h]=w+S}}e.pixels=[m,u,y],e.updateStatistics()}function mo(e,t){var E,L;if(!Ae(e))return e;const r=t.zFactor,c=(E=t.pixelSizePower)!=null?E:1,a=(L=t.pixelSizeFactor)!=null?L:1,n=t.slopeType,p=t.isGCS,{width:o,height:i,mask:l}=e,s=e.pixels[0],m=new Uint8Array(o*i);let u=1;if(H(l)){for(let P=0;P360&&(R%=360)),o[S+v]=R}}for(let w=0;wt[r]+2||e[r]{if(Ue(e.fromColor.toRgb(),a.fromColor)&&Ue(e.toColor.toRgb(),a.toColor))return c=a.id,!0}):e.type==="multipart"&&r.some(a=>{const n=e.colorRamps,p=a.colorRamps;if(n&&p&&n.length===p.length&&!p.some((o,i)=>{if(!Ue(n[i].fromColor.toRgb(),new lt(o.fromColor).toRgb())||!Ue(n[i].toColor.toRgb(),new lt(o.toColor).toRgb()))return!0})){if(c)return!0;c=a.id}}),c}function Wr(e){const t=zr(e);return t?jr[t]:null}function Ee(e){const t=(e=e||{}).numColors||256,r=e.distanceOffset||0,c=e.isCustomInterval!=null?e.isCustomInterval:e.distanceInterval!==null&&e.distanceInterval!==1/(t-1),a=e.distanceInterval||1/(t-1);return{...e,numColors:t,distanceOffset:r,interpolateAlpha:!!e.interpolateAlpha,distanceInterval:a,isCustomInterval:c,weights:e.weights}}function Kr(e,t,r){const{numColors:c,distanceOffset:a,distanceInterval:n,isCustomInterval:p}=Ee(r),o=e.s===0,i=t.s===0;let l=e.h,s=t.h;o&&!i?l=s:i&&!o&&(t={...t,h:l},s=l);let m,u=Math.abs(s-l);const y=360;us?u*n:-u*n);const b=(t.s-e.s)*n,h=(t.v-e.v)*n;let{s:g,v:d}=e,f=l;if(a){const T=a/n;f=(f+T*m+y)%y,g+=T*b,d+=T*h}const C=[];for(let T=0;Ty+b);a=a.map(y=>y/u)}else{a=[];for(let u=0;u{a.unshift(n),r||a.pop()}),c}function yo(e){const t=Wr(e);if(e){if(e.type==="algorithmic")return{...It(e),Name:t};if(e.colorRamps){const r=e.colorRamps.map(It);return{type:"MultiPartColorRamp",NumColorRamps:r.length,ArrayOfColorRamp:r,Name:t}}}}function It(e){var t;if(!!e)return{Algorithm:((t=e.toJSON())==null?void 0:t.Algorithm)||"esriHSVAlgorithm",type:"AlgorithmicColorRamp",FromColor:At(e.fromColor),ToColor:At(e.toColor)}}function At(e){const t=_e(e);return{type:"HsvColor",Hue:t.h,Saturation:t.s,Value:t.v,AlphaValue:255}}function Co(e){const t=e.reverse().map(r=>{const c=r.toString(16);return c.length<2?"0"+c:c});return 4294967295&Number.parseInt(t.join(""),16)}const wo=new Ht({none:"none",standardDeviation:"standard-deviation",histogramEqualization:"histogram-equalization",minMax:"min-max",percentClip:"percent-clip",sigmoid:"sigmoid"}),Xr={0:"none",3:"standardDeviation",4:"histogramEqualization",5:"minMax",6:"percentClip",9:"sigmoid"},xt={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34e38,34e38],f64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Je=1,Zr=[.299,.587,.114];function jt(e,t=256){t=Math.min(t,256);const{size:r,counts:c}=e,a=new Uint8Array(r),n=c.reduce((s,m)=>s+m/t,0);let p=0,o=0,i=0,l=n;for(let s=0;s=o,h=[];if(b)for(i=0;i1?c[i]>2?h[i]=6.5+(c[i]-2)**2.5:h[i]=6.5+100*(2-c[i])**4:h[i]=1;let g;const d=[];let f,C,T;if(b)for(i=0;i1&&(C-=(1/y)**(g*h[i])),ft[i]?T[l]=Math.floor(C*y*g**(1/c[i]))+n:f>=r[i]?T[l]=p:T[l]=n;d[i]=T}else for(i=0;i=r[i]?T[l]=p:T[l]=Math.floor((f-t[i])/u[i]*y)+n;d[i]=T}if(e.contrastOffset!=null){const w=Qr(e.contrastOffset,e.brightnessOffset);for(i=0;i0&&r<100?o=(200*p-100*a+2*a*c)/(2*(100-r))+n:r<=0&&r>-100?o=(200*p-100*a+2*a*c)*(100+r)/2e4+n:r===100?(o=200*p-100*a+(a+1)*(100-r)+2*a*c,o=o>0?a:0):r===-100&&(o=n),i[p]=o>a?a:o<0?0:o;return i}function eo(e,t,r){const c=[];for(let a=0;a=255)return Je;let t=0;e!==150&&(t=e<=150?45*Math.cos(.01047*e):17*Math.sin(.021*e));const r=255,c=e+t,a=Math.log(e/r),n=Math.log(c/r);if(n===0)return Je;const p=a/n;return isNaN(p)?Je:Math.min(9.9,Math.max(.01,p))}function ro(e){var k;if(Fe(e)||!((k=e.pixels)!=null&&k.length))return null;e.statistics||e.updateStatistics();const{pixels:t,mask:r,pixelType:c,statistics:a}=e,n=e.width*e.height,p=t.length;let o,i,l,s,m;const u=[],y=[];let b,h,g,d,f,C,T,w,S,v;const A=256;for(s=0;s[k.minValue,k.maxValue,0,0]);else{const k=ro(r);p=H(k)?k.statistics:null,o=H(k)?k.histograms:null}else p=((A=e.statistics)==null?void 0:A.length)>0?e.statistics:we(n.statistics),o=e.histograms||we(n.histograms);i!=="percentClip"&&i!=="histogramEqualization"||(o==null?void 0:o.length)||(i="minMax");const l=(p==null?void 0:p.length)||(o==null?void 0:o.length)||n.bandCount,s=[],m=[];let u,y,b,h,g,d,f,C,T,w,S,v;switch(p&&!Array.isArray(p[0])&&(p=p.map(k=>[k.min,k.max,k.avg,k.stddev])),i){case"none":{const k=xt[n.pixelType]||xt.f32;for(C=0;Cp[C][1]&&(m[C]=p[C][1]);break;case"histogramEqualization":for(le(o),C=0;C=20&&(h[0]=h[1]=h[2]=h[h.length-1]=h[h.length-2]=0),b=0,y=(u.max-u.min)/u.size,f=u.min===-.5&&y===1?.5:0,T=0;Td){s[C]=u.min+y*(T+f);break}for(d=(1-(e.maxPercent||0)/100)*b,T=u.size-2;T>=0;T--)if(g[T]jt(k)))):(S=e.max||255,w=e.min||0),oo({minCutOff:s,maxCutOff:m,outMax:S,outMin:w,histogramLut:v},c)}function oo(e,t){if(t==null||t.length===0)return e;const r=Math.max.apply(null,t),{minCutOff:c,maxCutOff:a,outMin:n,outMax:p,histogramLut:o}=e;return c.length===t.length||c.length<=r?e:{minCutOff:t.map(i=>c[i]),maxCutOff:t.map(i=>a[i]),histogramLut:o?t.map(i=>o[i]):null,outMin:n,outMax:p}}function Ye(e,t){var k;if(Fe(e)||!((k=e.pixels)!=null&&k.length))return e;const{mask:r,width:c,height:a,pixels:n}=e,{minCutOff:p,maxCutOff:o,gamma:i}=t,l=t.outMin||0,s=t.outMax||255,m=c*a,u=t.outputPixelType||"u8",y=e.pixels.map(()=>oe.createEmptyBand(u,m)),b=y.length;let h,g,d,f,C;const T=s-l,w=[];for(h=0;h=b,v=[];if(S)for(h=0;h1?i[h]>2?v[h]=6.5+(i[h]-2)**2.5:v[h]=6.5+100*(2-i[h])**4:v[h]=1;if(S)if(r!=null){for(g=0;g1&&(f-=(1/T)**(C*v[h])),dp[h]?y[h][g]=Math.floor(f*T*C**(1/i[h]))+l:d>=o[h]?y[h][g]=s:y[h][g]=l}else for(g=0;g1&&(f-=(1/T)**(C*v[h])),dp[h]?y[h][g]=Math.floor(f*T*C**(1/i[h]))+l:d>=o[h]?y[h][g]=s:y[h][g]=l;else if(r!=null){for(g=0;gp[h]?y[h][g]=Math.floor((d-p[h])/w[h]*T)+l:d>=o[h]?y[h][g]=s:y[h][g]=l}else for(g=0;gp[h]?y[h][g]=Math.floor((d-p[h])/w[h]*T)+l:d>=o[h]?y[h][g]=s:y[h][g]=l;const A=new oe({width:c,height:a,mask:r,pixels:y,pixelType:u});return A.updateStatistics(),A}var Xe;let ee=Xe=class extends et{constructor(){super(...arguments),this.blockWidth=void 0,this.blockHeight=void 0,this.compression=null,this.origin=null,this.firstPyramidLevel=null,this.maximumPyramidLevel=null,this.pyramidScalingFactor=2,this.pyramidBlockWidth=null,this.pyramidBlockHeight=null,this.isVirtualTileInfo=!1,this.tileInfo=null,this.transposeInfo=null,this.blockBoundary=null}clone(){return new Xe({blockWidth:this.blockWidth,blockHeight:this.blockHeight,compression:this.compression,origin:te(this.origin),firstPyramidLevel:this.firstPyramidLevel,maximumPyramidLevel:this.maximumPyramidLevel,pyramidResolutions:te(this.pyramidResolutions),pyramidScalingFactor:this.pyramidScalingFactor,pyramidBlockWidth:this.pyramidBlockWidth,pyramidBlockHeight:this.pyramidBlockHeight,isVirtualTileInfo:this.isVirtualTileInfo,tileInfo:te(this.tileInfo),transposeInfo:te(this.transposeInfo),blockBoundary:te(this.blockBoundary)})}};$([z({type:Number,json:{write:!0}})],ee.prototype,"blockWidth",void 0),$([z({type:Number,json:{write:!0}})],ee.prototype,"blockHeight",void 0),$([z({type:String,json:{write:!0}})],ee.prototype,"compression",void 0),$([z({type:qt,json:{write:!0}})],ee.prototype,"origin",void 0),$([z({type:Number,json:{write:!0}})],ee.prototype,"firstPyramidLevel",void 0),$([z({type:Number,json:{write:!0}})],ee.prototype,"maximumPyramidLevel",void 0),$([z({json:{write:!0}})],ee.prototype,"pyramidResolutions",void 0),$([z({type:Number,json:{write:!0}})],ee.prototype,"pyramidScalingFactor",void 0),$([z({type:Number,json:{write:!0}})],ee.prototype,"pyramidBlockWidth",void 0),$([z({type:Number,json:{write:!0}})],ee.prototype,"pyramidBlockHeight",void 0),$([z({type:Boolean,json:{write:!0}})],ee.prototype,"isVirtualTileInfo",void 0),$([z({json:{write:!0}})],ee.prototype,"tileInfo",void 0),$([z()],ee.prototype,"transposeInfo",void 0),$([z()],ee.prototype,"blockBoundary",void 0),ee=Xe=$([Qe("esri.layers.support.RasterStorageInfo")],ee);const io=ee;var Ze;let Y=Ze=class extends et{constructor(e){super(e),this.attributeTable=null,this.bandCount=null,this.colormap=null,this.extent=null,this.format=void 0,this.height=null,this.width=null,this.histograms=null,this.keyProperties={},this.multidimensionalInfo=null,this.noDataValue=null,this.pixelSize=null,this.pixelType=null,this.isPseudoSpatialReference=!1,this.spatialReference=null,this.statistics=null,this.storageInfo=null,this.transform=null}get dataType(){var t,r,c;const e=(c=(r=(t=this.keyProperties)==null?void 0:t.DataType)==null?void 0:r.toLowerCase())!=null?c:"generic";return e==="stdtime"?"standard-time":e}get nativeExtent(){return this._get("nativeExtent")||this.extent}set nativeExtent(e){e&&this._set("nativeExtent",e)}get nativePixelSize(){if(Fe(this.transform)||!this.transform.affectsPixelSize)return this.pixelSize;const e=this.nativeExtent;return{x:e.width/this.width,y:e.height/this.height}}get hasMultidimensionalTranspose(){var e;return!!((e=this.storageInfo)!=null&&e.transposeInfo)}clone(){return new Ze({attributeTable:te(this.attributeTable),bandCount:this.bandCount,colormap:te(this.colormap),extent:te(this.extent),nativePixelSize:te(this.nativePixelSize),format:this.format,height:this.height,width:this.width,histograms:te(this.histograms),keyProperties:te(this.keyProperties),multidimensionalInfo:te(this.multidimensionalInfo),noDataValue:this.noDataValue,pixelSize:te(this.pixelSize),pixelType:this.pixelType,isPseudoSpatialReference:this.isPseudoSpatialReference,spatialReference:te(this.spatialReference),statistics:te(this.statistics),storageInfo:te(this.storageInfo),transform:te(this.transform)})}};$([z({json:{write:!0}})],Y.prototype,"attributeTable",void 0),$([z({json:{write:!0}})],Y.prototype,"bandCount",void 0),$([z({json:{write:!0}})],Y.prototype,"colormap",void 0),$([z({type:String,readOnly:!0})],Y.prototype,"dataType",null),$([z({type:ct,json:{write:!0}})],Y.prototype,"extent",void 0),$([z({type:ct,json:{write:!0}})],Y.prototype,"nativeExtent",null),$([z({json:{write:!0}})],Y.prototype,"nativePixelSize",null),$([z({json:{write:!0}})],Y.prototype,"format",void 0),$([z({json:{write:!0}})],Y.prototype,"height",void 0),$([z({json:{write:!0}})],Y.prototype,"width",void 0),$([z({json:{write:!0}})],Y.prototype,"hasMultidimensionalTranspose",null),$([z({json:{write:!0}})],Y.prototype,"histograms",void 0),$([z({json:{write:!0}})],Y.prototype,"keyProperties",void 0),$([z({json:{write:!0}})],Y.prototype,"multidimensionalInfo",void 0),$([z({json:{write:!0}})],Y.prototype,"noDataValue",void 0),$([z({json:{write:!0}})],Y.prototype,"pixelSize",void 0),$([z({json:{write:!0}})],Y.prototype,"pixelType",void 0),$([z()],Y.prototype,"isPseudoSpatialReference",void 0),$([z({type:Xt,json:{write:!0}})],Y.prototype,"spatialReference",void 0),$([z({json:{write:!0}})],Y.prototype,"statistics",void 0),$([z({type:io,json:{write:!0}})],Y.prototype,"storageInfo",void 0),$([z({json:{write:!0}})],Y.prototype,"transform",void 0),Y=Ze=$([Qe("esri.layers.support.RasterInfo")],Y);const no=Y;function ao(e,t){const{attributeTable:r,bandCount:c}=e;return!(Fe(r)||c>1||t&&r.fields.find(a=>a.name.toLowerCase()===t.toLowerCase())==null)}function so(e){const{bandCount:t,dataType:r,pixelType:c}=e;return r==="elevation"||r==="generic"&&t===1&&(c==="s16"||c==="f32"||c==="f64")}function lo(e){const{bandCount:t,colormap:r}=e;return H(r)&&r.length>0&&t===1}let Ce=class extends et{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e&&e.pixelBlock;if(!Pt(t))return t;if(e.simpleStretchParams&&this.rendererJSON.type==="rasterStretch")return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=ft(t,[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const c=e.extent,a=c.spatialReference.isGeographic,n={x:(c.xmax-c.xmin)/t.width,y:(c.ymax-c.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:a,resolution:n});break}}return r}catch(r){return ut.getLogger(this.declaredClass).error("symbolize",r.message),t}}simpleStretch(e,t){if(!Pt(e))return e;try{return e.pixels.length>3&&(e=ft(e,[0,1,2])),Ye(e,t)}catch(r){return ut.getLogger(this.declaredClass).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:p,offset:o}=this.lookup.colormapLut||{};return{colormap:p,colormapOffset:o,type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:c,bandIds:a}=e,{rendererJSON:n}=this;return n.type==="rasterStretch"?this._generateStretchWebGLParams(t,n,a):n.type==="rasterShadedRelief"?this._generateShadedReliefWebGLParams(n,r,c):n.type==="vectorField"?this._generateVectorFieldWebGLParams(n):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(e){return this._isLUTChanged()&&!this.bind().success?e:$e(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){var r;const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);return this._isLUTChanged()&&!this.bind().success?e:t?$e(e,this.lookup.colormapLut):Zt(e,(r=this.lookup.remapLut)!=null?r:[])}_symbolizeStretch(e,t){var m,u,y;const{rasterInfo:r}=this,{pixelType:c,bandCount:a}=r,n=this.rendererJSON,p=["u8","u16","s8","s16"].includes(c);let o,i;const{dra:l}=n,{gamma:s}=this.lookup;if(n.stretchType==="histogramEqualization"){const b=l?null:(m=this.lookup)==null?void 0:m.histogramLut,h=Re(n,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!b}),g=Ye(e,{...h,gamma:s});i=ht(g,{lut:l?h.histogramLut:b,offset:0})}else if(p){if(l){const b=Re(n,{rasterInfo:r,pixelBlock:e,bandIds:t});o=Dt({pixelType:c,...b,gamma:s})}else if(this._isLUTChanged()){if(!this.bind().success)return e;o=this.lookup?this.lookup.stretchLut:null}else o=this.lookup?this.lookup.stretchLut:null;if(!o)return e;a>1&&(t==null?void 0:t.length)===((u=we(e))==null?void 0:u.pixels.length)&&(o==null?void 0:o.lut.length)===a&&(o={lut:t.map(b=>o.lut[b]),offset:o.offset}),i=ht(e,o)}else{const b=Re(n,{rasterInfo:r,pixelBlock:e,bandIds:t});i=Ye(e,{...b,gamma:s})}if(n.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return e;i=$e(i,(y=this.lookup)==null?void 0:y.colormapLut)}return i}_symbolizeShadedRelief(e,t){var o,i;const r=this.rendererJSON,c={...r,...t},a=Fr(e,c);if(!r.colorRamp)return a;let n;if(this._isLUTChanged(!0)){if(!this.bind().success)return a;n=this.lookup?this.lookup.hsvMap:null}else n=this.lookup?this.lookup.hsvMap:null;if(!n)return a;const p=(i=(o=we(this.rasterInfo.statistics))==null?void 0:o[0])!=null?i:{min:0,max:8e3};return Vr(a,e,n,p),a}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return e===2&&(t==="vector-magdir"||t==="vector-uv")}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){var l;const{bandCount:t,attributeTable:r,pixelType:c}=this.rasterInfo,a=e.field1;if(!a)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const n=e.defaultSymbol,p=t===1&&["u8","s8"].includes(c);if(!ao(this.rasterInfo,a)&&!p)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const o=[];if(H(r)){const s=r.fields.find(m=>m.name.toLowerCase()==="value");if(!s)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(m=>{var b,h;const u=(b=e.uniqueValueInfos)==null?void 0:b.find(g=>String(g.value)===String(m.attributes[a])),y=(h=u==null?void 0:u.symbol)==null?void 0:h.color;y?o.push([m.attributes[s.name]].concat(y)):n&&o.push([m.attributes[s.name]].concat(n.color))})}else{if(a.toLowerCase()!=="value")return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not availalbe.'};(l=e.uniqueValueInfos)==null||l.forEach(s=>{var u;const m=(u=s==null?void 0:s.symbol)==null?void 0:u.color;m?o.push([parseInt(""+s.value,10)].concat(m)):n&&o.push([parseInt(""+s.value,10)].concat(n==null?void 0:n.color))})}if(o.length===0)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const i=Pe({colormap:o});return this.lookup={rendererJSON:e,colormapLut:i},this.canRenderInWebGL=!0,{success:!0}}_updateColormapRenderer(e){if(!lo(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map(c=>[c.value].concat(c.color)).sort((c,a)=>c[0]-a[0]);if(!t||t.length===0)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=Pe({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=!0,{success:!0}}_updateShadedReliefRenderer(e){if(!so(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const t=kt(e.colorRamp,256,!0),r=Pe({colormap:t}),c=[],a=r.indexedColormap;for(let n=0;np.name.toLowerCase()==="value"):null,a=H(t)?t.fields.find(p=>p.name.toLowerCase()===e.field.toLowerCase()):null,n=c!=null&&a!==null;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||n,tableValueField:c,tableBreakField:a}}_updateClassBreaksRenderer(e){var m;const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:c,tableBreakField:a}=this._analyzeClassBreaks(e),n=e.classBreakInfos;if(!(n!=null&&n.length))return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const p=n.sort((u,y)=>u.classMaxValue-y.classMaxValue),o=p[p.length-1];let i=e.minValue;if(!r){const u=[];for(let y=0;yT>f);C&&l.push([d].concat(C.symbol.color))}}else{i=Math.floor(e.minValue);for(let u=0;u0&&e[0].min!=null&&e[0].max!=null}_updateStretchRenderer(e){var s,m;let{stretchType:t,dra:r}=e;if(!(t==="none"||((s=e.statistics)==null?void 0:s.length)||this._isValidRasterStatistics(this.rasterInfo.statistics)||r))return{success:!1,error:"Unsupported renderer; StretchRenderer.statistics is required when dynamic range adjustment is not used."};const c=we(e.histograms||this.rasterInfo.histograms);!this._isHistogramRequired(e.stretchType)||(c==null?void 0:c.length)||r||(t="minMax");const{computeGamma:a,useGamma:n,colorRamp:p}=e;let{gamma:o}=e;if(n&&a&&!(o!=null&&o.length)){const u=(m=e.statistics)!=null&&m.length?e.statistics:we(this.rasterInfo.statistics);o=eo(this.rasterInfo.pixelType,u)}const i=this.rasterInfo.pixelType,l=!r&&["u8","u16","s8","s16"].includes(i);if(t==="histogramEqualization"){const u=c.map(y=>jt(y));this.lookup={rendererJSON:e,histogramLut:u}}else if(l){const u=Re(e,{rasterInfo:this.rasterInfo}),y=Dt({pixelType:i,...u,gamma:n?o:null});this.lookup={rendererJSON:e,stretchLut:y}}if(p){const u=kt(p,256,!0);this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=Pe({colormap:u}),this.lookup.rendererJSON=e}return this.lookup.gamma=n&&(o==null?void 0:o.length)?o:null,this.canRenderInWebGL=!0,{success:!0}}_generateStretchWebGLParams(e,t,r){let c=null,a=null;const n=this.lookup&&this.lookup.colormapLut;t.colorRamp&&n&&(c=n.indexedColormap,a=n.offset),t.stretchType==="histogramEqualization"&&(t={...t,stretchType:"minMax"});const{gamma:p}=this.lookup,o=!!(t.useGamma&&p&&p.some(f=>f!==1)),{minCutOff:i,maxCutOff:l,outMin:s,outMax:m}=Re(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let u=0;H(e)&&(u=e.getPlaneCount(),u===2&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const y=Math.min(3,(r==null?void 0:r.length)||u||this.rasterInfo.bandCount),b=new Float32Array(y),h=c||o?1:255;let g;for(g=0;g1?p[g]>2?d[g]=6.5+(p[g]-2)**2.5:d[g]=6.5+100*(2-p[g])**4:d[g]=1;return{bandCount:y,outMin:s/h,outMax:m/h,minCutOff:i,maxCutOff:l,factor:b,useGamma:o,gamma:o?p:[1,1,1],gammaCorrection:o?d:[1,1,1],colormap:c,colormapOffset:a,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){var l,s,m;let c=null,a=null;const n=this.lookup&&this.lookup.colormapLut;e.colorRamp&&n&&(c=n.indexedColormap,a=n.offset);const p={...e,isGCS:t,resolution:r},o=Vt(p),i=(l=we(this.rasterInfo.statistics))==null?void 0:l[0];return{...o,minValue:(s=i==null?void 0:i.min)!=null?s:0,maxValue:(m=i==null?void 0:i.max)!=null?m:8e3,hillshadeType:e.hillshadeType==="traditional"?0:1,type:"hillshade",colormap:c,colormapOffset:a}}_generateVectorFieldWebGLParams(e){var d,f,C,T,w,S,v,A;const{style:t,inputUnit:r,outputUnit:c,visualVariables:a,symbolTileSize:n,flowRepresentation:p}=e;let o;const i=(f=(d=this.rasterInfo.statistics)==null?void 0:d[0].min)!=null?f:0,l=(T=(C=this.rasterInfo.statistics)==null?void 0:C[0].max)!=null?T:50,s=(w=a==null?void 0:a.find(k=>k.type==="sizeInfo"))!=null?w:{type:"sizeInfo",field:"Magnitude",maxDataValue:l,maxSize:.8*n,minDataValue:i,minSize:.2*n},m=(S=s.minDataValue)!=null?S:i,u=(v=s.maxDataValue)!=null?v:l,y=H(s.maxSize)&&H(s.minSize)?[s.minSize/n,s.maxSize/n]:[.2,.8];if(t==="wind_speed"){const k=(y[0]+y[1])/2;y[0]=y[1]=k}const b=H(m)&&H(u)?[m,u]:null;if(t==="classified_arrow")if(H(m)&&H(u)&&H(s)){o=[];const k=(s.maxDataValue-s.minDataValue)/5;for(let D=0;D<6;D++)o.push(s.minDataValue+k*D)}else o=[0,1e-6,3.5,7,10.5,14];const h=p==="flow_to"==(t==="ocean_current_kn"||t==="ocean_current_m")?0:Math.PI,g=a==null?void 0:a.find(k=>k.type==="rotationInfo");return{breakValues:o,dataRange:b,inputUnit:r,outputUnit:c,symbolTileSize:n,symbolPercentRange:y,style:t||"single_arrow",rotation:h,rotationType:((A=this.rasterInfo.storageInfo)==null?void 0:A.tileInfo)&&this.rasterInfo.dataType==="vector-uv"?"geographic":(g==null?void 0:g.rotationType)||e.rotationType,type:"vectorField"}}};function Pt(e){return Ae(e)&&e.validPixelCount!==0}$([z({json:{write:!0}})],Ce.prototype,"rendererJSON",void 0),$([z({type:no,json:{write:!0}})],Ce.prototype,"rasterInfo",void 0),$([z({json:{write:!0}})],Ce.prototype,"lookup",void 0),$([z()],Ce.prototype,"canRenderInWebGL",void 0),Ce=$([Qe("esri.renderers.support.RasterSymbolizer")],Ce);const To=Ce;export{nt as D,Sr as G,vr as N,at as O,ho as P,po as S,To as T,yo as _,mo as a,io as b,qr as c,Ye as d,no as e,Wr as f,Xr as g,kt as h,$r as i,bo as j,Co as k,it as l,Ie as m,wo as n,go as o,ro as p,wr as q,sr as r,Dt as u,Re as x}; +import{n as de,c1 as Wt,D as Kt,at as Jt,cs as Yt,cN as le,c as H,b9 as lt,ct as Ht,j as Fe,u as we,a6 as $,a7 as z,af as qt,a8 as Qe,cx as et,b4 as te,cU as ct,aT as Xt,s as ut}from"./index.221827cd.js";import{g as oe,r as Ae,s as ft,f as $e,p as Zt,c as ht,a as Pe}from"./pixelUtils.9c6f8dae.js";import{z as dt,y as _e,v as pt,p as Qt}from"./colorUtils.bb6424b7.js";var je,mt,gt,Rt={exports:{}};mt=Rt,je=function(){function e(){this.pos=0,this.bufferLength=0,this.eof=!1,this.buffer=null}return e.prototype={ensureBuffer:function(t){var r=this.buffer,c=r?r.byteLength:0;if(ta&&(c=a)}else{for(;!this.eof;)this.readBlock();c=this.bufferLength}return this.pos=c,this.buffer.subarray(r,c)},lookChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos])},getChar:function(){for(var t=this.pos;this.bufferLength<=t;){if(this.eof)return null;this.readBlock()}return String.fromCharCode(this.buffer[this.pos++])},makeSubStream:function(t,r,c){for(var a=t+r;this.bufferLength<=a&&!this.eof;)this.readBlock();return new Stream(this.buffer,t,r,c)},skip:function(t){t||(t=1),this.pos+=t},reset:function(){this.pos=0}},e}(),(gt=function(){if(!self||!self.Uint32Array)return null;var e=new Uint32Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),t=new Uint32Array([3,4,5,6,7,8,9,10,65547,65549,65551,65553,131091,131095,131099,131103,196643,196651,196659,196667,262211,262227,262243,262259,327811,327843,327875,327907,258,258,258]),r=new Uint32Array([1,2,3,4,65541,65543,131081,131085,196625,196633,262177,262193,327745,327777,393345,393409,459009,459137,524801,525057,590849,591361,657409,658433,724993,727041,794625,798721,868353,876545]),c=[new Uint32Array([459008,524368,524304,524568,459024,524400,524336,590016,459016,524384,524320,589984,524288,524416,524352,590048,459012,524376,524312,589968,459028,524408,524344,590032,459020,524392,524328,59e4,524296,524424,524360,590064,459010,524372,524308,524572,459026,524404,524340,590024,459018,524388,524324,589992,524292,524420,524356,590056,459014,524380,524316,589976,459030,524412,524348,590040,459022,524396,524332,590008,524300,524428,524364,590072,459009,524370,524306,524570,459025,524402,524338,590020,459017,524386,524322,589988,524290,524418,524354,590052,459013,524378,524314,589972,459029,524410,524346,590036,459021,524394,524330,590004,524298,524426,524362,590068,459011,524374,524310,524574,459027,524406,524342,590028,459019,524390,524326,589996,524294,524422,524358,590060,459015,524382,524318,589980,459031,524414,524350,590044,459023,524398,524334,590012,524302,524430,524366,590076,459008,524369,524305,524569,459024,524401,524337,590018,459016,524385,524321,589986,524289,524417,524353,590050,459012,524377,524313,589970,459028,524409,524345,590034,459020,524393,524329,590002,524297,524425,524361,590066,459010,524373,524309,524573,459026,524405,524341,590026,459018,524389,524325,589994,524293,524421,524357,590058,459014,524381,524317,589978,459030,524413,524349,590042,459022,524397,524333,590010,524301,524429,524365,590074,459009,524371,524307,524571,459025,524403,524339,590022,459017,524387,524323,589990,524291,524419,524355,590054,459013,524379,524315,589974,459029,524411,524347,590038,459021,524395,524331,590006,524299,524427,524363,590070,459011,524375,524311,524575,459027,524407,524343,590030,459019,524391,524327,589998,524295,524423,524359,590062,459015,524383,524319,589982,459031,524415,524351,590046,459023,524399,524335,590014,524303,524431,524367,590078,459008,524368,524304,524568,459024,524400,524336,590017,459016,524384,524320,589985,524288,524416,524352,590049,459012,524376,524312,589969,459028,524408,524344,590033,459020,524392,524328,590001,524296,524424,524360,590065,459010,524372,524308,524572,459026,524404,524340,590025,459018,524388,524324,589993,524292,524420,524356,590057,459014,524380,524316,589977,459030,524412,524348,590041,459022,524396,524332,590009,524300,524428,524364,590073,459009,524370,524306,524570,459025,524402,524338,590021,459017,524386,524322,589989,524290,524418,524354,590053,459013,524378,524314,589973,459029,524410,524346,590037,459021,524394,524330,590005,524298,524426,524362,590069,459011,524374,524310,524574,459027,524406,524342,590029,459019,524390,524326,589997,524294,524422,524358,590061,459015,524382,524318,589981,459031,524414,524350,590045,459023,524398,524334,590013,524302,524430,524366,590077,459008,524369,524305,524569,459024,524401,524337,590019,459016,524385,524321,589987,524289,524417,524353,590051,459012,524377,524313,589971,459028,524409,524345,590035,459020,524393,524329,590003,524297,524425,524361,590067,459010,524373,524309,524573,459026,524405,524341,590027,459018,524389,524325,589995,524293,524421,524357,590059,459014,524381,524317,589979,459030,524413,524349,590043,459022,524397,524333,590011,524301,524429,524365,590075,459009,524371,524307,524571,459025,524403,524339,590023,459017,524387,524323,589991,524291,524419,524355,590055,459013,524379,524315,589975,459029,524411,524347,590039,459021,524395,524331,590007,524299,524427,524363,590071,459011,524375,524311,524575,459027,524407,524343,590031,459019,524391,524327,589999,524295,524423,524359,590063,459015,524383,524319,589983,459031,524415,524351,590047,459023,524399,524335,590015,524303,524431,524367,590079]),9],a=[new Uint32Array([327680,327696,327688,327704,327684,327700,327692,327708,327682,327698,327690,327706,327686,327702,327694,0,327681,327697,327689,327705,327685,327701,327693,327709,327683,327699,327691,327707,327687,327703,327695,0]),5];function n(o){throw new Error(o)}function p(o){var i=0,l=o[i++],s=o[i++];l!=-1&&s!=-1||n("Invalid header in flate stream"),(15&l)!=8&&n("Unknown compression method in flate stream"),((l<<8)+s)%31!=0&&n("Bad FCHECK in flate stream"),32&s&&n("FDICT bit set in flate stream"),this.bytes=o,this.bytesPos=i,this.codeSize=0,this.codeBuf=0,je.call(this)}return p.prototype=Object.create(je.prototype),p.prototype.getBits=function(o){for(var i,l=this.codeSize,s=this.codeBuf,m=this.bytes,u=this.bytesPos;l>o,this.codeSize=l-=o,this.bytesPos=u,i},p.prototype.getCode=function(o){for(var i=o[0],l=o[1],s=this.codeSize,m=this.codeBuf,u=this.bytes,y=this.bytesPos;s>16,d=65535&h;return(s==0||s>g,this.codeSize=s-g,this.bytesPos=y,d},p.prototype.generateHuffmanTable=function(o){for(var i=o.length,l=0,s=0;sl&&(l=o[s]);for(var m=1<>=1;for(s=d;s0;)B[h++]=F}var i=this.getBits(3);if(1&i&&(this.eof=!0),(i>>=1)!=0){var l,s;if(i==1)l=c,s=a;else if(i==2){for(var m=this.getBits(5)+257,u=this.getBits(5)+1,y=this.getBits(4)+4,b=Array(e.length),h=0;h=w&&(w=(O=this.ensureBuffer(S+1)).length),O[S++]=v;else{if(v==256)return void(this.bufferLength=S);var A=(v=t[v-=257])>>16;A>0&&(A=this.getBits(A)),d=(65535&v)+A,v=this.getCode(s),(A=(v=r[v])>>16)>0&&(A=this.getBits(A));var k=(65535&v)+A;S+d>=w&&(w=(O=this.ensureBuffer(S+d)).length);for(var D=0;D{let s=null;p==="jpg"&&o&&(s=tt._getMask(t,{width:a,height:n}));const m=new Blob([new Uint8Array(t)],{type:"image/"+p=="jpg"?"jpeg":p}),u=URL.createObjectURL(m),y=new Image;let b;y.src=u,y.onload=()=>{if(URL.revokeObjectURL(u),Wt(c))return void l(Kt());a=y.width,n=y.height,this._canvas&&this._ctx?(this._canvas.width===a&&this._canvas.height===n||(this._canvas.width=a,this._canvas.height=n),this._ctx.clearRect(0,0,a,n)):(this._canvas=document.createElement("canvas"),this._canvas.width=a,this._canvas.height=n,this._ctx=this._canvas.getContext("2d")),this._ctx.drawImage(y,0,0);const h=this._ctx.getImageData(0,0,a,n);let g;if(b=h.data,r.renderOnCanvas){if(s)for(g=0;g{URL.revokeObjectURL(u),l("cannot load image")}})}static _getMask(t,r){let c=null;try{const a=new Uint8Array(t),n=Math.ceil(a.length/2);let p=0;const o=a.length-2;for(p=n;p=0;m--)c[l++]=i[s]>>m&1}}catch{}return c}}var yt,Ct,wt,Et={exports:{}};yt=Et,Ct=function(){var e=function(){function t(r){this.message="JPEG error: "+r}return t.prototype=new Error,t.prototype.name="JpegError",t.constructor=t,t}();return function(){if(!self||!self.Uint8ClampedArray)return null;var t=new Uint8Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),r=4017,c=799,a=3406,n=2276,p=1567,o=3784,i=5793,l=2896;function s(){this.decodeTransform=null,this.colorTransform=-1}function m(d,f){for(var C,T,w=0,S=[],v=16;v>0&&!d[v-1];)v--;S.push({children:[],index:0});var A,k=S[0];for(C=0;C0;)k=S.pop();for(k.index++,S.push(k);S.length<=C;)S.push(A={children:[],index:0}),k.children[k.index]=A.children,k=A;w++}C+10)return P--,L>>P&1;if((L=d[f++])===255){var U=d[f++];if(U)throw new e("unexpected marker "+(L<<8|U).toString(16))}return P=7,L>>>7}function x(U){for(var j=U;;){if(typeof(j=j[I()])=="number")return j;if(typeof j!="object")throw new e("invalid huffman sequence")}}function O(U){for(var j=0;U>0;)j=j<<1|I(),U--;return j}function N(U){if(U===1)return I()===1?1:-1;var j=O(U);return j>=1<>4;if(Q!==0){var zt=t[re+=ie];U.blockData[j+zt]=N(Q),re++}else{if(ie<15)break;re+=16}}}function M(U,j){var K=x(U.huffmanTableDC),Z=K===0?0:N(K)<0)_--;else for(var K=S,Z=v;K<=Z;){var re=x(U.huffmanTableAC),se=15&re,Q=re>>4;if(se!==0){var ie=t[K+=Q];U.blockData[j+ie]=N(se)*(1<>4,(K=15&Z)==0)Q<15?(_=O(Q)+(1<=65488&&ye<=65495))break;f+=2}return(ae=g(d,f))&&ae.invalid&&(console.log("decodeScan - unexpected Scan data, next marker is: "+ae.invalid),f=ae.offset),f-E}function b(d,f,C){var T,w,S,v,A,k,D,R,E,L,P,I,x,O,N,V,M,B=d.quantizationTable,_=d.blockData;if(!B)throw new e("missing required Quantization Table.");for(var G=0;G<64;G+=8)E=_[f+G],L=_[f+G+1],P=_[f+G+2],I=_[f+G+3],x=_[f+G+4],O=_[f+G+5],N=_[f+G+6],V=_[f+G+7],E*=B[G],(L|P|I|x|O|N|V)!=0?(L*=B[G+1],P*=B[G+2],I*=B[G+3],x*=B[G+4],O*=B[G+5],N*=B[G+6],V*=B[G+7],w=(T=(T=i*E+128>>8)+(w=i*x+128>>8)+1>>1)-w,M=(S=P)*o+(v=N)*p+128>>8,S=S*p-v*o+128>>8,D=(A=(A=l*(L-V)+128>>8)+(D=O<<4)+1>>1)-D,k=(R=(R=l*(L+V)+128>>8)+(k=I<<4)+1>>1)-k,v=(T=T+(v=M)+1>>1)-v,S=(w=w+S+1>>1)-S,M=A*n+R*a+2048>>12,A=A*a-R*n+2048>>12,R=M,M=k*c+D*r+2048>>12,k=k*r-D*c+2048>>12,D=M,C[G]=T+R,C[G+7]=T-R,C[G+1]=w+D,C[G+6]=w-D,C[G+2]=S+k,C[G+5]=S-k,C[G+3]=v+A,C[G+4]=v-A):(M=i*E+512>>10,C[G]=M,C[G+1]=M,C[G+2]=M,C[G+3]=M,C[G+4]=M,C[G+5]=M,C[G+6]=M,C[G+7]=M);for(var F=0;F<8;++F)E=C[F],((L=C[F+8])|(P=C[F+16])|(I=C[F+24])|(x=C[F+32])|(O=C[F+40])|(N=C[F+48])|(V=C[F+56]))!=0?(w=(T=4112+((T=i*E+2048>>12)+(w=i*x+2048>>12)+1>>1))-w,M=(S=P)*o+(v=N)*p+2048>>12,S=S*p-v*o+2048>>12,v=M,D=(A=(A=l*(L-V)+2048>>12)+(D=O)+1>>1)-D,k=(R=(R=l*(L+V)+2048>>12)+(k=I)+1>>1)-k,M=A*n+R*a+2048>>12,A=A*a-R*n+2048>>12,R=M,M=k*c+D*r+2048>>12,k=k*r-D*c+2048>>12,E=(E=(T=T+v+1>>1)+R)<16?0:E>=4080?255:E>>4,L=(L=(w=w+S+1>>1)+(D=M))<16?0:L>=4080?255:L>>4,P=(P=(S=w-S)+k)<16?0:P>=4080?255:P>>4,I=(I=(v=T-v)+A)<16?0:I>=4080?255:I>>4,x=(x=v-A)<16?0:x>=4080?255:x>>4,O=(O=S-k)<16?0:O>=4080?255:O>>4,N=(N=w-D)<16?0:N>=4080?255:N>>4,V=(V=T-R)<16?0:V>=4080?255:V>>4,_[f+F]=E,_[f+F+8]=L,_[f+F+16]=P,_[f+F+24]=I,_[f+F+32]=x,_[f+F+40]=O,_[f+F+48]=N,_[f+F+56]=V):(M=(M=i*E+8192>>14)<-2040?0:M>=2024?255:M+2056>>4,_[f+F]=M,_[f+F+8]=M,_[f+F+16]=M,_[f+F+24]=M,_[f+F+32]=M,_[f+F+40]=M,_[f+F+48]=M,_[f+F+56]=M)}function h(d,f){for(var C=f.blocksPerLine,T=f.blocksPerColumn,w=new Int16Array(64),S=0;S=w)return null;var v=T(f);if(v>=65472&&v<=65534)return{invalid:null,marker:v,offset:f};for(var A=T(S);!(A>=65472&&A<=65534);){if(++S>=w)return null;A=T(S)}return{invalid:v.toString(16),marker:A,offset:S}}return s.prototype={parse:function(d){function f(){var U=d[v]<<8|d[v+1];return v+=2,U}function C(){var U=f(),j=v+U-2,K=g(d,j,v);K&&K.invalid&&(console.log("readDataBlock - incorrect length, next marker is: "+K.invalid),j=K.offset);var Z=d.subarray(v,j);return v+=Z.length,Z}function T(U){for(var j=Math.ceil(U.samplesPerLine/8/U.maxH),K=Math.ceil(U.scanLines/8/U.maxV),Z=0;Z>4==0)for(I=0;I<64;I++)M[t[I]]=d[v++];else{if(V>>4!=1)throw new e("DQT - invalid table spec");for(I=0;I<64;I++)M[t[I]]=f()}D[15&V]=M}break;case 65472:case 65473:case 65474:if(w)throw new e("Only single frame JPEGs supported");f(),(w={}).extended=L===65473,w.progressive=L===65474,w.precision=d[v++],w.scanLines=f(),w.samplesPerLine=f(),w.components=[],w.componentIds={};var B,_=d[v++],G=0,F=0;for(P=0;P<_;P++){B=d[v];var q=d[v+1]>>4,X=15&d[v+1];G>4==0?E:R)[15&ce]=m(ne,pe)}break;case 65501:f(),S=f();break;case 65498:f();var J,De=d[v++],me=[];for(P=0;P>4],J.huffmanTableAC=R[15&ge],me.push(J)}var Le=d[v++],Me=d[v++],fe=d[v++],Oe=y(d,v,w,me,S,Le,Me,fe>>4,15&fe);v+=Oe;break;case 65535:d[v]!==255&&v--;break;default:if(d[v-3]===255&&d[v-2]>=192&&d[v-2]<=254){v-=3;break}throw new e("unknown marker "+L.toString(16))}L=f()}for(this.width=w.samplesPerLine,this.height=w.scanLines,this.jfif=A,this.eof=v,this.adobe=k,this.components=[],P=0;P>8)+_[R+1];return V},_isColorConversionNeeded:function(){return this.adobe?!!this.adobe.transformCode:this.numComponents===3?this.colorTransform!==0:this.colorTransform===1},_convertYccToRgb:function(d){for(var f,C,T,w=0,S=d.length;w4)throw new e("Unsupported color mode");var T=this._getLinearizedBlockData(d,f);if(this.numComponents===1&&C){for(var w=T.length,S=new Uint8ClampedArray(3*w),v=0,A=0;A=0;h--)u[d++]=g[y]>>h&1}catch{}if(o===1&&l.length===n*p)m=[l,l,l];else{for(m=[],y=0;y<3;y++)m.push(new Uint8Array(s));for(h=0,b=0;bimport("./lerc-wasm.8ece762d.js"),[]).then(e=>e.l).then(({default:e})=>e({locateFile:t=>Yt(`esri/layers/support/rasterFormats/${t}`)})).then(e=>{rr(e)}),ze)}const Ne={getBlobInfo:null,decode:null};function tr(e){return 16+(e>>3<<3)}function he(e,t,r){r.set(e.slice(t,t+r.length))}function rr(e){const{_malloc:t,_free:r,_lerc_getBlobInfo:c,_lerc_getDataRanges:a,_lerc_decode_4D:n,asm:p}=e;let o;const i=Object.values(p).find(s=>s&&"buffer"in s&&s.buffer===e.HEAPU8.buffer),l=s=>{const m=s.map(h=>tr(h)),u=m.reduce((h,g)=>h+g),y=t(u);o=new Uint8Array(i.buffer);let b=m[0];m[0]=y;for(let h=1;h{const y=new Uint8Array(48),b=new Uint8Array(8*3),[h,g,d]=l([s.length,y.length,b.length]);o.set(s,h),o.set(y,g),o.set(b,d);let f=c(h,s.length,g,d,12,3);if(f)throw r(h),`lerc-getBlobInfo: error code is ${f}`;o=new Uint8Array(i.buffer),he(o,g,y),he(o,d,b);const C=new Uint32Array(y.buffer),T=new Float64Array(b.buffer),[w,S,,v,A,k,D,R,E,L,P]=C,I={version:w,depthCount:L,width:v,height:A,validPixelCount:D,bandCount:k,blobSize:R,maskCount:E,dataType:S,minValue:T[0],maxValue:T[1],maxZerror:T[2],statistics:[],bandCountWithNoData:P};if(P)return I;if(L===1&&k===1)return r(h),I.statistics.push({minValue:T[0],maxValue:T[1]}),I;const x=L*k*8,O=new Uint8Array(x),N=new Uint8Array(x);let V=h,M=0,B=0,_=!1;if(o.byteLength1){const ve=G.slice(X*L,(X+1)*L),Se=F.slice(X*L,(X+1)*L),ce=Math.min.apply(null,ve),ne=Math.max.apply(null,Se);q.push({minValue:ce,maxValue:ne,depthStats:{minValues:ve,maxValues:Se}})}else q.push({minValue:G[X],maxValue:F[X]});return r(V),_||r(M),I},Ne.decode=(s,m)=>{const{maskCount:u,depthCount:y,bandCount:b,width:h,height:g,dataType:d,bandCountWithNoData:f}=m,C=Lt[d],T=h*g,w=new Uint8Array(T*b),S=T*y*b*C.size,v=new Uint8Array(S),A=new Uint8Array(b),k=new Uint8Array(8*b),[D,R,E,L,P]=l([s.length,w.length,v.length,A.length,k.length]);o.set(s,D),o.set(w,R),o.set(v,E),o.set(A,L),o.set(k,P);const I=n(D,s.length,u,R,y,h,g,b,d,E,L,P);if(I)throw r(D),`lerc-decode: error code is ${I}`;o=new Uint8Array(i.buffer),he(o,E,v),he(o,R,w);let x=null;if(f){he(o,L,A),he(o,P,k),x=[];const O=new Float64Array(k.buffer);for(let N=0;N1){T.set(d[0]);for(let D=1;D=w;if(u>0&&S)for(let D=0;D1?d:null,{pixelType:A}=b;return{width:o,height:i,bandCount:l,pixelType:A,depthCount:s,statistics:y,pixels:g,mask:T,bandMasks:v}}function ir(e,t,r,c=!0){if(t%4!=0||r%4!=0){const a=new ArrayBuffer(4*Math.ceil(r/4)),n=new Uint8Array(a),p=new Uint8Array(e,t,r);if(c)for(let o=0;o=n)o-=n,u=m>>>32-n,m<<=n;else{u=m>>>32-o,m=a[s++];const d=n-o;o=32-d,u=(u<>>o),m<<=d}if(u===257)break;if(u===256){n=9,p=bt(),i=p.length,l=[];continue}const g=p[u];if(g==null){if(u>p.length)throw"data integrity issue: code does not exist on code page";l.push(l[0]),p[i++]=l.slice(),Tt(h,l)}else Tt(h,g),l.push(g[0]),l.length>1&&(p[i++]=l.slice()),l=g.slice();if(ke.has(i)&&n++,o===0&&(m=a[s++],o=32),s>y||s===y&&o<=b)break}return new Uint8Array(h)}ke.add(511),ke.add(1023),ke.add(2047),ke.add(4095),ke.add(8191);const vt=(e,t)=>{const r=t.width*t.height,c=t.pixelType;return Math.floor(e.byteLength/(r*Ut(c)))},Ut=e=>{let t=1;switch(e){case Uint8Array:case Int8Array:t=1;break;case Uint16Array:case Int16Array:t=2;break;case Uint32Array:case Int32Array:case Float32Array:t=4;break;case Float64Array:t=8}return t},nr=(e,t)=>{if(8*e.byteLength=0;o--)c[a++]=n>>o&1;for(o=7;a>o&1,o--;return c};class ar{static decode(t,r){const c=r.pixelType,a=[],n=r.width*r.height,p=vt(t,r),{bandIds:o,format:i}=r,l=o&&o.length||vt(t,r),s=t.byteLength-t.byteLength%(n*Ut(c)),m=new c(t,0,n*p);let u,y,b,h,g=null;if(i==="bip")for(u=0;u>4,a<8?a=1:a===15?(a=4,n=(7&n)<<18|(63&e[r++])<<12|(63&e[r++])<<6|63&e[r++]):a===14?(a=3,n=(15&n)<<12|(63&e[r++])<<6|63&e[r++]):(a=2,n=(31&n)<<6|63&e[r++]),(n!==0||t)&&(c+=String.fromCharCode(n));return c}const ot=(()=>{const e=[];return e[254]="NEWSUBFILETYPE",e[255]="SUBFILETYPE",e[256]="IMAGEWIDTH",e[257]="IMAGELENGTH",e[258]="BITSPERSAMPLE",e[259]="COMPRESSION",e[262]="PHOTOMETRICINTERPRETATION",e[263]="THRESHHOLDING",e[264]="CELLWIDTH",e[265]="CELLLENGTH",e[266]="FILLORDER",e[269]="DOCUMENTNAME",e[270]="IMAGEDESCRIPTION",e[271]="MAKE",e[272]="MODEL",e[273]="STRIPOFFSETS",e[274]="ORIENTATION",e[277]="SAMPLESPERPIXEL",e[278]="ROWSPERSTRIP",e[279]="STRIPBYTECOUNTS",e[280]="MINSAMPLEVALUE",e[281]="MAXSAMPLEVALUE",e[282]="XRESOLUTION",e[283]="YRESOLUTION",e[284]="PLANARCONFIGURATION",e[285]="PAGENAME",e[286]="XPOSITION",e[287]="YPOSITION",e[288]="FREEOFFSETS",e[289]="FREEBYTECOUNTS",e[290]="GRAYRESPONSEUNIT",e[291]="GRAYRESPONSECURVE",e[292]="T4OPTIONS",e[293]="T6OPTIONS",e[296]="RESOLUTIONUNIT",e[297]="PAGENUMBER",e[300]="COLORRESPONSEUNIT",e[301]="TRANSFERFUNCTION",e[305]="SOFTWARE",e[306]="DATETIME",e[315]="ARTIST",e[316]="HOSTCOMPUTER",e[317]="PREDICTOR",e[318]="WHITEPOINT",e[319]="PRIMARYCHROMATICITIES",e[320]="COLORMAP",e[321]="HALFTONEHINTS",e[322]="TILEWIDTH",e[323]="TILELENGTH",e[324]="TILEOFFSETS",e[325]="TILEBYTECOUNTS",e[326]="BADFAXLINES",e[327]="CLEANFAXDATA",e[328]="CONSECUTIVEBADFAXLINES",e[330]="SUBIFD",e[332]="INKSET",e[333]="INKNAMES",e[334]="NUMBEROFINKS",e[336]="DOTRANGE",e[337]="TARGETPRINTER",e[338]="EXTRASAMPLES",e[339]="SAMPLEFORMAT",e[340]="SMINSAMPLEVALUE",e[341]="SMAXSAMPLEVALUE",e[342]="TRANSFERRANGE",e[347]="JPEGTABLES",e[512]="JPEGPROC",e[513]="JPEGIFOFFSET",e[514]="JPEGIFBYTECOUNT",e[515]="JPEGRESTARTINTERVAL",e[517]="JPEGLOSSLESSPREDICTORS",e[518]="JPEGPOINTTRANSFORM",e[519]="JPEGQTABLES",e[520]="JPEGDCTABLES",e[521]="JPEGACTABLES",e[529]="YCBCRCOEFFICIENTS",e[530]="YCBCRSUBSAMPLING",e[531]="YCBCRPOSITIONING",e[532]="REFERENCEBLACKWHITE",e[700]="XMP",e[33550]="GEOPIXELSCALE",e[33922]="GEOTIEPOINTS",e[33432]="COPYRIGHT",e[42112]="GDAL_METADATA",e[42113]="GDAL_NODATA",e[50844]="RPCCOEFFICIENT",e[34264]="GEOTRANSMATRIX",e[34735]="GEOKEYDIRECTORY",e[34736]="GEODOUBLEPARAMS",e[34737]="GEOASCIIPARAMS",e[34665]="EXIFIFD",e[34853]="GPSIFD",e[40965]="INTEROPERABILITYIFD",e})(),lr=(()=>{const e=ot.slice();return e[36864]="ExifVersion",e[40960]="FlashpixVersion",e[40961]="ColorSpace",e[42240]="Gamma",e[37121]="ComponentsConfiguration",e[37122]="CompressedBitsPerPixel",e[40962]="PixelXDimension",e[40963]="PixelYDimension",e[37500]="MakerNote",e[37510]="UserComment",e[40964]="RelatedSoundFile",e[36867]="DateTimeOriginal",e[36868]="DateTimeDigitized",e[36880]="OffsetTime",e[36881]="OffsetTimeOriginal",e[36882]="OffsetTimeDigitized",e[37520]="SubSecTime",e[37521]="SubSecTimeOriginal",e[37522]="SubSecTimeDigitized",e[37888]="Temperature",e[37889]="Humidity",e[37890]="Pressure",e[37891]="WaterDepth",e[37892]="Acceleration",e[37893]="CameraElevationAngle",e[42016]="ImageUniqueID",e[42032]="CameraOwnerName",e[42033]="BodySerialNumber",e[42034]="LensSpecification",e[42035]="LensMake",e[42036]="LensModel",e[42037]="LensSerialNumber",e[33434]="ExposureTime",e[33437]="FNumber",e[34850]="ExposureProgram",e[34852]="SpectralSensitivity",e[34855]="PhotographicSensitivity",e[34856]="OECF",e[34864]="SensitivityType",e[34865]="StandardOutputSensitivity",e[34866]="RecommendedExposureIndex",e[34867]="ISOSpeed",e[34868]="ISOSpeedLatitudeyyy",e[34869]="ISOSpeedLatitudezzz",e[37377]="ShutterSpeedValue",e[37378]="ApertureValue",e[37379]="BrightnessValue",e[37380]="ExposureBiasValue",e[37381]="MaxApertureValue",e[37382]="SubjectDistance",e[37383]="MeteringMode",e[37384]="LightSource",e[37385]="Flash",e[37386]="FocalLength",e[37396]="SubjectArea",e[41483]="FlashEnergy",e[41484]="SpatialFrequencyResponse",e[41486]="FocalPlaneXResolution",e[41487]="FocalPlaneYResolution",e[41488]="FocalPlaneResolutionUnit",e[41492]="SubjectLocation",e[41493]="ExposureIndex",e[41495]="SensingMethod",e[41728]="FileSource",e[41729]="SceneType",e[41730]="CFAPattern",e[41985]="CustomRendered",e[41986]="ExposureMode",e[41987]="WhiteBalance",e[41988]="DigitalZoomRatio",e[41989]="FocalLengthIn35mmFilm",e[41990]="SceneCaptureType",e[41991]="GainControl",e[41992]="Contrast",e[41993]="Saturation",e[41994]="Sharpness",e[41995]="DeviceSettingDescription",e[41996]="SubjectDistanceRange",e})(),cr=["GPSVersionID","GPSLatitudeRef","GPSLatitude","GPSLongitudeRef","GPSLongitude","GPSAltitudeRef","GPSAltitude","GPSTimeStamp","GPSSatellites","GPSStatus","GPSMeasureMode","GPSDOP","GPSSpeedRef","GPSSpeed","GPSTrackRef","GPSTrack","GPSImgDirectionRef","GPSImgDirection","GPSMapDatum","GPSDestLatitudeRef","GPSDestLatitude","GPSDestLongitudeRef","GPSDestLongitude","GPSDestBearingRef","GPSDestBearing","GPSDestDistanceRef","GPSDestDistance","GPSProcessingMethod","GPSAreaInformation","GPSDateStamp","GPSDifferential","GPSHPositioningError"],ur=(()=>{const e=[];return e[1024]="GTModelTypeGeoKey",e[1025]="GTRasterTypeGeoKey",e[1026]="GTCitationGeoKey",e[2048]="GeographicTypeGeoKey",e[2049]="GeogCitationGeoKey",e[2050]="GeogGeodeticDatumGeoKey",e[2051]="GeogPrimeMeridianGeoKey",e[2052]="GeogLinearUnitsGeoKey",e[2053]="GeogLinearUnitSizeGeoKey",e[2054]="GeogAngularUnitsGeoKey",e[2055]="GeogAngularUnitSizeGeoKey",e[2056]="GeogEllipsoidGeoKey",e[2057]="GeogSemiMajorAxisGeoKey",e[2058]="GeogSemiMinorAxisGeoKey",e[2059]="GeogInvFlatteningGeoKey",e[2061]="GeogPrimeMeridianLongGeoKey",e[2060]="GeogAzimuthUnitsGeoKey",e[3072]="ProjectedCSTypeGeoKey",e[3073]="PCSCitationGeoKey",e[3074]="ProjectionGeoKey",e[3075]="ProjCoordTransGeoKey",e[3076]="ProjLinearUnitsGeoKey",e[3077]="ProjLinearUnitSizeGeoKey",e[3078]="ProjStdParallel1GeoKey",e[3079]="ProjStdParallel2GeoKey",e[3080]="ProjNatOriginLongGeoKey",e[3081]="ProjNatOriginLatGeoKey",e[3082]="ProjFalseEastingGeoKey",e[3083]="ProjFalseNorthingGeoKey",e[3084]="ProjFalseOriginLongGeoKey",e[3085]="ProjFalseOriginLatGeoKey",e[3086]="ProjFalseOriginEastingGeoKey",e[3087]="ProjFalseOriginNorthingGeoKey",e[3088]="ProjCenterLongGeoKey",e[3090]="ProjCenterEastingGeoKey",e[3091]="ProjCenterNorthingGeoKey",e[3092]="ProjScaleAtNatOriginGeoKey",e[3093]="ProjScaleAtCenterGeoKey",e[3094]="ProjAzimuthAngleGeoKey",e[3095]="ProjStraightVertPoleLongGeoKey",e[4096]="VerticalCSTypeGeoKey",e[4097]="VerticalCitationGeoKey",e[4098]="VerticalDatumGeoKey",e[4099]="VerticalUnitsGeoKey",e})(),fr=(e,t)=>{let r=(t||ot)[e];return r===void 0&&(r="unknown"+String(e)),r},He=new Map;He.set("EXIFIFD",lr),He.set("GPSIFD",cr);const Ie={TIFF_TAGS:ot,ifdTags:He,GEO_KEYS:ur,getTagName:fr},it=(()=>{const e=new ArrayBuffer(4),t=new Uint8Array(e);return new Uint32Array(e)[0]=1,t[0]===1})(),St=[0,1,1,2,4,8,1,1,2,4,8,4,8,-1,-1,-1,8,8,8],xe=4294967296,hr=new Set([1,5,6,7,8,34712,34887]);function Gt(e,t){let r="unknown";return e===3?r=t===64?"f64":"f32":e===1?t===1?r="u1":t===2?r="u2":t===4?r="u4":t<=8?r="u8":t<=16?r="u16":t<=32&&(r="u32"):e===2&&(t<=8?r="s8":t<=16?r="s16":t<=32&&(r="s32")),r}function Ve(e){let t=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":t=Uint8Array;break;case"u16":t=Uint16Array;break;case"u32":t=Uint32Array;break;case"s8":t=Int8Array;break;case"s16":t=Int16Array;break;case"s32":t=Int32Array;break;case"f64":t=Float64Array;break;default:t=Float32Array}return t}function dr(e,t){return{x:t[0]*e.x+t[1]*e.y+t[2],y:t[3]*e.x+t[4]*e.y+t[5]}}function _t(e,t){var r;return(r=e.get(t))==null?void 0:r.values}function be(e,t){var r;return(r=e.get(t))==null?void 0:r.values}function We(e,t){var r,c;return(c=(r=e.get(t))==null?void 0:r.values)==null?void 0:c[0]}function W(e,t){var r,c;return(c=(r=e.get(t))==null?void 0:r.values)==null?void 0:c[0]}function Ke(e,t,r,c=0,a=Ie.TIFF_TAGS,n=4){const p=n===8,o=p?st(new DataView(e,r,8),0,t):new DataView(e,r,2).getUint16(0,t),i=4+2*n,l=p?8:2,s=l+o*i;if(r+s>e.byteLength)return{success:!1,ifd:null,nextIFD:null,requiredBufferSize:s};const m=r+s+4<=e.byteLength?Ge(new DataView(e,r+s,n===8?8:4),0,t,n===8):null,u=r+l,y=new Map;let b,h,g,d,f,C=0,T=0;for(let w=0;wOt(e,{inputOffset:t}).pixels[0];async function qe(e,t,r,c,a){var d,f;const n=it===t,p=W(r,"BITSPERSAMPLE"),o=Gt((d=W(r,"SAMPLEFORMAT"))!=null?d:1,p),i=(f=W(r,"COMPRESSION"))!=null?f:1,l=Ve(o);let s,m,u,y,b,h,g;if(i===34887)return await Mt(),pr(e,c);if(i===1)g=e.slice(c,c+a),u=new Uint8Array(g);else if(i===8||i===32946)u=new Uint8Array(e,c,a),b=new Te(u),h=b.getBytes(),g=new ArrayBuffer(h.length),u=new Uint8Array(g),u.set(h);else if(i===6){u=new Uint8Array(e,c,a);const C=new Be;C.parse(u);const T=C.getData(C.width,C.height,!0);g=new ArrayBuffer(T.length),u=new Uint8Array(g),u.set(T)}else if(i===7){const C=r.get("JPEGTABLES").values,T=C.length-2;u=new Uint8Array(T+a-2);for(let A=0;A1){const x=Math.round(c.length/m);for(d=0;d{var L;const c=it===t.littleEndian,a=be(r,"STRIPOFFSETS");if(a===void 0)return null;const{width:n,height:p,pixelType:o}=nt([r]),i=t.planes,l=n*p,s=W(r,"BITSPERSAMPLE"),m=Ve(o),u=new m(l*i),y=be(r,"STRIPBYTECOUNTS"),b=W(r,"ROWSPERSTRIP"),h=(L=W(r,"COMPRESSION"))!=null?L:1;let g,d,f,C,T,w,S,v,A,k,D,R=b;if(s%8==0)for(g=0;gp?p-g*b:b,o==="u8"||o==="s8"||c){if(h===8||h===32946)S=new Uint8Array(e,a[g],y[g]),k=new Te(S),D=k.getBytes(),w=new ArrayBuffer(D.length),S=new Uint8Array(w),S.set(D),S.length!==R*n*i*s/8&&console.log("strip byte counts is different than expected");else if(h===6){S=new Uint8Array(e,a[g],y[g]);const P=new Be;P.parse(S);const I=P.getData(P.width,P.height,!0);w=new ArrayBuffer(I.length),S=new Uint8Array(w),S.set(I)}else h===5?(S=rt(e,a[g],y[g],t.littleEndian),w=S.buffer):(y[g]!==R*n*i*s/8&&console.log("strip byte counts is different than expected"),w=e.slice(a[g],a[g]+y[g]));C=new m(w)}else{switch(h===6||h===8||h===32946?(S=new Uint8Array(e,a[g],y[g]),k=new Te(S),S=k.getBytes(),w=new ArrayBuffer(S.length),v=new Uint8Array(w),S.length!==R*n*i*s/8&&console.log("strip byte counts is different than expected")):(y[g]!==R*n*i*s/8&&console.log("strip byte counts is different than expected"),w=new ArrayBuffer(y[g]),S=new Uint8Array(e,a[g],y[g]),v=new Uint8Array(w)),o){case"u16":case"s16":for(f=0;f{if(!(e&&e.length>0&&t&&r))return null;let c,a,n;const p=e[0].length,o=e.length,i=new Uint8Array(p);for(let l=0;ln?0:1;else for(let s=0;sn?0:1);return i},Cr=e=>{if(!e)return null;const t=e.match(//gi);if(!t||t.length===0)return null;const r=new Map;let c,a,n,p,o;for(let d=0;d")),p=c.indexOf("sample="),p>-1&&(o=c.slice(p+8,c.indexOf('"',p+8))),p=c.indexOf("name="),p>-1&&(a=c.slice(p+6,c.indexOf('"',p+6))),a&&(n=c.slice(c.indexOf(">")+1,c.indexOf("")).trim(),o!=null?r.has(a)?r.get(a)[o]=n:r.set(a,[n]):r.set(a,n)),o=null;const i=r.get("STATISTICS_MINIMUM"),l=r.get("STATISTICS_MAXIMUM"),s=r.get("STATISTICS_MEAN"),m=r.get("STATISTICS_STDDEV");let u=null;if(i&&l){u=[];for(let d=0;dg&&u>(a?e.byteLength:e?e.byteLength-i+c:0))return r.offlineOffsetSize=[i,u],r.values=null,!1;if(y<=g){if(!t)if(g<=32)i>>>=32-y;else{const f=d!=null&&d.length?d[0]:i>>>0,C=d!=null&&d.length?d[1]:Math.round((i-f)/xe);y<=32?(i=f>>>32-y,d[0]=i):(i=f*2**(32-y)+(C>>>32-y),d[0]=f,d[1]=C>>>32-y)}if(o===1&&m===g)l=[i];else if(g===64){const f=d!=null&&d.length?d[0]:i>>>0,C=d!=null&&d.length?d[1]:Math.round((i-f)/xe);let T=f,w=32;for(h=1;h<=o;h++){const S=32-m*h%32;if(w>>32-w,A=C<<32-w>>>32-w;T=C,l.push(v+A*2**(m-w)),w-=32-(m-w)}else l.push(T<>>32-m),w-=m;w===0&&(w=32,T=C)}}else for(h=1;h<=o;h++){const f=32-m*h;l.push(i<>>32-m)}}else{i-=c,a&&(i=0);for(let f=i;fparseFloat(M)),u.some(M=>isNaN(M))&&(u=null));const y=(V=W(t,"COMPRESSION"))!=null?V:1;let b;switch(y){case 1:b="NONE";break;case 2:case 3:case 4:case 32771:b="CCITT";break;case 5:b="LZW";break;case 6:case 7:b="JPEG";break;case 32773:b="PACKBITS";break;case 8:case 32946:b="DEFLATE";break;case 34712:b="JPEG2000";break;case 34887:b="LERC";break;default:b=String(y)}let h=!0,g="";hr.has(y)||(h=!1,g+="unsupported tag compression "+y),i>3&&(h=!1,g+="unsupported tag sampleFormat "+i),p%8!=0&&(h=!1,g+="unsupported tag bitsPerSample "+p);const d=We(t,"GEOASCIIPARAMS");let f;if(d){const M=d.split("|").find(_=>_.includes("ESRI PE String = ")),B=M?M.replace("ESRI PE String = ",""):"";f=B.startsWith("COMPD_CS")||B.startsWith("PROJCS")||B.startsWith("GEOGCS")?{wkid:null,wkt:B}:null}const C=be(t,"GEOTIEPOINTS"),T=be(t,"GEOPIXELSCALE"),w=be(t,"GEOTRANSMATRIX"),S=t.has("GEOKEYDIRECTORY")?t.get("GEOKEYDIRECTORY").data:null;let v,A,k=!1;if(S){k=W(S,"GTRasterTypeGeoKey")===2;const M=W(S,"GTModelTypeGeoKey");if(M===2){const B=W(S,"GeographicTypeGeoKey");B>=1024&&B<=32766&&(f={wkid:B})}else if(M===1){const B=W(S,"ProjectedCSTypeGeoKey");B>=1024&&B<=32766&&(f={wkid:B})}}if(T&&C&&C.length>=6?(v=[T[0],0,C[3]-C[0]*T[0],0,-Math.abs(T[1]),C[4]-C[1]*T[1]],k&&(v[2]-=.5*v[0]+.5*v[1],v[5]-=.5*v[3]+.5*v[4])):w&&w.length===16&&(v=k?[w[0],w[1],w[3]-.5*w[0],w[4],w[5],w[7]-.5*w[5]]:[w[0],w[1],w[3],w[4],w[5],w[7]]),v){const M=[{x:0,y:n},{x:0,y:0},{x:a,y:n},{x:a,y:0}];let B,_=Number.POSITIVE_INFINITY,G=Number.POSITIVE_INFINITY,F=Number.NEGATIVE_INFINITY,q=Number.NEGATIVE_INFINITY;for(let X=0;X_?_:B.x,F=B.xG?G:B.y,q=B.yWe(M,"NEWSUBFILETYPE")===1);let R,E,L,P,I;if(D.length>0){L=Math.round(Math.log(a/W(D[0],"IMAGEWIDTH"))/Math.LN2);const M=D[D.length-1];P=Math.round(Math.log(a/W(M,"IMAGEWIDTH"))/Math.LN2),R=W(M,"TILEWIDTH"),E=W(M,"TILELENGTH")}R=P!=null&&P>0?R||r:null,E=P!=null&&P>0?E||c:null,r&&(I=[{maxCol:Math.ceil(a/r)-1,maxRow:Math.ceil(n/c)-1,minRow:0,minCol:0}],D.forEach(M=>{I.push({maxCol:Math.ceil(W(M,"IMAGEWIDTH")/W(M,"TILEWIDTH"))-1,maxRow:Math.ceil(W(M,"IMAGELENGTH")/W(M,"TILELENGTH"))-1,minRow:0,minCol:0})}));const x=We(e[0],"GDAL_METADATA"),O=Cr(x);return g+=" "+Bt({width:a,height:n,tileWidth:r,tileHeight:c,planes:o,ifds:e}),{width:a,height:n,tileWidth:r,tileHeight:c,planes:o,isBSQ:s,pixelType:l,compression:b,noData:u,isSupported:h,message:g,extent:A,affine:T?null:v,firstPyramidLevel:L,maximumPyramidLevel:P,pyramidBlockWidth:R,pyramidBlockHeight:E,tileBoundary:I,metadata:O}}function at(e,t){const r=_t(e,"PLANARCONFIGURATION");return r?r[0]===2:!!t&&t.isBSQ}function br(e){const{littleEndian:t,isBigTiff:r,firstIFDPos:c}=vr(e);let a=c;const n=[];do{const p=Sr(e,t,a,0,Ie.TIFF_TAGS,r?8:4);if(!p.success)break;n.push(p.ifd),a=p.nextIFD}while(a>0);return{...nt(n),littleEndian:t,isBigTiff:r,ifds:n}}function st(e,t,r){const c=e.getUint32(t,r),a=e.getUint32(t+4,r);return r?a*xe+c:c*xe+a}function Tr(e,t,r){let c=r?e.getInt32(t,r):e.getUint32(t,r),a=r?e.getUint32(t+4,r):e.getInt32(t+4,r);const n=(r?c:a)>=0?1:-1;return r?c*=n:a*=n,n*(r?a*xe+c:c*xe+a)}function Ge(e,t,r,c){return c?st(e,t,r):e.getUint32(t,r)}function vr(e){const t=new DataView(e,0,16),r=t.getUint16(0,!1);let c=null;if(r===18761)c=!0;else{if(r!==19789)throw"unexpected endianess byte";c=!1}const a=t.getUint16(2,c);if(a!==42&&a!==43)throw"unexpected tiff identifier";let n=4;const p=a===43;if(p){const o=t.getUint16(n,c);if(n+=2,o!==8||t.getUint16(n,c)!==0)throw"unsupported bigtiff version";n+=2}return{littleEndian:c,isBigTiff:p,firstIFDPos:Ge(t,n,c,p)}}function Sr(e,t,r,c=0,a=Ie.TIFF_TAGS,n=4){const p=Ke(e,t,r,c,a,n);let o;const i=p.ifd;if(i){if(Ie.ifdTags.forEach((l,s)=>{i.has(s)&&(o=i.get(s),o.data=Ke(e,t,o.valueOffset-c,c,l).ifd)}),i.has("GEOKEYDIRECTORY")){o=i.get("GEOKEYDIRECTORY");const l=o.values;if(l&&l.length>4){const s=l[0]+"."+l[1]+"."+l[2];o.data=Ke(e,t,o.valueOffset+6-c,c,Ie.GEO_KEYS,2).ifd,o.data&&o.data.set("GEOTIFFVersion",{id:0,type:2,valueCount:1,valueOffset:null,values:[s]})}}if(i.has("XMP")){o=i.get("XMP");const l=o.values;typeof l[0]=="number"&&o.type===7&&(o.values=[sr(new Uint8Array(l))])}}return p}function Bt(e){const{width:t,height:r,tileHeight:c,tileWidth:a}=e,n=e.planes,p=a?a*c:t*r,o=W(e.ifds[0],"BITSPERSAMPLE");let i="";return p*n>2**30/(o>8?o/8:1)&&(i=a?"tiled tiff exceeding 1 gigabits per tile is not supported":"scanline tiff exceeding 1 gigabits is not supported"),i}async function kr(e,t){var k;const{headerInfo:r,ifd:c,offsets:a,sizes:n}=t,p=[];for(let D=0;DD.min):null,S=T?T.map(D=>D.max):null;let v,A=null;if(C!=null)if(A=new Uint8Array(b),Math.abs(C)>1e24)for(v=0;v1e24)for(o=0;ol;0<=l?++C:--C)i.push(this.data[this.pos++]);break;case"tRNS":switch(this.transparency={},this.colorType){case 3:if(this.transparency.indexed=this.read(l),(d=255-this.transparency.indexed.length)>0)for(T=0;0<=d?Td;0<=d?++T:--T)this.transparency.indexed.push(255);break;case 0:this.transparency.grayscale=this.read(l)[0];break;case 2:this.transparency.rgb=this.read(l)}break;case"tEXt":b=(f=this.read(l)).indexOf(0),h=String.fromCharCode.apply(String,f.slice(0,b)),this.text[h]=String.fromCharCode.apply(String,f.slice(b+1));break;case"IEND":return y&&this.animation.frames.push(y),this.colors=function(){switch(this.colorType){case 0:case 3:case 4:return 1;case 2:case 6:return 3}}.call(this),this.hasAlphaChannel=(w=this.colorType)===4||w===6,s=this.colors+(this.hasAlphaChannel?1:0),this.pixelBitlength=this.bits*s,this.colorSpace=function(){switch(this.colors){case 1:return"DeviceGray";case 3:return"DeviceRGB"}}.call(this),void(this.imgData=new Uint8Array(this.imgData));default:this.pos+=l}if(this.pos+=4,this.pos>this.data.length)throw new Error("Incomplete or corrupt PNG file")}}return o.load=function(i,l,s){var m;return typeof l=="function"&&(s=l),(m=new XMLHttpRequest).open("GET",i,!0),m.responseType="arraybuffer",m.onload=function(){var u;return u=new o(new Uint8Array(m.response||m.mozResponseArrayBuffer)),typeof(l!=null?l.getContext:void 0)=="function"&&u.render(l),typeof s=="function"?s(u):void 0},m.send(null)},r=1,c=2,t=0,o.prototype.read=function(i){var l,s;for(s=[],l=0;0<=i?li;0<=i?++l:--l)s.push(this.data[this.pos++]);return s},o.prototype.readUInt32=function(){return this.data[this.pos++]<<24|this.data[this.pos++]<<16|this.data[this.pos++]<<8|this.data[this.pos++]},o.prototype.readUInt16=function(){return this.data[this.pos++]<<8|this.data[this.pos++]},o.prototype.decodePixels=function(i){var l,s,m,u,y,b,h,g,d,f,C,T,w,S,v,A,k,D,R,E,L,P,I;if(i==null&&(i=this.imgData),i.length===0)return new Uint8Array(0);for(i=(i=new Te(i)).getBytes(),A=(T=this.pixelBitlength/8)*this.width,w=new Uint8Array(A*this.height),b=i.length,v=0,S=0,s=0;S1&&s/uMr(r,c,e);break;case"tiff":t=Pr;break;case"deflate":t=Er;break;case"lzw":t=Lr;break;case"error":t=()=>{throw new de("rasterCodec:decode","input data contains error")};break;default:t=()=>{throw new de("rasterCodec:decode","unsupported raster format")}}return t}function Br(e){let t=null,r=null;switch(e?e.toLowerCase():"f32"){case"u1":case"u2":case"u4":case"u8":r=255,t=Uint8Array;break;case"u16":r=r||65535,t=Uint16Array;break;case"u32":r=r||2**32-1,t=Uint32Array;break;case"s8":r=r||-128,t=Int8Array;break;case"s16":r=r||-32768,t=Int16Array;break;case"s32":r=r||0-2**31,t=Int32Array;break;default:t=Float32Array}return{pixelTypeCtor:t,noDataValue:r}}function Nr(e,t=1){if(!e)return;const{pixels:r,width:c,height:a,mask:n}=e;if(!r||r.length===0)return;const p=r.length,o=c-1,i=a-1,l=[];let s,m,u,y,b,h,g=null;const d=oe.getPixelArrayConstructor(e.pixelType);if(t===0){for(s=0;s.001&&(u/=111e3,y/=111e3),p==="adjusted")if(o){const E=111e3*s,L=111e3*m;u=(l+E**a*n)/(8*E),y=(l+L**a*n)/(8*L)}else u=(l+s**a*n)/(8*s),y=(l+m**a*n)/(8*m);let b=(90-t)*Math.PI/180,h=Math.cos(b),g=(360-r+90)*Math.PI/180,d=Math.sin(b)*Math.cos(g),f=Math.sin(b)*Math.sin(g);const C=[315,270,225,360,180,0],T=[60,60,60,60,60,90],w=new Float32Array([3,5,3,2,1,4]),S=w.reduce((E,L)=>E+L),v=w.map(E=>E/S),A=c==="multi-directional"?C.length:1,k=new Float32Array(6),D=new Float32Array(6),R=new Float32Array(6);if(c==="multi-directional")for(let E=0;Eb?b:g],C=p[h],T=C*f,w=T*(1-Math.abs(d%2-1)),S=C-T;switch(Math.floor(d)){case 0:m[h]=T+S,u[h]=w+S,y[h]=S;break;case 1:m[h]=w+S,u[h]=T+S,y[h]=S;break;case 2:m[h]=S,u[h]=T+S,y[h]=w+S;break;case 3:m[h]=S,u[h]=w+S,y[h]=T+S;break;case 4:m[h]=w+S,u[h]=S,y[h]=T+S;break;case 5:case 6:m[h]=T+S,u[h]=S,y[h]=w+S}}e.pixels=[m,u,y],e.updateStatistics()}function mo(e,t){var E,L;if(!Ae(e))return e;const r=t.zFactor,c=(E=t.pixelSizePower)!=null?E:1,a=(L=t.pixelSizeFactor)!=null?L:1,n=t.slopeType,p=t.isGCS,{width:o,height:i,mask:l}=e,s=e.pixels[0],m=new Uint8Array(o*i);let u=1;if(H(l)){for(let P=0;P360&&(R%=360)),o[S+v]=R}}for(let w=0;wt[r]+2||e[r]{if(Ue(e.fromColor.toRgb(),a.fromColor)&&Ue(e.toColor.toRgb(),a.toColor))return c=a.id,!0}):e.type==="multipart"&&r.some(a=>{const n=e.colorRamps,p=a.colorRamps;if(n&&p&&n.length===p.length&&!p.some((o,i)=>{if(!Ue(n[i].fromColor.toRgb(),new lt(o.fromColor).toRgb())||!Ue(n[i].toColor.toRgb(),new lt(o.toColor).toRgb()))return!0})){if(c)return!0;c=a.id}}),c}function Wr(e){const t=zr(e);return t?jr[t]:null}function Ee(e){const t=(e=e||{}).numColors||256,r=e.distanceOffset||0,c=e.isCustomInterval!=null?e.isCustomInterval:e.distanceInterval!==null&&e.distanceInterval!==1/(t-1),a=e.distanceInterval||1/(t-1);return{...e,numColors:t,distanceOffset:r,interpolateAlpha:!!e.interpolateAlpha,distanceInterval:a,isCustomInterval:c,weights:e.weights}}function Kr(e,t,r){const{numColors:c,distanceOffset:a,distanceInterval:n,isCustomInterval:p}=Ee(r),o=e.s===0,i=t.s===0;let l=e.h,s=t.h;o&&!i?l=s:i&&!o&&(t={...t,h:l},s=l);let m,u=Math.abs(s-l);const y=360;us?u*n:-u*n);const b=(t.s-e.s)*n,h=(t.v-e.v)*n;let{s:g,v:d}=e,f=l;if(a){const T=a/n;f=(f+T*m+y)%y,g+=T*b,d+=T*h}const C=[];for(let T=0;Ty+b);a=a.map(y=>y/u)}else{a=[];for(let u=0;u{a.unshift(n),r||a.pop()}),c}function yo(e){const t=Wr(e);if(e){if(e.type==="algorithmic")return{...It(e),Name:t};if(e.colorRamps){const r=e.colorRamps.map(It);return{type:"MultiPartColorRamp",NumColorRamps:r.length,ArrayOfColorRamp:r,Name:t}}}}function It(e){var t;if(!!e)return{Algorithm:((t=e.toJSON())==null?void 0:t.Algorithm)||"esriHSVAlgorithm",type:"AlgorithmicColorRamp",FromColor:At(e.fromColor),ToColor:At(e.toColor)}}function At(e){const t=_e(e);return{type:"HsvColor",Hue:t.h,Saturation:t.s,Value:t.v,AlphaValue:255}}function Co(e){const t=e.reverse().map(r=>{const c=r.toString(16);return c.length<2?"0"+c:c});return 4294967295&Number.parseInt(t.join(""),16)}const wo=new Ht({none:"none",standardDeviation:"standard-deviation",histogramEqualization:"histogram-equalization",minMax:"min-max",percentClip:"percent-clip",sigmoid:"sigmoid"}),Xr={0:"none",3:"standardDeviation",4:"histogramEqualization",5:"minMax",6:"percentClip",9:"sigmoid"},xt={u1:[0,1],u2:[0,3],u4:[0,15],u8:[0,255],s8:[-128,127],u16:[0,65535],s16:[-32768,32767],u32:[0,4294967295],s32:[-2147483648,2147483647],f32:[-34e38,34e38],f64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Je=1,Zr=[.299,.587,.114];function jt(e,t=256){t=Math.min(t,256);const{size:r,counts:c}=e,a=new Uint8Array(r),n=c.reduce((s,m)=>s+m/t,0);let p=0,o=0,i=0,l=n;for(let s=0;s=o,h=[];if(b)for(i=0;i1?c[i]>2?h[i]=6.5+(c[i]-2)**2.5:h[i]=6.5+100*(2-c[i])**4:h[i]=1;let g;const d=[];let f,C,T;if(b)for(i=0;i1&&(C-=(1/y)**(g*h[i])),ft[i]?T[l]=Math.floor(C*y*g**(1/c[i]))+n:f>=r[i]?T[l]=p:T[l]=n;d[i]=T}else for(i=0;i=r[i]?T[l]=p:T[l]=Math.floor((f-t[i])/u[i]*y)+n;d[i]=T}if(e.contrastOffset!=null){const w=Qr(e.contrastOffset,e.brightnessOffset);for(i=0;i0&&r<100?o=(200*p-100*a+2*a*c)/(2*(100-r))+n:r<=0&&r>-100?o=(200*p-100*a+2*a*c)*(100+r)/2e4+n:r===100?(o=200*p-100*a+(a+1)*(100-r)+2*a*c,o=o>0?a:0):r===-100&&(o=n),i[p]=o>a?a:o<0?0:o;return i}function eo(e,t,r){const c=[];for(let a=0;a=255)return Je;let t=0;e!==150&&(t=e<=150?45*Math.cos(.01047*e):17*Math.sin(.021*e));const r=255,c=e+t,a=Math.log(e/r),n=Math.log(c/r);if(n===0)return Je;const p=a/n;return isNaN(p)?Je:Math.min(9.9,Math.max(.01,p))}function ro(e){var k;if(Fe(e)||!((k=e.pixels)!=null&&k.length))return null;e.statistics||e.updateStatistics();const{pixels:t,mask:r,pixelType:c,statistics:a}=e,n=e.width*e.height,p=t.length;let o,i,l,s,m;const u=[],y=[];let b,h,g,d,f,C,T,w,S,v;const A=256;for(s=0;s[k.minValue,k.maxValue,0,0]);else{const k=ro(r);p=H(k)?k.statistics:null,o=H(k)?k.histograms:null}else p=((A=e.statistics)==null?void 0:A.length)>0?e.statistics:we(n.statistics),o=e.histograms||we(n.histograms);i!=="percentClip"&&i!=="histogramEqualization"||(o==null?void 0:o.length)||(i="minMax");const l=(p==null?void 0:p.length)||(o==null?void 0:o.length)||n.bandCount,s=[],m=[];let u,y,b,h,g,d,f,C,T,w,S,v;switch(p&&!Array.isArray(p[0])&&(p=p.map(k=>[k.min,k.max,k.avg,k.stddev])),i){case"none":{const k=xt[n.pixelType]||xt.f32;for(C=0;Cp[C][1]&&(m[C]=p[C][1]);break;case"histogramEqualization":for(le(o),C=0;C=20&&(h[0]=h[1]=h[2]=h[h.length-1]=h[h.length-2]=0),b=0,y=(u.max-u.min)/u.size,f=u.min===-.5&&y===1?.5:0,T=0;Td){s[C]=u.min+y*(T+f);break}for(d=(1-(e.maxPercent||0)/100)*b,T=u.size-2;T>=0;T--)if(g[T]jt(k)))):(S=e.max||255,w=e.min||0),oo({minCutOff:s,maxCutOff:m,outMax:S,outMin:w,histogramLut:v},c)}function oo(e,t){if(t==null||t.length===0)return e;const r=Math.max.apply(null,t),{minCutOff:c,maxCutOff:a,outMin:n,outMax:p,histogramLut:o}=e;return c.length===t.length||c.length<=r?e:{minCutOff:t.map(i=>c[i]),maxCutOff:t.map(i=>a[i]),histogramLut:o?t.map(i=>o[i]):null,outMin:n,outMax:p}}function Ye(e,t){var k;if(Fe(e)||!((k=e.pixels)!=null&&k.length))return e;const{mask:r,width:c,height:a,pixels:n}=e,{minCutOff:p,maxCutOff:o,gamma:i}=t,l=t.outMin||0,s=t.outMax||255,m=c*a,u=t.outputPixelType||"u8",y=e.pixels.map(()=>oe.createEmptyBand(u,m)),b=y.length;let h,g,d,f,C;const T=s-l,w=[];for(h=0;h=b,v=[];if(S)for(h=0;h1?i[h]>2?v[h]=6.5+(i[h]-2)**2.5:v[h]=6.5+100*(2-i[h])**4:v[h]=1;if(S)if(r!=null){for(g=0;g1&&(f-=(1/T)**(C*v[h])),dp[h]?y[h][g]=Math.floor(f*T*C**(1/i[h]))+l:d>=o[h]?y[h][g]=s:y[h][g]=l}else for(g=0;g1&&(f-=(1/T)**(C*v[h])),dp[h]?y[h][g]=Math.floor(f*T*C**(1/i[h]))+l:d>=o[h]?y[h][g]=s:y[h][g]=l;else if(r!=null){for(g=0;gp[h]?y[h][g]=Math.floor((d-p[h])/w[h]*T)+l:d>=o[h]?y[h][g]=s:y[h][g]=l}else for(g=0;gp[h]?y[h][g]=Math.floor((d-p[h])/w[h]*T)+l:d>=o[h]?y[h][g]=s:y[h][g]=l;const A=new oe({width:c,height:a,mask:r,pixels:y,pixelType:u});return A.updateStatistics(),A}var Xe;let ee=Xe=class extends et{constructor(){super(...arguments),this.blockWidth=void 0,this.blockHeight=void 0,this.compression=null,this.origin=null,this.firstPyramidLevel=null,this.maximumPyramidLevel=null,this.pyramidScalingFactor=2,this.pyramidBlockWidth=null,this.pyramidBlockHeight=null,this.isVirtualTileInfo=!1,this.tileInfo=null,this.transposeInfo=null,this.blockBoundary=null}clone(){return new Xe({blockWidth:this.blockWidth,blockHeight:this.blockHeight,compression:this.compression,origin:te(this.origin),firstPyramidLevel:this.firstPyramidLevel,maximumPyramidLevel:this.maximumPyramidLevel,pyramidResolutions:te(this.pyramidResolutions),pyramidScalingFactor:this.pyramidScalingFactor,pyramidBlockWidth:this.pyramidBlockWidth,pyramidBlockHeight:this.pyramidBlockHeight,isVirtualTileInfo:this.isVirtualTileInfo,tileInfo:te(this.tileInfo),transposeInfo:te(this.transposeInfo),blockBoundary:te(this.blockBoundary)})}};$([z({type:Number,json:{write:!0}})],ee.prototype,"blockWidth",void 0),$([z({type:Number,json:{write:!0}})],ee.prototype,"blockHeight",void 0),$([z({type:String,json:{write:!0}})],ee.prototype,"compression",void 0),$([z({type:qt,json:{write:!0}})],ee.prototype,"origin",void 0),$([z({type:Number,json:{write:!0}})],ee.prototype,"firstPyramidLevel",void 0),$([z({type:Number,json:{write:!0}})],ee.prototype,"maximumPyramidLevel",void 0),$([z({json:{write:!0}})],ee.prototype,"pyramidResolutions",void 0),$([z({type:Number,json:{write:!0}})],ee.prototype,"pyramidScalingFactor",void 0),$([z({type:Number,json:{write:!0}})],ee.prototype,"pyramidBlockWidth",void 0),$([z({type:Number,json:{write:!0}})],ee.prototype,"pyramidBlockHeight",void 0),$([z({type:Boolean,json:{write:!0}})],ee.prototype,"isVirtualTileInfo",void 0),$([z({json:{write:!0}})],ee.prototype,"tileInfo",void 0),$([z()],ee.prototype,"transposeInfo",void 0),$([z()],ee.prototype,"blockBoundary",void 0),ee=Xe=$([Qe("esri.layers.support.RasterStorageInfo")],ee);const io=ee;var Ze;let Y=Ze=class extends et{constructor(e){super(e),this.attributeTable=null,this.bandCount=null,this.colormap=null,this.extent=null,this.format=void 0,this.height=null,this.width=null,this.histograms=null,this.keyProperties={},this.multidimensionalInfo=null,this.noDataValue=null,this.pixelSize=null,this.pixelType=null,this.isPseudoSpatialReference=!1,this.spatialReference=null,this.statistics=null,this.storageInfo=null,this.transform=null}get dataType(){var t,r,c;const e=(c=(r=(t=this.keyProperties)==null?void 0:t.DataType)==null?void 0:r.toLowerCase())!=null?c:"generic";return e==="stdtime"?"standard-time":e}get nativeExtent(){return this._get("nativeExtent")||this.extent}set nativeExtent(e){e&&this._set("nativeExtent",e)}get nativePixelSize(){if(Fe(this.transform)||!this.transform.affectsPixelSize)return this.pixelSize;const e=this.nativeExtent;return{x:e.width/this.width,y:e.height/this.height}}get hasMultidimensionalTranspose(){var e;return!!((e=this.storageInfo)!=null&&e.transposeInfo)}clone(){return new Ze({attributeTable:te(this.attributeTable),bandCount:this.bandCount,colormap:te(this.colormap),extent:te(this.extent),nativePixelSize:te(this.nativePixelSize),format:this.format,height:this.height,width:this.width,histograms:te(this.histograms),keyProperties:te(this.keyProperties),multidimensionalInfo:te(this.multidimensionalInfo),noDataValue:this.noDataValue,pixelSize:te(this.pixelSize),pixelType:this.pixelType,isPseudoSpatialReference:this.isPseudoSpatialReference,spatialReference:te(this.spatialReference),statistics:te(this.statistics),storageInfo:te(this.storageInfo),transform:te(this.transform)})}};$([z({json:{write:!0}})],Y.prototype,"attributeTable",void 0),$([z({json:{write:!0}})],Y.prototype,"bandCount",void 0),$([z({json:{write:!0}})],Y.prototype,"colormap",void 0),$([z({type:String,readOnly:!0})],Y.prototype,"dataType",null),$([z({type:ct,json:{write:!0}})],Y.prototype,"extent",void 0),$([z({type:ct,json:{write:!0}})],Y.prototype,"nativeExtent",null),$([z({json:{write:!0}})],Y.prototype,"nativePixelSize",null),$([z({json:{write:!0}})],Y.prototype,"format",void 0),$([z({json:{write:!0}})],Y.prototype,"height",void 0),$([z({json:{write:!0}})],Y.prototype,"width",void 0),$([z({json:{write:!0}})],Y.prototype,"hasMultidimensionalTranspose",null),$([z({json:{write:!0}})],Y.prototype,"histograms",void 0),$([z({json:{write:!0}})],Y.prototype,"keyProperties",void 0),$([z({json:{write:!0}})],Y.prototype,"multidimensionalInfo",void 0),$([z({json:{write:!0}})],Y.prototype,"noDataValue",void 0),$([z({json:{write:!0}})],Y.prototype,"pixelSize",void 0),$([z({json:{write:!0}})],Y.prototype,"pixelType",void 0),$([z()],Y.prototype,"isPseudoSpatialReference",void 0),$([z({type:Xt,json:{write:!0}})],Y.prototype,"spatialReference",void 0),$([z({json:{write:!0}})],Y.prototype,"statistics",void 0),$([z({type:io,json:{write:!0}})],Y.prototype,"storageInfo",void 0),$([z({json:{write:!0}})],Y.prototype,"transform",void 0),Y=Ze=$([Qe("esri.layers.support.RasterInfo")],Y);const no=Y;function ao(e,t){const{attributeTable:r,bandCount:c}=e;return!(Fe(r)||c>1||t&&r.fields.find(a=>a.name.toLowerCase()===t.toLowerCase())==null)}function so(e){const{bandCount:t,dataType:r,pixelType:c}=e;return r==="elevation"||r==="generic"&&t===1&&(c==="s16"||c==="f32"||c==="f64")}function lo(e){const{bandCount:t,colormap:r}=e;return H(r)&&r.length>0&&t===1}let Ce=class extends et{constructor(e){super(e)}bind(){const{rendererJSON:e}=this;if(!e)return{success:!1};let t;switch(this.lookup={rendererJSON:{}},e.type){case"uniqueValue":t=this._updateUVRenderer(e);break;case"rasterColormap":t=this._updateColormapRenderer(e);break;case"rasterStretch":t=this._updateStretchRenderer(e);break;case"classBreaks":t=this._updateClassBreaksRenderer(e);break;case"rasterShadedRelief":t=this._updateShadedReliefRenderer(e);break;case"vectorField":t=this._updateVectorFieldRenderer();break;case"flowRenderer":t=this._updateFlowRenderer()}return t}symbolize(e){let t=e&&e.pixelBlock;if(!Pt(t))return t;if(e.simpleStretchParams&&this.rendererJSON.type==="rasterStretch")return this.simpleStretch(t,e.simpleStretchParams);try{let r;switch(t.pixels.length>3&&(t=ft(t,[0,1,2])),this.rendererJSON.type){case"uniqueValue":case"rasterColormap":r=this._symbolizeColormap(t);break;case"classBreaks":r=this._symbolizeClassBreaks(t);break;case"rasterStretch":r=this._symbolizeStretch(t,e.bandIds);break;case"rasterShadedRelief":{const c=e.extent,a=c.spatialReference.isGeographic,n={x:(c.xmax-c.xmin)/t.width,y:(c.ymax-c.ymin)/t.height};r=this._symbolizeShadedRelief(t,{isGCS:a,resolution:n});break}}return r}catch(r){return ut.getLogger(this.declaredClass).error("symbolize",r.message),t}}simpleStretch(e,t){if(!Pt(e))return e;try{return e.pixels.length>3&&(e=ft(e,[0,1,2])),Ye(e,t)}catch(r){return ut.getLogger(this.declaredClass).error("symbolize",r.message),e}}generateWebGLParameters(e){if(["uniqueValue","rasterColormap","classBreaks"].includes(this.rendererJSON.type)){const{indexedColormap:p,offset:o}=this.lookup.colormapLut||{};return{colormap:p,colormapOffset:o,type:"lut"}}const{pixelBlock:t,isGCS:r,resolution:c,bandIds:a}=e,{rendererJSON:n}=this;return n.type==="rasterStretch"?this._generateStretchWebGLParams(t,n,a):n.type==="rasterShadedRelief"?this._generateShadedReliefWebGLParams(n,r,c):n.type==="vectorField"?this._generateVectorFieldWebGLParams(n):null}_isLUTChanged(e){if(!this.lookup||!this.lookup.rendererJSON)return!0;if("colorRamp"in this.rendererJSON){const t=this.rendererJSON.colorRamp;return e?JSON.stringify(t)!==JSON.stringify(this.lookup.rendererJSON.colorRamp):(this.rendererJSON,this.lookup.rendererJSON,JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON))}return JSON.stringify(this.rendererJSON)!==JSON.stringify(this.lookup.rendererJSON)}_symbolizeColormap(e){return this._isLUTChanged()&&!this.bind().success?e:$e(e,this.lookup.colormapLut)}_symbolizeClassBreaks(e){var r;const{canUseIndexedLUT:t}=this._analyzeClassBreaks(this.rendererJSON);return this._isLUTChanged()&&!this.bind().success?e:t?$e(e,this.lookup.colormapLut):Zt(e,(r=this.lookup.remapLut)!=null?r:[])}_symbolizeStretch(e,t){var m,u,y;const{rasterInfo:r}=this,{pixelType:c,bandCount:a}=r,n=this.rendererJSON,p=["u8","u16","s8","s16"].includes(c);let o,i;const{dra:l}=n,{gamma:s}=this.lookup;if(n.stretchType==="histogramEqualization"){const b=l?null:(m=this.lookup)==null?void 0:m.histogramLut,h=Re(n,{rasterInfo:r,pixelBlock:e,bandIds:t,returnHistogramLut:!b}),g=Ye(e,{...h,gamma:s});i=ht(g,{lut:l?h.histogramLut:b,offset:0})}else if(p){if(l){const b=Re(n,{rasterInfo:r,pixelBlock:e,bandIds:t});o=Dt({pixelType:c,...b,gamma:s})}else if(this._isLUTChanged()){if(!this.bind().success)return e;o=this.lookup?this.lookup.stretchLut:null}else o=this.lookup?this.lookup.stretchLut:null;if(!o)return e;a>1&&(t==null?void 0:t.length)===((u=we(e))==null?void 0:u.pixels.length)&&(o==null?void 0:o.lut.length)===a&&(o={lut:t.map(b=>o.lut[b]),offset:o.offset}),i=ht(e,o)}else{const b=Re(n,{rasterInfo:r,pixelBlock:e,bandIds:t});i=Ye(e,{...b,gamma:s})}if(n.colorRamp){if(this._isLUTChanged(!0)&&!this.bind().success)return e;i=$e(i,(y=this.lookup)==null?void 0:y.colormapLut)}return i}_symbolizeShadedRelief(e,t){var o,i;const r=this.rendererJSON,c={...r,...t},a=Fr(e,c);if(!r.colorRamp)return a;let n;if(this._isLUTChanged(!0)){if(!this.bind().success)return a;n=this.lookup?this.lookup.hsvMap:null}else n=this.lookup?this.lookup.hsvMap:null;if(!n)return a;const p=(i=(o=we(this.rasterInfo.statistics))==null?void 0:o[0])!=null?i:{min:0,max:8e3};return Vr(a,e,n,p),a}_isVectorFieldData(){const{bandCount:e,dataType:t}=this.rasterInfo;return e===2&&(t==="vector-magdir"||t==="vector-uv")}_updateVectorFieldRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; VectorFieldRenderer only supports "vector-magdir" and "vector-uv".`}}_updateFlowRenderer(){return this._isVectorFieldData()?{success:!0}:{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; FlowRenderer only supports "vector-magdir" and "vector-uv".`}}_updateUVRenderer(e){var l;const{bandCount:t,attributeTable:r,pixelType:c}=this.rasterInfo,a=e.field1;if(!a)return{success:!1,error:"Unsupported renderer; missing UniqueValueRenderer.field."};const n=e.defaultSymbol,p=t===1&&["u8","s8"].includes(c);if(!ao(this.rasterInfo,a)&&!p)return{success:!1,error:"Unsupported data; UniqueValueRenderer is only supported on single band data with a valid raster attribute table."};const o=[];if(H(r)){const s=r.fields.find(m=>m.name.toLowerCase()==="value");if(!s)return{success:!1,error:"Unsupported data; the data's raster attribute table does not have a value field."};r.features.forEach(m=>{var b,h;const u=(b=e.uniqueValueInfos)==null?void 0:b.find(g=>String(g.value)===String(m.attributes[a])),y=(h=u==null?void 0:u.symbol)==null?void 0:h.color;y?o.push([m.attributes[s.name]].concat(y)):n&&o.push([m.attributes[s.name]].concat(n.color))})}else{if(a.toLowerCase()!=="value")return{success:!1,error:'Unsupported renderer; UniqueValueRenderer.field must be "Value" when raster attribute table is not availalbe.'};(l=e.uniqueValueInfos)==null||l.forEach(s=>{var u;const m=(u=s==null?void 0:s.symbol)==null?void 0:u.color;m?o.push([parseInt(""+s.value,10)].concat(m)):n&&o.push([parseInt(""+s.value,10)].concat(n==null?void 0:n.color))})}if(o.length===0)return{success:!1,error:"Invalid UniqueValueRenderer. Cannot find matching records in the raster attribute table."};const i=Pe({colormap:o});return this.lookup={rendererJSON:e,colormapLut:i},this.canRenderInWebGL=!0,{success:!0}}_updateColormapRenderer(e){if(!lo(this.rasterInfo))return{success:!1,error:"Unsupported data; the data source does not have a colormap."};const t=e.colormapInfos.map(c=>[c.value].concat(c.color)).sort((c,a)=>c[0]-a[0]);if(!t||t.length===0)return{success:!1,error:"Unsupported renderer; ColormapRenderer must have meaningful colormapInfos."};const r=Pe({colormap:t});return this.lookup={rendererJSON:e,colormapLut:r},this.canRenderInWebGL=!0,{success:!0}}_updateShadedReliefRenderer(e){if(!so(this.rasterInfo))return{success:!1,error:`Unsupported data type "${this.rasterInfo.dataType}"; ShadedReliefRenderer only supports "elevation", or single band float/s16 data.`};if(e.colorRamp){const t=kt(e.colorRamp,256,!0),r=Pe({colormap:t}),c=[],a=r.indexedColormap;for(let n=0;np.name.toLowerCase()==="value"):null,a=H(t)?t.fields.find(p=>p.name.toLowerCase()===e.field.toLowerCase()):null,n=c!=null&&a!==null;return{canUseIndexedLUT:["u8","u16","s8","s16"].includes(r)||n,tableValueField:c,tableBreakField:a}}_updateClassBreaksRenderer(e){var m;const{attributeTable:t}=this.rasterInfo,{canUseIndexedLUT:r,tableValueField:c,tableBreakField:a}=this._analyzeClassBreaks(e),n=e.classBreakInfos;if(!(n!=null&&n.length))return{success:!1,error:"Unsupported renderer; missing or invalid ClassBreaksRenderer.classBreakInfos."};const p=n.sort((u,y)=>u.classMaxValue-y.classMaxValue),o=p[p.length-1];let i=e.minValue;if(!r){const u=[];for(let y=0;yT>f);C&&l.push([d].concat(C.symbol.color))}}else{i=Math.floor(e.minValue);for(let u=0;u0&&e[0].min!=null&&e[0].max!=null}_updateStretchRenderer(e){var s,m;let{stretchType:t,dra:r}=e;if(!(t==="none"||((s=e.statistics)==null?void 0:s.length)||this._isValidRasterStatistics(this.rasterInfo.statistics)||r))return{success:!1,error:"Unsupported renderer; StretchRenderer.statistics is required when dynamic range adjustment is not used."};const c=we(e.histograms||this.rasterInfo.histograms);!this._isHistogramRequired(e.stretchType)||(c==null?void 0:c.length)||r||(t="minMax");const{computeGamma:a,useGamma:n,colorRamp:p}=e;let{gamma:o}=e;if(n&&a&&!(o!=null&&o.length)){const u=(m=e.statistics)!=null&&m.length?e.statistics:we(this.rasterInfo.statistics);o=eo(this.rasterInfo.pixelType,u)}const i=this.rasterInfo.pixelType,l=!r&&["u8","u16","s8","s16"].includes(i);if(t==="histogramEqualization"){const u=c.map(y=>jt(y));this.lookup={rendererJSON:e,histogramLut:u}}else if(l){const u=Re(e,{rasterInfo:this.rasterInfo}),y=Dt({pixelType:i,...u,gamma:n?o:null});this.lookup={rendererJSON:e,stretchLut:y}}if(p){const u=kt(p,256,!0);this.lookup||(this.lookup={rendererJSON:e}),this.lookup.colormapLut=Pe({colormap:u}),this.lookup.rendererJSON=e}return this.lookup.gamma=n&&(o==null?void 0:o.length)?o:null,this.canRenderInWebGL=!0,{success:!0}}_generateStretchWebGLParams(e,t,r){let c=null,a=null;const n=this.lookup&&this.lookup.colormapLut;t.colorRamp&&n&&(c=n.indexedColormap,a=n.offset),t.stretchType==="histogramEqualization"&&(t={...t,stretchType:"minMax"});const{gamma:p}=this.lookup,o=!!(t.useGamma&&p&&p.some(f=>f!==1)),{minCutOff:i,maxCutOff:l,outMin:s,outMax:m}=Re(t,{rasterInfo:this.rasterInfo,pixelBlock:e,bandIds:r});let u=0;H(e)&&(u=e.getPlaneCount(),u===2&&((e=e.clone()).statistics=[e.statistics[0]],e.pixels=[e.pixels[0]]));const y=Math.min(3,(r==null?void 0:r.length)||u||this.rasterInfo.bandCount),b=new Float32Array(y),h=c||o?1:255;let g;for(g=0;g1?p[g]>2?d[g]=6.5+(p[g]-2)**2.5:d[g]=6.5+100*(2-p[g])**4:d[g]=1;return{bandCount:y,outMin:s/h,outMax:m/h,minCutOff:i,maxCutOff:l,factor:b,useGamma:o,gamma:o?p:[1,1,1],gammaCorrection:o?d:[1,1,1],colormap:c,colormapOffset:a,stretchType:t.stretchType,type:"stretch"}}_generateShadedReliefWebGLParams(e,t=!1,r={x:0,y:0}){var l,s,m;let c=null,a=null;const n=this.lookup&&this.lookup.colormapLut;e.colorRamp&&n&&(c=n.indexedColormap,a=n.offset);const p={...e,isGCS:t,resolution:r},o=Vt(p),i=(l=we(this.rasterInfo.statistics))==null?void 0:l[0];return{...o,minValue:(s=i==null?void 0:i.min)!=null?s:0,maxValue:(m=i==null?void 0:i.max)!=null?m:8e3,hillshadeType:e.hillshadeType==="traditional"?0:1,type:"hillshade",colormap:c,colormapOffset:a}}_generateVectorFieldWebGLParams(e){var d,f,C,T,w,S,v,A;const{style:t,inputUnit:r,outputUnit:c,visualVariables:a,symbolTileSize:n,flowRepresentation:p}=e;let o;const i=(f=(d=this.rasterInfo.statistics)==null?void 0:d[0].min)!=null?f:0,l=(T=(C=this.rasterInfo.statistics)==null?void 0:C[0].max)!=null?T:50,s=(w=a==null?void 0:a.find(k=>k.type==="sizeInfo"))!=null?w:{type:"sizeInfo",field:"Magnitude",maxDataValue:l,maxSize:.8*n,minDataValue:i,minSize:.2*n},m=(S=s.minDataValue)!=null?S:i,u=(v=s.maxDataValue)!=null?v:l,y=H(s.maxSize)&&H(s.minSize)?[s.minSize/n,s.maxSize/n]:[.2,.8];if(t==="wind_speed"){const k=(y[0]+y[1])/2;y[0]=y[1]=k}const b=H(m)&&H(u)?[m,u]:null;if(t==="classified_arrow")if(H(m)&&H(u)&&H(s)){o=[];const k=(s.maxDataValue-s.minDataValue)/5;for(let D=0;D<6;D++)o.push(s.minDataValue+k*D)}else o=[0,1e-6,3.5,7,10.5,14];const h=p==="flow_to"==(t==="ocean_current_kn"||t==="ocean_current_m")?0:Math.PI,g=a==null?void 0:a.find(k=>k.type==="rotationInfo");return{breakValues:o,dataRange:b,inputUnit:r,outputUnit:c,symbolTileSize:n,symbolPercentRange:y,style:t||"single_arrow",rotation:h,rotationType:((A=this.rasterInfo.storageInfo)==null?void 0:A.tileInfo)&&this.rasterInfo.dataType==="vector-uv"?"geographic":(g==null?void 0:g.rotationType)||e.rotationType,type:"vectorField"}}};function Pt(e){return Ae(e)&&e.validPixelCount!==0}$([z({json:{write:!0}})],Ce.prototype,"rendererJSON",void 0),$([z({type:no,json:{write:!0}})],Ce.prototype,"rasterInfo",void 0),$([z({json:{write:!0}})],Ce.prototype,"lookup",void 0),$([z()],Ce.prototype,"canRenderInWebGL",void 0),Ce=$([Qe("esri.renderers.support.RasterSymbolizer")],Ce);const To=Ce;export{nt as D,Sr as G,vr as N,at as O,ho as P,po as S,To as T,yo as _,mo as a,io as b,qr as c,Ye as d,no as e,Wr as f,Xr as g,kt as h,$r as i,bo as j,Co as k,it as l,Ie as m,wo as n,go as o,ro as p,wr as q,sr as r,Dt as u,Re as x}; diff --git a/assets/RasterVFDisplayObject.3d75d94d.js b/assets/RasterVFDisplayObject.da692284.js similarity index 98% rename from assets/RasterVFDisplayObject.3d75d94d.js rename to assets/RasterVFDisplayObject.da692284.js index 2cb924f..1b1f393 100644 --- a/assets/RasterVFDisplayObject.3d75d94d.js +++ b/assets/RasterVFDisplayObject.da692284.js @@ -1 +1 @@ -import{I as S,c as g,v as L,s as K,j as V,dC as U,P as nt,Q as B,S as F,R as X,N as tt,a6 as m,a7 as f,a8 as et,a9 as lt,x as ht,af as ct,cU as dt,dA as ut,_ as M,d1 as mt,b1 as pt,b3 as O,ck as ft,b2 as _t}from"./index.d94abe07.js";import{E as v,a as C}from"./VertexArrayObject.a4c1d809.js";import{C as d,R,E as N,F as w,P as H,L as yt,G as gt,D as xt}from"./enums.2d9e6f64.js";import{E as vt}from"./Texture.4c97bad5.js";import{t as _}from"./VertexElementDescriptor.1fdca6da.js";import{a as Z,F as J,D as Q}from"./dataUtils.0f9b810f.js";import{o as wt,i as Dt}from"./WGLContainer.1850619d.js";import{I as At,g as St}from"./Utils.7f6f3a6b.js";import{r as at}from"./utils.4b023c9d.js";function bt(a){const t=st(P(a)),e=t,s=!0,i=Math.max(t/2,5),r=Math.round(S(a.maxPathLength)/i)+1,o=10,{density:n}=a;return{smoothing:S(a.smoothing),interpolate:!0,velocityScale:a.flowRepresentation==="flow-from"?1:-1,verticesPerLine:r,minSpeedThreshold:.001,segmentLength:i,maxTurnAngle:1,collisions:s,lineCollisionWidth:e,lineSpacing:o,density:n}}function st(a){return a.kind==="constant"?a.value[0]:a.values[a.values.length-1]}function Y(a){const t=a.toRgba();return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function zt(a){return{kind:"constant",value:[.1,.1,.1,1]}}function P(a){if(!a.hasVisualVariables("size"))return{kind:"constant",value:[S(a.trailWidth)]};const t=a.getVisualVariablesForType("size")[0],e=[],s=[];let i;if(t.stops){for(const r of t.stops)e.push(r.value),s.push(S(r.size));i=t.stops.length}else e.push(t.minDataValue,t.maxDataValue),s.push(S(t.minSize),S(t.maxSize)),i=2;return{kind:"ramp",stops:e,values:s,count:i}}function Rt(a){if(!a.hasVisualVariables("color"))return{kind:"constant",value:Y(a.color)};const t=a.getVisualVariablesForType("color")[0],e=[],s=[];for(const i of t.stops)e.push(i.value),Array.prototype.push.apply(s,Y(i.color));return{kind:"ramp",stops:e,values:s,count:t.stops.length}}function $t(a){if(!a.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};const t=a.getVisualVariablesForType("opacity")[0],e=[],s=[];for(const i of t.stops)e.push(i.value),s.push(i.opacity);return{kind:"ramp",stops:e,values:s,count:t.stops.length}}function k(a,t,e,s){switch(t){case"int":a.setUniform1iv(e,s);break;case"float":a.setUniform1fv(e,s);break;case"vec2":a.setUniform2fv(e,s);break;case"vec3":a.setUniform3fv(e,s);break;case"vec4":a.setUniform4fv(e,s)}}function x(a,t,e,s){s.kind==="constant"?k(a,e,`u_${t}`,s.value):(k(a,"float",`u_${t}_stops`,s.stops),k(a,e,`u_${t}_values`,s.values),a.setUniform1i(`u_${t}_count`,s.count))}function Tt(a,t){let e=!0;return e=e&&a.collisions===t.collisions,e=e&&a.density===t.density,e=e&&a.interpolate===t.interpolate,e=e&&a.lineCollisionWidth===t.lineCollisionWidth,e=e&&a.lineSpacing===t.lineSpacing,e=e&&a.maxTurnAngle===t.maxTurnAngle,e=e&&a.minSpeedThreshold===t.minSpeedThreshold,e=e&&a.segmentLength===t.segmentLength,e=e&&a.smoothing===t.smoothing,e=e&&a.velocityScale===t.velocityScale,e=e&&a.verticesPerLine===t.verticesPerLine,e}function it(a,t){return a===t||!(!g(a)||!g(t))&&a.equals(t)}function rt(a,t){if(!Tt(a.simulationSettings,t.simulationSettings)||!it(a.timeExtent,t.timeExtent))return!1;let e=!0;return e=e&&a.loadImagery===t.loadImagery,e=e&&a.createFlowMesh===t.createFlowMesh,e=e&&a.color.kind===t.color.kind,e=e&&a.opacity.kind===t.opacity.kind,e=e&&a.size.kind===t.size.kind,e}class G{constructor(t){this._params=t,this.animated=!1}isCompatible(t){if(!(t instanceof G)||!it(this._params.timeExtent,t._params.timeExtent))return!1;let e=!0;return e=e&&this._params.loadImagery===t._params.loadImagery,e=e&&this._params.color.kind===t._params.color.kind,e=e&&this._params.opacity.kind===t._params.opacity.kind,e}async load(t,e){const{extent:s,size:i}=t;L(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e);return new Ot(r,{color:this._params.color,opacity:this._params.opacity})}render(t,e,s){const{context:i}=t,{program:r}=s;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(R.ONE,R.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),i.bindTexture(s.texture,0),r.setUniform1i("u_texture",0),r.setUniform1f("u_Min",s.min),r.setUniform1f("u_Max",s.max),x(r,"color","vec4",this._params.color),x(r,"opacity","float",this._params.opacity),i.bindVAO(s.vertexArray),i.drawArrays(N.TRIANGLE_STRIP,0,4)}}const E=new Map;E.set("a_position",0),E.set("a_texcoord",1);const It={geometry:[new _("a_position",2,d.UNSIGNED_SHORT,0,8),new _("a_texcoord",2,d.UNSIGNED_SHORT,4,8)]},Mt={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:E};class Ot{constructor(t,e){this._flowData=t,this._values=e}attach(t){const{context:e}=t,{width:s,height:i}=this._flowData,r=v.createVertex(e,w.STATIC_DRAW,new Uint16Array([0,0,0,1,s,0,1,1,0,i,0,0,s,i,1,0])),o=new C(e,E,It,{geometry:r}),n=[];this._values.color.kind==="ramp"&&n.push("vvColor"),this._values.opacity.kind==="ramp"&&n.push("vvOpacity");const l=t.painter.materialManager.getProgram(Mt,n);let u=1e6,D=-1e6;for(let h=0;h0}isCompatible(t){return t instanceof q&&rt(this._params,t._params)}async load(t,e){const{extent:s,size:i}=t;L(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Particles",this._params.simulationSettings,r,e);return new Et(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,s){const{context:i}=t,{program:r}=s;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(R.ONE,R.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniform1f("u_time",e.time),r.setUniform1f("u_trailLength",this._params.trailLength),r.setUniform1f("u_flowSpeed",this._params.flowSpeed),r.setUniform1f("u_featheringSize",this._params.featheringSize),r.setUniform1f("u_featheringOffset",this._params.featheringOffset),r.setUniform1f("u_introFade",this._params.introFade?1:0),r.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),r.setUniform1f("u_decayRate",this._params.decayRate),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),r.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),x(r,"color","vec4",this._params.color),x(r,"opacity","float",this._params.opacity),x(r,"size","float",this._params.size),i.bindVAO(s.vertexArray),i.drawElements(N.TRIANGLES,s.indexCount,d.UNSIGNED_INT,0)}}const b=new Map;b.set("a_xyts0",0),b.set("a_xyts1",1),b.set("a_typeIdDurationSeed",2),b.set("a_extrudeInfo",3);const Ft={geometry:[new _("a_xyts0",4,d.FLOAT,0,64),new _("a_xyts1",4,d.FLOAT,16,64),new _("a_typeIdDurationSeed",4,d.FLOAT,32,64),new _("a_extrudeInfo",4,d.FLOAT,48,64)]},Vt={vsPath:"raster/flow/particles",fsPath:"raster/flow/particles",attributes:b};class Et{constructor(t,e,s){this._vertexData=t,this._indexData=e,this._values=s}attach(t){const{context:e}=t,s=v.createVertex(e,w.STATIC_DRAW,this._vertexData),i=v.createIndex(e,w.STATIC_DRAW,this._indexData),r=new C(e,b,Ft,{geometry:s},i),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const n=t.painter.materialManager.getProgram(Vt,o);this.vertexArray=r,this.program=n,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.isCompiled}}class W{constructor(t){this._styles=t}get animated(){return this._styles.reduce((t,e)=>t||e.animated,!1)}isCompatible(t){if(!(t instanceof W)||this._styles.length!==t._styles.length)return!1;const e=this._styles.length;for(let s=0;si.load(t,e)));return new Ct(s)}render(t,e,s){for(let i=0;it&&e.ready,!0)}}class j{constructor(t){this._params=t}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof j&&rt(this._params,t._params)}async load(t,e){const{extent:s,size:i}=t;L(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,r,e);return new Pt(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,s){const{context:i}=t,{program:r}=s;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(R.ONE,R.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniform1f("u_time",e.time),r.setUniform1f("u_trailLength",this._params.trailLength),r.setUniform1f("u_flowSpeed",this._params.flowSpeed),r.setUniform1f("u_featheringSize",this._params.featheringSize),r.setUniform1f("u_featheringOffset",this._params.featheringOffset),r.setUniform1f("u_introFade",this._params.introFade?1:0),r.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),r.setUniform1f("u_decayRate",this._params.decayRate),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),r.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),x(r,"color","vec4",this._params.color),x(r,"opacity","float",this._params.opacity),x(r,"size","float",this._params.size),i.bindVAO(s.vertexArray),i.drawElements(N.TRIANGLES,s.indexCount,d.UNSIGNED_INT,0)}}const z=new Map;z.set("a_positionAndSide",0),z.set("a_timeInfo",1),z.set("a_extrude",2),z.set("a_speed",3);const kt={geometry:[new _("a_positionAndSide",3,d.FLOAT,0,36),new _("a_timeInfo",3,d.FLOAT,12,36),new _("a_extrude",2,d.FLOAT,24,36),new _("a_speed",1,d.FLOAT,32,36)]},Ut={vsPath:"raster/flow/streamlines",fsPath:"raster/flow/streamlines",attributes:z};class Pt{constructor(t,e,s){this._vertexData=t,this._indexData=e,this._values=s}attach(t){const{context:e}=t,s=v.createVertex(e,w.STATIC_DRAW,this._vertexData),i=v.createIndex(e,w.STATIC_DRAW,this._indexData),r=new C(e,z,kt,{geometry:s},i),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const n=t.painter.materialManager.getProgram(Ut,o);this.vertexArray=r,this.program=n,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.isCompiled}}const Lt=4,Nt=1,Gt=.5,qt=!0,Wt=!0,jt=2.3;function Bt(a,t){const{flowSpeed:e,trailLength:s}=a,i=bt(a);let r=null;const o={opacity:$t(a),size:P(a)};let n=Rt(a);if(a.background==="none")o.color=n;else{n.kind==="constant"&&(n={kind:"ramp",stops:[0,1],values:[0,0,0,1,n.value[0],n.value[1],n.value[2],n.value[3]],count:2});const D={loadImagery:t.loadImagery,timeExtent:t.timeExtent,color:n,opacity:{kind:"constant",value:[1]}};r=new G(D),o.color=zt()}const l={loadImagery:t.loadImagery,createFlowMesh:t.createFlowMesh,simulationSettings:i,timeExtent:t.timeExtent,trailLength:s,flowSpeed:e,featheringSize:Nt,featheringOffset:Gt,introFade:qt,fadeToZero:Wt,decayRate:jt,color:o.color,opacity:o.opacity,size:o.size},u=a.trailCap==="butt"||st(P(a))<=Lt?new j(l):new q(l);return g(r)?new W([r,u]):u}class Ht extends wt{constructor(){super(...arguments),this.flowStyle=null}get requiresDedicatedFBO(){return!1}doRender(t){super.doRender(t)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"flow",brushes:[Dt],target:()=>this.children,drawPhase:At.MAP});return[...super.prepareRenderPasses(t),e]}}class Zt{constructor(t,e,s,i){this.state={name:"created"},this.flowStyle=t,this.extent=e,this.size=s,this.pixelRatio=i}async load(){const t=new AbortController;this.state={name:"loading",abortController:t};const e={extent:this.extent,size:this.size,pixelRatio:this.pixelRatio},s=await this.flowStyle.load(e,t.signal);this.state={name:"loaded",resources:s}}attach(t){if(this.state.name!=="loaded")return void K.getLogger("esri.views.2d.engine.flow.FlowDisplayData").error("Only loaded resources can be attached.");const e=this.state.resources;e.attach(t),this.state={name:"attached",resources:e}}detach(){if(this.state.name==="loading")return this.state.abortController.abort(),void(this.state={name:"detached"});this.state.name==="attached"&&(this.state.resources.detach(),this.state={name:"detached"})}update(t){return this.flowStyle.isCompatible(t.flowStyle)?!(!this.extent.equals(t.extent)||this.size[0]!==t.size[0]||this.size[1]!==t.size[1]||this.pixelRatio!==t.pixelRatio)&&(this.flowStyle=t.flowStyle,!0):!1}}class Jt extends at{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(t){this._displayData=t,this.requestRender()}clear(){g(this._displayData)&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(t){const{displayData:e}=this;if(V(e))return;const s=e.extent.xmin,i=e.extent.ymax,r=[0,0];t.toScreen(r,[s,i]);const o=(e.extent.xmax-e.extent.xmin)/e.size[0]/t.resolution,n=U(t.rotation),{dvs:l}=this.transforms;nt(l,[-1,1,0]),B(l,l,[2/(t.size[0]*t.pixelRatio),-2/(t.size[1]*t.pixelRatio),1]),F(l,l,[r[0],r[1],0]),X(l,l,n),B(l,l,[o*t.pixelRatio,o*t.pixelRatio,1])}_createTransforms(){return{dvs:tt()}}}const Qt=1.15;let A=class extends lt{constructor(a){super(a),this._flowDisplayObject=new Jt,this._loading=null}initialize(){this.flowContainer.addChild(this._flowDisplayObject)}destroy(){this._clear(),this.flowContainer.removeAllChildren()}get updating(){return this._loading!=null}update(a){const{flowStyle:t}=this.flowContainer;if(V(t))return void this._clear();const{extent:e,rotation:s,resolution:i,pixelRatio:r}=a.state,o=Kt(e,s);o.expand(Qt);const n=[Math.round((o.xmax-o.xmin)/i),Math.round((o.ymax-o.ymin)/i)],l=new Zt(t,o,n,r);if(g(this._loading)){if(this._loading.update(l))return;this._loading.detach(),this._loading=null}!V(this._flowDisplayObject.displayData)&&this._flowDisplayObject.displayData.update(l)||(l.load().then(()=>{this._flowDisplayObject.clear(),this._flowDisplayObject.displayData=this._loading,this._loading=null},u=>{ht(u)||(K.getLogger(this.declaredClass).error("A resource failed to load.",u),this._loading=null)}),this._loading=l)}_clear(){this._flowDisplayObject.clear(),g(this._loading)&&(this._loading.detach(),this._loading=null)}};m([f()],A.prototype,"_loading",void 0),m([f()],A.prototype,"flowContainer",void 0),m([f()],A.prototype,"updating",null),A=m([et("esri.views.2d.engine.flow.FlowStrategy")],A);const Yt=A;function Kt(a,t){const e=new ct({x:(a.xmax+a.xmin)/2,y:(a.ymax+a.ymin)/2,spatialReference:a.spatialReference}),s=a.xmax-a.xmin,i=a.ymax-a.ymin,r=Math.abs(Math.cos(U(t))),o=Math.abs(Math.sin(U(t))),n=r*s+o*i,l=o*s+r*i,u=new dt({xmin:e.x-n/2,ymin:e.y-l/2,xmax:e.x+n/2,ymax:e.y+l/2,spatialReference:a.spatialReference});return u.centerAt(e),u}let p=class extends ut{constructor(){super(...arguments),this._loadImagery=(a,t,e,s,i)=>Z(this.layer,a,t,e,s,i),this._createFlowMesh=(a,t,e,s)=>this.layer.createFlowMesh({meshType:a,flowData:e,simulationSettings:t},{signal:s}),this.attached=!1,this.container=null,this.layer=null,this.type="flow",this.timeExtent=null,this.redrawOrRefetch=async()=>{this._updateVisualization()}}get updating(){return!this._strategy||this._strategy.updating}attach(){const{layer:a}=this,t=()=>{this._loadImagery=(e,s,i,r,o)=>Z(a,e,s,i,r,o),this._updateVisualization()};"multidimensionalDefinition"in a?this.handles.add(M(()=>a.multidimensionalDefinition,t)):this.handles.add([M(()=>a.mosaicRule,t),M(()=>a.renderingRule,t),M(()=>a.definitionExpression,t)]),this.container=new Ht,this._strategy=new Yt({flowContainer:this.container}),this._updateVisualization()}detach(){this._strategy.destroy(),this.container.removeAllChildren(),this.container=null,this.handles.removeAll()}update(a){a.stationary?this._strategy.update(a):this.layerView.requestUpdate()}hitTest(a){return new mt({attributes:{},geometry:a.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){const{renderer:a}=this.layer;if(a.type!=="flow")return;const t=Bt(a,{loadImagery:this._loadImagery,createFlowMesh:this._createFlowMesh,timeExtent:this.timeExtent});this.container.flowStyle=t,this.layerView.requestUpdate()}};m([f()],p.prototype,"_strategy",void 0),m([f()],p.prototype,"attached",void 0),m([f()],p.prototype,"container",void 0),m([f()],p.prototype,"layer",void 0),m([f()],p.prototype,"layerView",void 0),m([f()],p.prototype,"type",void 0),m([f()],p.prototype,"updating",null),m([f()],p.prototype,"timeExtent",void 0),p=m([et("esri.views.2d.engine.flow.FlowView2D")],p);const le=p;class he extends at{constructor(t=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.width=null,this.source=t}destroy(){var t,e;g(this.vaoData)&&((t=this.vaoData.magdir)==null||t.vao.dispose(),(e=this.vaoData.scalar)==null||e.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(t){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(t)&&(this._symbolizerParameters=t,this.invalidateVAO())}get source(){return this._source}set source(t){this._source=t,this.invalidateVAO()}invalidateVAO(){var t,e;!this._vaoInvalidated&&g(this.vaoData)&&((t=this.vaoData.magdir)==null||t.vao.dispose(),(e=this.vaoData.scalar)==null||e.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(t){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,g(this.source)&&V(this.vaoData)){const{style:e}=this.symbolizerParameters;switch(e){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const s=J(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={magdir:i}}break;case"simple_scalar":{const s=Q(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={scalar:i}}break;case"wind_speed":{const s=J(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s),r=Q(this.source,this.symbolizerParameters),o=this._createVectorFieldVAO(t.context,r);this.vaoData={magdir:i,scalar:o}}}}this.ready(),this.requestRender()}}_createTransforms(){return{dvs:tt()}}setTransform(t){const e=pt(this.transforms.dvs),[s,i]=t.toScreenNoRotation([0,0],[this.x,this.y]),r=this.resolution/this.pixelRatio/t.resolution,o=r*this.width,n=r*this.height,l=Math.PI*this.rotation/180;F(e,e,O(s,i)),F(e,e,O(o/2,n/2)),X(e,e,-l),F(e,e,O(-o/2,-n/2)),ft(e,e,O(o,n)),_t(this.transforms.dvs,t.displayViewMat3,e)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(t,e){const{vertexData:s,indexData:i}=e,r=v.createVertex(t,w.STATIC_DRAW,new Float32Array(s)),o=v.createIndex(t,w.STATIC_DRAW,new Uint32Array(i)),n=St("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:d.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:d.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:d.FLOAT,normalized:!1}]});return{vao:new C(t,n.attributes,n.bufferLayouts,{geometry:r},o),elementCount:i.length}}}export{le as d,he as y}; +import{I as S,c as g,v as L,s as K,j as V,dC as U,P as nt,Q as B,S as F,R as X,N as tt,a6 as m,a7 as f,a8 as et,a9 as lt,x as ht,af as ct,cU as dt,dA as ut,_ as M,d1 as mt,b1 as pt,b3 as O,ck as ft,b2 as _t}from"./index.221827cd.js";import{E as v,a as C}from"./VertexArrayObject.53cf1857.js";import{C as d,R,E as N,F as w,P as H,L as yt,G as gt,D as xt}from"./enums.2d9e6f64.js";import{E as vt}from"./Texture.940076b2.js";import{t as _}from"./VertexElementDescriptor.1fdca6da.js";import{a as Z,F as J,D as Q}from"./dataUtils.e7623e56.js";import{o as wt,i as Dt}from"./WGLContainer.347cc5cd.js";import{I as At,g as St}from"./Utils.2136650a.js";import{r as at}from"./utils.0160becb.js";function bt(a){const t=st(P(a)),e=t,s=!0,i=Math.max(t/2,5),r=Math.round(S(a.maxPathLength)/i)+1,o=10,{density:n}=a;return{smoothing:S(a.smoothing),interpolate:!0,velocityScale:a.flowRepresentation==="flow-from"?1:-1,verticesPerLine:r,minSpeedThreshold:.001,segmentLength:i,maxTurnAngle:1,collisions:s,lineCollisionWidth:e,lineSpacing:o,density:n}}function st(a){return a.kind==="constant"?a.value[0]:a.values[a.values.length-1]}function Y(a){const t=a.toRgba();return[t[0]/255,t[1]/255,t[2]/255,t[3]]}function zt(a){return{kind:"constant",value:[.1,.1,.1,1]}}function P(a){if(!a.hasVisualVariables("size"))return{kind:"constant",value:[S(a.trailWidth)]};const t=a.getVisualVariablesForType("size")[0],e=[],s=[];let i;if(t.stops){for(const r of t.stops)e.push(r.value),s.push(S(r.size));i=t.stops.length}else e.push(t.minDataValue,t.maxDataValue),s.push(S(t.minSize),S(t.maxSize)),i=2;return{kind:"ramp",stops:e,values:s,count:i}}function Rt(a){if(!a.hasVisualVariables("color"))return{kind:"constant",value:Y(a.color)};const t=a.getVisualVariablesForType("color")[0],e=[],s=[];for(const i of t.stops)e.push(i.value),Array.prototype.push.apply(s,Y(i.color));return{kind:"ramp",stops:e,values:s,count:t.stops.length}}function $t(a){if(!a.hasVisualVariables("opacity"))return{kind:"constant",value:[1]};const t=a.getVisualVariablesForType("opacity")[0],e=[],s=[];for(const i of t.stops)e.push(i.value),s.push(i.opacity);return{kind:"ramp",stops:e,values:s,count:t.stops.length}}function k(a,t,e,s){switch(t){case"int":a.setUniform1iv(e,s);break;case"float":a.setUniform1fv(e,s);break;case"vec2":a.setUniform2fv(e,s);break;case"vec3":a.setUniform3fv(e,s);break;case"vec4":a.setUniform4fv(e,s)}}function x(a,t,e,s){s.kind==="constant"?k(a,e,`u_${t}`,s.value):(k(a,"float",`u_${t}_stops`,s.stops),k(a,e,`u_${t}_values`,s.values),a.setUniform1i(`u_${t}_count`,s.count))}function Tt(a,t){let e=!0;return e=e&&a.collisions===t.collisions,e=e&&a.density===t.density,e=e&&a.interpolate===t.interpolate,e=e&&a.lineCollisionWidth===t.lineCollisionWidth,e=e&&a.lineSpacing===t.lineSpacing,e=e&&a.maxTurnAngle===t.maxTurnAngle,e=e&&a.minSpeedThreshold===t.minSpeedThreshold,e=e&&a.segmentLength===t.segmentLength,e=e&&a.smoothing===t.smoothing,e=e&&a.velocityScale===t.velocityScale,e=e&&a.verticesPerLine===t.verticesPerLine,e}function it(a,t){return a===t||!(!g(a)||!g(t))&&a.equals(t)}function rt(a,t){if(!Tt(a.simulationSettings,t.simulationSettings)||!it(a.timeExtent,t.timeExtent))return!1;let e=!0;return e=e&&a.loadImagery===t.loadImagery,e=e&&a.createFlowMesh===t.createFlowMesh,e=e&&a.color.kind===t.color.kind,e=e&&a.opacity.kind===t.opacity.kind,e=e&&a.size.kind===t.size.kind,e}class G{constructor(t){this._params=t,this.animated=!1}isCompatible(t){if(!(t instanceof G)||!it(this._params.timeExtent,t._params.timeExtent))return!1;let e=!0;return e=e&&this._params.loadImagery===t._params.loadImagery,e=e&&this._params.color.kind===t._params.color.kind,e=e&&this._params.opacity.kind===t._params.opacity.kind,e}async load(t,e){const{extent:s,size:i}=t;L(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e);return new Ot(r,{color:this._params.color,opacity:this._params.opacity})}render(t,e,s){const{context:i}=t,{program:r}=s;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(R.ONE,R.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),i.bindTexture(s.texture,0),r.setUniform1i("u_texture",0),r.setUniform1f("u_Min",s.min),r.setUniform1f("u_Max",s.max),x(r,"color","vec4",this._params.color),x(r,"opacity","float",this._params.opacity),i.bindVAO(s.vertexArray),i.drawArrays(N.TRIANGLE_STRIP,0,4)}}const E=new Map;E.set("a_position",0),E.set("a_texcoord",1);const It={geometry:[new _("a_position",2,d.UNSIGNED_SHORT,0,8),new _("a_texcoord",2,d.UNSIGNED_SHORT,4,8)]},Mt={vsPath:"raster/flow/imagery",fsPath:"raster/flow/imagery",attributes:E};class Ot{constructor(t,e){this._flowData=t,this._values=e}attach(t){const{context:e}=t,{width:s,height:i}=this._flowData,r=v.createVertex(e,w.STATIC_DRAW,new Uint16Array([0,0,0,1,s,0,1,1,0,i,0,0,s,i,1,0])),o=new C(e,E,It,{geometry:r}),n=[];this._values.color.kind==="ramp"&&n.push("vvColor"),this._values.opacity.kind==="ramp"&&n.push("vvOpacity");const l=t.painter.materialManager.getProgram(Mt,n);let u=1e6,D=-1e6;for(let h=0;h0}isCompatible(t){return t instanceof q&&rt(this._params,t._params)}async load(t,e){const{extent:s,size:i}=t;L(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Particles",this._params.simulationSettings,r,e);return new Et(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,s){const{context:i}=t,{program:r}=s;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(R.ONE,R.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniform1f("u_time",e.time),r.setUniform1f("u_trailLength",this._params.trailLength),r.setUniform1f("u_flowSpeed",this._params.flowSpeed),r.setUniform1f("u_featheringSize",this._params.featheringSize),r.setUniform1f("u_featheringOffset",this._params.featheringOffset),r.setUniform1f("u_introFade",this._params.introFade?1:0),r.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),r.setUniform1f("u_decayRate",this._params.decayRate),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),r.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),x(r,"color","vec4",this._params.color),x(r,"opacity","float",this._params.opacity),x(r,"size","float",this._params.size),i.bindVAO(s.vertexArray),i.drawElements(N.TRIANGLES,s.indexCount,d.UNSIGNED_INT,0)}}const b=new Map;b.set("a_xyts0",0),b.set("a_xyts1",1),b.set("a_typeIdDurationSeed",2),b.set("a_extrudeInfo",3);const Ft={geometry:[new _("a_xyts0",4,d.FLOAT,0,64),new _("a_xyts1",4,d.FLOAT,16,64),new _("a_typeIdDurationSeed",4,d.FLOAT,32,64),new _("a_extrudeInfo",4,d.FLOAT,48,64)]},Vt={vsPath:"raster/flow/particles",fsPath:"raster/flow/particles",attributes:b};class Et{constructor(t,e,s){this._vertexData=t,this._indexData=e,this._values=s}attach(t){const{context:e}=t,s=v.createVertex(e,w.STATIC_DRAW,this._vertexData),i=v.createIndex(e,w.STATIC_DRAW,this._indexData),r=new C(e,b,Ft,{geometry:s},i),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const n=t.painter.materialManager.getProgram(Vt,o);this.vertexArray=r,this.program=n,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.isCompiled}}class W{constructor(t){this._styles=t}get animated(){return this._styles.reduce((t,e)=>t||e.animated,!1)}isCompatible(t){if(!(t instanceof W)||this._styles.length!==t._styles.length)return!1;const e=this._styles.length;for(let s=0;si.load(t,e)));return new Ct(s)}render(t,e,s){for(let i=0;it&&e.ready,!0)}}class j{constructor(t){this._params=t}get animated(){return this._params.flowSpeed>0}isCompatible(t){return t instanceof j&&rt(this._params,t._params)}async load(t,e){const{extent:s,size:i}=t;L(e);const r=await this._params.loadImagery(s,i[0],i[1],this._params.timeExtent,e),{vertexData:o,indexData:n}=await this._params.createFlowMesh("Streamlines",this._params.simulationSettings,r,e);return new Pt(o,n,{color:this._params.color,opacity:this._params.opacity,size:this._params.size})}render(t,e,s){const{context:i}=t,{program:r}=s;i.setFaceCullingEnabled(!1),i.setBlendingEnabled(!0),i.setBlendFunction(R.ONE,R.ONE_MINUS_SRC_ALPHA),i.useProgram(r),r.setUniform1f("u_time",e.time),r.setUniform1f("u_trailLength",this._params.trailLength),r.setUniform1f("u_flowSpeed",this._params.flowSpeed),r.setUniform1f("u_featheringSize",this._params.featheringSize),r.setUniform1f("u_featheringOffset",this._params.featheringOffset),r.setUniform1f("u_introFade",this._params.introFade?1:0),r.setUniform1f("u_fadeToZero",this._params.fadeToZero?1:0),r.setUniform1f("u_decayRate",this._params.decayRate),r.setUniformMatrix3fv("u_dvsMat3",e.dvsMat3),r.setUniformMatrix3fv("u_displayViewMat3",e.displayViewMat3),x(r,"color","vec4",this._params.color),x(r,"opacity","float",this._params.opacity),x(r,"size","float",this._params.size),i.bindVAO(s.vertexArray),i.drawElements(N.TRIANGLES,s.indexCount,d.UNSIGNED_INT,0)}}const z=new Map;z.set("a_positionAndSide",0),z.set("a_timeInfo",1),z.set("a_extrude",2),z.set("a_speed",3);const kt={geometry:[new _("a_positionAndSide",3,d.FLOAT,0,36),new _("a_timeInfo",3,d.FLOAT,12,36),new _("a_extrude",2,d.FLOAT,24,36),new _("a_speed",1,d.FLOAT,32,36)]},Ut={vsPath:"raster/flow/streamlines",fsPath:"raster/flow/streamlines",attributes:z};class Pt{constructor(t,e,s){this._vertexData=t,this._indexData=e,this._values=s}attach(t){const{context:e}=t,s=v.createVertex(e,w.STATIC_DRAW,this._vertexData),i=v.createIndex(e,w.STATIC_DRAW,this._indexData),r=new C(e,z,kt,{geometry:s},i),o=[];this._values.color.kind==="ramp"&&o.push("vvColor"),this._values.opacity.kind==="ramp"&&o.push("vvOpacity"),this._values.size.kind==="ramp"&&o.push("vvSize");const n=t.painter.materialManager.getProgram(Ut,o);this.vertexArray=r,this.program=n,this.indexCount=this._indexData.length,this._vertexData=null,this._indexData=null}detach(){this.vertexArray.dispose()}get ready(){return this.program.isCompiled}}const Lt=4,Nt=1,Gt=.5,qt=!0,Wt=!0,jt=2.3;function Bt(a,t){const{flowSpeed:e,trailLength:s}=a,i=bt(a);let r=null;const o={opacity:$t(a),size:P(a)};let n=Rt(a);if(a.background==="none")o.color=n;else{n.kind==="constant"&&(n={kind:"ramp",stops:[0,1],values:[0,0,0,1,n.value[0],n.value[1],n.value[2],n.value[3]],count:2});const D={loadImagery:t.loadImagery,timeExtent:t.timeExtent,color:n,opacity:{kind:"constant",value:[1]}};r=new G(D),o.color=zt()}const l={loadImagery:t.loadImagery,createFlowMesh:t.createFlowMesh,simulationSettings:i,timeExtent:t.timeExtent,trailLength:s,flowSpeed:e,featheringSize:Nt,featheringOffset:Gt,introFade:qt,fadeToZero:Wt,decayRate:jt,color:o.color,opacity:o.opacity,size:o.size},u=a.trailCap==="butt"||st(P(a))<=Lt?new j(l):new q(l);return g(r)?new W([r,u]):u}class Ht extends wt{constructor(){super(...arguments),this.flowStyle=null}get requiresDedicatedFBO(){return!1}doRender(t){super.doRender(t)}prepareRenderPasses(t){const e=t.registerRenderPass({name:"flow",brushes:[Dt],target:()=>this.children,drawPhase:At.MAP});return[...super.prepareRenderPasses(t),e]}}class Zt{constructor(t,e,s,i){this.state={name:"created"},this.flowStyle=t,this.extent=e,this.size=s,this.pixelRatio=i}async load(){const t=new AbortController;this.state={name:"loading",abortController:t};const e={extent:this.extent,size:this.size,pixelRatio:this.pixelRatio},s=await this.flowStyle.load(e,t.signal);this.state={name:"loaded",resources:s}}attach(t){if(this.state.name!=="loaded")return void K.getLogger("esri.views.2d.engine.flow.FlowDisplayData").error("Only loaded resources can be attached.");const e=this.state.resources;e.attach(t),this.state={name:"attached",resources:e}}detach(){if(this.state.name==="loading")return this.state.abortController.abort(),void(this.state={name:"detached"});this.state.name==="attached"&&(this.state.resources.detach(),this.state={name:"detached"})}update(t){return this.flowStyle.isCompatible(t.flowStyle)?!(!this.extent.equals(t.extent)||this.size[0]!==t.size[0]||this.size[1]!==t.size[1]||this.pixelRatio!==t.pixelRatio)&&(this.flowStyle=t.flowStyle,!0):!1}}class Jt extends at{constructor(){super(...arguments),this._displayData=null}get displayData(){return this._displayData}set displayData(t){this._displayData=t,this.requestRender()}clear(){g(this._displayData)&&(this._displayData.detach(),this._displayData=null,this.requestRender())}setTransform(t){const{displayData:e}=this;if(V(e))return;const s=e.extent.xmin,i=e.extent.ymax,r=[0,0];t.toScreen(r,[s,i]);const o=(e.extent.xmax-e.extent.xmin)/e.size[0]/t.resolution,n=U(t.rotation),{dvs:l}=this.transforms;nt(l,[-1,1,0]),B(l,l,[2/(t.size[0]*t.pixelRatio),-2/(t.size[1]*t.pixelRatio),1]),F(l,l,[r[0],r[1],0]),X(l,l,n),B(l,l,[o*t.pixelRatio,o*t.pixelRatio,1])}_createTransforms(){return{dvs:tt()}}}const Qt=1.15;let A=class extends lt{constructor(a){super(a),this._flowDisplayObject=new Jt,this._loading=null}initialize(){this.flowContainer.addChild(this._flowDisplayObject)}destroy(){this._clear(),this.flowContainer.removeAllChildren()}get updating(){return this._loading!=null}update(a){const{flowStyle:t}=this.flowContainer;if(V(t))return void this._clear();const{extent:e,rotation:s,resolution:i,pixelRatio:r}=a.state,o=Kt(e,s);o.expand(Qt);const n=[Math.round((o.xmax-o.xmin)/i),Math.round((o.ymax-o.ymin)/i)],l=new Zt(t,o,n,r);if(g(this._loading)){if(this._loading.update(l))return;this._loading.detach(),this._loading=null}!V(this._flowDisplayObject.displayData)&&this._flowDisplayObject.displayData.update(l)||(l.load().then(()=>{this._flowDisplayObject.clear(),this._flowDisplayObject.displayData=this._loading,this._loading=null},u=>{ht(u)||(K.getLogger(this.declaredClass).error("A resource failed to load.",u),this._loading=null)}),this._loading=l)}_clear(){this._flowDisplayObject.clear(),g(this._loading)&&(this._loading.detach(),this._loading=null)}};m([f()],A.prototype,"_loading",void 0),m([f()],A.prototype,"flowContainer",void 0),m([f()],A.prototype,"updating",null),A=m([et("esri.views.2d.engine.flow.FlowStrategy")],A);const Yt=A;function Kt(a,t){const e=new ct({x:(a.xmax+a.xmin)/2,y:(a.ymax+a.ymin)/2,spatialReference:a.spatialReference}),s=a.xmax-a.xmin,i=a.ymax-a.ymin,r=Math.abs(Math.cos(U(t))),o=Math.abs(Math.sin(U(t))),n=r*s+o*i,l=o*s+r*i,u=new dt({xmin:e.x-n/2,ymin:e.y-l/2,xmax:e.x+n/2,ymax:e.y+l/2,spatialReference:a.spatialReference});return u.centerAt(e),u}let p=class extends ut{constructor(){super(...arguments),this._loadImagery=(a,t,e,s,i)=>Z(this.layer,a,t,e,s,i),this._createFlowMesh=(a,t,e,s)=>this.layer.createFlowMesh({meshType:a,flowData:e,simulationSettings:t},{signal:s}),this.attached=!1,this.container=null,this.layer=null,this.type="flow",this.timeExtent=null,this.redrawOrRefetch=async()=>{this._updateVisualization()}}get updating(){return!this._strategy||this._strategy.updating}attach(){const{layer:a}=this,t=()=>{this._loadImagery=(e,s,i,r,o)=>Z(a,e,s,i,r,o),this._updateVisualization()};"multidimensionalDefinition"in a?this.handles.add(M(()=>a.multidimensionalDefinition,t)):this.handles.add([M(()=>a.mosaicRule,t),M(()=>a.renderingRule,t),M(()=>a.definitionExpression,t)]),this.container=new Ht,this._strategy=new Yt({flowContainer:this.container}),this._updateVisualization()}detach(){this._strategy.destroy(),this.container.removeAllChildren(),this.container=null,this.handles.removeAll()}update(a){a.stationary?this._strategy.update(a):this.layerView.requestUpdate()}hitTest(a){return new mt({attributes:{},geometry:a.clone(),layer:this.layer})}moveEnd(){}async doRefresh(){}_updateVisualization(){const{renderer:a}=this.layer;if(a.type!=="flow")return;const t=Bt(a,{loadImagery:this._loadImagery,createFlowMesh:this._createFlowMesh,timeExtent:this.timeExtent});this.container.flowStyle=t,this.layerView.requestUpdate()}};m([f()],p.prototype,"_strategy",void 0),m([f()],p.prototype,"attached",void 0),m([f()],p.prototype,"container",void 0),m([f()],p.prototype,"layer",void 0),m([f()],p.prototype,"layerView",void 0),m([f()],p.prototype,"type",void 0),m([f()],p.prototype,"updating",null),m([f()],p.prototype,"timeExtent",void 0),p=m([et("esri.views.2d.engine.flow.FlowView2D")],p);const le=p;class he extends at{constructor(t=null){super(),this._source=null,this._symbolizerParameters=null,this._vaoInvalidated=!0,this.coordScale=[1,1],this.height=null,this.stencilRef=0,this.resolution=null,this.pixelRatio=1,this.x=0,this.y=0,this.rotation=0,this.rawPixelData=null,this.width=null,this.source=t}destroy(){var t,e;g(this.vaoData)&&((t=this.vaoData.magdir)==null||t.vao.dispose(),(e=this.vaoData.scalar)==null||e.vao.dispose(),this.vaoData=null)}get symbolizerParameters(){return this._symbolizerParameters}set symbolizerParameters(t){JSON.stringify(this._symbolizerParameters)!==JSON.stringify(t)&&(this._symbolizerParameters=t,this.invalidateVAO())}get source(){return this._source}set source(t){this._source=t,this.invalidateVAO()}invalidateVAO(){var t,e;!this._vaoInvalidated&&g(this.vaoData)&&((t=this.vaoData.magdir)==null||t.vao.dispose(),(e=this.vaoData.scalar)==null||e.vao.dispose(),this.vaoData=null,this._vaoInvalidated=!0,this.requestRender())}updateVectorFieldVAO(t){if(this._vaoInvalidated){if(this._vaoInvalidated=!1,g(this.source)&&V(this.vaoData)){const{style:e}=this.symbolizerParameters;switch(e){case"beaufort_ft":case"beaufort_km":case"beaufort_kn":case"beaufort_m":case"beaufort_mi":case"classified_arrow":case"ocean_current_kn":case"ocean_current_m":case"single_arrow":{const s=J(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={magdir:i}}break;case"simple_scalar":{const s=Q(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s);this.vaoData={scalar:i}}break;case"wind_speed":{const s=J(this.source,this.symbolizerParameters),i=this._createVectorFieldVAO(t.context,s),r=Q(this.source,this.symbolizerParameters),o=this._createVectorFieldVAO(t.context,r);this.vaoData={magdir:i,scalar:o}}}}this.ready(),this.requestRender()}}_createTransforms(){return{dvs:tt()}}setTransform(t){const e=pt(this.transforms.dvs),[s,i]=t.toScreenNoRotation([0,0],[this.x,this.y]),r=this.resolution/this.pixelRatio/t.resolution,o=r*this.width,n=r*this.height,l=Math.PI*this.rotation/180;F(e,e,O(s,i)),F(e,e,O(o/2,n/2)),X(e,e,-l),F(e,e,O(-o/2,-n/2)),ft(e,e,O(o,n)),_t(this.transforms.dvs,t.displayViewMat3,e)}onAttach(){this.invalidateVAO()}onDetach(){this.invalidateVAO()}_createVectorFieldVAO(t,e){const{vertexData:s,indexData:i}=e,r=v.createVertex(t,w.STATIC_DRAW,new Float32Array(s)),o=v.createIndex(t,w.STATIC_DRAW,new Uint32Array(i)),n=St("vector-field",{geometry:[{location:0,name:"a_pos",count:2,type:d.FLOAT,normalized:!1},{location:1,name:"a_offset",count:2,type:d.FLOAT,normalized:!1},{location:2,name:"a_vv",count:2,type:d.FLOAT,normalized:!1}]});return{vao:new C(t,n.attributes,n.bufferLayouts,{geometry:r},o),elementCount:i.length}}}export{le as d,he as y}; diff --git a/assets/RasterWorker.612f6623.js b/assets/RasterWorker.bd4ba3a5.js similarity index 86% rename from assets/RasterWorker.612f6623.js rename to assets/RasterWorker.bd4ba3a5.js index f1fbb98..fe5886e 100644 --- a/assets/RasterWorker.612f6623.js +++ b/assets/RasterWorker.bd4ba3a5.js @@ -1 +1 @@ -import{c as a,cU as n,u as l,h3 as m}from"./index.d94abe07.js";import{g as i,W as f,T as p,D as u,j as S}from"./pixelUtils.82950e1a.js";import{S as d,T as h,p as y}from"./RasterSymbolizer.4ee6ff2c.js";import{l as x,i as O}from"./utils.9731fda2.js";import{M as N,T as J,$ as b}from"./rasterProjectionHelper.0a540f3d.js";import{d as g,m as w,f as B}from"./dataUtils.0f9b810f.js";import"./colorUtils.bb6424b7.js";class E{convertVectorFieldData(t){const e=i.fromJSON(t.pixelBlock),s=g(e,t.type);return Promise.resolve(a(s)&&s.toJSON())}async decode(t){const e=await d(t.data,t.options);return e&&e.toJSON()}symbolize(t){t.pixelBlock=i.fromJSON(t.pixelBlock),t.extent=t.extent?n.fromJSON(t.extent):null;const e=this.symbolizer.symbolize(t);return Promise.resolve(a(e)&&e.toJSON())}async updateSymbolizer(t){var e;this.symbolizer=h.fromJSON(t.symbolizerJSON),t.histograms&&((e=this.symbolizer)==null?void 0:e.rendererJSON.type)==="rasterStretch"&&(this.symbolizer.rendererJSON.histograms=t.histograms)}async updateRasterFunction(t){this.rasterFunction=x(t.rasterFunctionJSON)}async process(t){const e=this.rasterFunction.process({extent:n.fromJSON(t.extent),primaryPixelBlocks:t.primaryPixelBlocks.map(s=>a(s)?i.fromJSON(s):null),primaryRasterIds:t.primaryRasterIds});return a(e)?e.toJSON():null}stretch(t){const e=this.symbolizer.simpleStretch(i.fromJSON(t.srcPixelBlock),t.stretchParams);return Promise.resolve(a(e)&&e.toJSON())}estimateStatisticsHistograms(t){const e=y(i.fromJSON(t.srcPixelBlock));return Promise.resolve(e)}split(t){const e=f(i.fromJSON(t.srcPixelBlock),t.tileSize,t.maximumPyramidLevel);return e&&e.forEach((s,o)=>{e.set(o,s==null?void 0:s.toJSON())}),Promise.resolve(e)}async mosaicAndTransform(t){const e=t.srcPixelBlocks.map(c=>c?new i(c):null),s=p(e,t.srcMosaicSize,{blockWidths:t.blockWidths,alignmentInfo:t.alignmentInfo,clipOffset:t.clipOffset,clipSize:t.clipSize});let o,r=s;return t.coefs&&(r=u(s,t.destDimension,t.coefs,t.sampleSpacing,t.interpolation)),t.projectDirections&&t.gcsGrid&&(o=S(t.destDimension,t.gcsGrid),r=l(w(r,t.isUV?"vector-uv":"vector-magdir",o))),{pixelBlock:r==null?void 0:r.toJSON(),localNorthDirections:o}}async createFlowMesh(t,e){const s={data:new Float32Array(t.flowData.buffer),mask:new Uint8Array(t.flowData.maskBuffer),width:t.flowData.width,height:t.flowData.height},{vertexData:o,indexData:r}=await B(t.meshType,t.simulationSettings,s,e.signal);return{result:{vertexBuffer:o.buffer,indexBuffer:r.buffer},transferList:[o.buffer,r.buffer]}}async getProjectionOffsetGrid(t){const e=n.fromJSON(t.projectedExtent),s=n.fromJSON(t.srcBufferExtent);let o=null;t.datumTransformationSteps&&(o=new m({steps:t.datumTransformationSteps})),(t.includeGCSGrid||N(e.spatialReference,s.spatialReference,o))&&await J();const r=t.rasterTransform?O(t.rasterTransform):null;return b({...t,projectedExtent:e,srcBufferExtent:s,datumTransformation:o,rasterTransform:r})}}export{E as default}; +import{c as a,cU as n,u as l,h3 as m}from"./index.221827cd.js";import{g as i,W as f,T as p,D as u,j as S}from"./pixelUtils.9c6f8dae.js";import{S as d,T as h,p as y}from"./RasterSymbolizer.093b1748.js";import{l as x,i as O}from"./utils.bc3381b3.js";import{M as N,T as J,$ as b}from"./rasterProjectionHelper.f3c10be2.js";import{d as g,m as w,f as B}from"./dataUtils.e7623e56.js";import"./colorUtils.bb6424b7.js";class E{convertVectorFieldData(t){const e=i.fromJSON(t.pixelBlock),s=g(e,t.type);return Promise.resolve(a(s)&&s.toJSON())}async decode(t){const e=await d(t.data,t.options);return e&&e.toJSON()}symbolize(t){t.pixelBlock=i.fromJSON(t.pixelBlock),t.extent=t.extent?n.fromJSON(t.extent):null;const e=this.symbolizer.symbolize(t);return Promise.resolve(a(e)&&e.toJSON())}async updateSymbolizer(t){var e;this.symbolizer=h.fromJSON(t.symbolizerJSON),t.histograms&&((e=this.symbolizer)==null?void 0:e.rendererJSON.type)==="rasterStretch"&&(this.symbolizer.rendererJSON.histograms=t.histograms)}async updateRasterFunction(t){this.rasterFunction=x(t.rasterFunctionJSON)}async process(t){const e=this.rasterFunction.process({extent:n.fromJSON(t.extent),primaryPixelBlocks:t.primaryPixelBlocks.map(s=>a(s)?i.fromJSON(s):null),primaryRasterIds:t.primaryRasterIds});return a(e)?e.toJSON():null}stretch(t){const e=this.symbolizer.simpleStretch(i.fromJSON(t.srcPixelBlock),t.stretchParams);return Promise.resolve(a(e)&&e.toJSON())}estimateStatisticsHistograms(t){const e=y(i.fromJSON(t.srcPixelBlock));return Promise.resolve(e)}split(t){const e=f(i.fromJSON(t.srcPixelBlock),t.tileSize,t.maximumPyramidLevel);return e&&e.forEach((s,o)=>{e.set(o,s==null?void 0:s.toJSON())}),Promise.resolve(e)}async mosaicAndTransform(t){const e=t.srcPixelBlocks.map(c=>c?new i(c):null),s=p(e,t.srcMosaicSize,{blockWidths:t.blockWidths,alignmentInfo:t.alignmentInfo,clipOffset:t.clipOffset,clipSize:t.clipSize});let o,r=s;return t.coefs&&(r=u(s,t.destDimension,t.coefs,t.sampleSpacing,t.interpolation)),t.projectDirections&&t.gcsGrid&&(o=S(t.destDimension,t.gcsGrid),r=l(w(r,t.isUV?"vector-uv":"vector-magdir",o))),{pixelBlock:r==null?void 0:r.toJSON(),localNorthDirections:o}}async createFlowMesh(t,e){const s={data:new Float32Array(t.flowData.buffer),mask:new Uint8Array(t.flowData.maskBuffer),width:t.flowData.width,height:t.flowData.height},{vertexData:o,indexData:r}=await B(t.meshType,t.simulationSettings,s,e.signal);return{result:{vertexBuffer:o.buffer,indexBuffer:r.buffer},transferList:[o.buffer,r.buffer]}}async getProjectionOffsetGrid(t){const e=n.fromJSON(t.projectedExtent),s=n.fromJSON(t.srcBufferExtent);let o=null;t.datumTransformationSteps&&(o=new m({steps:t.datumTransformationSteps})),(t.includeGCSGrid||N(e.spatialReference,s.spatialReference,o))&&await J();const r=t.rasterTransform?O(t.rasterTransform):null;return b({...t,projectedExtent:e,srcBufferExtent:s,datumTransformation:o,rasterTransform:r})}}export{E as default}; diff --git a/assets/RawBlockCache.73929591.js b/assets/RawBlockCache.e5f26f22.js similarity index 97% rename from assets/RawBlockCache.73929591.js rename to assets/RawBlockCache.e5f26f22.js index c4b8f82..9abf97d 100644 --- a/assets/RawBlockCache.73929591.js +++ b/assets/RawBlockCache.e5f26f22.js @@ -1 +1 @@ -import{c as W,af as J}from"./index.d94abe07.js";import{J as L,C as P,o as q}from"./rasterProjectionHelper.0a540f3d.js";class F{constructor(n=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=n,this._interval=Math.min(n,t)}decreaseRefCount(n,t){const e=n+"/"+t,r=this._cachedBlocks;if(r.has(e)){const o=r.get(e);return o.refCount--,o.refCount<=0&&(r.delete(e),o.controller&&o.controller.abort()),o.refCount}return 0}getBlock(n,t){const e=n+"/"+t,r=this._cachedBlocks;if(r.has(e)){const o=r.get(e);return o.ts=Date.now(),o.refCount++,r.delete(e),r.set(e,o),o.block}return null}putBlock(n,t,e,r){const o=this._cachedBlocks,s=n+"/"+t;if(o.has(s)){const i=o.get(s);i.ts=Date.now(),i.refCount++}else o.set(s,{block:e,ts:Date.now(),refCount:1,controller:r});this._trim(),this._updateTimer()}deleteBlock(n,t){const e=this._cachedBlocks,r=n+"/"+t;e.has(r)&&e.delete(r)}updateMaxSize(n){this._size=n,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(this._timer!=null)return;const n=this._cachedBlocks;this._timer=setInterval(()=>{const t=Array.from(n),e=Date.now();for(let r=0;r=n.size)return;const t=Array.from(n);for(let e=0;ee!=null)||f.delete(l))}function V(l,n,t){var s,i;const e=f.get(l);if(!e)return n==null?d.decreaseRefCount(l,t):0;if(n==null||e[n]==null)return d.decreaseRefCount(l,t);const r=(s=e[n])==null?void 0:s.cache,o=r==null?void 0:r.get(t);if(r&&o){if(o.refCount--,o.refCount===0){r.delete(t);for(let c=0;cs.isResolved=!0).catch(()=>s.isRejected=!0),(i=o[n])==null||i.cache.set(t,s)}function Z(l,n,t){var r;const e=f.get(l);e?n!=null&&e[n]!=null?(r=e[n])==null||r.cache.delete(t):d.deleteBlock(l,t):n==null&&d.deleteBlock(l,t)}function G(l,n){var e;const t=f.get(l);return t&&(e=t[n])!=null?e:null}function ee(l,n,t,e,r,o,s=null){const i=G(l,n);if(!i)return;const c=i.extent,{cache:a,rasterInfo:m}=i;if(c&&c.xmin===t.xmin&&c.xmax===t.xmax&&c.ymin===t.ymin&&c.ymax===t.ymax)return;e=e!=null?e:0;const M=t.clone().normalize(),{spatialReference:R,transform:v}=m,w=new Set;for(let g=0;g0?x.pyramidBlockWidth:x.blockWidth,$=p>0?x.pyramidBlockHeight:x.blockHeight,y=1,H=Math.max(0,Math.floor(k.x/z)-y),S=Math.max(0,Math.floor(k.y/$)-y),A=Math.floor((k.x+j-1)/z)+y,E=Math.floor((k.y+D-1)/$)+y;for(let B=S;B<=E;B++)for(let C=H;C<=A;C++)w.add(`${p}/${B}/${C}`)}a.forEach((g,h)=>{if(!w.has(h)){const u=a.get(h);(u==null||u.isResolved||u.isRejected)&&a.delete(h)}}),i.extent={xmin:t.xmin,ymin:t.ymin,xmax:t.xmax,ymax:t.ymax}}export{O as a,Z as d,U as f,ee as g,Y as h,V as m,Q as u,X as x}; +import{c as W,af as J}from"./index.221827cd.js";import{J as L,C as P,o as q}from"./rasterProjectionHelper.f3c10be2.js";class F{constructor(n=15e3,t=5e3){this._timer=null,this._cachedBlocks=new Map,this._size=-1,this._duration=n,this._interval=Math.min(n,t)}decreaseRefCount(n,t){const e=n+"/"+t,r=this._cachedBlocks;if(r.has(e)){const o=r.get(e);return o.refCount--,o.refCount<=0&&(r.delete(e),o.controller&&o.controller.abort()),o.refCount}return 0}getBlock(n,t){const e=n+"/"+t,r=this._cachedBlocks;if(r.has(e)){const o=r.get(e);return o.ts=Date.now(),o.refCount++,r.delete(e),r.set(e,o),o.block}return null}putBlock(n,t,e,r){const o=this._cachedBlocks,s=n+"/"+t;if(o.has(s)){const i=o.get(s);i.ts=Date.now(),i.refCount++}else o.set(s,{block:e,ts:Date.now(),refCount:1,controller:r});this._trim(),this._updateTimer()}deleteBlock(n,t){const e=this._cachedBlocks,r=n+"/"+t;e.has(r)&&e.delete(r)}updateMaxSize(n){this._size=n,this._trim()}empty(){this._cachedBlocks.clear(),this._clearTimer()}getCurrentSize(){return this._cachedBlocks.size}_updateTimer(){if(this._timer!=null)return;const n=this._cachedBlocks;this._timer=setInterval(()=>{const t=Array.from(n),e=Date.now();for(let r=0;r=n.size)return;const t=Array.from(n);for(let e=0;ee!=null)||f.delete(l))}function V(l,n,t){var s,i;const e=f.get(l);if(!e)return n==null?d.decreaseRefCount(l,t):0;if(n==null||e[n]==null)return d.decreaseRefCount(l,t);const r=(s=e[n])==null?void 0:s.cache,o=r==null?void 0:r.get(t);if(r&&o){if(o.refCount--,o.refCount===0){r.delete(t);for(let c=0;cs.isResolved=!0).catch(()=>s.isRejected=!0),(i=o[n])==null||i.cache.set(t,s)}function Z(l,n,t){var r;const e=f.get(l);e?n!=null&&e[n]!=null?(r=e[n])==null||r.cache.delete(t):d.deleteBlock(l,t):n==null&&d.deleteBlock(l,t)}function G(l,n){var e;const t=f.get(l);return t&&(e=t[n])!=null?e:null}function ee(l,n,t,e,r,o,s=null){const i=G(l,n);if(!i)return;const c=i.extent,{cache:a,rasterInfo:m}=i;if(c&&c.xmin===t.xmin&&c.xmax===t.xmax&&c.ymin===t.ymin&&c.ymax===t.ymax)return;e=e!=null?e:0;const M=t.clone().normalize(),{spatialReference:R,transform:v}=m,w=new Set;for(let g=0;g0?x.pyramidBlockWidth:x.blockWidth,$=p>0?x.pyramidBlockHeight:x.blockHeight,y=1,H=Math.max(0,Math.floor(k.x/z)-y),S=Math.max(0,Math.floor(k.y/$)-y),A=Math.floor((k.x+j-1)/z)+y,E=Math.floor((k.y+D-1)/$)+y;for(let B=S;B<=E;B++)for(let C=H;C<=A;C++)w.add(`${p}/${B}/${C}`)}a.forEach((g,h)=>{if(!w.has(h)){const u=a.get(h);(u==null||u.isResolved||u.isRejected)&&a.delete(h)}}),i.extent={xmin:t.xmin,ymin:t.ymin,xmax:t.xmax,ymax:t.ymax}}export{O as a,Z as d,U as f,ee as g,Y as h,V as m,Q as u,X as x}; diff --git a/assets/RealisticTree.glsl.6abe3a4c.js b/assets/RealisticTree.glsl.6abe3a4c.js new file mode 100644 index 0000000..770844e --- /dev/null +++ b/assets/RealisticTree.glsl.6abe3a4c.js @@ -0,0 +1 @@ +import{I as y}from"./objectResourceUtils.dfe6cb73.js";import"./mat3f64.6d32a1d7.js";import"./mat4f64.ff2a477c.js";import"./vec3f32.1121a836.js";import"./index.221827cd.js";import"./VertexAttribute.42396f25.js";import"./symbolColorUtils.36aaa708.js";import"./OrderIndependentTransparency.4d1575c0.js";import"./VertexArrayObject.53cf1857.js";import"./enums.2d9e6f64.js";import"./Texture.940076b2.js";import"./devEnvironmentUtils.d8d0484c.js";import"./BufferView.6eee27cd.js";import"./vec33.46fc6802.js";import"./DefaultMaterial_COLOR_GAMMA.8ee780a2.js";import"./types.44c7402c.js";import"./Version.433fbe58.js";import"./quat.d9562009.js";import"./quatf64.4ae3e6f1.js";import"./requestImageUtils.1f5d4b6d.js";import"./Util.f17667f9.js";import"./sphere.f99ddb50.js";import"./VertexElementDescriptor.1fdca6da.js";import"./InterleavedLayout.30cdc193.js";export{y as build}; diff --git a/assets/RealisticTree.glsl.8875d152.js b/assets/RealisticTree.glsl.8875d152.js deleted file mode 100644 index 53eb041..0000000 --- a/assets/RealisticTree.glsl.8875d152.js +++ /dev/null @@ -1 +0,0 @@ -import{I as y}from"./objectResourceUtils.996108d7.js";import"./mat3f64.6d32a1d7.js";import"./mat4f64.ff2a477c.js";import"./vec3f32.1121a836.js";import"./index.d94abe07.js";import"./VertexAttribute.42396f25.js";import"./symbolColorUtils.d5fe1bd7.js";import"./OrderIndependentTransparency.4d1575c0.js";import"./VertexArrayObject.a4c1d809.js";import"./enums.2d9e6f64.js";import"./Texture.4c97bad5.js";import"./devEnvironmentUtils.d8d0484c.js";import"./BufferView.89055914.js";import"./vec33.4564cd5b.js";import"./DefaultMaterial_COLOR_GAMMA.bf8213a8.js";import"./types.44c7402c.js";import"./Version.59f2da65.js";import"./quat.b3994f2f.js";import"./quatf64.4ae3e6f1.js";import"./requestImageUtils.7b09b5e8.js";import"./Util.ea9235b8.js";import"./sphere.ec1f4496.js";import"./VertexElementDescriptor.1fdca6da.js";import"./InterleavedLayout.f9d79992.js";export{y as build}; diff --git a/assets/RefreshableLayerView.28a00159.js b/assets/RefreshableLayerView.887ed8c3.js similarity index 84% rename from assets/RefreshableLayerView.28a00159.js rename to assets/RefreshableLayerView.887ed8c3.js index 0e9f9b7..dd5de9d 100644 --- a/assets/RefreshableLayerView.28a00159.js +++ b/assets/RefreshableLayerView.887ed8c3.js @@ -1 +1 @@ -import{a6 as s,a7 as t,a8 as h,c$ as l,x as d,s as o}from"./index.d94abe07.js";const c=r=>{let e=class extends r{initialize(){this.handles.add(l(()=>this.layer,"refresh",i=>{this.doRefresh(i.dataChanged).catch(a=>{d(a)||o.getLogger(this.declaredClass).error(a)})}),"RefreshableLayerView")}};return s([t()],e.prototype,"layer",void 0),e=s([h("esri.layers.mixins.RefreshableLayerView")],e),e};export{c as i}; +import{a6 as s,a7 as t,a8 as h,c$ as l,x as d,s as o}from"./index.221827cd.js";const c=r=>{let e=class extends r{initialize(){this.handles.add(l(()=>this.layer,"refresh",i=>{this.doRefresh(i.dataChanged).catch(a=>{d(a)||o.getLogger(this.declaredClass).error(a)})}),"RefreshableLayerView")}};return s([t()],e.prototype,"layer",void 0),e=s([h("esri.layers.mixins.RefreshableLayerView")],e),e};export{c as i}; diff --git a/assets/RenderingContext.6e624525.js b/assets/RenderingContext.8853f4cd.js similarity index 99% rename from assets/RenderingContext.6e624525.js rename to assets/RenderingContext.8853f4cd.js index 5ad0fad..4ba36aa 100644 --- a/assets/RenderingContext.6e624525.js +++ b/assets/RenderingContext.8853f4cd.js @@ -1,4 +1,4 @@ -import{n as Tt,m as Wt}from"./WGLContainer.1850619d.js";import{n as $t,s as Vt}from"./programUtils.956e69db.js";import{aj as Rt,r as rt,s as Yt,j as U,bc as Ht,c as it,bd as Bt,be as jt,w as Kt}from"./index.d94abe07.js";import{n as S,E as dt,a as H}from"./Texture.4c97bad5.js";import{R as q,T as ct,N as K,S as Nt,I as st,O as Q,t as et,Y as nt,V as at,M as G,D as Z,P as k,G as W,L as z,F as lt,C as Et,E as X,U as zt,_ as tt,A as u,X as ft,n as y,W as qt,r as At,f as Qt}from"./enums.2d9e6f64.js";import{t as mt,W as Zt,s as Jt,M as te}from"./OrderIndependentTransparency.4d1575c0.js";import{x as ot,E as ut,a as ht,i as xt}from"./VertexArrayObject.a4c1d809.js";import{r as ee}from"./floatRGBA.df11258c.js";import{t as gt}from"./VertexElementDescriptor.1fdca6da.js";const ie=r=>{let t="";t+=r[0].toUpperCase();for(let e=1;e{const t={};for(const e in r)t[ie(e)]=r[e];return $t(t)},ye=(r,t,e,i)=>{const s=r+r.substring(r.lastIndexOf("/")),a=t+t.substring(t.lastIndexOf("/")),o=re(i);return{attributes:e,shaders:{vertexShader:o+Tt(`${s}.vert`),fragmentShader:o+Tt(`${a}.frag`)}}};class St{constructor(t,e,i,s,a,o,_,f,T){this.createQuery=t,this.deleteQuery=e,this.resultAvailable=i,this.getResult=s,this.disjoint=a,this.beginTimeElapsed=o,this.endTimeElapsed=_,this.createTimestamp=f,this.timestampBits=T}}let j=!1;function se(r,t){if(t.disjointTimerQuery)return null;let e=r.getExtension("EXT_disjoint_timer_query_webgl2");return e&&S(r)?new St(()=>r.createQuery(),i=>{r.deleteQuery(i),j=!1},i=>r.getQueryParameter(i,r.QUERY_RESULT_AVAILABLE),i=>r.getQueryParameter(i,r.QUERY_RESULT),()=>r.getParameter(e.GPU_DISJOINT_EXT),i=>{j||(j=!0,r.beginQuery(e.TIME_ELAPSED_EXT,i))},()=>{r.endQuery(e.TIME_ELAPSED_EXT),j=!1},i=>e.queryCounterEXT(i,e.TIMESTAMP_EXT),()=>r.getQuery(e.TIMESTAMP_EXT,e.QUERY_COUNTER_BITS_EXT)):(e=r.getExtension("EXT_disjoint_timer_query"),e?new St(()=>e.createQueryEXT(),i=>{e.deleteQueryEXT(i),j=!1},i=>e.getQueryObjectEXT(i,e.QUERY_RESULT_AVAILABLE_EXT),i=>e.getQueryObjectEXT(i,e.QUERY_RESULT_EXT),()=>r.getParameter(e.GPU_DISJOINT_EXT),i=>{j||(j=!0,e.beginQueryEXT(e.TIME_ELAPSED_EXT,i))},()=>{e.endQueryEXT(e.TIME_ELAPSED_EXT),j=!1},i=>e.queryCounterEXT(i,e.TIMESTAMP_EXT),()=>e.getQueryEXT(e.TIMESTAMP_EXT,e.QUERY_COUNTER_BITS_EXT)):null)}class Ot{constructor(){this.blend=!1,this.blendColor={r:0,g:0,b:0,a:0},this.blendFunction={srcRGB:q.ONE,dstRGB:q.ZERO,srcAlpha:q.ONE,dstAlpha:q.ZERO},this.blendEquation={mode:ct.ADD,modeAlpha:ct.ADD},this.colorMask={r:!0,g:!0,b:!0,a:!0},this.faceCulling=!1,this.cullFace=K.BACK,this.frontFace=Nt.CCW,this.scissorTest=!1,this.scissorRect={x:0,y:0,width:0,height:0},this.depthTest=!1,this.depthFunction=st.LESS,this.clearDepth=1,this.depthWrite=!0,this.depthRange={zNear:0,zFar:1},this.viewport=null,this.stencilTest=!1,this.polygonOffsetFill=!1,this.polygonOffset=[0,0],this.stencilFunction={face:K.FRONT_AND_BACK,func:st.ALWAYS,ref:0,mask:1},this.clearStencil=0,this.stencilWriteMask=1,this.stencilOperation={face:K.FRONT_AND_BACK,fail:Q.KEEP,zFail:Q.KEEP,zPass:Q.KEEP},this.clearColor={r:0,g:0,b:0,a:0},this.program=null,this.vertexBuffer=null,this.indexBuffer=null,this.uniformBuffer=null,this.pixelPackBuffer=null,this.pixelUnpackBuffer=null,this.copyReadBuffer=null,this.copyWriteBuffer=null,this.uniformBufferBindingPoints=new Array,this.readFramebuffer=null,this.drawFramebuffer=null,this.renderbuffer=null,this.activeTexture=0,this.textureUnitMap=new Array,this.vertexArrayObject=null}}class ne{constructor(t){this._allocations=new Map,t?Error.stackTraceLimit=1/0:(this.add=()=>{},this.remove=()=>{})}add(t){this._allocations.set(t,new Error().stack)}remove(t){this._allocations.delete(t)}print(){if(this._allocations.size>0){console.log(`${this._allocations.size} live object allocations:`);const t=new Map;this._allocations.forEach(e=>{var i;t.set(e,((i=t.get(e))!=null?i:0)+1)}),t.forEach((e,i)=>{const s=i.split(` +import{n as Tt,m as Wt}from"./WGLContainer.347cc5cd.js";import{n as $t,s as Vt}from"./programUtils.10ecfb8b.js";import{aj as Rt,r as rt,s as Yt,j as U,bc as Ht,c as it,bd as Bt,be as jt,w as Kt}from"./index.221827cd.js";import{n as S,E as dt,a as H}from"./Texture.940076b2.js";import{R as q,T as ct,N as K,S as Nt,I as st,O as Q,t as et,Y as nt,V as at,M as G,D as Z,P as k,G as W,L as z,F as lt,C as Et,E as X,U as zt,_ as tt,A as u,X as ft,n as y,W as qt,r as At,f as Qt}from"./enums.2d9e6f64.js";import{t as mt,W as Zt,s as Jt,M as te}from"./OrderIndependentTransparency.4d1575c0.js";import{x as ot,E as ut,a as ht,i as xt}from"./VertexArrayObject.53cf1857.js";import{r as ee}from"./floatRGBA.3f71f8e9.js";import{t as gt}from"./VertexElementDescriptor.1fdca6da.js";const ie=r=>{let t="";t+=r[0].toUpperCase();for(let e=1;e{const t={};for(const e in r)t[ie(e)]=r[e];return $t(t)},ye=(r,t,e,i)=>{const s=r+r.substring(r.lastIndexOf("/")),a=t+t.substring(t.lastIndexOf("/")),o=re(i);return{attributes:e,shaders:{vertexShader:o+Tt(`${s}.vert`),fragmentShader:o+Tt(`${a}.frag`)}}};class St{constructor(t,e,i,s,a,o,_,f,T){this.createQuery=t,this.deleteQuery=e,this.resultAvailable=i,this.getResult=s,this.disjoint=a,this.beginTimeElapsed=o,this.endTimeElapsed=_,this.createTimestamp=f,this.timestampBits=T}}let j=!1;function se(r,t){if(t.disjointTimerQuery)return null;let e=r.getExtension("EXT_disjoint_timer_query_webgl2");return e&&S(r)?new St(()=>r.createQuery(),i=>{r.deleteQuery(i),j=!1},i=>r.getQueryParameter(i,r.QUERY_RESULT_AVAILABLE),i=>r.getQueryParameter(i,r.QUERY_RESULT),()=>r.getParameter(e.GPU_DISJOINT_EXT),i=>{j||(j=!0,r.beginQuery(e.TIME_ELAPSED_EXT,i))},()=>{r.endQuery(e.TIME_ELAPSED_EXT),j=!1},i=>e.queryCounterEXT(i,e.TIMESTAMP_EXT),()=>r.getQuery(e.TIMESTAMP_EXT,e.QUERY_COUNTER_BITS_EXT)):(e=r.getExtension("EXT_disjoint_timer_query"),e?new St(()=>e.createQueryEXT(),i=>{e.deleteQueryEXT(i),j=!1},i=>e.getQueryObjectEXT(i,e.QUERY_RESULT_AVAILABLE_EXT),i=>e.getQueryObjectEXT(i,e.QUERY_RESULT_EXT),()=>r.getParameter(e.GPU_DISJOINT_EXT),i=>{j||(j=!0,e.beginQueryEXT(e.TIME_ELAPSED_EXT,i))},()=>{e.endQueryEXT(e.TIME_ELAPSED_EXT),j=!1},i=>e.queryCounterEXT(i,e.TIMESTAMP_EXT),()=>e.getQueryEXT(e.TIMESTAMP_EXT,e.QUERY_COUNTER_BITS_EXT)):null)}class Ot{constructor(){this.blend=!1,this.blendColor={r:0,g:0,b:0,a:0},this.blendFunction={srcRGB:q.ONE,dstRGB:q.ZERO,srcAlpha:q.ONE,dstAlpha:q.ZERO},this.blendEquation={mode:ct.ADD,modeAlpha:ct.ADD},this.colorMask={r:!0,g:!0,b:!0,a:!0},this.faceCulling=!1,this.cullFace=K.BACK,this.frontFace=Nt.CCW,this.scissorTest=!1,this.scissorRect={x:0,y:0,width:0,height:0},this.depthTest=!1,this.depthFunction=st.LESS,this.clearDepth=1,this.depthWrite=!0,this.depthRange={zNear:0,zFar:1},this.viewport=null,this.stencilTest=!1,this.polygonOffsetFill=!1,this.polygonOffset=[0,0],this.stencilFunction={face:K.FRONT_AND_BACK,func:st.ALWAYS,ref:0,mask:1},this.clearStencil=0,this.stencilWriteMask=1,this.stencilOperation={face:K.FRONT_AND_BACK,fail:Q.KEEP,zFail:Q.KEEP,zPass:Q.KEEP},this.clearColor={r:0,g:0,b:0,a:0},this.program=null,this.vertexBuffer=null,this.indexBuffer=null,this.uniformBuffer=null,this.pixelPackBuffer=null,this.pixelUnpackBuffer=null,this.copyReadBuffer=null,this.copyWriteBuffer=null,this.uniformBufferBindingPoints=new Array,this.readFramebuffer=null,this.drawFramebuffer=null,this.renderbuffer=null,this.activeTexture=0,this.textureUnitMap=new Array,this.vertexArrayObject=null}}class ne{constructor(t){this._allocations=new Map,t?Error.stackTraceLimit=1/0:(this.add=()=>{},this.remove=()=>{})}add(t){this._allocations.set(t,new Error().stack)}remove(t){this._allocations.delete(t)}print(){if(this._allocations.size>0){console.log(`${this._allocations.size} live object allocations:`);const t=new Map;this._allocations.forEach(e=>{var i;t.set(e,((i=t.get(e))!=null?i:0)+1)}),t.forEach((e,i)=>{const s=i.split(` `);s.shift(),s.shift(),console.log(`${e}: ${s.shift()}`),s.forEach(a=>console.log(" ",a))})}}}const ae={RECORD_ALLOCATIONS:!1};class le{constructor(){for(this._current=new Array,this._max=new Array,this._allocations=new ne(ae.RECORD_ALLOCATIONS);this._current.lengtht+e,0)}printResourceCount(){if(this.total>0){console.log("Live objects:");for(let t=0;t0&&console.log(`${et[t]}: ${e}`)}}this._allocations.print()}}function Ct(r,t){r.resetState();const e=new ot(r,{colorTarget:nt.TEXTURE,depthStencilTarget:at.NONE},{target:G.TEXTURE_2D,wrapMode:Z.CLAMP_TO_EDGE,pixelFormat:k.RGBA,dataType:W.UNSIGNED_BYTE,samplingMode:z.NEAREST,width:1,height:1}),i=ut.createVertex(r,lt.STATIC_DRAW,new Uint16Array([0,0,1,0,0,1,1,1])),s=new ht(r,new Map([["position",0]]),{geometry:[new gt("position",2,Et.UNSIGNED_SHORT,0,4)]},{geometry:i}),a=Rt(5633261287538229e-9,2626832878767164e-9,1.4349880495278358e6),o=Rt(563327146742708e-8,2.6268736381334523e6,1434963231608387e-9),_=oe(r,a,o,t);r.bindFramebuffer(e),r.setViewport(0,0,1,1),r.bindVAO(s),r.drawArrays(X.TRIANGLE_STRIP,0,4);const f=new Uint8Array(4);e.readPixels(0,0,1,1,k.RGBA,W.UNSIGNED_BYTE,f),_.dispose(),s.dispose(!1),i.dispose(),e.dispose();const T=(a[2]-o[2])/25,d=ee(f);return Math.abs(T-d)}function oe(r,t,e,i){const s=` precision highp float; diff --git a/assets/RouteLayer.ab63e037.js b/assets/RouteLayer.bee5d382.js similarity index 99% rename from assets/RouteLayer.ab63e037.js rename to assets/RouteLayer.bee5d382.js index 3fde810..d5eb5b3 100644 --- a/assets/RouteLayer.ab63e037.js +++ b/assets/RouteLayer.bee5d382.js @@ -1,2 +1,2 @@ -import{a6 as t,a7 as s,eh as F,a8 as O,cx as M,e5 as Q,iF as be,iH as Rt,ei as L,d2 as j,e0 as V,j as A,s as mt,n as x,e4 as Se,U as ne,jF as $e,eA as It,dQ as ft,c as h,ct as ht,af as vt,d1 as Y,cS as Pe,cU as wt,d3 as q,aT as H,u as ye,e2 as At,eg as je,dZ as jt,c9 as Ot,d$ as Lt,cE as C,i2 as Dt,i3 as _t,eF as Ct,eG as Jt,eH as Mt,a4 as kt,c$ as xt,hV as Ft,cR as Et,e_ as rt,F as ot,jb as Ut,bX as Gt,cD as Wt,bW as qt,jG as st,x as Zt,jH as zt,dv as Vt,bI as Ht,cI as Kt,g2 as Qt,cF as Xt}from"./index.d94abe07.js";import{i as Yt}from"./originUtils.2d0aad75.js";import{f as er}from"./portalItemUtils.57ded807.js";import{y as ee,N as Oe,U as tr,r as Le,A as gt,R as rr,c as or,n as sr,w as ir,S as nr,d as it,s as ar,e as lr,i as pr,j as ur,k as cr,b as ae,h as le,O as re,g as oe,f as se,D as ie,a as de,t as yr,l as dr}from"./Stop.a3532add.js";import"./multiOriginJSONSupportUtils.38b69b9c.js";let Z=class extends M{constructor(e){super(e),this.break=new Q({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}}),this.first=new Q({color:[0,255,0],size:20,outline:{color:[255,255,255],width:4}}),this.unlocated=new Q({color:[255,0,0],size:12,outline:{color:[255,255,255],width:3}}),this.last=new Q({color:[255,0,0],size:20,outline:{color:[255,255,255],width:4}}),this.middle=new Q({color:[51,51,51],size:12,outline:{color:[0,122,194],width:3}}),this.waypoint=new Q({color:[255,255,255],size:12,outline:{color:[0,122,194],width:3}})}};t([s({types:F})],Z.prototype,"break",void 0),t([s({types:F})],Z.prototype,"first",void 0),t([s({types:F})],Z.prototype,"unlocated",void 0),t([s({types:F})],Z.prototype,"last",void 0),t([s({types:F})],Z.prototype,"middle",void 0),t([s({types:F})],Z.prototype,"waypoint",void 0),Z=t([O("esri.layers.support.RouteStopSymbols")],Z);const St=Z;let G=class extends M{constructor(e){super(e),this.directionLines=new be({color:[0,122,194],width:6}),this.directionPoints=new Q({color:[255,255,255],size:6,outline:{color:[0,122,194],width:2}}),this.pointBarriers=new Q({style:"x",size:10,outline:{color:[255,0,0],width:3}}),this.polygonBarriers=new Rt({color:[255,170,0,.6],outline:{width:7.5,color:[255,0,0,.6]}}),this.polylineBarriers=new be({width:7.5,color:[255,85,0,.7]}),this.routeInfo=new be({width:8,color:[20,89,127]}),this.stops=new St}};t([s({types:F})],G.prototype,"directionLines",void 0),t([s({types:F})],G.prototype,"directionPoints",void 0),t([s({types:F})],G.prototype,"pointBarriers",void 0),t([s({types:F})],G.prototype,"polygonBarriers",void 0),t([s({types:F})],G.prototype,"polylineBarriers",void 0),t([s({types:F})],G.prototype,"routeInfo",void 0),t([s({type:St})],G.prototype,"stops",void 0),G=t([O("esri.layers.support.RouteSymbols")],G);const bt=G;let E=class extends M{constructor(e){super(e),this.dataType=null,this.name=null,this.parameterNames=null,this.restrictionUsageParameterName=null,this.timeNeutralAttributeName=null,this.trafficSupport=null,this.units=null,this.usageType=null}};t([s({type:String})],E.prototype,"dataType",void 0),t([L(ee,{ignoreUnknown:!1})],E.prototype,"name",void 0),t([s({type:[String]})],E.prototype,"parameterNames",void 0),t([s({type:String})],E.prototype,"restrictionUsageParameterName",void 0),t([L(Oe,{ignoreUnknown:!1})],E.prototype,"timeNeutralAttributeName",void 0),t([s({type:String})],E.prototype,"trafficSupport",void 0),t([s({type:String})],E.prototype,"units",void 0),t([L(tr)],E.prototype,"usageType",void 0),E=t([O("esri.rest.support.NetworkAttribute")],E);const mr=E;let K=class extends M{constructor(e){super(e),this.buildTime=null,this.name=null,this.networkAttributes=null,this.networkSources=null,this.state=null}};t([s({type:Number})],K.prototype,"buildTime",void 0),t([s({type:String})],K.prototype,"name",void 0),t([s({type:[mr]})],K.prototype,"networkAttributes",void 0),t([s()],K.prototype,"networkSources",void 0),t([s({type:String})],K.prototype,"state",void 0),K=t([O("esri.rest.support.NetworkDataset")],K);const fr=K;let _=class extends M{constructor(e){super(e),this.accumulateAttributeNames=null,this.currentVersion=null,this.defaultTravelMode=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsSupportedLanguages=null,this.directionsTimeAttribute=null,this.hasZ=null,this.impedance=null,this.networkDataset=null,this.supportedTravelModes=null}readAccumulateAttributes(e){return A(e)?null:e.map(r=>ee.fromJSON(r))}writeAccumulateAttributes(e,r,o){!A(e)&&e.length&&(r[o]=e.map(i=>ee.toJSON(i)))}};t([s()],_.prototype,"accumulateAttributeNames",void 0),t([j("accumulateAttributeNames")],_.prototype,"readAccumulateAttributes",null),t([V("accumulateAttributeNames")],_.prototype,"writeAccumulateAttributes",null),t([s()],_.prototype,"currentVersion",void 0),t([s()],_.prototype,"defaultTravelMode",void 0),t([s()],_.prototype,"directionsLanguage",void 0),t([L(Le)],_.prototype,"directionsLengthUnits",void 0),t([s()],_.prototype,"directionsSupportedLanguages",void 0),t([L(Oe,{ignoreUnknown:!1})],_.prototype,"directionsTimeAttribute",void 0),t([s()],_.prototype,"hasZ",void 0),t([L(ee,{ignoreUnknown:!1})],_.prototype,"impedance",void 0),t([s({type:fr})],_.prototype,"networkDataset",void 0),t([s({type:[gt]})],_.prototype,"supportedTravelModes",void 0),_=t([O("esri.rest.support.NetworkServiceDescription")],_);const hr=_,vr=mt.getLogger("esri.rest.networkService");function me(e,r,o,i){i[o]=[r.length,r.length+e.length],e.forEach(n=>{r.push(n.geometry)})}function wr(e,r){for(let o=0;oee.fromJSON(r))}writeAccumulateAttributes(e,r,o){!A(e)&&e.length&&(r[o]=e.map(i=>ee.toJSON(i)))}};t([s()],_.prototype,"accumulateAttributeNames",void 0),t([j("accumulateAttributeNames")],_.prototype,"readAccumulateAttributes",null),t([V("accumulateAttributeNames")],_.prototype,"writeAccumulateAttributes",null),t([s()],_.prototype,"currentVersion",void 0),t([s()],_.prototype,"defaultTravelMode",void 0),t([s()],_.prototype,"directionsLanguage",void 0),t([L(Le)],_.prototype,"directionsLengthUnits",void 0),t([s()],_.prototype,"directionsSupportedLanguages",void 0),t([L(Oe,{ignoreUnknown:!1})],_.prototype,"directionsTimeAttribute",void 0),t([s()],_.prototype,"hasZ",void 0),t([L(ee,{ignoreUnknown:!1})],_.prototype,"impedance",void 0),t([s({type:fr})],_.prototype,"networkDataset",void 0),t([s({type:[gt]})],_.prototype,"supportedTravelModes",void 0),_=t([O("esri.rest.support.NetworkServiceDescription")],_);const hr=_,vr=mt.getLogger("esri.rest.networkService");function me(e,r,o,i){i[o]=[r.length,r.length+e.length],e.forEach(n=>{r.push(n.geometry)})}function wr(e,r){for(let o=0;o=10.4?br(e,r,o):Sr(e,o),{defaultTravelMode:u,supportedTravelModes:p}=await d;return n.defaultTravelMode=u,n.supportedTravelModes=p,hr.fromJSON(n)}async function Sr(e,r){var N,I,B;const o=Se({f:"json"},r),{data:i}=await ne(e.replace(/\/rest\/.*$/i,"/info"),o);if(!i||!i.owningSystemUrl)return{supportedTravelModes:[],defaultTravelMode:null};const{owningSystemUrl:n}=i,d=$e(n)+"/sharing/rest/portals/self",{data:u}=await ne(d,o),p=It("helperServices.routingUtilities.url",u);if(!p)return{supportedTravelModes:[],defaultTravelMode:null};const f=ft(n),S=/\/solve$/i.test(f.path)?"Route":/\/solveclosestfacility$/i.test(f.path)?"ClosestFacility":"ServiceAreas",a=Se({f:"json",serviceName:S},r),b=$e(p)+"/GetTravelModes/execute",$=await ne(b,a),v=[];let y=null;if((I=(N=$==null?void 0:$.data)==null?void 0:N.results)!=null&&I.length){const l=$.data.results;for(const g of l)if(g.paramName==="supportedTravelModes"){if((B=g.value)!=null&&B.features){for(const{attributes:w}of g.value.features)if(w){const P=JSON.parse(w.TravelMode);v.push(P)}}}else g.paramName==="defaultTravelMode"&&(y=g.value)}return{supportedTravelModes:v,defaultTravelMode:y}}async function br(e,r,o){try{const i=Se({f:"json",token:r},o),n=$e(e)+"/retrieveTravelModes",{data:{supportedTravelModes:d,defaultTravelMode:u}}=await ne(n,i);return{supportedTravelModes:d,defaultTravelMode:u}}catch(i){throw new x("network-service:retrieveTravelModes","Could not get to the NAServer's retrieveTravelModes.",{error:i})}}const nt=new ht({esriJobMessageTypeInformative:"informative",esriJobMessageTypeProcessDefinition:"process-definition",esriJobMessageTypeProcessStart:"process-start",esriJobMessageTypeProcessStop:"process-stop",esriJobMessageTypeWarning:"warning",esriJobMessageTypeError:"error",esriJobMessageTypeEmpty:"empty",esriJobMessageTypeAbort:"abort"});let pe=class extends M{constructor(e){super(e),this.description=null,this.type=null}};t([s({type:String,json:{write:!0}})],pe.prototype,"description",void 0),t([s({type:String,json:{read:nt.read,write:nt.write}})],pe.prototype,"type",void 0),pe=t([O("esri.rest.support.GPMessage")],pe);const Tr=pe,at=new ht({0:"informative",1:"process-definition",2:"process-start",3:"process-stop",50:"warning",100:"error",101:"empty",200:"abort"});let we=class extends Tr{constructor(e){super(e),this.type=null}};t([s({type:String,json:{read:at.read,write:at.write}})],we.prototype,"type",void 0),we=t([O("esri.rest.support.NAMessage")],we);const Br=we;let ue=class extends M{constructor(e){super(e)}};t([s({json:{read:{source:"string"}}})],ue.prototype,"text",void 0),t([L(rr,{name:"stringType"})],ue.prototype,"type",void 0),ue=t([O("esri.rest.support.DirectionsString")],ue);const Bt=ue;let z=class extends M{constructor(e){super(e),this.arriveTime=null,this.arriveTimeOffset=null,this.geometry=null,this.strings=null}readArriveTimeOffset(e,r){return or(r.ETA,r.arriveTimeUTC)}readGeometry(e,r){return vt.fromJSON(r.point)}};t([s({type:Date,json:{read:{source:"arriveTimeUTC"}}})],z.prototype,"arriveTime",void 0),t([s()],z.prototype,"arriveTimeOffset",void 0),t([j("arriveTimeOffset",["arriveTimeUTC","ETA"])],z.prototype,"readArriveTimeOffset",null),t([s({type:vt})],z.prototype,"geometry",void 0),t([j("geometry",["point"])],z.prototype,"readGeometry",null),t([s({type:[Bt]})],z.prototype,"strings",void 0),z=t([O("esri.rest.support.DirectionsEvent")],z);const Nr=z;function $r(e){if(A(e)||e==="")return null;let r=0,o=0,i=0,n=0;const d=[];let u,p,f,S,a,b,$,v,y=0,N=0,I=0;if(a=e.match(/((\+|\-)[^\+\-\|]+|\|)/g),a||(a=[]),parseInt(a[y],32)===0){y=2;const B=parseInt(a[y],32);y++,b=parseInt(a[y],32),y++,1&B&&(N=a.indexOf("|")+1,$=parseInt(a[N],32),N++),2&B&&(I=a.indexOf("|",N)+1,v=parseInt(a[I],32),I++)}else b=parseInt(a[y],32),y++;for(;y0,hasM:I>0}}let te=class extends Y{constructor(e){super(e),this.events=null,this.strings=null}readGeometry(e,r){const o=$r(r.compressedGeometry);return h(o)?Pe.fromJSON(o):null}};t([s({type:[Nr]})],te.prototype,"events",void 0),t([j("geometry",["compressedGeometry"])],te.prototype,"readGeometry",null),t([s({type:[Bt]})],te.prototype,"strings",void 0),te=t([O("esri.rest.support.DirectionsFeature")],te);const Pr=te;function Rr(e,r){if(e.length===0)return new Pe({spatialReference:r});const o=[];for(const u of e)for(const p of u.paths)o.push(...p);const i=[];o.forEach((u,p)=>{p!==0&&u[0]===o[p-1][0]&&u[1]===o[p-1][1]||i.push(u)});const{hasM:n,hasZ:d}=e[0];return new Pe({hasM:n,hasZ:d,paths:[i],spatialReference:r})}let J=class extends q{constructor(e){super(e),this.extent=null,this.features=null,this.geometryType="polyline",this.routeId=null,this.routeName=null,this.totalDriveTime=null,this.totalLength=null,this.totalTime=null}readFeatures(e,r){var n;if(!e)return[];const o=(n=r.summary.envelope.spatialReference)!=null?n:r.spatialReference,i=o&&H.fromJSON(o);return e.map(d=>{const u=Pr.fromJSON(d);if(h(u.geometry)&&(u.geometry.spatialReference=i),h(u.events))for(const p of u.events)h(p.geometry)&&(p.geometry.spatialReference=i);return u})}get mergedGeometry(){return this.features?Rr(this.features.map(({geometry:e})=>ye(e)),this.extent.spatialReference):null}get strings(){return this.features.map(({strings:e})=>e).flat().filter(h)}};t([s({type:wt,json:{read:{source:"summary.envelope"}}})],J.prototype,"extent",void 0),t([s()],J.prototype,"features",void 0),t([j("features")],J.prototype,"readFeatures",null),t([s()],J.prototype,"geometryType",void 0),t([s({readOnly:!0})],J.prototype,"mergedGeometry",null),t([s()],J.prototype,"routeId",void 0),t([s()],J.prototype,"routeName",void 0),t([s({value:null,readOnly:!0})],J.prototype,"strings",null),t([s({json:{read:{source:"summary.totalDriveTime"}}})],J.prototype,"totalDriveTime",void 0),t([s({json:{read:{source:"summary.totalLength"}}})],J.prototype,"totalLength",void 0),t([s({json:{read:{source:"summary.totalTime"}}})],J.prototype,"totalTime",void 0),J=t([O("esri.rest.support.DirectionsFeatureSet")],J);const Ir=J;let k=class extends M{constructor(e){super(e),this.directionLines=null,this.directionPoints=null,this.directions=null,this.route=null,this.routeName=null,this.stops=null,this.traversedEdges=null,this.traversedJunctions=null,this.traversedTurns=null}};t([s({type:q,json:{write:!0}})],k.prototype,"directionLines",void 0),t([s({type:q,json:{write:!0}})],k.prototype,"directionPoints",void 0),t([s({type:Ir,json:{write:!0}})],k.prototype,"directions",void 0),t([s({type:Y,json:{write:!0}})],k.prototype,"route",void 0),t([s({type:String,json:{write:!0}})],k.prototype,"routeName",void 0),t([s({type:[Y],json:{write:!0}})],k.prototype,"stops",void 0),t([s({type:q,json:{write:!0}})],k.prototype,"traversedEdges",void 0),t([s({type:q,json:{write:!0}})],k.prototype,"traversedJunctions",void 0),t([s({type:q,json:{write:!0}})],k.prototype,"traversedTurns",void 0),k=t([O("esri.rest.support.RouteResult")],k);const Ar=k;function Te(e){return e&&q.fromJSON(e).features.map(r=>r)}let U=class extends M{constructor(e){super(e),this.messages=null,this.pointBarriers=null,this.polylineBarriers=null,this.polygonBarriers=null,this.routeResults=null}readPointBarriers(e,r){return Te(r.barriers)}readPolylineBarriers(e){return Te(e)}readPolygonBarriers(e){return Te(e)}};t([s({type:[Br]})],U.prototype,"messages",void 0),t([s({type:[Y]})],U.prototype,"pointBarriers",void 0),t([j("pointBarriers",["barriers"])],U.prototype,"readPointBarriers",null),t([s({type:[Y]})],U.prototype,"polylineBarriers",void 0),t([j("polylineBarriers")],U.prototype,"readPolylineBarriers",null),t([s({type:[Y]})],U.prototype,"polygonBarriers",void 0),t([j("polygonBarriers")],U.prototype,"readPolygonBarriers",null),t([s({type:[Ar]})],U.prototype,"routeResults",void 0),U=t([O("esri.rest.support.RouteSolveResult")],U);const jr=U;function fe(e){return e instanceof q}async function Or(e,r,o){const i=[],n=[],d={},u={},p=ft(e),{path:f}=p;fe(r.stops)&&me(r.stops.features,n,"stops.features",d),fe(r.pointBarriers)&&me(r.pointBarriers.features,n,"pointBarriers.features",d),fe(r.polylineBarriers)&&me(r.polylineBarriers.features,n,"polylineBarriers.features",d),fe(r.polygonBarriers)&&me(r.polygonBarriers.features,n,"polygonBarriers.features",d);const S=await At(n);for(const v in d){const y=d[v];i.push(v),u[v]=S.slice(y[0],y[1])}if(gr(u,i)){let v=null;try{v=await Tt(f,r.apiKey,o)}catch{}v&&!v.hasZ&&wr(u,i)}for(const v in u)u[v].forEach((y,N)=>{r.get(v)[N].geometry=y});const a={...o,query:{...p.query,...sr(r),f:"json"}},b=f.endsWith("/solve")?f:`${f}/solve`,{data:$}=await ne(b,a);return Lr($)}function Lr(e){var B;const{barriers:r,directionLines:o,directionPoints:i,directions:n,messages:d,polygonBarriers:u,polylineBarriers:p,routes:f,stops:S,traversedEdges:a,traversedJunctions:b,traversedTurns:$}=e,v=l=>{const g=N.find(P=>P.routeName===l);if(h(g))return g;const w={routeId:N.length+1,routeName:l};return N.push(w),w},y=l=>{const g=N.find(P=>P.routeId===l);if(h(g))return g;const w={routeId:l,routeName:null};return N.push(w),w},N=[];f==null||f.features.forEach((l,g)=>{l.geometry.spatialReference=f.spatialReference;const w=l.attributes.Name,P=g+1;N.push({routeId:P,routeName:w,route:l})}),n==null||n.forEach(l=>{const{routeName:g}=l;v(g).directions=l});const I=((B=S==null?void 0:S.features.every(l=>A(l.attributes.RouteName)))!=null?B:!1)&&N.length>0?N[0].routeName:null;return S==null||S.features.forEach(l=>{var R,D;var g;l.geometry&&((R=(g=l.geometry).spatialReference)!=null||(g.spatialReference=S.spatialReference));const w=I!=null?I:l.attributes.RouteName,P=v(w);(D=P.stops)!=null||(P.stops=[]),P.stops.push(l)}),o==null||o.features.forEach(l=>{var D;const g=l.attributes.RouteID,w=y(g),{geometryType:P,spatialReference:R}=o;(D=w.directionLines)!=null||(w.directionLines={features:[],geometryType:P,spatialReference:R}),w.directionLines.features.push(l)}),i==null||i.features.forEach(l=>{var D;const g=l.attributes.RouteID,w=y(g),{geometryType:P,spatialReference:R}=i;(D=w.directionPoints)!=null||(w.directionPoints={features:[],geometryType:P,spatialReference:R}),w.directionPoints.features.push(l)}),a==null||a.features.forEach(l=>{var D;const g=l.attributes.RouteID,w=y(g),{geometryType:P,spatialReference:R}=a;(D=w.traversedEdges)!=null||(w.traversedEdges={features:[],geometryType:P,spatialReference:R}),w.traversedEdges.features.push(l)}),b==null||b.features.forEach(l=>{var D;const g=l.attributes.RouteID,w=y(g),{geometryType:P,spatialReference:R}=b;(D=w.traversedJunctions)!=null||(w.traversedJunctions={features:[],geometryType:P,spatialReference:R}),w.traversedJunctions.features.push(l)}),$==null||$.features.forEach(l=>{var P;const g=l.attributes.RouteID,w=y(g);(P=w.traversedTurns)!=null||(w.traversedTurns={features:[]}),w.traversedTurns.features.push(l)}),jr.fromJSON({routeResults:N,barriers:r,polygonBarriers:u,polylineBarriers:p,messages:d})}const Dr={type:String,json:{read:{source:"token"},write:{target:"token"}}};let W=class extends je(M){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.geometry=null,this.geometryType=null,this.name=null,this.spatialRelationship=null,this.type="layer",this.where=null}};t([s({type:Boolean,json:{write:!0}})],W.prototype,"doNotLocateOnRestrictedElements",void 0),t([s({types:jt,json:{read:Ot,write:!0}})],W.prototype,"geometry",void 0),t([L(ir)],W.prototype,"geometryType",void 0),t([s({type:String,json:{name:"layerName",write:!0}})],W.prototype,"name",void 0),t([L(nr,{name:"spatialRel"})],W.prototype,"spatialRelationship",void 0),t([s({type:String,json:{write:!0}})],W.prototype,"type",void 0),t([s({type:String,json:{write:!0}})],W.prototype,"where",void 0),W=t([O("esri.rest.support.DataLayer")],W);const _r=W;var Re;let ge=Re=class extends q{constructor(e){super(e),this.doNotLocateOnRestrictedElements=null}clone(){return new Re({doNotLocateOnRestrictedElements:this.doNotLocateOnRestrictedElements,...this.cloneProperties()})}};t([s({type:Boolean,json:{write:!0}})],ge.prototype,"doNotLocateOnRestrictedElements",void 0),ge=Re=t([O("esri.rest.support.NetworkFeatureSet")],ge);const Cr=ge;let ce=class extends je(M){constructor(e){super(e),this.doNotLocateOnRestrictedElements=null,this.url=null}};t([s({type:Boolean,json:{write:!0}})],ce.prototype,"doNotLocateOnRestrictedElements",void 0),t([s({type:String,json:{write:!0}})],ce.prototype,"url",void 0),ce=t([O("esri.rest.support.NetworkUrl")],ce);const Jr=ce;var Ie;function Mr(e){return e&&"type"in e}function kr(e){return e&&"features"in e&&"doNotLocateOnRestrictedElements"in e}function xr(e){return e&&"url"in e}function Fr(e){return e&&"features"in e}function Er(e){return Mr(e)?_r.fromJSON(e):xr(e)?Jr.fromJSON(e):kr(e)?Cr.fromJSON(e):Fr(e)?q.fromJSON(e):null}function he(e,r,o){h(e)&&(r[o]=C.isCollection(e)?{features:e.toArray().map(i=>i.toJSON())}:e.toJSON())}let c=Ie=class extends je(M){constructor(e){super(e),this.accumulateAttributes=null,this.apiKey=null,this.attributeParameterValues=null,this.directionsLanguage=null,this.directionsLengthUnits=null,this.directionsOutputType=null,this.directionsStyleName=null,this.directionsTimeAttribute=null,this.findBestSequence=null,this.geometryPrecision=null,this.geometryPrecisionM=null,this.geometryPrecisionZ=null,this.ignoreInvalidLocations=null,this.impedanceAttribute=null,this.outputGeometryPrecision=null,this.outputGeometryPrecisionUnits=null,this.outputLines="true-shape",this.outSpatialReference=null,this.overrides=null,this.pointBarriers=null,this.polygonBarriers=null,this.polylineBarriers=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.preserveObjectID=null,this.restrictionAttributes=null,this.restrictUTurns=null,this.returnBarriers=!1,this.returnDirections=!1,this.returnPolygonBarriers=!1,this.returnPolylineBarriers=!1,this.returnRoutes=!0,this.returnStops=!1,this.returnTraversedEdges=null,this.returnTraversedJunctions=null,this.returnTraversedTurns=null,this.returnZ=!0,this.startTime=null,this.startTimeIsUTC=!0,this.stops=null,this.timeWindowsAreUTC=null,this.travelMode=null,this.useHierarchy=null,this.useTimeWindows=null}static from(e){return Lt(Ie,e)}readAccumulateAttributes(e){return A(e)?null:e.map(r=>ee.fromJSON(r))}writeAccumulateAttributes(e,r,o){!A(e)&&e.length&&(r[o]=e.map(i=>ee.toJSON(i)))}writePointBarriers(e,r,o){he(e,r,o)}writePolygonBarrier(e,r,o){he(e,r,o)}writePolylineBarrier(e,r,o){he(e,r,o)}readRestrictionAttributes(e){return A(e)?null:e.map(r=>it.fromJSON(r))}writeRestrictionAttributes(e,r,o){!A(e)&&e.length&&(r[o]=e.map(i=>it.toJSON(i)))}readStartTime(e,r){const{startTime:o}=r;return A(o)?null:o==="now"?"now":new Date(o)}writeStartTime(e,r){A(e)||(r.startTime=e==="now"?"now":e.getTime())}readStops(e,r){return Er(r.stops)}writeStops(e,r,o){he(e,r,o)}};t([s({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],c.prototype,"accumulateAttributes",void 0),t([j("accumulateAttributes")],c.prototype,"readAccumulateAttributes",null),t([V("accumulateAttributes")],c.prototype,"writeAccumulateAttributes",null),t([s(Dr)],c.prototype,"apiKey",void 0),t([s({json:{write:!0}})],c.prototype,"attributeParameterValues",void 0),t([s({type:String,json:{write:!0}})],c.prototype,"directionsLanguage",void 0),t([L(Le)],c.prototype,"directionsLengthUnits",void 0),t([L(ar)],c.prototype,"directionsOutputType",void 0),t([L(lr)],c.prototype,"directionsStyleName",void 0),t([L(Oe,{name:"directionsTimeAttributeName",ignoreUnknown:!1})],c.prototype,"directionsTimeAttribute",void 0),t([s({type:Boolean,json:{write:!0}})],c.prototype,"findBestSequence",void 0),t([s({type:Number,json:{write:!0}})],c.prototype,"geometryPrecision",void 0),t([s({type:Number,json:{write:!0}})],c.prototype,"geometryPrecisionM",void 0),t([s({type:Number,json:{write:!0}})],c.prototype,"geometryPrecisionZ",void 0),t([s({type:Boolean,json:{write:!0}})],c.prototype,"ignoreInvalidLocations",void 0),t([L(ee,{name:"impedanceAttributeName",ignoreUnknown:!1})],c.prototype,"impedanceAttribute",void 0),t([s({type:Number,json:{write:!0}})],c.prototype,"outputGeometryPrecision",void 0),t([L(pr)],c.prototype,"outputGeometryPrecisionUnits",void 0),t([L(ur)],c.prototype,"outputLines",void 0),t([s({type:H,json:{name:"outSR",write:!0}})],c.prototype,"outSpatialReference",void 0),t([s({json:{write:!0}})],c.prototype,"overrides",void 0),t([s({json:{name:"barriers",write:!0}})],c.prototype,"pointBarriers",void 0),t([V("pointBarriers")],c.prototype,"writePointBarriers",null),t([s({json:{write:!0}})],c.prototype,"polygonBarriers",void 0),t([V("polygonBarriers")],c.prototype,"writePolygonBarrier",null),t([s({json:{write:!0}})],c.prototype,"polylineBarriers",void 0),t([V("polylineBarriers")],c.prototype,"writePolylineBarrier",null),t([s({type:Boolean,json:{write:!0}})],c.prototype,"preserveFirstStop",void 0),t([s({type:Boolean,json:{write:!0}})],c.prototype,"preserveLastStop",void 0),t([s({type:Boolean,json:{write:!0}})],c.prototype,"preserveObjectID",void 0),t([s({type:[String],json:{name:"restrictionAttributeNames",write:!0}})],c.prototype,"restrictionAttributes",void 0),t([j("restrictionAttributes")],c.prototype,"readRestrictionAttributes",null),t([V("restrictionAttributes")],c.prototype,"writeRestrictionAttributes",null),t([L(cr)],c.prototype,"restrictUTurns",void 0),t([s({type:Boolean,json:{write:!0}})],c.prototype,"returnBarriers",void 0),t([s({type:Boolean,json:{write:!0}})],c.prototype,"returnDirections",void 0),t([s({type:Boolean,json:{write:!0}})],c.prototype,"returnPolygonBarriers",void 0),t([s({type:Boolean,json:{write:!0}})],c.prototype,"returnPolylineBarriers",void 0),t([s({type:Boolean,json:{write:!0}})],c.prototype,"returnRoutes",void 0),t([s({type:Boolean,json:{write:!0}})],c.prototype,"returnStops",void 0),t([s({type:Boolean,json:{write:!0}})],c.prototype,"returnTraversedEdges",void 0),t([s({type:Boolean,json:{write:!0}})],c.prototype,"returnTraversedJunctions",void 0),t([s({type:Boolean,json:{write:!0}})],c.prototype,"returnTraversedTurns",void 0),t([s({type:Boolean,json:{write:!0}})],c.prototype,"returnZ",void 0),t([s({type:Date,json:{type:Number,write:!0}})],c.prototype,"startTime",void 0),t([j("startTime")],c.prototype,"readStartTime",null),t([V("startTime")],c.prototype,"writeStartTime",null),t([s({type:Boolean,json:{write:!0}})],c.prototype,"startTimeIsUTC",void 0),t([s({json:{write:!0}})],c.prototype,"stops",void 0),t([j("stops")],c.prototype,"readStops",null),t([V("stops")],c.prototype,"writeStops",null),t([s({type:Boolean,json:{write:!0}})],c.prototype,"timeWindowsAreUTC",void 0),t([s({type:gt,json:{write:!0}})],c.prototype,"travelMode",void 0),t([s({type:Boolean,json:{write:!0}})],c.prototype,"useHierarchy",void 0),t([s({type:Boolean,json:{write:!0}})],c.prototype,"useTimeWindows",void 0),c=Ie=t([O("esri.rest.support.RouteParameters")],c);const lt=c;function Be(e){return e.length?e:null}function Nt(e){const{defaultTravelMode:r,supportedTravelModes:o}=e;return o==null?void 0:o.find(({id:i})=>i===r)}function Ae(e){switch(e){case"esriGeometryPoint":return{type:"esriSMS",style:"esriSMSCircle",size:12,color:[0,0,0,0],outline:Ae("esriGeometryPolyline")};case"esriGeometryPolyline":return{type:"esriSLS",style:"esriSLSSolid",width:1,color:[0,0,0,0]};case"esriGeometryPolygon":return{type:"esriSFS",style:"esriSFSNull",outline:Ae("esriGeometryPolyline")}}}function ve(e){return"layers"in e}function Ur(e){return e.declaredClass==="esri.rest.support.FeatureSet"}function Gr(e){return e.declaredClass==="esri.rest.support.NetworkFeatureSet"}function Wr(e,r,o){var De,_e,Ce,Je,Me,ke,xe,Fe,Ee,Ue,Ge,We,qe,Ze,ze,Ve,He,Ke,Qe,Xe,Ye,et;const i=(De=r.networkDataset)==null?void 0:De.networkAttributes,n=(_e=i==null?void 0:i.filter(m=>m.usageType==="cost"))!=null?_e:[],d=Nt(r),u=(Ce=o.travelMode)!=null?Ce:d;if(A(u))return void Pt.warn("route-layer:missing-travel-mode","The routing service must have a default travel mode or one must be specified in the route parameter.");const{timeAttributeName:p,distanceAttributeName:f}=u,S=n.find(m=>m.name===p),a=n.find(m=>m.name===f),b=(ke=(Me=(Je=ye(o.travelMode))==null?void 0:Je.impedanceAttributeName)!=null?Me:ye(o.impedanceAttribute))!=null?ke:r.impedance,$=yr.fromJSON(S==null?void 0:S.units),v=Le.fromJSON(a==null?void 0:a.units);if(!$||!v)throw new x("routelayer:unknown-impedance-units","the units of either the distance or time impedance are unknown");const y=(xe=o.directionsLanguage)!=null?xe:r.directionsLanguage,N=(Ee=(Fe=ye(o.accumulateAttributes))!=null?Fe:r.accumulateAttributeNames)!=null?Ee:[],I=new Set(n.filter(({name:m})=>m===p||m===f||m===b||m!=null&&N.includes(m)).map(({name:m})=>m)),B=m=>{for(const tt in m)I.has(tt)||delete m[tt]};for(const m of e.pointBarriers)h(m.costs)&&(m.addedCost=(Ue=m.costs[b])!=null?Ue:0,B(m.costs));for(const m of e.polygonBarriers)h(m.costs)&&(m.scaleFactor=(Ge=m.costs[b])!=null?Ge:1,B(m.costs));for(const m of e.polylineBarriers)h(m.costs)&&(m.scaleFactor=(We=m.costs[b])!=null?We:1,B(m.costs));const{routeInfo:l}=e,{findBestSequence:g,preserveFirstStop:w,preserveLastStop:P,startTimeIsUTC:R,timeWindowsAreUTC:D}=o;l.analysisSettings=new dr({accumulateAttributes:N,directionsLanguage:y,findBestSequence:g,preserveFirstStop:w,preserveLastStop:P,startTimeIsUTC:R,timeWindowsAreUTC:D,travelMode:u}),l.totalDuration=X((qe=l.totalCosts[p])!=null?qe:0,$),l.totalDistance=Ne((Ze=l.totalCosts[f])!=null?Ze:0,v),l.totalLateDuration=X((ze=l.totalViolations[p])!=null?ze:0,$),l.totalWaitDuration=X((Ve=l.totalWait[p])!=null?Ve:0,$),h(l.totalCosts)&&B(l.totalCosts),h(l.totalViolations)&&B(l.totalViolations),h(l.totalWait)&&B(l.totalWait);for(const m of e.stops)h(m.serviceCosts)&&(m.serviceDuration=X((He=m.serviceCosts[p])!=null?He:0,$),m.serviceDistance=Ne((Ke=m.serviceCosts[f])!=null?Ke:0,v),B(m.serviceCosts)),h(m.cumulativeCosts)&&(m.cumulativeDuration=X((Qe=m.cumulativeCosts[p])!=null?Qe:0,$),m.cumulativeDistance=Ne((Xe=m.cumulativeCosts[f])!=null?Xe:0,v),B(m.cumulativeCosts)),h(m.violations)&&(m.lateDuration=X((Ye=m.violations[p])!=null?Ye:0,$),B(m.violations)),h(m.wait)&&(m.waitDuration=X((et=m.wait[p])!=null?et:0,$),B(m.wait))}async function pt(e){const r=H.WGS84;return await Ht(e.spatialReference,r),Kt(e,r)}function X(e,r){switch(r){case"seconds":return e/60;case"hours":return 60*e;case"days":return 60*e*24;default:return e}}function Ne(e,r){return r==="decimal-degrees"||r==="points"||r==="unknown"?e:Qt(e,r,"meters")}function qr(e){const{attributes:r,geometry:o,popupTemplate:i,symbol:n}=e.toGraphic().toJSON();return{attributes:r,geometry:o,popupInfo:i,symbol:n}}const Zr=C.ofType(ae),zr=C.ofType(le),ut=C.ofType(re),ct=C.ofType(oe),yt=C.ofType(se),dt=C.ofType(ie),$t="esri.layers.RouteLayer",Pt=mt.getLogger($t);let T=class extends Dt(_t(Ct(Jt(Mt(kt(Xt)))))){constructor(e){super(e),this._cachedServiceDescription=null,this._featureCollection=null,this._type="Feature Collection",this.defaultSymbols=new bt,this.directionLines=null,this.directionPoints=null,this.featureCollectionType="route",this.legendEnabled=!1,this.maxScale=0,this.minScale=0,this.pointBarriers=new ut,this.polygonBarriers=new ct,this.polylineBarriers=new yt,this.routeInfo=null,this.spatialReference=H.WGS84,this.stops=new dt,this.type="route";const r=()=>{this._setStopSymbol(this.stops)};this.addHandles(xt(()=>this.stops,"change",r,{sync:!0,onListenerAdd:r}))}writeFeatureCollectionWebmap(e,r,o,i){const n=[this._writePolygonBarriers(),this._writePolylineBarriers(),this._writePointBarriers(),this._writeRouteInfo(),this._writeDirectionLines(),this._writeDirectionPoints(),this._writeStops()].filter(p=>!!p),d=n.map((p,f)=>f),u=i.origin==="web-map"?"featureCollection.layers":"layers";Ft(u,n,r),r.opacity=this.opacity,r.visibility=this.visible,r.visibleLayers=d}readDirectionLines(e,r){return this._getNetworkFeatures(r,"DirectionLines",o=>ae.fromGraphic(o))}readDirectionPoints(e,r){return this._getNetworkFeatures(r,"DirectionPoints",o=>le.fromGraphic(o))}get fullExtent(){var n;const e=new wt({xmin:-180,ymin:-90,xmax:180,ymax:90,spatialReference:H.WGS84});if(h(this.routeInfo)&&h(this.routeInfo.geometry))return(n=this.routeInfo.geometry.extent)!=null?n:e;if(A(this.stops))return e;const r=this.stops.filter(d=>h(d.geometry));if(r.length<2)return e;const{spatialReference:o}=r.getItemAt(0).geometry;if(A(o))return e;const i=r.toArray().map(d=>{const u=d.geometry;return[u.x,u.y]});return new Et({points:i,spatialReference:o}).extent}readMaxScale(e,r){var o,i;return(i=(o=(ve(r)?r.layers:r.featureCollection.layers).find(n=>h(n.layerDefinition.maxScale)))==null?void 0:o.layerDefinition.maxScale)!=null?i:0}readMinScale(e,r){var o,i;return(i=(o=(ve(r)?r.layers:r.featureCollection.layers).find(n=>h(n.layerDefinition.minScale)))==null?void 0:o.layerDefinition.minScale)!=null?i:0}readPointBarriers(e,r){return this._getNetworkFeatures(r,"Barriers",o=>re.fromGraphic(o))}readPolygonBarriers(e,r){return this._getNetworkFeatures(r,"PolygonBarriers",o=>oe.fromGraphic(o))}readPolylineBarriers(e,r){return this._getNetworkFeatures(r,"PolylineBarriers",o=>se.fromGraphic(o))}readRouteInfo(e,r){const o=this._getNetworkFeatures(r,"RouteInfo",i=>de.fromGraphic(i));return o.length>0?o.getItemAt(0):null}readSpatialReference(e,r){var p,f,S,a,b;const o=ve(r)?r.layers:r.featureCollection.layers;if(!o.length)return H.WGS84;const{layerDefinition:i,featureSet:n}=o[0],d=n.features[0],u=(b=(a=(S=(f=(p=ye(d==null?void 0:d.geometry))==null?void 0:p.spatialReference)!=null?f:n.spatialReference)!=null?S:i.spatialReference)!=null?a:i.extent.spatialReference)!=null?b:rt;return H.fromJSON(u)}readStops(e,r){return this._getNetworkFeatures(r,"Stops",o=>ie.fromGraphic(o),o=>this._setStopSymbol(o))}get title(){return h(this.routeInfo)&&h(this.routeInfo.name)?this.routeInfo.name:"Route"}set title(e){this._overrideIfSome("title",e)}get url(){return ot.routeServiceUrl}set url(e){e!=null?this._set("url",Ut(e,Pt)):this._set("url",ot.routeServiceUrl)}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Feature Collection"]},e)),Promise.resolve(this)}removeAll(){this.removeResult(),this.pointBarriers.removeAll(),this.polygonBarriers.removeAll(),this.polylineBarriers.removeAll(),this.stops.removeAll()}removeResult(){h(this.directionLines)&&(this.directionLines.removeAll(),this._set("directionLines",null)),h(this.directionPoints)&&(this.directionPoints.removeAll(),this._set("directionPoints",null)),h(this.routeInfo)&&this._set("routeInfo",null)}async save(){await this.load();const{fullExtent:e,portalItem:r}=this;if(!r)throw new x("routelayer:portal-item-not-set","save() requires to the layer to have a portal item");if(!r.id)throw new x("routelayer:portal-item-not-saved","Please use saveAs() first to save the routelayer");if(r.type!=="Feature Collection")throw new x("routelayer:portal-item-wrong-type",'Portal item needs to have type "Feature Collection"');if(A(this.routeInfo))throw new x("routelayer:route-unsolved","save() requires a solved route");const{portal:o}=r;await o._signIn(),o.user||await r.reload();const{itemUrl:i,itemControl:n}=r;if(n!=="admin"&&n!=="update")throw new x("routelayer:insufficient-permissions","To save this layer, you need to be the owner or an administrator of your organization");const d={messages:[],origin:"portal-item",portal:o,url:i&&Gt(i),writtenProperties:[]},u=this.write(null,d);return r.extent=await pt(e),r.title=this.title,await r.update({data:u}),r}async saveAs(e,r={}){var p,f,S;if(await this.load(),A(this.routeInfo))throw new x("routelayer:route-unsolved","saveAs() requires a solved route");const o=Wt.from(e).clone();(p=o.extent)!=null||(o.extent=await pt(this.fullExtent)),o.id=null,(f=o.portal)!=null||(o.portal=qt.getDefault()),(S=o.title)!=null||(o.title=this.title),o.type="Feature Collection",o.typeKeywords=["Data","Feature Collection",er.MULTI_LAYER,"Route Layer"];const{portal:i}=o,n={messages:[],origin:"portal-item",portal:i,url:null,writtenProperties:[]};await i._signIn();const d=r==null?void 0:r.folder,u=this.write(null,n);return await i.user.addItem({item:o,folder:d,data:u}),this.portalItem=o,Yt(n),n.portalItem=o,o}async solve(e,r){var B,l,g,w,P;const o=(B=e==null?void 0:e.stops)!=null?B:this.stops,i=(l=e==null?void 0:e.pointBarriers)!=null?l:Be(this.pointBarriers),n=(g=e==null?void 0:e.polylineBarriers)!=null?g:Be(this.polylineBarriers),d=(w=e==null?void 0:e.polygonBarriers)!=null?w:Be(this.polygonBarriers);if(A(o))throw new x("routelayer:undefined-stops","the route layer must have stops defined in the route parameters.");if((Ur(o)||Gr(o))&&o.features.length<2||C.isCollection(o)&&o.length<2)throw new x("routelayer:insufficent-stops","the route layer must have two or more stops to solve a route.");if(C.isCollection(o))for(const R of o)R.routeName=null;const u=e==null?void 0:e.apiKey,p=this.url,f=await this._getServiceDescription(p,u,r),S=Nt(f),a=(P=e==null?void 0:e.travelMode)!=null?P:S,b=st(e==null?void 0:e.accumulateAttributes,[]);h(a)&&(b.push(a.distanceAttributeName),a.timeAttributeName&&b.push(a.timeAttributeName));const $={startTime:new Date},v={accumulateAttributes:b,directionsOutputType:"featuresets",ignoreInvalidLocations:!0,pointBarriers:i,polylineBarriers:n,polygonBarriers:d,preserveFirstStop:!0,preserveLastStop:!0,returnBarriers:!!i,returnDirections:!0,returnPolygonBarriers:!!d,returnPolylineBarriers:!!n,returnRoutes:!0,returnStops:!0,stops:o},y=e?lt.from(e):new lt;for(const R in $)y[R]==null&&(y[R]=$[R]);let N;y.set(v);try{N=await Or(p,y,r)}catch(R){throw Zt(R)?R:new x("routelayer:failed-route-request","the routing request failed",{error:R})}const I=this._toRouteLayerSolution(N);return this._isOverridden("title")||(this.title=st(I.routeInfo.name,"Route")),Wr(I,f,y),I}update(e){const{stops:r,directionLines:o,directionPoints:i,pointBarriers:n,polylineBarriers:d,polygonBarriers:u,routeInfo:p}=e;this.set({stops:r,pointBarriers:n,polylineBarriers:d,polygonBarriers:u}),this._set("directionLines",o),this._set("directionPoints",i),this._set("routeInfo",p),h(p.geometry)&&(this.spatialReference=p.geometry.spatialReference)}_getNetworkFeatures(e,r,o,i){var y,N,I;const n=(ve(e)?e.layers:e.featureCollection.layers).find(B=>B.layerDefinition.name===r);if(A(n))return new C;const{layerDefinition:d,popupInfo:u,featureSet:p}=n,f=d.drawingInfo.renderer,{features:S}=p,a=(I=(N=(y=p.spatialReference)!=null?y:d.spatialReference)!=null?N:d.extent.spatialReference)!=null?I:rt,b=f&&zt(f),$=H.fromJSON(a),v=S.map(B=>{var w,P,R;const l=Y.fromJSON(B);h(l.geometry)&&h(B.geometry)&&A(B.geometry.spatialReference)&&(l.geometry.spatialReference=$);const g=o(l);return(P=g.symbol)!=null||(g.symbol=(w=b==null?void 0:b.getSymbol(l))!=null?w:this._getNetworkSymbol(r)),(R=g.popupTemplate)!=null||(g.popupTemplate=u&&Vt.fromJSON(u)),g});return i&&v.some(B=>!B.symbol)&&i(v),new C(v)}_getNetworkSymbol(e){switch(e){case"Barriers":return this.defaultSymbols.pointBarriers;case"DirectionPoints":return this.defaultSymbols.directionPoints;case"DirectionLines":return this.defaultSymbols.directionLines;case"PolylineBarriers":return this.defaultSymbols.polylineBarriers;case"PolygonBarriers":return this.defaultSymbols.polygonBarriers;case"RouteInfo":return this.defaultSymbols.routeInfo;case"Stops":return null}}async _getServiceDescription(e,r,o){if(h(this._cachedServiceDescription)&&this._cachedServiceDescription.url===e)return this._cachedServiceDescription.serviceDescription;const i=await Tt(e,r,o);return this._cachedServiceDescription={serviceDescription:i,url:e},i}_setStopSymbol(e){if(!e||e.length===0||A(this.defaultSymbols.stops)||e.every(a=>h(a.symbol)))return;const{first:r,last:o,middle:i,unlocated:n,waypoint:d,break:u}=this.defaultSymbols.stops;if(A(this.routeInfo)||e.length===1)return void e.forEach((a,b)=>{switch(b){case 0:a.symbol=r;break;case e.length-1:a.symbol=o;break;default:a.symbol=i}});const p=e.map(a=>a.sequence).filter(a=>h(a)),f=Math.min(...p),S=Math.max(...p);for(const a of e)a.sequence!==f?a.sequence!==S?a.status==="ok"||a.status==="not-located-on-closest"?a.locationType!=="waypoint"?a.locationType!=="break"?a.symbol=i:a.symbol=u:a.symbol=d:a.symbol=n:a.symbol=o:a.symbol=r}_toRouteLayerSolution(e){var f,S,a,b,$;const r=e.routeResults[0].stops.map(v=>ie.fromJSON(v.toJSON()));this._setStopSymbol(r);const o=new dt(r),i=new ct((f=e.polygonBarriers)==null?void 0:f.map(v=>{const y=oe.fromJSON(v.toJSON());return y.symbol=this.defaultSymbols.polygonBarriers,y})),n=new yt((S=e.polylineBarriers)==null?void 0:S.map(v=>{const y=se.fromJSON(v.toJSON());return y.symbol=this.defaultSymbols.polylineBarriers,y})),d=new ut((a=e.pointBarriers)==null?void 0:a.map(v=>{const y=re.fromJSON(v.toJSON());return y.symbol=this.defaultSymbols.pointBarriers,y})),u=de.fromJSON(e.routeResults[0].route.toJSON());u.symbol=this.defaultSymbols.routeInfo;const p=new zr((b=e.routeResults[0].directionPoints)==null?void 0:b.features.map(v=>{const y=le.fromJSON(v.toJSON());return y.symbol=this.defaultSymbols.directionPoints,y}));return{directionLines:new Zr(($=e.routeResults[0].directionLines)==null?void 0:$.features.map(v=>{const y=ae.fromJSON(v.toJSON());return y.symbol=this.defaultSymbols.directionLines,y})),directionPoints:p,pointBarriers:d,polygonBarriers:i,polylineBarriers:n,routeInfo:u,stops:o}}_writeDirectionLines(){return this._writeNetworkFeatures(this.directionLines,this.defaultSymbols.directionLines,"esriGeometryPolyline",ae.fields,ae.popupInfo,"DirectionLines","Direction Lines")}_writeDirectionPoints(){return this._writeNetworkFeatures(this.directionPoints,this.defaultSymbols.directionPoints,"esriGeometryPoint",le.fields,le.popupInfo,"DirectionPoints","Direction Points")}_writeNetworkFeatures(e,r,o,i,n,d,u){if(A(e)||!e.length)return null;const p=this.spatialReference.toJSON(),{fullExtent:f,maxScale:S,minScale:a}=this;return{featureSet:{features:e.toArray().map(b=>qr(b)),geometryType:o,spatialReference:p},layerDefinition:{capabilities:"Query,Update,Editing",drawingInfo:{renderer:{type:"simple",symbol:h(r)?r.toJSON():Ae(o)}},extent:f.toJSON(),fields:i,geometryType:o,hasM:!1,hasZ:!1,maxScale:S,minScale:a,name:d,objectIdField:"ObjectID",spatialReference:p,title:u,type:"Feature Layer",typeIdField:""},popupInfo:n}}_writePointBarriers(){return this._writeNetworkFeatures(this.pointBarriers,this.defaultSymbols.pointBarriers,"esriGeometryPoint",re.fields,re.popupInfo,"Barriers","Point Barriers")}_writePolygonBarriers(){return this._writeNetworkFeatures(this.polygonBarriers,this.defaultSymbols.polygonBarriers,"esriGeometryPolygon",oe.fields,oe.popupInfo,"PolygonBarriers","Polygon Barriers")}_writePolylineBarriers(){return this._writeNetworkFeatures(this.polylineBarriers,this.defaultSymbols.polylineBarriers,"esriGeometryPolyline",se.fields,se.popupInfo,"PolylineBarriers","Line Barriers")}_writeRouteInfo(){return this._writeNetworkFeatures(h(this.routeInfo)?new C([this.routeInfo]):null,this.defaultSymbols.routeInfo,"esriGeometryPolyline",de.fields,de.popupInfo,"RouteInfo","Route Details")}_writeStops(){const e=this._writeNetworkFeatures(this.stops,null,"esriGeometryPoint",ie.fields,ie.popupInfo,"Stops","Stops");if(A(e))return null;const{stops:r}=this.defaultSymbols,o=h(r)&&h(r.first)&&r.first.toJSON(),i=h(r)&&h(r.middle)&&r.middle.toJSON(),n=h(r)&&h(r.last)&&r.last.toJSON();return e.layerDefinition.drawingInfo.renderer={type:"uniqueValue",field1:"Sequence",defaultSymbol:i,uniqueValueInfos:[{value:"1",symbol:o,label:"First Stop"},{value:`${this.stops.length}`,symbol:n,label:"Last Stop"}]},e}};t([s({readOnly:!0,json:{read:!1,origins:{"portal-item":{write:{allowNull:!0,ignoreOrigin:!0}},"web-map":{write:{overridePolicy(){return{allowNull:!0,ignoreOrigin:this.portalItem==null}}}}}}})],T.prototype,"_featureCollection",void 0),t([V(["web-map","portal-item"],"_featureCollection")],T.prototype,"writeFeatureCollectionWebmap",null),t([s({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{target:"type",overridePolicy(){return{ignoreOrigin:this.portalItem!=null}}}}}}})],T.prototype,"_type",void 0),t([s({nonNullable:!0,type:bt})],T.prototype,"defaultSymbols",void 0),t([s({readOnly:!0})],T.prototype,"directionLines",void 0),t([j(["web-map","portal-item"],"directionLines",["layers","featureCollection.layers"])],T.prototype,"readDirectionLines",null),t([s({readOnly:!0})],T.prototype,"directionPoints",void 0),t([j(["web-map","portal-item"],"directionPoints",["layers","featureCollection.layers"])],T.prototype,"readDirectionPoints",null),t([s({readOnly:!0,json:{read:!1,origins:{"web-map":{write:{ignoreOrigin:!0}}}}})],T.prototype,"featureCollectionType",void 0),t([s({readOnly:!0})],T.prototype,"fullExtent",null),t([s({json:{origins:{"web-map":{name:"featureCollection.showLegend"}},write:!0}})],T.prototype,"legendEnabled",void 0),t([s({type:["show","hide"]})],T.prototype,"listMode",void 0),t([s({type:Number,nonNullable:!0,json:{write:!1}})],T.prototype,"maxScale",void 0),t([j(["web-map","portal-item"],"maxScale",["layers","featureCollection.layers"])],T.prototype,"readMaxScale",null),t([s({type:Number,nonNullable:!0,json:{write:!1}})],T.prototype,"minScale",void 0),t([j(["web-map","portal-item"],"minScale",["layers","featureCollection.layers"])],T.prototype,"readMinScale",null),t([s({type:["ArcGISFeatureLayer"],value:"ArcGISFeatureLayer"})],T.prototype,"operationalLayerType",void 0),t([s({nonNullable:!0,type:C.ofType(re)})],T.prototype,"pointBarriers",void 0),t([j(["web-map","portal-item"],"pointBarriers",["layers","featureCollection.layers"])],T.prototype,"readPointBarriers",null),t([s({nonNullable:!0,type:C.ofType(oe)})],T.prototype,"polygonBarriers",void 0),t([j(["web-map","portal-item"],"polygonBarriers",["layers","featureCollection.layers"])],T.prototype,"readPolygonBarriers",null),t([s({nonNullable:!0,type:C.ofType(se)})],T.prototype,"polylineBarriers",void 0),t([j(["web-map","portal-item"],"polylineBarriers",["layers","featureCollection.layers"])],T.prototype,"readPolylineBarriers",null),t([s({readOnly:!0})],T.prototype,"routeInfo",void 0),t([j(["web-map","portal-item"],"routeInfo",["layers","featureCollection.layers"])],T.prototype,"readRouteInfo",null),t([s({type:H})],T.prototype,"spatialReference",void 0),t([j(["web-map","portal-item"],"spatialReference",["layers","featureCollection.layers"])],T.prototype,"readSpatialReference",null),t([s({nonNullable:!0,type:C.ofType(ie)})],T.prototype,"stops",void 0),t([j(["web-map","portal-item"],"stops",["layers","featureCollection.layers"])],T.prototype,"readStops",null),t([s()],T.prototype,"title",null),t([s({readOnly:!0,json:{read:!1}})],T.prototype,"type",void 0),t([s()],T.prototype,"url",null),T=t([O($t)],T);const Yr=T;export{Yr as default}; diff --git a/assets/RouteLayerView2D.4c625030.js b/assets/RouteLayerView2D.3761d027.js similarity index 77% rename from assets/RouteLayerView2D.4c625030.js rename to assets/RouteLayerView2D.3761d027.js index 562a0d6..4b07022 100644 --- a/assets/RouteLayerView2D.4c625030.js +++ b/assets/RouteLayerView2D.3761d027.js @@ -1 +1 @@ -import{cE as l,ee as m,c as a,$ as u,j as _,_ as g,a6 as p,a7 as d,a8 as w}from"./index.d94abe07.js";import{b as y,h as f,O as k,g as v,f as M,a as I,D as V}from"./Stop.a3532add.js";import{y as G,u as F}from"./LayerView.42d17220.js";import{i as H}from"./GraphicContainer.618d10e5.js";import{o as C}from"./BaseGraphicContainer.6b1c597d.js";import"./utils.4b023c9d.js";import"./Utils.7f6f3a6b.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.229b1dd6.js";import"./ExpandedCIM.f0b7f36d.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.0d428d19.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.df11258c.js";import"./normalizeUtilsSync.757b5fd1.js";import"./projectionSupport.0542c13b.js";import"./json.879c9adc.js";import"./VertexArrayObject.a4c1d809.js";import"./FeatureContainer.4ca52b51.js";import"./TileContainer.8b7fafe2.js";import"./WGLContainer.1850619d.js";import"./pixelUtils.82950e1a.js";import"./ProgramTemplate.e9a5aa54.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./visualVariablesUtils.32e27706.js";import"./visualVariablesUtils.aff73e6d.js";import"./Matcher.fe0c3dcf.js";import"./tileUtils.44921ab9.js";import"./TileClipper.8c399a8a.js";import"./Geometry.d049a63c.js";import"./devEnvironmentUtils.d8d0484c.js";import"./schemaUtils.69ad92d2.js";import"./createSymbolSchema.e54d2060.js";import"./util.ab699fea.js";import"./ComputedAttributeStorage.c1cb22b3.js";import"./centroid.cc817cc5.js";import"./vec3f32.1121a836.js";const b=Object.freeze({remove(){},pause(){},resume(){}}),U=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],h={graphic:null,property:null,oldValue:null,newValue:null};function c(t){return t instanceof y||t instanceof f||t instanceof k||t instanceof v||t instanceof M||t instanceof I||t instanceof V}function $(t){return l.isCollection(t)&&t.length&&c(t.getItemAt(0))}function A(t){return Array.isArray(t)&&t.length&&c(t[0])}let o=class extends G(F){constructor(){super(...arguments),this._graphics=new l,this._highlightIds=new Map,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map}get _routeItems(){return new m({getCollections:()=>a(this.layer)&&!this.destroyed?[a(this.layer.routeInfo)?new l([this.layer.routeInfo]):null,this.layer.directionLines,this.layer.directionPoints,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.pointBarriers,this.layer.stops]:[]})}initialize(){this.updatingHandles.addOnCollectionChange(()=>this._routeItems,t=>this._routeItemsChanged(t),u)}destroy(){var t;this.handles.removeAll(),this.updatingHandles.removeAll(),this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),(t=this._get("_routeItems"))==null||t.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView()}async fetchPopupFeatures(t){return this._graphicsView.hitTest(t).filter(e=>!!e.popupTemplate)}highlight(t){let e;e=c(t)?[this._getNetworkFeatureUid(t)]:A(t)?t.map(r=>this._getNetworkFeatureUid(r)):$(t)?t.map(r=>this._getNetworkFeatureUid(r)).toArray():[t.uid];const i=e.filter(a);return i.length?(this._addHighlight(i),{remove:()=>this._removeHighlight(i)}):b}async hitTest(t,e){if(this.suspended)return null;const i=this._graphicsView.hitTest(t).filter(a).map(s=>this._networkGraphicMap.get(s));if(!i.length)return null;const{layer:r}=this;return i.reverse().map(s=>({type:"route",layer:r,mapPoint:t,networkFeature:s}))}isUpdating(){return this._graphicsView.updating}moveStart(){}moveEnd(){}update(t){this._graphicsView.processUpdate(t)}viewChange(){this._graphicsView.viewChange()}_addHighlight(t){for(const e of t)if(this._highlightIds.has(e)){const i=this._highlightIds.get(e);this._highlightIds.set(e,i+1)}else this._highlightIds.set(e,1);this._updateHighlight()}_createGraphic(t){const e=t.toGraphic();return e.layer=this.layer,e.sourceLayer=this.layer,e}_createGraphicsView(){const t=this.view,e=()=>this.requestUpdate(),i=new H(t.featuresTilingScheme);this._graphicsView=new C({container:i,graphics:this._graphics,requestUpdateCallback:e,view:t}),this.container.addChild(i),this._updateHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(t){const e=this._networkGraphicMap.get(t);return U.indexOf(e.type)}_getNetworkFeatureUid(t){return this._networkFeatureMap.has(t)?this._networkFeatureMap.get(t).uid:null}_removeHighlight(t){for(const e of t)if(this._highlightIds.has(e)){const i=this._highlightIds.get(e)-1;i===0?this._highlightIds.delete(e):this._highlightIds.set(e,i)}this._updateHighlight()}_routeItemsChanged(t){if(t.removed.length){this._graphics.removeMany(t.removed.map(e=>{const i=this._networkFeatureMap.get(e);return this._networkFeatureMap.delete(e),this._networkGraphicMap.delete(i),i}));for(const e of t.removed)this.handles.remove(e)}if(t.added.length){this._graphics.addMany(t.added.map(e=>{const i=this._createGraphic(e);return _(i.symbol)?null:(this._networkFeatureMap.set(e,i),this._networkGraphicMap.set(i,e),i)}).filter(a));for(const e of t.added)this.handles.add([g(()=>e.geometry,(i,r)=>{this._updateGraphic(e,"geometry",i,r)}),g(()=>e.symbol,(i,r)=>{this._updateGraphic(e,"symbol",i,r)})],e);this._graphics.sort((e,i)=>this._getDrawOrder(e)-this._getDrawOrder(i))}}_updateGraphic(t,e,i,r){if(!this._networkFeatureMap.has(t)){const n=this._createGraphic(t);return this._networkFeatureMap.set(t,n),this._networkGraphicMap.set(n,t),void this._graphics.add(n)}const s=this._networkFeatureMap.get(t);s[e]=i,h.graphic=s,h.property=e,h.oldValue=r,h.newValue=i,this._graphicsView.graphicUpdateHandler(h)}_updateHighlight(){const t=Array.from(this._highlightIds.keys());this._graphicsView.setHighlight(t)}};p([d()],o.prototype,"_graphics",void 0),p([d()],o.prototype,"_routeItems",null),o=p([w("esri.views.2d.layers.RouteLayerView2D")],o);const It=o;export{It as default}; +import{cE as l,ee as m,c as a,$ as u,j as _,_ as g,a6 as p,a7 as d,a8 as w}from"./index.221827cd.js";import{b as y,h as f,O as k,g as v,f as M,a as I,D as V}from"./Stop.6862dd5a.js";import{y as G,u as F}from"./LayerView.ce6e0535.js";import{i as H}from"./GraphicContainer.b0be80ad.js";import{o as C}from"./BaseGraphicContainer.7704bbc1.js";import"./utils.0160becb.js";import"./Utils.2136650a.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.0cadabc1.js";import"./ExpandedCIM.a372ce74.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.7ff797cc.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.3f71f8e9.js";import"./normalizeUtilsSync.4d52fbd0.js";import"./projectionSupport.4f5da4af.js";import"./json.879c9adc.js";import"./VertexArrayObject.53cf1857.js";import"./FeatureContainer.b427dd87.js";import"./TileContainer.5aeb32d6.js";import"./WGLContainer.347cc5cd.js";import"./pixelUtils.9c6f8dae.js";import"./ProgramTemplate.cf9dd4e8.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./visualVariablesUtils.061b7a4e.js";import"./visualVariablesUtils.62efda9d.js";import"./Matcher.6586928a.js";import"./tileUtils.332711ed.js";import"./TileClipper.77103a2e.js";import"./Geometry.d049a63c.js";import"./devEnvironmentUtils.d8d0484c.js";import"./schemaUtils.d20994fa.js";import"./createSymbolSchema.827eb617.js";import"./util.520a352e.js";import"./ComputedAttributeStorage.29767acd.js";import"./centroid.06db4b74.js";import"./vec3f32.1121a836.js";const b=Object.freeze({remove(){},pause(){},resume(){}}),U=["route-info","direction-line","direction-point","polygon-barrier","polyline-barrier","point-barrier","stop"],h={graphic:null,property:null,oldValue:null,newValue:null};function c(t){return t instanceof y||t instanceof f||t instanceof k||t instanceof v||t instanceof M||t instanceof I||t instanceof V}function $(t){return l.isCollection(t)&&t.length&&c(t.getItemAt(0))}function A(t){return Array.isArray(t)&&t.length&&c(t[0])}let o=class extends G(F){constructor(){super(...arguments),this._graphics=new l,this._highlightIds=new Map,this._networkFeatureMap=new Map,this._networkGraphicMap=new Map}get _routeItems(){return new m({getCollections:()=>a(this.layer)&&!this.destroyed?[a(this.layer.routeInfo)?new l([this.layer.routeInfo]):null,this.layer.directionLines,this.layer.directionPoints,this.layer.polygonBarriers,this.layer.polylineBarriers,this.layer.pointBarriers,this.layer.stops]:[]})}initialize(){this.updatingHandles.addOnCollectionChange(()=>this._routeItems,t=>this._routeItemsChanged(t),u)}destroy(){var t;this.handles.removeAll(),this.updatingHandles.removeAll(),this._networkFeatureMap.clear(),this._networkGraphicMap.clear(),this._graphics.removeAll(),(t=this._get("_routeItems"))==null||t.destroy()}attach(){this._createGraphicsView()}detach(){this._destroyGraphicsView()}async fetchPopupFeatures(t){return this._graphicsView.hitTest(t).filter(e=>!!e.popupTemplate)}highlight(t){let e;e=c(t)?[this._getNetworkFeatureUid(t)]:A(t)?t.map(r=>this._getNetworkFeatureUid(r)):$(t)?t.map(r=>this._getNetworkFeatureUid(r)).toArray():[t.uid];const i=e.filter(a);return i.length?(this._addHighlight(i),{remove:()=>this._removeHighlight(i)}):b}async hitTest(t,e){if(this.suspended)return null;const i=this._graphicsView.hitTest(t).filter(a).map(s=>this._networkGraphicMap.get(s));if(!i.length)return null;const{layer:r}=this;return i.reverse().map(s=>({type:"route",layer:r,mapPoint:t,networkFeature:s}))}isUpdating(){return this._graphicsView.updating}moveStart(){}moveEnd(){}update(t){this._graphicsView.processUpdate(t)}viewChange(){this._graphicsView.viewChange()}_addHighlight(t){for(const e of t)if(this._highlightIds.has(e)){const i=this._highlightIds.get(e);this._highlightIds.set(e,i+1)}else this._highlightIds.set(e,1);this._updateHighlight()}_createGraphic(t){const e=t.toGraphic();return e.layer=this.layer,e.sourceLayer=this.layer,e}_createGraphicsView(){const t=this.view,e=()=>this.requestUpdate(),i=new H(t.featuresTilingScheme);this._graphicsView=new C({container:i,graphics:this._graphics,requestUpdateCallback:e,view:t}),this.container.addChild(i),this._updateHighlight()}_destroyGraphicsView(){this.container.removeChild(this._graphicsView.container),this._graphicsView.destroy()}_getDrawOrder(t){const e=this._networkGraphicMap.get(t);return U.indexOf(e.type)}_getNetworkFeatureUid(t){return this._networkFeatureMap.has(t)?this._networkFeatureMap.get(t).uid:null}_removeHighlight(t){for(const e of t)if(this._highlightIds.has(e)){const i=this._highlightIds.get(e)-1;i===0?this._highlightIds.delete(e):this._highlightIds.set(e,i)}this._updateHighlight()}_routeItemsChanged(t){if(t.removed.length){this._graphics.removeMany(t.removed.map(e=>{const i=this._networkFeatureMap.get(e);return this._networkFeatureMap.delete(e),this._networkGraphicMap.delete(i),i}));for(const e of t.removed)this.handles.remove(e)}if(t.added.length){this._graphics.addMany(t.added.map(e=>{const i=this._createGraphic(e);return _(i.symbol)?null:(this._networkFeatureMap.set(e,i),this._networkGraphicMap.set(i,e),i)}).filter(a));for(const e of t.added)this.handles.add([g(()=>e.geometry,(i,r)=>{this._updateGraphic(e,"geometry",i,r)}),g(()=>e.symbol,(i,r)=>{this._updateGraphic(e,"symbol",i,r)})],e);this._graphics.sort((e,i)=>this._getDrawOrder(e)-this._getDrawOrder(i))}}_updateGraphic(t,e,i,r){if(!this._networkFeatureMap.has(t)){const n=this._createGraphic(t);return this._networkFeatureMap.set(t,n),this._networkGraphicMap.set(n,t),void this._graphics.add(n)}const s=this._networkFeatureMap.get(t);s[e]=i,h.graphic=s,h.property=e,h.oldValue=r,h.newValue=i,this._graphicsView.graphicUpdateHandler(h)}_updateHighlight(){const t=Array.from(this._highlightIds.keys());this._graphicsView.setHighlight(t)}};p([d()],o.prototype,"_graphics",void 0),p([d()],o.prototype,"_routeItems",null),o=p([w("esri.views.2d.layers.RouteLayerView2D")],o);const It=o;export{It as default}; diff --git a/assets/SSAO.glsl.1592f040.js b/assets/SSAO.glsl.1592f040.js new file mode 100644 index 0000000..94fdf52 --- /dev/null +++ b/assets/SSAO.glsl.1592f040.js @@ -0,0 +1 @@ +import"./index.221827cd.js";import{d as z}from"./objectResourceUtils.dfe6cb73.js";import"./VertexAttribute.42396f25.js";import"./devEnvironmentUtils.d8d0484c.js";import"./mat3f64.6d32a1d7.js";import"./mat4f64.ff2a477c.js";import"./BufferView.6eee27cd.js";import"./vec33.46fc6802.js";import"./DefaultMaterial_COLOR_GAMMA.8ee780a2.js";import"./types.44c7402c.js";import"./enums.2d9e6f64.js";import"./Version.433fbe58.js";import"./quat.d9562009.js";import"./quatf64.4ae3e6f1.js";import"./requestImageUtils.1f5d4b6d.js";import"./OrderIndependentTransparency.4d1575c0.js";import"./Util.f17667f9.js";import"./sphere.f99ddb50.js";import"./Texture.940076b2.js";import"./VertexArrayObject.53cf1857.js";import"./VertexElementDescriptor.1fdca6da.js";import"./InterleavedLayout.30cdc193.js";import"./vec3f32.1121a836.js";import"./symbolColorUtils.36aaa708.js";export{z as build}; diff --git a/assets/SSAO.glsl.e631cc39.js b/assets/SSAO.glsl.e631cc39.js deleted file mode 100644 index 2d1ea20..0000000 --- a/assets/SSAO.glsl.e631cc39.js +++ /dev/null @@ -1 +0,0 @@ -import"./index.d94abe07.js";import{d as z}from"./objectResourceUtils.996108d7.js";import"./VertexAttribute.42396f25.js";import"./devEnvironmentUtils.d8d0484c.js";import"./mat3f64.6d32a1d7.js";import"./mat4f64.ff2a477c.js";import"./BufferView.89055914.js";import"./vec33.4564cd5b.js";import"./DefaultMaterial_COLOR_GAMMA.bf8213a8.js";import"./types.44c7402c.js";import"./enums.2d9e6f64.js";import"./Version.59f2da65.js";import"./quat.b3994f2f.js";import"./quatf64.4ae3e6f1.js";import"./requestImageUtils.7b09b5e8.js";import"./OrderIndependentTransparency.4d1575c0.js";import"./Util.ea9235b8.js";import"./sphere.ec1f4496.js";import"./Texture.4c97bad5.js";import"./VertexArrayObject.a4c1d809.js";import"./VertexElementDescriptor.1fdca6da.js";import"./InterleavedLayout.f9d79992.js";import"./vec3f32.1121a836.js";import"./symbolColorUtils.d5fe1bd7.js";export{z as build}; diff --git a/assets/SSAOBlur.glsl.1501066c.js b/assets/SSAOBlur.glsl.1501066c.js deleted file mode 100644 index 50ff578..0000000 --- a/assets/SSAOBlur.glsl.1501066c.js +++ /dev/null @@ -1 +0,0 @@ -import"./index.d94abe07.js";import{c as z}from"./objectResourceUtils.996108d7.js";import"./VertexAttribute.42396f25.js";import"./devEnvironmentUtils.d8d0484c.js";import"./mat3f64.6d32a1d7.js";import"./mat4f64.ff2a477c.js";import"./BufferView.89055914.js";import"./vec33.4564cd5b.js";import"./DefaultMaterial_COLOR_GAMMA.bf8213a8.js";import"./types.44c7402c.js";import"./enums.2d9e6f64.js";import"./Version.59f2da65.js";import"./quat.b3994f2f.js";import"./quatf64.4ae3e6f1.js";import"./requestImageUtils.7b09b5e8.js";import"./OrderIndependentTransparency.4d1575c0.js";import"./Util.ea9235b8.js";import"./sphere.ec1f4496.js";import"./Texture.4c97bad5.js";import"./VertexArrayObject.a4c1d809.js";import"./VertexElementDescriptor.1fdca6da.js";import"./InterleavedLayout.f9d79992.js";import"./vec3f32.1121a836.js";import"./symbolColorUtils.d5fe1bd7.js";export{z as build}; diff --git a/assets/SSAOBlur.glsl.7f71e6b4.js b/assets/SSAOBlur.glsl.7f71e6b4.js new file mode 100644 index 0000000..1d997f9 --- /dev/null +++ b/assets/SSAOBlur.glsl.7f71e6b4.js @@ -0,0 +1 @@ +import"./index.221827cd.js";import{c as z}from"./objectResourceUtils.dfe6cb73.js";import"./VertexAttribute.42396f25.js";import"./devEnvironmentUtils.d8d0484c.js";import"./mat3f64.6d32a1d7.js";import"./mat4f64.ff2a477c.js";import"./BufferView.6eee27cd.js";import"./vec33.46fc6802.js";import"./DefaultMaterial_COLOR_GAMMA.8ee780a2.js";import"./types.44c7402c.js";import"./enums.2d9e6f64.js";import"./Version.433fbe58.js";import"./quat.d9562009.js";import"./quatf64.4ae3e6f1.js";import"./requestImageUtils.1f5d4b6d.js";import"./OrderIndependentTransparency.4d1575c0.js";import"./Util.f17667f9.js";import"./sphere.f99ddb50.js";import"./Texture.940076b2.js";import"./VertexArrayObject.53cf1857.js";import"./VertexElementDescriptor.1fdca6da.js";import"./InterleavedLayout.30cdc193.js";import"./vec3f32.1121a836.js";import"./symbolColorUtils.36aaa708.js";export{z as build}; diff --git a/assets/SceneLayer.46cfbdf5.js b/assets/SceneLayer.4e29d3af.js similarity index 95% rename from assets/SceneLayer.46cfbdf5.js rename to assets/SceneLayer.4e29d3af.js index 7417912..df5583b 100644 --- a/assets/SceneLayer.46cfbdf5.js +++ b/assets/SceneLayer.4e29d3af.js @@ -1 +1 @@ -import{a6 as r,a7 as o,a8 as w,cx as R,iy as K,cE as j,az as I,dF as M,ii as O,jc as z,d2 as h,au as W,c$ as H,dz as Z,bY as B,j as g,U as D,eQ as Y,b4 as X,jI as ee,eE as te,eF as se,eG as re,i3 as ie,eH as oe,il as ae,c as p,ci as ne,iN as E,jJ as le,s as c,aU as pe,cC as de,dd as ye,dc as ue,n as d,d1 as ce,id as he,eP as fe,at as ge,i9 as me,e8 as x,x as ve,ds as we,jK as be,jL as Ie,ju as Le,io as Se,iP as Fe,iQ as je,iR as $,iE as _e,jM as Oe,ie as Ee,ig as xe,dv as $e,iU as Te,ih as Ae,cF as Pe}from"./index.d94abe07.js";import{N as Re,L as T}from"./SceneService.0f3bf01a.js";import{t as De,y as Ne,l as Ue}from"./FetchAssociatedFeatureLayer.7dd7fa59.js";import{s as N,l as qe,u as Ce,m as Qe}from"./I3SLayerDefinitions.96f4da60.js";import{g as Ge}from"./persistable.5f665309.js";import{d as ke,s as Ve}from"./popupUtils.4abb3ffd.js";import"./originUtils.2d0aad75.js";import"./multiOriginJSONSupportUtils.38b69b9c.js";import"./resourceUtils.6d10bf82.js";import"./mat3f64.6d32a1d7.js";import"./mat4f64.ff2a477c.js";import"./quat.b3994f2f.js";import"./quatf64.4ae3e6f1.js";import"./I3SBinaryReader.9c0bbe1b.js";import"./VertexAttribute.42396f25.js";import"./symbolColorUtils.d5fe1bd7.js";import"./vec3f32.1121a836.js";import"./plane.86573aee.js";import"./sphere.ec1f4496.js";let u=class extends R{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};r([o({type:String,json:{read:!0,write:!0}})],u.prototype,"name",void 0),r([o({type:String,json:{read:!0,write:!0}})],u.prototype,"field",void 0),r([o({type:[Number],json:{read:!0,write:!0}})],u.prototype,"currentRangeExtent",void 0),r([o({type:[Number],json:{read:!0,write:!0}})],u.prototype,"fullRangeExtent",void 0),r([o({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],u.prototype,"type",void 0),u=r([w("esri.layers.support.RangeInfo")],u);var v;let L=v=class extends K(j.ofType(I)){constructor(e){super(e)}clone(){return new v(this.items.map(e=>e.clone()))}write(e,t){return this.toJSON(t)}toJSON(e){var s;const t=(s=e==null?void 0:e.layer)==null?void 0:s.spatialReference;return t?this.toArray().map(a=>{if(!t.equals(a.spatialReference)){if(!M(a.spatialReference,t))return e&&e.messages&&e.messages.push(new O("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const l=new I;z(a,l,t),a=l}const n=a.toJSON(e);return delete n.spatialReference,n}).filter(a=>a!=null):(e!=null&&e.messages&&e.messages.push(new O("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map(a=>a.toJSON(e)))}static fromJSON(e,t){const s=new v;return e.forEach(a=>s.add(I.fromJSON(a,t))),s}};L=v=r([w("esri.layers.support.PolygonCollection")],L);const S=L;var F;let f=F=class extends R{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new S,this._geometriesSource=null,this._handles=new W}initialize(){this._handles.add(H(()=>this.geometries,"after-changes",()=>this.geometries=this.geometries,Z))}destroy(){this._handles.destroy()}readGeometries(e,t,s){this._geometriesSource={url:B(e,s),context:s}}async loadGeometries(e,t){if(g(this._geometriesSource))return;const{url:s,context:a}=this._geometriesSource,n=await D(s,{responseType:"json",signal:Y(t,"signal")}),l=e.toJSON(),y=n.data.map(b=>({...b,spatialReference:l}));this.geometries=S.fromJSON(y,a),this._geometriesSource=null}clone(){return new F({geometries:X(this.geometries),spatialRelationship:this.spatialRelationship})}};r([o({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],f.prototype,"spatialRelationship",void 0),r([o({type:S,nonNullable:!0,json:{write:!0}}),Ge({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries"})],f.prototype,"geometries",void 0),r([h(["web-scene","portal-item"],"geometries")],f.prototype,"readGeometries",null),f=F=r([w("esri.layers.support.SceneFilter")],f);const Je=f,Ke=["3DObject","Point"],A=Ae();let i=class extends ee(Re(te(se(re(ie(oe(ae(Pe)))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new j,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){var a,n,l,y;const s=(n=(a=this.getFeatureType(t==null?void 0:t.feature))==null?void 0:a.domains)==null?void 0:n[e];return s&&s.type!=="inherited"?s:(y=(l=this.getField(e))==null?void 0:l.domain)!=null?y:null}getFeatureType(e){return e!=null&&p(this.associatedLayer)?this.associatedLayer.getFeatureType(e):null}get types(){var e;return p(this.associatedLayer)?(e=this.associatedLayer.types)!=null?e:[]:[]}get typeIdField(){return p(this.associatedLayer)?this.associatedLayer.typeIdField:null}get formTemplate(){return p(this.associatedLayer)?this.associatedLayer.formTemplate:null}get fieldsIndex(){return new ne(this.fields)}readNodePages(e,t,s){return t.layerType==="Point"&&(e=t.pointNodePages),e==null||typeof e!="object"?null:N.fromJSON(e,s)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get geometryType(){return Me[this.profile]||"mesh"}set renderer(e){E(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return e!=null&&typeof e=="object"||(e={}),e.color==null&&(e.color=!1),e}get capabilities(){const e=p(this.associatedLayer)&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:De,{query:t,editing:{supportsGlobalId:s,supportsRollbackOnFailure:a,supportsUploadWithItemId:n,supportsReturnServiceEditsInSourceSpatialReference:l},data:{supportsZ:y,supportsM:b,isVersioned:U,supportsAttachment:q},operations:{supportsEditing:C,supportsAdd:Q,supportsUpdate:G,supportsDelete:k,supportsQuery:V,supportsQueryAttachments:J}}=e,m=e.operations.supportsChangeTracking,_=le();return{query:t,editing:{supportsGlobalId:s,supportsReturnServiceEditsInSourceSpatialReference:l,supportsRollbackOnFailure:a,supportsGeometryUpdate:!1,supportsUploadWithItemId:n},data:{supportsAttachment:q,supportsZ:y,supportsM:b,isVersioned:U},operations:{supportsQuery:V,supportsQueryAttachments:J,supportsEditing:C&&m,supportsAdd:_&&Q&&m,supportsDelete:_&&k&&m,supportsUpdate:G&&m}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return p(this.associatedLayer)?this.associatedLayer.infoFor3D:null}get defaultPopupTemplate(){return p(this.associatedLayer)||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(s=>(s.type==="esriFieldTypeOID"&&(e=s.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(s=>(s.type==="esriFieldTypeGlobalID"&&(e=s.name),!!e)),e||void 0}get displayField(){return p(this.associatedLayer)?this.associatedLayer.displayField:null}readProfile(e,t){const s=t.store.profile;return s!=null&&P[s]?P[s]:(c.getLogger(this.declaredClass).error("Unknown or missing profile",{profile:s,layer:this}),"mesh-pyramids")}load(e){const t=p(e)?e.signal:null,s=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(pe).then(()=>this._fetchService(t)).then(()=>Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),p(this.filter)?this.filter.loadGeometries(this.spatialReference):null])).then(()=>this._validateElevationInfo()).then(()=>this._applyAssociatedLayerOverrides()).then(()=>this._populateFieldUsageInfo()).then(()=>de(this,{origin:"service"},t)).then(()=>E(this.renderer,this.fieldsIndex)).then(()=>this.finishLoadEditablePortalLayer(e));return this.addResolvingPromise(s),Promise.resolve(this)}async beforeSave(){p(this.filter)&&await this.load()}createQuery(){const e=new ye;return this.geometryType!=="mesh"&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(s=>s.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(s=>s.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(s=>s.queryFeatures(e||this.createQuery(),t)).then(s=>{if(s!=null&&s.features)for(const a of s.features)a.layer=this,a.sourceLayer=this;return s})}async queryCachedAttributes(e,t){const s=ue(this.fieldsIndex,await ke(this,Ve(this)));return Ne(this.parsedUrl.path,this.attributeStorageInfo,e,t,s)}async queryCachedFeature(e,t){const s=await this.queryCachedAttributes(e,[t]);if(!s||s.length===0)throw new d("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const a=new ce;return a.attributes=s[0],a.layer=this,a.sourceLayer=this,a}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(s=>s.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(s=>s.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(c.getLogger(this.declaredClass).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return he(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return p(e)&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),g(this.associatedLayer))throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new d("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return this.statisticsInfo!=null&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){if(await this.load(t),!this.statisticsInfo)throw new d("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const s=this.fieldsIndex.get(e);if(!s)throw new d("scenelayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const a of this.statisticsInfo)if(a.name===s.name){const n=fe(this.parsedUrl.path,a.href);return D(n,{query:{f:"json",token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then(l=>l.data)}throw new d("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(T.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(T.SAVE,e)}async applyEdits(e,t){const s=await ge(()=>import("./editingSupport.b066c126.js"),["assets/editingSupport.b066c126.js","assets/index.d94abe07.js","assets/index.f5419ca5.css"]);if(await this.load(),g(this.associatedLayer))throw new d(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),s.applyEdits(this,this.associatedLayer.source,e,t)}on(e,t){return super.on(e,t)}validateLayer(e){if(e.layerType&&!Ke.includes(e.layerType))throw new d("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new d("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new d("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(s,a){let n=!1,l=!1;if(s==null)n=!0,l=!0;else{const y=a&&a.isGeographic;switch(s){case"east-north-up":case"earth-centered":n=!0,l=y;break;case"vertex-reference-frame":n=!0,l=!y;break;default:n=!1}}if(!n)throw new d("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!l)throw new d("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if(this.profile==="points")e.push("Point");else{if(this.profile!=="mesh-pyramids")throw new d("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some(n=>n.name===e.name)),s=!!(p(this.associatedLayer)&&this.associatedLayer.fields&&this.associatedLayer.fields.some(n=>n&&e.name===n.name)),a={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||s,supportsLayerQuery:s};this._fieldUsageInfo[e.name]=a}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides()}_applyAssociatedLayerFieldsOverrides(){if(g(this.associatedLayer)||!this.associatedLayer.fields)return;let e=null;for(const t of this.associatedLayer.fields){const s=this.getField(t.name);s?(!s.domain&&t.domain&&(s.domain=t.domain.clone()),s.editable=t.editable,s.nullable=t.nullable,s.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(g(this.associatedLayer))return;const e=["popupTemplate","popupEnabled"],t=me(this);for(let s=0;sthis.popupEnabled&&this.popupTemplate!=null);const e=`this SceneLayer: ${this.title}`;this.attributeStorageInfo==null?c.getLogger(this.declaredClass).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):c.getLogger(this.declaredClass).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;e&&(this.profile==="mesh-pyramids"&&e.mode==="relative-to-scene"&&c.getLogger(this.declaredClass).warn(".elevationInfo=","Mesh scene layers don't support relative-to-scene elevation mode"),e.featureExpressionInfo&&e.featureExpressionInfo.expression!=="0"&&c.getLogger(this.declaredClass).warn(".elevationInfo=","Scene layers do not support featureExpressionInfo"))}};r([o({types:{key:"type",base:be,typeMap:{selection:Ie}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],i.prototype,"featureReduction",void 0),r([o({type:[u],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],i.prototype,"rangeInfos",void 0),r([o({json:{read:!1}})],i.prototype,"associatedLayer",void 0),r([o({type:["show","hide"]})],i.prototype,"listMode",void 0),r([o({type:["ArcGISSceneServiceLayer"]})],i.prototype,"operationalLayerType",void 0),r([o({json:{read:!1},readOnly:!0})],i.prototype,"type",void 0),r([o({...A.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],i.prototype,"fields",void 0),r([o()],i.prototype,"types",null),r([o()],i.prototype,"typeIdField",null),r([o()],i.prototype,"formTemplate",null),r([o({readOnly:!0})],i.prototype,"fieldsIndex",null),r([o({type:Le,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],i.prototype,"floorInfo",void 0),r([o(A.outFields)],i.prototype,"outFields",void 0),r([o({type:N,readOnly:!0,json:{read:!1}})],i.prototype,"nodePages",void 0),r([h("service","nodePages",["nodePages","pointNodePages"])],i.prototype,"readNodePages",null),r([o({type:[qe],readOnly:!0})],i.prototype,"materialDefinitions",void 0),r([o({type:[Ce],readOnly:!0})],i.prototype,"textureSetDefinitions",void 0),r([o({type:[Qe],readOnly:!0})],i.prototype,"geometryDefinitions",void 0),r([o({readOnly:!0})],i.prototype,"serviceUpdateTimeStamp",void 0),r([o({readOnly:!0})],i.prototype,"attributeStorageInfo",void 0),r([o({readOnly:!0})],i.prototype,"statisticsInfo",void 0),r([o({type:j.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],i.prototype,"excludeObjectIds",void 0),r([o({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),r([o({type:Je,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],i.prototype,"filter",void 0),r([o({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],i.prototype,"path",void 0),r([o(Se)],i.prototype,"elevationInfo",null),r([o({type:String})],i.prototype,"geometryType",null),r([o(Fe)],i.prototype,"labelsVisible",void 0),r([o({type:[je],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:$},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:$},write:!0}})],i.prototype,"labelingInfo",void 0),r([o(_e)],i.prototype,"legendEnabled",void 0),r([o({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){var a,n;if(typeof e=="number"&&e>=0&&e<=1)return e;const s=(n=(a=t.layerDefinition)==null?void 0:a.drawingInfo)==null?void 0:n.transparency;return s!==void 0?Oe(s):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],i.prototype,"opacity",void 0),r([o({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],i.prototype,"priority",void 0),r([o({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],i.prototype,"semantic",void 0),r([o({types:Ee,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],i.prototype,"renderer",null),r([o({json:{read:!1}})],i.prototype,"cachedDrawingInfo",void 0),r([h("service","cachedDrawingInfo")],i.prototype,"readCachedDrawingInfo",null),r([o({readOnly:!0,json:{read:!1}})],i.prototype,"capabilities",null),r([o({type:Boolean,json:{read:!1}})],i.prototype,"editingEnabled",null),r([o({readOnly:!0,json:{write:!1,read:!1}})],i.prototype,"infoFor3D",null),r([o(xe)],i.prototype,"popupEnabled",void 0),r([o({type:$e,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),r([o({readOnly:!0,json:{read:!1}})],i.prototype,"defaultPopupTemplate",null),r([o({type:String,json:{read:!1}})],i.prototype,"objectIdField",void 0),r([h("service","objectIdField",["objectIdField","fields"])],i.prototype,"readObjectIdField",null),r([o({type:String,json:{read:!1}})],i.prototype,"globalIdField",void 0),r([h("service","globalIdField",["globalIdField","fields"])],i.prototype,"readGlobalIdField",null),r([o({readOnly:!0,type:String,json:{read:!1}})],i.prototype,"displayField",null),r([o({type:String,json:{read:!1}})],i.prototype,"profile",void 0),r([h("service","profile",["store.profile"])],i.prototype,"readProfile",null),r([o({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],i.prototype,"normalReferenceFrame",void 0),r([o(Te)],i.prototype,"screenSizePerspectiveEnabled",void 0),i=r([w("esri.layers.SceneLayer")],i);const P={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Me={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"},ut=i;export{ut as default}; +import{a6 as r,a7 as o,a8 as w,cx as R,iy as K,cE as j,az as I,dF as M,ii as O,jc as z,d2 as h,au as W,c$ as H,dz as Z,bY as B,j as g,U as D,eQ as Y,b4 as X,jI as ee,eE as te,eF as se,eG as re,i3 as ie,eH as oe,il as ae,c as p,ci as ne,iN as E,jJ as le,s as c,aU as pe,cC as de,dd as ye,dc as ue,n as d,d1 as ce,id as he,eP as fe,at as ge,i9 as me,e8 as x,x as ve,ds as we,jK as be,jL as Ie,ju as Le,io as Se,iP as Fe,iQ as je,iR as $,iE as _e,jM as Oe,ie as Ee,ig as xe,dv as $e,iU as Te,ih as Ae,cF as Pe}from"./index.221827cd.js";import{N as Re,L as T}from"./SceneService.9c2e5b40.js";import{t as De,y as Ne,l as Ue}from"./FetchAssociatedFeatureLayer.f6cbad39.js";import{s as N,l as qe,u as Ce,m as Qe}from"./I3SLayerDefinitions.0127897b.js";import{g as Ge}from"./persistable.6b292e5e.js";import{d as ke,s as Ve}from"./popupUtils.c6371f3a.js";import"./originUtils.2d0aad75.js";import"./multiOriginJSONSupportUtils.38b69b9c.js";import"./resourceUtils.f4b6e42a.js";import"./mat3f64.6d32a1d7.js";import"./mat4f64.ff2a477c.js";import"./quat.d9562009.js";import"./quatf64.4ae3e6f1.js";import"./I3SBinaryReader.2f855706.js";import"./VertexAttribute.42396f25.js";import"./symbolColorUtils.36aaa708.js";import"./vec3f32.1121a836.js";import"./plane.444b53ce.js";import"./sphere.f99ddb50.js";let u=class extends R{constructor(){super(...arguments),this.name=null,this.field=null,this.currentRangeExtent=null,this.fullRangeExtent=null,this.type="rangeInfo"}};r([o({type:String,json:{read:!0,write:!0}})],u.prototype,"name",void 0),r([o({type:String,json:{read:!0,write:!0}})],u.prototype,"field",void 0),r([o({type:[Number],json:{read:!0,write:!0}})],u.prototype,"currentRangeExtent",void 0),r([o({type:[Number],json:{read:!0,write:!0}})],u.prototype,"fullRangeExtent",void 0),r([o({type:["rangeInfo"],readOnly:!0,json:{read:!1,write:!0}})],u.prototype,"type",void 0),u=r([w("esri.layers.support.RangeInfo")],u);var v;let L=v=class extends K(j.ofType(I)){constructor(e){super(e)}clone(){return new v(this.items.map(e=>e.clone()))}write(e,t){return this.toJSON(t)}toJSON(e){var s;const t=(s=e==null?void 0:e.layer)==null?void 0:s.spatialReference;return t?this.toArray().map(a=>{if(!t.equals(a.spatialReference)){if(!M(a.spatialReference,t))return e&&e.messages&&e.messages.push(new O("scenefilter:unsupported","Scene filters with incompatible spatial references are not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),null;const l=new I;z(a,l,t),a=l}const n=a.toJSON(e);return delete n.spatialReference,n}).filter(a=>a!=null):(e!=null&&e.messages&&e.messages.push(new O("scenefilter:unsupported","Writing Scene filters without context layer is not supported",{modification:this,spatialReference:e.layer.spatialReference,context:e})),this.toArray().map(a=>a.toJSON(e)))}static fromJSON(e,t){const s=new v;return e.forEach(a=>s.add(I.fromJSON(a,t))),s}};L=v=r([w("esri.layers.support.PolygonCollection")],L);const S=L;var F;let f=F=class extends R{constructor(e){super(e),this.spatialRelationship="disjoint",this.geometries=new S,this._geometriesSource=null,this._handles=new W}initialize(){this._handles.add(H(()=>this.geometries,"after-changes",()=>this.geometries=this.geometries,Z))}destroy(){this._handles.destroy()}readGeometries(e,t,s){this._geometriesSource={url:B(e,s),context:s}}async loadGeometries(e,t){if(g(this._geometriesSource))return;const{url:s,context:a}=this._geometriesSource,n=await D(s,{responseType:"json",signal:Y(t,"signal")}),l=e.toJSON(),y=n.data.map(b=>({...b,spatialReference:l}));this.geometries=S.fromJSON(y,a),this._geometriesSource=null}clone(){return new F({geometries:X(this.geometries),spatialRelationship:this.spatialRelationship})}};r([o({type:["disjoint","contains"],nonNullable:!0,json:{write:!0}})],f.prototype,"spatialRelationship",void 0),r([o({type:S,nonNullable:!0,json:{write:!0}}),Ge({origins:["web-scene","portal-item"],type:"resource",prefix:"geometries"})],f.prototype,"geometries",void 0),r([h(["web-scene","portal-item"],"geometries")],f.prototype,"readGeometries",null),f=F=r([w("esri.layers.support.SceneFilter")],f);const Je=f,Ke=["3DObject","Point"],A=Ae();let i=class extends ee(Re(te(se(re(ie(oe(ae(Pe)))))))){constructor(...e){super(...e),this.featureReduction=null,this.rangeInfos=null,this.operationalLayerType="ArcGISSceneServiceLayer",this.type="scene",this.fields=null,this.floorInfo=null,this.outFields=null,this.nodePages=null,this.materialDefinitions=null,this.textureSetDefinitions=null,this.geometryDefinitions=null,this.serviceUpdateTimeStamp=null,this.excludeObjectIds=new j,this.definitionExpression=null,this.filter=null,this.path=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.priority=null,this.semantic=null,this.cachedDrawingInfo={color:!1},this.popupEnabled=!0,this.popupTemplate=null,this.objectIdField=null,this.globalIdField=null,this._fieldUsageInfo={},this.screenSizePerspectiveEnabled=!0}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e,t){var a,n,l,y;const s=(n=(a=this.getFeatureType(t==null?void 0:t.feature))==null?void 0:a.domains)==null?void 0:n[e];return s&&s.type!=="inherited"?s:(y=(l=this.getField(e))==null?void 0:l.domain)!=null?y:null}getFeatureType(e){return e!=null&&p(this.associatedLayer)?this.associatedLayer.getFeatureType(e):null}get types(){var e;return p(this.associatedLayer)?(e=this.associatedLayer.types)!=null?e:[]:[]}get typeIdField(){return p(this.associatedLayer)?this.associatedLayer.typeIdField:null}get formTemplate(){return p(this.associatedLayer)?this.associatedLayer.formTemplate:null}get fieldsIndex(){return new ne(this.fields)}readNodePages(e,t,s){return t.layerType==="Point"&&(e=t.pointNodePages),e==null||typeof e!="object"?null:N.fromJSON(e,s)}set elevationInfo(e){this._set("elevationInfo",e),this.loaded&&this._validateElevationInfo()}get geometryType(){return Me[this.profile]||"mesh"}set renderer(e){E(e,this.fieldsIndex),this._set("renderer",e)}readCachedDrawingInfo(e){return e!=null&&typeof e=="object"||(e={}),e.color==null&&(e.color=!1),e}get capabilities(){const e=p(this.associatedLayer)&&this.associatedLayer.capabilities?this.associatedLayer.capabilities:De,{query:t,editing:{supportsGlobalId:s,supportsRollbackOnFailure:a,supportsUploadWithItemId:n,supportsReturnServiceEditsInSourceSpatialReference:l},data:{supportsZ:y,supportsM:b,isVersioned:U,supportsAttachment:q},operations:{supportsEditing:C,supportsAdd:Q,supportsUpdate:G,supportsDelete:k,supportsQuery:V,supportsQueryAttachments:J}}=e,m=e.operations.supportsChangeTracking,_=le();return{query:t,editing:{supportsGlobalId:s,supportsReturnServiceEditsInSourceSpatialReference:l,supportsRollbackOnFailure:a,supportsGeometryUpdate:!1,supportsUploadWithItemId:n},data:{supportsAttachment:q,supportsZ:y,supportsM:b,isVersioned:U},operations:{supportsQuery:V,supportsQueryAttachments:J,supportsEditing:C&&m,supportsAdd:_&&Q&&m,supportsDelete:_&&k&&m,supportsUpdate:G&&m}}}get editingEnabled(){return this._isOverridden("editingEnabled")?this._get("editingEnabled"):this.userHasEditingPrivileges}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}get infoFor3D(){return p(this.associatedLayer)?this.associatedLayer.infoFor3D:null}get defaultPopupTemplate(){return p(this.associatedLayer)||this.attributeStorageInfo?this.createPopupTemplate():null}readObjectIdField(e,t){return!e&&t.fields&&t.fields.some(s=>(s.type==="esriFieldTypeOID"&&(e=s.name),!!e)),e||void 0}readGlobalIdField(e,t){return!e&&t.fields&&t.fields.some(s=>(s.type==="esriFieldTypeGlobalID"&&(e=s.name),!!e)),e||void 0}get displayField(){return p(this.associatedLayer)?this.associatedLayer.displayField:null}readProfile(e,t){const s=t.store.profile;return s!=null&&P[s]?P[s]:(c.getLogger(this.declaredClass).error("Unknown or missing profile",{profile:s,layer:this}),"mesh-pyramids")}load(e){const t=p(e)?e.signal:null,s=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(pe).then(()=>this._fetchService(t)).then(()=>Promise.all([this._fetchIndexAndUpdateExtent(this.nodePages,t),this._setAssociatedFeatureLayer(t),p(this.filter)?this.filter.loadGeometries(this.spatialReference):null])).then(()=>this._validateElevationInfo()).then(()=>this._applyAssociatedLayerOverrides()).then(()=>this._populateFieldUsageInfo()).then(()=>de(this,{origin:"service"},t)).then(()=>E(this.renderer,this.fieldsIndex)).then(()=>this.finishLoadEditablePortalLayer(e));return this.addResolvingPromise(s),Promise.resolve(this)}async beforeSave(){p(this.filter)&&await this.load()}createQuery(){const e=new ye;return this.geometryType!=="mesh"&&(e.returnGeometry=!0,e.returnZ=!0),e.where=this.definitionExpression||"1=1",e.sqlFormat="standard",e}queryExtent(e,t){return this._getAssociatedLayerForQuery().then(s=>s.queryExtent(e||this.createQuery(),t))}queryFeatureCount(e,t){return this._getAssociatedLayerForQuery().then(s=>s.queryFeatureCount(e||this.createQuery(),t))}queryFeatures(e,t){return this._getAssociatedLayerForQuery().then(s=>s.queryFeatures(e||this.createQuery(),t)).then(s=>{if(s!=null&&s.features)for(const a of s.features)a.layer=this,a.sourceLayer=this;return s})}async queryCachedAttributes(e,t){const s=ue(this.fieldsIndex,await ke(this,Ve(this)));return Ne(this.parsedUrl.path,this.attributeStorageInfo,e,t,s)}async queryCachedFeature(e,t){const s=await this.queryCachedAttributes(e,[t]);if(!s||s.length===0)throw new d("scenelayer:feature-not-in-cached-data","Feature not found in cached data");const a=new ce;return a.attributes=s[0],a.layer=this,a.sourceLayer=this,a}queryObjectIds(e,t){return this._getAssociatedLayerForQuery().then(s=>s.queryObjectIds(e||this.createQuery(),t))}queryAttachments(e,t){return this._getAssociatedLayerForQuery().then(s=>s.queryAttachments(e,t))}getFieldUsageInfo(e){const t={supportsLabelingInfo:!1,supportsRenderer:!1,supportsPopupTemplate:!1,supportsLayerQuery:!1};return this.loaded?this._fieldUsageInfo[e]||t:(c.getLogger(this.declaredClass).error("#getFieldUsageInfo()","Unavailable until layer is loaded"),t)}createPopupTemplate(e){return he(this,e)}_getAssociatedLayerForQuery(){const e=this.associatedLayer;return p(e)&&e.loaded?Promise.resolve(e):this._loadAssociatedLayerForQuery()}async _loadAssociatedLayerForQuery(){if(await this.load(),g(this.associatedLayer))throw new d("scenelayer:query-not-available","SceneLayer queries are not available without an associated feature layer",{layer:this});try{await this.associatedLayer.load()}catch(e){throw new d("scenelayer:query-not-available","SceneLayer associated feature layer could not be loaded",{layer:this,error:e})}return this.associatedLayer}hasCachedStatistics(e){return this.statisticsInfo!=null&&this.statisticsInfo.some(t=>t.name===e)}async queryCachedStatistics(e,t){if(await this.load(t),!this.statisticsInfo)throw new d("scenelayer:no-cached-statistics","Cached statistics are not available for this layer");const s=this.fieldsIndex.get(e);if(!s)throw new d("scenelayer:field-unexisting",`Field '${e}' does not exist on the layer`);for(const a of this.statisticsInfo)if(a.name===s.name){const n=fe(this.parsedUrl.path,a.href);return D(n,{query:{f:"json",token:this.apiKey},responseType:"json",signal:t?t.signal:null}).then(l=>l.data)}throw new d("scenelayer:no-cached-statistics","Cached statistics for this attribute are not available")}async saveAs(e,t){return this._debouncedSaveOperations(T.SAVE_AS,{...t,getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"},e)}async save(){const e={getTypeKeywords:()=>this._getTypeKeywords(),portalItemLayerType:"scene"};return this._debouncedSaveOperations(T.SAVE,e)}async applyEdits(e,t){const s=await ge(()=>import("./editingSupport.7278fc9c.js"),["assets/editingSupport.7278fc9c.js","assets/index.221827cd.js","assets/index.f5419ca5.css"]);if(await this.load(),g(this.associatedLayer))throw new d(`${this.type}-layer:not-editable`,"Service is not editable");return await this.associatedLayer.load(),s.applyEdits(this,this.associatedLayer.source,e,t)}on(e,t){return super.on(e,t)}validateLayer(e){if(e.layerType&&!Ke.includes(e.layerType))throw new d("scenelayer:layer-type-not-supported","SceneLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor))throw new d("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});if(this.version.major>2)throw new d("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"1.x, 2.x"});function t(s,a){let n=!1,l=!1;if(s==null)n=!0,l=!0;else{const y=a&&a.isGeographic;switch(s){case"east-north-up":case"earth-centered":n=!0,l=y;break;case"vertex-reference-frame":n=!0,l=!y;break;default:n=!1}}if(!n)throw new d("scenelayer:unsupported-normal-reference-frame","Normal reference frame is invalid.");if(!l)throw new d("scenelayer:incompatible-normal-reference-frame","Normal reference frame is incompatible with layer spatial reference.")}t(this.normalReferenceFrame,this.spatialReference)}_getTypeKeywords(){const e=[];if(this.profile==="points")e.push("Point");else{if(this.profile!=="mesh-pyramids")throw new d("scenelayer:unknown-profile","SceneLayer:save() encountered an unknown SceneLayer profile: "+this.profile);e.push("3DObject")}return e}_populateFieldUsageInfo(){if(this._fieldUsageInfo={},this.fields)for(const e of this.fields){const t=!(!this.attributeStorageInfo||!this.attributeStorageInfo.some(n=>n.name===e.name)),s=!!(p(this.associatedLayer)&&this.associatedLayer.fields&&this.associatedLayer.fields.some(n=>n&&e.name===n.name)),a={supportsLabelingInfo:t,supportsRenderer:t,supportsPopupTemplate:t||s,supportsLayerQuery:s};this._fieldUsageInfo[e.name]=a}}_applyAssociatedLayerOverrides(){this._applyAssociatedLayerFieldsOverrides(),this._applyAssociatedLayerPopupOverrides()}_applyAssociatedLayerFieldsOverrides(){if(g(this.associatedLayer)||!this.associatedLayer.fields)return;let e=null;for(const t of this.associatedLayer.fields){const s=this.getField(t.name);s?(!s.domain&&t.domain&&(s.domain=t.domain.clone()),s.editable=t.editable,s.nullable=t.nullable,s.length=t.length):(e||(e=this.fields?this.fields.slice():[]),e.push(t.clone()))}e&&this._set("fields",e)}_applyAssociatedLayerPopupOverrides(){if(g(this.associatedLayer))return;const e=["popupTemplate","popupEnabled"],t=me(this);for(let s=0;sthis.popupEnabled&&this.popupTemplate!=null);const e=`this SceneLayer: ${this.title}`;this.attributeStorageInfo==null?c.getLogger(this.declaredClass).warn(`Associated FeatureLayer could not be loaded and no binary attributes found. Popups will not work on ${e}`):c.getLogger(this.declaredClass).info(`Associated FeatureLayer could not be loaded. Falling back to binary attributes for Popups on ${e}`)}_validateElevationInfo(){const e=this.elevationInfo;e&&(this.profile==="mesh-pyramids"&&e.mode==="relative-to-scene"&&c.getLogger(this.declaredClass).warn(".elevationInfo=","Mesh scene layers don't support relative-to-scene elevation mode"),e.featureExpressionInfo&&e.featureExpressionInfo.expression!=="0"&&c.getLogger(this.declaredClass).warn(".elevationInfo=","Scene layers do not support featureExpressionInfo"))}};r([o({types:{key:"type",base:be,typeMap:{selection:Ie}},json:{origins:{"web-scene":{name:"layerDefinition.featureReduction",write:!0},"portal-item":{name:"layerDefinition.featureReduction",write:!0}}}})],i.prototype,"featureReduction",void 0),r([o({type:[u],json:{read:!1,origins:{"web-scene":{name:"layerDefinition.rangeInfos",write:!0},"portal-item":{name:"layerDefinition.rangeInfos",write:!0}}}})],i.prototype,"rangeInfos",void 0),r([o({json:{read:!1}})],i.prototype,"associatedLayer",void 0),r([o({type:["show","hide"]})],i.prototype,"listMode",void 0),r([o({type:["ArcGISSceneServiceLayer"]})],i.prototype,"operationalLayerType",void 0),r([o({json:{read:!1},readOnly:!0})],i.prototype,"type",void 0),r([o({...A.fields,readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],i.prototype,"fields",void 0),r([o()],i.prototype,"types",null),r([o()],i.prototype,"typeIdField",null),r([o()],i.prototype,"formTemplate",null),r([o({readOnly:!0})],i.prototype,"fieldsIndex",null),r([o({type:Le,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],i.prototype,"floorInfo",void 0),r([o(A.outFields)],i.prototype,"outFields",void 0),r([o({type:N,readOnly:!0,json:{read:!1}})],i.prototype,"nodePages",void 0),r([h("service","nodePages",["nodePages","pointNodePages"])],i.prototype,"readNodePages",null),r([o({type:[qe],readOnly:!0})],i.prototype,"materialDefinitions",void 0),r([o({type:[Ce],readOnly:!0})],i.prototype,"textureSetDefinitions",void 0),r([o({type:[Qe],readOnly:!0})],i.prototype,"geometryDefinitions",void 0),r([o({readOnly:!0})],i.prototype,"serviceUpdateTimeStamp",void 0),r([o({readOnly:!0})],i.prototype,"attributeStorageInfo",void 0),r([o({readOnly:!0})],i.prototype,"statisticsInfo",void 0),r([o({type:j.ofType(Number),nonNullable:!0,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.excludeObjectIds",write:{enabled:!0}}})],i.prototype,"excludeObjectIds",void 0),r([o({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],i.prototype,"definitionExpression",void 0),r([o({type:Je,json:{name:"layerDefinition.polygonFilter",write:{enabled:!0,allowNull:!0},origins:{service:{read:!1,write:!1}}}})],i.prototype,"filter",void 0),r([o({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],i.prototype,"path",void 0),r([o(Se)],i.prototype,"elevationInfo",null),r([o({type:String})],i.prototype,"geometryType",null),r([o(Fe)],i.prototype,"labelsVisible",void 0),r([o({type:[je],json:{origins:{service:{name:"drawingInfo.labelingInfo",read:{reader:$},write:!1}},name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:$},write:!0}})],i.prototype,"labelingInfo",void 0),r([o(_e)],i.prototype,"legendEnabled",void 0),r([o({type:Number,json:{origins:{"web-document":{default:1,write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}},read:{source:["opacity","layerDefinition.drawingInfo.transparency"],reader(e,t){var a,n;if(typeof e=="number"&&e>=0&&e<=1)return e;const s=(n=(a=t.layerDefinition)==null?void 0:a.drawingInfo)==null?void 0:n.transparency;return s!==void 0?Oe(s):void 0}}},"portal-item":{write:!0},service:{read:!1}}}})],i.prototype,"opacity",void 0),r([o({type:["Low","High"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],i.prototype,"priority",void 0),r([o({type:["Labels"],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],i.prototype,"semantic",void 0),r([o({types:Ee,json:{origins:{service:{read:{source:"drawingInfo.renderer"}}},name:"layerDefinition.drawingInfo.renderer",write:!0},value:null})],i.prototype,"renderer",null),r([o({json:{read:!1}})],i.prototype,"cachedDrawingInfo",void 0),r([h("service","cachedDrawingInfo")],i.prototype,"readCachedDrawingInfo",null),r([o({readOnly:!0,json:{read:!1}})],i.prototype,"capabilities",null),r([o({type:Boolean,json:{read:!1}})],i.prototype,"editingEnabled",null),r([o({readOnly:!0,json:{write:!1,read:!1}})],i.prototype,"infoFor3D",null),r([o(xe)],i.prototype,"popupEnabled",void 0),r([o({type:$e,json:{name:"popupInfo",write:!0}})],i.prototype,"popupTemplate",void 0),r([o({readOnly:!0,json:{read:!1}})],i.prototype,"defaultPopupTemplate",null),r([o({type:String,json:{read:!1}})],i.prototype,"objectIdField",void 0),r([h("service","objectIdField",["objectIdField","fields"])],i.prototype,"readObjectIdField",null),r([o({type:String,json:{read:!1}})],i.prototype,"globalIdField",void 0),r([h("service","globalIdField",["globalIdField","fields"])],i.prototype,"readGlobalIdField",null),r([o({readOnly:!0,type:String,json:{read:!1}})],i.prototype,"displayField",null),r([o({type:String,json:{read:!1}})],i.prototype,"profile",void 0),r([h("service","profile",["store.profile"])],i.prototype,"readProfile",null),r([o({readOnly:!0,type:String,json:{origins:{service:{read:{source:"store.normalReferenceFrame"}}},read:!1}})],i.prototype,"normalReferenceFrame",void 0),r([o(Te)],i.prototype,"screenSizePerspectiveEnabled",void 0),i=r([w("esri.layers.SceneLayer")],i);const P={"mesh-pyramids":"mesh-pyramids",meshpyramids:"mesh-pyramids","features-meshes":"mesh-pyramids",points:"points","features-points":"points",lines:"lines","features-lines":"lines",polygons:"polygons","features-polygons":"polygons"},Me={"mesh-pyramids":"mesh",points:"point",lines:"polyline",polygons:"polygon"},ut=i;export{ut as default}; diff --git a/assets/SceneLayerSnappingSourceWorker.15d0e4f8.js b/assets/SceneLayerSnappingSourceWorker.b99c81d4.js similarity index 95% rename from assets/SceneLayerSnappingSourceWorker.15d0e4f8.js rename to assets/SceneLayerSnappingSourceWorker.b99c81d4.js index 4e17222..ccb1511 100644 --- a/assets/SceneLayerSnappingSourceWorker.15d0e4f8.js +++ b/assets/SceneLayerSnappingSourceWorker.b99c81d4.js @@ -1 +1 @@ -import{bb as Et,eO as v,c as W,ad as D,fG as j,h4 as Z,fy as tt,h5 as Rt,M as N,aj as m,h6 as et,fF as K,a6 as At,a8 as Nt,v as Ft,j as nt,bd as Mt,fU as $}from"./index.d94abe07.js";import{c as ot,v as xt,b as St,j as jt}from"./Util.ea9235b8.js";import{s as mt,d as it,_ as G,p as st,T as H,k as F,V as rt,R as S,N as ht}from"./sphere.ec1f4496.js";import{q as at}from"./QueryEngineResult.7611d68a.js";import"./plane.86573aee.js";import{m as Bt}from"./edgeProcessing.b309b825.js";import"./mat3f64.6d32a1d7.js";import"./mat4f64.ff2a477c.js";import"./quatf64.4ae3e6f1.js";import"./quantizationUtils.0d428d19.js";import"./WhereClause.253310fe.js";import"./utils.8c53cad2.js";import"./generateRendererUtils.ebdde5b7.js";import"./projectionSupport.0542c13b.js";import"./json.879c9adc.js";import"./utils.399e6089.js";import"./deduplicate.17ab7923.js";import"./InterleavedLayout.f9d79992.js";import"./BufferView.89055914.js";import"./types.44c7402c.js";import"./VertexAttribute.42396f25.js";import"./enums.2d9e6f64.js";import"./VertexElementDescriptor.1fdca6da.js";function pt(o){return o?{ray:it(o.ray),c0:o.c0,c1:o.c1}:{ray:it(),c0:0,c1:Number.MAX_VALUE}}new mt(()=>pt());function C(o,t){for(let e=0;e=t[3])return!1}return!0}var dt,d;(function(o){o[o.LEFT=0]="LEFT",o[o.RIGHT=1]="RIGHT",o[o.BOTTOM=2]="BOTTOM",o[o.TOP=3]="TOP",o[o.NEAR=4]="NEAR",o[o.FAR=5]="FAR"})(dt||(dt={})),function(o){o[o.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",o[o.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",o[o.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",o[o.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",o[o.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",o[o.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",o[o.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",o[o.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(d||(d={}));d.FAR_BOTTOM_RIGHT,d.NEAR_BOTTOM_RIGHT,d.NEAR_BOTTOM_LEFT,d.FAR_BOTTOM_LEFT,d.NEAR_BOTTOM_LEFT,d.NEAR_BOTTOM_RIGHT,d.NEAR_TOP_RIGHT,d.NEAR_TOP_LEFT,d.FAR_BOTTOM_RIGHT,d.FAR_BOTTOM_LEFT,d.FAR_TOP_LEFT,d.FAR_TOP_RIGHT,d.NEAR_BOTTOM_RIGHT,d.FAR_BOTTOM_RIGHT,d.FAR_TOP_RIGHT,d.NEAR_TOP_RIGHT,d.FAR_BOTTOM_LEFT,d.NEAR_BOTTOM_LEFT,d.NEAR_TOP_LEFT,d.FAR_TOP_LEFT,d.FAR_TOP_LEFT,d.NEAR_TOP_LEFT,d.NEAR_TOP_RIGHT,d.FAR_TOP_RIGHT;var X,ct;(function(o){o[o.NUM=6]="NUM"})(X||(X={})),function(o){o[o.NUM=8]="NUM"}(ct||(ct={}));new mt(pt);class B{constructor(t,e){this._objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new c,this._objectCount=0,e&&(e.maximumObjectsPerNode!==void 0&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),e.maximumDepth!==void 0&&(this._maximumDepth=e.maximumDepth))}get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}destroy(){this._degenerateObjects.clear(),c.clearPool(),J[0]=null,M.prune(),x.prune()}add(t,e=t.length){this._objectCount+=e,this._grow(t,e);const n=c.acquire();for(let i=0;i{if(!this._intersectsNode(i,s))return!1;const h=s.node;return h.terminals.forAll(r=>{this._intersectsObject(i,r)&&n(r)}),h.residents!==null&&h.residents.forAll(r=>{this._intersectsObject(i,r)&&n(r)}),!0})}forEachAlongRayWithVerticalOffset(t,e,n,i){const s=st(t,e);this._forEachNode(this._root,h=>{if(!this._intersectsNodeWithOffset(s,h,i))return!1;const r=h.node;return r.terminals.forAll(a=>{this._intersectsObjectWithOffset(s,a,i)&&n(a)}),r.residents!==null&&r.residents.forAll(a=>{this._intersectsObjectWithOffset(s,a,i)&&n(a)}),!0})}forEach(t){this._forEachNode(this._root,e=>{const n=e.node;return n.terminals.forAll(t),n.residents!==null&&n.residents.forAll(t),!0}),this._degenerateObjects.forEach(t)}forEachDegenerateObject(t){this._degenerateObjects.forEach(t)}findClosest(t,e,n,i=()=>!0,s=1/0){let h=1/0,r=1/0,a=null;const u=q(t,e),_=l=>{if(--s,!i(l))return;const O=this._objectToBoundingSphere(l);if(!C(n,O))return;const E=A(t,e,F(O)),I=E-O[3],f=E+O[3];I{if(s<=0||!C(n,l.bounds)||(D(g,u,l.halfSize),j(g,g,l.bounds),A(t,e,g)>r))return!1;const O=l.node;return O.terminals.forAll(E=>_(E)),O.residents!==null&&O.residents.forAll(E=>_(E)),!0},t,e),a}forEachInDepthRange(t,e,n,i,s,h,r){let a=-1/0,u=1/0;const _={setRange:f=>{n===B.DepthOrder.FRONT_TO_BACK?(a=Math.max(a,f.near),u=Math.min(u,f.far)):(a=Math.max(a,-f.far),u=Math.min(u,-f.near))}};_.setRange(i);const l=A(e,n,t),O=q(e,n),E=q(e,-n),I=f=>{if(!r(f))return;const R=this._objectToBoundingSphere(f),L=F(R),Y=A(e,n,L)-l,gt=Y-R[3],bt=Y+R[3];gt>u||bt{if(!C(h,f.bounds)||(D(g,O,f.halfSize),j(g,g,f.bounds),A(e,n,g)-l>u)||(D(g,E,f.halfSize),j(g,g,f.bounds),A(e,n,g)-lI(L)),R.residents!==null&&R.residents.forAll(L=>I(L)),!0},e,n)}forEachNode(t){this._forEachNode(this._root,e=>t(e.node,e.bounds,e.halfSize))}forEachNeighbor(t,e){const n=H(e),i=F(e),s=a=>{const u=this._objectToBoundingSphere(a),_=H(u),l=n+_;return!(Z(F(u),i)-l*l<=0)||t(a)};let h=!0;const r=a=>{h&&(h=s(a))};this._forEachNode(this._root,a=>{const u=H(a.bounds),_=n+u;if(Z(F(a.bounds),i)-_*_>0)return!1;const l=a.node;return l.terminals.forAll(r),h&&l.residents!==null&&l.residents.forAll(r),h}),h&&this.forEachDegenerateObject(r)}_intersectsNode(t,e){return y(e.bounds,2*-e.halfSize,p),y(e.bounds,2*e.halfSize,T),ot(t.origin,t.direction,p,T)}_intersectsNodeWithOffset(t,e,n){return y(e.bounds,2*-e.halfSize,p),y(e.bounds,2*e.halfSize,T),n.applyToMinMax(p,T),ot(t.origin,t.direction,p,T)}_intersectsObject(t,e){const n=this._objectToBoundingSphere(e);return!(n[3]>0)||rt(n,t)}_intersectsObjectWithOffset(t,e,n){const i=this._objectToBoundingSphere(e);return!(i[3]>0)||rt(n.applyToBoundingSphere(i),t)}_forEachNode(t,e){let n=c.acquire().init(t);const i=[n];for(;i.length!==0;){if(n=i.pop(),e(n)&&!n.isLeaf())for(let s=0;s=0;--r){const a=_t[r];s.node.children[a]&&h.push(c.acquire().init(s).advance(a))}c.release(s)}}_remove(t,e,n){M.clear();const i=n.advanceTo(e,(s,h)=>{M.push(s.node),M.push(h)})?n.node.terminals:n.node.residents;if(i.removeUnordered(t),i.length===0)for(let s=M.length-2;s>=0;s-=2){const h=M.data[s],r=M.data[s+1];if(!this._purge(h,r))break}}_nodeIsEmpty(t){if(t.terminals.length!==0)return!1;if(t.residents!==null)return t.residents.length===0;for(let e=0;e=0&&(t.children[e]=null),!!this._nodeIsEmpty(t)&&(t.residents===null&&(t.residents=new v({shrink:!0})),!0)}_add(t,e){e.advanceTo(this._objectToBoundingSphere(t))?e.node.terminals.push(t):(e.node.residents.push(t),e.node.residents.length>this._maximumObjectsPerNode&&e.depththis._objectToBoundingSphere(n),b),P(b[3])&&!this._fitsInsideTree(b)))if(this._nodeIsEmpty(this._root.node))G(b,this._root.bounds),this._root.halfSize=1.25*b[3];else{const n=this._rootBoundsForRootAsSubNode(b);this._placingRootViolatesMaxDepth(n)?this._rebuildTree(b,n):this._growRootAsSubNode(n),c.release(n)}}_rebuildTree(t,e){tt(k,e.bounds),k[3]=e.halfSize,lt([t,k],2,i=>i,U);const n=c.acquire().init(this._root);this._root.initFrom(null,U,1.25*U[3]),this._forEachNode(n,i=>(this.add(i.node.terminals.data,i.node.terminals.length),i.node.residents!==null&&this.add(i.node.residents.data,i.node.residents.length),!0)),c.release(n)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return this._forEachNode(this._root,i=>(n=Math.max(n,i.depth),n+e<=this._maximumDepth)),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t[3],n=t;let i=-1/0;const s=this._root.bounds,h=this._root.halfSize;for(let r=0;r<3;r++){const a=s[r]-h-(n[r]-e),u=n[r]+e-(s[r]+h),_=Math.max(0,Math.ceil(a/(2*h))),l=Math.max(0,Math.ceil(u/(2*h)))+1,O=2**Math.ceil(Math.log(_+l)*Math.LOG2E);i=Math.max(i,O),z[r].min=_,z[r].max=l}for(let r=0;r<3;r++){let a=z[r].min,u=z[r].max;const _=(i-(a+u))/2;a+=Math.ceil(_),u+=Math.floor(_);const l=s[r]-h-a*h*2;V[r]=l+(u+a)*h}return V[3]=i*h*Ot,c.acquire().initFrom(null,V,i*h,0)}_growRootAsSubNode(t){const e=this._root.node;tt(b,this._root.bounds),b[3]=this._root.halfSize,this._root.init(t),t.advanceTo(b,null,!0),t.node.children=e.children,t.node.residents=e.residents,t.node.terminals=e.terminals}_shrink(){for(;;){const t=this._findShrinkIndex();if(t===-1)break;this._root.advance(t),this._root.depth=0}}_findShrinkIndex(){if(this._root.node.terminals.length!==0||this._root.isLeaf())return-1;let t=null;const e=this._root.node.children;let n=0,i=0;for(;i=e[0]-n&&t[0]<=e[0]+n&&t[1]>=e[1]-n&&t[1]<=e[1]+n&&t[2]>=e[2]-n&&t[2]<=e[2]+n}}class c{constructor(){this.bounds=S(),this.halfSize=0,this.initFrom(null,null,0,0)}init(t){return this.initFrom(t.node,t.bounds,t.halfSize,t.depth)}initFrom(t,e,n,i=this.depth){return this.node=W(t)?t:c.createEmptyNode(),W(e)&&G(e,this.bounds),this.halfSize=n,this.depth=i,this}advance(t){let e=this.node.children[t];e||(e=c.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=Tt[t];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.bounds[3]=this.halfSize*Ot,this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e&&e(this,-1),!0;if(this.isLeaf()){if(!n)return e&&e(this,-1),!1;this.node.residents=null}const i=this._childIndex(t);e&&e(this,i),this.advance(i)}}isLeaf(){return this.node.residents!=null}isTerminalFor(t){return t[3]>this.halfSize/2}_childIndex(t){const e=this.bounds;return(e[0]n.distance-i.distance);for(let n=0;n<8;++n)e[n]=x.data[n].index}function q(o,t){let e,n=1/0;for(let i=0;i<8;++i){const s=A(o,t,ut[i]);s0}c._pool=new Et(c),function(o){var t;(t=o.DepthOrder||(o.DepthOrder={}))[t.FRONT_TO_BACK=1]="FRONT_TO_BACK",t[t.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(B||(B={}));const Tt=[m(-1,-1,-1),m(1,-1,-1),m(-1,1,-1),m(1,1,-1),m(-1,-1,1),m(1,-1,1),m(-1,1,1),m(1,1,1)],ut=[m(-1,-1,-1),m(-1,-1,1),m(-1,1,-1),m(-1,1,1),m(1,-1,-1),m(1,-1,1),m(1,1,-1),m(1,1,1)],Ot=Math.sqrt(3),J=[null];function vt(o){return J[0]=o,J}const V=S(),g=N(),p=N(),T=N(),M=new v,$t=S(),b=S(),k=S(),U=S(),z=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],x=new v,_t=[0,0,0,0,0,0,0,0],ft=B,Ct=1e3;function yt(o,t,e){const n=S(),i=F(n);return et(i,i,o,.5),et(i,i,t,.5),n[3]=K(i,o),j(i,i,e),n}let Q=class{constructor(){this._idToComponent=new Map,this._components=new ft(o=>o.bounds),this._edges=new ft(o=>o.bounds),this._tmpLineSegment=xt(),this._tmpP1=N(),this._tmpP2=N(),this._tmpP3=N(),this.remoteClient=null}async fetchCandidates(o,t){await Promise.resolve(),Ft(t),await this._ensureEdgeLocations(o,t);const e=[];return this._edges.forEachNeighbor(n=>(this._addCandidates(o,n,e),e.length{if(nt(s.info)){const{id:h,uid:r}=s;e.push({id:h,uid:r})}return!0},o.bounds),!e.length)return;const n={components:e},i=await this.remoteClient.invoke("fetchAllEdgeLocations",n,Mt(t,{}));for(const s of i.components)this._setFetchEdgeLocations(s)}async add(o){const t=new w(o.id,o.bounds);return this._idToComponent.set(t.id,t),this._components.add([t]),{result:{}}}async remove(o){const t=this._idToComponent.get(o.id);if(t){const e=[];this._edges.forEachNeighbor(n=>(n.component===t&&e.push(n),!0),t.bounds),this._edges.remove(e),this._components.remove([t]),this._idToComponent.delete(t.id)}return{result:{}}}_setFetchEdgeLocations(o){const t=this._idToComponent.get(o.id);if(nt(t)||o.uid!==t.uid)return;const e=Bt.createView(o.locations),n=new Array(e.count),i=N(),s=N();for(let a=0;apt());function C(o,t){for(let e=0;e=t[3])return!1}return!0}var dt,d;(function(o){o[o.LEFT=0]="LEFT",o[o.RIGHT=1]="RIGHT",o[o.BOTTOM=2]="BOTTOM",o[o.TOP=3]="TOP",o[o.NEAR=4]="NEAR",o[o.FAR=5]="FAR"})(dt||(dt={})),function(o){o[o.NEAR_BOTTOM_LEFT=0]="NEAR_BOTTOM_LEFT",o[o.NEAR_BOTTOM_RIGHT=1]="NEAR_BOTTOM_RIGHT",o[o.NEAR_TOP_RIGHT=2]="NEAR_TOP_RIGHT",o[o.NEAR_TOP_LEFT=3]="NEAR_TOP_LEFT",o[o.FAR_BOTTOM_LEFT=4]="FAR_BOTTOM_LEFT",o[o.FAR_BOTTOM_RIGHT=5]="FAR_BOTTOM_RIGHT",o[o.FAR_TOP_RIGHT=6]="FAR_TOP_RIGHT",o[o.FAR_TOP_LEFT=7]="FAR_TOP_LEFT"}(d||(d={}));d.FAR_BOTTOM_RIGHT,d.NEAR_BOTTOM_RIGHT,d.NEAR_BOTTOM_LEFT,d.FAR_BOTTOM_LEFT,d.NEAR_BOTTOM_LEFT,d.NEAR_BOTTOM_RIGHT,d.NEAR_TOP_RIGHT,d.NEAR_TOP_LEFT,d.FAR_BOTTOM_RIGHT,d.FAR_BOTTOM_LEFT,d.FAR_TOP_LEFT,d.FAR_TOP_RIGHT,d.NEAR_BOTTOM_RIGHT,d.FAR_BOTTOM_RIGHT,d.FAR_TOP_RIGHT,d.NEAR_TOP_RIGHT,d.FAR_BOTTOM_LEFT,d.NEAR_BOTTOM_LEFT,d.NEAR_TOP_LEFT,d.FAR_TOP_LEFT,d.FAR_TOP_LEFT,d.NEAR_TOP_LEFT,d.NEAR_TOP_RIGHT,d.FAR_TOP_RIGHT;var X,ct;(function(o){o[o.NUM=6]="NUM"})(X||(X={})),function(o){o[o.NUM=8]="NUM"}(ct||(ct={}));new mt(pt);class B{constructor(t,e){this._objectToBoundingSphere=t,this._maximumObjectsPerNode=10,this._maximumDepth=20,this._degenerateObjects=new Set,this._root=new c,this._objectCount=0,e&&(e.maximumObjectsPerNode!==void 0&&(this._maximumObjectsPerNode=e.maximumObjectsPerNode),e.maximumDepth!==void 0&&(this._maximumDepth=e.maximumDepth))}get bounds(){return this._root.bounds}get halfSize(){return this._root.halfSize}get root(){return this._root.node}get maximumObjectsPerNode(){return this._maximumObjectsPerNode}get maximumDepth(){return this._maximumDepth}get objectCount(){return this._objectCount}destroy(){this._degenerateObjects.clear(),c.clearPool(),J[0]=null,M.prune(),x.prune()}add(t,e=t.length){this._objectCount+=e,this._grow(t,e);const n=c.acquire();for(let i=0;i{if(!this._intersectsNode(i,s))return!1;const h=s.node;return h.terminals.forAll(r=>{this._intersectsObject(i,r)&&n(r)}),h.residents!==null&&h.residents.forAll(r=>{this._intersectsObject(i,r)&&n(r)}),!0})}forEachAlongRayWithVerticalOffset(t,e,n,i){const s=st(t,e);this._forEachNode(this._root,h=>{if(!this._intersectsNodeWithOffset(s,h,i))return!1;const r=h.node;return r.terminals.forAll(a=>{this._intersectsObjectWithOffset(s,a,i)&&n(a)}),r.residents!==null&&r.residents.forAll(a=>{this._intersectsObjectWithOffset(s,a,i)&&n(a)}),!0})}forEach(t){this._forEachNode(this._root,e=>{const n=e.node;return n.terminals.forAll(t),n.residents!==null&&n.residents.forAll(t),!0}),this._degenerateObjects.forEach(t)}forEachDegenerateObject(t){this._degenerateObjects.forEach(t)}findClosest(t,e,n,i=()=>!0,s=1/0){let h=1/0,r=1/0,a=null;const u=q(t,e),_=l=>{if(--s,!i(l))return;const O=this._objectToBoundingSphere(l);if(!C(n,O))return;const E=A(t,e,F(O)),I=E-O[3],f=E+O[3];I{if(s<=0||!C(n,l.bounds)||(D(g,u,l.halfSize),j(g,g,l.bounds),A(t,e,g)>r))return!1;const O=l.node;return O.terminals.forAll(E=>_(E)),O.residents!==null&&O.residents.forAll(E=>_(E)),!0},t,e),a}forEachInDepthRange(t,e,n,i,s,h,r){let a=-1/0,u=1/0;const _={setRange:f=>{n===B.DepthOrder.FRONT_TO_BACK?(a=Math.max(a,f.near),u=Math.min(u,f.far)):(a=Math.max(a,-f.far),u=Math.min(u,-f.near))}};_.setRange(i);const l=A(e,n,t),O=q(e,n),E=q(e,-n),I=f=>{if(!r(f))return;const R=this._objectToBoundingSphere(f),L=F(R),Y=A(e,n,L)-l,gt=Y-R[3],bt=Y+R[3];gt>u||bt{if(!C(h,f.bounds)||(D(g,O,f.halfSize),j(g,g,f.bounds),A(e,n,g)-l>u)||(D(g,E,f.halfSize),j(g,g,f.bounds),A(e,n,g)-lI(L)),R.residents!==null&&R.residents.forAll(L=>I(L)),!0},e,n)}forEachNode(t){this._forEachNode(this._root,e=>t(e.node,e.bounds,e.halfSize))}forEachNeighbor(t,e){const n=H(e),i=F(e),s=a=>{const u=this._objectToBoundingSphere(a),_=H(u),l=n+_;return!(Z(F(u),i)-l*l<=0)||t(a)};let h=!0;const r=a=>{h&&(h=s(a))};this._forEachNode(this._root,a=>{const u=H(a.bounds),_=n+u;if(Z(F(a.bounds),i)-_*_>0)return!1;const l=a.node;return l.terminals.forAll(r),h&&l.residents!==null&&l.residents.forAll(r),h}),h&&this.forEachDegenerateObject(r)}_intersectsNode(t,e){return y(e.bounds,2*-e.halfSize,p),y(e.bounds,2*e.halfSize,T),ot(t.origin,t.direction,p,T)}_intersectsNodeWithOffset(t,e,n){return y(e.bounds,2*-e.halfSize,p),y(e.bounds,2*e.halfSize,T),n.applyToMinMax(p,T),ot(t.origin,t.direction,p,T)}_intersectsObject(t,e){const n=this._objectToBoundingSphere(e);return!(n[3]>0)||rt(n,t)}_intersectsObjectWithOffset(t,e,n){const i=this._objectToBoundingSphere(e);return!(i[3]>0)||rt(n.applyToBoundingSphere(i),t)}_forEachNode(t,e){let n=c.acquire().init(t);const i=[n];for(;i.length!==0;){if(n=i.pop(),e(n)&&!n.isLeaf())for(let s=0;s=0;--r){const a=_t[r];s.node.children[a]&&h.push(c.acquire().init(s).advance(a))}c.release(s)}}_remove(t,e,n){M.clear();const i=n.advanceTo(e,(s,h)=>{M.push(s.node),M.push(h)})?n.node.terminals:n.node.residents;if(i.removeUnordered(t),i.length===0)for(let s=M.length-2;s>=0;s-=2){const h=M.data[s],r=M.data[s+1];if(!this._purge(h,r))break}}_nodeIsEmpty(t){if(t.terminals.length!==0)return!1;if(t.residents!==null)return t.residents.length===0;for(let e=0;e=0&&(t.children[e]=null),!!this._nodeIsEmpty(t)&&(t.residents===null&&(t.residents=new v({shrink:!0})),!0)}_add(t,e){e.advanceTo(this._objectToBoundingSphere(t))?e.node.terminals.push(t):(e.node.residents.push(t),e.node.residents.length>this._maximumObjectsPerNode&&e.depththis._objectToBoundingSphere(n),b),P(b[3])&&!this._fitsInsideTree(b)))if(this._nodeIsEmpty(this._root.node))G(b,this._root.bounds),this._root.halfSize=1.25*b[3];else{const n=this._rootBoundsForRootAsSubNode(b);this._placingRootViolatesMaxDepth(n)?this._rebuildTree(b,n):this._growRootAsSubNode(n),c.release(n)}}_rebuildTree(t,e){tt(k,e.bounds),k[3]=e.halfSize,lt([t,k],2,i=>i,U);const n=c.acquire().init(this._root);this._root.initFrom(null,U,1.25*U[3]),this._forEachNode(n,i=>(this.add(i.node.terminals.data,i.node.terminals.length),i.node.residents!==null&&this.add(i.node.residents.data,i.node.residents.length),!0)),c.release(n)}_placingRootViolatesMaxDepth(t){const e=Math.log(t.halfSize/this._root.halfSize)*Math.LOG2E;let n=0;return this._forEachNode(this._root,i=>(n=Math.max(n,i.depth),n+e<=this._maximumDepth)),n+e>this._maximumDepth}_rootBoundsForRootAsSubNode(t){const e=t[3],n=t;let i=-1/0;const s=this._root.bounds,h=this._root.halfSize;for(let r=0;r<3;r++){const a=s[r]-h-(n[r]-e),u=n[r]+e-(s[r]+h),_=Math.max(0,Math.ceil(a/(2*h))),l=Math.max(0,Math.ceil(u/(2*h)))+1,O=2**Math.ceil(Math.log(_+l)*Math.LOG2E);i=Math.max(i,O),z[r].min=_,z[r].max=l}for(let r=0;r<3;r++){let a=z[r].min,u=z[r].max;const _=(i-(a+u))/2;a+=Math.ceil(_),u+=Math.floor(_);const l=s[r]-h-a*h*2;V[r]=l+(u+a)*h}return V[3]=i*h*Ot,c.acquire().initFrom(null,V,i*h,0)}_growRootAsSubNode(t){const e=this._root.node;tt(b,this._root.bounds),b[3]=this._root.halfSize,this._root.init(t),t.advanceTo(b,null,!0),t.node.children=e.children,t.node.residents=e.residents,t.node.terminals=e.terminals}_shrink(){for(;;){const t=this._findShrinkIndex();if(t===-1)break;this._root.advance(t),this._root.depth=0}}_findShrinkIndex(){if(this._root.node.terminals.length!==0||this._root.isLeaf())return-1;let t=null;const e=this._root.node.children;let n=0,i=0;for(;i=e[0]-n&&t[0]<=e[0]+n&&t[1]>=e[1]-n&&t[1]<=e[1]+n&&t[2]>=e[2]-n&&t[2]<=e[2]+n}}class c{constructor(){this.bounds=S(),this.halfSize=0,this.initFrom(null,null,0,0)}init(t){return this.initFrom(t.node,t.bounds,t.halfSize,t.depth)}initFrom(t,e,n,i=this.depth){return this.node=W(t)?t:c.createEmptyNode(),W(e)&&G(e,this.bounds),this.halfSize=n,this.depth=i,this}advance(t){let e=this.node.children[t];e||(e=c.createEmptyNode(),this.node.children[t]=e),this.node=e,this.halfSize/=2,this.depth++;const n=Tt[t];return this.bounds[0]+=n[0]*this.halfSize,this.bounds[1]+=n[1]*this.halfSize,this.bounds[2]+=n[2]*this.halfSize,this.bounds[3]=this.halfSize*Ot,this}advanceTo(t,e,n=!1){for(;;){if(this.isTerminalFor(t))return e&&e(this,-1),!0;if(this.isLeaf()){if(!n)return e&&e(this,-1),!1;this.node.residents=null}const i=this._childIndex(t);e&&e(this,i),this.advance(i)}}isLeaf(){return this.node.residents!=null}isTerminalFor(t){return t[3]>this.halfSize/2}_childIndex(t){const e=this.bounds;return(e[0]n.distance-i.distance);for(let n=0;n<8;++n)e[n]=x.data[n].index}function q(o,t){let e,n=1/0;for(let i=0;i<8;++i){const s=A(o,t,ut[i]);s0}c._pool=new Et(c),function(o){var t;(t=o.DepthOrder||(o.DepthOrder={}))[t.FRONT_TO_BACK=1]="FRONT_TO_BACK",t[t.BACK_TO_FRONT=-1]="BACK_TO_FRONT"}(B||(B={}));const Tt=[m(-1,-1,-1),m(1,-1,-1),m(-1,1,-1),m(1,1,-1),m(-1,-1,1),m(1,-1,1),m(-1,1,1),m(1,1,1)],ut=[m(-1,-1,-1),m(-1,-1,1),m(-1,1,-1),m(-1,1,1),m(1,-1,-1),m(1,-1,1),m(1,1,-1),m(1,1,1)],Ot=Math.sqrt(3),J=[null];function vt(o){return J[0]=o,J}const V=S(),g=N(),p=N(),T=N(),M=new v,$t=S(),b=S(),k=S(),U=S(),z=[{min:0,max:0},{min:0,max:0},{min:0,max:0}],x=new v,_t=[0,0,0,0,0,0,0,0],ft=B,Ct=1e3;function yt(o,t,e){const n=S(),i=F(n);return et(i,i,o,.5),et(i,i,t,.5),n[3]=K(i,o),j(i,i,e),n}let Q=class{constructor(){this._idToComponent=new Map,this._components=new ft(o=>o.bounds),this._edges=new ft(o=>o.bounds),this._tmpLineSegment=xt(),this._tmpP1=N(),this._tmpP2=N(),this._tmpP3=N(),this.remoteClient=null}async fetchCandidates(o,t){await Promise.resolve(),Ft(t),await this._ensureEdgeLocations(o,t);const e=[];return this._edges.forEachNeighbor(n=>(this._addCandidates(o,n,e),e.length{if(nt(s.info)){const{id:h,uid:r}=s;e.push({id:h,uid:r})}return!0},o.bounds),!e.length)return;const n={components:e},i=await this.remoteClient.invoke("fetchAllEdgeLocations",n,Mt(t,{}));for(const s of i.components)this._setFetchEdgeLocations(s)}async add(o){const t=new w(o.id,o.bounds);return this._idToComponent.set(t.id,t),this._components.add([t]),{result:{}}}async remove(o){const t=this._idToComponent.get(o.id);if(t){const e=[];this._edges.forEachNeighbor(n=>(n.component===t&&e.push(n),!0),t.bounds),this._edges.remove(e),this._components.remove([t]),this._idToComponent.delete(t.id)}return{result:{}}}_setFetchEdgeLocations(o){const t=this._idToComponent.get(o.id);if(nt(t)||o.uid!==t.uid)return;const e=Bt.createView(o.locations),n=new Array(e.count),i=N(),s=N();for(let a=0;aG(()=>import("./i3s.87f8afd0.js"),[]).then(t=>t.i).then(({default:t})=>{const r=t({locateFile:Q,onRuntimeInitialized:()=>e(r)});delete r.then})).catch(e=>{throw e})),T}function Q(e){return q(`esri/libs/i3s/${e}`)}let T;var N,E,x,B,$;(function(e){e[e.Unmodified=0]="Unmodified",e[e.Culled=1]="Culled",e[e.NotChecked=2]="NotChecked"})(N||(N={})),function(e){e[e.Unmodified=0]="Unmodified",e[e.PotentiallyModified=1]="PotentiallyModified",e[e.Culled=2]="Culled",e[e.Unknown=3]="Unknown",e[e.NotChecked=4]="NotChecked"}(E||(E={}));(function(e){e[e.Unknown=0]="Unknown",e[e.Uncached=1]="Uncached",e[e.Cached=2]="Cached"})(x||(x={})),function(e){e[e.None=0]="None",e[e.MaxScreenThreshold=1]="MaxScreenThreshold",e[e.ScreenSpaceRelative=2]="ScreenSpaceRelative",e[e.RemovedFeatureDiameter=3]="RemovedFeatureDiameter",e[e.DistanceRangeFromDefaultCamera=4]="DistanceRangeFromDefaultCamera"}(B||(B={})),function(e){e[e.Hole=0]="Hole",e[e.Leaf=1]="Leaf"}($||($={}));async function re(e){await g();const t=[e.geometryBuffer];return{result:k(e,t),transferList:t}}async function ie(e){var w;await g();const t=[e.geometryBuffer],{geometryBuffer:r}=e,f=r.byteLength,i=o._malloc(f),d=new Uint8Array(o.HEAPU8.buffer,i,f);d.set(new Uint8Array(r));const s=o.dracoDecompressPointCloudData(i,d.byteLength);if(o._free(i),s.error.length>0)throw`i3s.wasm: ${s.error}`;const p=((w=s.featureIds)==null?void 0:w.length)>0?c(s.featureIds):null,h=c(s.positions);return p&&t.push(p.buffer),t.push(h.buffer),{result:{positions:h,featureIds:p},transferList:t}}async function se(e){await g(),X(e);const t={buffer:e.buffer};return{result:t,transferList:[t.buffer]}}async function ae(e){await g(),W(e)}async function fe(e){await g(),o.setLegacySchema(e.context,e.jsonSchema)}function ce(e){H(e)}let _,o;function W(e){const t=e.modifications,r=o._malloc(8*t.length),f=new Float64Array(o.HEAPU8.buffer,r,t.length);for(let i=0;im.some(y=>y.name==="color")),normal:e.needNormals&&e.layouts.some(m=>m.some(y=>y.name==="normalCompressed")),uv0:e.layouts.some(m=>m.some(y=>y.name==="uv0")),uvRegion:e.layouts.some(m=>m.some(y=>y.name==="uvRegion")),featureIndex:M.featureIndex},n=o.process(r,!!e.obb,A,R.byteLength,M,j,I,p,Y,V,e.normalReferenceFrame);if(o._free(I),o._free(A),n.error.length>0)throw`i3s.wasm: ${n.error}`;if(n.discarded)return null;const U=n.componentOffsets.length>0?c(n.componentOffsets):null,P=n.featureIds.length>0?c(n.featureIds):null,S=c(n.interleavedVertedData).buffer,C=n.indicesType===L.Int16?c(new Uint16Array(n.indices.buffer,n.indices.byteOffset,n.indices.byteLength/2)):c(new Uint32Array(n.indices.buffer,n.indices.byteOffset,n.indices.byteLength/4)),O=c(n.positions),v=n.positionIndicesType===L.Int16?c(new Uint16Array(n.positionIndices.buffer,n.positionIndices.byteOffset,n.positionIndices.byteLength/2)):c(new Uint32Array(n.positionIndices.buffer,n.positionIndices.byteOffset,n.positionIndices.byteLength/4)),z={layout:e.layouts[0],interleavedVertexData:S,indices:C,hasColors:n.hasColors,hasModifications:n.hasModifications,positionData:{data:O,indices:v}};return P&&t.push(P.buffer),U&&t.push(U.buffer),t.push(S),t.push(C.buffer),t.push(O.buffer),t.push(v.buffer),{componentOffsets:U,featureIds:P,transformedGeometry:z,obb:n.obb}}function ue(e){return e===0?E.Unmodified:e===1?E.PotentiallyModified:e===2?E.Culled:E.Unknown}function X(e){const{context:t,buffer:r}=e,f=o._malloc(r.byteLength),i=r.byteLength/Float64Array.BYTES_PER_ELEMENT,d=new Float64Array(o.HEAPU8.buffer,f,i),s=new Float64Array(r);d.set(s),o.filterOBBs(t,f,i),s.set(d),o._free(f)}function H(e){o&&o.destroy(e)}function b(e,t){for(let r=0;r{o=e,_=null})),_)}const le={transform:k,destroy:H};export{ce as destroyContext,ie as dracoDecompressPointCloudData,se as filterObbsForModifications,X as filterObbsForModificationsSync,g as initialize,ue as interpretObbModificationResults,re as process,fe as setLegacySchema,ae as setModifications,W as setModificationsSync,le as test}; +import{at as G,cs as q,hg as c,c as J}from"./index.221827cd.js";import"./sphere.f99ddb50.js";import"./mat3f64.6d32a1d7.js";import"./mat4f64.ff2a477c.js";import"./quatf64.4ae3e6f1.js";var L,D;(function(e){e[e.None=0]="None",e[e.Int16=1]="Int16",e[e.Int32=2]="Int32"})(L||(L={})),function(e){e[e.Replace=0]="Replace",e[e.Outside=1]="Outside",e[e.Inside=2]="Inside",e[e.Finished=3]="Finished"}(D||(D={}));function K(){return T||(T=new Promise(e=>G(()=>import("./i3s.87f8afd0.js"),[]).then(t=>t.i).then(({default:t})=>{const r=t({locateFile:Q,onRuntimeInitialized:()=>e(r)});delete r.then})).catch(e=>{throw e})),T}function Q(e){return q(`esri/libs/i3s/${e}`)}let T;var N,E,x,B,$;(function(e){e[e.Unmodified=0]="Unmodified",e[e.Culled=1]="Culled",e[e.NotChecked=2]="NotChecked"})(N||(N={})),function(e){e[e.Unmodified=0]="Unmodified",e[e.PotentiallyModified=1]="PotentiallyModified",e[e.Culled=2]="Culled",e[e.Unknown=3]="Unknown",e[e.NotChecked=4]="NotChecked"}(E||(E={}));(function(e){e[e.Unknown=0]="Unknown",e[e.Uncached=1]="Uncached",e[e.Cached=2]="Cached"})(x||(x={})),function(e){e[e.None=0]="None",e[e.MaxScreenThreshold=1]="MaxScreenThreshold",e[e.ScreenSpaceRelative=2]="ScreenSpaceRelative",e[e.RemovedFeatureDiameter=3]="RemovedFeatureDiameter",e[e.DistanceRangeFromDefaultCamera=4]="DistanceRangeFromDefaultCamera"}(B||(B={})),function(e){e[e.Hole=0]="Hole",e[e.Leaf=1]="Leaf"}($||($={}));async function re(e){await g();const t=[e.geometryBuffer];return{result:k(e,t),transferList:t}}async function ie(e){var w;await g();const t=[e.geometryBuffer],{geometryBuffer:r}=e,f=r.byteLength,i=o._malloc(f),d=new Uint8Array(o.HEAPU8.buffer,i,f);d.set(new Uint8Array(r));const s=o.dracoDecompressPointCloudData(i,d.byteLength);if(o._free(i),s.error.length>0)throw`i3s.wasm: ${s.error}`;const p=((w=s.featureIds)==null?void 0:w.length)>0?c(s.featureIds):null,h=c(s.positions);return p&&t.push(p.buffer),t.push(h.buffer),{result:{positions:h,featureIds:p},transferList:t}}async function se(e){await g(),X(e);const t={buffer:e.buffer};return{result:t,transferList:[t.buffer]}}async function ae(e){await g(),W(e)}async function fe(e){await g(),o.setLegacySchema(e.context,e.jsonSchema)}function ce(e){H(e)}let _,o;function W(e){const t=e.modifications,r=o._malloc(8*t.length),f=new Float64Array(o.HEAPU8.buffer,r,t.length);for(let i=0;im.some(y=>y.name==="color")),normal:e.needNormals&&e.layouts.some(m=>m.some(y=>y.name==="normalCompressed")),uv0:e.layouts.some(m=>m.some(y=>y.name==="uv0")),uvRegion:e.layouts.some(m=>m.some(y=>y.name==="uvRegion")),featureIndex:M.featureIndex},n=o.process(r,!!e.obb,A,R.byteLength,M,j,I,p,Y,V,e.normalReferenceFrame);if(o._free(I),o._free(A),n.error.length>0)throw`i3s.wasm: ${n.error}`;if(n.discarded)return null;const U=n.componentOffsets.length>0?c(n.componentOffsets):null,P=n.featureIds.length>0?c(n.featureIds):null,S=c(n.interleavedVertedData).buffer,C=n.indicesType===L.Int16?c(new Uint16Array(n.indices.buffer,n.indices.byteOffset,n.indices.byteLength/2)):c(new Uint32Array(n.indices.buffer,n.indices.byteOffset,n.indices.byteLength/4)),O=c(n.positions),v=n.positionIndicesType===L.Int16?c(new Uint16Array(n.positionIndices.buffer,n.positionIndices.byteOffset,n.positionIndices.byteLength/2)):c(new Uint32Array(n.positionIndices.buffer,n.positionIndices.byteOffset,n.positionIndices.byteLength/4)),z={layout:e.layouts[0],interleavedVertexData:S,indices:C,hasColors:n.hasColors,hasModifications:n.hasModifications,positionData:{data:O,indices:v}};return P&&t.push(P.buffer),U&&t.push(U.buffer),t.push(S),t.push(C.buffer),t.push(O.buffer),t.push(v.buffer),{componentOffsets:U,featureIds:P,transformedGeometry:z,obb:n.obb}}function ue(e){return e===0?E.Unmodified:e===1?E.PotentiallyModified:e===2?E.Culled:E.Unknown}function X(e){const{context:t,buffer:r}=e,f=o._malloc(r.byteLength),i=r.byteLength/Float64Array.BYTES_PER_ELEMENT,d=new Float64Array(o.HEAPU8.buffer,f,i),s=new Float64Array(r);d.set(s),o.filterOBBs(t,f,i),s.set(d),o._free(f)}function H(e){o&&o.destroy(e)}function b(e,t){for(let r=0;r{o=e,_=null})),_)}const le={transform:k,destroy:H};export{ce as destroyContext,ie as dracoDecompressPointCloudData,se as filterObbsForModifications,X as filterObbsForModificationsSync,g as initialize,ue as interpretObbModificationResults,re as process,fe as setLegacySchema,ae as setModifications,W as setModificationsSync,le as test}; diff --git a/assets/SceneService.0f3bf01a.js b/assets/SceneService.9c2e5b40.js similarity index 97% rename from assets/SceneService.0f3bf01a.js rename to assets/SceneService.9c2e5b40.js index 65dfe78..aa07990 100644 --- a/assets/SceneService.0f3bf01a.js +++ b/assets/SceneService.9c2e5b40.js @@ -1,3 +1,3 @@ -import{c as I,U as v,n as y,i1 as L,cB as V,v as k,cQ as K,s as q,a6 as d,a7 as h,ip as M,aT as R,d2 as f,cU as A,eJ as F,eK as z,e0 as J,a8 as C,dn as D,iq as B,cy as Z,ir as G,is as H,it as Q,bX as N,cD as W,bW as T,at as X}from"./index.d94abe07.js";import{i as j}from"./originUtils.2d0aad75.js";import{getSiblingOfSameTypeI as Y}from"./resourceUtils.6d10bf82.js";async function ee(n,s,e,t,o,r){let a=null;if(I(e)){const i=`${n}/nodepages/`,u=i+Math.floor(e.rootIndex/e.nodesPerPage);try{return{type:"page",rootPage:(await v(u,{query:{f:"json",token:t},responseType:"json",signal:r})).data,rootIndex:e.rootIndex,pageSize:e.nodesPerPage,lodMetric:e.lodSelectionMetricType,urlPrefix:i}}catch(p){I(o)&&o.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",u,p),a=p}}if(!s)return null;const l=`${n}/nodes/`,c=l+(s&&s.split("/").pop());try{return{type:"node",rootNode:(await v(c,{query:{f:"json",token:t},responseType:"json",signal:r})).data,urlPrefix:l}}catch(i){throw new y("sceneservice:root-node-missing","Root node missing.",{pageError:a,nodeError:i,url:c})}}async function O(n,s,e){if(!s||!s.resources)return;const t=s.portalItem===n.portalItem?new Set(n.paths):new Set;n.paths.length=0,n.portalItem=s.portalItem;const o=new Set(s.resources.toKeep.map(i=>i.resource.path)),r=new Set,a=[];o.forEach(i=>{t.delete(i),n.paths.push(i)});for(const i of s.resources.toUpdate)if(t.delete(i.resource.path),o.has(i.resource.path)||r.has(i.resource.path)){const{resource:u,content:p,finish:b,error:_}=i,w=Y(u,L());n.paths.push(w.path),a.push($({resource:w,content:p,compress:i.compress,finish:b,error:_},e))}else n.paths.push(i.resource.path),a.push(te(i,e)),r.add(i.resource.path);for(const i of s.resources.toAdd)a.push($(i,e)),n.paths.push(i.resource.path);if(t.forEach(i=>{const u=s.portalItem.resourceFromPath(i);a.push(u.portalItem.removeResource(u).catch(()=>{}))}),a.length===0)return;const l=await V(a);k(e);const c=l.filter(i=>"error"in i).map(i=>i.error);if(c.length>0)throw new y("save:resources","Failed to save one or more resources",{errors:c})}async function $(n,s){const e={...I(s)?s:{},compress:n.compress},t=await K(n.resource.portalItem.addResource(n.resource,n.content,e));if(t.ok!==!0)throw n.error&&n.error(t.error),t.error;n.finish&&n.finish(n.resource)}async function te(n,s){const e=await K(n.resource.update(n.content,s));if(e.ok!==!0)throw n.error(e.error),e.error;n.finish(n.resource)}const P="esri.layers.mixins.SceneService",m=q.getLogger(P),ie=n=>{let s=class extends n{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.indexInfo=null,this._debouncedSaveOperations=D(async(e,t,o)=>{switch(e){case x.SAVE:return this._save(t);case x.SAVE_AS:return this._saveAs(o,t)}})}readSpatialReference(e,t){return this._readSpatialReference(t)}_readSpatialReference(e){if(e.spatialReference!=null)return R.fromJSON(e.spatialReference);{const t=e.store,o=t.indexCRS||t.geographicCRS,r=o&&parseInt(o.substring(o.lastIndexOf("/")+1,o.length),10);return r!=null?new R(r):null}}readFullExtent(e,t,o){if(e!=null&&typeof e=="object"){const l=e.spatialReference==null?{...e,spatialReference:this._readSpatialReference(t)}:e;return A.fromJSON(l,o)}const r=t.store,a=this._readSpatialReference(t);return a==null||r==null||r.extent==null||!Array.isArray(r.extent)||r.extent.some(l=>l=2&&(t.major=parseInt(o[0],10),t.minor=parseInt(o[1],10)),t}readVersion(e,t){const o=t.store,r=o.version!=null?o.version.toString():"";return this.parseVersionString(r)}readTitlePortalItem(e){return this.sublayerTitleMode!=="item-title"?void 0:e}readTitleService(e,t){const o=this.portalItem&&this.portalItem.title;if(this.sublayerTitleMode==="item-title")return B(this.url,t.name);let r=t.name;if(!r&&this.url){const a=Z(this.url);I(a)&&(r=a.title)}return this.sublayerTitleMode==="item-title-and-service-name"&&o&&(r=o+" - "+r),G(r)}set url(e){const t=H({layer:this,url:e,nonStandardUrlAllowed:!1,logger:m});this._set("url",t.url),t.layerId!=null&&this._set("layerId",t.layerId)}writeUrl(e,t,o,r){Q(this,e,"layers",t,r)}get parsedUrl(){const e=this._get("url"),t=N(e);return this.layerId!=null&&(t.path=`${t.path}/layers/${this.layerId}`),t}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=ee(this.parsedUrl.path,this.rootNode,e,this.apiKey,m,t),this.fullExtent==null||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(e){var t,o,r;if((e==null?void 0:e.type)==="page"){const a=e.rootIndex%e.pageSize,l=(o=(t=e.rootPage)==null?void 0:t.nodes)==null?void 0:o[a];if(l==null||l.obb==null||l.obb.center==null||l.obb.halfSize==null)throw new y("sceneservice:invalid-node-page","Invalid node page.");if(l.obb.center[0]0)return t.data.layers[0].id}async _fetchServiceLayer(e){var a,l;const t=await v((l=(a=this.parsedUrl)==null?void 0:a.path)!=null?l:"",{query:{f:"json",token:this.apiKey},responseType:"json",signal:e});t.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let o=!1;if(t.data.layerType&&t.data.layerType==="Voxel"&&(o=!0),o)return this._fetchVoxelServiceLayer();const r=t.data;this.read(r,{origin:"service",url:this.parsedUrl}),this.validateLayer(r)}async _fetchVoxelServiceLayer(e){var o;const t=(await v(((o=this.parsedUrl)==null?void 0:o.path)+"/layer",{query:{f:"json",token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,{origin:"service",url:this.parsedUrl}),this.validateLayer(t)}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&typeof this.beforeSave=="function"&&await this.beforeSave()}validateLayer(e){}_updateTypeKeywords(e,t,o){e.typeKeywords||(e.typeKeywords=[]);const r=t.getTypeKeywords();for(const a of r)e.typeKeywords.push(a);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((a,l,c)=>c.indexOf(a)===l),o===g.newItem&&(e.typeKeywords=e.typeKeywords.filter(a=>a!=="Hosted Service")))}async _saveAs(e,t){var i,u,p;const o={...U,...t};let r=W.from(e);r||(m.error("_saveAs(): requires a portal item parameter"),await Promise.reject(new y("sceneservice:portal-item-required","_saveAs() requires a portal item to save to"))),r.id&&(r=r.clone(),r.id=null);const a=r.portal||T.getDefault();await this._ensureLoadBeforeSave(),r.type=S,r.portal=a;const l={origin:"portal-item",url:null,messages:[],portal:a,portalItem:r,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},c={layers:[this.write({},l)]};return await Promise.all((u=(i=l.resources)==null?void 0:i.pendingOperations)!=null?u:[]),await this._validateAgainstJSONSchema(c,l,o),r.url=this.url,r.title||(r.title=this.title),this._updateTypeKeywords(r,o,g.newItem),await a._signIn(),await((p=a.user)==null?void 0:p.addItem({item:r,folder:o&&o.folder,data:c})),await O(this.resourceReferences,l,null),this.portalItem=r,j(l),l.portalItem=r,r}async _save(e){var a,l;const t={...U,...e};if(!this.portalItem)throw m.error("_save(): requires the .portalItem property to be set"),new y("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==S)throw m.error("_save(): Non-matching portal item type. Got "+this.portalItem.type+", expected "+S),new y("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${S}"`);await this._ensureLoadBeforeSave();const o={origin:"portal-item",url:this.portalItem.itemUrl&&N(this.portalItem.itemUrl),messages:[],portal:this.portalItem.portal||T.getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},r={layers:[this.write({},o)]};return await Promise.all((l=(a=o.resources)==null?void 0:a.pendingOperations)!=null?l:[]),await this._validateAgainstJSONSchema(r,o,t),this.portalItem.url=this.url,this.portalItem.title||(this.portalItem.title=this.title),this._updateTypeKeywords(this.portalItem,t,g.existingItem),await this.portalItem.update({data:r}),await O(this.resourceReferences,o,null),j(o),this.portalItem}async _validateAgainstJSONSchema(e,t,o){var a,l,c,i,u;let r=(l=(a=t.messages)==null?void 0:a.filter(p=>p.type==="error").map(p=>new y(p.name,p.message,p.details)))!=null?l:[];if(o&&((c=o.validationOptions)==null?void 0:c.ignoreUnsupported)&&(r=r.filter(p=>p.name!=="layer:unsupported"&&p.name!=="symbol:unsupported"&&p.name!=="symbol-layer:unsupported"&&p.name!=="property:unsupported"&&p.name!=="url:unsupported"&&p.name!=="scenemodification:unsupported")),((i=o.validationOptions)==null?void 0:i.enabled)||re){const p=(await X(()=>import("./schemaValidator.49ec0b34.js"),["assets/schemaValidator.49ec0b34.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/_commonjsHelpers.773c2c82.js"])).validate(e,o.portalItemLayerType);if(p.length>0){const b=`Layer item did not validate: +import{c as I,U as v,n as y,i1 as L,cB as V,v as k,cQ as K,s as q,a6 as d,a7 as h,ip as M,aT as R,d2 as f,cU as A,eJ as F,eK as z,e0 as J,a8 as C,dn as D,iq as B,cy as Z,ir as G,is as H,it as Q,bX as N,cD as W,bW as T,at as X}from"./index.221827cd.js";import{i as j}from"./originUtils.2d0aad75.js";import{getSiblingOfSameTypeI as Y}from"./resourceUtils.f4b6e42a.js";async function ee(n,s,e,t,o,r){let a=null;if(I(e)){const i=`${n}/nodepages/`,u=i+Math.floor(e.rootIndex/e.nodesPerPage);try{return{type:"page",rootPage:(await v(u,{query:{f:"json",token:t},responseType:"json",signal:r})).data,rootIndex:e.rootIndex,pageSize:e.nodesPerPage,lodMetric:e.lodSelectionMetricType,urlPrefix:i}}catch(p){I(o)&&o.warn("#fetchIndexInfo()","Failed to load root node page. Falling back to node documents.",u,p),a=p}}if(!s)return null;const l=`${n}/nodes/`,c=l+(s&&s.split("/").pop());try{return{type:"node",rootNode:(await v(c,{query:{f:"json",token:t},responseType:"json",signal:r})).data,urlPrefix:l}}catch(i){throw new y("sceneservice:root-node-missing","Root node missing.",{pageError:a,nodeError:i,url:c})}}async function O(n,s,e){if(!s||!s.resources)return;const t=s.portalItem===n.portalItem?new Set(n.paths):new Set;n.paths.length=0,n.portalItem=s.portalItem;const o=new Set(s.resources.toKeep.map(i=>i.resource.path)),r=new Set,a=[];o.forEach(i=>{t.delete(i),n.paths.push(i)});for(const i of s.resources.toUpdate)if(t.delete(i.resource.path),o.has(i.resource.path)||r.has(i.resource.path)){const{resource:u,content:p,finish:b,error:_}=i,w=Y(u,L());n.paths.push(w.path),a.push($({resource:w,content:p,compress:i.compress,finish:b,error:_},e))}else n.paths.push(i.resource.path),a.push(te(i,e)),r.add(i.resource.path);for(const i of s.resources.toAdd)a.push($(i,e)),n.paths.push(i.resource.path);if(t.forEach(i=>{const u=s.portalItem.resourceFromPath(i);a.push(u.portalItem.removeResource(u).catch(()=>{}))}),a.length===0)return;const l=await V(a);k(e);const c=l.filter(i=>"error"in i).map(i=>i.error);if(c.length>0)throw new y("save:resources","Failed to save one or more resources",{errors:c})}async function $(n,s){const e={...I(s)?s:{},compress:n.compress},t=await K(n.resource.portalItem.addResource(n.resource,n.content,e));if(t.ok!==!0)throw n.error&&n.error(t.error),t.error;n.finish&&n.finish(n.resource)}async function te(n,s){const e=await K(n.resource.update(n.content,s));if(e.ok!==!0)throw n.error(e.error),e.error;n.finish(n.resource)}const P="esri.layers.mixins.SceneService",m=q.getLogger(P),ie=n=>{let s=class extends n{constructor(){super(...arguments),this.spatialReference=null,this.fullExtent=null,this.heightModelInfo=null,this.minScale=0,this.maxScale=0,this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.copyright=null,this.sublayerTitleMode="item-title",this.title=null,this.layerId=null,this.indexInfo=null,this._debouncedSaveOperations=D(async(e,t,o)=>{switch(e){case x.SAVE:return this._save(t);case x.SAVE_AS:return this._saveAs(o,t)}})}readSpatialReference(e,t){return this._readSpatialReference(t)}_readSpatialReference(e){if(e.spatialReference!=null)return R.fromJSON(e.spatialReference);{const t=e.store,o=t.indexCRS||t.geographicCRS,r=o&&parseInt(o.substring(o.lastIndexOf("/")+1,o.length),10);return r!=null?new R(r):null}}readFullExtent(e,t,o){if(e!=null&&typeof e=="object"){const l=e.spatialReference==null?{...e,spatialReference:this._readSpatialReference(t)}:e;return A.fromJSON(l,o)}const r=t.store,a=this._readSpatialReference(t);return a==null||r==null||r.extent==null||!Array.isArray(r.extent)||r.extent.some(l=>l=2&&(t.major=parseInt(o[0],10),t.minor=parseInt(o[1],10)),t}readVersion(e,t){const o=t.store,r=o.version!=null?o.version.toString():"";return this.parseVersionString(r)}readTitlePortalItem(e){return this.sublayerTitleMode!=="item-title"?void 0:e}readTitleService(e,t){const o=this.portalItem&&this.portalItem.title;if(this.sublayerTitleMode==="item-title")return B(this.url,t.name);let r=t.name;if(!r&&this.url){const a=Z(this.url);I(a)&&(r=a.title)}return this.sublayerTitleMode==="item-title-and-service-name"&&o&&(r=o+" - "+r),G(r)}set url(e){const t=H({layer:this,url:e,nonStandardUrlAllowed:!1,logger:m});this._set("url",t.url),t.layerId!=null&&this._set("layerId",t.layerId)}writeUrl(e,t,o,r){Q(this,e,"layers",t,r)}get parsedUrl(){const e=this._get("url"),t=N(e);return this.layerId!=null&&(t.path=`${t.path}/layers/${this.layerId}`),t}async _fetchIndexAndUpdateExtent(e,t){this.indexInfo=ee(this.parsedUrl.path,this.rootNode,e,this.apiKey,m,t),this.fullExtent==null||this.fullExtent.hasZ||this._updateExtent(await this.indexInfo)}_updateExtent(e){var t,o,r;if((e==null?void 0:e.type)==="page"){const a=e.rootIndex%e.pageSize,l=(o=(t=e.rootPage)==null?void 0:t.nodes)==null?void 0:o[a];if(l==null||l.obb==null||l.obb.center==null||l.obb.halfSize==null)throw new y("sceneservice:invalid-node-page","Invalid node page.");if(l.obb.center[0]0)return t.data.layers[0].id}async _fetchServiceLayer(e){var a,l;const t=await v((l=(a=this.parsedUrl)==null?void 0:a.path)!=null?l:"",{query:{f:"json",token:this.apiKey},responseType:"json",signal:e});t.ssl&&(this.url=this.url.replace(/^http:/i,"https:"));let o=!1;if(t.data.layerType&&t.data.layerType==="Voxel"&&(o=!0),o)return this._fetchVoxelServiceLayer();const r=t.data;this.read(r,{origin:"service",url:this.parsedUrl}),this.validateLayer(r)}async _fetchVoxelServiceLayer(e){var o;const t=(await v(((o=this.parsedUrl)==null?void 0:o.path)+"/layer",{query:{f:"json",token:this.apiKey},responseType:"json",signal:e})).data;this.read(t,{origin:"service",url:this.parsedUrl}),this.validateLayer(t)}async _ensureLoadBeforeSave(){await this.load(),"beforeSave"in this&&typeof this.beforeSave=="function"&&await this.beforeSave()}validateLayer(e){}_updateTypeKeywords(e,t,o){e.typeKeywords||(e.typeKeywords=[]);const r=t.getTypeKeywords();for(const a of r)e.typeKeywords.push(a);e.typeKeywords&&(e.typeKeywords=e.typeKeywords.filter((a,l,c)=>c.indexOf(a)===l),o===g.newItem&&(e.typeKeywords=e.typeKeywords.filter(a=>a!=="Hosted Service")))}async _saveAs(e,t){var i,u,p;const o={...U,...t};let r=W.from(e);r||(m.error("_saveAs(): requires a portal item parameter"),await Promise.reject(new y("sceneservice:portal-item-required","_saveAs() requires a portal item to save to"))),r.id&&(r=r.clone(),r.id=null);const a=r.portal||T.getDefault();await this._ensureLoadBeforeSave(),r.type=S,r.portal=a;const l={origin:"portal-item",url:null,messages:[],portal:a,portalItem:r,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},c={layers:[this.write({},l)]};return await Promise.all((u=(i=l.resources)==null?void 0:i.pendingOperations)!=null?u:[]),await this._validateAgainstJSONSchema(c,l,o),r.url=this.url,r.title||(r.title=this.title),this._updateTypeKeywords(r,o,g.newItem),await a._signIn(),await((p=a.user)==null?void 0:p.addItem({item:r,folder:o&&o.folder,data:c})),await O(this.resourceReferences,l,null),this.portalItem=r,j(l),l.portalItem=r,r}async _save(e){var a,l;const t={...U,...e};if(!this.portalItem)throw m.error("_save(): requires the .portalItem property to be set"),new y("sceneservice:portal-item-not-set","Portal item to save to has not been set on this SceneService");if(this.portalItem.type!==S)throw m.error("_save(): Non-matching portal item type. Got "+this.portalItem.type+", expected "+S),new y("sceneservice:portal-item-wrong-type",`Portal item needs to have type "${S}"`);await this._ensureLoadBeforeSave();const o={origin:"portal-item",url:this.portalItem.itemUrl&&N(this.portalItem.itemUrl),messages:[],portal:this.portalItem.portal||T.getDefault(),portalItem:this.portalItem,writtenProperties:[],blockedRelativeUrls:[],resources:{toAdd:[],toUpdate:[],toKeep:[],pendingOperations:[]}},r={layers:[this.write({},o)]};return await Promise.all((l=(a=o.resources)==null?void 0:a.pendingOperations)!=null?l:[]),await this._validateAgainstJSONSchema(r,o,t),this.portalItem.url=this.url,this.portalItem.title||(this.portalItem.title=this.title),this._updateTypeKeywords(this.portalItem,t,g.existingItem),await this.portalItem.update({data:r}),await O(this.resourceReferences,o,null),j(o),this.portalItem}async _validateAgainstJSONSchema(e,t,o){var a,l,c,i,u;let r=(l=(a=t.messages)==null?void 0:a.filter(p=>p.type==="error").map(p=>new y(p.name,p.message,p.details)))!=null?l:[];if(o&&((c=o.validationOptions)==null?void 0:c.ignoreUnsupported)&&(r=r.filter(p=>p.name!=="layer:unsupported"&&p.name!=="symbol:unsupported"&&p.name!=="symbol-layer:unsupported"&&p.name!=="property:unsupported"&&p.name!=="url:unsupported"&&p.name!=="scenemodification:unsupported")),((i=o.validationOptions)==null?void 0:i.enabled)||re){const p=(await X(()=>import("./schemaValidator.90689324.js"),["assets/schemaValidator.90689324.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/_commonjsHelpers.773c2c82.js"])).validate(e,o.portalItemLayerType);if(p.length>0){const b=`Layer item did not validate: ${p.join(` `)}`;if(m.error(`_validateAgainstJSONSchema(): ${b}`),((u=o.validationOptions)==null?void 0:u.failPolicy)==="throw"){const _=p.map(w=>new y("sceneservice:schema-validation",w)).concat(r);throw new y("sceneservice-validate:error","Failed to save layer item due to schema validation, see `details.errors`.",{combined:_})}}}if(r.length>0)throw new y("sceneservice:save","Failed to save SceneService due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:r})}};return d([h(M)],s.prototype,"id",void 0),d([h({type:R})],s.prototype,"spatialReference",void 0),d([f("spatialReference",["spatialReference","store.indexCRS","store.geographicCRS"])],s.prototype,"readSpatialReference",null),d([h({type:A})],s.prototype,"fullExtent",void 0),d([f("fullExtent",["fullExtent","store.extent","spatialReference","store.indexCRS","store.geographicCRS"])],s.prototype,"readFullExtent",null),d([h({readOnly:!0,type:F})],s.prototype,"heightModelInfo",void 0),d([h({type:Number,json:{name:"layerDefinition.minScale",write:!0,origins:{service:{read:{source:"minScale"},write:!1}}}})],s.prototype,"minScale",void 0),d([h({type:Number,json:{name:"layerDefinition.maxScale",write:!0,origins:{service:{read:{source:"maxScale"},write:!1}}}})],s.prototype,"maxScale",void 0),d([h({readOnly:!0})],s.prototype,"version",void 0),d([f("version",["store.version"])],s.prototype,"readVersion",null),d([h({type:String,json:{read:{source:"copyrightText"}}})],s.prototype,"copyright",void 0),d([h({type:String,json:{read:!1}})],s.prototype,"sublayerTitleMode",void 0),d([h({type:String})],s.prototype,"title",void 0),d([f("portal-item","title")],s.prototype,"readTitlePortalItem",null),d([f("service","title",["name"])],s.prototype,"readTitleService",null),d([h({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{write:{target:"id",isRequired:!0,ignoreOrigin:!0},read:!1}}}})],s.prototype,"layerId",void 0),d([h(z)],s.prototype,"url",null),d([J("url")],s.prototype,"writeUrl",null),d([h()],s.prototype,"parsedUrl",null),d([h({readOnly:!0})],s.prototype,"store",void 0),d([h({type:String,readOnly:!0,json:{read:{source:"store.rootNode"}}})],s.prototype,"rootNode",void 0),s=d([C(P)],s),s},E=-1e38,re=!1;var g;(function(n){n[n.existingItem=0]="existingItem",n[n.newItem=1]="newItem"})(g||(g={}));const S="Scene Service",U={getTypeKeywords:()=>[],portalItemLayerType:"unknown",validationOptions:{enabled:!0,ignoreUnsupported:!1,failPolicy:"throw"}};var x;(function(n){n[n.SAVE=0]="SAVE",n[n.SAVE_AS=1]="SAVE_AS"})(x||(x={}));export{x as L,ie as N,ee as n}; diff --git a/assets/SpatialFilter.dc70612a.js b/assets/SpatialFilter.fd0a95ff.js similarity index 99% rename from assets/SpatialFilter.dc70612a.js rename to assets/SpatialFilter.fd0a95ff.js index 2a27454..58a1e9a 100644 --- a/assets/SpatialFilter.dc70612a.js +++ b/assets/SpatialFilter.fd0a95ff.js @@ -1 +1 @@ -import{a8 as q,a2 as d,a9 as k,aa as H,ab as J,ac as Y,$ as j,a0 as T,ad as V,ae as W,af as L,ag as C,ah as U}from"./arcadeUtils.9e078218.js";import{ba as x,aT as Z,ci as X,hD as O}from"./index.d94abe07.js";import{WhereClause as I}from"./WhereClause.253310fe.js";import{b as z,K as ee,W as te,M as ne,F as re,R as se,m as ae,S as ie,x as le,O as ue,p as oe,h as G}from"./geometryEngineAsync.3b47a469.js";var p;(function(s){s.InvalidFunctionParameters="InvalidFunctionParameters",s.UnsupportedSqlFunction="UnsupportedSqlFunction",s.UnsupportedOperator="UnsupportedOperator",s.UnsupportedSyntax="UnsupportedSyntax",s.UnsupportedIsRhs="UnsupportedIsRhs",s.UnsupportedIsLhs="UnsupportedIsLhs",s.MissingStatisticParameters="MissingStatisticParameters"})(p||(p={}));const ce={[p.MissingStatisticParameters]:"Statistic does not have 1 or 0 Parameters",[p.InvalidFunctionParameters]:"Invalid parameters for call to {function}",[p.UnsupportedIsLhs]:"Unsupported left hand expression in is statement",[p.UnsupportedIsRhs]:"Unsupported right hand expression in is statement",[p.UnsupportedOperator]:"Unsupported operator - {operator}",[p.UnsupportedSyntax]:"Unsupported syntax - {node}",[p.UnsupportedSqlFunction]:"Sql function not found = {function}"};class g extends Error{constructor(e,t){super(q(ce[e],t)),this.declaredRootClass="esri.arcade.featureset.support.sqlerror",Error.captureStackTrace&&Error.captureStackTrace(this,g)}}var f;(function(s){s.NeverReach="NeverReach",s.NotImplemented="NotImplemented",s.Cancelled="Cancelled",s.InvalidStatResponse="InvalidStatResponse",s.InvalidRequest="InvalidRequest",s.RequestFailed="RequestFailed",s.MissingFeatures="MissingFeatures",s.AggregationFieldNotFound="AggregationFieldNotFound",s.DataElementsNotFound="DataElementsNotFound"})(f||(f={}));const he={[f.Cancelled]:"Cancelled",[f.InvalidStatResponse]:"Invalid statistics response from service",[f.InvalidRequest]:"Invalid request",[f.RequestFailed]:"Request failed - {reason}",[f.MissingFeatures]:"Missing features",[f.AggregationFieldNotFound]:"Aggregation field not found",[f.DataElementsNotFound]:"Data elements not found on service",[f.NeverReach]:"Encountered unreachable logic",[f.NotImplemented]:"Not implemented"};class m extends Error{constructor(e,t){super(q(he[e],t)),this.declaredRootClass="esri.arcade.featureset.support.featureseterror",Error.captureStackTrace&&Error.captureStackTrace(this,m)}}class R{constructor(){this._databaseTypeMetaData={},this._layerInfo={}}clearDatabaseType(e){this._databaseTypeMetaData[e]===void 0&&delete this._databaseTypeMetaData[e]}getDatabaseType(e){return e==="MUSTBESET"||this._databaseTypeMetaData[e]===void 0?null:this._databaseTypeMetaData[e]}setDatabaseType(e,t){this._databaseTypeMetaData[e]=t}getLayerInfo(e){return this._layerInfo[e]===void 0?null:this._layerInfo[e]}setLayerInfo(e,t){this._layerInfo[e]=t}clearLayerInfo(e){this._layerInfo[e]!==void 0&&delete this._layerInfo[e]}}R.applicationCache=null;class de{constructor(e,t){this._lastId=-1,this._progress=t,this._parent=e}reset(){this._lastId=-1}nextBatch(e){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(r=>this.nextBatch(e),r=>this.nextBatch(e));const t={returnpromise:null,hasset:!1},n=[];return t.returnpromise=new Promise((r,a)=>{this._parent._getSet(this._progress).then(i=>{const l=x(i._known,"known");let u=l.length-1;if(l[l.length-1]==="GETPAGES"&&(u-=1),this._lastId+e>u&&l.length>0&&l[l.length-1]==="GETPAGES")return void this._parent._expandPagedSet(i,this._parent._maxQueryRate(),0,0,this._progress).then(_=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)},_=>{t.hasset=!0,this._parent._mainSetInUse=null,a(_)});const o=x(i._candidates,"candidates");if(u>=this._lastId+e||o.length===0){for(let _=0;_=l.length)break;n[_]=l[w]}return this._lastId+=n.length,n.length===0&&(t.hasset=!0,this._parent._mainSetInUse=null,r([])),void this._parent._getFeatureBatch(n,this._progress).then(_=>{t.hasset=!0,this._parent._mainSetInUse=null,r(_)},_=>{t.hasset=!0,this._parent._mainSetInUse=null,a(_)})}this._parent._refineSetBlock(i,this._parent._maxProcessingRate(),this._progress).then(()=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)},_=>{t.hasset=!0,this._parent._mainSetInUse=null,a(_)})},i=>{t.hasset=!0,this._parent._mainSetInUse=null,a(i)})}),t.hasset===!1&&(this._parent._mainSetInUse=t.returnpromise,t.hasset=!0),t.returnpromise}next(){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(t=>this.next(),t=>this.next());const e={returnpromise:null,hasset:!1};return e.returnpromise=new Promise((t,n)=>{this._parent._getSet(this._progress).then(r=>{const a=x(r._known,"known");this._lastId(e.hasset=!0,this._parent._mainSetInUse=null,this.next())).then(t,n):(this._lastId+=1,this._parent._getFeature(r,a[this._lastId],this._progress).then(i=>{e.hasset=!0,this._parent._mainSetInUse=null,t(i)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,n(i)})):x(r._candidates,"candidates").length>0?this._parent._refineSetBlock(r,this._parent._maxProcessingRate(),this._progress).then(()=>{e.hasset=!0,this._parent._mainSetInUse=null,this.next().then(t,n)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,n(i)}):(e.hasset=!0,this._parent._mainSetInUse=null,t(null))},r=>{e.hasset=!0,this._parent._mainSetInUse=null,n(r)})}),e.hasset===!1&&(this._parent._mainSetInUse=e.returnpromise,e.hasset=!0),e.returnpromise}async count(){if(this._parent._totalCount!==-1)return this._parent._totalCount;const e=await this._parent._getSet(this._progress),t=await this._refineAllSets(e);return this._parent._totalCount=t._known.length,this._parent._totalCount}async _refineAllSets(e){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,1,this._progress),this._refineAllSets(e);if(e._candidates.length>0){if(e._known[e._candidates.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,2,this._progress),this._refineAllSets(e);const t=await this._parent._refineSetBlock(e,this._parent._maxProcessingRate(),this._progress);return t._candidates.length>0?this._refineAllSets(t):t}return e}}class v{constructor(e,t,n,r){this._lastFetchedIndex=0,this._ordered=!1,this.pagesDefinition=null,this._candidates=e,this._known=t,this._ordered=n,this.pagesDefinition=r}}function M(s,e){return c(s==null?void 0:s.parseTree,e,s==null?void 0:s.parameters)}function Ae(s,e,t){return c(s,e,t)}function ke(s,e,t,n){return I.create(c(s.parseTree,d.Standardised,s.parameters,e,t),n)}function Le(s,e,t="AND"){return I.create("(("+M(s,d.Standardised)+")"+t+"("+M(e,d.Standardised)+"))",s.fieldsIndex)}function c(s,e,t,n=null,r=null){let a,i,l,u;switch(s.type){case"interval":return me(c(s.value,e,t,n,r),s.qualifier,s.op);case"case-expression":{let o=" CASE ";s.format==="simple"&&(o+=c(s.operand,e,t,n,r));for(let _=0;_":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+c(s.left,e,t,n,r)+" "+s.operator+" "+c(s.right,e,t,n,r)+") "}throw new g(p.UnsupportedOperator,{operator:s.operator});case"null":return"null";case"boolean":return s.value===!0?"1":"0";case"string":return"'"+s.value.toString().replace(/'/g,"''")+"'";case"timestamp":case"date":return N(s.value,e);case"number":return s.value.toString();case"current-time":return _e(s.mode==="date",e);case"column-reference":return n&&n.toLowerCase()===s.column.toLowerCase()?"("+r+")":s.column;case"function":{const o=c(s.args,e,t,n,r);return pe(s.name,o,e)}}throw new g(p.UnsupportedSyntax,{node:s.type})}function pe(s,e,t){switch(s.toLowerCase().trim()){case"abs":if(e.length!==1)throw new g(p.InvalidFunctionParameters,{function:"abs"});return"abs("+e[0]+")";case"ceiling":case"ceil":if(e.length!==1)throw new g(p.InvalidFunctionParameters,{function:"ceiling"});switch(t){case d.Standardised:case d.StandardisedNoInterval:}return"CEILING("+e[0]+")";case"floor":if(e.length!==1)throw new g(p.InvalidFunctionParameters,{function:"floor"});return"FLOOR("+e[0]+")";case"log":if(e.length!==1)throw new g(p.InvalidFunctionParameters,{function:"log"});return"LOG("+e[0]+")";case"log10":if(e.length!==1)throw new g(p.InvalidFunctionParameters,{function:"log10"});return"LOG10("+e[0]+")";case"power":if(e.length!==2)throw new g(p.InvalidFunctionParameters,{function:"power"});return"POWER("+e[0]+","+e[1]+")";case"round":if(e.length===2)return"ROUND("+e[0]+","+e[1]+")";if(e.length===1)return"ROUND("+e[0]+")";throw new g(p.InvalidFunctionParameters,{function:"round"});case"truncate":if(e.length<1||e.length>2)throw new g(p.InvalidFunctionParameters,{function:"truncate"});return t===d.SqlServer?"ROUND("+e[0]+(e.length===1?"0":","+e[1])+",1)":"TRUNCATE("+e[0]+(e.length===1?")":","+e[1]+")");case"char_length":case"len":if(e.length!==1)throw new g(p.InvalidFunctionParameters,{function:"char_length"});switch(t){case d.SqlServer:return"LEN("+e[0]+")";case d.Oracle:return"LENGTH("+e[0]+")";default:return"CHAR_LENGTH("+e[0]+")"}case"concat":if(e.length<1)throw new g(p.InvalidFunctionParameters,{function:"concat"});{let n="CONCAT(";for(let r=0;r":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if(e.right.type!=="null")throw new g(p.UnsupportedIsRhs);return"boolean";case"*":case"-":case"+":case"/":return D([y(s,e.left,t,n),y(s,e.right,t,n)]);default:throw new g(p.UnsupportedOperator,{operator:e.operator})}case"null":return"";case"boolean":return"boolean";case"string":return"string";case"number":return e.value===null?"":e.value%1==0?"integer":"double";case"date":case"timestamp":case"current-time":return"date";case"column-reference":{const a=s[e.column.toLowerCase()];return a===void 0?"":a}case"function":switch(e.name.toLowerCase()){case"position":case"extract":case"char_length":return"integer";case"round":return r=y(s,e.args,t,n),r instanceof Array?r.length>0?r[0]:"":r;case"sign":return r=y(s,e.args,t,n),r instanceof Array&&(r=D(r)),r==="integer"||r==="double"?r:"double";case"ceiling":case"floor":case"abs":{const a=y(s,e.args,t,n);return a instanceof Array?D(a):a}case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"power":case"truncate":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string"}return""}throw new g(p.UnsupportedSyntax,{node:e.type})}const $={boolean:1,string:2,integer:3,double:4,date:5};function D(s){if(s){let e="";for(const t of s)t!==""&&(e=e===""||$[e]<$[t]?t:e);return e}return""}function Ce(s,e){return S(s.parseTree,e)}function ge(s){return(s==null?void 0:s.parseTree.type)==="column-reference"}function S(s,e){if(s==null)return!1;switch(s.type){case"when-clause":return S(s.operand,e)||S(s.value,e);case"case-expression":for(const t of s.clauses)if(S(t,e))return!0;return!(s.format!=="simple"||!S(s.operand,e))||!(s.else===null||!S(s.else,e));case"parameter":case"null":case"boolean":case"date":case"timestamp":case"string":case"number":return!1;case"expression-list":for(const t of s.value)if(S(t,e))return!0;return!1;case"unary-expression":return S(s.expr,e);case"binary-expression":return S(s.left,e)||S(s.right,e);case"column-reference":return e.toLowerCase()===s.column.toLowerCase();case"function":return S(s.args,e)}return!1}function A(s){let e="";return e+=s.period.toUpperCase(),e}function me(s,e,t){let n="";return n=e.type==="interval-period"?A(e):A(e.start)+" TO "+A(e.end),"INTERVAL "+t+" "+s+" "+n}function ye(s){return s=+s,isFinite(s)?s-s%1||(s<0?-0:s===0?s:0):s}function P(s){let e=0;for(let t=0;t=e&&e!==-1)return t}return t}function Ue(s){switch(s.toLowerCase()){case"distinct":return"distinct";case"avg":case"mean":return"avg";case"min":return"min";case"sum":return"sum";case"max":return"max";case"stdev":case"stddev":return"stddev";case"var":case"variance":return"var";case"count":return"count"}return""}function Oe(s,e,t=1e3){switch(s.toLowerCase()){case"distinct":return Se(e,t);case"avg":case"mean":return P(e);case"min":return Math.min.apply(Math,e);case"sum":return K(e);case"max":return Math.max.apply(Math,e);case"stdev":case"stddev":return Math.sqrt(B(e));case"var":case"variance":return B(e);case"count":return e.length}return 0}async function we(s,e,t){const n=await E(s,e,t,!0);return n.length===0?null:Math.min.apply(Math,n)}async function Ie(s,e,t){const n=await E(s,e,t,!0);return n.length===0?null:Math.max.apply(Math,n)}async function Fe(s,e,t){let n="";e&&!ge(e)&&(n=fe(e,s.fields));const r=await E(s,e,t,!0);if(r.length===0)return null;const a=P(r);return a===null?a:n==="integer"?ye(a):a}async function Te(s,e,t){const n=await E(s,e,t,!0);return n.length===0?null:Q(n)}async function be(s,e,t){const n=await E(s,e,t,!0);return n.length===0?null:Math.sqrt(Q(n))}async function ve(s,e,t){const n=await E(s,e,t,!0);return n.length===0?null:K(n)}async function Re(s,e){return s.iterator(e).count()}async function E(s,e,t,n=!1){const r=s.iterator(t),a=[],i={ticker:0};let l=await r.next();for(;l!==null;){if(i.ticker++,t.aborted)throw new m(f.Cancelled);i.ticker%100==0&&(i.ticker=0,await new Promise(o=>{setTimeout(o,0)}));const u=e==null?void 0:e.calculateValue(l);u===null?n===!1&&(a[a.length]=u):a[a.length]=u,l=await r.next()}return a}async function Ee(s,e,t=1e3,n=null){const r=s.iterator(n),a=[],i={},l={ticker:0};let u=await r.next();for(;u!==null;){if(l.ticker++,n&&n.aborted)throw new m(f.Cancelled);l.ticker%100==0&&(l.ticker=0,await new Promise(_=>{setTimeout(_,0)}));const o=e==null?void 0:e.calculateValue(u);if(o!=null&&i[o]===void 0&&(a.push(o),i[o]=1),a.length>=t&&t!==-1)return a;u=await r.next()}return a}class h{constructor(e){this.recentlyUsedQueries=null,this.featureSetQueryInterceptor=null,this._idstates=[],this._parent=null,this._wset=null,this._mainSetInUse=null,this._maxProcessing=200,this._maxQuery=500,this._totalCount=-1,this._databaseType=d.NotEvaluated,this._databaseTypeProbed=null,this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._featureCache=[],this.typeIdField=null,this.types=null,this.fields=null,this.geometryType="",this.objectIdField="",this.globalIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1,this._transparent=!1,this.loaded=!1,this._loadPromise=null,this._fieldsIndex=null,e&&e.lrucache&&(this.recentlyUsedQueries=e.lrucache),e&&e.interceptor&&(this.featureSetQueryInterceptor=e.interceptor)}optimisePagingFeatureQueries(e){this._parent&&this._parent.optimisePagingFeatureQueries(e)}_hasMemorySource(){return!0}prop(e,t){return t===void 0?this[e]:(this[e]!==void 0&&(this[e]=t),this)}end(){return this._parent!==null&&this._parent._transparent===!0?this._parent.end():this._parent}_ensureLoaded(){return this.load()}load(){return this._loadPromise===null&&(this._loadPromise=this.loadImpl()),this._loadPromise}async loadImpl(){var e,t;return((e=this._parent)==null?void 0:e.loaded)===!0?(this._initialiseFeatureSet(),this):(await((t=this._parent)==null?void 0:t.load()),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.fields=[],this.typeIdField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new Z({wkid:4326}),this.geometryType=j.point)}getField(e,t){let n;return(t=t||this.fields)&&(e=e.toLowerCase(),t.some(r=>(r&&r.name.toLowerCase()===e&&(n=r),!!n))),n}getFieldsIndex(){return this._fieldsIndex===null&&(this._fieldsIndex=new X(this.fields)),this._fieldsIndex}_maxProcessingRate(){return this._parent!==null?Math.min(this._maxProcessing,this._parent._maxProcessingRate()):Math.min(this._maxProcessing,this._maxQueryRate())}_maxQueryRate(){return this._parent!==null?Math.max(this._maxQuery,this._parent._maxQueryRate()):this._maxQuery}_checkCancelled(e){if(e!=null&&e.aborted)throw new m(f.Cancelled)}nativeCapabilities(){return this._parent.nativeCapabilities()}async _canDoAggregates(e,t,n,r,a){return this._parent!==null&&this._parent._canDoAggregates(e,t,n,r,a)}async _getAggregatePagesDataSourceDefinition(e,t,n,r,a,i,l){if(this._parent===null)throw new m(f.NeverReach);return this._parent._getAggregatePagesDataSourceDefinition(e,t,n,r,a,i,l)}async _getAgregagtePhysicalPage(e,t,n){if(this._parent===null)throw new m(f.NeverReach);return this._parent._getAgregagtePhysicalPage(e,t,n)}async databaseType(){if(this._databaseType===d.NotEvaluated){if(R.applicationCache!==null){const e=R.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(e!==null)return e}if(this._databaseTypeProbed!==null)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),R.applicationCache!==null&&R.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(e){throw R.applicationCache!==null&&R.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),e}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){const e=[{thetype:d.SqlServer,testwhere:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{thetype:d.Oracle,testwhere:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{thetype:d.StandardisedNoInterval,testwhere:"(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0"}];for(const t of e)if(await this._runDatabaseProbe(t.testwhere)===!0)return t.thetype;return d.StandardisedNoInterval}_cacheableFeatureSetSourceKey(){return"MUSTBESET"}async _runDatabaseProbe(e){if(this._parent!==null)return this._parent._runDatabaseProbe(e);throw new m(f.NotImplemented)}isTable(){var e,t;return(t=(e=this._parent)==null?void 0:e.isTable())!=null?t:!1}_featureFromCache(e){if(this._featureCache[e]!==void 0)return this._featureCache[e]}_isInFeatureSet(e){return T.Unknown}_getSet(e){throw new m(f.NotImplemented)}async _getFeature(e,t,n){if(this._checkCancelled(n),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);if(await this._getFeatures(e,t,this._maxProcessingRate(),n),this._checkCancelled(n),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);throw new m(f.MissingFeatures)}async _getFeatureBatch(e,t){this._checkCancelled(t);const n=new v([],e,!1,null),r=[];await this._getFeatures(n,-1,e.length,t),this._checkCancelled(t);for(const a of e)this._featureFromCache(a)!==void 0&&r.push(this._featureFromCache(a));return r}async _getFeatures(e,t,n,r){return"success"}_getFilteredSet(e,t,n,r,a){throw new m(f.NotImplemented)}async _refineSetBlock(e,t,n){if(this._checkIfNeedToExpandCandidatePage(e,this._maxQueryRate())===!0)return await this._expandPagedSet(e,this._maxQueryRate(),0,0,n),this._refineSetBlock(e,t,n);this._checkCancelled(n);const r=e._candidates.length;this._refineKnowns(e,t);let a=r-e._candidates.length;if(e._candidates.length===0||a>=t)return e;if(await this._refineIfParentKnown(e,t-a,n),this._checkCancelled(n),this._refineKnowns(e,t-a),a=r-e._candidates.length,a0){const i=t-a,l=this._prepareFetchAndRefineSet(e._candidates);return await this._fetchAndRefineFeatures(l,l.length>i?i:e._candidates.length,n),this._checkCancelled(n),this._refineKnowns(e,t-a),e}return e}_fetchAndRefineFeatures(e,t,n){return null}_prepareFetchAndRefineSet(e){const t=[];for(let n=0;n=t)break}r!==null&&a.push(r);for(let i=a.length-1;i>=0;i--)e._candidates.splice(a[i].start,a[i].end-a[i].start+1)}_refineIfParentKnown(e,t,n){const r=new v([],[],e._ordered,null);return r._candidates=e._candidates.slice(0),this._parent._refineSetBlock(r,t,n)}_candidateIdTransform(e){return this._parent._candidateIdTransform(e)}_checkIfNeedToExpandKnownPage(e,t){if(e.pagesDefinition===null)return!1;let n=0;for(let r=e._lastFetchedIndex;r=t))break}return!1}_checkIfNeedToExpandCandidatePage(e,t){if(e.pagesDefinition===null)return!1;let n=0;for(let r=0;r=t)break}return!1}async _expandPagedSet(e,t,n,r,a){if(this._parent===null)throw new m(f.NotImplemented);return this._parent._expandPagedSet(e,t,n,r,a)}async _expandPagedSetFeatureSet(e,t,n,r,a){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"&&(r=1),r===0&&e._candidates.length>0&&e._candidates[e._candidates.length-1]==="GETPAGES"&&(r=2),r===0)return"finished";const i=await this._getPage(e,r,a);return n+ie.pagesDefinition.resultOffset||e.pagesDefinition.internal.fullyResolved===!0){r.length=r.length-1;let a=0;for(let l=0;l=e.pagesDefinition.internal.set.length);l++)r[r.length]=e.pagesDefinition.internal.set[e.pagesDefinition.resultOffset+l],a++;e.pagesDefinition.resultOffset+=a;let i=!1;return e.pagesDefinition.internal.fullyResolved===!0&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset&&(i=!0),i===!1&&r.push("GETPAGES"),a}return await this._getPhysicalPage(e,t,n),this._getPage(e,t,n)}_getPhysicalPage(e,t,n){return null}_clonePageDefinition(e){return this._parent===null?null:this._parent._clonePageDefinition(e)}_first(e){return this.iterator(e).next()}first(e){return this._first(e)}async calculateStatistic(e,t,n,r){await this._ensureLoaded();let a=await this._stat(e,t,"",null,null,n,r);return a.calculated===!1&&(a=await this._manualStat(e,t,n,r)),a.result}async _manualStat(e,t,n,r){let a=null;switch(e.toLowerCase()){case"count":return a=await Re(this,r),{calculated:!0,result:a};case"distinct":return a=await Ee(this,t,n,r),{calculated:!0,result:a};case"avg":case"mean":return a=await Fe(this,t,r),{calculated:!0,result:a};case"stdev":return a=await be(this,t,r),{calculated:!0,result:a};case"variance":return a=await Te(this,t,r),{calculated:!0,result:a};case"sum":return a=await ve(this,t,r),{calculated:!0,result:a};case"min":return a=await we(this,t,r),{calculated:!0,result:a};case"max":return a=await Ie(this,t,r),{calculated:!0,result:a};default:return{calculated:!0,result:0}}}async _stat(e,t,n,r,a,i,l){const u=await this._parent._stat(e,t,n,r,a,i,l);return u.calculated===!1?a===null&&n===""&&r===null?this._manualStat(e,t,i,l):{calculated:!1}:u}_unionAllGeomSelf(e){const t=this.iterator(this._defaultTracker(e)),n=[];return new Promise((r,a)=>{this._unionShapeInBatches(n,t,r,a)})}_unionAllGeom(e){return new Promise((t,n)=>{const r=this.iterator(this._defaultTracker(e)),a=[];this._unionShapeInBatches(a,r,t,n)})}_unionShapeInBatches(e,t,n,r){t.next().then(a=>{try{a!==null&&a.geometry!==null&&e.push(a.geometry),e.length>30||a===null&&e.length>1?z(e).then(i=>{try{a===null?n(i):(e=[i],this._unionShapeInBatches(e,t,n,r))}catch(l){r(l)}},r):a===null?e.length===1?n(e[0]):n(null):this._unionShapeInBatches(e,t,n,r)}catch(i){r(i)}},r)}iterator(e){return new de(this,e)}intersection(e,t=!1){return h._featuresetFunctions.intersection.bind(this)(e,t)}difference(e,t=!1,n=!0){return h._featuresetFunctions.difference.bind(this)(e,t,n)}symmetricDifference(e,t=!1,n=!0){return h._featuresetFunctions.symmetricDifference.bind(this)(e,t,n)}morphShape(e,t,n="unknown",r=null){return h._featuresetFunctions.morphShape.bind(this)(e,t,n,r)}morphShapeAndAttributes(e,t,n="unknown"){return h._featuresetFunctions.morphShapeAndAttributes.bind(this)(e,t,n)}union(e,t=!1){return h._featuresetFunctions.union.bind(this)(e,t)}intersects(e){return h._featuresetFunctions.intersects.bind(this)(e)}envelopeIntersects(e){return h._featuresetFunctions.envelopeIntersects.bind(this)(e)}contains(e){return h._featuresetFunctions.contains.bind(this)(e)}overlaps(e){return h._featuresetFunctions.overlaps.bind(this)(e)}relate(e,t){return h._featuresetFunctions.relate.bind(this)(e,t)}within(e){return h._featuresetFunctions.within.bind(this)(e)}touches(e){return h._featuresetFunctions.touches.bind(this)(e)}top(e){return h._featuresetFunctions.top.bind(this)(e)}crosses(e){return h._featuresetFunctions.crosses.bind(this)(e)}buffer(e,t,n,r=!0){return h._featuresetFunctions.buffer.bind(this)(e,t,n,r)}filter(e,t=null){return h._featuresetFunctions.filter.bind(this)(e,t)}orderBy(e){return h._featuresetFunctions.orderBy.bind(this)(e)}dissolve(e,t){return h._featuresetFunctions.dissolve.bind(this)(e,t)}groupby(e,t){return h._featuresetFunctions.groupby.bind(this)(e,t)}reduce(e,t=null,n){return new Promise((r,a)=>{this._reduceImpl(this.iterator(this._defaultTracker(n)),e,t,0,r,a,0)})}_reduceImpl(e,t,n,r,a,i,l){try{if(++l>1e3)return void setTimeout(()=>{l=0,this._reduceImpl(e,t,n,r,a,i,l)});e.next().then(u=>{try{if(u===null)a(n);else{const o=t(n,u,r,this);O(o)?o.then(_=>{this._reduceImpl(e,t,_,r+1,a,i,l)},i):this._reduceImpl(e,t,o,r+1,a,i,l)}}catch(o){i(o)}},i)}catch(u){i(u)}}removeField(e){return h._featuresetFunctions.removeField.bind(this)(e)}addField(e,t,n=null){return h._featuresetFunctions.addField.bind(this)(e,t,n)}sumArea(e,t=!1,n){const r=V(e);return this.reduce((a,i)=>i.geometry===null?0:t?ee(i.geometry,r).then(l=>a+l):te(i.geometry,r).then(l=>a+l),0,n)}sumLength(e,t=!1,n){const r=W(e);return this.reduce((a,i)=>i.geometry===null?0:t?ne(i.geometry,r).then(l=>a+l):re(i.geometry,r).then(l=>a+l),0,n)}_substituteVars(e,t){if(t!==null){const n={};for(const r in t)n[r.toLowerCase()]=t[r];e.parameters=n}}async distinct(e,t=1e3,n=null,r){await this.load();const a=I.create(e,this.getFieldsIndex());return this._substituteVars(a,n),this.calculateStatistic("distinct",a,t,this._defaultTracker(r))}async min(e,t=null,n){await this.load();const r=I.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("min",r,-1,this._defaultTracker(n))}async max(e,t=null,n){await this.load();const r=I.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("max",r,-1,this._defaultTracker(n))}async avg(e,t=null,n){await this.load();const r=I.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("avg",r,-1,this._defaultTracker(n))}async sum(e,t=null,n){await this.load();const r=I.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("sum",r,-1,this._defaultTracker(n))}async stdev(e,t=null,n){await this.load();const r=I.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("stdev",r,-1,this._defaultTracker(n))}async variance(e,t=null,n){await this.load();const r=I.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("variance",r,-1,this._defaultTracker(n))}async count(e){return await this.load(),this.calculateStatistic("count",I.create("1",this.getFieldsIndex()),-1,this._defaultTracker(e))}_defaultTracker(e){return e||{aborted:!1}}forEach(e,t){return new Promise((n,r)=>{this._forEachImpl(this.iterator(this._defaultTracker(t)),e,this,n,r,0)})}_forEachImpl(e,t,n,r,a,i){try{if(++i>1e3)return void setTimeout(()=>{i=0,this._forEachImpl(e,t,n,r,a,i)},0);e.next().then(l=>{try{if(l===null)r(n);else{const u=t(l);u==null?this._forEachImpl(e,t,n,r,a,i):O(u)?u.then(()=>{try{this._forEachImpl(e,t,n,r,a,i)}catch(o){a(o)}},a):this._forEachImpl(e,t,n,r,a,i)}}catch(u){a(u)}},a)}catch(l){a(l)}}convertToJSON(e){const t={layerDefinition:{geometryType:this.geometryType,fields:[]},featureSet:{features:[],geometryType:this.geometryType}};for(let n=0;n{const a={geometry:r.geometry&&r.geometry.toJSON(),attributes:{}};for(const i in r.attributes)a.attributes[i]=r.attributes[i];return t.featureSet.features.push(a),1},0,e).then(()=>t)}castToText(e=!1){return"object, FeatureSet"}queryAttachments(e,t,n,r,a){return this._parent.queryAttachments(e,t,n,r,a)}serviceUrl(){return this._parent.serviceUrl()}subtypes(){return this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map(e=>({name:e.name,code:e.id})):[]}:null}relationshipMetaData(){return this._parent.relationshipMetaData()}get gdbVersion(){return this._parent?this._parent.gdbVersion:""}schema(){const e=[];for(const t of this.fields)e.push(L(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:C[this.geometryType]===void 0?"":C[this.geometryType],fields:e}}async convertToText(e,t){if(e==="schema")return await this._ensureLoaded(),JSON.stringify(this.schema());if(e==="featureset"){await this._ensureLoaded();const n=[];await this.reduce((a,i)=>{const l={geometry:i.geometry?i.geometry.toJSON():null,attributes:i.attributes};return l.geometry!==null&&l.geometry.spatialReference&&delete l.geometry.spatialReference,n.push(l),1},0,t);const r=this.schema();return r.features=n,r.spatialReference=this.spatialReference.toJSON(),JSON.stringify(r)}return this.castToText()}getFeatureByObjectId(e,t){return this._parent.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._parent.getOwningSystemUrl()}getIdentityUser(){return this._parent.getIdentityUser()}getRootFeatureSet(){return this._parent!==null?this._parent.getRootFeatureSet():this}getDataSourceFeatureSet(){return this._parent!==null?this._parent.getDataSourceFeatureSet():this}castAsJson(e=null){return(e==null?void 0:e.featureset)==="keeptype"?this:(e==null?void 0:e.featureset)==="none"?null:{type:"FeatureSet"}}async castAsJsonAsync(e=null,t=null){var a;if((t==null?void 0:t.featureset)==="keeptype")return this;if((t==null?void 0:t.featureset)==="schema")return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if((t==null?void 0:t.featureset)==="none")return null;await this._ensureLoaded();const n=[];await this.reduce((i,l)=>{const u={geometry:l.geometry?(t==null?void 0:t.keepGeometryType)===!0?l.geometry:l.geometry.toJSON():null,attributes:l.attributes};return u.geometry!==null&&u.geometry.spatialReference&&(t==null?void 0:t.keepGeometryType)!==!0&&delete u.geometry.spatialReference,n.push(u),1},0,e);const r=this.schema();return r.features=n,r.spatialReference=(t==null?void 0:t.keepGeometryType)===!0?this.spatialReference:(a=this.spatialReference)==null?void 0:a.toJSON(),r}}h._featuresetFunctions={};class b extends h{constructor(e){super(e),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._wset=new v([],[],!1,null),this._parent=e.parentfeatureset,this._databaseType=d.Standardised}async _getSet(){return this._wset}optimisePagingFeatureQueries(){}_isInFeatureSet(){return T.NotInFeatureSet}async _getFeature(){throw new m(f.NeverReach)}async queryAttachments(){return[]}async _getFeatures(){return"success"}_featureFromCache(){return null}async _fetchAndRefineFeatures(){throw new m(f.NeverReach)}async _getFilteredSet(){return new v([],[],!1,null)}_stat(e,t,n,r,a,i,l){return this._manualStat(e,t,i,l)}async _canDoAggregates(){return!1}}class F extends h{constructor(e){super(e),this._relation="",this._relationGeom=null,this._relationString="",this.declaredClass="esri.arcade.featureset.actions.SpatialFilter",this._relationString=e.relationString,this._parent=e.parentfeatureset,this._maxProcessing=40,this._relation=e.relation,this._relationGeom=e.relationGeom}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._parent._getFilteredSet(this._relation!=="esriSpatialRelRelation"?this._relation:this._relation+":"+this._relationString,this._relationGeom,null,null,e);return this._checkCancelled(e),this._wset=new v(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent._isInFeatureSet(e);return t===T.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?T.Unknown:t)}_getFeature(e,t,n){return this._parent._getFeature(e,t,n)}_getFeatures(e,t,n,r){return this._parent._getFeatures(e,t,n,r)}_featureFromCache(e){return this._parent._featureFromCache(e)}async executeSpatialRelationTest(e){var t;if(e.geometry===null)return!1;switch(this._relation){case"esriSpatialRelEnvelopeIntersects":{const n=U(this._relationGeom),r=U(e.geometry);return G(n,r)}case"esriSpatialRelIntersects":return G(this._relationGeom,e.geometry);case"esriSpatialRelContains":return oe(this._relationGeom,e.geometry);case"esriSpatialRelOverlaps":return ue(this._relationGeom,e.geometry);case"esriSpatialRelWithin":return le(this._relationGeom,e.geometry);case"esriSpatialRelTouches":return ie(this._relationGeom,e.geometry);case"esriSpatialRelCrosses":return ae(this._relationGeom,e.geometry);case"esriSpatialRelRelation":return se(this._relationGeom,e.geometry,(t=this._relationString)!=null?t:"")}}async _fetchAndRefineFeatures(e,t,n){var l;const r=new v([],e,!1,null),a=Math.min(t,e.length);await((l=this._parent)==null?void 0:l._getFeatures(r,-1,a,n)),this._checkCancelled(n);const i=[];for(let u=0;uthis.nextBatch(e),r=>this.nextBatch(e));const t={returnpromise:null,hasset:!1},n=[];return t.returnpromise=new Promise((r,a)=>{this._parent._getSet(this._progress).then(i=>{const l=x(i._known,"known");let u=l.length-1;if(l[l.length-1]==="GETPAGES"&&(u-=1),this._lastId+e>u&&l.length>0&&l[l.length-1]==="GETPAGES")return void this._parent._expandPagedSet(i,this._parent._maxQueryRate(),0,0,this._progress).then(_=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)},_=>{t.hasset=!0,this._parent._mainSetInUse=null,a(_)});const o=x(i._candidates,"candidates");if(u>=this._lastId+e||o.length===0){for(let _=0;_=l.length)break;n[_]=l[w]}return this._lastId+=n.length,n.length===0&&(t.hasset=!0,this._parent._mainSetInUse=null,r([])),void this._parent._getFeatureBatch(n,this._progress).then(_=>{t.hasset=!0,this._parent._mainSetInUse=null,r(_)},_=>{t.hasset=!0,this._parent._mainSetInUse=null,a(_)})}this._parent._refineSetBlock(i,this._parent._maxProcessingRate(),this._progress).then(()=>{t.hasset=!0,this._parent._mainSetInUse=null,this.nextBatch(e).then(r,a)},_=>{t.hasset=!0,this._parent._mainSetInUse=null,a(_)})},i=>{t.hasset=!0,this._parent._mainSetInUse=null,a(i)})}),t.hasset===!1&&(this._parent._mainSetInUse=t.returnpromise,t.hasset=!0),t.returnpromise}next(){if(this._parent._mainSetInUse!==null)return this._parent._mainSetInUse.then(t=>this.next(),t=>this.next());const e={returnpromise:null,hasset:!1};return e.returnpromise=new Promise((t,n)=>{this._parent._getSet(this._progress).then(r=>{const a=x(r._known,"known");this._lastId(e.hasset=!0,this._parent._mainSetInUse=null,this.next())).then(t,n):(this._lastId+=1,this._parent._getFeature(r,a[this._lastId],this._progress).then(i=>{e.hasset=!0,this._parent._mainSetInUse=null,t(i)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,n(i)})):x(r._candidates,"candidates").length>0?this._parent._refineSetBlock(r,this._parent._maxProcessingRate(),this._progress).then(()=>{e.hasset=!0,this._parent._mainSetInUse=null,this.next().then(t,n)},i=>{e.hasset=!0,this._parent._mainSetInUse=null,n(i)}):(e.hasset=!0,this._parent._mainSetInUse=null,t(null))},r=>{e.hasset=!0,this._parent._mainSetInUse=null,n(r)})}),e.hasset===!1&&(this._parent._mainSetInUse=e.returnpromise,e.hasset=!0),e.returnpromise}async count(){if(this._parent._totalCount!==-1)return this._parent._totalCount;const e=await this._parent._getSet(this._progress),t=await this._refineAllSets(e);return this._parent._totalCount=t._known.length,this._parent._totalCount}async _refineAllSets(e){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,1,this._progress),this._refineAllSets(e);if(e._candidates.length>0){if(e._known[e._candidates.length-1]==="GETPAGES")return await this._parent._expandPagedSet(e,this._parent._maxQueryRate(),0,2,this._progress),this._refineAllSets(e);const t=await this._parent._refineSetBlock(e,this._parent._maxProcessingRate(),this._progress);return t._candidates.length>0?this._refineAllSets(t):t}return e}}class v{constructor(e,t,n,r){this._lastFetchedIndex=0,this._ordered=!1,this.pagesDefinition=null,this._candidates=e,this._known=t,this._ordered=n,this.pagesDefinition=r}}function M(s,e){return c(s==null?void 0:s.parseTree,e,s==null?void 0:s.parameters)}function Ae(s,e,t){return c(s,e,t)}function ke(s,e,t,n){return I.create(c(s.parseTree,d.Standardised,s.parameters,e,t),n)}function Le(s,e,t="AND"){return I.create("(("+M(s,d.Standardised)+")"+t+"("+M(e,d.Standardised)+"))",s.fieldsIndex)}function c(s,e,t,n=null,r=null){let a,i,l,u;switch(s.type){case"interval":return me(c(s.value,e,t,n,r),s.qualifier,s.op);case"case-expression":{let o=" CASE ";s.format==="simple"&&(o+=c(s.operand,e,t,n,r));for(let _=0;_":case"<":case">":case">=":case"<=":case"=":case"*":case"-":case"+":case"/":return" ("+c(s.left,e,t,n,r)+" "+s.operator+" "+c(s.right,e,t,n,r)+") "}throw new g(p.UnsupportedOperator,{operator:s.operator});case"null":return"null";case"boolean":return s.value===!0?"1":"0";case"string":return"'"+s.value.toString().replace(/'/g,"''")+"'";case"timestamp":case"date":return N(s.value,e);case"number":return s.value.toString();case"current-time":return _e(s.mode==="date",e);case"column-reference":return n&&n.toLowerCase()===s.column.toLowerCase()?"("+r+")":s.column;case"function":{const o=c(s.args,e,t,n,r);return pe(s.name,o,e)}}throw new g(p.UnsupportedSyntax,{node:s.type})}function pe(s,e,t){switch(s.toLowerCase().trim()){case"abs":if(e.length!==1)throw new g(p.InvalidFunctionParameters,{function:"abs"});return"abs("+e[0]+")";case"ceiling":case"ceil":if(e.length!==1)throw new g(p.InvalidFunctionParameters,{function:"ceiling"});switch(t){case d.Standardised:case d.StandardisedNoInterval:}return"CEILING("+e[0]+")";case"floor":if(e.length!==1)throw new g(p.InvalidFunctionParameters,{function:"floor"});return"FLOOR("+e[0]+")";case"log":if(e.length!==1)throw new g(p.InvalidFunctionParameters,{function:"log"});return"LOG("+e[0]+")";case"log10":if(e.length!==1)throw new g(p.InvalidFunctionParameters,{function:"log10"});return"LOG10("+e[0]+")";case"power":if(e.length!==2)throw new g(p.InvalidFunctionParameters,{function:"power"});return"POWER("+e[0]+","+e[1]+")";case"round":if(e.length===2)return"ROUND("+e[0]+","+e[1]+")";if(e.length===1)return"ROUND("+e[0]+")";throw new g(p.InvalidFunctionParameters,{function:"round"});case"truncate":if(e.length<1||e.length>2)throw new g(p.InvalidFunctionParameters,{function:"truncate"});return t===d.SqlServer?"ROUND("+e[0]+(e.length===1?"0":","+e[1])+",1)":"TRUNCATE("+e[0]+(e.length===1?")":","+e[1]+")");case"char_length":case"len":if(e.length!==1)throw new g(p.InvalidFunctionParameters,{function:"char_length"});switch(t){case d.SqlServer:return"LEN("+e[0]+")";case d.Oracle:return"LENGTH("+e[0]+")";default:return"CHAR_LENGTH("+e[0]+")"}case"concat":if(e.length<1)throw new g(p.InvalidFunctionParameters,{function:"concat"});{let n="CONCAT(";for(let r=0;r":case"<":case">":case">=":case"<=":case"=":return"boolean";case"IS":case"ISNOT":if(e.right.type!=="null")throw new g(p.UnsupportedIsRhs);return"boolean";case"*":case"-":case"+":case"/":return D([y(s,e.left,t,n),y(s,e.right,t,n)]);default:throw new g(p.UnsupportedOperator,{operator:e.operator})}case"null":return"";case"boolean":return"boolean";case"string":return"string";case"number":return e.value===null?"":e.value%1==0?"integer":"double";case"date":case"timestamp":case"current-time":return"date";case"column-reference":{const a=s[e.column.toLowerCase()];return a===void 0?"":a}case"function":switch(e.name.toLowerCase()){case"position":case"extract":case"char_length":return"integer";case"round":return r=y(s,e.args,t,n),r instanceof Array?r.length>0?r[0]:"":r;case"sign":return r=y(s,e.args,t,n),r instanceof Array&&(r=D(r)),r==="integer"||r==="double"?r:"double";case"ceiling":case"floor":case"abs":{const a=y(s,e.args,t,n);return a instanceof Array?D(a):a}case"area":case"length":case"log":case"log10":case"sin":case"cos":case"tan":case"asin":case"acos":case"atan":case"power":case"truncate":return"double";case"substring":case"trim":case"concat":case"lower":case"upper":return"string"}return""}throw new g(p.UnsupportedSyntax,{node:e.type})}const $={boolean:1,string:2,integer:3,double:4,date:5};function D(s){if(s){let e="";for(const t of s)t!==""&&(e=e===""||$[e]<$[t]?t:e);return e}return""}function Ce(s,e){return S(s.parseTree,e)}function ge(s){return(s==null?void 0:s.parseTree.type)==="column-reference"}function S(s,e){if(s==null)return!1;switch(s.type){case"when-clause":return S(s.operand,e)||S(s.value,e);case"case-expression":for(const t of s.clauses)if(S(t,e))return!0;return!(s.format!=="simple"||!S(s.operand,e))||!(s.else===null||!S(s.else,e));case"parameter":case"null":case"boolean":case"date":case"timestamp":case"string":case"number":return!1;case"expression-list":for(const t of s.value)if(S(t,e))return!0;return!1;case"unary-expression":return S(s.expr,e);case"binary-expression":return S(s.left,e)||S(s.right,e);case"column-reference":return e.toLowerCase()===s.column.toLowerCase();case"function":return S(s.args,e)}return!1}function A(s){let e="";return e+=s.period.toUpperCase(),e}function me(s,e,t){let n="";return n=e.type==="interval-period"?A(e):A(e.start)+" TO "+A(e.end),"INTERVAL "+t+" "+s+" "+n}function ye(s){return s=+s,isFinite(s)?s-s%1||(s<0?-0:s===0?s:0):s}function P(s){let e=0;for(let t=0;t=e&&e!==-1)return t}return t}function Ue(s){switch(s.toLowerCase()){case"distinct":return"distinct";case"avg":case"mean":return"avg";case"min":return"min";case"sum":return"sum";case"max":return"max";case"stdev":case"stddev":return"stddev";case"var":case"variance":return"var";case"count":return"count"}return""}function Oe(s,e,t=1e3){switch(s.toLowerCase()){case"distinct":return Se(e,t);case"avg":case"mean":return P(e);case"min":return Math.min.apply(Math,e);case"sum":return K(e);case"max":return Math.max.apply(Math,e);case"stdev":case"stddev":return Math.sqrt(B(e));case"var":case"variance":return B(e);case"count":return e.length}return 0}async function we(s,e,t){const n=await E(s,e,t,!0);return n.length===0?null:Math.min.apply(Math,n)}async function Ie(s,e,t){const n=await E(s,e,t,!0);return n.length===0?null:Math.max.apply(Math,n)}async function Fe(s,e,t){let n="";e&&!ge(e)&&(n=fe(e,s.fields));const r=await E(s,e,t,!0);if(r.length===0)return null;const a=P(r);return a===null?a:n==="integer"?ye(a):a}async function Te(s,e,t){const n=await E(s,e,t,!0);return n.length===0?null:Q(n)}async function be(s,e,t){const n=await E(s,e,t,!0);return n.length===0?null:Math.sqrt(Q(n))}async function ve(s,e,t){const n=await E(s,e,t,!0);return n.length===0?null:K(n)}async function Re(s,e){return s.iterator(e).count()}async function E(s,e,t,n=!1){const r=s.iterator(t),a=[],i={ticker:0};let l=await r.next();for(;l!==null;){if(i.ticker++,t.aborted)throw new m(f.Cancelled);i.ticker%100==0&&(i.ticker=0,await new Promise(o=>{setTimeout(o,0)}));const u=e==null?void 0:e.calculateValue(l);u===null?n===!1&&(a[a.length]=u):a[a.length]=u,l=await r.next()}return a}async function Ee(s,e,t=1e3,n=null){const r=s.iterator(n),a=[],i={},l={ticker:0};let u=await r.next();for(;u!==null;){if(l.ticker++,n&&n.aborted)throw new m(f.Cancelled);l.ticker%100==0&&(l.ticker=0,await new Promise(_=>{setTimeout(_,0)}));const o=e==null?void 0:e.calculateValue(u);if(o!=null&&i[o]===void 0&&(a.push(o),i[o]=1),a.length>=t&&t!==-1)return a;u=await r.next()}return a}class h{constructor(e){this.recentlyUsedQueries=null,this.featureSetQueryInterceptor=null,this._idstates=[],this._parent=null,this._wset=null,this._mainSetInUse=null,this._maxProcessing=200,this._maxQuery=500,this._totalCount=-1,this._databaseType=d.NotEvaluated,this._databaseTypeProbed=null,this.declaredRootClass="esri.arcade.featureset.support.FeatureSet",this._featureCache=[],this.typeIdField=null,this.types=null,this.fields=null,this.geometryType="",this.objectIdField="",this.globalIdField="",this.spatialReference=null,this.hasM=!1,this.hasZ=!1,this._transparent=!1,this.loaded=!1,this._loadPromise=null,this._fieldsIndex=null,e&&e.lrucache&&(this.recentlyUsedQueries=e.lrucache),e&&e.interceptor&&(this.featureSetQueryInterceptor=e.interceptor)}optimisePagingFeatureQueries(e){this._parent&&this._parent.optimisePagingFeatureQueries(e)}_hasMemorySource(){return!0}prop(e,t){return t===void 0?this[e]:(this[e]!==void 0&&(this[e]=t),this)}end(){return this._parent!==null&&this._parent._transparent===!0?this._parent.end():this._parent}_ensureLoaded(){return this.load()}load(){return this._loadPromise===null&&(this._loadPromise=this.loadImpl()),this._loadPromise}async loadImpl(){var e,t;return((e=this._parent)==null?void 0:e.loaded)===!0?(this._initialiseFeatureSet(),this):(await((t=this._parent)==null?void 0:t.load()),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.fields=[],this.typeIdField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new Z({wkid:4326}),this.geometryType=j.point)}getField(e,t){let n;return(t=t||this.fields)&&(e=e.toLowerCase(),t.some(r=>(r&&r.name.toLowerCase()===e&&(n=r),!!n))),n}getFieldsIndex(){return this._fieldsIndex===null&&(this._fieldsIndex=new X(this.fields)),this._fieldsIndex}_maxProcessingRate(){return this._parent!==null?Math.min(this._maxProcessing,this._parent._maxProcessingRate()):Math.min(this._maxProcessing,this._maxQueryRate())}_maxQueryRate(){return this._parent!==null?Math.max(this._maxQuery,this._parent._maxQueryRate()):this._maxQuery}_checkCancelled(e){if(e!=null&&e.aborted)throw new m(f.Cancelled)}nativeCapabilities(){return this._parent.nativeCapabilities()}async _canDoAggregates(e,t,n,r,a){return this._parent!==null&&this._parent._canDoAggregates(e,t,n,r,a)}async _getAggregatePagesDataSourceDefinition(e,t,n,r,a,i,l){if(this._parent===null)throw new m(f.NeverReach);return this._parent._getAggregatePagesDataSourceDefinition(e,t,n,r,a,i,l)}async _getAgregagtePhysicalPage(e,t,n){if(this._parent===null)throw new m(f.NeverReach);return this._parent._getAgregagtePhysicalPage(e,t,n)}async databaseType(){if(this._databaseType===d.NotEvaluated){if(R.applicationCache!==null){const e=R.applicationCache.getDatabaseType(this._cacheableFeatureSetSourceKey());if(e!==null)return e}if(this._databaseTypeProbed!==null)return this._databaseTypeProbed;try{this._databaseTypeProbed=this._getDatabaseTypeImpl(),R.applicationCache!==null&&R.applicationCache.setDatabaseType(this._cacheableFeatureSetSourceKey(),this._databaseTypeProbed)}catch(e){throw R.applicationCache!==null&&R.applicationCache.clearDatabaseType(this._cacheableFeatureSetSourceKey()),e}return this._databaseTypeProbed}return this._databaseType}async _getDatabaseTypeImpl(){const e=[{thetype:d.SqlServer,testwhere:"(CAST( '2015-01-01' as DATETIME) = CAST( '2015-01-01' as DATETIME)) AND OBJECTID<0"},{thetype:d.Oracle,testwhere:"(TO_DATE('2003-11-18','YYYY-MM-DD') = TO_DATE('2003-11-18','YYYY-MM-DD')) AND OBJECTID<0"},{thetype:d.StandardisedNoInterval,testwhere:"(date '2015-01-01 10:10:10' = date '2015-01-01 10:10:10') AND OBJECTID<0"}];for(const t of e)if(await this._runDatabaseProbe(t.testwhere)===!0)return t.thetype;return d.StandardisedNoInterval}_cacheableFeatureSetSourceKey(){return"MUSTBESET"}async _runDatabaseProbe(e){if(this._parent!==null)return this._parent._runDatabaseProbe(e);throw new m(f.NotImplemented)}isTable(){var e,t;return(t=(e=this._parent)==null?void 0:e.isTable())!=null?t:!1}_featureFromCache(e){if(this._featureCache[e]!==void 0)return this._featureCache[e]}_isInFeatureSet(e){return T.Unknown}_getSet(e){throw new m(f.NotImplemented)}async _getFeature(e,t,n){if(this._checkCancelled(n),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);if(await this._getFeatures(e,t,this._maxProcessingRate(),n),this._checkCancelled(n),this._featureFromCache(t)!==void 0)return this._featureFromCache(t);throw new m(f.MissingFeatures)}async _getFeatureBatch(e,t){this._checkCancelled(t);const n=new v([],e,!1,null),r=[];await this._getFeatures(n,-1,e.length,t),this._checkCancelled(t);for(const a of e)this._featureFromCache(a)!==void 0&&r.push(this._featureFromCache(a));return r}async _getFeatures(e,t,n,r){return"success"}_getFilteredSet(e,t,n,r,a){throw new m(f.NotImplemented)}async _refineSetBlock(e,t,n){if(this._checkIfNeedToExpandCandidatePage(e,this._maxQueryRate())===!0)return await this._expandPagedSet(e,this._maxQueryRate(),0,0,n),this._refineSetBlock(e,t,n);this._checkCancelled(n);const r=e._candidates.length;this._refineKnowns(e,t);let a=r-e._candidates.length;if(e._candidates.length===0||a>=t)return e;if(await this._refineIfParentKnown(e,t-a,n),this._checkCancelled(n),this._refineKnowns(e,t-a),a=r-e._candidates.length,a0){const i=t-a,l=this._prepareFetchAndRefineSet(e._candidates);return await this._fetchAndRefineFeatures(l,l.length>i?i:e._candidates.length,n),this._checkCancelled(n),this._refineKnowns(e,t-a),e}return e}_fetchAndRefineFeatures(e,t,n){return null}_prepareFetchAndRefineSet(e){const t=[];for(let n=0;n=t)break}r!==null&&a.push(r);for(let i=a.length-1;i>=0;i--)e._candidates.splice(a[i].start,a[i].end-a[i].start+1)}_refineIfParentKnown(e,t,n){const r=new v([],[],e._ordered,null);return r._candidates=e._candidates.slice(0),this._parent._refineSetBlock(r,t,n)}_candidateIdTransform(e){return this._parent._candidateIdTransform(e)}_checkIfNeedToExpandKnownPage(e,t){if(e.pagesDefinition===null)return!1;let n=0;for(let r=e._lastFetchedIndex;r=t))break}return!1}_checkIfNeedToExpandCandidatePage(e,t){if(e.pagesDefinition===null)return!1;let n=0;for(let r=0;r=t)break}return!1}async _expandPagedSet(e,t,n,r,a){if(this._parent===null)throw new m(f.NotImplemented);return this._parent._expandPagedSet(e,t,n,r,a)}async _expandPagedSetFeatureSet(e,t,n,r,a){if(e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"&&(r=1),r===0&&e._candidates.length>0&&e._candidates[e._candidates.length-1]==="GETPAGES"&&(r=2),r===0)return"finished";const i=await this._getPage(e,r,a);return n+ie.pagesDefinition.resultOffset||e.pagesDefinition.internal.fullyResolved===!0){r.length=r.length-1;let a=0;for(let l=0;l=e.pagesDefinition.internal.set.length);l++)r[r.length]=e.pagesDefinition.internal.set[e.pagesDefinition.resultOffset+l],a++;e.pagesDefinition.resultOffset+=a;let i=!1;return e.pagesDefinition.internal.fullyResolved===!0&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset&&(i=!0),i===!1&&r.push("GETPAGES"),a}return await this._getPhysicalPage(e,t,n),this._getPage(e,t,n)}_getPhysicalPage(e,t,n){return null}_clonePageDefinition(e){return this._parent===null?null:this._parent._clonePageDefinition(e)}_first(e){return this.iterator(e).next()}first(e){return this._first(e)}async calculateStatistic(e,t,n,r){await this._ensureLoaded();let a=await this._stat(e,t,"",null,null,n,r);return a.calculated===!1&&(a=await this._manualStat(e,t,n,r)),a.result}async _manualStat(e,t,n,r){let a=null;switch(e.toLowerCase()){case"count":return a=await Re(this,r),{calculated:!0,result:a};case"distinct":return a=await Ee(this,t,n,r),{calculated:!0,result:a};case"avg":case"mean":return a=await Fe(this,t,r),{calculated:!0,result:a};case"stdev":return a=await be(this,t,r),{calculated:!0,result:a};case"variance":return a=await Te(this,t,r),{calculated:!0,result:a};case"sum":return a=await ve(this,t,r),{calculated:!0,result:a};case"min":return a=await we(this,t,r),{calculated:!0,result:a};case"max":return a=await Ie(this,t,r),{calculated:!0,result:a};default:return{calculated:!0,result:0}}}async _stat(e,t,n,r,a,i,l){const u=await this._parent._stat(e,t,n,r,a,i,l);return u.calculated===!1?a===null&&n===""&&r===null?this._manualStat(e,t,i,l):{calculated:!1}:u}_unionAllGeomSelf(e){const t=this.iterator(this._defaultTracker(e)),n=[];return new Promise((r,a)=>{this._unionShapeInBatches(n,t,r,a)})}_unionAllGeom(e){return new Promise((t,n)=>{const r=this.iterator(this._defaultTracker(e)),a=[];this._unionShapeInBatches(a,r,t,n)})}_unionShapeInBatches(e,t,n,r){t.next().then(a=>{try{a!==null&&a.geometry!==null&&e.push(a.geometry),e.length>30||a===null&&e.length>1?z(e).then(i=>{try{a===null?n(i):(e=[i],this._unionShapeInBatches(e,t,n,r))}catch(l){r(l)}},r):a===null?e.length===1?n(e[0]):n(null):this._unionShapeInBatches(e,t,n,r)}catch(i){r(i)}},r)}iterator(e){return new de(this,e)}intersection(e,t=!1){return h._featuresetFunctions.intersection.bind(this)(e,t)}difference(e,t=!1,n=!0){return h._featuresetFunctions.difference.bind(this)(e,t,n)}symmetricDifference(e,t=!1,n=!0){return h._featuresetFunctions.symmetricDifference.bind(this)(e,t,n)}morphShape(e,t,n="unknown",r=null){return h._featuresetFunctions.morphShape.bind(this)(e,t,n,r)}morphShapeAndAttributes(e,t,n="unknown"){return h._featuresetFunctions.morphShapeAndAttributes.bind(this)(e,t,n)}union(e,t=!1){return h._featuresetFunctions.union.bind(this)(e,t)}intersects(e){return h._featuresetFunctions.intersects.bind(this)(e)}envelopeIntersects(e){return h._featuresetFunctions.envelopeIntersects.bind(this)(e)}contains(e){return h._featuresetFunctions.contains.bind(this)(e)}overlaps(e){return h._featuresetFunctions.overlaps.bind(this)(e)}relate(e,t){return h._featuresetFunctions.relate.bind(this)(e,t)}within(e){return h._featuresetFunctions.within.bind(this)(e)}touches(e){return h._featuresetFunctions.touches.bind(this)(e)}top(e){return h._featuresetFunctions.top.bind(this)(e)}crosses(e){return h._featuresetFunctions.crosses.bind(this)(e)}buffer(e,t,n,r=!0){return h._featuresetFunctions.buffer.bind(this)(e,t,n,r)}filter(e,t=null){return h._featuresetFunctions.filter.bind(this)(e,t)}orderBy(e){return h._featuresetFunctions.orderBy.bind(this)(e)}dissolve(e,t){return h._featuresetFunctions.dissolve.bind(this)(e,t)}groupby(e,t){return h._featuresetFunctions.groupby.bind(this)(e,t)}reduce(e,t=null,n){return new Promise((r,a)=>{this._reduceImpl(this.iterator(this._defaultTracker(n)),e,t,0,r,a,0)})}_reduceImpl(e,t,n,r,a,i,l){try{if(++l>1e3)return void setTimeout(()=>{l=0,this._reduceImpl(e,t,n,r,a,i,l)});e.next().then(u=>{try{if(u===null)a(n);else{const o=t(n,u,r,this);O(o)?o.then(_=>{this._reduceImpl(e,t,_,r+1,a,i,l)},i):this._reduceImpl(e,t,o,r+1,a,i,l)}}catch(o){i(o)}},i)}catch(u){i(u)}}removeField(e){return h._featuresetFunctions.removeField.bind(this)(e)}addField(e,t,n=null){return h._featuresetFunctions.addField.bind(this)(e,t,n)}sumArea(e,t=!1,n){const r=V(e);return this.reduce((a,i)=>i.geometry===null?0:t?ee(i.geometry,r).then(l=>a+l):te(i.geometry,r).then(l=>a+l),0,n)}sumLength(e,t=!1,n){const r=W(e);return this.reduce((a,i)=>i.geometry===null?0:t?ne(i.geometry,r).then(l=>a+l):re(i.geometry,r).then(l=>a+l),0,n)}_substituteVars(e,t){if(t!==null){const n={};for(const r in t)n[r.toLowerCase()]=t[r];e.parameters=n}}async distinct(e,t=1e3,n=null,r){await this.load();const a=I.create(e,this.getFieldsIndex());return this._substituteVars(a,n),this.calculateStatistic("distinct",a,t,this._defaultTracker(r))}async min(e,t=null,n){await this.load();const r=I.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("min",r,-1,this._defaultTracker(n))}async max(e,t=null,n){await this.load();const r=I.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("max",r,-1,this._defaultTracker(n))}async avg(e,t=null,n){await this.load();const r=I.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("avg",r,-1,this._defaultTracker(n))}async sum(e,t=null,n){await this.load();const r=I.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("sum",r,-1,this._defaultTracker(n))}async stdev(e,t=null,n){await this.load();const r=I.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("stdev",r,-1,this._defaultTracker(n))}async variance(e,t=null,n){await this.load();const r=I.create(e,this.getFieldsIndex());return this._substituteVars(r,t),this.calculateStatistic("variance",r,-1,this._defaultTracker(n))}async count(e){return await this.load(),this.calculateStatistic("count",I.create("1",this.getFieldsIndex()),-1,this._defaultTracker(e))}_defaultTracker(e){return e||{aborted:!1}}forEach(e,t){return new Promise((n,r)=>{this._forEachImpl(this.iterator(this._defaultTracker(t)),e,this,n,r,0)})}_forEachImpl(e,t,n,r,a,i){try{if(++i>1e3)return void setTimeout(()=>{i=0,this._forEachImpl(e,t,n,r,a,i)},0);e.next().then(l=>{try{if(l===null)r(n);else{const u=t(l);u==null?this._forEachImpl(e,t,n,r,a,i):O(u)?u.then(()=>{try{this._forEachImpl(e,t,n,r,a,i)}catch(o){a(o)}},a):this._forEachImpl(e,t,n,r,a,i)}}catch(u){a(u)}},a)}catch(l){a(l)}}convertToJSON(e){const t={layerDefinition:{geometryType:this.geometryType,fields:[]},featureSet:{features:[],geometryType:this.geometryType}};for(let n=0;n{const a={geometry:r.geometry&&r.geometry.toJSON(),attributes:{}};for(const i in r.attributes)a.attributes[i]=r.attributes[i];return t.featureSet.features.push(a),1},0,e).then(()=>t)}castToText(e=!1){return"object, FeatureSet"}queryAttachments(e,t,n,r,a){return this._parent.queryAttachments(e,t,n,r,a)}serviceUrl(){return this._parent.serviceUrl()}subtypes(){return this.typeIdField?{subtypeField:this.typeIdField,subtypes:this.types?this.types.map(e=>({name:e.name,code:e.id})):[]}:null}relationshipMetaData(){return this._parent.relationshipMetaData()}get gdbVersion(){return this._parent?this._parent.gdbVersion:""}schema(){const e=[];for(const t of this.fields)e.push(L(t));return{objectIdField:this.objectIdField,globalIdField:this.globalIdField,geometryType:C[this.geometryType]===void 0?"":C[this.geometryType],fields:e}}async convertToText(e,t){if(e==="schema")return await this._ensureLoaded(),JSON.stringify(this.schema());if(e==="featureset"){await this._ensureLoaded();const n=[];await this.reduce((a,i)=>{const l={geometry:i.geometry?i.geometry.toJSON():null,attributes:i.attributes};return l.geometry!==null&&l.geometry.spatialReference&&delete l.geometry.spatialReference,n.push(l),1},0,t);const r=this.schema();return r.features=n,r.spatialReference=this.spatialReference.toJSON(),JSON.stringify(r)}return this.castToText()}getFeatureByObjectId(e,t){return this._parent.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._parent.getOwningSystemUrl()}getIdentityUser(){return this._parent.getIdentityUser()}getRootFeatureSet(){return this._parent!==null?this._parent.getRootFeatureSet():this}getDataSourceFeatureSet(){return this._parent!==null?this._parent.getDataSourceFeatureSet():this}castAsJson(e=null){return(e==null?void 0:e.featureset)==="keeptype"?this:(e==null?void 0:e.featureset)==="none"?null:{type:"FeatureSet"}}async castAsJsonAsync(e=null,t=null){var a;if((t==null?void 0:t.featureset)==="keeptype")return this;if((t==null?void 0:t.featureset)==="schema")return await this._ensureLoaded(),JSON.parse(JSON.stringify(this.schema()));if((t==null?void 0:t.featureset)==="none")return null;await this._ensureLoaded();const n=[];await this.reduce((i,l)=>{const u={geometry:l.geometry?(t==null?void 0:t.keepGeometryType)===!0?l.geometry:l.geometry.toJSON():null,attributes:l.attributes};return u.geometry!==null&&u.geometry.spatialReference&&(t==null?void 0:t.keepGeometryType)!==!0&&delete u.geometry.spatialReference,n.push(u),1},0,e);const r=this.schema();return r.features=n,r.spatialReference=(t==null?void 0:t.keepGeometryType)===!0?this.spatialReference:(a=this.spatialReference)==null?void 0:a.toJSON(),r}}h._featuresetFunctions={};class b extends h{constructor(e){super(e),this.declaredClass="esri.layers.featureset.sources.Empty",this._maxProcessing=1e3,this._wset=new v([],[],!1,null),this._parent=e.parentfeatureset,this._databaseType=d.Standardised}async _getSet(){return this._wset}optimisePagingFeatureQueries(){}_isInFeatureSet(){return T.NotInFeatureSet}async _getFeature(){throw new m(f.NeverReach)}async queryAttachments(){return[]}async _getFeatures(){return"success"}_featureFromCache(){return null}async _fetchAndRefineFeatures(){throw new m(f.NeverReach)}async _getFilteredSet(){return new v([],[],!1,null)}_stat(e,t,n,r,a,i,l){return this._manualStat(e,t,i,l)}async _canDoAggregates(){return!1}}class F extends h{constructor(e){super(e),this._relation="",this._relationGeom=null,this._relationString="",this.declaredClass="esri.arcade.featureset.actions.SpatialFilter",this._relationString=e.relationString,this._parent=e.parentfeatureset,this._maxProcessing=40,this._relation=e.relation,this._relationGeom=e.relationGeom}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._parent._getFilteredSet(this._relation!=="esriSpatialRelRelation"?this._relation:this._relation+":"+this._relationString,this._relationGeom,null,null,e);return this._checkCancelled(e),this._wset=new v(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){let t=this._parent._isInFeatureSet(e);return t===T.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?T.Unknown:t)}_getFeature(e,t,n){return this._parent._getFeature(e,t,n)}_getFeatures(e,t,n,r){return this._parent._getFeatures(e,t,n,r)}_featureFromCache(e){return this._parent._featureFromCache(e)}async executeSpatialRelationTest(e){var t;if(e.geometry===null)return!1;switch(this._relation){case"esriSpatialRelEnvelopeIntersects":{const n=U(this._relationGeom),r=U(e.geometry);return G(n,r)}case"esriSpatialRelIntersects":return G(this._relationGeom,e.geometry);case"esriSpatialRelContains":return oe(this._relationGeom,e.geometry);case"esriSpatialRelOverlaps":return ue(this._relationGeom,e.geometry);case"esriSpatialRelWithin":return le(this._relationGeom,e.geometry);case"esriSpatialRelTouches":return ie(this._relationGeom,e.geometry);case"esriSpatialRelCrosses":return ae(this._relationGeom,e.geometry);case"esriSpatialRelRelation":return se(this._relationGeom,e.geometry,(t=this._relationString)!=null?t:"")}}async _fetchAndRefineFeatures(e,t,n){var l;const r=new v([],e,!1,null),a=Math.min(t,e.length);await((l=this._parent)==null?void 0:l._getFeatures(r,-1,a,n)),this._checkCancelled(n);const i=[];for(let u=0;une.fromJSON(l))}writeRestrictionAttributes(e,a,s){D(e)||(a[s]=e.map(l=>ne.toJSON(l)))}};t([i({type:[Object],json:{write:!0}})],b.prototype,"attributeParameterValues",void 0),t([i({type:String,json:{write:!0}})],b.prototype,"description",void 0),t([L(be,{ignoreUnknown:!1})],b.prototype,"distanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],b.prototype,"id",void 0),t([L(j,{ignoreUnknown:!1})],b.prototype,"impedanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],b.prototype,"name",void 0),t([i({type:[String],json:{write:!0}})],b.prototype,"restrictionAttributeNames",void 0),t([m("restrictionAttributeNames")],b.prototype,"readRestrictionAttributes",null),t([E("restrictionAttributeNames")],b.prototype,"writeRestrictionAttributes",null),t([i({type:Number,json:{write:{allowNull:!0}}})],b.prototype,"simplificationTolerance",void 0),t([L(ue)],b.prototype,"simplificationToleranceUnits",void 0),t([L(ce,{ignoreUnknown:!1})],b.prototype,"timeAttributeName",void 0),t([L(me)],b.prototype,"type",void 0),t([i({type:Boolean,json:{write:!0}})],b.prototype,"useHierarchy",void 0),t([L(de)],b.prototype,"uturnAtJunctions",void 0),b=t([A("esri.rest.support.TravelMode")],b);const ye=b;let S=class extends C{constructor(e){super(e),this.accumulateAttributes=null,this.directionsLanguage=null,this.findBestSequence=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.startTimeIsUTC=null,this.timeWindowsAreUTC=null,this.travelMode=null}readAccumulateAttributes(e){return D(e)?null:e.map(a=>j.fromJSON(a))}writeAccumulateAttributes(e,a,s){!D(e)&&e.length&&(a[s]=e.map(l=>j.toJSON(l)))}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],S.prototype,"accumulateAttributes",void 0),t([m("accumulateAttributes")],S.prototype,"readAccumulateAttributes",null),t([E("accumulateAttributes")],S.prototype,"writeAccumulateAttributes",null),t([i({type:String,json:{write:!0}})],S.prototype,"directionsLanguage",void 0),t([i({type:Boolean,json:{write:!0}})],S.prototype,"findBestSequence",void 0),t([i({type:Boolean,json:{write:!0}})],S.prototype,"preserveFirstStop",void 0),t([i({type:Boolean,json:{write:!0}})],S.prototype,"preserveLastStop",void 0),t([i({type:Boolean,json:{write:!0}})],S.prototype,"startTimeIsUTC",void 0),t([i({type:Boolean,json:{write:!0}})],S.prototype,"timeWindowsAreUTC",void 0),t([i({type:ye,json:{write:!0}})],S.prototype,"travelMode",void 0),S=t([A("esri.layers.support.RouteSettings")],S);const Te=S;var ee;let n=ee=class extends x(C){constructor(e){super(e),this.analysisSettings=null,this.endTime=null,this.endTimeOffset=null,this.firstStopId=null,this.geometry=null,this.lastStopId=null,this.messages=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.startTime=null,this.startTimeOffset=null,this.stopCount=null,this.symbol=null,this.totalCosts=null,this.totalDistance=null,this.totalDuration=null,this.totalLateDuration=null,this.totalViolations=null,this.totalWait=null,this.totalWaitDuration=null,this.type="route-info",this.version="1.0.0"}readEndTime(e,a){return r(a.attributes.EndTimeUTC)?new Date(a.attributes.EndTimeUTC):null}readEndTimeOffset(e,a){return z(a.attributes.EndTime,a.attributes.EndTimeUTC)}readStartTime(e,a){return r(a.attributes.StartTimeUTC)?new Date(a.attributes.StartTimeUTC):null}readStartTimeOffset(e,a){return z(a.attributes.StartTime,a.attributes.StartTimeUTC)}readTotalCosts(e,a){return O(a.attributes,"Total_")}readTotalViolations(e,a){return O(a.attributes,"TotalViolation_")}readTotalWait(e,a){return O(a.attributes,"TotalWait_")}static fromGraphic(e){var a,s,l,f,N,w,F;return new ee({analysisSettings:r(e.attributes.AnalysisSettings)?Te.fromJSON(JSON.parse(e.attributes.AnalysisSettings)):null,endTime:r(e.attributes.EndTime)?new Date(e.attributes.EndTime):null,endTimeOffset:(a=e.attributes.EndUTCOffset)!=null?a:null,geometry:e.geometry,messages:r(e.attributes.Messages)?JSON.parse(e.attributes.Messages):null,name:e.attributes.RouteName,objectId:(s=e.attributes.ObjectID)!=null?s:e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,startTime:r(e.attributes.StartTime)?new Date(e.attributes.StartTime):null,startTimeOffset:(l=e.attributes.StartUTCOffset)!=null?l:null,symbol:e.symbol,totalCosts:r(e.attributes.TotalCosts)?W(JSON.parse(e.attributes.TotalCosts)):null,totalDistance:(f=e.attributes.TotalMeters)!=null?f:null,totalDuration:(N=e.attributes.TotalMinutes)!=null?N:null,totalLateDuration:(w=e.attributes.TotalLateMinutes)!=null?w:null,totalWaitDuration:(F=e.attributes.TotalWaitMinutes)!=null?F:null,version:e.attributes.Version})}toGraphic(){const e={ObjectID:v(this.objectId),AnalysisSettings:r(this.analysisSettings)?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:r(this.endTime)?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:r(this.messages)?JSON.stringify(this.messages):null,RouteName:v(this.name),StartTime:r(this.startTime)?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:r(this.totalCosts)?JSON.stringify(V(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:v(this.version)};return new M({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:v(this.popupTemplate)})}};n.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"EndUTCOffset",alias:"End Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Messages",alias:"Analysis Messages",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:1024,editable:!0,nullable:!0,visible:!0,domain:null},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"StartUTCOffset",alias:"Start Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"Version",alias:"Version",type:"esriFieldTypeString",length:16,editable:!0,nullable:!0,visible:!0,domain:null}],n.popupInfo={title:"Route Details",fieldInfos:[{fieldName:"RouteName",label:"Route Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TotalMinutes",label:"Total Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalMeters",label:"Total Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalLateMinutes",label:"Total Late Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalWaitMinutes",label:"Total Wait Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalCosts",label:"Total Costs",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"StartTime",label:"Start Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"StartUTCOffset",label:"Start Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"EndTime",label:"End Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"EndUTCOffset",label:"End Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Messages",label:"Analysis Messages",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"AnalysisSettings",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"Version",label:"Version",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i()],n.prototype,"analysisSettings",void 0),t([i()],n.prototype,"endTime",void 0),t([m("endTime",["attributes.EndTimeUTC"])],n.prototype,"readEndTime",null),t([i()],n.prototype,"endTimeOffset",void 0),t([m("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],n.prototype,"readEndTimeOffset",null),t([i({json:{read:{source:"attributes.FirstStopID"}}})],n.prototype,"firstStopId",void 0),t([i({type:ie})],n.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.LastStopID"}}})],n.prototype,"lastStopId",void 0),t([i()],n.prototype,"messages",void 0),t([i({json:{read:{source:"attributes.Name"}}})],n.prototype,"name",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],n.prototype,"objectId",void 0),t([i({type:U})],n.prototype,"popupTemplate",void 0),t([i()],n.prototype,"startTime",void 0),t([m("startTime",["attributes.StartTimeUTC"])],n.prototype,"readStartTime",null),t([i()],n.prototype,"startTimeOffset",void 0),t([m("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],n.prototype,"readStartTimeOffset",null),t([i({json:{read:{source:"attributes.StopCount"}}})],n.prototype,"stopCount",void 0),t([i({types:k})],n.prototype,"symbol",void 0),t([i()],n.prototype,"totalCosts",void 0),t([m("totalCosts",["attributes"])],n.prototype,"readTotalCosts",null),t([i()],n.prototype,"totalDistance",void 0),t([i()],n.prototype,"totalDuration",void 0),t([i()],n.prototype,"totalLateDuration",void 0),t([i()],n.prototype,"totalViolations",void 0),t([m("totalViolations",["attributes"])],n.prototype,"readTotalViolations",null),t([i()],n.prototype,"totalWait",void 0),t([m("totalWait",["attributes"])],n.prototype,"readTotalWait",null),t([i()],n.prototype,"totalWaitDuration",void 0),t([i({readOnly:!0,json:{read:!1}})],n.prototype,"type",void 0),t([i()],n.prototype,"version",void 0),n=ee=t([A("esri.rest.support.RouteInfo")],n);const Me=n;var te;let o=te=class extends x(C){constructor(e){super(e),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.geometry=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.posAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.type="stop",this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(e,a){return z(a.attributes.ArriveTime,a.attributes.ArriveTimeUTC)}readCumulativeCosts(e,a){return O(a.attributes,"Cumul_")}readDepartTimeOffset(e,a){return z(a.attributes.DepartTime,a.attributes.DepartTimeUTC)}readServiceCosts(e,a){return O(a.attributes,"Attr_")}writeServiceCosts(e,a){re(e,a,"Attr_")}writeTimeWindowEnd(e,a){D(e)||(a.attributes||(a.attributes={}),a.attributes.TimeWindowEnd=e.getTime())}writeTimeWindowStart(e,a){D(e)||(a.attributes||(a.attributes={}),a.attributes.TimeWindowStart=e.getTime())}readViolations(e,a){return O(a.attributes,"Violation_")}readWait(e,a){return O(a.attributes,"Wait_")}static fromGraphic(e){var a,s,l,f,N,w,F,B,J,R,P;return new te({arriveCurbApproach:r(e.attributes.ArrivalCurbApproach)?c.fromJSON(e.attributes.ArrivalCurbApproach):null,arriveTime:r(e.attributes.ArrivalTime)?new Date(e.attributes.ArrivalTime):null,arriveTimeOffset:e.attributes.ArrivalUTCOffset,cumulativeCosts:r(e.attributes.CumulativeCosts)?W(JSON.parse(e.attributes.CumulativeCosts)):null,cumulativeDistance:(a=e.attributes.CumulativeMeters)!=null?a:null,cumulativeDuration:(s=e.attributes.CumulativeMinutes)!=null?s:null,curbApproach:r(e.attributes.CurbApproach)?c.fromJSON(e.attributes.CurbApproach):null,departCurbApproach:r(e.attributes.DepartureCurbApproach)?c.fromJSON(e.attributes.DepartureCurbApproach):null,departTime:r(e.attributes.DepartureTime)?new Date(e.attributes.DepartureTime):null,departTimeOffset:(l=e.attributes.DepartureUTCOffset)!=null?l:null,geometry:e.geometry,lateDuration:(f=e.attributes.LateMinutes)!=null?f:null,locationType:r(e.attributes.LocationType)?$.fromJSON(e.attributes.LocationType):null,name:e.attributes.Name,objectId:(N=e.attributes.ObjectID)!=null?N:e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,routeName:e.attributes.RouteName,sequence:(w=e.attributes.Sequence)!=null?w:null,serviceCosts:r(e.attributes.ServiceCosts)?W(JSON.parse(e.attributes.ServiceCosts)):null,serviceDistance:(F=e.attributes.ServiceMeters)!=null?F:null,serviceDuration:(B=e.attributes.ServiceMinutes)!=null?B:null,status:r(e.attributes.Status)?I.fromJSON(e.attributes.Status):null,symbol:e.symbol,timeWindowEnd:r(e.attributes.TimeWindowEnd)?new Date(e.attributes.TimeWindowEnd):null,timeWindowEndOffset:(J=e.attributes.TimeWindowEndUTCOffset)!=null?J:null,timeWindowStart:r(e.attributes.TimeWindowStart)?new Date(e.attributes.TimeWindowStart):null,timeWindowStartOffset:(R=e.attributes.TimeWindowStartUTCOffset)!=null?R:null,waitDuration:(P=e.attributes.WaitMinutes)!=null?P:null})}toGraphic(){var a,s;const e={ObjectID:v(this.objectId),ArrivalCurbApproach:r(this.arriveCurbApproach)?c.toJSON(this.arriveCurbApproach):null,ArrivalTime:r(this.arriveTime)?this.arriveTime.getTime():null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:r(this.cumulativeCosts)?JSON.stringify(V(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:r(this.curbApproach)?c.toJSON(this.curbApproach):null,DepartureCurbApproach:r(this.departCurbApproach)?c.toJSON(this.departCurbApproach):null,DepartureTime:r(this.departTime)?this.departTime.getTime():null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:r(this.locationType)?$.toJSON(this.locationType):null,Name:v(this.name),RouteName:v(this.routeName),Sequence:this.sequence,ServiceCosts:r(this.serviceCosts)?JSON.stringify(V(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:r(this.status)?I.toJSON(this.status):null,TimeWindowEnd:r(this.timeWindowEnd)?this.timeWindowEnd.getTime():null,TimeWindowEndUTCOffset:(a=this.timeWindowEndOffset)!=null?a:this.arriveTimeOffset,TimeWindowStart:r(this.timeWindowStart)?this.timeWindowStart.getTime():null,TimeWindowStartUTCOffset:(s=this.timeWindowStartOffset)!=null?s:this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new M({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};o.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"ArrivalUTCOffset",alias:"Arrival Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"DepartureUTCOffset",alias:"Departure Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNALocationType",codedValues:[{name:"Stop",code:0},{name:"Waypoint",code:1}]}},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"Status",alias:"Status",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAObjectStatus",codedValues:[{name:"OK",code:0},{name:"Not Located on Network",code:1},{name:"Network Unbuilt",code:2},{name:"Prohibited Street",code:3},{name:"Invalid Field Values",code:4},{name:"Cannot Reach",code:5},{name:"Time Window Violation",code:6}]}},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!1},{name:"TimeWindowEndUTCOffset",alias:"Time Window End: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!1},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"WaitMinutes",alias:"Minutes Early",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1}],o.popupInfo={title:"{Name}",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"RouteName",label:"Route Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:"Sequence",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:"Arrival Time",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ArrivalUTCOffset",label:"Arrival Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureTime",label:"Departure Time",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"DepartureUTCOffset",label:"Departure Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CurbApproach",label:"Curb Approach",isEditable:!0,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalCurbApproach",label:"Arrival Curb Approach",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureCurbApproach",label:"Departure Curb Approach",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Status",label:"Status",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"LocationType",label:"Location Type",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowStart",label:"Time Window Start",isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowStartUTCOffset",label:"Time Window Start: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowEnd",label:"Time Window End",isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowEndUTCOffset",label:"Time Window End: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMinutes",label:"Service Minutes",isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMeters",label:"Service Meters",isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceCosts",label:"Service Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"CumulativeMinutes",label:"Cumulative Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeMeters",label:"Cumulative Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeCosts",label:"Cumulative Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"LateMinutes",label:"Minutes Late",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"WaitMinutes",label:"Minutes Early",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i({type:c.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:c.read}}})],o.prototype,"arriveCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],o.prototype,"arriveTime",void 0),t([i()],o.prototype,"arriveTimeOffset",void 0),t([m("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],o.prototype,"readArriveTimeOffset",null),t([i({json:{name:"attributes.Bearing",read:!1,write:!0}})],o.prototype,"bearing",void 0),t([i({json:{name:"attributes.BearingTol",read:!1,write:!0}})],o.prototype,"bearingTol",void 0),t([i()],o.prototype,"cumulativeCosts",void 0),t([m("cumulativeCosts",["attributes"])],o.prototype,"readCumulativeCosts",null),t([i()],o.prototype,"cumulativeDistance",void 0),t([i()],o.prototype,"cumulativeDuration",void 0),t([i({type:c.apiValues,json:{name:"attributes.CurbApproach",read:{reader:c.read},write:{writer:c.write}}})],o.prototype,"curbApproach",void 0),t([i({type:c.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:c.read}}})],o.prototype,"departCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],o.prototype,"departTime",void 0),t([i()],o.prototype,"departTimeOffset",void 0),t([m("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],o.prototype,"readDepartTimeOffset",null),t([i({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],o.prototype,"distanceToNetworkInMeters",void 0),t([i({type:ae,json:{write:!0}})],o.prototype,"geometry",void 0),t([i()],o.prototype,"lateDuration",void 0),t([i({type:$.apiValues,json:{name:"attributes.LocationType",read:{reader:$.read},write:{writer:$.write}}})],o.prototype,"locationType",void 0),t([i({json:{name:"attributes.Name"}})],o.prototype,"name",void 0),t([i({json:{name:"attributes.NavLatency",read:!1,write:!0}})],o.prototype,"navLatency",void 0),t([i({json:{name:"attributes.ObjectID"}})],o.prototype,"objectId",void 0),t([i({type:U})],o.prototype,"popupTemplate",void 0),t([i({json:{read:{source:"attributes.PosAlong"}}})],o.prototype,"posAlong",void 0),t([i({json:{name:"attributes.RouteName"}})],o.prototype,"routeName",void 0),t([i()],o.prototype,"serviceCosts",void 0),t([m("serviceCosts",["attributes"])],o.prototype,"readServiceCosts",null),t([E("serviceCosts")],o.prototype,"writeServiceCosts",null),t([i()],o.prototype,"serviceDistance",void 0),t([i()],o.prototype,"serviceDuration",void 0),t([i({json:{name:"attributes.Sequence"}})],o.prototype,"sequence",void 0),t([i({type:q.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:q.read}}})],o.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SnapX"}}})],o.prototype,"snapX",void 0),t([i({json:{read:{source:"attributes.SnapY"}}})],o.prototype,"snapY",void 0),t([i({json:{read:{source:"attributes.SnapZ"}}})],o.prototype,"snapZ",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],o.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],o.prototype,"sourceOid",void 0),t([i({type:I.apiValues,json:{read:{source:"attributes.Status",reader:I.read}}})],o.prototype,"status",void 0),t([i({types:k})],o.prototype,"symbol",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowEnd"}})],o.prototype,"timeWindowEnd",void 0),t([E("timeWindowEnd")],o.prototype,"writeTimeWindowEnd",null),t([i()],o.prototype,"timeWindowEndOffset",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowStart"}})],o.prototype,"timeWindowStart",void 0),t([E("timeWindowStart")],o.prototype,"writeTimeWindowStart",null),t([i()],o.prototype,"timeWindowStartOffset",void 0),t([i({readOnly:!0,json:{read:!1}})],o.prototype,"type",void 0),t([i()],o.prototype,"violations",void 0),t([m("violations",["attributes"])],o.prototype,"readViolations",null),t([i()],o.prototype,"waitDuration",void 0),t([i()],o.prototype,"wait",void 0),t([m("wait",["attributes"])],o.prototype,"readWait",null),o=te=t([A("esri.rest.support.Stop")],o);const Ue=o;export{ye as A,Ue as D,ce as N,xe as O,Ce as R,Oe as S,Ae as U,Me as a,we as b,z as c,ne as d,Ne as e,je as f,Ee as g,Fe as h,ue as i,Se as j,de as k,Te as l,Ie as n,he as r,ge as s,fe as t,De as w,j as y}; +import{ef as u,eg as x,u as v,c as r,d1 as M,a6 as t,a7 as i,cS as ie,dv as U,eh as k,a8 as A,cx as C,d2 as m,af as ae,j as D,e0 as E,az as pe,ei as L}from"./index.221827cd.js";const ue=u()({esriCentimeters:"centimeters",esriDecimalDegrees:"decimal-degrees",esriDecimeters:"decimeters",esriFeet:"feet",esriInches:"inches",esriKilometers:"kilometers",esriMeters:"meters",esriMiles:"miles",esriMillimeters:"millimeters",esriNauticalMiles:"nautical-miles",esriPoints:"points",esriUnknownUnits:"unknown",esriYards:"yards"}),he=u()({esriNAUCentimeters:"centimeters",esriNAUDecimalDegrees:"decimal-degrees",esriNAUDecimeters:"decimeters",esriNAUFeet:"feet",esriNAUInches:"inches",esriNAUKilometers:"kilometers",esriNAUMeters:"meters",esriNAUMiles:"miles",esriNAUMillimeters:"millimeters",esriNAUNauticalMiles:"nautical-miles",esriNAUPoints:"points",esriNAUYards:"yards"}),fe=u()({esriNAUDays:"days",esriNAUHours:"hours",esriNAUMinutes:"minutes",esriNAUSeconds:"seconds"}),ge=u()({esriDOTComplete:"complete",esriDOTCompleteNoEvents:"complete-no-events",esriDOTFeatureSets:"featuresets",esriDOTInstructionsOnly:"instructions-only",esriDOTStandard:"standard",esriDOTSummaryOnly:"summary-only"}),Se=u()({esriNAOutputLineNone:"none",esriNAOutputLineStraight:"straight",esriNAOutputLineTrueShape:"true-shape",esriNAOutputLineTrueShapeWithMeasure:"true-shape-with-measure"});u()({esriNAOutputPolygonNone:"none",esriNAOutputPolygonSimplified:"simplified",esriNAOutputPolygonDetailed:"detailed"});const de=u()({esriNFSBAllowBacktrack:"allow-backtrack",esriNFSBAtDeadEndsOnly:"at-dead-ends-only",esriNFSBNoBacktrack:"no-backtrack",esriNFSBAtDeadEndsAndIntersections:"at-dead-ends-and-intersections"});u()({esriNATravelDirectionFromFacility:"from-facility",esriNATravelDirectionToFacility:"to-facility"});u()({esriNATimeOfDayNotUsed:"not-used",esriNATimeOfDayUseAsStartTime:"start",esriNATimeOfDayUseAsEndTime:"end"});const me=u()({AUTOMOBILE:"automobile",TRUCK:"truck",WALK:"walk",OTHER:"other"}),c=u()({0:"either-side-of-vehicle",1:"right-side-of-vehicle",2:"left-side-of-vehicle",3:"no-u-turn"},{useNumericKeys:!0}),$=u()({0:"stop",1:"waypoint",2:"break"},{useNumericKeys:!0}),I=u()({0:"ok",1:"not-located",2:"network-element-not-located",3:"element-not-traversable",4:"invalid-field-values",5:"not-reached",6:"time-window-violation",7:"not-located-on-closest"},{useNumericKeys:!0}),q=u()({1:"right",2:"left"},{useNumericKeys:!0}),g=u()({0:"restriction",1:"added-cost"},{useNumericKeys:!0}),_=u()({0:"permit",1:"restrict"},{useNumericKeys:!0}),G=u()({1:"header",50:"arrive",51:"depart",52:"straight",100:"on-ferry",101:"off-ferry",102:"central-fork",103:"roundabout",104:"u-turn",150:"door",151:"stairs",152:"elevator",153:"escalator",154:"pedestrian-ramp",200:"left-fork",201:"left-ramp",202:"clockwise-roundabout",203:"left-handed-u-turn",204:"bear-left",205:"left-turn",206:"sharp-left",207:"left-turn-and-immediate-left-turn",208:"left-turn-and-immediate-right-turn",300:"right-fork",301:"right-ramp",302:"counter-clockwise-roundabout",303:"right-handed-u-turn",304:"bear-right",305:"right-turn",306:"sharp-right",307:"right-turn-and-immediate-left-turn",308:"right-turn-and-immediate-right-turn",400:"up-elevator",401:"up-escalator",402:"up-stairs",500:"down-elevator",501:"down-escalator",502:"down-stairs",1e3:"general-event",1001:"landmark",1002:"time-zone-change",1003:"traffic-event",1004:"scaled-cost-barrier-event",1005:"boundary-crossing",1006:"restriction-violation"},{useNumericKeys:!0}),K=u()({0:"unknown",1:"segment",2:"maneuver-segment",3:"restriction-violation",4:"scaled-cost-barrier",5:"heavy-traffic",6:"slow-traffic",7:"moderate-traffic"},{useNumericKeys:!0}),Ne=u()({"NA Campus":"campus","NA Desktop":"desktop","NA Navigation":"navigation"}),be=u()({Kilometers:"kilometers",Miles:"miles",Meters:"meters"},{ignoreUnknown:!1}),ce=u()({Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),j=u()({Kilometers:"kilometers",Miles:"miles",Meters:"meters",Minutes:"minutes",TimeAt1KPH:"time-at-1-kph",TravelTime:"travel-time",TruckMinutes:"truck-minutes",TruckTravelTime:"truck-travel-time",WalkTime:"walk-time"},{ignoreUnknown:!1}),ne=u()({"Any Hazmat Prohibited":"any-hazmat-prohibited","Avoid Carpool Roads":"avoid-carpool-roads","Avoid Express Lanes":"avoid-express-lanes","Avoid Ferries":"avoid-ferries","Avoid Gates":"avoid-gates","Avoid Limited Access Roads":"avoid-limited-access-roads","Avoid Private Roads":"avoid-private-roads","Avoid Roads Unsuitable for Pedestrians":"avoid-roads-unsuitable-for-pedestrians","Avoid Stairways":"avoid-stairways","Avoid Toll Roads":"avoid-toll-roads","Avoid Toll Roads for Trucks":"avoid-toll-roads-for-trucks","Avoid Truck Restricted Roads":"avoid-truck-restricted-roads","Avoid Unpaved Roads":"avoid-unpaved-roads","Axle Count Restriction":"axle-count-restriction","Driving a Bus":"driving-a-bus","Driving a Taxi":"driving-a-taxi","Driving a Truck":"driving-a-truck","Driving an Automobile":"driving-an-automobile","Driving an Emergency Vehicle":"driving-an-emergency-vehicle","Height Restriction":"height-restriction","Kingpin to Rear Axle Length Restriction":"kingpin-to-rear-axle-length-restriction","Length Restriction":"length-restriction","Preferred for Pedestrians":"preferred-for-pedestrians","Riding a Motorcycle":"riding-a-motorcycle","Roads Under Construction Prohibited":"roads-under-construction-prohibited","Semi or Tractor with One or More Trailers Prohibited":"semi-or-tractor-with-one-or-more-trailers-prohibited","Single Axle Vehicles Prohibited":"single-axle-vehicles-prohibited","Tandem Axle Vehicles Prohibited":"tandem-axle-vehicles-prohibited","Through Traffic Prohibited":"through-traffic-prohibited","Truck with Trailers Restriction":"truck-with-trailers-restriction","Use Preferred Hazmat Routes":"use-preferred-hazmat-routes","Use Preferred Truck Routes":"use-preferred-truck-routes",Walking:"walking","Weight Restriction":"weight-restriction"},{ignoreUnknown:!1}),Oe=u()({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),De=u()({esriGeometryPoint:"point",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"envelope",esriGeometryMultipoint:"multipoint"}),Ae=u()({esriNAUTCost:"cost",esriNAUTDescriptor:"descriptor",esriNAUTRestriction:"restriction",esriNAUTHierarchy:"hierarchy"}),Ce=u()({esriDSTAltName:"alt-name",esriDSTArrive:"arrive",esriDSTBranch:"branch",esriDSTCrossStreet:"cross-street",esriDSTCumulativeLength:"cumulative-length",esriDSTDepart:"depart",esriDSTEstimatedArrivalTime:"estimated-arrival-time",esriDSTExit:"exit",esriDSTGeneral:"general",esriDSTLength:"length",esriDSTServiceTime:"service-time",esriDSTStreetName:"street-name",esriDSTSummary:"summary",esriDSTTime:"time",esriDSTTimeWindow:"time-window",esriDSTToward:"toward",esriDSTViolationTime:"violation-time",esriDSTWaitTime:"wait-time"});var H;let y=H=class extends x(C){constructor(e){super(e),this.directionLineType=null,this.directionPointId=null,this.distance=null,this.duration=null,this.fromLevel=null,this.geometry=null,this.objectId=null,this.popupTemplate=null,this.symbol=null,this.toLevel=null,this.type="direction-line"}static fromGraphic(e){var a,s,l;return new H({directionLineType:K.fromJSON(e.attributes.DirectionLineType),directionPointId:e.attributes.DirectionPointID,distance:e.attributes.Meters,duration:e.attributes.Minutes,fromLevel:(a=e.attributes.FromLevel)!=null?a:null,geometry:e.geometry,objectId:(s=e.attributes.ObjectID)!=null?s:e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,symbol:e.symbol,toLevel:(l=e.attributes.ToLevel)!=null?l:null})}toGraphic(){const e={ObjectID:v(this.objectId),DirectionLineType:r(this.directionLineType)?K.toJSON(this.directionLineType):null,DirectionPointID:v(this.directionPointId),Meters:v(this.distance),Minutes:v(this.duration)};return r(this.fromLevel)&&(e.FromLevel=this.fromLevel),r(this.toLevel)&&(e.ToLevel=this.toLevel),new M({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};y.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"DirectionLineType",alias:"Line Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriDirectionsLineType",codedValues:[{name:"Unknown",code:0},{name:"Segment",code:1},{name:"Maneuver Segment",code:2},{name:"Restriction violation",code:3},{name:"Scale cost barrier crossing",code:4},{name:"Heavy Traffic",code:5},{name:"Slow Traffic",code:6},{name:"Moderate Traffic",code:7}]}},{name:"DirectionPointID",alias:"Direction Point ID",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1},{name:"FromLevel",alias:"Start from 3D Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1},{name:"Meters",alias:"Length in Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"Minutes",alias:"Duration in Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"ToLevel",alias:"End at 3D Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1}],y.popupInfo={title:"Direction Lines",fieldInfos:[{fieldName:"DirectionLineType",label:"Line Type",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Meters",label:"Length in Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Minutes",label:"Duration in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DirectionPointID",label:"Direction Point ID",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"FromLevel",label:"Start from 3D Level",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ToLevel",label:"End at 3D Level",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i({type:K.apiValues,json:{read:{source:"attributes.DirectionLineType",reader:K.read}}})],y.prototype,"directionLineType",void 0),t([i({json:{read:{source:"attributes.DirectionPointID"}}})],y.prototype,"directionPointId",void 0),t([i({json:{read:{source:"attributes.Meters"}}})],y.prototype,"distance",void 0),t([i({json:{read:{source:"attributes.Minutes"}}})],y.prototype,"duration",void 0),t([i({json:{read:{source:"attributes.FromLevel"}}})],y.prototype,"fromLevel",void 0),t([i({type:ie})],y.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],y.prototype,"objectId",void 0),t([i({type:U})],y.prototype,"popupTemplate",void 0),t([i({types:k})],y.prototype,"symbol",void 0),t([i({json:{read:{source:"attributes.ToLevel"}}})],y.prototype,"toLevel",void 0),t([i({readOnly:!0,json:{read:!1}})],y.prototype,"type",void 0),y=H=t([A("esri.rest.support.DirectionLine")],y);const we=y;var Y;let p=Y=class extends x(C){constructor(e){super(e),this.alternateName=null,this.arrivalTime=null,this.arrivalTimeOffset=null,this.azimuth=null,this.branchName=null,this.directionPointType=null,this.displayText=null,this.exitName=null,this.geometry=null,this.intersectingName=null,this.level=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sequence=null,this.shortVoiceInstruction=null,this.stopId=null,this.symbol=null,this.towardName=null,this.type="direction-point",this.voiceInstruction=null}readArrivalTime(e,a){return r(a.attributes.ArrivalTime)?new Date(a.attributes.ArrivalTime):null}static fromGraphic(e){var a,s,l,f,N,w,F,B,J,R,P,se,oe,le;return new Y({alternateName:(a=e.attributes.AlternateName)!=null?a:null,arrivalTime:r(e.attributes.ArrivalTime)?new Date(e.attributes.ArrivalTime):null,arrivalTimeOffset:(s=e.attributes.ArrivalUTCOffset)!=null?s:null,azimuth:(l=e.attributes.Azimuth)!=null?l:null,branchName:(f=e.attributes.BranchName)!=null?f:null,directionPointType:G.fromJSON(e.attributes.DirectionPointType),displayText:(N=e.attributes.DisplayText)!=null?N:null,exitName:(w=e.attributes.ExitName)!=null?w:null,geometry:e.geometry,intersectingName:(F=e.attributes.IntersectingName)!=null?F:null,level:(B=e.attributes.Level)!=null?B:null,name:(J=e.attributes.Name)!=null?J:null,objectId:(R=e.attributes.ObjectID)!=null?R:e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,sequence:e.attributes.Sequence,shortVoiceInstruction:(P=e.attributes.ShortVoiceInstruction)!=null?P:null,stopId:(se=e.attributes.StopID)!=null?se:null,symbol:e.symbol,towardName:(oe=e.attributes.TowardName)!=null?oe:null,voiceInstruction:(le=e.attributes.VoiceInstruction)!=null?le:null})}toGraphic(){const e={ObjectID:v(this.objectId),DirectionPointType:r(this.directionPointType)?G.toJSON(this.directionPointType):null,Sequence:v(this.sequence),StopID:this.stopId};return r(this.alternateName)&&(e.AlternateName=this.alternateName),r(this.arrivalTime)&&(e.ArrivalTime=this.arrivalTime.getTime()),r(this.arrivalTimeOffset)&&(e.ArrivalUTCOffset=this.arrivalTimeOffset),r(this.azimuth)&&(e.Azimuth=this.azimuth),r(this.branchName)&&(e.BranchName=this.branchName),r(this.displayText)&&(e.DisplayText=this.displayText),r(this.exitName)&&(e.ExitName=this.exitName),r(this.intersectingName)&&(e.IntersectingName=this.intersectingName),r(this.level)&&(e.Level=this.level),r(this.name)&&(e.Name=this.name),r(this.shortVoiceInstruction)&&(e.ShortVoiceInstruction=this.shortVoiceInstruction),r(this.towardName)&&(e.TowardName=this.towardName),r(this.voiceInstruction)&&(e.VoiceInstruction=this.voiceInstruction),new M({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};p.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AlternateName",alias:"Alternative Feature Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"ArrivalTime",alias:"Maneuver Starts at",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"ArrivalUTCOffset",alias:"Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Azimuth",alias:"Azimuth",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"BranchName",alias:"Signpost Branch Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"DirectionPointType",alias:"Directions Item Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriDirectionPointType",codedValues:[{name:"Unknown",code:0},{name:"",code:1},{name:"Arrive at stop",code:50},{name:"Depart at stop",code:51},{name:"Go straight",code:52},{name:"Take ferry",code:100},{name:"Take off ferry",code:101},{name:"Keep center at fork",code:102},{name:"Take roundabout",code:103},{name:"Make U-Turn",code:104},{name:"Pass the door",code:150},{name:"Take stairs",code:151},{name:"",code:152},{name:"Take escalator",code:153},{name:"Take pedestrian ramp",code:154},{name:"Keep left at fork",code:200},{name:"Ramp left",code:201},{name:"Take left-handed roundabout",code:202},{name:"Make left-handed U-Turn",code:203},{name:"Bear left",code:204},{name:"Turn left",code:205},{name:"Make sharp left",code:206},{name:"Turn left, followed by turn left",code:207},{name:"Turn left, followed by turn right",code:208},{name:"Keep right at fork",code:300},{name:"Ramp right",code:301},{name:"Take right-handed roundabout",code:302},{name:"Make right-handed U-Turn",code:303},{name:"Bear right",code:304},{name:"Turn right",code:305},{name:"Make sharp right",code:306},{name:"Turn right, followed by turn left",code:307},{name:"Turn right, followed by turn right",code:308},{name:"Indicates up direction of elevator",code:400},{name:"Indicates up direction of escalator",code:401},{name:"Take up-stairs",code:402},{name:"Indicates down direction of elevator",code:500},{name:"Indicates down direction of escalator",code:501},{name:"Take down-stairs",code:502},{name:"General event",code:1e3},{name:"Landmark",code:1001},{name:"Time zone change",code:1002},{name:"Heavy traffic segment",code:1003},{name:"Scale cost barrier crossing",code:1004},{name:"Administrative Border crossing",code:1005},{name:"Restriction violation",code:1006}]}},{name:"DisplayText",alias:"Text to Display",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"ExitName",alias:"Highway Exit Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"IntersectingName",alias:"Intersecting Feature Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"Level",alias:"3D Logical Level",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Name",alias:"Primary Feature Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"ShortVoiceInstruction",alias:"Voice Instruction",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"StopID",alias:"Stop ID",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TowardName",alias:"Signpost Toward Name",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null},{name:"VoiceInstruction",alias:"Voice Full Instruction",type:"esriFieldTypeString",length:2048,editable:!0,nullable:!0,visible:!0,domain:null}],p.popupInfo={title:"{DisplayText}",fieldInfos:[{fieldName:"DirectionPointType",label:"Directions Item Type",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"DisplayText",label:"Text to Display",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:"Sequence",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"StopID",label:"Stop ID",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:"Maneuver Starts at",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ArrivalUTCOffset",label:"Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Azimuth",label:"Azimuth",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Name",label:"Primary Feature Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"AlternateName",label:"Alternative Feature Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ExitName",label:"Highway Exit Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"IntersectingName",label:"Intersecting Feature Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BranchName",label:"Signpost Branch Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TowardName",label:"Signpost Toward Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ShortVoiceInstruction",label:"Voice Instruction",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"VoiceInstruction",label:"Voice Full Instruction",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i()],p.prototype,"alternateName",void 0),t([i()],p.prototype,"arrivalTime",void 0),t([m("arrivalTime",["attributes.ArrivalTime"])],p.prototype,"readArrivalTime",null),t([i({json:{read:{source:"attributes.ArrivalUTCOffset"}}})],p.prototype,"arrivalTimeOffset",void 0),t([i({json:{read:{source:"attributes.Azimuth"}}})],p.prototype,"azimuth",void 0),t([i({json:{read:{source:"attributes.BranchName"}}})],p.prototype,"branchName",void 0),t([i({type:G.apiValues,json:{read:{source:"attributes.DirectionPointType",reader:G.read}}})],p.prototype,"directionPointType",void 0),t([i({json:{read:{source:"attributes.DisplayText"}}})],p.prototype,"displayText",void 0),t([i({json:{read:{source:"attributes.ExitName"}}})],p.prototype,"exitName",void 0),t([i({type:ae})],p.prototype,"geometry",void 0),t([i()],p.prototype,"intersectingName",void 0),t([i()],p.prototype,"level",void 0),t([i({json:{read:{source:"attributes.Name"}}})],p.prototype,"name",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],p.prototype,"objectId",void 0),t([i({type:U})],p.prototype,"popupTemplate",void 0),t([i({json:{read:{source:"attributes.Sequence"}}})],p.prototype,"sequence",void 0),t([i()],p.prototype,"shortVoiceInstruction",void 0),t([i({json:{read:{source:"attributes.StopID"}}})],p.prototype,"stopId",void 0),t([i({types:k})],p.prototype,"symbol",void 0),t([i({json:{read:{source:"attributes.TowardName"}}})],p.prototype,"towardName",void 0),t([i({readOnly:!0,json:{read:!1}})],p.prototype,"type",void 0),t([i()],p.prototype,"voiceInstruction",void 0),p=Y=t([A("esri.rest.support.DirectionPoint")],p);const Fe=p;function O(e,a){if(D(e))return null;const s={},l=new RegExp(`^${a}`,"i");for(const f of Object.keys(e))if(l.test(f)){const N=f.substring(a.length);s[j.fromJSON(N)]=e[f]}return s}function re(e,a,s){if(!D(e)){a.attributes||(a.attributes={});for(const l in e){const f=j.toJSON(l);a.attributes[`${s}${f}`]=e[l]}}}function W(e){const a={};for(const s of Object.keys(e)){const l=s;a[j.fromJSON(l)]=e[s]}return a}function V(e){const a={};for(const s of Object.keys(e)){const l=s;a[j.toJSON(l)]=e[s]}return a}function z(e,a){return D(e)||D(a)?null:Math.round((e-a)/6e4)}function Ie(e){const a=e.toJSON(),s=a;return s.accumulateAttributeNames&&(s.accumulateAttributeNames=a.accumulateAttributeNames.join()),s.attributeParameterValues&&(s.attributeParameterValues=JSON.stringify(a.attributeParameterValues)),s.barriers&&(s.barriers=JSON.stringify(a.barriers)),s.outSR&&(s.outSR=a.outSR.wkid),s.overrides&&(s.overrides=JSON.stringify(a.overrides)),s.polygonBarriers&&(s.polygonBarriers=JSON.stringify(a.polygonBarriers)),s.polylineBarriers&&(s.polylineBarriers=JSON.stringify(a.polylineBarriers)),s.restrictionAttributeNames&&(s.restrictionAttributeNames=a.restrictionAttributeNames.join()),s.stops&&(s.stops=JSON.stringify(a.stops)),s.travelMode&&(s.travelMode=JSON.stringify(a.travelMode)),s}var X;let d=X=class extends x(C){constructor(e){super(e),this.addedCost=null,this.barrierType=null,this.costs=null,this.curbApproach=null,this.fullEdge=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.sideOfEdge=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.type="point-barrier"}readCosts(e,a){return O(a.attributes,"Attr_")}writeCosts(e,a){re(e,a,"Attr_")}static fromGraphic(e){var a,s,l;return new X({addedCost:(a=e.attributes.AddedCost)!=null?a:null,barrierType:r(e.attributes.BarrierType)?g.fromJSON(e.attributes.BarrierType):null,costs:r(e.attributes.Costs)?W(JSON.parse(e.attributes.Costs)):null,curbApproach:r(e.attributes.CurbApproach)?c.fromJSON(e.attributes.CurbApproach):null,fullEdge:r(e.attributes.FullEdge)?_.fromJSON(e.attributes.FullEdge):null,geometry:e.geometry,name:(s=e.attributes.Name)!=null?s:null,objectId:(l=e.attributes.ObjectID)!=null?l:e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,status:r(e.attributes.Status)?I.fromJSON(e.attributes.Status):null,symbol:e.symbol})}toGraphic(){const e={ObjectID:v(this.objectId),AddedCost:this.addedCost,BarrierType:r(this.barrierType)?g.toJSON(this.barrierType):null,Costs:r(this.costs)?JSON.stringify(V(this.costs)):null,CurbApproach:r(this.curbApproach)?c.toJSON(this.curbApproach):null,FullEdge:r(this.fullEdge)?_.toJSON(this.fullEdge):null,Name:this.name,Status:r(this.status)?I.toJSON(this.status):null};return new M({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};d.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AddedCost",alias:"Added Cost",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0,domain:null},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:"Restriction",code:0},{name:"Scaled Cost",code:1},{name:"Added Cost",code:2}]}},{name:"Costs",alias:"Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"FullEdge",alias:"Full Edge",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAIntYesNo",codedValues:[{name:"No",code:0},{name:"Yes",code:1}]}},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"Status",alias:"Status",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAObjectStatus",codedValues:[{name:"OK",code:0},{name:"Not Located on Network",code:1},{name:"Network Unbuilt",code:2},{name:"Prohibited Street",code:3},{name:"Invalid Field Values",code:4},{name:"Cannot Reach",code:5},{name:"Time Window Violation",code:6}]}}],d.popupInfo={title:"Point Barriers",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:"Barrier Type",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"AddedCost",label:"Added Cost",isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i()],d.prototype,"addedCost",void 0),t([i({type:g.apiValues,json:{name:"attributes.BarrierType",read:{reader:g.read},write:{writer:g.write}}})],d.prototype,"barrierType",void 0),t([i()],d.prototype,"costs",void 0),t([m("costs",["attributes"])],d.prototype,"readCosts",null),t([E("costs")],d.prototype,"writeCosts",null),t([i({type:c.apiValues,json:{read:{source:"attributes.CurbApproach",reader:c.read}}})],d.prototype,"curbApproach",void 0),t([i({type:_.apiValues,json:{name:"attributes.FullEdge",read:{reader:_.read},write:{writer:_.write}}})],d.prototype,"fullEdge",void 0),t([i({type:ae,json:{write:!0}})],d.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],d.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],d.prototype,"objectId",void 0),t([i({type:U})],d.prototype,"popupTemplate",void 0),t([i({type:q.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:q.read}}})],d.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],d.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],d.prototype,"sourceOid",void 0),t([i({type:I.apiValues,json:{read:{source:"attributes.Status",reader:I.read}}})],d.prototype,"status",void 0),t([i({types:k})],d.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],d.prototype,"type",void 0),d=X=t([A("esri.rest.support.PointBarrier")],d);const xe=d;var Z;let T=Z=class extends x(C){constructor(e){super(e),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polygon-barrier"}readCosts(e,a){return O(a.attributes,"Attr_")}writeCosts(e,a){re(e,a,"Attr_")}static fromGraphic(e){var a,s,l;return new Z({barrierType:r(e.attributes.BarrierType)?g.fromJSON(e.attributes.BarrierType):null,costs:r(e.attributes.Costs)?W(JSON.parse(e.attributes.Costs)):null,geometry:e.geometry,name:(a=e.attributes.Name)!=null?a:null,objectId:(s=e.attributes.ObjectID)!=null?s:e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,scaleFactor:(l=e.attributes.ScaleFactor)!=null?l:null,symbol:e.symbol})}toGraphic(){var a,s;const e={ObjectID:v(this.objectId),BarrierType:r(this.barrierType)?g.toJSON(this.barrierType):null,Costs:r(this.costs)?JSON.stringify(V(this.costs)):null,Name:(a=this.name)!=null?a:null,ScaleFactor:(s=this.scaleFactor)!=null?s:null};return new M({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};T.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:"Restriction",code:0},{name:"Scaled Cost",code:1},{name:"Added Cost",code:2}]}},{name:"Costs",alias:"Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0}],T.popupInfo={title:"Polygon Barriers",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:"Barrier Type",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ScaleFactor",isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Costs",label:"Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i({type:g.apiValues,json:{name:"attributes.BarrierType",read:{reader:g.read},write:{writer:g.write}}})],T.prototype,"barrierType",void 0),t([i()],T.prototype,"costs",void 0),t([m("costs",["attributes"])],T.prototype,"readCosts",null),t([E("costs")],T.prototype,"writeCosts",null),t([i({type:pe,json:{write:!0}})],T.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],T.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],T.prototype,"objectId",void 0),t([i({type:U})],T.prototype,"popupTemplate",void 0),t([i()],T.prototype,"scaleFactor",void 0),t([i({types:k})],T.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],T.prototype,"type",void 0),T=Z=t([A("esri.rest.support.PolygonBarrier")],T);const Ee=T;var Q;let h=Q=class extends x(C){constructor(e){super(e),this.barrierType=null,this.costs=null,this.geometry=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.scaleFactor=null,this.symbol=null,this.type="polyline-barrier"}readCosts(e,a){return O(a.attributes,"Attr_")}static fromGraphic(e){var a,s,l;return new Q({barrierType:r(e.attributes.BarrierType)?g.fromJSON(e.attributes.BarrierType):null,costs:r(e.attributes.Costs)?W(JSON.parse(e.attributes.Costs)):null,geometry:e.geometry,name:(a=e.attributes.Name)!=null?a:null,objectId:(s=e.attributes.ObjectID)!=null?s:e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,scaleFactor:(l=e.attributes.ScaleFactor)!=null?l:null,symbol:e.symbol})}toGraphic(){const e={ObjectID:v(this.objectId),BarrierType:r(this.barrierType)?g.toJSON(this.barrierType):null,Costs:r(this.costs)?JSON.stringify(V(this.costs)):null,Name:this.name,ScaleFactor:this.scaleFactor};return new M({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};h.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"BarrierType",alias:"Barrier Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNABarrierType",codedValues:[{name:"Restriction",code:0},{name:"Scaled Cost",code:1},{name:"Added Cost",code:2}]}},{name:"Costs",alias:"Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"ScaleFactor",alias:"Scale Factor",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0}],h.popupInfo={title:"Line Barriers",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"BarrierType",label:"Barrier Type",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"ScaleFactor",isEditable:!0,tooltip:"",visible:!0,format:{places:3,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Costs",label:"Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i({type:g.apiValues,json:{read:{source:"attributes.BarrierType",reader:g.read}}})],h.prototype,"barrierType",void 0),t([i()],h.prototype,"costs",void 0),t([m("costs",["attributes"])],h.prototype,"readCosts",null),t([i({type:ie,json:{write:!0}})],h.prototype,"geometry",void 0),t([i({json:{name:"attributes.Name"}})],h.prototype,"name",void 0),t([i({json:{name:"attributes.ObjectID"}})],h.prototype,"objectId",void 0),t([i({type:U})],h.prototype,"popupTemplate",void 0),t([i()],h.prototype,"scaleFactor",void 0),t([i({types:k})],h.prototype,"symbol",void 0),t([i({readOnly:!0,json:{read:!1}})],h.prototype,"type",void 0),h=Q=t([A("esri.rest.support.PolylineBarrier")],h);const je=h;let b=class extends x(C){constructor(e){super(e),this.attributeParameterValues=null,this.description=null,this.distanceAttributeName=null,this.id=null,this.impedanceAttributeName=null,this.name=null,this.restrictionAttributeNames=null,this.simplificationTolerance=null,this.simplificationToleranceUnits=null,this.timeAttributeName=null,this.type=null,this.useHierarchy=null,this.uturnAtJunctions=null}readRestrictionAttributes(e,a){const{restrictionAttributeNames:s}=a;return D(s)?null:s.map(l=>ne.fromJSON(l))}writeRestrictionAttributes(e,a,s){D(e)||(a[s]=e.map(l=>ne.toJSON(l)))}};t([i({type:[Object],json:{write:!0}})],b.prototype,"attributeParameterValues",void 0),t([i({type:String,json:{write:!0}})],b.prototype,"description",void 0),t([L(be,{ignoreUnknown:!1})],b.prototype,"distanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],b.prototype,"id",void 0),t([L(j,{ignoreUnknown:!1})],b.prototype,"impedanceAttributeName",void 0),t([i({type:String,json:{write:!0}})],b.prototype,"name",void 0),t([i({type:[String],json:{write:!0}})],b.prototype,"restrictionAttributeNames",void 0),t([m("restrictionAttributeNames")],b.prototype,"readRestrictionAttributes",null),t([E("restrictionAttributeNames")],b.prototype,"writeRestrictionAttributes",null),t([i({type:Number,json:{write:{allowNull:!0}}})],b.prototype,"simplificationTolerance",void 0),t([L(ue)],b.prototype,"simplificationToleranceUnits",void 0),t([L(ce,{ignoreUnknown:!1})],b.prototype,"timeAttributeName",void 0),t([L(me)],b.prototype,"type",void 0),t([i({type:Boolean,json:{write:!0}})],b.prototype,"useHierarchy",void 0),t([L(de)],b.prototype,"uturnAtJunctions",void 0),b=t([A("esri.rest.support.TravelMode")],b);const ye=b;let S=class extends C{constructor(e){super(e),this.accumulateAttributes=null,this.directionsLanguage=null,this.findBestSequence=null,this.preserveFirstStop=null,this.preserveLastStop=null,this.startTimeIsUTC=null,this.timeWindowsAreUTC=null,this.travelMode=null}readAccumulateAttributes(e){return D(e)?null:e.map(a=>j.fromJSON(a))}writeAccumulateAttributes(e,a,s){!D(e)&&e.length&&(a[s]=e.map(l=>j.toJSON(l)))}};t([i({type:[String],json:{name:"accumulateAttributeNames",write:!0}})],S.prototype,"accumulateAttributes",void 0),t([m("accumulateAttributes")],S.prototype,"readAccumulateAttributes",null),t([E("accumulateAttributes")],S.prototype,"writeAccumulateAttributes",null),t([i({type:String,json:{write:!0}})],S.prototype,"directionsLanguage",void 0),t([i({type:Boolean,json:{write:!0}})],S.prototype,"findBestSequence",void 0),t([i({type:Boolean,json:{write:!0}})],S.prototype,"preserveFirstStop",void 0),t([i({type:Boolean,json:{write:!0}})],S.prototype,"preserveLastStop",void 0),t([i({type:Boolean,json:{write:!0}})],S.prototype,"startTimeIsUTC",void 0),t([i({type:Boolean,json:{write:!0}})],S.prototype,"timeWindowsAreUTC",void 0),t([i({type:ye,json:{write:!0}})],S.prototype,"travelMode",void 0),S=t([A("esri.layers.support.RouteSettings")],S);const Te=S;var ee;let n=ee=class extends x(C){constructor(e){super(e),this.analysisSettings=null,this.endTime=null,this.endTimeOffset=null,this.firstStopId=null,this.geometry=null,this.lastStopId=null,this.messages=null,this.name=null,this.objectId=null,this.popupTemplate=null,this.startTime=null,this.startTimeOffset=null,this.stopCount=null,this.symbol=null,this.totalCosts=null,this.totalDistance=null,this.totalDuration=null,this.totalLateDuration=null,this.totalViolations=null,this.totalWait=null,this.totalWaitDuration=null,this.type="route-info",this.version="1.0.0"}readEndTime(e,a){return r(a.attributes.EndTimeUTC)?new Date(a.attributes.EndTimeUTC):null}readEndTimeOffset(e,a){return z(a.attributes.EndTime,a.attributes.EndTimeUTC)}readStartTime(e,a){return r(a.attributes.StartTimeUTC)?new Date(a.attributes.StartTimeUTC):null}readStartTimeOffset(e,a){return z(a.attributes.StartTime,a.attributes.StartTimeUTC)}readTotalCosts(e,a){return O(a.attributes,"Total_")}readTotalViolations(e,a){return O(a.attributes,"TotalViolation_")}readTotalWait(e,a){return O(a.attributes,"TotalWait_")}static fromGraphic(e){var a,s,l,f,N,w,F;return new ee({analysisSettings:r(e.attributes.AnalysisSettings)?Te.fromJSON(JSON.parse(e.attributes.AnalysisSettings)):null,endTime:r(e.attributes.EndTime)?new Date(e.attributes.EndTime):null,endTimeOffset:(a=e.attributes.EndUTCOffset)!=null?a:null,geometry:e.geometry,messages:r(e.attributes.Messages)?JSON.parse(e.attributes.Messages):null,name:e.attributes.RouteName,objectId:(s=e.attributes.ObjectID)!=null?s:e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,startTime:r(e.attributes.StartTime)?new Date(e.attributes.StartTime):null,startTimeOffset:(l=e.attributes.StartUTCOffset)!=null?l:null,symbol:e.symbol,totalCosts:r(e.attributes.TotalCosts)?W(JSON.parse(e.attributes.TotalCosts)):null,totalDistance:(f=e.attributes.TotalMeters)!=null?f:null,totalDuration:(N=e.attributes.TotalMinutes)!=null?N:null,totalLateDuration:(w=e.attributes.TotalLateMinutes)!=null?w:null,totalWaitDuration:(F=e.attributes.TotalWaitMinutes)!=null?F:null,version:e.attributes.Version})}toGraphic(){const e={ObjectID:v(this.objectId),AnalysisSettings:r(this.analysisSettings)?JSON.stringify(this.analysisSettings.toJSON()):null,EndTime:r(this.endTime)?this.endTime.getTime():null,EndUTCOffset:this.endTimeOffset,Messages:r(this.messages)?JSON.stringify(this.messages):null,RouteName:v(this.name),StartTime:r(this.startTime)?this.startTime.getTime():null,StartUTCOffset:this.startTimeOffset,TotalCosts:r(this.totalCosts)?JSON.stringify(V(this.totalCosts)):null,TotalLateMinutes:this.totalLateDuration,TotalMeters:this.totalDistance,TotalMinutes:this.totalDuration,TotalWaitMinutes:this.totalWaitDuration,Version:v(this.version)};return new M({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:v(this.popupTemplate)})}};n.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"AnalysisSettings",alias:"Analysis Settings",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"EndTime",alias:"End Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"EndUTCOffset",alias:"End Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"Messages",alias:"Analysis Messages",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:1024,editable:!0,nullable:!0,visible:!0,domain:null},{name:"StartTime",alias:"Start Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"StartUTCOffset",alias:"Start Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TotalCosts",alias:"Total Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"TotalLateMinutes",alias:"Total Late Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"TotalMeters",alias:"Total Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalMinutes",alias:"Total Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"TotalWaitMinutes",alias:"Total Wait Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"Version",alias:"Version",type:"esriFieldTypeString",length:16,editable:!0,nullable:!0,visible:!0,domain:null}],n.popupInfo={title:"Route Details",fieldInfos:[{fieldName:"RouteName",label:"Route Name",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"TotalMinutes",label:"Total Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalMeters",label:"Total Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalLateMinutes",label:"Total Late Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalWaitMinutes",label:"Total Wait Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TotalCosts",label:"Total Costs",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"StartTime",label:"Start Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"StartUTCOffset",label:"Start Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"EndTime",label:"End Time",isEditable:!1,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"EndUTCOffset",label:"End Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Messages",label:"Analysis Messages",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"AnalysisSettings",isEditable:!1,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"Version",label:"Version",isEditable:!1,tooltip:"",visible:!0,stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i()],n.prototype,"analysisSettings",void 0),t([i()],n.prototype,"endTime",void 0),t([m("endTime",["attributes.EndTimeUTC"])],n.prototype,"readEndTime",null),t([i()],n.prototype,"endTimeOffset",void 0),t([m("endTimeOffset",["attributes.EndTime","attributes.EndTimeUTC"])],n.prototype,"readEndTimeOffset",null),t([i({json:{read:{source:"attributes.FirstStopID"}}})],n.prototype,"firstStopId",void 0),t([i({type:ie})],n.prototype,"geometry",void 0),t([i({json:{read:{source:"attributes.LastStopID"}}})],n.prototype,"lastStopId",void 0),t([i()],n.prototype,"messages",void 0),t([i({json:{read:{source:"attributes.Name"}}})],n.prototype,"name",void 0),t([i({json:{read:{source:"attributes.ObjectID"}}})],n.prototype,"objectId",void 0),t([i({type:U})],n.prototype,"popupTemplate",void 0),t([i()],n.prototype,"startTime",void 0),t([m("startTime",["attributes.StartTimeUTC"])],n.prototype,"readStartTime",null),t([i()],n.prototype,"startTimeOffset",void 0),t([m("startTimeOffset",["attributes.StartTime","attributes.StartTimeUTC"])],n.prototype,"readStartTimeOffset",null),t([i({json:{read:{source:"attributes.StopCount"}}})],n.prototype,"stopCount",void 0),t([i({types:k})],n.prototype,"symbol",void 0),t([i()],n.prototype,"totalCosts",void 0),t([m("totalCosts",["attributes"])],n.prototype,"readTotalCosts",null),t([i()],n.prototype,"totalDistance",void 0),t([i()],n.prototype,"totalDuration",void 0),t([i()],n.prototype,"totalLateDuration",void 0),t([i()],n.prototype,"totalViolations",void 0),t([m("totalViolations",["attributes"])],n.prototype,"readTotalViolations",null),t([i()],n.prototype,"totalWait",void 0),t([m("totalWait",["attributes"])],n.prototype,"readTotalWait",null),t([i()],n.prototype,"totalWaitDuration",void 0),t([i({readOnly:!0,json:{read:!1}})],n.prototype,"type",void 0),t([i()],n.prototype,"version",void 0),n=ee=t([A("esri.rest.support.RouteInfo")],n);const Me=n;var te;let o=te=class extends x(C){constructor(e){super(e),this.arriveCurbApproach=null,this.arriveTime=null,this.arriveTimeOffset=null,this.bearing=null,this.bearingTol=null,this.cumulativeCosts=null,this.cumulativeDistance=null,this.cumulativeDuration=null,this.curbApproach=null,this.departCurbApproach=null,this.departTime=null,this.departTimeOffset=null,this.distanceToNetworkInMeters=null,this.geometry=null,this.lateDuration=null,this.locationType=null,this.name=null,this.navLatency=null,this.objectId=null,this.popupTemplate=null,this.posAlong=null,this.routeName=null,this.serviceCosts=null,this.serviceDistance=null,this.serviceDuration=null,this.sequence=null,this.sideOfEdge=null,this.snapX=null,this.snapY=null,this.snapZ=null,this.sourceId=null,this.sourceOid=null,this.status=null,this.symbol=null,this.timeWindowEnd=null,this.timeWindowEndOffset=null,this.timeWindowStart=null,this.timeWindowStartOffset=null,this.type="stop",this.violations=null,this.waitDuration=null,this.wait=null}readArriveTimeOffset(e,a){return z(a.attributes.ArriveTime,a.attributes.ArriveTimeUTC)}readCumulativeCosts(e,a){return O(a.attributes,"Cumul_")}readDepartTimeOffset(e,a){return z(a.attributes.DepartTime,a.attributes.DepartTimeUTC)}readServiceCosts(e,a){return O(a.attributes,"Attr_")}writeServiceCosts(e,a){re(e,a,"Attr_")}writeTimeWindowEnd(e,a){D(e)||(a.attributes||(a.attributes={}),a.attributes.TimeWindowEnd=e.getTime())}writeTimeWindowStart(e,a){D(e)||(a.attributes||(a.attributes={}),a.attributes.TimeWindowStart=e.getTime())}readViolations(e,a){return O(a.attributes,"Violation_")}readWait(e,a){return O(a.attributes,"Wait_")}static fromGraphic(e){var a,s,l,f,N,w,F,B,J,R,P;return new te({arriveCurbApproach:r(e.attributes.ArrivalCurbApproach)?c.fromJSON(e.attributes.ArrivalCurbApproach):null,arriveTime:r(e.attributes.ArrivalTime)?new Date(e.attributes.ArrivalTime):null,arriveTimeOffset:e.attributes.ArrivalUTCOffset,cumulativeCosts:r(e.attributes.CumulativeCosts)?W(JSON.parse(e.attributes.CumulativeCosts)):null,cumulativeDistance:(a=e.attributes.CumulativeMeters)!=null?a:null,cumulativeDuration:(s=e.attributes.CumulativeMinutes)!=null?s:null,curbApproach:r(e.attributes.CurbApproach)?c.fromJSON(e.attributes.CurbApproach):null,departCurbApproach:r(e.attributes.DepartureCurbApproach)?c.fromJSON(e.attributes.DepartureCurbApproach):null,departTime:r(e.attributes.DepartureTime)?new Date(e.attributes.DepartureTime):null,departTimeOffset:(l=e.attributes.DepartureUTCOffset)!=null?l:null,geometry:e.geometry,lateDuration:(f=e.attributes.LateMinutes)!=null?f:null,locationType:r(e.attributes.LocationType)?$.fromJSON(e.attributes.LocationType):null,name:e.attributes.Name,objectId:(N=e.attributes.ObjectID)!=null?N:e.attributes.__OBJECTID,popupTemplate:e.popupTemplate,routeName:e.attributes.RouteName,sequence:(w=e.attributes.Sequence)!=null?w:null,serviceCosts:r(e.attributes.ServiceCosts)?W(JSON.parse(e.attributes.ServiceCosts)):null,serviceDistance:(F=e.attributes.ServiceMeters)!=null?F:null,serviceDuration:(B=e.attributes.ServiceMinutes)!=null?B:null,status:r(e.attributes.Status)?I.fromJSON(e.attributes.Status):null,symbol:e.symbol,timeWindowEnd:r(e.attributes.TimeWindowEnd)?new Date(e.attributes.TimeWindowEnd):null,timeWindowEndOffset:(J=e.attributes.TimeWindowEndUTCOffset)!=null?J:null,timeWindowStart:r(e.attributes.TimeWindowStart)?new Date(e.attributes.TimeWindowStart):null,timeWindowStartOffset:(R=e.attributes.TimeWindowStartUTCOffset)!=null?R:null,waitDuration:(P=e.attributes.WaitMinutes)!=null?P:null})}toGraphic(){var a,s;const e={ObjectID:v(this.objectId),ArrivalCurbApproach:r(this.arriveCurbApproach)?c.toJSON(this.arriveCurbApproach):null,ArrivalTime:r(this.arriveTime)?this.arriveTime.getTime():null,ArrivalUTCOffset:this.arriveTimeOffset,CumulativeCosts:r(this.cumulativeCosts)?JSON.stringify(V(this.cumulativeCosts)):null,CumulativeMeters:this.cumulativeDistance,CumulativeMinutes:this.cumulativeDuration,CurbApproach:r(this.curbApproach)?c.toJSON(this.curbApproach):null,DepartureCurbApproach:r(this.departCurbApproach)?c.toJSON(this.departCurbApproach):null,DepartureTime:r(this.departTime)?this.departTime.getTime():null,DepartureUTCOffset:this.departTimeOffset,LateMinutes:this.lateDuration,LocationType:r(this.locationType)?$.toJSON(this.locationType):null,Name:v(this.name),RouteName:v(this.routeName),Sequence:this.sequence,ServiceCosts:r(this.serviceCosts)?JSON.stringify(V(this.serviceCosts)):null,ServiceMeters:this.serviceDistance,ServiceMinutes:this.serviceDuration,Status:r(this.status)?I.toJSON(this.status):null,TimeWindowEnd:r(this.timeWindowEnd)?this.timeWindowEnd.getTime():null,TimeWindowEndUTCOffset:(a=this.timeWindowEndOffset)!=null?a:this.arriveTimeOffset,TimeWindowStart:r(this.timeWindowStart)?this.timeWindowStart.getTime():null,TimeWindowStartUTCOffset:(s=this.timeWindowStartOffset)!=null?s:this.arriveTimeOffset,WaitMinutes:this.waitDuration};return new M({geometry:this.geometry,attributes:e,symbol:this.symbol,popupTemplate:this.popupTemplate})}};o.fields=[{name:"ObjectID",alias:"ObjectID",type:"esriFieldTypeOID",editable:!1,nullable:!1,domain:null},{name:"ArrivalCurbApproach",alias:"Arrival Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"ArrivalTime",alias:"Arrival Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"ArrivalUTCOffset",alias:"Arrival Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"CumulativeCosts",alias:"Cumulative Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"CumulativeMeters",alias:"Cumulative Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"CumulativeMinutes",alias:"Cumulative Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!0},{name:"CurbApproach",alias:"Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!1,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"DepartureCurbApproach",alias:"Departure Curb Approach",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNACurbApproachType",codedValues:[{name:"Either side",code:0},{name:"From the right",code:1},{name:"From the left",code:2},{name:"Depart in the same direction",code:3}]}},{name:"DepartureTime",alias:"Departure Time",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!0},{name:"DepartureUTCOffset",alias:"Departure Time: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"LateMinutes",alias:"Minutes Late",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"LocationType",alias:"Location Type",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNALocationType",codedValues:[{name:"Stop",code:0},{name:"Waypoint",code:1}]}},{name:"Name",alias:"Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"RouteName",alias:"Route Name",type:"esriFieldTypeString",length:255,editable:!0,nullable:!0,visible:!0},{name:"Sequence",alias:"Sequence",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"ServiceCosts",alias:"Service Costs",type:"esriFieldTypeString",length:1048576,editable:!0,nullable:!0,visible:!1,domain:null},{name:"ServiceMeters",alias:"Service Meters",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"ServiceMinutes",alias:"Service Minutes",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1},{name:"Status",alias:"Status",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0,domain:{type:"codedValue",name:"esriNAObjectStatus",codedValues:[{name:"OK",code:0},{name:"Not Located on Network",code:1},{name:"Network Unbuilt",code:2},{name:"Prohibited Street",code:3},{name:"Invalid Field Values",code:4},{name:"Cannot Reach",code:5},{name:"Time Window Violation",code:6}]}},{name:"TimeWindowEnd",alias:"Time Window End",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!1},{name:"TimeWindowEndUTCOffset",alias:"Time Window End: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"TimeWindowStart",alias:"Time Window Start",type:"esriFieldTypeDate",length:36,editable:!0,nullable:!0,visible:!1},{name:"TimeWindowStartUTCOffset",alias:"Time Window Start: Offset from UTC in Minutes",type:"esriFieldTypeInteger",editable:!0,nullable:!0,visible:!0},{name:"WaitMinutes",alias:"Minutes Early",type:"esriFieldTypeDouble",editable:!0,nullable:!0,visible:!1}],o.popupInfo={title:"{Name}",fieldInfos:[{fieldName:"Name",label:"Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"RouteName",label:"Route Name",isEditable:!0,tooltip:"",visible:!0,stringFieldOption:"textbox"},{fieldName:"Sequence",label:"Sequence",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalTime",label:"Arrival Time",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"ArrivalUTCOffset",label:"Arrival Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureTime",label:"Departure Time",isEditable:!0,tooltip:"",visible:!0,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"DepartureUTCOffset",label:"Departure Time: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CurbApproach",label:"Curb Approach",isEditable:!0,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ArrivalCurbApproach",label:"Arrival Curb Approach",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"DepartureCurbApproach",label:"Departure Curb Approach",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"Status",label:"Status",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"LocationType",label:"Location Type",isEditable:!1,tooltip:"",visible:!0,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowStart",label:"Time Window Start",isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowStartUTCOffset",label:"Time Window Start: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"TimeWindowEnd",label:"Time Window End",isEditable:!0,tooltip:"",visible:!1,format:{dateFormat:"shortDateShortTime24"},stringFieldOption:"textbox"},{fieldName:"TimeWindowEndUTCOffset",label:"Time Window End: Offset from UTC in Minutes",isEditable:!1,tooltip:"",visible:!1,format:{places:0,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMinutes",label:"Service Minutes",isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceMeters",label:"Service Meters",isEditable:!0,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"ServiceCosts",label:"Service Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"CumulativeMinutes",label:"Cumulative Minutes",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeMeters",label:"Cumulative Meters",isEditable:!1,tooltip:"",visible:!0,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"CumulativeCosts",label:"Cumulative Costs",isEditable:!0,tooltip:"",visible:!1,stringFieldOption:"textbox"},{fieldName:"LateMinutes",label:"Minutes Late",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"},{fieldName:"WaitMinutes",label:"Minutes Early",isEditable:!1,tooltip:"",visible:!1,format:{places:2,digitSeparator:!0},stringFieldOption:"textbox"}],description:null,showAttachments:!1,mediaInfos:[]},t([i({type:c.apiValues,json:{read:{source:"attributes.ArrivalCurbApproach",reader:c.read}}})],o.prototype,"arriveCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.ArriveTimeUTC"}}})],o.prototype,"arriveTime",void 0),t([i()],o.prototype,"arriveTimeOffset",void 0),t([m("arriveTimeOffset",["attributes.ArriveTime","attributes.ArriveTimeUTC"])],o.prototype,"readArriveTimeOffset",null),t([i({json:{name:"attributes.Bearing",read:!1,write:!0}})],o.prototype,"bearing",void 0),t([i({json:{name:"attributes.BearingTol",read:!1,write:!0}})],o.prototype,"bearingTol",void 0),t([i()],o.prototype,"cumulativeCosts",void 0),t([m("cumulativeCosts",["attributes"])],o.prototype,"readCumulativeCosts",null),t([i()],o.prototype,"cumulativeDistance",void 0),t([i()],o.prototype,"cumulativeDuration",void 0),t([i({type:c.apiValues,json:{name:"attributes.CurbApproach",read:{reader:c.read},write:{writer:c.write}}})],o.prototype,"curbApproach",void 0),t([i({type:c.apiValues,json:{read:{source:"attributes.DepartCurbApproach",reader:c.read}}})],o.prototype,"departCurbApproach",void 0),t([i({type:Date,json:{read:{source:"attributes.DepartTimeUTC"}}})],o.prototype,"departTime",void 0),t([i()],o.prototype,"departTimeOffset",void 0),t([m("departTimeOffset",["attributes.DepartTime","attributes.DepartTimeUTC"])],o.prototype,"readDepartTimeOffset",null),t([i({json:{read:{source:"attributes.DistanceToNetworkInMeters"}}})],o.prototype,"distanceToNetworkInMeters",void 0),t([i({type:ae,json:{write:!0}})],o.prototype,"geometry",void 0),t([i()],o.prototype,"lateDuration",void 0),t([i({type:$.apiValues,json:{name:"attributes.LocationType",read:{reader:$.read},write:{writer:$.write}}})],o.prototype,"locationType",void 0),t([i({json:{name:"attributes.Name"}})],o.prototype,"name",void 0),t([i({json:{name:"attributes.NavLatency",read:!1,write:!0}})],o.prototype,"navLatency",void 0),t([i({json:{name:"attributes.ObjectID"}})],o.prototype,"objectId",void 0),t([i({type:U})],o.prototype,"popupTemplate",void 0),t([i({json:{read:{source:"attributes.PosAlong"}}})],o.prototype,"posAlong",void 0),t([i({json:{name:"attributes.RouteName"}})],o.prototype,"routeName",void 0),t([i()],o.prototype,"serviceCosts",void 0),t([m("serviceCosts",["attributes"])],o.prototype,"readServiceCosts",null),t([E("serviceCosts")],o.prototype,"writeServiceCosts",null),t([i()],o.prototype,"serviceDistance",void 0),t([i()],o.prototype,"serviceDuration",void 0),t([i({json:{name:"attributes.Sequence"}})],o.prototype,"sequence",void 0),t([i({type:q.apiValues,json:{read:{source:"attributes.SideOfEdge",reader:q.read}}})],o.prototype,"sideOfEdge",void 0),t([i({json:{read:{source:"attributes.SnapX"}}})],o.prototype,"snapX",void 0),t([i({json:{read:{source:"attributes.SnapY"}}})],o.prototype,"snapY",void 0),t([i({json:{read:{source:"attributes.SnapZ"}}})],o.prototype,"snapZ",void 0),t([i({json:{read:{source:"attributes.SourceID"}}})],o.prototype,"sourceId",void 0),t([i({json:{read:{source:"attributes.SourceOID"}}})],o.prototype,"sourceOid",void 0),t([i({type:I.apiValues,json:{read:{source:"attributes.Status",reader:I.read}}})],o.prototype,"status",void 0),t([i({types:k})],o.prototype,"symbol",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowEnd"}})],o.prototype,"timeWindowEnd",void 0),t([E("timeWindowEnd")],o.prototype,"writeTimeWindowEnd",null),t([i()],o.prototype,"timeWindowEndOffset",void 0),t([i({type:Date,json:{name:"attributes.TimeWindowStart"}})],o.prototype,"timeWindowStart",void 0),t([E("timeWindowStart")],o.prototype,"writeTimeWindowStart",null),t([i()],o.prototype,"timeWindowStartOffset",void 0),t([i({readOnly:!0,json:{read:!1}})],o.prototype,"type",void 0),t([i()],o.prototype,"violations",void 0),t([m("violations",["attributes"])],o.prototype,"readViolations",null),t([i()],o.prototype,"waitDuration",void 0),t([i()],o.prototype,"wait",void 0),t([m("wait",["attributes"])],o.prototype,"readWait",null),o=te=t([A("esri.rest.support.Stop")],o);const Ue=o;export{ye as A,Ue as D,ce as N,xe as O,Ce as R,Oe as S,Ae as U,Me as a,we as b,z as c,ne as d,Ne as e,je as f,Ee as g,Fe as h,ue as i,Se as j,de as k,Te as l,Ie as n,he as r,ge as s,fe as t,De as w,j as y}; diff --git a/assets/StreamLayer.aded61fe.js b/assets/StreamLayer.ee7e4471.js similarity index 96% rename from assets/StreamLayer.aded61fe.js rename to assets/StreamLayer.ee7e4471.js index f4726c6..cd355ba 100644 --- a/assets/StreamLayer.aded61fe.js +++ b/assets/StreamLayer.ee7e4471.js @@ -1 +1 @@ -import{a6 as e,a7 as i,a8 as g,cx as R,iK as $,iL as j,i2 as P,iM as T,i3 as O,ia as F,eE as E,eF as D,eG as N,eH as _,iJ as U,aT as v,n as p,c as k,aU as C,iN as u,jH as A,s as L,j8 as J,dx as G,at as V,hl as y,id as q,dd as z,U as M,iO as Q,cC as W,gw as H,cU as K,iP as X,iQ as Y,iR as Z,iE as B,h0 as m,jN as ee,jO as te,ig as ie,dv as re,iT as se,ie as oe,d2 as h,iU as ne,eK as ae,jP as le,jQ as pe,ih as de,cF as ye}from"./index.d94abe07.js";var c;let l=c=class extends R{constructor(){super(...arguments),this.age=null,this.ageReceived=null,this.displayCount=null,this.maxObservations=1}clone(){return new c({age:this.age,ageReceived:this.ageReceived,displayCount:this.displayCount,maxObservations:this.maxObservations})}};e([i({type:Number,json:{write:!0}})],l.prototype,"age",void 0),e([i({type:Number,json:{write:!0}})],l.prototype,"ageReceived",void 0),e([i({type:Number,json:{write:!0}})],l.prototype,"displayCount",void 0),e([i({type:Number,json:{write:!0}})],l.prototype,"maxObservations",void 0),l=c=e([g("esri.layers.support.PurgeOptions")],l);const b=l,f=de();let t=class extends $(j(P(T(O(F(E(D(N(_(U(ye))))))))))){constructor(...r){super(...r),this.copyright=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.geometryDefinition=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.maxReconnectionAttempts=0,this.maxReconnectionInterval=20,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.operationalLayerType="ArcGISStreamLayer",this.popupEnabled=!0,this.popupTemplate=null,this.purgeOptions=new b,this.screenSizePerspectiveEnabled=!0,this.sourceJSON=null,this.spatialReference=v.WGS84,this.type="stream",this.url=null,this.updateInterval=300,this.webSocketUrl=null}normalizeCtorArgs(r,s){return typeof r=="string"?{url:r,...s}:r}load(r){if(!("WebSocket"in globalThis))return this.addResolvingPromise(Promise.reject(new p("stream-layer:websocket-unsupported","WebSocket is not supported in this browser. StreamLayer will not have real-time connection with the stream service."))),Promise.resolve(this);const s=k(r)?r.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Stream Service","Feed"]},r).catch(C).then(()=>this._fetchService(s))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(r){u(r,this.fieldsIndex),this._set("renderer",r)}readRenderer(r,s,o){const n=(s=s.layerDefinition||s).drawingInfo&&s.drawingInfo.renderer||void 0;if(n){const a=A(n,s,o)||void 0;return a||L.getLogger(this.declaredClass).error("Failed to create renderer",{rendererDefinition:s.drawingInfo.renderer,layer:this,context:o}),a}if(s.defaultSymbol)return s.types&&s.types.length?new J({defaultSymbol:d(s.defaultSymbol,s,o),field:s.typeIdField,uniqueValueInfos:s.types.map(a=>({id:a.id,symbol:d(a.symbol,a,o)}))}):new G({symbol:d(s.defaultSymbol,s,o)})}async connect(r){const[{createConnection:s}]=await Promise.all([V(()=>import("./createConnection.60903ce1.js"),["assets/createConnection.60903ce1.js","assets/index.d94abe07.js","assets/index.f5419ca5.css"]),this.load()]),o=y.toJSON(this.geometryType),{customParameters:n=null,definitionExpression:a=null,geometryDefinition:w=null,maxReconnectionAttempts:I=0,maxReconnectionInterval:S=20,spatialReference:x=this.spatialReference}=r||this.createConnectionParameters();return s(this.parsedUrl,this.spatialReference,x,o,{geometry:w,where:a},I,S,n)}createConnectionParameters(){return{spatialReference:this.spatialReference,customParameters:this.customParameters,definitionExpression:this.definitionExpression,geometryDefinition:this.geometryDefinition,maxReconnectionAttempts:this.maxReconnectionAttempts,maxReconnectionInterval:this.maxReconnectionInterval}}createPopupTemplate(r){return q(this,r)}createQuery(){const r=new z;return r.returnGeometry=!0,r.outFields=["*"],r.where=this.definitionExpression||"1=1",r}getFieldDomain(r,s){if(!this.fields)return null;let o=null;return this.fields.some(n=>(n.name===r&&(o=n.domain),!!o)),o}getField(r){return this.fieldsIndex.get(r)}serviceSupportsSpatialReference(r){return!0}async _fetchService(r){var s,o;if(this.webSocketUrl){if(!((s=this.timeInfo)!=null&&s.trackIdField))throw new p("stream-layer:missing-metadata","The stream layer trackIdField must be specified.");if(!this.objectIdField)throw new p("stream-layer:missing-metadata","The stream layer objectIdField must be specified.");if(!this.fields)throw new p("stream-layer:missing-metadata","The stream layer fields must be specified.");if(!this.geometryType)throw new p("stream-layer:missing-metadata","The stream layer geometryType must be specified.");this.url=this.webSocketUrl}else if(!this.sourceJSON){const{data:n}=await M(this.parsedUrl.path,{query:{f:"json",...this.customParameters,...this.parsedUrl.query},responseType:"json",signal:r});this.sourceJSON=n}return this.sourceJSON={...(o=this.sourceJSON)!=null?o:{},objectIdField:"__esri_stream_id__"},this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl}),u(this.renderer,this.fieldsIndex),Q(this.timeInfo,this.fieldsIndex),W(this,{origin:"service"})}};e([i({type:String})],t.prototype,"copyright",void 0),e([i({readOnly:!0})],t.prototype,"defaultPopupTemplate",null),e([i({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],t.prototype,"definitionExpression",void 0),e([i({type:String})],t.prototype,"displayField",void 0),e([i({type:H})],t.prototype,"elevationInfo",void 0),e([i(f.fields)],t.prototype,"fields",void 0),e([i(f.fieldsIndex)],t.prototype,"fieldsIndex",void 0),e([i({type:K})],t.prototype,"geometryDefinition",void 0),e([i({type:y.apiValues,json:{read:{reader:y.read}}})],t.prototype,"geometryType",void 0),e([i(X)],t.prototype,"labelsVisible",void 0),e([i({type:[Y],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo",reader:Z},write:{target:"layerDefinition.drawingInfo.labelingInfo"}}})],t.prototype,"labelingInfo",void 0),e([i(B)],t.prototype,"legendEnabled",void 0),e([i({type:["show","hide"]})],t.prototype,"listMode",void 0),e([i({type:m})],t.prototype,"maxReconnectionAttempts",void 0),e([i({type:m})],t.prototype,"maxReconnectionInterval",void 0),e([i(ee)],t.prototype,"maxScale",void 0),e([i(te)],t.prototype,"minScale",void 0),e([i({type:String})],t.prototype,"objectIdField",void 0),e([i({value:"ArcGISStreamLayer",type:["ArcGISStreamLayer"]})],t.prototype,"operationalLayerType",void 0),e([i(ie)],t.prototype,"popupEnabled",void 0),e([i({type:re,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],t.prototype,"popupTemplate",void 0),e([i({type:b})],t.prototype,"purgeOptions",void 0),e([i({types:se,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{name:"layerDefinition.drawingInfo.renderer",types:oe,write:!0}},write:{target:"layerDefinition.drawingInfo.renderer"}}})],t.prototype,"renderer",null),e([h("service","renderer",["drawingInfo.renderer","defaultSymbol"]),h("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],t.prototype,"readRenderer",null),e([i(ne)],t.prototype,"screenSizePerspectiveEnabled",void 0),e([i()],t.prototype,"sourceJSON",void 0),e([i({type:v,json:{origins:{service:{read:{source:"spatialReference"}}}}})],t.prototype,"spatialReference",void 0),e([i({json:{read:!1}})],t.prototype,"type",void 0),e([i(ae)],t.prototype,"url",void 0),e([i({type:Number})],t.prototype,"updateInterval",void 0),e([i({type:String})],t.prototype,"webSocketUrl",void 0),t=e([g("esri.layers.StreamLayer")],t);const d=le({types:pe}),ue=t;export{ue as default}; +import{a6 as e,a7 as i,a8 as g,cx as R,iK as $,iL as j,i2 as P,iM as T,i3 as O,ia as F,eE as E,eF as D,eG as N,eH as _,iJ as U,aT as v,n as p,c as k,aU as C,iN as u,jH as A,s as L,j8 as J,dx as G,at as V,hl as y,id as q,dd as z,U as M,iO as Q,cC as W,gw as H,cU as K,iP as X,iQ as Y,iR as Z,iE as B,h0 as m,jN as ee,jO as te,ig as ie,dv as re,iT as se,ie as oe,d2 as h,iU as ne,eK as ae,jP as le,jQ as pe,ih as de,cF as ye}from"./index.221827cd.js";var c;let l=c=class extends R{constructor(){super(...arguments),this.age=null,this.ageReceived=null,this.displayCount=null,this.maxObservations=1}clone(){return new c({age:this.age,ageReceived:this.ageReceived,displayCount:this.displayCount,maxObservations:this.maxObservations})}};e([i({type:Number,json:{write:!0}})],l.prototype,"age",void 0),e([i({type:Number,json:{write:!0}})],l.prototype,"ageReceived",void 0),e([i({type:Number,json:{write:!0}})],l.prototype,"displayCount",void 0),e([i({type:Number,json:{write:!0}})],l.prototype,"maxObservations",void 0),l=c=e([g("esri.layers.support.PurgeOptions")],l);const b=l,f=de();let t=class extends $(j(P(T(O(F(E(D(N(_(U(ye))))))))))){constructor(...r){super(...r),this.copyright=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.fields=null,this.fieldsIndex=null,this.geometryDefinition=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.maxReconnectionAttempts=0,this.maxReconnectionInterval=20,this.maxScale=0,this.minScale=0,this.objectIdField=null,this.operationalLayerType="ArcGISStreamLayer",this.popupEnabled=!0,this.popupTemplate=null,this.purgeOptions=new b,this.screenSizePerspectiveEnabled=!0,this.sourceJSON=null,this.spatialReference=v.WGS84,this.type="stream",this.url=null,this.updateInterval=300,this.webSocketUrl=null}normalizeCtorArgs(r,s){return typeof r=="string"?{url:r,...s}:r}load(r){if(!("WebSocket"in globalThis))return this.addResolvingPromise(Promise.reject(new p("stream-layer:websocket-unsupported","WebSocket is not supported in this browser. StreamLayer will not have real-time connection with the stream service."))),Promise.resolve(this);const s=k(r)?r.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Stream Service","Feed"]},r).catch(C).then(()=>this._fetchService(s))),Promise.resolve(this)}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(r){u(r,this.fieldsIndex),this._set("renderer",r)}readRenderer(r,s,o){const n=(s=s.layerDefinition||s).drawingInfo&&s.drawingInfo.renderer||void 0;if(n){const a=A(n,s,o)||void 0;return a||L.getLogger(this.declaredClass).error("Failed to create renderer",{rendererDefinition:s.drawingInfo.renderer,layer:this,context:o}),a}if(s.defaultSymbol)return s.types&&s.types.length?new J({defaultSymbol:d(s.defaultSymbol,s,o),field:s.typeIdField,uniqueValueInfos:s.types.map(a=>({id:a.id,symbol:d(a.symbol,a,o)}))}):new G({symbol:d(s.defaultSymbol,s,o)})}async connect(r){const[{createConnection:s}]=await Promise.all([V(()=>import("./createConnection.0e3796d4.js"),["assets/createConnection.0e3796d4.js","assets/index.221827cd.js","assets/index.f5419ca5.css"]),this.load()]),o=y.toJSON(this.geometryType),{customParameters:n=null,definitionExpression:a=null,geometryDefinition:w=null,maxReconnectionAttempts:I=0,maxReconnectionInterval:S=20,spatialReference:x=this.spatialReference}=r||this.createConnectionParameters();return s(this.parsedUrl,this.spatialReference,x,o,{geometry:w,where:a},I,S,n)}createConnectionParameters(){return{spatialReference:this.spatialReference,customParameters:this.customParameters,definitionExpression:this.definitionExpression,geometryDefinition:this.geometryDefinition,maxReconnectionAttempts:this.maxReconnectionAttempts,maxReconnectionInterval:this.maxReconnectionInterval}}createPopupTemplate(r){return q(this,r)}createQuery(){const r=new z;return r.returnGeometry=!0,r.outFields=["*"],r.where=this.definitionExpression||"1=1",r}getFieldDomain(r,s){if(!this.fields)return null;let o=null;return this.fields.some(n=>(n.name===r&&(o=n.domain),!!o)),o}getField(r){return this.fieldsIndex.get(r)}serviceSupportsSpatialReference(r){return!0}async _fetchService(r){var s,o;if(this.webSocketUrl){if(!((s=this.timeInfo)!=null&&s.trackIdField))throw new p("stream-layer:missing-metadata","The stream layer trackIdField must be specified.");if(!this.objectIdField)throw new p("stream-layer:missing-metadata","The stream layer objectIdField must be specified.");if(!this.fields)throw new p("stream-layer:missing-metadata","The stream layer fields must be specified.");if(!this.geometryType)throw new p("stream-layer:missing-metadata","The stream layer geometryType must be specified.");this.url=this.webSocketUrl}else if(!this.sourceJSON){const{data:n}=await M(this.parsedUrl.path,{query:{f:"json",...this.customParameters,...this.parsedUrl.query},responseType:"json",signal:r});this.sourceJSON=n}return this.sourceJSON={...(o=this.sourceJSON)!=null?o:{},objectIdField:"__esri_stream_id__"},this.read(this.sourceJSON,{origin:"service",url:this.parsedUrl}),u(this.renderer,this.fieldsIndex),Q(this.timeInfo,this.fieldsIndex),W(this,{origin:"service"})}};e([i({type:String})],t.prototype,"copyright",void 0),e([i({readOnly:!0})],t.prototype,"defaultPopupTemplate",null),e([i({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],t.prototype,"definitionExpression",void 0),e([i({type:String})],t.prototype,"displayField",void 0),e([i({type:H})],t.prototype,"elevationInfo",void 0),e([i(f.fields)],t.prototype,"fields",void 0),e([i(f.fieldsIndex)],t.prototype,"fieldsIndex",void 0),e([i({type:K})],t.prototype,"geometryDefinition",void 0),e([i({type:y.apiValues,json:{read:{reader:y.read}}})],t.prototype,"geometryType",void 0),e([i(X)],t.prototype,"labelsVisible",void 0),e([i({type:[Y],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo",reader:Z},write:{target:"layerDefinition.drawingInfo.labelingInfo"}}})],t.prototype,"labelingInfo",void 0),e([i(B)],t.prototype,"legendEnabled",void 0),e([i({type:["show","hide"]})],t.prototype,"listMode",void 0),e([i({type:m})],t.prototype,"maxReconnectionAttempts",void 0),e([i({type:m})],t.prototype,"maxReconnectionInterval",void 0),e([i(ee)],t.prototype,"maxScale",void 0),e([i(te)],t.prototype,"minScale",void 0),e([i({type:String})],t.prototype,"objectIdField",void 0),e([i({value:"ArcGISStreamLayer",type:["ArcGISStreamLayer"]})],t.prototype,"operationalLayerType",void 0),e([i(ie)],t.prototype,"popupEnabled",void 0),e([i({type:re,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],t.prototype,"popupTemplate",void 0),e([i({type:b})],t.prototype,"purgeOptions",void 0),e([i({types:se,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{name:"layerDefinition.drawingInfo.renderer",types:oe,write:!0}},write:{target:"layerDefinition.drawingInfo.renderer"}}})],t.prototype,"renderer",null),e([h("service","renderer",["drawingInfo.renderer","defaultSymbol"]),h("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],t.prototype,"readRenderer",null),e([i(ne)],t.prototype,"screenSizePerspectiveEnabled",void 0),e([i()],t.prototype,"sourceJSON",void 0),e([i({type:v,json:{origins:{service:{read:{source:"spatialReference"}}}}})],t.prototype,"spatialReference",void 0),e([i({json:{read:!1}})],t.prototype,"type",void 0),e([i(ae)],t.prototype,"url",void 0),e([i({type:Number})],t.prototype,"updateInterval",void 0),e([i({type:String})],t.prototype,"webSocketUrl",void 0),t=e([g("esri.layers.StreamLayer")],t);const d=le({types:pe}),ue=t;export{ue as default}; diff --git a/assets/StreamLayerView2D.999b4965.js b/assets/StreamLayerView2D.29625b01.js similarity index 77% rename from assets/StreamLayerView2D.999b4965.js rename to assets/StreamLayerView2D.29625b01.js index b347d6e..223b899 100644 --- a/assets/StreamLayerView2D.999b4965.js +++ b/assets/StreamLayerView2D.29625b01.js @@ -1 +1 @@ -import{a6 as n,a7 as a,a8 as h,_ as p,n as l,d3 as f,j as c,c as m}from"./index.d94abe07.js";import v from"./FeatureLayerView2D.c0de0a56.js";import{e as O}from"./util.ab699fea.js";import"./utils.4b023c9d.js";import"./Utils.7f6f3a6b.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.229b1dd6.js";import"./LayerView.42d17220.js";import"./schemaUtils.69ad92d2.js";import"./visualVariablesUtils.aff73e6d.js";import"./createSymbolSchema.e54d2060.js";import"./ExpandedCIM.f0b7f36d.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.0d428d19.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.df11258c.js";import"./floorFilterUtils.05eb8c6a.js";import"./popupUtils.4abb3ffd.js";import"./RefreshableLayerView.28a00159.js";function d(e,t){if(c(e)&&c(t))return null;const r={};return m(t)&&(r.geometry=t.toJSON()),m(e)&&(r.where=e),r}let o=class extends v{constructor(){super(...arguments),this._enabledDataReceived=!1,this.errorString=null,this.connectionStatus="disconnected"}initialize(){this.handles.add([p(()=>{var e;return(e=this.layer)==null?void 0:e.purgeOptions},()=>this._update()),p(()=>this.suspended,e=>{e?this._proxy.pauseStream():this._proxy.resumeStream()})])}get connectionError(){if(this.errorString)return new l("stream-controller",this.errorString)}on(e,t){e==="data-received"&&(this._enabledDataReceived=!0,this._proxy.enableEvent("data-received",!0));const r=super.on(e,t),i=this;return{remove(){r.remove(),e==="data-received"&&(i._proxy.closed||i.hasEventListener("data-received")||i._proxy.enableEvent("data-received",!1))}}}queryLatestObservations(e,t){if(!(this.layer.timeInfo.endField||this.layer.timeInfo.startField))throw new l("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");return this._proxy.queryLatestObservations(this._cleanUpQuery(e),t).then(r=>{const i=f.fromJSON(r);return i.features.forEach(s=>{s.layer=this.layer,s.sourceLayer=this.layer}),i})}detach(){super.detach(),this.connectionStatus="disconnected"}_createClientOptions(){return{...super._createClientOptions(),setProperty:e=>{this.set(e.propertyName,e.value)}}}_createTileRendererHash(e){const t=`${JSON.stringify(this.layer.purgeOptions)}.${JSON.stringify(d(this.layer.definitionExpression,this.layer.geometryDefinition))})`;return super._createTileRendererHash(e)+t}async _createServiceOptions(){const e=this.layer,{objectIdField:t}=e,r=e.fields.map(u=>u.toJSON()),i=O(e.geometryType),s=e.timeInfo&&e.timeInfo.toJSON()||null,y=e.spatialReference?e.spatialReference.toJSON():null;return{type:"stream",fields:r,geometryType:i,objectIdField:t,timeInfo:s,source:this.layer.parsedUrl,serviceFilter:d(this.layer.definitionExpression,this.layer.geometryDefinition),purgeOptions:this.layer.purgeOptions.toJSON(),enableDataReceived:this._enabledDataReceived,spatialReference:y,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,updateInterval:this.layer.updateInterval,customParameters:e.customParameters}}};n([a()],o.prototype,"errorString",void 0),n([a({readOnly:!0})],o.prototype,"connectionError",null),n([a()],o.prototype,"connectionStatus",void 0),o=n([h("esri.views.2d.layers.StreamLayerView2D")],o);const k=o;export{k as default}; +import{a6 as n,a7 as a,a8 as h,_ as p,n as l,d3 as f,j as c,c as m}from"./index.221827cd.js";import v from"./FeatureLayerView2D.7c1a650d.js";import{e as O}from"./util.520a352e.js";import"./utils.0160becb.js";import"./Utils.2136650a.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.0cadabc1.js";import"./LayerView.ce6e0535.js";import"./schemaUtils.d20994fa.js";import"./visualVariablesUtils.62efda9d.js";import"./createSymbolSchema.827eb617.js";import"./ExpandedCIM.a372ce74.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.7ff797cc.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.3f71f8e9.js";import"./floorFilterUtils.05eb8c6a.js";import"./popupUtils.c6371f3a.js";import"./RefreshableLayerView.887ed8c3.js";function d(e,t){if(c(e)&&c(t))return null;const r={};return m(t)&&(r.geometry=t.toJSON()),m(e)&&(r.where=e),r}let o=class extends v{constructor(){super(...arguments),this._enabledDataReceived=!1,this.errorString=null,this.connectionStatus="disconnected"}initialize(){this.handles.add([p(()=>{var e;return(e=this.layer)==null?void 0:e.purgeOptions},()=>this._update()),p(()=>this.suspended,e=>{e?this._proxy.pauseStream():this._proxy.resumeStream()})])}get connectionError(){if(this.errorString)return new l("stream-controller",this.errorString)}on(e,t){e==="data-received"&&(this._enabledDataReceived=!0,this._proxy.enableEvent("data-received",!0));const r=super.on(e,t),i=this;return{remove(){r.remove(),e==="data-received"&&(i._proxy.closed||i.hasEventListener("data-received")||i._proxy.enableEvent("data-received",!1))}}}queryLatestObservations(e,t){if(!(this.layer.timeInfo.endField||this.layer.timeInfo.startField))throw new l("streamlayer-no-timeField","queryLatestObservation can only be used with services that define a TrackIdField");return this._proxy.queryLatestObservations(this._cleanUpQuery(e),t).then(r=>{const i=f.fromJSON(r);return i.features.forEach(s=>{s.layer=this.layer,s.sourceLayer=this.layer}),i})}detach(){super.detach(),this.connectionStatus="disconnected"}_createClientOptions(){return{...super._createClientOptions(),setProperty:e=>{this.set(e.propertyName,e.value)}}}_createTileRendererHash(e){const t=`${JSON.stringify(this.layer.purgeOptions)}.${JSON.stringify(d(this.layer.definitionExpression,this.layer.geometryDefinition))})`;return super._createTileRendererHash(e)+t}async _createServiceOptions(){const e=this.layer,{objectIdField:t}=e,r=e.fields.map(u=>u.toJSON()),i=O(e.geometryType),s=e.timeInfo&&e.timeInfo.toJSON()||null,y=e.spatialReference?e.spatialReference.toJSON():null;return{type:"stream",fields:r,geometryType:i,objectIdField:t,timeInfo:s,source:this.layer.parsedUrl,serviceFilter:d(this.layer.definitionExpression,this.layer.geometryDefinition),purgeOptions:this.layer.purgeOptions.toJSON(),enableDataReceived:this._enabledDataReceived,spatialReference:y,maxReconnectionAttempts:this.layer.maxReconnectionAttempts,maxReconnectionInterval:this.layer.maxReconnectionInterval,updateInterval:this.layer.updateInterval,customParameters:e.customParameters}}};n([a()],o.prototype,"errorString",void 0),n([a({readOnly:!0})],o.prototype,"connectionError",null),n([a()],o.prototype,"connectionStatus",void 0),o=n([h("esri.views.2d.layers.StreamLayerView2D")],o);const k=o;export{k as default}; diff --git a/assets/StyleRepository.a1fecb1f.js b/assets/StyleRepository.e426e44d.js similarity index 99% rename from assets/StyleRepository.a1fecb1f.js rename to assets/StyleRepository.e426e44d.js index cd8ef8f..771e14e 100644 --- a/assets/StyleRepository.a1fecb1f.js +++ b/assets/StyleRepository.e426e44d.js @@ -1,4 +1,4 @@ -import{a as b,f as Y,l as rt}from"./StyleDefinition.d56936e4.js";import{T as et}from"./enums.54326430.js";import{j as jt,b9 as I,el as ne}from"./index.d94abe07.js";import{C as g}from"./enums.2d9e6f64.js";import{t as A}from"./VertexElementDescriptor.1fdca6da.js";import{v as Kt,p as qt,z as Wt}from"./colorUtils.bb6424b7.js";import{b as P}from"./GeometryUtils.4f19e772.js";import{s as wt}from"./Geometry.d049a63c.js";import{a3 as oe}from"./enums.0295eb81.js";class le{constructor(t){this._array=[],t<=0&&console.error("strideInBytes must be positive!"),this._stride=t}get array(){return this._array}get index(){return 4*this._array.length/this._stride}get itemSize(){return this._stride}get sizeInBytes(){return 4*this._array.length}reset(){this.array.length=0}toBuffer(){return new Uint32Array(this._array).buffer}static i1616to32(t,e){return 65535&t|e<<16}static i8888to32(t,e,r,s){return 255&t|(255&e)<<8|(255&r)<<16|s<<24}static i8816to32(t,e,r){return 255&t|(255&e)<<8|r<<16}}var h,J;(function(i){i[i.R8_SIGNED=0]="R8_SIGNED",i[i.R8_UNSIGNED=1]="R8_UNSIGNED",i[i.R16_SIGNED=2]="R16_SIGNED",i[i.R16_UNSIGNED=3]="R16_UNSIGNED",i[i.R8G8_SIGNED=4]="R8G8_SIGNED",i[i.R8G8_UNSIGNED=5]="R8G8_UNSIGNED",i[i.R16G16_SIGNED=6]="R16G16_SIGNED",i[i.R16G16_UNSIGNED=7]="R16G16_UNSIGNED",i[i.R8G8B8A8_SIGNED=8]="R8G8B8A8_SIGNED",i[i.R8G8B8A8_UNSIGNED=9]="R8G8B8A8_UNSIGNED",i[i.R8G8B8A8_COLOR=10]="R8G8B8A8_COLOR",i[i.R16G16B16A16_DASHARRAY=11]="R16G16B16A16_DASHARRAY",i[i.R16G16B16A16_PATTERN=12]="R16G16B16A16_PATTERN"})(h||(h={})),function(i){i[i.UNIFORM=0]="UNIFORM",i[i.DATA_DRIVEN=1]="DATA_DRIVEN",i[i.INTERPOLATED_DATA_DRIVEN=2]="INTERPOLATED_DATA_DRIVEN",i[i.UNUSED=3]="UNUSED"}(J||(J={}));class C{constructor(t){this._locations=new Map,this._key=t}get key(){return this._key}get type(){return 7&this._key}defines(){return[]}getStride(){return this._layoutInfo||this._buildAttributesInfo(),this._stride}getAttributeLocations(){return this._locations.size===0&&this._buildAttributesInfo(),this._locations}getLayoutInfo(){return this._layoutInfo||this._buildAttributesInfo(),this._layoutInfo}getEncodingInfos(){return this._propertyEncodingInfo||this._buildAttributesInfo(),this._propertyEncodingInfo}getUniforms(){return this._uniforms||this._buildAttributesInfo(),this._uniforms}getShaderHeader(){return this._shaderHeader||this._buildAttributesInfo(),this._shaderHeader}getShaderMain(){return this._shaderMain||this._buildAttributesInfo(),this._shaderMain}setDataUniforms(t,e,r,s,a){const o=this.getUniforms();for(const n of o){const{name:l,type:u,getValue:p}=n,c=p(r,e,s,a);if(c!==null)switch(u){case"float":t.setUniform1f(l,c);break;case"vec2":t.setUniform2fv(l,c);break;case"vec4":t.setUniform4fv(l,c)}}}encodeAttributes(t,e,r,s){var p;const a=this.attributesInfo(),o=this.getEncodingInfos(),n=[];let l=0,u=0;for(const c of Object.keys(o)){const f=o[c],{type:_,precisionFactor:d,isLayout:G}=a[c],R=G?r.getLayoutProperty(c):r.getPaintProperty(c),q=(p=R.interpolator)==null?void 0:p.getInterpolationRange(e);let T=0;for(const S of f){const{offset:E,bufferElementsToAdd:k}=S;if(k>0){for(let D=0;D4)s++,D={dataIndex:s,count:0,offset:0},S!==4&&(r[v]=D),t.push({location:-1,name:"a_data_"+s,count:S,type:q,normalized:E}),z=Math.ceil(Math.max(k/4,1));else{const F=t[D.dataIndex];F.count+=S,z=Math.ceil(Math.max(F.count*T/4,1))-Math.ceil(Math.max(D.offset/4,1))}d.push({dataIndex:D.dataIndex,offset:D.offset,bufferElementsToAdd:z}),D.offset+=k,D.count+=S}}for(const c of t)switch(c.type){case g.BYTE:case g.UNSIGNED_BYTE:c.count=4;break;case g.SHORT:case g.UNSIGNED_SHORT:c.count+=c.count%2}this._buildVertexBufferLayout(t);let l=0;const u=this._layoutInfo.geometry;for(const c of u)this._locations.set(c.name,l++);const p=this._layoutInfo.opacity;if(p)for(const c of p)this._locations.set(c.name,l++);this._buildShaderInfo(t,e),this._propertyEncodingInfo=e}_buildVertexBufferLayout(t){const e={},r=this.geometryInfo();let s=r[0].stride;if(t.length===0)e.geometry=r;else{const a=[];let o=s;for(const n of t)s+=Zt(n.type)*n.count;for(const n of r)a.push(new A(n.name,n.count,n.type,n.offset,s,n.normalized));for(const n of t)a.push(new A(n.name,n.count,n.type,o,s,n.normalized)),o+=Zt(n.type)*n.count;e.geometry=a}this.opacityInfo()&&(e.opacity=this.opacityInfo()),this._layoutInfo=e,this._stride=s}_buildShaderInfo(t,e){let r=` +import{a as b,f as Y,l as rt}from"./StyleDefinition.d56936e4.js";import{T as et}from"./enums.54326430.js";import{j as jt,b9 as I,el as ne}from"./index.221827cd.js";import{C as g}from"./enums.2d9e6f64.js";import{t as A}from"./VertexElementDescriptor.1fdca6da.js";import{v as Kt,p as qt,z as Wt}from"./colorUtils.bb6424b7.js";import{b as P}from"./GeometryUtils.4f19e772.js";import{s as wt}from"./Geometry.d049a63c.js";import{a3 as oe}from"./enums.0295eb81.js";class le{constructor(t){this._array=[],t<=0&&console.error("strideInBytes must be positive!"),this._stride=t}get array(){return this._array}get index(){return 4*this._array.length/this._stride}get itemSize(){return this._stride}get sizeInBytes(){return 4*this._array.length}reset(){this.array.length=0}toBuffer(){return new Uint32Array(this._array).buffer}static i1616to32(t,e){return 65535&t|e<<16}static i8888to32(t,e,r,s){return 255&t|(255&e)<<8|(255&r)<<16|s<<24}static i8816to32(t,e,r){return 255&t|(255&e)<<8|r<<16}}var h,J;(function(i){i[i.R8_SIGNED=0]="R8_SIGNED",i[i.R8_UNSIGNED=1]="R8_UNSIGNED",i[i.R16_SIGNED=2]="R16_SIGNED",i[i.R16_UNSIGNED=3]="R16_UNSIGNED",i[i.R8G8_SIGNED=4]="R8G8_SIGNED",i[i.R8G8_UNSIGNED=5]="R8G8_UNSIGNED",i[i.R16G16_SIGNED=6]="R16G16_SIGNED",i[i.R16G16_UNSIGNED=7]="R16G16_UNSIGNED",i[i.R8G8B8A8_SIGNED=8]="R8G8B8A8_SIGNED",i[i.R8G8B8A8_UNSIGNED=9]="R8G8B8A8_UNSIGNED",i[i.R8G8B8A8_COLOR=10]="R8G8B8A8_COLOR",i[i.R16G16B16A16_DASHARRAY=11]="R16G16B16A16_DASHARRAY",i[i.R16G16B16A16_PATTERN=12]="R16G16B16A16_PATTERN"})(h||(h={})),function(i){i[i.UNIFORM=0]="UNIFORM",i[i.DATA_DRIVEN=1]="DATA_DRIVEN",i[i.INTERPOLATED_DATA_DRIVEN=2]="INTERPOLATED_DATA_DRIVEN",i[i.UNUSED=3]="UNUSED"}(J||(J={}));class C{constructor(t){this._locations=new Map,this._key=t}get key(){return this._key}get type(){return 7&this._key}defines(){return[]}getStride(){return this._layoutInfo||this._buildAttributesInfo(),this._stride}getAttributeLocations(){return this._locations.size===0&&this._buildAttributesInfo(),this._locations}getLayoutInfo(){return this._layoutInfo||this._buildAttributesInfo(),this._layoutInfo}getEncodingInfos(){return this._propertyEncodingInfo||this._buildAttributesInfo(),this._propertyEncodingInfo}getUniforms(){return this._uniforms||this._buildAttributesInfo(),this._uniforms}getShaderHeader(){return this._shaderHeader||this._buildAttributesInfo(),this._shaderHeader}getShaderMain(){return this._shaderMain||this._buildAttributesInfo(),this._shaderMain}setDataUniforms(t,e,r,s,a){const o=this.getUniforms();for(const n of o){const{name:l,type:u,getValue:p}=n,c=p(r,e,s,a);if(c!==null)switch(u){case"float":t.setUniform1f(l,c);break;case"vec2":t.setUniform2fv(l,c);break;case"vec4":t.setUniform4fv(l,c)}}}encodeAttributes(t,e,r,s){var p;const a=this.attributesInfo(),o=this.getEncodingInfos(),n=[];let l=0,u=0;for(const c of Object.keys(o)){const f=o[c],{type:_,precisionFactor:d,isLayout:G}=a[c],R=G?r.getLayoutProperty(c):r.getPaintProperty(c),q=(p=R.interpolator)==null?void 0:p.getInterpolationRange(e);let T=0;for(const S of f){const{offset:E,bufferElementsToAdd:k}=S;if(k>0){for(let D=0;D4)s++,D={dataIndex:s,count:0,offset:0},S!==4&&(r[v]=D),t.push({location:-1,name:"a_data_"+s,count:S,type:q,normalized:E}),z=Math.ceil(Math.max(k/4,1));else{const F=t[D.dataIndex];F.count+=S,z=Math.ceil(Math.max(F.count*T/4,1))-Math.ceil(Math.max(D.offset/4,1))}d.push({dataIndex:D.dataIndex,offset:D.offset,bufferElementsToAdd:z}),D.offset+=k,D.count+=S}}for(const c of t)switch(c.type){case g.BYTE:case g.UNSIGNED_BYTE:c.count=4;break;case g.SHORT:case g.UNSIGNED_SHORT:c.count+=c.count%2}this._buildVertexBufferLayout(t);let l=0;const u=this._layoutInfo.geometry;for(const c of u)this._locations.set(c.name,l++);const p=this._layoutInfo.opacity;if(p)for(const c of p)this._locations.set(c.name,l++);this._buildShaderInfo(t,e),this._propertyEncodingInfo=e}_buildVertexBufferLayout(t){const e={},r=this.geometryInfo();let s=r[0].stride;if(t.length===0)e.geometry=r;else{const a=[];let o=s;for(const n of t)s+=Zt(n.type)*n.count;for(const n of r)a.push(new A(n.name,n.count,n.type,n.offset,s,n.normalized));for(const n of t)a.push(new A(n.name,n.count,n.type,o,s,n.normalized)),o+=Zt(n.type)*n.count;e.geometry=a}this.opacityInfo()&&(e.opacity=this.opacityInfo()),this._layoutInfo=e,this._stride=s}_buildShaderInfo(t,e){let r=` `,s=` `;const a=[];for(const u of t)r+=`attribute ${this._getType(u.count)} ${u.name}; `;const o=this.attributes(),n=this.attributesInfo();let l=-1;for(const u of o){l++;const{name:p,type:c,precisionFactor:f,isLayout:_}=n[u],d=f&&f!==1?" * "+1/f:"",{bytesPerElement:G,count:R}=C._encodingInfo[c],q=T=>`a_data_${T.dataIndex}${ue(R,T.offset,G)}`;switch(this.getAtributeState(l)){case J.UNIFORM:{const T=this._getType(R),S=`u_${p}`;a.push({name:S,type:T,getValue:(E,k,v,D)=>{const z=_?E.getLayoutValue(u,k):E.getPaintValue(u,k);if(c===h.R16G16B16A16_DASHARRAY){const F=E.getDashKey(z,E.getLayoutValue("line-cap",k)),it=D.getMosaicItemPosition(F,!1);if(jt(it))return null;const{tl:nt,br:Ht}=it;return[nt[0],Ht[1],Ht[0],nt[1]]}if(c===h.R16G16B16A16_PATTERN){const F=D.getMosaicItemPosition(z,!u.includes("line-"));if(jt(F))return null;const{tl:it,br:nt}=F;return[it[0],nt[1],nt[0],it[1]]}if(c===h.R8G8B8A8_COLOR){const F=z[3];return[F*z[0],F*z[1],F*z[2],F]}return z}}),r+=`uniform ${T} ${S}; diff --git a/assets/SublayersOwner.8a52d000.js b/assets/SublayersOwner.fd9e3967.js similarity index 97% rename from assets/SublayersOwner.8a52d000.js rename to assets/SublayersOwner.fd9e3967.js index dfbfa44..8e9b3c5 100644 --- a/assets/SublayersOwner.8a52d000.js +++ b/assets/SublayersOwner.fd9e3967.js @@ -1 +1 @@ -import{a6 as a,a7 as o,d2 as S,cU as X,ip as ee,ig as te,aT as re,a8 as k,U as z,bX as ie,v as se,a4 as ae,eH as le,aP as oe,n as E,e8 as y,cy as ne,c as j,ci as ye,js as pe,hw as de,s as L,jt as R,hB as ue,cE as J,dR as ce,i9 as P,id as he,dd as W,at as M,b4 as D,c4 as fe,c5 as be,hl as U,gG as ge,ju as me,h0 as V,iQ as Se,e0 as w,dv as Ie,iT as ve,ie as we,hR as G,d$ as K,cw as Ee,iW as Le,jh as A,hT as xe,ee as Oe,_ as _e,dz as De,jv as Te}from"./index.d94abe07.js";import{r as Pe}from"./Version.59f2da65.js";import{t as Fe}from"./sublayerUtils.9d6cbcc3.js";const $e=t=>{let e=class extends t{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesPromise=null,this._allLayersAndTablesMap=null}readCapabilities(r,i){var q,Q;const s=i.capabilities&&i.capabilities.split(",").map(Z=>Z.toLowerCase().trim());if(!s)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const n=this.type,p=s.includes("data"),u=s.includes("query"),c=s.includes("map"),I=!!i.exportTilesAllowed,b=s.includes("tilemap"),m=n!=="tile"&&!!i.supportsDynamicLayers,g=n!=="tile"&&(!i.tileInfo||m),x=n!=="tile"&&(!i.tileInfo||m),d=n!=="tile",h=i.cimVersion&&Pe.parse(i.cimVersion),O=(q=h==null?void 0:h.since(1,4))!=null?q:!1,_=(Q=h==null?void 0:h.since(2,0))!=null?Q:!1;return{operations:{supportsExportMap:c,supportsExportTiles:I,supportsIdentify:u,supportsQuery:p,supportsTileMap:b},exportMap:c?{supportsArcadeExpressionForLabeling:O,supportsSublayersChanges:d,supportsDynamicLayers:m,supportsSublayerVisibility:g,supportsSublayerDefinitionExpression:x,supportsCIMSymbols:_}:null,exportTiles:I?{maxExportTilesCount:+i.maxExportTilesCount}:null}}readVersion(r,i){let s=i.currentVersion;return s||(s=i.hasOwnProperty("capabilities")||i.hasOwnProperty("tables")?10:i.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),s}async fetchSublayerInfo(r,i){var s;return await this.fetchAllLayersAndTables(i),(s=this._allLayersAndTablesMap)==null?void 0:s.get(r)}async fetchAllLayersAndTables(r){await this.load(r),this._allLayersAndTablesPromise||(this._allLayersAndTablesPromise=z(ie(this.url).path+"/layers",{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(s=>{this._allLayersAndTablesMap=new Map;for(const n of s.data.layers)this._allLayersAndTablesMap.set(n.id,n);return{result:s.data}},s=>({error:s})));const i=await this._allLayersAndTablesPromise;if(se(r),"result"in i)return i.result;throw i.error}};return a([o({readOnly:!0})],e.prototype,"capabilities",void 0),a([S("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],e.prototype,"readCapabilities",null),a([o({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),a([o({type:X})],e.prototype,"fullExtent",void 0),a([o(ee)],e.prototype,"id",void 0),a([o({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],e.prototype,"legendEnabled",void 0),a([o(te)],e.prototype,"popupEnabled",void 0),a([o({type:re})],e.prototype,"spatialReference",void 0),a([o({readOnly:!0})],e.prototype,"version",void 0),a([S("version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],e.prototype,"readVersion",null),e=a([k("esri.layers.mixins.ArcGISMapService")],e),e};var F;function C(t){return t&&t.type==="esriSMS"}function N(t,e,r){var s;const i=this.originIdOf(e)>=A(r.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!r&&((s=r.layer)==null?void 0:s.type)==="map-image"&&(r.writeSublayerStructure||i)}}function H(t,e,r){var i;return{enabled:!!r&&((i=r.layer)==null?void 0:i.type)==="tile"&&this._isOverridden(e)}}function f(t,e,r){return{ignoreOrigin:!0,enabled:r&&r.writeSublayerStructure||!1}}function T(t,e,r){return{ignoreOrigin:!0,enabled:!!r&&(r.writeSublayerStructure||this.originIdOf(e)>=A(r.origin))}}let Ae=0;const v=new Set;v.add("layer"),v.add("parent"),v.add("loaded"),v.add("loadStatus"),v.add("loadError"),v.add("loadWarnings");let l=F=class extends ae(le(oe(xe))){constructor(t){super(t),this.capabilities=void 0,this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.legendEnabled=!0,this.objectIdField=null,this.popupEnabled=!0,this.popupTemplate=null,this.sourceJSON=null,this.title=null,this.typeIdField=null,this.types=null}async load(t){return this.addResolvingPromise((async()=>{var r,i;if(!this.layer&&!this.url)throw new E("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});let e=null;if(!this.layer||this.originIdOf("url")>y.SERVICE||((r=this.source)==null?void 0:r.type)==="data-layer")e=(await z(this.url,{responseType:"json",query:{f:"json"},...t})).data;else{let s=this.id;((i=this.source)==null?void 0:i.type)==="map-layer"&&(s=this.source.mapLayerId),e=await this.layer.fetchSublayerInfo(s,t)}e&&(this.sourceJSON=e,this.read({layerDefinition:e},{origin:"service"}))})()),this}readCapabilities(t,e){const r=(t=(e=e.layerDefinition||e).capabilities||t)?t.toLowerCase().split(",").map(n=>n.trim()):[],i=this.url?ne(this.url):null,s=r.includes(j(i)&&i.serverType==="MapServer"?"data":"query");return{exportMap:{supportsModification:!!e.canModifyLayer},operations:{supportsQuery:s}}}set definitionExpression(t){this._setAndNotifyLayer("definitionExpression",t)}get fieldsIndex(){return new ye(this.fields||[])}set floorInfo(t){this._setAndNotifyLayer("floorInfo",t)}readGlobalIdFieldFromService(t,e){if((e=e.layerDefinition||e).globalIdField)return e.globalIdField;if(e.fields){for(const r of e.fields)if(r.type==="esriFieldTypeGlobalID")return r.name}}get id(){const t=this._get("id");return t!=null?t:Ae++}set id(t){this._get("id")!==t&&(this.get("layer.capabilities.exportMap.supportsDynamicLayers")!==!1?this._set("id",t):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}set labelingInfo(t){this._setAndNotifyLayer("labelingInfo",t)}writeLabelingInfo(t,e,r,i){t&&t.length&&(e.layerDefinition={drawingInfo:{labelingInfo:t.map(s=>s.write({},i))}})}set labelsVisible(t){this._setAndNotifyLayer("labelsVisible",t)}set layer(t){this._set("layer",t),this.sublayers&&this.sublayers.forEach(e=>e.layer=t)}set listMode(t){this._set("listMode",t)}set minScale(t){this._setAndNotifyLayer("minScale",t)}readMinScale(t,e){return e.minScale||e.layerDefinition&&e.layerDefinition.minScale||0}set maxScale(t){this._setAndNotifyLayer("maxScale",t)}readMaxScale(t,e){return e.maxScale||e.layerDefinition&&e.layerDefinition.maxScale||0}get effectiveScaleRange(){const{minScale:t,maxScale:e}=this;return{minScale:t,maxScale:e}}readObjectIdFieldFromService(t,e){if((e=e.layerDefinition||e).objectIdField)return e.objectIdField;if(e.fields){for(const r of e.fields)if(r.type==="esriFieldTypeOID")return r.name}}set opacity(t){this._setAndNotifyLayer("opacity",t)}readOpacity(t,e){const r=e.layerDefinition;return 1-.01*(r.transparency!=null?r.transparency:r.drawingInfo.transparency)}writeOpacity(t,e,r,i){e.layerDefinition={drawingInfo:{transparency:100-100*t}}}writeParent(t,e){this.parent&&this.parent!==this.layer?e.parentLayerId=pe(this.parent.id):e.parentLayerId=-1}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(t){if(t){for(const e of t.getSymbols())if(de(e)){L.getLogger(this.declaredClass).warn("Sublayer renderer should use 2D symbols");break}}this._setAndNotifyLayer("renderer",t)}get source(){return this._get("source")||new R({mapLayerId:this.id})}set source(t){this._setAndNotifyLayer("source",t)}set sublayers(t){this._handleSublayersChange(t,this._get("sublayers")),this._set("sublayers",t)}castSublayers(t){return ue(J.ofType(F),t)}writeSublayers(t,e,r){this.get("sublayers.length")&&(e[r]=this.sublayers.map(i=>i.id).toArray().reverse())}readTypeIdField(t,e){let r=(e=e.layerDefinition||e).typeIdField;if(r&&e.fields){r=r.toLowerCase();const i=e.fields.find(s=>s.name.toLowerCase()===r);i&&(r=i.name)}return r}get url(){var i,s;const t=(s=(i=this.layer)==null?void 0:i.parsedUrl)!=null?s:this._lastParsedUrl,e=this.source;if(!t)return null;if(this._lastParsedUrl=t,(e==null?void 0:e.type)==="map-layer")return`${t.path}/${e.mapLayerId}`;const r={layer:JSON.stringify({source:this.source})};return`${t.path}/dynamicLayer?${ce(r)}`}set url(t){this._overrideIfSome("url",t)}set visible(t){this._setAndNotifyLayer("visible",t)}writeVisible(t,e,r,i){e[r]=this.getAtOrigin("defaultVisibility","service")||t}clone(){const{store:t}=P(this),e=new F;return P(e).store=t.clone(v),this.commitProperty("url"),e._lastParsedUrl=this._lastParsedUrl,e}createPopupTemplate(t){return he(this,t)}createQuery(){return new W({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){var r,i;if(this.hasOwnProperty("sublayers"))return null;const t=(r=this.layer)==null?void 0:r.parsedUrl,e=new(await M(()=>import("./index.d94abe07.js").then(function(s){return s.l0}),["assets/index.d94abe07.js","assets/index.f5419ca5.css"])).default({url:t.path});return t&&this.source&&(this.source.type==="map-layer"?e.layerId=this.source.mapLayerId:e.dynamicDataSource=this.source),this.layer.refreshInterval!=null&&(e.refreshInterval=this.layer.refreshInterval),this.definitionExpression&&(e.definitionExpression=this.definitionExpression),this.floorInfo&&(e.floorInfo=D(this.floorInfo)),this.originIdOf("labelingInfo")>y.SERVICE&&(e.labelingInfo=D(this.labelingInfo)),this.originIdOf("labelsVisible")>y.DEFAULTS&&(e.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>y.DEFAULTS&&(e.legendEnabled=this.legendEnabled),this.originIdOf("visible")>y.DEFAULTS&&(e.visible=this.visible),this.originIdOf("minScale")>y.DEFAULTS&&(e.minScale=this.minScale),this.originIdOf("maxScale")>y.DEFAULTS&&(e.maxScale=this.maxScale),this.originIdOf("opacity")>y.DEFAULTS&&(e.opacity=this.opacity),this.originIdOf("popupTemplate")>y.DEFAULTS&&(e.popupTemplate=D(this.popupTemplate)),this.originIdOf("renderer")>y.SERVICE&&(e.renderer=D(this.renderer)),((i=this.source)==null?void 0:i.type)==="data-layer"&&(e.dynamicDataSource=this.source.clone()),this.originIdOf("title")>y.DEFAULTS&&(e.title=this.title),this.layer.type==="map-image"&&this.layer.originIdOf("customParameters")>y.DEFAULTS&&(e.customParameters=this.layer.customParameters),this.layer.type==="tile"&&this.layer.originIdOf("customParameters")>y.DEFAULTS&&(e.customParameters=this.layer.customParameters),e}getField(t){return this.fieldsIndex.get(t)}getFeatureType(t){const{typeIdField:e,types:r}=this;if(!e||!t)return null;const i=t.attributes?t.attributes[e]:void 0;if(i==null)return null;let s=null;return r.some(n=>{const{id:p}=n;return p!=null&&(p.toString()===i.toString()&&(s=n),!!s)}),s}getFieldDomain(t,e){const r=e&&e.feature,i=this.getFeatureType(r);if(i){const s=i.domains&&i.domains[t];if(s&&s.type!=="inherited")return s}return this._getLayerDomain(t)}async queryFeatures(t=this.createQuery(),e){var p,u,c,I,b,m;if(await this.load(),!((u=(p=this.capabilities)==null?void 0:p.operations)!=null&&u.supportsQuery))throw new E("Sublayer.queryFeatures","this layer doesn't support queries.");const[{executeQuery:r},{default:i}]=await Promise.all([M(()=>import("./index.d94abe07.js").then(function(g){return g.kY}),["assets/index.d94abe07.js","assets/index.f5419ca5.css"]),M(()=>import("./index.d94abe07.js").then(function(g){return g.kZ}),["assets/index.d94abe07.js","assets/index.f5419ca5.css"])]),s=await r(this.url,W.from(t),(I=(c=this.layer)==null?void 0:c.spatialReference)!=null?I:null,{...e,query:{...(b=this.layer)==null?void 0:b.customParameters,token:(m=this.layer)==null?void 0:m.apiKey}}),n=i.fromJSON(s.data);if(n!=null&&n.features)for(const g of n.features)g.sourceLayer=this;return n}toExportImageJSON(t){var n;const e={id:this.id,source:((n=this.source)==null?void 0:n.toJSON())||{mapLayerId:this.id,type:"mapLayer"}},r=fe(t,this.definitionExpression);j(r)&&(e.definitionExpression=r);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce((p,u)=>(p[u]=this.originIdOf(u),p),{});if(Object.keys(i).some(p=>i[p]>y.SERVICE)){const p=e.drawingInfo={};if(i.renderer>y.SERVICE&&(p.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>y.SERVICE&&(p.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>y.SERVICE){!this.loaded&&this.labelingInfo.some(c=>!c.labelPlacement)&&L.getLogger(this.declaredClass).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let u=this.labelingInfo;j(this.geometryType)&&(u=be(this.labelingInfo,U.toJSON(this.geometryType))),p.labelingInfo=u.filter(c=>c.labelPlacement).map(c=>c.toJSON({origin:"service",layer:this.layer})),p.showLabels=!0}i.opacity>y.SERVICE&&(p.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(p.renderer)}return e}_assignDefaultSymbolColors(t){this._forEachSimpleMarkerSymbols(t,e=>{e.color||e.style!=="esriSMSX"&&e.style!=="esriSMSCross"||(e.outline&&e.outline.color?e.color=e.outline.color:e.color=[0,0,0,0])})}_forEachSimpleMarkerSymbols(t,e){if(t){const r="uniqueValueInfos"in t?t.uniqueValueInfos:"classBreakInfos"in t?t.classBreakInfos:[];for(const i of r)C(i.symbol)&&e(i.symbol);"symbol"in t&&C(t.symbol)&&e(t.symbol),"defaultSymbol"in t&&C(t.defaultSymbol)&&e(t.defaultSymbol)}}_setAndNotifyLayer(t,e){const r=this.layer,i=this._get(t);let s,n;switch(t){case"definitionExpression":case"floorInfo":s="supportsSublayerDefinitionExpression";case"minScale":case"maxScale":case"visible":s="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":s="supportsDynamicLayers",n="supportsModification"}const p=P(this).getDefaultOrigin();if(p!=="service"){if(s&&this.get(`layer.capabilities.exportMap.${s}`)===!1)return void this._logLockedError(t,`capability not available 'layer.capabilities.exportMap.${s}'`);if(n&&this.get(`capabilities.exportMap.${n}`)===!1)return void this._logLockedError(t,`capability not available 'capabilities.exportMap.${n}'`)}t!=="source"||this.loadStatus==="not-loaded"?(this._set(t,e),p!=="service"&&i!==e&&r&&r.emit&&r.emit("sublayer-update",{propertyName:t,target:this})):this._logLockedError(t,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(t,e){e&&(e.forEach(r=>{r.parent=null,r.layer=null}),this.handles.removeAll()),t&&(t.forEach(r=>{r.parent=this,r.layer=this.layer}),this.handles.add([t.on("after-add",({item:r})=>{r.parent=this,r.layer=this.layer}),t.on("after-remove",({item:r})=>{r.parent=null,r.layer=null}),t.on("before-changes",r=>{const i=this.get("layer.capabilities.exportMap.supportsSublayersChanges");i==null||i||(L.getLogger(this.declaredClass).error(new E("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),r.preventDefault())})]))}_logLockedError(t,e){L.getLogger(this.declaredClass).error(new E("sublayer:locked",`Property '${String(t)}' can't be changed on Sublayer from the layer '${this.layer.id}'`,{reason:e,sublayer:this,layer:this.layer}))}_getLayerDomain(t){const e=this.fieldsIndex.get(t);return e?e.domain:null}};l.test={isMapImageLayerOverridePolicy:t=>t===f||t===N,isTileImageLayerOverridePolicy:t=>t===H},a([o({readOnly:!0})],l.prototype,"capabilities",void 0),a([S("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],l.prototype,"readCapabilities",null),a([o({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:N}}})],l.prototype,"definitionExpression",null),a([o({type:[ge],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],l.prototype,"fields",void 0),a([o({readOnly:!0})],l.prototype,"fieldsIndex",null),a([o({type:me,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:N},origins:{"web-scene":{read:!1,write:!1}}}})],l.prototype,"floorInfo",null),a([o({type:X,json:{read:{source:"layerDefinition.extent"}}})],l.prototype,"fullExtent",void 0),a([o({type:U.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:U.read}}}}})],l.prototype,"geometryType",void 0),a([o({type:String})],l.prototype,"globalIdField",void 0),a([S("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],l.prototype,"readGlobalIdFieldFromService",null),a([o({type:V,json:{write:{ignoreOrigin:!0}}})],l.prototype,"id",null),a([o({value:null,type:[Se],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:f}}})],l.prototype,"labelingInfo",null),a([w("labelingInfo")],l.prototype,"writeLabelingInfo",null),a([o({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:f}}})],l.prototype,"labelsVisible",null),a([o({value:null})],l.prototype,"layer",null),a([o({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:T}}})],l.prototype,"legendEnabled",void 0),a([o({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],l.prototype,"listMode",null),a([o({type:Number,value:0,json:{write:{overridePolicy:f}}})],l.prototype,"minScale",null),a([S("minScale",["minScale","layerDefinition.minScale"])],l.prototype,"readMinScale",null),a([o({type:Number,value:0,json:{write:{overridePolicy:f}}})],l.prototype,"maxScale",null),a([S("maxScale",["maxScale","layerDefinition.maxScale"])],l.prototype,"readMaxScale",null),a([o({readOnly:!0})],l.prototype,"effectiveScaleRange",null),a([o({type:String})],l.prototype,"objectIdField",void 0),a([S("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],l.prototype,"readObjectIdFieldFromService",null),a([o({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:f}}})],l.prototype,"opacity",null),a([S("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],l.prototype,"readOpacity",null),a([w("opacity")],l.prototype,"writeOpacity",null),a([o({json:{type:V,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:f}}})],l.prototype,"parent",void 0),a([w("parent")],l.prototype,"writeParent",null),a([o({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(t,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy:T,writer(t,e,r){e[r]=!t}}}})],l.prototype,"popupEnabled",void 0),a([o({type:Ie,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:T}}})],l.prototype,"popupTemplate",void 0),a([o({readOnly:!0})],l.prototype,"defaultPopupTemplate",null),a([o({types:ve,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:f},origins:{"web-scene":{types:we,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:f}}}}})],l.prototype,"renderer",null),a([o({types:{key:"type",base:null,typeMap:{"data-layer":G,"map-layer":R}},cast(t){if(t){if("mapLayerId"in t)return K(R,t);if("dataSource"in t)return K(G,t)}return t},json:{name:"layerDefinition.source",write:{overridePolicy:f}}})],l.prototype,"source",null),a([o()],l.prototype,"sourceJSON",void 0),a([o({value:null,json:{type:[V],write:{target:"subLayerIds",allowNull:!0,overridePolicy:f}}})],l.prototype,"sublayers",null),a([Ee("sublayers")],l.prototype,"castSublayers",null),a([w("sublayers")],l.prototype,"writeSublayers",null),a([o({type:String,json:{name:"name",write:{overridePolicy:T}}})],l.prototype,"title",void 0),a([o({type:String})],l.prototype,"typeIdField",void 0),a([S("typeIdField",["layerDefinition.typeIdField"])],l.prototype,"readTypeIdField",null),a([o({type:[Le],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],l.prototype,"types",void 0),a([o({type:String,json:{read:{source:"layerUrl"},write:{target:"layerUrl",overridePolicy:H}}})],l.prototype,"url",null),a([o({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:f}}})],l.prototype,"visible",null),a([w("visible")],l.prototype,"writeVisible",null),l=F=a([k("esri.layers.support.Sublayer")],l);const B=l,je=L.getLogger("esri.layers.TileLayer");function Me(t,e){const r=[],i={};return t&&t.forEach(s=>{const n=new B;if(n.read(s,e),i[n.id]=n,s.parentLayerId!=null&&s.parentLayerId!==-1){const p=i[s.parentLayerId];p.sublayers||(p.sublayers=[]),p.sublayers.unshift(n)}else r.unshift(n)}),r}const $=J.ofType(B);function Y(t,e){t&&t.forEach(r=>{e(r),r.sublayers&&r.sublayers.length&&Y(r.sublayers,e)})}const Re=t=>{let e=class extends t{constructor(...r){super(...r),this.allSublayers=new Oe({getCollections:()=>[this.sublayers],getChildrenFunction:i=>i.sublayers}),this.sublayersSourceJSON={[y.SERVICE]:{},[y.PORTAL_ITEM]:{},[y.WEB_SCENE]:{},[y.WEB_MAP]:{}},this.addHandles(_e(()=>this.sublayers,(i,s)=>this._handleSublayersChange(i,s),De))}readSublayers(r,i){if(!i||!r)return;const{sublayersSourceJSON:s}=this,n=A(i.origin);if(ny.SERVICE))return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:p,origin:u}=this.createSublayersForOrigin("web-document"),c=P(this);c.setDefaultOrigin(u),this._set("sublayers",new $(p)),c.setDefaultOrigin("user")}findSublayerById(r){return this.allSublayers.find(i=>i.id===r)}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(r){const i=A(r==="web-document"?"web-map":r);let s=y.SERVICE,n=this.sublayersSourceJSON[y.SERVICE].layers,p=this.sublayersSourceJSON[y.SERVICE].context,u=null;const c=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter(d=>d<=i);for(const d of c){const h=this.sublayersSourceJSON[d];Fe(h.layers)&&(s=d,n=h.layers,p=h.context,h.visibleLayers&&(u={visibleLayers:h.visibleLayers,context:h.context}))}const I=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter(d=>d>s&&d<=i);let b=null;for(const d of I){const{layers:h,visibleLayers:O,context:_}=this.sublayersSourceJSON[d];h&&(b={layers:h,context:_}),O&&(u={visibleLayers:O,context:_})}const m=Me(n,p),g=new Map,x=new Set;if(b)for(const d of b.layers)g.set(d.id,d);if(u)for(const d of u.visibleLayers)x.add(d);return Y(m,d=>{b&&d.read(g.get(d.id),b.context),u&&d.read({defaultVisibility:x.has(d.id)},u.context)}),{origin:Te(s),sublayers:new $({items:m})}}read(r,i){super.read(r,i),this.readSublayers(r,i)}_handleSublayersChange(r,i){i&&(i.forEach(s=>{s.parent=null,s.layer=null}),this.handles.remove("sublayers-owner")),r&&(r.forEach(s=>{s.parent=this,s.layer=this}),this.handles.add([r.on("after-add",({item:s})=>{s.parent=this,s.layer=this}),r.on("after-remove",({item:s})=>{s.parent=null,s.layer=null})],"sublayers-owner"),this.type==="tile"&&this.handles.add(r.on("before-changes",s=>{je.error(new E("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),s.preventDefault()}),"sublayers-owner"))}};return a([o({readOnly:!0})],e.prototype,"allSublayers",void 0),a([o({readOnly:!0,type:J.ofType(B)})],e.prototype,"serviceSublayers",void 0),a([o({value:null,type:$,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],e.prototype,"sublayers",void 0),a([o({readOnly:!0})],e.prototype,"sublayersSourceJSON",void 0),e=a([k("esri.layers.mixins.SublayersOwner")],e),e};export{Re as E,$e as y,B as z}; +import{a6 as a,a7 as o,d2 as S,cU as X,ip as ee,ig as te,aT as re,a8 as k,U as z,bX as ie,v as se,a4 as ae,eH as le,aP as oe,n as E,e8 as y,cy as ne,c as j,ci as ye,js as pe,hw as de,s as L,jt as R,hB as ue,cE as J,dR as ce,i9 as P,id as he,dd as W,at as M,b4 as D,c4 as fe,c5 as be,hl as U,gG as ge,ju as me,h0 as V,iQ as Se,e0 as w,dv as Ie,iT as ve,ie as we,hR as G,d$ as K,cw as Ee,iW as Le,jh as A,hT as xe,ee as Oe,_ as _e,dz as De,jv as Te}from"./index.221827cd.js";import{r as Pe}from"./Version.433fbe58.js";import{t as Fe}from"./sublayerUtils.59f5d9da.js";const $e=t=>{let e=class extends t{constructor(){super(...arguments),this.capabilities=void 0,this.copyright=null,this.fullExtent=null,this.legendEnabled=!0,this.spatialReference=null,this.version=void 0,this._allLayersAndTablesPromise=null,this._allLayersAndTablesMap=null}readCapabilities(r,i){var q,Q;const s=i.capabilities&&i.capabilities.split(",").map(Z=>Z.toLowerCase().trim());if(!s)return{operations:{supportsExportMap:!1,supportsExportTiles:!1,supportsIdentify:!1,supportsQuery:!1,supportsTileMap:!1},exportMap:null,exportTiles:null};const n=this.type,p=s.includes("data"),u=s.includes("query"),c=s.includes("map"),I=!!i.exportTilesAllowed,b=s.includes("tilemap"),m=n!=="tile"&&!!i.supportsDynamicLayers,g=n!=="tile"&&(!i.tileInfo||m),x=n!=="tile"&&(!i.tileInfo||m),d=n!=="tile",h=i.cimVersion&&Pe.parse(i.cimVersion),O=(q=h==null?void 0:h.since(1,4))!=null?q:!1,_=(Q=h==null?void 0:h.since(2,0))!=null?Q:!1;return{operations:{supportsExportMap:c,supportsExportTiles:I,supportsIdentify:u,supportsQuery:p,supportsTileMap:b},exportMap:c?{supportsArcadeExpressionForLabeling:O,supportsSublayersChanges:d,supportsDynamicLayers:m,supportsSublayerVisibility:g,supportsSublayerDefinitionExpression:x,supportsCIMSymbols:_}:null,exportTiles:I?{maxExportTilesCount:+i.maxExportTilesCount}:null}}readVersion(r,i){let s=i.currentVersion;return s||(s=i.hasOwnProperty("capabilities")||i.hasOwnProperty("tables")?10:i.hasOwnProperty("supportedImageFormatTypes")?9.31:9.3),s}async fetchSublayerInfo(r,i){var s;return await this.fetchAllLayersAndTables(i),(s=this._allLayersAndTablesMap)==null?void 0:s.get(r)}async fetchAllLayersAndTables(r){await this.load(r),this._allLayersAndTablesPromise||(this._allLayersAndTablesPromise=z(ie(this.url).path+"/layers",{responseType:"json",query:{f:"json",...this.customParameters,token:this.apiKey}}).then(s=>{this._allLayersAndTablesMap=new Map;for(const n of s.data.layers)this._allLayersAndTablesMap.set(n.id,n);return{result:s.data}},s=>({error:s})));const i=await this._allLayersAndTablesPromise;if(se(r),"result"in i)return i.result;throw i.error}};return a([o({readOnly:!0})],e.prototype,"capabilities",void 0),a([S("service","capabilities",["capabilities","exportTilesAllowed","maxExportTilesCount","supportsDynamicLayers","tileInfo"])],e.prototype,"readCapabilities",null),a([o({json:{read:{source:"copyrightText"}}})],e.prototype,"copyright",void 0),a([o({type:X})],e.prototype,"fullExtent",void 0),a([o(ee)],e.prototype,"id",void 0),a([o({type:Boolean,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend"}}})],e.prototype,"legendEnabled",void 0),a([o(te)],e.prototype,"popupEnabled",void 0),a([o({type:re})],e.prototype,"spatialReference",void 0),a([o({readOnly:!0})],e.prototype,"version",void 0),a([S("version",["currentVersion","capabilities","tables","supportedImageFormatTypes"])],e.prototype,"readVersion",null),e=a([k("esri.layers.mixins.ArcGISMapService")],e),e};var F;function C(t){return t&&t.type==="esriSMS"}function N(t,e,r){var s;const i=this.originIdOf(e)>=A(r.origin);return{ignoreOrigin:!0,allowNull:i,enabled:!!r&&((s=r.layer)==null?void 0:s.type)==="map-image"&&(r.writeSublayerStructure||i)}}function H(t,e,r){var i;return{enabled:!!r&&((i=r.layer)==null?void 0:i.type)==="tile"&&this._isOverridden(e)}}function f(t,e,r){return{ignoreOrigin:!0,enabled:r&&r.writeSublayerStructure||!1}}function T(t,e,r){return{ignoreOrigin:!0,enabled:!!r&&(r.writeSublayerStructure||this.originIdOf(e)>=A(r.origin))}}let Ae=0;const v=new Set;v.add("layer"),v.add("parent"),v.add("loaded"),v.add("loadStatus"),v.add("loadError"),v.add("loadWarnings");let l=F=class extends ae(le(oe(xe))){constructor(t){super(t),this.capabilities=void 0,this.fields=null,this.fullExtent=null,this.geometryType=null,this.globalIdField=null,this.legendEnabled=!0,this.objectIdField=null,this.popupEnabled=!0,this.popupTemplate=null,this.sourceJSON=null,this.title=null,this.typeIdField=null,this.types=null}async load(t){return this.addResolvingPromise((async()=>{var r,i;if(!this.layer&&!this.url)throw new E("sublayer:missing-layer","Sublayer can't be loaded without being part of a layer",{sublayer:this});let e=null;if(!this.layer||this.originIdOf("url")>y.SERVICE||((r=this.source)==null?void 0:r.type)==="data-layer")e=(await z(this.url,{responseType:"json",query:{f:"json"},...t})).data;else{let s=this.id;((i=this.source)==null?void 0:i.type)==="map-layer"&&(s=this.source.mapLayerId),e=await this.layer.fetchSublayerInfo(s,t)}e&&(this.sourceJSON=e,this.read({layerDefinition:e},{origin:"service"}))})()),this}readCapabilities(t,e){const r=(t=(e=e.layerDefinition||e).capabilities||t)?t.toLowerCase().split(",").map(n=>n.trim()):[],i=this.url?ne(this.url):null,s=r.includes(j(i)&&i.serverType==="MapServer"?"data":"query");return{exportMap:{supportsModification:!!e.canModifyLayer},operations:{supportsQuery:s}}}set definitionExpression(t){this._setAndNotifyLayer("definitionExpression",t)}get fieldsIndex(){return new ye(this.fields||[])}set floorInfo(t){this._setAndNotifyLayer("floorInfo",t)}readGlobalIdFieldFromService(t,e){if((e=e.layerDefinition||e).globalIdField)return e.globalIdField;if(e.fields){for(const r of e.fields)if(r.type==="esriFieldTypeGlobalID")return r.name}}get id(){const t=this._get("id");return t!=null?t:Ae++}set id(t){this._get("id")!==t&&(this.get("layer.capabilities.exportMap.supportsDynamicLayers")!==!1?this._set("id",t):this._logLockedError("id","capability not available 'layer.capabilities.exportMap.supportsDynamicLayers'"))}set labelingInfo(t){this._setAndNotifyLayer("labelingInfo",t)}writeLabelingInfo(t,e,r,i){t&&t.length&&(e.layerDefinition={drawingInfo:{labelingInfo:t.map(s=>s.write({},i))}})}set labelsVisible(t){this._setAndNotifyLayer("labelsVisible",t)}set layer(t){this._set("layer",t),this.sublayers&&this.sublayers.forEach(e=>e.layer=t)}set listMode(t){this._set("listMode",t)}set minScale(t){this._setAndNotifyLayer("minScale",t)}readMinScale(t,e){return e.minScale||e.layerDefinition&&e.layerDefinition.minScale||0}set maxScale(t){this._setAndNotifyLayer("maxScale",t)}readMaxScale(t,e){return e.maxScale||e.layerDefinition&&e.layerDefinition.maxScale||0}get effectiveScaleRange(){const{minScale:t,maxScale:e}=this;return{minScale:t,maxScale:e}}readObjectIdFieldFromService(t,e){if((e=e.layerDefinition||e).objectIdField)return e.objectIdField;if(e.fields){for(const r of e.fields)if(r.type==="esriFieldTypeOID")return r.name}}set opacity(t){this._setAndNotifyLayer("opacity",t)}readOpacity(t,e){const r=e.layerDefinition;return 1-.01*(r.transparency!=null?r.transparency:r.drawingInfo.transparency)}writeOpacity(t,e,r,i){e.layerDefinition={drawingInfo:{transparency:100-100*t}}}writeParent(t,e){this.parent&&this.parent!==this.layer?e.parentLayerId=pe(this.parent.id):e.parentLayerId=-1}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(t){if(t){for(const e of t.getSymbols())if(de(e)){L.getLogger(this.declaredClass).warn("Sublayer renderer should use 2D symbols");break}}this._setAndNotifyLayer("renderer",t)}get source(){return this._get("source")||new R({mapLayerId:this.id})}set source(t){this._setAndNotifyLayer("source",t)}set sublayers(t){this._handleSublayersChange(t,this._get("sublayers")),this._set("sublayers",t)}castSublayers(t){return ue(J.ofType(F),t)}writeSublayers(t,e,r){this.get("sublayers.length")&&(e[r]=this.sublayers.map(i=>i.id).toArray().reverse())}readTypeIdField(t,e){let r=(e=e.layerDefinition||e).typeIdField;if(r&&e.fields){r=r.toLowerCase();const i=e.fields.find(s=>s.name.toLowerCase()===r);i&&(r=i.name)}return r}get url(){var i,s;const t=(s=(i=this.layer)==null?void 0:i.parsedUrl)!=null?s:this._lastParsedUrl,e=this.source;if(!t)return null;if(this._lastParsedUrl=t,(e==null?void 0:e.type)==="map-layer")return`${t.path}/${e.mapLayerId}`;const r={layer:JSON.stringify({source:this.source})};return`${t.path}/dynamicLayer?${ce(r)}`}set url(t){this._overrideIfSome("url",t)}set visible(t){this._setAndNotifyLayer("visible",t)}writeVisible(t,e,r,i){e[r]=this.getAtOrigin("defaultVisibility","service")||t}clone(){const{store:t}=P(this),e=new F;return P(e).store=t.clone(v),this.commitProperty("url"),e._lastParsedUrl=this._lastParsedUrl,e}createPopupTemplate(t){return he(this,t)}createQuery(){return new W({returnGeometry:!0,where:this.definitionExpression||"1=1"})}async createFeatureLayer(){var r,i;if(this.hasOwnProperty("sublayers"))return null;const t=(r=this.layer)==null?void 0:r.parsedUrl,e=new(await M(()=>import("./index.221827cd.js").then(function(s){return s.l0}),["assets/index.221827cd.js","assets/index.f5419ca5.css"])).default({url:t.path});return t&&this.source&&(this.source.type==="map-layer"?e.layerId=this.source.mapLayerId:e.dynamicDataSource=this.source),this.layer.refreshInterval!=null&&(e.refreshInterval=this.layer.refreshInterval),this.definitionExpression&&(e.definitionExpression=this.definitionExpression),this.floorInfo&&(e.floorInfo=D(this.floorInfo)),this.originIdOf("labelingInfo")>y.SERVICE&&(e.labelingInfo=D(this.labelingInfo)),this.originIdOf("labelsVisible")>y.DEFAULTS&&(e.labelsVisible=this.labelsVisible),this.originIdOf("legendEnabled")>y.DEFAULTS&&(e.legendEnabled=this.legendEnabled),this.originIdOf("visible")>y.DEFAULTS&&(e.visible=this.visible),this.originIdOf("minScale")>y.DEFAULTS&&(e.minScale=this.minScale),this.originIdOf("maxScale")>y.DEFAULTS&&(e.maxScale=this.maxScale),this.originIdOf("opacity")>y.DEFAULTS&&(e.opacity=this.opacity),this.originIdOf("popupTemplate")>y.DEFAULTS&&(e.popupTemplate=D(this.popupTemplate)),this.originIdOf("renderer")>y.SERVICE&&(e.renderer=D(this.renderer)),((i=this.source)==null?void 0:i.type)==="data-layer"&&(e.dynamicDataSource=this.source.clone()),this.originIdOf("title")>y.DEFAULTS&&(e.title=this.title),this.layer.type==="map-image"&&this.layer.originIdOf("customParameters")>y.DEFAULTS&&(e.customParameters=this.layer.customParameters),this.layer.type==="tile"&&this.layer.originIdOf("customParameters")>y.DEFAULTS&&(e.customParameters=this.layer.customParameters),e}getField(t){return this.fieldsIndex.get(t)}getFeatureType(t){const{typeIdField:e,types:r}=this;if(!e||!t)return null;const i=t.attributes?t.attributes[e]:void 0;if(i==null)return null;let s=null;return r.some(n=>{const{id:p}=n;return p!=null&&(p.toString()===i.toString()&&(s=n),!!s)}),s}getFieldDomain(t,e){const r=e&&e.feature,i=this.getFeatureType(r);if(i){const s=i.domains&&i.domains[t];if(s&&s.type!=="inherited")return s}return this._getLayerDomain(t)}async queryFeatures(t=this.createQuery(),e){var p,u,c,I,b,m;if(await this.load(),!((u=(p=this.capabilities)==null?void 0:p.operations)!=null&&u.supportsQuery))throw new E("Sublayer.queryFeatures","this layer doesn't support queries.");const[{executeQuery:r},{default:i}]=await Promise.all([M(()=>import("./index.221827cd.js").then(function(g){return g.kY}),["assets/index.221827cd.js","assets/index.f5419ca5.css"]),M(()=>import("./index.221827cd.js").then(function(g){return g.kZ}),["assets/index.221827cd.js","assets/index.f5419ca5.css"])]),s=await r(this.url,W.from(t),(I=(c=this.layer)==null?void 0:c.spatialReference)!=null?I:null,{...e,query:{...(b=this.layer)==null?void 0:b.customParameters,token:(m=this.layer)==null?void 0:m.apiKey}}),n=i.fromJSON(s.data);if(n!=null&&n.features)for(const g of n.features)g.sourceLayer=this;return n}toExportImageJSON(t){var n;const e={id:this.id,source:((n=this.source)==null?void 0:n.toJSON())||{mapLayerId:this.id,type:"mapLayer"}},r=fe(t,this.definitionExpression);j(r)&&(e.definitionExpression=r);const i=["renderer","labelingInfo","opacity","labelsVisible"].reduce((p,u)=>(p[u]=this.originIdOf(u),p),{});if(Object.keys(i).some(p=>i[p]>y.SERVICE)){const p=e.drawingInfo={};if(i.renderer>y.SERVICE&&(p.renderer=this.renderer?this.renderer.toJSON():null),i.labelsVisible>y.SERVICE&&(p.showLabels=this.labelsVisible),this.labelsVisible&&i.labelingInfo>y.SERVICE){!this.loaded&&this.labelingInfo.some(c=>!c.labelPlacement)&&L.getLogger(this.declaredClass).warnOnce(`A Sublayer (title: ${this.title}, id: ${this.id}) has an undefined 'labelPlacement' and so labels cannot be displayed. Either define a valid 'labelPlacement' or call Sublayer.load() to use a default value based on geometry type.`,{sublayer:this});let u=this.labelingInfo;j(this.geometryType)&&(u=be(this.labelingInfo,U.toJSON(this.geometryType))),p.labelingInfo=u.filter(c=>c.labelPlacement).map(c=>c.toJSON({origin:"service",layer:this.layer})),p.showLabels=!0}i.opacity>y.SERVICE&&(p.transparency=100-100*this.opacity),this._assignDefaultSymbolColors(p.renderer)}return e}_assignDefaultSymbolColors(t){this._forEachSimpleMarkerSymbols(t,e=>{e.color||e.style!=="esriSMSX"&&e.style!=="esriSMSCross"||(e.outline&&e.outline.color?e.color=e.outline.color:e.color=[0,0,0,0])})}_forEachSimpleMarkerSymbols(t,e){if(t){const r="uniqueValueInfos"in t?t.uniqueValueInfos:"classBreakInfos"in t?t.classBreakInfos:[];for(const i of r)C(i.symbol)&&e(i.symbol);"symbol"in t&&C(t.symbol)&&e(t.symbol),"defaultSymbol"in t&&C(t.defaultSymbol)&&e(t.defaultSymbol)}}_setAndNotifyLayer(t,e){const r=this.layer,i=this._get(t);let s,n;switch(t){case"definitionExpression":case"floorInfo":s="supportsSublayerDefinitionExpression";case"minScale":case"maxScale":case"visible":s="supportsSublayerVisibility";break;case"labelingInfo":case"labelsVisible":case"opacity":case"renderer":case"source":s="supportsDynamicLayers",n="supportsModification"}const p=P(this).getDefaultOrigin();if(p!=="service"){if(s&&this.get(`layer.capabilities.exportMap.${s}`)===!1)return void this._logLockedError(t,`capability not available 'layer.capabilities.exportMap.${s}'`);if(n&&this.get(`capabilities.exportMap.${n}`)===!1)return void this._logLockedError(t,`capability not available 'capabilities.exportMap.${n}'`)}t!=="source"||this.loadStatus==="not-loaded"?(this._set(t,e),p!=="service"&&i!==e&&r&&r.emit&&r.emit("sublayer-update",{propertyName:t,target:this})):this._logLockedError(t,"'source' can't be changed after calling sublayer.load()")}_handleSublayersChange(t,e){e&&(e.forEach(r=>{r.parent=null,r.layer=null}),this.handles.removeAll()),t&&(t.forEach(r=>{r.parent=this,r.layer=this.layer}),this.handles.add([t.on("after-add",({item:r})=>{r.parent=this,r.layer=this.layer}),t.on("after-remove",({item:r})=>{r.parent=null,r.layer=null}),t.on("before-changes",r=>{const i=this.get("layer.capabilities.exportMap.supportsSublayersChanges");i==null||i||(L.getLogger(this.declaredClass).error(new E("sublayer:sublayers-non-modifiable","Sublayer can't be added, moved, or removed from the layer's sublayers",{sublayer:this,layer:this.layer})),r.preventDefault())})]))}_logLockedError(t,e){L.getLogger(this.declaredClass).error(new E("sublayer:locked",`Property '${String(t)}' can't be changed on Sublayer from the layer '${this.layer.id}'`,{reason:e,sublayer:this,layer:this.layer}))}_getLayerDomain(t){const e=this.fieldsIndex.get(t);return e?e.domain:null}};l.test={isMapImageLayerOverridePolicy:t=>t===f||t===N,isTileImageLayerOverridePolicy:t=>t===H},a([o({readOnly:!0})],l.prototype,"capabilities",void 0),a([S("service","capabilities",["layerDefinition.canModifyLayer","layerDefinition.capabilities"])],l.prototype,"readCapabilities",null),a([o({type:String,value:null,json:{name:"layerDefinition.definitionExpression",write:{allowNull:!0,overridePolicy:N}}})],l.prototype,"definitionExpression",null),a([o({type:[ge],json:{origins:{service:{read:{source:"layerDefinition.fields"}}}}})],l.prototype,"fields",void 0),a([o({readOnly:!0})],l.prototype,"fieldsIndex",null),a([o({type:me,value:null,json:{name:"layerDefinition.floorInfo",read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo",overridePolicy:N},origins:{"web-scene":{read:!1,write:!1}}}})],l.prototype,"floorInfo",null),a([o({type:X,json:{read:{source:"layerDefinition.extent"}}})],l.prototype,"fullExtent",void 0),a([o({type:U.apiValues,json:{origins:{service:{name:"layerDefinition.geometryType",read:{reader:U.read}}}}})],l.prototype,"geometryType",void 0),a([o({type:String})],l.prototype,"globalIdField",void 0),a([S("service","globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],l.prototype,"readGlobalIdFieldFromService",null),a([o({type:V,json:{write:{ignoreOrigin:!0}}})],l.prototype,"id",null),a([o({value:null,type:[Se],json:{read:{source:"layerDefinition.drawingInfo.labelingInfo"},write:{target:"layerDefinition.drawingInfo.labelingInfo",overridePolicy:f}}})],l.prototype,"labelingInfo",null),a([w("labelingInfo")],l.prototype,"writeLabelingInfo",null),a([o({type:Boolean,value:!0,json:{read:{source:"layerDefinition.drawingInfo.showLabels"},write:{target:"layerDefinition.drawingInfo.showLabels",overridePolicy:f}}})],l.prototype,"labelsVisible",null),a([o({value:null})],l.prototype,"layer",null),a([o({type:Boolean,value:!0,json:{origins:{service:{read:{enabled:!1}}},read:{source:"showLegend"},write:{target:"showLegend",overridePolicy:T}}})],l.prototype,"legendEnabled",void 0),a([o({type:["show","hide","hide-children"],value:"show",json:{read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],l.prototype,"listMode",null),a([o({type:Number,value:0,json:{write:{overridePolicy:f}}})],l.prototype,"minScale",null),a([S("minScale",["minScale","layerDefinition.minScale"])],l.prototype,"readMinScale",null),a([o({type:Number,value:0,json:{write:{overridePolicy:f}}})],l.prototype,"maxScale",null),a([S("maxScale",["maxScale","layerDefinition.maxScale"])],l.prototype,"readMaxScale",null),a([o({readOnly:!0})],l.prototype,"effectiveScaleRange",null),a([o({type:String})],l.prototype,"objectIdField",void 0),a([S("service","objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],l.prototype,"readObjectIdFieldFromService",null),a([o({type:Number,value:1,json:{write:{target:"layerDefinition.drawingInfo.transparency",overridePolicy:f}}})],l.prototype,"opacity",null),a([S("opacity",["layerDefinition.drawingInfo.transparency","layerDefinition.transparency"])],l.prototype,"readOpacity",null),a([w("opacity")],l.prototype,"writeOpacity",null),a([o({json:{type:V,write:{target:"parentLayerId",writerEnsuresNonNull:!0,overridePolicy:f}}})],l.prototype,"parent",void 0),a([w("parent")],l.prototype,"writeParent",null),a([o({type:Boolean,value:!0,json:{read:{source:"disablePopup",reader:(t,e)=>!e.disablePopup},write:{target:"disablePopup",overridePolicy:T,writer(t,e,r){e[r]=!t}}}})],l.prototype,"popupEnabled",void 0),a([o({type:Ie,json:{read:{source:"popupInfo"},write:{target:"popupInfo",overridePolicy:T}}})],l.prototype,"popupTemplate",void 0),a([o({readOnly:!0})],l.prototype,"defaultPopupTemplate",null),a([o({types:ve,value:null,json:{name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:f},origins:{"web-scene":{types:we,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:f}}}}})],l.prototype,"renderer",null),a([o({types:{key:"type",base:null,typeMap:{"data-layer":G,"map-layer":R}},cast(t){if(t){if("mapLayerId"in t)return K(R,t);if("dataSource"in t)return K(G,t)}return t},json:{name:"layerDefinition.source",write:{overridePolicy:f}}})],l.prototype,"source",null),a([o()],l.prototype,"sourceJSON",void 0),a([o({value:null,json:{type:[V],write:{target:"subLayerIds",allowNull:!0,overridePolicy:f}}})],l.prototype,"sublayers",null),a([Ee("sublayers")],l.prototype,"castSublayers",null),a([w("sublayers")],l.prototype,"writeSublayers",null),a([o({type:String,json:{name:"name",write:{overridePolicy:T}}})],l.prototype,"title",void 0),a([o({type:String})],l.prototype,"typeIdField",void 0),a([S("typeIdField",["layerDefinition.typeIdField"])],l.prototype,"readTypeIdField",null),a([o({type:[Le],json:{origins:{service:{read:{source:"layerDefinition.types"}}}}})],l.prototype,"types",void 0),a([o({type:String,json:{read:{source:"layerUrl"},write:{target:"layerUrl",overridePolicy:H}}})],l.prototype,"url",null),a([o({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"},write:{target:"defaultVisibility",overridePolicy:f}}})],l.prototype,"visible",null),a([w("visible")],l.prototype,"writeVisible",null),l=F=a([k("esri.layers.support.Sublayer")],l);const B=l,je=L.getLogger("esri.layers.TileLayer");function Me(t,e){const r=[],i={};return t&&t.forEach(s=>{const n=new B;if(n.read(s,e),i[n.id]=n,s.parentLayerId!=null&&s.parentLayerId!==-1){const p=i[s.parentLayerId];p.sublayers||(p.sublayers=[]),p.sublayers.unshift(n)}else r.unshift(n)}),r}const $=J.ofType(B);function Y(t,e){t&&t.forEach(r=>{e(r),r.sublayers&&r.sublayers.length&&Y(r.sublayers,e)})}const Re=t=>{let e=class extends t{constructor(...r){super(...r),this.allSublayers=new Oe({getCollections:()=>[this.sublayers],getChildrenFunction:i=>i.sublayers}),this.sublayersSourceJSON={[y.SERVICE]:{},[y.PORTAL_ITEM]:{},[y.WEB_SCENE]:{},[y.WEB_MAP]:{}},this.addHandles(_e(()=>this.sublayers,(i,s)=>this._handleSublayersChange(i,s),De))}readSublayers(r,i){if(!i||!r)return;const{sublayersSourceJSON:s}=this,n=A(i.origin);if(ny.SERVICE))return;this._set("serviceSublayers",this.createSublayersForOrigin("service").sublayers);const{sublayers:p,origin:u}=this.createSublayersForOrigin("web-document"),c=P(this);c.setDefaultOrigin(u),this._set("sublayers",new $(p)),c.setDefaultOrigin("user")}findSublayerById(r){return this.allSublayers.find(i=>i.id===r)}createServiceSublayers(){return this.createSublayersForOrigin("service").sublayers}createSublayersForOrigin(r){const i=A(r==="web-document"?"web-map":r);let s=y.SERVICE,n=this.sublayersSourceJSON[y.SERVICE].layers,p=this.sublayersSourceJSON[y.SERVICE].context,u=null;const c=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter(d=>d<=i);for(const d of c){const h=this.sublayersSourceJSON[d];Fe(h.layers)&&(s=d,n=h.layers,p=h.context,h.visibleLayers&&(u={visibleLayers:h.visibleLayers,context:h.context}))}const I=[y.PORTAL_ITEM,y.WEB_SCENE,y.WEB_MAP].filter(d=>d>s&&d<=i);let b=null;for(const d of I){const{layers:h,visibleLayers:O,context:_}=this.sublayersSourceJSON[d];h&&(b={layers:h,context:_}),O&&(u={visibleLayers:O,context:_})}const m=Me(n,p),g=new Map,x=new Set;if(b)for(const d of b.layers)g.set(d.id,d);if(u)for(const d of u.visibleLayers)x.add(d);return Y(m,d=>{b&&d.read(g.get(d.id),b.context),u&&d.read({defaultVisibility:x.has(d.id)},u.context)}),{origin:Te(s),sublayers:new $({items:m})}}read(r,i){super.read(r,i),this.readSublayers(r,i)}_handleSublayersChange(r,i){i&&(i.forEach(s=>{s.parent=null,s.layer=null}),this.handles.remove("sublayers-owner")),r&&(r.forEach(s=>{s.parent=this,s.layer=this}),this.handles.add([r.on("after-add",({item:s})=>{s.parent=this,s.layer=this}),r.on("after-remove",({item:s})=>{s.parent=null,s.layer=null})],"sublayers-owner"),this.type==="tile"&&this.handles.add(r.on("before-changes",s=>{je.error(new E("tilelayer:sublayers-non-modifiable","ISublayer can't be added, moved, or removed from the layer's sublayers",{layer:this})),s.preventDefault()}),"sublayers-owner"))}};return a([o({readOnly:!0})],e.prototype,"allSublayers",void 0),a([o({readOnly:!0,type:J.ofType(B)})],e.prototype,"serviceSublayers",void 0),a([o({value:null,type:$,json:{read:!1,write:{allowNull:!0,ignoreOrigin:!0}}})],e.prototype,"sublayers",void 0),a([o({readOnly:!0})],e.prototype,"sublayersSourceJSON",void 0),e=a([k("esri.layers.mixins.SublayersOwner")],e),e};export{Re as E,$e as y,B as z}; diff --git a/assets/SubtypeGroupLayer.8fd2feb6.js b/assets/SubtypeGroupLayer.76081822.js similarity index 97% rename from assets/SubtypeGroupLayer.8fd2feb6.js rename to assets/SubtypeGroupLayer.76081822.js index 7ba534d..494ed9f 100644 --- a/assets/SubtypeGroupLayer.8fd2feb6.js +++ b/assets/SubtypeGroupLayer.76081822.js @@ -1 +1 @@ -import{a6 as i,a7 as n,d2 as F,e0 as N,a8 as P,cx as z,jR as X,jP as Z,a4 as R,eH as q,aP as W,b4 as $,hV as Y,iN as K,dx as C,c as L,id as ee,e8 as M,jS as te,iP as re,iQ as ie,iR as se,iE as ne,jO as oe,jN as ae,ig as le,dv as ue,iV as U,jT as de,j8 as pe,j6 as ye,ih as A,jU as ce,jV as he,jW as me,hT as be,jX as fe,jI as ge,i2 as ve,iM as we,i3 as $e,ia as je,eE as Fe,eF as Oe,eG as Se,iJ as Ie,il as Te,au as _e,cE as E,_ as xe,dz as Ee,f5 as Pe,aU as Ce,n as j,bX as Le,eP as Ge,iq as De,jY as Ve,jZ as ke,j_ as Ne,cO as Re,at as qe,j$ as Me,c4 as Ue,k0 as Ae,k1 as Qe,k2 as Je,dd as Be,bd as He,k3 as ze,k4 as Xe,k5 as Ze,k6 as We,k7 as Ye,i_ as Ke,iO as et,k8 as tt,ip as rt,jh as G,gv as it,cF as st}from"./index.d94abe07.js";let b=class extends z{constructor(){super(...arguments),this.code=null,this.defaultValues={},this.domains=null,this.name=null}readDomains(e){if(!e)return null;const t={};for(const r of Object.keys(e))t[r]=X(e[r]);return t}writeDomains(e,t){var o;if(!e)return;const r={};for(const s of Object.keys(e))e[s]&&(r[s]=(o=e[s])==null?void 0:o.toJSON());t.domains=r}};i([n({type:Number,json:{write:!0}})],b.prototype,"code",void 0),i([n({type:Object,json:{write:!0}})],b.prototype,"defaultValues",void 0),i([n({json:{write:!0}})],b.prototype,"domains",void 0),i([F("domains")],b.prototype,"readDomains",null),i([N("domains")],b.prototype,"writeDomains",null),i([n({type:String,json:{write:!0}})],b.prototype,"name",void 0),b=i([P("esri.layers.support.Subtype")],b);const nt=b,ot=["charts","editingEnabled","formTemplate","labelsVisible","labelingInfo","legendEnabled","minScale","maxScale","opacity","popupEnabled","popupTemplate","renderer","subtypeCode","templates","title","visible"],Q={key:"type",base:de,errorContext:"renderer",typeMap:{simple:C,"unique-value":pe,"class-breaks":ye}},D=A(),V=Z({types:Q});let at=0;function S(e){const t=e.json.write;return typeof t=="object"?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function lt(e){return new C({symbol:ut(e)})}function ut(e){switch(e){case"point":case"multipoint":return me.clone();case"polyline":return he.clone();case"polygon":case"multipatch":return ce.clone();default:return null}}function dt(e,t){return!!t&&(e==null?void 0:e.type)==="unique-value"&&typeof e.field=="string"&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression}function J(e,t){var r;return e==null?null:(r=t.subtypes)==null?void 0:r.find(o=>o.code===e)}function pt(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const o={},s=J(e,t);if(L(s)){const{defaultValues:a}=s;for(const u in a)o[u]=a[u]}return o[t.subtypeField]=e,new U({name:"New Feature",drawingTool:r,prototype:{attributes:o}})}const yt="esri.layers.support.SubtypeSublayer";let l=class extends R(q(W(be))){constructor(e){super(e),this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${at++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}writeFieldOverrides(e,t,r){const{fields:o,parent:s}=this;let a;if(o){a=[];let u=0;o.forEach(({name:p,alias:m,editable:f,visible:v})=>{var g;if(!v)return;const c=(g=s==null?void 0:s.fields)==null?void 0:g.find(O=>O.name===p);if(!c)return;const w={name:p};let y=!1;m!==c.alias&&(w.alias=m,y=!0),f!==c.editable&&(w.editable=f,y=!0),a.push(w),y&&u++}),u===0&&a.length===o.length&&(a=null)}else a=$(e);a!=null&&a.length&&Y(r,a,t)}get fields(){var v,c;const{parent:e,fieldOverrides:t,subtypeCode:r}=this,o=e==null?void 0:e.fields;if(!(o!=null&&o.length))return null;const{subtypes:s,subtypeField:a}=e,u=s.find(w=>w.code===r),p=u==null?void 0:u.defaultValues,m=u==null?void 0:u.domains,f=[];for(const w of o){const y=w.clone(),{name:g}=y,O=t==null?void 0:t.find(I=>I.name===g);if(y.visible=!t||!!O,O){const{alias:I,editable:H}=O;I&&(y.alias=I),H===!1&&(y.editable=!1)}const B=(v=p==null?void 0:p[g])!=null?v:null;y.defaultValue=g===a?r:B;const _=(c=m==null?void 0:m[g])!=null?c:null;y.domain=g===a?null:_?_.type==="inherited"?y.domain:_.clone():null,f.push(y)}return f}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){K(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&e.geometryType!=="mesh"?lt(e.geometryType):null}readRendererFromService(e,t,r){var p,m,f;if(t.type==="Table")return null;const o=(p=t.drawingInfo)==null?void 0:p.renderer,s=V(o,t,r);let a;const{subtypeCode:u}=this;if(u!=null&&dt(s,t.subtypeField)){const v=(m=s.uniqueValueInfos)==null?void 0:m.find(({value:c})=>(c=typeof c=="number"?String(c):c)===String(u));v&&(a=new C({symbol:v.symbol}))}else(s==null?void 0:s.type)!=="simple"||((f=s.visualVariables)==null?void 0:f.length)||(a=s);return a}readRenderer(e,t,r){var s,a,u;const o=(a=(s=t==null?void 0:t.layerDefinition)==null?void 0:s.drawingInfo)==null?void 0:a.renderer;if(o&&!((u=o.visualVariables)!=null&&u.length))return V(o,t,r)||void 0}readTemplatesFromService(e,t){return[pt(this.subtypeCode,t)]}readTitleFromService(e,t){const r=J(this.subtypeCode,t);return L(r)?r.name:null}createPopupTemplate(e){let t=this;const{parent:r,fields:o,title:s}=this;if(r){const{displayField:a,editFieldsInfo:u,objectIdField:p}=r;t={displayField:a,editFieldsInfo:u,fields:o,objectIdField:p,title:s}}return ee(t,e)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e){return this._getLayerDomain(e)}hasUserOverrides(){return ot.some(e=>this.originIdOf(e)===M.USER)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};i([n({json:{write:{ignoreOrigin:!0}}})],l.prototype,"charts",void 0),i([n({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:{ignoreOrigin:!0}}})],l.prototype,"editingEnabled",void 0),i([n({readOnly:!0,json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],l.prototype,"fieldOverrides",void 0),i([N("fieldOverrides")],l.prototype,"writeFieldOverrides",null),i([n({...D.fields,readOnly:!0,json:{read:!1}})],l.prototype,"fields",null),i([n(D.fieldsIndex)],l.prototype,"fieldsIndex",void 0),i([n({type:te,json:{name:"formInfo",write:{ignoreOrigin:!0}}})],l.prototype,"formTemplate",void 0),i([n({type:String,readOnly:!0,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],l.prototype,"id",void 0),i([n({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),i([n(S($(re)))],l.prototype,"labelsVisible",void 0),i([n({type:[ie],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:se},write:{ignoreOrigin:!0}}})],l.prototype,"labelingInfo",void 0),i([n({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],l.prototype,"layerType",void 0),i([n(S($(ne)))],l.prototype,"legendEnabled",void 0),i([n({type:["show","hide"]})],l.prototype,"listMode",void 0),i([n((()=>{const e=$(oe);return e.json.origins.service.read=!1,S(e)})())],l.prototype,"minScale",void 0),i([n((()=>{const e=$(ae);return e.json.origins.service.read=!1,S(e)})())],l.prototype,"maxScale",void 0),i([n({readOnly:!0})],l.prototype,"effectiveScaleRange",null),i([n({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],l.prototype,"opacity",void 0),i([n()],l.prototype,"parent",void 0),i([n(S($(le)))],l.prototype,"popupEnabled",void 0),i([n({type:ue,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],l.prototype,"popupTemplate",void 0),i([n({readOnly:!0})],l.prototype,"defaultPopupTemplate",null),i([n({types:Q,json:{write:{target:"layerDefinition.drawingInfo.renderer",ignoreOrigin:!0}}})],l.prototype,"renderer",null),i([F("service","renderer",["drawingInfo.renderer","subtypeField","type"])],l.prototype,"readRendererFromService",null),i([F("renderer",["layerDefinition.drawingInfo.renderer"])],l.prototype,"readRenderer",null),i([n({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],l.prototype,"subtypeCode",void 0),i([n({type:[U],json:{name:"layerDefinition.templates",write:{ignoreOrigin:!0}}})],l.prototype,"templates",void 0),i([F("service","templates",["geometryType","subtypeField","subtypes","type"])],l.prototype,"readTemplatesFromService",null),i([n({type:String,json:{write:{ignoreOrigin:!0}}})],l.prototype,"title",void 0),i([F("service","title",["subtypes"])],l.prototype,"readTitleFromService",null),i([n({type:Boolean,nonNullable:!0,json:{name:"visibility",write:{ignoreOrigin:!0}}})],l.prototype,"visible",void 0),l=i([P(yt)],l);const T=l,h="SubtypeGroupLayer",ct="esri.layers.SubtypeGroupLayer";function k(e,t){return new j("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}const x=A();let d=class extends fe(ge(ve(we($e(je(Fe(Oe(Se(q(Ie(Te(R(st))))))))))))){constructor(...e){super(...e),this._handles=new _e,this._sublayersCollectionChanged=!1,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.subtypes=null,this.sublayers=new(E.ofType(T)),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this.addHandles(xe(()=>this.sublayers,(t,r)=>this._handleSublayersChange(t,r),Ee))}destroy(){var e;(e=this.source)==null||e.destroy(),this._handles=Pe(this._handles)}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=L(e)?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(Ce).then(async()=>{if(!this.url)throw new j("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(this.layerId==null)throw new j("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))}).then(()=>this.finishLoadEditablePortalLayer(e));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){var e;return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),((e=this._get("createQueryVersion"))!=null?e:0)+1}get editingEnabled(){return this.loaded&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get parsedUrl(){const e=Le(this.url);return e!=null&&this.layerId!=null&&(e.path=Ge(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?De(this.url,t):t}async addAttachment(e,t){return Ve(this,e,t,h)}async updateAttachment(e,t,r){return ke(this,e,t,r,h)}async applyEdits(e,t){return Ne(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await Re(qe(()=>import("./FeatureLayerSource.99e97c87.js"),["assets/FeatureLayerSource.99e97c87.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/clientSideDefaults.f5f7bfa0.js","assets/QueryEngineCapabilities.78217f95.js","assets/executeForIds.bade5c1b.js"]),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=Me(this),t=this.sublayers.map(r=>r.subtypeCode);return e.where=Ue(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){return Ae(this,e,t,h)}async fetchRecomputedExtents(e){return Qe(this,e,h)}getFieldDomain(e,t){return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}async queryAttachments(e,t){return Je(this,e,t,h)}async queryFeatures(e,t){var u;const r=await this.load(),o=(u=Be.from(e))!=null?u:r.createQuery(),s=He(o.outFields,[]);s.includes(this.subtypeField)||(s.push(this.subtypeField),o.outFields=s);const a=await r.source.queryFeatures(o,t);if(a!=null&&a.features)for(const p of a.features)p.layer=this._findSublayerForFeature(p),p.sourceLayer=this;return a}async queryObjectIds(e,t){return ze(this,e,t,h)}async queryFeatureCount(e,t){return Xe(this,e,t,h)}async queryExtent(e,t){return Ze(this,e,t,h)}async queryRelatedFeatures(e,t){return We(this,e,t,h)}async queryRelatedFeaturesCount(e,t){return Ye(this,e,t,h)}write(e,t){var a;const{origin:r,layerContainerType:o,messages:s}=t;if(this.isTable){if(r==="web-scene"||r==="web-map"&&o!=="tables")return s==null||s.push(k(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&r==="web-map"&&o==="tables")return s==null||s.push(k(this,"using a non-table source cannot be written to tables in web maps")),null;return(a=this.sublayers)!=null&&a.length?super.write(e,t):(s==null||s.push(new j("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&Ke(this,e)}_findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.sublayers.find(o=>o.subtypeCode===r)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){var r;this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),this.isTable)throw new j("subtype-grouplayer:unsupported-source","SubtypeGroupLayer cannot be created using a layer with table source");if(!((r=this.subtypes)!=null&&r.length))throw new j("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),et(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return tt(this)}_verifyFields(){var t,r,o;const e=(r=(t=this.parsedUrl)==null?void 0:t.path)!=null?r:"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||e.search(/\/FeatureServer\//i)!==-1||((o=this.fields)==null?void 0:o.some(s=>s.type==="geometry"))||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach(r=>{r.parent=null}),this.handles.remove("sublayers-owner")),e&&(e.forEach(r=>{r.parent=this}),this._sublayersCollectionChanged=!1,this.handles.add([e.on("after-add",({item:r})=>{r.parent=this}),e.on("after-remove",({item:r})=>{r.parent=null}),e.on("after-changes",()=>{this._sublayersCollectionChanged=!0})],"sublayers-owner"))}};i([n({readOnly:!0})],d.prototype,"createQueryVersion",null),i([n({type:Boolean,readOnly:!0})],d.prototype,"editingEnabled",null),i([n({...x.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],d.prototype,"fields",void 0),i([n(x.fieldsIndex)],d.prototype,"fieldsIndex",void 0),i([n(rt)],d.prototype,"id",void 0),i([n({type:["show","hide","hide-children"]})],d.prototype,"listMode",void 0),i([n({value:"SubtypeGroupLayer",type:["SubtypeGroupLayer"]})],d.prototype,"operationalLayerType",void 0),i([n(x.outFields)],d.prototype,"outFields",void 0),i([n({readOnly:!0})],d.prototype,"parsedUrl",null),i([n()],d.prototype,"source",null),i([n({type:[nt],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],d.prototype,"subtypes",void 0),i([n({type:E.ofType(T),json:{origins:{service:{read:{source:"subtypes",reader:(e,t,r)=>{const o=e.map(({code:s})=>{const a=new T({subtypeCode:s});return a.read(t,r),a});return new(E.ofType(T))(o)}}}},name:"layers",write:{overridePolicy(e,t,r){const o=this.originOf("sublayers"),s=M.PORTAL_ITEM;let a=!0;if(G(o)===s&&G(r.origin)>s){const u=e.some(p=>p.hasUserOverrides());a=this._sublayersCollectionChanged||u}return{enabled:a,ignoreOrigin:!0}}}}})],d.prototype,"sublayers",void 0),i([n({type:it})],d.prototype,"timeInfo",void 0),i([n({json:{origins:{"portal-item":{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],d.prototype,"title",void 0),i([F("service","title",["name"])],d.prototype,"readTitleFromService",null),i([n({json:{read:!1}})],d.prototype,"type",void 0),d=i([P(ct)],d);const mt=d;export{mt as default}; +import{a6 as i,a7 as n,d2 as F,e0 as N,a8 as P,cx as z,jR as X,jP as Z,a4 as R,eH as q,aP as W,b4 as $,hV as Y,iN as K,dx as C,c as L,id as ee,e8 as M,jS as te,iP as re,iQ as ie,iR as se,iE as ne,jO as oe,jN as ae,ig as le,dv as ue,iV as U,jT as de,j8 as pe,j6 as ye,ih as A,jU as ce,jV as he,jW as me,hT as be,jX as fe,jI as ge,i2 as ve,iM as we,i3 as $e,ia as je,eE as Fe,eF as Oe,eG as Se,iJ as Ie,il as Te,au as _e,cE as E,_ as xe,dz as Ee,f5 as Pe,aU as Ce,n as j,bX as Le,eP as Ge,iq as De,jY as Ve,jZ as ke,j_ as Ne,cO as Re,at as qe,j$ as Me,c4 as Ue,k0 as Ae,k1 as Qe,k2 as Je,dd as Be,bd as He,k3 as ze,k4 as Xe,k5 as Ze,k6 as We,k7 as Ye,i_ as Ke,iO as et,k8 as tt,ip as rt,jh as G,gv as it,cF as st}from"./index.221827cd.js";let b=class extends z{constructor(){super(...arguments),this.code=null,this.defaultValues={},this.domains=null,this.name=null}readDomains(e){if(!e)return null;const t={};for(const r of Object.keys(e))t[r]=X(e[r]);return t}writeDomains(e,t){var o;if(!e)return;const r={};for(const s of Object.keys(e))e[s]&&(r[s]=(o=e[s])==null?void 0:o.toJSON());t.domains=r}};i([n({type:Number,json:{write:!0}})],b.prototype,"code",void 0),i([n({type:Object,json:{write:!0}})],b.prototype,"defaultValues",void 0),i([n({json:{write:!0}})],b.prototype,"domains",void 0),i([F("domains")],b.prototype,"readDomains",null),i([N("domains")],b.prototype,"writeDomains",null),i([n({type:String,json:{write:!0}})],b.prototype,"name",void 0),b=i([P("esri.layers.support.Subtype")],b);const nt=b,ot=["charts","editingEnabled","formTemplate","labelsVisible","labelingInfo","legendEnabled","minScale","maxScale","opacity","popupEnabled","popupTemplate","renderer","subtypeCode","templates","title","visible"],Q={key:"type",base:de,errorContext:"renderer",typeMap:{simple:C,"unique-value":pe,"class-breaks":ye}},D=A(),V=Z({types:Q});let at=0;function S(e){const t=e.json.write;return typeof t=="object"?t.ignoreOrigin=!0:e.json.write={ignoreOrigin:!0},e}function lt(e){return new C({symbol:ut(e)})}function ut(e){switch(e){case"point":case"multipoint":return me.clone();case"polyline":return he.clone();case"polygon":case"multipatch":return ce.clone();default:return null}}function dt(e,t){return!!t&&(e==null?void 0:e.type)==="unique-value"&&typeof e.field=="string"&&e.field.toLowerCase()===t.toLowerCase()&&!e.field2&&!e.field3&&!e.valueExpression}function J(e,t){var r;return e==null?null:(r=t.subtypes)==null?void 0:r.find(o=>o.code===e)}function pt(e,t){let r=null;switch(t.geometryType){case"esriGeometryPoint":case"esriGeometryMultipoint":r="point";break;case"esriGeometryPolyline":r="line";break;case"esriGeometryPolygon":case"esriGeometryMultiPatch":r="polygon";break;default:t.type,r=null}const o={},s=J(e,t);if(L(s)){const{defaultValues:a}=s;for(const u in a)o[u]=a[u]}return o[t.subtypeField]=e,new U({name:"New Feature",drawingTool:r,prototype:{attributes:o}})}const yt="esri.layers.support.SubtypeSublayer";let l=class extends R(q(W(be))){constructor(e){super(e),this.charts=null,this.editingEnabled=!0,this.fieldOverrides=null,this.fieldsIndex=null,this.formTemplate=null,this.id=`${Date.now().toString(16)}-subtype-sublayer-${at++}`,this.type="subtype-sublayer",this.labelsVisible=!0,this.labelingInfo=null,this.layerType="ArcGISFeatureLayer",this.legendEnabled=!0,this.listMode="show",this.minScale=0,this.maxScale=0,this.opacity=1,this.popupEnabled=!0,this.popupTemplate=null,this.subtypeCode=null,this.templates=null,this.title=null,this.visible=!0}writeFieldOverrides(e,t,r){const{fields:o,parent:s}=this;let a;if(o){a=[];let u=0;o.forEach(({name:p,alias:m,editable:f,visible:v})=>{var g;if(!v)return;const c=(g=s==null?void 0:s.fields)==null?void 0:g.find(O=>O.name===p);if(!c)return;const w={name:p};let y=!1;m!==c.alias&&(w.alias=m,y=!0),f!==c.editable&&(w.editable=f,y=!0),a.push(w),y&&u++}),u===0&&a.length===o.length&&(a=null)}else a=$(e);a!=null&&a.length&&Y(r,a,t)}get fields(){var v,c;const{parent:e,fieldOverrides:t,subtypeCode:r}=this,o=e==null?void 0:e.fields;if(!(o!=null&&o.length))return null;const{subtypes:s,subtypeField:a}=e,u=s.find(w=>w.code===r),p=u==null?void 0:u.defaultValues,m=u==null?void 0:u.domains,f=[];for(const w of o){const y=w.clone(),{name:g}=y,O=t==null?void 0:t.find(I=>I.name===g);if(y.visible=!t||!!O,O){const{alias:I,editable:H}=O;I&&(y.alias=I),H===!1&&(y.editable=!1)}const B=(v=p==null?void 0:p[g])!=null?v:null;y.defaultValue=g===a?r:B;const _=(c=m==null?void 0:m[g])!=null?c:null;y.domain=g===a?null:_?_.type==="inherited"?y.domain:_.clone():null,f.push(y)}return f}get effectiveScaleRange(){const{minScale:e,maxScale:t}=this;return{minScale:e,maxScale:t}}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){K(e,this.fieldsIndex),this._override("renderer",e)}get renderer(){if(this._isOverridden("renderer"))return this._get("renderer");const{parent:e}=this;return e&&!e.isTable&&e.geometryType!=="mesh"?lt(e.geometryType):null}readRendererFromService(e,t,r){var p,m,f;if(t.type==="Table")return null;const o=(p=t.drawingInfo)==null?void 0:p.renderer,s=V(o,t,r);let a;const{subtypeCode:u}=this;if(u!=null&&dt(s,t.subtypeField)){const v=(m=s.uniqueValueInfos)==null?void 0:m.find(({value:c})=>(c=typeof c=="number"?String(c):c)===String(u));v&&(a=new C({symbol:v.symbol}))}else(s==null?void 0:s.type)!=="simple"||((f=s.visualVariables)==null?void 0:f.length)||(a=s);return a}readRenderer(e,t,r){var s,a,u;const o=(a=(s=t==null?void 0:t.layerDefinition)==null?void 0:s.drawingInfo)==null?void 0:a.renderer;if(o&&!((u=o.visualVariables)!=null&&u.length))return V(o,t,r)||void 0}readTemplatesFromService(e,t){return[pt(this.subtypeCode,t)]}readTitleFromService(e,t){const r=J(this.subtypeCode,t);return L(r)?r.name:null}createPopupTemplate(e){let t=this;const{parent:r,fields:o,title:s}=this;if(r){const{displayField:a,editFieldsInfo:u,objectIdField:p}=r;t={displayField:a,editFieldsInfo:u,fields:o,objectIdField:p,title:s}}return ee(t,e)}getField(e){return this.fieldsIndex.get(e)}getFieldDomain(e){return this._getLayerDomain(e)}hasUserOverrides(){return ot.some(e=>this.originIdOf(e)===M.USER)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}};i([n({json:{write:{ignoreOrigin:!0}}})],l.prototype,"charts",void 0),i([n({type:Boolean,nonNullable:!0,json:{name:"enableEditing",write:{ignoreOrigin:!0}}})],l.prototype,"editingEnabled",void 0),i([n({readOnly:!0,json:{name:"layerDefinition.fieldOverrides",origins:{service:{read:!1}},write:{ignoreOrigin:!0,allowNull:!0}}})],l.prototype,"fieldOverrides",void 0),i([N("fieldOverrides")],l.prototype,"writeFieldOverrides",null),i([n({...D.fields,readOnly:!0,json:{read:!1}})],l.prototype,"fields",null),i([n(D.fieldsIndex)],l.prototype,"fieldsIndex",void 0),i([n({type:te,json:{name:"formInfo",write:{ignoreOrigin:!0}}})],l.prototype,"formTemplate",void 0),i([n({type:String,readOnly:!0,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],l.prototype,"id",void 0),i([n({readOnly:!0,json:{read:!1}})],l.prototype,"type",void 0),i([n(S($(re)))],l.prototype,"labelsVisible",void 0),i([n({type:[ie],json:{name:"layerDefinition.drawingInfo.labelingInfo",origins:{service:{read:!1}},read:{reader:se},write:{ignoreOrigin:!0}}})],l.prototype,"labelingInfo",void 0),i([n({type:["ArcGISFeatureLayer"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],l.prototype,"layerType",void 0),i([n(S($(ne)))],l.prototype,"legendEnabled",void 0),i([n({type:["show","hide"]})],l.prototype,"listMode",void 0),i([n((()=>{const e=$(oe);return e.json.origins.service.read=!1,S(e)})())],l.prototype,"minScale",void 0),i([n((()=>{const e=$(ae);return e.json.origins.service.read=!1,S(e)})())],l.prototype,"maxScale",void 0),i([n({readOnly:!0})],l.prototype,"effectiveScaleRange",null),i([n({type:Number,range:{min:0,max:1},nonNullable:!0,json:{write:{ignoreOrigin:!0}}})],l.prototype,"opacity",void 0),i([n()],l.prototype,"parent",void 0),i([n(S($(le)))],l.prototype,"popupEnabled",void 0),i([n({type:ue,json:{name:"popupInfo",write:{ignoreOrigin:!0}}})],l.prototype,"popupTemplate",void 0),i([n({readOnly:!0})],l.prototype,"defaultPopupTemplate",null),i([n({types:Q,json:{write:{target:"layerDefinition.drawingInfo.renderer",ignoreOrigin:!0}}})],l.prototype,"renderer",null),i([F("service","renderer",["drawingInfo.renderer","subtypeField","type"])],l.prototype,"readRendererFromService",null),i([F("renderer",["layerDefinition.drawingInfo.renderer"])],l.prototype,"readRenderer",null),i([n({type:Number,json:{origins:{service:{read:!1}},write:{ignoreOrigin:!0}}})],l.prototype,"subtypeCode",void 0),i([n({type:[U],json:{name:"layerDefinition.templates",write:{ignoreOrigin:!0}}})],l.prototype,"templates",void 0),i([F("service","templates",["geometryType","subtypeField","subtypes","type"])],l.prototype,"readTemplatesFromService",null),i([n({type:String,json:{write:{ignoreOrigin:!0}}})],l.prototype,"title",void 0),i([F("service","title",["subtypes"])],l.prototype,"readTitleFromService",null),i([n({type:Boolean,nonNullable:!0,json:{name:"visibility",write:{ignoreOrigin:!0}}})],l.prototype,"visible",void 0),l=i([P(yt)],l);const T=l,h="SubtypeGroupLayer",ct="esri.layers.SubtypeGroupLayer";function k(e,t){return new j("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}const x=A();let d=class extends fe(ge(ve(we($e(je(Fe(Oe(Se(q(Ie(Te(R(st))))))))))))){constructor(...e){super(...e),this._handles=new _e,this._sublayersCollectionChanged=!1,this.fields=null,this.fieldsIndex=null,this.outFields=null,this.subtypes=null,this.sublayers=new(E.ofType(T)),this.timeInfo=null,this.title="Layer",this.type="subtype-group",this.addHandles(xe(()=>this.sublayers,(t,r)=>this._handleSublayersChange(t,r),Ee))}destroy(){var e;(e=this.source)==null||e.destroy(),this._handles=Pe(this._handles)}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){const t=L(e)?e.signal:null,r=this.loadFromPortal({supportedTypes:["Feature Service"]},e).catch(Ce).then(async()=>{if(!this.url)throw new j("subtype-grouplayer:missing-url-or-source","SubtypeGroupLayer must be created with either a url or a portal item");if(this.layerId==null)throw new j("subtype-grouplayer:missing-layerid","layerId is required for a SubtypeGroupLayer created with url");return this._initLayerProperties(await this.createGraphicsSource(t))}).then(()=>this.finishLoadEditablePortalLayer(e));return this.addResolvingPromise(r),Promise.resolve(this)}get createQueryVersion(){var e;return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),((e=this._get("createQueryVersion"))!=null?e:0)+1}get editingEnabled(){return this.loaded&&this.capabilities.operations.supportsEditing&&this.userHasEditingPrivileges}get parsedUrl(){const e=Le(this.url);return e!=null&&this.layerId!=null&&(e.path=Ge(e.path,this.layerId.toString())),e}set source(e){this._get("source")!==e&&this._set("source",e)}readTitleFromService(e,{name:t}){return this.url?De(this.url,t):t}async addAttachment(e,t){return Ve(this,e,t,h)}async updateAttachment(e,t,r){return ke(this,e,t,r,h)}async applyEdits(e,t){return Ne(this,e,t)}on(e,t){return super.on(e,t)}async createGraphicsSource(e){const{default:t}=await Re(qe(()=>import("./FeatureLayerSource.98dc2955.js"),["assets/FeatureLayerSource.98dc2955.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/clientSideDefaults.d40b9315.js","assets/QueryEngineCapabilities.78217f95.js","assets/executeForIds.9f78e2a6.js"]),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=Me(this),t=this.sublayers.map(r=>r.subtypeCode);return e.where=Ue(`${this.subtypeField} IN (${t.join(",")})`,this.definitionExpression),e}async deleteAttachments(e,t){return Ae(this,e,t,h)}async fetchRecomputedExtents(e){return Qe(this,e,h)}getFieldDomain(e,t){return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}async queryAttachments(e,t){return Je(this,e,t,h)}async queryFeatures(e,t){var u;const r=await this.load(),o=(u=Be.from(e))!=null?u:r.createQuery(),s=He(o.outFields,[]);s.includes(this.subtypeField)||(s.push(this.subtypeField),o.outFields=s);const a=await r.source.queryFeatures(o,t);if(a!=null&&a.features)for(const p of a.features)p.layer=this._findSublayerForFeature(p),p.sourceLayer=this;return a}async queryObjectIds(e,t){return ze(this,e,t,h)}async queryFeatureCount(e,t){return Xe(this,e,t,h)}async queryExtent(e,t){return Ze(this,e,t,h)}async queryRelatedFeatures(e,t){return We(this,e,t,h)}async queryRelatedFeaturesCount(e,t){return Ye(this,e,t,h)}write(e,t){var a;const{origin:r,layerContainerType:o,messages:s}=t;if(this.isTable){if(r==="web-scene"||r==="web-map"&&o!=="tables")return s==null||s.push(k(this,"using a table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&r==="web-map"&&o==="tables")return s==null||s.push(k(this,"using a non-table source cannot be written to tables in web maps")),null;return(a=this.sublayers)!=null&&a.length?super.write(e,t):(s==null||s.push(new j("web-document-write:invalid-property",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' has invalid value for 'sublayers' property. 'sublayers' collection should contain at least one sublayer`,{layer:this})),null)}serviceSupportsSpatialReference(e){return!!this.loaded&&Ke(this,e)}_findSublayerForFeature(e){const t=this.fieldsIndex.get(this.subtypeField),r=e.attributes[t.name];return this.sublayers.find(o=>o.subtypeCode===r)}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}async _initLayerProperties(e){var r;this._set("source",e);const{sourceJSON:t}=e;if(t&&(this.sourceJSON=t,this.read(t,{origin:"service",url:this.parsedUrl})),this.isTable)throw new j("subtype-grouplayer:unsupported-source","SubtypeGroupLayer cannot be created using a layer with table source");if(!((r=this.subtypes)!=null&&r.length))throw new j("subtype-grouplayer:missing-subtypes","SubtypeGroupLayer must be created using a layer with subtypes");this._verifyFields(),et(this.timeInfo,this.fieldsIndex)}async hasDataChanged(){return tt(this)}_verifyFields(){var t,r,o;const e=(r=(t=this.parsedUrl)==null?void 0:t.path)!=null?r:"undefined";this.objectIdField||console.log("SubtypeGroupLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||e.search(/\/FeatureServer\//i)!==-1||((o=this.fields)==null?void 0:o.some(s=>s.type==="geometry"))||console.log("SubtypeGroupLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_handleSublayersChange(e,t){t&&(t.forEach(r=>{r.parent=null}),this.handles.remove("sublayers-owner")),e&&(e.forEach(r=>{r.parent=this}),this._sublayersCollectionChanged=!1,this.handles.add([e.on("after-add",({item:r})=>{r.parent=this}),e.on("after-remove",({item:r})=>{r.parent=null}),e.on("after-changes",()=>{this._sublayersCollectionChanged=!0})],"sublayers-owner"))}};i([n({readOnly:!0})],d.prototype,"createQueryVersion",null),i([n({type:Boolean,readOnly:!0})],d.prototype,"editingEnabled",null),i([n({...x.fields,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],d.prototype,"fields",void 0),i([n(x.fieldsIndex)],d.prototype,"fieldsIndex",void 0),i([n(rt)],d.prototype,"id",void 0),i([n({type:["show","hide","hide-children"]})],d.prototype,"listMode",void 0),i([n({value:"SubtypeGroupLayer",type:["SubtypeGroupLayer"]})],d.prototype,"operationalLayerType",void 0),i([n(x.outFields)],d.prototype,"outFields",void 0),i([n({readOnly:!0})],d.prototype,"parsedUrl",null),i([n()],d.prototype,"source",null),i([n({type:[nt],readOnly:!0,json:{read:!1,origins:{service:{read:!0}}}})],d.prototype,"subtypes",void 0),i([n({type:E.ofType(T),json:{origins:{service:{read:{source:"subtypes",reader:(e,t,r)=>{const o=e.map(({code:s})=>{const a=new T({subtypeCode:s});return a.read(t,r),a});return new(E.ofType(T))(o)}}}},name:"layers",write:{overridePolicy(e,t,r){const o=this.originOf("sublayers"),s=M.PORTAL_ITEM;let a=!0;if(G(o)===s&&G(r.origin)>s){const u=e.some(p=>p.hasUserOverrides());a=this._sublayersCollectionChanged||u}return{enabled:a,ignoreOrigin:!0}}}}})],d.prototype,"sublayers",void 0),i([n({type:it})],d.prototype,"timeInfo",void 0),i([n({json:{origins:{"portal-item":{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0}}}}})],d.prototype,"title",void 0),i([F("service","title",["name"])],d.prototype,"readTitleFromService",null),i([n({json:{read:!1}})],d.prototype,"type",void 0),d=i([P(ct)],d);const mt=d;export{mt as default}; diff --git a/assets/SubtypeGroupLayerView2D.e026c935.js b/assets/SubtypeGroupLayerView2D.e28062ee.js similarity index 62% rename from assets/SubtypeGroupLayerView2D.e026c935.js rename to assets/SubtypeGroupLayerView2D.e28062ee.js index e7cf1bf..10953ed 100644 --- a/assets/SubtypeGroupLayerView2D.e026c935.js +++ b/assets/SubtypeGroupLayerView2D.e28062ee.js @@ -1 +1 @@ -import{a6 as o,a8 as n,_ as p,$ as y,c as m,d9 as u}from"./index.d94abe07.js";import d from"./FeatureLayerView2D.c0de0a56.js";import"./utils.4b023c9d.js";import"./Utils.7f6f3a6b.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.229b1dd6.js";import"./LayerView.42d17220.js";import"./schemaUtils.69ad92d2.js";import"./visualVariablesUtils.aff73e6d.js";import"./createSymbolSchema.e54d2060.js";import"./ExpandedCIM.f0b7f36d.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.0d428d19.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.df11258c.js";import"./util.ab699fea.js";import"./floorFilterUtils.05eb8c6a.js";import"./popupUtils.4abb3ffd.js";import"./RefreshableLayerView.28a00159.js";function h(e,r){return!e.visible||e.minScale!==0&&r>e.minScale||e.maxScale!==0&&r{var e;return(e=this.view)==null?void 0:e.viewpoint},()=>this._update(),y)])}_injectOverrides(e){let r=super._injectOverrides(e);const s=this.view.scale,t=this.layer.sublayers.filter(a=>h(a,s)).map(a=>a.subtypeCode);if(!t.length)return r;r=m(r)?r:new u().toJSON();const i=`NOT ${this.layer.subtypeField} IN (${t.join(",")})`;return r.where=r.where?`(${r.where}) AND (${i})`:i,r}_setLayersForFeature(e){const r=this.layer.fieldsIndex.get(this.layer.subtypeField),s=e.attributes[r.name],t=this.layer.sublayers.find(i=>i.subtypeCode===s);e.layer=t,e.sourceLayer=this.layer}_createSchemaConfig(){const e={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers).map(i=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:i.labelingInfo,labelsVisible:i.labelsVisible,renderer:i.renderer,subtypeCode:i.subtypeCode,orderBy:null}))},r=this.layer.sublayers.map(i=>i.subtypeCode).join(","),s=this.layer.sublayers.length?`${this.layer.subtypeField} IN (${r})`:"1=2";let t=this.layer.definitionExpression?this.layer.definitionExpression+" AND ":"";return t+=s,{...super._createSchemaConfig(),...e,definitionExpression:t}}};l=o([n("esri.views.2d.layers.SubtypeGroupLayerView2D")],l);const z=l;export{z as default}; +import{a6 as o,a8 as n,_ as p,$ as y,c as m,d9 as u}from"./index.221827cd.js";import d from"./FeatureLayerView2D.7c1a650d.js";import"./utils.0160becb.js";import"./Utils.2136650a.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.0cadabc1.js";import"./LayerView.ce6e0535.js";import"./schemaUtils.d20994fa.js";import"./visualVariablesUtils.62efda9d.js";import"./createSymbolSchema.827eb617.js";import"./ExpandedCIM.a372ce74.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.7ff797cc.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.3f71f8e9.js";import"./util.520a352e.js";import"./floorFilterUtils.05eb8c6a.js";import"./popupUtils.c6371f3a.js";import"./RefreshableLayerView.887ed8c3.js";function h(e,r){return!e.visible||e.minScale!==0&&r>e.minScale||e.maxScale!==0&&r{var e;return(e=this.view)==null?void 0:e.viewpoint},()=>this._update(),y)])}_injectOverrides(e){let r=super._injectOverrides(e);const s=this.view.scale,t=this.layer.sublayers.filter(a=>h(a,s)).map(a=>a.subtypeCode);if(!t.length)return r;r=m(r)?r:new u().toJSON();const i=`NOT ${this.layer.subtypeField} IN (${t.join(",")})`;return r.where=r.where?`(${r.where}) AND (${i})`:i,r}_setLayersForFeature(e){const r=this.layer.fieldsIndex.get(this.layer.subtypeField),s=e.attributes[r.name],t=this.layer.sublayers.find(i=>i.subtypeCode===s);e.layer=t,e.sourceLayer=this.layer}_createSchemaConfig(){const e={subtypeField:this.layer.subtypeField,sublayers:Array.from(this.layer.sublayers).map(i=>({featureReduction:null,geometryType:this.layer.geometryType,labelingInfo:i.labelingInfo,labelsVisible:i.labelsVisible,renderer:i.renderer,subtypeCode:i.subtypeCode,orderBy:null}))},r=this.layer.sublayers.map(i=>i.subtypeCode).join(","),s=this.layer.sublayers.length?`${this.layer.subtypeField} IN (${r})`:"1=2";let t=this.layer.definitionExpression?this.layer.definitionExpression+" AND ":"";return t+=s,{...super._createSchemaConfig(),...e,definitionExpression:t}}};l=o([n("esri.views.2d.layers.SubtypeGroupLayerView2D")],l);const z=l;export{z as default}; diff --git a/assets/SymbolProcessor.179a3ae5.js b/assets/SymbolProcessor.1465a4e3.js similarity index 90% rename from assets/SymbolProcessor.179a3ae5.js rename to assets/SymbolProcessor.1465a4e3.js index b99e718..bd10c51 100644 --- a/assets/SymbolProcessor.179a3ae5.js +++ b/assets/SymbolProcessor.1465a4e3.js @@ -1 +1 @@ -import{x as C,a6 as F,a8 as K,c3 as $,ek as T,v as _,aT as E,bc as v,j as M,c as I,ba as L,u as A}from"./index.d94abe07.js";import{n as P}from"./ExpandedCIM.f0b7f36d.js";import{p as O}from"./visualVariablesUtils.32e27706.js";import{S as U}from"./Utils.7f6f3a6b.js";import{x as z,l as x,b as B,E as j,t as H}from"./Matcher.fe0c3dcf.js";import{p as J}from"./BaseProcessor.fe0bade4.js";import"./BidiEngine.d8bba3fc.js";import"./enums.0295eb81.js";import"./MaterialKey.229b1dd6.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.0d428d19.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.df11258c.js";import"./visualVariablesUtils.aff73e6d.js";import"./enums.2d9e6f64.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./tileUtils.44921ab9.js";import"./TileClipper.8c399a8a.js";import"./Geometry.d049a63c.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./devEnvironmentUtils.d8d0484c.js";class N{constructor(e){this._remoteClient=e,this._resourceMap=new Map,this._inFlightResourceMap=new Map,this.geometryEngine=null}destroy(){}async fetchResource(e,r){const s=this._resourceMap,i=s.get(e);if(i)return i;let a=this._inFlightResourceMap.get(e);if(a)return a;try{a=this._remoteClient.invoke("tileRenderer.fetchResource",{url:e},{...r}),this._inFlightResourceMap.set(e,a),a.then(o=>(this._inFlightResourceMap.delete(e),s.set(e,o),o))}catch(o){return C(o)?null:{width:0,height:0}}return a}getResource(e){var r;return(r=this._resourceMap.get(e))!=null?r:null}}function k(t,e){return(!t.minScale||t.minScale>=e)&&(!t.maxScale||t.maxScale<=e)}function D(t){const e=t.message,r={message:{data:{},tileKey:e.tileKey,tileKeyOrigin:e.tileKeyOrigin,version:e.version},transferList:new Array};for(const s in e.data){const i=e.data[s];if(r.message.data[s]=null,I(i)){const a=i.stride,o=i.indices.slice(0),l=i.vertices.slice(0),c=i.records.slice(0),d={stride:a,indices:o,vertices:l,records:c,metrics:v(i.metrics,h=>h.slice(0))};r.transferList.push(o,l,c),r.message.data[s]=d}}return r}let S=class extends J{constructor(){super(...arguments),this.type="symbol",this._matchers={feature:null,aggregate:null},this._bufferData=new Map,this._bufferIds=new Map}initialize(){this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this))]),this._resourceManagerProxy=new N(this.remoteClient)}destroy(){this._resourceManagerProxy.destroy()}get supportsTileUpdates(){return!0}forEachBufferId(t){this._bufferIds.forEach(e=>{e.forEach(t)})}async update(t,e){const r=e.schema.processors[0];if(r.type!=="symbol")return;const s=$(this._schema,r);(T(s,"mesh")||T(s,"target"))&&(t.mesh=!0,t.why.mesh.push("Symbology changed"),this._schema=r,this._factory=this._createFactory(r),this._factory.update(r,this.tileStore.tileScheme.tileInfo))}onTileMessage(t,e,r,s){return _(s),this._onTileData(t,e,r,s)}onTileClear(t){const e={clear:!0};return this._bufferData.delete(t.key.id),this._bufferIds.delete(t.key.id),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:t.id,data:e})}onTileError(t,e,r){const s=r.signal,i={tileKey:t.id,error:e};return this.remoteClient.invoke("tileRenderer.onTileError",i,{signal:s})}onTileUpdate(t){for(const e of t.removed)this._bufferData.has(e.key.id)&&this._bufferData.delete(e.key.id),this._bufferIds.has(e.key.id)&&this._bufferIds.delete(e.key.id);for(const e of t.added)this._bufferData.forEach(r=>{for(const s of r)s.message.tileKey===e.id&&this._updateTileMesh("append",e,D(s),[],!1,!1,null)})}_addBufferData(t,e){this._bufferData.has(t)||this._bufferData.set(t,[]),this._bufferData.get(t).push(D(e))}_createFactory(t){const{geometryType:e,objectIdField:r,fields:s}=this.service,i=(d,h)=>this.remoteClient.invoke("tileRenderer.getMaterialItems",d,h),a={geometryType:e,fields:s,spatialReference:E.fromJSON(this.spatialReference)},o=new z(i,this.tileStore.tileScheme.tileInfo),{matcher:l,aggregateMatcher:c}=t.mesh;return this._store=o,this._matchers.feature=x(l,o,a,this._resourceManagerProxy),this._matchers.aggregate=v(c,d=>x(d,o,a,this._resourceManagerProxy)),new B(e,r,o)}async _onTileData(t,e,r,s){_(s);const{type:i,addOrUpdate:a,remove:o,clear:l,end:c}=e,d=!!this._schema.mesh.sortKey;if(!a){const u={type:i,addOrUpdate:null,remove:o,clear:l,end:c,sort:d};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:t.id,data:u},s)}const h=this._processFeatures(t,a,r,s,e.status.version);try{const u=await h;if(M(u)){const n={type:i,addOrUpdate:null,remove:o,clear:l,end:c,sort:d};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:t.id,data:n},s)}const m=[];for(const n of u){let f=!1;const g=n.message.bufferIds,p=t.key.id,b=n.message.tileKey;if(p!==b&&I(g)){if(!this.tileStore.get(b)){this._addBufferData(p,n),m.push(n);continue}let y=this._bufferIds.get(b);y||(y=new Set,this._bufferIds.set(b,y));const R=Array.from(g);for(const w of R){if(y.has(w)){f=!0;break}y.add(w)}}f||(this._addBufferData(p,n),m.push(n))}await Promise.all(m.map(n=>{const f=t.key.id===n.message.tileKey,g=f?e.remove:[],p=f&&e.end;return this._updateTileMesh(i,t,n,g,p,e.clear,s.signal)}))}catch(u){this._handleError(t,u,s)}}async _updateTileMesh(t,e,r,s,i,a,o){const l=t,c=r.message.tileKey,d=!!this._schema.mesh.sortKey;c!==e.key.id&&(i=!1);const h=v(r,f=>f.message),u=v(r,f=>f.transferList)||[],m={type:l,addOrUpdate:h,remove:s,clear:a,end:i,sort:d},n={transferList:A(u)||[],signal:o};return _(n),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:c,data:m},n)}async _processFeatures(t,e,r,s,i){if(M(e)||!e.hasFeatures)return null;const a={transform:t.transform,hasZ:!1,hasM:!1},o=this._factory,l={viewingMode:"",scale:t.scale},c=await this._matchers.feature,d=await this._matchers.aggregate;_(s);const h=this._getLabelInfos(t,e);return await o.analyze(e.getCursor(),this._resourceManagerProxy,c,d,a,l),_(s),this._writeFeatureSet(t,e,a,h,o,r,i)}_writeFeatureSet(t,e,r,s,i,a,o){const l=e.getSize(),c=this._schema.mesh.matcher.symbologyType,d=new j(t.key.id,{features:l,records:l,metrics:0},c,a,c!==U.HEATMAP,o),h={viewingMode:"",scale:t.scale},u=e.getCursor();for(;u.next();)try{const n=u.getDisplayId(),f=I(s)?s.get(n):null;i.writeCursor(d,u,r,h,t.level,f,this._resourceManagerProxy)}catch{}const m=t.tileInfoView.tileInfo.isWrappable;return d.serialize(m)}_handleError(t,e,r){if(!C(e)){const s={tileKey:t.id,error:e.message};return this.remoteClient.invoke("tileRenderer.onTileError",s,{signal:r.signal})}}_getLabelingSchemaForScale(t){const e=this._schema.mesh.labels;if(M(e))return null;if(e.type==="subtype"){const s={type:"subtype",classes:{}};let i=!1;for(const a in e.classes){const o=e.classes[a].filter(l=>k(l,t.scale));i=i||!!o.length,s.classes[a]=o}return i?s:null}const r=e.classes.filter(s=>k(s,t.scale));return r.length?{type:"simple",classes:r}:null}_getLabels(t,e){var r;if(e.type==="subtype"){const s=this.service.subtypeField,i=L(s,"Expected to find subtype Field"),a=t.readAttribute(i);return a==null?[]:(r=e.classes[a])!=null?r:[]}return e.classes}_getLabelInfos(t,e){const r=this._getLabelingSchemaForScale(t);if(M(r))return null;const s=new Map,i=e.getCursor();for(;i.next();){const a=i.getDisplayId(),o=[],l=O(a),c=l&&i.readAttribute("cluster_count")!==1?"aggregate":"feature",d=this._getLabels(i,r);for(const h of d){if(h.target!==c)continue;const u=i.getStorage(),m=l&&c==="feature"?u.getComputedStringAtIndex(i.readAttribute("referenceId"),h.fieldIndex):u.getComputedStringAtIndex(a,h.fieldIndex);if(!m)continue;const n=P(m.toString()),f=n[0],g=n[1];this._store.getMosaicItem(h.symbol,H(f)).then(p=>{o[h.index]={glyphs:p.glyphMosaicItems,rtl:g,index:h.index}})}s.set(a,o)}return s}};S=F([K("esri.views.2d.layers.features.processors.SymbolProcessor")],S);const pe=S;export{pe as default}; +import{x as C,a6 as F,a8 as K,c3 as $,ek as T,v as _,aT as E,bc as v,j as M,c as I,ba as L,u as A}from"./index.221827cd.js";import{n as P}from"./ExpandedCIM.a372ce74.js";import{p as O}from"./visualVariablesUtils.061b7a4e.js";import{S as U}from"./Utils.2136650a.js";import{x as z,l as x,b as B,E as j,t as H}from"./Matcher.6586928a.js";import{p as J}from"./BaseProcessor.f4010bc0.js";import"./BidiEngine.d8bba3fc.js";import"./enums.0295eb81.js";import"./MaterialKey.0cadabc1.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.7ff797cc.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.3f71f8e9.js";import"./visualVariablesUtils.62efda9d.js";import"./enums.2d9e6f64.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./tileUtils.332711ed.js";import"./TileClipper.77103a2e.js";import"./Geometry.d049a63c.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./devEnvironmentUtils.d8d0484c.js";class N{constructor(e){this._remoteClient=e,this._resourceMap=new Map,this._inFlightResourceMap=new Map,this.geometryEngine=null}destroy(){}async fetchResource(e,r){const s=this._resourceMap,i=s.get(e);if(i)return i;let a=this._inFlightResourceMap.get(e);if(a)return a;try{a=this._remoteClient.invoke("tileRenderer.fetchResource",{url:e},{...r}),this._inFlightResourceMap.set(e,a),a.then(o=>(this._inFlightResourceMap.delete(e),s.set(e,o),o))}catch(o){return C(o)?null:{width:0,height:0}}return a}getResource(e){var r;return(r=this._resourceMap.get(e))!=null?r:null}}function k(t,e){return(!t.minScale||t.minScale>=e)&&(!t.maxScale||t.maxScale<=e)}function D(t){const e=t.message,r={message:{data:{},tileKey:e.tileKey,tileKeyOrigin:e.tileKeyOrigin,version:e.version},transferList:new Array};for(const s in e.data){const i=e.data[s];if(r.message.data[s]=null,I(i)){const a=i.stride,o=i.indices.slice(0),l=i.vertices.slice(0),c=i.records.slice(0),d={stride:a,indices:o,vertices:l,records:c,metrics:v(i.metrics,h=>h.slice(0))};r.transferList.push(o,l,c),r.message.data[s]=d}}return r}let S=class extends J{constructor(){super(...arguments),this.type="symbol",this._matchers={feature:null,aggregate:null},this._bufferData=new Map,this._bufferIds=new Map}initialize(){this.handles.add([this.tileStore.on("update",this.onTileUpdate.bind(this))]),this._resourceManagerProxy=new N(this.remoteClient)}destroy(){this._resourceManagerProxy.destroy()}get supportsTileUpdates(){return!0}forEachBufferId(t){this._bufferIds.forEach(e=>{e.forEach(t)})}async update(t,e){const r=e.schema.processors[0];if(r.type!=="symbol")return;const s=$(this._schema,r);(T(s,"mesh")||T(s,"target"))&&(t.mesh=!0,t.why.mesh.push("Symbology changed"),this._schema=r,this._factory=this._createFactory(r),this._factory.update(r,this.tileStore.tileScheme.tileInfo))}onTileMessage(t,e,r,s){return _(s),this._onTileData(t,e,r,s)}onTileClear(t){const e={clear:!0};return this._bufferData.delete(t.key.id),this._bufferIds.delete(t.key.id),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:t.id,data:e})}onTileError(t,e,r){const s=r.signal,i={tileKey:t.id,error:e};return this.remoteClient.invoke("tileRenderer.onTileError",i,{signal:s})}onTileUpdate(t){for(const e of t.removed)this._bufferData.has(e.key.id)&&this._bufferData.delete(e.key.id),this._bufferIds.has(e.key.id)&&this._bufferIds.delete(e.key.id);for(const e of t.added)this._bufferData.forEach(r=>{for(const s of r)s.message.tileKey===e.id&&this._updateTileMesh("append",e,D(s),[],!1,!1,null)})}_addBufferData(t,e){this._bufferData.has(t)||this._bufferData.set(t,[]),this._bufferData.get(t).push(D(e))}_createFactory(t){const{geometryType:e,objectIdField:r,fields:s}=this.service,i=(d,h)=>this.remoteClient.invoke("tileRenderer.getMaterialItems",d,h),a={geometryType:e,fields:s,spatialReference:E.fromJSON(this.spatialReference)},o=new z(i,this.tileStore.tileScheme.tileInfo),{matcher:l,aggregateMatcher:c}=t.mesh;return this._store=o,this._matchers.feature=x(l,o,a,this._resourceManagerProxy),this._matchers.aggregate=v(c,d=>x(d,o,a,this._resourceManagerProxy)),new B(e,r,o)}async _onTileData(t,e,r,s){_(s);const{type:i,addOrUpdate:a,remove:o,clear:l,end:c}=e,d=!!this._schema.mesh.sortKey;if(!a){const u={type:i,addOrUpdate:null,remove:o,clear:l,end:c,sort:d};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:t.id,data:u},s)}const h=this._processFeatures(t,a,r,s,e.status.version);try{const u=await h;if(M(u)){const n={type:i,addOrUpdate:null,remove:o,clear:l,end:c,sort:d};return this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:t.id,data:n},s)}const m=[];for(const n of u){let f=!1;const g=n.message.bufferIds,p=t.key.id,b=n.message.tileKey;if(p!==b&&I(g)){if(!this.tileStore.get(b)){this._addBufferData(p,n),m.push(n);continue}let y=this._bufferIds.get(b);y||(y=new Set,this._bufferIds.set(b,y));const R=Array.from(g);for(const w of R){if(y.has(w)){f=!0;break}y.add(w)}}f||(this._addBufferData(p,n),m.push(n))}await Promise.all(m.map(n=>{const f=t.key.id===n.message.tileKey,g=f?e.remove:[],p=f&&e.end;return this._updateTileMesh(i,t,n,g,p,e.clear,s.signal)}))}catch(u){this._handleError(t,u,s)}}async _updateTileMesh(t,e,r,s,i,a,o){const l=t,c=r.message.tileKey,d=!!this._schema.mesh.sortKey;c!==e.key.id&&(i=!1);const h=v(r,f=>f.message),u=v(r,f=>f.transferList)||[],m={type:l,addOrUpdate:h,remove:s,clear:a,end:i,sort:d},n={transferList:A(u)||[],signal:o};return _(n),this.remoteClient.invoke("tileRenderer.onTileData",{tileKey:c,data:m},n)}async _processFeatures(t,e,r,s,i){if(M(e)||!e.hasFeatures)return null;const a={transform:t.transform,hasZ:!1,hasM:!1},o=this._factory,l={viewingMode:"",scale:t.scale},c=await this._matchers.feature,d=await this._matchers.aggregate;_(s);const h=this._getLabelInfos(t,e);return await o.analyze(e.getCursor(),this._resourceManagerProxy,c,d,a,l),_(s),this._writeFeatureSet(t,e,a,h,o,r,i)}_writeFeatureSet(t,e,r,s,i,a,o){const l=e.getSize(),c=this._schema.mesh.matcher.symbologyType,d=new j(t.key.id,{features:l,records:l,metrics:0},c,a,c!==U.HEATMAP,o),h={viewingMode:"",scale:t.scale},u=e.getCursor();for(;u.next();)try{const n=u.getDisplayId(),f=I(s)?s.get(n):null;i.writeCursor(d,u,r,h,t.level,f,this._resourceManagerProxy)}catch{}const m=t.tileInfoView.tileInfo.isWrappable;return d.serialize(m)}_handleError(t,e,r){if(!C(e)){const s={tileKey:t.id,error:e.message};return this.remoteClient.invoke("tileRenderer.onTileError",s,{signal:r.signal})}}_getLabelingSchemaForScale(t){const e=this._schema.mesh.labels;if(M(e))return null;if(e.type==="subtype"){const s={type:"subtype",classes:{}};let i=!1;for(const a in e.classes){const o=e.classes[a].filter(l=>k(l,t.scale));i=i||!!o.length,s.classes[a]=o}return i?s:null}const r=e.classes.filter(s=>k(s,t.scale));return r.length?{type:"simple",classes:r}:null}_getLabels(t,e){var r;if(e.type==="subtype"){const s=this.service.subtypeField,i=L(s,"Expected to find subtype Field"),a=t.readAttribute(i);return a==null?[]:(r=e.classes[a])!=null?r:[]}return e.classes}_getLabelInfos(t,e){const r=this._getLabelingSchemaForScale(t);if(M(r))return null;const s=new Map,i=e.getCursor();for(;i.next();){const a=i.getDisplayId(),o=[],l=O(a),c=l&&i.readAttribute("cluster_count")!==1?"aggregate":"feature",d=this._getLabels(i,r);for(const h of d){if(h.target!==c)continue;const u=i.getStorage(),m=l&&c==="feature"?u.getComputedStringAtIndex(i.readAttribute("referenceId"),h.fieldIndex):u.getComputedStringAtIndex(a,h.fieldIndex);if(!m)continue;const n=P(m.toString()),f=n[0],g=n[1];this._store.getMosaicItem(h.symbol,H(f)).then(p=>{o[h.index]={glyphs:p.glyphMosaicItems,rtl:g,index:h.index}})}s.set(a,o)}return s}};S=F([K("esri.views.2d.layers.features.processors.SymbolProcessor")],S);const pe=S;export{pe as default}; diff --git a/assets/SymbolTileRenderer.a57bd090.js b/assets/SymbolTileRenderer.5a8a4597.js similarity index 95% rename from assets/SymbolTileRenderer.a57bd090.js rename to assets/SymbolTileRenderer.5a8a4597.js index b34fca2..c397b74 100644 --- a/assets/SymbolTileRenderer.a57bd090.js +++ b/assets/SymbolTileRenderer.5a8a4597.js @@ -1,4 +1,4 @@ -import{c as l,j as f,bc as y,ba as Y,f5 as M,bo as K,m as b,bd as v,K as D,a6 as O,a8 as X,x as H,ay as Z}from"./index.d94abe07.js";import{s as L}from"./CircularArray.a4d7e1c2.js";import{h as A,b as G,I as B}from"./Utils.7f6f3a6b.js";import{i as U,m as N,o as W}from"./FeatureContainer.4ca52b51.js";import{a as x,i as j,e as J}from"./BufferPool.ff53b3f4.js";import{E as S,a as Q}from"./VertexArrayObject.a4c1d809.js";import{F as P}from"./enums.2d9e6f64.js";import{n as ee}from"./schemaUtils.69ad92d2.js";import{o as te}from"./BaseTileRenderer.5cd35765.js";import{b as se}from"./visualVariablesUtils.32e27706.js";import{c as _}from"./WGLContainer.1850619d.js";import"./enums.0295eb81.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./TileContainer.8b7fafe2.js";import"./utils.4b023c9d.js";import"./MaterialKey.229b1dd6.js";import"./visualVariablesUtils.aff73e6d.js";import"./createSymbolSchema.e54d2060.js";import"./ExpandedCIM.f0b7f36d.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.0d428d19.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.df11258c.js";import"./util.ab699fea.js";import"./pixelUtils.82950e1a.js";import"./ProgramTemplate.e9a5aa54.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";const g=6,V=4294967296;class C{constructor(e){this._savedCursor=null,this._savedOffset=null,this._head=e,this._cursor=e}static from(e){const t=E.from(new Float32Array(e));return new C(t)}get id(){return this._cursor.id}get baseZoom(){return this._cursor.baseZoom}get anchorX(){return this._cursor.anchorX}get anchorY(){return this._cursor.anchorY}get directionX(){return this._cursor.directionX}get directionY(){return this._cursor.directionY}get size(){return this._cursor.size}get materialKey(){return this._cursor.materialKey}get boundsCount(){return this._cursor.boundsCount}computedMinZoom(){return this._cursor.computedMinZoom()}setComputedMinZoom(e){return this._cursor.setComputedMinZoom(e)}boundsComputedAnchorX(e){return this._cursor.boundsComputedAnchorX(e)}boundsComputedAnchorY(e){return this._cursor.boundsComputedAnchorY(e)}setBoundsComputedAnchorX(e,t){return this._cursor.setBoundsComputedAnchorX(e,t)}setBoundsComputedAnchorY(e,t){return this._cursor.setBoundsComputedAnchorY(e,t)}boundsX(e){return this._cursor.boundsX(e)}boundsY(e){return this._cursor.boundsY(e)}boundsWidth(e){return this._cursor.boundsWidth(e)}boundsHeight(e){return this._cursor.boundsHeight(e)}link(e){if(l(e._head))return this._cursor.link(e._head)}getCursor(){return this.copy()}copy(){var r;const e=new C((r=this._head)==null?void 0:r.copy());if(!e._head)return e;let t=e._head,s=e._head._link;for(;s;)t._link=s.copy(),t=s,s=t._link;return e}peekId(){var e;return(e=this._cursor.peekId())!=null?e:this._cursor._link.peekId()}nextId(){const e=this.id;for(;e===this.id;)if(!this.next())return!1;return!0}save(){this._savedCursor=this._cursor,this._savedOffset=this._cursor._offset}restore(){this._savedCursor&&(this._cursor=this._savedCursor),this._savedOffset!=null&&(this._cursor._offset=this._savedOffset)}next(){if(!this._cursor)return!1;if(!this._cursor.next()){if(!this._cursor._link)return!1;this._cursor=this._cursor._link,this._cursor._offset=0}return!0}lookup(e){for(this._cursor=this._head;this._cursor&&!this._cursor.lookup(e);){if(!this._cursor._link)return!1;this._cursor=this._cursor._link}return!!this._cursor}delete(e){let t=this._head,s=null;for(;t;){if(t.delete(e))return t.isEmpty()&&l(s)&&(s._link=t._link),!0;s=t,t=t._link}return!1}}class E{constructor(e){this._offset=-1,this._link=null,this._count=0,this._deletedCount=0,this._offsets={instance:null},this._buffer=e}static from(e){return new E(new Float32Array(e))}isEmpty(){return this._deletedCount===this.count}get count(){return this._count||(this._count=this._computeCount()),this._count}get id(){return this._buffer[this._offset+0]}set id(e){this._buffer[this._offset+0]=e}get baseZoom(){return this._buffer[this._offset+1]}get anchorX(){return this._buffer[this._offset+2]}get anchorY(){return this._buffer[this._offset+3]}get directionX(){return this._buffer[this._offset+4]}get directionY(){return this._buffer[this._offset+5]}get size(){return this._buffer[this._offset+6]}get materialKey(){return this._buffer[this._offset+7]}computedMinZoom(){return this._buffer[this._offset+8]}setComputedMinZoom(e){this._buffer[this._offset+8]=e}get boundsCount(){return this._buffer[this._offset+9]}boundsComputedAnchorX(e){return this._buffer[this._offset+10+e*g+0]}boundsComputedAnchorY(e){return this._buffer[this._offset+10+e*g+1]}setBoundsComputedAnchorX(e,t){this._buffer[this._offset+10+e*g+0]=t}setBoundsComputedAnchorY(e,t){this._buffer[this._offset+10+e*g+1]=t}boundsX(e){return this._buffer[this._offset+10+e*g+2]}boundsY(e){return this._buffer[this._offset+10+e*g+3]}boundsWidth(e){return this._buffer[this._offset+10+e*g+4]}boundsHeight(e){return this._buffer[this._offset+10+e*g+5]}link(e){let t=this;for(;t._link;)t=t._link;t._link=e}getCursor(){return this.copy()}copy(){const e=new E(this._buffer);return e._link=this._link,e._offset=this._offset,e._deletedCount=this._deletedCount,e._offsets=this._offsets,e._count=this._count,e}peekId(){const e=this._offset+10+this.boundsCount*g+0;return e>=this._buffer.length?0:this._buffer[e]}next(){let e=0;for(;this._offsete.dispose()),this._gpu=null}_invalidateTriangleBuffer(){y(this._gpuComputeTriangles,e=>e.dispose()),this._gpuComputeTriangles=null}destroy(){y(this._gpu,e=>e.dispose()),y(this._gpuComputeTriangles,e=>e.dispose()),y(this._cpu,e=>e.destroy()),y(this._cpu2,e=>e.destroy())}clear(){this.dirty.start=1/0,this.dirty.end=0,this.freeList=new J({start:0,end:this._cpu.length/this.strideInt}),this.fillPointer=0}ensure(e){if(!(this.maxAvailableSpace()>=e)&&e*this.strideInt>this._cpu.length-this.fillPointer){this.invalidate();const t=this._cpu.length/this.strideInt,s=Math.round((t+e)*re),r=s*this.strideInt;this._cpu.expand(r*Uint32Array.BYTES_PER_ELEMENT),this.freeList.free(t,s-t)}}set(e,t){this._cpu.array[e]!==t&&(this._cpu.array[e]=t,this.dirty.start=Math.min(e,this.dirty.start),this.dirty.end=Math.max(e,this.dirty.end))}getGPUBuffer(e,t=!1){if(!this.bufferSize)return null;if(t){if(this.bufferType!=="index")throw new Error("Tired to get triangle buffer, but target is not an index buffer");return f(this._gpuComputeTriangles)&&(this._gpuComputeTriangles=this._createComputeBuffer(e)),this._gpuComputeTriangles}return f(this._gpu)&&(this._gpu=this._createBuffer(e)),this._gpu}getCPUBuffer(){if(!this._cpu2){const e=this._cpu.slice();this._cpu2=e}return this._cpu2.length!==this._cpu.length&&this._cpu2.expand(this._cpu.length*this._cpu.array.BYTES_PER_ELEMENT),this._cpu2.set(this._cpu),this._cpu2}get bufferSize(){return this._cpu.length/this.strideInt}maxAvailableSpace(){return this.freeList.maxAvailableSpace()}insert(e,t,s,r){const i=s*this.strideInt;if(!i)return 0;const n=t*this.strideInt*Uint32Array.BYTES_PER_ELEMENT,a=new Uint32Array(e,n,i),o=Y(this.freeList.firstFit(s),"First fit region must be defined")*this.strideInt,d=i,u=o/this.strideInt-t;if(r!==0)for(let c=0;c{p.indexFrom+=c,p.vertexFrom+=u}),Y(this._records,"Expected records to be defined").link(d),t)this._indicesInvalid=!0;else if(this._displayList){const p=d.getCursor();for(;p.next();)this._displayList.addRecord(p)}}else{const i=e.indices.byteLength/4,n=e.vertices.byteLength/r,a=r/Uint32Array.BYTES_PER_ELEMENT,o=this._stage.bufferPool;this._records=U.from(e.records),this._indexBuffer=new $("index",i,1,o),this._vertexBuffer=new $("vertex",n,a,o),this._indexBuffer.insert(e.indices,0,e.indices.byteLength/4,0),this._vertexBuffer.insert(e.vertices,0,e.vertices.byteLength/r,0),t&&(this._indicesInvalid=!0)}}remove(e){if(!f(this._records))for(const t of e){const s=this._records.getCursor();if(!s.lookup(t))continue;const r=s.indexFrom,i=s.vertexFrom;let n=s.indexCount,a=s.vertexCount;for(;s.next()&&s.id===t;)n+=s.indexCount,a+=s.vertexCount;this._indexBuffer.free(r,n),this._vertexBuffer.free(i,a,!0),this._records.delete(t)}}getVAO(e,t,s,r){if(!this._vertexBuffer||!this._indexBuffer||f(this._records)||!this._vertexBuffer.bufferSize)return null;const i=r?he:ne;let n=this._vaos.get(i);(this._vertexBuffer.invalidated||this._indexBuffer.invalidated||r&&this._indexBuffer.invalidatedComputeBuffer)&&(y(n,d=>d.dispose(!1)),n=null),this._vertexBuffer.upload(),this._indexBuffer.upload();const a=this._indexBuffer.getGPUBuffer(e,i===1),o=this._vertexBuffer.getGPUBuffer(e);return n||(n=new Q(e,s,t,{geometry:o},a),this._vaos.set(i,n)),n}forEachCommand(e){if(!f(this._records)){if(this._sortIndices(this._records),!this._displayList){const t=this._cursorIndexOrder;this._displayList=I.from(this,this.geometryType,this._records.getCursor(),t)}this._displayList.forEach(e)}}_sortIndices(e){const t=!!this._indexBuffer.bufferSize;if(!this._indicesInvalid)return;this._indicesInvalid=!1;let s=0;const r=e.getCursor(),i=[],n=[],a=[];for(;r.next();)n.push(r.index),a.push(r.sortKey),i.push(r.id);n.sort((u,c)=>{const p=a[c],m=a[u];return m===p?i[c]-i[u]:p-m});const o=e.getCursor(),d=t?this._indexBuffer.getCPUBuffer():this._vertexBuffer.getCPUBuffer();for(const u of n){if(!o.seekIndex(u))throw new Error("Expected to find index");if(t){const{indexFrom:c,indexCount:p}=o;o.indexFrom=s;for(let m=0;me.destroy()),l(this._renderState.next)&&this._renderState.next.geometry.forEach(e=>e.destroy()),this._renderState.current=null,this._renderState.next=null}get labelMetrics(){return this._renderState.current.metrics}get hasData(){return!!this._renderState.current.geometry.size}getGeometry(e){return this._renderState.current.geometry.get(e)}patch(e,t){this.patchCount++,e.clear&&this._patches.size>=oe&&this._dropPatches();const s=e,r=s.addOrUpdate&&this.key.id!==s.addOrUpdate.tileKeyOrigin;t&&r?this._bufferPatches.enqueue(s):(s.sort=s.sort&&!t,this._patches.enqueue(s)),this.requestRender()}commit(e){if(this._lastCommitTime!==e.time){this._lastCommitTime=e.time;for(let t=0;te.destroy()),this._renderState.current=this._renderState.next,this._renderState.next=null,this._requestLabelUpdate()))}_flushUpdates(){let e=this._patches.maxSize;for(;this._patches.size&&e--;)this._updateMesh(),this._swap()}_updateBufferMesh(){const e=this._bufferPatches.peek();if(!l(e)||!e.clear||this._renderState.next===null)for(;this._bufferPatches.size;){const t=this._bufferPatches.dequeue();l(t)&&this._patchBuffer(t)}}_updateMesh(){var t,s,r,i;const e=this._patches.dequeue();if(l(e)){if(b("esri-2d-update-debug")){const n=e,a=(t=n.addOrUpdate)==null?void 0:t.tileKeyOrigin,o=this.key.id===a?"SELF":a;let d="";for(let u=0;u<5;u++)d+=(i=(r=(s=n.addOrUpdate)==null?void 0:s.data[u])==null?void 0:r.records)!=null&&i.byteLength?1:0;console.debug(this.key.id,"FeatureTile:patch",`[clear: ${n.clear} origin: ${o}, end:${n.end} data:${d}]`)}e.clear===!0&&(l(this._renderState.next)&&(this._renderState.next.geometry.forEach(n=>n.destroy()),this._renderState.next=null),this._renderState.next={geometry:new Map,metrics:null},b("esri-2d-update-debug")&&console.debug(this.key.id,"FeatureTile:_updateMesh - Creating new renderState")),this.requestRender(),this._patch(e),e.end&&(b("esri-2d-update-debug")&&console.debug(this.key.id,"FeatureTile:_updateMesh - Encountered end message"),this.ready(),this._swapRenderStates())}}_patch(e){A(t=>{this._remove(t,e.remove),this._insert(t,e,!1)})}_patchBuffer(e){A(t=>{this._insert(t,e,!0)})}_insert(e,t,s){var r;try{const i=v(this._renderState.next,this._renderState.current),n=(r=t.addOrUpdate)==null?void 0:r.data[e],a=i.geometry;if(f(n))return;a.has(e)||(b("esri-2d-update-debug")&&console.debug(this.key.id,`FeatureTile:_insert - Creating geometry buffer ${e}`),a.set(e,new ae(e,this.stage))),b("esri-2d-update-debug")&&console.debug(this.key.id,`FeatureTile:_insert - Inserting into ${e}, version=${t.addOrUpdate.version} stride=${n.stride}`),a.get(e).insert(n,t.sort,s),e===G.LABEL&&this._insertLabelMetrics(t.type,n.metrics,t.clear)}catch{}}_insertLabelMetrics(e,t,s){const r=v(this._renderState.next,this._renderState.current);if(f(t))return;const i=C.from(t);if(f(r.metrics))r.metrics=i;else{if(e==="update"){const n=i.getCursor();for(;n.next();)r.metrics.delete(n.id)}r.metrics.link(i)}}_remove(e,t){const s=v(this._renderState.next,this._renderState.current).geometry.get(e);t&&t.length&&s&&(s.remove(t),this._removeLabelMetrics(t))}_removeLabelMetrics(e){const{metrics:t}=v(this._renderState.next,this._renderState.current);if(!f(t)&&e.length)for(const s of e)for(;t.delete(s););}_dropPatches(){const e=new Array;let t=!1;for(;this._patches.size;){const s=this._patches.dequeue();if(f(s))break;if(s.clear){if(t)break;t=!0}e.push(s)}this._patches.clear(),e.forEach(s=>this._patches.enqueue(s))}}const le=b("featurelayer-order-by-server-enabled");class ce extends W{constructor(e,t,s,r){super(e),this._hitTestsRequests=[],this._layer=s,this._layerView=t,this._onUpdate=r}renderChildren(e){this.attributeView.update(),this.hasAnimation&&e.painter.effects.integrate.draw(e,e.attributeView),super.renderChildren(e)}hasEmptyAttributeView(){return this.attributeView.isEmpty()}isUpdating(){return this.attributeView.isUpdating()}hitTest(e){let t=this._hitTestsRequests.find(({x:r,y:i})=>r===e.x&&i===e.y);const s=D();return t?t.resolvers.push(s):(t={x:e.x,y:e.y,resolvers:[s]},this._hitTestsRequests.push(t)),this.requestRender(),s.promise}onTileData(e,t){const s=le&&"orderBy"in this._layer&&this._layer.orderBy,r=(s==null?void 0:s.length)&&!s[0].valueExpression&&s[0].field,i=s&&this._layerView.orderByFields===r;e.patch(t,i),this.contains(e)||this.addChild(e),this.requestRender()}onTileError(e){this.contains(e)||this.addChild(e)}updateTransitionProperties(e,t){super.updateTransitionProperties(e,t),this._layerView.featureEffectView.transitionStep(e,t),this._layerView.featureEffectView.transitioning&&this.requestRender()}doRender(e){const{minScale:t,maxScale:s}=this._layer,r=e.state.scale;r<=(t||1/0)&&r>=s&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}onAttributeStoreUpdate(){this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this._onUpdate()}get hasAnimation(){return this.hasLabels}setStencilReference(e){const{rendererSchema:t}=e.rendererInfo;if((t==null?void 0:t.type)==="dot-density"&&(t==null?void 0:t.dotSize)>1||(t==null?void 0:t.type)==="heatmap")for(const r of this.children)r.stencilRef=r.key.level+1;else super.setStencilReference(e)}get hasLabels(){if("sublayers"in this._layer)return this._layer.sublayers.some(s=>s.labelingInfo&&s.labelingInfo.length&&s.labelsVisible);const e=this._layer.featureReduction,t=e&&"labelingInfo"in e&&e.labelsVisible&&e.labelingInfo&&e.labelingInfo.length;return this._layer.labelingInfo&&this._layer.labelingInfo.length&&this._layer.labelsVisible||!!t}prepareRenderPasses(e){const t=e.registerRenderPass({name:"label",brushes:[_.label],target:()=>this.hasLabels?this.children:null,drawPhase:B.LABEL|B.LABEL_ALPHA}),s=e.registerRenderPass({name:"geometry",brushes:[_.fill,_.dotDensity,_.line,_.marker,_.heatmap,_.pieChart,_.text],target:()=>this.children,enableDefaultDraw:()=>!this._layerView.featureEffectView.hasEffects,effects:[{apply:e.effects.outsideEffect,enable:()=>this._layerView.featureEffectView.hasEffects,args:()=>this._layerView.featureEffectView.excludedEffects},{apply:e.effects.insideEffect,enable:()=>this._layerView.featureEffectView.hasEffects,args:()=>this._layerView.featureEffectView.includedEffects},{apply:e.effects.hittest,enable:()=>!!this._hitTestsRequests.length,args:()=>this._hitTestsRequests}]}),r=e.registerRenderPass({name:"highlight",brushes:[_.fill,_.dotDensity,_.line,_.marker,_.pieChart,_.text],target:()=>this.children,drawPhase:B.HIGHLIGHT,enableDefaultDraw:()=>!1,effects:[{apply:e.effects.highlight,enable:()=>!!this._layerView.hasHighlight()}]});return[...super.prepareRenderPasses(e),s,r,t]}}let k=class extends te{constructor(){super(...arguments),this.type="symbol"}install(h){const e=()=>this.notifyChange("updating"),t=new ce(this.tileInfoView,this.layerView,this.layer,e);this.featuresView=t,h.addChild(t)}uninstall(h){h.removeChild(this.featuresView),this.featuresView.destroy(),this.featuresView=null}fetchResource(h,e){const{url:t}=h,s=this.featuresView.stage;try{return s.resourceManager.fetchResource(t,{signal:e.signal})}catch(r){return H(r)?Promise.resolve({width:0,height:0}):Promise.reject(r)}}isUpdating(){var r;const h=super.isUpdating(),e=!this.featuresView||this.featuresView.isUpdating(),t=(r=this.featuresView)==null?void 0:r.hasEmptyAttributeView(),s=h||e||h&&t;return b("esri-2d-log-updating")&&console.log(`Updating SymbolTileRenderer ${s} +import{c as l,j as f,bc as y,ba as Y,f5 as M,bo as K,m as b,bd as v,K as D,a6 as O,a8 as X,x as H,ay as Z}from"./index.221827cd.js";import{s as L}from"./CircularArray.62f75f43.js";import{h as A,b as G,I as B}from"./Utils.2136650a.js";import{i as U,m as N,o as W}from"./FeatureContainer.b427dd87.js";import{a as x,i as j,e as J}from"./BufferPool.98277e4b.js";import{E as S,a as Q}from"./VertexArrayObject.53cf1857.js";import{F as P}from"./enums.2d9e6f64.js";import{n as ee}from"./schemaUtils.d20994fa.js";import{o as te}from"./BaseTileRenderer.f04a8f8b.js";import{b as se}from"./visualVariablesUtils.061b7a4e.js";import{c as _}from"./WGLContainer.347cc5cd.js";import"./enums.0295eb81.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./TileContainer.5aeb32d6.js";import"./utils.0160becb.js";import"./MaterialKey.0cadabc1.js";import"./visualVariablesUtils.62efda9d.js";import"./createSymbolSchema.827eb617.js";import"./ExpandedCIM.a372ce74.js";import"./BidiEngine.d8bba3fc.js";import"./Rect.95b0fd2e.js";import"./quantizationUtils.7ff797cc.js";import"./GeometryUtils.4f19e772.js";import"./floatRGBA.3f71f8e9.js";import"./util.520a352e.js";import"./pixelUtils.9c6f8dae.js";import"./ProgramTemplate.cf9dd4e8.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";const g=6,V=4294967296;class C{constructor(e){this._savedCursor=null,this._savedOffset=null,this._head=e,this._cursor=e}static from(e){const t=E.from(new Float32Array(e));return new C(t)}get id(){return this._cursor.id}get baseZoom(){return this._cursor.baseZoom}get anchorX(){return this._cursor.anchorX}get anchorY(){return this._cursor.anchorY}get directionX(){return this._cursor.directionX}get directionY(){return this._cursor.directionY}get size(){return this._cursor.size}get materialKey(){return this._cursor.materialKey}get boundsCount(){return this._cursor.boundsCount}computedMinZoom(){return this._cursor.computedMinZoom()}setComputedMinZoom(e){return this._cursor.setComputedMinZoom(e)}boundsComputedAnchorX(e){return this._cursor.boundsComputedAnchorX(e)}boundsComputedAnchorY(e){return this._cursor.boundsComputedAnchorY(e)}setBoundsComputedAnchorX(e,t){return this._cursor.setBoundsComputedAnchorX(e,t)}setBoundsComputedAnchorY(e,t){return this._cursor.setBoundsComputedAnchorY(e,t)}boundsX(e){return this._cursor.boundsX(e)}boundsY(e){return this._cursor.boundsY(e)}boundsWidth(e){return this._cursor.boundsWidth(e)}boundsHeight(e){return this._cursor.boundsHeight(e)}link(e){if(l(e._head))return this._cursor.link(e._head)}getCursor(){return this.copy()}copy(){var r;const e=new C((r=this._head)==null?void 0:r.copy());if(!e._head)return e;let t=e._head,s=e._head._link;for(;s;)t._link=s.copy(),t=s,s=t._link;return e}peekId(){var e;return(e=this._cursor.peekId())!=null?e:this._cursor._link.peekId()}nextId(){const e=this.id;for(;e===this.id;)if(!this.next())return!1;return!0}save(){this._savedCursor=this._cursor,this._savedOffset=this._cursor._offset}restore(){this._savedCursor&&(this._cursor=this._savedCursor),this._savedOffset!=null&&(this._cursor._offset=this._savedOffset)}next(){if(!this._cursor)return!1;if(!this._cursor.next()){if(!this._cursor._link)return!1;this._cursor=this._cursor._link,this._cursor._offset=0}return!0}lookup(e){for(this._cursor=this._head;this._cursor&&!this._cursor.lookup(e);){if(!this._cursor._link)return!1;this._cursor=this._cursor._link}return!!this._cursor}delete(e){let t=this._head,s=null;for(;t;){if(t.delete(e))return t.isEmpty()&&l(s)&&(s._link=t._link),!0;s=t,t=t._link}return!1}}class E{constructor(e){this._offset=-1,this._link=null,this._count=0,this._deletedCount=0,this._offsets={instance:null},this._buffer=e}static from(e){return new E(new Float32Array(e))}isEmpty(){return this._deletedCount===this.count}get count(){return this._count||(this._count=this._computeCount()),this._count}get id(){return this._buffer[this._offset+0]}set id(e){this._buffer[this._offset+0]=e}get baseZoom(){return this._buffer[this._offset+1]}get anchorX(){return this._buffer[this._offset+2]}get anchorY(){return this._buffer[this._offset+3]}get directionX(){return this._buffer[this._offset+4]}get directionY(){return this._buffer[this._offset+5]}get size(){return this._buffer[this._offset+6]}get materialKey(){return this._buffer[this._offset+7]}computedMinZoom(){return this._buffer[this._offset+8]}setComputedMinZoom(e){this._buffer[this._offset+8]=e}get boundsCount(){return this._buffer[this._offset+9]}boundsComputedAnchorX(e){return this._buffer[this._offset+10+e*g+0]}boundsComputedAnchorY(e){return this._buffer[this._offset+10+e*g+1]}setBoundsComputedAnchorX(e,t){this._buffer[this._offset+10+e*g+0]=t}setBoundsComputedAnchorY(e,t){this._buffer[this._offset+10+e*g+1]=t}boundsX(e){return this._buffer[this._offset+10+e*g+2]}boundsY(e){return this._buffer[this._offset+10+e*g+3]}boundsWidth(e){return this._buffer[this._offset+10+e*g+4]}boundsHeight(e){return this._buffer[this._offset+10+e*g+5]}link(e){let t=this;for(;t._link;)t=t._link;t._link=e}getCursor(){return this.copy()}copy(){const e=new E(this._buffer);return e._link=this._link,e._offset=this._offset,e._deletedCount=this._deletedCount,e._offsets=this._offsets,e._count=this._count,e}peekId(){const e=this._offset+10+this.boundsCount*g+0;return e>=this._buffer.length?0:this._buffer[e]}next(){let e=0;for(;this._offsete.dispose()),this._gpu=null}_invalidateTriangleBuffer(){y(this._gpuComputeTriangles,e=>e.dispose()),this._gpuComputeTriangles=null}destroy(){y(this._gpu,e=>e.dispose()),y(this._gpuComputeTriangles,e=>e.dispose()),y(this._cpu,e=>e.destroy()),y(this._cpu2,e=>e.destroy())}clear(){this.dirty.start=1/0,this.dirty.end=0,this.freeList=new J({start:0,end:this._cpu.length/this.strideInt}),this.fillPointer=0}ensure(e){if(!(this.maxAvailableSpace()>=e)&&e*this.strideInt>this._cpu.length-this.fillPointer){this.invalidate();const t=this._cpu.length/this.strideInt,s=Math.round((t+e)*re),r=s*this.strideInt;this._cpu.expand(r*Uint32Array.BYTES_PER_ELEMENT),this.freeList.free(t,s-t)}}set(e,t){this._cpu.array[e]!==t&&(this._cpu.array[e]=t,this.dirty.start=Math.min(e,this.dirty.start),this.dirty.end=Math.max(e,this.dirty.end))}getGPUBuffer(e,t=!1){if(!this.bufferSize)return null;if(t){if(this.bufferType!=="index")throw new Error("Tired to get triangle buffer, but target is not an index buffer");return f(this._gpuComputeTriangles)&&(this._gpuComputeTriangles=this._createComputeBuffer(e)),this._gpuComputeTriangles}return f(this._gpu)&&(this._gpu=this._createBuffer(e)),this._gpu}getCPUBuffer(){if(!this._cpu2){const e=this._cpu.slice();this._cpu2=e}return this._cpu2.length!==this._cpu.length&&this._cpu2.expand(this._cpu.length*this._cpu.array.BYTES_PER_ELEMENT),this._cpu2.set(this._cpu),this._cpu2}get bufferSize(){return this._cpu.length/this.strideInt}maxAvailableSpace(){return this.freeList.maxAvailableSpace()}insert(e,t,s,r){const i=s*this.strideInt;if(!i)return 0;const n=t*this.strideInt*Uint32Array.BYTES_PER_ELEMENT,a=new Uint32Array(e,n,i),o=Y(this.freeList.firstFit(s),"First fit region must be defined")*this.strideInt,d=i,u=o/this.strideInt-t;if(r!==0)for(let c=0;c{p.indexFrom+=c,p.vertexFrom+=u}),Y(this._records,"Expected records to be defined").link(d),t)this._indicesInvalid=!0;else if(this._displayList){const p=d.getCursor();for(;p.next();)this._displayList.addRecord(p)}}else{const i=e.indices.byteLength/4,n=e.vertices.byteLength/r,a=r/Uint32Array.BYTES_PER_ELEMENT,o=this._stage.bufferPool;this._records=U.from(e.records),this._indexBuffer=new $("index",i,1,o),this._vertexBuffer=new $("vertex",n,a,o),this._indexBuffer.insert(e.indices,0,e.indices.byteLength/4,0),this._vertexBuffer.insert(e.vertices,0,e.vertices.byteLength/r,0),t&&(this._indicesInvalid=!0)}}remove(e){if(!f(this._records))for(const t of e){const s=this._records.getCursor();if(!s.lookup(t))continue;const r=s.indexFrom,i=s.vertexFrom;let n=s.indexCount,a=s.vertexCount;for(;s.next()&&s.id===t;)n+=s.indexCount,a+=s.vertexCount;this._indexBuffer.free(r,n),this._vertexBuffer.free(i,a,!0),this._records.delete(t)}}getVAO(e,t,s,r){if(!this._vertexBuffer||!this._indexBuffer||f(this._records)||!this._vertexBuffer.bufferSize)return null;const i=r?he:ne;let n=this._vaos.get(i);(this._vertexBuffer.invalidated||this._indexBuffer.invalidated||r&&this._indexBuffer.invalidatedComputeBuffer)&&(y(n,d=>d.dispose(!1)),n=null),this._vertexBuffer.upload(),this._indexBuffer.upload();const a=this._indexBuffer.getGPUBuffer(e,i===1),o=this._vertexBuffer.getGPUBuffer(e);return n||(n=new Q(e,s,t,{geometry:o},a),this._vaos.set(i,n)),n}forEachCommand(e){if(!f(this._records)){if(this._sortIndices(this._records),!this._displayList){const t=this._cursorIndexOrder;this._displayList=I.from(this,this.geometryType,this._records.getCursor(),t)}this._displayList.forEach(e)}}_sortIndices(e){const t=!!this._indexBuffer.bufferSize;if(!this._indicesInvalid)return;this._indicesInvalid=!1;let s=0;const r=e.getCursor(),i=[],n=[],a=[];for(;r.next();)n.push(r.index),a.push(r.sortKey),i.push(r.id);n.sort((u,c)=>{const p=a[c],m=a[u];return m===p?i[c]-i[u]:p-m});const o=e.getCursor(),d=t?this._indexBuffer.getCPUBuffer():this._vertexBuffer.getCPUBuffer();for(const u of n){if(!o.seekIndex(u))throw new Error("Expected to find index");if(t){const{indexFrom:c,indexCount:p}=o;o.indexFrom=s;for(let m=0;me.destroy()),l(this._renderState.next)&&this._renderState.next.geometry.forEach(e=>e.destroy()),this._renderState.current=null,this._renderState.next=null}get labelMetrics(){return this._renderState.current.metrics}get hasData(){return!!this._renderState.current.geometry.size}getGeometry(e){return this._renderState.current.geometry.get(e)}patch(e,t){this.patchCount++,e.clear&&this._patches.size>=oe&&this._dropPatches();const s=e,r=s.addOrUpdate&&this.key.id!==s.addOrUpdate.tileKeyOrigin;t&&r?this._bufferPatches.enqueue(s):(s.sort=s.sort&&!t,this._patches.enqueue(s)),this.requestRender()}commit(e){if(this._lastCommitTime!==e.time){this._lastCommitTime=e.time;for(let t=0;te.destroy()),this._renderState.current=this._renderState.next,this._renderState.next=null,this._requestLabelUpdate()))}_flushUpdates(){let e=this._patches.maxSize;for(;this._patches.size&&e--;)this._updateMesh(),this._swap()}_updateBufferMesh(){const e=this._bufferPatches.peek();if(!l(e)||!e.clear||this._renderState.next===null)for(;this._bufferPatches.size;){const t=this._bufferPatches.dequeue();l(t)&&this._patchBuffer(t)}}_updateMesh(){var t,s,r,i;const e=this._patches.dequeue();if(l(e)){if(b("esri-2d-update-debug")){const n=e,a=(t=n.addOrUpdate)==null?void 0:t.tileKeyOrigin,o=this.key.id===a?"SELF":a;let d="";for(let u=0;u<5;u++)d+=(i=(r=(s=n.addOrUpdate)==null?void 0:s.data[u])==null?void 0:r.records)!=null&&i.byteLength?1:0;console.debug(this.key.id,"FeatureTile:patch",`[clear: ${n.clear} origin: ${o}, end:${n.end} data:${d}]`)}e.clear===!0&&(l(this._renderState.next)&&(this._renderState.next.geometry.forEach(n=>n.destroy()),this._renderState.next=null),this._renderState.next={geometry:new Map,metrics:null},b("esri-2d-update-debug")&&console.debug(this.key.id,"FeatureTile:_updateMesh - Creating new renderState")),this.requestRender(),this._patch(e),e.end&&(b("esri-2d-update-debug")&&console.debug(this.key.id,"FeatureTile:_updateMesh - Encountered end message"),this.ready(),this._swapRenderStates())}}_patch(e){A(t=>{this._remove(t,e.remove),this._insert(t,e,!1)})}_patchBuffer(e){A(t=>{this._insert(t,e,!0)})}_insert(e,t,s){var r;try{const i=v(this._renderState.next,this._renderState.current),n=(r=t.addOrUpdate)==null?void 0:r.data[e],a=i.geometry;if(f(n))return;a.has(e)||(b("esri-2d-update-debug")&&console.debug(this.key.id,`FeatureTile:_insert - Creating geometry buffer ${e}`),a.set(e,new ae(e,this.stage))),b("esri-2d-update-debug")&&console.debug(this.key.id,`FeatureTile:_insert - Inserting into ${e}, version=${t.addOrUpdate.version} stride=${n.stride}`),a.get(e).insert(n,t.sort,s),e===G.LABEL&&this._insertLabelMetrics(t.type,n.metrics,t.clear)}catch{}}_insertLabelMetrics(e,t,s){const r=v(this._renderState.next,this._renderState.current);if(f(t))return;const i=C.from(t);if(f(r.metrics))r.metrics=i;else{if(e==="update"){const n=i.getCursor();for(;n.next();)r.metrics.delete(n.id)}r.metrics.link(i)}}_remove(e,t){const s=v(this._renderState.next,this._renderState.current).geometry.get(e);t&&t.length&&s&&(s.remove(t),this._removeLabelMetrics(t))}_removeLabelMetrics(e){const{metrics:t}=v(this._renderState.next,this._renderState.current);if(!f(t)&&e.length)for(const s of e)for(;t.delete(s););}_dropPatches(){const e=new Array;let t=!1;for(;this._patches.size;){const s=this._patches.dequeue();if(f(s))break;if(s.clear){if(t)break;t=!0}e.push(s)}this._patches.clear(),e.forEach(s=>this._patches.enqueue(s))}}const le=b("featurelayer-order-by-server-enabled");class ce extends W{constructor(e,t,s,r){super(e),this._hitTestsRequests=[],this._layer=s,this._layerView=t,this._onUpdate=r}renderChildren(e){this.attributeView.update(),this.hasAnimation&&e.painter.effects.integrate.draw(e,e.attributeView),super.renderChildren(e)}hasEmptyAttributeView(){return this.attributeView.isEmpty()}isUpdating(){return this.attributeView.isUpdating()}hitTest(e){let t=this._hitTestsRequests.find(({x:r,y:i})=>r===e.x&&i===e.y);const s=D();return t?t.resolvers.push(s):(t={x:e.x,y:e.y,resolvers:[s]},this._hitTestsRequests.push(t)),this.requestRender(),s.promise}onTileData(e,t){const s=le&&"orderBy"in this._layer&&this._layer.orderBy,r=(s==null?void 0:s.length)&&!s[0].valueExpression&&s[0].field,i=s&&this._layerView.orderByFields===r;e.patch(t,i),this.contains(e)||this.addChild(e),this.requestRender()}onTileError(e){this.contains(e)||this.addChild(e)}updateTransitionProperties(e,t){super.updateTransitionProperties(e,t),this._layerView.featureEffectView.transitionStep(e,t),this._layerView.featureEffectView.transitioning&&this.requestRender()}doRender(e){const{minScale:t,maxScale:s}=this._layer,r=e.state.scale;r<=(t||1/0)&&r>=s&&super.doRender(e)}afterRender(e){super.afterRender(e),this._hitTestsRequests.length&&this.requestRender()}onAttributeStoreUpdate(){this.hasLabels&&this._layerView.view.labelManager.requestUpdate(),this._onUpdate()}get hasAnimation(){return this.hasLabels}setStencilReference(e){const{rendererSchema:t}=e.rendererInfo;if((t==null?void 0:t.type)==="dot-density"&&(t==null?void 0:t.dotSize)>1||(t==null?void 0:t.type)==="heatmap")for(const r of this.children)r.stencilRef=r.key.level+1;else super.setStencilReference(e)}get hasLabels(){if("sublayers"in this._layer)return this._layer.sublayers.some(s=>s.labelingInfo&&s.labelingInfo.length&&s.labelsVisible);const e=this._layer.featureReduction,t=e&&"labelingInfo"in e&&e.labelsVisible&&e.labelingInfo&&e.labelingInfo.length;return this._layer.labelingInfo&&this._layer.labelingInfo.length&&this._layer.labelsVisible||!!t}prepareRenderPasses(e){const t=e.registerRenderPass({name:"label",brushes:[_.label],target:()=>this.hasLabels?this.children:null,drawPhase:B.LABEL|B.LABEL_ALPHA}),s=e.registerRenderPass({name:"geometry",brushes:[_.fill,_.dotDensity,_.line,_.marker,_.heatmap,_.pieChart,_.text],target:()=>this.children,enableDefaultDraw:()=>!this._layerView.featureEffectView.hasEffects,effects:[{apply:e.effects.outsideEffect,enable:()=>this._layerView.featureEffectView.hasEffects,args:()=>this._layerView.featureEffectView.excludedEffects},{apply:e.effects.insideEffect,enable:()=>this._layerView.featureEffectView.hasEffects,args:()=>this._layerView.featureEffectView.includedEffects},{apply:e.effects.hittest,enable:()=>!!this._hitTestsRequests.length,args:()=>this._hitTestsRequests}]}),r=e.registerRenderPass({name:"highlight",brushes:[_.fill,_.dotDensity,_.line,_.marker,_.pieChart,_.text],target:()=>this.children,drawPhase:B.HIGHLIGHT,enableDefaultDraw:()=>!1,effects:[{apply:e.effects.highlight,enable:()=>!!this._layerView.hasHighlight()}]});return[...super.prepareRenderPasses(e),s,r,t]}}let k=class extends te{constructor(){super(...arguments),this.type="symbol"}install(h){const e=()=>this.notifyChange("updating"),t=new ce(this.tileInfoView,this.layerView,this.layer,e);this.featuresView=t,h.addChild(t)}uninstall(h){h.removeChild(this.featuresView),this.featuresView.destroy(),this.featuresView=null}fetchResource(h,e){const{url:t}=h,s=this.featuresView.stage;try{return s.resourceManager.fetchResource(t,{signal:e.signal})}catch(r){return H(r)?Promise.resolve({width:0,height:0}):Promise.reject(r)}}isUpdating(){var r;const h=super.isUpdating(),e=!this.featuresView||this.featuresView.isUpdating(),t=(r=this.featuresView)==null?void 0:r.hasEmptyAttributeView(),s=h||e||h&&t;return b("esri-2d-log-updating")&&console.log(`Updating SymbolTileRenderer ${s} -> updatingTiles ${h} -> hasFeaturesView ${!!this.featuresView} -> updatingFeaturesView ${e}`),s}hitTest(h){return this.featuresView.hitTest(h)}supportsRenderer(h){return h!=null&&["simple","class-breaks","unique-value","dot-density","dictionary","heatmap","pie-chart"].includes(h.type)}onConfigUpdate(h){let e=null;if(h&&"visualVariables"in h){const t=(ee(h).visualVariables||[]).map(s=>{const r=s.clone();return"normalizationField"in s&&(r.normalizationField=null),s.valueExpression&&s.valueExpression!=="$view.scale"&&(r.valueExpression=null,r.field="nop"),r});e=se(t)}this.featuresView.setRendererInfo(h,e,this.layerView.featureEffect)}onTileData(h){const e=this.tiles.get(h.tileKey);e&&h.data&&this.featuresView.onTileData(e,h.data),this.layerView.view.labelManager.requestUpdate()}onTileError(h){const e=this.tiles.get(h.tileKey);e&&this.featuresView.onTileError(e)}forceAttributeTextureUpload(){this.featuresView.attributeView.forceTextureUpload()}lockGPUUploads(){this.featuresView.attributeView.lockTextureUpload(),this.tiles.forEach(h=>h.lock())}unlockGPUUploads(){this.featuresView.attributeView.unlockTextureUpload(),this.tiles.forEach(h=>h.unlock())}async getMaterialItems(h){return this.featuresView.getMaterialItems(h)}invalidateLabels(){this.featuresView.hasLabels&&this.layerView.view.labelManager.requestUpdate()}createTile(h){const e=this.tileInfoView.getTileBounds(Z(),h),t=()=>this.layerView.view.labelManager.requestUpdate(),s=this.tileInfoView.getTileResolution(h.level),r=this.featuresView.attributeView;return new fe(h,s,e[0],e[3],r,t)}disposeTile(h){this.featuresView.removeChild(h),h.destroy(),this.layerView.view.labelManager.requestUpdate()}};k=O([X("esri.views.2d.layers.features.tileRenderers.SymbolTileRenderer")],k);const He=k;export{He as default}; diff --git a/assets/Texture.4c97bad5.js b/assets/Texture.940076b2.js similarity index 99% rename from assets/Texture.4c97bad5.js rename to assets/Texture.940076b2.js index 3bbd8c5..4bfb3de 100644 --- a/assets/Texture.4c97bad5.js +++ b/assets/Texture.940076b2.js @@ -1 +1 @@ -import{s as z,m as K,n as H,r as D,c as I,q as v,u as Y}from"./index.d94abe07.js";import{M as x,L as T,D as U,t as F,G as O,P,U as b,u as q}from"./enums.2d9e6f64.js";const $=z.getLogger("esri.views.webgl.checkWebGLError");function Z(n,e){switch(e){case n.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case n.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case n.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case n.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 n.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case n.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const W=!!K("enable-feature:webgl-debug");function j(){return W}function ie(){return W}function R(n){if(j()){const e=n.getError();if(e){const t=Z(n,e),i=new Error().stack;$.error(new H("webgl-error","WebGL error occured",{message:t,stack:i}))}}}function M(n){return window.WebGL2RenderingContext&&n instanceof window.WebGL2RenderingContext}const S={target:x.TEXTURE_2D,samplingMode:T.LINEAR,wrapMode:U.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1},G=4;class u{constructor(e,t,i=null){this._context=e,this.type="texture",this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,e.instanceCounter.increment(F.Texture,this),this._descriptor={...S,...t};for(const r in S)this._descriptor[r]===void 0&&(this._descriptor[r]=S[r]);if(e.type!==D.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),w(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===x.TEXTURE_CUBE_MAP?this._setDataCubeMap(i):this.setData(i)}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.unbindTexture(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(F.Texture,this))}release(){this.dispose()}resize(e,t){const i=this._descriptor;if(i.width!==e||i.height!==t){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");i.width=e,i.height=t,this._descriptor.target===x.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=x.TEXTURE_CUBE_MAP_POSITIVE_X;t<=x.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){var p,g;if(!this._context||!this._context.gl)return;const i=this._context.gl;this._glName||(this._glName=i.createTexture()),e===void 0&&(e=null);const r=this._descriptor,o=t!=null?t:r.target,s=w(o);e===null&&(r.width=r.width||G,r.height=r.height||G,s&&(r.depth=(p=r.depth)!=null?p:1));const h=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(u.TEXTURE_UNIT_FOR_UPDATES),u._validateTexture(this._context,r),this._configurePixelStorage(),R(i);const a=r.pixelFormat;let l=(g=r.internalFormat)!=null?g:this._deriveInternalFormat(a,r.dataType);if(L(e)){let m=e.width,_=e.height;const d=1;e instanceof HTMLVideoElement&&(m=e.videoWidth,_=e.videoHeight),r.width&&r.height,s&&r.depth,r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(o,l,r.hasMipmap,m,_,d),this._texImage(o,0,l,m,_,d,e),R(i),r.hasMipmap&&this.generateMipmap(),r.width===void 0&&(r.width=m),r.height===void 0&&(r.height=_),s&&r.depth===void 0&&(r.depth=d)}else{const{width:m,height:_,depth:d}=r;if(m==null||_==null)throw new Error("Width and height must be specified!");if(s&&d==null)throw new Error("Depth must be specified!");if(r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(o,l,r.hasMipmap,m,_,d),i.DEPTH24_STENCIL8&&l===i.DEPTH_STENCIL&&(l=i.DEPTH24_STENCIL8),N(e)){const c=e.levels,E=X(o,m,_,d),f=Math.min(E-1,c.length-1);M(i)?i.texParameteri(r.target,i.TEXTURE_MAX_LEVEL,f):r.hasMipmap=r.hasMipmap&&E===c.length;const A=l;if(!Q(A))throw new Error("Attempting to use compressed data with an umcompressed format!");this._forEachMipmapLevel((y,C,B,V)=>{const k=c[Math.min(y,c.length-1)];this._compressedTexImage(o,y,A,C,B,V,k)},f)}else I(e)?(this._texImage(o,0,l,m,_,d,e),R(i),r.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel((c,E,f,A)=>{this._texImage(o,c,l,E,f,A,null),R(i)})}u._applySamplingMode(i,this._descriptor),u._applyWrapMode(i,this._descriptor),u._applyAnisotropicFilteringParameters(this._context,this._descriptor),R(i),this._context.bindTexture(h,u.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,i,r,o,s,h=0){var E;s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const a=this._context.gl,l=this._descriptor,{pixelFormat:p,dataType:g,target:m,isImmutable:_}=l,d=(E=l.internalFormat)!=null?E:this._deriveInternalFormat(p,g);if(_&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const c=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES,!0);if((t<0||i<0||r>l.width||o>l.height||t+r>l.width||i+o>l.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),h){if(!M(a))return void console.error("Webgl2 must be enabled to use dataRowOffset!");a.pixelStorei(a.UNPACK_SKIP_ROWS,h)}if(L(s)?M(a)?a.texSubImage2D(m,e,t,i,r,o,p,g,s):a.texSubImage2D(m,e,t,i,p,g,s):N(s)?a.compressedTexSubImage2D(m,e,t,i,r,o,d,s.levels[e]):a.texSubImage2D(m,e,t,i,r,o,p,g,s),h){if(!M(a))return void console.error("Webgl2 must be enabled to use dataRowOffset!");a.pixelStorei(a.UNPACK_SKIP_ROWS,0)}this._context.bindTexture(c,u.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,i,r,o,s,h,a){var f;a||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const l=this._context.gl;if(!M(l))throw new Error("3D textures are not supported in WebGL1");const p=this._descriptor,{pixelFormat:g,dataType:m,isImmutable:_,target:d}=p,c=(f=p.internalFormat)!=null?f:this._deriveInternalFormat(g,m);if(_&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");w(d)||console.warn("Attempting to set 3D texture data on a non-3D texture");const E=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(u.TEXTURE_UNIT_FOR_UPDATES),(t<0||i<0||r<0||o>p.width||s>p.height||h>p.depth||t+o>p.width||i+s>p.height||r+h>p.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),N(a))a=a.levels[e],l.compressedTexSubImage3D(d,e,t,i,r,o,s,h,c,a);else{const A=a;l.texSubImage3D(d,e,t,i,r,o,s,h,g,m,A)}this._context.bindTexture(E,u.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,u._validateTexture(this._context,e)}e.samplingMode===T.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=T.LINEAR_MIPMAP_NEAREST):e.samplingMode===T.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=T.NEAREST_MIPMAP_NEAREST);const t=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(u.TEXTURE_UNIT_FOR_UPDATES),this._context.gl.generateMipmap(e.target),this._context.bindTexture(t,u.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,u._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,t=this._descriptor;this._samplingModeDirty&&(u._applySamplingMode(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(u._applyWrapMode(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(e,t){if(this._context.type===D.WEBGL1)return e;switch(t){case O.FLOAT:switch(e){case P.RGBA:return b.RGBA32F;case P.RGB:return b.RGB32F;default:throw new Error("Unable to derive format")}case O.UNSIGNED_BYTE:switch(e){case P.RGBA:return b.RGBA8;case P.RGB:return b.RGB8}default:return e}}_configurePixelStorage(){const e=this._context.gl,{unpackAlignment:t,flipped:i,preMultiplyAlpha:r}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,i?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_texStorage(e,t,i,r,o,s){const h=this._context.gl;if(!M(h))throw new Error("Immutable textures are not supported in WebGL1");if(!J(t))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const a=i?X(e,r,o,s):1;if(w(e)){if(s==null)throw new Error("Missing depth dimension for 3D texture upload");h.texStorage3D(e,a,t,r,o,s)}else h.texStorage2D(e,a,t,r,o);this._wasImmutablyAllocated=!0}_texImage(e,t,i,r,o,s,h){const a=this._context.gl;let l=null;const p=this._context.type===D.WEBGL2,g=w(e),{isImmutable:m,pixelFormat:_,dataType:d}=this._descriptor;if(p&&(l=a),p||!L(h))if(m){if(I(h)){const c=h;if(g){if(s==null)throw new Error("Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,r,o,s,_,d,c)}else a.texSubImage2D(e,t,0,0,r,o,_,d,c)}}else{const c=Y(h);if(g){if(s==null)throw new Error("Missing depth dimension for 3D texture upload");l.texImage3D(e,t,i,r,o,s,0,_,d,c)}else a.texImage2D(e,t,i,r,o,0,_,d,c)}else a.texImage2D(e,0,i,_,d,h)}_compressedTexImage(e,t,i,r,o,s,h){const a=this._context.gl;let l=null;const p=w(e),g=this._descriptor.isImmutable;if(p){if(this._context.type!==D.WEBGL2)throw new Error("3D textures are not supported in WebGL1");l=a}if(g){if(I(h))if(p){if(s==null)throw new Error("Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,r,o,s,i,h)}else a.compressedTexSubImage2D(e,t,0,0,r,o,i,h)}else if(p){if(s==null)throw new Error("Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,i,r,o,s,0,h)}else a.compressedTexImage2D(e,t,i,r,o,0,h)}_forEachMipmapLevel(e,t=1/0){let{width:i,height:r,depth:o,hasMipmap:s,target:h}=this._descriptor;const a=h===x.TEXTURE_3D;if(i==null||r==null||a&&o==null)throw new Error("Missing texture dimensions for mipmap calculation");for(let l=0;e(l,i,r,o),s&&(i!==1||r!==1||a&&o!==1)&&!(l>=t);++l)i=Math.max(1,i>>1),r=Math.max(1,r>>1),a&&(o=Math.max(1,o>>1))}static _validateTexture(e,t){(t.width!=null&&t.width<0||t.height!=null&&t.height<0||t.depth!=null&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!");const i=M(e.gl),r=t.width!=null&&v(t.width)&&t.height!=null&&v(t.height);i||!t.isImmutable&&!w(t.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),i||r||(typeof t.wrapMode=="number"?t.wrapMode!==U.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===U.CLAMP_TO_EDGE&&t.wrapMode.t===U.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 i=t.samplingMode,r=t.samplingMode;i===T.LINEAR_MIPMAP_NEAREST||i===T.LINEAR_MIPMAP_LINEAR?(i=T.LINEAR,t.hasMipmap||(r=T.LINEAR)):i!==T.NEAREST_MIPMAP_NEAREST&&i!==T.NEAREST_MIPMAP_LINEAR||(i=T.NEAREST,t.hasMipmap||(r=T.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}static _applyWrapMode(e,t){typeof t.wrapMode=="number"?(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 r;const i=e.capabilities.textureFilterAnisotropic;!i||e.gl.texParameterf(t.target,i.TEXTURE_MAX_ANISOTROPY,(r=t.maxAnisotropy)!=null?r:1)}}function J(n){return n in b}function Q(n){return n in q}function N(n){return I(n)&&"type"in n&&n.type==="compressed"}function ee(n){return I(n)&&"byteLength"in n}function L(n){return I(n)&&!N(n)&&!ee(n)}function w(n){return n===x.TEXTURE_3D||n===x.TEXTURE_2D_ARRAY}function X(n,e,t,i=1){let r=Math.max(e,t);return n===x.TEXTURE_3D&&(r=Math.max(r,i)),Math.round(Math.log(r)/Math.LN2)+1}u.TEXTURE_UNIT_FOR_UPDATES=0;export{u as E,j as a,ie as c,M as n,R as u}; +import{s as z,m as K,n as H,r as D,c as I,q as v,u as Y}from"./index.221827cd.js";import{M as x,L as T,D as U,t as F,G as O,P,U as b,u as q}from"./enums.2d9e6f64.js";const $=z.getLogger("esri.views.webgl.checkWebGLError");function Z(n,e){switch(e){case n.INVALID_ENUM:return"Invalid Enum. An unacceptable value has been specified for an enumerated argument.";case n.INVALID_VALUE:return"Invalid Value. A numeric argument is out of range.";case n.INVALID_OPERATION:return"Invalid Operation. The specified command is not allowed for the current state.";case n.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 n.OUT_OF_MEMORY:return"Out of memory. Not enough memory is left to execute the command.";case n.CONTEXT_LOST_WEBGL:return"WebGL context has been lost";default:return"Unknown error"}}const W=!!K("enable-feature:webgl-debug");function j(){return W}function ie(){return W}function R(n){if(j()){const e=n.getError();if(e){const t=Z(n,e),i=new Error().stack;$.error(new H("webgl-error","WebGL error occured",{message:t,stack:i}))}}}function M(n){return window.WebGL2RenderingContext&&n instanceof window.WebGL2RenderingContext}const S={target:x.TEXTURE_2D,samplingMode:T.LINEAR,wrapMode:U.REPEAT,flipped:!1,hasMipmap:!1,isOpaque:!1,unpackAlignment:4,preMultiplyAlpha:!1,isImmutable:!1},G=4;class u{constructor(e,t,i=null){this._context=e,this.type="texture",this._glName=null,this._samplingModeDirty=!1,this._wrapModeDirty=!1,this._wasImmutablyAllocated=!1,e.instanceCounter.increment(F.Texture,this),this._descriptor={...S,...t};for(const r in S)this._descriptor[r]===void 0&&(this._descriptor[r]=S[r]);if(e.type!==D.WEBGL2&&(this._descriptor.isImmutable&&(this._descriptor.isImmutable=!1),w(this._descriptor.target)))throw new Error("3D and array textures are not supported in WebGL1");this._descriptor.target===x.TEXTURE_CUBE_MAP?this._setDataCubeMap(i):this.setData(i)}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.unbindTexture(this),this._context.gl.deleteTexture(this._glName),this._glName=null,this._context.instanceCounter.decrement(F.Texture,this))}release(){this.dispose()}resize(e,t){const i=this._descriptor;if(i.width!==e||i.height!==t){if(this._wasImmutablyAllocated)throw new Error("Immutable textures can't be resized!");i.width=e,i.height=t,this._descriptor.target===x.TEXTURE_CUBE_MAP?this._setDataCubeMap(null):this.setData(null)}}_setDataCubeMap(e=null){for(let t=x.TEXTURE_CUBE_MAP_POSITIVE_X;t<=x.TEXTURE_CUBE_MAP_NEGATIVE_Z;t++)this._setData(e,t)}setData(e){this._setData(e)}_setData(e,t){var p,g;if(!this._context||!this._context.gl)return;const i=this._context.gl;this._glName||(this._glName=i.createTexture()),e===void 0&&(e=null);const r=this._descriptor,o=t!=null?t:r.target,s=w(o);e===null&&(r.width=r.width||G,r.height=r.height||G,s&&(r.depth=(p=r.depth)!=null?p:1));const h=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(u.TEXTURE_UNIT_FOR_UPDATES),u._validateTexture(this._context,r),this._configurePixelStorage(),R(i);const a=r.pixelFormat;let l=(g=r.internalFormat)!=null?g:this._deriveInternalFormat(a,r.dataType);if(L(e)){let m=e.width,_=e.height;const d=1;e instanceof HTMLVideoElement&&(m=e.videoWidth,_=e.videoHeight),r.width&&r.height,s&&r.depth,r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(o,l,r.hasMipmap,m,_,d),this._texImage(o,0,l,m,_,d,e),R(i),r.hasMipmap&&this.generateMipmap(),r.width===void 0&&(r.width=m),r.height===void 0&&(r.height=_),s&&r.depth===void 0&&(r.depth=d)}else{const{width:m,height:_,depth:d}=r;if(m==null||_==null)throw new Error("Width and height must be specified!");if(s&&d==null)throw new Error("Depth must be specified!");if(r.isImmutable&&!this._wasImmutablyAllocated&&this._texStorage(o,l,r.hasMipmap,m,_,d),i.DEPTH24_STENCIL8&&l===i.DEPTH_STENCIL&&(l=i.DEPTH24_STENCIL8),N(e)){const c=e.levels,E=X(o,m,_,d),f=Math.min(E-1,c.length-1);M(i)?i.texParameteri(r.target,i.TEXTURE_MAX_LEVEL,f):r.hasMipmap=r.hasMipmap&&E===c.length;const A=l;if(!Q(A))throw new Error("Attempting to use compressed data with an umcompressed format!");this._forEachMipmapLevel((y,C,B,V)=>{const k=c[Math.min(y,c.length-1)];this._compressedTexImage(o,y,A,C,B,V,k)},f)}else I(e)?(this._texImage(o,0,l,m,_,d,e),R(i),r.hasMipmap&&this.generateMipmap()):this._forEachMipmapLevel((c,E,f,A)=>{this._texImage(o,c,l,E,f,A,null),R(i)})}u._applySamplingMode(i,this._descriptor),u._applyWrapMode(i,this._descriptor),u._applyAnisotropicFilteringParameters(this._context,this._descriptor),R(i),this._context.bindTexture(h,u.TEXTURE_UNIT_FOR_UPDATES)}updateData(e,t,i,r,o,s,h=0){var E;s||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const a=this._context.gl,l=this._descriptor,{pixelFormat:p,dataType:g,target:m,isImmutable:_}=l,d=(E=l.internalFormat)!=null?E:this._deriveInternalFormat(p,g);if(_&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");const c=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES,!0);if((t<0||i<0||r>l.width||o>l.height||t+r>l.width||i+o>l.height)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),h){if(!M(a))return void console.error("Webgl2 must be enabled to use dataRowOffset!");a.pixelStorei(a.UNPACK_SKIP_ROWS,h)}if(L(s)?M(a)?a.texSubImage2D(m,e,t,i,r,o,p,g,s):a.texSubImage2D(m,e,t,i,p,g,s):N(s)?a.compressedTexSubImage2D(m,e,t,i,r,o,d,s.levels[e]):a.texSubImage2D(m,e,t,i,r,o,p,g,s),h){if(!M(a))return void console.error("Webgl2 must be enabled to use dataRowOffset!");a.pixelStorei(a.UNPACK_SKIP_ROWS,0)}this._context.bindTexture(c,u.TEXTURE_UNIT_FOR_UPDATES)}updateData3D(e,t,i,r,o,s,h,a){var f;a||console.error("An attempt to use uninitialized data!"),this._glName||console.error("An attempt to update uninitialized texture!");const l=this._context.gl;if(!M(l))throw new Error("3D textures are not supported in WebGL1");const p=this._descriptor,{pixelFormat:g,dataType:m,isImmutable:_,target:d}=p,c=(f=p.internalFormat)!=null?f:this._deriveInternalFormat(g,m);if(_&&!this._wasImmutablyAllocated)throw new Error("Cannot update immutable texture before allocation!");w(d)||console.warn("Attempting to set 3D texture data on a non-3D texture");const E=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);if(this._context.setActiveTexture(u.TEXTURE_UNIT_FOR_UPDATES),(t<0||i<0||r<0||o>p.width||s>p.height||h>p.depth||t+o>p.width||i+s>p.height||r+h>p.depth)&&console.error("An attempt to update out of bounds of the texture!"),this._configurePixelStorage(),N(a))a=a.levels[e],l.compressedTexSubImage3D(d,e,t,i,r,o,s,h,c,a);else{const A=a;l.texSubImage3D(d,e,t,i,r,o,s,h,g,m,A)}this._context.bindTexture(E,u.TEXTURE_UNIT_FOR_UPDATES)}generateMipmap(){const e=this._descriptor;if(!e.hasMipmap){if(this._wasImmutablyAllocated)throw new Error("Cannot add mipmaps to immutable texture after allocation");e.hasMipmap=!0,this._samplingModeDirty=!0,u._validateTexture(this._context,e)}e.samplingMode===T.LINEAR?(this._samplingModeDirty=!0,e.samplingMode=T.LINEAR_MIPMAP_NEAREST):e.samplingMode===T.NEAREST&&(this._samplingModeDirty=!0,e.samplingMode=T.NEAREST_MIPMAP_NEAREST);const t=this._context.bindTexture(this,u.TEXTURE_UNIT_FOR_UPDATES);this._context.setActiveTexture(u.TEXTURE_UNIT_FOR_UPDATES),this._context.gl.generateMipmap(e.target),this._context.bindTexture(t,u.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,u._validateTexture(this._context,this._descriptor),this._wrapModeDirty=!0)}applyChanges(){const e=this._context.gl,t=this._descriptor;this._samplingModeDirty&&(u._applySamplingMode(e,t),this._samplingModeDirty=!1),this._wrapModeDirty&&(u._applyWrapMode(e,t),this._wrapModeDirty=!1)}_deriveInternalFormat(e,t){if(this._context.type===D.WEBGL1)return e;switch(t){case O.FLOAT:switch(e){case P.RGBA:return b.RGBA32F;case P.RGB:return b.RGB32F;default:throw new Error("Unable to derive format")}case O.UNSIGNED_BYTE:switch(e){case P.RGBA:return b.RGBA8;case P.RGB:return b.RGB8}default:return e}}_configurePixelStorage(){const e=this._context.gl,{unpackAlignment:t,flipped:i,preMultiplyAlpha:r}=this._descriptor;e.pixelStorei(e.UNPACK_ALIGNMENT,t),e.pixelStorei(e.UNPACK_FLIP_Y_WEBGL,i?1:0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r?1:0)}_texStorage(e,t,i,r,o,s){const h=this._context.gl;if(!M(h))throw new Error("Immutable textures are not supported in WebGL1");if(!J(t))throw new Error("Immutable textures must have a sized internal format");if(!this._descriptor.isImmutable)return;const a=i?X(e,r,o,s):1;if(w(e)){if(s==null)throw new Error("Missing depth dimension for 3D texture upload");h.texStorage3D(e,a,t,r,o,s)}else h.texStorage2D(e,a,t,r,o);this._wasImmutablyAllocated=!0}_texImage(e,t,i,r,o,s,h){const a=this._context.gl;let l=null;const p=this._context.type===D.WEBGL2,g=w(e),{isImmutable:m,pixelFormat:_,dataType:d}=this._descriptor;if(p&&(l=a),p||!L(h))if(m){if(I(h)){const c=h;if(g){if(s==null)throw new Error("Missing depth dimension for 3D texture upload");l.texSubImage3D(e,t,0,0,0,r,o,s,_,d,c)}else a.texSubImage2D(e,t,0,0,r,o,_,d,c)}}else{const c=Y(h);if(g){if(s==null)throw new Error("Missing depth dimension for 3D texture upload");l.texImage3D(e,t,i,r,o,s,0,_,d,c)}else a.texImage2D(e,t,i,r,o,0,_,d,c)}else a.texImage2D(e,0,i,_,d,h)}_compressedTexImage(e,t,i,r,o,s,h){const a=this._context.gl;let l=null;const p=w(e),g=this._descriptor.isImmutable;if(p){if(this._context.type!==D.WEBGL2)throw new Error("3D textures are not supported in WebGL1");l=a}if(g){if(I(h))if(p){if(s==null)throw new Error("Missing depth dimension for 3D texture upload");l.compressedTexSubImage3D(e,t,0,0,0,r,o,s,i,h)}else a.compressedTexSubImage2D(e,t,0,0,r,o,i,h)}else if(p){if(s==null)throw new Error("Missing depth dimension for 3D texture upload");l.compressedTexImage3D(e,t,i,r,o,s,0,h)}else a.compressedTexImage2D(e,t,i,r,o,0,h)}_forEachMipmapLevel(e,t=1/0){let{width:i,height:r,depth:o,hasMipmap:s,target:h}=this._descriptor;const a=h===x.TEXTURE_3D;if(i==null||r==null||a&&o==null)throw new Error("Missing texture dimensions for mipmap calculation");for(let l=0;e(l,i,r,o),s&&(i!==1||r!==1||a&&o!==1)&&!(l>=t);++l)i=Math.max(1,i>>1),r=Math.max(1,r>>1),a&&(o=Math.max(1,o>>1))}static _validateTexture(e,t){(t.width!=null&&t.width<0||t.height!=null&&t.height<0||t.depth!=null&&t.depth<0)&&console.error("Negative dimension parameters are not allowed!");const i=M(e.gl),r=t.width!=null&&v(t.width)&&t.height!=null&&v(t.height);i||!t.isImmutable&&!w(t.target)||console.error("Immutable and 3D-like textures are not supported in WebGL1!"),i||r||(typeof t.wrapMode=="number"?t.wrapMode!==U.CLAMP_TO_EDGE&&console.error("Non-power-of-two textures must have a wrap mode of CLAMP_TO_EDGE!"):t.wrapMode.s===U.CLAMP_TO_EDGE&&t.wrapMode.t===U.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 i=t.samplingMode,r=t.samplingMode;i===T.LINEAR_MIPMAP_NEAREST||i===T.LINEAR_MIPMAP_LINEAR?(i=T.LINEAR,t.hasMipmap||(r=T.LINEAR)):i!==T.NEAREST_MIPMAP_NEAREST&&i!==T.NEAREST_MIPMAP_LINEAR||(i=T.NEAREST,t.hasMipmap||(r=T.NEAREST)),e.texParameteri(t.target,e.TEXTURE_MAG_FILTER,i),e.texParameteri(t.target,e.TEXTURE_MIN_FILTER,r)}static _applyWrapMode(e,t){typeof t.wrapMode=="number"?(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 r;const i=e.capabilities.textureFilterAnisotropic;!i||e.gl.texParameterf(t.target,i.TEXTURE_MAX_ANISOTROPY,(r=t.maxAnisotropy)!=null?r:1)}}function J(n){return n in b}function Q(n){return n in q}function N(n){return I(n)&&"type"in n&&n.type==="compressed"}function ee(n){return I(n)&&"byteLength"in n}function L(n){return I(n)&&!N(n)&&!ee(n)}function w(n){return n===x.TEXTURE_3D||n===x.TEXTURE_2D_ARRAY}function X(n,e,t,i=1){let r=Math.max(e,t);return n===x.TEXTURE_3D&&(r=Math.max(r,i)),Math.round(Math.log(r)/Math.LN2)+1}u.TEXTURE_UNIT_FOR_UPDATES=0;export{u as E,j as a,ie as c,M as n,R as u}; diff --git a/assets/TileClipper.8c399a8a.js b/assets/TileClipper.77103a2e.js similarity index 99% rename from assets/TileClipper.8c399a8a.js rename to assets/TileClipper.77103a2e.js index 328f888..b80402b 100644 --- a/assets/TileClipper.8c399a8a.js +++ b/assets/TileClipper.77103a2e.js @@ -1 +1 @@ -import{m as Dt,at as Vt,cs as It}from"./index.d94abe07.js";import{a3 as Bt,a as C,n as W,Q as kt}from"./enums.0295eb81.js";import{t as S,s as tt}from"./Geometry.d049a63c.js";import{g as pt}from"./GeometryUtils.51c4032a.js";const Ut=128e3;let vt=null,Pt=null;async function Xt(){return vt||(vt=St()),vt}async function St(){Pt=await(Dt("esri-csp-restrictions")?await Vt(()=>import("./libtess-asm.35b825b8.js"),[]).then(t=>t.l):await Vt(()=>import("./libtess.1a722897.js"),[]).then(t=>t.l)).load({locateFile:t=>It(`esri/core/libs/libtess/${t}`)})}function jt(o,t){const i=Math.max(o.length,Ut);return Pt.triangulate(o,t,i)}function bt(o,t){return o.x===t.x&&o.y===t.y}function $t(o){if(!o)return;const t=o.length;if(t<=1)return;let i=0;for(let n=1;nn){r=!0;const s=(n-h)/_;_=n-h,b=(1-s)*x+s*b,T=(1-s)*a+s*T,--u}const l=this._writeVertex(x,a,0,0,m,p,p,-m,0,-1,h),c=this._writeVertex(x,a,0,0,m,p,-p,m,0,1,h);h+=_;const d=this._writeVertex(b,T,0,0,m,p,p,-m,0,-1,h),e=this._writeVertex(b,T,0,0,m,p,-p,m,0,1,h);this._writeTriangle(l,c,d),this._writeTriangle(c,d,e),x=b,a=T}}_tessellate(t,i){const n=t[0],h=t[t.length-1],r=bt(n,h),x=r?3:2;if(t.length{const j=Lt(l,c,V,E,Y,I,$,yt,H,X,w);return M>=0&&v>=0&&j>=0&&Nt(M,v,j),M=v,v=j,j};r&&(_=t[t.length-2],s.x=h.x-_.x,s.y=h.y-_.y,G=Rt(s),s.x/=G,s.y/=G);let st=!1;for(let $=0;$ft&&(st=!0)),st){const f=(ft-w)/it;it=ft-w,_={x:(1-f)*_.x+f*t[$].x,y:(1-f)*_.y+f*t[$].y},--$}else _=t[$];l=_.x,c=_.y;const yt=$<=0&&!st,Y=$===t.length-1;if(yt||(w+=it),d=Y?r?t[1]:null:t[$+1],d?(s.x=d.x-l,s.y=d.y-c,G=Rt(s),s.x/=G,s.y/=G):(s.x=void 0,s.y=void 0),!r){if(yt){U(g,s),V=g.x,E=g.y,y===C.SQUARE&&(P(-s.y-s.x,s.x-s.y,s.x,s.y,0,-1),P(s.y-s.x,-s.x-s.y,s.x,s.y,0,1)),y===C.ROUND&&(P(-s.y-s.x,s.x-s.y,s.x,s.y,-1,-1),P(s.y-s.x,-s.x-s.y,s.x,s.y,-1,1)),y!==C.ROUND&&y!==C.BUTT||(P(-s.y,s.x,s.x,s.y,0,-1),P(s.y,-s.x,s.x,s.y,0,1));continue}if(Y){z(g,e),V=g.x,E=g.y,y!==C.ROUND&&y!==C.BUTT||(P(e.y,-e.x,-e.x,-e.y,0,-1),P(-e.y,e.x,-e.x,-e.y,0,1)),y===C.SQUARE&&(P(e.y-e.x,-e.x-e.y,-e.x,-e.y,0,-1),P(-e.y-e.x,e.x-e.y,-e.x,-e.y,0,1)),y===C.ROUND&&(P(e.y-e.x,-e.x-e.y,-e.x,-e.y,1,-1),P(-e.y-e.x,e.x-e.y,-e.x,-e.y,1,1));continue}}let I,H,X=-Ot(e,s);if(Math.abs(X)<.01)Mt(e,s)>0?(g.x=e.x,g.y=e.y,X=1,I=Number.MAX_VALUE,H=!0):(U(g,s),X=1,I=1,H=!1);else{g.x=(e.x+s.x)/X,g.y=(e.y+s.y)/X,I=Rt(g);const f=(I-1)*m*a;H=I>4||f>it&&f>G}V=g.x,E=g.y;let j=u;switch(u){case W.BEVEL:I<1.05&&(j=W.MITER);break;case W.ROUND:Ib&&(j=W.BEVEL)}switch(j){case W.MITER:if(P(g.x,g.y,-e.x,-e.y,0,-1),P(-g.x,-g.y,-e.x,-e.y,0,1),Y)break;if(p){const f=st?0:w;M=this._writeVertex(l,c,V,E,s.x,s.y,g.x,g.y,0,-1,f),v=this._writeVertex(l,c,V,E,s.x,s.y,-g.x,-g.y,0,1,f)}break;case W.BEVEL:{const f=X<0;let D,B,J,O;if(f){const R=M;M=v,v=R,D=lt,B=rt}else D=rt,B=lt;if(H)J=f?U(this._innerPrev,e):z(this._innerPrev,e),O=f?z(this._innerNext,s):U(this._innerNext,s);else{const R=f?wt(this._inner,g):Et(this._inner,g);J=R,O=R}const A=f?z(this._bevelStart,e):U(this._bevelStart,e);P(J.x,J.y,-e.x,-e.y,D.x,D.y);const ot=P(A.x,A.y,-e.x,-e.y,B.x,B.y);if(Y)break;const q=f?U(this._bevelEnd,s):z(this._bevelEnd,s);if(H){const R=this._writeVertex(l,c,V,E,-e.x,-e.y,0,0,0,0,w);M=this._writeVertex(l,c,V,E,s.x,s.y,O.x,O.y,D.x,D.y,w),v=this._writeVertex(l,c,V,E,s.x,s.y,q.x,q.y,B.x,B.y,w),this._writeTriangle(ot,R,v)}else{if(p){const R=this._bevelMiddle;R.x=(A.x+q.x)/2,R.y=(A.y+q.y)/2,ht(L,R,-e.x,-e.y),P(R.x,R.y,-e.x,-e.y,L.x,L.y),ht(L,R,s.x,s.y),M=this._writeVertex(l,c,V,E,s.x,s.y,R.x,R.y,L.x,L.y,w),v=this._writeVertex(l,c,V,E,s.x,s.y,O.x,O.y,D.x,D.y,w)}else{const R=M;M=v,v=R}P(q.x,q.y,s.x,s.y,B.x,B.y)}if(f){const R=M;M=v,v=R}break}case W.ROUND:{const f=X<0;let D,B;if(f){const k=M;M=v,v=k,D=lt,B=rt}else D=rt,B=lt;const J=f?wt(this._inner,g):Et(this._inner,g);let O,A;H?(O=f?U(this._innerPrev,e):z(this._innerPrev,e),A=f?z(this._innerNext,s):U(this._innerNext,s)):(O=J,A=J);const ot=f?z(this._roundStart,e):U(this._roundStart,e),q=f?U(this._roundEnd,s):z(this._roundEnd,s),R=P(O.x,O.y,-e.x,-e.y,D.x,D.y),at=P(ot.x,ot.y,-e.x,-e.y,B.x,B.y);if(Y)break;const K=this._writeVertex(l,c,V,E,-e.x,-e.y,0,0,0,0,w);H||this._writeTriangle(M,v,K);const Q=wt(this._outer,J),Z=this._writeVertex(l,c,V,E,s.x,s.y,q.x,q.y,B.x,B.y,w);let et,nt;const ut=I>2;if(ut){let k;I!==Number.MAX_VALUE?(Q.x/=I,Q.y/=I,k=Mt(e,Q),k=(I*(k*k-1)+1)/k):k=-1,et=f?z(this._startBreak,e):U(this._startBreak,e),et.x+=e.x*k,et.y+=e.y*k,nt=f?U(this._endBreak,s):z(this._endBreak,s),nt.x+=s.x*k,nt.y+=s.y*k}ht(L,Q,-e.x,-e.y);const ct=this._writeVertex(l,c,V,E,-e.x,-e.y,Q.x,Q.y,L.x,L.y,w);ht(L,Q,s.x,s.y);const gt=p?this._writeVertex(l,c,V,E,s.x,s.y,Q.x,Q.y,L.x,L.y,w):ct,Tt=K,mt=p?this._writeVertex(l,c,V,E,s.x,s.y,0,0,0,0,w):K;let xt=-1,_t=-1;if(ut&&(ht(L,et,-e.x,-e.y),xt=this._writeVertex(l,c,V,E,-e.x,-e.y,et.x,et.y,L.x,L.y,w),ht(L,nt,s.x,s.y),_t=this._writeVertex(l,c,V,E,s.x,s.y,nt.x,nt.y,L.x,L.y,w)),p?ut?(this._writeTriangle(Tt,at,xt),this._writeTriangle(Tt,xt,ct),this._writeTriangle(mt,gt,_t),this._writeTriangle(mt,_t,Z)):(this._writeTriangle(Tt,at,ct),this._writeTriangle(mt,gt,Z)):ut?(this._writeTriangle(K,at,xt),this._writeTriangle(K,xt,_t),this._writeTriangle(K,_t,Z)):(this._writeTriangle(K,at,ct),this._writeTriangle(K,gt,Z)),H?(M=this._writeVertex(l,c,V,E,s.x,s.y,A.x,A.y,D.x,D.y,w),v=Z):(M=p?this._writeVertex(l,c,V,E,s.x,s.y,A.x,A.y,D.x,D.y,w):R,this._writeTriangle(M,mt,Z),v=Z),f){const k=M;M=v,v=k}break}}}}}class dt{constructor(t,i,n){this.ratio=t,this.x=i,this.y=n}}class Qt{constructor(t,i,n,h=8,r=8){this._lines=[],this._starts=[],this.validateTessellation=!0,this._pixelRatio=h,this._pixelMargin=r,this._tileSize=kt*h,this._dz=t,this._yPos=i,this._xPos=n}setPixelMargin(t){t!==this._pixelMargin&&(this._pixelMargin=t,this.setExtent(this._extent))}setExtent(t){this._extent=t,this._finalRatio=this._tileSize/t*(1<>this._dz;i>n&&(i=n),this._margin=i,this._xmin=n*this._xPos-i,this._ymin=n*this._yPos-i,this._xmax=this._xmin+n+2*i,this._ymax=this._ymin+n+2*i}reset(t){this._type=t,this._lines=[],this._starts=[],this._line=null,this._start=0}moveTo(t,i){this._pushLine(),this._prevIsIn=this._isIn(t,i),this._moveTo(t,i,this._prevIsIn),this._prevPt=new S(t,i),this._firstPt=new S(t,i),this._dist=0}lineTo(t,i){const n=this._isIn(t,i),h=new S(t,i),r=S.distance(this._prevPt,h);let x,a,y,u,b,T,m,p;if(n)this._prevIsIn?this._lineTo(t,i,!0):(x=this._prevPt,a=h,y=this._intersect(a,x),this._start=this._dist+r*(1-this._r),this._lineTo(y.x,y.y,!0),this._lineTo(a.x,a.y,!0));else if(this._prevIsIn)a=this._prevPt,x=h,y=this._intersect(a,x),this._lineTo(y.x,y.y,!0),this._lineTo(x.x,x.y,!1);else{const _=this._prevPt,l=h;if(_.x<=this._xmin&&l.x<=this._xmin||_.x>=this._xmax&&l.x>=this._xmax||_.y<=this._ymin&&l.y<=this._ymin||_.y>=this._ymax&&l.y>=this._ymax)this._lineTo(l.x,l.y,!1);else{const c=[];if((_.xthis._xmin||_.x>this._xmin&&l.x=this._ymax?T=!0:c.push(new dt(u,this._xmin,p))),(_.xthis._xmax||_.x>this._xmax&&l.x=this._ymax?T=!0:c.push(new dt(u,this._xmax,p))),(_.ythis._ymin||_.y>this._ymin&&l.y=this._xmax?b=!0:c.push(new dt(u,m,this._ymin))),(_.ythis._ymax||_.y>this._ymax&&l.y=this._xmax?b=!0:c.push(new dt(u,m,this._ymax))),c.length===0)b?T?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):T?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin,!0);else if(c.length>1&&c[0].ratio>c[1].ratio)this._start=this._dist+r*c[1].ratio,this._lineTo(c[1].x,c[1].y,!0),this._lineTo(c[0].x,c[0].y,!0);else{this._start=this._dist+r*c[0].ratio;for(let d=0;d2){const t=this._firstPt,i=this._prevPt;t.x===i.x&&t.y===i.y||this.lineTo(t.x,t.y);const n=this._line;let h=n.length;for(;h>=4&&(n[0].x===n[1].x&&n[0].x===n[h-2].x||n[0].y===n[1].y&&n[0].y===n[h-2].y);)n.pop(),n[0].x=n[h-2].x,n[0].y=n[h-2].y,--h}}result(t=!0){return this._pushLine(),this._lines.length===0?null:(this._type===tt.Polygon&&t&&F.simplify(this._tileSize,this._margin*this._finalRatio,this._lines),this._lines)}resultWithStarts(){if(this._type!==tt.LineString)throw new Error("Only valid for lines");this._pushLine();const t=this._lines,i=t.length;if(i===0)return null;const n=[];for(let h=0;h=this._xmin&&t<=this._xmax&&i>=this._ymin&&i<=this._ymax}_intersect(t,i){let n,h,r;if(i.x>=this._xmin&&i.x<=this._xmax)h=i.y<=this._ymin?this._ymin:this._ymax,r=(h-t.y)/(i.y-t.y),n=t.x+r*(i.x-t.x);else if(i.y>=this._ymin&&i.y<=this._ymax)n=i.x<=this._xmin?this._xmin:this._xmax,r=(n-t.x)/(i.x-t.x),h=t.y+r*(i.y-t.y);else{h=i.y<=this._ymin?this._ymin:this._ymax,n=i.x<=this._xmin?this._xmin:this._xmax;const x=(n-t.x)/(i.x-t.x),a=(h-t.y)/(i.y-t.y);x0&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===tt.LineString?this._line.length>1&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===tt.Polygon&&this._line.length>3&&(this._lines.push(this._line),this._starts.push(this._start))),this._line=[],this._start=0}_moveTo(t,i,n){this._type!==tt.Polygon?n&&(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new S(t,i))):(n||(tthis._xmax&&(t=this._xmax),ithis._ymax&&(i=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new S(t,i)),this._isH=!1,this._isV=!1)}_lineTo(t,i,n){let h,r;if(this._type!==tt.Polygon)if(n){if(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.length>0&&(h=this._line[this._line.length-1],h.equals(t,i)))return;this._line.push(new S(t,i))}else this._line&&this._line.length>0&&this._pushLine();else if(n||(tthis._xmax&&(t=this._xmax),ithis._ymax&&(i=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line&&this._line.length>0){h=this._line[this._line.length-1];const x=h.x===t,a=h.y===i;if(x&&a)return;this._isH&&x||this._isV&&a?(h.x=t,h.y=i,r=this._line[this._line.length-2],r.x===t&&r.y===i?(this._line.pop(),this._line.length<=1?(this._isH=!1,this._isV=!1):(r=this._line[this._line.length-2],this._isH=r.x===t,this._isV=r.y===i)):(this._isH=r.x===t,this._isV=r.y===i)):(this._line.push(new S(t,i)),this._isH=x,this._isV=a)}else this._line.push(new S(t,i))}}class Ct{setExtent(t){this._ratio=t===4096?1:4096/t}get validateTessellation(){return this._ratio<1}reset(t){this._lines=[],this._line=null}moveTo(t,i){this._line&&this._lines.push(this._line),this._line=[];const n=this._ratio;this._line.push(new S(t*n,i*n))}lineTo(t,i){const n=this._ratio;this._line.push(new S(t*n,i*n))}close(){const t=this._line;t&&!t[0].isEqual(t[t.length-1])&&t.push(t[0])}result(){return this._line&&this._lines.push(this._line),this._lines.length===0?null:this._lines}}var N;(function(o){o[o.sideLeft=0]="sideLeft",o[o.sideRight=1]="sideRight",o[o.sideTop=2]="sideTop",o[o.sideBottom=3]="sideBottom"})(N||(N={}));class F{static simplify(t,i,n){if(!n)return;const h=-i,r=t+i,x=-i,a=t+i,y=[],u=[],b=n.length;for(let m=0;m_.y?(y.push(m),y.push(d),y.push(N.sideLeft),y.push(-1)):(u.push(m),u.push(d),u.push(N.sideLeft),u.push(-1))),l.x>=r&&(l.y<_.y?(y.push(m),y.push(d),y.push(N.sideRight),y.push(-1)):(u.push(m),u.push(d),u.push(N.sideRight),u.push(-1)))),l.y===_.y&&(l.y<=x&&(l.x<_.x?(y.push(m),y.push(d),y.push(N.sideTop),y.push(-1)):(u.push(m),u.push(d),u.push(N.sideTop),u.push(-1))),l.y>=a&&(l.x>_.x?(y.push(m),y.push(d),y.push(N.sideBottom),y.push(-1)):(u.push(m),u.push(d),u.push(N.sideBottom),u.push(-1)))),l=_}if(y.length===0||u.length===0)return;F.fillParent(n,u,y),F.fillParent(n,y,u);const T=[];F.calcDeltas(T,u,y),F.calcDeltas(T,y,u),F.addDeltas(T,n)}static fillParent(t,i,n){const h=n.length,r=i.length;for(let x=0;x1&&h[x-2]===r?0:(h.push(r),F.calcDelta(r,n,i,h)+1)}static addDeltas(t,i){const n=t.length;let h=0;for(let r=0;rh&&(h=x)}for(let r=0;rimport("./libtess-asm.35b825b8.js"),[]).then(t=>t.l):await Vt(()=>import("./libtess.1a722897.js"),[]).then(t=>t.l)).load({locateFile:t=>It(`esri/core/libs/libtess/${t}`)})}function jt(o,t){const i=Math.max(o.length,Ut);return Pt.triangulate(o,t,i)}function bt(o,t){return o.x===t.x&&o.y===t.y}function $t(o){if(!o)return;const t=o.length;if(t<=1)return;let i=0;for(let n=1;nn){r=!0;const s=(n-h)/_;_=n-h,b=(1-s)*x+s*b,T=(1-s)*a+s*T,--u}const l=this._writeVertex(x,a,0,0,m,p,p,-m,0,-1,h),c=this._writeVertex(x,a,0,0,m,p,-p,m,0,1,h);h+=_;const d=this._writeVertex(b,T,0,0,m,p,p,-m,0,-1,h),e=this._writeVertex(b,T,0,0,m,p,-p,m,0,1,h);this._writeTriangle(l,c,d),this._writeTriangle(c,d,e),x=b,a=T}}_tessellate(t,i){const n=t[0],h=t[t.length-1],r=bt(n,h),x=r?3:2;if(t.length{const j=Lt(l,c,V,E,Y,I,$,yt,H,X,w);return M>=0&&v>=0&&j>=0&&Nt(M,v,j),M=v,v=j,j};r&&(_=t[t.length-2],s.x=h.x-_.x,s.y=h.y-_.y,G=Rt(s),s.x/=G,s.y/=G);let st=!1;for(let $=0;$ft&&(st=!0)),st){const f=(ft-w)/it;it=ft-w,_={x:(1-f)*_.x+f*t[$].x,y:(1-f)*_.y+f*t[$].y},--$}else _=t[$];l=_.x,c=_.y;const yt=$<=0&&!st,Y=$===t.length-1;if(yt||(w+=it),d=Y?r?t[1]:null:t[$+1],d?(s.x=d.x-l,s.y=d.y-c,G=Rt(s),s.x/=G,s.y/=G):(s.x=void 0,s.y=void 0),!r){if(yt){U(g,s),V=g.x,E=g.y,y===C.SQUARE&&(P(-s.y-s.x,s.x-s.y,s.x,s.y,0,-1),P(s.y-s.x,-s.x-s.y,s.x,s.y,0,1)),y===C.ROUND&&(P(-s.y-s.x,s.x-s.y,s.x,s.y,-1,-1),P(s.y-s.x,-s.x-s.y,s.x,s.y,-1,1)),y!==C.ROUND&&y!==C.BUTT||(P(-s.y,s.x,s.x,s.y,0,-1),P(s.y,-s.x,s.x,s.y,0,1));continue}if(Y){z(g,e),V=g.x,E=g.y,y!==C.ROUND&&y!==C.BUTT||(P(e.y,-e.x,-e.x,-e.y,0,-1),P(-e.y,e.x,-e.x,-e.y,0,1)),y===C.SQUARE&&(P(e.y-e.x,-e.x-e.y,-e.x,-e.y,0,-1),P(-e.y-e.x,e.x-e.y,-e.x,-e.y,0,1)),y===C.ROUND&&(P(e.y-e.x,-e.x-e.y,-e.x,-e.y,1,-1),P(-e.y-e.x,e.x-e.y,-e.x,-e.y,1,1));continue}}let I,H,X=-Ot(e,s);if(Math.abs(X)<.01)Mt(e,s)>0?(g.x=e.x,g.y=e.y,X=1,I=Number.MAX_VALUE,H=!0):(U(g,s),X=1,I=1,H=!1);else{g.x=(e.x+s.x)/X,g.y=(e.y+s.y)/X,I=Rt(g);const f=(I-1)*m*a;H=I>4||f>it&&f>G}V=g.x,E=g.y;let j=u;switch(u){case W.BEVEL:I<1.05&&(j=W.MITER);break;case W.ROUND:Ib&&(j=W.BEVEL)}switch(j){case W.MITER:if(P(g.x,g.y,-e.x,-e.y,0,-1),P(-g.x,-g.y,-e.x,-e.y,0,1),Y)break;if(p){const f=st?0:w;M=this._writeVertex(l,c,V,E,s.x,s.y,g.x,g.y,0,-1,f),v=this._writeVertex(l,c,V,E,s.x,s.y,-g.x,-g.y,0,1,f)}break;case W.BEVEL:{const f=X<0;let D,B,J,O;if(f){const R=M;M=v,v=R,D=lt,B=rt}else D=rt,B=lt;if(H)J=f?U(this._innerPrev,e):z(this._innerPrev,e),O=f?z(this._innerNext,s):U(this._innerNext,s);else{const R=f?wt(this._inner,g):Et(this._inner,g);J=R,O=R}const A=f?z(this._bevelStart,e):U(this._bevelStart,e);P(J.x,J.y,-e.x,-e.y,D.x,D.y);const ot=P(A.x,A.y,-e.x,-e.y,B.x,B.y);if(Y)break;const q=f?U(this._bevelEnd,s):z(this._bevelEnd,s);if(H){const R=this._writeVertex(l,c,V,E,-e.x,-e.y,0,0,0,0,w);M=this._writeVertex(l,c,V,E,s.x,s.y,O.x,O.y,D.x,D.y,w),v=this._writeVertex(l,c,V,E,s.x,s.y,q.x,q.y,B.x,B.y,w),this._writeTriangle(ot,R,v)}else{if(p){const R=this._bevelMiddle;R.x=(A.x+q.x)/2,R.y=(A.y+q.y)/2,ht(L,R,-e.x,-e.y),P(R.x,R.y,-e.x,-e.y,L.x,L.y),ht(L,R,s.x,s.y),M=this._writeVertex(l,c,V,E,s.x,s.y,R.x,R.y,L.x,L.y,w),v=this._writeVertex(l,c,V,E,s.x,s.y,O.x,O.y,D.x,D.y,w)}else{const R=M;M=v,v=R}P(q.x,q.y,s.x,s.y,B.x,B.y)}if(f){const R=M;M=v,v=R}break}case W.ROUND:{const f=X<0;let D,B;if(f){const k=M;M=v,v=k,D=lt,B=rt}else D=rt,B=lt;const J=f?wt(this._inner,g):Et(this._inner,g);let O,A;H?(O=f?U(this._innerPrev,e):z(this._innerPrev,e),A=f?z(this._innerNext,s):U(this._innerNext,s)):(O=J,A=J);const ot=f?z(this._roundStart,e):U(this._roundStart,e),q=f?U(this._roundEnd,s):z(this._roundEnd,s),R=P(O.x,O.y,-e.x,-e.y,D.x,D.y),at=P(ot.x,ot.y,-e.x,-e.y,B.x,B.y);if(Y)break;const K=this._writeVertex(l,c,V,E,-e.x,-e.y,0,0,0,0,w);H||this._writeTriangle(M,v,K);const Q=wt(this._outer,J),Z=this._writeVertex(l,c,V,E,s.x,s.y,q.x,q.y,B.x,B.y,w);let et,nt;const ut=I>2;if(ut){let k;I!==Number.MAX_VALUE?(Q.x/=I,Q.y/=I,k=Mt(e,Q),k=(I*(k*k-1)+1)/k):k=-1,et=f?z(this._startBreak,e):U(this._startBreak,e),et.x+=e.x*k,et.y+=e.y*k,nt=f?U(this._endBreak,s):z(this._endBreak,s),nt.x+=s.x*k,nt.y+=s.y*k}ht(L,Q,-e.x,-e.y);const ct=this._writeVertex(l,c,V,E,-e.x,-e.y,Q.x,Q.y,L.x,L.y,w);ht(L,Q,s.x,s.y);const gt=p?this._writeVertex(l,c,V,E,s.x,s.y,Q.x,Q.y,L.x,L.y,w):ct,Tt=K,mt=p?this._writeVertex(l,c,V,E,s.x,s.y,0,0,0,0,w):K;let xt=-1,_t=-1;if(ut&&(ht(L,et,-e.x,-e.y),xt=this._writeVertex(l,c,V,E,-e.x,-e.y,et.x,et.y,L.x,L.y,w),ht(L,nt,s.x,s.y),_t=this._writeVertex(l,c,V,E,s.x,s.y,nt.x,nt.y,L.x,L.y,w)),p?ut?(this._writeTriangle(Tt,at,xt),this._writeTriangle(Tt,xt,ct),this._writeTriangle(mt,gt,_t),this._writeTriangle(mt,_t,Z)):(this._writeTriangle(Tt,at,ct),this._writeTriangle(mt,gt,Z)):ut?(this._writeTriangle(K,at,xt),this._writeTriangle(K,xt,_t),this._writeTriangle(K,_t,Z)):(this._writeTriangle(K,at,ct),this._writeTriangle(K,gt,Z)),H?(M=this._writeVertex(l,c,V,E,s.x,s.y,A.x,A.y,D.x,D.y,w),v=Z):(M=p?this._writeVertex(l,c,V,E,s.x,s.y,A.x,A.y,D.x,D.y,w):R,this._writeTriangle(M,mt,Z),v=Z),f){const k=M;M=v,v=k}break}}}}}class dt{constructor(t,i,n){this.ratio=t,this.x=i,this.y=n}}class Qt{constructor(t,i,n,h=8,r=8){this._lines=[],this._starts=[],this.validateTessellation=!0,this._pixelRatio=h,this._pixelMargin=r,this._tileSize=kt*h,this._dz=t,this._yPos=i,this._xPos=n}setPixelMargin(t){t!==this._pixelMargin&&(this._pixelMargin=t,this.setExtent(this._extent))}setExtent(t){this._extent=t,this._finalRatio=this._tileSize/t*(1<>this._dz;i>n&&(i=n),this._margin=i,this._xmin=n*this._xPos-i,this._ymin=n*this._yPos-i,this._xmax=this._xmin+n+2*i,this._ymax=this._ymin+n+2*i}reset(t){this._type=t,this._lines=[],this._starts=[],this._line=null,this._start=0}moveTo(t,i){this._pushLine(),this._prevIsIn=this._isIn(t,i),this._moveTo(t,i,this._prevIsIn),this._prevPt=new S(t,i),this._firstPt=new S(t,i),this._dist=0}lineTo(t,i){const n=this._isIn(t,i),h=new S(t,i),r=S.distance(this._prevPt,h);let x,a,y,u,b,T,m,p;if(n)this._prevIsIn?this._lineTo(t,i,!0):(x=this._prevPt,a=h,y=this._intersect(a,x),this._start=this._dist+r*(1-this._r),this._lineTo(y.x,y.y,!0),this._lineTo(a.x,a.y,!0));else if(this._prevIsIn)a=this._prevPt,x=h,y=this._intersect(a,x),this._lineTo(y.x,y.y,!0),this._lineTo(x.x,x.y,!1);else{const _=this._prevPt,l=h;if(_.x<=this._xmin&&l.x<=this._xmin||_.x>=this._xmax&&l.x>=this._xmax||_.y<=this._ymin&&l.y<=this._ymin||_.y>=this._ymax&&l.y>=this._ymax)this._lineTo(l.x,l.y,!1);else{const c=[];if((_.xthis._xmin||_.x>this._xmin&&l.x=this._ymax?T=!0:c.push(new dt(u,this._xmin,p))),(_.xthis._xmax||_.x>this._xmax&&l.x=this._ymax?T=!0:c.push(new dt(u,this._xmax,p))),(_.ythis._ymin||_.y>this._ymin&&l.y=this._xmax?b=!0:c.push(new dt(u,m,this._ymin))),(_.ythis._ymax||_.y>this._ymax&&l.y=this._xmax?b=!0:c.push(new dt(u,m,this._ymax))),c.length===0)b?T?this._lineTo(this._xmax,this._ymax,!0):this._lineTo(this._xmax,this._ymin,!0):T?this._lineTo(this._xmin,this._ymax,!0):this._lineTo(this._xmin,this._ymin,!0);else if(c.length>1&&c[0].ratio>c[1].ratio)this._start=this._dist+r*c[1].ratio,this._lineTo(c[1].x,c[1].y,!0),this._lineTo(c[0].x,c[0].y,!0);else{this._start=this._dist+r*c[0].ratio;for(let d=0;d2){const t=this._firstPt,i=this._prevPt;t.x===i.x&&t.y===i.y||this.lineTo(t.x,t.y);const n=this._line;let h=n.length;for(;h>=4&&(n[0].x===n[1].x&&n[0].x===n[h-2].x||n[0].y===n[1].y&&n[0].y===n[h-2].y);)n.pop(),n[0].x=n[h-2].x,n[0].y=n[h-2].y,--h}}result(t=!0){return this._pushLine(),this._lines.length===0?null:(this._type===tt.Polygon&&t&&F.simplify(this._tileSize,this._margin*this._finalRatio,this._lines),this._lines)}resultWithStarts(){if(this._type!==tt.LineString)throw new Error("Only valid for lines");this._pushLine();const t=this._lines,i=t.length;if(i===0)return null;const n=[];for(let h=0;h=this._xmin&&t<=this._xmax&&i>=this._ymin&&i<=this._ymax}_intersect(t,i){let n,h,r;if(i.x>=this._xmin&&i.x<=this._xmax)h=i.y<=this._ymin?this._ymin:this._ymax,r=(h-t.y)/(i.y-t.y),n=t.x+r*(i.x-t.x);else if(i.y>=this._ymin&&i.y<=this._ymax)n=i.x<=this._xmin?this._xmin:this._xmax,r=(n-t.x)/(i.x-t.x),h=t.y+r*(i.y-t.y);else{h=i.y<=this._ymin?this._ymin:this._ymax,n=i.x<=this._xmin?this._xmin:this._xmax;const x=(n-t.x)/(i.x-t.x),a=(h-t.y)/(i.y-t.y);x0&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===tt.LineString?this._line.length>1&&(this._lines.push(this._line),this._starts.push(this._start)):this._type===tt.Polygon&&this._line.length>3&&(this._lines.push(this._line),this._starts.push(this._start))),this._line=[],this._start=0}_moveTo(t,i,n){this._type!==tt.Polygon?n&&(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new S(t,i))):(n||(tthis._xmax&&(t=this._xmax),ithis._ymax&&(i=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.push(new S(t,i)),this._isH=!1,this._isV=!1)}_lineTo(t,i,n){let h,r;if(this._type!==tt.Polygon)if(n){if(t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line.length>0&&(h=this._line[this._line.length-1],h.equals(t,i)))return;this._line.push(new S(t,i))}else this._line&&this._line.length>0&&this._pushLine();else if(n||(tthis._xmax&&(t=this._xmax),ithis._ymax&&(i=this._ymax)),t=Math.round((t-(this._xmin+this._margin))*this._finalRatio),i=Math.round((i-(this._ymin+this._margin))*this._finalRatio),this._line&&this._line.length>0){h=this._line[this._line.length-1];const x=h.x===t,a=h.y===i;if(x&&a)return;this._isH&&x||this._isV&&a?(h.x=t,h.y=i,r=this._line[this._line.length-2],r.x===t&&r.y===i?(this._line.pop(),this._line.length<=1?(this._isH=!1,this._isV=!1):(r=this._line[this._line.length-2],this._isH=r.x===t,this._isV=r.y===i)):(this._isH=r.x===t,this._isV=r.y===i)):(this._line.push(new S(t,i)),this._isH=x,this._isV=a)}else this._line.push(new S(t,i))}}class Ct{setExtent(t){this._ratio=t===4096?1:4096/t}get validateTessellation(){return this._ratio<1}reset(t){this._lines=[],this._line=null}moveTo(t,i){this._line&&this._lines.push(this._line),this._line=[];const n=this._ratio;this._line.push(new S(t*n,i*n))}lineTo(t,i){const n=this._ratio;this._line.push(new S(t*n,i*n))}close(){const t=this._line;t&&!t[0].isEqual(t[t.length-1])&&t.push(t[0])}result(){return this._line&&this._lines.push(this._line),this._lines.length===0?null:this._lines}}var N;(function(o){o[o.sideLeft=0]="sideLeft",o[o.sideRight=1]="sideRight",o[o.sideTop=2]="sideTop",o[o.sideBottom=3]="sideBottom"})(N||(N={}));class F{static simplify(t,i,n){if(!n)return;const h=-i,r=t+i,x=-i,a=t+i,y=[],u=[],b=n.length;for(let m=0;m_.y?(y.push(m),y.push(d),y.push(N.sideLeft),y.push(-1)):(u.push(m),u.push(d),u.push(N.sideLeft),u.push(-1))),l.x>=r&&(l.y<_.y?(y.push(m),y.push(d),y.push(N.sideRight),y.push(-1)):(u.push(m),u.push(d),u.push(N.sideRight),u.push(-1)))),l.y===_.y&&(l.y<=x&&(l.x<_.x?(y.push(m),y.push(d),y.push(N.sideTop),y.push(-1)):(u.push(m),u.push(d),u.push(N.sideTop),u.push(-1))),l.y>=a&&(l.x>_.x?(y.push(m),y.push(d),y.push(N.sideBottom),y.push(-1)):(u.push(m),u.push(d),u.push(N.sideBottom),u.push(-1)))),l=_}if(y.length===0||u.length===0)return;F.fillParent(n,u,y),F.fillParent(n,y,u);const T=[];F.calcDeltas(T,u,y),F.calcDeltas(T,y,u),F.addDeltas(T,n)}static fillParent(t,i,n){const h=n.length,r=i.length;for(let x=0;x1&&h[x-2]===r?0:(h.push(r),F.calcDelta(r,n,i,h)+1)}static addDeltas(t,i){const n=t.length;let h=0;for(let r=0;rh&&(h=x)}for(let r=0;rr.key.level-e.key.level!=0?r.key.level-e.key.level:r.key.row-e.key.row!=0?r.key.row-e.key.row:r.key.col-e.key.col;class v extends f{constructor(e){super(),this._tileInfoView=e}get requiresDedicatedFBO(){return!1}renderChildren(e){this.sortChildren(w),this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:t}=e,s=super.createRenderParams(e);return s.requiredLevel=this._tileInfoView.getClosestInfoForScale(t.scale).level,s.displayLevel=this._tileInfoView.tileInfo.scaleToZoom(t.scale),s}prepareRenderPasses(e){const t=super.prepareRenderPasses(e);return t.push(e.registerRenderPass({name:"stencil",brushes:[m],drawPhase:o.DEBUG|o.MAP|o.HIGHLIGHT,target:()=>this.getStencilTarget()})),p("esri-tiles-debug")&&t.push(e.registerRenderPass({name:"tileInfo",brushes:[y],drawPhase:o.DEBUG,target:()=>this.children})),t}getStencilTarget(){return this.children}setStencilReference(e){let t=1;for(const s of this.children)s.stencilRef=t++}}export{v as i,P as r}; +import{bN as c,cn as d,b2 as u,m as p}from"./index.221827cd.js";import{r as g}from"./utils.0160becb.js";import{I as o}from"./Utils.2136650a.js";import{o as f,h as m,x as y}from"./WGLContainer.347cc5cd.js";class P extends g{constructor(e,t,s,l,i,n,a=i,h=n){super(),this.triangleCountReportedInDebug=0,this.triangleCount=0,this.texture=null,this.key=new c(e),this.resolution=t,this.x=s,this.y=l,this.width=i,this.height=n,this.rangeX=a,this.rangeY=h}destroy(){this.texture&&(this.texture.dispose(),this.texture=null)}setTransform(e){const t=this.resolution/(e.resolution*e.pixelRatio),s=this.transforms.tileMat3,[l,i]=e.toScreenNoRotation([0,0],[this.x,this.y]),n=this.width/this.rangeX*t,a=this.height/this.rangeY*t;d(s,n,0,0,0,a,0,l,i,1),u(this.transforms.dvs,e.displayViewMat3,s)}}const w=(r,e)=>r.key.level-e.key.level!=0?r.key.level-e.key.level:r.key.row-e.key.row!=0?r.key.row-e.key.row:r.key.col-e.key.col;class v extends f{constructor(e){super(),this._tileInfoView=e}get requiresDedicatedFBO(){return!1}renderChildren(e){this.sortChildren(w),this.setStencilReference(e),super.renderChildren(e)}createRenderParams(e){const{state:t}=e,s=super.createRenderParams(e);return s.requiredLevel=this._tileInfoView.getClosestInfoForScale(t.scale).level,s.displayLevel=this._tileInfoView.tileInfo.scaleToZoom(t.scale),s}prepareRenderPasses(e){const t=super.prepareRenderPasses(e);return t.push(e.registerRenderPass({name:"stencil",brushes:[m],drawPhase:o.DEBUG|o.MAP|o.HIGHLIGHT,target:()=>this.getStencilTarget()})),p("esri-tiles-debug")&&t.push(e.registerRenderPass({name:"tileInfo",brushes:[y],drawPhase:o.DEBUG,target:()=>this.children})),t}getStencilTarget(){return this.children}setStencilReference(e){let t=1;for(const s of this.children)s.stencilRef=t++}}export{v as i,P as r}; diff --git a/assets/TileLayer.42bba12d.js b/assets/TileLayer.d3072542.js similarity index 94% rename from assets/TileLayer.42bba12d.js rename to assets/TileLayer.d3072542.js index 2779aab..7a583a4 100644 --- a/assets/TileLayer.42bba12d.js +++ b/assets/TileLayer.d3072542.js @@ -1 +1 @@ -import{i2 as g,i3 as m,eF as _,eG as S,eE as T,eH as b,a4 as w,ia as O,il as R,iJ as U,c as d,aU as W,aT as f,bX as $,U as h,dR as j,n as u,cy as B,gj as P,cG as I,eB as L,a6 as a,a7 as o,d2 as D,e0 as M,cw as k,eK as A,a8 as C,cF as N}from"./index.d94abe07.js";import{s as J}from"./ArcGISCachedService.e7d85534.js";import{E as G,y as q,z as E}from"./SublayersOwner.8a52d000.js";import"./TilemapCache.11964483.js";import"./Version.59f2da65.js";import"./sublayerUtils.9d6cbcc3.js";const y=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let t=class extends g(G(m(_(S(J(q(T(b(w(O(R(U(N))))))))))))){constructor(...e){super(...e),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}load(e){const r=d(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(W).then(()=>this._fetchService(r))),Promise.resolve(this)}get attributionDataUrl(){var r;const e=(r=this.parsedUrl)==null?void 0:r.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){return(e=e||r.tileInfo&&r.tileInfo.spatialReference)&&f.fromJSON(e)}writeSublayers(e,r,s,i){if(!this.loaded||!e)return;const p=e.slice().reverse().flatten(({sublayers:n})=>n&&n.toArray().reverse()).toArray(),l=[],c={writeSublayerStructure:!1,...i};p.forEach(n=>{const v=n.write({},c);l.push(v)}),l.some(n=>Object.keys(n).length>1)&&(r.layers=l)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl.path)}castTileServers(e){return Array.isArray(e)?e.map(r=>$(r).path):null}fetchTile(e,r,s,i={}){const{signal:p}=i,l=this.getTileUrl(e,r,s),c={responseType:"image",signal:p,query:{...this.refreshParameters}};return h(l,c).then(n=>n.data)}async fetchImageBitmapTile(e,r,s,i={}){const{signal:p}=i,l=this.getTileUrl(e,r,s),c={responseType:"blob",signal:p,query:{...this.refreshParameters}},n=await h(l,c);return createImageBitmap(n.data)}getTileUrl(e,r,s){const i=!this.tilemapCache&&this.supportsBlankTile,p=j({...this.parsedUrl.query,blankTile:!i&&null,...this.customParameters,token:this.apiKey}),l=this.tileServers;return`${l&&l.length?l[r%l.length]:this.parsedUrl.path}/tile/${e}/${r}/${s}${p?"?"+p:""}`}_fetchService(e){return new Promise((r,s)=>{if(this.sourceJSON){if(this.sourceJSON.bandCount!=null&&this.sourceJSON.pixelSizeX!=null)throw new u("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void r({data:this.sourceJSON})}if(!this.parsedUrl)throw new u("tile-layer:undefined-url","layer's url is not defined");const i=B(this.parsedUrl.path);if(d(i)&&i.serverType==="ImageServer")throw new u("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");h(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(r,s)}).then(r=>{if(r.ssl&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),this.version===10.1&&!P(this.url))return this._fetchServerVersion(this.url,e).then(s=>{this.read({currentVersion:s})}).catch(()=>{})})}_fetchServerVersion(e,r){if(!I(e))return Promise.reject();const s=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return h(s,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(i=>{if(i.data&&i.data.currentVersion)return i.data.currentVersion;throw new u("tile-layer:version-not-available")})}_getMapName(e){const r=e.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/mapserver/i);return r&&r[2]}_getDefaultAttribution(e){if(!e)return;let r;e=e.toLowerCase();for(let s=0,i=y.length;s({enabled:!1})}}})],t.prototype,"isReference",void 0),a([o({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],t.prototype,"operationalLayerType",void 0),a([o({type:Boolean})],t.prototype,"resampling",void 0),a([o()],t.prototype,"sourceJSON",void 0),a([o({type:f})],t.prototype,"spatialReference",void 0),a([D("spatialReference",["spatialReference","tileInfo"])],t.prototype,"readSpatialReference",null),a([o({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],t.prototype,"path",void 0),a([o({readOnly:!0})],t.prototype,"sublayers",void 0),a([M("sublayers",{layers:{type:[E]}})],t.prototype,"writeSublayers",null),a([o({json:{read:!1,write:!1}})],t.prototype,"popupEnabled",void 0),a([o()],t.prototype,"tileServers",null),a([k("tileServers")],t.prototype,"castTileServers",null),a([o({readOnly:!0,json:{read:!1}})],t.prototype,"type",void 0),a([o(A)],t.prototype,"url",void 0),t=a([C("esri.layers.TileLayer")],t),t.prototype.fetchTile.__isDefault__=!0;const X=t;export{X as default}; +import{i2 as g,i3 as m,eF as _,eG as S,eE as T,eH as b,a4 as w,ia as O,il as R,iJ as U,c as d,aU as W,aT as f,bX as $,U as h,dR as j,n as u,cy as B,gj as P,cG as I,eB as L,a6 as a,a7 as o,d2 as D,e0 as M,cw as k,eK as A,a8 as C,cF as N}from"./index.221827cd.js";import{s as J}from"./ArcGISCachedService.a530cd26.js";import{E as G,y as q,z as E}from"./SublayersOwner.fd9e3967.js";import"./TilemapCache.b64a2ea8.js";import"./Version.433fbe58.js";import"./sublayerUtils.59f5d9da.js";const y=["Canvas/World_Dark_Gray_Base","Canvas/World_Dark_Gray_Reference","Canvas/World_Light_Gray_Base","Canvas/World_Light_Gray_Reference","Elevation/World_Hillshade","Elevation/World_Hillshade_Dark","Ocean/World_Ocean_Base","Ocean/World_Ocean_Reference","Ocean_Basemap","Reference/World_Boundaries_and_Places","Reference/World_Boundaries_and_Places_Alternate","Reference/World_Transportation","World_Imagery","World_Street_Map","World_Topo_Map"];let t=class extends g(G(m(_(S(J(q(T(b(w(O(R(U(N))))))))))))){constructor(...e){super(...e),this.listMode="show",this.isReference=null,this.operationalLayerType="ArcGISTiledMapServiceLayer",this.resampling=!0,this.sourceJSON=null,this.spatialReference=null,this.path=null,this.sublayers=null,this.type="tile",this.url=null}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}load(e){const r=d(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["Map Service"]},e).catch(W).then(()=>this._fetchService(r))),Promise.resolve(this)}get attributionDataUrl(){var r;const e=(r=this.parsedUrl)==null?void 0:r.path.toLowerCase();return e?this._getDefaultAttribution(this._getMapName(e)):null}readSpatialReference(e,r){return(e=e||r.tileInfo&&r.tileInfo.spatialReference)&&f.fromJSON(e)}writeSublayers(e,r,s,i){if(!this.loaded||!e)return;const p=e.slice().reverse().flatten(({sublayers:n})=>n&&n.toArray().reverse()).toArray(),l=[],c={writeSublayerStructure:!1,...i};p.forEach(n=>{const v=n.write({},c);l.push(v)}),l.some(n=>Object.keys(n).length>1)&&(r.layers=l)}get tileServers(){return this._getDefaultTileServers(this.parsedUrl.path)}castTileServers(e){return Array.isArray(e)?e.map(r=>$(r).path):null}fetchTile(e,r,s,i={}){const{signal:p}=i,l=this.getTileUrl(e,r,s),c={responseType:"image",signal:p,query:{...this.refreshParameters}};return h(l,c).then(n=>n.data)}async fetchImageBitmapTile(e,r,s,i={}){const{signal:p}=i,l=this.getTileUrl(e,r,s),c={responseType:"blob",signal:p,query:{...this.refreshParameters}},n=await h(l,c);return createImageBitmap(n.data)}getTileUrl(e,r,s){const i=!this.tilemapCache&&this.supportsBlankTile,p=j({...this.parsedUrl.query,blankTile:!i&&null,...this.customParameters,token:this.apiKey}),l=this.tileServers;return`${l&&l.length?l[r%l.length]:this.parsedUrl.path}/tile/${e}/${r}/${s}${p?"?"+p:""}`}_fetchService(e){return new Promise((r,s)=>{if(this.sourceJSON){if(this.sourceJSON.bandCount!=null&&this.sourceJSON.pixelSizeX!=null)throw new u("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");return void r({data:this.sourceJSON})}if(!this.parsedUrl)throw new u("tile-layer:undefined-url","layer's url is not defined");const i=B(this.parsedUrl.path);if(d(i)&&i.serverType==="ImageServer")throw new u("tile-layer:unsupported-url","use ImageryTileLayer to open a tiled image service");h(this.parsedUrl.path,{query:{f:"json",...this.parsedUrl.query,...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(r,s)}).then(r=>{if(r.ssl&&(this.url=this.url.replace(/^http:/i,"https:")),this.sourceJSON=r.data,this.read(r.data,{origin:"service",url:this.parsedUrl}),this.version===10.1&&!P(this.url))return this._fetchServerVersion(this.url,e).then(s=>{this.read({currentVersion:s})}).catch(()=>{})})}_fetchServerVersion(e,r){if(!I(e))return Promise.reject();const s=e.replace(/(.*\/rest)\/.*/i,"$1")+"/info";return h(s,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:r}).then(i=>{if(i.data&&i.data.currentVersion)return i.data.currentVersion;throw new u("tile-layer:version-not-available")})}_getMapName(e){const r=e.match(/^(?:https?:)?\/\/(server\.arcgisonline\.com|services\.arcgisonline\.com|ibasemaps-api\.arcgis\.com)\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/mapserver/i);return r&&r[2]}_getDefaultAttribution(e){if(!e)return;let r;e=e.toLowerCase();for(let s=0,i=y.length;s({enabled:!1})}}})],t.prototype,"isReference",void 0),a([o({readOnly:!0,type:["ArcGISTiledMapServiceLayer"]})],t.prototype,"operationalLayerType",void 0),a([o({type:Boolean})],t.prototype,"resampling",void 0),a([o()],t.prototype,"sourceJSON",void 0),a([o({type:f})],t.prototype,"spatialReference",void 0),a([D("spatialReference",["spatialReference","tileInfo"])],t.prototype,"readSpatialReference",null),a([o({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],t.prototype,"path",void 0),a([o({readOnly:!0})],t.prototype,"sublayers",void 0),a([M("sublayers",{layers:{type:[E]}})],t.prototype,"writeSublayers",null),a([o({json:{read:!1,write:!1}})],t.prototype,"popupEnabled",void 0),a([o()],t.prototype,"tileServers",null),a([k("tileServers")],t.prototype,"castTileServers",null),a([o({readOnly:!0,json:{read:!1}})],t.prototype,"type",void 0),a([o(A)],t.prototype,"url",void 0),t=a([C("esri.layers.TileLayer")],t),t.prototype.fetchTile.__isDefault__=!0;const X=t;export{X as default}; diff --git a/assets/TileLayerView2D.98b348c2.js b/assets/TileLayerView2D.18abd98d.js similarity index 85% rename from assets/TileLayerView2D.98b348c2.js rename to assets/TileLayerView2D.18abd98d.js index ec3024c..a01163a 100644 --- a/assets/TileLayerView2D.98b348c2.js +++ b/assets/TileLayerView2D.18abd98d.js @@ -1 +1 @@ -import{a6 as c,a7 as f,a8 as g,n as y,cB as I,c as v,cV as V,cW as T,cX as q,_ as Q,bK as b,x as m,bN as d,s as S}from"./index.d94abe07.js";import{t as F,o as w,n as _}from"./imageUtils.b93c1581.js";import{y as U,u as x}from"./LayerView.42d17220.js";import{i as C}from"./RefreshableLayerView.28a00159.js";import{s as P,a as R}from"./drapedUtils.e64c9295.js";import"./BitmapTileContainer.3a622161.js";import"./Bitmap.43defcb1.js";import"./utils.4b023c9d.js";import"./Utils.7f6f3a6b.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.229b1dd6.js";import"./TileContainer.8b7fafe2.js";import"./WGLContainer.1850619d.js";import"./pixelUtils.82950e1a.js";import"./VertexArrayObject.a4c1d809.js";import"./ProgramTemplate.e9a5aa54.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";const k=e=>{let t=class extends e{async fetchPopupFeatures(s,r){const{layer:l}=this;if(!s)throw new y("tilelayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:l});if(l.type!=="tile")throw new y("tilelayerview:fetchPopupFeatures","Layer type should be 'tile'",{type:l.type});const h=this.get("view.scale"),n=l.allSublayers.toArray().filter(i=>{const a=i.minScale===0||h<=i.minScale,o=i.maxScale===0||h>=i.maxScale;return i.popupTemplate&&i.popupEnabled&&i.visible&&a&&o});return I(n.map(async i=>{const a=i.createQuery(),o=v(r)?r.event:null,p=P({renderer:i.renderer,event:o});return a.geometry=this.createFetchPopupFeaturesQueryGeometry(s,p),a.outFields=await i.popupTemplate.getRequiredFields(),(await i.queryFeatures(a)).features})).then(i=>[].concat(...i.map(a=>a.value).filter(Boolean)))}};return c([f()],t.prototype,"layer",void 0),t=c([g("esri.layers.mixins.TileLayerView")],t),t},E=[0,0];let u=class extends k(C(F(U(x)))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||this.layer.resampling!==!1}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume()}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null;this._tileInfoView=new V(this.layer.tileInfo,this.layer.fullExtent),this._fetchQueue=new T({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(t,s)=>this.fetchTile(t,s)}),this._tileStrategy=new q({cachePolicy:"keep",resampling:this.resampling,acquireTile:t=>this.acquireTile(t),releaseTile:t=>this.releaseTile(t),tileInfoView:this._tileInfoView}),this.requestUpdate(),this.handles.add(Q(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){var t;return b((t=this.layer.tileInfo)==null?void 0:t.spatialReference,e)}createFetchPopupFeaturesQueryGeometry(e,t){return R(e,t,this.view)}async doRefresh(){!this.attached||this.updateRequested||this.suspended||(this._fetchQueue.reset(),this._tileStrategy.tiles.forEach(e=>this._enqueueTileFetch(e)))}isUpdating(){var e,t;return(t=(e=this._fetchQueue)==null?void 0:e.updating)!=null?t:!1}acquireTile(e){const t=this._bitmapView.createTile(e),s=t.bitmap;return[s.x,s.y]=this._tileInfoView.getTileCoords(E,t.key),s.resolution=this._tileInfoView.getTileResolution(t.key),[s.width,s.height]=this._tileInfoView.tileInfo.size,this._enqueueTileFetch(t),this._bitmapView.addChild(t),this.requestUpdate(),t}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,t={}){const s="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:r,resamplingLevel:l=0}=t;if(!s)try{return await this._fetchImage(e,r)}catch(i){if(!m(i)&&!this.resampling)return w(this._tileInfoView.tileInfo.size);if(l<3){const a=this._tileInfoView.getTileParentId(e.id);if(a){const o=new d(a),p=await this.fetchTile(o,{...t,resamplingLevel:l+1});return _(this._tileInfoView,p,o,e)}}throw i}const h=new d(0,0,0,0);let n;try{if(await s.fetchAvailabilityUpsample(e.level,e.row,e.col,h,{signal:r}),h.level!==e.level&&!this.resampling)return w(this._tileInfoView.tileInfo.size);n=await this._fetchImage(h,r)}catch(i){if(m(i))throw i;n=await this._fetchImage(e,r)}return this.resampling?_(this._tileInfoView,n,h,e):n}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(t){m(t)||S.getLogger(this.declaredClass).error(t)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:t})}};c([f()],u.prototype,"_fetchQueue",void 0),c([f()],u.prototype,"resampling",null),u=c([g("esri.views.2d.layers.TileLayerView2D")],u);const re=u;export{re as default}; +import{a6 as c,a7 as f,a8 as g,n as y,cB as I,c as v,cV as V,cW as T,cX as q,_ as Q,bK as b,x as m,bN as d,s as S}from"./index.221827cd.js";import{t as F,o as w,n as _}from"./imageUtils.215a62b1.js";import{y as U,u as x}from"./LayerView.ce6e0535.js";import{i as C}from"./RefreshableLayerView.887ed8c3.js";import{s as P,a as R}from"./drapedUtils.0866c85c.js";import"./BitmapTileContainer.f5b20598.js";import"./Bitmap.72a3702e.js";import"./utils.0160becb.js";import"./Utils.2136650a.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.0cadabc1.js";import"./TileContainer.5aeb32d6.js";import"./WGLContainer.347cc5cd.js";import"./pixelUtils.9c6f8dae.js";import"./VertexArrayObject.53cf1857.js";import"./ProgramTemplate.cf9dd4e8.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";const k=e=>{let t=class extends e{async fetchPopupFeatures(s,r){const{layer:l}=this;if(!s)throw new y("tilelayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:l});if(l.type!=="tile")throw new y("tilelayerview:fetchPopupFeatures","Layer type should be 'tile'",{type:l.type});const h=this.get("view.scale"),n=l.allSublayers.toArray().filter(i=>{const a=i.minScale===0||h<=i.minScale,o=i.maxScale===0||h>=i.maxScale;return i.popupTemplate&&i.popupEnabled&&i.visible&&a&&o});return I(n.map(async i=>{const a=i.createQuery(),o=v(r)?r.event:null,p=P({renderer:i.renderer,event:o});return a.geometry=this.createFetchPopupFeaturesQueryGeometry(s,p),a.outFields=await i.popupTemplate.getRequiredFields(),(await i.queryFeatures(a)).features})).then(i=>[].concat(...i.map(a=>a.value).filter(Boolean)))}};return c([f()],t.prototype,"layer",void 0),t=c([g("esri.layers.mixins.TileLayerView")],t),t},E=[0,0];let u=class extends k(C(F(U(x)))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this.layer=null}get resampling(){return!("resampling"in this.layer)||this.layer.resampling!==!1}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume()}attach(){const e="tileServers"in this.layer?this.layer.tileServers:null;this._tileInfoView=new V(this.layer.tileInfo,this.layer.fullExtent),this._fetchQueue=new T({tileInfoView:this._tileInfoView,concurrency:e&&10*e.length||10,process:(t,s)=>this.fetchTile(t,s)}),this._tileStrategy=new q({cachePolicy:"keep",resampling:this.resampling,acquireTile:t=>this.acquireTile(t),releaseTile:t=>this.releaseTile(t),tileInfoView:this._tileInfoView}),this.requestUpdate(),this.handles.add(Q(()=>this.resampling,()=>{this.doRefresh()})),super.attach()}detach(){super.detach(),this._tileStrategy.destroy(),this._fetchQueue.clear(),this.container.removeAllChildren(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}supportsSpatialReference(e){var t;return b((t=this.layer.tileInfo)==null?void 0:t.spatialReference,e)}createFetchPopupFeaturesQueryGeometry(e,t){return R(e,t,this.view)}async doRefresh(){!this.attached||this.updateRequested||this.suspended||(this._fetchQueue.reset(),this._tileStrategy.tiles.forEach(e=>this._enqueueTileFetch(e)))}isUpdating(){var e,t;return(t=(e=this._fetchQueue)==null?void 0:e.updating)!=null?t:!1}acquireTile(e){const t=this._bitmapView.createTile(e),s=t.bitmap;return[s.x,s.y]=this._tileInfoView.getTileCoords(E,t.key),s.resolution=this._tileInfoView.getTileResolution(t.key),[s.width,s.height]=this._tileInfoView.tileInfo.size,this._enqueueTileFetch(t),this._bitmapView.addChild(t),this.requestUpdate(),t}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}async fetchTile(e,t={}){const s="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:r,resamplingLevel:l=0}=t;if(!s)try{return await this._fetchImage(e,r)}catch(i){if(!m(i)&&!this.resampling)return w(this._tileInfoView.tileInfo.size);if(l<3){const a=this._tileInfoView.getTileParentId(e.id);if(a){const o=new d(a),p=await this.fetchTile(o,{...t,resamplingLevel:l+1});return _(this._tileInfoView,p,o,e)}}throw i}const h=new d(0,0,0,0);let n;try{if(await s.fetchAvailabilityUpsample(e.level,e.row,e.col,h,{signal:r}),h.level!==e.level&&!this.resampling)return w(this._tileInfoView.tileInfo.size);n=await this._fetchImage(h,r)}catch(i){if(m(i))throw i;n=await this._fetchImage(e,r)}return this.resampling?_(this._tileInfoView,n,h,e):n}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(t){m(t)||S.getLogger(this.declaredClass).error(t)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:t})}};c([f()],u.prototype,"_fetchQueue",void 0),c([f()],u.prototype,"resampling",null),u=c([g("esri.views.2d.layers.TileLayerView2D")],u);const re=u;export{re as default}; diff --git a/assets/TilemapCache.11964483.js b/assets/TilemapCache.b64a2ea8.js similarity index 99% rename from assets/TilemapCache.11964483.js rename to assets/TilemapCache.b64a2ea8.js index f42441c..b2fdae4 100644 --- a/assets/TilemapCache.11964483.js +++ b/assets/TilemapCache.b64a2ea8.js @@ -1 +1 @@ -import{du as w,U as T,eL as O,n as m,b4 as L,a4 as D,eM as q,c2 as N,_ as $,s as C,C as P,x as S,eN as x,c1 as U,dR as j,eO as k,a6 as v,a7 as b,cw as E,c_ as J,D as M,cP as B,a8 as F,a9 as I}from"./index.d94abe07.js";const H={type:w,json:{origins:{service:{read:{source:["tileInfo","minScale","maxScale","minLOD","maxLOD"],reader:R}}}}};function R(e,i,a,t){if(!e)return null;const{minScale:l,maxScale:n,minLOD:o,maxLOD:r}=i;if(o!=null&&r!=null)return t&&t.ignoreMinMaxLOD?w.fromJSON(e):w.fromJSON({...e,lods:e.lods.filter(({level:h})=>h!=null&&h>=o&&h<=r)});if(l!==0&&n!==0){const h=u=>Math.round(1e4*u)/1e4,s=l?h(l):1/0,c=n?h(n):-1/0;return w.fromJSON({...e,lods:e.lods.filter(u=>{const f=h(u.scale);return f<=s&&f>=c})})}return w.fromJSON(e)}class y{constructor(){this.location={left:0,top:0,width:0,height:0},this._allAvailability="unknown",this.byteSize=40}getAvailability(i,a){if(this._allAvailability!=="unknown")return this._allAvailability;const t=(i-this.location.top)*this.location.width+(a-this.location.left),l=t%8,n=t>>3,o=this._tileAvailabilityBitSet;return n<0||n>o.length?"unknown":o[n]&1<s.data).catch(s=>{if(s&&s.details&&s.details.httpStatus===422)return{location:{top:l,left:n,width:o,height:r},valid:!0,data:O(o*r,0)};throw s}).then(s=>{if(s.location&&(s.location.top!==l||s.location.left!==n||s.location.width!==o||s.location.height!==r))throw new m("tilemap:location-mismatch","Tilemap response for different location than requested",{response:s,definition:{top:l,left:n,width:o,height:r}});return y.fromJSON(s)})}static fromJSON(i){y._validateJSON(i);const a=new y;return a.location=Object.freeze(L(i.location)),a._updateFromData(i.data),Object.freeze(a)}static _validateJSON(i){if(!i||!i.location)throw new m("tilemap:missing-location","Location missing from tilemap response");if(i.valid===!1)throw new m("tilemap:invalid","Tilemap response was marked as invalid");if(!i.data)throw new m("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(i.data))throw new m("tilemap:data-mismatch","Data must be an array of numbers");if(i.data.length!==i.location.width*i.location.height)throw new m("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}}function A(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function K(e){let i;if(e.service.type==="vector-tile")i=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;else{const t=e.service.tileServers;i=`${t&&t.length?t[e.row%t.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}const a=e.service.query;return a&&(i=`${i}?${a}`),i}var d;let p=d=class extends D(I){constructor(e){super(e),this._pendingTilemapRequests={},this._availableLevels={},this.levels=5,this.cacheByteSize=2*q.MEGABYTES,this.request=T,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new N(this.cacheByteSize),this.addHandles([$(()=>{const{layer:e}=this;return[e==null?void 0:e.parsedUrl,e==null?void 0:e.tileServers,e==null?void 0:e.apiKey,e==null?void 0:e.customParameters]},()=>this._initializeTilemapDefinition()),$(()=>{var e,i;return(i=(e=this.layer)==null?void 0:e.tileInfo)==null?void 0:i.lods},e=>this._initializeAvailableLevels(e),J)]),this._initializeTilemapDefinition()}castLevels(e){return e<=2?(C.getLogger(this.declaredClass).error("Minimum levels for Tilemap is 3, but got ",e),3):e}get size(){return 1<{P(o,()=>h(M()));const s=A(l);let c=this._pendingTilemapRequests[s];if(!c){c=y.fromDefinition(l,t).then(f=>(this._tilemapCache.put(s,f,f.byteSize),f));const u=()=>delete this._pendingTilemapRequests[s];this._pendingTilemapRequests[s]=c,c.then(u,u)}c.then(r,h)})}getAvailability(e,i,a){if(!this._availableLevels[e])return"unavailable";const t=this._tilemapFromCache(e,i,a,this._tmpTilemapDefinition);return t?t.getAvailability(i,a):"unknown"}fetchAvailability(e,i,a,t){return this._availableLevels[e]?this.fetchTilemap(e,i,a,t).catch(l=>l).then(l=>{if(l instanceof y){const n=l.getAvailability(i,a);if(n==="unavailable")throw new m("tile-map:tile-unavailable","Tile is not available",{level:e,row:i,col:a});return n}if(S(l))throw l;return"unknown"}):Promise.reject(new m("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`))}fetchAvailabilityUpsample(e,i,a,t,l){t.level=e,t.row=i,t.col=a;const n=this.layer.tileInfo;n.updateTileInfo(t);const o=this.fetchAvailability(e,i,a,l).catch(r=>{if(S(r))throw r;if(n.upsampleTile(t))return this.fetchAvailabilityUpsample(t.level,t.row,t.col,t);throw r});return this._fetchAvailabilityUpsamplePrefetch(t.id,e,i,a,l,o),o}async _fetchAvailabilityUpsamplePrefetch(e,i,a,t,l,n){if(!this._prefetchingEnabled)return;const o=`prefetch-${e}`;if(this.handles.has(o))return;const r=new AbortController;n.then(()=>r.abort(),()=>r.abort());let h=!1;const s={remove(){h||(h=!0,r.abort())}};if(this.handles.add(s,o),await x(10,r.signal).catch(()=>{}),h||(h=!0,this.handles.remove(o)),U(r))return;const c=new B(e,i,a,t),u={...l,signal:r.signal},f=this.layer.tileInfo;for(let z=0;d._prefetches.length{d._prefetches.removeUnordered(g)};g.then(_,_)}}_initializeTilemapDefinition(){var t;if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:i,customParameters:a}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:j({...e.query,...a,token:i!=null?i:(t=e.query)==null?void 0:t.token}),tileServers:this.layer.tileServers,request:this.request,type:this.layer.type},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,i,a,t){t.level=e,t.row=i-i%this.size,t.col=a-a%this.size;const l=A(t);return this._tilemapCache.get(l)}_initializeAvailableLevels(e){this._availableLevels={},e&&e.forEach(i=>this._availableLevels[i.level]=!0)}get test(){const e=this;return{get prefetchingEnabled(){return e._prefetchingEnabled},set prefetchingEnabled(i){e._prefetchingEnabled=i},hasTilemap:(i,a,t)=>!!e._tilemapFromCache(i,a,t,e._tmpTilemapDefinition)}}};p._maxPrefetch=4,p._prefetches=new k({initialSize:d._maxPrefetch}),v([b({constructOnly:!0,type:Number})],p.prototype,"levels",void 0),v([E("levels")],p.prototype,"castLevels",null),v([b({readOnly:!0,type:Number})],p.prototype,"size",null),v([b({constructOnly:!0,type:Number})],p.prototype,"cacheByteSize",void 0),v([b({constructOnly:!0})],p.prototype,"layer",void 0),v([b({constructOnly:!0})],p.prototype,"request",void 0),p=d=v([F("esri.layers.support.TilemapCache")],p);export{R as n,H as r,p as z}; +import{du as w,U as T,eL as O,n as m,b4 as L,a4 as D,eM as q,c2 as N,_ as $,s as C,C as P,x as S,eN as x,c1 as U,dR as j,eO as k,a6 as v,a7 as b,cw as E,c_ as J,D as M,cP as B,a8 as F,a9 as I}from"./index.221827cd.js";const H={type:w,json:{origins:{service:{read:{source:["tileInfo","minScale","maxScale","minLOD","maxLOD"],reader:R}}}}};function R(e,i,a,t){if(!e)return null;const{minScale:l,maxScale:n,minLOD:o,maxLOD:r}=i;if(o!=null&&r!=null)return t&&t.ignoreMinMaxLOD?w.fromJSON(e):w.fromJSON({...e,lods:e.lods.filter(({level:h})=>h!=null&&h>=o&&h<=r)});if(l!==0&&n!==0){const h=u=>Math.round(1e4*u)/1e4,s=l?h(l):1/0,c=n?h(n):-1/0;return w.fromJSON({...e,lods:e.lods.filter(u=>{const f=h(u.scale);return f<=s&&f>=c})})}return w.fromJSON(e)}class y{constructor(){this.location={left:0,top:0,width:0,height:0},this._allAvailability="unknown",this.byteSize=40}getAvailability(i,a){if(this._allAvailability!=="unknown")return this._allAvailability;const t=(i-this.location.top)*this.location.width+(a-this.location.left),l=t%8,n=t>>3,o=this._tileAvailabilityBitSet;return n<0||n>o.length?"unknown":o[n]&1<s.data).catch(s=>{if(s&&s.details&&s.details.httpStatus===422)return{location:{top:l,left:n,width:o,height:r},valid:!0,data:O(o*r,0)};throw s}).then(s=>{if(s.location&&(s.location.top!==l||s.location.left!==n||s.location.width!==o||s.location.height!==r))throw new m("tilemap:location-mismatch","Tilemap response for different location than requested",{response:s,definition:{top:l,left:n,width:o,height:r}});return y.fromJSON(s)})}static fromJSON(i){y._validateJSON(i);const a=new y;return a.location=Object.freeze(L(i.location)),a._updateFromData(i.data),Object.freeze(a)}static _validateJSON(i){if(!i||!i.location)throw new m("tilemap:missing-location","Location missing from tilemap response");if(i.valid===!1)throw new m("tilemap:invalid","Tilemap response was marked as invalid");if(!i.data)throw new m("tilemap:missing-data","Data missing from tilemap response");if(!Array.isArray(i.data))throw new m("tilemap:data-mismatch","Data must be an array of numbers");if(i.data.length!==i.location.width*i.location.height)throw new m("tilemap:data-mismatch","Number of data items does not match width/height of tilemap")}}function A(e){return`${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}function K(e){let i;if(e.service.type==="vector-tile")i=`${e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`;else{const t=e.service.tileServers;i=`${t&&t.length?t[e.row%t.length]:e.service.url}/tilemap/${e.level}/${e.row}/${e.col}/${e.width}/${e.height}`}const a=e.service.query;return a&&(i=`${i}?${a}`),i}var d;let p=d=class extends D(I){constructor(e){super(e),this._pendingTilemapRequests={},this._availableLevels={},this.levels=5,this.cacheByteSize=2*q.MEGABYTES,this.request=T,this._prefetchingEnabled=!0}initialize(){this._tilemapCache=new N(this.cacheByteSize),this.addHandles([$(()=>{const{layer:e}=this;return[e==null?void 0:e.parsedUrl,e==null?void 0:e.tileServers,e==null?void 0:e.apiKey,e==null?void 0:e.customParameters]},()=>this._initializeTilemapDefinition()),$(()=>{var e,i;return(i=(e=this.layer)==null?void 0:e.tileInfo)==null?void 0:i.lods},e=>this._initializeAvailableLevels(e),J)]),this._initializeTilemapDefinition()}castLevels(e){return e<=2?(C.getLogger(this.declaredClass).error("Minimum levels for Tilemap is 3, but got ",e),3):e}get size(){return 1<{P(o,()=>h(M()));const s=A(l);let c=this._pendingTilemapRequests[s];if(!c){c=y.fromDefinition(l,t).then(f=>(this._tilemapCache.put(s,f,f.byteSize),f));const u=()=>delete this._pendingTilemapRequests[s];this._pendingTilemapRequests[s]=c,c.then(u,u)}c.then(r,h)})}getAvailability(e,i,a){if(!this._availableLevels[e])return"unavailable";const t=this._tilemapFromCache(e,i,a,this._tmpTilemapDefinition);return t?t.getAvailability(i,a):"unknown"}fetchAvailability(e,i,a,t){return this._availableLevels[e]?this.fetchTilemap(e,i,a,t).catch(l=>l).then(l=>{if(l instanceof y){const n=l.getAvailability(i,a);if(n==="unavailable")throw new m("tile-map:tile-unavailable","Tile is not available",{level:e,row:i,col:a});return n}if(S(l))throw l;return"unknown"}):Promise.reject(new m("tilemap-cache:level-unavailable",`Level ${e} is unavailable in the service`))}fetchAvailabilityUpsample(e,i,a,t,l){t.level=e,t.row=i,t.col=a;const n=this.layer.tileInfo;n.updateTileInfo(t);const o=this.fetchAvailability(e,i,a,l).catch(r=>{if(S(r))throw r;if(n.upsampleTile(t))return this.fetchAvailabilityUpsample(t.level,t.row,t.col,t);throw r});return this._fetchAvailabilityUpsamplePrefetch(t.id,e,i,a,l,o),o}async _fetchAvailabilityUpsamplePrefetch(e,i,a,t,l,n){if(!this._prefetchingEnabled)return;const o=`prefetch-${e}`;if(this.handles.has(o))return;const r=new AbortController;n.then(()=>r.abort(),()=>r.abort());let h=!1;const s={remove(){h||(h=!0,r.abort())}};if(this.handles.add(s,o),await x(10,r.signal).catch(()=>{}),h||(h=!0,this.handles.remove(o)),U(r))return;const c=new B(e,i,a,t),u={...l,signal:r.signal},f=this.layer.tileInfo;for(let z=0;d._prefetches.length{d._prefetches.removeUnordered(g)};g.then(_,_)}}_initializeTilemapDefinition(){var t;if(!this.layer.parsedUrl)return;const{parsedUrl:e,apiKey:i,customParameters:a}=this.layer;this._tilemapCache.clear(),this._tmpTilemapDefinition={service:{url:e.path,query:j({...e.query,...a,token:i!=null?i:(t=e.query)==null?void 0:t.token}),tileServers:this.layer.tileServers,request:this.request,type:this.layer.type},width:this.size,height:this.size,level:0,row:0,col:0}}_tilemapFromCache(e,i,a,t){t.level=e,t.row=i-i%this.size,t.col=a-a%this.size;const l=A(t);return this._tilemapCache.get(l)}_initializeAvailableLevels(e){this._availableLevels={},e&&e.forEach(i=>this._availableLevels[i.level]=!0)}get test(){const e=this;return{get prefetchingEnabled(){return e._prefetchingEnabled},set prefetchingEnabled(i){e._prefetchingEnabled=i},hasTilemap:(i,a,t)=>!!e._tilemapFromCache(i,a,t,e._tmpTilemapDefinition)}}};p._maxPrefetch=4,p._prefetches=new k({initialSize:d._maxPrefetch}),v([b({constructOnly:!0,type:Number})],p.prototype,"levels",void 0),v([E("levels")],p.prototype,"castLevels",null),v([b({readOnly:!0,type:Number})],p.prototype,"size",null),v([b({constructOnly:!0,type:Number})],p.prototype,"cacheByteSize",void 0),v([b({constructOnly:!0})],p.prototype,"layer",void 0),v([b({constructOnly:!0})],p.prototype,"request",void 0),p=d=v([F("esri.layers.support.TilemapCache")],p);export{R as n,H as r,p as z}; diff --git a/assets/UnknownLayer.08ed3ee7.js b/assets/UnknownLayer.5555c7bd.js similarity index 91% rename from assets/UnknownLayer.08ed3ee7.js rename to assets/UnknownLayer.5555c7bd.js index 3feae59..9b07b30 100644 --- a/assets/UnknownLayer.08ed3ee7.js +++ b/assets/UnknownLayer.5555c7bd.js @@ -1 +1 @@ -import{eG as i,eH as y,k9 as l,a6 as o,a7 as t,a8 as p,cF as u,n as d}from"./index.d94abe07.js";let e=class extends i(y(u)){constructor(r){super(r),this.resourceInfo=null,this.type="unknown"}initialize(){this.addResolvingPromise(new Promise((r,s)=>{l(()=>{const n=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let a="Unknown layer type";n&&(a+=" "+n),s(new d("layer:unknown-layer-type",a,{layerType:n}))})}))}read(r,s){super.read({resourceInfo:r},s)}write(){return null}};o([t({readOnly:!0})],e.prototype,"resourceInfo",void 0),o([t({type:["show","hide"]})],e.prototype,"listMode",void 0),o([t({json:{read:!1},readOnly:!0,value:"unknown"})],e.prototype,"type",void 0),e=o([p("esri.layers.UnknownLayer")],e);const w=e;export{w as default}; +import{eG as i,eH as y,k9 as l,a6 as o,a7 as t,a8 as p,cF as u,n as d}from"./index.221827cd.js";let e=class extends i(y(u)){constructor(r){super(r),this.resourceInfo=null,this.type="unknown"}initialize(){this.addResolvingPromise(new Promise((r,s)=>{l(()=>{const n=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let a="Unknown layer type";n&&(a+=" "+n),s(new d("layer:unknown-layer-type",a,{layerType:n}))})}))}read(r,s){super.read({resourceInfo:r},s)}write(){return null}};o([t({readOnly:!0})],e.prototype,"resourceInfo",void 0),o([t({type:["show","hide"]})],e.prototype,"listMode",void 0),o([t({json:{read:!1},readOnly:!0,value:"unknown"})],e.prototype,"type",void 0),e=o([p("esri.layers.UnknownLayer")],e);const w=e;export{w as default}; diff --git a/assets/UnsupportedLayer.518b4e2c.js b/assets/UnsupportedLayer.5a5fca4b.js similarity index 92% rename from assets/UnsupportedLayer.518b4e2c.js rename to assets/UnsupportedLayer.5a5fca4b.js index 96e7300..65930d0 100644 --- a/assets/UnsupportedLayer.518b4e2c.js +++ b/assets/UnsupportedLayer.5a5fca4b.js @@ -1 +1 @@ -import{eG as a,eH as p,k9 as l,a6 as r,a7 as i,a8 as u,cF as d,n as y}from"./index.d94abe07.js";let t=class extends a(p(d)){constructor(e){super(e),this.resourceInfo=null,this.type="unsupported"}initialize(){this.addResolvingPromise(new Promise((e,o)=>{l(()=>{const s=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let n="Unsupported layer type";s&&(n+=" "+s),o(new y("layer:unsupported-layer-type",n,{layerType:s}))})}))}read(e,o){const s={resourceInfo:e};e.id!=null&&(s.id=e.id),e.title!=null&&(s.title=e.title),super.read(s,o)}write(e){return Object.assign(e||{},this.resourceInfo,{id:this.id})}};r([i({readOnly:!0})],t.prototype,"resourceInfo",void 0),r([i({type:["show","hide"]})],t.prototype,"listMode",void 0),r([i({json:{read:!1},readOnly:!0,value:"unsupported"})],t.prototype,"type",void 0),t=r([u("esri.layers.UnsupportedLayer")],t);const h=t;export{h as default}; +import{eG as a,eH as p,k9 as l,a6 as r,a7 as i,a8 as u,cF as d,n as y}from"./index.221827cd.js";let t=class extends a(p(d)){constructor(e){super(e),this.resourceInfo=null,this.type="unsupported"}initialize(){this.addResolvingPromise(new Promise((e,o)=>{l(()=>{const s=this.resourceInfo&&(this.resourceInfo.layerType||this.resourceInfo.type);let n="Unsupported layer type";s&&(n+=" "+s),o(new y("layer:unsupported-layer-type",n,{layerType:s}))})}))}read(e,o){const s={resourceInfo:e};e.id!=null&&(s.id=e.id),e.title!=null&&(s.title=e.title),super.read(s,o)}write(e){return Object.assign(e||{},this.resourceInfo,{id:this.id})}};r([i({readOnly:!0})],t.prototype,"resourceInfo",void 0),r([i({type:["show","hide"]})],t.prototype,"listMode",void 0),r([i({json:{read:!1},readOnly:!0,value:"unsupported"})],t.prototype,"type",void 0),t=r([u("esri.layers.UnsupportedLayer")],t);const h=t;export{h as default}; diff --git a/assets/Util.ea9235b8.js b/assets/Util.f17667f9.js similarity index 86% rename from assets/Util.ea9235b8.js rename to assets/Util.f17667f9.js index 578cb39..258f59d 100644 --- a/assets/Util.ea9235b8.js +++ b/assets/Util.f17667f9.js @@ -1 +1 @@ -import{fU as g,M as v,fy as h,fD as m,fz as p,h7 as w,ad as x,a1 as A,fG as E}from"./index.d94abe07.js";import{s as b,c as d}from"./sphere.ec1f4496.js";function l(r){return r?{origin:g(r.origin),vector:g(r.vector)}:{origin:v(),vector:v()}}function D(r,o,e=l()){return h(e.origin,r),m(e.vector,o,r),e}function G(r,o,e){return j(r,o,0,1,e)}function j(r,o,e,f,i){const{vector:s,origin:t}=r,n=m(d.get(),o,t),c=p(s,n)/w(s);return x(i,s,A(c,e,f)),E(i,i,r.origin)}new b(()=>l());class k{constructor(o){this.message=o}toString(){return`AssertException: ${this.message}`}}function M(r,o){if(!r)throw o=o||"assert",console.log(new Error(o).stack),new k(o)}function P(r,o,e,f){let i,s=(e[0]-r[0])/o[0],t=(f[0]-r[0])/o[0];s>t&&(i=s,s=t,t=i);let n=(e[1]-r[1])/o[1],c=(f[1]-r[1])/o[1];if(n>c&&(i=n,n=c,c=i),s>c||n>t)return!1;n>s&&(s=n),ca&&(i=u,u=a,a=i),!(s>a||u>t)&&(al());class k{constructor(o){this.message=o}toString(){return`AssertException: ${this.message}`}}function M(r,o){if(!r)throw o=o||"assert",console.log(new Error(o).stack),new k(o)}function P(r,o,e,f){let i,s=(e[0]-r[0])/o[0],t=(f[0]-r[0])/o[0];s>t&&(i=s,s=t,t=i);let n=(e[1]-r[1])/o[1],c=(f[1]-r[1])/o[1];if(n>c&&(i=n,n=c,c=i),s>c||n>t)return!1;n>s&&(s=n),ca&&(i=u,u=a,a=i),!(s>a||u>t)&&(a>>8,(16711680&t)>>>16,(4278190080&t)>>>24]}function pt(t,e){return 65535&t|e<<16}function w(t,e,n,r){return 255&t|(255&e)<<8|(255&n)<<16|r<<24}function Et(t,e=0,n=!1){const r=t[e+3];return t[e+0]*=r,t[e+1]*=r,t[e+2]*=r,n||(t[e+3]*=255),t}function Mt(t){if(!t)return 0;const{r:e,g:n,b:r,a:s}=t;return w(e*s,n*s,r*s,255*s)}function Rt(t){if(!t)return 0;const[e,n,r,s]=t;return w(e*(s/255),n*(s/255),r*(s/255),s)}function Dt(t,e,n=0){if(H(e))return t[n+0]=0,t[n+1]=0,t[n+2]=0,void(t[n+3]=0);const{r,g:s,b:a,a:c}=e;t[n+0]=r*c/255,t[n+1]=s*c/255,t[n+2]=a*c/255,t[n+3]=c}var i,y,p,L,E,M,R,f;(function(t){t[t.FILL=0]="FILL",t[t.LINE=1]="LINE",t[t.MARKER=2]="MARKER",t[t.TEXT=3]="TEXT",t[t.LABEL=4]="LABEL"})(i||(i={})),function(t){t[t.SUCCEEDED=0]="SUCCEEDED",t[t.FAILED_OUT_OF_MEMORY=1]="FAILED_OUT_OF_MEMORY"}(y||(y={})),function(t){t[t.NONE=0]="NONE",t[t.MAP=1]="MAP",t[t.LABEL=2]="LABEL",t[t.LABEL_ALPHA=4]="LABEL_ALPHA",t[t.HITTEST=8]="HITTEST",t[t.HIGHLIGHT=16]="HIGHLIGHT",t[t.CLIP=32]="CLIP",t[t.DEBUG=64]="DEBUG",t[t.NUM_DRAW_PHASES=9]="NUM_DRAW_PHASES"}(p||(p={})),function(t){t[t.SIZE=0]="SIZE",t[t.COLOR=1]="COLOR",t[t.OPACITY=2]="OPACITY",t[t.ROTATION=3]="ROTATION"}(L||(L={})),function(t){t[t.NONE=0]="NONE",t[t.OPACITY=1]="OPACITY",t[t.COLOR=2]="COLOR",t[t.ROTATION=4]="ROTATION",t[t.SIZE_MINMAX_VALUE=8]="SIZE_MINMAX_VALUE",t[t.SIZE_SCALE_STOPS=16]="SIZE_SCALE_STOPS",t[t.SIZE_FIELD_STOPS=32]="SIZE_FIELD_STOPS",t[t.SIZE_UNIT_VALUE=64]="SIZE_UNIT_VALUE"}(E||(E={})),function(t){t[t.MINMAX_TARGETS_OUTLINE=128]="MINMAX_TARGETS_OUTLINE",t[t.SCALE_TARGETS_OUTLINE=256]="SCALE_TARGETS_OUTLINE",t[t.FIELD_TARGETS_OUTLINE=512]="FIELD_TARGETS_OUTLINE",t[t.UNIT_TARGETS_OUTLINE=1024]="UNIT_TARGETS_OUTLINE"}(M||(M={})),function(t){t[t.SPRITE=0]="SPRITE",t[t.GLYPH=1]="GLYPH"}(R||(R={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.SIMPLE=1]="SIMPLE",t[t.DOT_DENSITY=2]="DOT_DENSITY",t[t.OUTLINE_FILL=3]="OUTLINE_FILL",t[t.OUTLINE_FILL_SIMPLE=4]="OUTLINE_FILL_SIMPLE",t[t.HEATMAP=5]="HEATMAP",t[t.PIE_CHART=6]="PIE_CHART"}(f||(f={}));class D{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,n,r,s,a,c,d,u,I){this.color=e,this.haloColor=n,this.haloSize=r,this.size=s,this.angle=a,this.offsetX=c,this.offsetY=d,this.hAnchor=u,this.vAnchor=I}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}}D.pool=new $(D);const A=b.getLogger("esri.views.2d.engine.webgl.Utils"),o="geometry",x=[{name:o,strideInBytes:36}],V=[{name:o,strideInBytes:12}],Z=[{name:o,strideInBytes:36}],k=[{name:o,strideInBytes:24}],q=[{name:o,strideInBytes:12}],K=[{name:o,strideInBytes:40}],W=[{name:o,strideInBytes:36}],j=[{name:o,strideInBytes:36}];function l(t){const e={};for(const n of t)e[n.name]=n.strideInBytes;return e}const J=l(x),Q=l(V),tt=l(Z),et=l(k),nt=l(q),rt=l(K),st=l(W),at=l(j);function Ct(t,e){switch(t){case i.MARKER:return e===f.HEATMAP?Q:J;case i.FILL:switch(e){case f.DOT_DENSITY:return nt;case f.SIMPLE:case f.OUTLINE_FILL_SIMPLE:return et;default:return tt}case i.LINE:return rt;case i.TEXT:return st;case i.LABEL:return at}}const it=[o],ot=[o],ct=[o],ut=[o],lt=[o];function Tt(t){switch(t){case i.MARKER:return it;case i.FILL:return ot;case i.LINE:return ct;case i.TEXT:return ut;case i.LABEL:return lt}}function It(t){switch(t%4){case 0:case 2:return 4;case 1:case 3:return 1}}function gt(t,e){switch(e%4){case 0:case 2:return new Uint32Array(Math.floor(t*e/4));case 1:case 3:return new Uint8Array(t*e)}}function wt(t,e){switch(e%4){case 0:case 2:return new Uint32Array(t);case 1:case 3:return new Uint8Array(t)}}function Pt(t){return t!=null}function Ft(t){return typeof t=="number"}function Bt(t){switch(t){case"butt":return _.BUTT;case"round":return _.ROUND;case"square":return _.SQUARE;default:return A.error(new O("mapview-invalid-type",`Cap type ${t} is not a valid option. Defaulting to round`)),_.ROUND}}function vt(t){switch(t){case"miter":return N.MITER;case"bevel":return N.BEVEL;case"round":return N.ROUND;default:return A.error(new O("mapview-invalid-type",`Join type ${t} is not a valid option. Defaulting to round`)),N.ROUND}}function Gt(t){switch(t){case"opacity":return L.OPACITY;case"color":return L.COLOR;case"rotation":return L.ROTATION;case"size":return L.SIZE;default:return A.error(`Cannot interpret unknown vv: ${t}`),null}}function Ht(t,e,n,r,s,a,c){for(const u in a){const I=a[u].stride,m=It(I),P=a[u].data,F=n[u].data,B=I*s.vertexCount/m,v=I*t/m,G=I*s.vertexFrom/m;for(let h=0;h{const c=new z(a.name,a.count,a.type,s,0,a.normalized||!1);return s+=a.count*Lt(a.type),c}),e[n].forEach(a=>a.stride=s)}return e}const St=t=>{const e=new Map;for(const n in t)for(const r of t[n])e.set(r.name,r.location);return e},At=t=>{const e={};for(const n in t){const r=t[n];e[n]=r.length?r[0].stride:0}return e},U=new Map,Xt=(t,e)=>{if(!U.has(t)){const n=ft(e),r={strides:At(n),bufferLayouts:n,attributes:St(e)};U.set(t,r)}return U.get(t)};function xt(t){t(i.FILL),t(i.LINE),t(i.MARKER),t(i.TEXT),t(i.LABEL)}const Vt=t=>"path"in t&&ht(t.path),Zt=t=>"url"in t&&t.url||"imageData"in t&&t.imageData,kt=t=>"imageData"in t&&t.imageData&&"contentType"in t&&t.contentType?`data:${t.contentType};base64,${t.imageData}`:"url"in t?t.url:null,C=t=>t.startsWith("data:image/gif"),qt=t=>"url"in t&&t.url&&(t.url.includes(".gif")||C(t.url))||"contentType"in t&&t.contentType==="image/gif"||"imageData"in t&&C(t.imageData),g=t=>t.startsWith("data:image/png"),Kt=t=>"url"in t&&t.url&&(t.url.includes(".png")||g(t.url))||"contentType"in t&&t.contentType==="image/png"||"imageData"in t&&g(t.imageData),Wt=t=>t.type&&t.type.toLowerCase().includes("3d");function jt(t){switch(t.type){case"line":{const e=t;return e.cim.type==="CIMSolidStroke"&&!e.dashTemplate}case"fill":return t.cim.type==="CIMSolidFill";case"esriSFS":return t.style==="esriSFSSolid"||t.style==="esriSFSNull";case"esriSLS":return t.style==="esriSLSSolid"||t.style==="esriSLSNull";default:return!1}}const Jt=t=>t.includes("data:image/svg+xml");function Qt(t){switch("cim"in t?t.cim.type:t.type){case"esriSMS":case"esriPMS":case"CIMPointSymbol":return!1;case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":return _t(t);default:return!0}}function te(t){const e="maxVVSize"in t&&t.maxVVSize,n="width"in t&&t.width||"size"in t&&t.size||0;return e||n}function ee(t){const e=[];for(let n=0;n!!t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4)),_t=t=>{var e,n;return t.type==="fill"&&((n=(e=t==null?void 0:t.cim)==null?void 0:e.markerPlacement)==null?void 0:n.type)==="CIMMarkerPlacementInsidePolygon"};export{Kt as A,_t as B,Jt as D,kt as E,Ct as G,p as I,Pt as J,gt as K,jt as M,Wt as N,R as O,Ft as Q,f as S,Zt as T,te as U,wt as W,It as X,Qt as _,Vt as a,i as b,Ht as c,Dt as d,pt as e,Rt as f,Xt as g,xt as h,bt as i,Mt as j,Bt as k,E as l,zt as m,yt as n,Yt as o,Et as p,M as q,Gt as r,$t as s,vt as t,ee as v,qt as w,w as x}; +import{j as H,bb as $,s as b,n as O}from"./index.221827cd.js";import{a as _,n as N}from"./enums.0295eb81.js";import{F as Y,G as S,C as T}from"./enums.2d9e6f64.js";import"./Texture.940076b2.js";import{t as z}from"./VertexElementDescriptor.1fdca6da.js";const X=new Float32Array(1);new Uint32Array(X.buffer);function yt(t){return[255&t,(65280&t)>>>8,(16711680&t)>>>16,(4278190080&t)>>>24]}function pt(t,e){return 65535&t|e<<16}function w(t,e,n,r){return 255&t|(255&e)<<8|(255&n)<<16|r<<24}function Et(t,e=0,n=!1){const r=t[e+3];return t[e+0]*=r,t[e+1]*=r,t[e+2]*=r,n||(t[e+3]*=255),t}function Mt(t){if(!t)return 0;const{r:e,g:n,b:r,a:s}=t;return w(e*s,n*s,r*s,255*s)}function Rt(t){if(!t)return 0;const[e,n,r,s]=t;return w(e*(s/255),n*(s/255),r*(s/255),s)}function Dt(t,e,n=0){if(H(e))return t[n+0]=0,t[n+1]=0,t[n+2]=0,void(t[n+3]=0);const{r,g:s,b:a,a:c}=e;t[n+0]=r*c/255,t[n+1]=s*c/255,t[n+2]=a*c/255,t[n+3]=c}var i,y,p,L,E,M,R,f;(function(t){t[t.FILL=0]="FILL",t[t.LINE=1]="LINE",t[t.MARKER=2]="MARKER",t[t.TEXT=3]="TEXT",t[t.LABEL=4]="LABEL"})(i||(i={})),function(t){t[t.SUCCEEDED=0]="SUCCEEDED",t[t.FAILED_OUT_OF_MEMORY=1]="FAILED_OUT_OF_MEMORY"}(y||(y={})),function(t){t[t.NONE=0]="NONE",t[t.MAP=1]="MAP",t[t.LABEL=2]="LABEL",t[t.LABEL_ALPHA=4]="LABEL_ALPHA",t[t.HITTEST=8]="HITTEST",t[t.HIGHLIGHT=16]="HIGHLIGHT",t[t.CLIP=32]="CLIP",t[t.DEBUG=64]="DEBUG",t[t.NUM_DRAW_PHASES=9]="NUM_DRAW_PHASES"}(p||(p={})),function(t){t[t.SIZE=0]="SIZE",t[t.COLOR=1]="COLOR",t[t.OPACITY=2]="OPACITY",t[t.ROTATION=3]="ROTATION"}(L||(L={})),function(t){t[t.NONE=0]="NONE",t[t.OPACITY=1]="OPACITY",t[t.COLOR=2]="COLOR",t[t.ROTATION=4]="ROTATION",t[t.SIZE_MINMAX_VALUE=8]="SIZE_MINMAX_VALUE",t[t.SIZE_SCALE_STOPS=16]="SIZE_SCALE_STOPS",t[t.SIZE_FIELD_STOPS=32]="SIZE_FIELD_STOPS",t[t.SIZE_UNIT_VALUE=64]="SIZE_UNIT_VALUE"}(E||(E={})),function(t){t[t.MINMAX_TARGETS_OUTLINE=128]="MINMAX_TARGETS_OUTLINE",t[t.SCALE_TARGETS_OUTLINE=256]="SCALE_TARGETS_OUTLINE",t[t.FIELD_TARGETS_OUTLINE=512]="FIELD_TARGETS_OUTLINE",t[t.UNIT_TARGETS_OUTLINE=1024]="UNIT_TARGETS_OUTLINE"}(M||(M={})),function(t){t[t.SPRITE=0]="SPRITE",t[t.GLYPH=1]="GLYPH"}(R||(R={})),function(t){t[t.DEFAULT=0]="DEFAULT",t[t.SIMPLE=1]="SIMPLE",t[t.DOT_DENSITY=2]="DOT_DENSITY",t[t.OUTLINE_FILL=3]="OUTLINE_FILL",t[t.OUTLINE_FILL_SIMPLE=4]="OUTLINE_FILL_SIMPLE",t[t.HEATMAP=5]="HEATMAP",t[t.PIE_CHART=6]="PIE_CHART"}(f||(f={}));class D{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,n,r,s,a,c,d,u,I){this.color=e,this.haloColor=n,this.haloSize=r,this.size=s,this.angle=a,this.offsetX=c,this.offsetY=d,this.hAnchor=u,this.vAnchor=I}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}}D.pool=new $(D);const A=b.getLogger("esri.views.2d.engine.webgl.Utils"),o="geometry",x=[{name:o,strideInBytes:36}],V=[{name:o,strideInBytes:12}],Z=[{name:o,strideInBytes:36}],k=[{name:o,strideInBytes:24}],q=[{name:o,strideInBytes:12}],K=[{name:o,strideInBytes:40}],W=[{name:o,strideInBytes:36}],j=[{name:o,strideInBytes:36}];function l(t){const e={};for(const n of t)e[n.name]=n.strideInBytes;return e}const J=l(x),Q=l(V),tt=l(Z),et=l(k),nt=l(q),rt=l(K),st=l(W),at=l(j);function Ct(t,e){switch(t){case i.MARKER:return e===f.HEATMAP?Q:J;case i.FILL:switch(e){case f.DOT_DENSITY:return nt;case f.SIMPLE:case f.OUTLINE_FILL_SIMPLE:return et;default:return tt}case i.LINE:return rt;case i.TEXT:return st;case i.LABEL:return at}}const it=[o],ot=[o],ct=[o],ut=[o],lt=[o];function Tt(t){switch(t){case i.MARKER:return it;case i.FILL:return ot;case i.LINE:return ct;case i.TEXT:return ut;case i.LABEL:return lt}}function It(t){switch(t%4){case 0:case 2:return 4;case 1:case 3:return 1}}function gt(t,e){switch(e%4){case 0:case 2:return new Uint32Array(Math.floor(t*e/4));case 1:case 3:return new Uint8Array(t*e)}}function wt(t,e){switch(e%4){case 0:case 2:return new Uint32Array(t);case 1:case 3:return new Uint8Array(t)}}function Pt(t){return t!=null}function Ft(t){return typeof t=="number"}function Bt(t){switch(t){case"butt":return _.BUTT;case"round":return _.ROUND;case"square":return _.SQUARE;default:return A.error(new O("mapview-invalid-type",`Cap type ${t} is not a valid option. Defaulting to round`)),_.ROUND}}function vt(t){switch(t){case"miter":return N.MITER;case"bevel":return N.BEVEL;case"round":return N.ROUND;default:return A.error(new O("mapview-invalid-type",`Join type ${t} is not a valid option. Defaulting to round`)),N.ROUND}}function Gt(t){switch(t){case"opacity":return L.OPACITY;case"color":return L.COLOR;case"rotation":return L.ROTATION;case"size":return L.SIZE;default:return A.error(`Cannot interpret unknown vv: ${t}`),null}}function Ht(t,e,n,r,s,a,c){for(const u in a){const I=a[u].stride,m=It(I),P=a[u].data,F=n[u].data,B=I*s.vertexCount/m,v=I*t/m,G=I*s.vertexFrom/m;for(let h=0;h{const c=new z(a.name,a.count,a.type,s,0,a.normalized||!1);return s+=a.count*Lt(a.type),c}),e[n].forEach(a=>a.stride=s)}return e}const St=t=>{const e=new Map;for(const n in t)for(const r of t[n])e.set(r.name,r.location);return e},At=t=>{const e={};for(const n in t){const r=t[n];e[n]=r.length?r[0].stride:0}return e},U=new Map,Xt=(t,e)=>{if(!U.has(t)){const n=ft(e),r={strides:At(n),bufferLayouts:n,attributes:St(e)};U.set(t,r)}return U.get(t)};function xt(t){t(i.FILL),t(i.LINE),t(i.MARKER),t(i.TEXT),t(i.LABEL)}const Vt=t=>"path"in t&&ht(t.path),Zt=t=>"url"in t&&t.url||"imageData"in t&&t.imageData,kt=t=>"imageData"in t&&t.imageData&&"contentType"in t&&t.contentType?`data:${t.contentType};base64,${t.imageData}`:"url"in t?t.url:null,C=t=>t.startsWith("data:image/gif"),qt=t=>"url"in t&&t.url&&(t.url.includes(".gif")||C(t.url))||"contentType"in t&&t.contentType==="image/gif"||"imageData"in t&&C(t.imageData),g=t=>t.startsWith("data:image/png"),Kt=t=>"url"in t&&t.url&&(t.url.includes(".png")||g(t.url))||"contentType"in t&&t.contentType==="image/png"||"imageData"in t&&g(t.imageData),Wt=t=>t.type&&t.type.toLowerCase().includes("3d");function jt(t){switch(t.type){case"line":{const e=t;return e.cim.type==="CIMSolidStroke"&&!e.dashTemplate}case"fill":return t.cim.type==="CIMSolidFill";case"esriSFS":return t.style==="esriSFSSolid"||t.style==="esriSFSNull";case"esriSLS":return t.style==="esriSLSSolid"||t.style==="esriSLSNull";default:return!1}}const Jt=t=>t.includes("data:image/svg+xml");function Qt(t){switch("cim"in t?t.cim.type:t.type){case"esriSMS":case"esriPMS":case"CIMPointSymbol":return!1;case"CIMVectorMarker":case"CIMCharacterMarker":case"CIMPictureMarker":return _t(t);default:return!0}}function te(t){const e="maxVVSize"in t&&t.maxVVSize,n="width"in t&&t.width||"size"in t&&t.size||0;return e||n}function ee(t){const e=[];for(let n=0;n!!t&&(t=t.trim(),!!(/^[mzlhvcsqta]\s*[-+.0-9][^mlhvzcsqta]+/i.test(t)&&/[\dz]$/i.test(t)&&t.length>4)),_t=t=>{var e,n;return t.type==="fill"&&((n=(e=t==null?void 0:t.cim)==null?void 0:e.markerPlacement)==null?void 0:n.type)==="CIMMarkerPlacementInsidePolygon"};export{Kt as A,_t as B,Jt as D,kt as E,Ct as G,p as I,Pt as J,gt as K,jt as M,Wt as N,R as O,Ft as Q,f as S,Zt as T,te as U,wt as W,It as X,Qt as _,Vt as a,i as b,Ht as c,Dt as d,pt as e,Rt as f,Xt as g,xt as h,bt as i,Mt as j,Bt as k,E as l,zt as m,yt as n,Yt as o,Et as p,M as q,Gt as r,$t as s,vt as t,ee as v,qt as w,w as x}; diff --git a/assets/VectorTileLayer.f3cc18bb.js b/assets/VectorTileLayer.1b238b34.js similarity index 98% rename from assets/VectorTileLayer.f3cc18bb.js rename to assets/VectorTileLayer.1b238b34.js index 15d0421..a01b74a 100644 --- a/assets/VectorTileLayer.f3cc18bb.js +++ b/assets/VectorTileLayer.1b238b34.js @@ -1 +1 @@ -import{s as W,n as R,g_ as X,ka as Y,bX as _,dR as H,U as A,v as F,bN as C,x as Z,b4 as x,ji as Q,eP as P,dT as v,cU as V,F as E,kb as ee,jC as q,jF as z,ey as G,hu as te,kc as J,du as O,i2 as re,i3 as se,eE as ie,eF as oe,eG as le,iJ as ae,il as ne,eH as ue,aU as T,u as pe,kd as ce,ke as he,aQ as M,av as ye,a6 as c,a7 as h,aT as de,e0 as fe,d2 as me,a8 as ge,cF as Ae}from"./index.d94abe07.js";import{s as Se}from"./ArcGISCachedService.e7d85534.js";import{n as we,z as ve}from"./TilemapCache.11964483.js";import{e as xe}from"./jsonContext.3176ed6f.js";import{l as _e}from"./StyleRepository.a1fecb1f.js";import"./StyleDefinition.d56936e4.js";import"./enums.0295eb81.js";import"./enums.54326430.js";import"./enums.2d9e6f64.js";import"./VertexElementDescriptor.1fdca6da.js";import"./colorUtils.bb6424b7.js";import"./GeometryUtils.4f19e772.js";import"./Geometry.d049a63c.js";let U=null;function Ue(e){if(U)return U;const t={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return U=new Promise(r=>{const s=new Image;s.onload=()=>{s.onload=s.onerror=null,r(s.width>0&&s.height>0)},s.onerror=()=>{s.onload=s.onerror=null,r(!1)},s.src="data:image/webp;base64,"+t[e]}),U}const D=1.15;class B{constructor(t,r){this._spriteSource=t,this._maxTextureSize=r,this.devicePixelRatio=1,this._spriteImageFormat="png",this._isRetina=!1,this._spritesData={},this.image=null,this.width=null,this.height=null,this.loadStatus="not-loaded",t.type==="url"&&t.spriteFormat&&(this._spriteImageFormat=t.spriteFormat),t.pixelRatio&&(this.devicePixelRatio=t.pixelRatio),this.baseURL=t.spriteUrl}get spriteNames(){const t=[];for(const r in this._spritesData)t.push(r);return t.sort(),t}getSpriteInfo(t){return this._spritesData?this._spritesData[t]:null}async load(t){if(this.baseURL){this.loadStatus="loading";try{await this._loadSprites(t),this.loadStatus="loaded"}catch{this.loadStatus="failed"}}else this.loadStatus="failed"}async _loadSprites(t){this._isRetina=this.devicePixelRatio>D;const{width:r,height:s,data:i,json:o}=await this._getSpriteData(this._spriteSource,t),l=Object.keys(o);if(!l||l.length===0||!i)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=o,this.width=r,this.height=s;const n=Math.max(this._maxTextureSize,4096);if(r>n||s>n){const a=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${n} pixels}`;throw W.getLogger("esri.layers.support.SpriteSource").error(a),new R("SpriteSource",a)}let u;for(let a=0;at.data.index)),this._tileIndexPromise}async dataKey(t,r){const s=await this.fetchTileIndex();return F(r),this._getIndexedDataKey(s,t)}_getIndexedDataKey(t,r){const s=[r];if(r.level<0||r.row<0||r.col<0||r.row>>r.level>0||r.col>>r.level>0)return null;let i=r;for(;i.level!==0;)i=new C(i.level-1,i.row>>1,i.col>>1,i.world),s.push(i);let o,l,n=t,u=s.pop();if(n===1)return u;for(;s.length;)if(o=s.pop(),l=(1&o.col)+((1&o.row)<<1),n){if(n[l]===0){u=null;break}if(n[l]===1){u=o;break}u=o,n=n[l]}return u}}class be{constructor(t,r){this._tilemap=t,this._tileIndexUrl=r}async fetchTileIndex(t){return this._tileIndexPromise||(this._tileIndexPromise=A(this._tileIndexUrl,{query:{...t==null?void 0:t.query}}).then(r=>r.data.index)),this._tileIndexPromise}dataKey(t,r){const{level:s,row:i,col:o}=t,l=new C(t);return this._tilemap.fetchAvailabilityUpsample(s,i,o,l,r).then(()=>(l.world=t.world,l)).catch(n=>{if(Z(n))throw n;return null})}}const I=new Map;function Re(e,t,r,s,i){return Te(e.replace(/\{z\}/gi,t.toString()).replace(/\{y\}/gi,r.toString()).replace(/\{x\}/gi,s.toString()),i)}function Te(e,t){const r=I.get(e);if(r)return r.then(i=>x(i));const s=A(e,{responseType:"array-buffer",...t}).then(({data:i})=>(I.delete(e),i)).catch(i=>{throw I.delete(e),i});return I.set(e,s),s}class $e{constructor(t,r,s){this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.name=t,this.sourceUrl=r;const i=_(this.sourceUrl),o=x(s),l=o.tiles;if(i)for(let m=0;mm.toLowerCase().trim()),u=(s==null?void 0:s.exportTilesAllowed)===!0,a=(n==null?void 0:n.includes("tilemap"))===!0,y=u&&s.hasOwnProperty("maxExportTilesCount")?s.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:u,supportsTileMap:a},exportTiles:u?{maxExportTilesCount:+y}:null},this.tileInfo=we(o.tileInfo,o,null,{ignoreMinMaxLOD:!0});const d=s.tileMap?v(P(i.path,s.tileMap),i.query):null;a?(this.type="vector-tile",this.tilemap=new be(new ve({layer:{parsedUrl:i,tileInfo:this.tileInfo,type:"vector-tile",tileServers:this.tileServers}}),d)):d&&(this.tilemap=new Ie(d)),this.fullExtent=V.fromJSON(s.fullExtent)}destroy(){}async getRefKey(t,r){var s,i;return(i=(s=this.tilemap)==null?void 0:s.dataKey(t,r))!=null?i:t}requestTile(t,r,s,i){const o=this.tileServers[r%this.tileServers.length];return Re(o,t,r,s,i)}isCompatibleWith(t){const r=this.tileInfo,s=t.tileInfo;if(!r.spatialReference.equals(s.spatialReference)||!r.origin.equals(s.origin)||Math.round(r.dpi)!==Math.round(s.dpi))return!1;const i=r.lods,o=s.lods,l=Math.min(i.length,o.length);for(let n=0;n=n&&l.push({level:a,scale:o,resolution:i}),i/=2,o/=2;for(const a of e.tiles)S(w(t,a));return{capabilities:"TilesOnly",initialExtent:r,fullExtent:r,minScale:0,maxScale:0,tiles:e.tiles,tileInfo:{rows:s,cols:s,dpi:96,format:"pbf",origin:{x:-20037508342787e-6,y:20037508342787e-6},lods:l,spatialReference:{wkid:102100}}}}const b=1e-6;function Ee(e,t){if(e===t)return!0;if(e==null&&t!=null||e!=null&&t==null||e==null||t==null||!e.spatialReference.equals(t.spatialReference)||e.dpi!==t.dpi)return!1;const r=e.origin,s=t.origin;if(Math.abs(r.x-s.x)>=b||Math.abs(r.y-s.y)>=b)return!1;let i,o;e.lods[0].scale>t.lods[0].scale?(i=e,o=t):(o=e,i=t);for(let l=i.lods[0].scale;l>=o.lods[o.lods.length-1].scale-b;l/=2)if(Math.abs(l-o.lods[0].scale)t.lods[0].scale?e.lods[0]:t.lods[0],u=e.lods[e.lods.length-1].scale<=t.lods[t.lods.length-1].scale?e.lods[e.lods.length-1]:t.lods[t.lods.length-1],a=n.scale,y=n.resolution,d=u.scale,m=[];let f=a,L=y,j=0;for(;f>d;)m.push({level:j,resolution:L,scale:f}),j++,f/=2,L/=2;return new O({size:[r,r],dpi:i,format:s||"pbf",origin:o,lods:m,spatialReference:l})}let p=class extends re(se(Se(ie(oe(le(ae(ne(ue(Ae))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.style=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.type="vector-tile",this.url=null,this.showCollisionBoxes="none",this.path=null}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))e==null||e.destroy();this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const t=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(T).then(async()=>{if(!this.portalItem||!this.portalItem.id)return;const r=`${this.portalItem.itemUrl}/resources/styles/root.json`;(await A(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:r},xe(this.portalItem))}).catch(T).then(()=>this._loadStyle(e));return this.addResolvingPromise(t),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e&&e.serviceUrl&&_(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?v(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){var e;return((e=this.primarySource)==null?void 0:e.fullExtent)||null}get parsedUrl(){return this.serviceUrl?_(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo&&this.currentStyleInfo.serviceUrl||null}get spatialReference(){return this.tileInfo&&this.tileInfo.spatialReference||null}get styleUrl(){return this.currentStyleInfo&&this.currentStyleInfo.styleUrl||null}writeStyleUrl(e,t){e&&q(e)&&(e=`https:${e}`);const r=pe(ce(e));t.styleUrl=he(e,r)}get tileInfo(){var r;const e=[];for(const s in this.sourceNameToSource)e.push(this.sourceNameToSource[s]);let t=((r=this.primarySource)==null?void 0:r.tileInfo)||new O;if(e.length>1)for(let s=0;s(this._spriteSourceMap.clear(),this._getSourceAndStyle(r,{signal:i})),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return x(this.styleRepository.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const s=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||s})}getStyleLayer(e){return x(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return x(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return(t==null?void 0:t.origin)&&!this.styleUrl?(t.messages&&t.messages.push(new R("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await Pe(e,{...t,query:{...this.customParameters,token:this.apiKey}});r.spriteFormat==="webp"&&(await Ue("lossy")||(r.spriteFormat="png")),this._set("currentStyleInfo",{...r}),typeof e=="string"?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new _e(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^\/]+)?\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/vectortileserver/i),r=["OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2"];if(!t)return;const s=t[2]&&t[2].toLowerCase();if(!s)return;const i=t[1]||"";for(const o of r)if(o.toLowerCase().includes(s))return G(`//static.arcgis.com/attribution/Vector${i}/${o}`)}async _loadStyle(e){var t,r;return(r=(t=this._loadingTask)==null?void 0:t.promise)!=null?r:this.loadStyle(null,e)}};c([h({readOnly:!0})],p.prototype,"attributionDataUrl",null),c([h({type:["show","hide"]})],p.prototype,"listMode",void 0),c([h({json:{read:!0,write:!0}})],p.prototype,"blendMode",void 0),c([h({readOnly:!0,json:{read:!1}})],p.prototype,"capabilities",null),c([h({readOnly:!0})],p.prototype,"currentStyleInfo",void 0),c([h({json:{read:!1},readOnly:!0,type:V})],p.prototype,"fullExtent",null),c([h()],p.prototype,"style",void 0),c([h({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],p.prototype,"isReference",void 0),c([h({type:["VectorTileLayer"]})],p.prototype,"operationalLayerType",void 0),c([h({readOnly:!0})],p.prototype,"parsedUrl",null),c([h({readOnly:!0})],p.prototype,"serviceUrl",null),c([h({type:de,readOnly:!0})],p.prototype,"spatialReference",null),c([h({readOnly:!0})],p.prototype,"styleRepository",void 0),c([h({readOnly:!0})],p.prototype,"sourceNameToSource",void 0),c([h({readOnly:!0})],p.prototype,"primarySource",void 0),c([h({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],p.prototype,"styleUrl",null),c([fe(["portal-item","web-document"],"styleUrl")],p.prototype,"writeStyleUrl",null),c([h({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:O})],p.prototype,"tileInfo",null),c([h({json:{read:!1},readOnly:!0,value:"vector-tile"})],p.prototype,"type",void 0),c([h({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],p.prototype,"url",void 0),c([h({readOnly:!0})],p.prototype,"version",void 0),c([me("version",["version","currentVersion"])],p.prototype,"readVersion",null),c([h({type:String})],p.prototype,"showCollisionBoxes",void 0),c([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],p.prototype,"path",void 0),p=c([ge("esri.layers.VectorTileLayer")],p);const We=p;export{We as default}; +import{s as W,n as R,g_ as X,ka as Y,bX as _,dR as H,U as A,v as F,bN as C,x as Z,b4 as x,ji as Q,eP as P,dT as v,cU as V,F as E,kb as ee,jC as q,jF as z,ey as G,hu as te,kc as J,du as O,i2 as re,i3 as se,eE as ie,eF as oe,eG as le,iJ as ae,il as ne,eH as ue,aU as T,u as pe,kd as ce,ke as he,aQ as M,av as ye,a6 as c,a7 as h,aT as de,e0 as fe,d2 as me,a8 as ge,cF as Ae}from"./index.221827cd.js";import{s as Se}from"./ArcGISCachedService.a530cd26.js";import{n as we,z as ve}from"./TilemapCache.b64a2ea8.js";import{e as xe}from"./jsonContext.fe51f9bd.js";import{l as _e}from"./StyleRepository.e426e44d.js";import"./StyleDefinition.d56936e4.js";import"./enums.0295eb81.js";import"./enums.54326430.js";import"./enums.2d9e6f64.js";import"./VertexElementDescriptor.1fdca6da.js";import"./colorUtils.bb6424b7.js";import"./GeometryUtils.4f19e772.js";import"./Geometry.d049a63c.js";let U=null;function Ue(e){if(U)return U;const t={lossy:"UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",lossless:"UklGRhoAAABXRUJQVlA4TA0AAAAvAAAAEAcQERGIiP4HAA==",alpha:"UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAARBxAR/Q9ERP8DAABWUDggGAAAABQBAJ0BKgEAAQAAAP4AAA3AAP7mtQAAAA==",animation:"UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA"};return U=new Promise(r=>{const s=new Image;s.onload=()=>{s.onload=s.onerror=null,r(s.width>0&&s.height>0)},s.onerror=()=>{s.onload=s.onerror=null,r(!1)},s.src="data:image/webp;base64,"+t[e]}),U}const D=1.15;class B{constructor(t,r){this._spriteSource=t,this._maxTextureSize=r,this.devicePixelRatio=1,this._spriteImageFormat="png",this._isRetina=!1,this._spritesData={},this.image=null,this.width=null,this.height=null,this.loadStatus="not-loaded",t.type==="url"&&t.spriteFormat&&(this._spriteImageFormat=t.spriteFormat),t.pixelRatio&&(this.devicePixelRatio=t.pixelRatio),this.baseURL=t.spriteUrl}get spriteNames(){const t=[];for(const r in this._spritesData)t.push(r);return t.sort(),t}getSpriteInfo(t){return this._spritesData?this._spritesData[t]:null}async load(t){if(this.baseURL){this.loadStatus="loading";try{await this._loadSprites(t),this.loadStatus="loaded"}catch{this.loadStatus="failed"}}else this.loadStatus="failed"}async _loadSprites(t){this._isRetina=this.devicePixelRatio>D;const{width:r,height:s,data:i,json:o}=await this._getSpriteData(this._spriteSource,t),l=Object.keys(o);if(!l||l.length===0||!i)return this._spritesData=this.image=null,void(this.width=this.height=0);this._spritesData=o,this.width=r,this.height=s;const n=Math.max(this._maxTextureSize,4096);if(r>n||s>n){const a=`Sprite resource for style ${this.baseURL} is bigger than the maximum allowed of ${n} pixels}`;throw W.getLogger("esri.layers.support.SpriteSource").error(a),new R("SpriteSource",a)}let u;for(let a=0;at.data.index)),this._tileIndexPromise}async dataKey(t,r){const s=await this.fetchTileIndex();return F(r),this._getIndexedDataKey(s,t)}_getIndexedDataKey(t,r){const s=[r];if(r.level<0||r.row<0||r.col<0||r.row>>r.level>0||r.col>>r.level>0)return null;let i=r;for(;i.level!==0;)i=new C(i.level-1,i.row>>1,i.col>>1,i.world),s.push(i);let o,l,n=t,u=s.pop();if(n===1)return u;for(;s.length;)if(o=s.pop(),l=(1&o.col)+((1&o.row)<<1),n){if(n[l]===0){u=null;break}if(n[l]===1){u=o;break}u=o,n=n[l]}return u}}class be{constructor(t,r){this._tilemap=t,this._tileIndexUrl=r}async fetchTileIndex(t){return this._tileIndexPromise||(this._tileIndexPromise=A(this._tileIndexUrl,{query:{...t==null?void 0:t.query}}).then(r=>r.data.index)),this._tileIndexPromise}dataKey(t,r){const{level:s,row:i,col:o}=t,l=new C(t);return this._tilemap.fetchAvailabilityUpsample(s,i,o,l,r).then(()=>(l.world=t.world,l)).catch(n=>{if(Z(n))throw n;return null})}}const I=new Map;function Re(e,t,r,s,i){return Te(e.replace(/\{z\}/gi,t.toString()).replace(/\{y\}/gi,r.toString()).replace(/\{x\}/gi,s.toString()),i)}function Te(e,t){const r=I.get(e);if(r)return r.then(i=>x(i));const s=A(e,{responseType:"array-buffer",...t}).then(({data:i})=>(I.delete(e),i)).catch(i=>{throw I.delete(e),i});return I.set(e,s),s}class $e{constructor(t,r,s){this.tilemap=null,this.tileInfo=null,this.capabilities=null,this.fullExtent=null,this.name=t,this.sourceUrl=r;const i=_(this.sourceUrl),o=x(s),l=o.tiles;if(i)for(let m=0;mm.toLowerCase().trim()),u=(s==null?void 0:s.exportTilesAllowed)===!0,a=(n==null?void 0:n.includes("tilemap"))===!0,y=u&&s.hasOwnProperty("maxExportTilesCount")?s.maxExportTilesCount:0;this.capabilities={operations:{supportsExportTiles:u,supportsTileMap:a},exportTiles:u?{maxExportTilesCount:+y}:null},this.tileInfo=we(o.tileInfo,o,null,{ignoreMinMaxLOD:!0});const d=s.tileMap?v(P(i.path,s.tileMap),i.query):null;a?(this.type="vector-tile",this.tilemap=new be(new ve({layer:{parsedUrl:i,tileInfo:this.tileInfo,type:"vector-tile",tileServers:this.tileServers}}),d)):d&&(this.tilemap=new Ie(d)),this.fullExtent=V.fromJSON(s.fullExtent)}destroy(){}async getRefKey(t,r){var s,i;return(i=(s=this.tilemap)==null?void 0:s.dataKey(t,r))!=null?i:t}requestTile(t,r,s,i){const o=this.tileServers[r%this.tileServers.length];return Re(o,t,r,s,i)}isCompatibleWith(t){const r=this.tileInfo,s=t.tileInfo;if(!r.spatialReference.equals(s.spatialReference)||!r.origin.equals(s.origin)||Math.round(r.dpi)!==Math.round(s.dpi))return!1;const i=r.lods,o=s.lods,l=Math.min(i.length,o.length);for(let n=0;n=n&&l.push({level:a,scale:o,resolution:i}),i/=2,o/=2;for(const a of e.tiles)S(w(t,a));return{capabilities:"TilesOnly",initialExtent:r,fullExtent:r,minScale:0,maxScale:0,tiles:e.tiles,tileInfo:{rows:s,cols:s,dpi:96,format:"pbf",origin:{x:-20037508342787e-6,y:20037508342787e-6},lods:l,spatialReference:{wkid:102100}}}}const b=1e-6;function Ee(e,t){if(e===t)return!0;if(e==null&&t!=null||e!=null&&t==null||e==null||t==null||!e.spatialReference.equals(t.spatialReference)||e.dpi!==t.dpi)return!1;const r=e.origin,s=t.origin;if(Math.abs(r.x-s.x)>=b||Math.abs(r.y-s.y)>=b)return!1;let i,o;e.lods[0].scale>t.lods[0].scale?(i=e,o=t):(o=e,i=t);for(let l=i.lods[0].scale;l>=o.lods[o.lods.length-1].scale-b;l/=2)if(Math.abs(l-o.lods[0].scale)t.lods[0].scale?e.lods[0]:t.lods[0],u=e.lods[e.lods.length-1].scale<=t.lods[t.lods.length-1].scale?e.lods[e.lods.length-1]:t.lods[t.lods.length-1],a=n.scale,y=n.resolution,d=u.scale,m=[];let f=a,L=y,j=0;for(;f>d;)m.push({level:j,resolution:L,scale:f}),j++,f/=2,L/=2;return new O({size:[r,r],dpi:i,format:s||"pbf",origin:o,lods:m,spatialReference:l})}let p=class extends re(se(Se(ie(oe(le(ae(ne(ue(Ae))))))))){constructor(...e){super(...e),this._spriteSourceMap=new Map,this.currentStyleInfo=null,this.style=null,this.isReference=null,this.operationalLayerType="VectorTileLayer",this.type="vector-tile",this.url=null,this.showCollisionBoxes="none",this.path=null}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}destroy(){if(this.sourceNameToSource)for(const e of Object.values(this.sourceNameToSource))e==null||e.destroy();this._spriteSourceMap.clear()}async prefetchResources(e){await this.loadSpriteSource(globalThis.devicePixelRatio||1,e)}load(e){const t=this.loadFromPortal({supportedTypes:["Vector Tile Service"],supportsData:!1},e).catch(T).then(async()=>{if(!this.portalItem||!this.portalItem.id)return;const r=`${this.portalItem.itemUrl}/resources/styles/root.json`;(await A(r,{...e,query:{f:"json",...this.customParameters,token:this.apiKey}})).data&&this.read({url:r},xe(this.portalItem))}).catch(T).then(()=>this._loadStyle(e));return this.addResolvingPromise(t),Promise.resolve(this)}get attributionDataUrl(){const e=this.currentStyleInfo,t=e&&e.serviceUrl&&_(e.serviceUrl);if(!t)return null;const r=this._getDefaultAttribution(t.path);return r?v(r,{...this.customParameters,token:this.apiKey}):null}get capabilities(){const e=this.primarySource;return e?e.capabilities:{operations:{supportsExportTiles:!1,supportsTileMap:!1},exportTiles:null}}get fullExtent(){var e;return((e=this.primarySource)==null?void 0:e.fullExtent)||null}get parsedUrl(){return this.serviceUrl?_(this.serviceUrl):null}get serviceUrl(){return this.currentStyleInfo&&this.currentStyleInfo.serviceUrl||null}get spatialReference(){return this.tileInfo&&this.tileInfo.spatialReference||null}get styleUrl(){return this.currentStyleInfo&&this.currentStyleInfo.styleUrl||null}writeStyleUrl(e,t){e&&q(e)&&(e=`https:${e}`);const r=pe(ce(e));t.styleUrl=he(e,r)}get tileInfo(){var r;const e=[];for(const s in this.sourceNameToSource)e.push(this.sourceNameToSource[s]);let t=((r=this.primarySource)==null?void 0:r.tileInfo)||new O;if(e.length>1)for(let s=0;s(this._spriteSourceMap.clear(),this._getSourceAndStyle(r,{signal:i})),t)),this._loadingTask.promise}getStyleLayerId(e){return this.styleRepository.getStyleLayerId(e)}getStyleLayerIndex(e){return this.styleRepository.getStyleLayerIndex(e)}getPaintProperties(e){return x(this.styleRepository.getPaintProperties(e))}setPaintProperties(e,t){const r=this.styleRepository.isPainterDataDriven(e);this.styleRepository.setPaintProperties(e,t);const s=this.styleRepository.isPainterDataDriven(e);this.emit("paint-change",{layer:e,paint:t,isDataDriven:r||s})}getStyleLayer(e){return x(this.styleRepository.getStyleLayer(e))}setStyleLayer(e,t){this.styleRepository.setStyleLayer(e,t),this.emit("style-layer-change",{layer:e,index:t})}deleteStyleLayer(e){this.styleRepository.deleteStyleLayer(e),this.emit("delete-style-layer",{layer:e})}getLayoutProperties(e){return x(this.styleRepository.getLayoutProperties(e))}setLayoutProperties(e,t){this.styleRepository.setLayoutProperties(e,t),this.emit("layout-change",{layer:e,layout:t})}setStyleLayerVisibility(e,t){this.styleRepository.setStyleLayerVisibility(e,t),this.emit("style-layer-visibility-change",{layer:e,visibility:t})}getStyleLayerVisibility(e){return this.styleRepository.getStyleLayerVisibility(e)}write(e,t){return(t==null?void 0:t.origin)&&!this.styleUrl?(t.messages&&t.messages.push(new R("vectortilelayer:unsupported",`VectorTileLayer (${this.title}, ${this.id}) with style defined by JSON only are not supported`,{layer:this})),null):super.write(e,t)}getTileUrl(e,t,r){return null}async _getSourceAndStyle(e,t){if(!e)throw new Error("invalid style!");const r=await Pe(e,{...t,query:{...this.customParameters,token:this.apiKey}});r.spriteFormat==="webp"&&(await Ue("lossy")||(r.spriteFormat="png")),this._set("currentStyleInfo",{...r}),typeof e=="string"?(this.url=e,this.style=null):(this.url=null,this.style=e),this._set("sourceNameToSource",r.sourceNameToSource),this._set("primarySource",r.sourceNameToSource[r.primarySourceName]),this._set("styleRepository",new _e(r.style)),this.read(r.layerDefinition,{origin:"service"}),this.emit("load-style")}_getDefaultAttribution(e){const t=e.match(/^https?:\/\/(?:basemaps|basemapsbeta|basemapsdev)(?:-api)?\.arcgis\.com(\/[^\/]+)?\/arcgis\/rest\/services\/([^\/]+(\/[^\/]+)*)\/vectortileserver/i),r=["OpenStreetMap_v2","OpenStreetMap_Daylight_v2","OpenStreetMap_Export_v2","OpenStreetMap_FTS_v2","OpenStreetMap_GCS_v2","World_Basemap","World_Basemap_v2","World_Basemap_Export_v2","World_Basemap_GCS_v2","World_Basemap_WGS84","World_Contours_v2"];if(!t)return;const s=t[2]&&t[2].toLowerCase();if(!s)return;const i=t[1]||"";for(const o of r)if(o.toLowerCase().includes(s))return G(`//static.arcgis.com/attribution/Vector${i}/${o}`)}async _loadStyle(e){var t,r;return(r=(t=this._loadingTask)==null?void 0:t.promise)!=null?r:this.loadStyle(null,e)}};c([h({readOnly:!0})],p.prototype,"attributionDataUrl",null),c([h({type:["show","hide"]})],p.prototype,"listMode",void 0),c([h({json:{read:!0,write:!0}})],p.prototype,"blendMode",void 0),c([h({readOnly:!0,json:{read:!1}})],p.prototype,"capabilities",null),c([h({readOnly:!0})],p.prototype,"currentStyleInfo",void 0),c([h({json:{read:!1},readOnly:!0,type:V})],p.prototype,"fullExtent",null),c([h()],p.prototype,"style",void 0),c([h({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],p.prototype,"isReference",void 0),c([h({type:["VectorTileLayer"]})],p.prototype,"operationalLayerType",void 0),c([h({readOnly:!0})],p.prototype,"parsedUrl",null),c([h({readOnly:!0})],p.prototype,"serviceUrl",null),c([h({type:de,readOnly:!0})],p.prototype,"spatialReference",null),c([h({readOnly:!0})],p.prototype,"styleRepository",void 0),c([h({readOnly:!0})],p.prototype,"sourceNameToSource",void 0),c([h({readOnly:!0})],p.prototype,"primarySource",void 0),c([h({type:String,readOnly:!0,json:{write:{ignoreOrigin:!0},origins:{"web-document":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],p.prototype,"styleUrl",null),c([fe(["portal-item","web-document"],"styleUrl")],p.prototype,"writeStyleUrl",null),c([h({json:{read:!1,origins:{service:{read:!1}}},readOnly:!0,type:O})],p.prototype,"tileInfo",null),c([h({json:{read:!1},readOnly:!0,value:"vector-tile"})],p.prototype,"type",void 0),c([h({json:{origins:{"web-document":{read:{source:"styleUrl"}},"portal-item":{read:{source:"url"}}},write:!1,read:!1}})],p.prototype,"url",void 0),c([h({readOnly:!0})],p.prototype,"version",void 0),c([me("version",["version","currentVersion"])],p.prototype,"readVersion",null),c([h({type:String})],p.prototype,"showCollisionBoxes",void 0),c([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],p.prototype,"path",void 0),p=c([ge("esri.layers.VectorTileLayer")],p);const We=p;export{We as default}; diff --git a/assets/VectorTileLayerView2D.fd81c1b1.js b/assets/VectorTileLayerView2D.d09abb15.js similarity index 98% rename from assets/VectorTileLayerView2D.fd81c1b1.js rename to assets/VectorTileLayerView2D.d09abb15.js index 8803599..fb725b7 100644 --- a/assets/VectorTileLayerView2D.fd81c1b1.js +++ b/assets/VectorTileLayerView2D.d09abb15.js @@ -1 +1 @@ -import{U as Re,A as Ae,dT as re,d6 as Pe,z as Me,bN as B,x as X,cB as ne,c2 as Le,d7 as pe,j as O,c as p,u as k,b1 as ge,S as me,R as Be,Q as be,N as q,ej as Oe,W as Ue,K as ke,ay as ee,cV as Ve,du as Ee,d1 as ze,_ as $e,$ as He,c3 as Fe,ek as qe,bK as Ne,s as oe,cW as ae,b4 as Qe,a6 as N,a7 as j,a8 as We}from"./index.d94abe07.js";import{I as P,L as v}from"./enums.54326430.js";import{t as M}from"./Rect.95b0fd2e.js";import{P as we,G as xe,D as je,F as I,O as H,I as le,R as F,C as Se,E as Je}from"./enums.2d9e6f64.js";import{E as Te}from"./Texture.4c97bad5.js";import{e as Ge}from"./rasterizingUtils.4baad29a.js";import{E as C,a as z}from"./VertexArrayObject.a4c1d809.js";import{e as J,t as Ye,c as Ke}from"./config.82550349.js";import{r as Ie,i as Ze}from"./TileContainer.8b7fafe2.js";import{n as Xe,l as V,r as et,i as te,a as D}from"./StyleDefinition.d56936e4.js";import{I as U}from"./Utils.7f6f3a6b.js";import{l as he}from"./StyleRepository.a1fecb1f.js";import{y as tt,u as st}from"./LayerView.42d17220.js";import"./ProgramTemplate.e9a5aa54.js";import{r as it}from"./utils.4b023c9d.js";import{t as rt}from"./VertexElementDescriptor.1fdca6da.js";import"./floatRGBA.df11258c.js";import"./WGLContainer.1850619d.js";import"./pixelUtils.82950e1a.js";import"./enums.0295eb81.js";import"./MaterialKey.229b1dd6.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./colorUtils.bb6424b7.js";import"./GeometryUtils.4f19e772.js";import"./Geometry.d049a63c.js";class Q{constructor(e,s){this._width=0,this._height=0,this._free=[],this._width=e,this._height=s,this._free.push(new M(0,0,e,s))}get width(){return this._width}get height(){return this._height}allocate(e,s){if(e>this._width||s>this._height)return new M;let t=null,i=-1;for(let r=0;re&&this._free.push(new M(t.x+e,t.y,t.width-e,s)),t.height>s&&this._free.push(new M(t.x,t.y+s,t.width,t.height-s))):(t.width>e&&this._free.push(new M(t.x+e,t.y,t.width-e,t.height)),t.height>s&&this._free.push(new M(t.x,t.y+s,e,t.height-s))),new M(t.x,t.y,e,s))}release(e){for(let s=0;s{if(a<=256){const h=e+a;if(this._rangePromises.has(h))o.push(this._rangePromises.get(h));else{const y=i.getRange(e,a).then(()=>{this._rangePromises.delete(h)},()=>{this._rangePromises.delete(h)});this._rangePromises.set(h,y),o.push(y)}}}),Promise.all(o).then(()=>{let a=this._glyphIndex[e];a||(a={},this._glyphIndex[e]=a);for(const h of s){const y=a[h];if(y){t[h]={sdf:!0,rect:y.rect,metrics:y.metrics,page:y.page,code:h};continue}const u=i.getGlyph(e,h);if(!u||!u.metrics)continue;const d=u.metrics;let c;if(d.width===0)c=new M(0,0,0,0);else{const f=d.width+6,g=d.height+2*3;let m=f%4?4-f%4:4,w=g%4?4-g%4:4;m===1&&(m=5),w===1&&(w=5),c=this._binPack.allocate(f+m,g+w),c.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(void 0),this._binPack=new Q(this.width-4,this.height-4),c=this._binPack.allocate(f+m,g+w));const b=this._glyphData[this._currentPage],x=u.bitmap;let A,S;if(x)for(let R=0;R{t.addRange(s,new K(new Ae(new Uint8Array(o.data),new DataView(o.data))))}).catch(()=>{t.addRange(s,new K)})}return t.addRange(s,new K),Promise.resolve()}getGlyph(e,s){const t=this._getFontStack(e);if(!t)return;const i=Math.floor(s/256);if(i>256)return;const r=t.getRange(i);return r?{metrics:r.getMetrics(s),bitmap:r.getBitmap(s)}:void 0}_getFontStack(e){let s=this._glyphInfo[e];return s||(s=this._glyphInfo[e]=new nt),s}}const ot="dasharray-";class W{constructor(e,s,t=0){this._size=[],this._mosaicsData=[],this._textures=[],this._dirties=[],this._maxItemSize=0,this._currentPage=0,this._pageWidth=0,this._pageHeight=0,this._mosaicRects={},this.pixelRatio=1,(e<=0||s<=0)&&console.error("Sprites mosaic defaultWidth and defaultHeight must be greater than zero!"),this._pageWidth=e,this._pageHeight=s,t>0&&(this._maxItemSize=t),this._binPack=new Q(e-4,s-4)}dispose(){this._binPack=null,this._mosaicRects={};for(const e of this._textures)e&&e.dispose();this._textures.length=0}getWidth(e){return e>=this._size.length?-1:this._size[e][0]}getHeight(e){return e>=this._size.length?-1:this._size[e][1]}getPageSize(e){return e>=this._size.length?null:this._size[e]}setSpriteSource(e){if(this.dispose(),this.pixelRatio=e.devicePixelRatio,this._mosaicsData.length===0){this._binPack=new Q(this._pageWidth-4,this._pageHeight-4);const s=Math.floor(this._pageWidth),t=Math.floor(this._pageHeight),i=new Uint32Array(s*t);this._mosaicsData[0]=i,this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}this._sprites=e}getSpriteItem(e,s=!1){let t,i,r=this._mosaicRects[e];if(r)return r;if(!this._sprites||this._sprites.loadStatus!=="loaded"||(e&&e.startsWith(ot)?([t,i]=this._rasterizeDash(e),s=!0):t=this._sprites.getSpriteInfo(e),!t||!t.width||!t.height||t.width<0||t.height<0))return null;const n=t.width,o=t.height,[a,h,y]=this._allocateImage(n,o);return a.width<=0?null:(this._copy(a,t,h,y,s,i),r={rect:a,width:n,height:o,sdf:t.sdf,simplePattern:!1,pixelRatio:t.pixelRatio,page:h},this._mosaicRects[e]=r,r)}getSpriteItems(e){const s={};for(const t of e)s[t.name]=this.getSpriteItem(t.name,t.repeat);return s}getMosaicItemPosition(e,s){const t=this.getSpriteItem(e,s),i=t&&t.rect;if(!i)return null;i.width=t.width,i.height=t.height;const r=t.width,n=t.height,o=2;return{tl:[i.x+o,i.y+o],br:[i.x+o+r,i.y+o+n],page:t.page}}bind(e,s,t=0,i=0){if(t>=this._size.length||t>=this._mosaicsData.length)return;this._textures[t]||(this._textures[t]=new Te(e,{pixelFormat:we.RGBA,dataType:xe.UNSIGNED_BYTE,wrapMode:je.CLAMP_TO_EDGE,width:this._size[t][0],height:this._size[t][1]},new Uint8Array(this._mosaicsData[t].buffer)));const r=this._textures[t];r.setSamplingMode(s),this._dirties[t]&&r.setData(new Uint8Array(this._mosaicsData[t].buffer)),e.bindTexture(r,i),this._dirties[t]=!1}static _copyBits(e,s,t,i,r,n,o,a,h,y,u){let d=i*s+t,c=a*n+o;if(u){c-=n;for(let _=-1;_<=y;_++,d=((_+y)%y+i)*s+t,c+=n)for(let f=-1;f<=h;f++)r[c+f]=e[d+(f+h)%h]}else for(let _=0;_=this._mosaicsData.length)return;const o=new Uint32Array(n?n.buffer:this._sprites.image.buffer),a=this._mosaicsData[t];a&&o||console.error("Source or target images are uninitialized!");const h=2,y=n?s.width:this._sprites.width;W._copyBits(o,y,s.x,s.y,a,i[0],e.x+h,e.y+h,s.width,s.height,r),this._dirties[t]=!0}_allocateImage(e,s){e+=2,s+=2;const t=Math.max(e,s);if(this._maxItemSize&&this._maxItemSizethis._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(e){this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,e),this._spriteSourcePromise.then(t=>{this._spriteMosaic=new W(1024,1024,250),this._spriteMosaic.setSpriteSource(t)});const s=new ue(this._layer.currentStyleInfo.glyphsUrl?re(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);this._glyphMosaic=new ce(1024,1024,s),this._broadcastPromise=Pe("WorkerTileHandler",{client:this,schedule:e.schedule,signal:e.signal}).then(t=>{if(this._connection=t,this._layer&&!this._connection.closed){const i=t.broadcast("setStyle",this._layer.currentStyleInfo.style,e);Promise.all(i).catch(r=>Me(r))}})}async updateStyle(e){return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",e)),this._broadcastPromise}setSpriteSource(e){const s=new W(1024,1024,250);return s.setSpriteSource(e),this._spriteMosaic=s,this._spriteSourcePromise=Promise.resolve(e),s}async setStyle(e,s){await this._broadcastPromise,this._styleRepository=e,this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,null),this._spriteSourcePromise.then(i=>{this._spriteMosaic=new W(1024,1024,250),this._spriteMosaic.setSpriteSource(i)});const t=new ue(this._layer.currentStyleInfo.glyphsUrl?re(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);return this._glyphMosaic=new ce(1024,1024,t),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",s)),this._broadcastPromise}fetchTileData(e,s){return this._getRefKeys(e,s).then(t=>{const i=this._layer.sourceNameToSource,r=[];for(const n in i)r.push(n);return this._getSourcesData(r,t,s)})}parseTileData(e,s){const t=e&&e.data;if(!t)return Promise.resolve(null);const{sourceName2DataAndRefKey:i,transferList:r}=t;return Object.keys(i).length===0?Promise.resolve(null):this._broadcastPromise.then(()=>this._connection.invoke("createTileAndParse",{key:e.key.id,sourceName2DataAndRefKey:i,styleLayerUIDs:e.styleLayerUIDs},{...s,transferList:r}))}async getSprites(e){return await this._spriteSourcePromise,this._spriteMosaic.getSpriteItems(e)}getGlyphs(e){return this._glyphMosaic.getGlyphItems(e.font,e.codePoints)}async _getTilePayload(e,s,t){const i=B.pool.acquire(e.id),r=this._layer.sourceNameToSource[s],{level:n,row:o,col:a}=i;B.pool.release(i);try{return{protobuff:await r.requestTile(n,o,a,t),sourceName:s}}catch(h){if(X(h))throw h;return{protobuff:null,sourceName:s}}}_getRefKeys(e,s){const t=this._layer.sourceNameToSource,i=new Array;for(const r in t){const n=t[r].getRefKey(e,s);i.push(n)}return ne(i)}_getSourcesData(e,s,t){const i=[];for(let r=0;r{const n={},o=[];for(let a=0;a0){const h=s[a].value.id;n[r[a].value.sourceName]={refKey:h,protobuff:r[a].value.protobuff},o.push(r[a].value.protobuff)}return{sourceName2DataAndRefKey:n,transferList:o}})}}const de=512,lt=1e-6,ht=(l,e)=>l+1/(1<<2*e);class ct{constructor(e,s){this._tiles=new Map,this._tileCache=new Le(40,t=>t.dispose()),this._viewSize=[0,0],this._visibleTiles=new Map,this.acquireTile=e.acquireTile,this.releaseTile=e.releaseTile,this.tileInfoView=e.tileInfoView,this._container=s}destroy(){for(const[e,s]of this._tiles)s.dispose();this._tiles=null,this._tileCache.clear(),this._tileCache=null}update(e){this._updateCacheSize(e);const s=this.tileInfoView,t=s.getTileCoverage(e.state,0,"smallest"),{spans:i,lodInfo:r}=t,{level:n}=r,o=this._tiles,a=new Set,h=new Set;for(const{row:u,colFrom:d,colTo:c}of i)for(let _=d;_<=c;_++){const f=B.getId(n,u,r.normalizeCol(_),r.getWorldForColumn(_)),g=this._getOrAcquireTile(f);a.add(f),g.processed()?this._addToContainer(g):h.add(new B(f))}for(const[u,d]of o)d.isCoverage=a.has(u);for(const u of h)this._findPlaceholdersForMissingTiles(u,a);let y=!1;for(const[u,d]of o)d.neededForCoverage=a.has(u),d.neededForCoverage||d.isHoldingForFade&&s.intersects(t,d.key)&&a.add(u),d.isFading&&(y=!0);for(const[u,d]of this._tiles)a.has(u)||this._releaseTile(u);return pe.pool.release(t),!y}clear(){this._tiles.clear(),this._tileCache.clear(),this._visibleTiles.clear()}clearCache(){this._tileCache.clear()}_findPlaceholdersForMissingTiles(e,s){const t=[];for(const[r,n]of this._tiles)this._addPlaceholderChild(t,n,e,s);const i=t.reduce(ht,0);Math.abs(1-i)0;){if(i--,r>>=1,n>>=1,t.level===i&&t.row===r&&t.col===n&&t.world===o)return!0;if(a.has(`${i}/${r}/${n}/${o}`))return!1}return!1}_updateCacheSize(e){const s=e.state.size;if(s[0]===this._viewSize[0]&&s[1]===this._viewSize[1])return;const t=Math.ceil(s[0]/de)+1,i=Math.ceil(s[1]/de)+1;this._viewSize[0]=s[0],this._viewSize[1]=s[1],this._tileCache.maxSize=5*t*i}}function ut(l){const[e,s,t,i]=l.split("/"),r=parseInt(e,10);return r===0?null:`${r-1}/${parseInt(s,10)>>1}/${parseInt(t,10)>>1}/${parseInt(i,10)}`}function dt(l,e){const s=e.level-l.level;return l.row===e.row>>s&&l.col===e.col>>s&&l.world===e.world}class yt{constructor(e){this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=e}}class ft{constructor(){this.tileSymbols=[],this.parts=[{startTime:0,startOpacity:0,targetOpacity:0,show:!1},{startTime:0,startOpacity:0,targetOpacity:0,show:!1}],this.show=!1}}function ye(l,e,s,t,i,r){const n=s-i;if(n>=0)return(e>>n)+(t-(r<>n);const o=-n;return e-(r-(t<>o)<0){const n=new Map;for(let o=0;o0}triangleCount(){return this.lineIndexCount/3}doDestroy(){p(this.lineVertexArrayObject)&&this.lineVertexArrayObject.dispose(),p(this.lineVertexBuffer)&&this.lineVertexBuffer.dispose(),p(this.lineIndexBuffer)&&this.lineIndexBuffer.dispose(),this.lineVertexArrayObject=null,this.lineVertexBuffer=null,this.lineIndexBuffer=null,this.memoryUsed=0}doPrepareForRendering(e,s,t){const i=new Uint32Array(s),r=new Int32Array(i.buffer),n=i[t++];this.lineVertexBuffer=C.createVertex(e,I.STATIC_DRAW,new Int32Array(r.buffer,4*t,n)),t+=n;const o=i[t++];this.lineIndexBuffer=C.createIndex(e,I.STATIC_DRAW,new Uint32Array(i.buffer,4*t,o)),t+=o;const a=this.layer.lineMaterial;this.lineVertexArrayObject=new z(e,a.getAttributeLocations(),a.getLayoutInfo(),{geometry:this.lineVertexBuffer},this.lineIndexBuffer)}}class bt extends Y{constructor(e,s){super(e,s),this.type=P.FILL,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const t=new Uint32Array(e);let i=this.bufferDataOffset;this.fillIndexStart=t[i++],this.fillIndexCount=t[i++],this.outlineIndexStart=t[i++],this.outlineIndexCount=t[i++];const r=t[i++];if(r>0){const n=new Map;for(let o=0;o0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){p(this.fillVertexArrayObject)&&this.fillVertexArrayObject.dispose(),p(this.fillVertexBuffer)&&this.fillVertexBuffer.dispose(),p(this.fillIndexBuffer)&&this.fillIndexBuffer.dispose(),this.fillVertexArrayObject=null,this.fillVertexBuffer=null,this.fillIndexBuffer=null,p(this.outlineVertexArrayObject)&&this.outlineVertexArrayObject.dispose(),p(this.outlineVertexBuffer)&&this.outlineVertexBuffer.dispose(),p(this.outlineIndexBuffer)&&this.outlineIndexBuffer.dispose(),this.outlineVertexArrayObject=null,this.outlineVertexBuffer=null,this.outlineIndexBuffer=null,this.memoryUsed=0}doPrepareForRendering(e,s,t){const i=new Uint32Array(s),r=new Int32Array(i.buffer),n=i[t++];this.fillVertexBuffer=C.createVertex(e,I.STATIC_DRAW,new Int32Array(r.buffer,4*t,n)),t+=n;const o=i[t++];this.fillIndexBuffer=C.createIndex(e,I.STATIC_DRAW,new Uint32Array(i.buffer,4*t,o)),t+=o;const a=i[t++];this.outlineVertexBuffer=C.createVertex(e,I.STATIC_DRAW,new Int32Array(r.buffer,4*t,a)),t+=a;const h=i[t++];this.outlineIndexBuffer=C.createIndex(e,I.STATIC_DRAW,new Uint32Array(i.buffer,4*t,h)),t+=h;const y=this.layer,u=y.fillMaterial,d=y.outlineMaterial;this.fillVertexArrayObject=new z(e,u.getAttributeLocations(),u.getLayoutInfo(),{geometry:this.fillVertexBuffer},this.fillIndexBuffer),this.outlineVertexArrayObject=new z(e,d.getAttributeLocations(),d.getLayoutInfo(),{geometry:this.outlineVertexBuffer},this.outlineIndexBuffer)}}class wt extends Y{constructor(e,s,t){super(e,s),this.type=P.SYMBOL,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.symbolInstances=[],this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[];const i=new Uint32Array(e),r=new Int32Array(e),n=new Float32Array(e);let o=this.bufferDataOffset;this.isIconSDF=!!i[o++];const a=i[o++];for(let d=0;d0||this.glyphPerPageElementsMap.size>0}triangleCount(){let e=0;for(const[s,t]of this.iconPerPageElementsMap)e+=t[1];for(const[s,t]of this.glyphPerPageElementsMap)e+=t[1];return e/3}doDestroy(){p(this.iconVertexArrayObject)&&this.iconVertexArrayObject.dispose(),p(this.iconVertexBuffer)&&this.iconVertexBuffer.dispose(),p(this.iconOpacityBuffer)&&this.iconOpacityBuffer.dispose(),p(this.iconIndexBuffer)&&this.iconIndexBuffer.dispose(),this.iconVertexArrayObject=null,this.iconVertexBuffer=null,this.iconOpacityBuffer=null,this.iconIndexBuffer=null,p(this.textVertexArrayObject)&&this.textVertexArrayObject.dispose(),p(this.textVertexBuffer)&&this.textVertexBuffer.dispose(),p(this.textOpacityBuffer)&&this.textOpacityBuffer.dispose(),p(this.textIndexBuffer)&&this.textIndexBuffer.dispose(),this.textVertexArrayObject=null,this.textVertexBuffer=null,this.textOpacityBuffer=null,this.textIndexBuffer=null,this.memoryUsed=0}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const e=k(this.iconOpacity),s=k(this.iconOpacityBuffer);e.length>0&&e.byteLength===s.size&&s.setSubData(e,0,0,e.length);const t=k(this.textOpacity),i=k(this.textOpacityBuffer);t.length>0&&t.byteLength===i.size&&i.setSubData(t,0,0,t.length)}doPrepareForRendering(e,s,t){const i=new Uint32Array(s),r=new Int32Array(i.buffer),n=i[t++];this.iconVertexBuffer=C.createVertex(e,I.STATIC_DRAW,new Int32Array(r.buffer,4*t,n)),t+=n;const o=i[t++];this.iconIndexBuffer=C.createIndex(e,I.STATIC_DRAW,new Uint32Array(i.buffer,4*t,o)),t+=o;const a=i[t++];this.textVertexBuffer=C.createVertex(e,I.STATIC_DRAW,new Int32Array(r.buffer,4*t,a)),t+=a;const h=i[t++];this.textIndexBuffer=C.createIndex(e,I.STATIC_DRAW,new Uint32Array(i.buffer,4*t,h)),t+=h,this.iconOpacityBuffer=C.createVertex(e,I.STATIC_DRAW,k(this.iconOpacity).buffer),this.textOpacityBuffer=C.createVertex(e,I.STATIC_DRAW,k(this.textOpacity).buffer);const y=this.layer,u=y.iconMaterial,d=y.textMaterial;this.iconVertexArrayObject=new z(e,u.getAttributeLocations(),u.getLayoutInfo(),{geometry:this.iconVertexBuffer,opacity:this.iconOpacityBuffer},this.iconIndexBuffer),this.textVertexArrayObject=new z(e,d.getAttributeLocations(),d.getLayoutInfo(),{geometry:this.textVertexBuffer,opacity:this.textOpacityBuffer},this.textIndexBuffer)}}class xt extends Y{constructor(e,s){super(e,s),this.type=P.CIRCLE,this.circleIndexStart=0,this.circleIndexCount=0;const t=new Uint32Array(e);let i=this.bufferDataOffset;this.circleIndexStart=t[i++],this.circleIndexCount=t[i++],this.bufferDataOffset=i}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){p(this.circleVertexArrayObject)&&this.circleVertexArrayObject.dispose(),p(this.circleVertexBuffer)&&this.circleVertexBuffer.dispose(),p(this.circleIndexBuffer)&&this.circleIndexBuffer.dispose(),this.circleVertexArrayObject=null,this.circleVertexBuffer=null,this.circleIndexBuffer=null,this.memoryUsed=0}doPrepareForRendering(e,s,t){const i=new Uint32Array(s),r=new Int32Array(i.buffer),n=i[t++];this.circleVertexBuffer=C.createVertex(e,I.STATIC_DRAW,new Int32Array(r.buffer,4*t,n)),t+=n;const o=i[t++];this.circleIndexBuffer=C.createIndex(e,I.STATIC_DRAW,new Uint32Array(i.buffer,4*t,o)),t+=o;const a=this.layer.circleMaterial;this.circleVertexArrayObject=new z(e,a.getAttributeLocations(),a.getLayoutInfo(),{geometry:this.circleVertexBuffer},this.circleIndexBuffer)}}class se extends Ie{constructor(e,s,t,i,r,n,o,a=null){super(e,s,t,i,r,n,4096,4096),this._memCache=a,this.type="vector-tile",this._referenced=0,this._hasSymbolBuckets=!1,this._memoryUsedByLayerData=0,this.layerData=new Map,this.layerCount=0,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.invalidating=!1,this.parentTile=null,this.childrenTiles=new Set,this._processed=!1,this._referenced=1,this.styleRepository=o,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate0}dispose(){this.status!=="unloaded"&&(St.delete(this),se._destroyRenderBuckets(this.layerData),this.layerData=null,this.layerCount=0,this._memoryUsedByLayerData=0,this.destroy(),this.status="unloaded")}release(){return--this._referenced==0&&(this.dispose(),this.stage=null,!0)}retain(){++this._referenced}get referenced(){return this._referenced}get memoryUsage(){return(this._memoryUsedByLayerData+256)/(this._referenced||1)}changeDataImpl(e){let s=!1;if(e){const{bucketsWithData:t,emptyBuckets:i}=e,r=this._createRenderBuckets(t);if(i&&i.byteLength>0){const n=new Uint32Array(i);for(const o of n)this._deleteLayerData(o)}for(const[n,o]of r)this._deleteLayerData(n),o.type===P.SYMBOL&&(this.symbols.set(n,o.symbols),s=!0),this._memoryUsedByLayerData+=o.memoryUsed,this.layerData.set(n,o),this.layerCount++;p(this._memCache)&&this._memCache.updateSize(this.key.id,this,this._memoryUsedByLayerData)}this._hasSymbolBuckets=!1;for(const[t,i]of this.layerData)i.type===P.SYMBOL&&(this._hasSymbolBuckets=!0);s&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(s){s.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e){super.setTransform(e);const s=this.resolution/(e.resolution*e.pixelRatio),t=this.width/this.rangeX*s,i=this.height/this.rangeY*s,r=[0,0];e.toScreen(r,[this.x,this.y]);const n=this.transforms.tileUnitsToPixels;ge(n),me(n,n,r),Be(n,n,Math.PI*e.rotation/180),be(n,n,[t,i,1])}_createTransforms(){return{dvs:q(),tileMat3:q(),tileUnitsToPixels:q()}}static _destroyRenderBuckets(e){if(!e)return;const s=new Set;e.forEach(t=>{s.has(t)||(t.destroy(),s.add(t))}),e.clear()}_createRenderBuckets(e){const s=new Map,t=new Map;for(const i of e){const r=this._deserializeBucket(i,t);for(const n of r.layerUIDs)s.set(n,r)}return s}_deserializeBucket(e,s){let t=s.get(e);if(t)return t;switch(new Uint32Array(e)[0]){case P.FILL:t=new bt(e,this.styleRepository);break;case P.LINE:t=new mt(e,this.styleRepository);break;case P.SYMBOL:t=new wt(e,this.styleRepository,this);break;case P.CIRCLE:t=new xt(e,this.styleRepository)}return s.set(e,t),t}_deleteLayerData(e){if(!this.layerData.has(e))return;const s=this.layerData.get(e);this._memoryUsedByLayerData-=s.memoryUsed,s.destroy(),this.layerData.delete(e),this.layerCount--}}const St=new Map;function Tt(l,e,s,t,i,r){const{iconRotationAlignment:n,textRotationAlignment:o,iconTranslate:a,iconTranslateAnchor:h,textTranslate:y,textTranslateAnchor:u}=t;let d=0;for(const c of l.colliders){const[_,f]=c.partIndex===0?a:y,g=c.partIndex===0?h:u,m=c.minLod<=r&&r<=c.maxLod;d+=m?0:1,c.enabled=m,c.xScreen=c.xTile*i[0]+c.yTile*i[3]+i[6],c.yScreen=c.xTile*i[1]+c.yTile*i[4]+i[7],g===et.MAP?(c.xScreen+=s*_-e*f,c.yScreen+=e*_+s*f):(c.xScreen+=_,c.yScreen+=f),V.VIEWPORT===(c.partIndex===0?n:o)?(c.dxScreen=c.dxPixels,c.dyScreen=c.dyPixels):(c.dxScreen=s*(c.dxPixels+c.width/2)-e*(c.dyPixels+c.height/2)-c.width/2,c.dyScreen=e*(c.dxPixels+c.width/2)+s*(c.dyPixels+c.height/2)-c.height/2)}l.colliders.length>0&&d===l.colliders.length&&(l.unique.show=!1)}class It{constructor(e,s,t,i,r,n){this._symbols=e,this._styleRepository=i,this._zoom=r,this._currentLayerCursor=0,this._currentSymbolCursor=0,this._styleProps=new Map,this._allNeededMatrices=new Map,this._gridIndex=new Ce(s,t,Ye),this._si=Math.sin(Math.PI*n/180),this._co=Math.cos(Math.PI*n/180);for(const o of e)for(const a of o.symbols)this._allNeededMatrices.has(a.tile)||this._allNeededMatrices.set(a.tile,Oe(a.tile.transforms.tileUnitsToPixels))}work(e){const s=this._gridIndex;function t(r){const n=r.xScreen+r.dxScreen,o=r.yScreen+r.dyScreen,a=n+r.width,h=o+r.height,[y,u,d,c]=s.getCellSpan(n,o,a,h);for(let _=u;_<=c;_++)for(let f=y;f<=d;f++){const g=s.cells[_][f];for(const m of g){const w=m.xScreen+m.dxScreen,b=m.yScreen+m.dyScreen,x=w+m.width,A=b+m.height;if(!(ax||hA))return!0}}return!1}const i=performance.now();for(;this._currentLayerCursore)return!1;const o=r.symbols[this._currentSymbolCursor];if(!o.unique.show)continue;Tt(o,this._si,this._co,n,this._allNeededMatrices.get(o.tile),this._zoom);const a=o.unique;if(!a.show)continue;const{iconAllowOverlap:h,iconIgnorePlacement:y,textAllowOverlap:u,textIgnorePlacement:d}=n;for(const c of o.colliders){if(!c.enabled)continue;const _=a.parts[c.partIndex];!_.show||!(c.partIndex?u:h)&&t(c)&&(c.hard?a.show=!1:_.show=!1)}if(a.show)for(const c of o.colliders){if(!c.enabled||(c.partIndex?d:y)||!a.parts[c.partIndex].show)continue;const _=c.xScreen+c.dxScreen,f=c.yScreen+c.dyScreen,g=_+c.width,m=f+c.height,[w,b,x,A]=this._gridIndex.getCellSpan(_,f,g,m);for(let S=b;S<=A;S++)for(let R=w;R<=x;R++)this._gridIndex.cells[S][R].push(c)}}}return!0}_getProperties(e){const s=this._styleProps.get(e);if(s)return s;const t=this._zoom,i=this._styleRepository.getStyleLayerByUID(e),r=i.getLayoutValue("symbol-placement",t)!==Xe.POINT;let n=i.getLayoutValue("icon-rotation-alignment",t);n===V.AUTO&&(n=r?V.MAP:V.VIEWPORT);let o=i.getLayoutValue("text-rotation-alignment",t);o===V.AUTO&&(o=r?V.MAP:V.VIEWPORT);const a=i.getPaintValue("icon-translate",t),h=i.getPaintValue("icon-translate-anchor",t),y=i.getPaintValue("text-translate",t),u=i.getPaintValue("text-translate-anchor",t),d={iconAllowOverlap:i.getLayoutValue("icon-allow-overlap",t),iconIgnorePlacement:i.getLayoutValue("icon-ignore-placement",t),textAllowOverlap:i.getLayoutValue("text-allow-overlap",t),textIgnorePlacement:i.getLayoutValue("text-ignore-placement",t),iconRotationAlignment:n,textRotationAlignment:o,iconTranslateAnchor:h,iconTranslate:a,textTranslateAnchor:u,textTranslate:y};return this._styleProps.set(e,d),d}}function Ct(l,e){if(l.priority-e.priority)return l.priority-e.priority;const s=l.tile.key,t=e.tile.key;return s.world-t.world?s.world-t.world:s.level-t.level?s.level-t.level:s.row-t.row?s.row-t.row:s.col-t.col?s.col-t.col:l.xTile-e.xTile?l.xTile-e.xTile:l.yTile-e.yTile}class vt{constructor(e,s,t,i,r,n){this._visibleTiles=e,this._symbolRepository=s,this._createCollisionJob=t,this._assignTileSymbolsOpacity=i,this._symbolLayerSorter=r,this._isLayerVisible=n,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}get running(){return this._running}setScreenSize(e,s){this._screenWidth===e&&this._screenHeight===s||this.restart(),this._screenWidth=e,this._screenHeight=s}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(e){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const s=performance.now();if(!this._selectionJob.work(e)||(this._selectionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-s)))===0))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const s=performance.now();if(!this._collisionJob.work(e)||(this._collisionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-s)))===0))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const s=performance.now();if(!this._opacityJob.work(e)||(this._opacityJobCompleted=!0,(e=Math.max(0,e-(performance.now()-s)))===0))return!1}return this._running=!1,!0}_createSelectionJob(){const e=this._symbolRepository.uniqueSymbols;for(let a=0;aa)return!1;let _=null,f=!1,g=!1;for(const m of h.tileSymbols)if(!g||!f){const w=m.tile;(!_||w.isCoverage||w.neededForCoverage&&!f)&&(_=m,(w.neededForCoverage||w.isCoverage)&&(g=!0),w.isCoverage&&(f=!0))}if(_.selectedForRendering=!0,g){c.symbols.push(_),h.show=!0;for(const m of h.parts)m.show=!0}else h.show=!1}}for(const u of s)u.symbols.sort(Ct);return!0}const o=this._symbolLayerSorter;return{work:n,get sortedSymbols(){return s.sort(o)}}}_createOpacityJob(){const e=this._assignTileSymbolsOpacity,s=this._visibleTiles;let t=0;function i(r,n){const o=r.symbols;for(const[a,h]of o)Dt(h,n);e(r,n);for(const a of r.childrenTiles)i(a,n)}return{work(r){const n=performance.now();for(;tr)return!1;const o=s[t];p(o.parentTile)||i(o,performance.now())}return!0}}}}function Dt(l,e){for(const s of l){const t=s.unique;for(const i of t.parts){const r=i.targetOpacity>.5?1:-1;i.startOpacity+=r*((e-i.startTime)/J),i.startOpacity=Math.min(Math.max(i.startOpacity,0),1),i.startTime=e,i.targetOpacity=t.show&&i.show?1:0}}}const Rt=32,At=8,Pt=64;class Mt{constructor(e,s,t){this.tileCoordRange=e,this._visibleTiles=s,this._createUnique=t,this._tiles=new Map,this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){return O(this._uniqueSymbolLayerArray)&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}add(e,s){this._uniqueSymbolLayerArray=null;let t=this._tiles.get(e.id);t||(t={symbols:new Map},this._tiles.set(e.id,t));const i=new Map;if(s)for(const o of s)t.symbols.has(o)&&(i.set(o,t.symbols.get(o)),t.symbols.delete(o));else for(const[o,a]of e.layerData)t.symbols.has(o)&&(i.set(o,t.symbols.get(o)),t.symbols.delete(o));this._removeSymbols(i);const r=e.symbols,n=new Map;for(const[o,a]of r){let h=a.length;if(h>=Rt){let y=this.tileCoordRange;do y/=2,h/=4;while(h>At&&y>Pt);const u=new Ce(this.tileCoordRange,this.tileCoordRange,y);n.set(o,{flat:a,index:u}),t.symbols.set(o,{flat:a,index:u});for(const d of a)u.getCell(d.xTile,d.yTile).push(d)}else n.set(o,{flat:a}),t.symbols.set(o,{flat:a})}this._addSymbols(e.key,r)}deleteStyleLayers(e){this._uniqueSymbolLayerArray=null;for(const[s,t]of this._tiles){const i=new Map;for(const r of e)t.symbols.has(r)&&(i.set(r,t.symbols.get(r)),t.symbols.delete(r));this._removeSymbols(i),t.symbols.size===0&&this._tiles.delete(s)}}removeTile(e){this._uniqueSymbolLayerArray=null;const s=this._tiles.get(e.id);if(!s)return;const t=new Map;for(const[i,r]of e.symbols)s.symbols.has(i)&&(t.set(i,s.symbols.get(i)),s.symbols.delete(i));this._removeSymbols(t),s.symbols.size===0&&this._tiles.delete(e.id)}_removeSymbols(e){for(const[s,{flat:t}]of e)for(const i of t){const r=i.unique,n=r.tileSymbols,o=n.length-1;for(let a=0;as.level){const r=e.key.level-s.level;if(e.key.row>>r!==s.row||e.key.col>>r!==s.col)return}if(s.level>e.key.level){const r=s.level-e.key.level;if(s.row>>r!==e.key.row||s.col>>r!==e.key.col)return}if(s.equals(e.key)){for(const r of e.childrenTiles)this._matchSymbols(r,s,t);return}const i=new Map;for(const[r,n]of t){const o=[];for(const u of n){const d=ye(this.tileCoordRange,u.xTile,s.level,s.col,e.key.level,e.key.col),c=ye(this.tileCoordRange,u.yTile,s.level,s.row,e.key.level,e.key.row);d>=0&&d=0&&c0&&i.set(r,a)}for(const r of e.childrenTiles)this._matchSymbols(r,s,i)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsReferences,s=new Array(e.size);let t,i=0;for(const[r,n]of e){const o=new Array(n.size);t=0;for(const a of n)o[t++]=a;s[i]={styleLayerUID:r,uniqueSymbols:o},i++}return s}}const Lt=.5,fe=1e-6;class Bt extends Ue{constructor(e,s){super(),this.styleRepository=e,this._tileToHandle=new Map,this._viewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._declutterViewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._completed=!1,this._symbolRepository=new Mt(4096,s,()=>new ft),this._symbolDeclutterer=new vt(s,this._symbolRepository,(t,i,r)=>new It(t,i,r,this.styleRepository,this._zoom,this._viewState.rotation),(t,i)=>{t.allSymbolsFadingOut=!0,t.lastOpacityUpdate=i,pt(t,i,!0),t.decluttered=!0,t.requestRender()},(t,i)=>this.styleRepository.getStyleLayerByUID(t.styleLayerUID).z-this.styleRepository.getStyleLayerByUID(i.styleLayerUID).z,t=>{const i=this.styleRepository.getStyleLayerByUID(t);if(this._zoom+fe=i.maxzoom)return!1;const r=i.getLayoutProperty("visibility");return!r||r.getValue()!==te.NONE})}addTile(e){e.decluttered=!1,this._tileToHandle.set(e,e.on("symbols-changed",()=>{this._symbolRepository.add(e),this.restartDeclutter()})),this._symbolRepository.add(e),this.restartDeclutter()}removeTile(e){const s=this._tileToHandle.get(e);s&&(this._symbolRepository.removeTile(e),this.restartDeclutter(),s.remove(),this._tileToHandle.delete(e))}update(e,s){return this._zoom=e,this._viewState={scale:s.scale,rotation:s.rotation,center:[s.center[0],s.center[1]],size:[s.size[0],s.size[1]]},this._continueDeclutter(),this._completed}restartDeclutter(){this._completed=!1,this._symbolDeclutterer.restart(),this._notifyUnstable()}clear(){this._completed=!1,this._symbolRepository=null,this._symbolDeclutterer.restart(),this._tileToHandle.forEach(e=>e.remove()),this._tileToHandle.clear()}get stale(){return this._zoom!==this._declutterZoom||this._viewState.size[0]!==this._declutterViewState.size[0]||this._viewState.size[1]!==this._declutterViewState.size[1]||this._viewState.scale!==this._declutterViewState.scale||this._viewState.rotation!==this._declutterViewState.rotation}deleteStyleLayers(e){this._symbolRepository.deleteStyleLayers(e)}_continueDeclutter(){this._completed&&!this.stale||(this._symbolDeclutterer.running||(this._declutterZoom=this._zoom,this._declutterViewState.center[0]=this._viewState.center[0],this._declutterViewState.center[1]=this._viewState.center[1],this._declutterViewState.rotation=this._viewState.rotation,this._declutterViewState.scale=this._viewState.scale,this._declutterViewState.size[0]=this._viewState.size[0],this._declutterViewState.size[1]=this._viewState.size[1],this._symbolDeclutterer.restart()),this._symbolDeclutterer.setScreenSize(this._viewState.size[0],this._viewState.size[1]),this._completed=this._symbolDeclutterer.continue(Ke),this._completed&&this._scheduleNotifyStable())}_scheduleNotifyStable(){p(this._stableNotificationHandle)&&clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=setTimeout(()=>{this._stableNotificationHandle=null,this.emit("fade-complete")},(1+Lt)*J)}_notifyUnstable(){p(this._stableNotificationHandle)&&(clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=null),this.emit("fade-start")}}class Ot extends Ie{_createTransforms(){return{dvs:q(),tileMat3:q()}}}const G=1e-6;function _e(l,e){if(l){const s=l.getLayoutProperty("visibility");if(!s||s.getValue()!==te.NONE&&(l.minzoom===void 0||l.minzoom=e-G))return!0}return!1}class Ut extends Ze{constructor(e){super(e),this._backgroundTiles=[],this._pointToCallbacks=new Map}destroy(){this.removeAllChildren(),this._spriteMosaic&&(this._spriteMosaic.dispose(),this._spriteMosaic=null),this._glyphMosaic&&(this._glyphMosaic.dispose(),this._glyphMosaic=null),p(this._symbolFader)&&(this._symbolFader.clear(),this._symbolFader=null),this._styleRepository=null,this._backgroundTiles=[],this._pointToCallbacks.clear()}setStyleResources(e,s,t){if(this._spriteMosaic=e,this._glyphMosaic=s,this._styleRepository=t,O(this._symbolFader)){const i=new Bt(this._styleRepository,this.children);i.on("fade-start",()=>{this.emit("fade-start"),this.requestRender()}),i.on("fade-complete",()=>{this.emit("fade-complete"),this.requestRender()}),this._symbolFader=i}k(this._symbolFader).styleRepository=t}setSpriteMosaic(e){this._spriteMosaic.dispose(),this._spriteMosaic=e}deleteStyleLayers(e){p(this._symbolFader)&&this._symbolFader.deleteStyleLayers(e)}async hitTest(e){const s=ke();return this._pointToCallbacks.set(e,s),this.requestRender(),s.promise}enterTileInvalidation(){for(const e of this.children)e.invalidating=!0}createRenderParams(e){return{...super.createRenderParams(e),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic,hasClipping:!!this._clippingInfos}}doRender(e){!this.visible||e.drawPhase!==U.MAP&&e.drawPhase!==U.DEBUG||this._spriteMosaic===void 0||super.doRender(e)}addChild(e){return super.addChild(e),p(this._symbolFader)?this._symbolFader.addTile(e):e.decluttered=!0,this.requestRender(),e}removeChild(e){return p(this._symbolFader)&&this._symbolFader.removeTile(e),this.requestRender(),super.removeChild(e)}renderChildren(e){const{drawPhase:s}=e;if(s!==U.DEBUG){if(this._doRender(e),this._pointToCallbacks.size>0){e.drawPhase=U.HITTEST;const t=e.painter.effects.hittestVTL;t.bind(e),this._doRender(e),t.draw(e,this._pointToCallbacks),t.unbind(e),e.drawPhase=s}}else super.renderChildren(e)}removeAllChildren(){for(let e=0;ee.neededForCoverage&&e.hasData())}restartDeclutter(){p(this._symbolFader)&&this._symbolFader.restartDeclutter()}_doRender(e){const{context:s}=e,t=this._styleRepository;if(!t)return;const i=t.layers;let r=!0;e.drawPhase===U.HITTEST&&(r=!1),t.backgroundBucketIds.length>0&&(e.renderPass="background",this._renderBackgroundLayers(e,t.backgroundBucketIds)),super.renderChildren(e),e.drawPhase===U.MAP&&this._fade(e.displayLevel,e.state);const n=this.children.filter(o=>o.visible&&o.hasData());if(!n||n.length===0)return s.bindVAO(),s.setStencilTestEnabled(!0),void s.setBlendingEnabled(!0);for(const o of n)o.triangleCount=0;s.setStencilWriteMask(0),s.setColorMask(!0,!0,!0,!0),s.setStencilOp(H.KEEP,H.KEEP,H.REPLACE),s.setStencilTestEnabled(!0),s.setBlendingEnabled(!1),s.setDepthTestEnabled(!0),s.setDepthWriteEnabled(!0),s.setDepthFunction(le.LEQUAL),s.setClearDepth(1),s.clear(s.gl.DEPTH_BUFFER_BIT),e.renderPass="opaque";for(let o=i.length-1;o>=0;o--)this._renderStyleLayer(i[o],e,n);s.setDepthWriteEnabled(!1),s.setBlendingEnabled(r),s.setBlendFunctionSeparate(F.ONE,F.ONE_MINUS_SRC_ALPHA,F.ONE,F.ONE_MINUS_SRC_ALPHA),e.renderPass="translucent";for(let o=0;oh.decluttered):t.filter(h=>h.neededForCoverage),o!=="vtlSymbol"){const h=s.displayLevel;if(t.length===0||e.minzoom!==void 0&&e.minzoom>=h+G||e.maxzoom!==void 0&&e.maxzoom>1,s.col>>1,s.world);return B.pool.release(s),t}getTileCoverage(e,s,t){const i=super.getTileCoverage(e,s,t);if(!i)return i;const r=1<n.row>=0&&n.rows[0].scale)return s[0].level;let t,i;for(let r=0;ri.scale)return t=s[r],t.level+(t.scale-e)/(t.scale-i.scale);return s[s.length-1].level}}_initializeFullCacheLODs(e){let s;if(e[0].level===0)s=e.map(t=>({level:t.level,resolution:t.resolution,scale:t.scale}));else{const t=this.tileInfo.size[0],i=this.tileInfo.spatialReference;s=Ee.create({size:t,spatialReference:i}).lods.map(r=>({level:r.level,resolution:r.resolution,scale:r.scale}))}for(let t=0;t{const{pixelRatio:e}=l.state;let s=0;const t=[],i=[];for(const r of this._vectorTileContainer.children)if(r.symbols)for(const[n,o]of r.symbols)for(const a of o)for(const h of a.colliders){const y=(h.xScreen+h.dxScreen)*e,u=(h.yScreen+h.dyScreen)*e,d=h.width*e,c=h.height*e,_=a.unique.parts[h.partIndex].targetOpacity>.5;if(!_&&this.layer.showCollisionBoxes!=="all")continue;const f=2,g=0,m=3,w=0,b=3,x=1,A=3,S=0,R=_?f:g,L=_?m:w,$=Z.makeFlags(R,L);t.push(y,u,$,y+d,u,$,y,u+c,$,y+d,u+c,$),i.push(s+0,s+1,s+2,s+1,s+3,s+2),s+=4;const ve=_?b:x,De=_?A:S,T=Z.makeFlags(ve,De);t.push(y,u,T,y+d,u,T,y,u+1,T,y+d,u+1,T),i.push(s+0,s+1,s+2,s+1,s+3,s+2),s+=4,t.push(y,u+c-1,T,y+d,u+c-1,T,y,u+c,T,y+d,u+c,T),i.push(s+0,s+1,s+2,s+1,s+3,s+2),s+=4,t.push(y,u,T,y+1,u,T,y,u+c,T,y+1,u+c,T),i.push(s+0,s+1,s+2,s+1,s+3,s+2),s+=4,t.push(y+d-1,u,T,y+d,u,T,y+d-1,u+c,T,y+d,u+c,T),i.push(s+0,s+1,s+2,s+1,s+3,s+2),s+=4}return{vertexData:new Int16Array(t),indexData:new Uint32Array(i)}},this._getCollidersColors=()=>[1,.5,0,1,1,0,0,1,0,1,.5,1,0,.5,0,1],this._getCollidersOpacities=()=>[.05,.01,.15,.2]}async hitTest(l,e){if(!this._tileHandlerPromise)return null;await this._tileHandlerPromise;const s=await this._vectorTileContainer.hitTest(e);if(!s||s.length===0)return null;const t=s[0]-1,i=this._styleRepository,r=i.getStyleLayerByUID(t);if(!r)return null;const n=i.getStyleLayerIndex(r.id);return[{type:"graphic",mapPoint:l,layer:this.layer,graphic:new ze({attributes:{layerId:n,layerName:r.id,layerUID:t},layer:this.layer,sourceLayer:this.layer})}]}update(l){if(this._tileHandlerPromise&&this._isTileHandlerReady)return l.pixelRatio!==this._tileHandler.devicePixelRatio?(this._start(),void(this._tileHandler.devicePixelRatio=l.pixelRatio)):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.state=l.state,this._parseQueue.state=l.state,this._tileManager.update(l)||this.requestUpdate(),this._parseQueue.resume(),this._fetchQueue.resume()))}attach(){const{style:l}=this.layer.currentStyleInfo;this._styleRepository=new he(l),this._tileInfoView=new Et(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new Ut(this._tileInfoView),this._tileHandler=new at(this.layer,this._styleRepository,window.devicePixelRatio||1),this.container.addChild(this._vectorTileContainer),this._start(),this.handles.add([this._vectorTileContainer.on("fade-start",()=>{this.fading=!0,this.notifyChange("updating"),this.requestUpdate()}),this._vectorTileContainer.on("fade-complete",()=>{var e;(e=this._collisionOverlay)==null||e.requestRender(),this.fading=!1,this.notifyChange("updating"),this.requestUpdate()}),$e(()=>this.layer.showCollisionBoxes,e=>{e!=="none"?this._collisionOverlay||(this._collisionOverlay=new Z({getMesh:this._getCollidersMesh,getColors:this._getCollidersColors,getOpacities:this._getCollidersOpacities}),this.container.addChild(this._collisionOverlay)):(this.container.removeChild(this._collisionOverlay),this._collisionOverlay=null),this.container.requestRender()},He),this.layer.on("paint-change",e=>{if(e.isDataDriven)this._styleChanges.push({type:v.PAINTER_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate();else{const s=this._styleRepository,t=s.getLayerById(e.layer);if(!t)return;const i=t.type===D.SYMBOL;s.setPaintProperties(e.layer,e.paint),i&&this._vectorTileContainer.restartDeclutter(),this._vectorTileContainer.requestRender()}}),this.layer.on("layout-change",e=>{const s=this._styleRepository,t=s.getLayerById(e.layer);if(!t)return;const i=Fe(t.layout,e.layout);if(!O(i)){if(qe(i,"visibility")&&zt(i)===1)return s.setLayoutProperties(e.layer,e.layout),t.type===D.SYMBOL&&this._vectorTileContainer.restartDeclutter(),void this._vectorTileContainer.requestRender();this._styleChanges.push({type:v.LAYOUT_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",e=>{const s=this._styleRepository,t=s.getLayerById(e.layer);t&&(s.setStyleLayerVisibility(e.layer,e.visibility),t.type===D.SYMBOL&&this._vectorTileContainer.restartDeclutter(),this._vectorTileContainer.requestRender())}),this.layer.on("style-layer-change",e=>{this._styleChanges.push({type:v.LAYER_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate()}),this.layer.on("delete-style-layer",e=>{this._styleChanges.push({type:v.LAYER_REMOVED,data:e}),this.notifyChange("updating"),this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",e=>{this._newSpriteSource=e.spriteSource,this._styleChanges.push({type:v.SPRITES_CHANGED,data:null});const s=this._styleRepository.layers;for(const t of s)switch(t.type){case D.SYMBOL:t.getLayoutProperty("icon-image")&&this._styleChanges.push({type:v.LAYOUT_CHANGED,data:{layer:t.id,layout:t.layout}});break;case D.LINE:t.getPaintProperty("line-pattern")&&this._styleChanges.push({type:v.PAINTER_CHANGED,data:{layer:t.id,paint:t.paint,isDataDriven:t.isPainterDataDriven()}});break;case D.FILL:t.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:v.PAINTER_CHANGED,data:{layer:t.id,paint:t.paint,isDataDriven:t.isPainterDataDriven()}})}this.notifyChange("updating"),this.requestUpdate()})],this.declaredClass)}detach(){var l,e;this._stop(),this.container.removeAllChildren(),(l=this._vectorTileContainer)==null||l.destroy(),this._vectorTileContainer=null,(e=this._tileHandler)==null||e.destroy(),this._tileHandler=null,this.handles.remove(this.declaredClass)}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this._collisionOverlay&&this._vectorTileContainer.restartDeclutter(),this.requestUpdate()}supportsSpatialReference(l){var e;return Ne((e=this.layer.tileInfo)==null?void 0:e.spatialReference,l)}canResume(){let l=super.canResume();const{currentStyleInfo:e}=this.layer;if(l&&(e==null?void 0:e.layerDefinition)){const s=this.view.scale,{minScale:t,maxScale:i}=e.layerDefinition;e&&e.layerDefinition&&(t&&ts&&(l=!1))}return l}isUpdating(){const l=this._vectorTileContainer.children;return!this._isTileHandlerReady||!this._fetchQueue||!this._parseQueue||this._fetchQueue.updating||this._parseQueue.updating||l.length>0&&l.some(e=>e.invalidating)||this.fading}acquireTile(l){const e=this._createVectorTile(l);return this._tileHandlerPromise.then(()=>{this._fetchQueue.push(e.key).then(s=>this._parseQueue.push({key:e.key,data:s})).then(s=>{e.once("attach",()=>this.requestUpdate()),e.setData(s),this.requestUpdate(),this.notifyChange("updating")}).catch(s=>{this.notifyChange("updating"),X(s)||oe.getLogger(this.declaredClass).error(s)})}),e}releaseTile(l){const e=l.key.id;this._fetchQueue.abort(e),this._parseQueue.abort(e),this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new ct({acquireTile:s=>this.acquireTile(s),releaseTile:s=>this.releaseTile(s),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const l=new AbortController,e=this._tileHandler.start({signal:l.signal}).then(()=>{this._fetchQueue=new ae({tileInfoView:this._tileInfoView,process:(s,t)=>this._getTileData(s,t),concurrency:15}),this._parseQueue=new ae({tileInfoView:this._tileInfoView,process:(s,t)=>this._parseTileData(s,t),concurrency:8}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(s=>{this._vectorTileContainer.setStyleResources(s,this._tileHandler.glyphMosaic,this._styleRepository),this.requestUpdate()}),this._tileHandlerAbortController=l,this._tileHandlerPromise=e}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const l=this._tileHandlerAbortController;l&&l.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue&&(this._fetchQueue.destroy(),this._fetchQueue=null),this._parseQueue&&(this._parseQueue.destroy(),this._parseQueue=null),this._tileManager&&(this._tileManager.destroy(),this._tileManager=null),this._vectorTileContainer.removeAllChildren()}async _getTileData(l,e){const s=await this._tileHandler.fetchTileData(l,e);return this.notifyChange("updating"),s}async _parseTileData(l,e){return this._tileHandler.parseTileData(l,e)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this._tileManager.clearCache();const l=this._styleChanges;try{await this._tileHandler.updateStyle(l)}catch(n){oe.getLogger(this.declaredClass).error("error applying vector-tiles style update",n.message),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0}const e=this._styleRepository,s=[];l.forEach(n=>{if(n.type!==v.LAYER_REMOVED)return;const o=n.data,a=e.getLayerById(o.layer);a&&s.push(a.uid)});const t=[];let i;l.forEach(n=>{const o=n.type,a=n.data;switch(o){case v.PAINTER_CHANGED:e.setPaintProperties(a.layer,a.paint),i=a.layer;break;case v.LAYOUT_CHANGED:e.setLayoutProperties(a.layer,a.layout),i=a.layer;break;case v.LAYER_REMOVED:return void e.deleteStyleLayer(a.layer);case v.LAYER_CHANGED:e.setStyleLayer(a.layer,a.index),i=a.layer.id;break;case v.SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(this._newSpriteSource)),this._newSpriteSource=null,i=null}const h=e.getLayerById(i);h&&t.push(h.uid)});const r=this._vectorTileContainer.children;if(s.length>0){this._vectorTileContainer.deleteStyleLayers(s);for(const n of r)n.deleteLayerData(s)}if(this._fetchQueue.resume(),this._parseQueue.resume(),t.length>0){const n=[];for(const o of r){const a=this._fetchQueue.push(o.key).then(h=>this._parseQueue.push({key:o.key,data:h,styleLayerUIDs:t})).then(h=>o.setData(h));n.push(a)}await Promise.all(n)}this._styleChanges=[],this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate()}async _loadStyle(){const{style:l}=this.layer.currentStyleInfo,e=Qe(l);this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this.notifyChange("updating"),this._styleRepository=new he(e),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:s}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,e),await this._tileHandlerPromise}catch(i){if(!X(i))throw i}if(s.aborted)return this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),void this.requestUpdate();const t=await this._tileHandler.spriteMosaic;this._vectorTileContainer.setStyleResources(t,this._tileHandler.glyphMosaic,this._styleRepository),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate()}_createVectorTile(l){const e=this._tileInfoView.getTileBounds(ee(),l),s=this._tileInfoView.getTileResolution(l.level);return new se(l,s,e[0],e[3],512,512,this._styleRepository)}};function zt(l){if(O(l))return 0;switch(l.type){case"partial":return Object.keys(l.diff).length;case"complete":return Math.max(Object.keys(l.oldValue).length,Object.keys(l.newValue).length);case"collection":return Object.keys(l.added).length+Object.keys(l.changed).length+Object.keys(l.removed).length}}N([j()],E.prototype,"_fetchQueue",void 0),N([j()],E.prototype,"_parseQueue",void 0),N([j()],E.prototype,"_isTileHandlerReady",void 0),N([j()],E.prototype,"fading",void 0),E=N([We("esri.views.2d.layers.VectorTileLayerView2D")],E);const ds=E;export{ds as default}; +import{U as Re,A as Ae,dT as re,d6 as Pe,z as Me,bN as B,x as X,cB as ne,c2 as Le,d7 as pe,j as O,c as p,u as k,b1 as ge,S as me,R as Be,Q as be,N as q,ej as Oe,W as Ue,K as ke,ay as ee,cV as Ve,du as Ee,d1 as ze,_ as $e,$ as He,c3 as Fe,ek as qe,bK as Ne,s as oe,cW as ae,b4 as Qe,a6 as N,a7 as j,a8 as We}from"./index.221827cd.js";import{I as P,L as v}from"./enums.54326430.js";import{t as M}from"./Rect.95b0fd2e.js";import{P as we,G as xe,D as je,F as I,O as H,I as le,R as F,C as Se,E as Je}from"./enums.2d9e6f64.js";import{E as Te}from"./Texture.940076b2.js";import{e as Ge}from"./rasterizingUtils.ec7fabe7.js";import{E as C,a as z}from"./VertexArrayObject.53cf1857.js";import{e as J,t as Ye,c as Ke}from"./config.82550349.js";import{r as Ie,i as Ze}from"./TileContainer.5aeb32d6.js";import{n as Xe,l as V,r as et,i as te,a as D}from"./StyleDefinition.d56936e4.js";import{I as U}from"./Utils.2136650a.js";import{l as he}from"./StyleRepository.e426e44d.js";import{y as tt,u as st}from"./LayerView.ce6e0535.js";import"./ProgramTemplate.cf9dd4e8.js";import{r as it}from"./utils.0160becb.js";import{t as rt}from"./VertexElementDescriptor.1fdca6da.js";import"./floatRGBA.3f71f8e9.js";import"./WGLContainer.347cc5cd.js";import"./pixelUtils.9c6f8dae.js";import"./enums.0295eb81.js";import"./MaterialKey.0cadabc1.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./colorUtils.bb6424b7.js";import"./GeometryUtils.4f19e772.js";import"./Geometry.d049a63c.js";class Q{constructor(e,s){this._width=0,this._height=0,this._free=[],this._width=e,this._height=s,this._free.push(new M(0,0,e,s))}get width(){return this._width}get height(){return this._height}allocate(e,s){if(e>this._width||s>this._height)return new M;let t=null,i=-1;for(let r=0;re&&this._free.push(new M(t.x+e,t.y,t.width-e,s)),t.height>s&&this._free.push(new M(t.x,t.y+s,t.width,t.height-s))):(t.width>e&&this._free.push(new M(t.x+e,t.y,t.width-e,t.height)),t.height>s&&this._free.push(new M(t.x,t.y+s,e,t.height-s))),new M(t.x,t.y,e,s))}release(e){for(let s=0;s{if(a<=256){const h=e+a;if(this._rangePromises.has(h))o.push(this._rangePromises.get(h));else{const y=i.getRange(e,a).then(()=>{this._rangePromises.delete(h)},()=>{this._rangePromises.delete(h)});this._rangePromises.set(h,y),o.push(y)}}}),Promise.all(o).then(()=>{let a=this._glyphIndex[e];a||(a={},this._glyphIndex[e]=a);for(const h of s){const y=a[h];if(y){t[h]={sdf:!0,rect:y.rect,metrics:y.metrics,page:y.page,code:h};continue}const u=i.getGlyph(e,h);if(!u||!u.metrics)continue;const d=u.metrics;let c;if(d.width===0)c=new M(0,0,0,0);else{const f=d.width+6,g=d.height+2*3;let m=f%4?4-f%4:4,w=g%4?4-g%4:4;m===1&&(m=5),w===1&&(w=5),c=this._binPack.allocate(f+m,g+w),c.isEmpty&&(this._dirties[this._currentPage]||(this._glyphData[this._currentPage]=null),this._currentPage=this._glyphData.length,this._glyphData.push(new Uint8Array(this.width*this.height)),this._dirties.push(!0),this._textures.push(void 0),this._binPack=new Q(this.width-4,this.height-4),c=this._binPack.allocate(f+m,g+w));const b=this._glyphData[this._currentPage],x=u.bitmap;let A,S;if(x)for(let R=0;R{t.addRange(s,new K(new Ae(new Uint8Array(o.data),new DataView(o.data))))}).catch(()=>{t.addRange(s,new K)})}return t.addRange(s,new K),Promise.resolve()}getGlyph(e,s){const t=this._getFontStack(e);if(!t)return;const i=Math.floor(s/256);if(i>256)return;const r=t.getRange(i);return r?{metrics:r.getMetrics(s),bitmap:r.getBitmap(s)}:void 0}_getFontStack(e){let s=this._glyphInfo[e];return s||(s=this._glyphInfo[e]=new nt),s}}const ot="dasharray-";class W{constructor(e,s,t=0){this._size=[],this._mosaicsData=[],this._textures=[],this._dirties=[],this._maxItemSize=0,this._currentPage=0,this._pageWidth=0,this._pageHeight=0,this._mosaicRects={},this.pixelRatio=1,(e<=0||s<=0)&&console.error("Sprites mosaic defaultWidth and defaultHeight must be greater than zero!"),this._pageWidth=e,this._pageHeight=s,t>0&&(this._maxItemSize=t),this._binPack=new Q(e-4,s-4)}dispose(){this._binPack=null,this._mosaicRects={};for(const e of this._textures)e&&e.dispose();this._textures.length=0}getWidth(e){return e>=this._size.length?-1:this._size[e][0]}getHeight(e){return e>=this._size.length?-1:this._size[e][1]}getPageSize(e){return e>=this._size.length?null:this._size[e]}setSpriteSource(e){if(this.dispose(),this.pixelRatio=e.devicePixelRatio,this._mosaicsData.length===0){this._binPack=new Q(this._pageWidth-4,this._pageHeight-4);const s=Math.floor(this._pageWidth),t=Math.floor(this._pageHeight),i=new Uint32Array(s*t);this._mosaicsData[0]=i,this._dirties.push(!0),this._size.push([this._pageWidth,this._pageHeight]),this._textures.push(void 0)}this._sprites=e}getSpriteItem(e,s=!1){let t,i,r=this._mosaicRects[e];if(r)return r;if(!this._sprites||this._sprites.loadStatus!=="loaded"||(e&&e.startsWith(ot)?([t,i]=this._rasterizeDash(e),s=!0):t=this._sprites.getSpriteInfo(e),!t||!t.width||!t.height||t.width<0||t.height<0))return null;const n=t.width,o=t.height,[a,h,y]=this._allocateImage(n,o);return a.width<=0?null:(this._copy(a,t,h,y,s,i),r={rect:a,width:n,height:o,sdf:t.sdf,simplePattern:!1,pixelRatio:t.pixelRatio,page:h},this._mosaicRects[e]=r,r)}getSpriteItems(e){const s={};for(const t of e)s[t.name]=this.getSpriteItem(t.name,t.repeat);return s}getMosaicItemPosition(e,s){const t=this.getSpriteItem(e,s),i=t&&t.rect;if(!i)return null;i.width=t.width,i.height=t.height;const r=t.width,n=t.height,o=2;return{tl:[i.x+o,i.y+o],br:[i.x+o+r,i.y+o+n],page:t.page}}bind(e,s,t=0,i=0){if(t>=this._size.length||t>=this._mosaicsData.length)return;this._textures[t]||(this._textures[t]=new Te(e,{pixelFormat:we.RGBA,dataType:xe.UNSIGNED_BYTE,wrapMode:je.CLAMP_TO_EDGE,width:this._size[t][0],height:this._size[t][1]},new Uint8Array(this._mosaicsData[t].buffer)));const r=this._textures[t];r.setSamplingMode(s),this._dirties[t]&&r.setData(new Uint8Array(this._mosaicsData[t].buffer)),e.bindTexture(r,i),this._dirties[t]=!1}static _copyBits(e,s,t,i,r,n,o,a,h,y,u){let d=i*s+t,c=a*n+o;if(u){c-=n;for(let _=-1;_<=y;_++,d=((_+y)%y+i)*s+t,c+=n)for(let f=-1;f<=h;f++)r[c+f]=e[d+(f+h)%h]}else for(let _=0;_=this._mosaicsData.length)return;const o=new Uint32Array(n?n.buffer:this._sprites.image.buffer),a=this._mosaicsData[t];a&&o||console.error("Source or target images are uninitialized!");const h=2,y=n?s.width:this._sprites.width;W._copyBits(o,y,s.x,s.y,a,i[0],e.x+h,e.y+h,s.width,s.height,r),this._dirties[t]=!0}_allocateImage(e,s){e+=2,s+=2;const t=Math.max(e,s);if(this._maxItemSize&&this._maxItemSizethis._spriteMosaic)}get glyphMosaic(){return this._glyphMosaic}async start(e){this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,e),this._spriteSourcePromise.then(t=>{this._spriteMosaic=new W(1024,1024,250),this._spriteMosaic.setSpriteSource(t)});const s=new ue(this._layer.currentStyleInfo.glyphsUrl?re(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);this._glyphMosaic=new ce(1024,1024,s),this._broadcastPromise=Pe("WorkerTileHandler",{client:this,schedule:e.schedule,signal:e.signal}).then(t=>{if(this._connection=t,this._layer&&!this._connection.closed){const i=t.broadcast("setStyle",this._layer.currentStyleInfo.style,e);Promise.all(i).catch(r=>Me(r))}})}async updateStyle(e){return await this._broadcastPromise,this._broadcastPromise=Promise.all(this._connection.broadcast("updateStyle",e)),this._broadcastPromise}setSpriteSource(e){const s=new W(1024,1024,250);return s.setSpriteSource(e),this._spriteMosaic=s,this._spriteSourcePromise=Promise.resolve(e),s}async setStyle(e,s){await this._broadcastPromise,this._styleRepository=e,this._spriteSourcePromise=this._layer.loadSpriteSource(this.devicePixelRatio,null),this._spriteSourcePromise.then(i=>{this._spriteMosaic=new W(1024,1024,250),this._spriteMosaic.setSpriteSource(i)});const t=new ue(this._layer.currentStyleInfo.glyphsUrl?re(this._layer.currentStyleInfo.glyphsUrl,{...this._layer.customParameters,token:this._layer.apiKey}):null);return this._glyphMosaic=new ce(1024,1024,t),this._broadcastPromise=Promise.all(this._connection.broadcast("setStyle",s)),this._broadcastPromise}fetchTileData(e,s){return this._getRefKeys(e,s).then(t=>{const i=this._layer.sourceNameToSource,r=[];for(const n in i)r.push(n);return this._getSourcesData(r,t,s)})}parseTileData(e,s){const t=e&&e.data;if(!t)return Promise.resolve(null);const{sourceName2DataAndRefKey:i,transferList:r}=t;return Object.keys(i).length===0?Promise.resolve(null):this._broadcastPromise.then(()=>this._connection.invoke("createTileAndParse",{key:e.key.id,sourceName2DataAndRefKey:i,styleLayerUIDs:e.styleLayerUIDs},{...s,transferList:r}))}async getSprites(e){return await this._spriteSourcePromise,this._spriteMosaic.getSpriteItems(e)}getGlyphs(e){return this._glyphMosaic.getGlyphItems(e.font,e.codePoints)}async _getTilePayload(e,s,t){const i=B.pool.acquire(e.id),r=this._layer.sourceNameToSource[s],{level:n,row:o,col:a}=i;B.pool.release(i);try{return{protobuff:await r.requestTile(n,o,a,t),sourceName:s}}catch(h){if(X(h))throw h;return{protobuff:null,sourceName:s}}}_getRefKeys(e,s){const t=this._layer.sourceNameToSource,i=new Array;for(const r in t){const n=t[r].getRefKey(e,s);i.push(n)}return ne(i)}_getSourcesData(e,s,t){const i=[];for(let r=0;r{const n={},o=[];for(let a=0;a0){const h=s[a].value.id;n[r[a].value.sourceName]={refKey:h,protobuff:r[a].value.protobuff},o.push(r[a].value.protobuff)}return{sourceName2DataAndRefKey:n,transferList:o}})}}const de=512,lt=1e-6,ht=(l,e)=>l+1/(1<<2*e);class ct{constructor(e,s){this._tiles=new Map,this._tileCache=new Le(40,t=>t.dispose()),this._viewSize=[0,0],this._visibleTiles=new Map,this.acquireTile=e.acquireTile,this.releaseTile=e.releaseTile,this.tileInfoView=e.tileInfoView,this._container=s}destroy(){for(const[e,s]of this._tiles)s.dispose();this._tiles=null,this._tileCache.clear(),this._tileCache=null}update(e){this._updateCacheSize(e);const s=this.tileInfoView,t=s.getTileCoverage(e.state,0,"smallest"),{spans:i,lodInfo:r}=t,{level:n}=r,o=this._tiles,a=new Set,h=new Set;for(const{row:u,colFrom:d,colTo:c}of i)for(let _=d;_<=c;_++){const f=B.getId(n,u,r.normalizeCol(_),r.getWorldForColumn(_)),g=this._getOrAcquireTile(f);a.add(f),g.processed()?this._addToContainer(g):h.add(new B(f))}for(const[u,d]of o)d.isCoverage=a.has(u);for(const u of h)this._findPlaceholdersForMissingTiles(u,a);let y=!1;for(const[u,d]of o)d.neededForCoverage=a.has(u),d.neededForCoverage||d.isHoldingForFade&&s.intersects(t,d.key)&&a.add(u),d.isFading&&(y=!0);for(const[u,d]of this._tiles)a.has(u)||this._releaseTile(u);return pe.pool.release(t),!y}clear(){this._tiles.clear(),this._tileCache.clear(),this._visibleTiles.clear()}clearCache(){this._tileCache.clear()}_findPlaceholdersForMissingTiles(e,s){const t=[];for(const[r,n]of this._tiles)this._addPlaceholderChild(t,n,e,s);const i=t.reduce(ht,0);Math.abs(1-i)0;){if(i--,r>>=1,n>>=1,t.level===i&&t.row===r&&t.col===n&&t.world===o)return!0;if(a.has(`${i}/${r}/${n}/${o}`))return!1}return!1}_updateCacheSize(e){const s=e.state.size;if(s[0]===this._viewSize[0]&&s[1]===this._viewSize[1])return;const t=Math.ceil(s[0]/de)+1,i=Math.ceil(s[1]/de)+1;this._viewSize[0]=s[0],this._viewSize[1]=s[1],this._tileCache.maxSize=5*t*i}}function ut(l){const[e,s,t,i]=l.split("/"),r=parseInt(e,10);return r===0?null:`${r-1}/${parseInt(s,10)>>1}/${parseInt(t,10)>>1}/${parseInt(i,10)}`}function dt(l,e){const s=e.level-l.level;return l.row===e.row>>s&&l.col===e.col>>s&&l.world===e.world}class yt{constructor(e){this.xTile=0,this.yTile=0,this.hash=0,this.priority=1,this.colliders=[],this.textVertexRanges=[],this.iconVertexRanges=[],this.tile=e}}class ft{constructor(){this.tileSymbols=[],this.parts=[{startTime:0,startOpacity:0,targetOpacity:0,show:!1},{startTime:0,startOpacity:0,targetOpacity:0,show:!1}],this.show=!1}}function ye(l,e,s,t,i,r){const n=s-i;if(n>=0)return(e>>n)+(t-(r<>n);const o=-n;return e-(r-(t<>o)<0){const n=new Map;for(let o=0;o0}triangleCount(){return this.lineIndexCount/3}doDestroy(){p(this.lineVertexArrayObject)&&this.lineVertexArrayObject.dispose(),p(this.lineVertexBuffer)&&this.lineVertexBuffer.dispose(),p(this.lineIndexBuffer)&&this.lineIndexBuffer.dispose(),this.lineVertexArrayObject=null,this.lineVertexBuffer=null,this.lineIndexBuffer=null,this.memoryUsed=0}doPrepareForRendering(e,s,t){const i=new Uint32Array(s),r=new Int32Array(i.buffer),n=i[t++];this.lineVertexBuffer=C.createVertex(e,I.STATIC_DRAW,new Int32Array(r.buffer,4*t,n)),t+=n;const o=i[t++];this.lineIndexBuffer=C.createIndex(e,I.STATIC_DRAW,new Uint32Array(i.buffer,4*t,o)),t+=o;const a=this.layer.lineMaterial;this.lineVertexArrayObject=new z(e,a.getAttributeLocations(),a.getLayoutInfo(),{geometry:this.lineVertexBuffer},this.lineIndexBuffer)}}class bt extends Y{constructor(e,s){super(e,s),this.type=P.FILL,this.fillIndexStart=0,this.fillIndexCount=0,this.outlineIndexStart=0,this.outlineIndexCount=0;const t=new Uint32Array(e);let i=this.bufferDataOffset;this.fillIndexStart=t[i++],this.fillIndexCount=t[i++],this.outlineIndexStart=t[i++],this.outlineIndexCount=t[i++];const r=t[i++];if(r>0){const n=new Map;for(let o=0;o0||this.outlineIndexCount>0}triangleCount(){return(this.fillIndexCount+this.outlineIndexCount)/3}doDestroy(){p(this.fillVertexArrayObject)&&this.fillVertexArrayObject.dispose(),p(this.fillVertexBuffer)&&this.fillVertexBuffer.dispose(),p(this.fillIndexBuffer)&&this.fillIndexBuffer.dispose(),this.fillVertexArrayObject=null,this.fillVertexBuffer=null,this.fillIndexBuffer=null,p(this.outlineVertexArrayObject)&&this.outlineVertexArrayObject.dispose(),p(this.outlineVertexBuffer)&&this.outlineVertexBuffer.dispose(),p(this.outlineIndexBuffer)&&this.outlineIndexBuffer.dispose(),this.outlineVertexArrayObject=null,this.outlineVertexBuffer=null,this.outlineIndexBuffer=null,this.memoryUsed=0}doPrepareForRendering(e,s,t){const i=new Uint32Array(s),r=new Int32Array(i.buffer),n=i[t++];this.fillVertexBuffer=C.createVertex(e,I.STATIC_DRAW,new Int32Array(r.buffer,4*t,n)),t+=n;const o=i[t++];this.fillIndexBuffer=C.createIndex(e,I.STATIC_DRAW,new Uint32Array(i.buffer,4*t,o)),t+=o;const a=i[t++];this.outlineVertexBuffer=C.createVertex(e,I.STATIC_DRAW,new Int32Array(r.buffer,4*t,a)),t+=a;const h=i[t++];this.outlineIndexBuffer=C.createIndex(e,I.STATIC_DRAW,new Uint32Array(i.buffer,4*t,h)),t+=h;const y=this.layer,u=y.fillMaterial,d=y.outlineMaterial;this.fillVertexArrayObject=new z(e,u.getAttributeLocations(),u.getLayoutInfo(),{geometry:this.fillVertexBuffer},this.fillIndexBuffer),this.outlineVertexArrayObject=new z(e,d.getAttributeLocations(),d.getLayoutInfo(),{geometry:this.outlineVertexBuffer},this.outlineIndexBuffer)}}class wt extends Y{constructor(e,s,t){super(e,s),this.type=P.SYMBOL,this.iconPerPageElementsMap=new Map,this.glyphPerPageElementsMap=new Map,this.symbolInstances=[],this.isIconSDF=!1,this.opacityChanged=!1,this.lastOpacityUpdate=0,this.symbols=[];const i=new Uint32Array(e),r=new Int32Array(e),n=new Float32Array(e);let o=this.bufferDataOffset;this.isIconSDF=!!i[o++];const a=i[o++];for(let d=0;d0||this.glyphPerPageElementsMap.size>0}triangleCount(){let e=0;for(const[s,t]of this.iconPerPageElementsMap)e+=t[1];for(const[s,t]of this.glyphPerPageElementsMap)e+=t[1];return e/3}doDestroy(){p(this.iconVertexArrayObject)&&this.iconVertexArrayObject.dispose(),p(this.iconVertexBuffer)&&this.iconVertexBuffer.dispose(),p(this.iconOpacityBuffer)&&this.iconOpacityBuffer.dispose(),p(this.iconIndexBuffer)&&this.iconIndexBuffer.dispose(),this.iconVertexArrayObject=null,this.iconVertexBuffer=null,this.iconOpacityBuffer=null,this.iconIndexBuffer=null,p(this.textVertexArrayObject)&&this.textVertexArrayObject.dispose(),p(this.textVertexBuffer)&&this.textVertexBuffer.dispose(),p(this.textOpacityBuffer)&&this.textOpacityBuffer.dispose(),p(this.textIndexBuffer)&&this.textIndexBuffer.dispose(),this.textVertexArrayObject=null,this.textVertexBuffer=null,this.textOpacityBuffer=null,this.textIndexBuffer=null,this.memoryUsed=0}updateOpacityInfo(){if(!this.opacityChanged)return;this.opacityChanged=!1;const e=k(this.iconOpacity),s=k(this.iconOpacityBuffer);e.length>0&&e.byteLength===s.size&&s.setSubData(e,0,0,e.length);const t=k(this.textOpacity),i=k(this.textOpacityBuffer);t.length>0&&t.byteLength===i.size&&i.setSubData(t,0,0,t.length)}doPrepareForRendering(e,s,t){const i=new Uint32Array(s),r=new Int32Array(i.buffer),n=i[t++];this.iconVertexBuffer=C.createVertex(e,I.STATIC_DRAW,new Int32Array(r.buffer,4*t,n)),t+=n;const o=i[t++];this.iconIndexBuffer=C.createIndex(e,I.STATIC_DRAW,new Uint32Array(i.buffer,4*t,o)),t+=o;const a=i[t++];this.textVertexBuffer=C.createVertex(e,I.STATIC_DRAW,new Int32Array(r.buffer,4*t,a)),t+=a;const h=i[t++];this.textIndexBuffer=C.createIndex(e,I.STATIC_DRAW,new Uint32Array(i.buffer,4*t,h)),t+=h,this.iconOpacityBuffer=C.createVertex(e,I.STATIC_DRAW,k(this.iconOpacity).buffer),this.textOpacityBuffer=C.createVertex(e,I.STATIC_DRAW,k(this.textOpacity).buffer);const y=this.layer,u=y.iconMaterial,d=y.textMaterial;this.iconVertexArrayObject=new z(e,u.getAttributeLocations(),u.getLayoutInfo(),{geometry:this.iconVertexBuffer,opacity:this.iconOpacityBuffer},this.iconIndexBuffer),this.textVertexArrayObject=new z(e,d.getAttributeLocations(),d.getLayoutInfo(),{geometry:this.textVertexBuffer,opacity:this.textOpacityBuffer},this.textIndexBuffer)}}class xt extends Y{constructor(e,s){super(e,s),this.type=P.CIRCLE,this.circleIndexStart=0,this.circleIndexCount=0;const t=new Uint32Array(e);let i=this.bufferDataOffset;this.circleIndexStart=t[i++],this.circleIndexCount=t[i++],this.bufferDataOffset=i}hasData(){return this.circleIndexCount>0}triangleCount(){return this.circleIndexCount/3}doDestroy(){p(this.circleVertexArrayObject)&&this.circleVertexArrayObject.dispose(),p(this.circleVertexBuffer)&&this.circleVertexBuffer.dispose(),p(this.circleIndexBuffer)&&this.circleIndexBuffer.dispose(),this.circleVertexArrayObject=null,this.circleVertexBuffer=null,this.circleIndexBuffer=null,this.memoryUsed=0}doPrepareForRendering(e,s,t){const i=new Uint32Array(s),r=new Int32Array(i.buffer),n=i[t++];this.circleVertexBuffer=C.createVertex(e,I.STATIC_DRAW,new Int32Array(r.buffer,4*t,n)),t+=n;const o=i[t++];this.circleIndexBuffer=C.createIndex(e,I.STATIC_DRAW,new Uint32Array(i.buffer,4*t,o)),t+=o;const a=this.layer.circleMaterial;this.circleVertexArrayObject=new z(e,a.getAttributeLocations(),a.getLayoutInfo(),{geometry:this.circleVertexBuffer},this.circleIndexBuffer)}}class se extends Ie{constructor(e,s,t,i,r,n,o,a=null){super(e,s,t,i,r,n,4096,4096),this._memCache=a,this.type="vector-tile",this._referenced=0,this._hasSymbolBuckets=!1,this._memoryUsedByLayerData=0,this.layerData=new Map,this.layerCount=0,this.status="loading",this.allSymbolsFadingOut=!1,this.lastOpacityUpdate=0,this.symbols=new Map,this.isCoverage=!1,this.neededForCoverage=!1,this.decluttered=!1,this.invalidating=!1,this.parentTile=null,this.childrenTiles=new Set,this._processed=!1,this._referenced=1,this.styleRepository=o,this.id=e.id}get hasSymbolBuckets(){return this._hasSymbolBuckets}get isFading(){return this._hasSymbolBuckets&&performance.now()-this.lastOpacityUpdate0}dispose(){this.status!=="unloaded"&&(St.delete(this),se._destroyRenderBuckets(this.layerData),this.layerData=null,this.layerCount=0,this._memoryUsedByLayerData=0,this.destroy(),this.status="unloaded")}release(){return--this._referenced==0&&(this.dispose(),this.stage=null,!0)}retain(){++this._referenced}get referenced(){return this._referenced}get memoryUsage(){return(this._memoryUsedByLayerData+256)/(this._referenced||1)}changeDataImpl(e){let s=!1;if(e){const{bucketsWithData:t,emptyBuckets:i}=e,r=this._createRenderBuckets(t);if(i&&i.byteLength>0){const n=new Uint32Array(i);for(const o of n)this._deleteLayerData(o)}for(const[n,o]of r)this._deleteLayerData(n),o.type===P.SYMBOL&&(this.symbols.set(n,o.symbols),s=!0),this._memoryUsedByLayerData+=o.memoryUsed,this.layerData.set(n,o),this.layerCount++;p(this._memCache)&&this._memCache.updateSize(this.key.id,this,this._memoryUsedByLayerData)}this._hasSymbolBuckets=!1;for(const[t,i]of this.layerData)i.type===P.SYMBOL&&(this._hasSymbolBuckets=!0);s&&this.emit("symbols-changed")}attachWithContext(e){this.stage={context:e,trashDisplayObject(s){s.processDetach()},untrashDisplayObject:()=>!1}}setTransform(e){super.setTransform(e);const s=this.resolution/(e.resolution*e.pixelRatio),t=this.width/this.rangeX*s,i=this.height/this.rangeY*s,r=[0,0];e.toScreen(r,[this.x,this.y]);const n=this.transforms.tileUnitsToPixels;ge(n),me(n,n,r),Be(n,n,Math.PI*e.rotation/180),be(n,n,[t,i,1])}_createTransforms(){return{dvs:q(),tileMat3:q(),tileUnitsToPixels:q()}}static _destroyRenderBuckets(e){if(!e)return;const s=new Set;e.forEach(t=>{s.has(t)||(t.destroy(),s.add(t))}),e.clear()}_createRenderBuckets(e){const s=new Map,t=new Map;for(const i of e){const r=this._deserializeBucket(i,t);for(const n of r.layerUIDs)s.set(n,r)}return s}_deserializeBucket(e,s){let t=s.get(e);if(t)return t;switch(new Uint32Array(e)[0]){case P.FILL:t=new bt(e,this.styleRepository);break;case P.LINE:t=new mt(e,this.styleRepository);break;case P.SYMBOL:t=new wt(e,this.styleRepository,this);break;case P.CIRCLE:t=new xt(e,this.styleRepository)}return s.set(e,t),t}_deleteLayerData(e){if(!this.layerData.has(e))return;const s=this.layerData.get(e);this._memoryUsedByLayerData-=s.memoryUsed,s.destroy(),this.layerData.delete(e),this.layerCount--}}const St=new Map;function Tt(l,e,s,t,i,r){const{iconRotationAlignment:n,textRotationAlignment:o,iconTranslate:a,iconTranslateAnchor:h,textTranslate:y,textTranslateAnchor:u}=t;let d=0;for(const c of l.colliders){const[_,f]=c.partIndex===0?a:y,g=c.partIndex===0?h:u,m=c.minLod<=r&&r<=c.maxLod;d+=m?0:1,c.enabled=m,c.xScreen=c.xTile*i[0]+c.yTile*i[3]+i[6],c.yScreen=c.xTile*i[1]+c.yTile*i[4]+i[7],g===et.MAP?(c.xScreen+=s*_-e*f,c.yScreen+=e*_+s*f):(c.xScreen+=_,c.yScreen+=f),V.VIEWPORT===(c.partIndex===0?n:o)?(c.dxScreen=c.dxPixels,c.dyScreen=c.dyPixels):(c.dxScreen=s*(c.dxPixels+c.width/2)-e*(c.dyPixels+c.height/2)-c.width/2,c.dyScreen=e*(c.dxPixels+c.width/2)+s*(c.dyPixels+c.height/2)-c.height/2)}l.colliders.length>0&&d===l.colliders.length&&(l.unique.show=!1)}class It{constructor(e,s,t,i,r,n){this._symbols=e,this._styleRepository=i,this._zoom=r,this._currentLayerCursor=0,this._currentSymbolCursor=0,this._styleProps=new Map,this._allNeededMatrices=new Map,this._gridIndex=new Ce(s,t,Ye),this._si=Math.sin(Math.PI*n/180),this._co=Math.cos(Math.PI*n/180);for(const o of e)for(const a of o.symbols)this._allNeededMatrices.has(a.tile)||this._allNeededMatrices.set(a.tile,Oe(a.tile.transforms.tileUnitsToPixels))}work(e){const s=this._gridIndex;function t(r){const n=r.xScreen+r.dxScreen,o=r.yScreen+r.dyScreen,a=n+r.width,h=o+r.height,[y,u,d,c]=s.getCellSpan(n,o,a,h);for(let _=u;_<=c;_++)for(let f=y;f<=d;f++){const g=s.cells[_][f];for(const m of g){const w=m.xScreen+m.dxScreen,b=m.yScreen+m.dyScreen,x=w+m.width,A=b+m.height;if(!(ax||hA))return!0}}return!1}const i=performance.now();for(;this._currentLayerCursore)return!1;const o=r.symbols[this._currentSymbolCursor];if(!o.unique.show)continue;Tt(o,this._si,this._co,n,this._allNeededMatrices.get(o.tile),this._zoom);const a=o.unique;if(!a.show)continue;const{iconAllowOverlap:h,iconIgnorePlacement:y,textAllowOverlap:u,textIgnorePlacement:d}=n;for(const c of o.colliders){if(!c.enabled)continue;const _=a.parts[c.partIndex];!_.show||!(c.partIndex?u:h)&&t(c)&&(c.hard?a.show=!1:_.show=!1)}if(a.show)for(const c of o.colliders){if(!c.enabled||(c.partIndex?d:y)||!a.parts[c.partIndex].show)continue;const _=c.xScreen+c.dxScreen,f=c.yScreen+c.dyScreen,g=_+c.width,m=f+c.height,[w,b,x,A]=this._gridIndex.getCellSpan(_,f,g,m);for(let S=b;S<=A;S++)for(let R=w;R<=x;R++)this._gridIndex.cells[S][R].push(c)}}}return!0}_getProperties(e){const s=this._styleProps.get(e);if(s)return s;const t=this._zoom,i=this._styleRepository.getStyleLayerByUID(e),r=i.getLayoutValue("symbol-placement",t)!==Xe.POINT;let n=i.getLayoutValue("icon-rotation-alignment",t);n===V.AUTO&&(n=r?V.MAP:V.VIEWPORT);let o=i.getLayoutValue("text-rotation-alignment",t);o===V.AUTO&&(o=r?V.MAP:V.VIEWPORT);const a=i.getPaintValue("icon-translate",t),h=i.getPaintValue("icon-translate-anchor",t),y=i.getPaintValue("text-translate",t),u=i.getPaintValue("text-translate-anchor",t),d={iconAllowOverlap:i.getLayoutValue("icon-allow-overlap",t),iconIgnorePlacement:i.getLayoutValue("icon-ignore-placement",t),textAllowOverlap:i.getLayoutValue("text-allow-overlap",t),textIgnorePlacement:i.getLayoutValue("text-ignore-placement",t),iconRotationAlignment:n,textRotationAlignment:o,iconTranslateAnchor:h,iconTranslate:a,textTranslateAnchor:u,textTranslate:y};return this._styleProps.set(e,d),d}}function Ct(l,e){if(l.priority-e.priority)return l.priority-e.priority;const s=l.tile.key,t=e.tile.key;return s.world-t.world?s.world-t.world:s.level-t.level?s.level-t.level:s.row-t.row?s.row-t.row:s.col-t.col?s.col-t.col:l.xTile-e.xTile?l.xTile-e.xTile:l.yTile-e.yTile}class vt{constructor(e,s,t,i,r,n){this._visibleTiles=e,this._symbolRepository=s,this._createCollisionJob=t,this._assignTileSymbolsOpacity=i,this._symbolLayerSorter=r,this._isLayerVisible=n,this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}get running(){return this._running}setScreenSize(e,s){this._screenWidth===e&&this._screenHeight===s||this.restart(),this._screenWidth=e,this._screenHeight=s}restart(){this._selectionJob=null,this._selectionJobCompleted=!1,this._collisionJob=null,this._collisionJobCompleted=!1,this._opacityJob=null,this._opacityJobCompleted=!1,this._running=!0}continue(e){if(this._selectionJob||(this._selectionJob=this._createSelectionJob()),!this._selectionJobCompleted){const s=performance.now();if(!this._selectionJob.work(e)||(this._selectionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-s)))===0))return!1}if(this._collisionJob||(this._collisionJob=this._createCollisionJob(this._selectionJob.sortedSymbols,this._screenWidth,this._screenHeight)),!this._collisionJobCompleted){const s=performance.now();if(!this._collisionJob.work(e)||(this._collisionJobCompleted=!0,(e=Math.max(0,e-(performance.now()-s)))===0))return!1}if(this._opacityJob||(this._opacityJob=this._createOpacityJob()),!this._opacityJobCompleted){const s=performance.now();if(!this._opacityJob.work(e)||(this._opacityJobCompleted=!0,(e=Math.max(0,e-(performance.now()-s)))===0))return!1}return this._running=!1,!0}_createSelectionJob(){const e=this._symbolRepository.uniqueSymbols;for(let a=0;aa)return!1;let _=null,f=!1,g=!1;for(const m of h.tileSymbols)if(!g||!f){const w=m.tile;(!_||w.isCoverage||w.neededForCoverage&&!f)&&(_=m,(w.neededForCoverage||w.isCoverage)&&(g=!0),w.isCoverage&&(f=!0))}if(_.selectedForRendering=!0,g){c.symbols.push(_),h.show=!0;for(const m of h.parts)m.show=!0}else h.show=!1}}for(const u of s)u.symbols.sort(Ct);return!0}const o=this._symbolLayerSorter;return{work:n,get sortedSymbols(){return s.sort(o)}}}_createOpacityJob(){const e=this._assignTileSymbolsOpacity,s=this._visibleTiles;let t=0;function i(r,n){const o=r.symbols;for(const[a,h]of o)Dt(h,n);e(r,n);for(const a of r.childrenTiles)i(a,n)}return{work(r){const n=performance.now();for(;tr)return!1;const o=s[t];p(o.parentTile)||i(o,performance.now())}return!0}}}}function Dt(l,e){for(const s of l){const t=s.unique;for(const i of t.parts){const r=i.targetOpacity>.5?1:-1;i.startOpacity+=r*((e-i.startTime)/J),i.startOpacity=Math.min(Math.max(i.startOpacity,0),1),i.startTime=e,i.targetOpacity=t.show&&i.show?1:0}}}const Rt=32,At=8,Pt=64;class Mt{constructor(e,s,t){this.tileCoordRange=e,this._visibleTiles=s,this._createUnique=t,this._tiles=new Map,this._uniqueSymbolsReferences=new Map}get uniqueSymbols(){return O(this._uniqueSymbolLayerArray)&&(this._uniqueSymbolLayerArray=this._createUniqueSymbolLayerArray()),this._uniqueSymbolLayerArray}add(e,s){this._uniqueSymbolLayerArray=null;let t=this._tiles.get(e.id);t||(t={symbols:new Map},this._tiles.set(e.id,t));const i=new Map;if(s)for(const o of s)t.symbols.has(o)&&(i.set(o,t.symbols.get(o)),t.symbols.delete(o));else for(const[o,a]of e.layerData)t.symbols.has(o)&&(i.set(o,t.symbols.get(o)),t.symbols.delete(o));this._removeSymbols(i);const r=e.symbols,n=new Map;for(const[o,a]of r){let h=a.length;if(h>=Rt){let y=this.tileCoordRange;do y/=2,h/=4;while(h>At&&y>Pt);const u=new Ce(this.tileCoordRange,this.tileCoordRange,y);n.set(o,{flat:a,index:u}),t.symbols.set(o,{flat:a,index:u});for(const d of a)u.getCell(d.xTile,d.yTile).push(d)}else n.set(o,{flat:a}),t.symbols.set(o,{flat:a})}this._addSymbols(e.key,r)}deleteStyleLayers(e){this._uniqueSymbolLayerArray=null;for(const[s,t]of this._tiles){const i=new Map;for(const r of e)t.symbols.has(r)&&(i.set(r,t.symbols.get(r)),t.symbols.delete(r));this._removeSymbols(i),t.symbols.size===0&&this._tiles.delete(s)}}removeTile(e){this._uniqueSymbolLayerArray=null;const s=this._tiles.get(e.id);if(!s)return;const t=new Map;for(const[i,r]of e.symbols)s.symbols.has(i)&&(t.set(i,s.symbols.get(i)),s.symbols.delete(i));this._removeSymbols(t),s.symbols.size===0&&this._tiles.delete(e.id)}_removeSymbols(e){for(const[s,{flat:t}]of e)for(const i of t){const r=i.unique,n=r.tileSymbols,o=n.length-1;for(let a=0;as.level){const r=e.key.level-s.level;if(e.key.row>>r!==s.row||e.key.col>>r!==s.col)return}if(s.level>e.key.level){const r=s.level-e.key.level;if(s.row>>r!==e.key.row||s.col>>r!==e.key.col)return}if(s.equals(e.key)){for(const r of e.childrenTiles)this._matchSymbols(r,s,t);return}const i=new Map;for(const[r,n]of t){const o=[];for(const u of n){const d=ye(this.tileCoordRange,u.xTile,s.level,s.col,e.key.level,e.key.col),c=ye(this.tileCoordRange,u.yTile,s.level,s.row,e.key.level,e.key.row);d>=0&&d=0&&c0&&i.set(r,a)}for(const r of e.childrenTiles)this._matchSymbols(r,s,i)}_createUniqueSymbolLayerArray(){const e=this._uniqueSymbolsReferences,s=new Array(e.size);let t,i=0;for(const[r,n]of e){const o=new Array(n.size);t=0;for(const a of n)o[t++]=a;s[i]={styleLayerUID:r,uniqueSymbols:o},i++}return s}}const Lt=.5,fe=1e-6;class Bt extends Ue{constructor(e,s){super(),this.styleRepository=e,this._tileToHandle=new Map,this._viewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._declutterViewState={scale:0,rotation:0,center:[0,0],size:[0,0]},this._completed=!1,this._symbolRepository=new Mt(4096,s,()=>new ft),this._symbolDeclutterer=new vt(s,this._symbolRepository,(t,i,r)=>new It(t,i,r,this.styleRepository,this._zoom,this._viewState.rotation),(t,i)=>{t.allSymbolsFadingOut=!0,t.lastOpacityUpdate=i,pt(t,i,!0),t.decluttered=!0,t.requestRender()},(t,i)=>this.styleRepository.getStyleLayerByUID(t.styleLayerUID).z-this.styleRepository.getStyleLayerByUID(i.styleLayerUID).z,t=>{const i=this.styleRepository.getStyleLayerByUID(t);if(this._zoom+fe=i.maxzoom)return!1;const r=i.getLayoutProperty("visibility");return!r||r.getValue()!==te.NONE})}addTile(e){e.decluttered=!1,this._tileToHandle.set(e,e.on("symbols-changed",()=>{this._symbolRepository.add(e),this.restartDeclutter()})),this._symbolRepository.add(e),this.restartDeclutter()}removeTile(e){const s=this._tileToHandle.get(e);s&&(this._symbolRepository.removeTile(e),this.restartDeclutter(),s.remove(),this._tileToHandle.delete(e))}update(e,s){return this._zoom=e,this._viewState={scale:s.scale,rotation:s.rotation,center:[s.center[0],s.center[1]],size:[s.size[0],s.size[1]]},this._continueDeclutter(),this._completed}restartDeclutter(){this._completed=!1,this._symbolDeclutterer.restart(),this._notifyUnstable()}clear(){this._completed=!1,this._symbolRepository=null,this._symbolDeclutterer.restart(),this._tileToHandle.forEach(e=>e.remove()),this._tileToHandle.clear()}get stale(){return this._zoom!==this._declutterZoom||this._viewState.size[0]!==this._declutterViewState.size[0]||this._viewState.size[1]!==this._declutterViewState.size[1]||this._viewState.scale!==this._declutterViewState.scale||this._viewState.rotation!==this._declutterViewState.rotation}deleteStyleLayers(e){this._symbolRepository.deleteStyleLayers(e)}_continueDeclutter(){this._completed&&!this.stale||(this._symbolDeclutterer.running||(this._declutterZoom=this._zoom,this._declutterViewState.center[0]=this._viewState.center[0],this._declutterViewState.center[1]=this._viewState.center[1],this._declutterViewState.rotation=this._viewState.rotation,this._declutterViewState.scale=this._viewState.scale,this._declutterViewState.size[0]=this._viewState.size[0],this._declutterViewState.size[1]=this._viewState.size[1],this._symbolDeclutterer.restart()),this._symbolDeclutterer.setScreenSize(this._viewState.size[0],this._viewState.size[1]),this._completed=this._symbolDeclutterer.continue(Ke),this._completed&&this._scheduleNotifyStable())}_scheduleNotifyStable(){p(this._stableNotificationHandle)&&clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=setTimeout(()=>{this._stableNotificationHandle=null,this.emit("fade-complete")},(1+Lt)*J)}_notifyUnstable(){p(this._stableNotificationHandle)&&(clearTimeout(this._stableNotificationHandle),this._stableNotificationHandle=null),this.emit("fade-start")}}class Ot extends Ie{_createTransforms(){return{dvs:q(),tileMat3:q()}}}const G=1e-6;function _e(l,e){if(l){const s=l.getLayoutProperty("visibility");if(!s||s.getValue()!==te.NONE&&(l.minzoom===void 0||l.minzoom=e-G))return!0}return!1}class Ut extends Ze{constructor(e){super(e),this._backgroundTiles=[],this._pointToCallbacks=new Map}destroy(){this.removeAllChildren(),this._spriteMosaic&&(this._spriteMosaic.dispose(),this._spriteMosaic=null),this._glyphMosaic&&(this._glyphMosaic.dispose(),this._glyphMosaic=null),p(this._symbolFader)&&(this._symbolFader.clear(),this._symbolFader=null),this._styleRepository=null,this._backgroundTiles=[],this._pointToCallbacks.clear()}setStyleResources(e,s,t){if(this._spriteMosaic=e,this._glyphMosaic=s,this._styleRepository=t,O(this._symbolFader)){const i=new Bt(this._styleRepository,this.children);i.on("fade-start",()=>{this.emit("fade-start"),this.requestRender()}),i.on("fade-complete",()=>{this.emit("fade-complete"),this.requestRender()}),this._symbolFader=i}k(this._symbolFader).styleRepository=t}setSpriteMosaic(e){this._spriteMosaic.dispose(),this._spriteMosaic=e}deleteStyleLayers(e){p(this._symbolFader)&&this._symbolFader.deleteStyleLayers(e)}async hitTest(e){const s=ke();return this._pointToCallbacks.set(e,s),this.requestRender(),s.promise}enterTileInvalidation(){for(const e of this.children)e.invalidating=!0}createRenderParams(e){return{...super.createRenderParams(e),renderPass:null,styleLayer:null,styleLayerUID:-1,glyphMosaic:this._glyphMosaic,spriteMosaic:this._spriteMosaic,hasClipping:!!this._clippingInfos}}doRender(e){!this.visible||e.drawPhase!==U.MAP&&e.drawPhase!==U.DEBUG||this._spriteMosaic===void 0||super.doRender(e)}addChild(e){return super.addChild(e),p(this._symbolFader)?this._symbolFader.addTile(e):e.decluttered=!0,this.requestRender(),e}removeChild(e){return p(this._symbolFader)&&this._symbolFader.removeTile(e),this.requestRender(),super.removeChild(e)}renderChildren(e){const{drawPhase:s}=e;if(s!==U.DEBUG){if(this._doRender(e),this._pointToCallbacks.size>0){e.drawPhase=U.HITTEST;const t=e.painter.effects.hittestVTL;t.bind(e),this._doRender(e),t.draw(e,this._pointToCallbacks),t.unbind(e),e.drawPhase=s}}else super.renderChildren(e)}removeAllChildren(){for(let e=0;ee.neededForCoverage&&e.hasData())}restartDeclutter(){p(this._symbolFader)&&this._symbolFader.restartDeclutter()}_doRender(e){const{context:s}=e,t=this._styleRepository;if(!t)return;const i=t.layers;let r=!0;e.drawPhase===U.HITTEST&&(r=!1),t.backgroundBucketIds.length>0&&(e.renderPass="background",this._renderBackgroundLayers(e,t.backgroundBucketIds)),super.renderChildren(e),e.drawPhase===U.MAP&&this._fade(e.displayLevel,e.state);const n=this.children.filter(o=>o.visible&&o.hasData());if(!n||n.length===0)return s.bindVAO(),s.setStencilTestEnabled(!0),void s.setBlendingEnabled(!0);for(const o of n)o.triangleCount=0;s.setStencilWriteMask(0),s.setColorMask(!0,!0,!0,!0),s.setStencilOp(H.KEEP,H.KEEP,H.REPLACE),s.setStencilTestEnabled(!0),s.setBlendingEnabled(!1),s.setDepthTestEnabled(!0),s.setDepthWriteEnabled(!0),s.setDepthFunction(le.LEQUAL),s.setClearDepth(1),s.clear(s.gl.DEPTH_BUFFER_BIT),e.renderPass="opaque";for(let o=i.length-1;o>=0;o--)this._renderStyleLayer(i[o],e,n);s.setDepthWriteEnabled(!1),s.setBlendingEnabled(r),s.setBlendFunctionSeparate(F.ONE,F.ONE_MINUS_SRC_ALPHA,F.ONE,F.ONE_MINUS_SRC_ALPHA),e.renderPass="translucent";for(let o=0;oh.decluttered):t.filter(h=>h.neededForCoverage),o!=="vtlSymbol"){const h=s.displayLevel;if(t.length===0||e.minzoom!==void 0&&e.minzoom>=h+G||e.maxzoom!==void 0&&e.maxzoom>1,s.col>>1,s.world);return B.pool.release(s),t}getTileCoverage(e,s,t){const i=super.getTileCoverage(e,s,t);if(!i)return i;const r=1<n.row>=0&&n.rows[0].scale)return s[0].level;let t,i;for(let r=0;ri.scale)return t=s[r],t.level+(t.scale-e)/(t.scale-i.scale);return s[s.length-1].level}}_initializeFullCacheLODs(e){let s;if(e[0].level===0)s=e.map(t=>({level:t.level,resolution:t.resolution,scale:t.scale}));else{const t=this.tileInfo.size[0],i=this.tileInfo.spatialReference;s=Ee.create({size:t,spatialReference:i}).lods.map(r=>({level:r.level,resolution:r.resolution,scale:r.scale}))}for(let t=0;t{const{pixelRatio:e}=l.state;let s=0;const t=[],i=[];for(const r of this._vectorTileContainer.children)if(r.symbols)for(const[n,o]of r.symbols)for(const a of o)for(const h of a.colliders){const y=(h.xScreen+h.dxScreen)*e,u=(h.yScreen+h.dyScreen)*e,d=h.width*e,c=h.height*e,_=a.unique.parts[h.partIndex].targetOpacity>.5;if(!_&&this.layer.showCollisionBoxes!=="all")continue;const f=2,g=0,m=3,w=0,b=3,x=1,A=3,S=0,R=_?f:g,L=_?m:w,$=Z.makeFlags(R,L);t.push(y,u,$,y+d,u,$,y,u+c,$,y+d,u+c,$),i.push(s+0,s+1,s+2,s+1,s+3,s+2),s+=4;const ve=_?b:x,De=_?A:S,T=Z.makeFlags(ve,De);t.push(y,u,T,y+d,u,T,y,u+1,T,y+d,u+1,T),i.push(s+0,s+1,s+2,s+1,s+3,s+2),s+=4,t.push(y,u+c-1,T,y+d,u+c-1,T,y,u+c,T,y+d,u+c,T),i.push(s+0,s+1,s+2,s+1,s+3,s+2),s+=4,t.push(y,u,T,y+1,u,T,y,u+c,T,y+1,u+c,T),i.push(s+0,s+1,s+2,s+1,s+3,s+2),s+=4,t.push(y+d-1,u,T,y+d,u,T,y+d-1,u+c,T,y+d,u+c,T),i.push(s+0,s+1,s+2,s+1,s+3,s+2),s+=4}return{vertexData:new Int16Array(t),indexData:new Uint32Array(i)}},this._getCollidersColors=()=>[1,.5,0,1,1,0,0,1,0,1,.5,1,0,.5,0,1],this._getCollidersOpacities=()=>[.05,.01,.15,.2]}async hitTest(l,e){if(!this._tileHandlerPromise)return null;await this._tileHandlerPromise;const s=await this._vectorTileContainer.hitTest(e);if(!s||s.length===0)return null;const t=s[0]-1,i=this._styleRepository,r=i.getStyleLayerByUID(t);if(!r)return null;const n=i.getStyleLayerIndex(r.id);return[{type:"graphic",mapPoint:l,layer:this.layer,graphic:new ze({attributes:{layerId:n,layerName:r.id,layerUID:t},layer:this.layer,sourceLayer:this.layer})}]}update(l){if(this._tileHandlerPromise&&this._isTileHandlerReady)return l.pixelRatio!==this._tileHandler.devicePixelRatio?(this._start(),void(this._tileHandler.devicePixelRatio=l.pixelRatio)):void(this._styleChanges.length>0?this._tileHandlerPromise=this._applyStyleChanges():(this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.state=l.state,this._parseQueue.state=l.state,this._tileManager.update(l)||this.requestUpdate(),this._parseQueue.resume(),this._fetchQueue.resume()))}attach(){const{style:l}=this.layer.currentStyleInfo;this._styleRepository=new he(l),this._tileInfoView=new Et(this.layer.tileInfo,this.layer.fullExtent),this._vectorTileContainer=new Ut(this._tileInfoView),this._tileHandler=new at(this.layer,this._styleRepository,window.devicePixelRatio||1),this.container.addChild(this._vectorTileContainer),this._start(),this.handles.add([this._vectorTileContainer.on("fade-start",()=>{this.fading=!0,this.notifyChange("updating"),this.requestUpdate()}),this._vectorTileContainer.on("fade-complete",()=>{var e;(e=this._collisionOverlay)==null||e.requestRender(),this.fading=!1,this.notifyChange("updating"),this.requestUpdate()}),$e(()=>this.layer.showCollisionBoxes,e=>{e!=="none"?this._collisionOverlay||(this._collisionOverlay=new Z({getMesh:this._getCollidersMesh,getColors:this._getCollidersColors,getOpacities:this._getCollidersOpacities}),this.container.addChild(this._collisionOverlay)):(this.container.removeChild(this._collisionOverlay),this._collisionOverlay=null),this.container.requestRender()},He),this.layer.on("paint-change",e=>{if(e.isDataDriven)this._styleChanges.push({type:v.PAINTER_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate();else{const s=this._styleRepository,t=s.getLayerById(e.layer);if(!t)return;const i=t.type===D.SYMBOL;s.setPaintProperties(e.layer,e.paint),i&&this._vectorTileContainer.restartDeclutter(),this._vectorTileContainer.requestRender()}}),this.layer.on("layout-change",e=>{const s=this._styleRepository,t=s.getLayerById(e.layer);if(!t)return;const i=Fe(t.layout,e.layout);if(!O(i)){if(qe(i,"visibility")&&zt(i)===1)return s.setLayoutProperties(e.layer,e.layout),t.type===D.SYMBOL&&this._vectorTileContainer.restartDeclutter(),void this._vectorTileContainer.requestRender();this._styleChanges.push({type:v.LAYOUT_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate()}}),this.layer.on("style-layer-visibility-change",e=>{const s=this._styleRepository,t=s.getLayerById(e.layer);t&&(s.setStyleLayerVisibility(e.layer,e.visibility),t.type===D.SYMBOL&&this._vectorTileContainer.restartDeclutter(),this._vectorTileContainer.requestRender())}),this.layer.on("style-layer-change",e=>{this._styleChanges.push({type:v.LAYER_CHANGED,data:e}),this.notifyChange("updating"),this.requestUpdate()}),this.layer.on("delete-style-layer",e=>{this._styleChanges.push({type:v.LAYER_REMOVED,data:e}),this.notifyChange("updating"),this.requestUpdate()}),this.layer.on("load-style",()=>this._loadStyle()),this.layer.on("spriteSource-change",e=>{this._newSpriteSource=e.spriteSource,this._styleChanges.push({type:v.SPRITES_CHANGED,data:null});const s=this._styleRepository.layers;for(const t of s)switch(t.type){case D.SYMBOL:t.getLayoutProperty("icon-image")&&this._styleChanges.push({type:v.LAYOUT_CHANGED,data:{layer:t.id,layout:t.layout}});break;case D.LINE:t.getPaintProperty("line-pattern")&&this._styleChanges.push({type:v.PAINTER_CHANGED,data:{layer:t.id,paint:t.paint,isDataDriven:t.isPainterDataDriven()}});break;case D.FILL:t.getLayoutProperty("fill-pattern")&&this._styleChanges.push({type:v.PAINTER_CHANGED,data:{layer:t.id,paint:t.paint,isDataDriven:t.isPainterDataDriven()}})}this.notifyChange("updating"),this.requestUpdate()})],this.declaredClass)}detach(){var l,e;this._stop(),this.container.removeAllChildren(),(l=this._vectorTileContainer)==null||l.destroy(),this._vectorTileContainer=null,(e=this._tileHandler)==null||e.destroy(),this._tileHandler=null,this.handles.remove(this.declaredClass)}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this._collisionOverlay&&this._vectorTileContainer.restartDeclutter(),this.requestUpdate()}supportsSpatialReference(l){var e;return Ne((e=this.layer.tileInfo)==null?void 0:e.spatialReference,l)}canResume(){let l=super.canResume();const{currentStyleInfo:e}=this.layer;if(l&&(e==null?void 0:e.layerDefinition)){const s=this.view.scale,{minScale:t,maxScale:i}=e.layerDefinition;e&&e.layerDefinition&&(t&&ts&&(l=!1))}return l}isUpdating(){const l=this._vectorTileContainer.children;return!this._isTileHandlerReady||!this._fetchQueue||!this._parseQueue||this._fetchQueue.updating||this._parseQueue.updating||l.length>0&&l.some(e=>e.invalidating)||this.fading}acquireTile(l){const e=this._createVectorTile(l);return this._tileHandlerPromise.then(()=>{this._fetchQueue.push(e.key).then(s=>this._parseQueue.push({key:e.key,data:s})).then(s=>{e.once("attach",()=>this.requestUpdate()),e.setData(s),this.requestUpdate(),this.notifyChange("updating")}).catch(s=>{this.notifyChange("updating"),X(s)||oe.getLogger(this.declaredClass).error(s)})}),e}releaseTile(l){const e=l.key.id;this._fetchQueue.abort(e),this._parseQueue.abort(e),this.requestUpdate()}_start(){if(this._stop(),this._tileManager=new ct({acquireTile:s=>this.acquireTile(s),releaseTile:s=>this.releaseTile(s),tileInfoView:this._tileInfoView},this._vectorTileContainer),!this.layer.currentStyleInfo)return;const l=new AbortController,e=this._tileHandler.start({signal:l.signal}).then(()=>{this._fetchQueue=new ae({tileInfoView:this._tileInfoView,process:(s,t)=>this._getTileData(s,t),concurrency:15}),this._parseQueue=new ae({tileInfoView:this._tileInfoView,process:(s,t)=>this._parseTileData(s,t),concurrency:8}),this.requestUpdate(),this._isTileHandlerReady=!0});this._tileHandler.spriteMosaic.then(s=>{this._vectorTileContainer.setStyleResources(s,this._tileHandler.glyphMosaic,this._styleRepository),this.requestUpdate()}),this._tileHandlerAbortController=l,this._tileHandlerPromise=e}_stop(){if(!this._tileHandlerAbortController||!this._vectorTileContainer)return;const l=this._tileHandlerAbortController;l&&l.abort(),this._tileHandlerPromise=null,this._isTileHandlerReady=!1,this._fetchQueue&&(this._fetchQueue.destroy(),this._fetchQueue=null),this._parseQueue&&(this._parseQueue.destroy(),this._parseQueue=null),this._tileManager&&(this._tileManager.destroy(),this._tileManager=null),this._vectorTileContainer.removeAllChildren()}async _getTileData(l,e){const s=await this._tileHandler.fetchTileData(l,e);return this.notifyChange("updating"),s}async _parseTileData(l,e){return this._tileHandler.parseTileData(l,e)}async _applyStyleChanges(){this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this._tileManager.clearCache();const l=this._styleChanges;try{await this._tileHandler.updateStyle(l)}catch(n){oe.getLogger(this.declaredClass).error("error applying vector-tiles style update",n.message),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0}const e=this._styleRepository,s=[];l.forEach(n=>{if(n.type!==v.LAYER_REMOVED)return;const o=n.data,a=e.getLayerById(o.layer);a&&s.push(a.uid)});const t=[];let i;l.forEach(n=>{const o=n.type,a=n.data;switch(o){case v.PAINTER_CHANGED:e.setPaintProperties(a.layer,a.paint),i=a.layer;break;case v.LAYOUT_CHANGED:e.setLayoutProperties(a.layer,a.layout),i=a.layer;break;case v.LAYER_REMOVED:return void e.deleteStyleLayer(a.layer);case v.LAYER_CHANGED:e.setStyleLayer(a.layer,a.index),i=a.layer.id;break;case v.SPRITES_CHANGED:this._vectorTileContainer.setSpriteMosaic(this._tileHandler.setSpriteSource(this._newSpriteSource)),this._newSpriteSource=null,i=null}const h=e.getLayerById(i);h&&t.push(h.uid)});const r=this._vectorTileContainer.children;if(s.length>0){this._vectorTileContainer.deleteStyleLayers(s);for(const n of r)n.deleteLayerData(s)}if(this._fetchQueue.resume(),this._parseQueue.resume(),t.length>0){const n=[];for(const o of r){const a=this._fetchQueue.push(o.key).then(h=>this._parseQueue.push({key:o.key,data:h,styleLayerUIDs:t})).then(h=>o.setData(h));n.push(a)}await Promise.all(n)}this._styleChanges=[],this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate()}async _loadStyle(){const{style:l}=this.layer.currentStyleInfo,e=Qe(l);this._isTileHandlerReady=!1,this._fetchQueue.pause(),this._parseQueue.pause(),this._fetchQueue.clear(),this._parseQueue.clear(),this.notifyChange("updating"),this._styleRepository=new he(e),this._vectorTileContainer.destroy(),this._tileManager.clear(),this._tileHandlerAbortController.abort(),this._tileHandlerAbortController=new AbortController;const{signal:s}=this._tileHandlerAbortController;try{this._tileHandlerPromise=this._tileHandler.setStyle(this._styleRepository,e),await this._tileHandlerPromise}catch(i){if(!X(i))throw i}if(s.aborted)return this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),void this.requestUpdate();const t=await this._tileHandler.spriteMosaic;this._vectorTileContainer.setStyleResources(t,this._tileHandler.glyphMosaic,this._styleRepository),this._fetchQueue.resume(),this._parseQueue.resume(),this._isTileHandlerReady=!0,this.notifyChange("updating"),this.requestUpdate()}_createVectorTile(l){const e=this._tileInfoView.getTileBounds(ee(),l),s=this._tileInfoView.getTileResolution(l.level);return new se(l,s,e[0],e[3],512,512,this._styleRepository)}};function zt(l){if(O(l))return 0;switch(l.type){case"partial":return Object.keys(l.diff).length;case"complete":return Math.max(Object.keys(l.oldValue).length,Object.keys(l.newValue).length);case"collection":return Object.keys(l.added).length+Object.keys(l.changed).length+Object.keys(l.removed).length}}N([j()],E.prototype,"_fetchQueue",void 0),N([j()],E.prototype,"_parseQueue",void 0),N([j()],E.prototype,"_isTileHandlerReady",void 0),N([j()],E.prototype,"fading",void 0),E=N([We("esri.views.2d.layers.VectorTileLayerView2D")],E);const ds=E;export{ds as default}; diff --git a/assets/Version.59f2da65.js b/assets/Version.433fbe58.js similarity index 93% rename from assets/Version.59f2da65.js rename to assets/Version.433fbe58.js index 3cfd04a..128a0eb 100644 --- a/assets/Version.59f2da65.js +++ b/assets/Version.433fbe58.js @@ -1 +1 @@ -import{n as i}from"./index.d94abe07.js";class r{constructor(t,o,n=""){this.major=t,this.minor=o,this._context=n}lessThan(t,o){return this.major=this._size)&&m.error("offset is out of range!"),i>=s&&m.error("end must be bigger than start!"),e+(s-i)>this._size&&m.error("An attempt to write beyond the end of the buffer!");const a=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const c=this._context.gl;if(this._context.type===x.WEBGL2)c.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,t,i,s-i);else{const r=i===0&&s===t.length?t:t.subarray(i,s);c.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,r)}G(c),this._isVAOAware&&this._context.bindVAO(a)}getSubData(t,e=0,i,s){if(this._context.type!==x.WEBGL2)return void m.error("Get buffer subdata is supported in WebGL2 only!");if(i<0||s<0)return void m.error("Problem getting subdata: offset and length were less than zero!");const a=st(t)?t.BYTES_PER_ELEMENT:1;if(a*((i!=null?i:0)+(s!=null?s:0))>t.byteLength)return void m.error("Problem getting subdata: offset and length exceeded destination size!");e+a*(s!=null?s:0)>this.byteSize&&m.warn("Potential problem getting subdata: requested data exceeds buffer size!");const c=this._context.gl;this._context.bindBuffer(this,E.COPY_READ_BUFFER),c.getBufferSubData(E.COPY_READ_BUFFER,e,t,i,s),this._context.unbindBuffer(E.COPY_READ_BUFFER)}async getSubDataAsync(t,e=0,i,s){this._context.type===x.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(t,e,i,s)):m.error("Get buffer subdata is supported in WebGL2 only!")}}class P{constructor(t,e){this._context=t,this._desc=e,this.type="renderbuffer",this._context.instanceCounter.increment(g.Renderbuffer,this);const i=this._context.gl;this.glName=i.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:s,height:a,internalFormat:c,multisampled:r}=e;if(r){if(this._context.type!==x.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,c,s,a)}else i.renderbufferStorage(i.RENDERBUFFER,c,s,a)}get descriptor(){return this._desc}get samples(){const t=this._desc.samples,e=this._context.parameters.maxSamples;return t?Math.min(t,e):e}resize(t,e){const i=this._desc;if(i.width===t&&i.height===e)return;i.width=t,i.height=e;const s=this._context.gl;this._context.bindRenderbuffer(this),i.multisampled?s.renderbufferStorageMultisample(s.RENDERBUFFER,this.samples,i.internalFormat,i.width,i.height):s.renderbufferStorage(s.RENDERBUFFER,i.internalFormat,i.width,i.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(g.Renderbuffer,this),this._context=X(this._context))}}function lt(n){const t=n.gl;switch(t.getError()){case t.NO_ERROR:return null;case t.INVALID_ENUM:return"An unacceptable value has been specified for an enumerated argument";case t.INVALID_VALUE:return"A numeric argument is out of range";case t.INVALID_OPERATION:return"The specified command is not allowed for the current state";case t.INVALID_FRAMEBUFFER_OPERATION:return"The currently bound framebuffer is not framebuffer complete";case t.OUT_OF_MEMORY:return"Not enough memory is left to execute the command";case t.CONTEXT_LOST_WEBGL:return"WebGL context is lost"}return"Unknown error"}function ft(n,t){return n.vertexBuffers[t].size/rt(n.layout[t])}function rt(n){return n[0].stride}function nt(n,t,e,i,s=0){const a=n.gl,c=n.capabilities.instancing;n.bindBuffer(e);for(const r of i){const o=t.get(r.name);o===void 0&&console.error(`There is no location for vertex attribute '${r.name}' defined.`);const _=s*r.stride;if(r.count<=4)a.vertexAttribPointer(o,r.count,r.type,r.normalized,r.stride,r.offset+_),a.enableVertexAttribArray(o),r.divisor>0&&c&&c.vertexAttribDivisor(o,r.divisor);else if(r.count===9)for(let u=0;u<3;u++)a.vertexAttribPointer(o+u,3,r.type,r.normalized,r.stride,r.offset+12*u+_),a.enableVertexAttribArray(o+u),r.divisor>0&&c&&c.vertexAttribDivisor(o+u,r.divisor);else if(r.count===16)for(let u=0;u<4;u++)a.vertexAttribPointer(o+u,4,r.type,r.normalized,r.stride,r.offset+16*u+_),a.enableVertexAttribArray(o+u),r.divisor>0&&c&&c.vertexAttribDivisor(o+u,r.divisor);else console.error("Unsupported vertex attribute element count: "+r.count)}}function at(n,t,e,i){const s=n.gl,a=n.capabilities.instancing;n.bindBuffer(e);for(const c of i){const r=t.get(c.name);if(c.count<=4)s.disableVertexAttribArray(r),c.divisor&&c.divisor>0&&a&&a.vertexAttribDivisor(r,0);else if(c.count===9)for(let o=0;o<3;o++)s.disableVertexAttribArray(r+o),c.divisor&&c.divisor>0&&a&&a.vertexAttribDivisor(r+o,0);else if(c.count===16)for(let o=0;o<4;o++)s.disableVertexAttribArray(r+o),c.divisor&&c.divisor>0&&a&&a.vertexAttribDivisor(r+o,0);else console.error("Unsupported vertex attribute element count: "+c.count)}n.unbindBuffer(E.ARRAY_BUFFER)}function ct(n){switch(n){case f.ALPHA:case f.LUMINANCE:case f.RED:case f.RED_INTEGER:case h.R8:case h.R8I:case h.R8UI:case h.R8_SNORM:case T.STENCIL_INDEX8:return 1;case f.LUMINANCE_ALPHA:case f.RG:case f.RG_INTEGER:case h.RGBA4:case h.R16F:case h.R16I:case h.R16UI:case h.RG8:case h.RG8I:case h.RG8UI:case h.RG8_SNORM:case h.RGB565:case h.RGB5_A1:case T.DEPTH_COMPONENT16:return 2;case f.DEPTH_COMPONENT:case f.RGB:case f.RGB_INTEGER:case h.RGB8:case h.RGB8I:case h.RGB8UI:case h.RGB8_SNORM:case h.SRGB8:case T.DEPTH_COMPONENT24:return 3;case f.DEPTH_STENCIL:case f.RGBA:case f.RGBA_INTEGER:case h.RGBA8:case h.R32F:case h.R11F_G11F_B10F:case h.RG16F:case h.R32I:case h.R32UI:case h.RG16I:case h.RG16UI:case h.RGBA8I:case h.RGBA8UI:case h.RGBA8_SNORM:case h.SRGB8_ALPHA8:case h.RGB9_E5:case h.RGB10_A2UI:case h.RGB10_A2:case T.DEPTH_STENCIL:case T.DEPTH_COMPONENT32F:case T.DEPTH24_STENCIL8:return 4;case T.DEPTH32F_STENCIL8:return 5;case h.RGB16F:case h.RGB16I:case h.RGB16UI:return 6;case h.RG32F:case h.RG32I:case h.RG32UI:case h.RGBA16F:case h.RGBA16I:case h.RGBA16UI:return 8;case h.RGB32F:case h.RGB32I:case h.RGB32UI:return 12;case h.RGBA32F:case h.RGBA32I:case h.RGBA32UI:return 16;case d.COMPRESSED_RGB_S3TC_DXT1_EXT:case d.COMPRESSED_RGBA_S3TC_DXT1_EXT:return .5;case d.COMPRESSED_RGBA_S3TC_DXT3_EXT:case d.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case d.COMPRESSED_R11_EAC:case d.COMPRESSED_SIGNED_R11_EAC:case d.COMPRESSED_RGB8_ETC2:case d.COMPRESSED_SRGB8_ETC2:case d.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case d.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return .5;case d.COMPRESSED_RG11_EAC:case d.COMPRESSED_SIGNED_RG11_EAC:case d.COMPRESSED_RGBA8_ETC2_EAC:case d.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function z(n){if(w(n))return 0;if("descriptor"in n)return n.glName?z(n.descriptor):0;const t=n.internalFormat||"pixelFormat"in n&&n.pixelFormat;if(!t)return 0;const e="hasMipmap"in n&&n.hasMipmap?1.3:1,i=n.width*n.height;return ct(t)*i*e}class B{constructor(t,e,i=null,s=null){var a;if(this._context=t,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._depthStencilTexture=null,this._initialized=!1,this._desc={...e},t.instanceCounter.increment(g.FramebufferObject,this),C(i)){Array.isArray(i)||(i=[i]);for(let c=0;ct+z(i),0)+z(this.depthStencilAttachment)}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&p(e)?e:null}attachColorTexture(t,e=b.COLOR_ATTACHMENT0){!t||(this._validateColorAttachmentPoint(e),M(t.descriptor,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e)),this._colorAttachments.set(e,t))}detachColorTexture(t=b.COLOR_ATTACHMENT0){const e=this._colorAttachments.get(t);if(p(e)){const i=e;return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t)),this._colorAttachments.delete(t),i}}setColorTextureTarget(t,e=b.COLOR_ATTACHMENT0){const i=this._colorAttachments.get(e);p(i)&&this._framebufferTexture2D(i.glName,e,t)}attachDepthStencilTexture(t){if(w(t))return;const e=t.descriptor;e.pixelFormat!==f.DEPTH_STENCIL&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),e.dataType!==v.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),M(e,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==l.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=l.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,k)),this._depthStencilTexture=t}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,k)),this._depthStencilTexture=null,t}attachDepthStencilBuffer(t){if(w(t))return;const e=t.descriptor;if(e.internalFormat!==T.DEPTH_STENCIL&&e.internalFormat!==T.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),y(e,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=e.internalFormat===T.DEPTH_STENCIL?l.DEPTH_STENCIL_RENDER_BUFFER:l.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const i=this._context.gl,s=this._desc.depthStencilTarget===l.DEPTH_RENDER_BUFFER?i.DEPTH_ATTACHMENT:i.DEPTH_STENCIL_ATTACHMENT;i.framebufferRenderbuffer(N.FRAMEBUFFER,s,i.RENDERBUFFER,t.glName)}this._depthAttachment=t}detachDepthStencilBuffer(){const t=this._context.gl,e=this._depthAttachment;if(e&&this._initialized){this._context.bindFramebuffer(this);const i=this._desc.depthStencilTarget===l.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(N.FRAMEBUFFER,i,t.RENDERBUFFER,null)}return this._depthAttachment=null,e}detachAll(){this._colorAttachments.forEach((t,e)=>this._detachColorAttachment(e)),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(t,e,i,s,a,c,r){(t<0||e<0||a<0||c<0)&&console.error("Offsets cannot be negative!"),(i<=0||s<=0)&&console.error("Copy width and height must be greater than zero!");const o=this._desc,_=r.descriptor;r.descriptor.target!==A.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),((o==null?void 0:o.width)==null||(o==null?void 0:o.height)==null||(_==null?void 0:_.width)==null||(_==null?void 0:_.height)==null||t+i>o.width||e+s>o.height||a+i>_.width||c+s>_.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const u=this._context,O=u.bindTexture(r,D.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(D.TEXTURE_UNIT_FOR_UPDATES),u.bindFramebuffer(this),u.gl.copyTexSubImage2D(A.TEXTURE_2D,0,a,c,t,e,i,s),u.bindTexture(O,D.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,s,a,c,r){(i<=0||s<=0)&&console.error("Copy width and height must be greater than zero!"),r||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,i,s,a,c,r)}async readPixelsAsync(t,e,i,s,a,c,r){if(this._context.type!==x.WEBGL2)return I()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(t,e,i,s,a,c,r);const o=this._context.gl,_=S.createPixelPack(this._context,H.STREAM_READ,r.byteLength);this._context.bindBuffer(_),this._context.bindFramebuffer(this),o.readPixels(t,e,i,s,a,c,0),this._context.unbindBuffer(E.PIXEL_PACK_BUFFER),await _.getSubDataAsync(r),_.dispose()}resize(t,e){const i=this._desc;if(i.width!==t||i.height!==e){if(!this._initialized)return i.width=t,i.height=e,this._colorAttachments.forEach(s=>{s&&s.resize(t,e)}),void(this._depthStencilTexture&&this._depthStencilTexture.resize(t,e));i.width=t,i.height=e,this._colorAttachments.forEach(s=>{s&&s.resize(t,e)}),this._depthStencilTexture!=null?this._depthStencilTexture.resize(t,e):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(t,e),this._stencilAttachment&&this._stencilAttachment.resize(t,e)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(t=N.FRAMEBUFFER){var u,O,W,Y;const e=this._context.gl;if(this._initialized)return void e.bindFramebuffer(t,this.glName);this._glName&&e.deleteFramebuffer(this._glName);const i=this._context,s=e.createFramebuffer(),a=this._desc,c=(u=a.colorTarget)!=null?u:L.RENDER_BUFFER,r=(O=a.width)!=null?O:1,o=(W=a.height)!=null?W:1;if(e.bindFramebuffer(t,s),this._colorAttachments.size===0)if(c===L.TEXTURE||c===L.CUBEMAP)this._colorAttachments.set(b.COLOR_ATTACHMENT0,ht(i,a,this.descriptor.colorTarget===L.CUBEMAP?A.TEXTURE_CUBE_MAP:A.TEXTURE_2D));else{const R=new P(i,{internalFormat:h.RGBA4,width:r,height:o});this._colorAttachments.set(b.COLOR_ATTACHMENT0,R)}this._colorAttachments.forEach((R,j)=>{R&&(p(R)?this._framebufferTexture2D(R.glName,j,q(R),t):e.framebufferRenderbuffer(t,j,e.RENDERBUFFER,R.glName))});const _=(Y=a.depthStencilTarget)!=null?Y:l.NONE;switch(_){case l.DEPTH_RENDER_BUFFER:case l.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new P(i,{internalFormat:a.depthStencilTarget===l.DEPTH_RENDER_BUFFER?T.DEPTH_COMPONENT16:T.DEPTH_STENCIL,width:r,height:o}));const R=_===l.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(t,R,e.RENDERBUFFER,this._depthAttachment.glName);break}case l.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new P(i,{internalFormat:T.STENCIL_INDEX8,width:r,height:o})),e.framebufferRenderbuffer(t,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,this._stencilAttachment.glName);break;case l.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){i.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");const R={target:A.TEXTURE_2D,pixelFormat:f.DEPTH_STENCIL,dataType:v.UNSIGNED_INT_24_8,samplingMode:J.NEAREST,wrapMode:Q.CLAMP_TO_EDGE,width:r,height:o};this._depthStencilTexture=new D(i,R)}this._framebufferTexture2D(this._depthStencilTexture.glName,e.DEPTH_STENCIL_ATTACHMENT,q(this._depthStencilTexture),t)}I()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=s,this._initialized=!0}_framebufferTexture2D(t,e=b.COLOR_ATTACHMENT0,i=A.TEXTURE_2D,s=N.FRAMEBUFFER,a=0){this._context.gl.framebufferTexture2D(s,e,i,t,a)}_detachColorAttachment(t){I()&&console.warn("Detaching an FBO attachment can be a slow due to invalidating framebuffer completeness!");const e=this._context.gl,i=this._colorAttachments.get(t);return p(i)?this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t)):this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer(N.FRAMEBUFFER,t,e.RENDERBUFFER,null)),this._colorAttachments.delete(t),i}_disposeColorAttachments(){this._colorAttachments.forEach((t,e)=>{this._detachColorAttachment(e),t.dispose()}),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const e=this._desc.depthStencilTarget===l.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(N.FRAMEBUFFER,e,t.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),t.framebufferRenderbuffer(N.FRAMEBUFFER,t.STENCIL_ATTACHMENT,t.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateColorAttachmentPoint(t){if(B._MAX_COLOR_ATTACHMENTS===-1){const i=this._context.capabilities.drawBuffers;if(i){const s=this._context.gl;B._MAX_COLOR_ATTACHMENTS=s.getParameter(i.MAX_COLOR_ATTACHMENTS)}else B._MAX_COLOR_ATTACHMENTS=1}const e=t-b.COLOR_ATTACHMENT0;e+1>B._MAX_COLOR_ATTACHMENTS&&V.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${B._MAX_COLOR_ATTACHMENTS} color attachments`)}}function p(n){return n!=null&&"type"in n&&n.type==="texture"}function $(n){return n!=null&&"type"in n&&n.type==="renderbuffer"}function K(n){return p(n)||n!=null&&"pixelFormat"in n}function ht(n,t,e){return new D(n,{target:e,pixelFormat:f.RGBA,dataType:v.UNSIGNED_BYTE,samplingMode:J.NEAREST,wrapMode:Q.CLAMP_TO_EDGE,width:t.width,height:t.height})}function M(n,t){n.target!==A.TEXTURE_2D&&n.target!==A.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),t.width!==void 0&&t.width>=0&&t.height!==void 0&&t.height>=0?t.width===n.width&&t.height===n.height||console.error("Color attachment texture must match the framebuffer's!"):(t.width=n.width,t.height=n.height)}function y(n,t){t.width!==void 0&&t.width>=0&&t.height!==void 0&&t.height>=0?t.width===n.width&&t.height===n.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(t.width=n.width,t.height=n.height)}function q(n){return n.descriptor.target===A.TEXTURE_CUBE_MAP?A.TEXTURE_CUBE_MAP_POSITIVE_X:A.TEXTURE_2D}B._MAX_COLOR_ATTACHMENTS=-1;const F=V.getLogger("esri.views.webgl.VertexArrayObject");class Et{constructor(t,e,i,s,a=null){this._context=t,this._locations=e,this._layout=i,this._buffers=s,this._indexBuffer=a,this._glName=null,this._initialized=!1,t.instanceCounter.increment(g.VertexArrayObject,this)}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce((t,e)=>t+this._buffers[e].size,C(this._indexBuffer)?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(t=!0){var e,i,s;if(!this._context)return void((this._glName||t&&Object.getOwnPropertyNames(this._buffers).length>0)&&F.warn("Leaked WebGL VAO"));if(this._glName){const a=(i=(e=this._context)==null?void 0:e.capabilities)==null?void 0:i.vao;a?(a.deleteVertexArray(this._glName),this._glName=null):F.warn("Leaked WebGL VAO")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),t){for(const a in this._buffers)(s=this._buffers[a])==null||s.dispose(),delete this._buffers[a];this._indexBuffer=it(this._indexBuffer)}this._context.instanceCounter.decrement(g.VertexArrayObject,this),this._context=X(this._context)}initialize(){if(this._initialized)return;const t=this._context.capabilities.vao;if(t){const e=t.createVertexArray();t.bindVertexArray(e),this._bindLayout(),t.bindVertexArray(null),this._glName=e}this._initialized=!0}bind(){this.initialize();const t=this._context.capabilities.vao;t?t.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:t,_layout:e,_indexBuffer:i}=this;t||F.error("Vertex buffer dictionary is empty!");const s=this._context.gl;for(const a in t){const c=t[a];c||F.error("Vertex buffer is uninitialized!");const r=e[a];r||F.error("Vertex element descriptor is empty!"),nt(this._context,this._locations,c,r)}C(i)&&(this._context.capabilities.vao?s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,i.glName):this._context.bindBuffer(i))}unbind(){this.initialize();const t=this._context.capabilities.vao;t?t.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:t,_layout:e}=this;t||F.error("Vertex buffer dictionary is empty!");for(const i in t){const s=t[i];s||F.error("Vertex buffer is uninitialized!");const a=e[i];at(this._context,this._locations,s,a)}C(this._indexBuffer)&&this._context.unbindBuffer(this._indexBuffer.bufferType)}}export{S as E,ct as _,Et as a,lt as i,ft as n,P as s,B as x}; +import{s as V,r as x,d as X,c as C,i as Z,e as tt,f as et,j as w,k as it}from"./index.221827cd.js";import{u as G,E as D,a as I}from"./Texture.940076b2.js";import{t as g,A as E,F as H,C as U,u as d,U as h,B as T,P as f,f as b,V as l,G as v,c as k,n as N,M as A,Y as L,L as J,D as Q}from"./enums.2d9e6f64.js";const m=V.getLogger("esri.views.webgl.BufferObject");function st(n){return et(n)}class S{constructor(t,e,i,s){this._context=t,this.bufferType=e,this.usage=i,this._glName=null,this._size=-1,this._indexType=void 0,t.instanceCounter.increment(g.BufferObject,this),this._glName=this._context.gl.createBuffer(),G(this._context.gl),s&&this.setData(s)}static createIndex(t,e,i){return new S(t,E.ELEMENT_ARRAY_BUFFER,e,i)}static createVertex(t,e,i){return new S(t,E.ARRAY_BUFFER,e,i)}static createUniform(t,e,i){if(t.type!==x.WEBGL2)throw new Error("Uniform buffers are supported in WebGL2 only!");return new S(t,E.UNIFORM_BUFFER,e,i)}static createPixelPack(t,e=H.STREAM_READ,i){if(t.type!==x.WEBGL2)throw new Error("Pixel pack buffers are supported in WebGL2 only!");const s=new S(t,E.PIXEL_PACK_BUFFER,e);return i&&s.setSize(i),s}static createPixelUnpack(t,e=H.STREAM_DRAW,i){if(t.type!==x.WEBGL2)throw new Error("Pixel unpack buffers are supported in WebGL2 only!");return new S(t,E.PIXEL_UNPACK_BUFFER,e,i)}get glName(){return this._glName}get size(){return this._size}get indexType(){return this._indexType}get byteSize(){return this.bufferType===E.ELEMENT_ARRAY_BUFFER?this._indexType===U.UNSIGNED_INT?4*this._size:2*this._size:this._size}get _isVAOAware(){return this.bufferType===E.ELEMENT_ARRAY_BUFFER||this.bufferType===E.ARRAY_BUFFER}dispose(){var t;(t=this._context)!=null&&t.gl?(this._glName&&(this._context.gl.deleteBuffer(this._glName),this._glName=null),this._context.instanceCounter.decrement(g.BufferObject,this),this._context=X(this._context)):this._glName&&m.warn("Leaked WebGL buffer object")}setSize(t,e=null){if(t<=0&&m.error("Buffer size needs to be positive!"),this.bufferType===E.ELEMENT_ARRAY_BUFFER&&C(e))switch(this._indexType=e,e){case U.UNSIGNED_SHORT:t*=2;break;case U.UNSIGNED_INT:t*=4}this._setBufferData(t)}setData(t){if(!t)return;let e=t.byteLength;this.bufferType===E.ELEMENT_ARRAY_BUFFER&&(Z(t)&&(e/=2,this._indexType=U.UNSIGNED_SHORT),tt(t)&&(e/=4,this._indexType=U.UNSIGNED_INT)),this._setBufferData(e,t)}_setBufferData(t,e=null){this._size=t;const i=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const s=this._context.gl;C(e)?s.bufferData(this.bufferType,e,this.usage):s.bufferData(this.bufferType,t,this.usage),G(s),this._isVAOAware&&this._context.bindVAO(i)}setSubData(t,e,i,s){if(!t)return;(e<0||e>=this._size)&&m.error("offset is out of range!"),i>=s&&m.error("end must be bigger than start!"),e+(s-i)>this._size&&m.error("An attempt to write beyond the end of the buffer!");const a=this._context.getBoundVAO();this._isVAOAware&&this._context.bindVAO(null),this._context.bindBuffer(this);const c=this._context.gl;if(this._context.type===x.WEBGL2)c.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,t,i,s-i);else{const r=i===0&&s===t.length?t:t.subarray(i,s);c.bufferSubData(this.bufferType,e*t.BYTES_PER_ELEMENT,r)}G(c),this._isVAOAware&&this._context.bindVAO(a)}getSubData(t,e=0,i,s){if(this._context.type!==x.WEBGL2)return void m.error("Get buffer subdata is supported in WebGL2 only!");if(i<0||s<0)return void m.error("Problem getting subdata: offset and length were less than zero!");const a=st(t)?t.BYTES_PER_ELEMENT:1;if(a*((i!=null?i:0)+(s!=null?s:0))>t.byteLength)return void m.error("Problem getting subdata: offset and length exceeded destination size!");e+a*(s!=null?s:0)>this.byteSize&&m.warn("Potential problem getting subdata: requested data exceeds buffer size!");const c=this._context.gl;this._context.bindBuffer(this,E.COPY_READ_BUFFER),c.getBufferSubData(E.COPY_READ_BUFFER,e,t,i,s),this._context.unbindBuffer(E.COPY_READ_BUFFER)}async getSubDataAsync(t,e=0,i,s){this._context.type===x.WEBGL2?(await this._context.clientWaitAsync(),this.getSubData(t,e,i,s)):m.error("Get buffer subdata is supported in WebGL2 only!")}}class P{constructor(t,e){this._context=t,this._desc=e,this.type="renderbuffer",this._context.instanceCounter.increment(g.Renderbuffer,this);const i=this._context.gl;this.glName=i.createRenderbuffer(),this._context.bindRenderbuffer(this);const{width:s,height:a,internalFormat:c,multisampled:r}=e;if(r){if(this._context.type!==x.WEBGL2)throw new Error("Multisampled renderbuffers are not supported in WebGL1!");i.renderbufferStorageMultisample(i.RENDERBUFFER,this.samples,c,s,a)}else i.renderbufferStorage(i.RENDERBUFFER,c,s,a)}get descriptor(){return this._desc}get samples(){const t=this._desc.samples,e=this._context.parameters.maxSamples;return t?Math.min(t,e):e}resize(t,e){const i=this._desc;if(i.width===t&&i.height===e)return;i.width=t,i.height=e;const s=this._context.gl;this._context.bindRenderbuffer(this),i.multisampled?s.renderbufferStorageMultisample(s.RENDERBUFFER,this.samples,i.internalFormat,i.width,i.height):s.renderbufferStorage(s.RENDERBUFFER,i.internalFormat,i.width,i.height)}dispose(){this._context&&(this._context.gl.deleteRenderbuffer(this.glName),this._context.instanceCounter.decrement(g.Renderbuffer,this),this._context=X(this._context))}}function lt(n){const t=n.gl;switch(t.getError()){case t.NO_ERROR:return null;case t.INVALID_ENUM:return"An unacceptable value has been specified for an enumerated argument";case t.INVALID_VALUE:return"A numeric argument is out of range";case t.INVALID_OPERATION:return"The specified command is not allowed for the current state";case t.INVALID_FRAMEBUFFER_OPERATION:return"The currently bound framebuffer is not framebuffer complete";case t.OUT_OF_MEMORY:return"Not enough memory is left to execute the command";case t.CONTEXT_LOST_WEBGL:return"WebGL context is lost"}return"Unknown error"}function ft(n,t){return n.vertexBuffers[t].size/rt(n.layout[t])}function rt(n){return n[0].stride}function nt(n,t,e,i,s=0){const a=n.gl,c=n.capabilities.instancing;n.bindBuffer(e);for(const r of i){const o=t.get(r.name);o===void 0&&console.error(`There is no location for vertex attribute '${r.name}' defined.`);const _=s*r.stride;if(r.count<=4)a.vertexAttribPointer(o,r.count,r.type,r.normalized,r.stride,r.offset+_),a.enableVertexAttribArray(o),r.divisor>0&&c&&c.vertexAttribDivisor(o,r.divisor);else if(r.count===9)for(let u=0;u<3;u++)a.vertexAttribPointer(o+u,3,r.type,r.normalized,r.stride,r.offset+12*u+_),a.enableVertexAttribArray(o+u),r.divisor>0&&c&&c.vertexAttribDivisor(o+u,r.divisor);else if(r.count===16)for(let u=0;u<4;u++)a.vertexAttribPointer(o+u,4,r.type,r.normalized,r.stride,r.offset+16*u+_),a.enableVertexAttribArray(o+u),r.divisor>0&&c&&c.vertexAttribDivisor(o+u,r.divisor);else console.error("Unsupported vertex attribute element count: "+r.count)}}function at(n,t,e,i){const s=n.gl,a=n.capabilities.instancing;n.bindBuffer(e);for(const c of i){const r=t.get(c.name);if(c.count<=4)s.disableVertexAttribArray(r),c.divisor&&c.divisor>0&&a&&a.vertexAttribDivisor(r,0);else if(c.count===9)for(let o=0;o<3;o++)s.disableVertexAttribArray(r+o),c.divisor&&c.divisor>0&&a&&a.vertexAttribDivisor(r+o,0);else if(c.count===16)for(let o=0;o<4;o++)s.disableVertexAttribArray(r+o),c.divisor&&c.divisor>0&&a&&a.vertexAttribDivisor(r+o,0);else console.error("Unsupported vertex attribute element count: "+c.count)}n.unbindBuffer(E.ARRAY_BUFFER)}function ct(n){switch(n){case f.ALPHA:case f.LUMINANCE:case f.RED:case f.RED_INTEGER:case h.R8:case h.R8I:case h.R8UI:case h.R8_SNORM:case T.STENCIL_INDEX8:return 1;case f.LUMINANCE_ALPHA:case f.RG:case f.RG_INTEGER:case h.RGBA4:case h.R16F:case h.R16I:case h.R16UI:case h.RG8:case h.RG8I:case h.RG8UI:case h.RG8_SNORM:case h.RGB565:case h.RGB5_A1:case T.DEPTH_COMPONENT16:return 2;case f.DEPTH_COMPONENT:case f.RGB:case f.RGB_INTEGER:case h.RGB8:case h.RGB8I:case h.RGB8UI:case h.RGB8_SNORM:case h.SRGB8:case T.DEPTH_COMPONENT24:return 3;case f.DEPTH_STENCIL:case f.RGBA:case f.RGBA_INTEGER:case h.RGBA8:case h.R32F:case h.R11F_G11F_B10F:case h.RG16F:case h.R32I:case h.R32UI:case h.RG16I:case h.RG16UI:case h.RGBA8I:case h.RGBA8UI:case h.RGBA8_SNORM:case h.SRGB8_ALPHA8:case h.RGB9_E5:case h.RGB10_A2UI:case h.RGB10_A2:case T.DEPTH_STENCIL:case T.DEPTH_COMPONENT32F:case T.DEPTH24_STENCIL8:return 4;case T.DEPTH32F_STENCIL8:return 5;case h.RGB16F:case h.RGB16I:case h.RGB16UI:return 6;case h.RG32F:case h.RG32I:case h.RG32UI:case h.RGBA16F:case h.RGBA16I:case h.RGBA16UI:return 8;case h.RGB32F:case h.RGB32I:case h.RGB32UI:return 12;case h.RGBA32F:case h.RGBA32I:case h.RGBA32UI:return 16;case d.COMPRESSED_RGB_S3TC_DXT1_EXT:case d.COMPRESSED_RGBA_S3TC_DXT1_EXT:return .5;case d.COMPRESSED_RGBA_S3TC_DXT3_EXT:case d.COMPRESSED_RGBA_S3TC_DXT5_EXT:return 1;case d.COMPRESSED_R11_EAC:case d.COMPRESSED_SIGNED_R11_EAC:case d.COMPRESSED_RGB8_ETC2:case d.COMPRESSED_SRGB8_ETC2:case d.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2:case d.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2:return .5;case d.COMPRESSED_RG11_EAC:case d.COMPRESSED_SIGNED_RG11_EAC:case d.COMPRESSED_RGBA8_ETC2_EAC:case d.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:return 1}return 0}function z(n){if(w(n))return 0;if("descriptor"in n)return n.glName?z(n.descriptor):0;const t=n.internalFormat||"pixelFormat"in n&&n.pixelFormat;if(!t)return 0;const e="hasMipmap"in n&&n.hasMipmap?1.3:1,i=n.width*n.height;return ct(t)*i*e}class B{constructor(t,e,i=null,s=null){var a;if(this._context=t,this._glName=null,this._depthAttachment=null,this._stencilAttachment=null,this._colorAttachments=new Map,this._depthStencilTexture=null,this._initialized=!1,this._desc={...e},t.instanceCounter.increment(g.FramebufferObject,this),C(i)){Array.isArray(i)||(i=[i]);for(let c=0;ct+z(i),0)+z(this.depthStencilAttachment)}getColorTexture(t){const e=this._colorAttachments.get(t);return e&&p(e)?e:null}attachColorTexture(t,e=b.COLOR_ATTACHMENT0){!t||(this._validateColorAttachmentPoint(e),M(t.descriptor,this._desc),this._disposeColorAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,e)),this._colorAttachments.set(e,t))}detachColorTexture(t=b.COLOR_ATTACHMENT0){const e=this._colorAttachments.get(t);if(p(e)){const i=e;return this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t)),this._colorAttachments.delete(t),i}}setColorTextureTarget(t,e=b.COLOR_ATTACHMENT0){const i=this._colorAttachments.get(e);p(i)&&this._framebufferTexture2D(i.glName,e,t)}attachDepthStencilTexture(t){if(w(t))return;const e=t.descriptor;e.pixelFormat!==f.DEPTH_STENCIL&&console.error("Depth/Stencil texture must have a pixel type of DEPTH_STENCIL!"),e.dataType!==v.UNSIGNED_INT_24_8&&console.error("Depth/Stencil texture must have data type of UNSIGNED_INT_24_8!"),this._context.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture!"),M(e,this._desc),this._desc.depthStencilTarget&&this._desc.depthStencilTarget!==l.DEPTH_STENCIL_TEXTURE&&(this._desc.depthStencilTarget=l.DEPTH_STENCIL_TEXTURE),this._disposeDepthStencilAttachments(),this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(t.glName,k)),this._depthStencilTexture=t}detachDepthStencilTexture(){const t=this._depthStencilTexture;return t&&this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,k)),this._depthStencilTexture=null,t}attachDepthStencilBuffer(t){if(w(t))return;const e=t.descriptor;if(e.internalFormat!==T.DEPTH_STENCIL&&e.internalFormat!==T.DEPTH_COMPONENT16&&console.error("Depth/Stencil buffer must have correct internalFormat"),y(e,this._desc),this._disposeDepthStencilAttachments(),this._desc.depthStencilTarget=e.internalFormat===T.DEPTH_STENCIL?l.DEPTH_STENCIL_RENDER_BUFFER:l.DEPTH_RENDER_BUFFER,this._initialized){this._context.bindFramebuffer(this);const i=this._context.gl,s=this._desc.depthStencilTarget===l.DEPTH_RENDER_BUFFER?i.DEPTH_ATTACHMENT:i.DEPTH_STENCIL_ATTACHMENT;i.framebufferRenderbuffer(N.FRAMEBUFFER,s,i.RENDERBUFFER,t.glName)}this._depthAttachment=t}detachDepthStencilBuffer(){const t=this._context.gl,e=this._depthAttachment;if(e&&this._initialized){this._context.bindFramebuffer(this);const i=this._desc.depthStencilTarget===l.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(N.FRAMEBUFFER,i,t.RENDERBUFFER,null)}return this._depthAttachment=null,e}detachAll(){this._colorAttachments.forEach((t,e)=>this._detachColorAttachment(e)),this.detachDepthStencilBuffer(),this.detachDepthStencilTexture()}copyToTexture(t,e,i,s,a,c,r){(t<0||e<0||a<0||c<0)&&console.error("Offsets cannot be negative!"),(i<=0||s<=0)&&console.error("Copy width and height must be greater than zero!");const o=this._desc,_=r.descriptor;r.descriptor.target!==A.TEXTURE_2D&&console.error("Texture target must be TEXTURE_2D!"),((o==null?void 0:o.width)==null||(o==null?void 0:o.height)==null||(_==null?void 0:_.width)==null||(_==null?void 0:_.height)==null||t+i>o.width||e+s>o.height||a+i>_.width||c+s>_.height)&&console.error("Bad dimensions, the current input values will attempt to read or copy out of bounds!");const u=this._context,O=u.bindTexture(r,D.TEXTURE_UNIT_FOR_UPDATES);u.setActiveTexture(D.TEXTURE_UNIT_FOR_UPDATES),u.bindFramebuffer(this),u.gl.copyTexSubImage2D(A.TEXTURE_2D,0,a,c,t,e,i,s),u.bindTexture(O,D.TEXTURE_UNIT_FOR_UPDATES)}readPixels(t,e,i,s,a,c,r){(i<=0||s<=0)&&console.error("Copy width and height must be greater than zero!"),r||console.error("Target memory is not initialized!"),this._context.bindFramebuffer(this),this._context.gl.readPixels(t,e,i,s,a,c,r)}async readPixelsAsync(t,e,i,s,a,c,r){if(this._context.type!==x.WEBGL2)return I()&&console.warn("Attempting to read pixels using pixel buffer object without WebGL2"),void this.readPixels(t,e,i,s,a,c,r);const o=this._context.gl,_=S.createPixelPack(this._context,H.STREAM_READ,r.byteLength);this._context.bindBuffer(_),this._context.bindFramebuffer(this),o.readPixels(t,e,i,s,a,c,0),this._context.unbindBuffer(E.PIXEL_PACK_BUFFER),await _.getSubDataAsync(r),_.dispose()}resize(t,e){const i=this._desc;if(i.width!==t||i.height!==e){if(!this._initialized)return i.width=t,i.height=e,this._colorAttachments.forEach(s=>{s&&s.resize(t,e)}),void(this._depthStencilTexture&&this._depthStencilTexture.resize(t,e));i.width=t,i.height=e,this._colorAttachments.forEach(s=>{s&&s.resize(t,e)}),this._depthStencilTexture!=null?this._depthStencilTexture.resize(t,e):(this._depthAttachment||this._stencilAttachment)&&(this._depthAttachment&&this._depthAttachment.resize(t,e),this._stencilAttachment&&this._stencilAttachment.resize(t,e)),this._context.getBoundFramebufferObject()===this&&this._context.bindFramebuffer(null),this._initialized=!1}}initializeAndBind(t=N.FRAMEBUFFER){var u,O,W,Y;const e=this._context.gl;if(this._initialized)return void e.bindFramebuffer(t,this.glName);this._glName&&e.deleteFramebuffer(this._glName);const i=this._context,s=e.createFramebuffer(),a=this._desc,c=(u=a.colorTarget)!=null?u:L.RENDER_BUFFER,r=(O=a.width)!=null?O:1,o=(W=a.height)!=null?W:1;if(e.bindFramebuffer(t,s),this._colorAttachments.size===0)if(c===L.TEXTURE||c===L.CUBEMAP)this._colorAttachments.set(b.COLOR_ATTACHMENT0,ht(i,a,this.descriptor.colorTarget===L.CUBEMAP?A.TEXTURE_CUBE_MAP:A.TEXTURE_2D));else{const R=new P(i,{internalFormat:h.RGBA4,width:r,height:o});this._colorAttachments.set(b.COLOR_ATTACHMENT0,R)}this._colorAttachments.forEach((R,j)=>{R&&(p(R)?this._framebufferTexture2D(R.glName,j,q(R),t):e.framebufferRenderbuffer(t,j,e.RENDERBUFFER,R.glName))});const _=(Y=a.depthStencilTarget)!=null?Y:l.NONE;switch(_){case l.DEPTH_RENDER_BUFFER:case l.DEPTH_STENCIL_RENDER_BUFFER:{this._depthAttachment||(this._depthAttachment=new P(i,{internalFormat:a.depthStencilTarget===l.DEPTH_RENDER_BUFFER?T.DEPTH_COMPONENT16:T.DEPTH_STENCIL,width:r,height:o}));const R=_===l.DEPTH_RENDER_BUFFER?e.DEPTH_ATTACHMENT:e.DEPTH_STENCIL_ATTACHMENT;e.framebufferRenderbuffer(t,R,e.RENDERBUFFER,this._depthAttachment.glName);break}case l.STENCIL_RENDER_BUFFER:this._stencilAttachment||(this._stencilAttachment=new P(i,{internalFormat:T.STENCIL_INDEX8,width:r,height:o})),e.framebufferRenderbuffer(t,e.STENCIL_ATTACHMENT,e.RENDERBUFFER,this._stencilAttachment.glName);break;case l.DEPTH_STENCIL_TEXTURE:if(!this._depthStencilTexture){i.capabilities.depthTexture||console.error("Extension WEBGL_depth_texture isn't supported therefore it is no possible to set the depth/stencil texture as an attachment!");const R={target:A.TEXTURE_2D,pixelFormat:f.DEPTH_STENCIL,dataType:v.UNSIGNED_INT_24_8,samplingMode:J.NEAREST,wrapMode:Q.CLAMP_TO_EDGE,width:r,height:o};this._depthStencilTexture=new D(i,R)}this._framebufferTexture2D(this._depthStencilTexture.glName,e.DEPTH_STENCIL_ATTACHMENT,q(this._depthStencilTexture),t)}I()&&e.checkFramebufferStatus(t)!==e.FRAMEBUFFER_COMPLETE&&console.error("Framebuffer is incomplete!"),this._glName=s,this._initialized=!0}_framebufferTexture2D(t,e=b.COLOR_ATTACHMENT0,i=A.TEXTURE_2D,s=N.FRAMEBUFFER,a=0){this._context.gl.framebufferTexture2D(s,e,i,t,a)}_detachColorAttachment(t){I()&&console.warn("Detaching an FBO attachment can be a slow due to invalidating framebuffer completeness!");const e=this._context.gl,i=this._colorAttachments.get(t);return p(i)?this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t)):this._initialized&&(this._context.bindFramebuffer(this),e.framebufferRenderbuffer(N.FRAMEBUFFER,t,e.RENDERBUFFER,null)),this._colorAttachments.delete(t),i}_disposeColorAttachments(){this._colorAttachments.forEach((t,e)=>{this._detachColorAttachment(e),t.dispose()}),this._colorAttachments.clear()}_disposeDepthStencilAttachments(){const t=this._context.gl;if(this._depthAttachment){if(this._initialized){this._context.bindFramebuffer(this);const e=this._desc.depthStencilTarget===l.DEPTH_RENDER_BUFFER?t.DEPTH_ATTACHMENT:t.DEPTH_STENCIL_ATTACHMENT;t.framebufferRenderbuffer(N.FRAMEBUFFER,e,t.RENDERBUFFER,null)}this._depthAttachment.dispose(),this._depthAttachment=null}this._stencilAttachment&&(this._initialized&&(this._context.bindFramebuffer(this),t.framebufferRenderbuffer(N.FRAMEBUFFER,t.STENCIL_ATTACHMENT,t.RENDERBUFFER,null)),this._stencilAttachment.dispose(),this._stencilAttachment=null),this._depthStencilTexture&&(this._initialized&&(this._context.bindFramebuffer(this),this._framebufferTexture2D(null,t.DEPTH_STENCIL_ATTACHMENT)),this._depthStencilTexture.dispose(),this._depthStencilTexture=null)}_validateColorAttachmentPoint(t){if(B._MAX_COLOR_ATTACHMENTS===-1){const i=this._context.capabilities.drawBuffers;if(i){const s=this._context.gl;B._MAX_COLOR_ATTACHMENTS=s.getParameter(i.MAX_COLOR_ATTACHMENTS)}else B._MAX_COLOR_ATTACHMENTS=1}const e=t-b.COLOR_ATTACHMENT0;e+1>B._MAX_COLOR_ATTACHMENTS&&V.getLogger("esri.views.webgl.FrameBufferObject").error("esri.FrameBufferObject",`illegal attachment point for color attachment: ${e+1}. Implementation supports up to ${B._MAX_COLOR_ATTACHMENTS} color attachments`)}}function p(n){return n!=null&&"type"in n&&n.type==="texture"}function $(n){return n!=null&&"type"in n&&n.type==="renderbuffer"}function K(n){return p(n)||n!=null&&"pixelFormat"in n}function ht(n,t,e){return new D(n,{target:e,pixelFormat:f.RGBA,dataType:v.UNSIGNED_BYTE,samplingMode:J.NEAREST,wrapMode:Q.CLAMP_TO_EDGE,width:t.width,height:t.height})}function M(n,t){n.target!==A.TEXTURE_2D&&n.target!==A.TEXTURE_CUBE_MAP&&console.error("Texture type must be TEXTURE_2D or TEXTURE_CUBE_MAP!"),t.width!==void 0&&t.width>=0&&t.height!==void 0&&t.height>=0?t.width===n.width&&t.height===n.height||console.error("Color attachment texture must match the framebuffer's!"):(t.width=n.width,t.height=n.height)}function y(n,t){t.width!==void 0&&t.width>=0&&t.height!==void 0&&t.height>=0?t.width===n.width&&t.height===n.height||console.error("Renderbuffer dimensions must match the framebuffer's!"):(t.width=n.width,t.height=n.height)}function q(n){return n.descriptor.target===A.TEXTURE_CUBE_MAP?A.TEXTURE_CUBE_MAP_POSITIVE_X:A.TEXTURE_2D}B._MAX_COLOR_ATTACHMENTS=-1;const F=V.getLogger("esri.views.webgl.VertexArrayObject");class Et{constructor(t,e,i,s,a=null){this._context=t,this._locations=e,this._layout=i,this._buffers=s,this._indexBuffer=a,this._glName=null,this._initialized=!1,t.instanceCounter.increment(g.VertexArrayObject,this)}get glName(){return this._glName}get context(){return this._context}get vertexBuffers(){return this._buffers}get indexBuffer(){return this._indexBuffer}get size(){return Object.keys(this._buffers).reduce((t,e)=>t+this._buffers[e].size,C(this._indexBuffer)?this._indexBuffer.size:0)}get layout(){return this._layout}get locations(){return this._locations}dispose(t=!0){var e,i,s;if(!this._context)return void((this._glName||t&&Object.getOwnPropertyNames(this._buffers).length>0)&&F.warn("Leaked WebGL VAO"));if(this._glName){const a=(i=(e=this._context)==null?void 0:e.capabilities)==null?void 0:i.vao;a?(a.deleteVertexArray(this._glName),this._glName=null):F.warn("Leaked WebGL VAO")}if(this._context.getBoundVAO()===this&&this._context.bindVAO(null),t){for(const a in this._buffers)(s=this._buffers[a])==null||s.dispose(),delete this._buffers[a];this._indexBuffer=it(this._indexBuffer)}this._context.instanceCounter.decrement(g.VertexArrayObject,this),this._context=X(this._context)}initialize(){if(this._initialized)return;const t=this._context.capabilities.vao;if(t){const e=t.createVertexArray();t.bindVertexArray(e),this._bindLayout(),t.bindVertexArray(null),this._glName=e}this._initialized=!0}bind(){this.initialize();const t=this._context.capabilities.vao;t?t.bindVertexArray(this.glName):(this._context.bindVAO(null),this._bindLayout())}_bindLayout(){const{_buffers:t,_layout:e,_indexBuffer:i}=this;t||F.error("Vertex buffer dictionary is empty!");const s=this._context.gl;for(const a in t){const c=t[a];c||F.error("Vertex buffer is uninitialized!");const r=e[a];r||F.error("Vertex element descriptor is empty!"),nt(this._context,this._locations,c,r)}C(i)&&(this._context.capabilities.vao?s.bindBuffer(s.ELEMENT_ARRAY_BUFFER,i.glName):this._context.bindBuffer(i))}unbind(){this.initialize();const t=this._context.capabilities.vao;t?t.bindVertexArray(null):this._unbindLayout()}_unbindLayout(){const{_buffers:t,_layout:e}=this;t||F.error("Vertex buffer dictionary is empty!");for(const i in t){const s=t[i];s||F.error("Vertex buffer is uninitialized!");const a=e[i];at(this._context,this._locations,s,a)}C(this._indexBuffer)&&this._context.unbindBuffer(this._indexBuffer.bufferType)}}export{S as E,ct as _,Et as a,lt as i,ft as n,P as s,B as x}; diff --git a/assets/VoxelLayer.50438218.js b/assets/VoxelLayer.733738ec.js similarity index 98% rename from assets/VoxelLayer.50438218.js rename to assets/VoxelLayer.733738ec.js index 2b71923..b596462 100644 --- a/assets/VoxelLayer.50438218.js +++ b/assets/VoxelLayer.733738ec.js @@ -1 +1 @@ -import{fy as we,fE as de,g$ as Ve,kf as he,V as me,M as Ee,eg as T,iA as $,iB as z,a6 as t,a7 as o,cw as Y,a8 as v,cx as g,iw as Pe,h0 as j,b9 as P,cE as c,cZ as Z,a1 as K,kg as H,b4 as G,s as je,aT as $e,bK as Be,aj as ze,fD as ke,kh as Oe,af as oe,ki as Ce,kj as Ue,fG as We,eE as Je,eF as Ge,eG as Ke,i3 as He,eH as Xe,il as Ye,jb as Ze,c as D,aU as Qe,n as re,cU as Re,ig as et,iE as tt,eK as it,d2 as ve,cF as ot}from"./index.d94abe07.js";import{N as rt}from"./SceneService.0f3bf01a.js";import{g as st}from"./persistable.5f665309.js";import{v as se,y as nt}from"./quat.b3994f2f.js";import{e as te}from"./quatf64.4ae3e6f1.js";import"./originUtils.2d0aad75.js";import"./multiOriginJSONSupportUtils.38b69b9c.js";import"./resourceUtils.6d10bf82.js";import"./mat3f64.6d32a1d7.js";const f=Ee(),ge=te(),fe=te(),be=te(),Ie=new Float64Array([0,0,1]),lt=new Float64Array([0,1,0]),at=new Float64Array([1,0,0]);function B(e){we(f,e),de(f,f);const i=Math.atan2(f[1],f[0]),r=se(te(),Ie,-i);Ve(f,f,r);const s=-1*Math.atan2(f[2],f[0]);return[he(i)+270,he(s)+90]}function Q(e,i){return se(fe,Ie,me(e-270)),se(be,lt,me(i-90)),nt(ge,fe,be),we(f,at),Ve(f,f,ge),de(f,f),[f[0],f[1],f[2]]}let R=class extends T(g){constructor(e){super(e),this.enabled=!0,this.label="",this.normal=null,this.point=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=B(this.normal);return $.normalize(z(e),0,!0)}set orientation(e){const i=Q(e,this.tilt);this._set("normal",i),this._set("orientation",e)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=B(this.normal);return $.normalize(z(i),0,!0)}set tilt(e){const i=Q(this.orientation,e);this._set("normal",i),this._set("tilt",e)}};t([o({type:Boolean,json:{write:!0}})],R.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],R.prototype,"label",void 0),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),Y(e=>$.normalize(z(e),0,!0))],R.prototype,"orientation",null),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),Y(e=>$.normalize(z(e),0,!0))],R.prototype,"tilt",null),t([o({type:[Number],json:{write:!0}})],R.prototype,"normal",void 0),t([o({type:[Number],json:{write:!0}})],R.prototype,"point",void 0),R=t([v("esri.layers.voxel.VoxelSlice")],R);const ee=R;let b=class extends T(g){constructor(){super(...arguments),this.enabled=!0,this.href=null,this.id=null,this.label="",this.normal=null,this.point=null,this.sizeInPixel=null,this.slices=null,this.timeId=0,this.variableId=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=B(this.normal);return $.normalize(z(e),0,!0)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=B(this.normal);return $.normalize(z(i),0,!0)}};t([o({type:Boolean,json:{default:!0,write:!0}})],b.prototype,"enabled",void 0),t([o({type:String,json:{origins:{service:{read:Pe}},write:{enabled:!0,isRequired:!0}}}),st({origins:["web-scene"],type:"resource",prefix:"sections",compress:!0})],b.prototype,"href",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"id",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"label",void 0),t([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],b.prototype,"orientation",null),t([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],b.prototype,"tilt",null),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"normal",void 0),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"point",void 0),t([o({type:[j],json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"sizeInPixel",void 0),t([o({type:[ee],json:{write:!0}})],b.prototype,"slices",void 0),t([o({type:j,json:{default:0,write:!0}})],b.prototype,"timeId",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"variableId",void 0),b=t([v("esri.layers.voxel.VoxelSection")],b);const ne=b;let O=class extends g{constructor(){super(...arguments),this.diffuseFactor=.5,this.specularFactor=.5}};t([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],O.prototype,"diffuseFactor",void 0),t([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],O.prototype,"specularFactor",void 0),O=t([v("esri.layers.voxel.VoxelSimpleShading")],O);const Ne=O;let I=class extends g{constructor(){super(...arguments),this.continuity=null,this.hasNoData=!1,this.noData=0,this.offset=0,this.scale=1,this.type=null}};t([o({type:["discrete","continuous"],json:{write:!0}})],I.prototype,"continuity",void 0),t([o({type:Boolean,json:{write:!0}})],I.prototype,"hasNoData",void 0),t([o({type:Number,json:{write:!0}})],I.prototype,"noData",void 0),t([o({type:Number,json:{write:!0}})],I.prototype,"offset",void 0),t([o({type:Number,json:{write:!0}})],I.prototype,"scale",void 0),t([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],I.prototype,"type",void 0),I=t([v("esri.layers.voxel.VoxelFormat")],I);const Se=I;let V=class extends g{constructor(){super(...arguments),this.id=null,this.description="",this.name=null,this.originalFormat=null,this.renderingFormat=null,this.unit="",this.volumeId=0,this.type=null}};t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],V.prototype,"id",void 0),t([o({type:String,json:{write:!0}})],V.prototype,"description",void 0),t([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],V.prototype,"name",void 0),t([o({type:Se,json:{write:!0}})],V.prototype,"originalFormat",void 0),t([o({type:Se,json:{write:{enabled:!0,isRequired:!0}}})],V.prototype,"renderingFormat",void 0),t([o({type:String,json:{write:!0}})],V.prototype,"unit",void 0),t([o({type:Number,json:{write:!0}})],V.prototype,"volumeId",void 0),t([o({type:["stc-hot-spot-results","stc-cluster-outlier-results","stc-estimated-bin","generic-nearest-interpolated"],json:{write:!0}})],V.prototype,"type",void 0),V=t([v("esri.layers.voxel.VoxelVariable")],V);const pt=V;let F=class extends T(g){constructor(){super(...arguments),this.color=P.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label="",this.colorLocked=!0}};t([o({type:P,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],F.prototype,"color",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],F.prototype,"value",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],F.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],F.prototype,"label",void 0),t([o({type:Boolean,json:{default:!1}})],F.prototype,"colorLocked",void 0),F=t([v("esri.layers.voxel.VoxelIsosurface")],F);const Ae=F;let C=class extends T(g){constructor(){super(...arguments),this.color=null,this.position=0}};t([o({type:P,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],C.prototype,"color",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],C.prototype,"position",void 0),C=t([v("esri.layers.voxel.VoxelColorStop")],C);const le=C;let U=class extends T(g){constructor(){super(...arguments),this.opacity=1,this.position=0}};t([o({type:Number,json:{name:"alpha",write:{enabled:!0,isRequired:!0}}})],U.prototype,"opacity",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],U.prototype,"position",void 0),U=t([v("esri.layers.voxel.VoxelOpacityStop")],U);const ae=U;let W=class extends T(g){constructor(){super(...arguments),this.enabled=!1,this.range=null}};t([o({type:Boolean,json:{default:!1,write:!0}})],W.prototype,"enabled",void 0),t([o({type:[Number],json:{write:!0}})],W.prototype,"range",void 0),W=t([v("esri.layers.voxel.VoxelRangeFilter")],W);const ut=W;var w;(function(e){e[e.Color=1]="Color",e[e.Alpha=2]="Alpha",e[e.Both=3]="Both"})(w||(w={}));let N=class extends T(g){constructor(e){super(e),this.interpolation=null,this.stretchRange=null,this.rangeFilter=null,this._colorMapSize=256,this.colorStops=new(c.ofType(le)),this.opacityStops=new(c.ofType(ae))}set colorStops(e){this._set("colorStops",Z(e,this._get("colorStops"),c.ofType(le)))}set opacityStops(e){this._set("opacityStops",Z(e,this._get("opacityStops"),c.ofType(ae)))}getPreviousNext(e,i,r){let s=e;for(;--s>0&&i[s].type!==r&&i[s].type!==w.Both;);let n=e;const l=i.length;for(;++nu.position{d.color[ie]=Math.round(H(k[ie],_e[ie],m))})}else["r","g","b"].forEach(h!==-1?m=>{d.color[m]=r[h][m]}:m=>{d.color[m]=r[y][m]})}}for(const u of r)i.push({color:u.color,position:u.position})}i[0].position=0,i[i.length-1].position=1;let n=0,l=1;for(let a=0;ai[l].position;)n=l++;const d=(u-i[n].position)/(i[l].position-i[n].position),h=i[n].color,y=i[l].color,m=new P;["r","g","b"].forEach(k=>{m[k]=Math.round(H(h[k],y[k],d))}),m.a=K(1-H(h.a,y.a,d)/255,0,1),e.push(m)}return e}getColorForContinuousDataValue(e,i){const r=this.rasterizedTransferFunction;if(this.colorStops.length<2||!Array.isArray(this.stretchRange)||this.stretchRange.length<2||r.length<256)return null;let s=this.stretchRange[0],n=this.stretchRange[1];if(s>n){const a=s;s=n,n=a}e=K(e,s,n);const l=r[Math.round((e-s)/(n-s)*(this._colorMapSize-1))].clone();return i||(l.a=1),l}};t([o({type:["linear","nearest"],json:{write:!0}})],N.prototype,"interpolation",void 0),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],N.prototype,"stretchRange",void 0),t([o({type:c.ofType(le),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.colorStops&&this.colorStops.length>0}}}}})],N.prototype,"colorStops",null),t([o({type:c.ofType(ae),json:{read:{source:"alphaStops"},write:{enabled:!0,target:"alphaStops",overridePolicy(){return{enabled:!!this.opacityStops&&this.opacityStops.length>0}}}}})],N.prototype,"opacityStops",null),t([o({type:ut,json:{write:!0}})],N.prototype,"rangeFilter",void 0),t([o({type:[P],clonable:!1,json:{read:!1}})],N.prototype,"rasterizedTransferFunction",null),N=t([v("esri.layers.voxel.VoxelTransferFunctionStyle")],N);const ct=N;let _=class extends T(g){constructor(){super(...arguments),this.color=P.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label=""}};t([o({type:P,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],_.prototype,"color",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],_.prototype,"value",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],_.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],_.prototype,"label",void 0),_=t([v("esri.layers.voxel.VoxelUniqueValue")],_);const qe=_;var pe;let L=pe=class extends g{constructor(e){super(e),this.variableId=0,this.label="",this.transferFunction=null,this.uniqueValues=null,this.isosurfaces=null,this.uniqueValues=new(c.ofType(qe)),this.isosurfaces=new(c.ofType(Ae))}clone(){return new pe({variableId:this.variableId,label:this.label,transferFunction:G(this.transferFunction),uniqueValues:G(this.uniqueValues),isosurfaces:G(this.isosurfaces)})}};t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],L.prototype,"variableId",void 0),t([o({type:String,json:{write:!0}})],L.prototype,"label",void 0),t([o({type:ct,json:{write:{enabled:!0,overridePolicy(){return{enabled:!this.uniqueValues||this.uniqueValues.length<1}}}}})],L.prototype,"transferFunction",void 0),t([o({type:c.ofType(qe),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.uniqueValues&&this.uniqueValues.length>0}}}}})],L.prototype,"uniqueValues",void 0),t([o({type:c.ofType(Ae),json:{write:{enabled:!0,overridePolicy(){const e=!this.uniqueValues||this.uniqueValues.length<1,i=!!this.isosurfaces&&this.isosurfaces.length>0;return{enabled:e&&i}}}}})],L.prototype,"isosurfaces",void 0),L=pe=t([v("esri.layers.voxel.VoxelVariableStyle")],L);const Te=L;let X=class extends g{constructor(){super(...arguments),this.values=null}};t([o({type:[Number],json:{write:!0}})],X.prototype,"values",void 0),X=t([v("esri.layers.voxel.VoxelIrregularSpacing")],X);const yt=X;let J=class extends g{constructor(){super(...arguments),this.scale=1,this.offset=0}};t([o({type:Number,json:{write:!0}})],J.prototype,"scale",void 0),t([o({type:Number,json:{write:!0}})],J.prototype,"offset",void 0),J=t([v("esri.layers.voxel.VoxelRegularSpacing")],J);const dt=J;let S=class extends g{constructor(){super(...arguments),this.irregularSpacing=null,this.isPositiveUp=!0,this.isWrappedDateLine=!1,this.label=null,this.name=null,this.quantity=null,this.regularSpacing=null,this.size=0,this.unit=null}get isRegular(){return(this.irregularSpacing==null||this.irregularSpacing===void 0)&&this.regularSpacing!==null}getRange(){var e;return this.isRegular?[this.regularSpacing.offset,this.regularSpacing.offset+this.regularSpacing.scale*(this.size-1)]:Array.isArray((e=this.irregularSpacing)==null?void 0:e.values)&&this.irregularSpacing.values.length>1?[this.irregularSpacing.values[0],this.irregularSpacing.values[this.irregularSpacing.values.length-1]]:[0,0]}};t([o({type:yt,json:{write:!0}})],S.prototype,"irregularSpacing",void 0),t([o({type:Boolean,json:{write:!0}})],S.prototype,"isPositiveUp",void 0),t([o({type:Boolean,json:{write:!0}})],S.prototype,"isWrappedDateLine",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"label",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"name",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"quantity",void 0),t([o({type:dt,json:{write:!0}})],S.prototype,"regularSpacing",void 0),t([o({type:Number,json:{write:!0}})],S.prototype,"size",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"unit",void 0),t([o({type:Boolean,json:{read:!1}})],S.prototype,"isRegular",null),S=t([v("esri.layers.voxel.VoxelDimension")],S);const ht=S,De="esri.layers.voxel.VoxelVolume",xe=je.getLogger(De);let x=class extends g{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=$e.WGS84}get zDimension(){if(!this.dimensions||!Array.isArray(this.dimensions)||this.dimensions.length!==4)return-1;for(let e=2;e<4;++e)if(this.dimensions[e].size>0)return e;return-1}get isValid(){return!!this.dimensions&&!!Array.isArray(this.dimensions)&&this.dimensions.length===4&&!(this.dimensions[0].size<1||this.dimensions[1].size<1)&&!(this.zDimension===-1||this.dimensions[this.zDimension].size<1)}get originInLayerSpace3D(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),r=this.dimensions[2],s=r.isRegular?r.getRange():[0,r.size];return[e[0],i[0],s[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),r=this.dimensions[2],s=r.isRegular?r.getRange():[0,r.size],n=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let l=0;l<3;++l)n[l]<2?n[l]=1:n[l]-=1;return r.isRegular&&!r.isPositiveUp&&(n[2]*=-1),[(e[1]-e[0])/n[0],(i[1]-i[0])/n[1],(s[1]-s[0])/n[2]]}get volumeType(){if(this.isValid){const e=this.dimensions[2].size>0,i=this.dimensions[3].size>0;if(!e&&i)return"xyt";if(e&&i)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const e=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[e].size]}computeVoxelSpaceLocation(e){var s,n,l;if(!this.isValid)return[0,0,0];if(this.volumeType==="xyt")return xe.error("computeVoxelSpacePosition cannot be used with XYT volumes."),[0,0,0];if(!Be(this.spatialReference,e.spatialReference))return xe.error("pos argument should have the same spatial reference as the VoxelLayer."),[0,0,0];const i=ze(e.x,e.y,(s=e.z)!=null?s:0);ke(i,i,this.originInLayerSpace3D),Oe(i,i,this.voxelSizeInLayerSpaceSigned);const r=this.dimensions[this.zDimension];if(!r.isRegular&&Array.isArray((n=r.irregularSpacing)==null?void 0:n.values)&&r.irregularSpacing.values.length>1){const a=(l=e.z)!=null?l:0,u=r.irregularSpacing.values,d=r.isPositiveUp?1:-1,h=u.reduce((y,m)=>Math.abs(d*m-a)$.normalize(z(e),0,!0))],A.prototype,"orientation",null),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),Y(e=>$.normalize(z(e),0,!0))],A.prototype,"tilt",null),t([o({type:[Number],json:{write:!0}})],A.prototype,"normal",void 0),t([o({type:[Number],json:{write:!0}})],A.prototype,"point",void 0),A=t([v("esri.layers.voxel.VoxelDynamicSection")],A);const ce=A;var ye;let q=ye=class extends g{constructor(e){super(e),this.volumeId=0,this.verticalExaggeration=1,this.exaggerationMode="scale-height",this.verticalOffset=0,this.slices=new(c.ofType(ee)),this.dynamicSections=new(c.ofType(ce))}set slices(e){this._set("slices",Z(e,this._get("slices"),c.ofType(ee)))}set dynamicSections(e){this._set("dynamicSections",Z(e,this._get("dynamicSections"),c.ofType(ce)))}clone(){return new ye({volumeId:this.volumeId,verticalExaggeration:this.verticalExaggeration,exaggerationMode:this.exaggerationMode,verticalOffset:this.verticalOffset,slices:G(this.slices),dynamicSections:G(this.dynamicSections)})}};t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],q.prototype,"volumeId",void 0),t([o({type:Number,json:{default:1,write:!0}})],q.prototype,"verticalExaggeration",void 0),t([o({type:["scale-position","scale-height"],json:{default:"scale-height",write:!0}})],q.prototype,"exaggerationMode",void 0),t([o({type:Number,json:{default:0,write:!0}})],q.prototype,"verticalOffset",void 0),t([o({type:c.ofType(ee),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.slices&&this.slices.length>0}}}}})],q.prototype,"slices",null),t([o({type:c.ofType(ce),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.dynamicSections&&this.dynamicSections.length>0}}}}})],q.prototype,"dynamicSections",null),q=ye=t([v("esri.layers.voxel.VoxelVolumeStyle")],q);const Le=q,Me="esri.layers.VoxelLayer",M=je.getLogger(Me);let p=class extends rt(Je(Ge(Ke(He(Xe(Ye(ot))))))){constructor(e){super(e),this.serviceRoot="",this.popupEnabled=!0,this.operationalLayerType="Voxel",this.legendEnabled=!0,this.title=null,this.sections=null,this.currentVariableId=0,this.volumeStyles=null,this.renderMode="volume",this.variableStyles=null,this.enableSlices=!0,this.enableSections=!0,this.enableDynamicSections=!0,this.enableIsosurfaces=!0,this.shading=new Ne,this.opacity=1,this.variables=new c,this.volumes=new c,this.index=null,this.minScale=0,this.maxScale=0,this.type="voxel",this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.fullExtent=null,this.volumeStyles=new(c.ofType(Le)),this.variableStyles=new(c.ofType(Te)),this.sections=new(c.ofType(ne))}set url(e){this._set("url",Ze(e,M))}load(e){const i=D(e)?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(Qe).then(()=>this._fetchService(i)).then(()=>this.serviceRoot=this.url);return this.addResolvingPromise(r),Promise.resolve(this)}read(e,i){super.read(e,i);for(const r of this.volumes)r.spatialReference=this.spatialReference}readVersion(e,i){return super.parseVersionString(e)}validateLayer(e){if(e.layerType&&e.layerType!==this.operationalLayerType)throw new re("voxel-layer:layer-type-not-supported","VoxelLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor)||this.version.major<3)throw new re("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new re("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"})}readFullExtent(e,i,r){if(e!=null&&typeof e=="object"){const s=Re.fromJSON(e,r);if(s.zmin===0&&s.zmax===0&&Array.isArray(i.volumes)){const n=Fe.fromJSON(i.volumes[0]);if(n.isValid&&n.volumeType!=="xyt"){const l=n.dimensions[2];if(l.isRegular){let a=l.regularSpacing.offset,u=l.regularSpacing.offset+l.regularSpacing.scale*(l.size-1);if(a>u){const d=a;a=u,u=d}s.zmin=a,s.zmax=u}}}return s}return null}getConfiguration(){const e={layerType:this.operationalLayerType,version:this.version.versionString,name:this.title,spatialReference:this.spatialReference,fullExtent:this.fullExtent,volumes:this.volumes.toJSON(),variables:this.variables.toJSON(),index:this.index.toJSON(),sections:this.getSections(),style:{volumeStyles:this.getVolumeStyles(),currentVariableId:this.currentVariableId,renderMode:this.renderMode,variableStyles:this.getVariableStyles(),enableSections:this.enableSections,enableDynamicSections:this.enableDynamicSections,enableIsosurfaces:this.enableIsosurfaces,enableSlices:this.enableSlices,shading:this.shading}};return e.index&&this.index.isValid()?JSON.stringify(e):""}getVariableStyle(e){let i=-1;if(i=D(e)?e:this.currentVariableId,!this.variableStyles||i===-1)return null;const r=this.variableStyles.findIndex(s=>s.variableId===i);return r<0?null:this.variableStyles.getItemAt(r)}getVariable(e){let i=-1;if(i=D(e)?e:this.currentVariableId,!this.variables||i===-1)return null;const r=this.variables.findIndex(s=>s.id===i);return r<0?null:this.variables.getItemAt(r)}getVolume(e){const i=this.getVariable(e);return D(i)?this.volumes.find(({id:r})=>r===i.volumeId):null}getVolumeStyle(e){const i=this.getVariable(e);return D(i)?this.volumeStyles.find(({volumeId:r})=>r===i.volumeId):null}getColorForContinuousDataValue(e,i,r){const s=this.getVariable(e);if(!D(s)||s.renderingFormat.continuity!=="continuous"||!this.variableStyles)return null;const n=this.variableStyles.findIndex(a=>a.variableId===e);if(n<0)return null;const l=this.variableStyles.getItemAt(n);return l.transferFunction?l.transferFunction.getColorForContinuousDataValue(i,r):null}getSections(){const e=[];for(const i of this.sections)e.push(new ne({enabled:i.enabled,href:i.href,id:i.id,label:i.label,normal:i.normal,point:i.point,sizeInPixel:i.sizeInPixel,slices:i.slices,timeId:i.timeId,variableId:i.variableId}));return e}getVariableStyles(){const e=[];for(const i of this.variableStyles){const r=this._getVariable(i);if(D(r)){const s=i.clone();s.isosurfaces.length>4&&(s.isosurfaces=s.isosurfaces.slice(0,3),M.error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const n of s.isosurfaces)if(n.colorLocked){const l=this.getColorForContinuousDataValue(s.variableId,n.value,!1);l===null||l.equals(n.color)||(n.color=l)}if(r.renderingFormat.continuity==="continuous")(s.transferFunction===null||s.transferFunction.colorStops.length<2)&&M.error(`VoxelVariableStyle for variable ${r.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),s.transferFunction!==null&&(Array.isArray(s.transferFunction.stretchRange)&&s.transferFunction.stretchRange.length===2||(M.error(`VoxelVariableStyle for variable ${r.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),s.transferFunction.stretchRange=[0,1],s.transferFunction.colorStops.removeAll()));else if(r.renderingFormat.continuity==="discrete")if(i.uniqueValues.length===0)M.error(`VoxelVariableStyle for variable ${r.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(const n of i.uniqueValues)n.label!==null&&n.label!==void 0||n.value===null||n.value===void 0||(n.label=n.value.toString());e.push(s)}else M.error(`VoxelVariable ID=${i.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return e}getVolumeStyles(){const e=[];for(const i of this.volumeStyles){const r=this._getVolumeFromVolumeId(i.volumeId);if(D(r)){const s=i.clone();for(const n of s.slices)this._isPlaneValid(n,[0,1,r.zDimension],r.dimensions)||(n.enabled=!1,n.label="invalid");for(const n of s.dynamicSections)this._isPlaneValid(n,[0,1,r.zDimension],r.dimensions)||(n.enabled=!1,n.label="invalid");e.push(s)}else M.error(`VoxelVolume ID=${i.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return e}_getVariable(e){const i=e.variableId;for(const r of this.variables)if(r.id===i)return r;return null}_getVolumeFromVolumeId(e){for(const i of this.volumes)if(i.id===e)return i;return null}_isPlaneValid(e,i,r){if(!e.point||!Array.isArray(e.point)||e.point.length!==3||!e.normal||!Array.isArray(e.normal)||e.normal.length!==3)return!1;for(let l=0;l<3;++l){const a=e.point[l];if(a<0||a>=r[i[l]].size)return!1}const s=ze(e.normal[0],e.normal[1],e.normal[2]);de(s,s);const n=1e-6;return!(Math.abs(s[0])+Math.abs(s[1])+Math.abs(s[2])$.normalize(z(e),0,!0))],R.prototype,"orientation",null),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),Y(e=>$.normalize(z(e),0,!0))],R.prototype,"tilt",null),t([o({type:[Number],json:{write:!0}})],R.prototype,"normal",void 0),t([o({type:[Number],json:{write:!0}})],R.prototype,"point",void 0),R=t([v("esri.layers.voxel.VoxelSlice")],R);const ee=R;let b=class extends T(g){constructor(){super(...arguments),this.enabled=!0,this.href=null,this.id=null,this.label="",this.normal=null,this.point=null,this.sizeInPixel=null,this.slices=null,this.timeId=0,this.variableId=null}get orientation(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=B(this.normal);return $.normalize(z(e),0,!0)}get tilt(){if(!Array.isArray(this.normal)||this.normal.length!==3)return 0;const[e,i]=B(this.normal);return $.normalize(z(i),0,!0)}};t([o({type:Boolean,json:{default:!0,write:!0}})],b.prototype,"enabled",void 0),t([o({type:String,json:{origins:{service:{read:Pe}},write:{enabled:!0,isRequired:!0}}}),st({origins:["web-scene"],type:"resource",prefix:"sections",compress:!0})],b.prototype,"href",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"id",void 0),t([o({type:String,json:{write:!0}})],b.prototype,"label",void 0),t([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],b.prototype,"orientation",null),t([o({type:Number,clonable:!1,readOnly:!0,range:{min:0,max:360}})],b.prototype,"tilt",null),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"normal",void 0),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"point",void 0),t([o({type:[j],json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"sizeInPixel",void 0),t([o({type:[ee],json:{write:!0}})],b.prototype,"slices",void 0),t([o({type:j,json:{default:0,write:!0}})],b.prototype,"timeId",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],b.prototype,"variableId",void 0),b=t([v("esri.layers.voxel.VoxelSection")],b);const ne=b;let O=class extends g{constructor(){super(...arguments),this.diffuseFactor=.5,this.specularFactor=.5}};t([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],O.prototype,"diffuseFactor",void 0),t([o({type:Number,range:{min:0,max:1},json:{default:.5,write:!0}})],O.prototype,"specularFactor",void 0),O=t([v("esri.layers.voxel.VoxelSimpleShading")],O);const Ne=O;let I=class extends g{constructor(){super(...arguments),this.continuity=null,this.hasNoData=!1,this.noData=0,this.offset=0,this.scale=1,this.type=null}};t([o({type:["discrete","continuous"],json:{write:!0}})],I.prototype,"continuity",void 0),t([o({type:Boolean,json:{write:!0}})],I.prototype,"hasNoData",void 0),t([o({type:Number,json:{write:!0}})],I.prototype,"noData",void 0),t([o({type:Number,json:{write:!0}})],I.prototype,"offset",void 0),t([o({type:Number,json:{write:!0}})],I.prototype,"scale",void 0),t([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],I.prototype,"type",void 0),I=t([v("esri.layers.voxel.VoxelFormat")],I);const Se=I;let V=class extends g{constructor(){super(...arguments),this.id=null,this.description="",this.name=null,this.originalFormat=null,this.renderingFormat=null,this.unit="",this.volumeId=0,this.type=null}};t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],V.prototype,"id",void 0),t([o({type:String,json:{write:!0}})],V.prototype,"description",void 0),t([o({type:String,json:{write:{enabled:!0,isRequired:!0}}})],V.prototype,"name",void 0),t([o({type:Se,json:{write:!0}})],V.prototype,"originalFormat",void 0),t([o({type:Se,json:{write:{enabled:!0,isRequired:!0}}})],V.prototype,"renderingFormat",void 0),t([o({type:String,json:{write:!0}})],V.prototype,"unit",void 0),t([o({type:Number,json:{write:!0}})],V.prototype,"volumeId",void 0),t([o({type:["stc-hot-spot-results","stc-cluster-outlier-results","stc-estimated-bin","generic-nearest-interpolated"],json:{write:!0}})],V.prototype,"type",void 0),V=t([v("esri.layers.voxel.VoxelVariable")],V);const pt=V;let F=class extends T(g){constructor(){super(...arguments),this.color=P.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label="",this.colorLocked=!0}};t([o({type:P,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],F.prototype,"color",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],F.prototype,"value",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],F.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],F.prototype,"label",void 0),t([o({type:Boolean,json:{default:!1}})],F.prototype,"colorLocked",void 0),F=t([v("esri.layers.voxel.VoxelIsosurface")],F);const Ae=F;let C=class extends T(g){constructor(){super(...arguments),this.color=null,this.position=0}};t([o({type:P,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],C.prototype,"color",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],C.prototype,"position",void 0),C=t([v("esri.layers.voxel.VoxelColorStop")],C);const le=C;let U=class extends T(g){constructor(){super(...arguments),this.opacity=1,this.position=0}};t([o({type:Number,json:{name:"alpha",write:{enabled:!0,isRequired:!0}}})],U.prototype,"opacity",void 0),t([o({type:Number,json:{write:{enabled:!0,isRequired:!0}}})],U.prototype,"position",void 0),U=t([v("esri.layers.voxel.VoxelOpacityStop")],U);const ae=U;let W=class extends T(g){constructor(){super(...arguments),this.enabled=!1,this.range=null}};t([o({type:Boolean,json:{default:!1,write:!0}})],W.prototype,"enabled",void 0),t([o({type:[Number],json:{write:!0}})],W.prototype,"range",void 0),W=t([v("esri.layers.voxel.VoxelRangeFilter")],W);const ut=W;var w;(function(e){e[e.Color=1]="Color",e[e.Alpha=2]="Alpha",e[e.Both=3]="Both"})(w||(w={}));let N=class extends T(g){constructor(e){super(e),this.interpolation=null,this.stretchRange=null,this.rangeFilter=null,this._colorMapSize=256,this.colorStops=new(c.ofType(le)),this.opacityStops=new(c.ofType(ae))}set colorStops(e){this._set("colorStops",Z(e,this._get("colorStops"),c.ofType(le)))}set opacityStops(e){this._set("opacityStops",Z(e,this._get("opacityStops"),c.ofType(ae)))}getPreviousNext(e,i,r){let s=e;for(;--s>0&&i[s].type!==r&&i[s].type!==w.Both;);let n=e;const l=i.length;for(;++nu.position{d.color[ie]=Math.round(H(k[ie],_e[ie],m))})}else["r","g","b"].forEach(h!==-1?m=>{d.color[m]=r[h][m]}:m=>{d.color[m]=r[y][m]})}}for(const u of r)i.push({color:u.color,position:u.position})}i[0].position=0,i[i.length-1].position=1;let n=0,l=1;for(let a=0;ai[l].position;)n=l++;const d=(u-i[n].position)/(i[l].position-i[n].position),h=i[n].color,y=i[l].color,m=new P;["r","g","b"].forEach(k=>{m[k]=Math.round(H(h[k],y[k],d))}),m.a=K(1-H(h.a,y.a,d)/255,0,1),e.push(m)}return e}getColorForContinuousDataValue(e,i){const r=this.rasterizedTransferFunction;if(this.colorStops.length<2||!Array.isArray(this.stretchRange)||this.stretchRange.length<2||r.length<256)return null;let s=this.stretchRange[0],n=this.stretchRange[1];if(s>n){const a=s;s=n,n=a}e=K(e,s,n);const l=r[Math.round((e-s)/(n-s)*(this._colorMapSize-1))].clone();return i||(l.a=1),l}};t([o({type:["linear","nearest"],json:{write:!0}})],N.prototype,"interpolation",void 0),t([o({type:[Number],json:{write:{enabled:!0,isRequired:!0}}})],N.prototype,"stretchRange",void 0),t([o({type:c.ofType(le),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.colorStops&&this.colorStops.length>0}}}}})],N.prototype,"colorStops",null),t([o({type:c.ofType(ae),json:{read:{source:"alphaStops"},write:{enabled:!0,target:"alphaStops",overridePolicy(){return{enabled:!!this.opacityStops&&this.opacityStops.length>0}}}}})],N.prototype,"opacityStops",null),t([o({type:ut,json:{write:!0}})],N.prototype,"rangeFilter",void 0),t([o({type:[P],clonable:!1,json:{read:!1}})],N.prototype,"rasterizedTransferFunction",null),N=t([v("esri.layers.voxel.VoxelTransferFunctionStyle")],N);const ct=N;let _=class extends T(g){constructor(){super(...arguments),this.color=P.fromArray([0,0,0,0]),this.value=0,this.enabled=!0,this.label=""}};t([o({type:P,json:{type:[j],write:{enabled:!0,isRequired:!0}}})],_.prototype,"color",void 0),t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],_.prototype,"value",void 0),t([o({type:Boolean,json:{default:!0,write:!0}})],_.prototype,"enabled",void 0),t([o({type:String,json:{write:!0}})],_.prototype,"label",void 0),_=t([v("esri.layers.voxel.VoxelUniqueValue")],_);const qe=_;var pe;let L=pe=class extends g{constructor(e){super(e),this.variableId=0,this.label="",this.transferFunction=null,this.uniqueValues=null,this.isosurfaces=null,this.uniqueValues=new(c.ofType(qe)),this.isosurfaces=new(c.ofType(Ae))}clone(){return new pe({variableId:this.variableId,label:this.label,transferFunction:G(this.transferFunction),uniqueValues:G(this.uniqueValues),isosurfaces:G(this.isosurfaces)})}};t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],L.prototype,"variableId",void 0),t([o({type:String,json:{write:!0}})],L.prototype,"label",void 0),t([o({type:ct,json:{write:{enabled:!0,overridePolicy(){return{enabled:!this.uniqueValues||this.uniqueValues.length<1}}}}})],L.prototype,"transferFunction",void 0),t([o({type:c.ofType(qe),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.uniqueValues&&this.uniqueValues.length>0}}}}})],L.prototype,"uniqueValues",void 0),t([o({type:c.ofType(Ae),json:{write:{enabled:!0,overridePolicy(){const e=!this.uniqueValues||this.uniqueValues.length<1,i=!!this.isosurfaces&&this.isosurfaces.length>0;return{enabled:e&&i}}}}})],L.prototype,"isosurfaces",void 0),L=pe=t([v("esri.layers.voxel.VoxelVariableStyle")],L);const Te=L;let X=class extends g{constructor(){super(...arguments),this.values=null}};t([o({type:[Number],json:{write:!0}})],X.prototype,"values",void 0),X=t([v("esri.layers.voxel.VoxelIrregularSpacing")],X);const yt=X;let J=class extends g{constructor(){super(...arguments),this.scale=1,this.offset=0}};t([o({type:Number,json:{write:!0}})],J.prototype,"scale",void 0),t([o({type:Number,json:{write:!0}})],J.prototype,"offset",void 0),J=t([v("esri.layers.voxel.VoxelRegularSpacing")],J);const dt=J;let S=class extends g{constructor(){super(...arguments),this.irregularSpacing=null,this.isPositiveUp=!0,this.isWrappedDateLine=!1,this.label=null,this.name=null,this.quantity=null,this.regularSpacing=null,this.size=0,this.unit=null}get isRegular(){return(this.irregularSpacing==null||this.irregularSpacing===void 0)&&this.regularSpacing!==null}getRange(){var e;return this.isRegular?[this.regularSpacing.offset,this.regularSpacing.offset+this.regularSpacing.scale*(this.size-1)]:Array.isArray((e=this.irregularSpacing)==null?void 0:e.values)&&this.irregularSpacing.values.length>1?[this.irregularSpacing.values[0],this.irregularSpacing.values[this.irregularSpacing.values.length-1]]:[0,0]}};t([o({type:yt,json:{write:!0}})],S.prototype,"irregularSpacing",void 0),t([o({type:Boolean,json:{write:!0}})],S.prototype,"isPositiveUp",void 0),t([o({type:Boolean,json:{write:!0}})],S.prototype,"isWrappedDateLine",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"label",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"name",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"quantity",void 0),t([o({type:dt,json:{write:!0}})],S.prototype,"regularSpacing",void 0),t([o({type:Number,json:{write:!0}})],S.prototype,"size",void 0),t([o({type:String,json:{write:!0}})],S.prototype,"unit",void 0),t([o({type:Boolean,json:{read:!1}})],S.prototype,"isRegular",null),S=t([v("esri.layers.voxel.VoxelDimension")],S);const ht=S,De="esri.layers.voxel.VoxelVolume",xe=je.getLogger(De);let x=class extends g{constructor(e){super(e),this.id=0,this.dimensions=null,this.spatialReference=$e.WGS84}get zDimension(){if(!this.dimensions||!Array.isArray(this.dimensions)||this.dimensions.length!==4)return-1;for(let e=2;e<4;++e)if(this.dimensions[e].size>0)return e;return-1}get isValid(){return!!this.dimensions&&!!Array.isArray(this.dimensions)&&this.dimensions.length===4&&!(this.dimensions[0].size<1||this.dimensions[1].size<1)&&!(this.zDimension===-1||this.dimensions[this.zDimension].size<1)}get originInLayerSpace3D(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),r=this.dimensions[2],s=r.isRegular?r.getRange():[0,r.size];return[e[0],i[0],s[0]]}get voxelSizeInLayerSpaceSigned(){if(!this.isValid||this.volumeType==="xyt")return[0,0,0];const e=this.dimensions[0].getRange(),i=this.dimensions[1].getRange(),r=this.dimensions[2],s=r.isRegular?r.getRange():[0,r.size],n=[this.sizeInVoxels[0],this.sizeInVoxels[1],this.sizeInVoxels[2]];for(let l=0;l<3;++l)n[l]<2?n[l]=1:n[l]-=1;return r.isRegular&&!r.isPositiveUp&&(n[2]*=-1),[(e[1]-e[0])/n[0],(i[1]-i[0])/n[1],(s[1]-s[0])/n[2]]}get volumeType(){if(this.isValid){const e=this.dimensions[2].size>0,i=this.dimensions[3].size>0;if(!e&&i)return"xyt";if(e&&i)return"xyzt"}return"xyz"}get sizeInVoxels(){if(!this.isValid)return[0,0,0];const e=this.zDimension;return[this.dimensions[0].size,this.dimensions[1].size,this.dimensions[e].size]}computeVoxelSpaceLocation(e){var s,n,l;if(!this.isValid)return[0,0,0];if(this.volumeType==="xyt")return xe.error("computeVoxelSpacePosition cannot be used with XYT volumes."),[0,0,0];if(!Be(this.spatialReference,e.spatialReference))return xe.error("pos argument should have the same spatial reference as the VoxelLayer."),[0,0,0];const i=ze(e.x,e.y,(s=e.z)!=null?s:0);ke(i,i,this.originInLayerSpace3D),Oe(i,i,this.voxelSizeInLayerSpaceSigned);const r=this.dimensions[this.zDimension];if(!r.isRegular&&Array.isArray((n=r.irregularSpacing)==null?void 0:n.values)&&r.irregularSpacing.values.length>1){const a=(l=e.z)!=null?l:0,u=r.irregularSpacing.values,d=r.isPositiveUp?1:-1,h=u.reduce((y,m)=>Math.abs(d*m-a)$.normalize(z(e),0,!0))],A.prototype,"orientation",null),t([o({type:Number,json:{read:!1},clonable:!1,range:{min:0,max:360}}),Y(e=>$.normalize(z(e),0,!0))],A.prototype,"tilt",null),t([o({type:[Number],json:{write:!0}})],A.prototype,"normal",void 0),t([o({type:[Number],json:{write:!0}})],A.prototype,"point",void 0),A=t([v("esri.layers.voxel.VoxelDynamicSection")],A);const ce=A;var ye;let q=ye=class extends g{constructor(e){super(e),this.volumeId=0,this.verticalExaggeration=1,this.exaggerationMode="scale-height",this.verticalOffset=0,this.slices=new(c.ofType(ee)),this.dynamicSections=new(c.ofType(ce))}set slices(e){this._set("slices",Z(e,this._get("slices"),c.ofType(ee)))}set dynamicSections(e){this._set("dynamicSections",Z(e,this._get("dynamicSections"),c.ofType(ce)))}clone(){return new ye({volumeId:this.volumeId,verticalExaggeration:this.verticalExaggeration,exaggerationMode:this.exaggerationMode,verticalOffset:this.verticalOffset,slices:G(this.slices),dynamicSections:G(this.dynamicSections)})}};t([o({type:j,json:{write:{enabled:!0,isRequired:!0}}})],q.prototype,"volumeId",void 0),t([o({type:Number,json:{default:1,write:!0}})],q.prototype,"verticalExaggeration",void 0),t([o({type:["scale-position","scale-height"],json:{default:"scale-height",write:!0}})],q.prototype,"exaggerationMode",void 0),t([o({type:Number,json:{default:0,write:!0}})],q.prototype,"verticalOffset",void 0),t([o({type:c.ofType(ee),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.slices&&this.slices.length>0}}}}})],q.prototype,"slices",null),t([o({type:c.ofType(ce),json:{write:{enabled:!0,overridePolicy(){return{enabled:!!this.dynamicSections&&this.dynamicSections.length>0}}}}})],q.prototype,"dynamicSections",null),q=ye=t([v("esri.layers.voxel.VoxelVolumeStyle")],q);const Le=q,Me="esri.layers.VoxelLayer",M=je.getLogger(Me);let p=class extends rt(Je(Ge(Ke(He(Xe(Ye(ot))))))){constructor(e){super(e),this.serviceRoot="",this.popupEnabled=!0,this.operationalLayerType="Voxel",this.legendEnabled=!0,this.title=null,this.sections=null,this.currentVariableId=0,this.volumeStyles=null,this.renderMode="volume",this.variableStyles=null,this.enableSlices=!0,this.enableSections=!0,this.enableDynamicSections=!0,this.enableIsosurfaces=!0,this.shading=new Ne,this.opacity=1,this.variables=new c,this.volumes=new c,this.index=null,this.minScale=0,this.maxScale=0,this.type="voxel",this.version={major:Number.NaN,minor:Number.NaN,versionString:""},this.fullExtent=null,this.volumeStyles=new(c.ofType(Le)),this.variableStyles=new(c.ofType(Te)),this.sections=new(c.ofType(ne))}set url(e){this._set("url",Ze(e,M))}load(e){const i=D(e)?e.signal:null,r=this.loadFromPortal({supportedTypes:["Scene Service"]},e).catch(Qe).then(()=>this._fetchService(i)).then(()=>this.serviceRoot=this.url);return this.addResolvingPromise(r),Promise.resolve(this)}read(e,i){super.read(e,i);for(const r of this.volumes)r.spatialReference=this.spatialReference}readVersion(e,i){return super.parseVersionString(e)}validateLayer(e){if(e.layerType&&e.layerType!==this.operationalLayerType)throw new re("voxel-layer:layer-type-not-supported","VoxelLayer does not support this layer type",{layerType:e.layerType});if(isNaN(this.version.major)||isNaN(this.version.minor)||this.version.major<3)throw new re("layer:service-version-not-supported","Service version is not supported.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"});if(this.version.major>3)throw new re("layer:service-version-too-new","Service version is too new.",{serviceVersion:this.version.versionString,supportedVersions:"3.x"})}readFullExtent(e,i,r){if(e!=null&&typeof e=="object"){const s=Re.fromJSON(e,r);if(s.zmin===0&&s.zmax===0&&Array.isArray(i.volumes)){const n=Fe.fromJSON(i.volumes[0]);if(n.isValid&&n.volumeType!=="xyt"){const l=n.dimensions[2];if(l.isRegular){let a=l.regularSpacing.offset,u=l.regularSpacing.offset+l.regularSpacing.scale*(l.size-1);if(a>u){const d=a;a=u,u=d}s.zmin=a,s.zmax=u}}}return s}return null}getConfiguration(){const e={layerType:this.operationalLayerType,version:this.version.versionString,name:this.title,spatialReference:this.spatialReference,fullExtent:this.fullExtent,volumes:this.volumes.toJSON(),variables:this.variables.toJSON(),index:this.index.toJSON(),sections:this.getSections(),style:{volumeStyles:this.getVolumeStyles(),currentVariableId:this.currentVariableId,renderMode:this.renderMode,variableStyles:this.getVariableStyles(),enableSections:this.enableSections,enableDynamicSections:this.enableDynamicSections,enableIsosurfaces:this.enableIsosurfaces,enableSlices:this.enableSlices,shading:this.shading}};return e.index&&this.index.isValid()?JSON.stringify(e):""}getVariableStyle(e){let i=-1;if(i=D(e)?e:this.currentVariableId,!this.variableStyles||i===-1)return null;const r=this.variableStyles.findIndex(s=>s.variableId===i);return r<0?null:this.variableStyles.getItemAt(r)}getVariable(e){let i=-1;if(i=D(e)?e:this.currentVariableId,!this.variables||i===-1)return null;const r=this.variables.findIndex(s=>s.id===i);return r<0?null:this.variables.getItemAt(r)}getVolume(e){const i=this.getVariable(e);return D(i)?this.volumes.find(({id:r})=>r===i.volumeId):null}getVolumeStyle(e){const i=this.getVariable(e);return D(i)?this.volumeStyles.find(({volumeId:r})=>r===i.volumeId):null}getColorForContinuousDataValue(e,i,r){const s=this.getVariable(e);if(!D(s)||s.renderingFormat.continuity!=="continuous"||!this.variableStyles)return null;const n=this.variableStyles.findIndex(a=>a.variableId===e);if(n<0)return null;const l=this.variableStyles.getItemAt(n);return l.transferFunction?l.transferFunction.getColorForContinuousDataValue(i,r):null}getSections(){const e=[];for(const i of this.sections)e.push(new ne({enabled:i.enabled,href:i.href,id:i.id,label:i.label,normal:i.normal,point:i.point,sizeInPixel:i.sizeInPixel,slices:i.slices,timeId:i.timeId,variableId:i.variableId}));return e}getVariableStyles(){const e=[];for(const i of this.variableStyles){const r=this._getVariable(i);if(D(r)){const s=i.clone();s.isosurfaces.length>4&&(s.isosurfaces=s.isosurfaces.slice(0,3),M.error("A maximum of 4 isosurfaces are supported for Voxel Layers."));for(const n of s.isosurfaces)if(n.colorLocked){const l=this.getColorForContinuousDataValue(s.variableId,n.value,!1);l===null||l.equals(n.color)||(n.color=l)}if(r.renderingFormat.continuity==="continuous")(s.transferFunction===null||s.transferFunction.colorStops.length<2)&&M.error(`VoxelVariableStyle for variable ${r.id} is invalid. At least 2 color stops are required in the transferFunction for continuous Voxel Layer variables.`),s.transferFunction!==null&&(Array.isArray(s.transferFunction.stretchRange)&&s.transferFunction.stretchRange.length===2||(M.error(`VoxelVariableStyle for variable ${r.id} is invalid. The stretchRange of the transferFunction for continuous Voxel Layer variables must be of the form [minimumDataValue, maximumDataValue].`),s.transferFunction.stretchRange=[0,1],s.transferFunction.colorStops.removeAll()));else if(r.renderingFormat.continuity==="discrete")if(i.uniqueValues.length===0)M.error(`VoxelVariableStyle for variable ${r.id} is invalid. Unique values are required for discrete Voxel Layer variables.`);else for(const n of i.uniqueValues)n.label!==null&&n.label!==void 0||n.value===null||n.value===void 0||(n.label=n.value.toString());e.push(s)}else M.error(`VoxelVariable ID=${i.variableId} doesn't exist, VoxelVariableStyle for this VoxelVariable will be ignored.`)}return e}getVolumeStyles(){const e=[];for(const i of this.volumeStyles){const r=this._getVolumeFromVolumeId(i.volumeId);if(D(r)){const s=i.clone();for(const n of s.slices)this._isPlaneValid(n,[0,1,r.zDimension],r.dimensions)||(n.enabled=!1,n.label="invalid");for(const n of s.dynamicSections)this._isPlaneValid(n,[0,1,r.zDimension],r.dimensions)||(n.enabled=!1,n.label="invalid");e.push(s)}else M.error(`VoxelVolume ID=${i.volumeId} doesn't exist, VoxelVolumeStyle for this VoxelVolume will be ignored.`)}return e}_getVariable(e){const i=e.variableId;for(const r of this.variables)if(r.id===i)return r;return null}_getVolumeFromVolumeId(e){for(const i of this.volumes)if(i.id===e)return i;return null}_isPlaneValid(e,i,r){if(!e.point||!Array.isArray(e.point)||e.point.length!==3||!e.normal||!Array.isArray(e.normal)||e.normal.length!==3)return!1;for(let l=0;l<3;++l){const a=e.point[l];if(a<0||a>=r[i[l]].size)return!1}const s=ze(e.normal[0],e.normal[1],e.normal[2]);de(s,s);const n=1e-6;return!(Math.abs(s[0])+Math.abs(s[1])+Math.abs(s[2]){await this.load();const{extent:t}=await this._connection.invoke("refresh",e);return t&&(this.sourceJSON.extent=t),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}})}load(e){const t=x(e)?e.signal:null;return this.addResolvingPromise(this._startWorker({signal:t})),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);const o=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return E.fromJSON(o)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._connection.invoke("queryFeatures",e?e.toJSON():null,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t)}async queryObjectIds(e,t={}){return await this.load(t),this._connection.invoke("queryObjectIds",e?e.toJSON():null,t)}async queryExtent(e,t={}){await this.load(t);const o=await this._connection.invoke("queryExtent",e?e.toJSON():null,t);return{count:o.count,extent:j.fromJSON(o.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke("querySnapping",e,t)}async _createLoadOptions(e){var F,O;const{url:t,customParameters:o,name:n,namespaceUri:l,spatialReference:a,fields:u,geometryType:m,swapXY:h}=this.layer;if(!t)throw new U("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await we(t,{customParameters:o,...e}));const f=["fields","geometryType","name","namespaceUri","spatialReference","swapXY"].some(w=>this.layer[w]==null),p=f?await ve(this.wfsCapabilities,n,l,{spatialReference:a,customParameters:o,signal:e==null?void 0:e.signal}):{...Fe(u!=null?u:[]),geometryType:m,name:n,namespaceUri:l,spatialReference:a,swapXY:h},g=N(Oe(this.wfsCapabilities.readFeatureTypes(),p.name,p.namespaceUri)),P=c.toJSON(p.geometryType);return{customParameters:o,featureType:g,fields:(O=(F=p.fields)==null?void 0:F.map(w=>w.toJSON()))!=null?O:[],geometryField:p.geometryField,geometryType:P,getFeatureUrl:this.wfsCapabilities.operations.GetFeature.url,getFeatureOutputFormat:this.wfsCapabilities.operations.GetFeature.outputFormat,objectIdField:p.objectIdField,spatialReference:p.spatialReference.toJSON(),swapXY:!!p.swapXY}}async _startWorker(e){const[t,o]=await _([this._createLoadOptions(e),J("WFSSourceWorker",{...e,strategy:k("feature-layers-workers")?"dedicated":"local"})]),n=t.error||o.error||null,l=o.value||null;if(n)throw l&&l.close(),n;const a=t.value;this._connection=o.value;const{extent:u}=await this._connection.invoke("load",a,e);this.sourceJSON={extent:u,fields:a.fields,geometryType:a.geometryType,objectIdField:a.objectIdField,geometryField:a.geometryField,drawingInfo:ge(a.geometryType),name:a.featureType.title,wfsInfo:{name:a.featureType.name,featureUrl:a.getFeatureUrl,maxFeatures:3e3,swapXY:a.swapXY,supportedSpatialReferences:a.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:a.featureType.namespaceUri}}}};i([r()],d.prototype,"capabilities",void 0),i([r({constructOnly:!0})],d.prototype,"layer",void 0),i([r()],d.prototype,"sourceJSON",void 0),i([r()],d.prototype,"type",void 0),i([r()],d.prototype,"wfsCapabilities",void 0),d=i([T("esri.layers.graphics.sources.WFSSource")],d);var v;const I=me();let s=v=class extends X(D(Y(L(Q(G(V(z(M(B(K(he))))))))))){constructor(e){super(e),this.copyright=null,this.customParameters=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxFeatures=3e3,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=R.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}static fromWFSLayerInfo(e){const{customParameters:t,fields:o,geometryField:n,geometryType:l,name:a,namespaceUri:u,objectIdField:m,spatialReference:h,swapXY:f,url:p,wfsCapabilities:g}=e;return new v({customParameters:t,fields:o,geometryField:n,geometryType:l,name:a,namespaceUri:u,objectIdField:m,spatialReference:h,swapXY:f,url:p,wfsCapabilities:g})}destroy(){var e;(e=this.source)==null||e.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),b(this.renderer,this.fieldsIndex),H(this.timeInfo,this.fieldsIndex)})),Promise.resolve(this)}get capabilities(){var e;return(e=this.source)==null?void 0:e.capabilities}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,t,o){const n=e.filter(l=>l.name!==be);this.geometryField&&n.unshift(new q({name:this.geometryField,alias:this.geometryField,type:"geometry"})),A(o,n.map(l=>l.toJSON()),t)}get parsedUrl(){return Z(this.url)}set renderer(e){b(e,this.fieldsIndex),this._set("renderer",e)}get wfsCapabilities(){var e;return(e=this.source)==null?void 0:e.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return ee(this,e)}createQuery(){const e=new y;e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:t,timeExtent:o}=this;return e.timeExtent=t!=null&&o!=null?o.offset(-t.value,t.unit):o||null,e}getFieldDomain(e,t){var o;return(o=this.getField(e))==null?void 0:o.domain}getField(e){var t;return(t=this.fieldsIndex)==null?void 0:t.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(y.from(e)||this.createQuery(),t)).then(o=>{if(o!=null&&o.features)for(const n of o.features)n.layer=n.sourceLayer=this;return o})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(y.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(y.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(y.from(e)||this.createQuery(),t))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return x(t)&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};i([r({readOnly:!0})],s.prototype,"capabilities",null),i([r({type:String})],s.prototype,"copyright",void 0),i([r({readOnly:!0})],s.prototype,"createQueryVersion",null),i([r({json:{name:"wfsInfo.customParameters",write:{ignoreOrigin:!0}}})],s.prototype,"customParameters",void 0),i([r({readOnly:!0})],s.prototype,"defaultPopupTemplate",null),i([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],s.prototype,"definitionExpression",void 0),i([r({type:String})],s.prototype,"displayField",void 0),i([r(te)],s.prototype,"elevationInfo",void 0),i([r({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"featureUrl",void 0),i([r({type:[q],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],s.prototype,"fields",void 0),i([ie("fields")],s.prototype,"writeFields",null),i([r(I.fieldsIndex)],s.prototype,"fieldsIndex",void 0),i([r({type:j,json:{name:"extent"}})],s.prototype,"fullExtent",void 0),i([r()],s.prototype,"geometryField",void 0),i([r({type:String,json:{read:{source:"layerDefinition.geometryType",reader:c.read},write:{target:"layerDefinition.geometryType",writer:c.write,ignoreOrigin:!0},origins:{service:{read:c.read}}}})],s.prototype,"geometryType",void 0),i([r({type:String})],s.prototype,"id",void 0),i([r(re)],s.prototype,"labelsVisible",void 0),i([r({type:[se],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:oe},write:!0}})],s.prototype,"labelingInfo",void 0),i([r(ae)],s.prototype,"legendEnabled",void 0),i([r({type:["show","hide"]})],s.prototype,"listMode",void 0),i([r({type:String})],s.prototype,"objectIdField",void 0),i([r({type:["WFS"]})],s.prototype,"operationalLayerType",void 0),i([r({type:S,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"maxFeatures",void 0),i([r({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],s.prototype,"mode",void 0),i([r({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"name",void 0),i([r({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"namespaceUri",void 0),i([r(ne)],s.prototype,"opacity",void 0),i([r(I.outFields)],s.prototype,"outFields",void 0),i([r({readOnly:!0})],s.prototype,"parsedUrl",null),i([r(le)],s.prototype,"popupEnabled",void 0),i([r({type:pe,json:{name:"popupInfo",write:!0}})],s.prototype,"popupTemplate",void 0),i([r({types:de,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:ue,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],s.prototype,"renderer",null),i([r(ye)],s.prototype,"screenSizePerspectiveEnabled",void 0),i([r({readOnly:!0})],s.prototype,"source",void 0),i([r({type:R,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],s.prototype,"spatialReference",void 0),i([r({readOnly:!0,type:[S],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"spatialReferences",void 0),i([r({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"swapXY",void 0),i([r({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],s.prototype,"title",void 0),i([r({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),i([r(ce)],s.prototype,"url",void 0),i([r({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"version",void 0),i([r()],s.prototype,"wfsCapabilities",null),s=v=i([T("esri.layers.WFSLayer")],s);const qe=s;export{qe as default}; +import{a4 as $,dn as C,c as x,d3 as E,cU as j,n as U,u as N,hl as c,cB as _,d6 as J,m as k,a6 as i,a7 as r,a8 as T,hT as W,iI as X,iJ as D,iK as Y,iL as L,i2 as Q,iM as G,ia as V,i3 as z,eF as M,eG as B,eH as K,aT as R,iN as b,iO as H,gG as q,hV as A,bX as Z,id as ee,dd as y,io as te,e0 as ie,iP as re,iQ as se,iR as oe,iE as ae,h0 as S,kk as ne,ig as le,dv as pe,iT as de,ie as ue,iU as ye,eK as ce,ih as me,cF as he}from"./index.221827cd.js";import{l as fe,o as ge}from"./clientSideDefaults.d40b9315.js";import{D as we,X as ve,z as Fe,W as Oe,C as be}from"./wfsUtils.6ba3d875.js";import"./QueryEngineCapabilities.78217f95.js";import"./geojson.7d18026b.js";import"./xmlUtils.56e603f6.js";let d=class extends $(W){constructor(){super(...arguments),this._connection=null,this.capabilities=fe(!1,!1),this.type="wfs",this.refresh=C(async e=>{await this.load();const{extent:t}=await this._connection.invoke("refresh",e);return t&&(this.sourceJSON.extent=t),{dataChanged:!0,updates:{extent:this.sourceJSON.extent}}})}load(e){const t=x(e)?e.signal:null;return this.addResolvingPromise(this._startWorker({signal:t})),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}async openPorts(){return await this.load(),this._connection.openPorts()}async queryFeatures(e,t={}){await this.load(t);const o=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return E.fromJSON(o)}async queryFeaturesJSON(e,t={}){return await this.load(t),this._connection.invoke("queryFeatures",e?e.toJSON():null,t)}async queryFeatureCount(e,t={}){return await this.load(t),this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t)}async queryObjectIds(e,t={}){return await this.load(t),this._connection.invoke("queryObjectIds",e?e.toJSON():null,t)}async queryExtent(e,t={}){await this.load(t);const o=await this._connection.invoke("queryExtent",e?e.toJSON():null,t);return{count:o.count,extent:j.fromJSON(o.extent)}}async querySnapping(e,t={}){return await this.load(t),this._connection.invoke("querySnapping",e,t)}async _createLoadOptions(e){var F,O;const{url:t,customParameters:o,name:n,namespaceUri:l,spatialReference:a,fields:u,geometryType:m,swapXY:h}=this.layer;if(!t)throw new U("wfs-layer:missing-url","WFSLayer must be created with a url");this.wfsCapabilities||(this.wfsCapabilities=await we(t,{customParameters:o,...e}));const f=["fields","geometryType","name","namespaceUri","spatialReference","swapXY"].some(w=>this.layer[w]==null),p=f?await ve(this.wfsCapabilities,n,l,{spatialReference:a,customParameters:o,signal:e==null?void 0:e.signal}):{...Fe(u!=null?u:[]),geometryType:m,name:n,namespaceUri:l,spatialReference:a,swapXY:h},g=N(Oe(this.wfsCapabilities.readFeatureTypes(),p.name,p.namespaceUri)),P=c.toJSON(p.geometryType);return{customParameters:o,featureType:g,fields:(O=(F=p.fields)==null?void 0:F.map(w=>w.toJSON()))!=null?O:[],geometryField:p.geometryField,geometryType:P,getFeatureUrl:this.wfsCapabilities.operations.GetFeature.url,getFeatureOutputFormat:this.wfsCapabilities.operations.GetFeature.outputFormat,objectIdField:p.objectIdField,spatialReference:p.spatialReference.toJSON(),swapXY:!!p.swapXY}}async _startWorker(e){const[t,o]=await _([this._createLoadOptions(e),J("WFSSourceWorker",{...e,strategy:k("feature-layers-workers")?"dedicated":"local"})]),n=t.error||o.error||null,l=o.value||null;if(n)throw l&&l.close(),n;const a=t.value;this._connection=o.value;const{extent:u}=await this._connection.invoke("load",a,e);this.sourceJSON={extent:u,fields:a.fields,geometryType:a.geometryType,objectIdField:a.objectIdField,geometryField:a.geometryField,drawingInfo:ge(a.geometryType),name:a.featureType.title,wfsInfo:{name:a.featureType.name,featureUrl:a.getFeatureUrl,maxFeatures:3e3,swapXY:a.swapXY,supportedSpatialReferences:a.featureType.supportedSpatialReferences,version:"2.0.0",wfsNamespace:a.featureType.namespaceUri}}}};i([r()],d.prototype,"capabilities",void 0),i([r({constructOnly:!0})],d.prototype,"layer",void 0),i([r()],d.prototype,"sourceJSON",void 0),i([r()],d.prototype,"type",void 0),i([r()],d.prototype,"wfsCapabilities",void 0),d=i([T("esri.layers.graphics.sources.WFSSource")],d);var v;const I=me();let s=v=class extends X(D(Y(L(Q(G(V(z(M(B(K(he))))))))))){constructor(e){super(e),this.copyright=null,this.customParameters=null,this.definitionExpression=null,this.displayField=null,this.elevationInfo=null,this.featureUrl=void 0,this.fields=null,this.fieldsIndex=null,this.fullExtent=null,this.geometryType=null,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.operationalLayerType="WFS",this.maxFeatures=3e3,this.mode=0,this.name=null,this.namespaceUri=null,this.outFields=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.source=new d({layer:this}),this.spatialReference=R.WGS84,this.spatialReferences=[4326],this.swapXY=void 0,this.title="WFS",this.type="wfs",this.url=null,this.version=void 0}static fromWFSLayerInfo(e){const{customParameters:t,fields:o,geometryField:n,geometryType:l,name:a,namespaceUri:u,objectIdField:m,spatialReference:h,swapXY:f,url:p,wfsCapabilities:g}=e;return new v({customParameters:t,fields:o,geometryField:n,geometryType:l,name:a,namespaceUri:u,objectIdField:m,spatialReference:h,swapXY:f,url:p,wfsCapabilities:g})}destroy(){var e;(e=this.source)==null||e.destroy()}load(e){return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WFS"]},e).then(()=>this.source.load(e)).then(()=>{this.read(this.source.sourceJSON,{origin:"service",url:this.parsedUrl}),this.revert(["objectIdField","fields","timeInfo","spatialReference","name","namespaceUri"],"service"),b(this.renderer,this.fieldsIndex),H(this.timeInfo,this.fieldsIndex)})),Promise.resolve(this)}get capabilities(){var e;return(e=this.source)==null?void 0:e.capabilities}get createQueryVersion(){return this.commitProperty("definitionExpression"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("capabilities"),(this._get("createQueryVersion")||0)+1}get defaultPopupTemplate(){return this.createPopupTemplate()}writeFields(e,t,o){const n=e.filter(l=>l.name!==be);this.geometryField&&n.unshift(new q({name:this.geometryField,alias:this.geometryField,type:"geometry"})),A(o,n.map(l=>l.toJSON()),t)}get parsedUrl(){return Z(this.url)}set renderer(e){b(e,this.fieldsIndex),this._set("renderer",e)}get wfsCapabilities(){var e;return(e=this.source)==null?void 0:e.wfsCapabilities}set wfsCapabilities(e){this.source&&(this.source.wfsCapabilities=e)}createPopupTemplate(e){return ee(this,e)}createQuery(){const e=new y;e.returnGeometry=!0,e.outFields=["*"],e.where=this.definitionExpression||"1=1";const{timeOffset:t,timeExtent:o}=this;return e.timeExtent=t!=null&&o!=null?o.offset(-t.value,t.unit):o||null,e}getFieldDomain(e,t){var o;return(o=this.getField(e))==null?void 0:o.domain}getField(e){var t;return(t=this.fieldsIndex)==null?void 0:t.get(e)}queryFeatures(e,t){return this.load().then(()=>this.source.queryFeatures(y.from(e)||this.createQuery(),t)).then(o=>{if(o!=null&&o.features)for(const n of o.features)n.layer=n.sourceLayer=this;return o})}queryObjectIds(e,t){return this.load().then(()=>this.source.queryObjectIds(y.from(e)||this.createQuery(),t))}queryFeatureCount(e,t){return this.load().then(()=>this.source.queryFeatureCount(y.from(e)||this.createQuery(),t))}queryExtent(e,t){return this.load().then(()=>this.source.queryExtent(y.from(e)||this.createQuery(),t))}async hasDataChanged(){try{const{dataChanged:e,updates:t}=await this.source.refresh(this.customParameters);return x(t)&&this.read(t,{origin:"service",url:this.parsedUrl,ignoreDefaults:!0}),e}catch{}return!1}};i([r({readOnly:!0})],s.prototype,"capabilities",null),i([r({type:String})],s.prototype,"copyright",void 0),i([r({readOnly:!0})],s.prototype,"createQueryVersion",null),i([r({json:{name:"wfsInfo.customParameters",write:{ignoreOrigin:!0}}})],s.prototype,"customParameters",void 0),i([r({readOnly:!0})],s.prototype,"defaultPopupTemplate",null),i([r({type:String,json:{name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],s.prototype,"definitionExpression",void 0),i([r({type:String})],s.prototype,"displayField",void 0),i([r(te)],s.prototype,"elevationInfo",void 0),i([r({type:String,readOnly:!0,json:{name:"wfsInfo.featureUrl",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"featureUrl",void 0),i([r({type:[q],json:{name:"layerDefinition.fields",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"fields"}}}})],s.prototype,"fields",void 0),i([ie("fields")],s.prototype,"writeFields",null),i([r(I.fieldsIndex)],s.prototype,"fieldsIndex",void 0),i([r({type:j,json:{name:"extent"}})],s.prototype,"fullExtent",void 0),i([r()],s.prototype,"geometryField",void 0),i([r({type:String,json:{read:{source:"layerDefinition.geometryType",reader:c.read},write:{target:"layerDefinition.geometryType",writer:c.write,ignoreOrigin:!0},origins:{service:{read:c.read}}}})],s.prototype,"geometryType",void 0),i([r({type:String})],s.prototype,"id",void 0),i([r(re)],s.prototype,"labelsVisible",void 0),i([r({type:[se],json:{name:"layerDefinition.drawingInfo.labelingInfo",read:{reader:oe},write:!0}})],s.prototype,"labelingInfo",void 0),i([r(ae)],s.prototype,"legendEnabled",void 0),i([r({type:["show","hide"]})],s.prototype,"listMode",void 0),i([r({type:String})],s.prototype,"objectIdField",void 0),i([r({type:["WFS"]})],s.prototype,"operationalLayerType",void 0),i([r({type:S,json:{name:"wfsInfo.maxFeatures",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"maxFeatures",void 0),i([r({type:[0],readOnly:!0,json:{origins:{"web-map":{write:{ignoreOrigin:!0,isRequired:!0}}}}})],s.prototype,"mode",void 0),i([r({type:String,json:{name:"wfsInfo.name",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"name",void 0),i([r({type:String,json:{name:"wfsInfo.wfsNamespace",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"namespaceUri",void 0),i([r(ne)],s.prototype,"opacity",void 0),i([r(I.outFields)],s.prototype,"outFields",void 0),i([r({readOnly:!0})],s.prototype,"parsedUrl",null),i([r(le)],s.prototype,"popupEnabled",void 0),i([r({type:pe,json:{name:"popupInfo",write:!0}})],s.prototype,"popupTemplate",void 0),i([r({types:de,json:{origins:{service:{name:"drawingInfo.renderer"},"web-scene":{types:ue,name:"layerDefinition.drawingInfo.renderer",write:!0}},name:"layerDefinition.drawingInfo.renderer",write:{ignoreOrigin:!0}}})],s.prototype,"renderer",null),i([r(ye)],s.prototype,"screenSizePerspectiveEnabled",void 0),i([r({readOnly:!0})],s.prototype,"source",void 0),i([r({type:R,json:{name:"layerDefinition.spatialReference",write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"extent.spatialReference"}}}})],s.prototype,"spatialReference",void 0),i([r({readOnly:!0,type:[S],json:{name:"wfsInfo.supportedSpatialReferences",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"spatialReferences",void 0),i([r({type:Boolean,value:!1,json:{name:"wfsInfo.swapXY",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"swapXY",void 0),i([r({json:{write:{ignoreOrigin:!0,isRequired:!0},origins:{service:{name:"name"}}}})],s.prototype,"title",void 0),i([r({json:{read:!1},readOnly:!0})],s.prototype,"type",void 0),i([r(ce)],s.prototype,"url",void 0),i([r({type:String,readOnly:!0,json:{name:"wfsInfo.version",write:{ignoreOrigin:!0,isRequired:!0}}})],s.prototype,"version",void 0),i([r()],s.prototype,"wfsCapabilities",null),s=v=i([T("esri.layers.WFSLayer")],s);const qe=s;export{qe as default}; diff --git a/assets/WFSSourceWorker.bb34a8ad.js b/assets/WFSSourceWorker.b32c1de1.js similarity index 80% rename from assets/WFSSourceWorker.bb34a8ad.js rename to assets/WFSSourceWorker.b32c1de1.js index 2d7b058..0044563 100644 --- a/assets/WFSSourceWorker.bb34a8ad.js +++ b/assets/WFSSourceWorker.b32c1de1.js @@ -1 +1 @@ -import{v as h,bK as l,e_ as u,c as _,bP as g,c8 as f,ci as d,u as w,n as p,av as E,x as q,s as F}from"./index.d94abe07.js";import{u as S}from"./FeatureStore.27890cc9.js";import{g as x,f as T}from"./projectionSupport.0542c13b.js";import{Y as b}from"./QueryEngine.5a5ece4a.js";import{T as j,I}from"./geojson.8a0cb9d1.js";import{m as C}from"./sourceUtils.61cd5549.js";import{K as P}from"./wfsUtils.f8061e44.js";import"./PooledRBush.04520070.js";import"./centroid.cc817cc5.js";import"./json.879c9adc.js";import"./QueryEngineResult.7611d68a.js";import"./quantizationUtils.0d428d19.js";import"./WhereClause.253310fe.js";import"./utils.8c53cad2.js";import"./generateRendererUtils.ebdde5b7.js";import"./utils.399e6089.js";import"./QueryEngineCapabilities.78217f95.js";import"./timeSupport.668a2439.js";import"./xmlUtils.56e603f6.js";class J{constructor(){this._queryEngine=null,this._customParameters=null,this._snapshotFeatures=async e=>{var i;const{objectIdField:t}=this._queryEngine,s=await P((i=this._getFeatureUrl)!=null?i:"",this._featureType.typeName,this._getFeatureOutputFormat,{customParameters:this._customParameters,dateFields:this._queryEngine.fieldsIndex.dateFields.map(r=>r.name),signal:e});await j(s),h(e);const a=I(s,{geometryType:this._queryEngine.geometryType,hasZ:!1,objectIdField:t});if(!l(this._queryEngine.spatialReference,u))for(const r of a)_(r.geometry)&&(r.geometry=g(x(f(r.geometry,this._queryEngine.geometryType,!1,!1),u,this._queryEngine.spatialReference)));let n=1;for(const r of a){const o={};C(this._fieldsIndex,o,r.attributes,!0),r.attributes=o,r.attributes[t]==null&&(r.objectId=r.attributes[t]=n++)}return a}}destroy(){var e;(e=this._queryEngine)==null||e.destroy(),this._queryEngine=null}async load(e,t){const{getFeatureUrl:s,getFeatureOutputFormat:a,spatialReference:n,fields:i,geometryType:r,featureType:o,objectIdField:y,customParameters:m}=e;this._featureType=o,this._customParameters=m,this._getFeatureUrl=s,this._getFeatureOutputFormat=a,this._fieldsIndex=new d(i),await this._checkProjection(n),h(t),this._queryEngine=new b({fields:i,geometryType:r,hasM:!1,hasZ:!1,objectIdField:y,spatialReference:n,timeInfo:null,featureStore:new S({geometryType:r,hasM:!1,hasZ:!1})});const c=await this._snapshotFeatures(w(t.signal));return this._queryEngine.featureStore.addMany(c),{extent:this._queryEngine.fullExtent}}async applyEdits(){throw new p("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){var t;return this._customParameters=e,(t=this._snapshotTask)==null||t.abort(),this._snapshotTask=E(this._snapshotFeatures),this._snapshotTask.promise.then(s=>{this._queryEngine.featureStore.clear(),s&&this._queryEngine.featureStore.addMany(s)},s=>{this._queryEngine.featureStore.clear(),q(s)||F.getLogger("esri.layers.WFSLayer").error(new p("wfs-layer:getfeature-error","An error occurred during the GetFeature request",{error:s}))}),await this._waitSnapshotComplete(),{extent:this._queryEngine.fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _checkProjection(e){try{await T(u,e)}catch{throw new p("unsupported-projection","Projection not supported",{spatialReference:e})}}}export{J as default}; +import{v as h,bK as l,e_ as u,c as _,bP as g,c8 as f,ci as d,u as w,n as p,av as E,x as q,s as F}from"./index.221827cd.js";import{u as S}from"./FeatureStore.99d80f36.js";import{g as x,f as T}from"./projectionSupport.4f5da4af.js";import{Y as b}from"./QueryEngine.ac81c46d.js";import{T as j,I}from"./geojson.7d18026b.js";import{m as C}from"./sourceUtils.ed369a2c.js";import{K as P}from"./wfsUtils.6ba3d875.js";import"./PooledRBush.e6a31ee9.js";import"./centroid.06db4b74.js";import"./json.879c9adc.js";import"./QueryEngineResult.2fc58178.js";import"./quantizationUtils.7ff797cc.js";import"./WhereClause.5b749615.js";import"./utils.83e0b804.js";import"./generateRendererUtils.5c972fdb.js";import"./utils.e42485ea.js";import"./QueryEngineCapabilities.78217f95.js";import"./timeSupport.968e62fc.js";import"./xmlUtils.56e603f6.js";class J{constructor(){this._queryEngine=null,this._customParameters=null,this._snapshotFeatures=async e=>{var i;const{objectIdField:t}=this._queryEngine,s=await P((i=this._getFeatureUrl)!=null?i:"",this._featureType.typeName,this._getFeatureOutputFormat,{customParameters:this._customParameters,dateFields:this._queryEngine.fieldsIndex.dateFields.map(r=>r.name),signal:e});await j(s),h(e);const a=I(s,{geometryType:this._queryEngine.geometryType,hasZ:!1,objectIdField:t});if(!l(this._queryEngine.spatialReference,u))for(const r of a)_(r.geometry)&&(r.geometry=g(x(f(r.geometry,this._queryEngine.geometryType,!1,!1),u,this._queryEngine.spatialReference)));let n=1;for(const r of a){const o={};C(this._fieldsIndex,o,r.attributes,!0),r.attributes=o,r.attributes[t]==null&&(r.objectId=r.attributes[t]=n++)}return a}}destroy(){var e;(e=this._queryEngine)==null||e.destroy(),this._queryEngine=null}async load(e,t){const{getFeatureUrl:s,getFeatureOutputFormat:a,spatialReference:n,fields:i,geometryType:r,featureType:o,objectIdField:y,customParameters:m}=e;this._featureType=o,this._customParameters=m,this._getFeatureUrl=s,this._getFeatureOutputFormat=a,this._fieldsIndex=new d(i),await this._checkProjection(n),h(t),this._queryEngine=new b({fields:i,geometryType:r,hasM:!1,hasZ:!1,objectIdField:y,spatialReference:n,timeInfo:null,featureStore:new S({geometryType:r,hasM:!1,hasZ:!1})});const c=await this._snapshotFeatures(w(t.signal));return this._queryEngine.featureStore.addMany(c),{extent:this._queryEngine.fullExtent}}async applyEdits(){throw new p("wfs-source:editing-not-supported","applyEdits() is not supported on WFSLayer")}async queryFeatures(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQuery(e,t.signal)}async queryFeatureCount(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForCount(e,t.signal)}async queryObjectIds(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForIds(e,t.signal)}async queryExtent(e={},t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForExtent(e,t.signal)}async querySnapping(e,t={}){return await this._waitSnapshotComplete(),this._queryEngine.executeQueryForSnapping(e,t.signal)}async refresh(e){var t;return this._customParameters=e,(t=this._snapshotTask)==null||t.abort(),this._snapshotTask=E(this._snapshotFeatures),this._snapshotTask.promise.then(s=>{this._queryEngine.featureStore.clear(),s&&this._queryEngine.featureStore.addMany(s)},s=>{this._queryEngine.featureStore.clear(),q(s)||F.getLogger("esri.layers.WFSLayer").error(new p("wfs-layer:getfeature-error","An error occurred during the GetFeature request",{error:s}))}),await this._waitSnapshotComplete(),{extent:this._queryEngine.fullExtent}}async _waitSnapshotComplete(){if(this._snapshotTask&&!this._snapshotTask.finished){try{await this._snapshotTask.promise}catch{}return this._waitSnapshotComplete()}}async _checkProjection(e){try{await T(u,e)}catch{throw new p("unsupported-projection","Projection not supported",{spatialReference:e})}}}export{J as default}; diff --git a/assets/WGLContainer.1850619d.js b/assets/WGLContainer.347cc5cd.js similarity index 99% rename from assets/WGLContainer.1850619d.js rename to assets/WGLContainer.347cc5cd.js index 7c6f1f2..7f18321 100644 --- a/assets/WGLContainer.1850619d.js +++ b/assets/WGLContainer.347cc5cd.js @@ -1,4 +1,4 @@ -import{N as _e,j as G,c as E,r as Ne,cj as Be,b1 as yt,S as De,b3 as pe,R as St,ck as Tt,b2 as bt,bd as nt,k as oe,bf as Et,ba as It,n as ae,s as ze,y as Ge,J as Ct,cl as Ot,aJ as Ye,cm as At,G as Pt,an as He,_ as Dt}from"./index.d94abe07.js";import{I as V,M as re,P as B,U as Ce,G as q,L as N,D as Q,o as Y,F as J,C as m,E as R,R as D,O as X,Y as Rt,V as Lt,B as it,_ as We,N as Mt}from"./enums.2d9e6f64.js";import{s as Nt}from"./pixelUtils.82950e1a.js";import{r as ot,p as at,s as fe,i as zt}from"./utils.4b023c9d.js";import{E as se}from"./Texture.4c97bad5.js";import{E as ee,a as le,s as rt,x as st}from"./VertexArrayObject.a4c1d809.js";import{t as ge}from"./VertexElementDescriptor.1fdca6da.js";import{ad as Oe,S as wt,B as Ft,C as Vt,ae as Ut,af as Bt,ag as Gt,ah as Yt,ai as Ht,aj as Wt,Q as Re,ak as $,al as lt,am as ke}from"./enums.0295eb81.js";import{g as ce,b as me,S as te,I as U,n as xe,e as H}from"./Utils.7f6f3a6b.js";import{e as kt,a as Ae}from"./ProgramTemplate.e9a5aa54.js";import{U as $t,w as Zt,N as qt,Z as Kt,C as jt,P as Xt}from"./MaterialKey.229b1dd6.js";import{r as de,l as Z,n as $e}from"./StyleDefinition.d56936e4.js";import{e as Ze}from"./config.82550349.js";import{M as qe}from"./GeometryUtils.51c4032a.js";import{x as Qt}from"./earcut.afc1d357.js";class W{constructor(){this.name=this.constructor.name||"UnnamedBrush",this.brushEffect=null}prepareState(e,t){}draw(e,t,n){}drawMany(e,t,n){for(const o of t)o.visible&&this.draw(e,o,n)}}class Jt extends W{constructor(){super(...arguments),this._visualState={time:0,dvsMat3:_e(),displayViewMat3:_e()}}dispose(){}prepareState(e){const{context:t}=e;t.setColorMask(!0,!0,!0,!0),t.setStencilFunction(V.EQUAL,0,255)}draw(e,t){const{requestRender:n,allowDelayedRender:o}=e,{displayData:i}=t;if(G(i)||(i.state.name==="loaded"&&i.attach(e),i.state.name!=="attached"))return;const a=i.state.resources;o&&!a.ready&&E(n)?n():(this._visualState.time=e.time/1e3,this._visualState.dvsMat3=t.transforms.dvs,this._visualState.displayViewMat3=e.state.displayViewMat3,i.flowStyle.render(e,this._visualState,a),i.flowStyle.animated&&E(n)&&n())}}function en(l,e,t="nearest",n=!1){var s;const o=!(n&&e.pixelType==="u8"),i=o?q.FLOAT:q.UNSIGNED_BYTE,a=e.pixels==null||e.pixels.length===0?null:o?e.getAsRGBAFloat():e.getAsRGBA(),r=(s=l.capabilities.textureFloat)==null?void 0:s.textureFloatLinear,c={width:e.width,height:e.height,target:re.TEXTURE_2D,pixelFormat:B.RGBA,internalFormat:l.type===Ne.WEBGL2&&o?Ce.RGBA32F:B.RGBA,samplingMode:!r||t!=="bilinear"&&t!=="cubic"?N.NEAREST:N.LINEAR,dataType:i,wrapMode:Q.CLAMP_TO_EDGE,flipped:!1};return new se(l,c,a)}function tn(l,e){const{spacing:t,offsets:n,coefficients:o,size:[i,a]}=e,r=t[0]>1,c={width:r?4*i:i,height:a,target:re.TEXTURE_2D,pixelFormat:B.RGBA,internalFormat:l.type===Ne.WEBGL2?Ce.RGBA32F:B.RGBA,dataType:q.FLOAT,samplingMode:N.NEAREST,wrapMode:Q.CLAMP_TO_EDGE,flipped:!1},s=new Float32Array(r?i*a*16:2*n.length);if(r)for(let u=0,f=0;u{const o=e.get(n)||e.get(n+"[0]");o&&un(l,n,t[n],o)})}function cn(l,e,t,n){t.length===n.length&&(n.some(o=>o==null)||t.some(o=>o==null)||t.forEach((o,i)=>{e.setUniform1i(o,i),l.bindTexture(n[i],i)}))}function un(l,e,t,n){if(n===null||t==null)return!1;const{info:o}=n;switch(o.type){case Y.FLOAT:o.size>1?l.setUniform1fv(e,t):l.setUniform1f(e,t);break;case Y.FLOAT_VEC2:l.setUniform2fv(e,t);break;case Y.FLOAT_VEC3:l.setUniform3fv(e,t);break;case Y.FLOAT_VEC4:l.setUniform4fv(e,t);break;case Y.FLOAT_MAT3:l.setUniformMatrix3fv(e,t);break;case Y.FLOAT_MAT4:l.setUniformMatrix4fv(e,t);break;case Y.INT:o.size>1?l.setUniform1iv(e,t):l.setUniform1i(e,t);break;case Y.BOOL:l.setUniform1i(e,t?1:0);break;case Y.INT_VEC2:case Y.BOOL_VEC2:l.setUniform2iv(e,t);break;case Y.INT_VEC3:case Y.BOOL_VEC3:l.setUniform3iv(e,t);break;case Y.INT_VEC4:case Y.BOOL_VEC4:l.setUniform4iv(e,t);break;default:return!1}return!0}const fn={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class xi extends ot{constructor(e=null,t=null,n=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._supportsBilinearTexture=!0,this.stencilRef=0,this.coordScale=[1,1],this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=e,this.transformGrid=t,this.interpolation=n}destroy(){var e;(e=this.getTextures())==null||e.textures.forEach(t=>t.dispose()),this._rasterTexture=null,this._transformGridTexture=null,this._colormapTexture=null}get symbolizerParameters(){return this._symbolizerParameters||fn}set symbolizerParameters(e){this._symbolizerParameters!==e&&(this._symbolizerParameters=e,this._colormapTextureInvalidated=!0)}get source(){return this._source}set source(e){this._source!==e&&(this._source=e,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this.invalidateTexture())}get suspended(){return this._suspended}set suspended(e){this._suspended&&!e&&this.stage&&(this.ready(),this.requestRender()),this._suspended=e}get bandIds(){return this._bandIds}set bandIds(e){this._bandIds=e,this._isBandIdschanged(e)&&this.invalidateTexture()}get interpolation(){return this._interpolation||"nearest"}set interpolation(e){this._interpolation=e,this._rasterTexture&&this._rasterTexture.setSamplingMode(this._getTextureSamplingMethod(e)==="bilinear"?N.LINEAR:N.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid=e,this._transformGridTexture&&(this._transformGridTexture.dispose(),this._transformGridTexture=null)}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}_createTransforms(){return{dvs:_e()}}setTransform(e){const t=yt(this.transforms.dvs),[n,o]=e.toScreenNoRotation([0,0],[this.x,this.y]),i=this.resolution/this.pixelRatio/e.resolution,a=i*this.width,r=i*this.height,c=Math.PI*this.rotation/180;De(t,t,pe(n,o)),De(t,t,pe(a/2,r/2)),St(t,t,-c),De(t,t,pe(-a/2,-r/2)),Tt(t,t,pe(a,r)),bt(this.transforms.dvs,e.displayViewMat3,t)}getTextures(){if(!this._rasterTexture)return null;const e=[],t=[];return this._transformGridTexture&&(t.push(this._transformGridTexture),e.push("u_transformGrid")),this._rasterTexture&&(t.push(this._rasterTexture),e.push("u_image")),this._colormapTexture&&(t.push(this._colormapTexture),e.push("u_colormap")),{names:e,textures:t}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:e}){var n,o,i;if(!this.stage)return(n=this._rasterTexture)==null||n.dispose(),(o=this._transformGridTexture)==null||o.dispose(),(i=this._colormapTexture)==null||i.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,void(this._colormapTexture=null);const t=this._isValidSource(this.source);t&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(e)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(e),this._rasterTexture&&(t?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=tn(e,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}_createOrDestroyRasterTexture(e){var a,r;const t=E(this.source)?Nt(this.source,this.bandIds):null;if(!this._isValidSource(t))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const n=!this._isBandIdschanged(this.bandIds);if(this._rasterTexture){if(n)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=(a=e.capabilities.textureFloat)==null?void 0:a.textureFloatLinear;const o=this._getTextureSamplingMethod(this.interpolation),i=this.isRendereredSource||!((r=e.capabilities.textureFloat)!=null&&r.textureFloat);this._rasterTexture=en(e,t,o,i),this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdschanged(e){const t=this._rasterTextureBandIds;return!(t==null&&e==null||t&&e&&t.join("")===e.join(""))}_isValidSource(e){var t;return E(e)&&((t=e.pixels)==null?void 0:t.length)>0}_getTextureSamplingMethod(e){const{type:t,colormap:n}=this.symbolizerParameters,o=t==="lut"||t==="stretch"&&E(n);return!this._supportsBilinearTexture||o||e!=="bilinear"&&e!=="cubic"?"nearest":"bilinear"}_updateColormapTexture(e){const t=this._colormap,n=this.symbolizerParameters.colormap;return n?t?n.length!==t.length||n.some((o,i)=>o!==t[i])?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=Ke(e,n),void(this._colormap=n)):void 0:(this._colormapTexture=Ke(e,n),void(this._colormap=n)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}}function _n(l){return E(l.source)}class we{constructor(e,t){this._rctx=e,this._vertexBuffer=ee.createVertex(e,J.STATIC_DRAW,new Uint16Array(t)),this._vao=new le(e,new Map([["a_position",0]]),{geometry:[new ge("a_position",2,m.SHORT,0,4)]},{geometry:this._vertexBuffer}),this._count=t.length/2}bind(){this._rctx.bindVAO(this._vao)}unbind(){this._rctx.bindVAO(null)}dispose(){this._vao.dispose(!1),this._vertexBuffer.dispose()}draw(){this._rctx.bindVAO(this._vao),this._rctx.drawArrays(R.TRIANGLE_STRIP,0,this._count)}}class dn extends W{constructor(){super(...arguments),this._desc={lut:{vsPath:"raster/lut",fsPath:"raster/lut",attributes:new Map([["a_position",0],["a_texcoord",1]])},stretch:{vsPath:"raster/stretch",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])},hillshade:{vsPath:"raster/hillshade",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])}},this._rendererUniformInfos=new Map}dispose(){this._quad&&this._quad.dispose()}prepareState({context:e}){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(D.ONE,D.ONE_MINUS_SRC_ALPHA,D.ONE,D.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0)}draw(e,t){var s;if(!_n(t)||t.suspended)return;const{timeline:n,context:o,painter:i}=e;n.begin(this.name),o.setStencilFunction(V.EQUAL,t.stencilRef,255);const a=!((s=o.capabilities.textureFloat)!=null&&s.textureFloatLinear);t.updateTexture(e);const r=this._getShaderVariations(t,a),c=i.materialManager.getProgram(this._desc[t.symbolizerParameters.type],r);this._drawWithProgram(e,c,t),n.end(this.name)}_drawWithProgram({context:e,requestRender:t,allowDelayedRender:n},o,i,a=1,r=[0,0],c=!1){if(this._quad||(this._quad=new we(e,[0,0,1,0,0,1,1,1])),n&&E(t)&&!o.isCompiled)return void t();const{symbolizerParameters:s,transformGrid:u,width:f,height:_,opacity:v}=i,g=s.type;e.useProgram(o);const p=this._getShaderVariations(i),d=this._getUniformInfos(g,e,o,p),{names:I,textures:h}=i.getTextures();cn(e,o,I,h);const O=an(a,r),P=nn(u,[f,_],[i.source.width,i.source.height],v,c);if(Se(o,d,{u_coordScale:i.coordScale,u_dvsMat3:i.transforms.dvs,...O,...P}),s.colormap){const{colormap:S,colormapOffset:y}=s,x=on(S,y);Se(o,d,x)}if(s.type==="stretch"){const S=rn(s);Se(o,d,S)}else if(s.type==="hillshade"){const S=sn(s);Se(o,d,S)}this._quad.draw()}_getUniformInfos(e,t,n,o){const i=o.length>0?e+"-"+o.join("-"):e;if(this._rendererUniformInfos.has(i))return this._rendererUniformInfos.get(i);const a=ln(t,n);return this._rendererUniformInfos.set(i,a),a}_getShaderVariations(e,t=!1){const n=[],{interpolation:o}=e,{type:i,colormap:a}=e.symbolizerParameters;return o==="cubic"?n.push("bicubic"):o==="bilinear"&&i==="stretch"&&a!=null?(n.push("bilinear"),n.push("nnedge")):t&&o==="bilinear"&&n.push("bilinear"),e.isRendereredSource?n.push("noop"):a&&n.push("applyColormap"),e.transformGrid&&(n.push("applyProjection"),e.transformGrid.spacing[0]===1&&n.push("lookupProjection")),n}}const Te=new Float32Array([.27058823529411763,.4588235294117647,.7098039215686275,1,.396078431372549,.5372549019607843,.7215686274509804,1,.5176470588235295,.6196078431372549,.7294117647058823,1,.6352941176470588,.7058823529411765,.7411764705882353,1,.7529411764705882,.8,.7450980392156863,1,.8705882352941177,.8901960784313725,.7490196078431373,1,1,1,.7490196078431373,1,1,.8627450980392157,.6313725490196078,1,.9803921568627451,.7254901960784313,.5176470588235295,1,.9607843137254902,.596078431372549,.4117647058823529,1,.9294117647058824,.4588235294117647,.3176470588235294,1,.9098039215686274,.08235294117647059,.08235294117647059,1]),je={beaufort_ft:Te,beaufort_m:Te,beaufort_km:Te,beaufort_mi:Te,beaufort_kn:new Float32Array([.1568627450980392,.5725490196078431,.7803921568627451,1,.34901960784313724,.6352941176470588,.7294117647058823,1,.5058823529411764,.7019607843137254,.6705882352941176,1,.6274509803921569,.7607843137254902,.6078431372549019,1,.7490196078431373,.8313725490196079,.5411764705882353,1,.8549019607843137,.9019607843137255,.4666666666666667,1,.9803921568627451,.9803921568627451,.39215686274509803,1,.9882352941176471,.8352941176470589,.3254901960784314,1,.9882352941176471,.7019607843137254,.4,1,.9803921568627451,.5529411764705883,.20392156862745098,1,.9686274509803922,.43137254901960786,.16470588235294117,1,.9411764705882353,.2784313725490196,.11372549019607843,1]),classified_arrow:new Float32Array([.2196078431372549,.6588235294117647,0,1,.5450980392156862,1.2117647058823529,0,1,1,1,0,1,1,.5019607843137255,0,1,1,0,0,1]),ocean_current_m:new Float32Array([.3058823529411765,.10196078431372549,.6,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),ocean_current_kn:new Float32Array([0,0,0,1,0,.1450980392156863,.39215686274509803,1,.3058823529411765,.10196078431372549,.6,1,.592156862745098,0,.39215686274509803,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.6941176470588235,.3058823529411765,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.7019607843137254,.20392156862745098,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),single_arrow:new Float32Array([0,92/255,230/255,1]),wind_speed:new Float32Array([0,0,0,1])};class mn extends W{constructor(){super(...arguments),this._desc={magdir:{vsPath:"raster/magdir",fsPath:"raster/magdir",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])},scalar:{vsPath:"raster/scalar",fsPath:"raster/scalar",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])}}}dispose(){}prepareState({context:e}){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(D.ONE,D.ONE_MINUS_SRC_ALPHA,D.ONE,D.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0),e.setStencilOp(X.KEEP,X.KEEP,X.REPLACE)}draw(e,t){if(G(t.source)||t.source.validPixelCount===0)return;const{context:n,timeline:o}=e;if(o.begin(this.name),n.setStencilFunction(V.EQUAL,t.stencilRef,255),t.updateVectorFieldVAO(e),e.renderPass==="scalar"){const i=t.vaoData.scalar;i&&this._drawScalars(e,t,i.vao,i.elementCount)}else{const i=t.vaoData.magdir;i&&this._drawTriangles(e,t,i.vao,i.elementCount)}o.end(this.name)}_drawTriangles(e,t,n,o){const{context:i,painter:a,requestRender:r,allowDelayedRender:c}=e,{symbolizerParameters:s}=t,u=s.dataRange?["dataRange"]:[];s.rotationType==="geographic"&&u.push("rotationGeographic");const f=a.materialManager.getProgram(this._desc.magdir,u);if(c&&E(r)&&!f.isCompiled)return void r();i.useProgram(f);const{coordScale:_,opacity:v,transforms:g}=t;f.setUniform2fv("u_coordScale",_),f.setUniform1f("u_opacity",v),f.setUniformMatrix3fv("u_dvsMat3",g.dvs);const{style:p,dataRange:d,rotation:I,symbolPercentRange:h}=s;f.setUniform4fv("u_colors",je[p]||je.single_arrow),f.setUniform2fv("u_dataRange",d),f.setUniform1f("u_rotation",I),f.setUniform2fv("u_symbolPercentRange",h);const O=this._getSymbolSize(e,t);f.setUniform2fv("u_symbolSize",O),i.bindVAO(n),i.drawElements(R.TRIANGLES,o,m.UNSIGNED_INT,0)}_drawScalars(e,t,n,o){const{context:i,painter:a,requestRender:r,allowDelayedRender:c}=e,{symbolizerParameters:s}=t,u=[];s.style==="wind_speed"?u.push("innerCircle"):s.dataRange&&u.push("dataRange"),s.rotationType==="geographic"&&u.push("rotationGeographic");const f=a.materialManager.getProgram(this._desc.scalar,u);if(c&&E(r)&&!f.isCompiled)return void r();i.useProgram(f);const{coordScale:_,opacity:v,transforms:g}=t;f.setUniform2fv("u_coordScale",_),f.setUniform1f("u_opacity",v),f.setUniformMatrix3fv("u_dvsMat3",g.dvs);const{dataRange:p,symbolPercentRange:d}=s;f.setUniform2fv("u_dataRange",p),f.setUniform2fv("u_symbolPercentRange",d);const I=this._getSymbolSize(e,t);f.setUniform2fv("u_symbolSize",I),i.bindVAO(n),i.drawElements(R.TRIANGLES,o,m.UNSIGNED_INT,0)}_getSymbolSize(e,t){const n=t.key?2**(e.displayLevel-t.key.level):t.resolution/e.state.resolution,{symbolTileSize:o}=t.symbolizerParameters;return[o/(Math.round((t.width-t.offset[0])/o)*o)/n,o/(Math.round((t.height-t.offset[1])/o)*o)/n]}}const Le={nearest:{defines:[],samplingMode:N.NEAREST,mips:!1},bilinear:{defines:[],samplingMode:N.LINEAR,mips:!1},bicubic:{defines:["bicubic"],samplingMode:N.LINEAR,mips:!1},trilinear:{defines:[],samplingMode:N.LINEAR_MIPMAP_LINEAR,mips:!0}},vn=(l,e,t)=>{if(t.samplingMode==="dynamic"){const{state:n}=l,o=e.resolution/e.pixelRatio/n.resolution,i=Math.round(l.pixelRatio)!==l.pixelRatio,a=o>1.05||o<.95;return n.rotation||a||i||e.isSourceScaled||e.rotation?Le.bilinear:Le.nearest}return Le[t.samplingMode]};class pn extends W{constructor(){super(...arguments),this._desc={vsPath:"raster/bitmap",fsPath:"raster/bitmap",attributes:new Map([["a_pos",0]])}}dispose(){this._quad&&this._quad.dispose()}prepareState({context:e}){e.setBlendingEnabled(!0),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0)}draw(e,t){const{context:n,renderingOptions:o,painter:i,requestRender:a,allowDelayedRender:r}=e;if(!t.source||!t.isReady)return;const c=vn(e,t,o),s=i.materialManager.getProgram(this._desc,c.defines);if(r&&E(a)&&!s.isCompiled)return void a();e.timeline.begin(this.name),t.blendFunction==="additive"?n.setBlendFunctionSeparate(D.ONE,D.ONE,D.ONE,D.ONE):n.setBlendFunctionSeparate(D.ONE,D.ONE_MINUS_SRC_ALPHA,D.ONE,D.ONE_MINUS_SRC_ALPHA),n.setStencilFunction(V.EQUAL,t.stencilRef,255),this._quad||(this._quad=new we(n,[0,0,1,0,0,1,1,1]));const{coordScale:u,computedOpacity:f,transforms:_}=t;t.setSamplingProfile(c),t.bind(e.context,Oe),n.useProgram(s),s.setUniformMatrix3fv("u_dvsMat3",_.dvs),s.setUniform1i("u_texture",Oe),s.setUniform2fv("u_coordScale",u),s.setUniform1f("u_opacity",f),this._quad.draw(),e.timeline.end(this.name)}}function ct(){return new Float32Array(4)}function gn(l){const e=new Float32Array(4);return e[0]=l[0],e[1]=l[1],e[2]=l[2],e[3]=l[3],e}function K(l,e,t,n){const o=new Float32Array(4);return o[0]=l,o[1]=e,o[2]=t,o[3]=n,o}function hn(l,e){return new Float32Array(l,e,4)}function ut(){return ct()}function ft(){return K(1,1,1,1)}function _t(){return K(1,0,0,0)}function dt(){return K(0,1,0,0)}function mt(){return K(0,0,1,0)}function vt(){return K(0,0,0,1)}const xn=ut(),yn=ft(),Sn=_t(),Tn=dt(),bn=mt(),En=vt();Object.freeze(Object.defineProperty({__proto__:null,create:ct,clone:gn,fromValues:K,createView:hn,zeros:ut,ones:ft,unitX:_t,unitY:dt,unitZ:mt,unitW:vt,ZEROS:xn,ONES:yn,UNIT_X:Sn,UNIT_Y:Tn,UNIT_Z:bn,UNIT_W:En},Symbol.toStringTag,{value:"Module"}));const In={background:{"background.frag":`uniform lowp vec4 u_color; +import{N as _e,j as G,c as E,r as Ne,cj as Be,b1 as yt,S as De,b3 as pe,R as St,ck as Tt,b2 as bt,bd as nt,k as oe,bf as Et,ba as It,n as ae,s as ze,y as Ge,J as Ct,cl as Ot,aJ as Ye,cm as At,G as Pt,an as He,_ as Dt}from"./index.221827cd.js";import{I as V,M as re,P as B,U as Ce,G as q,L as N,D as Q,o as Y,F as J,C as m,E as R,R as D,O as X,Y as Rt,V as Lt,B as it,_ as We,N as Mt}from"./enums.2d9e6f64.js";import{s as Nt}from"./pixelUtils.9c6f8dae.js";import{r as ot,p as at,s as fe,i as zt}from"./utils.0160becb.js";import{E as se}from"./Texture.940076b2.js";import{E as ee,a as le,s as rt,x as st}from"./VertexArrayObject.53cf1857.js";import{t as ge}from"./VertexElementDescriptor.1fdca6da.js";import{ad as Oe,S as wt,B as Ft,C as Vt,ae as Ut,af as Bt,ag as Gt,ah as Yt,ai as Ht,aj as Wt,Q as Re,ak as $,al as lt,am as ke}from"./enums.0295eb81.js";import{g as ce,b as me,S as te,I as U,n as xe,e as H}from"./Utils.2136650a.js";import{e as kt,a as Ae}from"./ProgramTemplate.cf9dd4e8.js";import{U as $t,w as Zt,N as qt,Z as Kt,C as jt,P as Xt}from"./MaterialKey.0cadabc1.js";import{r as de,l as Z,n as $e}from"./StyleDefinition.d56936e4.js";import{e as Ze}from"./config.82550349.js";import{M as qe}from"./GeometryUtils.51c4032a.js";import{x as Qt}from"./earcut.afc1d357.js";class W{constructor(){this.name=this.constructor.name||"UnnamedBrush",this.brushEffect=null}prepareState(e,t){}draw(e,t,n){}drawMany(e,t,n){for(const o of t)o.visible&&this.draw(e,o,n)}}class Jt extends W{constructor(){super(...arguments),this._visualState={time:0,dvsMat3:_e(),displayViewMat3:_e()}}dispose(){}prepareState(e){const{context:t}=e;t.setColorMask(!0,!0,!0,!0),t.setStencilFunction(V.EQUAL,0,255)}draw(e,t){const{requestRender:n,allowDelayedRender:o}=e,{displayData:i}=t;if(G(i)||(i.state.name==="loaded"&&i.attach(e),i.state.name!=="attached"))return;const a=i.state.resources;o&&!a.ready&&E(n)?n():(this._visualState.time=e.time/1e3,this._visualState.dvsMat3=t.transforms.dvs,this._visualState.displayViewMat3=e.state.displayViewMat3,i.flowStyle.render(e,this._visualState,a),i.flowStyle.animated&&E(n)&&n())}}function en(l,e,t="nearest",n=!1){var s;const o=!(n&&e.pixelType==="u8"),i=o?q.FLOAT:q.UNSIGNED_BYTE,a=e.pixels==null||e.pixels.length===0?null:o?e.getAsRGBAFloat():e.getAsRGBA(),r=(s=l.capabilities.textureFloat)==null?void 0:s.textureFloatLinear,c={width:e.width,height:e.height,target:re.TEXTURE_2D,pixelFormat:B.RGBA,internalFormat:l.type===Ne.WEBGL2&&o?Ce.RGBA32F:B.RGBA,samplingMode:!r||t!=="bilinear"&&t!=="cubic"?N.NEAREST:N.LINEAR,dataType:i,wrapMode:Q.CLAMP_TO_EDGE,flipped:!1};return new se(l,c,a)}function tn(l,e){const{spacing:t,offsets:n,coefficients:o,size:[i,a]}=e,r=t[0]>1,c={width:r?4*i:i,height:a,target:re.TEXTURE_2D,pixelFormat:B.RGBA,internalFormat:l.type===Ne.WEBGL2?Ce.RGBA32F:B.RGBA,dataType:q.FLOAT,samplingMode:N.NEAREST,wrapMode:Q.CLAMP_TO_EDGE,flipped:!1},s=new Float32Array(r?i*a*16:2*n.length);if(r)for(let u=0,f=0;u{const o=e.get(n)||e.get(n+"[0]");o&&un(l,n,t[n],o)})}function cn(l,e,t,n){t.length===n.length&&(n.some(o=>o==null)||t.some(o=>o==null)||t.forEach((o,i)=>{e.setUniform1i(o,i),l.bindTexture(n[i],i)}))}function un(l,e,t,n){if(n===null||t==null)return!1;const{info:o}=n;switch(o.type){case Y.FLOAT:o.size>1?l.setUniform1fv(e,t):l.setUniform1f(e,t);break;case Y.FLOAT_VEC2:l.setUniform2fv(e,t);break;case Y.FLOAT_VEC3:l.setUniform3fv(e,t);break;case Y.FLOAT_VEC4:l.setUniform4fv(e,t);break;case Y.FLOAT_MAT3:l.setUniformMatrix3fv(e,t);break;case Y.FLOAT_MAT4:l.setUniformMatrix4fv(e,t);break;case Y.INT:o.size>1?l.setUniform1iv(e,t):l.setUniform1i(e,t);break;case Y.BOOL:l.setUniform1i(e,t?1:0);break;case Y.INT_VEC2:case Y.BOOL_VEC2:l.setUniform2iv(e,t);break;case Y.INT_VEC3:case Y.BOOL_VEC3:l.setUniform3iv(e,t);break;case Y.INT_VEC4:case Y.BOOL_VEC4:l.setUniform4iv(e,t);break;default:return!1}return!0}const fn={bandCount:3,outMin:0,outMax:1,minCutOff:[0,0,0],maxCutOff:[255,255,255],factor:[1/255,1/255,1/255],useGamma:!1,gamma:[1,1,1],gammaCorrection:[1,1,1],colormap:null,colormapOffset:null,stretchType:"none",type:"stretch"};class xi extends ot{constructor(e=null,t=null,n=null){super(),this._textureInvalidated=!0,this._colormapTextureInvalidated=!0,this._supportsBilinearTexture=!0,this.stencilRef=0,this.coordScale=[1,1],this._symbolizerParameters=null,this.height=null,this.isRendereredSource=!1,this.pixelRatio=1,this.resolution=0,this.rotation=0,this._source=null,this.rawPixelData=null,this._suspended=!1,this._bandIds=null,this._interpolation=null,this._transformGrid=null,this.width=null,this.x=0,this.y=0,this.source=e,this.transformGrid=t,this.interpolation=n}destroy(){var e;(e=this.getTextures())==null||e.textures.forEach(t=>t.dispose()),this._rasterTexture=null,this._transformGridTexture=null,this._colormapTexture=null}get symbolizerParameters(){return this._symbolizerParameters||fn}set symbolizerParameters(e){this._symbolizerParameters!==e&&(this._symbolizerParameters=e,this._colormapTextureInvalidated=!0)}get source(){return this._source}set source(e){this._source!==e&&(this._source=e,this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null),this.invalidateTexture())}get suspended(){return this._suspended}set suspended(e){this._suspended&&!e&&this.stage&&(this.ready(),this.requestRender()),this._suspended=e}get bandIds(){return this._bandIds}set bandIds(e){this._bandIds=e,this._isBandIdschanged(e)&&this.invalidateTexture()}get interpolation(){return this._interpolation||"nearest"}set interpolation(e){this._interpolation=e,this._rasterTexture&&this._rasterTexture.setSamplingMode(this._getTextureSamplingMethod(e)==="bilinear"?N.LINEAR:N.NEAREST)}get transformGrid(){return this._transformGrid}set transformGrid(e){this._transformGrid=e,this._transformGridTexture&&(this._transformGridTexture.dispose(),this._transformGridTexture=null)}invalidateTexture(){this._textureInvalidated||(this._textureInvalidated=!0,this.requestRender())}_createTransforms(){return{dvs:_e()}}setTransform(e){const t=yt(this.transforms.dvs),[n,o]=e.toScreenNoRotation([0,0],[this.x,this.y]),i=this.resolution/this.pixelRatio/e.resolution,a=i*this.width,r=i*this.height,c=Math.PI*this.rotation/180;De(t,t,pe(n,o)),De(t,t,pe(a/2,r/2)),St(t,t,-c),De(t,t,pe(-a/2,-r/2)),Tt(t,t,pe(a,r)),bt(this.transforms.dvs,e.displayViewMat3,t)}getTextures(){if(!this._rasterTexture)return null;const e=[],t=[];return this._transformGridTexture&&(t.push(this._transformGridTexture),e.push("u_transformGrid")),this._rasterTexture&&(t.push(this._rasterTexture),e.push("u_image")),this._colormapTexture&&(t.push(this._colormapTexture),e.push("u_colormap")),{names:e,textures:t}}onAttach(){this.invalidateTexture()}onDetach(){this.invalidateTexture()}updateTexture({context:e}){var n,o,i;if(!this.stage)return(n=this._rasterTexture)==null||n.dispose(),(o=this._transformGridTexture)==null||o.dispose(),(i=this._colormapTexture)==null||i.dispose(),this._rasterTexture=null,this._rasterTextureBandIds=null,this._transformGridTexture=null,void(this._colormapTexture=null);const t=this._isValidSource(this.source);t&&this._colormapTextureInvalidated&&(this._colormapTextureInvalidated=!1,this._updateColormapTexture(e)),this._textureInvalidated&&(this._textureInvalidated=!1,this._createOrDestroyRasterTexture(e),this._rasterTexture&&(t?this.transformGrid&&!this._transformGridTexture&&(this._transformGridTexture=tn(e,this.transformGrid)):this._rasterTexture.setData(null)),this.suspended||(this.ready(),this.requestRender()))}_createOrDestroyRasterTexture(e){var a,r;const t=E(this.source)?Nt(this.source,this.bandIds):null;if(!this._isValidSource(t))return void(this._rasterTexture&&(this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null));const n=!this._isBandIdschanged(this.bandIds);if(this._rasterTexture){if(n)return;this._rasterTexture.dispose(),this._rasterTextureBandIds=null,this._rasterTexture=null}this._supportsBilinearTexture=(a=e.capabilities.textureFloat)==null?void 0:a.textureFloatLinear;const o=this._getTextureSamplingMethod(this.interpolation),i=this.isRendereredSource||!((r=e.capabilities.textureFloat)!=null&&r.textureFloat);this._rasterTexture=en(e,t,o,i),this._rasterTextureBandIds=this.bandIds?[...this.bandIds]:null}_isBandIdschanged(e){const t=this._rasterTextureBandIds;return!(t==null&&e==null||t&&e&&t.join("")===e.join(""))}_isValidSource(e){var t;return E(e)&&((t=e.pixels)==null?void 0:t.length)>0}_getTextureSamplingMethod(e){const{type:t,colormap:n}=this.symbolizerParameters,o=t==="lut"||t==="stretch"&&E(n);return!this._supportsBilinearTexture||o||e!=="bilinear"&&e!=="cubic"?"nearest":"bilinear"}_updateColormapTexture(e){const t=this._colormap,n=this.symbolizerParameters.colormap;return n?t?n.length!==t.length||n.some((o,i)=>o!==t[i])?(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),this._colormapTexture=Ke(e,n),void(this._colormap=n)):void 0:(this._colormapTexture=Ke(e,n),void(this._colormap=n)):(this._colormapTexture&&(this._colormapTexture.dispose(),this._colormapTexture=null),void(this._colormap=null))}}function _n(l){return E(l.source)}class we{constructor(e,t){this._rctx=e,this._vertexBuffer=ee.createVertex(e,J.STATIC_DRAW,new Uint16Array(t)),this._vao=new le(e,new Map([["a_position",0]]),{geometry:[new ge("a_position",2,m.SHORT,0,4)]},{geometry:this._vertexBuffer}),this._count=t.length/2}bind(){this._rctx.bindVAO(this._vao)}unbind(){this._rctx.bindVAO(null)}dispose(){this._vao.dispose(!1),this._vertexBuffer.dispose()}draw(){this._rctx.bindVAO(this._vao),this._rctx.drawArrays(R.TRIANGLE_STRIP,0,this._count)}}class dn extends W{constructor(){super(...arguments),this._desc={lut:{vsPath:"raster/lut",fsPath:"raster/lut",attributes:new Map([["a_position",0],["a_texcoord",1]])},stretch:{vsPath:"raster/stretch",fsPath:"raster/stretch",attributes:new Map([["a_position",0],["a_texcoord",1]])},hillshade:{vsPath:"raster/hillshade",fsPath:"raster/hillshade",attributes:new Map([["a_position",0],["a_texcoord",1]])}},this._rendererUniformInfos=new Map}dispose(){this._quad&&this._quad.dispose()}prepareState({context:e}){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(D.ONE,D.ONE_MINUS_SRC_ALPHA,D.ONE,D.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0)}draw(e,t){var s;if(!_n(t)||t.suspended)return;const{timeline:n,context:o,painter:i}=e;n.begin(this.name),o.setStencilFunction(V.EQUAL,t.stencilRef,255);const a=!((s=o.capabilities.textureFloat)!=null&&s.textureFloatLinear);t.updateTexture(e);const r=this._getShaderVariations(t,a),c=i.materialManager.getProgram(this._desc[t.symbolizerParameters.type],r);this._drawWithProgram(e,c,t),n.end(this.name)}_drawWithProgram({context:e,requestRender:t,allowDelayedRender:n},o,i,a=1,r=[0,0],c=!1){if(this._quad||(this._quad=new we(e,[0,0,1,0,0,1,1,1])),n&&E(t)&&!o.isCompiled)return void t();const{symbolizerParameters:s,transformGrid:u,width:f,height:_,opacity:v}=i,g=s.type;e.useProgram(o);const p=this._getShaderVariations(i),d=this._getUniformInfos(g,e,o,p),{names:I,textures:h}=i.getTextures();cn(e,o,I,h);const O=an(a,r),P=nn(u,[f,_],[i.source.width,i.source.height],v,c);if(Se(o,d,{u_coordScale:i.coordScale,u_dvsMat3:i.transforms.dvs,...O,...P}),s.colormap){const{colormap:S,colormapOffset:y}=s,x=on(S,y);Se(o,d,x)}if(s.type==="stretch"){const S=rn(s);Se(o,d,S)}else if(s.type==="hillshade"){const S=sn(s);Se(o,d,S)}this._quad.draw()}_getUniformInfos(e,t,n,o){const i=o.length>0?e+"-"+o.join("-"):e;if(this._rendererUniformInfos.has(i))return this._rendererUniformInfos.get(i);const a=ln(t,n);return this._rendererUniformInfos.set(i,a),a}_getShaderVariations(e,t=!1){const n=[],{interpolation:o}=e,{type:i,colormap:a}=e.symbolizerParameters;return o==="cubic"?n.push("bicubic"):o==="bilinear"&&i==="stretch"&&a!=null?(n.push("bilinear"),n.push("nnedge")):t&&o==="bilinear"&&n.push("bilinear"),e.isRendereredSource?n.push("noop"):a&&n.push("applyColormap"),e.transformGrid&&(n.push("applyProjection"),e.transformGrid.spacing[0]===1&&n.push("lookupProjection")),n}}const Te=new Float32Array([.27058823529411763,.4588235294117647,.7098039215686275,1,.396078431372549,.5372549019607843,.7215686274509804,1,.5176470588235295,.6196078431372549,.7294117647058823,1,.6352941176470588,.7058823529411765,.7411764705882353,1,.7529411764705882,.8,.7450980392156863,1,.8705882352941177,.8901960784313725,.7490196078431373,1,1,1,.7490196078431373,1,1,.8627450980392157,.6313725490196078,1,.9803921568627451,.7254901960784313,.5176470588235295,1,.9607843137254902,.596078431372549,.4117647058823529,1,.9294117647058824,.4588235294117647,.3176470588235294,1,.9098039215686274,.08235294117647059,.08235294117647059,1]),je={beaufort_ft:Te,beaufort_m:Te,beaufort_km:Te,beaufort_mi:Te,beaufort_kn:new Float32Array([.1568627450980392,.5725490196078431,.7803921568627451,1,.34901960784313724,.6352941176470588,.7294117647058823,1,.5058823529411764,.7019607843137254,.6705882352941176,1,.6274509803921569,.7607843137254902,.6078431372549019,1,.7490196078431373,.8313725490196079,.5411764705882353,1,.8549019607843137,.9019607843137255,.4666666666666667,1,.9803921568627451,.9803921568627451,.39215686274509803,1,.9882352941176471,.8352941176470589,.3254901960784314,1,.9882352941176471,.7019607843137254,.4,1,.9803921568627451,.5529411764705883,.20392156862745098,1,.9686274509803922,.43137254901960786,.16470588235294117,1,.9411764705882353,.2784313725490196,.11372549019607843,1]),classified_arrow:new Float32Array([.2196078431372549,.6588235294117647,0,1,.5450980392156862,1.2117647058823529,0,1,1,1,0,1,1,.5019607843137255,0,1,1,0,0,1]),ocean_current_m:new Float32Array([.3058823529411765,.10196078431372549,.6,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),ocean_current_kn:new Float32Array([0,0,0,1,0,.1450980392156863,.39215686274509803,1,.3058823529411765,.10196078431372549,.6,1,.592156862745098,0,.39215686274509803,1,.7019607843137254,.10588235294117647,.10196078431372549,1,.6941176470588235,.3058823529411765,.10196078431372549,1,.792156862745098,.5019607843137255,.10196078431372549,1,.6941176470588235,.7019607843137254,.20392156862745098,1,.6941176470588235,.6941176470588235,.6941176470588235,1]),single_arrow:new Float32Array([0,92/255,230/255,1]),wind_speed:new Float32Array([0,0,0,1])};class mn extends W{constructor(){super(...arguments),this._desc={magdir:{vsPath:"raster/magdir",fsPath:"raster/magdir",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])},scalar:{vsPath:"raster/scalar",fsPath:"raster/scalar",attributes:new Map([["a_pos",0],["a_offset",1],["a_vv",2]])}}}dispose(){}prepareState({context:e}){e.setBlendingEnabled(!0),e.setBlendFunctionSeparate(D.ONE,D.ONE_MINUS_SRC_ALPHA,D.ONE,D.ONE_MINUS_SRC_ALPHA),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0),e.setStencilOp(X.KEEP,X.KEEP,X.REPLACE)}draw(e,t){if(G(t.source)||t.source.validPixelCount===0)return;const{context:n,timeline:o}=e;if(o.begin(this.name),n.setStencilFunction(V.EQUAL,t.stencilRef,255),t.updateVectorFieldVAO(e),e.renderPass==="scalar"){const i=t.vaoData.scalar;i&&this._drawScalars(e,t,i.vao,i.elementCount)}else{const i=t.vaoData.magdir;i&&this._drawTriangles(e,t,i.vao,i.elementCount)}o.end(this.name)}_drawTriangles(e,t,n,o){const{context:i,painter:a,requestRender:r,allowDelayedRender:c}=e,{symbolizerParameters:s}=t,u=s.dataRange?["dataRange"]:[];s.rotationType==="geographic"&&u.push("rotationGeographic");const f=a.materialManager.getProgram(this._desc.magdir,u);if(c&&E(r)&&!f.isCompiled)return void r();i.useProgram(f);const{coordScale:_,opacity:v,transforms:g}=t;f.setUniform2fv("u_coordScale",_),f.setUniform1f("u_opacity",v),f.setUniformMatrix3fv("u_dvsMat3",g.dvs);const{style:p,dataRange:d,rotation:I,symbolPercentRange:h}=s;f.setUniform4fv("u_colors",je[p]||je.single_arrow),f.setUniform2fv("u_dataRange",d),f.setUniform1f("u_rotation",I),f.setUniform2fv("u_symbolPercentRange",h);const O=this._getSymbolSize(e,t);f.setUniform2fv("u_symbolSize",O),i.bindVAO(n),i.drawElements(R.TRIANGLES,o,m.UNSIGNED_INT,0)}_drawScalars(e,t,n,o){const{context:i,painter:a,requestRender:r,allowDelayedRender:c}=e,{symbolizerParameters:s}=t,u=[];s.style==="wind_speed"?u.push("innerCircle"):s.dataRange&&u.push("dataRange"),s.rotationType==="geographic"&&u.push("rotationGeographic");const f=a.materialManager.getProgram(this._desc.scalar,u);if(c&&E(r)&&!f.isCompiled)return void r();i.useProgram(f);const{coordScale:_,opacity:v,transforms:g}=t;f.setUniform2fv("u_coordScale",_),f.setUniform1f("u_opacity",v),f.setUniformMatrix3fv("u_dvsMat3",g.dvs);const{dataRange:p,symbolPercentRange:d}=s;f.setUniform2fv("u_dataRange",p),f.setUniform2fv("u_symbolPercentRange",d);const I=this._getSymbolSize(e,t);f.setUniform2fv("u_symbolSize",I),i.bindVAO(n),i.drawElements(R.TRIANGLES,o,m.UNSIGNED_INT,0)}_getSymbolSize(e,t){const n=t.key?2**(e.displayLevel-t.key.level):t.resolution/e.state.resolution,{symbolTileSize:o}=t.symbolizerParameters;return[o/(Math.round((t.width-t.offset[0])/o)*o)/n,o/(Math.round((t.height-t.offset[1])/o)*o)/n]}}const Le={nearest:{defines:[],samplingMode:N.NEAREST,mips:!1},bilinear:{defines:[],samplingMode:N.LINEAR,mips:!1},bicubic:{defines:["bicubic"],samplingMode:N.LINEAR,mips:!1},trilinear:{defines:[],samplingMode:N.LINEAR_MIPMAP_LINEAR,mips:!0}},vn=(l,e,t)=>{if(t.samplingMode==="dynamic"){const{state:n}=l,o=e.resolution/e.pixelRatio/n.resolution,i=Math.round(l.pixelRatio)!==l.pixelRatio,a=o>1.05||o<.95;return n.rotation||a||i||e.isSourceScaled||e.rotation?Le.bilinear:Le.nearest}return Le[t.samplingMode]};class pn extends W{constructor(){super(...arguments),this._desc={vsPath:"raster/bitmap",fsPath:"raster/bitmap",attributes:new Map([["a_pos",0]])}}dispose(){this._quad&&this._quad.dispose()}prepareState({context:e}){e.setBlendingEnabled(!0),e.setColorMask(!0,!0,!0,!0),e.setStencilWriteMask(0),e.setStencilTestEnabled(!0)}draw(e,t){const{context:n,renderingOptions:o,painter:i,requestRender:a,allowDelayedRender:r}=e;if(!t.source||!t.isReady)return;const c=vn(e,t,o),s=i.materialManager.getProgram(this._desc,c.defines);if(r&&E(a)&&!s.isCompiled)return void a();e.timeline.begin(this.name),t.blendFunction==="additive"?n.setBlendFunctionSeparate(D.ONE,D.ONE,D.ONE,D.ONE):n.setBlendFunctionSeparate(D.ONE,D.ONE_MINUS_SRC_ALPHA,D.ONE,D.ONE_MINUS_SRC_ALPHA),n.setStencilFunction(V.EQUAL,t.stencilRef,255),this._quad||(this._quad=new we(n,[0,0,1,0,0,1,1,1]));const{coordScale:u,computedOpacity:f,transforms:_}=t;t.setSamplingProfile(c),t.bind(e.context,Oe),n.useProgram(s),s.setUniformMatrix3fv("u_dvsMat3",_.dvs),s.setUniform1i("u_texture",Oe),s.setUniform2fv("u_coordScale",u),s.setUniform1f("u_opacity",f),this._quad.draw(),e.timeline.end(this.name)}}function ct(){return new Float32Array(4)}function gn(l){const e=new Float32Array(4);return e[0]=l[0],e[1]=l[1],e[2]=l[2],e[3]=l[3],e}function K(l,e,t,n){const o=new Float32Array(4);return o[0]=l,o[1]=e,o[2]=t,o[3]=n,o}function hn(l,e){return new Float32Array(l,e,4)}function ut(){return ct()}function ft(){return K(1,1,1,1)}function _t(){return K(1,0,0,0)}function dt(){return K(0,1,0,0)}function mt(){return K(0,0,1,0)}function vt(){return K(0,0,0,1)}const xn=ut(),yn=ft(),Sn=_t(),Tn=dt(),bn=mt(),En=vt();Object.freeze(Object.defineProperty({__proto__:null,create:ct,clone:gn,fromValues:K,createView:hn,zeros:ut,ones:ft,unitX:_t,unitY:dt,unitZ:mt,unitW:vt,ZEROS:xn,ONES:yn,UNIT_X:Sn,UNIT_Y:Tn,UNIT_Z:bn,UNIT_W:En},Symbol.toStringTag,{value:"Module"}));const In={background:{"background.frag":`uniform lowp vec4 u_color; void main() { gl_FragColor = u_color; }`,"background.vert":`attribute vec2 a_pos; diff --git a/assets/WMSLayer.b219bb80.js b/assets/WMSLayer.5b9ad09d.js similarity index 99% rename from assets/WMSLayer.b219bb80.js rename to assets/WMSLayer.5b9ad09d.js index 38af6c3..b409bf2 100644 --- a/assets/WMSLayer.b219bb80.js +++ b/assets/WMSLayer.5b9ad09d.js @@ -1,2 +1,2 @@ -import{aP as Oe,c$ as W,dz as P,_ as ye,cU as U,hB as Re,cE as K,a6 as a,a7 as u,d2 as N,cw as $e,a8 as he,ic as Le,n as Pe,aT as O,bX as Ue,j as L,ct as Ae,i2 as _e,iM as Me,ia as Te,i3 as je,eF as Ce,eG as qe,eH as Be,ee as Ve,c as I,aU as We,U as X,dT as ke,kl as De,bK as Xe,hJ as Ge,dv as He,d1 as Je,ev as ze,F as Ke,b4 as Qe,e0 as G,iE as Ye,h0 as Ze,eK as et,cF as tt,km as rt}from"./index.d94abe07.js";import{i as ne}from"./scaleUtils.467c71f9.js";import{o as J}from"./crsUtils.daf46943.js";import{l as se}from"./ExportWMSImageParameters.bc1ac1a0.js";var q;let nt=0,y=q=class extends Oe(Le){constructor(e){super(e),this.dimensions=null,this.fullExtents=null,this.legendUrl=null,this.legendEnabled=!0,this.layer=null,this.maxScale=0,this.minScale=0,this.parent=null,this.popupEnabled=!1,this.queryable=!1,this.sublayers=null,this.spatialReferences=null,this.addHandles([W(()=>this.sublayers,"after-add",({item:r})=>{r.parent=this,r.layer=this.layer},P),W(()=>this.sublayers,"after-remove",({item:r})=>{r.layer=r.parent=null},P),ye(()=>this.sublayers,(r,n)=>{if(n)for(const t of n)t.layer=t.parent=null;if(r)for(const t of r)t.parent=this,t.layer=this.layer},P)])}get description(){return this._get("description")}set description(e){this._set("description",e)}get fullExtent(){return this._get("fullExtent")}set fullExtent(e){this._set("fullExtent",e)}readExtent(e,r){return(e=r.extent)?U.fromJSON(e):null}get id(){const e=this._get("id");return e!=null?e:nt++}set id(e){this._set("id",e)}readLegendUrl(e,r){var n,t;return(t=(n=r==null?void 0:r.legendUrl)!=null?n:r==null?void 0:r.legendURL)!=null?t:null}get effectiveScaleRange(){const{minScale:e,maxScale:r}=this;return{minScale:e,maxScale:r}}get name(){return this._get("name")}set name(e){this._set("name",e)}castSublayers(e){return Re(K.ofType(q),e)}get title(){return this._get("title")}set title(e){this._set("title",e)}get visible(){return this._get("visible")}set visible(e){this._setAndNotifyLayer("visible",e)}clone(){var r,n,t;const e=new q;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent.clone()),this.hasOwnProperty("fullExtents")&&(e.fullExtents=(n=(r=this.fullExtents)==null?void 0:r.map(s=>s.clone()))!=null?n:null),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("legendEnabled")&&(e.legendEnabled=this.legendEnabled),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("name")&&(e.name=this.name),this.hasOwnProperty("parent")&&(e.parent=this.parent),this.hasOwnProperty("queryable")&&(e.queryable=this.queryable),this.hasOwnProperty("sublayers")&&(e.sublayers=this.sublayers&&this.sublayers.map(s=>s.clone())),this.hasOwnProperty("spatialReferences")&&(e.spatialReferences=(t=this.spatialReferences)==null?void 0:t.map(s=>s)),this.hasOwnProperty("visible")&&(e.visible=this.visible),this.hasOwnProperty("title")&&(e.title=this.title),e}_setAndNotifyLayer(e,r){const n=this.layer;this._get(e)!==r&&(this._set(e,r),n&&n.emit("wms-sublayer-update",{propertyName:e,id:this.id}))}};a([u()],y.prototype,"description",null),a([u({readOnly:!0})],y.prototype,"dimensions",void 0),a([u({value:null})],y.prototype,"fullExtent",null),a([N("fullExtent",["extent"])],y.prototype,"readExtent",null),a([u()],y.prototype,"fullExtents",void 0),a([u({type:Number,json:{write:{enabled:!1,overridePolicy:()=>({ignoreOrigin:!0,enabled:!0})}}})],y.prototype,"id",null),a([u({type:String,json:{origins:{"web-document":{read:{source:["legendUrl","legendURL"]},write:{target:"legendUrl",ignoreOrigin:!0}}},read:{source:"legendURL"},write:{ignoreOrigin:!0}}})],y.prototype,"legendUrl",void 0),a([N(["web-document"],"legendUrl")],y.prototype,"readLegendUrl",null),a([u({value:!0,type:Boolean,json:{read:{source:"showLegend"},write:{target:"showLegend"},origins:{"web-map":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],y.prototype,"legendEnabled",void 0),a([u()],y.prototype,"layer",void 0),a([u()],y.prototype,"maxScale",void 0),a([u()],y.prototype,"minScale",void 0),a([u({readOnly:!0})],y.prototype,"effectiveScaleRange",null),a([u({type:String,value:null,json:{read:{source:"name"},write:{ignoreOrigin:!0}}})],y.prototype,"name",null),a([u()],y.prototype,"parent",void 0),a([u({type:Boolean,json:{read:{source:"showPopup"},write:{ignoreOrigin:!0,target:"showPopup"}}})],y.prototype,"popupEnabled",void 0),a([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],y.prototype,"queryable",void 0),a([u()],y.prototype,"sublayers",void 0),a([$e("sublayers")],y.prototype,"castSublayers",null),a([u({type:[Number],json:{read:{source:"spatialReferences"}}})],y.prototype,"spatialReferences",void 0),a([u({type:String,value:null,json:{write:{ignoreOrigin:!0}}})],y.prototype,"title",null),a([u({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"}}})],y.prototype,"visible",null),y=q=a([he("esri.layers.support.WMSSublayer")],y);const z=y,C={84:4326,83:4269,27:4267};function st(e){if(!e)return null;const r={idCounter:-1};typeof e=="string"&&(e=new DOMParser().parseFromString(e,"text/xml"));const n=e.documentElement;if(n.nodeName==="ServiceExceptionReport"){const w=Array.prototype.slice.call(n.childNodes).map(A=>A.textContent).join(`\r +import{aP as Oe,c$ as W,dz as P,_ as ye,cU as U,hB as Re,cE as K,a6 as a,a7 as u,d2 as N,cw as $e,a8 as he,ic as Le,n as Pe,aT as O,bX as Ue,j as L,ct as Ae,i2 as _e,iM as Me,ia as Te,i3 as je,eF as Ce,eG as qe,eH as Be,ee as Ve,c as I,aU as We,U as X,dT as ke,kl as De,bK as Xe,hJ as Ge,dv as He,d1 as Je,ev as ze,F as Ke,b4 as Qe,e0 as G,iE as Ye,h0 as Ze,eK as et,cF as tt,km as rt}from"./index.221827cd.js";import{i as ne}from"./scaleUtils.de5ad5a6.js";import{o as J}from"./crsUtils.daf46943.js";import{l as se}from"./ExportWMSImageParameters.013012f9.js";var q;let nt=0,y=q=class extends Oe(Le){constructor(e){super(e),this.dimensions=null,this.fullExtents=null,this.legendUrl=null,this.legendEnabled=!0,this.layer=null,this.maxScale=0,this.minScale=0,this.parent=null,this.popupEnabled=!1,this.queryable=!1,this.sublayers=null,this.spatialReferences=null,this.addHandles([W(()=>this.sublayers,"after-add",({item:r})=>{r.parent=this,r.layer=this.layer},P),W(()=>this.sublayers,"after-remove",({item:r})=>{r.layer=r.parent=null},P),ye(()=>this.sublayers,(r,n)=>{if(n)for(const t of n)t.layer=t.parent=null;if(r)for(const t of r)t.parent=this,t.layer=this.layer},P)])}get description(){return this._get("description")}set description(e){this._set("description",e)}get fullExtent(){return this._get("fullExtent")}set fullExtent(e){this._set("fullExtent",e)}readExtent(e,r){return(e=r.extent)?U.fromJSON(e):null}get id(){const e=this._get("id");return e!=null?e:nt++}set id(e){this._set("id",e)}readLegendUrl(e,r){var n,t;return(t=(n=r==null?void 0:r.legendUrl)!=null?n:r==null?void 0:r.legendURL)!=null?t:null}get effectiveScaleRange(){const{minScale:e,maxScale:r}=this;return{minScale:e,maxScale:r}}get name(){return this._get("name")}set name(e){this._set("name",e)}castSublayers(e){return Re(K.ofType(q),e)}get title(){return this._get("title")}set title(e){this._set("title",e)}get visible(){return this._get("visible")}set visible(e){this._setAndNotifyLayer("visible",e)}clone(){var r,n,t;const e=new q;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent.clone()),this.hasOwnProperty("fullExtents")&&(e.fullExtents=(n=(r=this.fullExtents)==null?void 0:r.map(s=>s.clone()))!=null?n:null),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("legendEnabled")&&(e.legendEnabled=this.legendEnabled),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("name")&&(e.name=this.name),this.hasOwnProperty("parent")&&(e.parent=this.parent),this.hasOwnProperty("queryable")&&(e.queryable=this.queryable),this.hasOwnProperty("sublayers")&&(e.sublayers=this.sublayers&&this.sublayers.map(s=>s.clone())),this.hasOwnProperty("spatialReferences")&&(e.spatialReferences=(t=this.spatialReferences)==null?void 0:t.map(s=>s)),this.hasOwnProperty("visible")&&(e.visible=this.visible),this.hasOwnProperty("title")&&(e.title=this.title),e}_setAndNotifyLayer(e,r){const n=this.layer;this._get(e)!==r&&(this._set(e,r),n&&n.emit("wms-sublayer-update",{propertyName:e,id:this.id}))}};a([u()],y.prototype,"description",null),a([u({readOnly:!0})],y.prototype,"dimensions",void 0),a([u({value:null})],y.prototype,"fullExtent",null),a([N("fullExtent",["extent"])],y.prototype,"readExtent",null),a([u()],y.prototype,"fullExtents",void 0),a([u({type:Number,json:{write:{enabled:!1,overridePolicy:()=>({ignoreOrigin:!0,enabled:!0})}}})],y.prototype,"id",null),a([u({type:String,json:{origins:{"web-document":{read:{source:["legendUrl","legendURL"]},write:{target:"legendUrl",ignoreOrigin:!0}}},read:{source:"legendURL"},write:{ignoreOrigin:!0}}})],y.prototype,"legendUrl",void 0),a([N(["web-document"],"legendUrl")],y.prototype,"readLegendUrl",null),a([u({value:!0,type:Boolean,json:{read:{source:"showLegend"},write:{target:"showLegend"},origins:{"web-map":{read:!1,write:!1},"web-scene":{read:!1,write:!1}}}})],y.prototype,"legendEnabled",void 0),a([u()],y.prototype,"layer",void 0),a([u()],y.prototype,"maxScale",void 0),a([u()],y.prototype,"minScale",void 0),a([u({readOnly:!0})],y.prototype,"effectiveScaleRange",null),a([u({type:String,value:null,json:{read:{source:"name"},write:{ignoreOrigin:!0}}})],y.prototype,"name",null),a([u()],y.prototype,"parent",void 0),a([u({type:Boolean,json:{read:{source:"showPopup"},write:{ignoreOrigin:!0,target:"showPopup"}}})],y.prototype,"popupEnabled",void 0),a([u({type:Boolean,json:{write:{ignoreOrigin:!0}}})],y.prototype,"queryable",void 0),a([u()],y.prototype,"sublayers",void 0),a([$e("sublayers")],y.prototype,"castSublayers",null),a([u({type:[Number],json:{read:{source:"spatialReferences"}}})],y.prototype,"spatialReferences",void 0),a([u({type:String,value:null,json:{write:{ignoreOrigin:!0}}})],y.prototype,"title",null),a([u({type:Boolean,value:!0,json:{read:{source:"defaultVisibility"}}})],y.prototype,"visible",null),y=q=a([he("esri.layers.support.WMSSublayer")],y);const z=y,C={84:4326,83:4269,27:4267};function st(e){if(!e)return null;const r={idCounter:-1};typeof e=="string"&&(e=new DOMParser().parseFromString(e,"text/xml"));const n=e.documentElement;if(n.nodeName==="ServiceExceptionReport"){const w=Array.prototype.slice.call(n.childNodes).map(A=>A.textContent).join(`\r `);throw new Pe("wmslayer:wms-capabilities-xml-is-not-valid","The server returned errors when the WMS capabilities were requested.",w)}const t=b("Capability",n),s=b("Service",n),l=b("Request",t);if(!t||!s||!l)return null;const o=b("Layer",t);if(!o)return null;const f=n.nodeName==="WMS_Capabilities"||n.nodeName==="WMT_MS_Capabilities"?n.getAttribute("version"):"1.3.0",i=v("Title",s,"")||v("Name",s,""),p=v("AccessConstraints",s,""),m=/^none$/i.test(p)?"":p,c=v("Abstract",s,""),g=parseInt(v("MaxWidth",s,"5000"),10),x=parseInt(v("MaxHeight",s,"5000"),10),E=ae(l,"GetMap"),S=ie(l,"GetMap"),h=M(o,f,r);let Q,k=0;if(Array.prototype.slice.call(t.childNodes).forEach(w=>{w.nodeName==="Layer"&&(k===0?Q=w:(k===1&&h.name&&(h.name="",h.sublayers.push(M(Q,f,r))),h.sublayers.push(M(w,f,r))),k++)}),!h)return null;let F,T;const ve=h.fullExtents;if(F=h.sublayers,F||(F=[]),F.length===0&&F.push(h),T=h.extent,!T){const w=new U(F[0].extent);h.extent=w.toJSON(),T=h.extent}const Se=h.spatialReferences.length>0?h.spatialReferences:ge(h),Y=ie(l,"GetFeatureInfo"),Ee=Y?ae(l,"GetFeatureInfo"):null,Z=be(F),Fe=h.minScale||0,Ie=h.maxScale||0,ee=h.dimensions,Ne=Z.reduce((w,A)=>w.concat(A.dimensions),[]),te=ee.concat(Ne).filter(we);let re=null;if(te.length){const w=te.map(A=>{const{extent:D}=A;return ot(D)?D.map(j=>j.getTime()):D.map(j=>[j.min.getTime(),j.max.getTime()])}).flat(2);re={startTimeField:null,endTimeField:null,trackIdField:null,timeExtent:[Math.min(...w),Math.max(...w)]}}return{copyright:m,description:c,dimensions:ee,extent:T,fullExtents:ve,featureInfoFormats:Ee,featureInfoUrl:Y,mapUrl:S,maxWidth:g,maxHeight:x,maxScale:Ie,minScale:Fe,layers:Z,spatialReferences:Se,supportedImageFormatTypes:E,timeInfo:re,title:i,version:f}}function it(e){const r=e.filter(n=>n.popupEnabled&&n.name&&n.queryable);return r.length?r.map(({name:n})=>n).join():null}function ge(e){if(e.spatialReferences.length>0)return e.spatialReferences;if(e.sublayers)for(const r of e.sublayers){const n=ge(r);if(n.length>0)return n}return[]}function be(e){var n;let r=[];for(const t of e)r.push(t),(n=t.sublayers)!=null&&n.length&&(r=r.concat(be(t.sublayers)),delete t.sublayers);return r}function B(e,r,n){var t;return(t=r.getAttribute(e))!=null?t:n}function at(e,r,n,t){const s=b(e,n);return s?B(r,s,t):t}function b(e,r){for(let n=0;ns);const t=[];for(const s of n)if(s.getAttribute("name")===r){const l=V("Format",s);for(const{textContent:o}of l)t.push(o)}return t}function oe(e,r,n){const t=b(r,e);if(!t)return n;const{textContent:s}=t;if(s==null||s==="")return n;const l=Number(s);return isNaN(l)?n:l}function M(e,r,n){if(!e)return null;const t={id:n.idCounter++,fullExtents:[],parentLayerId:null,queryable:e.getAttribute("queryable")==="1",spatialReferences:[],sublayers:null},s=b("LatLonBoundingBox",e),l=b("EX_GeographicBoundingBox",e);let o=null;s&&(o=_(s,4326)),l&&(o=new U(0,0,0,0,new O({wkid:4326})),o.xmin=parseFloat(v("westBoundLongitude",l,"0")),o.ymin=parseFloat(v("southBoundLatitude",l,"0")),o.xmax=parseFloat(v("eastBoundLongitude",l,"0")),o.ymax=parseFloat(v("northBoundLatitude",l,"0"))),s||l||(o=new U(-180,-90,180,90,new O({wkid:4326}))),t.minScale=oe(e,"MaxScaleDenominator",0),t.maxScale=oe(e,"MinScaleDenominator",0);const f=["1.0.0","1.1.0","1.1.1"].includes(r)?"SRS":"CRS";return Array.prototype.slice.call(e.childNodes).forEach(i=>{if(i.nodeName==="Name")t.name=i.textContent||"";else if(i.nodeName==="Title")t.title=i.textContent||"";else if(i.nodeName==="Abstract")t.description=i.textContent||"";else if(i.nodeName==="BoundingBox"){const p=i.getAttribute(f);if(p&&p.indexOf("EPSG:")===0){const c=parseInt(p.substring(5),10);c===0||isNaN(c)||o||(o=r==="1.3.0"?_(i,c,J(c)):_(i,c))}const m=p&&p.indexOf(":");if(m&&m>-1){let c=parseInt(p.substring(m+1,p.length),10);c===0||isNaN(c)||(c=C[c]?C[c]:c);const g=r==="1.3.0"?_(i,c,J(c)):_(i,c);t.fullExtents.push(g)}}else if(i.nodeName===f)i.textContent.split(" ").forEach(p=>{const m=p.includes(":")?parseInt(p.split(":")[1],10):parseInt(p,10);if(m!==0&&!isNaN(m)){const c=C[m]?C[m]:m;t.spatialReferences.includes(c)||t.spatialReferences.push(c)}});else if(i.nodeName!=="Style"||t.legendURL){if(i.nodeName==="Layer"){const p=M(i,r,n);p&&(p.parentLayerId=t.id,t.sublayers||(t.sublayers=[]),t.sublayers.push(p))}}else{const p=b("LegendURL",i);if(p){const m=b("OnlineResource",p);m&&(t.legendURL=m.getAttribute("xlink:href"))}}}),t.extent=o==null?void 0:o.toJSON(),t.dimensions=V("Dimension",e).filter(i=>i.getAttribute("name")&&i.getAttribute("units")&&i.textContent).map(i=>{const p=i.getAttribute("name"),m=i.getAttribute("units"),c=i.textContent,g=i.getAttribute("unitSymbol"),x=i.getAttribute("default"),E=B("default",i,"0")!=="0",S=B("nearestValue",i,"0")!=="0",h=B("current",i,"0")!=="0";return we({name:p,units:m})?{name:"time",units:"ISO8601",extent:pe(c),default:pe(x),multipleValues:E,nearestValue:S,current:h}:lt({name:p,units:m})?{name:"elevation",units:m,extent:le(c),unitSymbol:g,default:le(x),multipleValues:E,nearestValue:S}:{name:p,units:m,extent:ue(c),unitSymbol:g,default:ue(x),multipleValues:E,nearestValue:S}}),t}function ot(e){return Array.isArray(e)&&e.length>0&&e[0]instanceof Date}function xe(e){return e.nodeType===Node.ELEMENT_NODE}function lt(e){return/^elevation$/i.test(e.name)&&/^(epsg|crs):\d+$/i.test(e.units)}function we(e){return/^time$/i.test(e.name)&&/^iso8601$/i.test(e.units)}function ut(e,r){const n=[],t=Ue(e);for(const s in t.query)t.query.hasOwnProperty(s)&&(r.includes(s.toLowerCase())||n.push(s+"="+t.query[s]));return t.path+(n.length?"?"+n.join("&"):"")}function le(e){if(!e)return null;const r=e.includes("/"),n=e.split(",");return r?n.map(t=>{const s=t.split("/");return s.length<2?null:{min:parseFloat(s[0]),max:parseFloat(s[1]),resolution:s.length>=3&&s[2]!=="0"?parseFloat(s[2]):void 0}}).filter(t=>t):n.map(t=>parseFloat(t))}function ue(e){if(!e)return null;const r=e.includes("/"),n=e.split(",");return r?n.map(t=>{const s=t.split("/");return s.length<2?null:{min:s[0],max:s[1],resolution:s.length>=3&&s[2]!=="0"?s[2]:void 0}}).filter(t=>t):n}function pe(e){if(!e)return null;const r=e.includes("/"),n=e.split(",");return r?n.map(t=>{const s=t.split("/");return s.length<2?null:{min:new Date(s[0]),max:new Date(s[1]),resolution:s.length>=3&&s[2]!=="0"?pt(s[2]):void 0}}).filter(t=>t):n.map(t=>new Date(t))}function pt(e){const r=/(?:p(\d+y|\d+(?:.|,)\d+y)?(\d+m|\d+(?:.|,)\d+m)?(\d+d|\d+(?:.|,)\d+d)?)?(?:t(\d+h|\d+(?:.|,)\d+h)?(\d+m|\d+(?:.|,)\d+m)?(\d+s|\d+(?:.|,)\d+s)?)?/i,n=e.match(r);return n?{years:R(n[1]),months:R(n[2]),days:R(n[3]),hours:R(n[4]),minutes:R(n[5]),seconds:R(n[6])}:null}function R(e){if(!e)return 0;const r=/(?:\d+(?:.|,)\d+|\d+)/,n=e.match(r);if(!n)return 0;const t=n[0].replace(",",".");return Number(t)}function $(e){return e.toISOString().replace(/\.[0-9]{3}/,"")}const ce=new Set([102100,3857,102113,900913]),ct=new Set([3395,54004]);function dt(e,r){let n=e.wkid;return L(r)?n:(!r.includes(n)&&e.latestWkid&&(n=e.latestWkid),ce.has(n)?r.find(t=>ce.has(t))||r.find(t=>ct.has(t))||102100:n)}const H=new Ae({bmp:"image/bmp",gif:"image/gif",jpg:"image/jpeg",png:"image/png",svg:"image/svg+xml"},{ignoreUnknown:!1});function de(e){return e==="text/html"}function me(e){return e==="text/plain"}let d=class extends _e(Me(Te(je(Ce(qe(Be(tt))))))){constructor(...e){super(...e),this.allSublayers=new Ve({getCollections:()=>[this.sublayers],getChildrenFunction:r=>r.sublayers}),this.customParameters=null,this.customLayerParameters=null,this.copyright=null,this.description=null,this.dimensions=null,this.fullExtent=null,this.fullExtents=null,this.featureInfoFormats=null,this.featureInfoUrl=null,this.fetchFeatureInfoFunction=null,this.imageFormat=null,this.imageMaxHeight=2048,this.imageMaxWidth=2048,this.imageTransparency=!0,this.legendEnabled=!0,this.mapUrl=null,this.isReference=null,this.operationalLayerType="WMS",this.spatialReference=null,this.spatialReferences=null,this.sublayers=null,this.type="wms",this.url=null,this.version=null,this.addHandles([W(()=>this.sublayers,"after-add",({item:r})=>{r.parent=r.layer=this},P),W(()=>this.sublayers,"after-remove",({item:r})=>{r.layer=r.parent=null},P),ye(()=>this.sublayers,(r,n)=>{if(n)for(const t of n)t.layer=t.parent=null;if(r)for(const t of r)t.parent=t.layer=this},P)])}normalizeCtorArgs(e,r){return typeof e=="string"?{url:e,...r}:e}load(e){const r=I(e)?e.signal:null;return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMS"]},e).catch(We).then(()=>this._fetchService(r))),Promise.resolve(this)}readFullExtentFromItemOrMap(e,r){const n=r.extent;return n?new U({xmin:n[0][0],ymin:n[0][1],xmax:n[1][0],ymax:n[1][1]}):null}writeFullExtent(e,r){r.extent=[[e.xmin,e.ymin],[e.xmax,e.ymax]]}get featureInfoFormat(){var e,r;return L(this.featureInfoFormats)?null:(r=(e=this.featureInfoFormats.find(de))!=null?e:this.featureInfoFormats.find(me))!=null?r:null}set featureInfoFormat(e){I(e)?(de(e)||me(e))&&this._override("featureInfoFormat",e):(this.revert("featureInfoFormat","service"),this._clearOverride("featureInfoFormat"))}readImageFormat(e,r){const n=r.supportedImageFormatTypes;return n&&n.includes("image/png")?"image/png":n&&n[0]}readSpatialReferenceFromItemOrDocument(e,r){return new O(r.spatialReferences[0])}writeSpatialReferences(e,r){var t;const n=(t=this.spatialReference)==null?void 0:t.wkid;e&&n?(r.spatialReferences=e.filter(s=>s!==n),r.spatialReferences.unshift(n)):r.spatialReferences=e}readSublayersFromItemOrMap(e,r,n){return fe(r.layers,n,r.visibleLayers)}readSublayers(e,r,n){return fe(r.layers,n)}writeSublayers(e,r,n,t){var o,f;r.layers=[];const s=new Map,l=e.flatten(({sublayers:i})=>i);for(const i of l)if(typeof((o=i.parent)==null?void 0:o.id)=="number"){const p=s.get(i.parent.id);p!=null?p.push(i.id):s.set(i.parent.id,[i.id])}for(const i of l){const p={sublayer:i,...t},m=i.write({parentLayerId:typeof((f=i.parent)==null?void 0:f.id)=="number"?i.parent.id:-1},p);if(s.has(i.id)&&(m.sublayerIds=s.get(i.id)),!i.sublayers&&i.name){const c=i.write({},p);delete c.id,r.layers.push(c)}}r.visibleLayers=l.filter(({visible:i,sublayers:p})=>i&&!p).map(({name:i})=>i).toArray()}createExportImageParameters(e,r,n,t){var S;const s=(S=t==null?void 0:t.pixelRatio)!=null?S:1,l=ne({extent:e,width:r})*s,o=new se({layer:this,scale:l}),{xmin:f,ymin:i,xmax:p,ymax:m,spatialReference:c}=e,g=dt(c,this.spatialReferences),x=this.version==="1.3.0"&&J(g)?`${i},${f},${m},${p}`:`${f},${i},${p},${m}`,E=o.toJSON();return{bbox:x,[this.version==="1.3.0"?"crs":"srs"]:isNaN(g)?void 0:"EPSG:"+g,...E}}async fetchImage(e,r,n,t){var m,c;const s=this.mapUrl,l=this.createExportImageParameters(e,r,n,t);if(!l.layers){const g=document.createElement("canvas");return g.width=r,g.height=n,g}const o=(m=t==null?void 0:t.timeExtent)==null?void 0:m.start,f=(c=t==null?void 0:t.timeExtent)==null?void 0:c.end,i=I(o)&&I(f)?o.getTime()===f.getTime()?$(o):`${$(o)}/${$(f)}`:void 0,p={responseType:"image",query:this._mixCustomParameters({width:r,height:n,...l,time:i,...this.refreshParameters}),signal:t==null?void 0:t.signal};return X(s!=null?s:"",p).then(g=>g.data)}async fetchImageBitmap(e,r,n,t){var c,g;const s=this.mapUrl,l=this.createExportImageParameters(e,r,n,t);if(!l.layers){const x=document.createElement("canvas");return x.width=r,x.height=n,x}const o=(c=t==null?void 0:t.timeExtent)==null?void 0:c.start,f=(g=t==null?void 0:t.timeExtent)==null?void 0:g.end,i=I(o)&&I(f)?o.getTime()===f.getTime()?$(o):`${$(o)}/${$(f)}`:void 0,p={responseType:"blob",query:this._mixCustomParameters({width:r,height:n,...l,time:i,...this.refreshParameters}),signal:t==null?void 0:t.signal},m=await X(s!=null?s:"",p).then(x=>x.data);return createImageBitmap(m)}fetchFeatureInfo(e,r,n,t,s){const l=ne({extent:e,width:r}),o=new se({layer:this,scale:l}),f=it(o.visibleSublayers);if(L(this.featureInfoUrl)||L(f))return Promise.resolve([]);if(L(this.fetchFeatureInfoFunction)&&L(this.featureInfoFormat))return Promise.resolve([]);const i=this.version==="1.3.0"?{I:t,J:s}:{x:t,y:s},p={query_layers:f,request:"GetFeatureInfo",info_format:this.featureInfoFormat,feature_count:25,width:r,height:n,...i},m={...this.createExportImageParameters(e,r,n),...p},c=this._mixCustomParameters(m);return I(this.fetchFeatureInfoFunction)?this.fetchFeatureInfoFunction(c):this._defaultFetchFeatureInfoFunction(ke(this.featureInfoUrl,c))}findSublayerById(e){return this.allSublayers.find(r=>r.id===e)}findSublayerByName(e){return this.allSublayers.find(r=>r.name===e)}serviceSupportsSpatialReference(e){return De(this.url)||this.spatialReferences!=null&&this.spatialReferences.some(r=>{const n=r===900913?O.WebMercator:new O({wkid:r});return Xe(n,e)})}_defaultFetchFeatureInfoFunction(e){const r=document.createElement("iframe");r.src=Ge(e),r.style.border="none",r.style.margin="0",r.style.width="100%",r.setAttribute("sandbox","");const n=new He({title:this.title,content:r}),t=new Je({sourceLayer:this,popupTemplate:n});return Promise.resolve([t])}async _fetchService(e){var r;if(!this.resourceInfo){const{path:n,query:t}=(r=this.parsedUrl)!=null?r:{};t!=null&&t.service&&(t.SERVICE=t.service,delete t.service),t!=null&&t.request&&(t.REQUEST=t.request,delete t.request);const{data:s}=await X(n!=null?n:"",{query:{SERVICE:"WMS",REQUEST:"GetCapabilities",...t,...this.customParameters},responseType:"xml",signal:e});this.resourceInfo=st(s)}if(this.parsedUrl){const n=new ze(this.parsedUrl.path),{httpsDomains:t}=Ke.request;n.scheme!=="https"||n.port&&n.port!=="443"||!n.host||t.includes(n.host)||t.push(n.host)}this.read(this.resourceInfo,{origin:"service"})}_mixCustomParameters(e){if(!this.customLayerParameters&&!this.customParameters)return e;const r={...this.customParameters,...this.customLayerParameters};for(const n in r)e[n.toLowerCase()]=r[n];return e}};function mt(e,r){return e.some(n=>{for(const t in n)if(rt(n,t,null,r))return!0;return!1})}function fe(e,r,n){e=e!=null?e:[];const t=new Map;e.every(l=>l.id==null)&&(e=Qe(e)).forEach((l,o)=>l.id=o);for(const l of e){const o=new z;o.read(l,r),n&&!n.includes(o.name)&&(o.visible=!1),t.set(o.id,o)}const s=[];for(const l of e){const o=l.id!=null?t.get(l.id):null;if(o)if(l.parentLayerId!=null&&l.parentLayerId>=0){const f=t.get(l.parentLayerId);if(!f)continue;f.sublayers||(f.sublayers=new K),f.sublayers.push(o)}else s.push(o)}return s}a([u({readOnly:!0})],d.prototype,"allSublayers",void 0),a([u({json:{type:Object,write:!0}})],d.prototype,"customParameters",void 0),a([u({json:{type:Object,write:!0}})],d.prototype,"customLayerParameters",void 0),a([u({type:String,json:{write:!0}})],d.prototype,"copyright",void 0),a([u()],d.prototype,"description",void 0),a([u({readOnly:!0})],d.prototype,"dimensions",void 0),a([u({json:{type:[[Number]],read:{source:"extent"},write:{target:"extent"},origins:{"web-document":{write:{ignoreOrigin:!0}},"portal-item":{write:{ignoreOrigin:!0}}}}})],d.prototype,"fullExtent",void 0),a([N(["web-document","portal-item"],"fullExtent",["extent"])],d.prototype,"readFullExtentFromItemOrMap",null),a([G(["web-document","portal-item"],"fullExtent",{extent:{type:[[Number]]}})],d.prototype,"writeFullExtent",null),a([u()],d.prototype,"fullExtents",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],d.prototype,"featureInfoFormat",null),a([u({type:[String],readOnly:!0})],d.prototype,"featureInfoFormats",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],d.prototype,"featureInfoUrl",void 0),a([u()],d.prototype,"fetchFeatureInfoFunction",void 0),a([u({type:String,json:{origins:{"web-document":{default:"image/png",type:H.jsonValues,read:{reader:H.read,source:"format"},write:{writer:H.write,target:"format"}}}}})],d.prototype,"imageFormat",void 0),a([N("imageFormat",["supportedImageFormatTypes"])],d.prototype,"readImageFormat",null),a([u({type:Number,json:{read:{source:"maxHeight"},write:{target:"maxHeight"}}})],d.prototype,"imageMaxHeight",void 0),a([u({type:Number,json:{read:{source:"maxWidth"},write:{target:"maxWidth"}}})],d.prototype,"imageMaxWidth",void 0),a([u()],d.prototype,"imageTransparency",void 0),a([u(Ye)],d.prototype,"legendEnabled",void 0),a([u({type:["show","hide","hide-children"]})],d.prototype,"listMode",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],d.prototype,"mapUrl",void 0),a([u({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],d.prototype,"isReference",void 0),a([u({type:["WMS"]})],d.prototype,"operationalLayerType",void 0),a([u()],d.prototype,"resourceInfo",void 0),a([u({type:O,json:{origins:{service:{read:{source:"extent.spatialReference"}}},write:!1}})],d.prototype,"spatialReference",void 0),a([N(["web-document","portal-item"],"spatialReference",["spatialReferences"])],d.prototype,"readSpatialReferenceFromItemOrDocument",null),a([u({type:[Ze],json:{read:!1,origins:{service:{read:!0},"web-document":{read:!1,write:{ignoreOrigin:!0}},"portal-item":{read:!1,write:{ignoreOrigin:!0}}}}})],d.prototype,"spatialReferences",void 0),a([G(["web-document","portal-item"],"spatialReferences")],d.prototype,"writeSpatialReferences",null),a([u({type:K.ofType(z),json:{write:{target:"layers",overridePolicy(e,r,n){if(mt(this.allSublayers,n))return{ignoreOrigin:!0}}}}})],d.prototype,"sublayers",void 0),a([N(["web-document","portal-item"],"sublayers",["layers","visibleLayers"])],d.prototype,"readSublayersFromItemOrMap",null),a([N("service","sublayers",["layers"])],d.prototype,"readSublayers",null),a([G("sublayers",{layers:{type:[z]},visibleLayers:{type:[String]}})],d.prototype,"writeSublayers",null),a([u({json:{read:!1},readOnly:!0,value:"wms"})],d.prototype,"type",void 0),a([u(et)],d.prototype,"url",void 0),a([u({type:String,json:{write:{ignoreOrigin:!0}}})],d.prototype,"version",void 0),d=a([he("esri.layers.WMSLayer")],d);const bt=d;export{bt as default}; diff --git a/assets/WMSLayerView2D.1b7f0c8d.js b/assets/WMSLayerView2D.ed538bb1.js similarity index 81% rename from assets/WMSLayerView2D.1b7f0c8d.js rename to assets/WMSLayerView2D.ed538bb1.js index 22ba6ed..c09bb82 100644 --- a/assets/WMSLayerView2D.1b7f0c8d.js +++ b/assets/WMSLayerView2D.ed538bb1.js @@ -1 +1 @@ -import{a6 as s,a7 as m,da as F,a8 as b,n as g,x as M,s as E,_ as V,cU as R}from"./index.d94abe07.js";import{a as I}from"./BitmapContainer.3274be0c.js";import{y as U,u as $}from"./LayerView.42d17220.js";import{v as q}from"./ExportStrategy.e65233e4.js";import{i as W}from"./RefreshableLayerView.28a00159.js";import{l as L}from"./ExportWMSImageParameters.bc1ac1a0.js";import"./WGLContainer.1850619d.js";import"./enums.2d9e6f64.js";import"./pixelUtils.82950e1a.js";import"./utils.4b023c9d.js";import"./Utils.7f6f3a6b.js";import"./enums.0295eb81.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.229b1dd6.js";import"./VertexArrayObject.a4c1d809.js";import"./ProgramTemplate.e9a5aa54.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./Bitmap.43defcb1.js";const j=t=>{let e=class extends t{initialize(){this.exportImageParameters=new L({layer:this.layer})}destroy(){this.exportImageParameters.destroy(),this.exportImageParameters=null}get exportImageVersion(){var r;return(r=this.exportImageParameters)==null||r.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}fetchPopupFeatures(r){const{layer:a}=this;if(!r)return Promise.reject(new g("wmslayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:a}));const{popupEnabled:n}=a;if(!n)return Promise.reject(new g("wmslayerview:fetchPopupFeatures","popupEnabled should be true",{popupEnabled:n}));const u=this.createFetchPopupFeaturesQuery(r);if(!u)return Promise.resolve([]);const{extent:i,width:o,height:p,x:d,y:l}=u;if(!(i&&o&&p))throw new g("wmslayerview:fetchPopupFeatures","WMSLayer does not support fetching features.",{extent:i,width:o,height:p});return a.fetchFeatureInfo(i,o,p,d,l)}};return s([m()],e.prototype,"exportImageParameters",void 0),s([m({readOnly:!0})],e.prototype,"exportImageVersion",null),s([m()],e.prototype,"layer",void 0),s([m(F)],e.prototype,"timeExtent",void 0),e=s([b("esri.layers.mixins.WMSLayerView")],e),e};let h=class extends j(W(U($))){constructor(){super(...arguments),this.bitmapContainer=new I}supportsSpatialReference(t){return this.layer.serviceSupportsSpatialReference(t)}update(t){this.strategy.update(t).catch(e=>{M(e)||E.getLogger(this.declaredClass).error(e)})}attach(){const{layer:t}=this,{imageMaxHeight:e,imageMaxWidth:r}=t;this.bitmapContainer=new I,this.container.addChild(this.bitmapContainer),this.strategy=new q({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:e,imageMaxWidth:r,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.handles.add(V(()=>this.exportImageVersion,()=>this.requestUpdate()),"exportImageVersion")}detach(){this.handles.remove("exportImageVersion"),this.strategy.destroy(),this.strategy=null,this.container.removeAllChildren()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(t){const{view:e,bitmapContainer:r}=this,{x:a,y:n}=t,{spatialReference:u}=e;let i=null,o=0,p=0;if(r.children.some(C=>{const{width:x,height:f,resolution:w,x:c,y}=C,v=c+w*x,P=y-w*f;return a>=c&&a<=v&&n<=y&&n>=P&&(i=new R({xmin:c,ymin:P,xmax:v,ymax:y,spatialReference:u}),o=x,p=f,!0)}),!i)return null;const d=i.width/o,l=Math.round((a-i.xmin)/d),S=Math.round((i.ymax-n)/d);return{extent:i,width:o,height:p,x:l,y:S}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(t,e,r,a){return this.layer.fetchImageBitmap(t,e,r,{timeExtent:this.timeExtent,...a})}};s([m()],h.prototype,"strategy",void 0),s([m()],h.prototype,"updating",void 0),h=s([b("esri.views.2d.layers.WMSLayerView2D")],h);const se=h;export{se as default}; +import{a6 as s,a7 as m,da as F,a8 as b,n as g,x as M,s as E,_ as V,cU as R}from"./index.221827cd.js";import{a as I}from"./BitmapContainer.9e943f6d.js";import{y as U,u as $}from"./LayerView.ce6e0535.js";import{v as q}from"./ExportStrategy.fb59ab52.js";import{i as W}from"./RefreshableLayerView.887ed8c3.js";import{l as L}from"./ExportWMSImageParameters.013012f9.js";import"./WGLContainer.347cc5cd.js";import"./enums.2d9e6f64.js";import"./pixelUtils.9c6f8dae.js";import"./utils.0160becb.js";import"./Utils.2136650a.js";import"./enums.0295eb81.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.0cadabc1.js";import"./VertexArrayObject.53cf1857.js";import"./ProgramTemplate.cf9dd4e8.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";import"./Bitmap.72a3702e.js";const j=t=>{let e=class extends t{initialize(){this.exportImageParameters=new L({layer:this.layer})}destroy(){this.exportImageParameters.destroy(),this.exportImageParameters=null}get exportImageVersion(){var r;return(r=this.exportImageParameters)==null||r.commitProperty("version"),this.commitProperty("timeExtent"),(this._get("exportImageVersion")||0)+1}fetchPopupFeatures(r){const{layer:a}=this;if(!r)return Promise.reject(new g("wmslayerview:fetchPopupFeatures","Nothing to fetch without area",{layer:a}));const{popupEnabled:n}=a;if(!n)return Promise.reject(new g("wmslayerview:fetchPopupFeatures","popupEnabled should be true",{popupEnabled:n}));const u=this.createFetchPopupFeaturesQuery(r);if(!u)return Promise.resolve([]);const{extent:i,width:o,height:p,x:d,y:l}=u;if(!(i&&o&&p))throw new g("wmslayerview:fetchPopupFeatures","WMSLayer does not support fetching features.",{extent:i,width:o,height:p});return a.fetchFeatureInfo(i,o,p,d,l)}};return s([m()],e.prototype,"exportImageParameters",void 0),s([m({readOnly:!0})],e.prototype,"exportImageVersion",null),s([m()],e.prototype,"layer",void 0),s([m(F)],e.prototype,"timeExtent",void 0),e=s([b("esri.layers.mixins.WMSLayerView")],e),e};let h=class extends j(W(U($))){constructor(){super(...arguments),this.bitmapContainer=new I}supportsSpatialReference(t){return this.layer.serviceSupportsSpatialReference(t)}update(t){this.strategy.update(t).catch(e=>{M(e)||E.getLogger(this.declaredClass).error(e)})}attach(){const{layer:t}=this,{imageMaxHeight:e,imageMaxWidth:r}=t;this.bitmapContainer=new I,this.container.addChild(this.bitmapContainer),this.strategy=new q({container:this.bitmapContainer,fetchSource:this.fetchImage.bind(this),requestUpdate:this.requestUpdate.bind(this),imageMaxHeight:e,imageMaxWidth:r,imageRotationSupported:!1,imageNormalizationSupported:!1,hidpi:!1}),this.handles.add(V(()=>this.exportImageVersion,()=>this.requestUpdate()),"exportImageVersion")}detach(){this.handles.remove("exportImageVersion"),this.strategy.destroy(),this.strategy=null,this.container.removeAllChildren()}moveStart(){}viewChange(){}moveEnd(){this.requestUpdate()}createFetchPopupFeaturesQuery(t){const{view:e,bitmapContainer:r}=this,{x:a,y:n}=t,{spatialReference:u}=e;let i=null,o=0,p=0;if(r.children.some(C=>{const{width:x,height:f,resolution:w,x:c,y}=C,v=c+w*x,P=y-w*f;return a>=c&&a<=v&&n<=y&&n>=P&&(i=new R({xmin:c,ymin:P,xmax:v,ymax:y,spatialReference:u}),o=x,p=f,!0)}),!i)return null;const d=i.width/o,l=Math.round((a-i.xmin)/d),S=Math.round((i.ymax-n)/d);return{extent:i,width:o,height:p,x:l,y:S}}async doRefresh(){this.requestUpdate()}isUpdating(){return this.strategy.updating||this.updateRequested}fetchImage(t,e,r,a){return this.layer.fetchImageBitmap(t,e,r,{timeExtent:this.timeExtent,...a})}};s([m()],h.prototype,"strategy",void 0),s([m()],h.prototype,"updating",void 0),h=s([b("esri.views.2d.layers.WMSLayerView2D")],h);const se=h;export{se as default}; diff --git a/assets/WMTSLayer.2d04341c.js b/assets/WMTSLayer.902b88c8.js similarity index 99% rename from assets/WMTSLayer.2d04341c.js rename to assets/WMTSLayer.902b88c8.js index 1f6cad9..9e56805 100644 --- a/assets/WMTSLayer.2d04341c.js +++ b/assets/WMTSLayer.902b88c8.js @@ -1 +1 @@ -import{kn as re,a6 as o,a7 as u,cU as R,du as z,a8 as k,cx as X,d2 as C,cE as G,n as N,af as fe,ko as B,kp as ge,c as Y,i2 as we,ia as xe,i3 as ve,eF as Se,eG as Me,eH as Ie,_ as ie,dz as j,c$ as se,aU as ae,eA as Te,U as K,b4 as le,bX as oe,dR as Le,e0 as be,cF as Ee}from"./index.d94abe07.js";import{p as Pe,x as Ce}from"./WebTileLayer.ab421225.js";import{o as Q}from"./crsUtils.daf46943.js";import{o as ne}from"./xmlUtils.56e603f6.js";class Oe{constructor(t,r=0,i=t.lods.length-1){this.tileInfo=t,this.minLOD=r,this.maxLOD=i}getAvailability(t,r,i){var l;const s=(l=this.tileInfo)==null?void 0:l.lodAt(t);return!s||tthis.maxLOD?"unavailable":s.cols&&s.rows?i>=s.cols[0]&&i<=s.cols[1]&&r>=s.rows[0]&&r<=s.rows[1]?"available":"unavailable":"available"}async fetchAvailability(t,r,i,s){return await re(s),this.getAvailability(t,r,i)}async fetchAvailabilityUpsample(t,r,i,s,l){await re(l),s.level=t,s.row=r,s.col=i;const a=this.tileInfo;for(a.updateTileInfo(s);;){const n=this.getAvailability(s.level,s.row,s.col);if(n!=="unavailable")return n;if(!a.upsampleTile(s))return"unavailable"}}}var J;let F=J=class extends X{constructor(e){super(e),this.fullExtent=null,this.id=null,this.tileInfo=null}clone(){const e=new J;return this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent&&this.fullExtent.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("tileInfo")&&(e.tileInfo=this.tileInfo&&this.tileInfo.clone()),e}};o([u({type:R,json:{read:{source:"fullExtent"}}})],F.prototype,"fullExtent",void 0),o([u({type:String,json:{read:{source:"id"}}})],F.prototype,"id",void 0),o([u({type:z,json:{read:{source:"tileInfo"}}})],F.prototype,"tileInfo",void 0),F=J=o([k("esri.layer.support.TileMatrixSet")],F);const Re=F;var q;let L=q=class extends X{constructor(e){super(e),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const e=new q;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("isDefault")&&(e.isDefault=this.isDefault),this.hasOwnProperty("keywords")&&(e.keywords=this.keywords&&this.keywords.slice()),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([u({json:{read:{source:"id"}}})],L.prototype,"id",void 0),o([u({json:{read:{source:"title"}}})],L.prototype,"title",void 0),o([u({json:{read:{source:"abstract"}}})],L.prototype,"description",void 0),o([u({json:{read:{source:"legendUrl"}}})],L.prototype,"legendUrl",void 0),o([u({json:{read:{source:"isDefault"}}})],L.prototype,"isDefault",void 0),o([u({json:{read:{source:"keywords"}}})],L.prototype,"keywords",void 0),L=q=o([k("esri.layer.support.WMTSStyle")],L);const Fe=L;var H;let S=H=class extends X{constructor(e){super(e),this.fullExtent=null,this.fullExtents=null,this.imageFormats=null,this.id=null,this.layer=null,this.styles=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}get description(){return this._get("description")}set description(e){this._set("description",e)}readFullExtent(e,t){return(e=t.fullExtent)?R.fromJSON(e):null}readFullExtents(e,t){var r,i,s;return(r=t.fullExtents)!=null&&r.length?t.fullExtents.map(l=>R.fromJSON(l)):(s=(i=t.tileMatrixSets)==null?void 0:i.map(l=>R.fromJSON(l.fullExtent)).filter(l=>l))!=null?s:[]}get imageFormat(){let e=this._get("imageFormat");return e||(e=this.imageFormats&&this.imageFormats.length?this.imageFormats[0]:""),e}set imageFormat(e){const t=this.imageFormats;e&&(e.includes("image/")||t&&!t.includes(e))&&(e.includes("image/")||(e="image/"+e),t&&!t.includes(e))?console.error("The layer doesn't support the format of "+e):this._set("imageFormat",e)}get styleId(){var t;let e=this._get("styleId");return e||(e=(t=this.styles)!=null&&t.length?this.styles.getItemAt(0).id:""),e}set styleId(e){this._set("styleId",e)}get title(){return this._get("title")}set title(e){this._set("title",e)}get tileMatrixSet(){return this.tileMatrixSets?this.tileMatrixSets.find(e=>e.id===this.tileMatrixSetId):null}clone(){var t;const e=new H;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("imageFormats")&&(e.imageFormats=this.imageFormats&&this.imageFormats.slice()),this.hasOwnProperty("imageFormat")&&(e.imageFormat=this.imageFormat),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent&&this.fullExtent.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("styleId")&&(e.styleId=this.styleId),this.hasOwnProperty("styles")&&(e.styles=this.styles&&this.styles.clone()),this.hasOwnProperty("tileMatrixSetId")&&(e.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty("tileMatrixSets")&&(e.tileMatrixSets=(t=this.tileMatrixSets)==null?void 0:t.clone()),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([u()],S.prototype,"description",null),o([u()],S.prototype,"fullExtent",void 0),o([C("fullExtent",["fullExtent"])],S.prototype,"readFullExtent",null),o([u({readOnly:!0})],S.prototype,"fullExtents",void 0),o([C("fullExtents",["fullExtents","tileMatrixSets"])],S.prototype,"readFullExtents",null),o([u()],S.prototype,"imageFormat",null),o([u({json:{read:{source:"formats"}}})],S.prototype,"imageFormats",void 0),o([u()],S.prototype,"id",void 0),o([u()],S.prototype,"layer",void 0),o([u()],S.prototype,"styleId",null),o([u({type:G.ofType(Fe),json:{read:{source:"styles"}}})],S.prototype,"styles",void 0),o([u({value:null,json:{write:{ignoreOrigin:!0}}})],S.prototype,"title",null),o([u()],S.prototype,"tileMatrixSetId",void 0),o([u({readOnly:!0})],S.prototype,"tileMatrixSet",null),o([u({type:G.ofType(Re),json:{read:{source:"tileMatrixSets"}}})],S.prototype,"tileMatrixSets",void 0),S=H=o([k("esri.layers.support.WMTSSublayer")],S);const U=S,de=90.71428571428571;function ue(e){const t=e.replace(/ows:/gi,"");if(!x("Contents",new DOMParser().parseFromString(t,"text/xml").documentElement))throw new N("wmtslayer:wmts-capabilities-xml-is-not-valid","the wmts get capabilities response is not compliant",{text:e})}function $e(e,t){var _,te;e=e.replace(/ows:/gi,"");const r=new DOMParser().parseFromString(e,"text/xml").documentElement,i=new Map,s=new Map,l=x("Contents",r);if(!l)throw new N("wmtslayer:wmts-capabilities-xml-is-not-valid");const a=(_=x("OperationsMetadata",r))==null?void 0:_.querySelector("[name='GetTile']"),n=a==null?void 0:a.getElementsByTagName("Get"),c=n&&Array.prototype.slice.call(n),m=(te=t.url)==null?void 0:te.indexOf("https"),g=m!==void 0&&m>-1;let f,p,h=t.serviceMode,w=t==null?void 0:t.url;if(c&&c.length&&c.some(M=>{const T=x("Constraint",M);return!T||V("AllowedValues","Value",h,T)?(w=M.attributes[0].nodeValue,!0):(!T||V("AllowedValues","Value","RESTful",T)||V("AllowedValues","Value","REST",T)?p=M.attributes[0].nodeValue:T&&!V("AllowedValues","Value","KVP",T)||(f=M.attributes[0].nodeValue),!1)}),!w)if(p)w=p,h="RESTful";else if(f)w=f,h="KVP";else{const M=x("ServiceMetadataURL",r);w=M==null?void 0:M.getAttribute("xlink:href")}const b=w.indexOf("1.0.0/");b===-1&&h==="RESTful"?w+="/":b>-1&&(w=w.substring(0,b)),h==="KVP"&&(w+=b>-1?"":"?"),g&&(w=w.replace(/^http:/i,"https:"));const $=y("ServiceIdentification>ServiceTypeVersion",r),v=y("ServiceIdentification>AccessConstraints",r),I=v&&/^none$/i.test(v)?null:v,E=P("Layer",l),D=P("TileMatrixSet",l),W=E.map(M=>{const T=y("Identifier",M);return i.set(T,M),Ae(T,M,D,g,$)});return{copyright:I,dimensionMap:s,layerMap:i,layers:W,serviceMode:h,tileUrl:w}}function Ve(e){return e.layers.forEach(t=>{var r;(r=t.tileMatrixSets)==null||r.forEach(i=>{var l;const s=i.tileInfo;s&&s.dpi!==96&&((l=s.lods)==null||l.forEach(a=>{var n;a.scale=96*a.scale/s.dpi,a.resolution=ye((n=s.spatialReference)==null?void 0:n.wkid,a.scale*de/96,i.id)}),s.dpi=96)})}),e}function Z(e){return e.nodeType===Node.ELEMENT_NODE}function x(e,t){for(let r=0;ri.textContent).filter(Y)}function y(e,t){return e.split(">").forEach(r=>{t&&(t=x(r,t))}),t&&t.textContent}function V(e,t,r,i){let s;return Array.prototype.slice.call(i.childNodes).some(l=>{if(l.nodeName.includes(e)){const a=x(t,l),n=a&&a.textContent;if(n===r||r.split(":")&&r.split(":")[1]===n)return s=l,!0}return!1}),s}function Ae(e,t,r,i,s){const l=y("Abstract",t),a=O("Format",t);return{id:e,fullExtent:Ne(t),fullExtents:ke(t),description:l,formats:a,styles:De(t,i),title:y("Title",t),tileMatrixSets:We(s,t,r)}}function me(e,t){var g;const r=[],i=(g=e.layerMap)==null?void 0:g.get(t);if(!i)return null;const s=P("ResourceURL",i),l=P("Dimension",i);let a,n,c,m;return l.length&&(a=y("Identifier",l[0]),n=O("Default",l[0])||O("Value",l[0])),l.length>1&&(c=y("Identifier",l[1]),m=O("Default",l[1])||O("Value",l[1])),e.dimensionMap.set(t,{dimensions:n,dimensions2:m}),s.forEach(f=>{let p=f.getAttribute("template");if(f.getAttribute("resourceType")==="tile"){if(a&&n.length)if(p.includes("{"+a+"}"))p=p.replace("{"+a+"}","{dimensionValue}");else{const h=p.toLowerCase().indexOf("{"+a.toLowerCase()+"}");h>-1&&(p=p.substring(0,h)+"{dimensionValue}"+p.substring(h+a.length+2))}if(c&&m.length)if(p.includes("{"+c+"}"))p=p.replace("{"+c+"}","{dimensionValue2}");else{const h=p.toLowerCase().indexOf("{"+c.toLowerCase()+"}");h>-1&&(p=p.substring(0,h)+"{dimensionValue2}"+p.substring(h+c.length+2))}r.push({template:p,format:f.getAttribute("format"),resourceType:"tile"})}}),r}function Ue(e,t,r,i,s,l,a,n){var p,h;const c=_e(e,t,i);if(!((c==null?void 0:c.length)>0))return"";const{dimensionMap:m}=e,g=(p=m.get(t).dimensions)==null?void 0:p[0],f=(h=m.get(t).dimensions2)==null?void 0:h[0];return c[a%c.length].template.replace(/\{Style\}/gi,s!=null?s:"").replace(/\{TileMatrixSet\}/gi,r!=null?r:"").replace(/\{TileMatrix\}/gi,l).replace(/\{TileRow\}/gi,""+a).replace(/\{TileCol\}/gi,""+n).replace(/\{dimensionValue\}/gi,g).replace(/\{dimensionValue2\}/gi,f)}function _e(e,t,r){var l;const i=me(e,t),s=i==null?void 0:i.filter(a=>a.format===r);return(l=s!=null&&s.length?s:i)!=null?l:[]}function je(e,t,r,i){const{dimensionMap:s}=e,l=me(e,t);let a="";if(l&&l.length>0){const n=s.get(t).dimensions&&s.get(t).dimensions[0],c=s.get(t).dimensions2&&s.get(t).dimensions2[0];a=l[0].template,a.indexOf(".xxx")===a.length-4&&(a=a.slice(0,a.length-4)),a=a.replace(/\{Style\}/gi,i),a=a.replace(/\{TileMatrixSet\}/gi,r),a=a.replace(/\{TileMatrix\}/gi,"{level}"),a=a.replace(/\{TileRow\}/gi,"{row}"),a=a.replace(/\{TileCol\}/gi,"{col}"),a=a.replace(/\{dimensionValue\}/gi,n),a=a.replace(/\{dimensionValue2\}/gi,c)}return a}function Ne(e){const t=x("WGS84BoundingBox",e),r=t?y("LowerCorner",t).split(" "):["-180","-90"],i=t?y("UpperCorner",t).split(" "):["180","90"];return{xmin:parseFloat(r[0]),ymin:parseFloat(r[1]),xmax:parseFloat(i[0]),ymax:parseFloat(i[1]),spatialReference:{wkid:4326}}}function ke(e){const t=[];return ne(e,{BoundingBox:r=>{if(!r.getAttribute("crs"))return;const i=r.getAttribute("crs").toLowerCase(),s=ee(i),l=i.includes("epsg")&&Q(s.wkid);let a,n,c,m;ne(r,{LowerCorner:g=>{[a,n]=g.textContent.split(" ").map(f=>Number.parseFloat(f)),l&&([a,n]=[n,a])},UpperCorner:g=>{[c,m]=g.textContent.split(" ").map(f=>Number.parseFloat(f)),l&&([c,m]=[m,c])}}),t.push({xmin:a,ymin:n,xmax:c,ymax:m,spatialReference:s})}}),t}function De(e,t){return P("Style",e).map(r=>{const i=x("LegendURL",r),s=x("Keywords",r),l=s?O("Keyword",s):[];let a=i&&i.getAttribute("xlink:href");return t&&(a=a&&a.replace(/^http:/i,"https:")),{abstract:y("Abstract",r),id:y("Identifier",r),isDefault:r.getAttribute("isDefault")==="true",keywords:l,legendUrl:a,title:y("Title",r)}})}function We(e,t,r){return P("TileMatrixSetLink",t).map(i=>Be(e,i,r))}function Be(e,t,r){const i=x("TileMatrixSet",t).textContent,s=O("TileMatrix",t),l=r.find(v=>{const I=x("Identifier",v),E=I&&I.textContent;return!!(E===i||i.split(":")&&i.split(":")[1]===E)}),a=x("TileMatrixSetLimits",t),n=a&&P("TileMatrixLimits",a),c=new Map;if(n!=null&&n.length)for(const v of n){const I=x("TileMatrix",v).textContent,E=+x("MinTileRow",v).textContent,D=+x("MaxTileRow",v).textContent,W=+x("MinTileCol",v).textContent,_=+x("MaxTileCol",v).textContent;c.set(I,{minCol:W,maxCol:_,minRow:E,maxRow:D})}const m=y("SupportedCRS",l).toLowerCase(),g=Ke(l,m),f=g.spatialReference,p=x("TileMatrix",l),h=[parseInt(y("TileWidth",p),10),parseInt(y("TileHeight",p),10)],w=[];s.length?s.forEach((v,I)=>{const E=V("TileMatrix","Identifier",v,l);w.push(ce(E,m,I,i,c))}):P("TileMatrix",l).forEach((v,I)=>{w.push(ce(v,m,I,i,c))});const b=Ge(e,l,g,h,w[0]).toJSON(),$=new z({dpi:96,spatialReference:f,size:h,origin:g,lods:w}).toJSON();return{id:i,fullExtent:b,tileInfo:$}}function ee(e){e=e.toLowerCase();let t=parseInt(e.split(":").pop(),10);t!==900913&&t!==3857||(t=102100);const r=qe(e);return Y(r)&&(t=r),{wkid:t}}function Ke(e,t){return he(x("TileMatrix",e),t)}function he(e,t){const r=ee(t),[i,s]=y("TopLeftCorner",e).split(" ").map(a=>parseFloat(a)),l=t.includes("epsg")&&Q(r.wkid);return new fe(l?{x:s,y:i,spatialReference:r}:{x:i,y:s,spatialReference:r})}function Ge(e,t,r,i,s){const l=x("BoundingBox",t);let a,n,c,m,g,f;if(l&&(a=y("LowerCorner",l).split(" "),n=y("UpperCorner",l).split(" ")),a&&a.length>1&&n&&n.length>1)c=parseFloat(a[0]),g=parseFloat(a[1]),m=parseFloat(n[0]),f=parseFloat(n[1]);else{const p=x("TileMatrix",t),h=parseInt(y("MatrixWidth",p),10),w=parseInt(y("MatrixHeight",p),10);c=r.x,f=r.y,m=c+h*i[0]*s.resolution,g=f-w*i[1]*s.resolution}return Je(e,r.spatialReference,r)?new R(g,c,f,m,r.spatialReference):new R(c,g,m,f,r.spatialReference)}function Je(e,t,r){return e==="1.0.0"&&Q(t.wkid)&&!(r.spatialReference.isGeographic&&r.x<-90&&r.y>=-90)}var A;function qe(e){return e.includes("crs84")||e.includes("crs:84")?A.CRS84:e.includes("crs83")||e.includes("crs:83")?A.CRS83:e.includes("crs27")||e.includes("crs:27")?A.CRS27:null}function ce(e,t,r,i,s){var v;const l=ee(t),a=y("Identifier",e);let n=parseFloat(y("ScaleDenominator",e));const c=ye(l.wkid,n,i);n*=96/de;const m=+y("MatrixWidth",e),g=+y("MatrixHeight",e),{maxCol:f=m-1,maxRow:p=g-1,minCol:h=0,minRow:w=0}=(v=s.get(a))!=null?v:{},{x:b,y:$}=he(e,t);return{cols:[h,f],level:r,levelValue:a,origin:[b,$],scale:n,resolution:c,rows:[w,p]}}function ye(e,t,r){let i;return i=B.hasOwnProperty(""+e)?B.values[B[e]]:r==="default028mm"?6370997*Math.PI/180:ge(e).metersPerDegree,7*t/25e3/i}(function(e){e[e.CRS84=4326]="CRS84",e[e.CRS83=4269]="CRS83",e[e.CRS27=4267]="CRS27"})(A||(A={}));const pe={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""},He=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let d=class extends we(xe(ve(Se(Me(Ie(Ee)))))){constructor(...e){super(...e),this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.addHandles([ie(()=>this.activeLayer,(t,r)=>{r&&(r.layer=null),t&&(t.layer=this)},j),se(()=>this.sublayers,"after-add",({item:t})=>{t.layer=this},j),se(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=null},j),ie(()=>this.sublayers,(t,r)=>{if(r)for(const i of r)i.layer=null;if(t)for(const i of t)i.layer=this},j)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){if(this.serviceMode==="KVP"||this.serviceMode==="RESTful")return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(ae).then(()=>this._fetchService(e)).catch(t=>{throw ae(t),new N("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:t})})),Promise.resolve(this);console.error("WMTS mode could only be 'KVP' or 'RESTful'")}get activeLayer(){return this._get("activeLayer")}set activeLayer(e){this._set("activeLayer",e)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new U);let i=t.layers.find(s=>s.id===this.activeLayer.id);return i||(i=t.layers[0]),this.activeLayer.read(i,r),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:r,wmtsInfo:i}=t,s=r?this._getLowerCasedUrlParams(r):null,l=i==null?void 0:i.layerIdentifier;let a=null;const n=i==null?void 0:i.tileMatrixSet;n&&(Array.isArray(n)?n.length&&(a=n[0]):a=n);const c=s==null?void 0:s.format,m=s==null?void 0:s.style;return new U({id:l,imageFormat:c,styleId:m,tileMatrixSetId:a})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const l=Te("tileMatrixSet.tileInfo",s);t.tileInfo=l?l.toJSON(i):null,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:s.id,tileMatrixSet:s.tileMatrixSetId}}readCustomParameters(e,t){const r=t.wmtsInfo;return r?this._mergeParams(r.customParameters,r.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,r){return ze(t.layers,r)}get supportedSpatialReferences(){var e,t;return(t=(e=this.activeLayer.tileMatrixSets)==null?void 0:e.map(r=>{var i;return(i=r.tileInfo)==null?void 0:i.spatialReference}).toArray().filter(Y))!=null?t:[]}get tilemapCache(){var t,r;const e=(r=(t=this.activeLayer)==null?void 0:t.tileMatrixSet)==null?void 0:r.tileInfo;return e?new Oe(e):void 0}get title(){var e,t;return(t=(e=this.activeLayer)==null?void 0:e.title)!=null?t:"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&e.substr(-1)==="/"?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){var l;const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=(l=this._getTileMatrixSetById(e.tileMatrixSetId))==null?void 0:l.tileInfo,i=e.fullExtent,s=new Pe({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(s.customLayerParameters=this.customLayerParameters),this.customParameters&&(s.customParameters=this.customParameters),new Ce({fullExtent:i,urlTemplate:t,tileInfo:r,wmtsInfo:s})}fetchTile(e,t,r){const i=this.getTileUrl(e,t,r);return K(i,{responseType:"image"}).then(s=>s.data)}async fetchImageBitmapTile(e,t,r){const i=this.getTileUrl(e,t,r),{data:s}=await K(i,{responseType:"blob"});return createImageBitmap(s)}findSublayerById(e){var t;return(t=this.sublayers)==null?void 0:t.find(r=>r.id===e)}getTileUrl(e,t,r){var a,n;const i=(n=(a=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId))==null?void 0:a.tileInfo)==null?void 0:n.lods[e],s=i?i.levelValue?i.levelValue:`${i.level}`:`${e}`;let l=this.resourceInfo?"":Ue({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,s,t,r);return l||(l=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replace(/\{level\}/gi,s).replace(/\{row\}/gi,`${t}`).replace(/\{col\}/gi,`${r}`)),l=this._appendCustomLayerParameters(l),l}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const s=je({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,i);if(s)return s}if(this.serviceMode==="KVP")return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+i+"&FORMAT="+r+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if(this.serviceMode==="RESTful"){let s="";return pe[r.toLowerCase()]&&(s=pe[r.toLowerCase()]),this.url+e+"/"+i+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){let t;if(this.resourceInfo)this.resourceInfo.serviceMode==="KVP"&&(this.url+=this.url.includes("?")?"":"?"),t={ssl:!1,data:this.resourceInfo};else try{t=await this._getCapabilities(this.serviceMode,e),ue(t.data)}catch{const r=this.serviceMode==="KVP"?"RESTful":"KVP";try{t=await this._getCapabilities(r,e),ue(t.data),this.serviceMode=r}catch(i){throw new N("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:i})}}this.resourceInfo?t.data=Ve(t.data):t.data=$e(t.data,{serviceMode:this.serviceMode,url:this.url}),t.data&&this.read(t.data,{origin:"service"})}async _getCapabilities(e,t){const r=this._getCapabilitiesUrl(e);return await K(r,{...t,responseType:"text"})}_getTileMatrixSetById(e){var r,i;return(i=(r=this.findSublayerById(this.activeLayer.id))==null?void 0:r.tileMatrixSets)==null?void 0:i.find(s=>s.id===e)}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...le(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const r=oe(e),i={...r.query,...t},s=Le(i);return s===""?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){this.url=this.url.split("?")[0];const t=e==="KVP"?`${this.url}?request=GetCapabilities&service=WMTS&version=${this.version}`:`${this.url}/${this.version}/WMTSCapabilities.xml`;return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=oe(e).query;if(!t)return null;const r={};return Object.keys(t).forEach(i=>{r[i.toLowerCase()]=t[i]}),r}_mergeParams(e,t){const r=this._getLowerCasedUrlParams(t);if(r){const i=Object.keys(r);i.length&&(e=e?le(e):{},i.forEach(s=>{e.hasOwnProperty(s)||He.has(s)||(e[s]=r[s])}))}return e}};function ze(e,t){return e.map(r=>{const i=new U;return i.read(r,t),i})}o([u()],d.prototype,"dimensionMap",void 0),o([u()],d.prototype,"layerMap",void 0),o([u({type:U,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],d.prototype,"activeLayer",null),o([C("service","activeLayer",["layers"])],d.prototype,"readActiveLayerFromService",null),o([C(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],d.prototype,"readActiveLayerFromItemOrWebDoc",null),o([be(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:z},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],d.prototype,"writeActiveLayer",null),o([u({type:String,value:"",json:{write:!0}})],d.prototype,"copyright",void 0),o([u({type:["show","hide"]})],d.prototype,"listMode",void 0),o([u({json:{read:!0,write:!0}})],d.prototype,"blendMode",void 0),o([u({json:{origins:{"web-document":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}}}}})],d.prototype,"customParameters",void 0),o([C(["portal-item","web-document"],"customParameters")],d.prototype,"readCustomParameters",null),o([u({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],d.prototype,"customLayerParameters",void 0),o([u({type:R,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],d.prototype,"fullExtent",void 0),o([u({readOnly:!0})],d.prototype,"fullExtents",null),o([u({type:["WebTiledLayer"]})],d.prototype,"operationalLayerType",void 0),o([u()],d.prototype,"resourceInfo",void 0),o([u()],d.prototype,"serviceMode",void 0),o([C(["portal-item","web-document"],"serviceMode",["templateUrl"])],d.prototype,"readServiceMode",null),o([u({type:G.ofType(U)})],d.prototype,"sublayers",void 0),o([C("service","sublayers",["layers"])],d.prototype,"readSublayersFromService",null),o([u({readOnly:!0})],d.prototype,"supportedSpatialReferences",null),o([u({readOnly:!0})],d.prototype,"tilemapCache",null),o([u({json:{read:{source:"title"}}})],d.prototype,"title",null),o([u({json:{read:!1},readOnly:!0,value:"wmts"})],d.prototype,"type",void 0),o([u({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],d.prototype,"url",null),o([u()],d.prototype,"version",void 0),d=o([k("esri.layers.WMTSLayer")],d);const et=d;export{et as default}; +import{kn as re,a6 as o,a7 as u,cU as R,du as z,a8 as k,cx as X,d2 as C,cE as G,n as N,af as fe,ko as B,kp as ge,c as Y,i2 as we,ia as xe,i3 as ve,eF as Se,eG as Me,eH as Ie,_ as ie,dz as j,c$ as se,aU as ae,eA as Te,U as K,b4 as le,bX as oe,dR as Le,e0 as be,cF as Ee}from"./index.221827cd.js";import{p as Pe,x as Ce}from"./WebTileLayer.b038b70d.js";import{o as Q}from"./crsUtils.daf46943.js";import{o as ne}from"./xmlUtils.56e603f6.js";class Oe{constructor(t,r=0,i=t.lods.length-1){this.tileInfo=t,this.minLOD=r,this.maxLOD=i}getAvailability(t,r,i){var l;const s=(l=this.tileInfo)==null?void 0:l.lodAt(t);return!s||tthis.maxLOD?"unavailable":s.cols&&s.rows?i>=s.cols[0]&&i<=s.cols[1]&&r>=s.rows[0]&&r<=s.rows[1]?"available":"unavailable":"available"}async fetchAvailability(t,r,i,s){return await re(s),this.getAvailability(t,r,i)}async fetchAvailabilityUpsample(t,r,i,s,l){await re(l),s.level=t,s.row=r,s.col=i;const a=this.tileInfo;for(a.updateTileInfo(s);;){const n=this.getAvailability(s.level,s.row,s.col);if(n!=="unavailable")return n;if(!a.upsampleTile(s))return"unavailable"}}}var J;let F=J=class extends X{constructor(e){super(e),this.fullExtent=null,this.id=null,this.tileInfo=null}clone(){const e=new J;return this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent&&this.fullExtent.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("tileInfo")&&(e.tileInfo=this.tileInfo&&this.tileInfo.clone()),e}};o([u({type:R,json:{read:{source:"fullExtent"}}})],F.prototype,"fullExtent",void 0),o([u({type:String,json:{read:{source:"id"}}})],F.prototype,"id",void 0),o([u({type:z,json:{read:{source:"tileInfo"}}})],F.prototype,"tileInfo",void 0),F=J=o([k("esri.layer.support.TileMatrixSet")],F);const Re=F;var q;let L=q=class extends X{constructor(e){super(e),this.id=null,this.title=null,this.description=null,this.legendUrl=null}clone(){const e=new q;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("isDefault")&&(e.isDefault=this.isDefault),this.hasOwnProperty("keywords")&&(e.keywords=this.keywords&&this.keywords.slice()),this.hasOwnProperty("legendUrl")&&(e.legendUrl=this.legendUrl),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([u({json:{read:{source:"id"}}})],L.prototype,"id",void 0),o([u({json:{read:{source:"title"}}})],L.prototype,"title",void 0),o([u({json:{read:{source:"abstract"}}})],L.prototype,"description",void 0),o([u({json:{read:{source:"legendUrl"}}})],L.prototype,"legendUrl",void 0),o([u({json:{read:{source:"isDefault"}}})],L.prototype,"isDefault",void 0),o([u({json:{read:{source:"keywords"}}})],L.prototype,"keywords",void 0),L=q=o([k("esri.layer.support.WMTSStyle")],L);const Fe=L;var H;let S=H=class extends X{constructor(e){super(e),this.fullExtent=null,this.fullExtents=null,this.imageFormats=null,this.id=null,this.layer=null,this.styles=null,this.tileMatrixSetId=null,this.tileMatrixSets=null}get description(){return this._get("description")}set description(e){this._set("description",e)}readFullExtent(e,t){return(e=t.fullExtent)?R.fromJSON(e):null}readFullExtents(e,t){var r,i,s;return(r=t.fullExtents)!=null&&r.length?t.fullExtents.map(l=>R.fromJSON(l)):(s=(i=t.tileMatrixSets)==null?void 0:i.map(l=>R.fromJSON(l.fullExtent)).filter(l=>l))!=null?s:[]}get imageFormat(){let e=this._get("imageFormat");return e||(e=this.imageFormats&&this.imageFormats.length?this.imageFormats[0]:""),e}set imageFormat(e){const t=this.imageFormats;e&&(e.includes("image/")||t&&!t.includes(e))&&(e.includes("image/")||(e="image/"+e),t&&!t.includes(e))?console.error("The layer doesn't support the format of "+e):this._set("imageFormat",e)}get styleId(){var t;let e=this._get("styleId");return e||(e=(t=this.styles)!=null&&t.length?this.styles.getItemAt(0).id:""),e}set styleId(e){this._set("styleId",e)}get title(){return this._get("title")}set title(e){this._set("title",e)}get tileMatrixSet(){return this.tileMatrixSets?this.tileMatrixSets.find(e=>e.id===this.tileMatrixSetId):null}clone(){var t;const e=new H;return this.hasOwnProperty("description")&&(e.description=this.description),this.hasOwnProperty("imageFormats")&&(e.imageFormats=this.imageFormats&&this.imageFormats.slice()),this.hasOwnProperty("imageFormat")&&(e.imageFormat=this.imageFormat),this.hasOwnProperty("fullExtent")&&(e.fullExtent=this.fullExtent&&this.fullExtent.clone()),this.hasOwnProperty("id")&&(e.id=this.id),this.hasOwnProperty("layer")&&(e.layer=this.layer),this.hasOwnProperty("styleId")&&(e.styleId=this.styleId),this.hasOwnProperty("styles")&&(e.styles=this.styles&&this.styles.clone()),this.hasOwnProperty("tileMatrixSetId")&&(e.tileMatrixSetId=this.tileMatrixSetId),this.hasOwnProperty("tileMatrixSets")&&(e.tileMatrixSets=(t=this.tileMatrixSets)==null?void 0:t.clone()),this.hasOwnProperty("title")&&(e.title=this.title),e}};o([u()],S.prototype,"description",null),o([u()],S.prototype,"fullExtent",void 0),o([C("fullExtent",["fullExtent"])],S.prototype,"readFullExtent",null),o([u({readOnly:!0})],S.prototype,"fullExtents",void 0),o([C("fullExtents",["fullExtents","tileMatrixSets"])],S.prototype,"readFullExtents",null),o([u()],S.prototype,"imageFormat",null),o([u({json:{read:{source:"formats"}}})],S.prototype,"imageFormats",void 0),o([u()],S.prototype,"id",void 0),o([u()],S.prototype,"layer",void 0),o([u()],S.prototype,"styleId",null),o([u({type:G.ofType(Fe),json:{read:{source:"styles"}}})],S.prototype,"styles",void 0),o([u({value:null,json:{write:{ignoreOrigin:!0}}})],S.prototype,"title",null),o([u()],S.prototype,"tileMatrixSetId",void 0),o([u({readOnly:!0})],S.prototype,"tileMatrixSet",null),o([u({type:G.ofType(Re),json:{read:{source:"tileMatrixSets"}}})],S.prototype,"tileMatrixSets",void 0),S=H=o([k("esri.layers.support.WMTSSublayer")],S);const U=S,de=90.71428571428571;function ue(e){const t=e.replace(/ows:/gi,"");if(!x("Contents",new DOMParser().parseFromString(t,"text/xml").documentElement))throw new N("wmtslayer:wmts-capabilities-xml-is-not-valid","the wmts get capabilities response is not compliant",{text:e})}function $e(e,t){var _,te;e=e.replace(/ows:/gi,"");const r=new DOMParser().parseFromString(e,"text/xml").documentElement,i=new Map,s=new Map,l=x("Contents",r);if(!l)throw new N("wmtslayer:wmts-capabilities-xml-is-not-valid");const a=(_=x("OperationsMetadata",r))==null?void 0:_.querySelector("[name='GetTile']"),n=a==null?void 0:a.getElementsByTagName("Get"),c=n&&Array.prototype.slice.call(n),m=(te=t.url)==null?void 0:te.indexOf("https"),g=m!==void 0&&m>-1;let f,p,h=t.serviceMode,w=t==null?void 0:t.url;if(c&&c.length&&c.some(M=>{const T=x("Constraint",M);return!T||V("AllowedValues","Value",h,T)?(w=M.attributes[0].nodeValue,!0):(!T||V("AllowedValues","Value","RESTful",T)||V("AllowedValues","Value","REST",T)?p=M.attributes[0].nodeValue:T&&!V("AllowedValues","Value","KVP",T)||(f=M.attributes[0].nodeValue),!1)}),!w)if(p)w=p,h="RESTful";else if(f)w=f,h="KVP";else{const M=x("ServiceMetadataURL",r);w=M==null?void 0:M.getAttribute("xlink:href")}const b=w.indexOf("1.0.0/");b===-1&&h==="RESTful"?w+="/":b>-1&&(w=w.substring(0,b)),h==="KVP"&&(w+=b>-1?"":"?"),g&&(w=w.replace(/^http:/i,"https:"));const $=y("ServiceIdentification>ServiceTypeVersion",r),v=y("ServiceIdentification>AccessConstraints",r),I=v&&/^none$/i.test(v)?null:v,E=P("Layer",l),D=P("TileMatrixSet",l),W=E.map(M=>{const T=y("Identifier",M);return i.set(T,M),Ae(T,M,D,g,$)});return{copyright:I,dimensionMap:s,layerMap:i,layers:W,serviceMode:h,tileUrl:w}}function Ve(e){return e.layers.forEach(t=>{var r;(r=t.tileMatrixSets)==null||r.forEach(i=>{var l;const s=i.tileInfo;s&&s.dpi!==96&&((l=s.lods)==null||l.forEach(a=>{var n;a.scale=96*a.scale/s.dpi,a.resolution=ye((n=s.spatialReference)==null?void 0:n.wkid,a.scale*de/96,i.id)}),s.dpi=96)})}),e}function Z(e){return e.nodeType===Node.ELEMENT_NODE}function x(e,t){for(let r=0;ri.textContent).filter(Y)}function y(e,t){return e.split(">").forEach(r=>{t&&(t=x(r,t))}),t&&t.textContent}function V(e,t,r,i){let s;return Array.prototype.slice.call(i.childNodes).some(l=>{if(l.nodeName.includes(e)){const a=x(t,l),n=a&&a.textContent;if(n===r||r.split(":")&&r.split(":")[1]===n)return s=l,!0}return!1}),s}function Ae(e,t,r,i,s){const l=y("Abstract",t),a=O("Format",t);return{id:e,fullExtent:Ne(t),fullExtents:ke(t),description:l,formats:a,styles:De(t,i),title:y("Title",t),tileMatrixSets:We(s,t,r)}}function me(e,t){var g;const r=[],i=(g=e.layerMap)==null?void 0:g.get(t);if(!i)return null;const s=P("ResourceURL",i),l=P("Dimension",i);let a,n,c,m;return l.length&&(a=y("Identifier",l[0]),n=O("Default",l[0])||O("Value",l[0])),l.length>1&&(c=y("Identifier",l[1]),m=O("Default",l[1])||O("Value",l[1])),e.dimensionMap.set(t,{dimensions:n,dimensions2:m}),s.forEach(f=>{let p=f.getAttribute("template");if(f.getAttribute("resourceType")==="tile"){if(a&&n.length)if(p.includes("{"+a+"}"))p=p.replace("{"+a+"}","{dimensionValue}");else{const h=p.toLowerCase().indexOf("{"+a.toLowerCase()+"}");h>-1&&(p=p.substring(0,h)+"{dimensionValue}"+p.substring(h+a.length+2))}if(c&&m.length)if(p.includes("{"+c+"}"))p=p.replace("{"+c+"}","{dimensionValue2}");else{const h=p.toLowerCase().indexOf("{"+c.toLowerCase()+"}");h>-1&&(p=p.substring(0,h)+"{dimensionValue2}"+p.substring(h+c.length+2))}r.push({template:p,format:f.getAttribute("format"),resourceType:"tile"})}}),r}function Ue(e,t,r,i,s,l,a,n){var p,h;const c=_e(e,t,i);if(!((c==null?void 0:c.length)>0))return"";const{dimensionMap:m}=e,g=(p=m.get(t).dimensions)==null?void 0:p[0],f=(h=m.get(t).dimensions2)==null?void 0:h[0];return c[a%c.length].template.replace(/\{Style\}/gi,s!=null?s:"").replace(/\{TileMatrixSet\}/gi,r!=null?r:"").replace(/\{TileMatrix\}/gi,l).replace(/\{TileRow\}/gi,""+a).replace(/\{TileCol\}/gi,""+n).replace(/\{dimensionValue\}/gi,g).replace(/\{dimensionValue2\}/gi,f)}function _e(e,t,r){var l;const i=me(e,t),s=i==null?void 0:i.filter(a=>a.format===r);return(l=s!=null&&s.length?s:i)!=null?l:[]}function je(e,t,r,i){const{dimensionMap:s}=e,l=me(e,t);let a="";if(l&&l.length>0){const n=s.get(t).dimensions&&s.get(t).dimensions[0],c=s.get(t).dimensions2&&s.get(t).dimensions2[0];a=l[0].template,a.indexOf(".xxx")===a.length-4&&(a=a.slice(0,a.length-4)),a=a.replace(/\{Style\}/gi,i),a=a.replace(/\{TileMatrixSet\}/gi,r),a=a.replace(/\{TileMatrix\}/gi,"{level}"),a=a.replace(/\{TileRow\}/gi,"{row}"),a=a.replace(/\{TileCol\}/gi,"{col}"),a=a.replace(/\{dimensionValue\}/gi,n),a=a.replace(/\{dimensionValue2\}/gi,c)}return a}function Ne(e){const t=x("WGS84BoundingBox",e),r=t?y("LowerCorner",t).split(" "):["-180","-90"],i=t?y("UpperCorner",t).split(" "):["180","90"];return{xmin:parseFloat(r[0]),ymin:parseFloat(r[1]),xmax:parseFloat(i[0]),ymax:parseFloat(i[1]),spatialReference:{wkid:4326}}}function ke(e){const t=[];return ne(e,{BoundingBox:r=>{if(!r.getAttribute("crs"))return;const i=r.getAttribute("crs").toLowerCase(),s=ee(i),l=i.includes("epsg")&&Q(s.wkid);let a,n,c,m;ne(r,{LowerCorner:g=>{[a,n]=g.textContent.split(" ").map(f=>Number.parseFloat(f)),l&&([a,n]=[n,a])},UpperCorner:g=>{[c,m]=g.textContent.split(" ").map(f=>Number.parseFloat(f)),l&&([c,m]=[m,c])}}),t.push({xmin:a,ymin:n,xmax:c,ymax:m,spatialReference:s})}}),t}function De(e,t){return P("Style",e).map(r=>{const i=x("LegendURL",r),s=x("Keywords",r),l=s?O("Keyword",s):[];let a=i&&i.getAttribute("xlink:href");return t&&(a=a&&a.replace(/^http:/i,"https:")),{abstract:y("Abstract",r),id:y("Identifier",r),isDefault:r.getAttribute("isDefault")==="true",keywords:l,legendUrl:a,title:y("Title",r)}})}function We(e,t,r){return P("TileMatrixSetLink",t).map(i=>Be(e,i,r))}function Be(e,t,r){const i=x("TileMatrixSet",t).textContent,s=O("TileMatrix",t),l=r.find(v=>{const I=x("Identifier",v),E=I&&I.textContent;return!!(E===i||i.split(":")&&i.split(":")[1]===E)}),a=x("TileMatrixSetLimits",t),n=a&&P("TileMatrixLimits",a),c=new Map;if(n!=null&&n.length)for(const v of n){const I=x("TileMatrix",v).textContent,E=+x("MinTileRow",v).textContent,D=+x("MaxTileRow",v).textContent,W=+x("MinTileCol",v).textContent,_=+x("MaxTileCol",v).textContent;c.set(I,{minCol:W,maxCol:_,minRow:E,maxRow:D})}const m=y("SupportedCRS",l).toLowerCase(),g=Ke(l,m),f=g.spatialReference,p=x("TileMatrix",l),h=[parseInt(y("TileWidth",p),10),parseInt(y("TileHeight",p),10)],w=[];s.length?s.forEach((v,I)=>{const E=V("TileMatrix","Identifier",v,l);w.push(ce(E,m,I,i,c))}):P("TileMatrix",l).forEach((v,I)=>{w.push(ce(v,m,I,i,c))});const b=Ge(e,l,g,h,w[0]).toJSON(),$=new z({dpi:96,spatialReference:f,size:h,origin:g,lods:w}).toJSON();return{id:i,fullExtent:b,tileInfo:$}}function ee(e){e=e.toLowerCase();let t=parseInt(e.split(":").pop(),10);t!==900913&&t!==3857||(t=102100);const r=qe(e);return Y(r)&&(t=r),{wkid:t}}function Ke(e,t){return he(x("TileMatrix",e),t)}function he(e,t){const r=ee(t),[i,s]=y("TopLeftCorner",e).split(" ").map(a=>parseFloat(a)),l=t.includes("epsg")&&Q(r.wkid);return new fe(l?{x:s,y:i,spatialReference:r}:{x:i,y:s,spatialReference:r})}function Ge(e,t,r,i,s){const l=x("BoundingBox",t);let a,n,c,m,g,f;if(l&&(a=y("LowerCorner",l).split(" "),n=y("UpperCorner",l).split(" ")),a&&a.length>1&&n&&n.length>1)c=parseFloat(a[0]),g=parseFloat(a[1]),m=parseFloat(n[0]),f=parseFloat(n[1]);else{const p=x("TileMatrix",t),h=parseInt(y("MatrixWidth",p),10),w=parseInt(y("MatrixHeight",p),10);c=r.x,f=r.y,m=c+h*i[0]*s.resolution,g=f-w*i[1]*s.resolution}return Je(e,r.spatialReference,r)?new R(g,c,f,m,r.spatialReference):new R(c,g,m,f,r.spatialReference)}function Je(e,t,r){return e==="1.0.0"&&Q(t.wkid)&&!(r.spatialReference.isGeographic&&r.x<-90&&r.y>=-90)}var A;function qe(e){return e.includes("crs84")||e.includes("crs:84")?A.CRS84:e.includes("crs83")||e.includes("crs:83")?A.CRS83:e.includes("crs27")||e.includes("crs:27")?A.CRS27:null}function ce(e,t,r,i,s){var v;const l=ee(t),a=y("Identifier",e);let n=parseFloat(y("ScaleDenominator",e));const c=ye(l.wkid,n,i);n*=96/de;const m=+y("MatrixWidth",e),g=+y("MatrixHeight",e),{maxCol:f=m-1,maxRow:p=g-1,minCol:h=0,minRow:w=0}=(v=s.get(a))!=null?v:{},{x:b,y:$}=he(e,t);return{cols:[h,f],level:r,levelValue:a,origin:[b,$],scale:n,resolution:c,rows:[w,p]}}function ye(e,t,r){let i;return i=B.hasOwnProperty(""+e)?B.values[B[e]]:r==="default028mm"?6370997*Math.PI/180:ge(e).metersPerDegree,7*t/25e3/i}(function(e){e[e.CRS84=4326]="CRS84",e[e.CRS83=4269]="CRS83",e[e.CRS27=4267]="CRS27"})(A||(A={}));const pe={"image/png":".png","image/png8":".png","image/png24":".png","image/png32":".png","image/jpg":".jpg","image/jpeg":".jpeg","image/gif":".gif","image/bmp":".bmp","image/tiff":".tif","image/jpgpng":"","image/jpegpng":"","image/unknown":""},He=new Set(["version","service","request","layer","style","format","tilematrixset","tilematrix","tilerow","tilecol"]);let d=class extends we(xe(ve(Se(Me(Ie(Ee)))))){constructor(...e){super(...e),this.copyright="",this.customParameters=null,this.customLayerParameters=null,this.fullExtent=null,this.operationalLayerType="WebTiledLayer",this.resourceInfo=null,this.serviceMode="RESTful",this.sublayers=null,this.type="wmts",this.version="1.0.0",this.addHandles([ie(()=>this.activeLayer,(t,r)=>{r&&(r.layer=null),t&&(t.layer=this)},j),se(()=>this.sublayers,"after-add",({item:t})=>{t.layer=this},j),se(()=>this.sublayers,"after-remove",({item:t})=>{t.layer=null},j),ie(()=>this.sublayers,(t,r)=>{if(r)for(const i of r)i.layer=null;if(t)for(const i of t)i.layer=this},j)])}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){if(this.serviceMode==="KVP"||this.serviceMode==="RESTful")return this.addResolvingPromise(this.loadFromPortal({supportedTypes:["WMTS"]},e).catch(ae).then(()=>this._fetchService(e)).catch(t=>{throw ae(t),new N("wmtslayer:unsupported-service-data","Invalid response from the WMTS service.",{error:t})})),Promise.resolve(this);console.error("WMTS mode could only be 'KVP' or 'RESTful'")}get activeLayer(){return this._get("activeLayer")}set activeLayer(e){this._set("activeLayer",e)}readActiveLayerFromService(e,t,r){this.activeLayer||(this.activeLayer=new U);let i=t.layers.find(s=>s.id===this.activeLayer.id);return i||(i=t.layers[0]),this.activeLayer.read(i,r),this.activeLayer}readActiveLayerFromItemOrWebDoc(e,t){const{templateUrl:r,wmtsInfo:i}=t,s=r?this._getLowerCasedUrlParams(r):null,l=i==null?void 0:i.layerIdentifier;let a=null;const n=i==null?void 0:i.tileMatrixSet;n&&(Array.isArray(n)?n.length&&(a=n[0]):a=n);const c=s==null?void 0:s.format,m=s==null?void 0:s.style;return new U({id:l,imageFormat:c,styleId:m,tileMatrixSetId:a})}writeActiveLayer(e,t,r,i){const s=this.activeLayer;t.templateUrl=this.getUrlTemplate(s.id,s.tileMatrixSetId,s.imageFormat,s.styleId);const l=Te("tileMatrixSet.tileInfo",s);t.tileInfo=l?l.toJSON(i):null,t.wmtsInfo={...t.wmtsInfo,layerIdentifier:s.id,tileMatrixSet:s.tileMatrixSetId}}readCustomParameters(e,t){const r=t.wmtsInfo;return r?this._mergeParams(r.customParameters,r.url):null}get fullExtents(){return this.activeLayer.fullExtents}readServiceMode(e,t){return t.templateUrl.includes("?")?"KVP":"RESTful"}readSublayersFromService(e,t,r){return ze(t.layers,r)}get supportedSpatialReferences(){var e,t;return(t=(e=this.activeLayer.tileMatrixSets)==null?void 0:e.map(r=>{var i;return(i=r.tileInfo)==null?void 0:i.spatialReference}).toArray().filter(Y))!=null?t:[]}get tilemapCache(){var t,r;const e=(r=(t=this.activeLayer)==null?void 0:t.tileMatrixSet)==null?void 0:r.tileInfo;return e?new Oe(e):void 0}get title(){var e,t;return(t=(e=this.activeLayer)==null?void 0:e.title)!=null?t:"Layer"}set title(e){this._overrideIfSome("title",e)}get url(){return this._get("url")}set url(e){e&&e.substr(-1)==="/"?this._set("url",e.slice(0,-1)):this._set("url",e)}createWebTileLayer(e){var l;const t=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId),r=(l=this._getTileMatrixSetById(e.tileMatrixSetId))==null?void 0:l.tileInfo,i=e.fullExtent,s=new Pe({layerIdentifier:e.id,tileMatrixSet:e.tileMatrixSetId,url:this.url});return this.customLayerParameters&&(s.customLayerParameters=this.customLayerParameters),this.customParameters&&(s.customParameters=this.customParameters),new Ce({fullExtent:i,urlTemplate:t,tileInfo:r,wmtsInfo:s})}fetchTile(e,t,r){const i=this.getTileUrl(e,t,r);return K(i,{responseType:"image"}).then(s=>s.data)}async fetchImageBitmapTile(e,t,r){const i=this.getTileUrl(e,t,r),{data:s}=await K(i,{responseType:"blob"});return createImageBitmap(s)}findSublayerById(e){var t;return(t=this.sublayers)==null?void 0:t.find(r=>r.id===e)}getTileUrl(e,t,r){var a,n;const i=(n=(a=this._getTileMatrixSetById(this.activeLayer.tileMatrixSetId))==null?void 0:a.tileInfo)==null?void 0:n.lods[e],s=i?i.levelValue?i.levelValue:`${i.level}`:`${e}`;let l=this.resourceInfo?"":Ue({dimensionMap:this.dimensionMap,layerMap:this.layerMap},this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId,s,t,r);return l||(l=this.getUrlTemplate(this.activeLayer.id,this.activeLayer.tileMatrixSetId,this.activeLayer.imageFormat,this.activeLayer.styleId).replace(/\{level\}/gi,s).replace(/\{row\}/gi,`${t}`).replace(/\{col\}/gi,`${r}`)),l=this._appendCustomLayerParameters(l),l}getUrlTemplate(e,t,r,i){if(!this.resourceInfo){const s=je({dimensionMap:this.dimensionMap,layerMap:this.layerMap},e,t,i);if(s)return s}if(this.serviceMode==="KVP")return this.url+"?SERVICE=WMTS&VERSION="+this.version+"&REQUEST=GetTile&LAYER="+e+"&STYLE="+i+"&FORMAT="+r+"&TILEMATRIXSET="+t+"&TILEMATRIX={level}&TILEROW={row}&TILECOL={col}";if(this.serviceMode==="RESTful"){let s="";return pe[r.toLowerCase()]&&(s=pe[r.toLowerCase()]),this.url+e+"/"+i+"/"+t+"/{level}/{row}/{col}"+s}return""}async _fetchService(e){let t;if(this.resourceInfo)this.resourceInfo.serviceMode==="KVP"&&(this.url+=this.url.includes("?")?"":"?"),t={ssl:!1,data:this.resourceInfo};else try{t=await this._getCapabilities(this.serviceMode,e),ue(t.data)}catch{const r=this.serviceMode==="KVP"?"RESTful":"KVP";try{t=await this._getCapabilities(r,e),ue(t.data),this.serviceMode=r}catch(i){throw new N("wmtslayer:unsupported-service-data","Services does not support RESTful or KVP service modes.",{error:i})}}this.resourceInfo?t.data=Ve(t.data):t.data=$e(t.data,{serviceMode:this.serviceMode,url:this.url}),t.data&&this.read(t.data,{origin:"service"})}async _getCapabilities(e,t){const r=this._getCapabilitiesUrl(e);return await K(r,{...t,responseType:"text"})}_getTileMatrixSetById(e){var r,i;return(i=(r=this.findSublayerById(this.activeLayer.id))==null?void 0:r.tileMatrixSets)==null?void 0:i.find(s=>s.id===e)}_appendCustomParameters(e){return this._appendParameters(e,this.customParameters)}_appendCustomLayerParameters(e){return this._appendParameters(e,{...le(this.customParameters),...this.customLayerParameters})}_appendParameters(e,t){const r=oe(e),i={...r.query,...t},s=Le(i);return s===""?r.path:`${r.path}?${s}`}_getCapabilitiesUrl(e){this.url=this.url.split("?")[0];const t=e==="KVP"?`${this.url}?request=GetCapabilities&service=WMTS&version=${this.version}`:`${this.url}/${this.version}/WMTSCapabilities.xml`;return this._appendCustomParameters(t)}_getLowerCasedUrlParams(e){if(!e)return null;const t=oe(e).query;if(!t)return null;const r={};return Object.keys(t).forEach(i=>{r[i.toLowerCase()]=t[i]}),r}_mergeParams(e,t){const r=this._getLowerCasedUrlParams(t);if(r){const i=Object.keys(r);i.length&&(e=e?le(e):{},i.forEach(s=>{e.hasOwnProperty(s)||He.has(s)||(e[s]=r[s])}))}return e}};function ze(e,t){return e.map(r=>{const i=new U;return i.read(r,t),i})}o([u()],d.prototype,"dimensionMap",void 0),o([u()],d.prototype,"layerMap",void 0),o([u({type:U,json:{origins:{"web-document":{write:{ignoreOrigin:!0}}}}})],d.prototype,"activeLayer",null),o([C("service","activeLayer",["layers"])],d.prototype,"readActiveLayerFromService",null),o([C(["web-document","portal-item"],"activeLayer",["wmtsInfo"])],d.prototype,"readActiveLayerFromItemOrWebDoc",null),o([be(["web-document","portal-item"],"activeLayer",{templateUrl:{type:String},tileInfo:{type:z},"wmtsInfo.layerIdentifier":{type:String},"wmtsInfo.tileMatrixSet":{type:String}})],d.prototype,"writeActiveLayer",null),o([u({type:String,value:"",json:{write:!0}})],d.prototype,"copyright",void 0),o([u({type:["show","hide"]})],d.prototype,"listMode",void 0),o([u({json:{read:!0,write:!0}})],d.prototype,"blendMode",void 0),o([u({json:{origins:{"web-document":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}},"portal-item":{read:{source:["wmtsInfo.customParameters","wmtsInfo.url"]},write:{target:"wmtsInfo.customParameters"}}}}})],d.prototype,"customParameters",void 0),o([C(["portal-item","web-document"],"customParameters")],d.prototype,"readCustomParameters",null),o([u({json:{origins:{"web-document":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}},"portal-item":{read:{source:"wmtsInfo.customLayerParameters"},write:{target:"wmtsInfo.customLayerParameters"}}}}})],d.prototype,"customLayerParameters",void 0),o([u({type:R,json:{write:{ignoreOrigin:!0},origins:{"web-document":{read:{source:"fullExtent"}},"portal-item":{read:{source:"fullExtent"}}}}})],d.prototype,"fullExtent",void 0),o([u({readOnly:!0})],d.prototype,"fullExtents",null),o([u({type:["WebTiledLayer"]})],d.prototype,"operationalLayerType",void 0),o([u()],d.prototype,"resourceInfo",void 0),o([u()],d.prototype,"serviceMode",void 0),o([C(["portal-item","web-document"],"serviceMode",["templateUrl"])],d.prototype,"readServiceMode",null),o([u({type:G.ofType(U)})],d.prototype,"sublayers",void 0),o([C("service","sublayers",["layers"])],d.prototype,"readSublayersFromService",null),o([u({readOnly:!0})],d.prototype,"supportedSpatialReferences",null),o([u({readOnly:!0})],d.prototype,"tilemapCache",null),o([u({json:{read:{source:"title"}}})],d.prototype,"title",null),o([u({json:{read:!1},readOnly:!0,value:"wmts"})],d.prototype,"type",void 0),o([u({json:{origins:{service:{read:{source:"tileUrl"}},"web-document":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}},"portal-item":{read:{source:"wmtsInfo.url"},write:{target:"wmtsInfo.url"}}}}})],d.prototype,"url",null),o([u()],d.prototype,"version",void 0),d=o([k("esri.layers.WMTSLayer")],d);const et=d;export{et as default}; diff --git a/assets/WMTSLayerView2D.430450ca.js b/assets/WMTSLayerView2D.c5c29679.js similarity index 85% rename from assets/WMTSLayerView2D.430450ca.js rename to assets/WMTSLayerView2D.c5c29679.js index 2b33c0f..939490e 100644 --- a/assets/WMTSLayerView2D.430450ca.js +++ b/assets/WMTSLayerView2D.c5c29679.js @@ -1 +1 @@ -import{cV as w,cW as g,cX as I,_ as S,bN as f,x as h,bK as d,s as T,a6 as n,a7 as m,a8 as V}from"./index.d94abe07.js";import{t as v,n as y}from"./imageUtils.b93c1581.js";import{y as x,u as M}from"./LayerView.42d17220.js";import{i as q}from"./RefreshableLayerView.28a00159.js";import"./BitmapTileContainer.3a622161.js";import"./Bitmap.43defcb1.js";import"./utils.4b023c9d.js";import"./Utils.7f6f3a6b.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.229b1dd6.js";import"./TileContainer.8b7fafe2.js";import"./WGLContainer.1850619d.js";import"./pixelUtils.82950e1a.js";import"./VertexArrayObject.a4c1d809.js";import"./ProgramTemplate.e9a5aa54.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";const b=[102113,102100,3857,3785,900913],R=[0,0];let a=class extends q(v(x(M))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this._tileRequests=new Map,this.layer=null}get tileMatrixSet(){const e=this._getTileMatrixSetBySpatialReference(this.layer.activeLayer);return e?(e.id!==this.layer.activeLayer.tileMatrixSetId&&(this.layer.activeLayer.tileMatrixSetId=e.id),e):null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume()}attach(){if(!this.tileMatrixSet)return;const{tileInfo:e}=this.tileMatrixSet;this._tileInfoView=new w(e),this._fetchQueue=new g({tileInfoView:this._tileInfoView,concurrency:16,process:(t,i)=>this.fetchTile(t,i)}),this._tileStrategy=new I({cachePolicy:"keep",resampling:!0,acquireTile:t=>this.acquireTile(t),releaseTile:t=>this.releaseTile(t),tileInfoView:this._tileInfoView}),this.handles.add(S(()=>{var t,i;return[(i=(t=this.layer)==null?void 0:t.activeLayer)==null?void 0:i.styleId,this.tileMatrixSet]},()=>this._refresh()),this.declaredClass),super.attach()}detach(){var e,t;super.detach(),this.handles.remove(this.declaredClass),(e=this._tileStrategy)==null||e.destroy(),(t=this._fetchQueue)==null||t.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}acquireTile(e){const t=this._bitmapView.createTile(e),i=t.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(R,t.key),i.resolution=this._tileInfoView.getTileResolution(t.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._enqueueTileFetch(t),this._bitmapView.addChild(t),this.requestUpdate(),t}async doRefresh(){!this.attached||this.updateRequested||this.suspended||this._refresh()}isUpdating(){var e,t;return(t=(e=this._fetchQueue)==null?void 0:e.updating)!=null?t:!1}async fetchTile(e,t={}){const i="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:s,resamplingLevel:o=0}=t;if(!i)return this._fetchImage(e,s);const r=new f(0,0,0,0);let c;try{await i.fetchAvailabilityUpsample(e.level,e.row,e.col,r,{signal:s}),c=await this._fetchImage(r,s)}catch(l){if(h(l))throw l;if(o<3){const u=this._tileInfoView.getTileParentId(e.id);if(u){const p=new f(u),_=await this.fetchTile(p,{...t,resamplingLevel:o+1});return y(this._tileInfoView,_,p,e)}}throw l}return y(this._tileInfoView,c,r,e)}canResume(){const e=super.canResume();return e&&this.tileMatrixSet!==null}supportsSpatialReference(e){return this.layer.activeLayer.tileMatrixSets.some(t=>d(t.tileInfo.spatialReference,e))}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(t){h(t)||T.getLogger(this.declaredClass).error(t)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:t})}_refresh(){this._fetchQueue.reset(),this._tileStrategy.tiles.forEach(e=>{if(!e.bitmap.source)return;const t={id:e.key.id,fulfilled:!1,promise:this._fetchQueue.push(e.key).then(i=>{e.bitmap.source=i}).catch(i=>{h(i)||(e.bitmap.source=null)}).finally(()=>{e.requestRender(),t.fulfilled=!0})};this._tileRequests.set(e,t)})}_getTileMatrixSetBySpatialReference(e){const t=this.view.spatialReference;if(!e.tileMatrixSets)return null;let i=e.tileMatrixSets.find(s=>d(s.tileInfo.spatialReference,t));return!i&&t.isWebMercator&&(i=e.tileMatrixSets.find(s=>b.includes(s.tileInfo.spatialReference.wkid))),i}};n([m()],a.prototype,"_fetchQueue",void 0),n([m({readOnly:!0})],a.prototype,"tileMatrixSet",null),a=n([V("esri.views.2d.layers.WMTSLayerView2D")],a);const Z=a;export{Z as default}; +import{cV as w,cW as g,cX as I,_ as S,bN as f,x as h,bK as d,s as T,a6 as n,a7 as m,a8 as V}from"./index.221827cd.js";import{t as v,n as y}from"./imageUtils.215a62b1.js";import{y as x,u as M}from"./LayerView.ce6e0535.js";import{i as q}from"./RefreshableLayerView.887ed8c3.js";import"./BitmapTileContainer.f5b20598.js";import"./Bitmap.72a3702e.js";import"./utils.0160becb.js";import"./Utils.2136650a.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";import"./MaterialKey.0cadabc1.js";import"./TileContainer.5aeb32d6.js";import"./WGLContainer.347cc5cd.js";import"./pixelUtils.9c6f8dae.js";import"./VertexArrayObject.53cf1857.js";import"./ProgramTemplate.cf9dd4e8.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./GeometryUtils.51c4032a.js";import"./earcut.afc1d357.js";const b=[102113,102100,3857,3785,900913],R=[0,0];let a=class extends q(v(x(M))){constructor(){super(...arguments),this._tileStrategy=null,this._fetchQueue=null,this._tileRequests=new Map,this.layer=null}get tileMatrixSet(){const e=this._getTileMatrixSetBySpatialReference(this.layer.activeLayer);return e?(e.id!==this.layer.activeLayer.tileMatrixSetId&&(this.layer.activeLayer.tileMatrixSetId=e.id),e):null}update(e){this._fetchQueue.pause(),this._fetchQueue.state=e.state,this._tileStrategy.update(e),this._fetchQueue.resume()}attach(){if(!this.tileMatrixSet)return;const{tileInfo:e}=this.tileMatrixSet;this._tileInfoView=new w(e),this._fetchQueue=new g({tileInfoView:this._tileInfoView,concurrency:16,process:(t,i)=>this.fetchTile(t,i)}),this._tileStrategy=new I({cachePolicy:"keep",resampling:!0,acquireTile:t=>this.acquireTile(t),releaseTile:t=>this.releaseTile(t),tileInfoView:this._tileInfoView}),this.handles.add(S(()=>{var t,i;return[(i=(t=this.layer)==null?void 0:t.activeLayer)==null?void 0:i.styleId,this.tileMatrixSet]},()=>this._refresh()),this.declaredClass),super.attach()}detach(){var e,t;super.detach(),this.handles.remove(this.declaredClass),(e=this._tileStrategy)==null||e.destroy(),(t=this._fetchQueue)==null||t.destroy(),this._fetchQueue=this._tileStrategy=this._tileInfoView=null}moveStart(){this.requestUpdate()}viewChange(){this.requestUpdate()}moveEnd(){this.requestUpdate()}releaseTile(e){this._fetchQueue.abort(e.key.id),this._bitmapView.removeChild(e),e.once("detach",()=>e.destroy()),this.requestUpdate()}acquireTile(e){const t=this._bitmapView.createTile(e),i=t.bitmap;return[i.x,i.y]=this._tileInfoView.getTileCoords(R,t.key),i.resolution=this._tileInfoView.getTileResolution(t.key),[i.width,i.height]=this._tileInfoView.tileInfo.size,this._enqueueTileFetch(t),this._bitmapView.addChild(t),this.requestUpdate(),t}async doRefresh(){!this.attached||this.updateRequested||this.suspended||this._refresh()}isUpdating(){var e,t;return(t=(e=this._fetchQueue)==null?void 0:e.updating)!=null?t:!1}async fetchTile(e,t={}){const i="tilemapCache"in this.layer?this.layer.tilemapCache:null,{signal:s,resamplingLevel:o=0}=t;if(!i)return this._fetchImage(e,s);const r=new f(0,0,0,0);let c;try{await i.fetchAvailabilityUpsample(e.level,e.row,e.col,r,{signal:s}),c=await this._fetchImage(r,s)}catch(l){if(h(l))throw l;if(o<3){const u=this._tileInfoView.getTileParentId(e.id);if(u){const p=new f(u),_=await this.fetchTile(p,{...t,resamplingLevel:o+1});return y(this._tileInfoView,_,p,e)}}throw l}return y(this._tileInfoView,c,r,e)}canResume(){const e=super.canResume();return e&&this.tileMatrixSet!==null}supportsSpatialReference(e){return this.layer.activeLayer.tileMatrixSets.some(t=>d(t.tileInfo.spatialReference,e))}async _enqueueTileFetch(e){if(!this._fetchQueue.has(e.key.id)){try{const t=await this._fetchQueue.push(e.key);e.bitmap.source=t,e.bitmap.width=this._tileInfoView.tileInfo.size[0],e.bitmap.height=this._tileInfoView.tileInfo.size[1],e.once("attach",()=>this.requestUpdate())}catch(t){h(t)||T.getLogger(this.declaredClass).error(t)}this.requestUpdate()}}async _fetchImage(e,t){return this.layer.fetchImageBitmapTile(e.level,e.row,e.col,{signal:t})}_refresh(){this._fetchQueue.reset(),this._tileStrategy.tiles.forEach(e=>{if(!e.bitmap.source)return;const t={id:e.key.id,fulfilled:!1,promise:this._fetchQueue.push(e.key).then(i=>{e.bitmap.source=i}).catch(i=>{h(i)||(e.bitmap.source=null)}).finally(()=>{e.requestRender(),t.fulfilled=!0})};this._tileRequests.set(e,t)})}_getTileMatrixSetBySpatialReference(e){const t=this.view.spatialReference;if(!e.tileMatrixSets)return null;let i=e.tileMatrixSets.find(s=>d(s.tileInfo.spatialReference,t));return!i&&t.isWebMercator&&(i=e.tileMatrixSets.find(s=>b.includes(s.tileInfo.spatialReference.wkid))),i}};n([m()],a.prototype,"_fetchQueue",void 0),n([m({readOnly:!0})],a.prototype,"tileMatrixSet",null),a=n([V("esri.views.2d.layers.WMTSLayerView2D")],a);const Z=a;export{Z as default}; diff --git a/assets/WebTileLayer.ab421225.js b/assets/WebTileLayer.b038b70d.js similarity index 99% rename from assets/WebTileLayer.ab421225.js rename to assets/WebTileLayer.b038b70d.js index 1252144..2ec3d17 100644 --- a/assets/WebTileLayer.ab421225.js +++ b/assets/WebTileLayer.b038b70d.js @@ -1 +1 @@ -import{a6 as l,a7 as o,a8 as g,cx as j,b4 as v,i2 as S,ia as R,i3 as x,eF as P,eG as I,eH as U,cU as b,aT as c,du as T,af as M,jB as r,ev as d,n as W,jC as D,ey as E,U as f,jD as L,d2 as w,e0 as $,cF as O}from"./index.d94abe07.js";var m;let p=m=class extends j{constructor(e){super(e)}clone(){return new m({customLayerParameters:v(this.customLayerParameters),customParameters:v(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};l([o({json:{type:Object,write:!0}})],p.prototype,"customLayerParameters",void 0),l([o({json:{type:Object,write:!0}})],p.prototype,"customParameters",void 0),l([o({type:String,json:{write:!0}})],p.prototype,"layerIdentifier",void 0),l([o({type:String,json:{write:!0}})],p.prototype,"tileMatrixSet",void 0),l([o({type:String,json:{write:!0}})],p.prototype,"url",void 0),p=m=l([g("esri.layer.support.WMTSLayerInfo")],p);let s=class extends S(R(x(P(I(U(O)))))){constructor(...e){super(...e),this.copyright="",this.fullExtent=new b(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,c.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=c.WebMercator,this.subDomains=null,this.tileInfo=new T({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new M({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:c.WebMercator}),spatialReference:c.WebMercator,lods:[new r({level:0,scale:591657527591555e-6,resolution:156543.033928}),new r({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new r({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new r({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new r({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new r({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new r({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new r({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new r({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new r({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new r({level:10,scale:577790.554289,resolution:152.874056570411}),new r({level:11,scale:288895.277144,resolution:76.4370282850732}),new r({level:12,scale:144447.638572,resolution:38.2185141425366}),new r({level:13,scale:72223.819286,resolution:19.1092570712683}),new r({level:14,scale:36111.909643,resolution:9.55462853563415}),new r({level:15,scale:18055.954822,resolution:4.77731426794937}),new r({level:16,scale:9027.977411,resolution:2.38865713397468}),new r({level:17,scale:4513.988705,resolution:1.19432856685505}),new r({level:18,scale:2256.994353,resolution:.597164283559817}),new r({level:19,scale:1128.497176,resolution:.298582141647617}),new r({level:20,scale:564.248588,resolution:.14929107082380833}),new r({level:21,scale:282.124294,resolution:.07464553541190416}),new r({level:22,scale:141.062147,resolution:.03732276770595208}),new r({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(e,t){return typeof e=="string"?{urlTemplate:e,...t}:e}load(e){const t=this.loadFromPortal({supportedTypes:["WMTS"]},e).then(()=>{let i="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const a=new d(this.urlTemplate);!(!!this.subDomains&&this.subDomains.length>0)&&a.authority.includes("{subDomain}")&&(i="is missing 'subDomains' property")}else i="spatialReference must match tileInfo.spatialReference";else i="is missing the required 'urlTemplate' property value";if(i)throw new W("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${i}`)});return this.addResolvingPromise(t),Promise.resolve(this)}get levelValues(){const e=[];if(!this.tileInfo)return null;for(const t of this.tileInfo.lods)e[t.level]=t.levelValue||t.level;return e}readSpatialReference(e,t){return e||t.fullExtent&&t.fullExtent.spatialReference&&c.fromJSON(t.fullExtent.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const e=[],{urlTemplate:t,subDomains:i}=this,a=new d(t),u=a.scheme?a.scheme+"://":"//",y=u+a.authority+"/";if(a.authority.includes("{subDomain}")){if(i&&i.length>0&&a.authority.split(".").length>1)for(const n of i)e.push(u+a.authority.replace(/\{subDomain\}/gi,n)+"/")}else e.push(y);return e.map(n=>(n.charAt(n.length-1)!=="/"&&(n+="/"),n))}get urlPath(){if(!this.urlTemplate)return null;const e=this.urlTemplate,t=new d(e),i=(t.scheme?t.scheme+"://":"//")+t.authority+"/";return e.substring(i.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){e&&D(e)&&(e="https:"+e),e&&(e=e.replace(/\{z\}/gi,"{level}").replace(/\{x\}/gi,"{col}").replace(/\{y\}/gi,"{row}"),e=E(e)),t.templateUrl=e}fetchTile(e,t,i,a={}){const{signal:u}=a,y=this.getTileUrl(e,t,i),n={responseType:"image",signal:u,query:{...this.refreshParameters}};return f(y,n).then(h=>h.data)}async fetchImageBitmapTile(e,t,i,a={}){const{signal:u}=a,y=this.getTileUrl(e,t,i),n={responseType:"blob",signal:u,query:{...this.refreshParameters}},{data:h}=await f(y,n);return createImageBitmap(h)}getTileUrl(e,t,i){const a=this.levelValues[e];return this.tileServers[t%this.tileServers.length]+L(this.urlPath,{level:a,z:a,col:i,x:i,row:t,y:t})}};l([o({type:String,value:"",json:{write:!0}})],s.prototype,"copyright",void 0),l([o({type:b,json:{write:!0},nonNullable:!0})],s.prototype,"fullExtent",void 0),l([o({readOnly:!0,json:{read:!1,write:!1}})],s.prototype,"legendEnabled",void 0),l([o({type:["show","hide"]})],s.prototype,"listMode",void 0),l([o({json:{read:!0,write:!0}})],s.prototype,"blendMode",void 0),l([o()],s.prototype,"levelValues",null),l([o({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],s.prototype,"isReference",void 0),l([o({type:["WebTiledLayer"],value:"WebTiledLayer"})],s.prototype,"operationalLayerType",void 0),l([o({readOnly:!0,json:{read:!1,write:!1}})],s.prototype,"popupEnabled",void 0),l([o({type:c})],s.prototype,"spatialReference",void 0),l([w("spatialReference",["spatialReference","fullExtent.spatialReference"])],s.prototype,"readSpatialReference",null),l([o({type:[String],json:{write:!0}})],s.prototype,"subDomains",void 0),l([o({type:T,json:{write:!0}})],s.prototype,"tileInfo",void 0),l([o({readOnly:!0})],s.prototype,"tileServers",null),l([o({json:{read:!1}})],s.prototype,"type",void 0),l([o()],s.prototype,"urlPath",null),l([o({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],s.prototype,"urlTemplate",void 0),l([w("urlTemplate",["urlTemplate","templateUrl"])],s.prototype,"readUrlTemplate",null),l([$("urlTemplate",{templateUrl:{type:String}})],s.prototype,"writeUrlTemplate",null),l([o({type:p,json:{write:!0}})],s.prototype,"wmtsInfo",void 0),s=l([g("esri.layers.WebTileLayer")],s);const z=s;var B=Object.freeze(Object.defineProperty({__proto__:null,default:z},Symbol.toStringTag,{value:"Module"}));export{B as W,p,z as x}; +import{a6 as l,a7 as o,a8 as g,cx as j,b4 as v,i2 as S,ia as R,i3 as x,eF as P,eG as I,eH as U,cU as b,aT as c,du as T,af as M,jB as r,ev as d,n as W,jC as D,ey as E,U as f,jD as L,d2 as w,e0 as $,cF as O}from"./index.221827cd.js";var m;let p=m=class extends j{constructor(e){super(e)}clone(){return new m({customLayerParameters:v(this.customLayerParameters),customParameters:v(this.customParameters),layerIdentifier:this.layerIdentifier,tileMatrixSet:this.tileMatrixSet,url:this.url})}};l([o({json:{type:Object,write:!0}})],p.prototype,"customLayerParameters",void 0),l([o({json:{type:Object,write:!0}})],p.prototype,"customParameters",void 0),l([o({type:String,json:{write:!0}})],p.prototype,"layerIdentifier",void 0),l([o({type:String,json:{write:!0}})],p.prototype,"tileMatrixSet",void 0),l([o({type:String,json:{write:!0}})],p.prototype,"url",void 0),p=m=l([g("esri.layer.support.WMTSLayerInfo")],p);let s=class extends S(R(x(P(I(U(O)))))){constructor(...e){super(...e),this.copyright="",this.fullExtent=new b(-20037508342787e-6,-2003750834278e-5,2003750834278e-5,20037508342787e-6,c.WebMercator),this.legendEnabled=!1,this.isReference=null,this.popupEnabled=!1,this.spatialReference=c.WebMercator,this.subDomains=null,this.tileInfo=new T({size:[256,256],dpi:96,format:"png8",compressionQuality:0,origin:new M({x:-20037508342787e-6,y:20037508342787e-6,spatialReference:c.WebMercator}),spatialReference:c.WebMercator,lods:[new r({level:0,scale:591657527591555e-6,resolution:156543.033928}),new r({level:1,scale:295828763795777e-6,resolution:78271.5169639999}),new r({level:2,scale:147914381897889e-6,resolution:39135.7584820001}),new r({level:3,scale:73957190948944e-6,resolution:19567.8792409999}),new r({level:4,scale:36978595474472e-6,resolution:9783.93962049996}),new r({level:5,scale:18489297737236e-6,resolution:4891.96981024998}),new r({level:6,scale:9244648868618e-6,resolution:2445.98490512499}),new r({level:7,scale:4622324434309e-6,resolution:1222.99245256249}),new r({level:8,scale:2311162217155e-6,resolution:611.49622628138}),new r({level:9,scale:1155581108577e-6,resolution:305.748113140558}),new r({level:10,scale:577790.554289,resolution:152.874056570411}),new r({level:11,scale:288895.277144,resolution:76.4370282850732}),new r({level:12,scale:144447.638572,resolution:38.2185141425366}),new r({level:13,scale:72223.819286,resolution:19.1092570712683}),new r({level:14,scale:36111.909643,resolution:9.55462853563415}),new r({level:15,scale:18055.954822,resolution:4.77731426794937}),new r({level:16,scale:9027.977411,resolution:2.38865713397468}),new r({level:17,scale:4513.988705,resolution:1.19432856685505}),new r({level:18,scale:2256.994353,resolution:.597164283559817}),new r({level:19,scale:1128.497176,resolution:.298582141647617}),new r({level:20,scale:564.248588,resolution:.14929107082380833}),new r({level:21,scale:282.124294,resolution:.07464553541190416}),new r({level:22,scale:141.062147,resolution:.03732276770595208}),new r({level:23,scale:70.5310735,resolution:.01866138385297604})]}),this.type="web-tile",this.urlTemplate=null,this.wmtsInfo=null}normalizeCtorArgs(e,t){return typeof e=="string"?{urlTemplate:e,...t}:e}load(e){const t=this.loadFromPortal({supportedTypes:["WMTS"]},e).then(()=>{let i="";if(this.urlTemplate)if(this.spatialReference.equals(this.tileInfo.spatialReference)){const a=new d(this.urlTemplate);!(!!this.subDomains&&this.subDomains.length>0)&&a.authority.includes("{subDomain}")&&(i="is missing 'subDomains' property")}else i="spatialReference must match tileInfo.spatialReference";else i="is missing the required 'urlTemplate' property value";if(i)throw new W("web-tile-layer:load",`WebTileLayer (title: '${this.title}', id: '${this.id}') ${i}`)});return this.addResolvingPromise(t),Promise.resolve(this)}get levelValues(){const e=[];if(!this.tileInfo)return null;for(const t of this.tileInfo.lods)e[t.level]=t.levelValue||t.level;return e}readSpatialReference(e,t){return e||t.fullExtent&&t.fullExtent.spatialReference&&c.fromJSON(t.fullExtent.spatialReference)}get tileServers(){if(!this.urlTemplate)return null;const e=[],{urlTemplate:t,subDomains:i}=this,a=new d(t),u=a.scheme?a.scheme+"://":"//",y=u+a.authority+"/";if(a.authority.includes("{subDomain}")){if(i&&i.length>0&&a.authority.split(".").length>1)for(const n of i)e.push(u+a.authority.replace(/\{subDomain\}/gi,n)+"/")}else e.push(y);return e.map(n=>(n.charAt(n.length-1)!=="/"&&(n+="/"),n))}get urlPath(){if(!this.urlTemplate)return null;const e=this.urlTemplate,t=new d(e),i=(t.scheme?t.scheme+"://":"//")+t.authority+"/";return e.substring(i.length)}readUrlTemplate(e,t){return e||t.templateUrl}writeUrlTemplate(e,t){e&&D(e)&&(e="https:"+e),e&&(e=e.replace(/\{z\}/gi,"{level}").replace(/\{x\}/gi,"{col}").replace(/\{y\}/gi,"{row}"),e=E(e)),t.templateUrl=e}fetchTile(e,t,i,a={}){const{signal:u}=a,y=this.getTileUrl(e,t,i),n={responseType:"image",signal:u,query:{...this.refreshParameters}};return f(y,n).then(h=>h.data)}async fetchImageBitmapTile(e,t,i,a={}){const{signal:u}=a,y=this.getTileUrl(e,t,i),n={responseType:"blob",signal:u,query:{...this.refreshParameters}},{data:h}=await f(y,n);return createImageBitmap(h)}getTileUrl(e,t,i){const a=this.levelValues[e];return this.tileServers[t%this.tileServers.length]+L(this.urlPath,{level:a,z:a,col:i,x:i,row:t,y:t})}};l([o({type:String,value:"",json:{write:!0}})],s.prototype,"copyright",void 0),l([o({type:b,json:{write:!0},nonNullable:!0})],s.prototype,"fullExtent",void 0),l([o({readOnly:!0,json:{read:!1,write:!1}})],s.prototype,"legendEnabled",void 0),l([o({type:["show","hide"]})],s.prototype,"listMode",void 0),l([o({json:{read:!0,write:!0}})],s.prototype,"blendMode",void 0),l([o()],s.prototype,"levelValues",null),l([o({type:Boolean,json:{read:!1,write:{enabled:!0,overridePolicy:()=>({enabled:!1})}}})],s.prototype,"isReference",void 0),l([o({type:["WebTiledLayer"],value:"WebTiledLayer"})],s.prototype,"operationalLayerType",void 0),l([o({readOnly:!0,json:{read:!1,write:!1}})],s.prototype,"popupEnabled",void 0),l([o({type:c})],s.prototype,"spatialReference",void 0),l([w("spatialReference",["spatialReference","fullExtent.spatialReference"])],s.prototype,"readSpatialReference",null),l([o({type:[String],json:{write:!0}})],s.prototype,"subDomains",void 0),l([o({type:T,json:{write:!0}})],s.prototype,"tileInfo",void 0),l([o({readOnly:!0})],s.prototype,"tileServers",null),l([o({json:{read:!1}})],s.prototype,"type",void 0),l([o()],s.prototype,"urlPath",null),l([o({type:String,json:{origins:{"portal-item":{read:{source:"url"}}}}})],s.prototype,"urlTemplate",void 0),l([w("urlTemplate",["urlTemplate","templateUrl"])],s.prototype,"readUrlTemplate",null),l([$("urlTemplate",{templateUrl:{type:String}})],s.prototype,"writeUrlTemplate",null),l([o({type:p,json:{write:!0}})],s.prototype,"wmtsInfo",void 0),s=l([g("esri.layers.WebTileLayer")],s);const z=s;var B=Object.freeze(Object.defineProperty({__proto__:null,default:z},Symbol.toStringTag,{value:"Module"}));export{B as W,p,z as x}; diff --git a/assets/WhereClause.253310fe.js b/assets/WhereClause.5b749615.js similarity index 99% rename from assets/WhereClause.253310fe.js rename to assets/WhereClause.5b749615.js index b944451..8debb93 100644 --- a/assets/WhereClause.253310fe.js +++ b/assets/WhereClause.5b749615.js @@ -1,4 +1,4 @@ -import{ft as Os,m as mt}from"./index.d94abe07.js";function Rs(l,u){const o=xt[l.toLowerCase()];if(o==null)throw new Error("Function Not Recognised");if(u.lengtho.maxParams)throw new Error(`Invalid Parameter count for call to ${l.toUpperCase()}`);return o.evaluate(u)}function Js(l,u){const o=xt[l.toLowerCase()];return o!=null&&u>=o.minParams&&u<=o.maxParams}const xt={min:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.min.apply(Math,l[0])},max:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.max.apply(Math,l[0])},avg:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Tt(l[0])},sum:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:ks(l[0])},stddev:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.sqrt(gt(l[0]))},count:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:l[0].length},var:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:gt(l[0])}};function Tt(l){let u=0;for(let o=0;o1?p/(o-1):0}class F{constructor(){this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0}static _fixDefaults(u){if(u.precision!==null||u.secondary!==null)throw new Error("Primary and Secondary SqlInterval qualifiers not supported")}static createFromMilliseconds(u){const o=new F;return o.second=u/1e3,o}static createFromValueAndQualifer(u,o,p){let i=null;const v=new F;if(v.op=p==="-"?"-":"+",o.type==="interval-period"){F._fixDefaults(o);const m=new RegExp("^[0-9]{1,}$");if(o.period==="year"||o.period==="month")throw new Error("Year-Month Intervals not supported");if(!m.test(u))throw new Error("Illegal Interval");v[o.period]=parseFloat(u)}else{if(F._fixDefaults(o.start),F._fixDefaults(o.end),o.start.period==="year"||o.start.period==="month")throw new Error("Year-Month Intervals not supported");if(o.end.period==="year"||o.end.period==="month")throw new Error("Year-Month Intervals not supported");switch(o.start.period){case"day":switch(o.end.period){case"hour":if(i=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!i.test(u))throw new Error("Illegal Interval");v[o.start.period]=parseFloat(u.split(" ")[0]),v[o.end.period]=parseFloat(u.split(" ")[1]);break;case"minute":if(i=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!i.test(u))throw new Error("Illegal Interval");{v[o.start.period]=parseFloat(u.split(" ")[0]);const m=u.split(" ")[1].split(":");v.hour=parseFloat(m[0]),v.minute=parseFloat(m[1])}break;case"second":if(i=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!i.test(u))throw new Error("Illegal Interval");{v[o.start.period]=parseFloat(u.split(" ")[0]);const m=u.split(" ")[1].split(":");v.hour=parseFloat(m[0]),v.minute=parseFloat(m[1]),v.second=parseFloat(m[2])}break;default:throw new Error("Invalid Interval.")}break;case"hour":switch(o.end.period){case"minute":if(i=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!i.test(u))throw new Error("Illegal Interval");v.hour=parseFloat(u.split(":")[0]),v.minute=parseFloat(u.split(":")[1]);break;case"second":if(i=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!i.test(u))throw new Error("Illegal Interval");{const m=u.split(":");v.hour=parseFloat(m[0]),v.minute=parseFloat(m[1]),v.second=parseFloat(m[2])}break;default:throw new Error("Invalid Interval.")}break;case"minute":if(o.end.period!=="second")throw new Error("Invalid Interval.");if(i=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!i.test(u))throw new Error("Illegal Interval");{const m=u.split(":");v.minute=parseFloat(m[0]),v.second=parseFloat(m[1])}break;default:throw new Error("Invalid Interval.")}}return v}valueInMilliseconds(){return(this.op==="-"?-1:1)*(1e3*this.second+60*this.minute*1e3+60*this.hour*60*1e3+24*this.day*60*60*1e3+this.month*(365/12)*24*60*60*1e3+365*this.year*24*60*60*1e3)}}function At(l,u){const o=It[l.toLowerCase()];if(o==null)throw new Error("Function Not Recognised");if(u.lengtho.maxParams)throw new Error(`Invalid Parameter count for call to ${l.toUpperCase()}`);return o.evaluate(u)}function Us(l,u){const o=It[l.toLowerCase()];return o!=null&&u>=o.minParams&&u<=o.maxParams}const It={extract:{minParams:2,maxParams:2,evaluate:([l,u])=>{if(u==null)return null;if(u instanceof Date)switch(l.toUpperCase()){case"SECOND":return u.getSeconds();case"MINUTE":return u.getMinutes();case"HOUR":return u.getHours();case"DAY":return u.getDate();case"MONTH":return u.getMonth()+1;case"YEAR":return u.getFullYear()}throw new Error("Invalid Parameter for call to EXTRACT")}},substring:{minParams:2,maxParams:3,evaluate:l=>{if(l.length===2){const[u,o]=l;return u==null||o==null?null:u.toString().substring(o-1)}if(l.length===3){const[u,o,p]=l;return u==null||o==null||p==null?null:p<=0?"":u.toString().substring(o-1,o+p-1)}}},position:{minParams:2,maxParams:2,evaluate:([l,u])=>l==null||u==null?null:u.indexOf(l)+1},trim:{minParams:2,maxParams:3,evaluate:l=>{const u=l.length===3,o=u?l[1]:" ",p=u?l[2]:l[1];if(o==null||p==null)return null;const i=`(${Os(o)})`;switch(l[0]){case"BOTH":return p.replace(new RegExp(`^${i}*|${i}*$`,"g"),"");case"LEADING":return p.replace(new RegExp(`^${i}*`,"g"),"");case"TRAILING":return p.replace(new RegExp(`${i}*$`,"g"),"")}throw new Error("Invalid Parameter for call to TRIM")}},abs:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.abs(l[0])},ceiling:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.ceil(l[0])},floor:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.floor(l[0])},log:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.log(l[0])},log10:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.log(l[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.sin(l[0])},cos:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.cos(l[0])},tan:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.tan(l[0])},asin:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.asin(l[0])},acos:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.acos(l[0])},atan:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.atan(l[0])},sign:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:l[0]>0?1:l[1]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:l=>l[0]==null||l[1]==null?null:l[0]**l[1]},mod:{minParams:2,maxParams:2,evaluate:l=>l[0]==null||l[1]==null?null:l[0]%l[1]},round:{minParams:1,maxParams:2,evaluate:l=>{const u=l[0],o=l.length===2?10**l[1]:1;return u==null?null:Math.round(u*o)/o}},truncate:{minParams:1,maxParams:2,evaluate:l=>l[0]==null?null:l.length===1?parseInt(l[0].toFixed(0),10):parseFloat(l[0].toFixed(l[1]))},char_length:{minParams:1,maxParams:1,evaluate:l=>typeof l[0]=="string"||l[0]instanceof String?l[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:l=>{let u="";for(let o=0;ol[0]==null?null:l[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:l[0].toString().toUpperCase()}};var wt,yt,Et={exports:{}};yt=function(){function l(i,v){function m(){this.constructor=i}m.prototype=v.prototype,i.prototype=new m}function u(i,v,m,t){var w=Error.call(this,i);return Object.setPrototypeOf&&Object.setPrototypeOf(w,u.prototype),w.expected=v,w.found=m,w.location=t,w.name="SyntaxError",w}function o(i,v,m){return m=m||" ",i.length>v?i:(v-=i.length,i+(m+=m.repeat(v)).slice(0,v))}function p(i,v){var m,t={},w=(v=v!==void 0?v:{}).grammarSource,A={start:Ve},I=Ve,k="!",D="=",x=">=",S=">",L="<=",C="<>",Ot="<",Ee="!=",ie="+",le="-",Rt="*",Jt="/",kt="@",Se="'",Ce="N'",$="''",Ut=".",Ht="null",Vt="true",qt="false",Bt="in",jt="is",Yt="like",zt="escape",Gt="not",Wt="and",$t="or",Kt="between",Zt="from",Qt="for",Xt="substring",en="extract",tn="trim",nn="position",rn="timestamp",an="date",un="leading",sn="trailing",on="both",ln="to",cn="interval",fn="year",pn="month",vn="day",hn="hour",dn="minute",mn="second",gn="case",wn="end",yn="when",Nn="then",bn="else",xn=",",Tn="(",An=")",_e="`",In=/^[A-Za-z_\x80-\uFFFF]/,En=/^[A-Za-z0-9_]/,Sn=/^[A-Za-z0-9_.\x80-\uFFFF]/,Pe=/^[^']/,Cn=/^[0-9]/,_n=/^[eE]/,Pn=/^[+\-]/,Fn=/^[ \t\n\r]/,Fe=/^[^`]/,Ln=g("!",!1),Le=g("=",!1),Mn=g(">=",!1),Dn=g(">",!1),On=g("<=",!1),Rn=g("<>",!1),Jn=g("<",!1),kn=g("!=",!1),ce=g("+",!1),fe=g("-",!1),Un=g("*",!1),Hn=g("/",!1),Vn=O([["A","Z"],["a","z"],"_",["\x80","\uFFFF"]],!1,!1),qn=O([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),Bn=O([["A","Z"],["a","z"],["0","9"],"_",".",["\x80","\uFFFF"]],!1,!1),jn=g("@",!1),Me=g("'",!1),Yn=g("N'",!1),De=g("''",!1),Oe=O(["'"],!0,!1),zn=g(".",!1),Gn=O([["0","9"]],!1,!1),Wn=O(["e","E"],!1,!1),$n=O(["+","-"],!1,!1),Kn=g("NULL",!0),Zn=g("TRUE",!0),Qn=g("FALSE",!0),Xn=g("IN",!0),er=g("IS",!0),tr=g("LIKE",!0),nr=g("ESCAPE",!0),rr=g("NOT",!0),ar=g("AND",!0),ur=g("OR",!0),sr=g("BETWEEN",!0),or=g("FROM",!0),ir=g("FOR",!0),lr=g("SUBSTRING",!0),cr=g("EXTRACT",!0),fr=g("TRIM",!0),pr=g("POSITION",!0),vr=g("TIMESTAMP",!0),hr=g("DATE",!0),dr=g("LEADING",!0),mr=g("TRAILING",!0),gr=g("BOTH",!0),wr=g("TO",!0),yr=g("INTERVAL",!0),Nr=g("YEAR",!0),br=g("MONTH",!0),xr=g("DAY",!0),Tr=g("HOUR",!0),Ar=g("MINUTE",!0),Ir=g("SECOND",!0),Er=g("CASE",!0),Sr=g("END",!0),Cr=g("WHEN",!0),_r=g("THEN",!0),Pr=g("ELSE",!0),Fr=g(",",!1),Lr=g("(",!1),Mr=g(")",!1),Dr=O([" "," ",` +import{ft as Os,m as mt}from"./index.221827cd.js";function Rs(l,u){const o=xt[l.toLowerCase()];if(o==null)throw new Error("Function Not Recognised");if(u.lengtho.maxParams)throw new Error(`Invalid Parameter count for call to ${l.toUpperCase()}`);return o.evaluate(u)}function Js(l,u){const o=xt[l.toLowerCase()];return o!=null&&u>=o.minParams&&u<=o.maxParams}const xt={min:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.min.apply(Math,l[0])},max:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.max.apply(Math,l[0])},avg:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Tt(l[0])},sum:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:ks(l[0])},stddev:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.sqrt(gt(l[0]))},count:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:l[0].length},var:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:gt(l[0])}};function Tt(l){let u=0;for(let o=0;o1?p/(o-1):0}class F{constructor(){this.op="+",this.day=0,this.second=0,this.hour=0,this.month=0,this.year=0,this.minute=0}static _fixDefaults(u){if(u.precision!==null||u.secondary!==null)throw new Error("Primary and Secondary SqlInterval qualifiers not supported")}static createFromMilliseconds(u){const o=new F;return o.second=u/1e3,o}static createFromValueAndQualifer(u,o,p){let i=null;const v=new F;if(v.op=p==="-"?"-":"+",o.type==="interval-period"){F._fixDefaults(o);const m=new RegExp("^[0-9]{1,}$");if(o.period==="year"||o.period==="month")throw new Error("Year-Month Intervals not supported");if(!m.test(u))throw new Error("Illegal Interval");v[o.period]=parseFloat(u)}else{if(F._fixDefaults(o.start),F._fixDefaults(o.end),o.start.period==="year"||o.start.period==="month")throw new Error("Year-Month Intervals not supported");if(o.end.period==="year"||o.end.period==="month")throw new Error("Year-Month Intervals not supported");switch(o.start.period){case"day":switch(o.end.period){case"hour":if(i=new RegExp("^[0-9]{1,} [0-9]{1,}$"),!i.test(u))throw new Error("Illegal Interval");v[o.start.period]=parseFloat(u.split(" ")[0]),v[o.end.period]=parseFloat(u.split(" ")[1]);break;case"minute":if(i=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,}$"),!i.test(u))throw new Error("Illegal Interval");{v[o.start.period]=parseFloat(u.split(" ")[0]);const m=u.split(" ")[1].split(":");v.hour=parseFloat(m[0]),v.minute=parseFloat(m[1])}break;case"second":if(i=new RegExp("^[0-9]{1,} [0-9]{1,2}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!i.test(u))throw new Error("Illegal Interval");{v[o.start.period]=parseFloat(u.split(" ")[0]);const m=u.split(" ")[1].split(":");v.hour=parseFloat(m[0]),v.minute=parseFloat(m[1]),v.second=parseFloat(m[2])}break;default:throw new Error("Invalid Interval.")}break;case"hour":switch(o.end.period){case"minute":if(i=new RegExp("^[0-9]{1,}:[0-9]{1,}$"),!i.test(u))throw new Error("Illegal Interval");v.hour=parseFloat(u.split(":")[0]),v.minute=parseFloat(u.split(":")[1]);break;case"second":if(i=new RegExp("^[0-9]{1,}:[0-9]{1,2}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!i.test(u))throw new Error("Illegal Interval");{const m=u.split(":");v.hour=parseFloat(m[0]),v.minute=parseFloat(m[1]),v.second=parseFloat(m[2])}break;default:throw new Error("Invalid Interval.")}break;case"minute":if(o.end.period!=="second")throw new Error("Invalid Interval.");if(i=new RegExp("^[0-9]{1,}:[0-9]{1,}([.]{1}[0-9]{1,}){0,1}$"),!i.test(u))throw new Error("Illegal Interval");{const m=u.split(":");v.minute=parseFloat(m[0]),v.second=parseFloat(m[1])}break;default:throw new Error("Invalid Interval.")}}return v}valueInMilliseconds(){return(this.op==="-"?-1:1)*(1e3*this.second+60*this.minute*1e3+60*this.hour*60*1e3+24*this.day*60*60*1e3+this.month*(365/12)*24*60*60*1e3+365*this.year*24*60*60*1e3)}}function At(l,u){const o=It[l.toLowerCase()];if(o==null)throw new Error("Function Not Recognised");if(u.lengtho.maxParams)throw new Error(`Invalid Parameter count for call to ${l.toUpperCase()}`);return o.evaluate(u)}function Us(l,u){const o=It[l.toLowerCase()];return o!=null&&u>=o.minParams&&u<=o.maxParams}const It={extract:{minParams:2,maxParams:2,evaluate:([l,u])=>{if(u==null)return null;if(u instanceof Date)switch(l.toUpperCase()){case"SECOND":return u.getSeconds();case"MINUTE":return u.getMinutes();case"HOUR":return u.getHours();case"DAY":return u.getDate();case"MONTH":return u.getMonth()+1;case"YEAR":return u.getFullYear()}throw new Error("Invalid Parameter for call to EXTRACT")}},substring:{minParams:2,maxParams:3,evaluate:l=>{if(l.length===2){const[u,o]=l;return u==null||o==null?null:u.toString().substring(o-1)}if(l.length===3){const[u,o,p]=l;return u==null||o==null||p==null?null:p<=0?"":u.toString().substring(o-1,o+p-1)}}},position:{minParams:2,maxParams:2,evaluate:([l,u])=>l==null||u==null?null:u.indexOf(l)+1},trim:{minParams:2,maxParams:3,evaluate:l=>{const u=l.length===3,o=u?l[1]:" ",p=u?l[2]:l[1];if(o==null||p==null)return null;const i=`(${Os(o)})`;switch(l[0]){case"BOTH":return p.replace(new RegExp(`^${i}*|${i}*$`,"g"),"");case"LEADING":return p.replace(new RegExp(`^${i}*`,"g"),"");case"TRAILING":return p.replace(new RegExp(`${i}*$`,"g"),"")}throw new Error("Invalid Parameter for call to TRIM")}},abs:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.abs(l[0])},ceiling:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.ceil(l[0])},floor:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.floor(l[0])},log:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.log(l[0])},log10:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.log(l[0])*Math.LOG10E},sin:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.sin(l[0])},cos:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.cos(l[0])},tan:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.tan(l[0])},asin:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.asin(l[0])},acos:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.acos(l[0])},atan:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:Math.atan(l[0])},sign:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:l[0]>0?1:l[1]<0?-1:0},power:{minParams:2,maxParams:2,evaluate:l=>l[0]==null||l[1]==null?null:l[0]**l[1]},mod:{minParams:2,maxParams:2,evaluate:l=>l[0]==null||l[1]==null?null:l[0]%l[1]},round:{minParams:1,maxParams:2,evaluate:l=>{const u=l[0],o=l.length===2?10**l[1]:1;return u==null?null:Math.round(u*o)/o}},truncate:{minParams:1,maxParams:2,evaluate:l=>l[0]==null?null:l.length===1?parseInt(l[0].toFixed(0),10):parseFloat(l[0].toFixed(l[1]))},char_length:{minParams:1,maxParams:1,evaluate:l=>typeof l[0]=="string"||l[0]instanceof String?l[0].length:0},concat:{minParams:1,maxParams:1/0,evaluate:l=>{let u="";for(let o=0;ol[0]==null?null:l[0].toString().toLowerCase()},upper:{minParams:1,maxParams:1,evaluate:l=>l[0]==null?null:l[0].toString().toUpperCase()}};var wt,yt,Et={exports:{}};yt=function(){function l(i,v){function m(){this.constructor=i}m.prototype=v.prototype,i.prototype=new m}function u(i,v,m,t){var w=Error.call(this,i);return Object.setPrototypeOf&&Object.setPrototypeOf(w,u.prototype),w.expected=v,w.found=m,w.location=t,w.name="SyntaxError",w}function o(i,v,m){return m=m||" ",i.length>v?i:(v-=i.length,i+(m+=m.repeat(v)).slice(0,v))}function p(i,v){var m,t={},w=(v=v!==void 0?v:{}).grammarSource,A={start:Ve},I=Ve,k="!",D="=",x=">=",S=">",L="<=",C="<>",Ot="<",Ee="!=",ie="+",le="-",Rt="*",Jt="/",kt="@",Se="'",Ce="N'",$="''",Ut=".",Ht="null",Vt="true",qt="false",Bt="in",jt="is",Yt="like",zt="escape",Gt="not",Wt="and",$t="or",Kt="between",Zt="from",Qt="for",Xt="substring",en="extract",tn="trim",nn="position",rn="timestamp",an="date",un="leading",sn="trailing",on="both",ln="to",cn="interval",fn="year",pn="month",vn="day",hn="hour",dn="minute",mn="second",gn="case",wn="end",yn="when",Nn="then",bn="else",xn=",",Tn="(",An=")",_e="`",In=/^[A-Za-z_\x80-\uFFFF]/,En=/^[A-Za-z0-9_]/,Sn=/^[A-Za-z0-9_.\x80-\uFFFF]/,Pe=/^[^']/,Cn=/^[0-9]/,_n=/^[eE]/,Pn=/^[+\-]/,Fn=/^[ \t\n\r]/,Fe=/^[^`]/,Ln=g("!",!1),Le=g("=",!1),Mn=g(">=",!1),Dn=g(">",!1),On=g("<=",!1),Rn=g("<>",!1),Jn=g("<",!1),kn=g("!=",!1),ce=g("+",!1),fe=g("-",!1),Un=g("*",!1),Hn=g("/",!1),Vn=O([["A","Z"],["a","z"],"_",["\x80","\uFFFF"]],!1,!1),qn=O([["A","Z"],["a","z"],["0","9"],"_"],!1,!1),Bn=O([["A","Z"],["a","z"],["0","9"],"_",".",["\x80","\uFFFF"]],!1,!1),jn=g("@",!1),Me=g("'",!1),Yn=g("N'",!1),De=g("''",!1),Oe=O(["'"],!0,!1),zn=g(".",!1),Gn=O([["0","9"]],!1,!1),Wn=O(["e","E"],!1,!1),$n=O(["+","-"],!1,!1),Kn=g("NULL",!0),Zn=g("TRUE",!0),Qn=g("FALSE",!0),Xn=g("IN",!0),er=g("IS",!0),tr=g("LIKE",!0),nr=g("ESCAPE",!0),rr=g("NOT",!0),ar=g("AND",!0),ur=g("OR",!0),sr=g("BETWEEN",!0),or=g("FROM",!0),ir=g("FOR",!0),lr=g("SUBSTRING",!0),cr=g("EXTRACT",!0),fr=g("TRIM",!0),pr=g("POSITION",!0),vr=g("TIMESTAMP",!0),hr=g("DATE",!0),dr=g("LEADING",!0),mr=g("TRAILING",!0),gr=g("BOTH",!0),wr=g("TO",!0),yr=g("INTERVAL",!0),Nr=g("YEAR",!0),br=g("MONTH",!0),xr=g("DAY",!0),Tr=g("HOUR",!0),Ar=g("MINUTE",!0),Ir=g("SECOND",!0),Er=g("CASE",!0),Sr=g("END",!0),Cr=g("WHEN",!0),_r=g("THEN",!0),Pr=g("ELSE",!0),Fr=g(",",!1),Lr=g("(",!1),Mr=g(")",!1),Dr=O([" "," ",` `,"\r"],!1,!1),Re=g("`",!1),Je=O(["`"],!0,!1),Or=function(e){return e},Rr=function(e,r){var a={type:"expression-list"},s=Ds(e,r);return a.value=s,a},Jr=function(e,r){return G(e,r)},kr=function(e,r){return G(e,r)},Ur=function(e){return Ls("NOT",e)},Hr=function(e,r){return r==""||r==null||r==null?e:r.type=="arithmetic"?G(e,r.tail):dt(r.op,e,r.right,r.escape)},Vr=function(e){return{type:"arithmetic",tail:e}},qr=function(e,r){return{op:e+"NOT",right:r}},Br=function(e,r){return{op:e,right:r}},jr=function(e,r,a){return{op:"NOT"+e,right:{type:"expression-list",value:[r,a]}}},Yr=function(e,r,a){return{op:e,right:{type:"expression-list",value:[r,a]}}},zr=function(e){return e[0]+" "+e[2]},Gr=function(e){return e[0]+" "+e[2]},Wr=function(e,r,a){return{op:e,right:r,escape:a.value}},$r=function(e,r){return{op:e,right:r,escape:""}},Kr=function(e,r){return{op:e,right:r}},Zr=function(e){return{op:e,right:{type:"expression-list",value:[]}}},Qr=function(e,r){return{op:e,right:r}},Xr=function(e,r){return G(e,r)},ea=function(e,r){return G(e,r)},ta=function(e){return e.paren=!0,e},na=function(e){return/^CURRENT_DATE$/i.test(e)?{type:"current-time",mode:"date"}:/^CURRENT_TIMESTAMP$/i.test(e)?{type:"current-time",mode:"timestamp"}:{type:"column-reference",table:"",column:e}},ra=function(e){return e},aa=function(e,r){return e+r.join("")},ua=function(e,r){return e+r.join("")},sa=function(e){return{type:"parameter",value:e[1]}},oa=function(e,r){return{type:"function",name:"extract",args:{type:"expression-list",value:[{type:"string",value:e},r]}}},ia=function(e,r,a){return{type:"function",name:"substring",args:{type:"expression-list",value:a?[e,r,a[2]]:[e,r]}}},la=function(e,r,a){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:e!=null?e:"BOTH"},r,a]}}},ca=function(e,r){return{type:"function",name:"trim",args:{type:"expression-list",value:[{type:"string",value:e!=null?e:"BOTH"},r]}}},fa=function(e,r){return{type:"function",name:"position",args:{type:"expression-list",value:[e,r]}}},pa=function(e,r){return{type:"function",name:e,args:r||{type:"expression-list",value:[]}}},va=function(e){return{type:"timestamp",value:e.value}},ha=function(e,r,a){return{type:"interval",value:r,qualifier:a,op:e}},da=function(e,r){return{type:"interval",value:e,qualifier:r,op:""}},ma=function(e,r){return{type:"interval-qualifier",start:e,end:r}},ga=function(e,r){return{type:"interval-period",period:e.value,precision:r,secondary:null}},wa=function(e){return{type:"interval-period",period:e.value,precision:null,secondary:null}},ya=function(e){return{type:"interval-period",period:e.value,precision:null,secondary:null}},Na=function(e,r){return{type:"interval-period",period:"second",precision:e,secondary:r}},ba=function(e){return{type:"interval-period",period:"second",precision:e,secondary:null}},xa=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},Ta=function(e,r){return{type:"interval-period",period:e.value,precision:r,secondary:null}},Aa=function(e){return{type:"interval-period",period:e.value,precision:null,secondary:null}},Ia=function(e,r){return{type:"interval-period",period:"second",precision:e,secondary:r}},Ea=function(e){return{type:"interval-period",period:"second",precision:e,secondary:null}},Sa=function(){return{type:"interval-period",period:"second",precision:null,secondary:null}},Ca=function(){return{type:"string",value:"day"}},_a=function(){return{type:"string",value:"hour"}},Pa=function(){return{type:"string",value:"minute"}},Fa=function(){return{type:"string",value:"month"}},La=function(){return{type:"string",value:"year"}},Ma=function(e){return parseFloat(e)},Da=function(e){return parseFloat(e)},Oa=function(e){return{type:"date",value:e.value}},Ra=function(){return{type:"null",value:null}},Ja=function(){return{type:"boolean",value:!0}},ka=function(){return{type:"boolean",value:!1}},ke=function(){return"'"},Ua=function(e){return{type:"string",value:e.join("")}},Ha=function(e,r){return{type:"case-expression",format:"simple",operand:e,clauses:r,else:null}},Va=function(e,r,a){return{type:"case-expression",format:"simple",operand:e,clauses:r,else:a.value}},qa=function(e){return{type:"case-expression",format:"searched",clauses:e,else:null}},Ba=function(e,r){return{type:"case-expression",format:"searched",clauses:e,else:r.value}},ja=function(e,r){return{type:"when-clause",operand:e,value:r}},Ya=function(e,r){return{type:"when-clause",operand:e,value:r}},za=function(e){return{type:"else-clause",value:e}},Ga=function(e){return{type:"number",value:e}},Wa=function(e,r,a){return parseFloat(e+r+a)},$a=function(e,r){return parseFloat(e+r)},Ka=function(e,r){return parseFloat(e+r)},Za=function(e){return parseFloat(e)},Qa=function(e,r){return e[0]+r},Xa=function(e){return"."+(e!=null?e:"")},eu=function(e,r){return e+r},tu=function(e){return e.join("")},nu=function(e,r){return"e"+(r===null?"":r)},ru=function(){return"IN"},au=function(){return"IS"},uu=function(){return"LIKE"},su=function(){return"ESCAPE"},ou=function(){return"NOT"},iu=function(){return"AND"},lu=function(){return"OR"},cu=function(){return"BETWEEN"},fu=function(){return"FROM"},pu=function(){return"FOR"},vu=function(){return"SUBSTRING"},hu=function(){return"EXTRACT"},du=function(){return"TRIM"},mu=function(){return"POSITION"},gu=function(){return"TIMESTAMP"},wu=function(){return"DATE"},yu=function(){return"LEADING"},Nu=function(){return"TRAILING"},bu=function(){return"BOTH"},xu=function(){return"TO"},Tu=function(){return"INTERVAL"},Au=function(){return"YEAR"},Iu=function(){return"MONTH"},Eu=function(){return"DAY"},Su=function(){return"HOUR"},Cu=function(){return"MINUTE"},_u=function(){return"SECOND"},Pu=function(){return"CASE"},Fu=function(){return"END"},Lu=function(){return"WHEN"},Mu=function(){return"THEN"},Du=function(){return"ELSE"},Ou=function(e){return e},Ru=function(e){return e.join("")},n=0,K=[{line:1,column:1}],M=0,pe=[],c=0;if("startRule"in v){if(!(v.startRule in A))throw new Error(`Can't start parsing from rule "`+v.startRule+'".');I=A[v.startRule]}function g(e,r){return{type:"literal",text:e,ignoreCase:r}}function O(e,r,a){return{type:"class",parts:e,inverted:r,ignoreCase:a}}function Ju(){return{type:"end"}}function Ue(e){var r,a=K[e];if(a)return a;for(r=e-1;!K[r];)r--;for(a={line:(a=K[r]).line,column:a.column};rM&&(M=n,pe=[]),pe.push(e))}function ku(e,r,a){return new u(u.buildMessage(e,r),e,r,a)}function Ve(){var e,r;return e=n,f(),(r=E())!==t?(f(),e=Or(r)):(n=e,e=t),e}function qe(){var e,r,a,s,d,N,b,T;if(e=n,(r=E())!==t){for(a=[],s=n,d=f(),(N=se())!==t?(b=f(),(T=E())!==t?s=d=[d,N,b,T]:(n=s,s=t)):(n=s,s=t);s!==t;)a.push(s),s=n,d=f(),(N=se())!==t?(b=f(),(T=E())!==t?s=d=[d,N,b,T]:(n=s,s=t)):(n=s,s=t);e=Rr(r,a)}else n=e,e=t;return e}function E(){var e,r,a,s,d,N,b,T;if(e=n,(r=ve())!==t){for(a=[],s=n,d=f(),(N=rt())!==t?(b=f(),(T=ve())!==t?s=d=[d,N,b,T]:(n=s,s=t)):(n=s,s=t);s!==t;)a.push(s),s=n,d=f(),(N=rt())!==t?(b=f(),(T=ve())!==t?s=d=[d,N,b,T]:(n=s,s=t)):(n=s,s=t);e=Jr(r,a)}else n=e,e=t;return e}function ve(){var e,r,a,s,d,N,b,T;if(e=n,(r=Z())!==t){for(a=[],s=n,d=f(),(N=re())!==t?(b=f(),(T=Z())!==t?s=d=[d,N,b,T]:(n=s,s=t)):(n=s,s=t);s!==t;)a.push(s),s=n,d=f(),(N=re())!==t?(b=f(),(T=Z())!==t?s=d=[d,N,b,T]:(n=s,s=t)):(n=s,s=t);e=kr(r,a)}else n=e,e=t;return e}function Z(){var e,r,a,s,d;return e=n,(r=z())===t&&(r=n,i.charCodeAt(n)===33?(a=k,n++):(a=t,c===0&&h(Ln)),a!==t?(s=n,c++,i.charCodeAt(n)===61?(d=D,n++):(d=t,c===0&&h(Le)),c--,d===t?s=void 0:(n=s,s=t),s!==t?r=a=[a,s]:(n=r,r=t)):(n=r,r=t)),r!==t?(a=f(),(s=Z())!==t?e=Ur(s):(n=e,e=t)):(n=e,e=t),e===t&&(e=Uu()),e}function Uu(){var e,r,a;return e=n,(r=R())!==t?(f(),(a=Hu())===t&&(a=null),e=Hr(r,a)):(n=e,e=t),e}function Hu(){var e;return(e=Vu())===t&&(e=Yu())===t&&(e=Bu())===t&&(e=qu())===t&&(e=ju()),e}function Vu(){var e,r,a,s,d,N;if(e=[],r=n,a=f(),(s=Be())!==t?(d=f(),(N=R())!==t?r=a=[a,s,d,N]:(n=r,r=t)):(n=r,r=t),r!==t)for(;r!==t;)e.push(r),r=n,a=f(),(s=Be())!==t?(d=f(),(N=R())!==t?r=a=[a,s,d,N]:(n=r,r=t)):(n=r,r=t);else e=t;return e!==t&&(e=Vr(e)),e}function Be(){var e;return i.substr(n,2)===x?(e=x,n+=2):(e=t,c===0&&h(Mn)),e===t&&(i.charCodeAt(n)===62?(e=S,n++):(e=t,c===0&&h(Dn)),e===t&&(i.substr(n,2)===L?(e=L,n+=2):(e=t,c===0&&h(On)),e===t&&(i.substr(n,2)===C?(e=C,n+=2):(e=t,c===0&&h(Rn)),e===t&&(i.charCodeAt(n)===60?(e=Ot,n++):(e=t,c===0&&h(Jn)),e===t&&(i.charCodeAt(n)===61?(e=D,n++):(e=t,c===0&&h(Le)),e===t&&(i.substr(n,2)===Ee?(e=Ee,n+=2):(e=t,c===0&&h(kn)))))))),e}function qu(){var e,r,a,s;return e=n,(r=tt())!==t?(f(),(a=z())!==t?(f(),(s=R())!==t?e=qr(r,s):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=tt())!==t?(f(),(a=R())!==t?e=Br(r,a):(n=e,e=t)):(n=e,e=t)),e}function Bu(){var e,r,a,s,d,N;return e=n,(r=z())!==t?(f(),(a=at())!==t?(f(),(s=R())!==t?(f(),(d=re())!==t?(f(),(N=R())!==t?e=jr(a,s,N):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=at())!==t?(f(),(a=R())!==t?(f(),(s=re())!==t?(f(),(d=R())!==t?e=Yr(r,a,d):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)),e}function je(){var e,r,a,s,d;return e=n,r=n,(a=z())!==t?(s=f(),(d=nt())!==t?r=a=[a,s,d]:(n=r,r=t)):(n=r,r=t),r!==t&&(r=zr(r)),(e=r)===t&&(e=nt()),e}function he(){var e,r,a,s,d;return e=n,r=n,(a=z())!==t?(s=f(),(d=Ne())!==t?r=a=[a,s,d]:(n=r,r=t)):(n=r,r=t),r!==t&&(r=Gr(r)),(e=r)===t&&(e=Ne()),e}function ju(){var e,r,a,s;return e=n,(r=je())!==t?(f(),(a=q())!==t?(f(),ys()!==t?(f(),(s=ye())!==t?e=Wr(r,a,s):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=je())!==t?(f(),(a=q())!==t?e=$r(r,a):(n=e,e=t)):(n=e,e=t)),e}function Yu(){var e,r,a,s;return e=n,(r=he())!==t?(f(),(a=_())!==t?(f(),(s=qe())!==t?(f(),P()!==t?e=Kr(r,s):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=he())!==t?(f(),(a=_())!==t?(f(),(s=P())!==t?e=Zr(r):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=he())!==t?(f(),(a=we())!==t?e=Qr(r,a):(n=e,e=t)):(n=e,e=t))),e}function R(){var e,r,a,s,d,N,b,T;if(e=n,(r=de())!==t){for(a=[],s=n,d=f(),(N=Ye())!==t?(b=f(),(T=de())!==t?s=d=[d,N,b,T]:(n=s,s=t)):(n=s,s=t);s!==t;)a.push(s),s=n,d=f(),(N=Ye())!==t?(b=f(),(T=de())!==t?s=d=[d,N,b,T]:(n=s,s=t)):(n=s,s=t);e=Xr(r,a)}else n=e,e=t;return e}function Ye(){var e;return i.charCodeAt(n)===43?(e=ie,n++):(e=t,c===0&&h(ce)),e===t&&(i.charCodeAt(n)===45?(e=le,n++):(e=t,c===0&&h(fe))),e}function de(){var e,r,a,s,d,N,b,T;if(e=n,(r=me())!==t){for(a=[],s=n,d=f(),(N=ze())!==t?(b=f(),(T=me())!==t?s=d=[d,N,b,T]:(n=s,s=t)):(n=s,s=t);s!==t;)a.push(s),s=n,d=f(),(N=ze())!==t?(b=f(),(T=me())!==t?s=d=[d,N,b,T]:(n=s,s=t)):(n=s,s=t);e=ea(r,a)}else n=e,e=t;return e}function ze(){var e;return i.charCodeAt(n)===42?(e=Rt,n++):(e=t,c===0&&h(Un)),e===t&&(i.charCodeAt(n)===47?(e=Jt,n++):(e=t,c===0&&h(Hn))),e}function me(){var e,r;return(e=ts())===t&&(e=$u())===t&&(e=Ku())===t&&(e=Zu())===t&&(e=Qu())===t&&(e=Xu())===t&&(e=cs())===t&&(e=zu())===t&&(e=we())===t&&(e=n,_()!==t?(f(),(r=E())!==t?(f(),P()!==t?e=ta(r):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)),e}function zu(){var e;return(e=Gu())!==t&&(e=na(e)),e}function Gu(){var e;return(e=Wu())!==t&&(e=ra(e)),e}function Wu(){var e,r,a,s;if(e=n,(r=ge())!==t){for(a=[],s=We();s!==t;)a.push(s),s=We();e=aa(r,a)}else n=e,e=t;return e}function Ge(){var e,r,a,s;if(e=n,(r=ge())!==t){for(a=[],s=y();s!==t;)a.push(s),s=y();e=ua(r,a)}else n=e,e=t;return e}function ge(){var e;return In.test(i.charAt(n))?(e=i.charAt(n),n++):(e=t,c===0&&h(Vn)),e}function y(){var e;return En.test(i.charAt(n))?(e=i.charAt(n),n++):(e=t,c===0&&h(qn)),e}function We(){var e;return Sn.test(i.charAt(n))?(e=i.charAt(n),n++):(e=t,c===0&&h(Bn)),e}function we(){var e,r,a;return e=n,i.charCodeAt(n)===64?(r=kt,n++):(r=t,c===0&&h(jn)),r!==t&&(a=Ge())!==t?e=r=[r,a]:(n=e,e=t),e!==t&&(e=sa(e)),e}function $u(){var e,r,a;return e=n,xs()!==t?(f(),_()!==t?(f(),(r=es())!==t?(f(),be()!==t?(f(),(a=E())!==t?(f(),P()!==t?e=oa(r,a):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e}function Ku(){var e,r,a,s,d,N,b;return e=n,bs()!==t?(f(),_()!==t?(f(),(r=E())!==t?(f(),be()!==t?(f(),(a=E())!==t?(f(),s=n,(d=Ns())!==t?(N=f(),(b=E())!==t?s=d=[d,N,b,f()]:(n=s,s=t)):(n=s,s=t),s===t&&(s=null),(d=P())!==t?e=ia(r,a,s):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e}function Zu(){var e,r,a,s;return e=n,ut()!==t?(f(),_()!==t?(f(),(r=$e())===t&&(r=null),f(),(a=E())!==t?(f(),be()!==t?(f(),(s=E())!==t?(f(),P()!==t?e=la(r,a,s):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,ut()!==t?(f(),_()!==t?(f(),(r=$e())===t&&(r=null),f(),(a=E())!==t?(f(),P()!==t?e=ca(r,a):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)),e}function $e(){var e;return(e=Es())===t&&(e=Ss())===t&&(e=Cs()),e}function Qu(){var e,r,a;return e=n,Ts()!==t?(f(),_()!==t?(f(),(r=E())!==t?(f(),Ne()!==t?(f(),(a=E())!==t?(f(),P()!==t?e=fa(r,a):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e}function Xu(){var e,r,a;return e=n,(r=Fs())!==t?(f(),_()!==t?(f(),(a=qe())===t&&(a=null),f(),P()!==t?e=pa(r,a):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e}function es(){var e;return(e=ot())===t&&(e=it())===t&&(e=lt())===t&&(e=ct())===t&&(e=ft())===t&&(e=U()),e}function ts(){var e;return(e=ye())===t&&(e=vs())===t&&(e=ls())===t&&(e=is())===t&&(e=os())===t&&(e=ns())===t&&(e=rs()),e}function ns(){var e,r;return e=n,As()!==t?(f(),(r=q())!==t?e=va(r):(n=e,e=t)):(n=e,e=t),e}function rs(){var e,r,a,s;return e=n,st()!==t?(f(),i.charCodeAt(n)===45?(r=le,n++):(r=t,c===0&&h(fe)),r===t&&(i.charCodeAt(n)===43?(r=ie,n++):(r=t,c===0&&h(ce))),r!==t?(f(),(a=q())!==t?(f(),(s=Ke())!==t?e=ha(r,a,s):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,st()!==t?(f(),(r=q())!==t?(f(),(a=Ke())!==t?e=da(r,a):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)),e}function Ke(){var e,r,a;return e=n,(r=as())!==t?(f(),_s()!==t?(f(),(a=us())!==t?e=ma(r,a):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=ss()),e}function as(){var e,r,a;return e=n,(r=Y())!==t?(f(),_()!==t?(f(),(a=X())!==t?(f(),P()!==t?e=ga(r,a):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=Y())!==t&&(r=wa(r)),e=r),e}function us(){var e,r,a,s;return e=n,(r=Y())!==t&&(r=ya(r)),(e=r)===t&&(e=n,(r=U())!==t?(f(),_()!==t?(f(),(a=X())!==t?(f(),se()!==t?(f(),(s=Q())!==t?(f(),P()!==t?e=Na(a,s):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=U())!==t?(f(),_()!==t?(f(),(a=X())!==t?(f(),P()!==t?e=ba(a):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=U())!==t&&(r=xa()),e=r))),e}function ss(){var e,r,a,s;return e=n,(r=Y())!==t?(f(),_()!==t?(f(),(a=Q())!==t?(f(),P()!==t?e=Ta(r,a):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=Y())!==t&&(r=Aa(r)),(e=r)===t&&(e=n,(r=U())!==t?(f(),_()!==t?(f(),(a=X())!==t?(f(),se()!==t?(f(),(s=Q())!==t?(f(),P()!==t?e=Ia(a,s):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=U())!==t?(f(),_()!==t?(f(),(a=Q())!==t?(f(),P()!==t?e=Ea(a):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e===t&&(e=n,(r=U())!==t&&(r=Sa()),e=r)))),e}function Y(){var e,r;return e=n,(r=lt())!==t&&(r=Ca()),(e=r)===t&&(e=n,(r=ct())!==t&&(r=_a()),(e=r)===t&&(e=n,(r=ft())!==t&&(r=Pa()),(e=r)===t&&(e=n,(r=it())!==t&&(r=Fa()),(e=r)===t&&(e=n,(r=ot())!==t&&(r=La()),e=r)))),e}function Q(){var e;return(e=B())!==t&&(e=Ma(e)),e}function X(){var e;return(e=B())!==t&&(e=Da(e)),e}function os(){var e,r;return e=n,Is()!==t?(f(),(r=q())!==t?e=Oa(r):(n=e,e=t)):(n=e,e=t),e}function is(){var e;return(e=ms())!==t&&(e=Ra()),e}function ls(){var e,r;return e=n,(r=gs())!==t&&(r=Ja()),(e=r)===t&&(e=n,(r=ws())!==t&&(r=ka()),e=r),e}function q(){var e;return(e=ye())===t&&(e=we()),e}function ye(){var e,r,a,s,d;if(e=n,i.charCodeAt(n)===39?(r=Se,n++):(r=t,c===0&&h(Me)),r===t&&(i.substr(n,2)===Ce?(r=Ce,n+=2):(r=t,c===0&&h(Yn))),r!==t){for(a=[],s=n,i.substr(n,2)===$?(d=$,n+=2):(d=t,c===0&&h(De)),d!==t&&(d=ke()),(s=d)===t&&(Pe.test(i.charAt(n))?(s=i.charAt(n),n++):(s=t,c===0&&h(Oe)));s!==t;)a.push(s),s=n,i.substr(n,2)===$?(d=$,n+=2):(d=t,c===0&&h(De)),d!==t&&(d=ke()),(s=d)===t&&(Pe.test(i.charAt(n))?(s=i.charAt(n),n++):(s=t,c===0&&h(Oe)));i.charCodeAt(n)===39?(s=Se,n++):(s=t,c===0&&h(Me)),s!==t?e=Ua(a):(n=e,e=t)}else n=e,e=t;return e}function cs(){var e;return(e=fs())===t&&(e=ps()),e}function fs(){var e,r,a,s,d;if(e=n,ae()!==t)if(f(),(r=E())!==t){for(f(),a=[],s=te();s!==t;)a.push(s),s=te();s=f(),(d=ue())!==t?e=Ha(r,a):(n=e,e=t)}else n=e,e=t;else n=e,e=t;if(e===t)if(e=n,ae()!==t)if(f(),(r=E())!==t){for(f(),a=[],s=te();s!==t;)a.push(s),s=te();s=f(),(d=Ze())!==t?(f(),ue()!==t?e=Va(r,a,d):(n=e,e=t)):(n=e,e=t)}else n=e,e=t;else n=e,e=t;return e}function ps(){var e,r,a,s;if(e=n,ae()!==t){for(f(),r=[],a=ee();a!==t;)r.push(a),a=ee();a=f(),(s=ue())!==t?e=qa(r):(n=e,e=t)}else n=e,e=t;if(e===t)if(e=n,ae()!==t){for(f(),r=[],a=ee();a!==t;)r.push(a),a=ee();a=f(),(s=Ze())!==t?(f(),ue()!==t?e=Ba(r,s):(n=e,e=t)):(n=e,e=t)}else n=e,e=t;return e}function ee(){var e,r,a;return e=n,pt()!==t?(f(),(r=E())!==t?(f(),vt()!==t?(f(),(a=E())!==t?e=ja(r,a):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e}function te(){var e,r,a;return e=n,pt()!==t?(f(),(r=E())!==t?(f(),vt()!==t?(f(),(a=E())!==t?e=Ya(r,a):(n=e,e=t)):(n=e,e=t)):(n=e,e=t)):(n=e,e=t),e}function Ze(){var e,r;return e=n,Ps()!==t?(f(),(r=E())!==t?e=za(r):(n=e,e=t)):(n=e,e=t),e}function vs(){var e,r,a,s;return e=n,(r=hs())!==t?(a=n,c++,s=ge(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=Ga(r):(n=e,e=t)):(n=e,e=t),e}function hs(){var e,r,a,s;return e=n,(r=ne())!==t&&(a=Qe())!==t&&(s=Xe())!==t?e=Wa(r,a,s):(n=e,e=t),e===t&&(e=n,(r=ne())!==t&&(a=Qe())!==t?e=$a(r,a):(n=e,e=t),e===t&&(e=n,(r=ne())!==t&&(a=Xe())!==t?e=Ka(r,a):(n=e,e=t),e===t&&(e=n,(r=ne())!==t&&(r=Za(r)),e=r))),e}function ne(){var e,r,a;return(e=B())===t&&(e=n,i.charCodeAt(n)===45?(r=le,n++):(r=t,c===0&&h(fe)),r===t&&(i.charCodeAt(n)===43?(r=ie,n++):(r=t,c===0&&h(ce))),r!==t&&(a=B())!==t?e=Qa(r,a):(n=e,e=t)),e}function Qe(){var e,r,a;return e=n,i.charCodeAt(n)===46?(r=Ut,n++):(r=t,c===0&&h(zn)),r!==t?((a=B())===t&&(a=null),e=Xa(a)):(n=e,e=t),e}function Xe(){var e,r,a;return e=n,(r=ds())!==t&&(a=B())!==t?e=eu(r,a):(n=e,e=t),e}function B(){var e,r;if(e=[],(r=et())!==t)for(;r!==t;)e.push(r),r=et();else e=t;return e!==t&&(e=tu(e)),e}function et(){var e;return Cn.test(i.charAt(n))?(e=i.charAt(n),n++):(e=t,c===0&&h(Gn)),e}function ds(){var e,r,a;return e=n,_n.test(i.charAt(n))?(r=i.charAt(n),n++):(r=t,c===0&&h(Wn)),r!==t?(Pn.test(i.charAt(n))?(a=i.charAt(n),n++):(a=t,c===0&&h($n)),a===t&&(a=null),e=nu(r,a)):(n=e,e=t),e}function ms(){var e,r,a,s;return e=n,i.substr(n,4).toLowerCase()===Ht?(r=i.substr(n,4),n+=4):(r=t,c===0&&h(Kn)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=r=[r,a]:(n=e,e=t)):(n=e,e=t),e}function gs(){var e,r,a,s;return e=n,i.substr(n,4).toLowerCase()===Vt?(r=i.substr(n,4),n+=4):(r=t,c===0&&h(Zn)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=r=[r,a]:(n=e,e=t)):(n=e,e=t),e}function ws(){var e,r,a,s;return e=n,i.substr(n,5).toLowerCase()===qt?(r=i.substr(n,5),n+=5):(r=t,c===0&&h(Qn)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=r=[r,a]:(n=e,e=t)):(n=e,e=t),e}function Ne(){var e,r,a,s;return e=n,i.substr(n,2).toLowerCase()===Bt?(r=i.substr(n,2),n+=2):(r=t,c===0&&h(Xn)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=ru():(n=e,e=t)):(n=e,e=t),e}function tt(){var e,r,a,s;return e=n,i.substr(n,2).toLowerCase()===jt?(r=i.substr(n,2),n+=2):(r=t,c===0&&h(er)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=au():(n=e,e=t)):(n=e,e=t),e}function nt(){var e,r,a,s;return e=n,i.substr(n,4).toLowerCase()===Yt?(r=i.substr(n,4),n+=4):(r=t,c===0&&h(tr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=uu():(n=e,e=t)):(n=e,e=t),e}function ys(){var e,r,a,s;return e=n,i.substr(n,6).toLowerCase()===zt?(r=i.substr(n,6),n+=6):(r=t,c===0&&h(nr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=su():(n=e,e=t)):(n=e,e=t),e}function z(){var e,r,a,s;return e=n,i.substr(n,3).toLowerCase()===Gt?(r=i.substr(n,3),n+=3):(r=t,c===0&&h(rr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=ou():(n=e,e=t)):(n=e,e=t),e}function re(){var e,r,a,s;return e=n,i.substr(n,3).toLowerCase()===Wt?(r=i.substr(n,3),n+=3):(r=t,c===0&&h(ar)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=iu():(n=e,e=t)):(n=e,e=t),e}function rt(){var e,r,a,s;return e=n,i.substr(n,2).toLowerCase()===$t?(r=i.substr(n,2),n+=2):(r=t,c===0&&h(ur)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=lu():(n=e,e=t)):(n=e,e=t),e}function at(){var e,r,a,s;return e=n,i.substr(n,7).toLowerCase()===Kt?(r=i.substr(n,7),n+=7):(r=t,c===0&&h(sr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=cu():(n=e,e=t)):(n=e,e=t),e}function be(){var e,r,a,s;return e=n,i.substr(n,4).toLowerCase()===Zt?(r=i.substr(n,4),n+=4):(r=t,c===0&&h(or)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=fu():(n=e,e=t)):(n=e,e=t),e}function Ns(){var e,r,a,s;return e=n,i.substr(n,3).toLowerCase()===Qt?(r=i.substr(n,3),n+=3):(r=t,c===0&&h(ir)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=pu():(n=e,e=t)):(n=e,e=t),e}function bs(){var e,r,a,s;return e=n,i.substr(n,9).toLowerCase()===Xt?(r=i.substr(n,9),n+=9):(r=t,c===0&&h(lr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=vu():(n=e,e=t)):(n=e,e=t),e}function xs(){var e,r,a,s;return e=n,i.substr(n,7).toLowerCase()===en?(r=i.substr(n,7),n+=7):(r=t,c===0&&h(cr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=hu():(n=e,e=t)):(n=e,e=t),e}function ut(){var e,r,a,s;return e=n,i.substr(n,4).toLowerCase()===tn?(r=i.substr(n,4),n+=4):(r=t,c===0&&h(fr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=du():(n=e,e=t)):(n=e,e=t),e}function Ts(){var e,r,a,s;return e=n,i.substr(n,8).toLowerCase()===nn?(r=i.substr(n,8),n+=8):(r=t,c===0&&h(pr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=mu():(n=e,e=t)):(n=e,e=t),e}function As(){var e,r,a,s;return e=n,i.substr(n,9).toLowerCase()===rn?(r=i.substr(n,9),n+=9):(r=t,c===0&&h(vr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=gu():(n=e,e=t)):(n=e,e=t),e}function Is(){var e,r,a,s;return e=n,i.substr(n,4).toLowerCase()===an?(r=i.substr(n,4),n+=4):(r=t,c===0&&h(hr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=wu():(n=e,e=t)):(n=e,e=t),e}function Es(){var e,r,a,s;return e=n,i.substr(n,7).toLowerCase()===un?(r=i.substr(n,7),n+=7):(r=t,c===0&&h(dr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=yu():(n=e,e=t)):(n=e,e=t),e}function Ss(){var e,r,a,s;return e=n,i.substr(n,8).toLowerCase()===sn?(r=i.substr(n,8),n+=8):(r=t,c===0&&h(mr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=Nu():(n=e,e=t)):(n=e,e=t),e}function Cs(){var e,r,a,s;return e=n,i.substr(n,4).toLowerCase()===on?(r=i.substr(n,4),n+=4):(r=t,c===0&&h(gr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=bu():(n=e,e=t)):(n=e,e=t),e}function _s(){var e,r,a,s;return e=n,i.substr(n,2).toLowerCase()===ln?(r=i.substr(n,2),n+=2):(r=t,c===0&&h(wr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=xu():(n=e,e=t)):(n=e,e=t),e}function st(){var e,r,a,s;return e=n,i.substr(n,8).toLowerCase()===cn?(r=i.substr(n,8),n+=8):(r=t,c===0&&h(yr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=Tu():(n=e,e=t)):(n=e,e=t),e}function ot(){var e,r,a,s;return e=n,i.substr(n,4).toLowerCase()===fn?(r=i.substr(n,4),n+=4):(r=t,c===0&&h(Nr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=Au():(n=e,e=t)):(n=e,e=t),e}function it(){var e,r,a,s;return e=n,i.substr(n,5).toLowerCase()===pn?(r=i.substr(n,5),n+=5):(r=t,c===0&&h(br)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=Iu():(n=e,e=t)):(n=e,e=t),e}function lt(){var e,r,a,s;return e=n,i.substr(n,3).toLowerCase()===vn?(r=i.substr(n,3),n+=3):(r=t,c===0&&h(xr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=Eu():(n=e,e=t)):(n=e,e=t),e}function ct(){var e,r,a,s;return e=n,i.substr(n,4).toLowerCase()===hn?(r=i.substr(n,4),n+=4):(r=t,c===0&&h(Tr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=Su():(n=e,e=t)):(n=e,e=t),e}function ft(){var e,r,a,s;return e=n,i.substr(n,6).toLowerCase()===dn?(r=i.substr(n,6),n+=6):(r=t,c===0&&h(Ar)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=Cu():(n=e,e=t)):(n=e,e=t),e}function U(){var e,r,a,s;return e=n,i.substr(n,6).toLowerCase()===mn?(r=i.substr(n,6),n+=6):(r=t,c===0&&h(Ir)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=_u():(n=e,e=t)):(n=e,e=t),e}function ae(){var e,r,a,s;return e=n,i.substr(n,4).toLowerCase()===gn?(r=i.substr(n,4),n+=4):(r=t,c===0&&h(Er)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=Pu():(n=e,e=t)):(n=e,e=t),e}function ue(){var e,r,a,s;return e=n,i.substr(n,3).toLowerCase()===wn?(r=i.substr(n,3),n+=3):(r=t,c===0&&h(Sr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=Fu():(n=e,e=t)):(n=e,e=t),e}function pt(){var e,r,a,s;return e=n,i.substr(n,4).toLowerCase()===yn?(r=i.substr(n,4),n+=4):(r=t,c===0&&h(Cr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=Lu():(n=e,e=t)):(n=e,e=t),e}function vt(){var e,r,a,s;return e=n,i.substr(n,4).toLowerCase()===Nn?(r=i.substr(n,4),n+=4):(r=t,c===0&&h(_r)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=Mu():(n=e,e=t)):(n=e,e=t),e}function Ps(){var e,r,a,s;return e=n,i.substr(n,4).toLowerCase()===bn?(r=i.substr(n,4),n+=4):(r=t,c===0&&h(Pr)),r!==t?(a=n,c++,s=y(),c--,s===t?a=void 0:(n=a,a=t),a!==t?e=Du():(n=e,e=t)):(n=e,e=t),e}function se(){var e;return i.charCodeAt(n)===44?(e=xn,n++):(e=t,c===0&&h(Fr)),e}function _(){var e;return i.charCodeAt(n)===40?(e=Tn,n++):(e=t,c===0&&h(Lr)),e}function P(){var e;return i.charCodeAt(n)===41?(e=An,n++):(e=t,c===0&&h(Mr)),e}function f(){var e,r;for(e=[],r=ht();r!==t;)e.push(r),r=ht();return e}function ht(){var e;return Fn.test(i.charAt(n))?(e=i.charAt(n),n++):(e=t,c===0&&h(Dr)),e}function Fs(){var e,r,a,s;if(e=n,(r=Ge())!==t&&(r=Ou(r)),(e=r)===t)if(e=n,i.charCodeAt(n)===96?(r=_e,n++):(r=t,c===0&&h(Re)),r!==t){if(a=[],Fe.test(i.charAt(n))?(s=i.charAt(n),n++):(s=t,c===0&&h(Je)),s!==t)for(;s!==t;)a.push(s),Fe.test(i.charAt(n))?(s=i.charAt(n),n++):(s=t,c===0&&h(Je));else a=t;a!==t?(i.charCodeAt(n)===96?(s=_e,n++):(s=t,c===0&&h(Re)),s!==t?e=Ru(a):(n=e,e=t)):(n=e,e=t)}else n=e,e=t;return e}function Ls(e,r){return{type:"unary-expression",operator:e,expr:r}}function dt(e,r,a,s){var d={type:"binary-expression",operator:e,left:r,right:a};return s!==void 0&&(d.escape=s),d}function Ms(e,r){for(var a=[e],s=0;s `+A+` `+k+` | diff --git a/assets/WorkerTileHandler.8091b1a1.js b/assets/WorkerTileHandler.de9f3c4a.js similarity index 99% rename from assets/WorkerTileHandler.8091b1a1.js rename to assets/WorkerTileHandler.de9f3c4a.js index 0c1d82e..77939b6 100644 --- a/assets/WorkerTileHandler.8091b1a1.js +++ b/assets/WorkerTileHandler.de9f3c4a.js @@ -1,2 +1,2 @@ -import{hm as ke,bz as ve,A as Ye,c1 as Ze,c as Je,x as Ke}from"./index.d94abe07.js";import{I as _e,L as oe}from"./enums.54326430.js";import{f as Be,t as le,n as se,a as Ce,h as We,r as Se,P as Y,b as ge}from"./GeometryUtils.4f19e772.js";import{t as Ee}from"./Rect.95b0fd2e.js";import{o as Re}from"./config.82550349.js";import{l as ie,m as k,o as Oe,n as be,p as Qe,u as Pe,a as ee}from"./StyleDefinition.d56936e4.js";import{t as D,s as Xe}from"./Geometry.d049a63c.js";import{r as et,c as tt,n as st,_ as it,i as rt}from"./TileClipper.8c399a8a.js";import{t as E,T as nt,m as at,l as ot}from"./StyleRepository.a1fecb1f.js";import{x as Fe}from"./earcut.afc1d357.js";import{C as lt}from"./BidiEngine.d8bba3fc.js";import"./enums.0295eb81.js";import"./GeometryUtils.51c4032a.js";import"./enums.2d9e6f64.js";import"./VertexElementDescriptor.1fdca6da.js";import"./colorUtils.bb6424b7.js";function ht(u){return u===746||u===747||!(u<4352)&&(u>=12704&&u<=12735||u>=12544&&u<=12591||u>=65072&&u<=65103&&!(u>=65097&&u<=65103)||u>=63744&&u<=64255||u>=13056&&u<=13311||u>=11904&&u<=12031||u>=12736&&u<=12783||u>=12288&&u<=12351&&!(u>=12296&&u<=12305||u>=12308&&u<=12319||u===12336)||u>=13312&&u<=19903||u>=19968&&u<=40959||u>=12800&&u<=13055||u>=12592&&u<=12687||u>=43360&&u<=43391||u>=55216&&u<=55295||u>=4352&&u<=4607||u>=44032&&u<=55215||u>=12352&&u<=12447||u>=12272&&u<=12287||u>=12688&&u<=12703||u>=12032&&u<=12255||u>=12784&&u<=12799||u>=12448&&u<=12543&&u!==12540||u>=65280&&u<=65519&&!(u===65288||u===65289||u===65293||u>=65306&&u<=65310||u===65339||u===65341||u===65343||u>=65371&&u<=65503||u===65507||u>=65512&&u<=65519)||u>=65104&&u<=65135&&!(u>=65112&&u<=65118||u>=65123&&u<=65126)||u>=5120&&u<=5759||u>=6320&&u<=6399||u>=65040&&u<=65055||u>=19904&&u<=19967||u>=40960&&u<=42127||u>=42128&&u<=42191)}function ct(u){return!(u<11904)&&(u>=12704&&u<=12735||u>=12544&&u<=12591||u>=65072&&u<=65103||u>=63744&&u<=64255||u>=13056&&u<=13311||u>=11904&&u<=12031||u>=12736&&u<=12783||u>=12288&&u<=12351||u>=13312&&u<=19903||u>=19968&&u<=40959||u>=12800&&u<=13055||u>=65280&&u<=65519||u>=12352&&u<=12447||u>=12272&&u<=12287||u>=12032&&u<=12255||u>=12784&&u<=12799||u>=12448&&u<=12543||u>=65040&&u<=65055||u>=42128&&u<=42191||u>=40960&&u<=42127)}function ut(u){switch(u){case 10:case 32:case 38:case 40:case 41:case 43:case 45:case 47:case 173:case 183:case 8203:case 8208:case 8211:case 8231:return!0}return!1}function ze(u){switch(u){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}const H=24,je=17;class qe{constructor(e,t,i,s,r,n,a){this._glyphItems=e,this._maxWidth=t,this._lineHeight=i,this._letterSpacing=s,this._hAnchor=r,this._vAnchor=n,this._justify=a}getShaping(e,t,i){const s=this._letterSpacing,r=this._lineHeight,n=this._justify,a=this._maxWidth,o=[];let c=0,h=0;const d=e.length;for(let g=0;g0&&(l=c/Math.max(1,Math.ceil(c/a)));const f=e.includes("\u200B"),y=[];for(let g=0;gb&&ze(o[_].codePoint);)o[_].glyphMosaicItem=null,--_;if(b<=_){const M=o[b].x;for(let P=b;P<=_;P++)o[P].x-=M,o[P].y=h;let B=o[_].x;o[_].glyphMosaicItem&&(B+=o[_].glyphMosaicItem.metrics.advance),w=Math.max(B,w),n&&this._applyJustification(o,b,_)}m=I,h+=x}if(o.length>0){const g=p.length-1,I=(n-this._hAnchor)*w;let b=(-this._vAnchor*(g+1)+.5)*r;t&&g&&(b+=g*r);for(const _ of o)_.x+=I,_.y+=b}return o.filter(g=>g.glyphMosaicItem)}static getTextBox(e,t){if(!e.length)return null;let i=1/0,s=1/0,r=0,n=0;for(const a of e){const o=a.glyphMosaicItem.metrics.advance,c=a.x,h=a.y-je,d=c+o,l=h+t;i=Math.min(i,c),r=Math.max(r,d),s=Math.min(s,h),n=Math.max(n,l)}return{x:i,y:s,width:r-i,height:n-s}}static getBox(e){if(!e.length)return null;let t=1/0,i=1/0,s=0,r=0;for(const n of e){const{height:a,left:o,top:c,width:h}=n.glyphMosaicItem.metrics,d=n.x,l=n.y-(a-Math.abs(c)),f=d+h+o,y=l+a;t=Math.min(t,d),s=Math.max(s,f),i=Math.min(i,l),r=Math.max(r,y)}return{x:t,y:i,width:s-t,height:r-i}}static addDecoration(e,t){const i=e.length;if(i===0)return;const s=3;let r=e[0].x+e[0].glyphMosaicItem.metrics.left,n=e[0].y;for(let o=1;o=0&&a,f=s.allowOverlap&&s.ignorePlacement?null:[],y=[],p=4,w=!l;let x=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=x,I=m;const b=(l||a)&&o,_=s.size/H;let M=!1;for(const T of t)if(T.vertical){M=!0;break}let B,P=0,L=0;if(!l&&M){const T=qe.getTextBox(t,s.lineHeight*H);switch(s.anchor){case k.LEFT:P=T.height/2,L=-T.width/2;break;case k.RIGHT:P=-T.height/2,L=T.width/2;break;case k.TOP:P=T.height/2,L=T.width/2;break;case k.BOTTOM:P=-T.height/2,L=-T.width/2;break;case k.TOP_LEFT:P=T.height;break;case k.BOTTOM_LEFT:L=-T.width;break;case k.TOP_RIGHT:L=T.width;break;case k.BOTTOM_RIGHT:P=-T.height}}P+=s.offset[0]*H,L+=s.offset[1]*H;for(const T of t){const C=T.glyphMosaicItem;if(!C||C.rect.isEmpty)continue;const A=C.rect,v=C.metrics,R=C.page;if(f&&w){if(B!==void 0&&B!==T.y){let S,F,$,G;M?(S=-I+P,F=x+L,$=I-g,G=m-x):(S=x+P,F=g+L,$=m-x,G=I-g);const j={xTile:e.x,yTile:e.y,dxPixels:S*_-c,dyPixels:F*_-c,hard:!s.optional,partIndex:1,width:$*_+2*c,height:G*_+2*c,angle:n,minLod:X,maxLod:se};f.push(j),x=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=x,I=m}B=T.y}const Z=[];if(l){const S=.5*C.metrics.width,F=(T.x+v.left-p+S)*_*he;if(h=this._placeGlyph(e,h,F,i,e.segment,1,T.vertical,R,Z),o&&(h=this._placeGlyph(e,h,F,i,e.segment,-1,T.vertical,R,Z)),h>=Te)break}else Z.push(new me(r,d,d,R,!1)),a&&o&&Z.push(new me(r,d+le,d+le,R,!1));const N=T.x+v.left,W=T.y-je-v.top,J=N+v.width,we=W+v.height;let O,U,ce,ue,Q,fe,Ve,Ae;if(!l&&M)if(T.vertical){const S=(N+J)/2-v.height/2,F=(W+we)/2+v.width/2;O=new D(-F-p+P,S-p+L),U=new D(O.x+A.width,O.y+A.height),ce=new D(O.x,U.y),ue=new D(U.x,O.y)}else O=new D(-W+p+P,N-p+L),U=new D(O.x-A.height,O.y+A.width),ce=new D(U.x,O.y),ue=new D(O.x,U.y);else O=new D(N-p+P,W-p+L),U=new D(O.x+A.width,O.y+A.height),ce=new D(O.x,U.y),ue=new D(U.x,O.y);for(const S of Z){let F,$,G,j;if(S.alternateVerticalGlyph){if(!Q){const q=(W+we)/2+L;Q=new D((N+J)/2+P-v.height/2-p,q+v.width/2+p),fe=new D(Q.x+A.height,Q.y-A.width),Ve=new D(fe.x,Q.y),Ae=new D(Q.x,fe.y)}F=Q,$=Ve,G=Ae,j=fe}else F=O,$=ce,G=ue,j=U;const de=W,Me=we,xe=S.glyphAngle+n;if(xe!==0){const q=Math.cos(xe),ye=Math.sin(xe);F=F.clone(),$=$.clone(),G=G.clone(),j=j.clone(),F.rotate(q,ye),j.rotate(q,ye),$.rotate(q,ye),G.rotate(q,ye)}let ne=0,ae=256;if(l&&M?T.vertical?S.alternateVerticalGlyph?(ne=32,ae=96):(ne=224,ae=32):(ne=224,ae=96):(ne=192,ae=64),y.push(new Ue(F,G,$,j,A,S.labelAngle,ne,ae,S.anchor,S.minzoom,S.maxzoom,S.page)),f&&(!b||this._legible(S.labelAngle))){if(w)Nm&&(m=J),Me>I&&(I=Me);else if(S.minzoom=Te)return null;if(f&&w){let T,C,A,v;M?(T=-I+P,C=x+L,A=I-g,v=m-x):(T=x+P,C=g+L,A=m-x,v=I-g);const R={xTile:e.x,yTile:e.y,dxPixels:T*_-c,dyPixels:C*_-c,hard:!s.optional,partIndex:1,width:A*_+2*c,height:v*_+2*c,angle:n,minLod:X,maxLod:se};f.push(R)}const V=new $e(y);return f&&f.length>0&&(V.textColliders=f),V}_legible(e){const t=We(e);return t<65||t>=193}_placeGlyph(e,t,i,s,r,n,a,o,c){let h=n;const d=h<0?Ce(e.angle+le,Se):e.angle;let l=0;i<0&&(h*=-1,i*=-1,l=le),h>0&&++r;let f=new D(e.x,e.y),y=s[r],p=se;if(s.length<=r)return p;for(;;){const w=y.x-f.x,x=y.y-f.y,m=Math.sqrt(w*w+x*x),g=Math.max(i/m,t),I=w/m,b=x/m,_=Ce(Math.atan2(b,I)+l,Se);if(c.push(new me(f,d,_,o,!1,g,p)),a&&c.push(new me(f,d,_,o,!0,g,p)),g<=t)return g;f=y.clone();do{if(r+=h,s.length<=r||r<0)return g;y=s[r]}while(f.isEqual(y));let M=y.x-f.x,B=y.y-f.y;const P=Math.sqrt(M*M+B*B);M*=m/P,B*=m/P,f.x-=M,f.y-=B,p=g}}}var re;(function(u){u[u.moveTo=1]="moveTo",u[u.lineTo=2]="lineTo",u[u.close=7]="close"})(re||(re={}));class dt{constructor(e,t){this.values={},this._geometry=void 0,this._pbfGeometry=null;const i=t.keys,s=t.values,r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:this.id=r.getUInt64();break;case 2:{const n=r.getMessage().asUnsafe(),a=this.values;for(;!n.empty();){const o=n.getUInt32(),c=n.getUInt32();a[i[o]]=s[c]}n.release();break}case 3:this.type=r.getUInt32();break;case 4:this._pbfGeometry=r.getMessage();break;default:r.skip()}}getGeometry(e){if(this._geometry!==void 0)return this._geometry;if(!this._pbfGeometry)return null;const t=this._pbfGeometry.asUnsafe();let i,s;this._pbfGeometry=null,e?e.reset(this.type):i=[];let r,n=re.moveTo,a=0,o=0,c=0;for(;!t.empty();){if(a===0){const h=t.getUInt32();n=7&h,a=h>>3}switch(a--,n){case re.moveTo:o+=t.getSInt32(),c+=t.getSInt32(),e?e.moveTo(o,c):i&&(s&&i.push(s),s=[],s.push(new D(o,c)));break;case re.lineTo:o+=t.getSInt32(),c+=t.getSInt32(),e?e.lineTo(o,c):s&&s.push(new D(o,c));break;case re.close:e?e.close():s&&!s[0].equals(o,c)&&s.push(s[0].clone());break;default:throw t.release(),new Error("Invalid path operation")}}return e?r=e.result():i&&(s&&i.push(s),r=i),t.release(),this._geometry=r,r}}class te extends E{constructor(){super(12)}add(e,t,i){const s=this.array;s.push(e),s.push(t),s.push(i)}}class Le{constructor(e){this.extent=4096,this.keys=[],this.values=[],this._pbfLayer=e.clone();const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:this.name=t.getString();break;case 3:this.keys.push(t.getString());break;case 4:this.values.push(t.processMessage(Le._parseValue));break;case 5:this.extent=t.getUInt32();break;default:t.skip()}}getData(){return this._pbfLayer}static _parseValue(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.getInt64();case 5:return e.getUInt64();case 6:return e.getSInt64();case 7:return e.getBool();default:e.skip()}return null}}class xt extends E{constructor(e){super(e)}add(e,t,i,s,r,n,a,o,c,h,d,l){const f=this.array;let y=E.i1616to32(e,t);f.push(y);const p=31;y=E.i8888to32(Math.round(p*i),Math.round(p*s),Math.round(p*r),Math.round(p*n)),f.push(y),y=E.i8888to32(Math.round(p*a),Math.round(p*o),Math.round(p*c),Math.round(p*h)),f.push(y),y=E.i1616to32(d,0),f.push(y),l&&f.push(...l)}}class yt extends E{constructor(e){super(e)}add(e,t,i){const s=this.array;s.push(E.i1616to32(e,t)),i&&s.push(...i)}}class gt extends E{constructor(e){super(e)}add(e,t,i,s,r,n,a){const o=this.array,c=this.index;let h=E.i1616to32(e,t);o.push(h);const d=15;return h=E.i8888to32(Math.round(d*i),Math.round(d*s),r,n),o.push(h),a&&o.push(...a),c}}class Ge extends E{constructor(e){super(e)}add(e,t,i,s,r,n,a,o,c,h,d,l){const f=this.array;let y=E.i1616to32(e,t);f.push(y),y=E.i1616to32(Math.round(8*i),Math.round(8*s)),f.push(y),y=E.i8888to32(r/4,n/4,o,c),f.push(y),y=E.i8888to32(0,We(a),10*h,Math.min(10*d,255)),f.push(y),l&&f.push(...l)}}class pt extends E{constructor(e){super(e)}add(e,t,i,s,r){const n=this.array,a=E.i1616to32(2*e+i,2*t+s);n.push(a),r&&n.push(...r)}}class Ie{constructor(e,t,i){this.layerExtent=4096,this._features=[],this.layer=e,this.zoom=t,this._spriteInfo=i,this._filter=e.getFeatureFilter()}pushFeature(e){this._filter&&!this._filter.filter(e,this.zoom)||this._features.push(e)}hasFeatures(){return this._features.length>0}getResources(e,t,i){}}class mt extends Ie{constructor(e,t,i,s,r){super(e,t,i),this.type=_e.CIRCLE,this._circleVertexBuffer=s,this._circleIndexBuffer=r}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(e){const t=this._circleVertexBuffer,i=this._circleIndexBuffer;this._circleIndexStart=3*i.index,this._circleIndexCount=0;const s=this.layer,r=this.zoom;e&&e.setExtent(this.layerExtent);for(const n of this._features){const a=n.getGeometry(e);if(!a)continue;const o=s.circleMaterial.encodeAttributes(n,r,s);for(const c of a)if(c)for(const h of c){const d=t.index;t.add(h.x,h.y,0,0,o),t.add(h.x,h.y,0,1,o),t.add(h.x,h.y,1,0,o),t.add(h.x,h.y,1,1,o),i.add(d+0,d+1,d+2),i.add(d+1,d+2,d+3),this._circleIndexCount+=6}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this._circleVertexBuffer.array.length,e+=this._circleIndexBuffer.array.length;const t=new Uint32Array(e),i=new Int32Array(t.buffer);let s=0;t[s++]=this.type,t[s++]=this.layerUIDs.length;for(let r=0;rI.page-b.page);for(const{ddFillAttributes:I,ddOutlineAttributes:b,page:_,geometry:M}of f)this._processFeature(M,h,t.outlineUsesFillColor,I,b,l,_)}}else for(const f of d){const y=n?s.encodeAttributes(f,i,t):null,p=h&&a?r.encodeAttributes(f,i,t):null,w=f.getGeometry(e);this._processFeature(w,h,t.outlineUsesFillColor,y,p,l)}}serialize(){let e=10;e+=this.layerUIDs.length,e+=this._fillVertexBuffer.array.length,e+=this._fillIndexBuffer.array.length,e+=this._outlineVertexBuffer.array.length,e+=this._outlineIndexBuffer.array.length,e+=3*this._patternMap.size+1;const t=new Uint32Array(e),i=new Int32Array(t.buffer);let s=0;t[s++]=this.type,t[s++]=this.layerUIDs.length;for(let a=0;a0)for(const[a,[o,c]]of r)t[s++]=a,t[s++]=o,t[s++]=c;t[s++]=this._fillVertexBuffer.array.length;for(let a=0;ah?(d!==void 0&&this._processFill(e,d,s,n,a),d=[l]):f<-h&&d!==void 0&&d.push(l)}d!==void 0&&this._processFill(e,d,s,n,a)}_processOutline(e,t){const i=this._outlineVertexBuffer,s=this._outlineIndexBuffer,r=s.index;let n,a,o;const c=new D(0,0),h=new D(0,0),d=new D(0,0);let l=-1,f=-1,y=-1,p=-1,w=-1,x=!1;const m=0;let g=e.length;if(g<2)return;const I=e[m];let b=e[g-1];for(;g&&b.isEqual(I);)--g,b=e[g-1];if(!(g-m<2)){for(let _=m;_8&&(L=8),B>=0?(y=i.add(a.x,a.y,c.x,c.y,0,1,t),p===-1&&(p=y),l>=0&&f>=0&&y>=0&&!M&&s.add(l,f,y),f=i.add(a.x,a.y,L*-d.x,L*-d.y,0,-1,t),w===-1&&(w=f),l>=0&&f>=0&&y>=0&&!M&&s.add(l,f,y),l=f,f=y,y=i.add(a.x,a.y,d.x,d.y,0,1,t),l>=0&&f>=0&&y>=0&&!M&&s.add(l,f,y),f=i.add(a.x,a.y,h.x,h.y,0,1,t),l>=0&&f>=0&&y>=0&&!M&&s.add(l,f,y)):(y=i.add(a.x,a.y,L*d.x,L*d.y,0,1,t),p===-1&&(p=y),l>=0&&f>=0&&y>=0&&!M&&s.add(l,f,y),f=i.add(a.x,a.y,-c.x,-c.y,0,-1,t),w===-1&&(w=f),l>=0&&f>=0&&y>=0&&!M&&s.add(l,f,y),l=f,f=y,y=i.add(a.x,a.y,-d.x,-d.y,0,-1,t),l>=0&&f>=0&&y>=0&&!M&&s.add(l,f,y),l=i.add(a.x,a.y,-h.x,-h.y,0,-1,t),l>=0&&f>=0&&y>=0&&!M&&s.add(l,f,y))}l>=0&&f>=0&&p>=0&&!x&&s.add(l,f,p),l>=0&&p>=0&&w>=0&&!x&&s.add(l,w,p),this._outlineIndexCount+=3*(s.index-r)}}_processFill(e,t,i,s,r){s=!0;let n;t.length>1&&(n=[]);let a=0;for(const d of t)a!==0&&n.push(a),a+=e[d].length;const o=2*a,c=ke.acquire();for(const d of t){const l=e[d],f=l.length;for(let y=0;y0){const d=t.map(y=>e[y].length),{buffer:l,vertexCount:f}=et(c,d);if(f>0){const y=this._fillVertexBuffer.index;for(let p=0;p0){const l=this._fillVertexBuffer.index;let f=0;for(;f=4160:e.y===t.y&&(e.y<=-64||e.y>=4160)}static _area(e){let t=0;const i=e.length-1;for(let s=0;sT.page-C.page),r.textured=!0;for(const{ddAttributes:T,page:C,cap:A,join:v,miterLimit:R,roundLimit:Z,halfWidth:N,offset:W,geometry:J}of V)r.capType=A,r.joinType=v,r.miterLimit=R,r.roundLimit=Z,r.halfWidth=N,r.offset=W,this._processFeature(J,T,C)}else{if(o){const V=o.getValue(i),T=this._spriteInfo[V];if(!T||!T.rect)return}r.textured=!(!o&&!c),r.capType=y,r.joinType=m,r.miterLimit=I,r.roundLimit=_,r.halfWidth=.5*B,r.offset=L;for(const V of s){const T=n?a.encodeAttributes(V,i,t):null;f&&(r.capType=f.getValue(i,V)),x&&(r.joinType=x.getValue(i,V)),g&&(r.miterLimit=g.getValue(i,V)),b&&(r.roundLimit=b.getValue(i,V)),M&&(r.halfWidth=.5*M.getValue(i,V)),P&&(r.offset=P.getValue(i,V));const C=V.getGeometry(e);this._processFeature(C,T)}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this.tessellationProperties._lineVertexBuffer.array.length,e+=this.tessellationProperties._lineIndexBuffer.array.length,e+=3*this._patternMap.size+1;const t=new Uint32Array(e),i=new Int32Array(t.buffer);let s=0;t[s++]=this.type,t[s++]=this.layerUIDs.length;for(let a=0;a0)for(const[a,[o,c]]of r)t[s++]=a,t[s++]=o,t[s++]=c;t[s++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let a=0;a(e,t,i,s,r,n,a,o,c,h,d)=>(u._lineVertexBuffer.add(e,t,a,o,i,s,r,n,c,h,d,u._ddValues),u._lineVertexBuffer.index-1),Mt=u=>(e,t,i)=>{u._lineIndexBuffer.add(e,t,i)},He=10;function bt(u,e){return u.iconMosaicItem&&e.iconMosaicItem?u.iconMosaicItem.page===e.iconMosaicItem.page?0:u.iconMosaicItem.page-e.iconMosaicItem.page:u.iconMosaicItem&&!e.iconMosaicItem?1:!u.iconMosaicItem&&e.iconMosaicItem?-1:0}class z extends Ie{constructor(e,t,i,s,r,n,a,o){super(e,t,o.getSpriteItems()),this.type=_e.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._iconVertexBuffer=i,this._iconIndexBuffer=s,this._textVertexBuffer=r,this._textIndexBuffer=n,this._placementEngine=a,this._workerTileHandler=o}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}getResources(e,t,i){const s=this.layer,r=this.zoom;e&&e.setExtent(this.layerExtent);const n=s.getLayoutProperty("icon-image"),a=s.getLayoutProperty("text-field");let o=s.getLayoutProperty("text-transform"),c=s.getLayoutProperty("text-font");const h=[];let d,l,f,y;n&&!n.isDataDriven&&(d=n.getValue(r)),a&&!a.isDataDriven&&(l=a.getValue(r)),o&&o.isDataDriven||(f=s.getLayoutValue("text-transform",r),o=null),c&&c.isDataDriven||(y=s.getLayoutValue("text-font",r),c=null);for(const p of this._features){const w=p.getGeometry(e);if(!w||w.length===0)continue;let x,m;n&&(x=n.isDataDriven?n.getValue(r,p):this._replaceKeys(d,p.values),x&&t(x));let g=!1;if(a&&(m=a.isDataDriven?a.getValue(r,p):this._replaceKeys(l,p.values),m)){switch(m=m.replace(/\\n/g,` +import{hm as ke,bz as ve,A as Ye,c1 as Ze,c as Je,x as Ke}from"./index.221827cd.js";import{I as _e,L as oe}from"./enums.54326430.js";import{f as Be,t as le,n as se,a as Ce,h as We,r as Se,P as Y,b as ge}from"./GeometryUtils.4f19e772.js";import{t as Ee}from"./Rect.95b0fd2e.js";import{o as Re}from"./config.82550349.js";import{l as ie,m as k,o as Oe,n as be,p as Qe,u as Pe,a as ee}from"./StyleDefinition.d56936e4.js";import{t as D,s as Xe}from"./Geometry.d049a63c.js";import{r as et,c as tt,n as st,_ as it,i as rt}from"./TileClipper.77103a2e.js";import{t as E,T as nt,m as at,l as ot}from"./StyleRepository.e426e44d.js";import{x as Fe}from"./earcut.afc1d357.js";import{C as lt}from"./BidiEngine.d8bba3fc.js";import"./enums.0295eb81.js";import"./GeometryUtils.51c4032a.js";import"./enums.2d9e6f64.js";import"./VertexElementDescriptor.1fdca6da.js";import"./colorUtils.bb6424b7.js";function ht(u){return u===746||u===747||!(u<4352)&&(u>=12704&&u<=12735||u>=12544&&u<=12591||u>=65072&&u<=65103&&!(u>=65097&&u<=65103)||u>=63744&&u<=64255||u>=13056&&u<=13311||u>=11904&&u<=12031||u>=12736&&u<=12783||u>=12288&&u<=12351&&!(u>=12296&&u<=12305||u>=12308&&u<=12319||u===12336)||u>=13312&&u<=19903||u>=19968&&u<=40959||u>=12800&&u<=13055||u>=12592&&u<=12687||u>=43360&&u<=43391||u>=55216&&u<=55295||u>=4352&&u<=4607||u>=44032&&u<=55215||u>=12352&&u<=12447||u>=12272&&u<=12287||u>=12688&&u<=12703||u>=12032&&u<=12255||u>=12784&&u<=12799||u>=12448&&u<=12543&&u!==12540||u>=65280&&u<=65519&&!(u===65288||u===65289||u===65293||u>=65306&&u<=65310||u===65339||u===65341||u===65343||u>=65371&&u<=65503||u===65507||u>=65512&&u<=65519)||u>=65104&&u<=65135&&!(u>=65112&&u<=65118||u>=65123&&u<=65126)||u>=5120&&u<=5759||u>=6320&&u<=6399||u>=65040&&u<=65055||u>=19904&&u<=19967||u>=40960&&u<=42127||u>=42128&&u<=42191)}function ct(u){return!(u<11904)&&(u>=12704&&u<=12735||u>=12544&&u<=12591||u>=65072&&u<=65103||u>=63744&&u<=64255||u>=13056&&u<=13311||u>=11904&&u<=12031||u>=12736&&u<=12783||u>=12288&&u<=12351||u>=13312&&u<=19903||u>=19968&&u<=40959||u>=12800&&u<=13055||u>=65280&&u<=65519||u>=12352&&u<=12447||u>=12272&&u<=12287||u>=12032&&u<=12255||u>=12784&&u<=12799||u>=12448&&u<=12543||u>=65040&&u<=65055||u>=42128&&u<=42191||u>=40960&&u<=42127)}function ut(u){switch(u){case 10:case 32:case 38:case 40:case 41:case 43:case 45:case 47:case 173:case 183:case 8203:case 8208:case 8211:case 8231:return!0}return!1}function ze(u){switch(u){case 9:case 10:case 11:case 12:case 13:case 32:return!0}return!1}const H=24,je=17;class qe{constructor(e,t,i,s,r,n,a){this._glyphItems=e,this._maxWidth=t,this._lineHeight=i,this._letterSpacing=s,this._hAnchor=r,this._vAnchor=n,this._justify=a}getShaping(e,t,i){const s=this._letterSpacing,r=this._lineHeight,n=this._justify,a=this._maxWidth,o=[];let c=0,h=0;const d=e.length;for(let g=0;g0&&(l=c/Math.max(1,Math.ceil(c/a)));const f=e.includes("\u200B"),y=[];for(let g=0;gb&&ze(o[_].codePoint);)o[_].glyphMosaicItem=null,--_;if(b<=_){const M=o[b].x;for(let P=b;P<=_;P++)o[P].x-=M,o[P].y=h;let B=o[_].x;o[_].glyphMosaicItem&&(B+=o[_].glyphMosaicItem.metrics.advance),w=Math.max(B,w),n&&this._applyJustification(o,b,_)}m=I,h+=x}if(o.length>0){const g=p.length-1,I=(n-this._hAnchor)*w;let b=(-this._vAnchor*(g+1)+.5)*r;t&&g&&(b+=g*r);for(const _ of o)_.x+=I,_.y+=b}return o.filter(g=>g.glyphMosaicItem)}static getTextBox(e,t){if(!e.length)return null;let i=1/0,s=1/0,r=0,n=0;for(const a of e){const o=a.glyphMosaicItem.metrics.advance,c=a.x,h=a.y-je,d=c+o,l=h+t;i=Math.min(i,c),r=Math.max(r,d),s=Math.min(s,h),n=Math.max(n,l)}return{x:i,y:s,width:r-i,height:n-s}}static getBox(e){if(!e.length)return null;let t=1/0,i=1/0,s=0,r=0;for(const n of e){const{height:a,left:o,top:c,width:h}=n.glyphMosaicItem.metrics,d=n.x,l=n.y-(a-Math.abs(c)),f=d+h+o,y=l+a;t=Math.min(t,d),s=Math.max(s,f),i=Math.min(i,l),r=Math.max(r,y)}return{x:t,y:i,width:s-t,height:r-i}}static addDecoration(e,t){const i=e.length;if(i===0)return;const s=3;let r=e[0].x+e[0].glyphMosaicItem.metrics.left,n=e[0].y;for(let o=1;o=0&&a,f=s.allowOverlap&&s.ignorePlacement?null:[],y=[],p=4,w=!l;let x=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=x,I=m;const b=(l||a)&&o,_=s.size/H;let M=!1;for(const T of t)if(T.vertical){M=!0;break}let B,P=0,L=0;if(!l&&M){const T=qe.getTextBox(t,s.lineHeight*H);switch(s.anchor){case k.LEFT:P=T.height/2,L=-T.width/2;break;case k.RIGHT:P=-T.height/2,L=T.width/2;break;case k.TOP:P=T.height/2,L=T.width/2;break;case k.BOTTOM:P=-T.height/2,L=-T.width/2;break;case k.TOP_LEFT:P=T.height;break;case k.BOTTOM_LEFT:L=-T.width;break;case k.TOP_RIGHT:L=T.width;break;case k.BOTTOM_RIGHT:P=-T.height}}P+=s.offset[0]*H,L+=s.offset[1]*H;for(const T of t){const C=T.glyphMosaicItem;if(!C||C.rect.isEmpty)continue;const A=C.rect,v=C.metrics,R=C.page;if(f&&w){if(B!==void 0&&B!==T.y){let S,F,$,G;M?(S=-I+P,F=x+L,$=I-g,G=m-x):(S=x+P,F=g+L,$=m-x,G=I-g);const j={xTile:e.x,yTile:e.y,dxPixels:S*_-c,dyPixels:F*_-c,hard:!s.optional,partIndex:1,width:$*_+2*c,height:G*_+2*c,angle:n,minLod:X,maxLod:se};f.push(j),x=Number.POSITIVE_INFINITY,m=Number.NEGATIVE_INFINITY,g=x,I=m}B=T.y}const Z=[];if(l){const S=.5*C.metrics.width,F=(T.x+v.left-p+S)*_*he;if(h=this._placeGlyph(e,h,F,i,e.segment,1,T.vertical,R,Z),o&&(h=this._placeGlyph(e,h,F,i,e.segment,-1,T.vertical,R,Z)),h>=Te)break}else Z.push(new me(r,d,d,R,!1)),a&&o&&Z.push(new me(r,d+le,d+le,R,!1));const N=T.x+v.left,W=T.y-je-v.top,J=N+v.width,we=W+v.height;let O,U,ce,ue,Q,fe,Ve,Ae;if(!l&&M)if(T.vertical){const S=(N+J)/2-v.height/2,F=(W+we)/2+v.width/2;O=new D(-F-p+P,S-p+L),U=new D(O.x+A.width,O.y+A.height),ce=new D(O.x,U.y),ue=new D(U.x,O.y)}else O=new D(-W+p+P,N-p+L),U=new D(O.x-A.height,O.y+A.width),ce=new D(U.x,O.y),ue=new D(O.x,U.y);else O=new D(N-p+P,W-p+L),U=new D(O.x+A.width,O.y+A.height),ce=new D(O.x,U.y),ue=new D(U.x,O.y);for(const S of Z){let F,$,G,j;if(S.alternateVerticalGlyph){if(!Q){const q=(W+we)/2+L;Q=new D((N+J)/2+P-v.height/2-p,q+v.width/2+p),fe=new D(Q.x+A.height,Q.y-A.width),Ve=new D(fe.x,Q.y),Ae=new D(Q.x,fe.y)}F=Q,$=Ve,G=Ae,j=fe}else F=O,$=ce,G=ue,j=U;const de=W,Me=we,xe=S.glyphAngle+n;if(xe!==0){const q=Math.cos(xe),ye=Math.sin(xe);F=F.clone(),$=$.clone(),G=G.clone(),j=j.clone(),F.rotate(q,ye),j.rotate(q,ye),$.rotate(q,ye),G.rotate(q,ye)}let ne=0,ae=256;if(l&&M?T.vertical?S.alternateVerticalGlyph?(ne=32,ae=96):(ne=224,ae=32):(ne=224,ae=96):(ne=192,ae=64),y.push(new Ue(F,G,$,j,A,S.labelAngle,ne,ae,S.anchor,S.minzoom,S.maxzoom,S.page)),f&&(!b||this._legible(S.labelAngle))){if(w)Nm&&(m=J),Me>I&&(I=Me);else if(S.minzoom=Te)return null;if(f&&w){let T,C,A,v;M?(T=-I+P,C=x+L,A=I-g,v=m-x):(T=x+P,C=g+L,A=m-x,v=I-g);const R={xTile:e.x,yTile:e.y,dxPixels:T*_-c,dyPixels:C*_-c,hard:!s.optional,partIndex:1,width:A*_+2*c,height:v*_+2*c,angle:n,minLod:X,maxLod:se};f.push(R)}const V=new $e(y);return f&&f.length>0&&(V.textColliders=f),V}_legible(e){const t=We(e);return t<65||t>=193}_placeGlyph(e,t,i,s,r,n,a,o,c){let h=n;const d=h<0?Ce(e.angle+le,Se):e.angle;let l=0;i<0&&(h*=-1,i*=-1,l=le),h>0&&++r;let f=new D(e.x,e.y),y=s[r],p=se;if(s.length<=r)return p;for(;;){const w=y.x-f.x,x=y.y-f.y,m=Math.sqrt(w*w+x*x),g=Math.max(i/m,t),I=w/m,b=x/m,_=Ce(Math.atan2(b,I)+l,Se);if(c.push(new me(f,d,_,o,!1,g,p)),a&&c.push(new me(f,d,_,o,!0,g,p)),g<=t)return g;f=y.clone();do{if(r+=h,s.length<=r||r<0)return g;y=s[r]}while(f.isEqual(y));let M=y.x-f.x,B=y.y-f.y;const P=Math.sqrt(M*M+B*B);M*=m/P,B*=m/P,f.x-=M,f.y-=B,p=g}}}var re;(function(u){u[u.moveTo=1]="moveTo",u[u.lineTo=2]="lineTo",u[u.close=7]="close"})(re||(re={}));class dt{constructor(e,t){this.values={},this._geometry=void 0,this._pbfGeometry=null;const i=t.keys,s=t.values,r=e.asUnsafe();for(;r.next();)switch(r.tag()){case 1:this.id=r.getUInt64();break;case 2:{const n=r.getMessage().asUnsafe(),a=this.values;for(;!n.empty();){const o=n.getUInt32(),c=n.getUInt32();a[i[o]]=s[c]}n.release();break}case 3:this.type=r.getUInt32();break;case 4:this._pbfGeometry=r.getMessage();break;default:r.skip()}}getGeometry(e){if(this._geometry!==void 0)return this._geometry;if(!this._pbfGeometry)return null;const t=this._pbfGeometry.asUnsafe();let i,s;this._pbfGeometry=null,e?e.reset(this.type):i=[];let r,n=re.moveTo,a=0,o=0,c=0;for(;!t.empty();){if(a===0){const h=t.getUInt32();n=7&h,a=h>>3}switch(a--,n){case re.moveTo:o+=t.getSInt32(),c+=t.getSInt32(),e?e.moveTo(o,c):i&&(s&&i.push(s),s=[],s.push(new D(o,c)));break;case re.lineTo:o+=t.getSInt32(),c+=t.getSInt32(),e?e.lineTo(o,c):s&&s.push(new D(o,c));break;case re.close:e?e.close():s&&!s[0].equals(o,c)&&s.push(s[0].clone());break;default:throw t.release(),new Error("Invalid path operation")}}return e?r=e.result():i&&(s&&i.push(s),r=i),t.release(),this._geometry=r,r}}class te extends E{constructor(){super(12)}add(e,t,i){const s=this.array;s.push(e),s.push(t),s.push(i)}}class Le{constructor(e){this.extent=4096,this.keys=[],this.values=[],this._pbfLayer=e.clone();const t=e.asUnsafe();for(;t.next();)switch(t.tag()){case 1:this.name=t.getString();break;case 3:this.keys.push(t.getString());break;case 4:this.values.push(t.processMessage(Le._parseValue));break;case 5:this.extent=t.getUInt32();break;default:t.skip()}}getData(){return this._pbfLayer}static _parseValue(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.getInt64();case 5:return e.getUInt64();case 6:return e.getSInt64();case 7:return e.getBool();default:e.skip()}return null}}class xt extends E{constructor(e){super(e)}add(e,t,i,s,r,n,a,o,c,h,d,l){const f=this.array;let y=E.i1616to32(e,t);f.push(y);const p=31;y=E.i8888to32(Math.round(p*i),Math.round(p*s),Math.round(p*r),Math.round(p*n)),f.push(y),y=E.i8888to32(Math.round(p*a),Math.round(p*o),Math.round(p*c),Math.round(p*h)),f.push(y),y=E.i1616to32(d,0),f.push(y),l&&f.push(...l)}}class yt extends E{constructor(e){super(e)}add(e,t,i){const s=this.array;s.push(E.i1616to32(e,t)),i&&s.push(...i)}}class gt extends E{constructor(e){super(e)}add(e,t,i,s,r,n,a){const o=this.array,c=this.index;let h=E.i1616to32(e,t);o.push(h);const d=15;return h=E.i8888to32(Math.round(d*i),Math.round(d*s),r,n),o.push(h),a&&o.push(...a),c}}class Ge extends E{constructor(e){super(e)}add(e,t,i,s,r,n,a,o,c,h,d,l){const f=this.array;let y=E.i1616to32(e,t);f.push(y),y=E.i1616to32(Math.round(8*i),Math.round(8*s)),f.push(y),y=E.i8888to32(r/4,n/4,o,c),f.push(y),y=E.i8888to32(0,We(a),10*h,Math.min(10*d,255)),f.push(y),l&&f.push(...l)}}class pt extends E{constructor(e){super(e)}add(e,t,i,s,r){const n=this.array,a=E.i1616to32(2*e+i,2*t+s);n.push(a),r&&n.push(...r)}}class Ie{constructor(e,t,i){this.layerExtent=4096,this._features=[],this.layer=e,this.zoom=t,this._spriteInfo=i,this._filter=e.getFeatureFilter()}pushFeature(e){this._filter&&!this._filter.filter(e,this.zoom)||this._features.push(e)}hasFeatures(){return this._features.length>0}getResources(e,t,i){}}class mt extends Ie{constructor(e,t,i,s,r){super(e,t,i),this.type=_e.CIRCLE,this._circleVertexBuffer=s,this._circleIndexBuffer=r}get circleIndexStart(){return this._circleIndexStart}get circleIndexCount(){return this._circleIndexCount}processFeatures(e){const t=this._circleVertexBuffer,i=this._circleIndexBuffer;this._circleIndexStart=3*i.index,this._circleIndexCount=0;const s=this.layer,r=this.zoom;e&&e.setExtent(this.layerExtent);for(const n of this._features){const a=n.getGeometry(e);if(!a)continue;const o=s.circleMaterial.encodeAttributes(n,r,s);for(const c of a)if(c)for(const h of c){const d=t.index;t.add(h.x,h.y,0,0,o),t.add(h.x,h.y,0,1,o),t.add(h.x,h.y,1,0,o),t.add(h.x,h.y,1,1,o),i.add(d+0,d+1,d+2),i.add(d+1,d+2,d+3),this._circleIndexCount+=6}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this._circleVertexBuffer.array.length,e+=this._circleIndexBuffer.array.length;const t=new Uint32Array(e),i=new Int32Array(t.buffer);let s=0;t[s++]=this.type,t[s++]=this.layerUIDs.length;for(let r=0;rI.page-b.page);for(const{ddFillAttributes:I,ddOutlineAttributes:b,page:_,geometry:M}of f)this._processFeature(M,h,t.outlineUsesFillColor,I,b,l,_)}}else for(const f of d){const y=n?s.encodeAttributes(f,i,t):null,p=h&&a?r.encodeAttributes(f,i,t):null,w=f.getGeometry(e);this._processFeature(w,h,t.outlineUsesFillColor,y,p,l)}}serialize(){let e=10;e+=this.layerUIDs.length,e+=this._fillVertexBuffer.array.length,e+=this._fillIndexBuffer.array.length,e+=this._outlineVertexBuffer.array.length,e+=this._outlineIndexBuffer.array.length,e+=3*this._patternMap.size+1;const t=new Uint32Array(e),i=new Int32Array(t.buffer);let s=0;t[s++]=this.type,t[s++]=this.layerUIDs.length;for(let a=0;a0)for(const[a,[o,c]]of r)t[s++]=a,t[s++]=o,t[s++]=c;t[s++]=this._fillVertexBuffer.array.length;for(let a=0;ah?(d!==void 0&&this._processFill(e,d,s,n,a),d=[l]):f<-h&&d!==void 0&&d.push(l)}d!==void 0&&this._processFill(e,d,s,n,a)}_processOutline(e,t){const i=this._outlineVertexBuffer,s=this._outlineIndexBuffer,r=s.index;let n,a,o;const c=new D(0,0),h=new D(0,0),d=new D(0,0);let l=-1,f=-1,y=-1,p=-1,w=-1,x=!1;const m=0;let g=e.length;if(g<2)return;const I=e[m];let b=e[g-1];for(;g&&b.isEqual(I);)--g,b=e[g-1];if(!(g-m<2)){for(let _=m;_8&&(L=8),B>=0?(y=i.add(a.x,a.y,c.x,c.y,0,1,t),p===-1&&(p=y),l>=0&&f>=0&&y>=0&&!M&&s.add(l,f,y),f=i.add(a.x,a.y,L*-d.x,L*-d.y,0,-1,t),w===-1&&(w=f),l>=0&&f>=0&&y>=0&&!M&&s.add(l,f,y),l=f,f=y,y=i.add(a.x,a.y,d.x,d.y,0,1,t),l>=0&&f>=0&&y>=0&&!M&&s.add(l,f,y),f=i.add(a.x,a.y,h.x,h.y,0,1,t),l>=0&&f>=0&&y>=0&&!M&&s.add(l,f,y)):(y=i.add(a.x,a.y,L*d.x,L*d.y,0,1,t),p===-1&&(p=y),l>=0&&f>=0&&y>=0&&!M&&s.add(l,f,y),f=i.add(a.x,a.y,-c.x,-c.y,0,-1,t),w===-1&&(w=f),l>=0&&f>=0&&y>=0&&!M&&s.add(l,f,y),l=f,f=y,y=i.add(a.x,a.y,-d.x,-d.y,0,-1,t),l>=0&&f>=0&&y>=0&&!M&&s.add(l,f,y),l=i.add(a.x,a.y,-h.x,-h.y,0,-1,t),l>=0&&f>=0&&y>=0&&!M&&s.add(l,f,y))}l>=0&&f>=0&&p>=0&&!x&&s.add(l,f,p),l>=0&&p>=0&&w>=0&&!x&&s.add(l,w,p),this._outlineIndexCount+=3*(s.index-r)}}_processFill(e,t,i,s,r){s=!0;let n;t.length>1&&(n=[]);let a=0;for(const d of t)a!==0&&n.push(a),a+=e[d].length;const o=2*a,c=ke.acquire();for(const d of t){const l=e[d],f=l.length;for(let y=0;y0){const d=t.map(y=>e[y].length),{buffer:l,vertexCount:f}=et(c,d);if(f>0){const y=this._fillVertexBuffer.index;for(let p=0;p0){const l=this._fillVertexBuffer.index;let f=0;for(;f=4160:e.y===t.y&&(e.y<=-64||e.y>=4160)}static _area(e){let t=0;const i=e.length-1;for(let s=0;sT.page-C.page),r.textured=!0;for(const{ddAttributes:T,page:C,cap:A,join:v,miterLimit:R,roundLimit:Z,halfWidth:N,offset:W,geometry:J}of V)r.capType=A,r.joinType=v,r.miterLimit=R,r.roundLimit=Z,r.halfWidth=N,r.offset=W,this._processFeature(J,T,C)}else{if(o){const V=o.getValue(i),T=this._spriteInfo[V];if(!T||!T.rect)return}r.textured=!(!o&&!c),r.capType=y,r.joinType=m,r.miterLimit=I,r.roundLimit=_,r.halfWidth=.5*B,r.offset=L;for(const V of s){const T=n?a.encodeAttributes(V,i,t):null;f&&(r.capType=f.getValue(i,V)),x&&(r.joinType=x.getValue(i,V)),g&&(r.miterLimit=g.getValue(i,V)),b&&(r.roundLimit=b.getValue(i,V)),M&&(r.halfWidth=.5*M.getValue(i,V)),P&&(r.offset=P.getValue(i,V));const C=V.getGeometry(e);this._processFeature(C,T)}}}serialize(){let e=6;e+=this.layerUIDs.length,e+=this.tessellationProperties._lineVertexBuffer.array.length,e+=this.tessellationProperties._lineIndexBuffer.array.length,e+=3*this._patternMap.size+1;const t=new Uint32Array(e),i=new Int32Array(t.buffer);let s=0;t[s++]=this.type,t[s++]=this.layerUIDs.length;for(let a=0;a0)for(const[a,[o,c]]of r)t[s++]=a,t[s++]=o,t[s++]=c;t[s++]=this.tessellationProperties._lineVertexBuffer.array.length;for(let a=0;a(e,t,i,s,r,n,a,o,c,h,d)=>(u._lineVertexBuffer.add(e,t,a,o,i,s,r,n,c,h,d,u._ddValues),u._lineVertexBuffer.index-1),Mt=u=>(e,t,i)=>{u._lineIndexBuffer.add(e,t,i)},He=10;function bt(u,e){return u.iconMosaicItem&&e.iconMosaicItem?u.iconMosaicItem.page===e.iconMosaicItem.page?0:u.iconMosaicItem.page-e.iconMosaicItem.page:u.iconMosaicItem&&!e.iconMosaicItem?1:!u.iconMosaicItem&&e.iconMosaicItem?-1:0}class z extends Ie{constructor(e,t,i,s,r,n,a,o){super(e,t,o.getSpriteItems()),this.type=_e.SYMBOL,this._markerMap=new Map,this._glyphMap=new Map,this._glyphBufferDataStorage=new Map,this._isIconSDF=!1,this._iconVertexBuffer=i,this._iconIndexBuffer=s,this._textVertexBuffer=r,this._textIndexBuffer=n,this._placementEngine=a,this._workerTileHandler=o}get markerPageMap(){return this._markerMap}get glyphsPageMap(){return this._glyphMap}get symbolInstances(){return this._symbolInstances}getResources(e,t,i){const s=this.layer,r=this.zoom;e&&e.setExtent(this.layerExtent);const n=s.getLayoutProperty("icon-image"),a=s.getLayoutProperty("text-field");let o=s.getLayoutProperty("text-transform"),c=s.getLayoutProperty("text-font");const h=[];let d,l,f,y;n&&!n.isDataDriven&&(d=n.getValue(r)),a&&!a.isDataDriven&&(l=a.getValue(r)),o&&o.isDataDriven||(f=s.getLayoutValue("text-transform",r),o=null),c&&c.isDataDriven||(y=s.getLayoutValue("text-font",r),c=null);for(const p of this._features){const w=p.getGeometry(e);if(!w||w.length===0)continue;let x,m;n&&(x=n.isDataDriven?n.getValue(r,p):this._replaceKeys(d,p.values),x&&t(x));let g=!1;if(a&&(m=a.isDataDriven?a.getValue(r,p):this._replaceKeys(l,p.values),m)){switch(m=m.replace(/\\n/g,` `),o&&(f=o.getValue(r,p)),f){case Oe.LOWERCASE:m=m.toLowerCase();break;case Oe.UPPERCASE:m=m.toUpperCase()}if(z._bidiEngine.hasBidiChar(m)){let M;M=z._bidiEngine.checkContextual(m)==="rtl"?"IDNNN":"ICNNN",m=z._bidiEngine.bidiTransform(m,M,"VLYSN"),g=!0}const _=m.length;if(_>0){c&&(y=c.getValue(r,p));for(const M of y){let B=i[M];B||(B=i[M]=new Set);for(let P=0;P<_;P++){const L=m.charCodeAt(P);B.add(L)}}}}if(!x&&!m)continue;const I=s.getLayoutValue("symbol-sort-key",r,p),b={feature:p,sprite:x,label:m,rtl:g,geometry:w,hash:(m?ve(m):0)^(x?ve(x):0),priority:I,textFont:y};h.push(b)}this._symbolFeatures=h}processFeatures(e){e&&e.setExtent(this.layerExtent);const t=this.layer,i=this.zoom,s=t.getLayoutValue("symbol-placement",i),r=s!==be.POINT,n=t.getLayoutValue("symbol-spacing",i)*he,a=t.getLayoutProperty("icon-image"),o=t.getLayoutProperty("text-field"),c=a?new nt(t,i,r):null,h=o?new at(t,i,r):null,d=this._workerTileHandler;let l;a&&(l=d.getSpriteItems()),this._iconIndexStart=3*this._iconIndexBuffer.index,this._textIndexStart=3*this._textIndexBuffer.index,this._iconIndexCount=0,this._textIndexCount=0,this._markerMap.clear(),this._glyphMap.clear();const f=[];let y=1;h&&h.size&&(y=h.size/H);const p=h?h.maxAngle*Be:0,w=h?h.size*he:0;for(const x of this._symbolFeatures){let m;c&&l&&x.sprite&&(m=l[x.sprite],m&&m.sdf&&(this._isIconSDF=!0));let g;m&&c.update(i,x.feature);let I=0;const b=x.label;if(b){h.update(i,x.feature);const _=r&&h.rotationAlignment===ie.MAP?h.keepUpright:h.writingMode&&h.writingMode.includes(Qe.VERTICAL);let M=.5;switch(h.anchor){case k.TOP_LEFT:case k.LEFT:case k.BOTTOM_LEFT:M=0;break;case k.TOP_RIGHT:case k.RIGHT:case k.BOTTOM_RIGHT:M=1}let B=.5;switch(h.anchor){case k.TOP_LEFT:case k.TOP:case k.TOP_RIGHT:B=0;break;case k.BOTTOM_LEFT:case k.BOTTOM:case k.BOTTOM_RIGHT:B=1}let P=.5;switch(h.justify){case Pe.AUTO:P=M;break;case Pe.LEFT:P=0;break;case Pe.RIGHT:P=1}const L=h.letterSpacing*H,V=r?0:h.maxWidth*H,T=h.lineHeight*H,C=x.textFont.map(A=>d.getGlyphItems(A));if(g=new qe(C,V,T,L,M,B,P).getShaping(b,x.rtl,_),g&&g.length>0){let A=1e30,v=-1e30;for(const R of g)A=Math.min(A,R.x),v=Math.max(v,R.x);I=(v-A+2*H)*y*he}}for(let _ of x.geometry){const M=[];if(s===be.LINE){if(g&&g.length>0&&h&&h.size){const B=h.size*he*(2+Math.min(2,4*Math.abs(h.offset[1])));_=z._smoothVertices(_,B)}z._pushAnchors(M,_,n,I)}else s===be.LINE_CENTER?z._pushCenterAnchor(M,_):x.feature.type===Xe.Polygon?z._pushCentroid(M,_):M.push(new pe(_[0].x,_[0].y));for(const B of M){if(B.x<0||B.x>Ne||B.y<0||B.y>Ne||r&&I>0&&h.rotationAlignment===ie.MAP&&!z._honorsTextMaxAngle(_,B,I,p,w))continue;const P={shaping:g,line:_,iconMosaicItem:m,anchor:B,symbolFeature:x,textColliders:[],iconColliders:[],textVertexRanges:[],iconVertexRanges:[]};f.push(P),this._processFeature(P,c,h)}}}f.sort(bt),this._addPlacedGlyphs(),this._symbolInstances=f}serialize(){let e=11;e+=this.layerUIDs.length,e+=3*this.markerPageMap.size,e+=3*this.glyphsPageMap.size,e+=z._symbolsSerializationLength(this._symbolInstances),e+=this._iconVertexBuffer.array.length,e+=this._iconIndexBuffer.array.length,e+=this._textVertexBuffer.array.length,e+=this._textIndexBuffer.array.length;const t=new Uint32Array(e),i=new Int32Array(t.buffer),s=new Float32Array(t.buffer);let r=0;t[r++]=this.type,t[r++]=this.layerUIDs.length;for(let n=0;ns in t?t[s]:"")}_processFeature(e,t,i){const{line:s,iconMosaicItem:r,shaping:n,anchor:a}=e,o=this.zoom,c=this.layer,h=!!r;let d=!0;h&&(d=t.optional||!r);const l=n&&n.length>0;let f,y,p=!0;if(l&&(p=i.optional),h&&(f=this._placementEngine.getIconPlacement(a,r,t)),(f||d)&&(l&&(y=this._placementEngine.getTextPlacement(a,n,s,i)),y||p)){if(f&&y||(p||d?p||y?d||f||(y=null):f=null:(f=null,y=null)),y){const w=c.hasDataDrivenText?c.textMaterial.encodeAttributes(e.symbolFeature.feature,o,c):null;if(this._storePlacedGlyphs(e,y.shapes,o,i.rotationAlignment,w),y.textColliders){e.textColliders=y.textColliders;for(const x of y.textColliders){x.minLod=Math.max(o+Y(x.minLod),0),x.maxLod=Math.min(o+Y(x.maxLod),25);const m=x.angle;if(m){const g=Math.cos(m),I=Math.sin(m),b=x.dxPixels*g-x.dyPixels*I,_=x.dxPixels*I+x.dyPixels*g,M=(x.dxPixels+x.width)*g-x.dyPixels*I,B=(x.dxPixels+x.width)*I+x.dyPixels*g,P=x.dxPixels*g-(x.dyPixels+x.height)*I,L=x.dxPixels*I+(x.dyPixels+x.height)*g,V=(x.dxPixels+x.width)*g-(x.dyPixels+x.height)*I,T=(x.dxPixels+x.width)*I+(x.dyPixels+x.height)*g,C=Math.min(b,M,P,V),A=Math.max(b,M,P,V),v=Math.min(_,B,L,T),R=Math.max(_,B,L,T);x.dxPixels=C,x.dyPixels=v,x.width=A-C,x.height=R-v}}}}if(f){const w=c.hasDataDrivenIcon?c.iconMaterial.encodeAttributes(e.symbolFeature.feature,o,c):null;if(this._addPlacedIcons(e,f.shapes,o,r.page,t.rotationAlignment===ie.VIEWPORT,w),f.iconColliders){e.iconColliders=f.iconColliders;for(const x of f.iconColliders){x.minLod=Math.max(o+Y(x.minLod),0),x.maxLod=Math.min(o+Y(x.maxLod),25);const m=x.angle;if(m){const g=Math.cos(m),I=Math.sin(m),b=x.dxPixels*g-x.dyPixels*I,_=x.dxPixels*I+x.dyPixels*g,M=(x.dxPixels+x.width)*g-x.dyPixels*I,B=(x.dxPixels+x.width)*I+x.dyPixels*g,P=x.dxPixels*g-(x.dyPixels+x.height)*I,L=x.dxPixels*I+(x.dyPixels+x.height)*g,V=(x.dxPixels+x.width)*g-(x.dyPixels+x.height)*I,T=(x.dxPixels+x.width)*I+(x.dyPixels+x.height)*g,C=Math.min(b,M,P,V),A=Math.max(b,M,P,V),v=Math.min(_,B,L,T),R=Math.max(_,B,L,T);x.dxPixels=C,x.dyPixels=v,x.width=A-C,x.height=R-v}}}}}}_addPlacedIcons(e,t,i,s,r,n){const a=Math.max(i-1,0),o=this._iconVertexBuffer,c=this._iconIndexBuffer,h=this._markerMap;for(const d of t){const l=r?0:Math.max(i+Y(d.minzoom),a),f=r?25:Math.min(i+Y(d.maxzoom),25);if(f<=l)continue;const y=d.tl,p=d.tr,w=d.bl,x=d.br,m=d.mosaicRect,g=d.labelAngle,I=d.minAngle,b=d.maxAngle,_=d.anchor,M=o.index,B=m.x,P=m.y,L=B+m.width,V=P+m.height,T=o.index;o.add(_.x,_.y,y.x,y.y,B,P,g,I,b,l,f,n),o.add(_.x,_.y,p.x,p.y,L,P,g,I,b,l,f,n),o.add(_.x,_.y,w.x,w.y,B,V,g,I,b,l,f,n),o.add(_.x,_.y,x.x,x.y,L,V,g,I,b,l,f,n),e.iconVertexRanges.length>0&&e.iconVertexRanges[0][0]+e.iconVertexRanges[0][1]===T?e.iconVertexRanges[0][1]+=4:e.iconVertexRanges.push([T,4]),c.add(M+0,M+1,M+2),c.add(M+1,M+2,M+3),h.has(s)?h.get(s)[1]+=6:h.set(s,[this._iconIndexStart+this._iconIndexCount,6]),this._iconIndexCount+=6}}_addPlacedGlyphs(){const e=this._textVertexBuffer,t=this._textIndexBuffer,i=this._glyphMap;for(const[s,r]of this._glyphBufferDataStorage)for(const n of r){const a=e.index,o=n.symbolInstance,c=n.ddAttributes,h=e.index;e.add(n.glyphAnchor[0],n.glyphAnchor[1],n.tl[0],n.tl[1],n.xmin,n.ymin,n.labelAngle,n.minAngle,n.maxAngle,n.minLod,n.maxLod,c),e.add(n.glyphAnchor[0],n.glyphAnchor[1],n.tr[0],n.tr[1],n.xmax,n.ymin,n.labelAngle,n.minAngle,n.maxAngle,n.minLod,n.maxLod,c),e.add(n.glyphAnchor[0],n.glyphAnchor[1],n.bl[0],n.bl[1],n.xmin,n.ymax,n.labelAngle,n.minAngle,n.maxAngle,n.minLod,n.maxLod,c),e.add(n.glyphAnchor[0],n.glyphAnchor[1],n.br[0],n.br[1],n.xmax,n.ymax,n.labelAngle,n.minAngle,n.maxAngle,n.minLod,n.maxLod,c),o.textVertexRanges.length>0&&o.textVertexRanges[0][0]+o.textVertexRanges[0][1]===h?o.textVertexRanges[0][1]+=4:o.textVertexRanges.push([h,4]),t.add(a+0,a+1,a+2),t.add(a+1,a+2,a+3),i.has(s)?i.get(s)[1]+=6:i.set(s,[this._textIndexStart+this._textIndexCount,6]),this._textIndexCount+=6}this._glyphBufferDataStorage.clear()}_storePlacedGlyphs(e,t,i,s,r){const n=Math.max(i-1,0),a=s===ie.VIEWPORT;let o,c,h,d,l,f,y,p,w,x,m;for(const g of t)o=a?0:Math.max(i+Y(g.minzoom),n),c=a?25:Math.min(i+Y(g.maxzoom),25),!(c<=o)&&(h=g.tl,d=g.tr,l=g.bl,f=g.br,y=g.labelAngle,p=g.minAngle,w=g.maxAngle,x=g.anchor,m=g.mosaicRect,this._glyphBufferDataStorage.has(g.page)||this._glyphBufferDataStorage.set(g.page,[]),this._glyphBufferDataStorage.get(g.page).push({glyphAnchor:[x.x,x.y],tl:[h.x,h.y],tr:[d.x,d.y],bl:[l.x,l.y],br:[f.x,f.y],xmin:m.x,ymin:m.y,xmax:m.x+m.width,ymax:m.y+m.height,labelAngle:y,minAngle:p,maxAngle:w,minLod:o,maxLod:c,placementLod:n,symbolInstance:e,ddAttributes:r}))}static _pushAnchors(e,t,i,s){i+=s;let r=0;const n=t.length-1;for(let l=0;l-a;){if(--c,c<0)return!1;n-=D.distance(e[c],o),o=e[c]}n+=D.distance(e[c],e[c+1]);const h=[];let d=0;const l=e.length;for(;nr;)d-=h.shift().deviation;if(Math.abs(d)>s)return!1;n+=D.distance(y,w),c=p}return!0}static _smoothVertices(e,t){if(t<=0)return e;let i=e.length;if(i<3)return e;const s=[];let r=0,n=0;s.push(0);for(let p=1;p0&&(r+=w,s.push(r),n++,n!==p&&(e[n]=e[p]))}if(i=n+1,i<3)return e;t=Math.min(t,.2*r);const a=e[0].x,o=e[0].y,c=e[i-1].x,h=e[i-1].y,d=D.sub(e[0],e[1]);d.normalize(),e[0].x+=t*d.x,e[0].y+=t*d.y,d.assignSub(e[i-1],e[i-2]),d.normalize(),e[i-1].x+=t*d.x,e[i-1].y+=t*d.y,s[0]-=t,s[i-1]+=t;const l=[];l.push(new D(a,o));const f=1e-6,y=.5*t;for(let p=1;p=0;g--){const I=y+s[g+1]-s[p];if(I<0)break;const b=s[g+1]-s[g],_=s[p]-s[g]4096&&(d=4096),d<0&&(d=0),l>4096&&(l=4096),l<0&&(l=0);for(let f=1;f4096&&(y=4096),y<0&&(y=0),p>4096&&(p=4096),p<0&&(p=0),w>4096&&(w=4096),w<0&&(w=0),x>4096&&(x=4096),x<0&&(x=0);const m=(y-d)*(x-l)-(w-d)*(p-l);o+=m*(d+y+w),c+=m*(l+p+x),h+=m}o/=3*h,c/=3*h,isNaN(o)||isNaN(c)||e.push(new pe(o,c))}}z._bidiEngine=new lt;var K;(function(u){u[u.INITIALIZED=0]="INITIALIZED",u[u.NO_DATA=1]="NO_DATA",u[u.READY=2]="READY",u[u.MODIFIED=3]="MODIFIED",u[u.INVALID=4]="INVALID"})(K||(K={}));const Pt=8,Tt=14,Bt=5;class Lt{constructor(e,t,i,s,r){if(this._pbfTiles={},this._tileClippers={},this._client=i,this._tile=t,r){this._styleLayerUIDs=new Set;for(const h of r)this._styleLayerUIDs.add(h)}this._styleRepository=s,this._layers=this._styleRepository.layers;const[n,a,o]=t.tileKey.split("/").map(parseFloat);this._level=n;const c=Pt+Math.max((this._level-Tt)*Bt,0);for(const h of Object.keys(e)){const d=e[h];if(this._pbfTiles[h]=new Ye(new Uint8Array(d.protobuff),new DataView(d.protobuff)),d.refKey){const[l]=d.refKey.split("/").map(parseFloat),f=n-l;if(f>0){const y=(1<{n.has(h)||(r.push({name:h,repeat:d}),n.add(h))},o={};for(const h of s)h.getResources(h.tileClipper,a,o);if(this._tile.status===K.INVALID)return[];const c=this._fetchResources(r,o,e);return Promise.all([...c,t]).then(()=>this._processFeatures(i.returnedBuckets))}_initialize(e){return{signal:e&&e.signal,sourceNameToTileData:this._parseTileData(this._pbfTiles),layers:this._layers,zoom:this._level,sourceNameToTileClipper:this._tileClippers,sourceNameToUniqueSourceLayerBuckets:{},sourceNameToUniqueSourceLayers:{},returnedBuckets:[],layerIdToBucket:{},referencerUIDToReferencedId:new Map}}_processLayers(e){const{sourceNameToTileData:t,layers:i,zoom:s,sourceNameToTileClipper:r,sourceNameToUniqueSourceLayerBuckets:n,sourceNameToUniqueSourceLayers:a,returnedBuckets:o,layerIdToBucket:c,referencerUIDToReferencedId:h}=e;for(let d=i.length-1;d>=0;d--){const l=i[d];if(!this._canParseStyleLayer(l.uid)||l.minzoom&&s=l.maxzoom||l.type===ee.BACKGROUND||!t[l.source]||!r[l.source])continue;const f=t[l.source],y=r[l.source],p=l.sourceLayer,w=f[p];if(w){let x=a[l.source];if(x||(x=a[l.source]=new Set),x.add(l.sourceLayer),l.refLayerId)h.set(l.uid,l.refLayerId);else{const m=this._createBucket(l);if(m){m.layerUIDs=[l.uid],m.layerExtent=w.extent,m.tileClipper=y;let g=n[l.source];g||(g=n[l.source]={});let I=g[p];I||(I=g[p]=[]),I.push(m),o.push(m),c[l.id]=m}}}}}_linkReferences(e){const{layerIdToBucket:t,referencerUIDToReferencedId:i}=e;i.forEach((s,r)=>{t[s]&&t[s].layerUIDs.push(r)})}_filterFeatures(e){const{signal:t,sourceNameToTileData:i,sourceNameToUniqueSourceLayerBuckets:s,sourceNameToUniqueSourceLayers:r}=e,n=10*this._level,a=10*(this._level+1),o=[],c=[];for(const h of Object.keys(r))r[h].forEach(d=>{o.push(d),c.push(h)});for(let h=0;h=a)continue;const I=m._maxzoom;if(I&&I<=n)continue}for(const g of y)g.pushFeature(x)}}}_fetchResources(e,t,i){const s=[],r=this._tile.getWorkerTileHandler();let n,a;e.length>0&&(n=r.fetchSprites(e,this._client,i),s.push(n));for(const o in t){const c=t[o];c.size>0&&(a=r.fetchGlyphs(this._tile.tileKey,o,c,this._client,i),s.push(a))}return s}_processFeatures(e){const t=e.filter(i=>i.hasFeatures()||this._canParseStyleLayer(i.layer.uid));for(const i of t)i.processFeatures(i.tileClipper);return t}_parseTileData(e){const t={};for(const i of Object.keys(e)){const s=e[i],r={};for(;s.next();)switch(s.tag()){case 3:{const n=s.getMessage(),a=new Le(n);n.release(),r[a.name]=a;break}default:s.skip()}t[i]=r}return t}_createBucket(e){switch(e.type){case ee.BACKGROUND:return null;case ee.FILL:return this._createFillBucket(e);case ee.LINE:return this._createLineBucket(e);case ee.CIRCLE:return this._createCircleBucket(e);case ee.SYMBOL:return this._createSymbolBucket(e)}}_createFillBucket(e){return new De(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new yt(e.fillMaterial.getStride()),new te,new gt(e.outlineMaterial.getStride()),new te)}_createLineBucket(e){return new It(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new xt(e.lineMaterial.getStride()),new te)}_createCircleBucket(e){return new mt(e,this._level,this._tile.getWorkerTileHandler().getSpriteItems(),new pt(e.circleMaterial.getStride()),new te)}_createSymbolBucket(e){const t=this._tile;return new z(e,this._level,new Ge(e.iconMaterial.getStride()),new te,new Ge(e.textMaterial.getStride()),new te,t.placementEngine,t.getWorkerTileHandler())}}class Dt{constructor(e,t,i,s){this.status=K.INITIALIZED,this.placementEngine=new ft,this.tileKey=e,this.refKeys=t,this._workerTileHandler=i,this._styleRepository=s}release(){this.tileKey="",this.refKeys=null,this.status=K.INITIALIZED,this._workerTileHandler=null}async parse(e,t){const i=t&&t.signal;if(Je(i)){const h=()=>{i.removeEventListener("abort",h),this.status=K.INVALID};i.addEventListener("abort",h)}let s;const r={bucketsWithData:[],emptyBuckets:null};try{s=await this._parse(e,t)}catch(h){if(Ke(h))throw h;return{result:r,transferList:[]}}this.status=K.READY;const n=r.bucketsWithData,a=[];for(const h of s)if(h.hasFeatures()){const d=h.serialize();n.push(d)}else a.push(h.layer.uid);const o=[...n];let c=null;return a.length>0&&(c=Uint32Array.from(a),o.push(c.buffer)),r.emptyBuckets=c,{result:r,transferList:o}}setObsolete(){this.status=K.INVALID}getLayers(){return this._workerTileHandler.getLayers()}getWorkerTileHandler(){return this._workerTileHandler}async _parse(e,t){const i=e.sourceName2DataAndRefKey;return Object.keys(i).length===0?[]:(this.status=K.MODIFIED,new Lt(i,this,t.client,this._styleRepository,e.styleLayerUIDs).parse(t))}}class Kt{constructor(){this._spriteInfo={},this._glyphInfo={}}reset(){return this._spriteInfo={},this._glyphInfo={},Promise.resolve()}getLayers(){var e;return(e=this._styleRepository)==null?void 0:e.layers}async createTileAndParse(e,t){const{key:i}=e,s={};for(const n of Object.keys(e.sourceName2DataAndRefKey)){const a=e.sourceName2DataAndRefKey[n];s[n]=a.refKey}const r=new Dt(i,s,this,this._styleRepository);try{return await r.parse(e,t)}catch(n){if(r.setObsolete(),r.release(),!Ke(n))throw n;return null}}updateStyle(e){if(!e||e.length===0||!this._styleRepository)return;const t=this._styleRepository;for(const i of e){const s=i.type,r=i.data;switch(s){case oe.PAINTER_CHANGED:t.setPaintProperties(r.layer,r.paint);break;case oe.LAYOUT_CHANGED:t.setLayoutProperties(r.layer,r.layout);break;case oe.LAYER_REMOVED:t.deleteStyleLayer(r.layer);break;case oe.LAYER_CHANGED:t.setStyleLayer(r.layer,r.index);break;case oe.SPRITES_CHANGED:this._spriteInfo={}}}}setStyle(e){this._styleRepository=new ot(e),this._spriteInfo={},this._glyphInfo={}}fetchSprites(e,t,i){const s=[],r=this._spriteInfo;for(const n of e)r[n.name]===void 0&&s.push(n);return s.length===0?Promise.resolve():t.invoke("getSprites",s,{signal:i&&i.signal}).then(n=>{for(const a in n){const o=n[a];r[a]=o}})}getSpriteItems(){return this._spriteInfo}fetchGlyphs(e,t,i,s,r){const n=[];let a=this._glyphInfo[t];return a?i.forEach(o=>{a[o]||n.push(o)}):(a=this._glyphInfo[t]=[],i.forEach(o=>n.push(o))),n.length===0?Promise.resolve():s.invoke("getGlyphs",{tileID:e,font:t,codePoints:n},r).then(o=>{for(let c=0;c{const r={spatialReference:this.context.spatialReference,console:this.context.console,lrucache:this.context.lrucache,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:e.depthCounter+1},globalScope:this.context.globalScope};if(r.depthCounter.depth>64)throw new l(e,s.MaximumCallDepth,null);return D(this.definition,r,t,null)}}call(e,t){return k(e,t,(r,o,i)=>{const a={spatialReference:e.spatialReference,services:e.services,console:e.console,libraryResolver:e.libraryResolver,exports:e.exports,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{},abortSignal:e.abortSignal,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1}};if(a.depthCounter.depth>64)throw new l(e,s.MaximumCallDepth,t);return D(this.definition,a,i,t)})}marshalledCall(e,t,r,o){return o(e,t,async(i,a,u)=>{const f={spatialReference:e.spatialReference,globalScope:r.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,abortSignal:e.abortSignal,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};return u=u.map(w=>!v(w)||w instanceof T?w:X(w,e,o)),X(await D(this.definition,f,u,t),r,o)})}}class C extends xe{constructor(e){super(e)}async global(e){const t=this.executingContext.globalScope[e.toLowerCase()];if(t.valueset||(t.value=await c(this.executingContext,t.node),t.valueset=!0),v(t.value)&&!(t.value instanceof T)){const r=new T;r.fn=t.value,r.parameterEvaluator=k,r.context=this.executingContext,t.value=r}return t.value}setGlobal(e,t){if(v(t))throw new l(null,s.AssignModuleFunction,null);this.executingContext.globalScope[e.toLowerCase()]={value:t,valueset:!0,node:null}}hasGlobal(e){return this.executingContext.exports[e]===void 0&&(e=e.toLowerCase()),this.executingContext.exports[e]!==void 0}async loadModule(e){let t=e.spatialReference;t==null&&(t=new ne({wkid:102100})),this.moduleScope=ie({},e.customfunctions),this.executingContext={spatialReference:t,services:e.services,libraryResolver:new $(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},abortSignal:e.abortSignal===void 0||e.abortSignal===null?{aborted:!1}:e.abortSignal,globalScope:this.moduleScope,console:e.console?e.console:le,lrucache:e.lrucache,interceptor:e.interceptor,localScope:null,depthCounter:{depth:1}},await c(this.executingContext,this.source.syntax)}}async function k(n,e,t){if(e.preparsed===!0){const o=t(n,null,e.arguments);return H(o),o}const r=t(n,e,await Y(n,e));return H(r),r}async function c(n,e,t){if(e.breakpoint&&t!==!0)return await e.breakpoint(),c(n,e,!0);try{switch(e==null?void 0:e.type){case"VariableDeclarator":return await Ue(n,e);case"ImportDeclaration":return await Te(n,e);case"ExportNamedDeclaration":return await qe(n,e);case"VariableDeclaration":return await re(n,e,0);case"BlockStatement":case"Program":return await Ke(n,e);case"FunctionDeclaration":return await Ge(n,e);case"ReturnStatement":return await De(n,e);case"IfStatement":return await Pe(n,e);case"ExpressionStatement":return await je(n,e);case"UpdateExpression":return await Ee(n,e);case"AssignmentExpression":return await Be(n,e);case"ForStatement":return await Ne(n,e);case"WhileStatement":return await Ae(n,e);case"ForInStatement":return await Oe(n,e);case"BreakStatement":return S;case"EmptyStatement":return p;case"ContinueStatement":return E;case"TemplateElement":return await Xe(n,e);case"TemplateLiteral":return await He(n,e);case"Identifier":return await J(n,e);case"MemberExpression":return await Ve(n,e);case"Literal":return e.value;case"CallExpression":return await Qe(n,e);case"UnaryExpression":return await We(n,e);case"BinaryExpression":return await Ye(n,e);case"LogicalExpression":return await Je(n,e);case"ArrayExpression":return await _e(n,e);case"ObjectExpression":return await Ce(n,e);case"Property":return await Re(n,e);default:throw new l(n,s.Unrecognised,e)}}catch(r){throw ge(n,e,r)}}async function Ce(n,e){const t=[];for(let a=0;a{try{t.testResult===!0?++i>P?(i=0,setTimeout(()=>{O(n,e,t,r,o,i)},0)):O(n,e,t,r,o,i):t.lastAction instanceof m?r(t.lastAction):r(p)}catch(a){o(a)}},a=>{o(a)})}catch(a){o(a)}}function Ne(n,e){try{return e.init!==null?c(n,e.init).then(()=>new Promise((t,r)=>{O(n,e,{testResult:!0,lastAction:p},o=>{t(o)},o=>{r(o)},0)})):new Promise((t,r)=>{O(n,e,{testResult:!0,lastAction:p},o=>{t(o)},o=>{r(o)},0)})}catch(t){return Promise.reject(t)}}function q(n,e,t,r,o,i,a,u,f,w){try{if(r<=i)return void u(p);o.value=a==="k"?t[i]:i,c(n,e.body).then(y=>{try{y instanceof m?u(y):y===S?u(p):++w>P?(w=0,setTimeout(()=>{q(n,e,t,r,o,i+1,a,u,f,w)},0)):q(n,e,t,r,o,i+1,a,u,f,w)}catch(K){f(K)}},y=>{f(y)})}catch(y){f(y)}}function U(n,e,t,r,o,i,a,u,f){try{if(t.length()<=o)return void a(p);r.value=i==="k"?t.get(o):o,c(n,e.body).then(w=>{w instanceof m?a(w):w===S?a(p):++f>P?(f=0,setTimeout(()=>{U(n,e,t,r,o+1,i,a,u,f)},0)):U(n,e,t,r,o+1,i,a,u,f)},w=>{u(w)})}catch(w){u(w)}}function V(n,e,t,r,o,i){try{if(i===void 0&&(i="i"),t.length===0)return void r.resolve(p);q(n,e,t,t.length,o,0,i,a=>{r.resolve(a)},a=>{r.reject(a)},0)}catch(a){r.reject(a)}}function ke(n,e,t,r,o,i){try{if(i===void 0&&(i="i"),t.length===0)return void r.resolve(p);U(n,e,t,o,0,i,a=>{r.resolve(a)},a=>{r.reject(a)},0)}catch(a){r.reject(a)}}function Le(n,e,t,r,o){try{V(n,e,t.keys(),r,o,"k")}catch(i){r.reject(i)}}function W(n,e,t,r,o,i,a,u){try{n.next().then(f=>{try{if(f===null)i(p);else{const w=ee.createFromGraphicLikeObject(f.geometry,f.attributes,r);w._underlyingGraphic=f,o.value=w,c(e,t.body).then(y=>{try{y===S?i(p):y instanceof m?i(y):++u>P?(u=0,setTimeout(()=>{W(n,e,t,r,o,i,a,u)},0)):W(n,e,t,r,o,i,a,u)}catch(K){a(K)}},y=>{a(y)})}}catch(w){a(w)}},f=>{a(f)})}catch(f){a(f)}}async function Oe(n,e){return new Promise((t,r)=>{c(n,e.right).then(o=>{try{let i=null;i=e.left.type==="VariableDeclaration"?c(n,e.left):Promise.resolve(),i.then(()=>{try{let a="";if(e.left.type==="VariableDeclaration"){const f=e.left.declarations[0].id;f.type==="Identifier"&&(a=f.name)}else e.left.type==="Identifier"&&(a=e.left.name);if(!a)throw new l(n,s.InvalidIdentifier,e);a=a.toLowerCase();let u=null;if(n.localScope!=null&&n.localScope[a]!==void 0&&(u=n.localScope[a]),u===null&&n.globalScope[a]!==void 0&&(u=n.globalScope[a]),u===null)return void r(new l(n,s.InvalidIdentifier,e));B(o)||h(o)?V(n,e,o,{reject:r,resolve:t},u):j(o)?ke(n,e,o,{reject:r,resolve:t},u):o instanceof F||M(o)?Le(n,e,o,{reject:r,resolve:t},u):ye(o)?W(o.iterator(n.abortSignal),n,e,o,u,f=>{t(f)},f=>{r(f)},0):V(n,e,[],{reject:r,resolve:t},u)}catch(a){r(a)}},r)}catch(i){r(i)}},r)})}async function Ee(n,e){const t=e.argument;if(t.type==="MemberExpression"){const i={t:null},a=await c(n,t.object);let u=null;i.t=a,t.computed===!0?u=await c(n,t.property):t.property.type==="Identifier"&&(u=t.property.name);const f=i.t;let w;if(B(f)){if(!R(u))throw new l(n,s.ArrayAccessorMustBeNumber,e);if(u<0&&(u=f.length+u),u<0||u>=f.length)throw new l(n,s.OutOfBounds,e);w=d(f[u]),f[u]=e.operator==="++"?w+1:w-1}else if(f instanceof F){if(h(u)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(f.hasField(u)!==!0)throw new l(n,s.FieldNotFound,e,{key:u});w=d(f.field(u)),f.setField(u,e.operator==="++"?w+1:w-1)}else if(f instanceof C){if(h(u)===!1)throw new l(n,s.ModuleAccessorMustBeString,e);if(f.hasGlobal(u)!==!0)throw new l(n,s.ModuleExportNotFound,e);w=d(await f.global(u)),f.setGlobal(u,e.operator==="++"?w+1:w-1)}else{if(!M(f))throw j(f)?new l(n,s.Immutable,e):new l(n,s.InvalidParameter,e);if(h(u)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(f.hasField(u)!==!0)throw new l(n,s.FieldNotFound,e,{key:u});w=d(f.field(u)),f.setField(u,e.operator==="++"?w+1:w-1)}return e.prefix===!1?w:e.operator==="++"?w+1:w-1}const r=e.argument.type==="Identifier"?e.argument.name.toLowerCase():"";if(!r)throw new l(n,s.InvalidIdentifier,e);let o;if(n.localScope!=null&&n.localScope[r]!==void 0)return o=d(n.localScope[r].value),n.localScope[r]={value:e.operator==="++"?o+1:o-1,valueset:!0,node:e},e.prefix===!1?o:e.operator==="++"?o+1:o-1;if(n.globalScope[r]!==void 0)return o=d(n.globalScope[r].value),n.globalScope[r]={value:e.operator==="++"?o+1:o-1,valueset:!0,node:e},e.prefix===!1?o:e.operator==="++"?o+1:o-1;throw new l(n,s.InvalidIdentifier,e)}function b(n,e,t,r,o){switch(e){case"=":return n===p?null:n;case"/=":return d(t)/d(n);case"*=":return d(t)*d(n);case"-=":return d(t)-d(n);case"+=":return h(t)||h(n)?N(t)+N(n):d(t)+d(n);case"%=":return d(t)%d(n);default:throw new l(o,s.UnsupportedOperator,r)}}async function Be(n,e){const t=e.left;if(t.type==="MemberExpression"){const o=await c(n,e.right),i=await c(n,t.object);let a=null;if(t.computed===!0)a=await c(n,t.property);else{if(t.property.type!=="Identifier")throw new l(n,s.InvalidIdentifier,e);a=t.property.name}if(B(i)){if(!R(a))throw new l(n,s.ArrayAccessorMustBeNumber,e);if(a<0&&(a=i.length+a),a<0||a>i.length)throw new l(n,s.OutOfBounds,e);if(a===i.length){if(e.operator!=="=")throw new l(n,s.OutOfBounds,e);i[a]=b(o,e.operator,i[a],e,n)}else i[a]=b(o,e.operator,i[a],e,n)}else if(i instanceof F){if(h(a)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(i.hasField(a)===!0)i.setField(a,b(o,e.operator,i.field(a),e,n));else{if(e.operator!=="=")throw new l(n,s.FieldNotFound,e,{key:a});i.setField(a,b(o,e.operator,null,e,n))}}else if(i instanceof C){if(h(a)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(i.hasGlobal(a)!==!0)throw new l(n,s.ModuleExportNotFound,e);i.setGlobal(a,b(o,e.operator,await i.global(a),e,n))}else{if(!M(i))throw j(i)?new l(n,s.Immutable,e):new l(n,s.InvalidParameter,e);if(h(a)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(i.hasField(a)===!0)i.setField(a,b(o,e.operator,i.field(a),e,n));else{if(e.operator!=="=")throw new l(n,s.FieldNotFound,e,{key:a});i.setField(a,b(o,e.operator,null,e,n))}}return p}const r=t.name.toLowerCase();if(n.localScope!=null&&n.localScope[r]!==void 0){const o=await c(n,e.right);return n.localScope[r]={value:b(o,e.operator,n.localScope[r].value,e,n),valueset:!0,node:e.right},p}if(n.globalScope[r]!==void 0){const o=await c(n,e.right);return n.globalScope[r]={value:b(o,e.operator,n.globalScope[r].value,e,n),valueset:!0,node:e.right},p}throw new l(n,s.InvalidIdentifier,e)}async function je(n,e){if(e.expression.type==="AssignmentExpression")return c(n,e.expression);if(e.expression.type==="CallExpression"){const r=await c(n,e.expression);return r===p?p:new L(r)}const t=await c(n,e.expression);return t===p?p:new L(t)}async function Pe(n,e){const t=await c(n,e.test);if(t===!0)return c(n,e.consequent);if(t===!1)return e.alternate!==null?c(n,e.alternate):p;throw new l(n,s.BooleanConditionRequired,e)}async function Ke(n,e){return te(n,e,0)}async function te(n,e,t){if(t>=e.body.length)return p;const r=await c(n,e.body[t]);return r instanceof m||r===S||r===E||t===e.body.length-1?r:te(n,e,t+1)}async function De(n,e){if(e.argument===null)return new m(p);const t=await c(n,e.argument);return new m(t)}async function Ge(n,e){const t=e.id.name.toLowerCase();return n.globalScope[t]={valueset:!0,node:null,value:new Fe(e,n)},p}async function Te(n,e){var i,a;const t=e.specifiers[0].local.name.toLowerCase(),r=n.libraryResolver.loadLibrary(t);let o=null;return(i=n.libraryResolver._moduleSingletons)!=null&&i.has(r.uri)?o=n.libraryResolver._moduleSingletons.get(r.uri):(o=new C(r),await o.loadModule(n),(a=n.libraryResolver._moduleSingletons)==null||a.set(r.uri,o)),n.globalScope[t]={value:o,valueset:!0,node:e},p}async function qe(n,e){if(await c(n,e.declaration),e.declaration.type==="FunctionDeclaration")n.exports[e.declaration.id.name.toLowerCase()]="function";else if(e.declaration.type==="VariableDeclaration")for(const t of e.declaration.declarations)n.exports[t.id.name.toLowerCase()]="variable";return p}async function re(n,e,t){return t>=e.declarations.length?p:(await c(n,e.declarations[t]),t===e.declarations.length-1||await re(n,e,t+1),p)}async function Ue(n,e){let t=null;if(t=e.init===null?null:await c(n,e.init),n.localScope!==null){if(t===p&&(t=null),e.id.type!=="Identifier")throw new l(n,s.InvalidIdentifier,e);const o=e.id.name.toLowerCase();return n.localScope!=null&&(n.localScope[o]={value:t,valueset:!0,node:e.init}),p}if(e.id.type!=="Identifier")throw new l(n,s.InvalidIdentifier,e);const r=e.id.name.toLowerCase();return t===p&&(t=null),n.globalScope[r]={value:t,valueset:!0,node:e.init},p}async function Ve(n,e){const t=await c(n,e.object);if(t===null)throw new l(n,s.MemberOfNull,e);if(e.computed===!1){if(e.property.type==="Identifier"){if(t instanceof F||M(t))return t.field(e.property.name);if(t instanceof Z)return Q(t,e.property.name,n,e);if(t instanceof C){if(!t.hasGlobal(e.property.name))throw new l(n,s.InvalidIdentifier,e);return t.global(e.property.name)}throw new l(n,s.InvalidMemberAccessKey,e)}throw new l(n,s.InvalidMemberAccessKey,e)}let r=await c(n,e.property);if(t instanceof F||M(t)){if(h(r))return t.field(r);throw new l(n,s.InvalidMemberAccessKey,e)}if(t instanceof C){if(h(r))return t.global(r);throw new l(n,s.InvalidMemberAccessKey,e)}if(t instanceof Z){if(h(r))return Q(t,r,n,e);throw new l(n,s.InvalidMemberAccessKey,e)}if(B(t)){if(R(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length+r),r>=t.length||r<0)throw new l(n,s.OutOfBounds,e);return t[r]}throw new l(n,s.InvalidMemberAccessKey,e)}if(j(t)){if(R(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length()+r),r>=t.length()||r<0)throw new l(n,s.OutOfBounds,e);return t.get(r)}throw new l(n,s.InvalidMemberAccessKey,e)}if(h(t)){if(R(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length+r),r>=t.length||r<0)throw new l(n,s.OutOfBounds,e);return t[r]}throw new l(n,s.InvalidMemberAccessKey,e)}throw new l(n,s.InvalidMemberAccessKey,e)}async function We(n,e){const t=await c(n,e.argument);if(I(t)){if(e.operator==="!")return!t;if(e.operator==="-")return-1*d(t);if(e.operator==="+")return 1*d(t);if(e.operator==="~")return~d(t);throw new l(n,s.UnsupportedUnaryOperator,e)}if(e.operator==="-")return-1*d(t);if(e.operator==="+")return 1*d(t);if(e.operator==="~")return~d(t);throw new l(n,s.UnsupportedUnaryOperator,e)}async function _e(n,e){const t=[];for(let r=0;r>":case">>>":case"^":case"&":return ve(d(r),d(o),e.operator);case"==":return G(r,o);case"!=":return!G(r,o);case"<":case">":case"<=":case">=":return me(r,o,e.operator);case"+":return h(r)||h(o)?N(r)+N(o):d(r)+d(o);case"-":return d(r)-d(o);case"*":return d(r)*d(o);case"/":return d(r)/d(o);case"%":return d(r)%d(o);default:throw new l(n,s.UnsupportedOperator,e)}}async function Je(n,e){const t=await c(n,e.left);let r=null;if(!I(t))throw new l(n,s.LogicalExpressionOnlyBoolean,e);switch(e.operator){case"||":if(t===!0)return t;if(r=await c(n,e.right),I(r))return r;throw new l(n,s.LogicExpressionOrAnd,e);case"&&":if(t===!1)return t;if(r=await c(n,e.right),I(r))return r;throw new l(n,s.LogicExpressionOrAnd,e);default:throw new l(n,s.LogicExpressionOrAnd,e)}}async function J(n,e){const t=e.name.toLowerCase();if(n.localScope!=null&&n.localScope[t]!==void 0){const r=n.localScope[t];if(r.valueset===!0)return r.value;if(r.d!==null)return r.d;r.d=c(n,r.node);const o=await r.d;return r.value=o,r.valueset=!0,o}if(n.globalScope[t]!==void 0){const r=n.globalScope[t];if(r.valueset===!0)return r.value;if(r.d!==null)return r.d;r.d=c(n,r.node);const o=await r.d;return r.value=o,r.valueset=!0,o}throw new l(n,s.InvalidIdentifier,e)}async function Qe(n,e){if(e.callee.type==="MemberExpression"){const t=await c(n,e.callee.object);if(!(t instanceof C))throw new l(n,s.FuncionNotFound,e);const r=e.callee.computed===!1?e.callee.property.name:await c(n,e.callee.property);if(!t.hasGlobal(r))throw new l(n,s.FuncionNotFound,e);const o=await t.global(r);if(!v(o))throw new l(n,s.CallNonFunction,e);return o.call(n,e)}if(e.callee.type!=="Identifier")throw new l(n,s.FuncionNotFound,e);if(n.localScope!=null&&n.localScope[e.callee.name.toLowerCase()]!==void 0){const t=n.localScope[e.callee.name.toLowerCase()];if(v(t.value))return t.value.call(n,e);throw new l(n,s.CallNonFunction,e)}if(n.globalScope[e.callee.name.toLowerCase()]!==void 0){const t=n.globalScope[e.callee.name.toLowerCase()];if(v(t.value))return t.value.call(n,e);throw new l(n,s.CallNonFunction,e)}throw new l(n,s.FuncionNotFound,e)}async function Xe(n,e){return e.value?e.value.cooked:""}function Ze(n,e,t){if(v(n))throw new l(e,s.NoFunctionInTemplateLiteral,t);return n}async function He(n,e){const t=[];for(let i=0;i{const r={spatialReference:this.context.spatialReference,console:this.context.console,lrucache:this.context.lrucache,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:e.depthCounter+1},globalScope:this.context.globalScope};if(r.depthCounter.depth>64)throw new l(e,s.MaximumCallDepth,null);return D(this.definition,r,t,null)}}call(e,t){return k(e,t,(r,o,i)=>{const a={spatialReference:e.spatialReference,services:e.services,console:e.console,libraryResolver:e.libraryResolver,exports:e.exports,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{},abortSignal:e.abortSignal,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1}};if(a.depthCounter.depth>64)throw new l(e,s.MaximumCallDepth,t);return D(this.definition,a,i,t)})}marshalledCall(e,t,r,o){return o(e,t,async(i,a,u)=>{const f={spatialReference:e.spatialReference,globalScope:r.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,abortSignal:e.abortSignal,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};return u=u.map(w=>!v(w)||w instanceof T?w:X(w,e,o)),X(await D(this.definition,f,u,t),r,o)})}}class C extends xe{constructor(e){super(e)}async global(e){const t=this.executingContext.globalScope[e.toLowerCase()];if(t.valueset||(t.value=await c(this.executingContext,t.node),t.valueset=!0),v(t.value)&&!(t.value instanceof T)){const r=new T;r.fn=t.value,r.parameterEvaluator=k,r.context=this.executingContext,t.value=r}return t.value}setGlobal(e,t){if(v(t))throw new l(null,s.AssignModuleFunction,null);this.executingContext.globalScope[e.toLowerCase()]={value:t,valueset:!0,node:null}}hasGlobal(e){return this.executingContext.exports[e]===void 0&&(e=e.toLowerCase()),this.executingContext.exports[e]!==void 0}async loadModule(e){let t=e.spatialReference;t==null&&(t=new ne({wkid:102100})),this.moduleScope=ie({},e.customfunctions),this.executingContext={spatialReference:t,services:e.services,libraryResolver:new $(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},abortSignal:e.abortSignal===void 0||e.abortSignal===null?{aborted:!1}:e.abortSignal,globalScope:this.moduleScope,console:e.console?e.console:le,lrucache:e.lrucache,interceptor:e.interceptor,localScope:null,depthCounter:{depth:1}},await c(this.executingContext,this.source.syntax)}}async function k(n,e,t){if(e.preparsed===!0){const o=t(n,null,e.arguments);return H(o),o}const r=t(n,e,await Y(n,e));return H(r),r}async function c(n,e,t){if(e.breakpoint&&t!==!0)return await e.breakpoint(),c(n,e,!0);try{switch(e==null?void 0:e.type){case"VariableDeclarator":return await Ue(n,e);case"ImportDeclaration":return await Te(n,e);case"ExportNamedDeclaration":return await qe(n,e);case"VariableDeclaration":return await re(n,e,0);case"BlockStatement":case"Program":return await Ke(n,e);case"FunctionDeclaration":return await Ge(n,e);case"ReturnStatement":return await De(n,e);case"IfStatement":return await Pe(n,e);case"ExpressionStatement":return await je(n,e);case"UpdateExpression":return await Ee(n,e);case"AssignmentExpression":return await Be(n,e);case"ForStatement":return await Ne(n,e);case"WhileStatement":return await Ae(n,e);case"ForInStatement":return await Oe(n,e);case"BreakStatement":return S;case"EmptyStatement":return p;case"ContinueStatement":return E;case"TemplateElement":return await Xe(n,e);case"TemplateLiteral":return await He(n,e);case"Identifier":return await J(n,e);case"MemberExpression":return await Ve(n,e);case"Literal":return e.value;case"CallExpression":return await Qe(n,e);case"UnaryExpression":return await We(n,e);case"BinaryExpression":return await Ye(n,e);case"LogicalExpression":return await Je(n,e);case"ArrayExpression":return await _e(n,e);case"ObjectExpression":return await Ce(n,e);case"Property":return await Re(n,e);default:throw new l(n,s.Unrecognised,e)}}catch(r){throw ge(n,e,r)}}async function Ce(n,e){const t=[];for(let a=0;a{try{t.testResult===!0?++i>P?(i=0,setTimeout(()=>{O(n,e,t,r,o,i)},0)):O(n,e,t,r,o,i):t.lastAction instanceof m?r(t.lastAction):r(p)}catch(a){o(a)}},a=>{o(a)})}catch(a){o(a)}}function Ne(n,e){try{return e.init!==null?c(n,e.init).then(()=>new Promise((t,r)=>{O(n,e,{testResult:!0,lastAction:p},o=>{t(o)},o=>{r(o)},0)})):new Promise((t,r)=>{O(n,e,{testResult:!0,lastAction:p},o=>{t(o)},o=>{r(o)},0)})}catch(t){return Promise.reject(t)}}function q(n,e,t,r,o,i,a,u,f,w){try{if(r<=i)return void u(p);o.value=a==="k"?t[i]:i,c(n,e.body).then(y=>{try{y instanceof m?u(y):y===S?u(p):++w>P?(w=0,setTimeout(()=>{q(n,e,t,r,o,i+1,a,u,f,w)},0)):q(n,e,t,r,o,i+1,a,u,f,w)}catch(K){f(K)}},y=>{f(y)})}catch(y){f(y)}}function U(n,e,t,r,o,i,a,u,f){try{if(t.length()<=o)return void a(p);r.value=i==="k"?t.get(o):o,c(n,e.body).then(w=>{w instanceof m?a(w):w===S?a(p):++f>P?(f=0,setTimeout(()=>{U(n,e,t,r,o+1,i,a,u,f)},0)):U(n,e,t,r,o+1,i,a,u,f)},w=>{u(w)})}catch(w){u(w)}}function V(n,e,t,r,o,i){try{if(i===void 0&&(i="i"),t.length===0)return void r.resolve(p);q(n,e,t,t.length,o,0,i,a=>{r.resolve(a)},a=>{r.reject(a)},0)}catch(a){r.reject(a)}}function ke(n,e,t,r,o,i){try{if(i===void 0&&(i="i"),t.length===0)return void r.resolve(p);U(n,e,t,o,0,i,a=>{r.resolve(a)},a=>{r.reject(a)},0)}catch(a){r.reject(a)}}function Le(n,e,t,r,o){try{V(n,e,t.keys(),r,o,"k")}catch(i){r.reject(i)}}function W(n,e,t,r,o,i,a,u){try{n.next().then(f=>{try{if(f===null)i(p);else{const w=ee.createFromGraphicLikeObject(f.geometry,f.attributes,r);w._underlyingGraphic=f,o.value=w,c(e,t.body).then(y=>{try{y===S?i(p):y instanceof m?i(y):++u>P?(u=0,setTimeout(()=>{W(n,e,t,r,o,i,a,u)},0)):W(n,e,t,r,o,i,a,u)}catch(K){a(K)}},y=>{a(y)})}}catch(w){a(w)}},f=>{a(f)})}catch(f){a(f)}}async function Oe(n,e){return new Promise((t,r)=>{c(n,e.right).then(o=>{try{let i=null;i=e.left.type==="VariableDeclaration"?c(n,e.left):Promise.resolve(),i.then(()=>{try{let a="";if(e.left.type==="VariableDeclaration"){const f=e.left.declarations[0].id;f.type==="Identifier"&&(a=f.name)}else e.left.type==="Identifier"&&(a=e.left.name);if(!a)throw new l(n,s.InvalidIdentifier,e);a=a.toLowerCase();let u=null;if(n.localScope!=null&&n.localScope[a]!==void 0&&(u=n.localScope[a]),u===null&&n.globalScope[a]!==void 0&&(u=n.globalScope[a]),u===null)return void r(new l(n,s.InvalidIdentifier,e));B(o)||h(o)?V(n,e,o,{reject:r,resolve:t},u):j(o)?ke(n,e,o,{reject:r,resolve:t},u):o instanceof F||M(o)?Le(n,e,o,{reject:r,resolve:t},u):ye(o)?W(o.iterator(n.abortSignal),n,e,o,u,f=>{t(f)},f=>{r(f)},0):V(n,e,[],{reject:r,resolve:t},u)}catch(a){r(a)}},r)}catch(i){r(i)}},r)})}async function Ee(n,e){const t=e.argument;if(t.type==="MemberExpression"){const i={t:null},a=await c(n,t.object);let u=null;i.t=a,t.computed===!0?u=await c(n,t.property):t.property.type==="Identifier"&&(u=t.property.name);const f=i.t;let w;if(B(f)){if(!R(u))throw new l(n,s.ArrayAccessorMustBeNumber,e);if(u<0&&(u=f.length+u),u<0||u>=f.length)throw new l(n,s.OutOfBounds,e);w=d(f[u]),f[u]=e.operator==="++"?w+1:w-1}else if(f instanceof F){if(h(u)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(f.hasField(u)!==!0)throw new l(n,s.FieldNotFound,e,{key:u});w=d(f.field(u)),f.setField(u,e.operator==="++"?w+1:w-1)}else if(f instanceof C){if(h(u)===!1)throw new l(n,s.ModuleAccessorMustBeString,e);if(f.hasGlobal(u)!==!0)throw new l(n,s.ModuleExportNotFound,e);w=d(await f.global(u)),f.setGlobal(u,e.operator==="++"?w+1:w-1)}else{if(!M(f))throw j(f)?new l(n,s.Immutable,e):new l(n,s.InvalidParameter,e);if(h(u)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(f.hasField(u)!==!0)throw new l(n,s.FieldNotFound,e,{key:u});w=d(f.field(u)),f.setField(u,e.operator==="++"?w+1:w-1)}return e.prefix===!1?w:e.operator==="++"?w+1:w-1}const r=e.argument.type==="Identifier"?e.argument.name.toLowerCase():"";if(!r)throw new l(n,s.InvalidIdentifier,e);let o;if(n.localScope!=null&&n.localScope[r]!==void 0)return o=d(n.localScope[r].value),n.localScope[r]={value:e.operator==="++"?o+1:o-1,valueset:!0,node:e},e.prefix===!1?o:e.operator==="++"?o+1:o-1;if(n.globalScope[r]!==void 0)return o=d(n.globalScope[r].value),n.globalScope[r]={value:e.operator==="++"?o+1:o-1,valueset:!0,node:e},e.prefix===!1?o:e.operator==="++"?o+1:o-1;throw new l(n,s.InvalidIdentifier,e)}function b(n,e,t,r,o){switch(e){case"=":return n===p?null:n;case"/=":return d(t)/d(n);case"*=":return d(t)*d(n);case"-=":return d(t)-d(n);case"+=":return h(t)||h(n)?N(t)+N(n):d(t)+d(n);case"%=":return d(t)%d(n);default:throw new l(o,s.UnsupportedOperator,r)}}async function Be(n,e){const t=e.left;if(t.type==="MemberExpression"){const o=await c(n,e.right),i=await c(n,t.object);let a=null;if(t.computed===!0)a=await c(n,t.property);else{if(t.property.type!=="Identifier")throw new l(n,s.InvalidIdentifier,e);a=t.property.name}if(B(i)){if(!R(a))throw new l(n,s.ArrayAccessorMustBeNumber,e);if(a<0&&(a=i.length+a),a<0||a>i.length)throw new l(n,s.OutOfBounds,e);if(a===i.length){if(e.operator!=="=")throw new l(n,s.OutOfBounds,e);i[a]=b(o,e.operator,i[a],e,n)}else i[a]=b(o,e.operator,i[a],e,n)}else if(i instanceof F){if(h(a)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(i.hasField(a)===!0)i.setField(a,b(o,e.operator,i.field(a),e,n));else{if(e.operator!=="=")throw new l(n,s.FieldNotFound,e,{key:a});i.setField(a,b(o,e.operator,null,e,n))}}else if(i instanceof C){if(h(a)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(i.hasGlobal(a)!==!0)throw new l(n,s.ModuleExportNotFound,e);i.setGlobal(a,b(o,e.operator,await i.global(a),e,n))}else{if(!M(i))throw j(i)?new l(n,s.Immutable,e):new l(n,s.InvalidParameter,e);if(h(a)===!1)throw new l(n,s.KeyAccessorMustBeString,e);if(i.hasField(a)===!0)i.setField(a,b(o,e.operator,i.field(a),e,n));else{if(e.operator!=="=")throw new l(n,s.FieldNotFound,e,{key:a});i.setField(a,b(o,e.operator,null,e,n))}}return p}const r=t.name.toLowerCase();if(n.localScope!=null&&n.localScope[r]!==void 0){const o=await c(n,e.right);return n.localScope[r]={value:b(o,e.operator,n.localScope[r].value,e,n),valueset:!0,node:e.right},p}if(n.globalScope[r]!==void 0){const o=await c(n,e.right);return n.globalScope[r]={value:b(o,e.operator,n.globalScope[r].value,e,n),valueset:!0,node:e.right},p}throw new l(n,s.InvalidIdentifier,e)}async function je(n,e){if(e.expression.type==="AssignmentExpression")return c(n,e.expression);if(e.expression.type==="CallExpression"){const r=await c(n,e.expression);return r===p?p:new L(r)}const t=await c(n,e.expression);return t===p?p:new L(t)}async function Pe(n,e){const t=await c(n,e.test);if(t===!0)return c(n,e.consequent);if(t===!1)return e.alternate!==null?c(n,e.alternate):p;throw new l(n,s.BooleanConditionRequired,e)}async function Ke(n,e){return te(n,e,0)}async function te(n,e,t){if(t>=e.body.length)return p;const r=await c(n,e.body[t]);return r instanceof m||r===S||r===E||t===e.body.length-1?r:te(n,e,t+1)}async function De(n,e){if(e.argument===null)return new m(p);const t=await c(n,e.argument);return new m(t)}async function Ge(n,e){const t=e.id.name.toLowerCase();return n.globalScope[t]={valueset:!0,node:null,value:new Fe(e,n)},p}async function Te(n,e){var i,a;const t=e.specifiers[0].local.name.toLowerCase(),r=n.libraryResolver.loadLibrary(t);let o=null;return(i=n.libraryResolver._moduleSingletons)!=null&&i.has(r.uri)?o=n.libraryResolver._moduleSingletons.get(r.uri):(o=new C(r),await o.loadModule(n),(a=n.libraryResolver._moduleSingletons)==null||a.set(r.uri,o)),n.globalScope[t]={value:o,valueset:!0,node:e},p}async function qe(n,e){if(await c(n,e.declaration),e.declaration.type==="FunctionDeclaration")n.exports[e.declaration.id.name.toLowerCase()]="function";else if(e.declaration.type==="VariableDeclaration")for(const t of e.declaration.declarations)n.exports[t.id.name.toLowerCase()]="variable";return p}async function re(n,e,t){return t>=e.declarations.length?p:(await c(n,e.declarations[t]),t===e.declarations.length-1||await re(n,e,t+1),p)}async function Ue(n,e){let t=null;if(t=e.init===null?null:await c(n,e.init),n.localScope!==null){if(t===p&&(t=null),e.id.type!=="Identifier")throw new l(n,s.InvalidIdentifier,e);const o=e.id.name.toLowerCase();return n.localScope!=null&&(n.localScope[o]={value:t,valueset:!0,node:e.init}),p}if(e.id.type!=="Identifier")throw new l(n,s.InvalidIdentifier,e);const r=e.id.name.toLowerCase();return t===p&&(t=null),n.globalScope[r]={value:t,valueset:!0,node:e.init},p}async function Ve(n,e){const t=await c(n,e.object);if(t===null)throw new l(n,s.MemberOfNull,e);if(e.computed===!1){if(e.property.type==="Identifier"){if(t instanceof F||M(t))return t.field(e.property.name);if(t instanceof Z)return Q(t,e.property.name,n,e);if(t instanceof C){if(!t.hasGlobal(e.property.name))throw new l(n,s.InvalidIdentifier,e);return t.global(e.property.name)}throw new l(n,s.InvalidMemberAccessKey,e)}throw new l(n,s.InvalidMemberAccessKey,e)}let r=await c(n,e.property);if(t instanceof F||M(t)){if(h(r))return t.field(r);throw new l(n,s.InvalidMemberAccessKey,e)}if(t instanceof C){if(h(r))return t.global(r);throw new l(n,s.InvalidMemberAccessKey,e)}if(t instanceof Z){if(h(r))return Q(t,r,n,e);throw new l(n,s.InvalidMemberAccessKey,e)}if(B(t)){if(R(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length+r),r>=t.length||r<0)throw new l(n,s.OutOfBounds,e);return t[r]}throw new l(n,s.InvalidMemberAccessKey,e)}if(j(t)){if(R(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length()+r),r>=t.length()||r<0)throw new l(n,s.OutOfBounds,e);return t.get(r)}throw new l(n,s.InvalidMemberAccessKey,e)}if(h(t)){if(R(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=t.length+r),r>=t.length||r<0)throw new l(n,s.OutOfBounds,e);return t[r]}throw new l(n,s.InvalidMemberAccessKey,e)}throw new l(n,s.InvalidMemberAccessKey,e)}async function We(n,e){const t=await c(n,e.argument);if(I(t)){if(e.operator==="!")return!t;if(e.operator==="-")return-1*d(t);if(e.operator==="+")return 1*d(t);if(e.operator==="~")return~d(t);throw new l(n,s.UnsupportedUnaryOperator,e)}if(e.operator==="-")return-1*d(t);if(e.operator==="+")return 1*d(t);if(e.operator==="~")return~d(t);throw new l(n,s.UnsupportedUnaryOperator,e)}async function _e(n,e){const t=[];for(let r=0;r>":case">>>":case"^":case"&":return ve(d(r),d(o),e.operator);case"==":return G(r,o);case"!=":return!G(r,o);case"<":case">":case"<=":case">=":return me(r,o,e.operator);case"+":return h(r)||h(o)?N(r)+N(o):d(r)+d(o);case"-":return d(r)-d(o);case"*":return d(r)*d(o);case"/":return d(r)/d(o);case"%":return d(r)%d(o);default:throw new l(n,s.UnsupportedOperator,e)}}async function Je(n,e){const t=await c(n,e.left);let r=null;if(!I(t))throw new l(n,s.LogicalExpressionOnlyBoolean,e);switch(e.operator){case"||":if(t===!0)return t;if(r=await c(n,e.right),I(r))return r;throw new l(n,s.LogicExpressionOrAnd,e);case"&&":if(t===!1)return t;if(r=await c(n,e.right),I(r))return r;throw new l(n,s.LogicExpressionOrAnd,e);default:throw new l(n,s.LogicExpressionOrAnd,e)}}async function J(n,e){const t=e.name.toLowerCase();if(n.localScope!=null&&n.localScope[t]!==void 0){const r=n.localScope[t];if(r.valueset===!0)return r.value;if(r.d!==null)return r.d;r.d=c(n,r.node);const o=await r.d;return r.value=o,r.valueset=!0,o}if(n.globalScope[t]!==void 0){const r=n.globalScope[t];if(r.valueset===!0)return r.value;if(r.d!==null)return r.d;r.d=c(n,r.node);const o=await r.d;return r.value=o,r.valueset=!0,o}throw new l(n,s.InvalidIdentifier,e)}async function Qe(n,e){if(e.callee.type==="MemberExpression"){const t=await c(n,e.callee.object);if(!(t instanceof C))throw new l(n,s.FuncionNotFound,e);const r=e.callee.computed===!1?e.callee.property.name:await c(n,e.callee.property);if(!t.hasGlobal(r))throw new l(n,s.FuncionNotFound,e);const o=await t.global(r);if(!v(o))throw new l(n,s.CallNonFunction,e);return o.call(n,e)}if(e.callee.type!=="Identifier")throw new l(n,s.FuncionNotFound,e);if(n.localScope!=null&&n.localScope[e.callee.name.toLowerCase()]!==void 0){const t=n.localScope[e.callee.name.toLowerCase()];if(v(t.value))return t.value.call(n,e);throw new l(n,s.CallNonFunction,e)}if(n.globalScope[e.callee.name.toLowerCase()]!==void 0){const t=n.globalScope[e.callee.name.toLowerCase()];if(v(t.value))return t.value.call(n,e);throw new l(n,s.CallNonFunction,e)}throw new l(n,s.FuncionNotFound,e)}async function Xe(n,e){return e.value?e.value.cooked:""}function Ze(n,e,t){if(v(n))throw new l(e,s.NoFunctionInTemplateLiteral,t);return n}async function He(n,e){const t=[];for(let i=0;ithis.fn(e,{preparsed:!0,arguments:n})}call(e,n){return this.fn(e,n)}marshalledCall(e,n,r,i){return i(e,n,(u,a,s)=>{s=s.map(l=>l instanceof Ft&&!(l instanceof et)?Lt(l,e,i):l);const o=this.call(r,{args:s});return at(o)?o.then(l=>Lt(l,r,i)):o})}}class et extends Ft{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(e){return this.fn.createFunction(this.context)}call(e,n){return this.fn.marshalledCall(e,n,this.context,this.parameterEvaluator)}marshalledCall(e,n,r){return this.fn.marshalledCall(e,n,this.context,this.parameterEvaluator)}}class nt extends me{constructor(e,n,r,i,u,a){super(e),this._lazyPt=[],this._hasZ=!1,this._hasM=!1,this._spRef=n,this._hasZ=r,this._hasM=i,this._cacheId=u,this._partId=a}get(e){if(this._lazyPt[e]===void 0){const n=this._elements[e];if(n===void 0)return;const r=this._hasZ,i=this._hasM;let u=null;u=r&&!i?new W(n[0],n[1],n[2],void 0,this._spRef):i&&!r?new W(n[0],n[1],void 0,n[2],this._spRef):r&&i?new W(n[0],n[1],n[2],n[3],this._spRef):new W(n[0],n[1],this._spRef),u.cache._arcadeCacheId=this._cacheId.toString()+"-"+this._partId.toString()+"-"+e.toString(),this._lazyPt[e]=u}return this._lazyPt[e]}equalityTest(e){return e===this||e!==null&&e instanceof nt&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()+"-"+this._partId.toString()}}class yn extends me{constructor(e,n,r,i,u){super(e),this._lazyPath=[],this._hasZ=!1,this._hasM=!1,this._hasZ=r,this._hasM=i,this._spRef=n,this._cacheId=u}get(e){if(this._lazyPath[e]===void 0){const n=this._elements[e];if(n===void 0)return;this._lazyPath[e]=new nt(n,this._spRef,this._hasZ,this._hasM,this._cacheId,e)}return this._lazyPath[e]}equalityTest(e){return e===this||e!==null&&e instanceof yn&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()}}class At extends Error{}class oo extends At{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class lo extends At{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class co extends At{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class tn extends At{}class Ws extends At{constructor(e){super(`Invalid unit ${e}`)}}class Me extends At{}class rt extends At{constructor(){super("Zone is an abstract class")}}const x="numeric",Ge="short",ve="long",Rr={year:x,month:x,day:x},Js={year:x,month:Ge,day:x},ho={year:x,month:Ge,day:x,weekday:Ge},Ys={year:x,month:ve,day:x},Ks={year:x,month:ve,day:x,weekday:ve},Qs={hour:x,minute:x},Xs={hour:x,minute:x,second:x},ea={hour:x,minute:x,second:x,timeZoneName:Ge},ta={hour:x,minute:x,second:x,timeZoneName:ve},na={hour:x,minute:x,hourCycle:"h23"},ra={hour:x,minute:x,second:x,hourCycle:"h23"},ia={hour:x,minute:x,second:x,hourCycle:"h23",timeZoneName:Ge},sa={hour:x,minute:x,second:x,hourCycle:"h23",timeZoneName:ve},aa={year:x,month:x,day:x,hour:x,minute:x},ua={year:x,month:x,day:x,hour:x,minute:x,second:x},oa={year:x,month:Ge,day:x,hour:x,minute:x},la={year:x,month:Ge,day:x,hour:x,minute:x,second:x},fo={year:x,month:Ge,day:x,weekday:Ge,hour:x,minute:x},ca={year:x,month:ve,day:x,hour:x,minute:x,timeZoneName:Ge},ha={year:x,month:ve,day:x,hour:x,minute:x,second:x,timeZoneName:Ge},fa={year:x,month:ve,day:x,weekday:ve,hour:x,minute:x,timeZoneName:ve},da={year:x,month:ve,day:x,weekday:ve,hour:x,minute:x,second:x,timeZoneName:ve};function H(t){return typeof t=="undefined"}function xt(t){return typeof t=="number"}function Qn(t){return typeof t=="number"&&t%1===0}function mo(t){return typeof t=="string"}function po(t){return Object.prototype.toString.call(t)==="[object Date]"}function ma(){try{return typeof Intl!="undefined"&&!!Intl.RelativeTimeFormat}catch{return!1}}function go(t){return Array.isArray(t)?t:[t]}function Li(t,e,n){if(t.length!==0)return t.reduce((r,i)=>{const u=[e(i),i];return r&&n(r[0],u[0])===r[0]?r:u},null)[1]}function yo(t,e){return e.reduce((n,r)=>(n[r]=t[r],n),{})}function $t(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Qe(t,e,n){return Qn(t)&&t>=e&&t<=n}function Do(t,e){return t-e*Math.floor(t/e)}function ie(t,e=2){const n=t<0;let r;return n?r="-"+(""+-t).padStart(e,"0"):r=(""+t).padStart(e,"0"),r}function st(t){if(!(H(t)||t===null||t===""))return parseInt(t,10)}function dt(t){if(!(H(t)||t===null||t===""))return parseFloat(t)}function ui(t){if(!(H(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function oi(t,e,n=!1){const r=10**e;return(n?Math.trunc:Math.round)(t*r)/r}function Fn(t){return t%4===0&&(t%100!==0||t%400===0)}function cn(t){return Fn(t)?366:365}function zn(t,e){const n=Do(e-1,12)+1,r=t+(e-n)/12;return n===2?Fn(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function li(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function Gn(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,n=t-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return e===4||r===3?53:52}function Pr(t){return t>99?t:t>60?1900+t:2e3+t}function pa(t,e,n,r=null){const i=new Date(t),u={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(u.timeZone=r);const a={timeZoneName:e,...u},s=new Intl.DateTimeFormat(n,a).formatToParts(i).find(o=>o.type.toLowerCase()==="timezonename");return s?s.value:null}function Xn(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);const r=parseInt(e,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function ga(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new Me(`Invalid unit value ${t}`);return e}function Vn(t,e){const n={};for(const r in t)if($t(t,r)){const i=t[r];if(i==null)continue;n[e(r)]=ga(i)}return n}function hn(t,e){const n=Math.trunc(Math.abs(t/60)),r=Math.trunc(Math.abs(t%60)),i=t>=0?"+":"-";switch(e){case"short":return`${i}${ie(n,2)}:${ie(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${ie(n,2)}${ie(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function er(t){return yo(t,["hour","minute","second","millisecond"])}const ya=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,wo=["January","February","March","April","May","June","July","August","September","October","November","December"],Da=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],xo=["J","F","M","A","M","J","J","A","S","O","N","D"];function wa(t){switch(t){case"narrow":return[...xo];case"short":return[...Da];case"long":return[...wo];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const xa=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Fa=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Fo=["M","T","W","T","F","S","S"];function Ca(t){switch(t){case"narrow":return[...Fo];case"short":return[...Fa];case"long":return[...xa];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Ea=["AM","PM"],Co=["Before Christ","Anno Domini"],Eo=["BC","AD"],Ao=["B","A"];function Aa(t){switch(t){case"narrow":return[...Ao];case"short":return[...Eo];case"long":return[...Co];default:return null}}function So(t){return Ea[t.hour<12?0:1]}function vo(t,e){return Ca(e)[t.weekday-1]}function bo(t,e){return wa(e)[t.month-1]}function Io(t,e){return Aa(e)[t.year<0?0:1]}function ko(t,e,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},u=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&u){const f=t==="days";switch(e){case 1:return f?"tomorrow":`next ${i[t][0]}`;case-1:return f?"yesterday":`last ${i[t][0]}`;case 0:return f?"today":`this ${i[t][0]}`}}const a=Object.is(e,-0)||e<0,s=Math.abs(e),o=s===1,l=i[t],d=r?o?l[1]:l[2]||l[1]:o?i[t][0]:t;return a?`${s} ${d} ago`:`in ${s} ${d}`}function $i(t,e){let n="";for(const r of t)r.literal?n+=r.val:n+=e(r.val);return n}const To={D:Rr,DD:Js,DDD:Ys,DDDD:Ks,t:Qs,tt:Xs,ttt:ea,tttt:ta,T:na,TT:ra,TTT:ia,TTTT:sa,f:aa,ff:oa,fff:ca,ffff:fa,F:ua,FF:la,FFF:ha,FFFF:da};class xe{static create(e,n={}){return new xe(e,n)}static parseFormat(e){let n=null,r="",i=!1;const u=[];for(let a=0;a0&&u.push({literal:i,val:r}),n=null,r="",i=!i):i||s===n?r+=s:(r.length>0&&u.push({literal:!1,val:r}),r=s,n=s)}return r.length>0&&u.push({literal:i,val:r}),u}static macroTokenToFormatOpts(e){return To[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}formatDateTime(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n}).format()}formatDateTimeParts(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n}).formatToParts()}resolvedOptions(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n}).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return ie(e,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,n){const r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",u=(g,D)=>this.loc.extract(e,g,D),a=g=>e.isOffsetFixed&&e.offset===0&&g.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,g.format):"",s=()=>r?So(e):u({hour:"numeric",hourCycle:"h12"},"dayperiod"),o=(g,D)=>r?bo(e,g):u(D?{month:g}:{month:g,day:"numeric"},"month"),l=(g,D)=>r?vo(e,g):u(D?{weekday:g}:{weekday:g,month:"long",day:"numeric"},"weekday"),d=g=>{const D=xe.macroTokenToFormatOpts(g);return D?this.formatWithSystemDefault(e,D):g},f=g=>r?Io(e,g):u({era:g},"era"),m=g=>{switch(g){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return s();case"d":return i?u({day:"numeric"},"day"):this.num(e.day);case"dd":return i?u({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return i?u({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return i?u({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return o("short",!0);case"LLLL":return o("long",!0);case"LLLLL":return o("narrow",!0);case"M":return i?u({month:"numeric"},"month"):this.num(e.month);case"MM":return i?u({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return o("short",!1);case"MMMM":return o("long",!1);case"MMMMM":return o("narrow",!1);case"y":return i?u({year:"numeric"},"year"):this.num(e.year);case"yy":return i?u({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return i?u({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return i?u({year:"numeric"},"year"):this.num(e.year,6);case"G":return f("short");case"GG":return f("long");case"GGGGG":return f("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return d(g)}};return $i(xe.parseFormat(n),m)}formatDurationFromString(e,n){const r=o=>{switch(o[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=o=>l=>{const d=r(l);return d?this.num(o.get(d),l.length):l},u=xe.parseFormat(n),a=u.reduce((o,{literal:l,val:d})=>l?o:o.concat(d),[]),s=e.shiftTo(...a.map(r).filter(o=>o));return $i(u,i(s))}}class Re{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Cn{get type(){throw new rt}get name(){throw new rt}get ianaName(){return this.name}get isUniversal(){throw new rt}offsetName(e,n){throw new rt}formatOffset(e,n){throw new rt}offset(e){throw new rt}equals(e){throw new rt}get isValid(){throw new rt}}let pr=null;class tr extends Cn{static get instance(){return pr===null&&(pr=new tr),pr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return pa(e,n,r)}formatOffset(e,n){return hn(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let _n={};function Mo(t){return _n[t]||(_n[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),_n[t]}const No={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Oo(t,e){const n=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,u,a,s,o,l,d]=r;return[a,i,u,s,o,l,d]}function Bo(t,e){const n=t.formatToParts(e),r=[];for(let i=0;i=0?D:1e3+D,(m-g)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let gr=null;class Fe extends Cn{static get utcInstance(){return gr===null&&(gr=new Fe(0)),gr}static instance(e){return e===0?Fe.utcInstance:new Fe(e)}static parseSpecifier(e){if(e){const n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Fe(Xn(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${hn(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${hn(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return hn(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class _o extends Cn{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function ut(t,e){if(H(t)||t===null)return e;if(t instanceof Cn)return t;if(mo(t)){const n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?tr.instance:n==="utc"||n==="gmt"?Fe.utcInstance:Fe.parseSpecifier(n)||tt.create(t)}else return xt(t)?Fe.instance(t):typeof t=="object"&&t.offset&&typeof t.offset=="number"?t:new _o(t)}let Ri=()=>Date.now(),Pi="system",Ui=null,zi=null,Gi=null,Vi;class ae{static get now(){return Ri}static set now(e){Ri=e}static set defaultZone(e){Pi=e}static get defaultZone(){return ut(Pi,tr.instance)}static get defaultLocale(){return Ui}static set defaultLocale(e){Ui=e}static get defaultNumberingSystem(){return zi}static set defaultNumberingSystem(e){zi=e}static get defaultOutputCalendar(){return Gi}static set defaultOutputCalendar(e){Gi=e}static get throwOnInvalid(){return Vi}static set throwOnInvalid(e){Vi=e}static resetCaches(){ee.resetCache(),tt.resetCache()}}let qi={};function Lo(t,e={}){const n=JSON.stringify([t,e]);let r=qi[n];return r||(r=new Intl.ListFormat(t,e),qi[n]=r),r}let Ur={};function zr(t,e={}){const n=JSON.stringify([t,e]);let r=Ur[n];return r||(r=new Intl.DateTimeFormat(t,e),Ur[n]=r),r}let Gr={};function $o(t,e={}){const n=JSON.stringify([t,e]);let r=Gr[n];return r||(r=new Intl.NumberFormat(t,e),Gr[n]=r),r}let Vr={};function Ro(t,e={}){const{base:n,...r}=e,i=JSON.stringify([t,r]);let u=Vr[i];return u||(u=new Intl.RelativeTimeFormat(t,e),Vr[i]=u),u}let nn=null;function Po(){return nn||(nn=new Intl.DateTimeFormat().resolvedOptions().locale,nn)}function Uo(t){const e=t.indexOf("-u-");if(e===-1)return[t];{let n;const r=t.substring(0,e);try{n=zr(t).resolvedOptions()}catch{n=zr(r).resolvedOptions()}const{numberingSystem:i,calendar:u}=n;return[r,i,u]}}function zo(t,e,n){return(n||e)&&(t+="-u",n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function Go(t){const e=[];for(let n=1;n<=12;n++){const r=B.utc(2016,n,1);e.push(t(r))}return e}function Vo(t){const e=[];for(let n=1;n<=7;n++){const r=B.utc(2016,11,13+n);e.push(t(r))}return e}function In(t,e,n,r,i){const u=t.listingMode(n);return u==="error"?null:u==="en"?r(e):i(e)}function qo(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class Zo{constructor(e,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:i,floor:u,...a}=r;if(!n||Object.keys(a).length>0){const s={useGrouping:!1,...r};r.padTo>0&&(s.minimumIntegerDigits=r.padTo),this.inf=$o(e,s)}}format(e){if(this.inf){const n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{const n=this.floor?Math.floor(e):oi(e,3);return ie(n,this.padTo)}}}class Ho{constructor(e,n,r){this.opts=r;let i;if(e.zone.isUniversal){const a=-1*(e.offset/60),s=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;e.offset!==0&&tt.create(s).valid?(i=s,this.dt=e):(i="UTC",r.timeZoneName?this.dt=e:this.dt=e.offset===0?e:B.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,i=e.zone.name);const u={...this.opts};i&&(u.timeZone=i),this.dtf=zr(n,u)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class jo{constructor(e,n,r){this.opts={style:"long",...r},!n&&ma()&&(this.rtf=Ro(e,r))}format(e,n){return this.rtf?this.rtf.format(e,n):ko(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}}class ee{static fromOpts(e){return ee.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,n,r,i=!1){const u=e||ae.defaultLocale,a=u||(i?"en-US":Po()),s=n||ae.defaultNumberingSystem,o=r||ae.defaultOutputCalendar;return new ee(a,s,o,u)}static resetCache(){nn=null,Ur={},Gr={},Vr={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:r}={}){return ee.create(e,n,r)}constructor(e,n,r,i){const[u,a,s]=Uo(e);this.locale=u,this.numberingSystem=n||a||null,this.outputCalendar=r||s||null,this.intl=zo(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=qo(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:ee.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1,r=!0){return In(this,e,r,wa,()=>{const i=n?{month:e,day:"numeric"}:{month:e},u=n?"format":"standalone";return this.monthsCache[u][e]||(this.monthsCache[u][e]=Go(a=>this.extract(a,i,"month"))),this.monthsCache[u][e]})}weekdays(e,n=!1,r=!0){return In(this,e,r,Ca,()=>{const i=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},u=n?"format":"standalone";return this.weekdaysCache[u][e]||(this.weekdaysCache[u][e]=Vo(a=>this.extract(a,i,"weekday"))),this.weekdaysCache[u][e]})}meridiems(e=!0){return In(this,void 0,e,()=>Ea,()=>{if(!this.meridiemCache){const n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[B.utc(2016,11,13,9),B.utc(2016,11,13,19)].map(r=>this.extract(r,n,"dayperiod"))}return this.meridiemCache})}eras(e,n=!0){return In(this,e,n,Aa,()=>{const r={era:e};return this.eraCache[e]||(this.eraCache[e]=[B.utc(-40,1,1),B.utc(2017,1,1)].map(i=>this.extract(i,r,"era"))),this.eraCache[e]})}extract(e,n,r){const i=this.dtFormatter(e,n),u=i.formatToParts(),a=u.find(s=>s.type.toLowerCase()===r);return a?a.value:null}numberFormatter(e={}){return new Zo(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new Ho(e,this.intl,n)}relFormatter(e={}){return new jo(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Lo(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Vt(...t){const e=t.reduce((n,r)=>n+r.source,"");return RegExp(`^${e}$`)}function qt(...t){return e=>t.reduce(([n,r,i],u)=>{const[a,s,o]=u(e,i);return[{...n,...a},s||r,o]},[{},null,1]).slice(0,2)}function Zt(t,...e){if(t==null)return[null,null];for(const[n,r]of e){const i=n.exec(t);if(i)return r(i)}return[null,null]}function Sa(...t){return(e,n)=>{const r={};let i;for(i=0;ig!==void 0&&(D||g&&d)?-g:g;return[{years:m(dt(n)),months:m(dt(r)),weeks:m(dt(i)),days:m(dt(u)),hours:m(dt(a)),minutes:m(dt(s)),seconds:m(dt(o),o==="-0"),milliseconds:m(ui(l),f)}]}const al={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function fi(t,e,n,r,i,u,a){const s={year:e.length===2?Pr(st(e)):st(e),month:Da.indexOf(n)+1,day:st(r),hour:st(i),minute:st(u)};return a&&(s.second=st(a)),t&&(s.weekday=t.length>3?xa.indexOf(t)+1:Fa.indexOf(t)+1),s}const ul=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ol(t){const[,e,n,r,i,u,a,s,o,l,d,f]=t,m=fi(e,i,r,n,u,a,s);let g;return o?g=al[o]:l?g=0:g=Xn(d,f),[m,new Fe(g)]}function ll(t){return t.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const cl=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,hl=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,fl=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Zi(t){const[,e,n,r,i,u,a,s]=t;return[fi(e,i,r,n,u,a,s),Fe.utcInstance]}function dl(t){const[,e,n,r,i,u,a,s]=t;return[fi(e,s,n,r,i,u,a),Fe.utcInstance]}const ml=Vt(Jo,hi),pl=Vt(Yo,hi),gl=Vt(Ko,hi),yl=Vt(ba),ka=qt(nl,Ht,En,An),Dl=qt(Qo,Ht,En,An),wl=qt(Xo,Ht,En,An),xl=qt(Ht,En,An);function Fl(t){return Zt(t,[ml,ka],[pl,Dl],[gl,wl],[yl,xl])}function Cl(t){return Zt(ll(t),[ul,ol])}function El(t){return Zt(t,[cl,Zi],[hl,Zi],[fl,dl])}function Al(t){return Zt(t,[il,sl])}const Sl=qt(Ht);function vl(t){return Zt(t,[rl,Sl])}const bl=Vt(el,tl),Il=Vt(Ia),kl=qt(Ht,En,An);function Tl(t){return Zt(t,[bl,ka],[Il,kl])}const Ml="Invalid Duration",Ta={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Nl={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Ta},Ie=146097/400,St=146097/4800,Ol={years:{quarters:4,months:12,weeks:Ie/7,days:Ie,hours:Ie*24,minutes:Ie*24*60,seconds:Ie*24*60*60,milliseconds:Ie*24*60*60*1e3},quarters:{months:3,weeks:Ie/28,days:Ie/4,hours:Ie*24/4,minutes:Ie*24*60/4,seconds:Ie*24*60*60/4,milliseconds:Ie*24*60*60*1e3/4},months:{weeks:St/7,days:St,hours:St*24,minutes:St*24*60,seconds:St*24*60*60,milliseconds:St*24*60*60*1e3},...Ta},pt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Bl=pt.slice(0).reverse();function mt(t,e,n=!1){const r={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new j(r)}function _l(t){return t<0?Math.floor(t):Math.ceil(t)}function Ma(t,e,n,r,i){const u=t[i][n],a=e[n]/u,s=Math.sign(a)===Math.sign(r[i]),o=!s&&r[i]!==0&&Math.abs(a)<=1?_l(a):Math.trunc(a);r[i]+=o,e[n]-=o*u}function Ll(t,e){Bl.reduce((n,r)=>H(e[r])?n:(n&&Ma(t,e,n,e,r),r),null)}class j{constructor(e){const n=e.conversionAccuracy==="longterm"||!1;let r=n?Ol:Nl;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||ee.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,n){return j.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new Me(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new j({values:Vn(e,j.normalizeUnit),loc:ee.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(xt(e))return j.fromMillis(e);if(j.isDuration(e))return e;if(typeof e=="object")return j.fromObject(e);throw new Me(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){const[r]=Al(e);return r?j.fromObject(r,n):j.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){const[r]=vl(e);return r?j.fromObject(r,n):j.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new Me("need to specify a reason the Duration is invalid");const r=e instanceof Re?e:new Re(e,n);if(ae.throwOnInvalid)throw new co(r);return new j({invalid:r})}static normalizeUnit(e){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new Ws(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?xe.create(this.loc,r).formatDurationFromString(this,e):Ml}toHuman(e={}){const n=pt.map(r=>{const i=this.values[r];return H(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(i)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=oi(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const n=this.toMillis();if(n<0||n>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const r=this.shiftTo("hours","minutes","seconds","milliseconds");let i=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(i+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||r.milliseconds!==0)&&(i+=".SSS"));let u=r.toFormat(i);return e.includePrefix&&(u="T"+u),u}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const n=j.fromDurationLike(e),r={};for(const i of pt)($t(n.values,i)||$t(this.values,i))&&(r[i]=n.get(i)+this.get(i));return mt(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const n=j.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=ga(e(this.values[r],r));return mt(this,{values:n},!0)}get(e){return this[j.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const n={...this.values,...Vn(e,j.normalizeUnit)};return mt(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:r,matrix:i}={}){const a={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:i,conversionAccuracy:r};return mt(this,a)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Ll(this.matrix,e),mt(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(a=>j.normalizeUnit(a));const n={},r={},i=this.toObject();let u;for(const a of pt)if(e.indexOf(a)>=0){u=a;let s=0;for(const l in r)s+=this.matrix[l][a]*r[l],r[l]=0;xt(i[a])&&(s+=i[a]);const o=Math.trunc(s);n[a]=o,r[a]=(s*1e3-o*1e3)/1e3;for(const l in i)pt.indexOf(l)>pt.indexOf(a)&&Ma(this.matrix,i,l,n,a)}else xt(i[a])&&(r[a]=i[a]);for(const a in r)r[a]!==0&&(n[u]+=a===u?r[a]:r[a]/this.matrix[u][a]);return mt(this,{values:n},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return mt(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(const r of pt)if(!n(this.values[r],e.values[r]))return!1;return!0}}const Jt="Invalid Interval";function $l(t,e){return!t||!t.isValid?te.invalid("missing or invalid start"):!e||!e.isValid?te.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?te.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];const n=e.map(Qt).filter(a=>this.contains(a)).sort(),r=[];let{s:i}=this,u=0;for(;i+this.e?this.e:a;r.push(te.fromDateTimes(i,s)),i=s,u+=1}return r}splitBy(e){const n=j.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,u;const a=[];for(;ro*i));u=+s>+this.e?this.e:s,a.push(te.fromDateTimes(r,u)),r=u,i+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const n=this.s>e.s?this.s:e.s,r=this.e=r?null:te.fromDateTimes(n,r)}union(e){if(!this.isValid)return this;const n=this.se.e?this.e:e.e;return te.fromDateTimes(n,r)}static merge(e){const[n,r]=e.sort((i,u)=>i.s-u.s).reduce(([i,u],a)=>u?u.overlaps(a)||u.abutsStart(a)?[i,u.union(a)]:[i.concat([u]),a]:[i,a],[[],null]);return r&&n.push(r),n}static xor(e){let n=null,r=0;const i=[],u=e.map(o=>[{time:o.s,type:"s"},{time:o.e,type:"e"}]),a=Array.prototype.concat(...u),s=a.sort((o,l)=>o.time-l.time);for(const o of s)r+=o.type==="s"?1:-1,r===1?n=o.time:(n&&+n!=+o.time&&i.push(te.fromDateTimes(n,o.time)),n=null);return te.merge(i)}difference(...e){return te.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:Jt}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Jt}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Jt}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Jt}toFormat(e,{separator:n=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:Jt}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):j.invalid(this.invalidReason)}mapEndpoints(e){return te.fromDateTimes(e(this.s),e(this.e))}}class kn{static hasDST(e=ae.defaultZone){const n=B.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return tt.isValidZone(e)}static normalizeZone(e){return ut(e,ae.defaultZone)}static months(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:u="gregory"}={}){return(i||ee.create(n,r,u)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:u="gregory"}={}){return(i||ee.create(n,r,u)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||ee.create(n,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||ee.create(n,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return ee.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return ee.create(n,null,"gregory").eras(e)}static features(){return{relative:ma()}}}function Hi(t,e){const n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(e)-n(t);return Math.floor(j.fromMillis(r).as("days"))}function Rl(t,e,n){const r=[["years",(s,o)=>o.year-s.year],["quarters",(s,o)=>o.quarter-s.quarter+(o.year-s.year)*4],["months",(s,o)=>o.month-s.month+(o.year-s.year)*12],["weeks",(s,o)=>{const l=Hi(s,o);return(l-l%7)/7}],["days",Hi]],i={};let u,a;for(const[s,o]of r)if(n.indexOf(s)>=0){u=s;let l=o(t,e);a=t.plus({[s]:l}),a>e?(t=t.plus({[s]:l-1}),l-=1):t=a,i[s]=l}return[t,i,a,u]}function Pl(t,e,n,r){let[i,u,a,s]=Rl(t,e,n);const o=e-i,l=n.filter(f=>["hours","minutes","seconds","milliseconds"].indexOf(f)>=0);l.length===0&&(a0?j.fromMillis(o,r).shiftTo(...l).plus(d):d}const di={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},ji={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ul=di.hanidec.replace(/[\[|\]]/g,"").split("");function zl(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n=u&&r<=a&&(e+=r-u)}}return parseInt(e,10)}else return e}function _e({numberingSystem:t},e=""){return new RegExp(`${di[t||"latn"]}${e}`)}const Gl="missing Intl.DateTimeFormat.formatToParts support";function Y(t,e=n=>n){return{regex:t,deser:([n])=>e(zl(n))}}const Vl=String.fromCharCode(160),Na=`[ ${Vl}]`,Oa=new RegExp(Na,"g");function ql(t){return t.replace(/\./g,"\\.?").replace(Oa,Na)}function Wi(t){return t.replace(/\./g,"").replace(Oa," ").toLowerCase()}function Le(t,e){return t===null?null:{regex:RegExp(t.map(ql).join("|")),deser:([n])=>t.findIndex(r=>Wi(n)===Wi(r))+e}}function Ji(t,e){return{regex:t,deser:([,n,r])=>Xn(n,r),groups:e}}function yr(t){return{regex:t,deser:([e])=>e}}function Zl(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Hl(t,e){const n=_e(e),r=_e(e,"{2}"),i=_e(e,"{3}"),u=_e(e,"{4}"),a=_e(e,"{6}"),s=_e(e,"{1,2}"),o=_e(e,"{1,3}"),l=_e(e,"{1,6}"),d=_e(e,"{1,9}"),f=_e(e,"{2,4}"),m=_e(e,"{4,6}"),g=F=>({regex:RegExp(Zl(F.val)),deser:([U])=>U,literal:!0}),k=(F=>{if(t.literal)return g(F);switch(F.val){case"G":return Le(e.eras("short",!1),0);case"GG":return Le(e.eras("long",!1),0);case"y":return Y(l);case"yy":return Y(f,Pr);case"yyyy":return Y(u);case"yyyyy":return Y(m);case"yyyyyy":return Y(a);case"M":return Y(s);case"MM":return Y(r);case"MMM":return Le(e.months("short",!0,!1),1);case"MMMM":return Le(e.months("long",!0,!1),1);case"L":return Y(s);case"LL":return Y(r);case"LLL":return Le(e.months("short",!1,!1),1);case"LLLL":return Le(e.months("long",!1,!1),1);case"d":return Y(s);case"dd":return Y(r);case"o":return Y(o);case"ooo":return Y(i);case"HH":return Y(r);case"H":return Y(s);case"hh":return Y(r);case"h":return Y(s);case"mm":return Y(r);case"m":return Y(s);case"q":return Y(s);case"qq":return Y(r);case"s":return Y(s);case"ss":return Y(r);case"S":return Y(o);case"SSS":return Y(i);case"u":return yr(d);case"uu":return yr(s);case"uuu":return Y(n);case"a":return Le(e.meridiems(),0);case"kkkk":return Y(u);case"kk":return Y(f,Pr);case"W":return Y(s);case"WW":return Y(r);case"E":case"c":return Y(n);case"EEE":return Le(e.weekdays("short",!1,!1),1);case"EEEE":return Le(e.weekdays("long",!1,!1),1);case"ccc":return Le(e.weekdays("short",!0,!1),1);case"cccc":return Le(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Ji(new RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case"ZZZ":return Ji(new RegExp(`([+-]${s.source})(${r.source})?`),2);case"z":return yr(/[a-z_+-/]{1,256}?/i);default:return g(F)}})(t)||{invalidReason:Gl};return k.token=t,k}const jl={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Wl(t,e,n){const{type:r,value:i}=t;if(r==="literal")return{literal:!0,val:i};const u=n[r];let a=jl[r];if(typeof a=="object"&&(a=a[u]),a)return{literal:!1,val:a}}function Jl(t){return[`^${t.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,t]}function Yl(t,e,n){const r=t.match(e);if(r){const i={};let u=1;for(const a in n)if($t(n,a)){const s=n[a],o=s.groups?s.groups+1:1;!s.literal&&s.token&&(i[s.token.val[0]]=s.deser(r.slice(u,u+o))),u+=o}return[r,i]}else return[r,{}]}function Kl(t){const e=u=>{switch(u){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return H(t.z)||(n=tt.create(t.z)),H(t.Z)||(n||(n=new Fe(t.Z)),r=t.Z),H(t.q)||(t.M=(t.q-1)*3+1),H(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),H(t.u)||(t.S=ui(t.u)),[Object.keys(t).reduce((u,a)=>{const s=e(a);return s&&(u[s]=t[a]),u},{}),n,r]}let Dr=null;function Ql(){return Dr||(Dr=B.fromMillis(1555555555555)),Dr}function Xl(t,e){if(t.literal)return t;const n=xe.macroTokenToFormatOpts(t.val),r=La(n,e);return r==null||r.includes(void 0)?t:r}function Ba(t,e){return Array.prototype.concat(...t.map(n=>Xl(n,e)))}function _a(t,e,n){const r=Ba(xe.parseFormat(n),t),i=r.map(a=>Hl(a,t)),u=i.find(a=>a.invalidReason);if(u)return{input:e,tokens:r,invalidReason:u.invalidReason};{const[a,s]=Jl(i),o=RegExp(a,"i"),[l,d]=Yl(e,o,s),[f,m,g]=d?Kl(d):[null,null,void 0];if($t(d,"a")&&$t(d,"H"))throw new tn("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:r,regex:o,rawMatches:l,matches:d,result:f,zone:m,specificOffset:g}}}function ec(t,e,n){const{result:r,zone:i,specificOffset:u,invalidReason:a}=_a(t,e,n);return[r,i,u,a]}function La(t,e){return t?xe.create(e,t).formatDateTimeParts(Ql()).map(i=>Wl(i,e,t)):null}const $a=[0,31,59,90,120,151,181,212,243,273,304,334],Ra=[0,31,60,91,121,152,182,213,244,274,305,335];function Oe(t,e){return new Re("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Pa(t,e,n){const r=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return i===0?7:i}function Ua(t,e,n){return n+(Fn(t)?Ra:$a)[e-1]}function za(t,e){const n=Fn(t)?Ra:$a,r=n.findIndex(u=>uGn(e)?(s=e+1,a=1):s=e,{weekYear:s,weekNumber:a,weekday:u,...er(t)}}function Yi(t){const{weekYear:e,weekNumber:n,weekday:r}=t,i=Pa(e,1,4),u=cn(e);let a=n*7+r-i-3,s;a<1?(s=e-1,a+=cn(s)):a>u?(s=e+1,a-=cn(e)):s=e;const{month:o,day:l}=za(s,a);return{year:s,month:o,day:l,...er(t)}}function wr(t){const{year:e,month:n,day:r}=t,i=Ua(e,n,r);return{year:e,ordinal:i,...er(t)}}function Ki(t){const{year:e,ordinal:n}=t,{month:r,day:i}=za(e,n);return{year:e,month:r,day:i,...er(t)}}function tc(t){const e=Qn(t.weekYear),n=Qe(t.weekNumber,1,Gn(t.weekYear)),r=Qe(t.weekday,1,7);return e?n?r?!1:Oe("weekday",t.weekday):Oe("week",t.week):Oe("weekYear",t.weekYear)}function nc(t){const e=Qn(t.year),n=Qe(t.ordinal,1,cn(t.year));return e?n?!1:Oe("ordinal",t.ordinal):Oe("year",t.year)}function Ga(t){const e=Qn(t.year),n=Qe(t.month,1,12),r=Qe(t.day,1,zn(t.year,t.month));return e?n?r?!1:Oe("day",t.day):Oe("month",t.month):Oe("year",t.year)}function Va(t){const{hour:e,minute:n,second:r,millisecond:i}=t,u=Qe(e,0,23)||e===24&&n===0&&r===0&&i===0,a=Qe(n,0,59),s=Qe(r,0,59),o=Qe(i,0,999);return u?a?s?o?!1:Oe("millisecond",i):Oe("second",r):Oe("minute",n):Oe("hour",e)}const xr="Invalid DateTime",Qi=864e13;function Tn(t){return new Re("unsupported zone",`the zone "${t.name}" is not supported`)}function Fr(t){return t.weekData===null&&(t.weekData=qr(t.c)),t.weekData}function Yt(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new B({...n,...e,old:n})}function qa(t,e,n){let r=t-e*60*1e3;const i=n.offset(r);if(e===i)return[r,e];r-=(i-e)*60*1e3;const u=n.offset(r);return i===u?[r,i]:[t-Math.min(i,u)*60*1e3,Math.max(i,u)]}function Xi(t,e){t+=e*60*1e3;const n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Ln(t,e,n){return qa(li(t),e,n)}function es(t,e){const n=t.o,r=t.c.year+Math.trunc(e.years),i=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,u={...t.c,year:r,month:i,day:Math.min(t.c.day,zn(r,i))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},a=j.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),s=li(u);let[o,l]=qa(s,n,t.zone);return a!==0&&(o+=a,l=t.zone.offset(o)),{ts:o,o:l}}function Kt(t,e,n,r,i,u){const{setZone:a,zone:s}=n;if(t&&Object.keys(t).length!==0){const o=e||s,l=B.fromObject(t,{...n,zone:o,specificOffset:u});return a?l:l.setZone(s)}else return B.invalid(new Re("unparsable",`the input "${i}" can't be parsed as ${r}`))}function Mn(t,e,n=!0){return t.isValid?xe.create(ee.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function Cr(t,e){const n=t.c.year>9999||t.c.year<0;let r="";return n&&t.c.year>=0&&(r+="+"),r+=ie(t.c.year,n?6:4),e?(r+="-",r+=ie(t.c.month),r+="-",r+=ie(t.c.day)):(r+=ie(t.c.month),r+=ie(t.c.day)),r}function ts(t,e,n,r,i,u){let a=ie(t.c.hour);return e?(a+=":",a+=ie(t.c.minute),(t.c.second!==0||!n)&&(a+=":")):a+=ie(t.c.minute),(t.c.second!==0||!n)&&(a+=ie(t.c.second),(t.c.millisecond!==0||!r)&&(a+=".",a+=ie(t.c.millisecond,3))),i&&(t.isOffsetFixed&&t.offset===0&&!u?a+="Z":t.o<0?(a+="-",a+=ie(Math.trunc(-t.o/60)),a+=":",a+=ie(Math.trunc(-t.o%60))):(a+="+",a+=ie(Math.trunc(t.o/60)),a+=":",a+=ie(Math.trunc(t.o%60)))),u&&(a+="["+t.zone.ianaName+"]"),a}const Za={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},rc={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ic={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Ha=["year","month","day","hour","minute","second","millisecond"],sc=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ac=["year","ordinal","hour","minute","second","millisecond"];function ns(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new Ws(t);return e}function rs(t,e){const n=ut(e.zone,ae.defaultZone),r=ee.fromObject(e),i=ae.now();let u,a;if(H(t.year))u=i;else{for(const l of Ha)H(t[l])&&(t[l]=Za[l]);const s=Ga(t)||Va(t);if(s)return B.invalid(s);const o=n.offset(i);[u,a]=Ln(t,o,n)}return new B({ts:u,zone:n,loc:r,o:a})}function is(t,e,n){const r=H(n.round)?!0:n.round,i=(a,s)=>(a=oi(a,r||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(a,s)),u=a=>n.calendary?e.hasSame(t,a)?0:e.startOf(a).diff(t.startOf(a),a).get(a):e.diff(t,a).get(a);if(n.unit)return i(u(n.unit),n.unit);for(const a of n.units){const s=u(a);if(Math.abs(s)>=1)return i(s,a)}return i(t>e?-0:0,n.units[n.units.length-1])}function ss(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}class B{constructor(e){const n=e.zone||ae.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new Re("invalid input"):null)||(n.isValid?null:Tn(n));this.ts=H(e.ts)?ae.now():e.ts;let i=null,u=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[i,u]=[e.old.c,e.old.o];else{const s=n.offset(this.ts);i=Xi(this.ts,s),r=Number.isNaN(i.year)?new Re("invalid input"):null,i=r?null:i,u=r?null:s}this._zone=n,this.loc=e.loc||ee.create(),this.invalid=r,this.weekData=null,this.c=i,this.o=u,this.isLuxonDateTime=!0}static now(){return new B({})}static local(){const[e,n]=ss(arguments),[r,i,u,a,s,o,l]=n;return rs({year:r,month:i,day:u,hour:a,minute:s,second:o,millisecond:l},e)}static utc(){const[e,n]=ss(arguments),[r,i,u,a,s,o,l]=n;return e.zone=Fe.utcInstance,rs({year:r,month:i,day:u,hour:a,minute:s,second:o,millisecond:l},e)}static fromJSDate(e,n={}){const r=po(e)?e.valueOf():NaN;if(Number.isNaN(r))return B.invalid("invalid input");const i=ut(n.zone,ae.defaultZone);return i.isValid?new B({ts:r,zone:i,loc:ee.fromObject(n)}):B.invalid(Tn(i))}static fromMillis(e,n={}){if(xt(e))return e<-Qi||e>Qi?B.invalid("Timestamp out of range"):new B({ts:e,zone:ut(n.zone,ae.defaultZone),loc:ee.fromObject(n)});throw new Me(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(xt(e))return new B({ts:e*1e3,zone:ut(n.zone,ae.defaultZone),loc:ee.fromObject(n)});throw new Me("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};const r=ut(n.zone,ae.defaultZone);if(!r.isValid)return B.invalid(Tn(r));const i=ae.now(),u=H(n.specificOffset)?r.offset(i):n.specificOffset,a=Vn(e,ns),s=!H(a.ordinal),o=!H(a.year),l=!H(a.month)||!H(a.day),d=o||l,f=a.weekYear||a.weekNumber,m=ee.fromObject(n);if((d||s)&&f)throw new tn("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&s)throw new tn("Can't mix ordinal dates with month/day");const g=f||a.weekday&&!d;let D,k,F=Xi(i,u);g?(D=sc,k=rc,F=qr(F)):s?(D=ac,k=ic,F=wr(F)):(D=Ha,k=Za);let U=!1;for(const Wt of D){const Yu=a[Wt];H(Yu)?U?a[Wt]=k[Wt]:a[Wt]=F[Wt]:U=!0}const pe=g?tc(a):s?nc(a):Ga(a),ft=pe||Va(a);if(ft)return B.invalid(ft);const ju=g?Yi(a):s?Ki(a):a,[Wu,Ju]=Ln(ju,u,r),mr=new B({ts:Wu,zone:r,o:Ju,loc:m});return a.weekday&&d&&e.weekday!==mr.weekday?B.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${mr.toISO()}`):mr}static fromISO(e,n={}){const[r,i]=Fl(e);return Kt(r,i,n,"ISO 8601",e)}static fromRFC2822(e,n={}){const[r,i]=Cl(e);return Kt(r,i,n,"RFC 2822",e)}static fromHTTP(e,n={}){const[r,i]=El(e);return Kt(r,i,n,"HTTP",n)}static fromFormat(e,n,r={}){if(H(e)||H(n))throw new Me("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:u=null}=r,a=ee.fromOpts({locale:i,numberingSystem:u,defaultToEN:!0}),[s,o,l,d]=ec(a,e,n);return d?B.invalid(d):Kt(s,o,r,`format ${n}`,e,l)}static fromString(e,n,r={}){return B.fromFormat(e,n,r)}static fromSQL(e,n={}){const[r,i]=Tl(e);return Kt(r,i,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new Me("need to specify a reason the DateTime is invalid");const r=e instanceof Re?e:new Re(e,n);if(ae.throwOnInvalid)throw new oo(r);return new B({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){const r=La(e,ee.fromObject(n));return r?r.map(i=>i?i.val:null).join(""):null}static expandFormat(e,n={}){return Ba(xe.parseFormat(e),ee.fromObject(n)).map(i=>i.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Fr(this).weekYear:NaN}get weekNumber(){return this.isValid?Fr(this).weekNumber:NaN}get weekday(){return this.isValid?Fr(this).weekday:NaN}get ordinal(){return this.isValid?wr(this.c).ordinal:NaN}get monthShort(){return this.isValid?kn.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?kn.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?kn.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?kn.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return Fn(this.year)}get daysInMonth(){return zn(this.year,this.month)}get daysInYear(){return this.isValid?cn(this.year):NaN}get weeksInWeekYear(){return this.isValid?Gn(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:n,numberingSystem:r,calendar:i}=xe.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(e=0,n={}){return this.setZone(Fe.instance(e),n)}toLocal(){return this.setZone(ae.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(e=ut(e,ae.defaultZone),e.equals(this.zone))return this;if(e.isValid){let i=this.ts;if(n||r){const u=e.offset(this.ts),a=this.toObject();[i]=Ln(a,u,e)}return Yt(this,{ts:i,zone:e})}else return B.invalid(Tn(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:r}={}){const i=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:r});return Yt(this,{loc:i})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const n=Vn(e,ns),r=!H(n.weekYear)||!H(n.weekNumber)||!H(n.weekday),i=!H(n.ordinal),u=!H(n.year),a=!H(n.month)||!H(n.day),s=u||a,o=n.weekYear||n.weekNumber;if((s||i)&&o)throw new tn("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&i)throw new tn("Can't mix ordinal dates with month/day");let l;r?l=Yi({...qr(this.c),...n}):H(n.ordinal)?(l={...this.toObject(),...n},H(n.day)&&(l.day=Math.min(zn(l.year,l.month),l.day))):l=Ki({...wr(this.c),...n});const[d,f]=Ln(l,this.o,this.zone);return Yt(this,{ts:d,o:f})}plus(e){if(!this.isValid)return this;const n=j.fromDurationLike(e);return Yt(this,es(this,n))}minus(e){if(!this.isValid)return this;const n=j.fromDurationLike(e).negate();return Yt(this,es(this,n))}startOf(e){if(!this.isValid)return this;const n={},r=j.normalizeUnit(e);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(r==="weeks"&&(n.weekday=1),r==="quarters"){const i=Math.ceil(this.month/3);n.month=(i-1)*3+1}return this.set(n)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,n={}){return this.isValid?xe.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):xr}toLocaleString(e=Rr,n={}){return this.isValid?xe.create(this.loc.clone(n),e).formatDateTime(this):xr}toLocaleParts(e={}){return this.isValid?xe.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:i=!0,extendedZone:u=!1}={}){if(!this.isValid)return null;const a=e==="extended";let s=Cr(this,a);return s+="T",s+=ts(this,a,n,r,i,u),s}toISODate({format:e="extended"}={}){return this.isValid?Cr(this,e==="extended"):null}toISOWeekDate(){return Mn(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:i=!1,extendedZone:u=!1,format:a="extended"}={}){return this.isValid?(i?"T":"")+ts(this,a==="extended",n,e,r,u):null}toRFC2822(){return Mn(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Mn(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Cr(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let i="HH:mm:ss.SSS";return(n||e)&&(r&&(i+=" "),n?i+="z":e&&(i+="ZZ")),Mn(this,i,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():xr}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",r={}){if(!this.isValid||!e.isValid)return j.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...r},u=go(n).map(j.normalizeUnit),a=e.valueOf()>this.valueOf(),s=a?this:e,o=a?e:this,l=Pl(s,o,u,i);return a?l.negate():l}diffNow(e="milliseconds",n={}){return this.diff(B.now(),e,n)}until(e){return this.isValid?te.fromDateTimes(this,e):this}hasSame(e,n){if(!this.isValid)return!1;const r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(n)<=r&&r<=i.endOf(n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const n=e.base||B.fromObject({},{zone:this.zone}),r=e.padding?thisn.valueOf(),Math.min)}static max(...e){if(!e.every(B.isDateTime))throw new Me("max requires all arguments be DateTimes");return Li(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,r={}){const{locale:i=null,numberingSystem:u=null}=r,a=ee.fromOpts({locale:i,numberingSystem:u,defaultToEN:!0});return _a(a,e,n)}static fromStringExplain(e,n,r={}){return B.fromFormatExplain(e,n,r)}static get DATE_SHORT(){return Rr}static get DATE_MED(){return Js}static get DATE_MED_WITH_WEEKDAY(){return ho}static get DATE_FULL(){return Ys}static get DATE_HUGE(){return Ks}static get TIME_SIMPLE(){return Qs}static get TIME_WITH_SECONDS(){return Xs}static get TIME_WITH_SHORT_OFFSET(){return ea}static get TIME_WITH_LONG_OFFSET(){return ta}static get TIME_24_SIMPLE(){return na}static get TIME_24_WITH_SECONDS(){return ra}static get TIME_24_WITH_SHORT_OFFSET(){return ia}static get TIME_24_WITH_LONG_OFFSET(){return sa}static get DATETIME_SHORT(){return aa}static get DATETIME_SHORT_WITH_SECONDS(){return ua}static get DATETIME_MED(){return oa}static get DATETIME_MED_WITH_SECONDS(){return la}static get DATETIME_MED_WITH_WEEKDAY(){return fo}static get DATETIME_FULL(){return ca}static get DATETIME_FULL_WITH_SECONDS(){return ha}static get DATETIME_HUGE(){return fa}static get DATETIME_HUGE_WITH_SECONDS(){return da}}function Qt(t){if(B.isDateTime(t))return t;if(t&&t.valueOf&&xt(t.valueOf()))return B.fromJSDate(t);if(t&&typeof t=="object")return B.fromObject(t);throw new Me(`Unknown datetime argument: ${t}, of type ${typeof t}`)}var as,us;function hd(t){return Ku.fromJSON(t.toJSON())}function uc(t){return t.toJSON?t.toJSON():t}function fd(t){return typeof t=="string"||t instanceof String}function dd(t){return typeof t=="number"}function os(t){return t instanceof Date}function md(t,e){return t===e||!(!os(t)||!os(e))&&t.getTime()===e.getTime()}function pd(t){if(t==null)return null;if(typeof t=="number")return t;switch(t.toLowerCase()){case"meters":case"meter":return 109404;case"miles":case"mile":return 109439;case"kilometers":case"kilometer":case"km":return 109414}return null}function gd(t){if(t==null)return null;switch(t.type){case"polygon":case"multipoint":case"polyline":return t.extent;case"point":return new we({xmin:t.x,ymin:t.y,xmax:t.x,ymax:t.y,spatialReference:t.spatialReference});case"extent":return t}return null}function yd(t){if(t==null)return null;if(typeof t=="number"||typeof t=="number")return t;switch(t.toLowerCase()){case"meters":case"meter":return 9001;case"miles":case"mile":return 9093;case"kilometers":case"kilometer":case"km":return 9036}return null}(function(t){t[t.Standardised=0]="Standardised",t[t.StandardisedNoInterval=1]="StandardisedNoInterval",t[t.SqlServer=2]="SqlServer",t[t.Oracle=3]="Oracle",t[t.Postgres=4]="Postgres",t[t.PGDB=5]="PGDB",t[t.FILEGDB=6]="FILEGDB",t[t.NotEvaluated=7]="NotEvaluated"})(as||(as={})),function(t){t[t.InFeatureSet=0]="InFeatureSet",t[t.NotInFeatureSet=1]="NotInFeatureSet",t[t.Unknown=2]="Unknown"}(us||(us={}));const Dd=1e3,wd={point:"point",polygon:"polygon",polyline:"polyline",multipoint:"multipoint",extent:"extent",esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint",esriGeometryEnvelope:"extent",envelope:"extent"},ls={point:"esriGeometryPoint",polygon:"esriGeometryPolygon",polyline:"esriGeometryPolyline",multipoint:"esriGeometryMultipoint",extent:"esriGeometryEnvelope",esriGeometryPoint:"esriGeometryPoint",esriGeometryPolygon:"esriGeometryPolygon",esriGeometryPolyline:"esriGeometryPolyline",esriGeometryMultipoint:"esriGeometryMultipoint",esriGeometryEnvelope:"esriGeometryEnvelope",envelope:"esriGeometryEnvelope"},cs={"small-integer":"esriFieldTypeSmallInteger",integer:"esriFieldTypeInteger",long:"esriFieldTypeLong",single:"esriFieldTypeSingle",double:"esriFieldTypeDouble",string:"esriFieldTypeString",date:"esriFieldTypeDate",oid:"esriFieldTypeOID",geometry:"esriFieldTypeGeometry",blob:"esriFieldTypeBlob",raster:"esriFieldTypeRaster",guid:"esriFieldTypeGUID","global-id":"esriFieldTypeGlobalID",xml:"eesriFieldTypeXML",esriFieldTypeSmallInteger:"esriFieldTypeSmallInteger",esriFieldTypeInteger:"esriFieldTypeInteger",esriFieldTypeLong:"esriFieldTypeLong",esriFieldTypeSingle:"esriFieldTypeSingle",esriFieldTypeDouble:"esriFieldTypeDouble",esriFieldTypeString:"esriFieldTypeString",esriFieldTypeDate:"esriFieldTypeDate",esriFieldTypeOID:"esriFieldTypeOID",esriFieldTypeGeometry:"esriFieldTypeGeometry",esriFieldTypeBlob:"esriFieldTypeBlob",esriFieldTypeRaster:"esriFieldTypeRaster",esriFieldTypeGUID:"esriFieldTypeGUID",esriFieldTypeGlobalID:"esriFieldTypeGlobalID",esriFieldTypeXML:"eesriFieldTypeXML"};function xd(t){return t===void 0?"":t=(t=(t=t.replace(/\/featureserver\/[0-9]*/i,"/FeatureServer")).replace(/\/mapserver\/[0-9]*/i,"/MapServer")).split("?")[0]}function Fd(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});const n=typeof e.cycles=="boolean"&&e.cycles,r=e.cmp&&(i=e.cmp,function(a){return function(s,o){const l={key:s,value:a[s]},d={key:o,value:a[o]};return i(l,d)}});var i;const u=[];return function a(s){if(s&&s.toJSON&&typeof s.toJSON=="function"&&(s=s.toJSON()),s===void 0)return;if(typeof s=="number")return isFinite(s)?""+s:"null";if(typeof s!="object")return JSON.stringify(s);let o,l;if(Array.isArray(s)){for(l="[",o=0;on)throw new h(r,c.WrongNumberOfParameters,i)}function Zr(t){return t<0?-Math.round(-t):Math.round(t)}function Nt(){let t=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),(e==="x"?n:3&n|8).toString(16)})}function gi(t,e){return isNaN(t)||e==null||e===""?t.toString():(e=lt(e,"\u2030",""),e=lt(e,"\xA4",""),io(t,{pattern:e}))}function sr(t,e){const n=B.fromJSDate(t);return e==null||e===""?n.toISO({suppressMilliseconds:!0}):n.toFormat(yi(e),{locale:zs(),numberingSystem:"latn"})}function yi(t){t=t.replace(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let e="";const n=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of t.match(n))switch(r){case"D":e+="d";break;case"DD":e+="dd";break;case"DDD":e+="o";break;case"d":e+="c";break;case"ddd":e+="ccc";break;case"dddd":e+="cccc";break;case"M":e+="L";break;case"MM":e+="LL";break;case"MMM":e+="LLL";break;case"MMMM":e+="LLLL";break;case"YY":e+="yy";break;case"Y":case"YYYY":e+="yyyy";break;case"Q":e+="q";break;case"Z":e+="ZZ";break;case"ZZ":e+="ZZZ";break;case"S":e+="'S'";break;case"SS":e+="'SS'";break;case"SSS":e+="u";break;case"A":case"a":e+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":e+=r;break;default:r.length>=2&&r.slice(0,1)==="["&&r.slice(-1)==="]"?e+=`'${r.slice(1,-1)}'`:e+=`'${r}'`}return e}function K(t,e,n){switch(n){case">":return t>e;case"<":return t=":return t>=e;case"<=":return t<=e}return!1}function Di(t,e,n){if(t===null){if(e===null||e===A)return K(null,null,n);if(G(e))return K(0,e,n);if(v(e)||z(e))return K(0,p(e),n);if(Q(e))return K(0,e.getTime(),n)}if(t===A){if(e===null||e===A)return K(null,null,n);if(G(e))return K(0,e,n);if(v(e)||z(e))return K(0,p(e),n);if(Q(e))return K(0,e.getTime(),n)}else if(G(t)){if(G(e))return K(t,e,n);if(z(e))return K(t,p(e),n);if(e===null||e===A)return K(t,0,n);if(v(e))return K(t,p(e),n);if(Q(e))return K(t,e.getTime(),n)}else if(v(t)){if(v(e))return K(b(t),b(e),n);if(Q(e))return K(p(t),e.getTime(),n);if(G(e))return K(p(t),e,n);if(e===null||e===A)return K(p(t),0,n);if(z(e))return K(p(t),p(e),n)}else if(Q(t)){if(Q(e))return K(t,e,n);if(e===null||e===A)return K(t.getTime(),0,n);if(G(e))return K(t.getTime(),e,n);if(z(e)||v(e))return K(t.getTime(),p(e),n)}else if(z(t)){if(z(e))return K(t,e,n);if(G(e))return K(p(t),p(e),n);if(Q(e))return K(p(t),e.getTime(),n);if(e===null||e===A)return K(p(t),0,n);if(v(e))return K(p(t),p(e),n)}return!!Be(t,e)&&(n==="<="||n===">=")}function Be(t,e){if(t===e||t===null&&e===A||e===null&&t===A)return!0;if(Q(t)&&Q(e))return t.getTime()===e.getTime();if(t instanceof yn||t instanceof nt)return t.equalityTest(e);if(t instanceof W&&e instanceof W){const n=t.cache._arcadeCacheId,r=e.cache._arcadeCacheId;if(n!=null)return n===r}return t!==void 0&&e!==void 0&&t!==null&&e!==null&&typeof t=="object"&&typeof e=="object"&&(t._arcadeCacheId===e._arcadeCacheId&&t._arcadeCacheId!==void 0&&t._arcadeCacheId!==null||t._underlyingGraphic===e._underlyingGraphic&&t._underlyingGraphic!==void 0&&t._underlyingGraphic!==null)}function b(t,e){if(v(t))return t;if(t===null)return"";if(G(t))return gi(t,e);if(z(t))return t.toString();if(Q(t))return sr(t,e);if(t instanceof N)return JSON.stringify(t.toJSON());if(M(t)){const n=[];for(let r=0;rr.key===i.key?0:r.key==="spatialReference"?1:i.key==="spatialReference"||r.keyi.key?1:0);if(M(t)){const r=[];for(let i=0;i0)return t;return null}if(t instanceof ce){if(t.paths.length===0)return null;for(const e of t.paths)if(e.length>0)return t;return null}return t instanceof Ne?t.points.length===0?null:t:t instanceof we?t.xmin==="NaN"||t.xmin===null||isNaN(t.xmin)?null:t:null}function Ya(t,e){if(!t||!t.domain)return e;let n=null;if(t.field.type==="string"||t.field.type==="esriFieldTypeString")e=b(e);else{if(e==null)return null;if(e==="")return e;e=p(e)}for(let r=0;rs.id===r&&(i=s.domains&&s.domains[a.name],i&&i.type==="inherited"&&(i=hs(a.name,e),u=!0),!0)),u||i||(i=hs(t,e)),{field:a,domain:i}}function hs(t,e){let n;return e.fields.some(r=>(r.name.toLowerCase()===t.toLowerCase()&&(n=r.domain),!!n)),n}function Hr(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});const n=typeof e.cycles=="boolean"&&e.cycles,r=e.cmp&&(i=e.cmp,function(a){return function(s,o){const l={key:s,value:a[s]},d={key:o,value:a[o]};return i(l,d)}});var i;const u=[];return function a(s){if(s&&s.toJSON&&typeof s.toJSON=="function"&&(s=s.toJSON()),s===void 0)return;if(typeof s=="number")return isFinite(s)?""+s:"null";if(typeof s!="object")return JSON.stringify(s);let o,l;if(Array.isArray(s)){for(l="[",o=0;o0&&(u=t[0].spatialReference,n=t[0].hasZ,r=t[0].hasM)}else if(t instanceof nt)i=t._elements,i.length>0&&(n=t._hasZ,r=t._hasM,u=t.get(0).spatialReference);else{if(!L(t))throw new h(null,c.InvalidParameter,null);for(const a of t.toArray())Ut(i,a);i.length>0&&(u=t.get(0).spatialReference,n=t.get(0).hasZ===!0,r=t.get(0).hasM===!0)}return i.length===0?null:(Gs(i,r,n)||(i=i.slice(0).reverse()),new he({rings:[i],spatialReference:u,hasZ:n,hasM:r}))}return t}function fn(t,e){if(M(t)||L(t)){let n=!1,r=!1,i=[],u=e;if(M(t)){for(const a of t)Ut(i,a);i.length>0&&(u=t[0].spatialReference,n=t[0].hasZ===!0,r=t[0].hasM===!0)}else if(t instanceof nt)i=t._elements,i.length>0&&(n=t._hasZ,r=t._hasM,u=t.get(0).spatialReference);else if(L(t)){for(const a of t.toArray())Ut(i,a);i.length>0&&(u=t.get(0).spatialReference,n=t.get(0).hasZ===!0,r=t.get(0).hasM===!0)}return i.length===0?null:new ce({paths:[i],spatialReference:u,hasZ:n,hasM:r})}return t}function Rn(t,e){if(M(t)||L(t)){let n=!1,r=!1,i=[],u=e;if(M(t)){for(const a of t)Ut(i,a);i.length>0&&(u=t[0].spatialReference,n=t[0].hasZ===!0,r=t[0].hasM===!0)}else if(t instanceof nt)i=t._elements,i.length>0&&(n=t._hasZ,r=t._hasM,u=t.get(0).spatialReference);else if(L(t)){for(const a of t.toArray())Ut(i,a);i.length>0&&(u=t.get(0).spatialReference,n=t.get(0).hasZ===!0,r=t.get(0).hasM===!0)}return i.length===0?null:new Ne({points:i,spatialReference:u,hasZ:n,hasM:r})}return t}function oc(t,e=!1){const n=[];if(t===null)return n;if(M(t)===!0){for(let r=0;r{setTimeout(()=>{e(t)},0)})):t}function wi(t,e,n){switch(n){case"&":return t&e;case"|":return t|e;case"^":return t^e;case"<<":return t<>":return t>>e;case">>>":return t>>>e}}function ht(t,e=null){return t==null?null:z(t)||G(t)||v(t)?t:t instanceof N?(e==null?void 0:e.keepGeometryType)===!0?t:t.toJSON():t instanceof me?t.toArray().map(n=>ht(n,e)):t instanceof Array?t.map(n=>ht(n,e)):t instanceof Date?t:t!==null&&typeof t=="object"&&t.castAsJson!==void 0?t.castAsJson(e):null}async function cc(t,e,n,r,i){const u=await xi(t,e,n);i[r]=u}async function xi(t,e=null,n=null){if(t instanceof me&&(t=t.toArray()),t==null)return null;if(ct(t)||t instanceof N||t instanceof Date)return ht(t,n);if(t instanceof Array){const r=[],i=[];for(const u of t)u===null||ct(u)||u instanceof N||u instanceof Date?i.push(ht(u,n)):(i.push(null),r.push(cc(u,e,n,i.length-1,i)));return r.length>0&&await Promise.all(r),i}return t!==null&&typeof t=="object"&&t.castAsJsonAsync!==void 0?t.castAsJsonAsync(e,n):null}function Qa(t,e,n){const r=t.fullSchema();return r===null||!r.fields?null:ar(e,r,t,n)}function Pn(t){const e=t.fullSchema();return e===null?null:e.fields&&e.typeIdField?{subtypeField:e.typeIdField,subtypes:e.types?e.types.map(n=>({name:n.name,code:n.id})):[]}:null}function Xa(t,e,n,r){const i=t.fullSchema();if(i===null||!i.fields)return null;const u=ar(e,i,t,r);if(n===void 0)try{n=t.field(e)}catch{return null}return Ya(u,n)}function eu(t,e,n,r){const i=t.fullSchema();if(i===null||!i.fields)return null;if(n===void 0){try{n=t.field(e)}catch{return null}return n}return Ka(ar(e,i,t,r),n)}function tu(t){const e=t.fullSchema();if(e===null||!e.fields)return null;const n=[];for(const r of e.fields)n.push(uc(r));return{objectIdField:e.objectIdField,globalIdField:e.globalIdField,geometryType:ls[e.geometryType]===void 0?"":ls[e.geometryType],fields:n}}const nu=Object.freeze(Object.defineProperty({__proto__:null,ReturnResultE:ja,ImplicitResultE:Wa,ImplicitResult:Rt,ReturnResult:Ee,voidOperation:A,breakResult:Ue,continueResult:jt,multiReplace:lt,isFunctionParameter:X,isModule:mi,isSimpleType:ct,defaultUndefined:_,getType:pi,isString:v,isBoolean:z,isNumber:G,isInteger:Je,isArray:M,isFeature:ne,isFeatureSet:rr,isFeatureSetCollection:ir,isImmutableArray:L,isDate:Q,pcCheck:y,absRound:Zr,generateUUID:Nt,formatNumber:gi,formatDate:sr,standardiseDateFormat:yi,greaterThanLessThan:Di,equalityTest:Be,toString:b,toNumberArray:gt,toStringExplicit:Ae,toNumber:p,toDate:se,toDateTime:$n,toBoolean:Pt,fixSpatialReference:re,fixNullGeometry:yt,getDomainValue:Ya,getDomainCode:Ka,getDomain:ar,stableStringify:Hr,autoCastFeatureToGeometry:P,autoCastArrayOfPointsToPolygon:jr,autoCastArrayOfPointsToPolyline:fn,autoCastArrayOfPointsToMultiPoint:Rn,toStringArray:oc,tick:lc,binaryOperator:wi,castAsJson:ht,castAsJsonAsync:xi,featureFullDomain:Qa,featureSubtypes:Pn,featureDomainValueLookup:Xa,featureDomainCodeLookup:eu,featureSchema:tu},Symbol.toStringTag,{value:"Module"}));function Zn(t,e=!1){if(t==null)return null;if(G(t))return p(t);if(z(t))return Pt(t);if(v(t))return b(t);if(Q(t))return se(t);if(M(t)){const r=[];for(const i of t)r.push(Zn(i,e));return r}const n=new O;n.immutable=!1;for(const r of Object.keys(t)){const i=t[r];i!==void 0&&n.setField(r,Zn(i,e))}return n.immutable=e,n}class O{constructor(e){this.declaredClass="esri.arcade.Dictionary",this.attributes=null,this.plain=!1,this.immutable=!0,this.attributes=e instanceof O?e.attributes:e!=null?e:{}}field(e){const n=e.toLowerCase(),r=this.attributes[e];if(r!==void 0)return r;for(const i in this.attributes)if(i.toLowerCase()===n)return this.attributes[i];throw new h(null,c.FieldNotFound,null,{key:e})}setField(e,n){if(this.immutable)throw new h(null,c.Immutable,null);if(X(n))throw new h(null,c.NoFunctionInDictionary,null);const r=e.toLowerCase();if(this.attributes[e]===void 0){for(const i in this.attributes)if(i.toLowerCase()===r)return void(this.attributes[i]=n);this.attributes[e]=n}else this.attributes[e]=n}hasField(e){const n=e.toLowerCase();if(this.attributes[e]!==void 0)return!0;for(const r in this.attributes)if(r.toLowerCase()===n)return!0;return!1}keys(){let e=[];for(const n in this.attributes)e.push(n);return e=e.sort(),e}castToText(e=!1){let n="";for(const r in this.attributes){n!==""&&(n+=",");const i=this.attributes[r];i==null?n+=JSON.stringify(r)+":null":z(i)||G(i)||v(i)?n+=JSON.stringify(r)+":"+JSON.stringify(i):i instanceof N?n+=JSON.stringify(r)+":"+Ae(i):i instanceof me||i instanceof Array?n+=JSON.stringify(r)+":"+Ae(i,null,e):i instanceof Date?n+=e?JSON.stringify(r)+":"+JSON.stringify(i.getTime()):JSON.stringify(r)+":"+JSON.stringify(i):i!==null&&typeof i=="object"&&i.castToText!==void 0&&(n+=JSON.stringify(r)+":"+i.castToText(e))}return"{"+n+"}"}static convertObjectToArcadeDictionary(e,n=!0){const r=new O;r.immutable=!1;for(const i in e){const u=e[i];u!==void 0&&r.setField(i.toString(),Zn(u))}return r.immutable=n,r}static convertJsonToArcade(e,n=!1){return Zn(e,n)}castAsJson(e=null){const n={};for(let r in this.attributes){const i=this.attributes[r];i!==void 0&&(e!=null&&e.keyTranslate&&(r=e.keyTranslate(r)),n[r]=ht(i,e))}return n}async castDictionaryValueAsJsonAsync(e,n,r,i=null,u){const a=await xi(r,i,u);return e[n]=a,a}async castAsJsonAsync(e=null,n=null){const r={},i=[];for(let u in this.attributes){const a=this.attributes[u];n!=null&&n.keyTranslate&&(u=n.keyTranslate(u)),a!==void 0&&(ct(a)||a instanceof N||a instanceof Date?r[u]=ht(a,n):i.push(this.castDictionaryValueAsJsonAsync(r,u,a,e,n)))}return i.length>0&&await Promise.all(i),r}}class q{constructor(){this.arcadeDeclaredClass="esri.arcade.Feature",this._optimizedGeomDefinition=null,this._geometry=null,this.attributes=null,this._layer=null,this._datesfixed=!0,this.immutable=!0,this._datefields=null,this.immutable=!0}static createFromGraphic(e){const n=new q;return n._geometry=Ni(e.geometry)?e.geometry:null,e.attributes===void 0||e.attributes===null?n.attributes={}:n.attributes=e.attributes,e._sourceLayer?(n._layer=e._sourceLayer,n._datesfixed=!1):e._layer?(n._layer=e._layer,n._datesfixed=!1):e.layer&&"fields"in e.layer?(n._layer=e.layer,n._datesfixed=!1):e.sourceLayer&&"fields"in e.sourceLayer&&(n._layer=e.sourceLayer,n._datesfixed=!1),n}static createFromArcadeFeature(e){const n=new q;return n._datesfixed=e._datesfixed,n.attributes=e.attributes,n._geometry=e._geometry,n._optimizedGeomDefinition=e._optimizedGeomDefinition,e._layer&&(n._layer=e._layer),n}static createFromOptimisedFeature(e,n,r){const i=new q;return i._geometry=e.geometry?{geometry:e.geometry}:null,i._optimizedGeomDefinition=r,i.attributes=e.attributes||{},i._layer=n,i._datesfixed=!1,i}static createFromArcadeDictionary(e){const n=new q;return n.attributes=e.field("attributes"),n.attributes!==null&&n.attributes instanceof O?(n.attributes=n.attributes.attributes,n.attributes===null&&(n.attributes={})):n.attributes={},n._geometry=e.field("geometry"),n._geometry!==null&&(n._geometry instanceof O?n._geometry=q.parseGeometryFromDictionary(n._geometry):n._geometry instanceof N||(n._geometry=null)),n}static createFromGraphicLikeObject(e,n,r=null){const i=new q;return n===null&&(n={}),i.attributes=n,i._geometry=Ni(e)?e:null,i._layer=r,i._layer&&(i._datesfixed=!1),i}repurposeFromGraphicLikeObject(e,n,r=null){n===null&&(n={}),this.attributes=n,this._geometry=e||null,this._layer=r,this._layer?this._datesfixed=!1:this._datesfixed=!0}castToText(e=!1){let n="";this._datesfixed===!1&&this._fixDates();for(const r in this.attributes){n!==""&&(n+=",");const i=this.attributes[r];i==null?n+=JSON.stringify(r)+":null":z(i)||G(i)||v(i)?n+=JSON.stringify(r)+":"+JSON.stringify(i):i instanceof N?n+=JSON.stringify(r)+":"+Ae(i):i instanceof me||i instanceof Array?n+=JSON.stringify(r)+":"+Ae(i,null,e):i instanceof Date?n+=e?JSON.stringify(r)+":"+JSON.stringify(i.getTime()):JSON.stringify(r)+":"+JSON.stringify(i):i!==null&&typeof i=="object"&&i.castToText!==void 0&&(n+=JSON.stringify(r)+":"+i.castToText(e))}return'{"geometry":'+(this.geometry()===null?"null":Ae(this.geometry()))+',"attributes":{'+n+"}}"}_fixDates(){if(this._datefields!==null)return this._datefields.length>0&&this._fixDateFields(this._datefields),void(this._datesfixed=!0);const e=[],n=this._layer.fields;for(let r=0;r0&&this._fixDateFields(e),this._datesfixed=!0}_fixDateFields(e){this.attributes={...this.attributes};for(let n=0;n!n&&(i.type==="Identifier"&&i.name&&i.name.toLowerCase()===r&&(n=!0),!0)),n}function iu(t){const e=[];return Z(t,n=>(n.type==="ImportDeclaration"&&n.source&&n.source.value&&e.push({libname:n.specifiers[0].local.name.toLowerCase(),source:n.source.value}),!0)),e}function dc(t,e){let n=!1;const r=e.toLowerCase();return Z(t,i=>!n&&(i.type!=="CallExpression"||i.callee.type!=="Identifier"||!i.callee.name||i.callee.name.toLowerCase()!==r||(n=!0,!1))),n}function mc(t){const e=[];return Z(t,n=>{var r;return n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?e.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&e.push(n.object.name.toLowerCase()+"."+((r=n.property.value)==null?void 0:r.toString().toLowerCase())),!1)}),e}function pc(t){const e=[];return Z(t,n=>{var r;if(n.type==="CallExpression"){if(n.callee.type==="Identifier"&&n.callee.name.toLowerCase()==="expects"){let i="";for(let u=0;u<(n.arguments||[]).length;u++)u===0?n.arguments[u].type==="Identifier"&&(i=n.arguments[u].name.toLowerCase()):i&&n.arguments[u].type==="Literal"&&ds(n.arguments[u].value)&&e.push(i+"."+n.arguments[u].value.toLowerCase());return!1}if(n.callee.type==="Identifier"&&["domainname","domaincode","domain","haskey"].includes(n.callee.name.toLowerCase())&&n.arguments.length>=2){let i="";return n.arguments[0].type==="Identifier"&&(i=n.arguments[0].name.toLowerCase()),i&&n.arguments[1].type==="Literal"&&ds(n.arguments[1].value)&&e.push(i+"."+n.arguments[1].value.toLowerCase()),!1}}return n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?e.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&e.push(n.object.name.toLowerCase()+"."+((r=n.property.value)==null?void 0:r.toString().toLowerCase())),!1)}),e}function Jr(t){const e=[];return Z(t,n=>(n.type==="CallExpression"&&n.callee.type==="Identifier"&&e.push(n.callee.name.toLowerCase()),!0)),e}function Sn(t,e=[]){let n=null;if(t.usesFeatureSet===void 0){n===null&&(n=Jr(t)),t.usesFeatureSet=!1;for(let r=0;r0){for(const r of e)if(ru(t,r)){t.usesFeatureSet=!0,t.isAsync=!0;break}}}if(t.usesModules===void 0&&(t.usesModules=!1,iu(t).length>0&&(t.usesModules=!0)),t.usesGeometry===void 0){t.usesGeometry=!1,n===null&&(n=Jr(t));for(let r=0;r0||o.length>0;)if(s.length>0&&o.length>0){let f=l(s[0],o[0]);isNaN(f)&&(f=0),f<=0?(d.push(s[0]),s=s.slice(1)):(d.push(o[0]),o=o.slice(1))}else s.length>0?(d.push(s[0]),s=s.slice(1)):o.length>0&&(d.push(o[0]),o=o.slice(1));return d}async function i(s,o){const l=s.length,d=Math.floor(l/2);if(l===0)return[];if(l===1)return[s[0]];const f=[await i(s.slice(0,d),o),await i(s.slice(d,l),o)];return u(f[0],f[1],o,[])}async function u(s,o,l,d){const f=d;if(!(s.length>0||o.length>0))return d;if(s.length>0&&o.length>0){let m=await l(s[0],o[0]);return isNaN(m)&&(m=1),m<=0?(f.push(s[0]),s=s.slice(1)):(f.push(o[0]),o=o.slice(1)),u(s,o,l,d)}return s.length>0?(f.push(s[0]),u(s=s.slice(1),o,l,d)):o.length>0?(f.push(o[0]),u(s,o=o.slice(1),l,d)):void 0}function a(s,o,l,d){y(l,1,2,s,o);let f=l[0];if(L(f)&&(f=f.toArray()),M(f)===!1)throw new h(s,c.InvalidParameter,o);if(l.length>1){if(X(l[1])===!1)throw new h(s,c.InvalidParameter,o);let F=f;const U=l[1].createFunction(s);return d?i(F,U):(F=n(F,(pe,ft)=>U(pe,ft)),F)}let m=f;if(m.length===0)return[];const g={};for(let F=0;F1||k==="String"?n(m,(F,U)=>{if(F==null||F===A)return U==null||U===A?0:1;if(U==null||U===A)return-1;const pe=b(F),ft=b(U);return peF-U):k==="Boolean"?n(m,(F,U)=>F===U?0:U?-1:1):k==="Date"?n(m,(F,U)=>U-F):m.slice(0),m}t.functions.array=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{y(f,1,2,s,o);const m=p(f[0]);if(isNaN(m)||Je(m)===!1)throw new h(s,c.InvalidParameter,o);const g=_(f[1],null),D=new Array(m);return D.fill(g),D})},t.functions.front=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{if(y(f,1,1,s,o),L(f[0])){if(f[0].length()<=0)throw new h(s,c.OutOfBounds,o);return f[0].get(0)}if(M(f[0])){if(f[0].length<=0)throw new h(s,c.OutOfBounds,o);return f[0][0]}throw new h(s,c.InvalidParameter,o)})},t.functions.back=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{if(y(f,1,1,s,o),L(f[0])){if(f[0].length()<=0)throw new h(s,c.OutOfBounds,o);return f[0].get(f[0].length()-1)}if(M(f[0])){if(f[0].length<=0)throw new h(s,c.OutOfBounds,o);return f[0][f[0].length-1]}throw new h(s,c.InvalidParameter,o)})},t.functions.push=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{if(y(f,1,2,s,o),M(f[0]))return f[0][f[0].length]=f[1],f[0].length;throw new h(s,c.InvalidParameter,o)})},t.functions.pop=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{if(y(f,1,1,s,o),M(f[0])){if(f[0].length<=0)throw new h(s,c.OutOfBounds,o);const m=f[0][f[0].length-1];return f[0].length=f[0].length-1,m}throw new h(s,c.InvalidParameter,o)})},t.functions.erase=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{if(y(f,2,2,s,o),M(f[0])){let m=p(f[1]);if(isNaN(m)||Je(m)===!1)throw new h(s,c.InvalidParameter,o);const g=f[0];if(g.length<=0)throw new h(s,c.OutOfBounds,o);if(m<0&&(m=g.length+m),m<0)throw new h(s,c.OutOfBounds,o);if(m>=g.length)throw new h(s,c.OutOfBounds,o);return g.splice(m,1),A}throw new h(s,c.InvalidParameter,o)})},t.functions.insert=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{if(y(f,3,3,s,o),M(f[0])){const m=p(f[1]);if(isNaN(m)||Je(m)===!1)throw new h(s,c.InvalidParameter,o);const g=f[2],D=f[0];if(m>D.length)throw new h(s,c.OutOfBounds,o);if(m<0&&m<-1*D.length)throw new h(s,c.OutOfBounds,o);return m===D.length?(D[m]=g,A):(D.splice(m,0,g),A)}throw new h(s,c.InvalidParameter,o)})},t.functions.resize=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{if(y(f,2,3,s,o),M(f[0])){const m=p(f[1]);if(isNaN(m)||Je(m)===!1)throw new h(s,c.InvalidParameter,o);if(m<0)throw new h(s,c.InvalidParameter,o);const g=_(f[2],null),D=f[0];if(D.length>=m)return D.length=m,A;const k=D.length;D.length=m;for(let F=k;F{if(y(f,2,2,s,o),M(f[0])){const m=f[1];return f[0].findIndex(g=>Be(g,m))>-1}if(L(f[0])){const m=f[1];return f[0].toArray().findIndex(g=>Be(g,m))>-1}throw new h(s,c.InvalidParameter,o)})},t.functions.slice=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{if(y(f,1,3,s,o),M(f[0])){const m=p(_(f[1],0)),g=p(_(f[2],f[0].length));if(isNaN(m)||Je(m)===!1)throw new h(s,c.InvalidParameter,o);if(isNaN(g)||Je(g)===!1)throw new h(s,c.InvalidParameter,o);return f[0].slice(m,g)}if(L(f[0])){const m=f[0],g=p(_(f[1],0)),D=p(_(f[2],m.length()));if(isNaN(g)||Je(g)===!1)throw new h(s,c.InvalidParameter,o);if(isNaN(D)||Je(D)===!1)throw new h(s,c.InvalidParameter,o);return m.toArray().slice(g,D)}throw new h(s,c.InvalidParameter,o)})},t.functions.splice=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{const m=[];for(let g=0;g{if(y(f,2,2,s,o),M(f[0]))return p(f[1])>=f[0].length?f[0].slice(0):f[0].slice(0,p(f[1]));if(L(f[0]))return p(f[1])>=f[0].length()?f[0].slice(0):f[0].slice(0,p(f[1]));throw new h(s,c.InvalidParameter,o)})},t.functions.first=function(s,o){return t.standardFunction(s,o,(l,d,f)=>(y(f,1,1,s,o),M(f[0])?f[0].length===0?null:f[0][0]:L(f[0])?f[0].length()===0?null:f[0].get(0):null))},t.mode==="sync"&&(t.functions.sort=function(s,o){return t.standardFunction(s,o,(l,d,f)=>a(s,o,f,!1))},t.functions.any=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o);for(const D of g){const k=m(D);if(z(k)&&k===!0)return!0}return!1})},t.functions.all=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o);for(const D of g)if(m(D)!==!0)return!1;return!0})},t.functions.none=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o);for(const D of g)if(m(D)===!0)return!1;return!0})},t.functions.reduce=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{y(f,2,3,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o);return f.length===2?g.length===0?null:g.reduce((D,k)=>{const F=m(D,k);return D=F!==void 0&&F!==A?F:null}):g.reduce((D,k)=>{const F=m(D,k);return D=F!==void 0&&F!==A?F:null},f[2])})},t.functions.map=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o),D=[];for(const k of g){const F=m(k);F!==void 0&&F!==A?D.push(F):D.push(null)}return D})},t.functions.filter=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o),D=[];for(const k of g)m(k)===!0&&D.push(k);return D})}),t.mode==="async"&&(t.functions.sort=function(s,o){return t.standardFunctionAsync(s,o,(l,d,f)=>a(s,o,f,!0))},t.functions.any=function(s,o){return t.standardFunctionAsync(s,o,async(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o);for(const D of g){const k=await m(D);let F=null;if(F=at(F)?await k:k,z(F)&&F===!0)return!0}return!1})},t.functions.all=function(s,o){return t.standardFunctionAsync(s,o,async(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o);for(const D of g){const k=await m(D);let F=null;if(F=at(F)?await k:k,F!==!0)return!1}return!0})},t.functions.none=function(s,o){return t.standardFunctionAsync(s,o,async(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o);for(const D of g){const k=await m(D);let F=null;if(F=at(F)?await k:k,F===!0)return!1}return!0})},t.functions.filter=function(s,o){return t.standardFunctionAsync(s,o,async(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o),D=[];for(const k of g){const F=await m(k);let U=null;U=at(U)?await F:F,U===!0&&D.push(k)}return D})},t.functions.reduce=function(s,o){return t.standardFunctionAsync(s,o,(l,d,f)=>{y(f,2,3,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o);let D=null;if(f.length>2){const k=_(f[2],null);D=g.reduce(async(F,U)=>{let pe=await F;return pe!==void 0&&pe!==A||(pe=null),m(pe,U)},Promise.resolve(k))}else{if(g.length===0)return null;D=g.reduce(async(k,F,U)=>{if(U<=1)return m(k,F);let pe=await k;return pe!==void 0&&pe!==A||(pe=null),m(pe,F)})}return D.then(k=>k!==void 0&&k!==A?k:null)})},t.functions.map=function(s,o){return t.standardFunctionAsync(s,o,async(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o),D=[];for(const k of g){const F=await m(k);let U=null;U=at(U)?await F:F,U!==void 0&&U!==A?D.push(U):D.push(null)}return D})})}const Yr=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:gc},Symbol.toStringTag,{value:"Module"}));function su(t){const e=new Date(t.getTime()),n=e.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Hn(r),u=new Date(0);u.setFullYear(n,0,4),u.setHours(0,0,0,0);const a=Hn(u);return e.getTime()>=i.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function Hn(t){const n=new Date(t.getTime()),r=n.getDay(),i=(r<1?7:0)+r-1;return n.setDate(n.getDate()-i),n.setHours(0,0,0,0),n}function yc(t){const e=su(t),n=new Date(0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Hn(n)}function Dc(t,e,n){return t+(wc(n)?Fc:xc)[e]}function wc(t){return t%4==0&&(t%100!=0||t%400==0)}const xc=[0,31,59,90,120,151,181,212,243,273,304,334],Fc=[0,31,60,91,121,152,182,213,244,274,305,335];function vt(t){return t===null?t:isNaN(t.getTime())?null:t}function au(t,e){t.today=function(n,r){return e(n,r,(i,u,a)=>{y(a,0,0,n,r);const s=new Date;return s.setHours(0,0,0,0),s})},t.now=function(n,r){return e(n,r,(i,u,a)=>(y(a,0,0,n,r),new Date))},t.timestamp=function(n,r){return e(n,r,(i,u,a)=>{y(a,0,0,n,r);let s=new Date;return s=new Date(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate(),s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),s})},t.toutc=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?null:new Date(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate(),s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds())})},t.tolocal=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?null:B.utc(s.getFullYear(),s.getMonth()+1,s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()).toJSDate()})},t.day=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:s.getDate()})},t.month=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:s.getMonth()})},t.year=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:s.getFullYear()})},t.hour=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:s.getHours()})},t.second=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:s.getSeconds()})},t.millisecond=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:s.getMilliseconds()})},t.minute=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:s.getMinutes()})},t.week=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,2,n,r);const s=se(a[0]);if(s===null)return NaN;const o=p(_(a[1],0));if(o<0||o>6)throw new h(n,c.InvalidParameter,r);const l=s.getDate(),d=s.getMonth(),f=s.getFullYear(),m=s.getDay(),g=Dc(l,d,f)-1,D=Math.floor(g/7);return m-o+(m-o<0?7:0){y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:s.getDay()})},t.isoweekday=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);if(s===null)return NaN;let o=s.getDay();return o===0&&(o=7),o})},t.isomonth=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:s.getMonth()+1})},t.isoweek=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);if(s===null)return NaN;const o=Hn(s).getTime()-yc(s).getTime();return Math.round(o/6048e5)+1})},t.isoyear=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:su(s)})},t.date=function(n,r){return e(n,r,(i,u,a)=>{if(y(a,0,7,n,r),a.length===3)return vt(new Date(p(a[0]),p(a[1]),p(a[2]),0,0,0,0));if(a.length===4)return vt(new Date(p(a[0]),p(a[1]),p(a[2]),p(a[3]),0,0,0));if(a.length===5)return vt(new Date(p(a[0]),p(a[1]),p(a[2]),p(a[3]),p(a[4]),0,0));if(a.length===6)return vt(new Date(p(a[0]),p(a[1]),p(a[2]),p(a[3]),p(a[4]),p(a[5]),0));if(a.length===7)return vt(new Date(p(a[0]),p(a[1]),p(a[2]),p(a[3]),p(a[4]),p(a[5]),p(a[6])));if(a.length===2){let s,o=b(a[1]);return o===""?null:(o=yi(o),s=o==="X"?B.fromSeconds(p(a[0])):o==="x"?B.fromMillis(p(a[0])):B.fromFormat(b(a[0]),o,{locale:zs(),numberingSystem:"latn"}),s.isValid?s.toJSDate():null)}if(a.length===1){if(v(a[0])){if(a[0].replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(a[0])===!0)return se(a[0]+"-01-01")}const s=p(a[0]);return isNaN(s)===!1?vt(new Date(s)):se(a[0])}return a.length===0?new Date:void 0})},t.datediff=function(n,r){return e(n,r,(i,u,a)=>{y(a,2,3,n,r);const s=$n(a[0]),o=$n(a[1]);if(s===null||o===null)return NaN;switch(b(a[2]).toLowerCase()){case"days":case"day":case"d":return s.diff(o,"days").days;case"months":case"month":return s.diff(o,"months").months;case"minutes":case"minute":case"m":return a[2]==="M"?s.diff(o,"months").months:s.diff(o,"minutes").minutes;case"seconds":case"second":case"s":return s.diff(o,"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return s.diff(o).milliseconds;case"hours":case"hour":case"h":return s.diff(o,"hours").hours;case"years":case"year":case"y":return s.diff(o,"years").years}})},t.dateadd=function(n,r){return e(n,r,(i,u,a)=>{y(a,2,3,n,r);const s=$n(a[0]);if(s===null)return null;let o=p(a[1]);if(isNaN(o))return s.toJSDate();let l="milliseconds";switch(b(a[2]).toLowerCase()){case"days":case"day":case"d":l="days",o=Zr(o);break;case"months":case"month":l="months",o=Zr(o);break;case"minutes":case"minute":case"m":l=a[2]==="M"?"months":"minutes";break;case"seconds":case"second":case"s":l="seconds";break;case"milliseconds":case"millisecond":case"ms":l="milliseconds";break;case"hours":case"hour":case"h":l="hours";break;case"years":case"year":case"y":l="years"}return s.plus({[l]:o}).toJSDate()})}}function Xt(t,e,n){return Math.sqrt((t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]!==void 0&&e[2]!==void 0?(t[2]*n-e[2]*n)**2:0))}const rn=[];for(const t of[[9002,56146130,6131,6132,8050,8051,8228],[9003,5702,6358,6359,6360,8052,8053],[9095,5754]]){const e=t[0];for(let n=1;n0?(r.x/=i,r.y/=i,e&&(r.z/=i),n&&(r.m/=i)):(r.x=t[0][0],r.y=t[0][1],e&&(r.z=t[0][2]),n&&e?r.m=t[0][3]:n&&(r.m=t[0][2])),r}function Ec(t,e,n,r){const i={x:(t[0]+e[0])/2,y:(t[1]+e[1])/2};return n&&(i.z=(t[2]+e[2])/2),n&&r?i.m=(t[3]+e[3])/2:r&&(i.m=(t[2]+e[2])/2),i}function Ac(t,e){if(t.length<=1)return 0;let n=0;for(let r=1;r0?(n.x/=i,n.y/=i,t.hasZ===!0&&(n.z/=i),t.hasM===!0&&(n.m/=i),new W(n)):r>0?(e.x/=r,e.y/=r,t.hasZ===!0&&(n.z/=r),t.hasM===!0&&(e.m/=r),new W(e)):null}function bc(t){if(t.points.length===0)return null;let e=0,n=0,r=0,i=0;for(let a=0;a=r;)t-=e;return t}function ou(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}function Tc(t,e){return lr(ou(t,e),2*Math.PI)*(180/Math.PI)}function Mc(t,e){return lr(Math.PI/2-ou(t,e),2*Math.PI)*(180/Math.PI)}function lu(t,e,n){const r={x:t.x-e.x,y:t.y-e.y},i={x:n.x-e.x,y:n.y-e.y};return Math.atan2(kc(r,i),Ic(r,i))}function Nc(t,e,n){return lr(lu(t,e,n),2*Math.PI)*(180/Math.PI)}function Oc(t,e,n){return lr(-1*lu(t,e,n),2*Math.PI)*(180/Math.PI)}dn[9002]=.3048,dn[9003]=.3048006096012192,dn[9095]=.3048007491;const oe=[0,0];function ps(t){for(let e=0;e{y(a,1,1,n,r);let s=[],o=!1,l=!1;if(a[0]===null)return!1;if(M(a[0])){for(const d of a[0]){if(!(d instanceof W))throw new h(n,c.InvalidParameter,r);s.push(d.hasZ?d.hasM?[d.x,d.y,d.z,d.m]:[d.x,d.y,d.z]:[d.x,d.y])}s.length>0&&(o=a[0][0].hasZ,l=a[0][0].hasM)}else if(a[0]instanceof nt)s=a[0]._elements,s.length>0&&(o=a[0]._hasZ,l=a[0]._hasM);else{if(!L(a[0]))throw new h(n,c.InvalidParameter,r);for(const d of a[0].toArray()){if(!(d instanceof W))throw new h(n,c.InvalidParameter,r);s.push(d.hasZ?d.hasM?[d.x,d.y,d.z,d.m]:[d.x,d.y,d.z]:[d.x,d.y])}s.length>0&&(o=a[0].get(0).hasZ,l=a[0].get(0).hasM)}return!(s.length<3)&&Gs(s,l,o)})},t.polygon=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);let s=null;if(a[0]instanceof O){if(s=re(q.parseGeometryFromDictionary(a[0]),n.spatialReference),!(s instanceof he))throw new h(n,c.InvalidParameter,r)}else s=a[0]instanceof he?Ce(a[0].toJSON()):re(new he(JSON.parse(a[0])),n.spatialReference);if(s!==null&&s.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return yt(s)})},t.polyline=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);let s=null;if(a[0]instanceof O){if(s=re(q.parseGeometryFromDictionary(a[0]),n.spatialReference),!(s instanceof ce))throw new h(n,c.InvalidParameter,r)}else s=a[0]instanceof ce?Ce(a[0].toJSON()):re(new ce(JSON.parse(a[0])),n.spatialReference);if(s!==null&&s.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return yt(s)})},t.point=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);let s=null;if(a[0]instanceof O){if(s=re(q.parseGeometryFromDictionary(a[0]),n.spatialReference),!(s instanceof W))throw new h(n,c.InvalidParameter,r)}else s=a[0]instanceof W?Ce(a[0].toJSON()):re(new W(JSON.parse(a[0])),n.spatialReference);if(s!==null&&s.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return yt(s)})},t.multipoint=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);let s=null;if(a[0]instanceof O){if(s=re(q.parseGeometryFromDictionary(a[0]),n.spatialReference),!(s instanceof Ne))throw new h(n,c.InvalidParameter,r)}else s=a[0]instanceof Ne?Ce(a[0].toJSON()):re(new Ne(JSON.parse(a[0])),n.spatialReference);if(s!==null&&s.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return yt(s)})},t.extent=function(n,r){return e(n,r,(i,u,a)=>{var o;a=P(a),y(a,1,1,n,r);let s=null;if(a[0]instanceof O)s=re(q.parseGeometryFromDictionary(a[0]),n.spatialReference);else if(a[0]instanceof W){const l={xmin:a[0].x,ymin:a[0].y,xmax:a[0].x,ymax:a[0].y,spatialReference:a[0].spatialReference.toJSON()},d=a[0];d.hasZ?(l.zmin=d.z,l.zmax=d.z):d.hasM&&(l.mmin=d.m,l.mmax=d.m),s=Ce(l)}else s=a[0]instanceof he||a[0]instanceof ce||a[0]instanceof Ne?Ce((o=a[0].extent)==null?void 0:o.toJSON()):a[0]instanceof we?Ce(a[0].toJSON()):re(new we(JSON.parse(a[0])),n.spatialReference);if(s!==null&&s.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return yt(s)})},t.geometry=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);let s=null;if(a[0]===null)return null;if(s=Nn(a[0])?re(a[0].geometry(),n.spatialReference):a[0]instanceof O?re(q.parseGeometryFromDictionary(a[0]),n.spatialReference):re(Ce(JSON.parse(a[0])),n.spatialReference),s!==null&&s.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return yt(s)})},t.setgeometry=function(n,r){return e(n,r,(i,u,a)=>{if(y(a,2,2,n,r),!Nn(a[0]))throw new h(n,c.InvalidParameter,r);if(a[0].immutable===!0)throw new h(n,c.Immutable,r);if(!(a[1]instanceof N||a[1]===null))throw new h(n,c.InvalidParameter,r);return a[0]._geometry=a[1],A})},t.feature=function(n,r){return e(n,r,(i,u,a)=>{if(a.length===0)throw new h(n,c.WrongNumberOfParameters,r);let s=null;if(a.length===1)if(v(a[0]))s=q.fromJson(JSON.parse(a[0]));else if(Nn(a[0]))s=q.createFromArcadeFeature(a[0]);else if(a[0]instanceof N)s=q.createFromGraphicLikeObject(a[0],null,null);else{if(!(a[0]instanceof O))throw new h(n,c.InvalidParameter,r);{let o=a[0].hasField("geometry")?a[0].field("geometry"):null,l=a[0].hasField("attributes")?a[0].field("attributes"):null;o!==null&&o instanceof O&&(o=q.parseGeometryFromDictionary(o)),l!==null&&(l=q.parseAttributesFromDictionary(l)),s=q.createFromGraphicLikeObject(o,l,null)}}else if(a.length===2){let o=null,l=null;if(a[0]!==null)if(a[0]instanceof N)o=a[0];else{if(!(o instanceof O))throw new h(n,c.InvalidParameter,r);o=q.parseGeometryFromDictionary(a[0])}if(a[1]!==null){if(!(a[1]instanceof O))throw new h(n,c.InvalidParameter,r);l=q.parseAttributesFromDictionary(a[1])}s=q.createFromGraphicLikeObject(o,l,null)}else{let o=null;const l={};if(a[0]!==null)if(a[0]instanceof N)o=a[0];else{if(!(o instanceof O))throw new h(n,c.InvalidParameter,r);o=q.parseGeometryFromDictionary(a[0])}for(let d=1;d{if(a.length===0){const l=new O;return l.immutable=!1,l}if(a.length===1&&v(a[0]))try{const l=JSON.parse(a[0]),d=O.convertObjectToArcadeDictionary(l,!1);return d.immutable=!1,d}catch{throw new h(n,c.InvalidParameter,r)}if(a.length%2!=0)throw new h(n,c.WrongNumberOfParameters,r);const s={};for(let l=0;l{y(a,2,2,n,r);const s=b(a[1]);if(Nn(a[0])||a[0]instanceof O)return a[0].hasField(s);if(a[0]instanceof N){const o=Dn(a[0],s,null,null,2);return!o||o.keystate!=="notfound"}throw new h(n,c.InvalidParameter,r)})},t.hasvalue=function(n,r){return e(n,r,(i,u,a)=>{if(y(a,2,2,n,r),a[0]===null||a[1]===null)return!1;const s=b(a[1]);return ne(a[0])||a[0]instanceof O?!!a[0].hasField(s)&&a[0].field(s)!==null:a[0]instanceof N?Dn(a[0],s,null,null,0)!==null:!1})},t.indexof=function(n,r){return e(n,r,(i,u,a)=>{y(a,2,2,n,r);const s=a[1];if(M(a[0])){for(let o=0;o{if(a=P(a),y(a,2,3,n,r),!(a[0]instanceof W))throw new h(n,c.InvalidParameter,r);if(!(a[1]instanceof W))throw new h(n,c.InvalidParameter,r);if(a.length>2&&!(a[2]instanceof W))throw new h(n,c.InvalidParameter,r);return a.length===2?Tc(a[0],a[1]):Nc(a[0],a[1],a[2])})},t.bearing=function(n,r){return e(n,r,(i,u,a)=>{if(a=P(a),y(a,2,3,n,r),!(a[0]instanceof W))throw new h(n,c.InvalidParameter,r);if(!(a[1]instanceof W))throw new h(n,c.InvalidParameter,r);if(a.length>2&&!(a[2]instanceof W))throw new h(n,c.InvalidParameter,r);return a.length===2?Mc(a[0],a[1]):Oc(a[0],a[1],a[2])})},t.isselfintersecting=function(n,r){return e(n,r,(i,u,a)=>{a=P(a),y(a,1,1,n,r);let s=a[0];if(s instanceof he)return s.isSelfIntersecting;if(s instanceof ce)return s=s.paths,ps(s);if(s instanceof Ne){const o=s.points;for(let l=0;l(s=P(s),n(r,i,s),s[0]===null||s[1]===null||$.disjoint(s[0],s[1])))},t.intersects=function(r,i){return e(r,i,(u,a,s)=>(s=P(s),n(r,i,s),s[0]!==null&&s[1]!==null&&$.intersects(s[0],s[1])))},t.touches=function(r,i){return e(r,i,(u,a,s)=>(s=P(s),n(r,i,s),s[0]!==null&&s[1]!==null&&$.touches(s[0],s[1])))},t.crosses=function(r,i){return e(r,i,(u,a,s)=>(s=P(s),n(r,i,s),s[0]!==null&&s[1]!==null&&$.crosses(s[0],s[1])))},t.within=function(r,i){return e(r,i,(u,a,s)=>(s=P(s),n(r,i,s),s[0]!==null&&s[1]!==null&&$.within(s[0],s[1])))},t.contains=function(r,i){return e(r,i,(u,a,s)=>(s=P(s),n(r,i,s),s[0]!==null&&s[1]!==null&&$.contains(s[0],s[1])))},t.overlaps=function(r,i){return e(r,i,(u,a,s)=>(s=P(s),n(r,i,s),s[0]!==null&&s[1]!==null&&$.overlaps(s[0],s[1])))},t.equals=function(r,i){return e(r,i,(u,a,s)=>(y(s,2,2,r,i),s[0]===s[1]||(s[0]instanceof N&&s[1]instanceof N?$.equals(s[0],s[1]):!(!Q(s[0])||!Q(s[1]))&&s[0].getTime()===s[1].getTime())))},t.relate=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,3,3,r,i),s[0]instanceof N&&s[1]instanceof N)return $.relate(s[0],s[1],b(s[2]));if(s[0]instanceof N&&s[1]===null||s[1]instanceof N&&s[0]===null||s[0]===null&&s[1]===null)return!1;throw new h(r,c.InvalidParameter,i)})},t.intersection=function(r,i){return e(r,i,(u,a,s)=>(s=P(s),n(r,i,s),s[0]===null||s[1]===null?null:$.intersect(s[0],s[1])))},t.union=function(r,i){return e(r,i,(u,a,s)=>{const o=[];if((s=P(s)).length===0)throw new h(r,c.WrongNumberOfParameters,i);if(s.length===1)if(M(s[0])){const l=P(s[0]);for(let d=0;d(s=P(s),n(r,i,s),s[0]!==null&&s[1]===null?$e(s[0]):s[0]===null?null:$.difference(s[0],s[1])))},t.symmetricdifference=function(r,i){return e(r,i,(u,a,s)=>(s=P(s),n(r,i,s),s[0]===null&&s[1]===null?null:s[0]===null?$e(s[1]):s[1]===null?$e(s[0]):$.symmetricDifference(s[0],s[1])))},t.clip=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,2,2,r,i),!(s[1]instanceof we)&&s[1]!==null)throw new h(r,c.InvalidParameter,i);if(s[0]===null)return null;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return s[1]===null?null:$.clip(s[0],s[1])})},t.cut=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,2,2,r,i),!(s[1]instanceof ce)&&s[1]!==null)throw new h(r,c.InvalidParameter,i);if(s[0]===null)return[];if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return s[1]===null?[$e(s[0])]:$.cut(s[0],s[1])})},t.area=function(r,i){return e(r,i,(u,a,s)=>{if(y(s,1,2,r,i),(s=P(s))[0]===null)return 0;if(M(s[0])||L(s[0])){const o=jr(s[0],r.spatialReference);return o===null?0:$.planarArea(o,On(_(s[1],-1)))}if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return $.planarArea(s[0],On(_(s[1],-1)))})},t.areageodetic=function(r,i){return e(r,i,(u,a,s)=>{if(y(s,1,2,r,i),(s=P(s))[0]===null)return 0;if(M(s[0])||L(s[0])){const o=jr(s[0],r.spatialReference);return o===null?0:$.geodesicArea(o,On(_(s[1],-1)))}if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return $.geodesicArea(s[0],On(_(s[1],-1)))})},t.length=function(r,i){return e(r,i,(u,a,s)=>{if(y(s,1,2,r,i),(s=P(s))[0]===null)return 0;if(M(s[0])||L(s[0])){const o=fn(s[0],r.spatialReference);return o===null?0:$.planarLength(o,le(_(s[1],-1)))}if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return $.planarLength(s[0],le(_(s[1],-1)))})},t.length3d=function(r,i){return e(r,i,(u,a,s)=>{if(y(s,1,2,r,i),(s=P(s))[0]===null)return 0;if(M(s[0])||L(s[0])){const o=fn(s[0],r.spatialReference);return o===null?0:o.hasZ===!0?ys(o,le(_(s[1],-1))):$.planarLength(o,le(_(s[1],-1)))}if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return s[0].hasZ===!0?ys(s[0],le(_(s[1],-1))):$.planarLength(s[0],le(_(s[1],-1)))})},t.lengthgeodetic=function(r,i){return e(r,i,(u,a,s)=>{if(y(s,1,2,r,i),(s=P(s))[0]===null)return 0;if(M(s[0])||L(s[0])){const o=fn(s[0],r.spatialReference);return o===null?0:$.geodesicLength(o,le(_(s[1],-1)))}if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return $.geodesicLength(s[0],le(_(s[1],-1)))})},t.distance=function(r,i){return e(r,i,(u,a,s)=>{s=P(s),y(s,2,3,r,i);let o=s[0];(M(s[0])||L(s[0]))&&(o=Rn(s[0],r.spatialReference));let l=s[1];if((M(s[1])||L(s[1]))&&(l=Rn(s[1],r.spatialReference)),!(o instanceof N))throw new h(r,c.InvalidParameter,i);if(!(l instanceof N))throw new h(r,c.InvalidParameter,i);return $.distance(o,l,le(_(s[2],-1)))})},t.distancegeodetic=function(r,i){return e(r,i,(u,a,s)=>{s=P(s),y(s,2,3,r,i);const o=s[0],l=s[1];if(!(o instanceof W))throw new h(r,c.InvalidParameter,i);if(!(l instanceof W))throw new h(r,c.InvalidParameter,i);const d=new ce({paths:[],spatialReference:o.spatialReference});return d.addPath([o,l]),$.geodesicLength(d,le(_(s[2],-1)))})},t.densify=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,2,3,r,i),s[0]===null)return null;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);const o=p(s[1]);if(isNaN(o))throw new h(r,c.InvalidParameter,i);if(o<=0)throw new h(r,c.InvalidParameter,i);return s[0]instanceof he||s[0]instanceof ce?$.densify(s[0],o,le(_(s[2],-1))):s[0]instanceof we?$.densify(gs(s[0]),o,le(_(s[2],-1))):s[0]})},t.densifygeodetic=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,2,3,r,i),s[0]===null)return null;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);const o=p(s[1]);if(isNaN(o))throw new h(r,c.InvalidParameter,i);if(o<=0)throw new h(r,c.InvalidParameter,i);return s[0]instanceof he||s[0]instanceof ce?$.geodesicDensify(s[0],o,le(_(s[2],-1))):s[0]instanceof we?$.geodesicDensify(gs(s[0]),o,le(_(s[2],-1))):s[0]})},t.generalize=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,2,4,r,i),s[0]===null)return null;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);const o=p(s[1]);if(isNaN(o))throw new h(r,c.InvalidParameter,i);return $.generalize(s[0],o,Pt(_(s[2],!0)),le(_(s[3],-1)))})},t.buffer=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,2,3,r,i),s[0]===null)return null;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);const o=p(s[1]);if(isNaN(o))throw new h(r,c.InvalidParameter,i);return o===0?$e(s[0]):$.buffer(s[0],o,le(_(s[2],-1)))})},t.buffergeodetic=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,2,3,r,i),s[0]===null)return null;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);const o=p(s[1]);if(isNaN(o))throw new h(r,c.InvalidParameter,i);return o===0?$e(s[0]):$.geodesicBuffer(s[0],o,le(_(s[2],-1)))})},t.offset=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,2,6,r,i),s[0]===null)return null;if(!(s[0]instanceof he||s[0]instanceof ce))throw new h(r,c.InvalidParameter,i);const o=p(s[1]);if(isNaN(o))throw new h(r,c.InvalidParameter,i);const l=p(_(s[4],10));if(isNaN(l))throw new h(r,c.InvalidParameter,i);const d=p(_(s[5],0));if(isNaN(d))throw new h(r,c.InvalidParameter,i);return $.offset(s[0],o,le(_(s[2],-1)),b(_(s[3],"round")).toLowerCase(),l,d)})},t.rotate=function(r,i){return e(r,i,(u,a,s)=>{s=P(s),y(s,2,3,r,i);let o=s[0];if(o===null)return null;if(!(o instanceof N))throw new h(r,c.InvalidParameter,i);o instanceof we&&(o=he.fromExtent(o));const l=p(s[1]);if(isNaN(l))throw new h(r,c.InvalidParameter,i);const d=_(s[2],null);if(d===null)return $.rotate(o,l);if(d instanceof W)return $.rotate(o,l,d);throw new h(r,c.InvalidParameter,i)})},t.centroid=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,1,1,r,i),s[0]===null)return null;let o=s[0];if((M(s[0])||L(s[0]))&&(o=Rn(s[0],r.spatialReference)),o===null)return null;if(!(o instanceof N))throw new h(r,c.InvalidParameter,i);return o instanceof W?re($e(s[0]),r.spatialReference):o instanceof he?o.centroid:o instanceof ce?vc(o):o instanceof Ne?bc(o):o instanceof we?o.center:null})},t.multiparttosinglepart=function(r,i){return e(r,i,(u,a,s)=>{s=P(s),y(s,1,1,r,i);const o=[];if(s[0]===null)return null;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);if(s[0]instanceof W)return[re($e(s[0]),r.spatialReference)];if(s[0]instanceof we)return[re($e(s[0]),r.spatialReference)];const l=$.simplify(s[0]);if(l instanceof he){const d=[],f=[];for(let m=0;m{if(s=P(s),y(s,1,1,r,i),s[0]===null)return!0;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return $.isSimple(s[0])})},t.simplify=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,1,1,r,i),s[0]===null)return null;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return $.simplify(s[0])})},t.convexhull=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,1,1,r,i),s[0]===null)return null;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return $.convexHull(s[0])})}}var _c=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:Fi,setGeometryEngine:Bc},Symbol.toStringTag,{value:"Module"}));function Ar(t,e,n){return n===void 0||+n==0?Math[t](e):(e=+e,n=+n,isNaN(e)||typeof n!="number"||n%1!=0?NaN:(e=e.toString().split("e"),+((e=(e=Math[t](+(e[0]+"e"+(e[1]?+e[1]-n:-n)))).toString().split("e"))[0]+"e"+(e[1]?+e[1]+n:n))))}function hu(t,e){function n(r,i,u){const a=p(r);return isNaN(a)?a:isNaN(i)||isNaN(u)||i>u?NaN:au?u:a}t.number=function(r,i){return e(r,i,(u,a,s)=>{y(s,1,2,r,i);const o=s[0];if(G(o))return o;if(o===null)return 0;if(Q(o)||z(o))return Number(o);if(M(o))return NaN;if(o===""||o===void 0)return Number(o);if(v(o)){if(s[1]!==void 0){let l=lt(s[1],"\u2030","");return l=lt(l,"\xA4",""),Hs(o,{pattern:l})}return Number(o.trim())}return Number(o)})},t.abs=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.abs(p(s[0]))))},t.acos=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.acos(p(s[0]))))},t.asin=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.asin(p(s[0]))))},t.atan=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.atan(p(s[0]))))},t.atan2=function(r,i){return e(r,i,(u,a,s)=>(y(s,2,2,r,i),Math.atan2(p(s[0]),p(s[1]))))},t.ceil=function(r,i){return e(r,i,(u,a,s)=>{if(y(s,1,2,r,i),s.length===2){let o=p(s[1]);return isNaN(o)&&(o=0),Ar("ceil",p(s[0]),-1*o)}return Math.ceil(p(s[0]))})},t.round=function(r,i){return e(r,i,(u,a,s)=>{if(y(s,1,2,r,i),s.length===2){let o=p(s[1]);return isNaN(o)&&(o=0),Ar("round",p(s[0]),-1*o)}return Math.round(p(s[0]))})},t.floor=function(r,i){return e(r,i,(u,a,s)=>{if(y(s,1,2,r,i),s.length===2){let o=p(s[1]);return isNaN(o)&&(o=0),Ar("floor",p(s[0]),-1*o)}return Math.floor(p(s[0]))})},t.cos=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.cos(p(s[0]))))},t.isnan=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),typeof s[0]=="number"&&isNaN(s[0])))},t.exp=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.exp(p(s[0]))))},t.log=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.log(p(s[0]))))},t.pow=function(r,i){return e(r,i,(u,a,s)=>(y(s,2,2,r,i),p(s[0])**p(s[1])))},t.random=function(r,i){return e(r,i,(u,a,s)=>(y(s,0,0,r,i),Math.random()))},t.sin=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.sin(p(s[0]))))},t.sqrt=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.sqrt(p(s[0]))))},t.tan=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.tan(p(s[0]))))},t.defaultvalue=function(r,i){return e(r,i,(u,a,s)=>(y(s,2,2,r,i),s[0]===null||s[0]===""||s[0]===void 0?s[1]:s[0]))},t.isempty=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),s[0]===null||s[0]===""||s[0]===void 0))},t.boolean=function(r,i){return e(r,i,(u,a,s)=>{y(s,1,1,r,i);const o=s[0];return Pt(o)})},t.constrain=function(r,i){return e(r,i,(u,a,s)=>{y(s,3,3,r,i);const o=p(s[1]),l=p(s[2]);if(M(s[0])){const d=[];for(const f of s[0])d.push(n(f,o,l));return d}if(L(s[0])){const d=[];for(let f=0;f=e&&e!==-1)return n}return n}function Sr(t,e,n=1e3){switch(t.toLowerCase()){case"distinct":return $c(e,n);case"avg":case"mean":return fu(gt(e));case"min":return Math.min.apply(Math,gt(e));case"sum":return Lc(gt(e));case"max":return Math.max.apply(Math,gt(e));case"stdev":case"stddev":return Math.sqrt(Ds(gt(e)));case"var":case"variance":return Ds(gt(e));case"count":return e.length}return 0}function it(t,e,n,r){if(r.length===1){if(M(r[0]))return Sr(t,r[0],-1);if(L(r[0]))return Sr(t,r[0].toArray(),-1)}return Sr(t,r,-1)}function du(t,e){t.stdev=function(n,r){return e(n,r,(i,u,a)=>it("stdev",i,u,a))},t.variance=function(n,r){return e(n,r,(i,u,a)=>it("variance",i,u,a))},t.average=function(n,r){return e(n,r,(i,u,a)=>it("mean",i,u,a))},t.mean=function(n,r){return e(n,r,(i,u,a)=>it("mean",i,u,a))},t.sum=function(n,r){return e(n,r,(i,u,a)=>it("sum",i,u,a))},t.min=function(n,r){return e(n,r,(i,u,a)=>it("min",i,u,a))},t.max=function(n,r){return e(n,r,(i,u,a)=>it("max",i,u,a))},t.distinct=function(n,r){return e(n,r,(i,u,a)=>it("distinct",i,u,a))},t.count=function(n,r){return e(n,r,(i,u,a)=>{if(y(a,1,1,n,r),M(a[0])||v(a[0]))return a[0].length;if(L(a[0]))return a[0].length();throw new h(n,c.InvalidParameter,r)})}}class mu extends O{constructor(e){super(),this.declaredClass="esri.arcade.Portal",this.immutable=!1,this.setField("url",e),this.immutable=!0}}class Rc extends O{constructor(e,n,r,i,u,a){super(),this.attachmentUrl=u,this.declaredClass="esri.arcade.Attachment",this.immutable=!1,this.setField("id",e),this.setField("name",n),this.setField("contenttype",r),this.setField("size",i),this.setField("exifinfo",a),this.immutable=!0}}const Ci=t=>(e,n,r)=>(r=r||14,+t(e,n).toFixed(r)),Pc=(t,e)=>t+e,Uc=(t,e)=>t*e,zc=(t,e)=>t/e,ws=(t,e,n)=>Ci(Pc)(t,e,n),_t=(t,e,n)=>Ci(Uc)(t,e,n),jn=(t,e,n)=>Ci(zc)(t,e,n),Wn=360,Gc=400,Vc=2*Math.PI,Pe=3600,xs=3240,mn=60,ot=60,Fs=180*Pe/Math.PI,sn=Wn*mn*ot,vr=90*Pe,bt=180*Pe,qc=270*Pe,pu=String.fromCharCode(7501),an="\xB0";function en(t){if(v(t)===!1)throw new h(null,c.InvalidParameter,null);return t}function Kr(t,e){const n=10**e;return Math.round(t*n)/n}function Zc(t,e){return t%e}function It(t){const e=parseFloat(t.toString().replace(Math.trunc(t).toString(),"0"))*Math.sign(t);return t<0?{fraction:e,integer:Math.ceil(t)}:{fraction:e,integer:Math.floor(t)}}var J,w,V,Qr;function Ot(t,e){switch(t){case J.north:return e==="SHORT"?"N":"North";case J.east:return e==="SHORT"?"E":"East";case J.south:return e==="SHORT"?"S":"South";case J.west:return e==="SHORT"?"W":"West"}}function br(t,e,n){for(;t.length=qc?J.north:J.south,r=n===J.north?Math.min(sn-e,e):Math.abs(e-bt),i=e>bt?J.west:J.east;return new Hc(n,r,i)}static createFromAngleMeridianAndDirection(e,n,r){return new de(new Se(de.secondsQuadrantToNorthAzimuth(e.extractAngularUnits(w.seconds),n,r)))}static secondsQuadrantToNorthAzimuth(e,n,r){return n===J.north?r===J.east?e:sn-e:r===J.east?bt-e:bt+e}static _convertDirectionFormat(e,n,r){let i=0;switch(n){case V.north_azimuth:i=e;break;case V.polar:i=vr-e;break;case V.quadrant:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"});case V.south_azimuth:i=e+bt}let u=0;switch(r){case V.north_azimuth:u=i;break;case V.polar:u=vr-i;break;case V.quadrant:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"});case V.south_azimuth:u=i-bt}return u=Zc(u,sn),u<0?sn+u:u}}function As(t,e,n){let r=null;switch(e){case w.decimal_degrees:r=_t(t,Pe);break;case w.seconds:r=t;break;case w.gradians:r=_t(t,xs);break;case w.radians:r=_t(t,Fs);break;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}switch(n){case w.decimal_degrees:return jn(r,Pe);case w.seconds:return r;case w.gradians:return jn(r,xs);case w.radians:return r/Fs;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}class Se{constructor(e){this._seconds=e}static createFromAngleAndUnits(e,n){return new Se(As(e,n,w.seconds))}extractAngularUnits(e){return As(this._seconds,w.seconds,wn(e))}static createFromDegreesMinutesSeconds(e,n,r){return new Se(ws(ws(_t(e,Pe),_t(n,ot)),r))}}function wn(t){switch(Vs(t),t){case w.decimal_degrees:case w.truncated_degrees:case w.degrees_minutes_seconds:return w.decimal_degrees;case w.gradians:return w.gradians;case w.fractional_degree_minutes:return w.fractional_degree_minutes;case w.radians:return w.radians;case w.seconds:case w.fractional_minute_seconds:return w.seconds}}class Ei{constructor(e,n,r,i){this.view=e,this.angle=n,this.merdian=r,this.direction=i,this._dms=null,this._formattedDms=null}static createFromStringAndBearing(e,n,r){return new Ei(e,n.getAngle(r),n.getMeridian(r),n.getDirection(r))}fetchAngle(){return this.angle}fetchMeridian(){return this.merdian}fetchDirection(){return this.direction}fetchView(){return this.view}fetchDms(){return this._dms===null&&this._calculateDms(),this._dms}fetchFormattedDms(){return this._formattedDms===null&&this._calculateDms(),this._formattedDms}_calculateDms(){let e=null,n=w.truncated_degrees,r=0;for(let i=0;i0?1:0));case w.truncated_degrees:case w.fractional_degree_minutes:return u=Ir(i.fetchFormattedDms().getField(e),kr(e)),br(u.toFixed(r),"0",n+r+(r>0?1:0));case w.fractional_minute_seconds:return u=Ir(Kr(i.fetchDms().getField(e),r),kr(e)),br(u.toFixed(r),"0",n+r+(r>0?1:0));default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}function Wc(t,e,n){if(n===V.quadrant)throw new h(null,c.LogicError,null,{reason:"conversion error"});if(e===w.degrees_minutes_seconds){const r=qe.numberToDms(t);return de.createFromAngleAndDirection(Se.createFromDegreesMinutesSeconds(r.m_degrees,r.m_minutes,r.m_seconds),n)}return de.createFromAngleAndDirection(Se.createFromAngleAndUnits(t,wn(e)),n)}function Jc(t){switch(p(t)){case 1:return{first:J.north,second:J.east};case 2:return{first:J.south,second:J.east};case 3:return{first:J.south,second:J.west};case 4:return{first:J.north,second:J.west}}return null}function Ss(t){switch(t.toUpperCase().trim()){case"N":case"NORTH":return J.north;case"E":case"EAST":return J.east;case"S":case"SOUTH":return J.south;case"W":case"WEST":return J.west}return null}function kt(t){const e=parseFloat(t);if(G(e)){if(isNaN(e))throw new h(null,c.LogicError,null,{reason:"invalid conversion"});return e}throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}function Tr(t,e,n){const r=n===V.quadrant;let i=null,u=null,a=0,s=0,o=0;if(r){if(t.length<2)throw new h(null,c.LogicError,null,{reason:"conversion error"});o=1;const l=Jc(b(t[t.length-1]));if(l?(i=l.first,u=l.second):(a=1,i=Ss(b(t[0])),u=Ss(b(t[t.length-1]))),i===null||u===null)throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}switch(e){case w.decimal_degrees:case w.radians:case w.gradians:if(t.length===0)throw new h(null,c.LogicError,null,{reason:"invalid conversion"});return r?de.createFromAngleMeridianAndDirection(Se.createFromAngleAndUnits(kt(t[a]),wn(e)),i,u):de.createFromAngleAndDirection(Se.createFromAngleAndUnits(kt(t[a]),wn(e)),n);case w.degrees_minutes_seconds:if(s=t.length-o-a,s===3){const l=Se.createFromDegreesMinutesSeconds(kt(t[a]),kt(t[a+1]),kt(t[a+2]));return r?de.createFromAngleMeridianAndDirection(l,i,u):de.createFromAngleAndDirection(l,n)}if(s===1){const l=kt(t[a]),d=qe.numberToDms(l),f=Se.createFromDegreesMinutesSeconds(d.m_degrees,d.m_minutes,d.m_seconds);return r?de.createFromAngleMeridianAndDirection(f,i,u):de.createFromAngleAndDirection(f,n)}}throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}function Yc(t){const e=[" ","-","/","'",'"',"\\","^",an,pu," ","\r",` +import{hD as at,af as W,gG as Ku,cU as we,az as he,cS as ce,cR as Ne,fs as zs,cY as N,j as Qu,hE as Gs,c as Ni,u as Oi,c9 as Ce,c8 as Xu,bk as Bi,dO as eo,cq as to,cN as Vs,aT as xn,at as Ke,bW as qs,U as no,m as Zs,b4 as ro,hF as _i}from"./index.221827cd.js";import{s as io,p as Hs}from"./number.9e690eda.js";var c;(function(t){t.AsyncNotEnabled="AsyncNotEnabled",t.ModulesNotSupported="ModulesNotSupported",t.CircularModules="CircularModules",t.NeverReach="NeverReach",t.UnsupportedHashType="UnsupportedHashType",t.InvalidParameter="InvalidParameter",t.UnexpectedToken="UnexpectedToken",t.Unrecognised="Unrecognised",t.UnrecognisedType="UnrecognisedType",t.MaximumCallDepth="MaximumCallDepth",t.BooleanConditionRequired="BooleanConditionRequired",t.TypeNotAllowedInFeature="TypeNotAllowedInFeature",t.KeyMustBeString="KeyMustBeString",t.WrongNumberOfParameters="WrongNumberOfParameters",t.CallNonFunction="CallNonFunction",t.NoFunctionInTemplateLiteral="NoFunctionInTemplateLiteral",t.NoFunctionInDictionary="NoFunctionInDictionary",t.NoFunctionInArray="NoFunctionInArray",t.AssignModuleFunction="AssignModuleFunction",t.LogicExpressionOrAnd="LogicExpressionOrAnd",t.LogicalExpressionOnlyBoolean="LogicalExpressionOnlyBoolean",t.FuncionNotFound="FunctionNotFound",t.InvalidMemberAccessKey="InvalidMemberAccessKey",t.UnsupportedUnaryOperator="UnsupportUnaryOperator",t.InvalidIdentifier="InvalidIdentifier",t.MemberOfNull="MemberOfNull",t.UnsupportedOperator="UnsupportedOperator",t.Cancelled="Cancelled",t.ModuleAccessorMustBeString="ModuleAccessorMustBeString",t.ModuleExportNotFound="ModuleExportNotFound",t.Immutable="Immutable",t.OutOfBounds="OutOfBounds",t.IllegalResult="IllegalResult",t.FieldNotFound="FieldNotFound",t.PortalRequired="PortalRequired",t.LogicError="LogicError",t.ArrayAccessorMustBeNumber="ArrayAccessMustBeNumber",t.KeyAccessorMustBeString="KeyAccessorMustBeString",t.WrongSpatialReference="WrongSpatialReference"})(c||(c={}));const js={[c.TypeNotAllowedInFeature]:"Feature attributes only support dates, numbers, strings, guids.",[c.LogicError]:"Logic error - {reason}",[c.NeverReach]:"Encountered unreachable logic",[c.AsyncNotEnabled]:"Async Arcade must be enabled for this script",[c.ModuleAccessorMustBeString]:"Module accessor must be a string",[c.ModuleExportNotFound]:"Module has no export with provided identifier",[c.ModulesNotSupported]:"Current profile does not support modules",[c.ArrayAccessorMustBeNumber]:"Array accessor must be a number",[c.FuncionNotFound]:"Function not found",[c.FieldNotFound]:"Key not found - {key}",[c.CircularModules]:"Circular module dependencies are not allowed",[c.Cancelled]:"Execution cancelled",[c.UnsupportedHashType]:"Type not supported in hash function",[c.IllegalResult]:"Value is not a supported return type",[c.PortalRequired]:"Portal is required",[c.InvalidParameter]:"Invalid parameter",[c.WrongNumberOfParameters]:"Call with wrong number of parameters",[c.Unrecognised]:"Unrecognised code structure",[c.UnrecognisedType]:"Unrecognised type",[c.WrongSpatialReference]:"Cannot work with geometry in this spatial reference. It is different to the execution spatial reference",[c.BooleanConditionRequired]:"Conditions must use booleans",[c.NoFunctionInDictionary]:"Dictionaries cannot contain functions.",[c.NoFunctionInArray]:"Arrays cannot contain functions.",[c.NoFunctionInTemplateLiteral]:"Template Literals do not expect functions by value.",[c.KeyAccessorMustBeString]:"Accessor must be a string",[c.KeyMustBeString]:"Object keys must be a string",[c.Immutable]:"Object is immutable",[c.InvalidParameter]:"Invalid parameter",[c.UnexpectedToken]:"Unexpected token",[c.MemberOfNull]:"Cannot access property of null object",[c.MaximumCallDepth]:"Exceeded maximum function depth",[c.OutOfBounds]:"Out of bounds",[c.InvalidIdentifier]:"Identifier not recognised",[c.FuncionNotFound]:"Function not found",[c.CallNonFunction]:"Expression is not a function",[c.InvalidMemberAccessKey]:"Cannot access value using a key of this type",[c.AssignModuleFunction]:"Cannot assign function to module variable",[c.UnsupportedUnaryOperator]:"Unsupported unary operator",[c.UnsupportedOperator]:"Unsupported operator",[c.LogicalExpressionOnlyBoolean]:"Logical expressions must be boolean",[c.LogicExpressionOrAnd]:"Logical expression can only be combined with || or &&"};class so extends Error{constructor(...e){super(...e)}}class Un extends so{constructor(e,n){super(si(n)+e.message,{cause:e}),this.loc=null,Error.captureStackTrace&&Error.captureStackTrace(this,Un),n&&n.loc&&(this.loc=n.loc)}}class h extends Error{constructor(e,n,r,i){super("Execution error - "+si(r)+ai(js[n],i)),this.loc=null,this.declaredRootClass="esri.arcade.arcadeexecutionerror",Error.captureStackTrace&&Error.captureStackTrace(this,h),r&&r.loc&&(this.loc=r.loc)}}function si(t){var e,n;return t&&t.loc?`Line : ${(e=t.loc.start)==null?void 0:e.line}, ${(n=t.loc.start)==null?void 0:n.column}: `:""}class fe extends Error{constructor(e,n,r,i){super("Compilation error - "+si(r)+ai(js[n],i)),this.loc=null,this.declaredRootClass="esri.arcade.arcadecompilationerror",Error.captureStackTrace&&Error.captureStackTrace(this,fe),r&&r.loc&&(this.loc=r.loc)}}class on extends Error{constructor(){super("Uncompilable code structures"),this.declaredRootClass="esri.arcade.arcadeuncompilableerror",Error.captureStackTrace&&Error.captureStackTrace(this,on)}}function ai(t,e){try{if(!e)return t;for(const n in e){let r=e[n];r||(r=""),t=t.replace("{"+n+"}",e[n])}}catch{}return t}function ao(t,e,n){return n.declaredRootClass==="esri.arcade.arcadeexecutionerror"||n.declaredRootClass==="esri.arcade.arcadecompilationerror"?n.loc===null&&e&&e.loc?new Un(n,{cause:n}):n:(n.declaredRootClass==="esri.arcade.featureset.support.featureseterror"||n.declaredRootClass,e&&e.loc?new Un(n,{cause:n}):n)}var wt;(function(t){t.UnrecognisedUri="UnrecognisedUri",t.UnsupportedUriProtocol="UnsupportedUriProtocol"})(wt||(wt={}));const uo={[wt.UnrecognisedUri]:"Unrecognised uri - {uri}",[wt.UnsupportedUriProtocol]:"Unrecognised uri protocol"};class ln extends Error{constructor(e,n){super(ai(uo[e],n)),this.declaredRootClass="esri.arcade.arcademoduleerror",Error.captureStackTrace&&Error.captureStackTrace(this,ln)}}class me{constructor(e=[]){this._elements=e}length(){return this._elements.length}get(e){return this._elements[e]}toArray(){const e=[];for(let n=0;nthis.fn(e,{preparsed:!0,arguments:n})}call(e,n){return this.fn(e,n)}marshalledCall(e,n,r,i){return i(e,n,(u,a,s)=>{s=s.map(l=>l instanceof Ft&&!(l instanceof et)?Lt(l,e,i):l);const o=this.call(r,{args:s});return at(o)?o.then(l=>Lt(l,r,i)):o})}}class et extends Ft{constructor(){super(...arguments),this.fn=null,this.context=null}createFunction(e){return this.fn.createFunction(this.context)}call(e,n){return this.fn.marshalledCall(e,n,this.context,this.parameterEvaluator)}marshalledCall(e,n,r){return this.fn.marshalledCall(e,n,this.context,this.parameterEvaluator)}}class nt extends me{constructor(e,n,r,i,u,a){super(e),this._lazyPt=[],this._hasZ=!1,this._hasM=!1,this._spRef=n,this._hasZ=r,this._hasM=i,this._cacheId=u,this._partId=a}get(e){if(this._lazyPt[e]===void 0){const n=this._elements[e];if(n===void 0)return;const r=this._hasZ,i=this._hasM;let u=null;u=r&&!i?new W(n[0],n[1],n[2],void 0,this._spRef):i&&!r?new W(n[0],n[1],void 0,n[2],this._spRef):r&&i?new W(n[0],n[1],n[2],n[3],this._spRef):new W(n[0],n[1],this._spRef),u.cache._arcadeCacheId=this._cacheId.toString()+"-"+this._partId.toString()+"-"+e.toString(),this._lazyPt[e]=u}return this._lazyPt[e]}equalityTest(e){return e===this||e!==null&&e instanceof nt&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()+"-"+this._partId.toString()}}class yn extends me{constructor(e,n,r,i,u){super(e),this._lazyPath=[],this._hasZ=!1,this._hasM=!1,this._hasZ=r,this._hasM=i,this._spRef=n,this._cacheId=u}get(e){if(this._lazyPath[e]===void 0){const n=this._elements[e];if(n===void 0)return;this._lazyPath[e]=new nt(n,this._spRef,this._hasZ,this._hasM,this._cacheId,e)}return this._lazyPath[e]}equalityTest(e){return e===this||e!==null&&e instanceof yn&&e.getUniqueHash()===this.getUniqueHash()}getUniqueHash(){return this._cacheId.toString()}}class At extends Error{}class oo extends At{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}}class lo extends At{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}}class co extends At{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}}class tn extends At{}class Ws extends At{constructor(e){super(`Invalid unit ${e}`)}}class Me extends At{}class rt extends At{constructor(){super("Zone is an abstract class")}}const x="numeric",Ge="short",ve="long",Rr={year:x,month:x,day:x},Js={year:x,month:Ge,day:x},ho={year:x,month:Ge,day:x,weekday:Ge},Ys={year:x,month:ve,day:x},Ks={year:x,month:ve,day:x,weekday:ve},Qs={hour:x,minute:x},Xs={hour:x,minute:x,second:x},ea={hour:x,minute:x,second:x,timeZoneName:Ge},ta={hour:x,minute:x,second:x,timeZoneName:ve},na={hour:x,minute:x,hourCycle:"h23"},ra={hour:x,minute:x,second:x,hourCycle:"h23"},ia={hour:x,minute:x,second:x,hourCycle:"h23",timeZoneName:Ge},sa={hour:x,minute:x,second:x,hourCycle:"h23",timeZoneName:ve},aa={year:x,month:x,day:x,hour:x,minute:x},ua={year:x,month:x,day:x,hour:x,minute:x,second:x},oa={year:x,month:Ge,day:x,hour:x,minute:x},la={year:x,month:Ge,day:x,hour:x,minute:x,second:x},fo={year:x,month:Ge,day:x,weekday:Ge,hour:x,minute:x},ca={year:x,month:ve,day:x,hour:x,minute:x,timeZoneName:Ge},ha={year:x,month:ve,day:x,hour:x,minute:x,second:x,timeZoneName:Ge},fa={year:x,month:ve,day:x,weekday:ve,hour:x,minute:x,timeZoneName:ve},da={year:x,month:ve,day:x,weekday:ve,hour:x,minute:x,second:x,timeZoneName:ve};function H(t){return typeof t=="undefined"}function xt(t){return typeof t=="number"}function Qn(t){return typeof t=="number"&&t%1===0}function mo(t){return typeof t=="string"}function po(t){return Object.prototype.toString.call(t)==="[object Date]"}function ma(){try{return typeof Intl!="undefined"&&!!Intl.RelativeTimeFormat}catch{return!1}}function go(t){return Array.isArray(t)?t:[t]}function Li(t,e,n){if(t.length!==0)return t.reduce((r,i)=>{const u=[e(i),i];return r&&n(r[0],u[0])===r[0]?r:u},null)[1]}function yo(t,e){return e.reduce((n,r)=>(n[r]=t[r],n),{})}function $t(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Qe(t,e,n){return Qn(t)&&t>=e&&t<=n}function Do(t,e){return t-e*Math.floor(t/e)}function ie(t,e=2){const n=t<0;let r;return n?r="-"+(""+-t).padStart(e,"0"):r=(""+t).padStart(e,"0"),r}function st(t){if(!(H(t)||t===null||t===""))return parseInt(t,10)}function dt(t){if(!(H(t)||t===null||t===""))return parseFloat(t)}function ui(t){if(!(H(t)||t===null||t==="")){const e=parseFloat("0."+t)*1e3;return Math.floor(e)}}function oi(t,e,n=!1){const r=10**e;return(n?Math.trunc:Math.round)(t*r)/r}function Fn(t){return t%4===0&&(t%100!==0||t%400===0)}function cn(t){return Fn(t)?366:365}function zn(t,e){const n=Do(e-1,12)+1,r=t+(e-n)/12;return n===2?Fn(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function li(t){let e=Date.UTC(t.year,t.month-1,t.day,t.hour,t.minute,t.second,t.millisecond);return t.year<100&&t.year>=0&&(e=new Date(e),e.setUTCFullYear(e.getUTCFullYear()-1900)),+e}function Gn(t){const e=(t+Math.floor(t/4)-Math.floor(t/100)+Math.floor(t/400))%7,n=t-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return e===4||r===3?53:52}function Pr(t){return t>99?t:t>60?1900+t:2e3+t}function pa(t,e,n,r=null){const i=new Date(t),u={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(u.timeZone=r);const a={timeZoneName:e,...u},s=new Intl.DateTimeFormat(n,a).formatToParts(i).find(o=>o.type.toLowerCase()==="timezonename");return s?s.value:null}function Xn(t,e){let n=parseInt(t,10);Number.isNaN(n)&&(n=0);const r=parseInt(e,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function ga(t){const e=Number(t);if(typeof t=="boolean"||t===""||Number.isNaN(e))throw new Me(`Invalid unit value ${t}`);return e}function Vn(t,e){const n={};for(const r in t)if($t(t,r)){const i=t[r];if(i==null)continue;n[e(r)]=ga(i)}return n}function hn(t,e){const n=Math.trunc(Math.abs(t/60)),r=Math.trunc(Math.abs(t%60)),i=t>=0?"+":"-";switch(e){case"short":return`${i}${ie(n,2)}:${ie(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${ie(n,2)}${ie(r,2)}`;default:throw new RangeError(`Value format ${e} is out of range for property format`)}}function er(t){return yo(t,["hour","minute","second","millisecond"])}const ya=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,wo=["January","February","March","April","May","June","July","August","September","October","November","December"],Da=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],xo=["J","F","M","A","M","J","J","A","S","O","N","D"];function wa(t){switch(t){case"narrow":return[...xo];case"short":return[...Da];case"long":return[...wo];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const xa=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],Fa=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Fo=["M","T","W","T","F","S","S"];function Ca(t){switch(t){case"narrow":return[...Fo];case"short":return[...Fa];case"long":return[...xa];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Ea=["AM","PM"],Co=["Before Christ","Anno Domini"],Eo=["BC","AD"],Ao=["B","A"];function Aa(t){switch(t){case"narrow":return[...Ao];case"short":return[...Eo];case"long":return[...Co];default:return null}}function So(t){return Ea[t.hour<12?0:1]}function vo(t,e){return Ca(e)[t.weekday-1]}function bo(t,e){return wa(e)[t.month-1]}function Io(t,e){return Aa(e)[t.year<0?0:1]}function ko(t,e,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},u=["hours","minutes","seconds"].indexOf(t)===-1;if(n==="auto"&&u){const f=t==="days";switch(e){case 1:return f?"tomorrow":`next ${i[t][0]}`;case-1:return f?"yesterday":`last ${i[t][0]}`;case 0:return f?"today":`this ${i[t][0]}`}}const a=Object.is(e,-0)||e<0,s=Math.abs(e),o=s===1,l=i[t],d=r?o?l[1]:l[2]||l[1]:o?i[t][0]:t;return a?`${s} ${d} ago`:`in ${s} ${d}`}function $i(t,e){let n="";for(const r of t)r.literal?n+=r.val:n+=e(r.val);return n}const To={D:Rr,DD:Js,DDD:Ys,DDDD:Ks,t:Qs,tt:Xs,ttt:ea,tttt:ta,T:na,TT:ra,TTT:ia,TTTT:sa,f:aa,ff:oa,fff:ca,ffff:fa,F:ua,FF:la,FFF:ha,FFFF:da};class xe{static create(e,n={}){return new xe(e,n)}static parseFormat(e){let n=null,r="",i=!1;const u=[];for(let a=0;a0&&u.push({literal:i,val:r}),n=null,r="",i=!i):i||s===n?r+=s:(r.length>0&&u.push({literal:!1,val:r}),r=s,n=s)}return r.length>0&&u.push({literal:i,val:r}),u}static macroTokenToFormatOpts(e){return To[e]}constructor(e,n){this.opts=n,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,n){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...n}).format()}formatDateTime(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n}).format()}formatDateTimeParts(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n}).formatToParts()}resolvedOptions(e,n={}){return this.loc.dtFormatter(e,{...this.opts,...n}).resolvedOptions()}num(e,n=0){if(this.opts.forceSimple)return ie(e,n);const r={...this.opts};return n>0&&(r.padTo=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(e,n){const r=this.loc.listingMode()==="en",i=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",u=(g,D)=>this.loc.extract(e,g,D),a=g=>e.isOffsetFixed&&e.offset===0&&g.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,g.format):"",s=()=>r?So(e):u({hour:"numeric",hourCycle:"h12"},"dayperiod"),o=(g,D)=>r?bo(e,g):u(D?{month:g}:{month:g,day:"numeric"},"month"),l=(g,D)=>r?vo(e,g):u(D?{weekday:g}:{weekday:g,month:"long",day:"numeric"},"weekday"),d=g=>{const D=xe.macroTokenToFormatOpts(g);return D?this.formatWithSystemDefault(e,D):g},f=g=>r?Io(e,g):u({era:g},"era"),m=g=>{switch(g){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12===0?12:e.hour%12);case"hh":return this.num(e.hour%12===0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return s();case"d":return i?u({day:"numeric"},"day"):this.num(e.day);case"dd":return i?u({day:"2-digit"},"day"):this.num(e.day,2);case"c":return this.num(e.weekday);case"ccc":return l("short",!0);case"cccc":return l("long",!0);case"ccccc":return l("narrow",!0);case"E":return this.num(e.weekday);case"EEE":return l("short",!1);case"EEEE":return l("long",!1);case"EEEEE":return l("narrow",!1);case"L":return i?u({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return i?u({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return o("short",!0);case"LLLL":return o("long",!0);case"LLLLL":return o("narrow",!0);case"M":return i?u({month:"numeric"},"month"):this.num(e.month);case"MM":return i?u({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return o("short",!1);case"MMMM":return o("long",!1);case"MMMMM":return o("narrow",!1);case"y":return i?u({year:"numeric"},"year"):this.num(e.year);case"yy":return i?u({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return i?u({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return i?u({year:"numeric"},"year"):this.num(e.year,6);case"G":return f("short");case"GG":return f("long");case"GGGGG":return f("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return d(g)}};return $i(xe.parseFormat(n),m)}formatDurationFromString(e,n){const r=o=>{switch(o[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},i=o=>l=>{const d=r(l);return d?this.num(o.get(d),l.length):l},u=xe.parseFormat(n),a=u.reduce((o,{literal:l,val:d})=>l?o:o.concat(d),[]),s=e.shiftTo(...a.map(r).filter(o=>o));return $i(u,i(s))}}class Re{constructor(e,n){this.reason=e,this.explanation=n}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class Cn{get type(){throw new rt}get name(){throw new rt}get ianaName(){return this.name}get isUniversal(){throw new rt}offsetName(e,n){throw new rt}formatOffset(e,n){throw new rt}offset(e){throw new rt}equals(e){throw new rt}get isValid(){throw new rt}}let pr=null;class tr extends Cn{static get instance(){return pr===null&&(pr=new tr),pr}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:n,locale:r}){return pa(e,n,r)}formatOffset(e,n){return hn(this.offset(e),n)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type==="system"}get isValid(){return!0}}let _n={};function Mo(t){return _n[t]||(_n[t]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),_n[t]}const No={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Oo(t,e){const n=t.format(e).replace(/\u200E/g,""),r=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n),[,i,u,a,s,o,l,d]=r;return[a,i,u,s,o,l,d]}function Bo(t,e){const n=t.formatToParts(e),r=[];for(let i=0;i=0?D:1e3+D,(m-g)/(60*1e3)}equals(e){return e.type==="iana"&&e.name===this.name}get isValid(){return this.valid}}let gr=null;class Fe extends Cn{static get utcInstance(){return gr===null&&(gr=new Fe(0)),gr}static instance(e){return e===0?Fe.utcInstance:new Fe(e)}static parseSpecifier(e){if(e){const n=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new Fe(Xn(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${hn(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${hn(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,n){return hn(this.fixed,n)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type==="fixed"&&e.fixed===this.fixed}get isValid(){return!0}}class _o extends Cn{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function ut(t,e){if(H(t)||t===null)return e;if(t instanceof Cn)return t;if(mo(t)){const n=t.toLowerCase();return n==="default"?e:n==="local"||n==="system"?tr.instance:n==="utc"||n==="gmt"?Fe.utcInstance:Fe.parseSpecifier(n)||tt.create(t)}else return xt(t)?Fe.instance(t):typeof t=="object"&&t.offset&&typeof t.offset=="number"?t:new _o(t)}let Ri=()=>Date.now(),Pi="system",Ui=null,zi=null,Gi=null,Vi;class ae{static get now(){return Ri}static set now(e){Ri=e}static set defaultZone(e){Pi=e}static get defaultZone(){return ut(Pi,tr.instance)}static get defaultLocale(){return Ui}static set defaultLocale(e){Ui=e}static get defaultNumberingSystem(){return zi}static set defaultNumberingSystem(e){zi=e}static get defaultOutputCalendar(){return Gi}static set defaultOutputCalendar(e){Gi=e}static get throwOnInvalid(){return Vi}static set throwOnInvalid(e){Vi=e}static resetCaches(){ee.resetCache(),tt.resetCache()}}let qi={};function Lo(t,e={}){const n=JSON.stringify([t,e]);let r=qi[n];return r||(r=new Intl.ListFormat(t,e),qi[n]=r),r}let Ur={};function zr(t,e={}){const n=JSON.stringify([t,e]);let r=Ur[n];return r||(r=new Intl.DateTimeFormat(t,e),Ur[n]=r),r}let Gr={};function $o(t,e={}){const n=JSON.stringify([t,e]);let r=Gr[n];return r||(r=new Intl.NumberFormat(t,e),Gr[n]=r),r}let Vr={};function Ro(t,e={}){const{base:n,...r}=e,i=JSON.stringify([t,r]);let u=Vr[i];return u||(u=new Intl.RelativeTimeFormat(t,e),Vr[i]=u),u}let nn=null;function Po(){return nn||(nn=new Intl.DateTimeFormat().resolvedOptions().locale,nn)}function Uo(t){const e=t.indexOf("-u-");if(e===-1)return[t];{let n;const r=t.substring(0,e);try{n=zr(t).resolvedOptions()}catch{n=zr(r).resolvedOptions()}const{numberingSystem:i,calendar:u}=n;return[r,i,u]}}function zo(t,e,n){return(n||e)&&(t+="-u",n&&(t+=`-ca-${n}`),e&&(t+=`-nu-${e}`)),t}function Go(t){const e=[];for(let n=1;n<=12;n++){const r=B.utc(2016,n,1);e.push(t(r))}return e}function Vo(t){const e=[];for(let n=1;n<=7;n++){const r=B.utc(2016,11,13+n);e.push(t(r))}return e}function In(t,e,n,r,i){const u=t.listingMode(n);return u==="error"?null:u==="en"?r(e):i(e)}function qo(t){return t.numberingSystem&&t.numberingSystem!=="latn"?!1:t.numberingSystem==="latn"||!t.locale||t.locale.startsWith("en")||new Intl.DateTimeFormat(t.intl).resolvedOptions().numberingSystem==="latn"}class Zo{constructor(e,n,r){this.padTo=r.padTo||0,this.floor=r.floor||!1;const{padTo:i,floor:u,...a}=r;if(!n||Object.keys(a).length>0){const s={useGrouping:!1,...r};r.padTo>0&&(s.minimumIntegerDigits=r.padTo),this.inf=$o(e,s)}}format(e){if(this.inf){const n=this.floor?Math.floor(e):e;return this.inf.format(n)}else{const n=this.floor?Math.floor(e):oi(e,3);return ie(n,this.padTo)}}}class Ho{constructor(e,n,r){this.opts=r;let i;if(e.zone.isUniversal){const a=-1*(e.offset/60),s=a>=0?`Etc/GMT+${a}`:`Etc/GMT${a}`;e.offset!==0&&tt.create(s).valid?(i=s,this.dt=e):(i="UTC",r.timeZoneName?this.dt=e:this.dt=e.offset===0?e:B.fromMillis(e.ts+e.offset*60*1e3))}else e.zone.type==="system"?this.dt=e:(this.dt=e,i=e.zone.name);const u={...this.opts};i&&(u.timeZone=i),this.dtf=zr(n,u)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class jo{constructor(e,n,r){this.opts={style:"long",...r},!n&&ma()&&(this.rtf=Ro(e,r))}format(e,n){return this.rtf?this.rtf.format(e,n):ko(n,e,this.opts.numeric,this.opts.style!=="long")}formatToParts(e,n){return this.rtf?this.rtf.formatToParts(e,n):[]}}class ee{static fromOpts(e){return ee.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,n,r,i=!1){const u=e||ae.defaultLocale,a=u||(i?"en-US":Po()),s=n||ae.defaultNumberingSystem,o=r||ae.defaultOutputCalendar;return new ee(a,s,o,u)}static resetCache(){nn=null,Ur={},Gr={},Vr={}}static fromObject({locale:e,numberingSystem:n,outputCalendar:r}={}){return ee.create(e,n,r)}constructor(e,n,r,i){const[u,a,s]=Uo(e);this.locale=u,this.numberingSystem=n||a||null,this.outputCalendar=r||s||null,this.intl=zo(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=qo(this)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),n=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return e&&n?"en":"intl"}clone(e){return!e||Object.getOwnPropertyNames(e).length===0?this:ee.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,n=!1,r=!0){return In(this,e,r,wa,()=>{const i=n?{month:e,day:"numeric"}:{month:e},u=n?"format":"standalone";return this.monthsCache[u][e]||(this.monthsCache[u][e]=Go(a=>this.extract(a,i,"month"))),this.monthsCache[u][e]})}weekdays(e,n=!1,r=!0){return In(this,e,r,Ca,()=>{const i=n?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},u=n?"format":"standalone";return this.weekdaysCache[u][e]||(this.weekdaysCache[u][e]=Vo(a=>this.extract(a,i,"weekday"))),this.weekdaysCache[u][e]})}meridiems(e=!0){return In(this,void 0,e,()=>Ea,()=>{if(!this.meridiemCache){const n={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[B.utc(2016,11,13,9),B.utc(2016,11,13,19)].map(r=>this.extract(r,n,"dayperiod"))}return this.meridiemCache})}eras(e,n=!0){return In(this,e,n,Aa,()=>{const r={era:e};return this.eraCache[e]||(this.eraCache[e]=[B.utc(-40,1,1),B.utc(2017,1,1)].map(i=>this.extract(i,r,"era"))),this.eraCache[e]})}extract(e,n,r){const i=this.dtFormatter(e,n),u=i.formatToParts(),a=u.find(s=>s.type.toLowerCase()===r);return a?a.value:null}numberFormatter(e={}){return new Zo(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,n={}){return new Ho(e,this.intl,n)}relFormatter(e={}){return new jo(this.intl,this.isEnglish(),e)}listFormatter(e={}){return Lo(this.intl,e)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Vt(...t){const e=t.reduce((n,r)=>n+r.source,"");return RegExp(`^${e}$`)}function qt(...t){return e=>t.reduce(([n,r,i],u)=>{const[a,s,o]=u(e,i);return[{...n,...a},s||r,o]},[{},null,1]).slice(0,2)}function Zt(t,...e){if(t==null)return[null,null];for(const[n,r]of e){const i=n.exec(t);if(i)return r(i)}return[null,null]}function Sa(...t){return(e,n)=>{const r={};let i;for(i=0;ig!==void 0&&(D||g&&d)?-g:g;return[{years:m(dt(n)),months:m(dt(r)),weeks:m(dt(i)),days:m(dt(u)),hours:m(dt(a)),minutes:m(dt(s)),seconds:m(dt(o),o==="-0"),milliseconds:m(ui(l),f)}]}const al={GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function fi(t,e,n,r,i,u,a){const s={year:e.length===2?Pr(st(e)):st(e),month:Da.indexOf(n)+1,day:st(r),hour:st(i),minute:st(u)};return a&&(s.second=st(a)),t&&(s.weekday=t.length>3?xa.indexOf(t)+1:Fa.indexOf(t)+1),s}const ul=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function ol(t){const[,e,n,r,i,u,a,s,o,l,d,f]=t,m=fi(e,i,r,n,u,a,s);let g;return o?g=al[o]:l?g=0:g=Xn(d,f),[m,new Fe(g)]}function ll(t){return t.replace(/\([^)]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const cl=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,hl=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,fl=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Zi(t){const[,e,n,r,i,u,a,s]=t;return[fi(e,i,r,n,u,a,s),Fe.utcInstance]}function dl(t){const[,e,n,r,i,u,a,s]=t;return[fi(e,s,n,r,i,u,a),Fe.utcInstance]}const ml=Vt(Jo,hi),pl=Vt(Yo,hi),gl=Vt(Ko,hi),yl=Vt(ba),ka=qt(nl,Ht,En,An),Dl=qt(Qo,Ht,En,An),wl=qt(Xo,Ht,En,An),xl=qt(Ht,En,An);function Fl(t){return Zt(t,[ml,ka],[pl,Dl],[gl,wl],[yl,xl])}function Cl(t){return Zt(ll(t),[ul,ol])}function El(t){return Zt(t,[cl,Zi],[hl,Zi],[fl,dl])}function Al(t){return Zt(t,[il,sl])}const Sl=qt(Ht);function vl(t){return Zt(t,[rl,Sl])}const bl=Vt(el,tl),Il=Vt(Ia),kl=qt(Ht,En,An);function Tl(t){return Zt(t,[bl,ka],[Il,kl])}const Ml="Invalid Duration",Ta={weeks:{days:7,hours:7*24,minutes:7*24*60,seconds:7*24*60*60,milliseconds:7*24*60*60*1e3},days:{hours:24,minutes:24*60,seconds:24*60*60,milliseconds:24*60*60*1e3},hours:{minutes:60,seconds:60*60,milliseconds:60*60*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Nl={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:91*24,minutes:91*24*60,seconds:91*24*60*60,milliseconds:91*24*60*60*1e3},months:{weeks:4,days:30,hours:30*24,minutes:30*24*60,seconds:30*24*60*60,milliseconds:30*24*60*60*1e3},...Ta},Ie=146097/400,St=146097/4800,Ol={years:{quarters:4,months:12,weeks:Ie/7,days:Ie,hours:Ie*24,minutes:Ie*24*60,seconds:Ie*24*60*60,milliseconds:Ie*24*60*60*1e3},quarters:{months:3,weeks:Ie/28,days:Ie/4,hours:Ie*24/4,minutes:Ie*24*60/4,seconds:Ie*24*60*60/4,milliseconds:Ie*24*60*60*1e3/4},months:{weeks:St/7,days:St,hours:St*24,minutes:St*24*60,seconds:St*24*60*60,milliseconds:St*24*60*60*1e3},...Ta},pt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Bl=pt.slice(0).reverse();function mt(t,e,n=!1){const r={values:n?e.values:{...t.values,...e.values||{}},loc:t.loc.clone(e.loc),conversionAccuracy:e.conversionAccuracy||t.conversionAccuracy,matrix:e.matrix||t.matrix};return new j(r)}function _l(t){return t<0?Math.floor(t):Math.ceil(t)}function Ma(t,e,n,r,i){const u=t[i][n],a=e[n]/u,s=Math.sign(a)===Math.sign(r[i]),o=!s&&r[i]!==0&&Math.abs(a)<=1?_l(a):Math.trunc(a);r[i]+=o,e[n]-=o*u}function Ll(t,e){Bl.reduce((n,r)=>H(e[r])?n:(n&&Ma(t,e,n,e,r),r),null)}class j{constructor(e){const n=e.conversionAccuracy==="longterm"||!1;let r=n?Ol:Nl;e.matrix&&(r=e.matrix),this.values=e.values,this.loc=e.loc||ee.create(),this.conversionAccuracy=n?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=r,this.isLuxonDuration=!0}static fromMillis(e,n){return j.fromObject({milliseconds:e},n)}static fromObject(e,n={}){if(e==null||typeof e!="object")throw new Me(`Duration.fromObject: argument expected to be an object, got ${e===null?"null":typeof e}`);return new j({values:Vn(e,j.normalizeUnit),loc:ee.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(e){if(xt(e))return j.fromMillis(e);if(j.isDuration(e))return e;if(typeof e=="object")return j.fromObject(e);throw new Me(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,n){const[r]=Al(e);return r?j.fromObject(r,n):j.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,n){const[r]=vl(e);return r?j.fromObject(r,n):j.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,n=null){if(!e)throw new Me("need to specify a reason the Duration is invalid");const r=e instanceof Re?e:new Re(e,n);if(ae.throwOnInvalid)throw new co(r);return new j({invalid:r})}static normalizeUnit(e){const n={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e&&e.toLowerCase()];if(!n)throw new Ws(e);return n}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,n={}){const r={...n,floor:n.round!==!1&&n.floor!==!1};return this.isValid?xe.create(this.loc,r).formatDurationFromString(this,e):Ml}toHuman(e={}){const n=pt.map(r=>{const i=this.values[r];return H(i)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:r.slice(0,-1)}).format(i)}).filter(r=>r);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return this.years!==0&&(e+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+"M"),this.weeks!==0&&(e+=this.weeks+"W"),this.days!==0&&(e+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+="T"),this.hours!==0&&(e+=this.hours+"H"),this.minutes!==0&&(e+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(e+=oi(this.seconds+this.milliseconds/1e3,3)+"S"),e==="P"&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const n=this.toMillis();if(n<0||n>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const r=this.shiftTo("hours","minutes","seconds","milliseconds");let i=e.format==="basic"?"hhmm":"hh:mm";(!e.suppressSeconds||r.seconds!==0||r.milliseconds!==0)&&(i+=e.format==="basic"?"ss":":ss",(!e.suppressMilliseconds||r.milliseconds!==0)&&(i+=".SSS"));let u=r.toFormat(i);return e.includePrefix&&(u="T"+u),u}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const n=j.fromDurationLike(e),r={};for(const i of pt)($t(n.values,i)||$t(this.values,i))&&(r[i]=n.get(i)+this.get(i));return mt(this,{values:r},!0)}minus(e){if(!this.isValid)return this;const n=j.fromDurationLike(e);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;const n={};for(const r of Object.keys(this.values))n[r]=ga(e(this.values[r],r));return mt(this,{values:n},!0)}get(e){return this[j.normalizeUnit(e)]}set(e){if(!this.isValid)return this;const n={...this.values,...Vn(e,j.normalizeUnit)};return mt(this,{values:n})}reconfigure({locale:e,numberingSystem:n,conversionAccuracy:r,matrix:i}={}){const a={loc:this.loc.clone({locale:e,numberingSystem:n}),matrix:i,conversionAccuracy:r};return mt(this,a)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return Ll(this.matrix,e),mt(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(e.length===0)return this;e=e.map(a=>j.normalizeUnit(a));const n={},r={},i=this.toObject();let u;for(const a of pt)if(e.indexOf(a)>=0){u=a;let s=0;for(const l in r)s+=this.matrix[l][a]*r[l],r[l]=0;xt(i[a])&&(s+=i[a]);const o=Math.trunc(s);n[a]=o,r[a]=(s*1e3-o*1e3)/1e3;for(const l in i)pt.indexOf(l)>pt.indexOf(a)&&Ma(this.matrix,i,l,n,a)}else xt(i[a])&&(r[a]=i[a]);for(const a in r)r[a]!==0&&(n[u]+=a===u?r[a]:r[a]/this.matrix[u][a]);return mt(this,{values:n},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const n of Object.keys(this.values))e[n]=this.values[n]===0?0:-this.values[n];return mt(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function n(r,i){return r===void 0||r===0?i===void 0||i===0:r===i}for(const r of pt)if(!n(this.values[r],e.values[r]))return!1;return!0}}const Jt="Invalid Interval";function $l(t,e){return!t||!t.isValid?te.invalid("missing or invalid start"):!e||!e.isValid?te.invalid("missing or invalid end"):ee:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:e,end:n}={}){return this.isValid?te.fromDateTimes(e||this.s,n||this.e):this}splitAt(...e){if(!this.isValid)return[];const n=e.map(Qt).filter(a=>this.contains(a)).sort(),r=[];let{s:i}=this,u=0;for(;i+this.e?this.e:a;r.push(te.fromDateTimes(i,s)),i=s,u+=1}return r}splitBy(e){const n=j.fromDurationLike(e);if(!this.isValid||!n.isValid||n.as("milliseconds")===0)return[];let{s:r}=this,i=1,u;const a=[];for(;ro*i));u=+s>+this.e?this.e:s,a.push(te.fromDateTimes(r,u)),r=u,i+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const n=this.s>e.s?this.s:e.s,r=this.e=r?null:te.fromDateTimes(n,r)}union(e){if(!this.isValid)return this;const n=this.se.e?this.e:e.e;return te.fromDateTimes(n,r)}static merge(e){const[n,r]=e.sort((i,u)=>i.s-u.s).reduce(([i,u],a)=>u?u.overlaps(a)||u.abutsStart(a)?[i,u.union(a)]:[i.concat([u]),a]:[i,a],[[],null]);return r&&n.push(r),n}static xor(e){let n=null,r=0;const i=[],u=e.map(o=>[{time:o.s,type:"s"},{time:o.e,type:"e"}]),a=Array.prototype.concat(...u),s=a.sort((o,l)=>o.time-l.time);for(const o of s)r+=o.type==="s"?1:-1,r===1?n=o.time:(n&&+n!=+o.time&&i.push(te.fromDateTimes(n,o.time)),n=null);return te.merge(i)}difference(...e){return te.xor([this].concat(e)).map(n=>this.intersection(n)).filter(n=>n&&!n.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} \u2013 ${this.e.toISO()})`:Jt}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Jt}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Jt}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Jt}toFormat(e,{separator:n=" \u2013 "}={}){return this.isValid?`${this.s.toFormat(e)}${n}${this.e.toFormat(e)}`:Jt}toDuration(e,n){return this.isValid?this.e.diff(this.s,e,n):j.invalid(this.invalidReason)}mapEndpoints(e){return te.fromDateTimes(e(this.s),e(this.e))}}class kn{static hasDST(e=ae.defaultZone){const n=B.now().setZone(e).set({month:12});return!e.isUniversal&&n.offset!==n.set({month:6}).offset}static isValidIANAZone(e){return tt.isValidZone(e)}static normalizeZone(e){return ut(e,ae.defaultZone)}static months(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:u="gregory"}={}){return(i||ee.create(n,r,u)).months(e)}static monthsFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null,outputCalendar:u="gregory"}={}){return(i||ee.create(n,r,u)).months(e,!0)}static weekdays(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||ee.create(n,r,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:n=null,numberingSystem:r=null,locObj:i=null}={}){return(i||ee.create(n,r,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return ee.create(e).meridiems()}static eras(e="short",{locale:n=null}={}){return ee.create(n,null,"gregory").eras(e)}static features(){return{relative:ma()}}}function Hi(t,e){const n=i=>i.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(e)-n(t);return Math.floor(j.fromMillis(r).as("days"))}function Rl(t,e,n){const r=[["years",(s,o)=>o.year-s.year],["quarters",(s,o)=>o.quarter-s.quarter+(o.year-s.year)*4],["months",(s,o)=>o.month-s.month+(o.year-s.year)*12],["weeks",(s,o)=>{const l=Hi(s,o);return(l-l%7)/7}],["days",Hi]],i={};let u,a;for(const[s,o]of r)if(n.indexOf(s)>=0){u=s;let l=o(t,e);a=t.plus({[s]:l}),a>e?(t=t.plus({[s]:l-1}),l-=1):t=a,i[s]=l}return[t,i,a,u]}function Pl(t,e,n,r){let[i,u,a,s]=Rl(t,e,n);const o=e-i,l=n.filter(f=>["hours","minutes","seconds","milliseconds"].indexOf(f)>=0);l.length===0&&(a0?j.fromMillis(o,r).shiftTo(...l).plus(d):d}const di={arab:"[\u0660-\u0669]",arabext:"[\u06F0-\u06F9]",bali:"[\u1B50-\u1B59]",beng:"[\u09E6-\u09EF]",deva:"[\u0966-\u096F]",fullwide:"[\uFF10-\uFF19]",gujr:"[\u0AE6-\u0AEF]",hanidec:"[\u3007|\u4E00|\u4E8C|\u4E09|\u56DB|\u4E94|\u516D|\u4E03|\u516B|\u4E5D]",khmr:"[\u17E0-\u17E9]",knda:"[\u0CE6-\u0CEF]",laoo:"[\u0ED0-\u0ED9]",limb:"[\u1946-\u194F]",mlym:"[\u0D66-\u0D6F]",mong:"[\u1810-\u1819]",mymr:"[\u1040-\u1049]",orya:"[\u0B66-\u0B6F]",tamldec:"[\u0BE6-\u0BEF]",telu:"[\u0C66-\u0C6F]",thai:"[\u0E50-\u0E59]",tibt:"[\u0F20-\u0F29]",latn:"\\d"},ji={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Ul=di.hanidec.replace(/[\[|\]]/g,"").split("");function zl(t){let e=parseInt(t,10);if(isNaN(e)){e="";for(let n=0;n=u&&r<=a&&(e+=r-u)}}return parseInt(e,10)}else return e}function _e({numberingSystem:t},e=""){return new RegExp(`${di[t||"latn"]}${e}`)}const Gl="missing Intl.DateTimeFormat.formatToParts support";function Y(t,e=n=>n){return{regex:t,deser:([n])=>e(zl(n))}}const Vl=String.fromCharCode(160),Na=`[ ${Vl}]`,Oa=new RegExp(Na,"g");function ql(t){return t.replace(/\./g,"\\.?").replace(Oa,Na)}function Wi(t){return t.replace(/\./g,"").replace(Oa," ").toLowerCase()}function Le(t,e){return t===null?null:{regex:RegExp(t.map(ql).join("|")),deser:([n])=>t.findIndex(r=>Wi(n)===Wi(r))+e}}function Ji(t,e){return{regex:t,deser:([,n,r])=>Xn(n,r),groups:e}}function yr(t){return{regex:t,deser:([e])=>e}}function Zl(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Hl(t,e){const n=_e(e),r=_e(e,"{2}"),i=_e(e,"{3}"),u=_e(e,"{4}"),a=_e(e,"{6}"),s=_e(e,"{1,2}"),o=_e(e,"{1,3}"),l=_e(e,"{1,6}"),d=_e(e,"{1,9}"),f=_e(e,"{2,4}"),m=_e(e,"{4,6}"),g=F=>({regex:RegExp(Zl(F.val)),deser:([U])=>U,literal:!0}),k=(F=>{if(t.literal)return g(F);switch(F.val){case"G":return Le(e.eras("short",!1),0);case"GG":return Le(e.eras("long",!1),0);case"y":return Y(l);case"yy":return Y(f,Pr);case"yyyy":return Y(u);case"yyyyy":return Y(m);case"yyyyyy":return Y(a);case"M":return Y(s);case"MM":return Y(r);case"MMM":return Le(e.months("short",!0,!1),1);case"MMMM":return Le(e.months("long",!0,!1),1);case"L":return Y(s);case"LL":return Y(r);case"LLL":return Le(e.months("short",!1,!1),1);case"LLLL":return Le(e.months("long",!1,!1),1);case"d":return Y(s);case"dd":return Y(r);case"o":return Y(o);case"ooo":return Y(i);case"HH":return Y(r);case"H":return Y(s);case"hh":return Y(r);case"h":return Y(s);case"mm":return Y(r);case"m":return Y(s);case"q":return Y(s);case"qq":return Y(r);case"s":return Y(s);case"ss":return Y(r);case"S":return Y(o);case"SSS":return Y(i);case"u":return yr(d);case"uu":return yr(s);case"uuu":return Y(n);case"a":return Le(e.meridiems(),0);case"kkkk":return Y(u);case"kk":return Y(f,Pr);case"W":return Y(s);case"WW":return Y(r);case"E":case"c":return Y(n);case"EEE":return Le(e.weekdays("short",!1,!1),1);case"EEEE":return Le(e.weekdays("long",!1,!1),1);case"ccc":return Le(e.weekdays("short",!0,!1),1);case"cccc":return Le(e.weekdays("long",!0,!1),1);case"Z":case"ZZ":return Ji(new RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case"ZZZ":return Ji(new RegExp(`([+-]${s.source})(${r.source})?`),2);case"z":return yr(/[a-z_+-/]{1,256}?/i);default:return g(F)}})(t)||{invalidReason:Gl};return k.token=t,k}const jl={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"},timeZoneName:{long:"ZZZZZ",short:"ZZZ"}};function Wl(t,e,n){const{type:r,value:i}=t;if(r==="literal")return{literal:!0,val:i};const u=n[r];let a=jl[r];if(typeof a=="object"&&(a=a[u]),a)return{literal:!1,val:a}}function Jl(t){return[`^${t.map(n=>n.regex).reduce((n,r)=>`${n}(${r.source})`,"")}$`,t]}function Yl(t,e,n){const r=t.match(e);if(r){const i={};let u=1;for(const a in n)if($t(n,a)){const s=n[a],o=s.groups?s.groups+1:1;!s.literal&&s.token&&(i[s.token.val[0]]=s.deser(r.slice(u,u+o))),u+=o}return[r,i]}else return[r,{}]}function Kl(t){const e=u=>{switch(u){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}};let n=null,r;return H(t.z)||(n=tt.create(t.z)),H(t.Z)||(n||(n=new Fe(t.Z)),r=t.Z),H(t.q)||(t.M=(t.q-1)*3+1),H(t.h)||(t.h<12&&t.a===1?t.h+=12:t.h===12&&t.a===0&&(t.h=0)),t.G===0&&t.y&&(t.y=-t.y),H(t.u)||(t.S=ui(t.u)),[Object.keys(t).reduce((u,a)=>{const s=e(a);return s&&(u[s]=t[a]),u},{}),n,r]}let Dr=null;function Ql(){return Dr||(Dr=B.fromMillis(1555555555555)),Dr}function Xl(t,e){if(t.literal)return t;const n=xe.macroTokenToFormatOpts(t.val),r=La(n,e);return r==null||r.includes(void 0)?t:r}function Ba(t,e){return Array.prototype.concat(...t.map(n=>Xl(n,e)))}function _a(t,e,n){const r=Ba(xe.parseFormat(n),t),i=r.map(a=>Hl(a,t)),u=i.find(a=>a.invalidReason);if(u)return{input:e,tokens:r,invalidReason:u.invalidReason};{const[a,s]=Jl(i),o=RegExp(a,"i"),[l,d]=Yl(e,o,s),[f,m,g]=d?Kl(d):[null,null,void 0];if($t(d,"a")&&$t(d,"H"))throw new tn("Can't include meridiem when specifying 24-hour format");return{input:e,tokens:r,regex:o,rawMatches:l,matches:d,result:f,zone:m,specificOffset:g}}}function ec(t,e,n){const{result:r,zone:i,specificOffset:u,invalidReason:a}=_a(t,e,n);return[r,i,u,a]}function La(t,e){return t?xe.create(e,t).formatDateTimeParts(Ql()).map(i=>Wl(i,e,t)):null}const $a=[0,31,59,90,120,151,181,212,243,273,304,334],Ra=[0,31,60,91,121,152,182,213,244,274,305,335];function Oe(t,e){return new Re("unit out of range",`you specified ${e} (of type ${typeof e}) as a ${t}, which is invalid`)}function Pa(t,e,n){const r=new Date(Date.UTC(t,e-1,n));t<100&&t>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return i===0?7:i}function Ua(t,e,n){return n+(Fn(t)?Ra:$a)[e-1]}function za(t,e){const n=Fn(t)?Ra:$a,r=n.findIndex(u=>uGn(e)?(s=e+1,a=1):s=e,{weekYear:s,weekNumber:a,weekday:u,...er(t)}}function Yi(t){const{weekYear:e,weekNumber:n,weekday:r}=t,i=Pa(e,1,4),u=cn(e);let a=n*7+r-i-3,s;a<1?(s=e-1,a+=cn(s)):a>u?(s=e+1,a-=cn(e)):s=e;const{month:o,day:l}=za(s,a);return{year:s,month:o,day:l,...er(t)}}function wr(t){const{year:e,month:n,day:r}=t,i=Ua(e,n,r);return{year:e,ordinal:i,...er(t)}}function Ki(t){const{year:e,ordinal:n}=t,{month:r,day:i}=za(e,n);return{year:e,month:r,day:i,...er(t)}}function tc(t){const e=Qn(t.weekYear),n=Qe(t.weekNumber,1,Gn(t.weekYear)),r=Qe(t.weekday,1,7);return e?n?r?!1:Oe("weekday",t.weekday):Oe("week",t.week):Oe("weekYear",t.weekYear)}function nc(t){const e=Qn(t.year),n=Qe(t.ordinal,1,cn(t.year));return e?n?!1:Oe("ordinal",t.ordinal):Oe("year",t.year)}function Ga(t){const e=Qn(t.year),n=Qe(t.month,1,12),r=Qe(t.day,1,zn(t.year,t.month));return e?n?r?!1:Oe("day",t.day):Oe("month",t.month):Oe("year",t.year)}function Va(t){const{hour:e,minute:n,second:r,millisecond:i}=t,u=Qe(e,0,23)||e===24&&n===0&&r===0&&i===0,a=Qe(n,0,59),s=Qe(r,0,59),o=Qe(i,0,999);return u?a?s?o?!1:Oe("millisecond",i):Oe("second",r):Oe("minute",n):Oe("hour",e)}const xr="Invalid DateTime",Qi=864e13;function Tn(t){return new Re("unsupported zone",`the zone "${t.name}" is not supported`)}function Fr(t){return t.weekData===null&&(t.weekData=qr(t.c)),t.weekData}function Yt(t,e){const n={ts:t.ts,zone:t.zone,c:t.c,o:t.o,loc:t.loc,invalid:t.invalid};return new B({...n,...e,old:n})}function qa(t,e,n){let r=t-e*60*1e3;const i=n.offset(r);if(e===i)return[r,e];r-=(i-e)*60*1e3;const u=n.offset(r);return i===u?[r,i]:[t-Math.min(i,u)*60*1e3,Math.max(i,u)]}function Xi(t,e){t+=e*60*1e3;const n=new Date(t);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function Ln(t,e,n){return qa(li(t),e,n)}function es(t,e){const n=t.o,r=t.c.year+Math.trunc(e.years),i=t.c.month+Math.trunc(e.months)+Math.trunc(e.quarters)*3,u={...t.c,year:r,month:i,day:Math.min(t.c.day,zn(r,i))+Math.trunc(e.days)+Math.trunc(e.weeks)*7},a=j.fromObject({years:e.years-Math.trunc(e.years),quarters:e.quarters-Math.trunc(e.quarters),months:e.months-Math.trunc(e.months),weeks:e.weeks-Math.trunc(e.weeks),days:e.days-Math.trunc(e.days),hours:e.hours,minutes:e.minutes,seconds:e.seconds,milliseconds:e.milliseconds}).as("milliseconds"),s=li(u);let[o,l]=qa(s,n,t.zone);return a!==0&&(o+=a,l=t.zone.offset(o)),{ts:o,o:l}}function Kt(t,e,n,r,i,u){const{setZone:a,zone:s}=n;if(t&&Object.keys(t).length!==0){const o=e||s,l=B.fromObject(t,{...n,zone:o,specificOffset:u});return a?l:l.setZone(s)}else return B.invalid(new Re("unparsable",`the input "${i}" can't be parsed as ${r}`))}function Mn(t,e,n=!0){return t.isValid?xe.create(ee.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(t,e):null}function Cr(t,e){const n=t.c.year>9999||t.c.year<0;let r="";return n&&t.c.year>=0&&(r+="+"),r+=ie(t.c.year,n?6:4),e?(r+="-",r+=ie(t.c.month),r+="-",r+=ie(t.c.day)):(r+=ie(t.c.month),r+=ie(t.c.day)),r}function ts(t,e,n,r,i,u){let a=ie(t.c.hour);return e?(a+=":",a+=ie(t.c.minute),(t.c.second!==0||!n)&&(a+=":")):a+=ie(t.c.minute),(t.c.second!==0||!n)&&(a+=ie(t.c.second),(t.c.millisecond!==0||!r)&&(a+=".",a+=ie(t.c.millisecond,3))),i&&(t.isOffsetFixed&&t.offset===0&&!u?a+="Z":t.o<0?(a+="-",a+=ie(Math.trunc(-t.o/60)),a+=":",a+=ie(Math.trunc(-t.o%60))):(a+="+",a+=ie(Math.trunc(t.o/60)),a+=":",a+=ie(Math.trunc(t.o%60)))),u&&(a+="["+t.zone.ianaName+"]"),a}const Za={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},rc={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},ic={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Ha=["year","month","day","hour","minute","second","millisecond"],sc=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],ac=["year","ordinal","hour","minute","second","millisecond"];function ns(t){const e={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[t.toLowerCase()];if(!e)throw new Ws(t);return e}function rs(t,e){const n=ut(e.zone,ae.defaultZone),r=ee.fromObject(e),i=ae.now();let u,a;if(H(t.year))u=i;else{for(const l of Ha)H(t[l])&&(t[l]=Za[l]);const s=Ga(t)||Va(t);if(s)return B.invalid(s);const o=n.offset(i);[u,a]=Ln(t,o,n)}return new B({ts:u,zone:n,loc:r,o:a})}function is(t,e,n){const r=H(n.round)?!0:n.round,i=(a,s)=>(a=oi(a,r||n.calendary?0:2,!0),e.loc.clone(n).relFormatter(n).format(a,s)),u=a=>n.calendary?e.hasSame(t,a)?0:e.startOf(a).diff(t.startOf(a),a).get(a):e.diff(t,a).get(a);if(n.unit)return i(u(n.unit),n.unit);for(const a of n.units){const s=u(a);if(Math.abs(s)>=1)return i(s,a)}return i(t>e?-0:0,n.units[n.units.length-1])}function ss(t){let e={},n;return t.length>0&&typeof t[t.length-1]=="object"?(e=t[t.length-1],n=Array.from(t).slice(0,t.length-1)):n=Array.from(t),[e,n]}class B{constructor(e){const n=e.zone||ae.defaultZone;let r=e.invalid||(Number.isNaN(e.ts)?new Re("invalid input"):null)||(n.isValid?null:Tn(n));this.ts=H(e.ts)?ae.now():e.ts;let i=null,u=null;if(!r)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(n))[i,u]=[e.old.c,e.old.o];else{const s=n.offset(this.ts);i=Xi(this.ts,s),r=Number.isNaN(i.year)?new Re("invalid input"):null,i=r?null:i,u=r?null:s}this._zone=n,this.loc=e.loc||ee.create(),this.invalid=r,this.weekData=null,this.c=i,this.o=u,this.isLuxonDateTime=!0}static now(){return new B({})}static local(){const[e,n]=ss(arguments),[r,i,u,a,s,o,l]=n;return rs({year:r,month:i,day:u,hour:a,minute:s,second:o,millisecond:l},e)}static utc(){const[e,n]=ss(arguments),[r,i,u,a,s,o,l]=n;return e.zone=Fe.utcInstance,rs({year:r,month:i,day:u,hour:a,minute:s,second:o,millisecond:l},e)}static fromJSDate(e,n={}){const r=po(e)?e.valueOf():NaN;if(Number.isNaN(r))return B.invalid("invalid input");const i=ut(n.zone,ae.defaultZone);return i.isValid?new B({ts:r,zone:i,loc:ee.fromObject(n)}):B.invalid(Tn(i))}static fromMillis(e,n={}){if(xt(e))return e<-Qi||e>Qi?B.invalid("Timestamp out of range"):new B({ts:e,zone:ut(n.zone,ae.defaultZone),loc:ee.fromObject(n)});throw new Me(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,n={}){if(xt(e))return new B({ts:e*1e3,zone:ut(n.zone,ae.defaultZone),loc:ee.fromObject(n)});throw new Me("fromSeconds requires a numerical input")}static fromObject(e,n={}){e=e||{};const r=ut(n.zone,ae.defaultZone);if(!r.isValid)return B.invalid(Tn(r));const i=ae.now(),u=H(n.specificOffset)?r.offset(i):n.specificOffset,a=Vn(e,ns),s=!H(a.ordinal),o=!H(a.year),l=!H(a.month)||!H(a.day),d=o||l,f=a.weekYear||a.weekNumber,m=ee.fromObject(n);if((d||s)&&f)throw new tn("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(l&&s)throw new tn("Can't mix ordinal dates with month/day");const g=f||a.weekday&&!d;let D,k,F=Xi(i,u);g?(D=sc,k=rc,F=qr(F)):s?(D=ac,k=ic,F=wr(F)):(D=Ha,k=Za);let U=!1;for(const Wt of D){const Yu=a[Wt];H(Yu)?U?a[Wt]=k[Wt]:a[Wt]=F[Wt]:U=!0}const pe=g?tc(a):s?nc(a):Ga(a),ft=pe||Va(a);if(ft)return B.invalid(ft);const ju=g?Yi(a):s?Ki(a):a,[Wu,Ju]=Ln(ju,u,r),mr=new B({ts:Wu,zone:r,o:Ju,loc:m});return a.weekday&&d&&e.weekday!==mr.weekday?B.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${mr.toISO()}`):mr}static fromISO(e,n={}){const[r,i]=Fl(e);return Kt(r,i,n,"ISO 8601",e)}static fromRFC2822(e,n={}){const[r,i]=Cl(e);return Kt(r,i,n,"RFC 2822",e)}static fromHTTP(e,n={}){const[r,i]=El(e);return Kt(r,i,n,"HTTP",n)}static fromFormat(e,n,r={}){if(H(e)||H(n))throw new Me("fromFormat requires an input string and a format");const{locale:i=null,numberingSystem:u=null}=r,a=ee.fromOpts({locale:i,numberingSystem:u,defaultToEN:!0}),[s,o,l,d]=ec(a,e,n);return d?B.invalid(d):Kt(s,o,r,`format ${n}`,e,l)}static fromString(e,n,r={}){return B.fromFormat(e,n,r)}static fromSQL(e,n={}){const[r,i]=Tl(e);return Kt(r,i,n,"SQL",e)}static invalid(e,n=null){if(!e)throw new Me("need to specify a reason the DateTime is invalid");const r=e instanceof Re?e:new Re(e,n);if(ae.throwOnInvalid)throw new oo(r);return new B({invalid:r})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,n={}){const r=La(e,ee.fromObject(n));return r?r.map(i=>i?i.val:null).join(""):null}static expandFormat(e,n={}){return Ba(xe.parseFormat(e),ee.fromObject(n)).map(i=>i.val).join("")}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Fr(this).weekYear:NaN}get weekNumber(){return this.isValid?Fr(this).weekNumber:NaN}get weekday(){return this.isValid?Fr(this).weekday:NaN}get ordinal(){return this.isValid?wr(this.c).ordinal:NaN}get monthShort(){return this.isValid?kn.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?kn.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?kn.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?kn.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}get isInLeapYear(){return Fn(this.year)}get daysInMonth(){return zn(this.year,this.month)}get daysInYear(){return this.isValid?cn(this.year):NaN}get weeksInWeekYear(){return this.isValid?Gn(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:n,numberingSystem:r,calendar:i}=xe.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:n,numberingSystem:r,outputCalendar:i}}toUTC(e=0,n={}){return this.setZone(Fe.instance(e),n)}toLocal(){return this.setZone(ae.defaultZone)}setZone(e,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(e=ut(e,ae.defaultZone),e.equals(this.zone))return this;if(e.isValid){let i=this.ts;if(n||r){const u=e.offset(this.ts),a=this.toObject();[i]=Ln(a,u,e)}return Yt(this,{ts:i,zone:e})}else return B.invalid(Tn(e))}reconfigure({locale:e,numberingSystem:n,outputCalendar:r}={}){const i=this.loc.clone({locale:e,numberingSystem:n,outputCalendar:r});return Yt(this,{loc:i})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const n=Vn(e,ns),r=!H(n.weekYear)||!H(n.weekNumber)||!H(n.weekday),i=!H(n.ordinal),u=!H(n.year),a=!H(n.month)||!H(n.day),s=u||a,o=n.weekYear||n.weekNumber;if((s||i)&&o)throw new tn("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&i)throw new tn("Can't mix ordinal dates with month/day");let l;r?l=Yi({...qr(this.c),...n}):H(n.ordinal)?(l={...this.toObject(),...n},H(n.day)&&(l.day=Math.min(zn(l.year,l.month),l.day))):l=Ki({...wr(this.c),...n});const[d,f]=Ln(l,this.o,this.zone);return Yt(this,{ts:d,o:f})}plus(e){if(!this.isValid)return this;const n=j.fromDurationLike(e);return Yt(this,es(this,n))}minus(e){if(!this.isValid)return this;const n=j.fromDurationLike(e).negate();return Yt(this,es(this,n))}startOf(e){if(!this.isValid)return this;const n={},r=j.normalizeUnit(e);switch(r){case"years":n.month=1;case"quarters":case"months":n.day=1;case"weeks":case"days":n.hour=0;case"hours":n.minute=0;case"minutes":n.second=0;case"seconds":n.millisecond=0;break}if(r==="weeks"&&(n.weekday=1),r==="quarters"){const i=Math.ceil(this.month/3);n.month=(i-1)*3+1}return this.set(n)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,n={}){return this.isValid?xe.create(this.loc.redefaultToEN(n)).formatDateTimeFromString(this,e):xr}toLocaleString(e=Rr,n={}){return this.isValid?xe.create(this.loc.clone(n),e).formatDateTime(this):xr}toLocaleParts(e={}){return this.isValid?xe.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:n=!1,suppressMilliseconds:r=!1,includeOffset:i=!0,extendedZone:u=!1}={}){if(!this.isValid)return null;const a=e==="extended";let s=Cr(this,a);return s+="T",s+=ts(this,a,n,r,i,u),s}toISODate({format:e="extended"}={}){return this.isValid?Cr(this,e==="extended"):null}toISOWeekDate(){return Mn(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:n=!1,includeOffset:r=!0,includePrefix:i=!1,extendedZone:u=!1,format:a="extended"}={}){return this.isValid?(i?"T":"")+ts(this,a==="extended",n,e,r,u):null}toRFC2822(){return Mn(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Mn(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?Cr(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:n=!1,includeOffsetSpace:r=!0}={}){let i="HH:mm:ss.SSS";return(n||e)&&(r&&(i+=" "),n?i+="z":e&&(i+="ZZ")),Mn(this,i,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():xr}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const n={...this.c};return e.includeConfig&&(n.outputCalendar=this.outputCalendar,n.numberingSystem=this.loc.numberingSystem,n.locale=this.loc.locale),n}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,n="milliseconds",r={}){if(!this.isValid||!e.isValid)return j.invalid("created by diffing an invalid DateTime");const i={locale:this.locale,numberingSystem:this.numberingSystem,...r},u=go(n).map(j.normalizeUnit),a=e.valueOf()>this.valueOf(),s=a?this:e,o=a?e:this,l=Pl(s,o,u,i);return a?l.negate():l}diffNow(e="milliseconds",n={}){return this.diff(B.now(),e,n)}until(e){return this.isValid?te.fromDateTimes(this,e):this}hasSame(e,n){if(!this.isValid)return!1;const r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(n)<=r&&r<=i.endOf(n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const n=e.base||B.fromObject({},{zone:this.zone}),r=e.padding?thisn.valueOf(),Math.min)}static max(...e){if(!e.every(B.isDateTime))throw new Me("max requires all arguments be DateTimes");return Li(e,n=>n.valueOf(),Math.max)}static fromFormatExplain(e,n,r={}){const{locale:i=null,numberingSystem:u=null}=r,a=ee.fromOpts({locale:i,numberingSystem:u,defaultToEN:!0});return _a(a,e,n)}static fromStringExplain(e,n,r={}){return B.fromFormatExplain(e,n,r)}static get DATE_SHORT(){return Rr}static get DATE_MED(){return Js}static get DATE_MED_WITH_WEEKDAY(){return ho}static get DATE_FULL(){return Ys}static get DATE_HUGE(){return Ks}static get TIME_SIMPLE(){return Qs}static get TIME_WITH_SECONDS(){return Xs}static get TIME_WITH_SHORT_OFFSET(){return ea}static get TIME_WITH_LONG_OFFSET(){return ta}static get TIME_24_SIMPLE(){return na}static get TIME_24_WITH_SECONDS(){return ra}static get TIME_24_WITH_SHORT_OFFSET(){return ia}static get TIME_24_WITH_LONG_OFFSET(){return sa}static get DATETIME_SHORT(){return aa}static get DATETIME_SHORT_WITH_SECONDS(){return ua}static get DATETIME_MED(){return oa}static get DATETIME_MED_WITH_SECONDS(){return la}static get DATETIME_MED_WITH_WEEKDAY(){return fo}static get DATETIME_FULL(){return ca}static get DATETIME_FULL_WITH_SECONDS(){return ha}static get DATETIME_HUGE(){return fa}static get DATETIME_HUGE_WITH_SECONDS(){return da}}function Qt(t){if(B.isDateTime(t))return t;if(t&&t.valueOf&&xt(t.valueOf()))return B.fromJSDate(t);if(t&&typeof t=="object")return B.fromObject(t);throw new Me(`Unknown datetime argument: ${t}, of type ${typeof t}`)}var as,us;function hd(t){return Ku.fromJSON(t.toJSON())}function uc(t){return t.toJSON?t.toJSON():t}function fd(t){return typeof t=="string"||t instanceof String}function dd(t){return typeof t=="number"}function os(t){return t instanceof Date}function md(t,e){return t===e||!(!os(t)||!os(e))&&t.getTime()===e.getTime()}function pd(t){if(t==null)return null;if(typeof t=="number")return t;switch(t.toLowerCase()){case"meters":case"meter":return 109404;case"miles":case"mile":return 109439;case"kilometers":case"kilometer":case"km":return 109414}return null}function gd(t){if(t==null)return null;switch(t.type){case"polygon":case"multipoint":case"polyline":return t.extent;case"point":return new we({xmin:t.x,ymin:t.y,xmax:t.x,ymax:t.y,spatialReference:t.spatialReference});case"extent":return t}return null}function yd(t){if(t==null)return null;if(typeof t=="number"||typeof t=="number")return t;switch(t.toLowerCase()){case"meters":case"meter":return 9001;case"miles":case"mile":return 9093;case"kilometers":case"kilometer":case"km":return 9036}return null}(function(t){t[t.Standardised=0]="Standardised",t[t.StandardisedNoInterval=1]="StandardisedNoInterval",t[t.SqlServer=2]="SqlServer",t[t.Oracle=3]="Oracle",t[t.Postgres=4]="Postgres",t[t.PGDB=5]="PGDB",t[t.FILEGDB=6]="FILEGDB",t[t.NotEvaluated=7]="NotEvaluated"})(as||(as={})),function(t){t[t.InFeatureSet=0]="InFeatureSet",t[t.NotInFeatureSet=1]="NotInFeatureSet",t[t.Unknown=2]="Unknown"}(us||(us={}));const Dd=1e3,wd={point:"point",polygon:"polygon",polyline:"polyline",multipoint:"multipoint",extent:"extent",esriGeometryPoint:"point",esriGeometryPolygon:"polygon",esriGeometryPolyline:"polyline",esriGeometryMultipoint:"multipoint",esriGeometryEnvelope:"extent",envelope:"extent"},ls={point:"esriGeometryPoint",polygon:"esriGeometryPolygon",polyline:"esriGeometryPolyline",multipoint:"esriGeometryMultipoint",extent:"esriGeometryEnvelope",esriGeometryPoint:"esriGeometryPoint",esriGeometryPolygon:"esriGeometryPolygon",esriGeometryPolyline:"esriGeometryPolyline",esriGeometryMultipoint:"esriGeometryMultipoint",esriGeometryEnvelope:"esriGeometryEnvelope",envelope:"esriGeometryEnvelope"},cs={"small-integer":"esriFieldTypeSmallInteger",integer:"esriFieldTypeInteger",long:"esriFieldTypeLong",single:"esriFieldTypeSingle",double:"esriFieldTypeDouble",string:"esriFieldTypeString",date:"esriFieldTypeDate",oid:"esriFieldTypeOID",geometry:"esriFieldTypeGeometry",blob:"esriFieldTypeBlob",raster:"esriFieldTypeRaster",guid:"esriFieldTypeGUID","global-id":"esriFieldTypeGlobalID",xml:"eesriFieldTypeXML",esriFieldTypeSmallInteger:"esriFieldTypeSmallInteger",esriFieldTypeInteger:"esriFieldTypeInteger",esriFieldTypeLong:"esriFieldTypeLong",esriFieldTypeSingle:"esriFieldTypeSingle",esriFieldTypeDouble:"esriFieldTypeDouble",esriFieldTypeString:"esriFieldTypeString",esriFieldTypeDate:"esriFieldTypeDate",esriFieldTypeOID:"esriFieldTypeOID",esriFieldTypeGeometry:"esriFieldTypeGeometry",esriFieldTypeBlob:"esriFieldTypeBlob",esriFieldTypeRaster:"esriFieldTypeRaster",esriFieldTypeGUID:"esriFieldTypeGUID",esriFieldTypeGlobalID:"esriFieldTypeGlobalID",esriFieldTypeXML:"eesriFieldTypeXML"};function xd(t){return t===void 0?"":t=(t=(t=t.replace(/\/featureserver\/[0-9]*/i,"/FeatureServer")).replace(/\/mapserver\/[0-9]*/i,"/MapServer")).split("?")[0]}function Fd(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});const n=typeof e.cycles=="boolean"&&e.cycles,r=e.cmp&&(i=e.cmp,function(a){return function(s,o){const l={key:s,value:a[s]},d={key:o,value:a[o]};return i(l,d)}});var i;const u=[];return function a(s){if(s&&s.toJSON&&typeof s.toJSON=="function"&&(s=s.toJSON()),s===void 0)return;if(typeof s=="number")return isFinite(s)?""+s:"null";if(typeof s!="object")return JSON.stringify(s);let o,l;if(Array.isArray(s)){for(l="[",o=0;on)throw new h(r,c.WrongNumberOfParameters,i)}function Zr(t){return t<0?-Math.round(-t):Math.round(t)}function Nt(){let t=Date.now();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),(e==="x"?n:3&n|8).toString(16)})}function gi(t,e){return isNaN(t)||e==null||e===""?t.toString():(e=lt(e,"\u2030",""),e=lt(e,"\xA4",""),io(t,{pattern:e}))}function sr(t,e){const n=B.fromJSDate(t);return e==null||e===""?n.toISO({suppressMilliseconds:!0}):n.toFormat(yi(e),{locale:zs(),numberingSystem:"latn"})}function yi(t){t=t.replace(/LTS|LT|LL?L?L?|l{1,4}/g,"[$&]");let e="";const n=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g;for(const r of t.match(n))switch(r){case"D":e+="d";break;case"DD":e+="dd";break;case"DDD":e+="o";break;case"d":e+="c";break;case"ddd":e+="ccc";break;case"dddd":e+="cccc";break;case"M":e+="L";break;case"MM":e+="LL";break;case"MMM":e+="LLL";break;case"MMMM":e+="LLLL";break;case"YY":e+="yy";break;case"Y":case"YYYY":e+="yyyy";break;case"Q":e+="q";break;case"Z":e+="ZZ";break;case"ZZ":e+="ZZZ";break;case"S":e+="'S'";break;case"SS":e+="'SS'";break;case"SSS":e+="u";break;case"A":case"a":e+="a";break;case"m":case"mm":case"h":case"hh":case"H":case"HH":case"s":case"ss":case"X":case"x":e+=r;break;default:r.length>=2&&r.slice(0,1)==="["&&r.slice(-1)==="]"?e+=`'${r.slice(1,-1)}'`:e+=`'${r}'`}return e}function K(t,e,n){switch(n){case">":return t>e;case"<":return t=":return t>=e;case"<=":return t<=e}return!1}function Di(t,e,n){if(t===null){if(e===null||e===A)return K(null,null,n);if(G(e))return K(0,e,n);if(v(e)||z(e))return K(0,p(e),n);if(Q(e))return K(0,e.getTime(),n)}if(t===A){if(e===null||e===A)return K(null,null,n);if(G(e))return K(0,e,n);if(v(e)||z(e))return K(0,p(e),n);if(Q(e))return K(0,e.getTime(),n)}else if(G(t)){if(G(e))return K(t,e,n);if(z(e))return K(t,p(e),n);if(e===null||e===A)return K(t,0,n);if(v(e))return K(t,p(e),n);if(Q(e))return K(t,e.getTime(),n)}else if(v(t)){if(v(e))return K(b(t),b(e),n);if(Q(e))return K(p(t),e.getTime(),n);if(G(e))return K(p(t),e,n);if(e===null||e===A)return K(p(t),0,n);if(z(e))return K(p(t),p(e),n)}else if(Q(t)){if(Q(e))return K(t,e,n);if(e===null||e===A)return K(t.getTime(),0,n);if(G(e))return K(t.getTime(),e,n);if(z(e)||v(e))return K(t.getTime(),p(e),n)}else if(z(t)){if(z(e))return K(t,e,n);if(G(e))return K(p(t),p(e),n);if(Q(e))return K(p(t),e.getTime(),n);if(e===null||e===A)return K(p(t),0,n);if(v(e))return K(p(t),p(e),n)}return!!Be(t,e)&&(n==="<="||n===">=")}function Be(t,e){if(t===e||t===null&&e===A||e===null&&t===A)return!0;if(Q(t)&&Q(e))return t.getTime()===e.getTime();if(t instanceof yn||t instanceof nt)return t.equalityTest(e);if(t instanceof W&&e instanceof W){const n=t.cache._arcadeCacheId,r=e.cache._arcadeCacheId;if(n!=null)return n===r}return t!==void 0&&e!==void 0&&t!==null&&e!==null&&typeof t=="object"&&typeof e=="object"&&(t._arcadeCacheId===e._arcadeCacheId&&t._arcadeCacheId!==void 0&&t._arcadeCacheId!==null||t._underlyingGraphic===e._underlyingGraphic&&t._underlyingGraphic!==void 0&&t._underlyingGraphic!==null)}function b(t,e){if(v(t))return t;if(t===null)return"";if(G(t))return gi(t,e);if(z(t))return t.toString();if(Q(t))return sr(t,e);if(t instanceof N)return JSON.stringify(t.toJSON());if(M(t)){const n=[];for(let r=0;rr.key===i.key?0:r.key==="spatialReference"?1:i.key==="spatialReference"||r.keyi.key?1:0);if(M(t)){const r=[];for(let i=0;i0)return t;return null}if(t instanceof ce){if(t.paths.length===0)return null;for(const e of t.paths)if(e.length>0)return t;return null}return t instanceof Ne?t.points.length===0?null:t:t instanceof we?t.xmin==="NaN"||t.xmin===null||isNaN(t.xmin)?null:t:null}function Ya(t,e){if(!t||!t.domain)return e;let n=null;if(t.field.type==="string"||t.field.type==="esriFieldTypeString")e=b(e);else{if(e==null)return null;if(e==="")return e;e=p(e)}for(let r=0;rs.id===r&&(i=s.domains&&s.domains[a.name],i&&i.type==="inherited"&&(i=hs(a.name,e),u=!0),!0)),u||i||(i=hs(t,e)),{field:a,domain:i}}function hs(t,e){let n;return e.fields.some(r=>(r.name.toLowerCase()===t.toLowerCase()&&(n=r.domain),!!n)),n}function Hr(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});const n=typeof e.cycles=="boolean"&&e.cycles,r=e.cmp&&(i=e.cmp,function(a){return function(s,o){const l={key:s,value:a[s]},d={key:o,value:a[o]};return i(l,d)}});var i;const u=[];return function a(s){if(s&&s.toJSON&&typeof s.toJSON=="function"&&(s=s.toJSON()),s===void 0)return;if(typeof s=="number")return isFinite(s)?""+s:"null";if(typeof s!="object")return JSON.stringify(s);let o,l;if(Array.isArray(s)){for(l="[",o=0;o0&&(u=t[0].spatialReference,n=t[0].hasZ,r=t[0].hasM)}else if(t instanceof nt)i=t._elements,i.length>0&&(n=t._hasZ,r=t._hasM,u=t.get(0).spatialReference);else{if(!L(t))throw new h(null,c.InvalidParameter,null);for(const a of t.toArray())Ut(i,a);i.length>0&&(u=t.get(0).spatialReference,n=t.get(0).hasZ===!0,r=t.get(0).hasM===!0)}return i.length===0?null:(Gs(i,r,n)||(i=i.slice(0).reverse()),new he({rings:[i],spatialReference:u,hasZ:n,hasM:r}))}return t}function fn(t,e){if(M(t)||L(t)){let n=!1,r=!1,i=[],u=e;if(M(t)){for(const a of t)Ut(i,a);i.length>0&&(u=t[0].spatialReference,n=t[0].hasZ===!0,r=t[0].hasM===!0)}else if(t instanceof nt)i=t._elements,i.length>0&&(n=t._hasZ,r=t._hasM,u=t.get(0).spatialReference);else if(L(t)){for(const a of t.toArray())Ut(i,a);i.length>0&&(u=t.get(0).spatialReference,n=t.get(0).hasZ===!0,r=t.get(0).hasM===!0)}return i.length===0?null:new ce({paths:[i],spatialReference:u,hasZ:n,hasM:r})}return t}function Rn(t,e){if(M(t)||L(t)){let n=!1,r=!1,i=[],u=e;if(M(t)){for(const a of t)Ut(i,a);i.length>0&&(u=t[0].spatialReference,n=t[0].hasZ===!0,r=t[0].hasM===!0)}else if(t instanceof nt)i=t._elements,i.length>0&&(n=t._hasZ,r=t._hasM,u=t.get(0).spatialReference);else if(L(t)){for(const a of t.toArray())Ut(i,a);i.length>0&&(u=t.get(0).spatialReference,n=t.get(0).hasZ===!0,r=t.get(0).hasM===!0)}return i.length===0?null:new Ne({points:i,spatialReference:u,hasZ:n,hasM:r})}return t}function oc(t,e=!1){const n=[];if(t===null)return n;if(M(t)===!0){for(let r=0;r{setTimeout(()=>{e(t)},0)})):t}function wi(t,e,n){switch(n){case"&":return t&e;case"|":return t|e;case"^":return t^e;case"<<":return t<>":return t>>e;case">>>":return t>>>e}}function ht(t,e=null){return t==null?null:z(t)||G(t)||v(t)?t:t instanceof N?(e==null?void 0:e.keepGeometryType)===!0?t:t.toJSON():t instanceof me?t.toArray().map(n=>ht(n,e)):t instanceof Array?t.map(n=>ht(n,e)):t instanceof Date?t:t!==null&&typeof t=="object"&&t.castAsJson!==void 0?t.castAsJson(e):null}async function cc(t,e,n,r,i){const u=await xi(t,e,n);i[r]=u}async function xi(t,e=null,n=null){if(t instanceof me&&(t=t.toArray()),t==null)return null;if(ct(t)||t instanceof N||t instanceof Date)return ht(t,n);if(t instanceof Array){const r=[],i=[];for(const u of t)u===null||ct(u)||u instanceof N||u instanceof Date?i.push(ht(u,n)):(i.push(null),r.push(cc(u,e,n,i.length-1,i)));return r.length>0&&await Promise.all(r),i}return t!==null&&typeof t=="object"&&t.castAsJsonAsync!==void 0?t.castAsJsonAsync(e,n):null}function Qa(t,e,n){const r=t.fullSchema();return r===null||!r.fields?null:ar(e,r,t,n)}function Pn(t){const e=t.fullSchema();return e===null?null:e.fields&&e.typeIdField?{subtypeField:e.typeIdField,subtypes:e.types?e.types.map(n=>({name:n.name,code:n.id})):[]}:null}function Xa(t,e,n,r){const i=t.fullSchema();if(i===null||!i.fields)return null;const u=ar(e,i,t,r);if(n===void 0)try{n=t.field(e)}catch{return null}return Ya(u,n)}function eu(t,e,n,r){const i=t.fullSchema();if(i===null||!i.fields)return null;if(n===void 0){try{n=t.field(e)}catch{return null}return n}return Ka(ar(e,i,t,r),n)}function tu(t){const e=t.fullSchema();if(e===null||!e.fields)return null;const n=[];for(const r of e.fields)n.push(uc(r));return{objectIdField:e.objectIdField,globalIdField:e.globalIdField,geometryType:ls[e.geometryType]===void 0?"":ls[e.geometryType],fields:n}}const nu=Object.freeze(Object.defineProperty({__proto__:null,ReturnResultE:ja,ImplicitResultE:Wa,ImplicitResult:Rt,ReturnResult:Ee,voidOperation:A,breakResult:Ue,continueResult:jt,multiReplace:lt,isFunctionParameter:X,isModule:mi,isSimpleType:ct,defaultUndefined:_,getType:pi,isString:v,isBoolean:z,isNumber:G,isInteger:Je,isArray:M,isFeature:ne,isFeatureSet:rr,isFeatureSetCollection:ir,isImmutableArray:L,isDate:Q,pcCheck:y,absRound:Zr,generateUUID:Nt,formatNumber:gi,formatDate:sr,standardiseDateFormat:yi,greaterThanLessThan:Di,equalityTest:Be,toString:b,toNumberArray:gt,toStringExplicit:Ae,toNumber:p,toDate:se,toDateTime:$n,toBoolean:Pt,fixSpatialReference:re,fixNullGeometry:yt,getDomainValue:Ya,getDomainCode:Ka,getDomain:ar,stableStringify:Hr,autoCastFeatureToGeometry:P,autoCastArrayOfPointsToPolygon:jr,autoCastArrayOfPointsToPolyline:fn,autoCastArrayOfPointsToMultiPoint:Rn,toStringArray:oc,tick:lc,binaryOperator:wi,castAsJson:ht,castAsJsonAsync:xi,featureFullDomain:Qa,featureSubtypes:Pn,featureDomainValueLookup:Xa,featureDomainCodeLookup:eu,featureSchema:tu},Symbol.toStringTag,{value:"Module"}));function Zn(t,e=!1){if(t==null)return null;if(G(t))return p(t);if(z(t))return Pt(t);if(v(t))return b(t);if(Q(t))return se(t);if(M(t)){const r=[];for(const i of t)r.push(Zn(i,e));return r}const n=new O;n.immutable=!1;for(const r of Object.keys(t)){const i=t[r];i!==void 0&&n.setField(r,Zn(i,e))}return n.immutable=e,n}class O{constructor(e){this.declaredClass="esri.arcade.Dictionary",this.attributes=null,this.plain=!1,this.immutable=!0,this.attributes=e instanceof O?e.attributes:e!=null?e:{}}field(e){const n=e.toLowerCase(),r=this.attributes[e];if(r!==void 0)return r;for(const i in this.attributes)if(i.toLowerCase()===n)return this.attributes[i];throw new h(null,c.FieldNotFound,null,{key:e})}setField(e,n){if(this.immutable)throw new h(null,c.Immutable,null);if(X(n))throw new h(null,c.NoFunctionInDictionary,null);const r=e.toLowerCase();if(this.attributes[e]===void 0){for(const i in this.attributes)if(i.toLowerCase()===r)return void(this.attributes[i]=n);this.attributes[e]=n}else this.attributes[e]=n}hasField(e){const n=e.toLowerCase();if(this.attributes[e]!==void 0)return!0;for(const r in this.attributes)if(r.toLowerCase()===n)return!0;return!1}keys(){let e=[];for(const n in this.attributes)e.push(n);return e=e.sort(),e}castToText(e=!1){let n="";for(const r in this.attributes){n!==""&&(n+=",");const i=this.attributes[r];i==null?n+=JSON.stringify(r)+":null":z(i)||G(i)||v(i)?n+=JSON.stringify(r)+":"+JSON.stringify(i):i instanceof N?n+=JSON.stringify(r)+":"+Ae(i):i instanceof me||i instanceof Array?n+=JSON.stringify(r)+":"+Ae(i,null,e):i instanceof Date?n+=e?JSON.stringify(r)+":"+JSON.stringify(i.getTime()):JSON.stringify(r)+":"+JSON.stringify(i):i!==null&&typeof i=="object"&&i.castToText!==void 0&&(n+=JSON.stringify(r)+":"+i.castToText(e))}return"{"+n+"}"}static convertObjectToArcadeDictionary(e,n=!0){const r=new O;r.immutable=!1;for(const i in e){const u=e[i];u!==void 0&&r.setField(i.toString(),Zn(u))}return r.immutable=n,r}static convertJsonToArcade(e,n=!1){return Zn(e,n)}castAsJson(e=null){const n={};for(let r in this.attributes){const i=this.attributes[r];i!==void 0&&(e!=null&&e.keyTranslate&&(r=e.keyTranslate(r)),n[r]=ht(i,e))}return n}async castDictionaryValueAsJsonAsync(e,n,r,i=null,u){const a=await xi(r,i,u);return e[n]=a,a}async castAsJsonAsync(e=null,n=null){const r={},i=[];for(let u in this.attributes){const a=this.attributes[u];n!=null&&n.keyTranslate&&(u=n.keyTranslate(u)),a!==void 0&&(ct(a)||a instanceof N||a instanceof Date?r[u]=ht(a,n):i.push(this.castDictionaryValueAsJsonAsync(r,u,a,e,n)))}return i.length>0&&await Promise.all(i),r}}class q{constructor(){this.arcadeDeclaredClass="esri.arcade.Feature",this._optimizedGeomDefinition=null,this._geometry=null,this.attributes=null,this._layer=null,this._datesfixed=!0,this.immutable=!0,this._datefields=null,this.immutable=!0}static createFromGraphic(e){const n=new q;return n._geometry=Ni(e.geometry)?e.geometry:null,e.attributes===void 0||e.attributes===null?n.attributes={}:n.attributes=e.attributes,e._sourceLayer?(n._layer=e._sourceLayer,n._datesfixed=!1):e._layer?(n._layer=e._layer,n._datesfixed=!1):e.layer&&"fields"in e.layer?(n._layer=e.layer,n._datesfixed=!1):e.sourceLayer&&"fields"in e.sourceLayer&&(n._layer=e.sourceLayer,n._datesfixed=!1),n}static createFromArcadeFeature(e){const n=new q;return n._datesfixed=e._datesfixed,n.attributes=e.attributes,n._geometry=e._geometry,n._optimizedGeomDefinition=e._optimizedGeomDefinition,e._layer&&(n._layer=e._layer),n}static createFromOptimisedFeature(e,n,r){const i=new q;return i._geometry=e.geometry?{geometry:e.geometry}:null,i._optimizedGeomDefinition=r,i.attributes=e.attributes||{},i._layer=n,i._datesfixed=!1,i}static createFromArcadeDictionary(e){const n=new q;return n.attributes=e.field("attributes"),n.attributes!==null&&n.attributes instanceof O?(n.attributes=n.attributes.attributes,n.attributes===null&&(n.attributes={})):n.attributes={},n._geometry=e.field("geometry"),n._geometry!==null&&(n._geometry instanceof O?n._geometry=q.parseGeometryFromDictionary(n._geometry):n._geometry instanceof N||(n._geometry=null)),n}static createFromGraphicLikeObject(e,n,r=null){const i=new q;return n===null&&(n={}),i.attributes=n,i._geometry=Ni(e)?e:null,i._layer=r,i._layer&&(i._datesfixed=!1),i}repurposeFromGraphicLikeObject(e,n,r=null){n===null&&(n={}),this.attributes=n,this._geometry=e||null,this._layer=r,this._layer?this._datesfixed=!1:this._datesfixed=!0}castToText(e=!1){let n="";this._datesfixed===!1&&this._fixDates();for(const r in this.attributes){n!==""&&(n+=",");const i=this.attributes[r];i==null?n+=JSON.stringify(r)+":null":z(i)||G(i)||v(i)?n+=JSON.stringify(r)+":"+JSON.stringify(i):i instanceof N?n+=JSON.stringify(r)+":"+Ae(i):i instanceof me||i instanceof Array?n+=JSON.stringify(r)+":"+Ae(i,null,e):i instanceof Date?n+=e?JSON.stringify(r)+":"+JSON.stringify(i.getTime()):JSON.stringify(r)+":"+JSON.stringify(i):i!==null&&typeof i=="object"&&i.castToText!==void 0&&(n+=JSON.stringify(r)+":"+i.castToText(e))}return'{"geometry":'+(this.geometry()===null?"null":Ae(this.geometry()))+',"attributes":{'+n+"}}"}_fixDates(){if(this._datefields!==null)return this._datefields.length>0&&this._fixDateFields(this._datefields),void(this._datesfixed=!0);const e=[],n=this._layer.fields;for(let r=0;r0&&this._fixDateFields(e),this._datesfixed=!0}_fixDateFields(e){this.attributes={...this.attributes};for(let n=0;n!n&&(i.type==="Identifier"&&i.name&&i.name.toLowerCase()===r&&(n=!0),!0)),n}function iu(t){const e=[];return Z(t,n=>(n.type==="ImportDeclaration"&&n.source&&n.source.value&&e.push({libname:n.specifiers[0].local.name.toLowerCase(),source:n.source.value}),!0)),e}function dc(t,e){let n=!1;const r=e.toLowerCase();return Z(t,i=>!n&&(i.type!=="CallExpression"||i.callee.type!=="Identifier"||!i.callee.name||i.callee.name.toLowerCase()!==r||(n=!0,!1))),n}function mc(t){const e=[];return Z(t,n=>{var r;return n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?e.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&e.push(n.object.name.toLowerCase()+"."+((r=n.property.value)==null?void 0:r.toString().toLowerCase())),!1)}),e}function pc(t){const e=[];return Z(t,n=>{var r;if(n.type==="CallExpression"){if(n.callee.type==="Identifier"&&n.callee.name.toLowerCase()==="expects"){let i="";for(let u=0;u<(n.arguments||[]).length;u++)u===0?n.arguments[u].type==="Identifier"&&(i=n.arguments[u].name.toLowerCase()):i&&n.arguments[u].type==="Literal"&&ds(n.arguments[u].value)&&e.push(i+"."+n.arguments[u].value.toLowerCase());return!1}if(n.callee.type==="Identifier"&&["domainname","domaincode","domain","haskey"].includes(n.callee.name.toLowerCase())&&n.arguments.length>=2){let i="";return n.arguments[0].type==="Identifier"&&(i=n.arguments[0].name.toLowerCase()),i&&n.arguments[1].type==="Literal"&&ds(n.arguments[1].value)&&e.push(i+"."+n.arguments[1].value.toLowerCase()),!1}}return n.type!=="MemberExpression"||n.object.type!=="Identifier"||(n.computed===!1&&n.object&&n.object.name&&n.property&&n.property.type==="Identifier"&&n.property.name?e.push(n.object.name.toLowerCase()+"."+n.property.name.toLowerCase()):n.object&&n.object.name&&n.property&&n.property.type==="Literal"&&typeof n.property.value=="string"&&e.push(n.object.name.toLowerCase()+"."+((r=n.property.value)==null?void 0:r.toString().toLowerCase())),!1)}),e}function Jr(t){const e=[];return Z(t,n=>(n.type==="CallExpression"&&n.callee.type==="Identifier"&&e.push(n.callee.name.toLowerCase()),!0)),e}function Sn(t,e=[]){let n=null;if(t.usesFeatureSet===void 0){n===null&&(n=Jr(t)),t.usesFeatureSet=!1;for(let r=0;r0){for(const r of e)if(ru(t,r)){t.usesFeatureSet=!0,t.isAsync=!0;break}}}if(t.usesModules===void 0&&(t.usesModules=!1,iu(t).length>0&&(t.usesModules=!0)),t.usesGeometry===void 0){t.usesGeometry=!1,n===null&&(n=Jr(t));for(let r=0;r0||o.length>0;)if(s.length>0&&o.length>0){let f=l(s[0],o[0]);isNaN(f)&&(f=0),f<=0?(d.push(s[0]),s=s.slice(1)):(d.push(o[0]),o=o.slice(1))}else s.length>0?(d.push(s[0]),s=s.slice(1)):o.length>0&&(d.push(o[0]),o=o.slice(1));return d}async function i(s,o){const l=s.length,d=Math.floor(l/2);if(l===0)return[];if(l===1)return[s[0]];const f=[await i(s.slice(0,d),o),await i(s.slice(d,l),o)];return u(f[0],f[1],o,[])}async function u(s,o,l,d){const f=d;if(!(s.length>0||o.length>0))return d;if(s.length>0&&o.length>0){let m=await l(s[0],o[0]);return isNaN(m)&&(m=1),m<=0?(f.push(s[0]),s=s.slice(1)):(f.push(o[0]),o=o.slice(1)),u(s,o,l,d)}return s.length>0?(f.push(s[0]),u(s=s.slice(1),o,l,d)):o.length>0?(f.push(o[0]),u(s,o=o.slice(1),l,d)):void 0}function a(s,o,l,d){y(l,1,2,s,o);let f=l[0];if(L(f)&&(f=f.toArray()),M(f)===!1)throw new h(s,c.InvalidParameter,o);if(l.length>1){if(X(l[1])===!1)throw new h(s,c.InvalidParameter,o);let F=f;const U=l[1].createFunction(s);return d?i(F,U):(F=n(F,(pe,ft)=>U(pe,ft)),F)}let m=f;if(m.length===0)return[];const g={};for(let F=0;F1||k==="String"?n(m,(F,U)=>{if(F==null||F===A)return U==null||U===A?0:1;if(U==null||U===A)return-1;const pe=b(F),ft=b(U);return peF-U):k==="Boolean"?n(m,(F,U)=>F===U?0:U?-1:1):k==="Date"?n(m,(F,U)=>U-F):m.slice(0),m}t.functions.array=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{y(f,1,2,s,o);const m=p(f[0]);if(isNaN(m)||Je(m)===!1)throw new h(s,c.InvalidParameter,o);const g=_(f[1],null),D=new Array(m);return D.fill(g),D})},t.functions.front=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{if(y(f,1,1,s,o),L(f[0])){if(f[0].length()<=0)throw new h(s,c.OutOfBounds,o);return f[0].get(0)}if(M(f[0])){if(f[0].length<=0)throw new h(s,c.OutOfBounds,o);return f[0][0]}throw new h(s,c.InvalidParameter,o)})},t.functions.back=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{if(y(f,1,1,s,o),L(f[0])){if(f[0].length()<=0)throw new h(s,c.OutOfBounds,o);return f[0].get(f[0].length()-1)}if(M(f[0])){if(f[0].length<=0)throw new h(s,c.OutOfBounds,o);return f[0][f[0].length-1]}throw new h(s,c.InvalidParameter,o)})},t.functions.push=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{if(y(f,1,2,s,o),M(f[0]))return f[0][f[0].length]=f[1],f[0].length;throw new h(s,c.InvalidParameter,o)})},t.functions.pop=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{if(y(f,1,1,s,o),M(f[0])){if(f[0].length<=0)throw new h(s,c.OutOfBounds,o);const m=f[0][f[0].length-1];return f[0].length=f[0].length-1,m}throw new h(s,c.InvalidParameter,o)})},t.functions.erase=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{if(y(f,2,2,s,o),M(f[0])){let m=p(f[1]);if(isNaN(m)||Je(m)===!1)throw new h(s,c.InvalidParameter,o);const g=f[0];if(g.length<=0)throw new h(s,c.OutOfBounds,o);if(m<0&&(m=g.length+m),m<0)throw new h(s,c.OutOfBounds,o);if(m>=g.length)throw new h(s,c.OutOfBounds,o);return g.splice(m,1),A}throw new h(s,c.InvalidParameter,o)})},t.functions.insert=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{if(y(f,3,3,s,o),M(f[0])){const m=p(f[1]);if(isNaN(m)||Je(m)===!1)throw new h(s,c.InvalidParameter,o);const g=f[2],D=f[0];if(m>D.length)throw new h(s,c.OutOfBounds,o);if(m<0&&m<-1*D.length)throw new h(s,c.OutOfBounds,o);return m===D.length?(D[m]=g,A):(D.splice(m,0,g),A)}throw new h(s,c.InvalidParameter,o)})},t.functions.resize=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{if(y(f,2,3,s,o),M(f[0])){const m=p(f[1]);if(isNaN(m)||Je(m)===!1)throw new h(s,c.InvalidParameter,o);if(m<0)throw new h(s,c.InvalidParameter,o);const g=_(f[2],null),D=f[0];if(D.length>=m)return D.length=m,A;const k=D.length;D.length=m;for(let F=k;F{if(y(f,2,2,s,o),M(f[0])){const m=f[1];return f[0].findIndex(g=>Be(g,m))>-1}if(L(f[0])){const m=f[1];return f[0].toArray().findIndex(g=>Be(g,m))>-1}throw new h(s,c.InvalidParameter,o)})},t.functions.slice=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{if(y(f,1,3,s,o),M(f[0])){const m=p(_(f[1],0)),g=p(_(f[2],f[0].length));if(isNaN(m)||Je(m)===!1)throw new h(s,c.InvalidParameter,o);if(isNaN(g)||Je(g)===!1)throw new h(s,c.InvalidParameter,o);return f[0].slice(m,g)}if(L(f[0])){const m=f[0],g=p(_(f[1],0)),D=p(_(f[2],m.length()));if(isNaN(g)||Je(g)===!1)throw new h(s,c.InvalidParameter,o);if(isNaN(D)||Je(D)===!1)throw new h(s,c.InvalidParameter,o);return m.toArray().slice(g,D)}throw new h(s,c.InvalidParameter,o)})},t.functions.splice=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{const m=[];for(let g=0;g{if(y(f,2,2,s,o),M(f[0]))return p(f[1])>=f[0].length?f[0].slice(0):f[0].slice(0,p(f[1]));if(L(f[0]))return p(f[1])>=f[0].length()?f[0].slice(0):f[0].slice(0,p(f[1]));throw new h(s,c.InvalidParameter,o)})},t.functions.first=function(s,o){return t.standardFunction(s,o,(l,d,f)=>(y(f,1,1,s,o),M(f[0])?f[0].length===0?null:f[0][0]:L(f[0])?f[0].length()===0?null:f[0].get(0):null))},t.mode==="sync"&&(t.functions.sort=function(s,o){return t.standardFunction(s,o,(l,d,f)=>a(s,o,f,!1))},t.functions.any=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o);for(const D of g){const k=m(D);if(z(k)&&k===!0)return!0}return!1})},t.functions.all=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o);for(const D of g)if(m(D)!==!0)return!1;return!0})},t.functions.none=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o);for(const D of g)if(m(D)===!0)return!1;return!0})},t.functions.reduce=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{y(f,2,3,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o);return f.length===2?g.length===0?null:g.reduce((D,k)=>{const F=m(D,k);return D=F!==void 0&&F!==A?F:null}):g.reduce((D,k)=>{const F=m(D,k);return D=F!==void 0&&F!==A?F:null},f[2])})},t.functions.map=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o),D=[];for(const k of g){const F=m(k);F!==void 0&&F!==A?D.push(F):D.push(null)}return D})},t.functions.filter=function(s,o){return t.standardFunction(s,o,(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o),D=[];for(const k of g)m(k)===!0&&D.push(k);return D})}),t.mode==="async"&&(t.functions.sort=function(s,o){return t.standardFunctionAsync(s,o,(l,d,f)=>a(s,o,f,!0))},t.functions.any=function(s,o){return t.standardFunctionAsync(s,o,async(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o);for(const D of g){const k=await m(D);let F=null;if(F=at(F)?await k:k,z(F)&&F===!0)return!0}return!1})},t.functions.all=function(s,o){return t.standardFunctionAsync(s,o,async(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o);for(const D of g){const k=await m(D);let F=null;if(F=at(F)?await k:k,F!==!0)return!1}return!0})},t.functions.none=function(s,o){return t.standardFunctionAsync(s,o,async(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o);for(const D of g){const k=await m(D);let F=null;if(F=at(F)?await k:k,F===!0)return!1}return!0})},t.functions.filter=function(s,o){return t.standardFunctionAsync(s,o,async(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o),D=[];for(const k of g){const F=await m(k);let U=null;U=at(U)?await F:F,U===!0&&D.push(k)}return D})},t.functions.reduce=function(s,o){return t.standardFunctionAsync(s,o,(l,d,f)=>{y(f,2,3,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o);let D=null;if(f.length>2){const k=_(f[2],null);D=g.reduce(async(F,U)=>{let pe=await F;return pe!==void 0&&pe!==A||(pe=null),m(pe,U)},Promise.resolve(k))}else{if(g.length===0)return null;D=g.reduce(async(k,F,U)=>{if(U<=1)return m(k,F);let pe=await k;return pe!==void 0&&pe!==A||(pe=null),m(pe,F)})}return D.then(k=>k!==void 0&&k!==A?k:null)})},t.functions.map=function(s,o){return t.standardFunctionAsync(s,o,async(l,d,f)=>{y(f,2,2,s,o);const m=f[1].createFunction(s),g=e(f[0],s,o),D=[];for(const k of g){const F=await m(k);let U=null;U=at(U)?await F:F,U!==void 0&&U!==A?D.push(U):D.push(null)}return D})})}const Yr=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:gc},Symbol.toStringTag,{value:"Module"}));function su(t){const e=new Date(t.getTime()),n=e.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);const i=Hn(r),u=new Date(0);u.setFullYear(n,0,4),u.setHours(0,0,0,0);const a=Hn(u);return e.getTime()>=i.getTime()?n+1:e.getTime()>=a.getTime()?n:n-1}function Hn(t){const n=new Date(t.getTime()),r=n.getDay(),i=(r<1?7:0)+r-1;return n.setDate(n.getDate()-i),n.setHours(0,0,0,0),n}function yc(t){const e=su(t),n=new Date(0);return n.setFullYear(e,0,4),n.setHours(0,0,0,0),Hn(n)}function Dc(t,e,n){return t+(wc(n)?Fc:xc)[e]}function wc(t){return t%4==0&&(t%100!=0||t%400==0)}const xc=[0,31,59,90,120,151,181,212,243,273,304,334],Fc=[0,31,60,91,121,152,182,213,244,274,305,335];function vt(t){return t===null?t:isNaN(t.getTime())?null:t}function au(t,e){t.today=function(n,r){return e(n,r,(i,u,a)=>{y(a,0,0,n,r);const s=new Date;return s.setHours(0,0,0,0),s})},t.now=function(n,r){return e(n,r,(i,u,a)=>(y(a,0,0,n,r),new Date))},t.timestamp=function(n,r){return e(n,r,(i,u,a)=>{y(a,0,0,n,r);let s=new Date;return s=new Date(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate(),s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds()),s})},t.toutc=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?null:new Date(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate(),s.getUTCHours(),s.getUTCMinutes(),s.getUTCSeconds(),s.getUTCMilliseconds())})},t.tolocal=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?null:B.utc(s.getFullYear(),s.getMonth()+1,s.getDate(),s.getHours(),s.getMinutes(),s.getSeconds(),s.getMilliseconds()).toJSDate()})},t.day=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:s.getDate()})},t.month=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:s.getMonth()})},t.year=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:s.getFullYear()})},t.hour=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:s.getHours()})},t.second=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:s.getSeconds()})},t.millisecond=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:s.getMilliseconds()})},t.minute=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:s.getMinutes()})},t.week=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,2,n,r);const s=se(a[0]);if(s===null)return NaN;const o=p(_(a[1],0));if(o<0||o>6)throw new h(n,c.InvalidParameter,r);const l=s.getDate(),d=s.getMonth(),f=s.getFullYear(),m=s.getDay(),g=Dc(l,d,f)-1,D=Math.floor(g/7);return m-o+(m-o<0?7:0){y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:s.getDay()})},t.isoweekday=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);if(s===null)return NaN;let o=s.getDay();return o===0&&(o=7),o})},t.isomonth=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:s.getMonth()+1})},t.isoweek=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);if(s===null)return NaN;const o=Hn(s).getTime()-yc(s).getTime();return Math.round(o/6048e5)+1})},t.isoyear=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=se(a[0]);return s===null?NaN:su(s)})},t.date=function(n,r){return e(n,r,(i,u,a)=>{if(y(a,0,7,n,r),a.length===3)return vt(new Date(p(a[0]),p(a[1]),p(a[2]),0,0,0,0));if(a.length===4)return vt(new Date(p(a[0]),p(a[1]),p(a[2]),p(a[3]),0,0,0));if(a.length===5)return vt(new Date(p(a[0]),p(a[1]),p(a[2]),p(a[3]),p(a[4]),0,0));if(a.length===6)return vt(new Date(p(a[0]),p(a[1]),p(a[2]),p(a[3]),p(a[4]),p(a[5]),0));if(a.length===7)return vt(new Date(p(a[0]),p(a[1]),p(a[2]),p(a[3]),p(a[4]),p(a[5]),p(a[6])));if(a.length===2){let s,o=b(a[1]);return o===""?null:(o=yi(o),s=o==="X"?B.fromSeconds(p(a[0])):o==="x"?B.fromMillis(p(a[0])):B.fromFormat(b(a[0]),o,{locale:zs(),numberingSystem:"latn"}),s.isValid?s.toJSDate():null)}if(a.length===1){if(v(a[0])){if(a[0].replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")==="")return null;if(/^[0-9][0-9][0-9][0-9]$/.test(a[0])===!0)return se(a[0]+"-01-01")}const s=p(a[0]);return isNaN(s)===!1?vt(new Date(s)):se(a[0])}return a.length===0?new Date:void 0})},t.datediff=function(n,r){return e(n,r,(i,u,a)=>{y(a,2,3,n,r);const s=$n(a[0]),o=$n(a[1]);if(s===null||o===null)return NaN;switch(b(a[2]).toLowerCase()){case"days":case"day":case"d":return s.diff(o,"days").days;case"months":case"month":return s.diff(o,"months").months;case"minutes":case"minute":case"m":return a[2]==="M"?s.diff(o,"months").months:s.diff(o,"minutes").minutes;case"seconds":case"second":case"s":return s.diff(o,"seconds").seconds;case"milliseconds":case"millisecond":case"ms":default:return s.diff(o).milliseconds;case"hours":case"hour":case"h":return s.diff(o,"hours").hours;case"years":case"year":case"y":return s.diff(o,"years").years}})},t.dateadd=function(n,r){return e(n,r,(i,u,a)=>{y(a,2,3,n,r);const s=$n(a[0]);if(s===null)return null;let o=p(a[1]);if(isNaN(o))return s.toJSDate();let l="milliseconds";switch(b(a[2]).toLowerCase()){case"days":case"day":case"d":l="days",o=Zr(o);break;case"months":case"month":l="months",o=Zr(o);break;case"minutes":case"minute":case"m":l=a[2]==="M"?"months":"minutes";break;case"seconds":case"second":case"s":l="seconds";break;case"milliseconds":case"millisecond":case"ms":l="milliseconds";break;case"hours":case"hour":case"h":l="hours";break;case"years":case"year":case"y":l="years"}return s.plus({[l]:o}).toJSDate()})}}function Xt(t,e,n){return Math.sqrt((t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]!==void 0&&e[2]!==void 0?(t[2]*n-e[2]*n)**2:0))}const rn=[];for(const t of[[9002,56146130,6131,6132,8050,8051,8228],[9003,5702,6358,6359,6360,8052,8053],[9095,5754]]){const e=t[0];for(let n=1;n0?(r.x/=i,r.y/=i,e&&(r.z/=i),n&&(r.m/=i)):(r.x=t[0][0],r.y=t[0][1],e&&(r.z=t[0][2]),n&&e?r.m=t[0][3]:n&&(r.m=t[0][2])),r}function Ec(t,e,n,r){const i={x:(t[0]+e[0])/2,y:(t[1]+e[1])/2};return n&&(i.z=(t[2]+e[2])/2),n&&r?i.m=(t[3]+e[3])/2:r&&(i.m=(t[2]+e[2])/2),i}function Ac(t,e){if(t.length<=1)return 0;let n=0;for(let r=1;r0?(n.x/=i,n.y/=i,t.hasZ===!0&&(n.z/=i),t.hasM===!0&&(n.m/=i),new W(n)):r>0?(e.x/=r,e.y/=r,t.hasZ===!0&&(n.z/=r),t.hasM===!0&&(e.m/=r),new W(e)):null}function bc(t){if(t.points.length===0)return null;let e=0,n=0,r=0,i=0;for(let a=0;a=r;)t-=e;return t}function ou(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}function Tc(t,e){return lr(ou(t,e),2*Math.PI)*(180/Math.PI)}function Mc(t,e){return lr(Math.PI/2-ou(t,e),2*Math.PI)*(180/Math.PI)}function lu(t,e,n){const r={x:t.x-e.x,y:t.y-e.y},i={x:n.x-e.x,y:n.y-e.y};return Math.atan2(kc(r,i),Ic(r,i))}function Nc(t,e,n){return lr(lu(t,e,n),2*Math.PI)*(180/Math.PI)}function Oc(t,e,n){return lr(-1*lu(t,e,n),2*Math.PI)*(180/Math.PI)}dn[9002]=.3048,dn[9003]=.3048006096012192,dn[9095]=.3048007491;const oe=[0,0];function ps(t){for(let e=0;e{y(a,1,1,n,r);let s=[],o=!1,l=!1;if(a[0]===null)return!1;if(M(a[0])){for(const d of a[0]){if(!(d instanceof W))throw new h(n,c.InvalidParameter,r);s.push(d.hasZ?d.hasM?[d.x,d.y,d.z,d.m]:[d.x,d.y,d.z]:[d.x,d.y])}s.length>0&&(o=a[0][0].hasZ,l=a[0][0].hasM)}else if(a[0]instanceof nt)s=a[0]._elements,s.length>0&&(o=a[0]._hasZ,l=a[0]._hasM);else{if(!L(a[0]))throw new h(n,c.InvalidParameter,r);for(const d of a[0].toArray()){if(!(d instanceof W))throw new h(n,c.InvalidParameter,r);s.push(d.hasZ?d.hasM?[d.x,d.y,d.z,d.m]:[d.x,d.y,d.z]:[d.x,d.y])}s.length>0&&(o=a[0].get(0).hasZ,l=a[0].get(0).hasM)}return!(s.length<3)&&Gs(s,l,o)})},t.polygon=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);let s=null;if(a[0]instanceof O){if(s=re(q.parseGeometryFromDictionary(a[0]),n.spatialReference),!(s instanceof he))throw new h(n,c.InvalidParameter,r)}else s=a[0]instanceof he?Ce(a[0].toJSON()):re(new he(JSON.parse(a[0])),n.spatialReference);if(s!==null&&s.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return yt(s)})},t.polyline=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);let s=null;if(a[0]instanceof O){if(s=re(q.parseGeometryFromDictionary(a[0]),n.spatialReference),!(s instanceof ce))throw new h(n,c.InvalidParameter,r)}else s=a[0]instanceof ce?Ce(a[0].toJSON()):re(new ce(JSON.parse(a[0])),n.spatialReference);if(s!==null&&s.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return yt(s)})},t.point=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);let s=null;if(a[0]instanceof O){if(s=re(q.parseGeometryFromDictionary(a[0]),n.spatialReference),!(s instanceof W))throw new h(n,c.InvalidParameter,r)}else s=a[0]instanceof W?Ce(a[0].toJSON()):re(new W(JSON.parse(a[0])),n.spatialReference);if(s!==null&&s.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return yt(s)})},t.multipoint=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);let s=null;if(a[0]instanceof O){if(s=re(q.parseGeometryFromDictionary(a[0]),n.spatialReference),!(s instanceof Ne))throw new h(n,c.InvalidParameter,r)}else s=a[0]instanceof Ne?Ce(a[0].toJSON()):re(new Ne(JSON.parse(a[0])),n.spatialReference);if(s!==null&&s.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return yt(s)})},t.extent=function(n,r){return e(n,r,(i,u,a)=>{var o;a=P(a),y(a,1,1,n,r);let s=null;if(a[0]instanceof O)s=re(q.parseGeometryFromDictionary(a[0]),n.spatialReference);else if(a[0]instanceof W){const l={xmin:a[0].x,ymin:a[0].y,xmax:a[0].x,ymax:a[0].y,spatialReference:a[0].spatialReference.toJSON()},d=a[0];d.hasZ?(l.zmin=d.z,l.zmax=d.z):d.hasM&&(l.mmin=d.m,l.mmax=d.m),s=Ce(l)}else s=a[0]instanceof he||a[0]instanceof ce||a[0]instanceof Ne?Ce((o=a[0].extent)==null?void 0:o.toJSON()):a[0]instanceof we?Ce(a[0].toJSON()):re(new we(JSON.parse(a[0])),n.spatialReference);if(s!==null&&s.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return yt(s)})},t.geometry=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);let s=null;if(a[0]===null)return null;if(s=Nn(a[0])?re(a[0].geometry(),n.spatialReference):a[0]instanceof O?re(q.parseGeometryFromDictionary(a[0]),n.spatialReference):re(Ce(JSON.parse(a[0])),n.spatialReference),s!==null&&s.spatialReference.equals(n.spatialReference)===!1)throw new h(n,c.WrongSpatialReference,r);return yt(s)})},t.setgeometry=function(n,r){return e(n,r,(i,u,a)=>{if(y(a,2,2,n,r),!Nn(a[0]))throw new h(n,c.InvalidParameter,r);if(a[0].immutable===!0)throw new h(n,c.Immutable,r);if(!(a[1]instanceof N||a[1]===null))throw new h(n,c.InvalidParameter,r);return a[0]._geometry=a[1],A})},t.feature=function(n,r){return e(n,r,(i,u,a)=>{if(a.length===0)throw new h(n,c.WrongNumberOfParameters,r);let s=null;if(a.length===1)if(v(a[0]))s=q.fromJson(JSON.parse(a[0]));else if(Nn(a[0]))s=q.createFromArcadeFeature(a[0]);else if(a[0]instanceof N)s=q.createFromGraphicLikeObject(a[0],null,null);else{if(!(a[0]instanceof O))throw new h(n,c.InvalidParameter,r);{let o=a[0].hasField("geometry")?a[0].field("geometry"):null,l=a[0].hasField("attributes")?a[0].field("attributes"):null;o!==null&&o instanceof O&&(o=q.parseGeometryFromDictionary(o)),l!==null&&(l=q.parseAttributesFromDictionary(l)),s=q.createFromGraphicLikeObject(o,l,null)}}else if(a.length===2){let o=null,l=null;if(a[0]!==null)if(a[0]instanceof N)o=a[0];else{if(!(o instanceof O))throw new h(n,c.InvalidParameter,r);o=q.parseGeometryFromDictionary(a[0])}if(a[1]!==null){if(!(a[1]instanceof O))throw new h(n,c.InvalidParameter,r);l=q.parseAttributesFromDictionary(a[1])}s=q.createFromGraphicLikeObject(o,l,null)}else{let o=null;const l={};if(a[0]!==null)if(a[0]instanceof N)o=a[0];else{if(!(o instanceof O))throw new h(n,c.InvalidParameter,r);o=q.parseGeometryFromDictionary(a[0])}for(let d=1;d{if(a.length===0){const l=new O;return l.immutable=!1,l}if(a.length===1&&v(a[0]))try{const l=JSON.parse(a[0]),d=O.convertObjectToArcadeDictionary(l,!1);return d.immutable=!1,d}catch{throw new h(n,c.InvalidParameter,r)}if(a.length%2!=0)throw new h(n,c.WrongNumberOfParameters,r);const s={};for(let l=0;l{y(a,2,2,n,r);const s=b(a[1]);if(Nn(a[0])||a[0]instanceof O)return a[0].hasField(s);if(a[0]instanceof N){const o=Dn(a[0],s,null,null,2);return!o||o.keystate!=="notfound"}throw new h(n,c.InvalidParameter,r)})},t.hasvalue=function(n,r){return e(n,r,(i,u,a)=>{if(y(a,2,2,n,r),a[0]===null||a[1]===null)return!1;const s=b(a[1]);return ne(a[0])||a[0]instanceof O?!!a[0].hasField(s)&&a[0].field(s)!==null:a[0]instanceof N?Dn(a[0],s,null,null,0)!==null:!1})},t.indexof=function(n,r){return e(n,r,(i,u,a)=>{y(a,2,2,n,r);const s=a[1];if(M(a[0])){for(let o=0;o{if(a=P(a),y(a,2,3,n,r),!(a[0]instanceof W))throw new h(n,c.InvalidParameter,r);if(!(a[1]instanceof W))throw new h(n,c.InvalidParameter,r);if(a.length>2&&!(a[2]instanceof W))throw new h(n,c.InvalidParameter,r);return a.length===2?Tc(a[0],a[1]):Nc(a[0],a[1],a[2])})},t.bearing=function(n,r){return e(n,r,(i,u,a)=>{if(a=P(a),y(a,2,3,n,r),!(a[0]instanceof W))throw new h(n,c.InvalidParameter,r);if(!(a[1]instanceof W))throw new h(n,c.InvalidParameter,r);if(a.length>2&&!(a[2]instanceof W))throw new h(n,c.InvalidParameter,r);return a.length===2?Mc(a[0],a[1]):Oc(a[0],a[1],a[2])})},t.isselfintersecting=function(n,r){return e(n,r,(i,u,a)=>{a=P(a),y(a,1,1,n,r);let s=a[0];if(s instanceof he)return s.isSelfIntersecting;if(s instanceof ce)return s=s.paths,ps(s);if(s instanceof Ne){const o=s.points;for(let l=0;l(s=P(s),n(r,i,s),s[0]===null||s[1]===null||$.disjoint(s[0],s[1])))},t.intersects=function(r,i){return e(r,i,(u,a,s)=>(s=P(s),n(r,i,s),s[0]!==null&&s[1]!==null&&$.intersects(s[0],s[1])))},t.touches=function(r,i){return e(r,i,(u,a,s)=>(s=P(s),n(r,i,s),s[0]!==null&&s[1]!==null&&$.touches(s[0],s[1])))},t.crosses=function(r,i){return e(r,i,(u,a,s)=>(s=P(s),n(r,i,s),s[0]!==null&&s[1]!==null&&$.crosses(s[0],s[1])))},t.within=function(r,i){return e(r,i,(u,a,s)=>(s=P(s),n(r,i,s),s[0]!==null&&s[1]!==null&&$.within(s[0],s[1])))},t.contains=function(r,i){return e(r,i,(u,a,s)=>(s=P(s),n(r,i,s),s[0]!==null&&s[1]!==null&&$.contains(s[0],s[1])))},t.overlaps=function(r,i){return e(r,i,(u,a,s)=>(s=P(s),n(r,i,s),s[0]!==null&&s[1]!==null&&$.overlaps(s[0],s[1])))},t.equals=function(r,i){return e(r,i,(u,a,s)=>(y(s,2,2,r,i),s[0]===s[1]||(s[0]instanceof N&&s[1]instanceof N?$.equals(s[0],s[1]):!(!Q(s[0])||!Q(s[1]))&&s[0].getTime()===s[1].getTime())))},t.relate=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,3,3,r,i),s[0]instanceof N&&s[1]instanceof N)return $.relate(s[0],s[1],b(s[2]));if(s[0]instanceof N&&s[1]===null||s[1]instanceof N&&s[0]===null||s[0]===null&&s[1]===null)return!1;throw new h(r,c.InvalidParameter,i)})},t.intersection=function(r,i){return e(r,i,(u,a,s)=>(s=P(s),n(r,i,s),s[0]===null||s[1]===null?null:$.intersect(s[0],s[1])))},t.union=function(r,i){return e(r,i,(u,a,s)=>{const o=[];if((s=P(s)).length===0)throw new h(r,c.WrongNumberOfParameters,i);if(s.length===1)if(M(s[0])){const l=P(s[0]);for(let d=0;d(s=P(s),n(r,i,s),s[0]!==null&&s[1]===null?$e(s[0]):s[0]===null?null:$.difference(s[0],s[1])))},t.symmetricdifference=function(r,i){return e(r,i,(u,a,s)=>(s=P(s),n(r,i,s),s[0]===null&&s[1]===null?null:s[0]===null?$e(s[1]):s[1]===null?$e(s[0]):$.symmetricDifference(s[0],s[1])))},t.clip=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,2,2,r,i),!(s[1]instanceof we)&&s[1]!==null)throw new h(r,c.InvalidParameter,i);if(s[0]===null)return null;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return s[1]===null?null:$.clip(s[0],s[1])})},t.cut=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,2,2,r,i),!(s[1]instanceof ce)&&s[1]!==null)throw new h(r,c.InvalidParameter,i);if(s[0]===null)return[];if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return s[1]===null?[$e(s[0])]:$.cut(s[0],s[1])})},t.area=function(r,i){return e(r,i,(u,a,s)=>{if(y(s,1,2,r,i),(s=P(s))[0]===null)return 0;if(M(s[0])||L(s[0])){const o=jr(s[0],r.spatialReference);return o===null?0:$.planarArea(o,On(_(s[1],-1)))}if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return $.planarArea(s[0],On(_(s[1],-1)))})},t.areageodetic=function(r,i){return e(r,i,(u,a,s)=>{if(y(s,1,2,r,i),(s=P(s))[0]===null)return 0;if(M(s[0])||L(s[0])){const o=jr(s[0],r.spatialReference);return o===null?0:$.geodesicArea(o,On(_(s[1],-1)))}if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return $.geodesicArea(s[0],On(_(s[1],-1)))})},t.length=function(r,i){return e(r,i,(u,a,s)=>{if(y(s,1,2,r,i),(s=P(s))[0]===null)return 0;if(M(s[0])||L(s[0])){const o=fn(s[0],r.spatialReference);return o===null?0:$.planarLength(o,le(_(s[1],-1)))}if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return $.planarLength(s[0],le(_(s[1],-1)))})},t.length3d=function(r,i){return e(r,i,(u,a,s)=>{if(y(s,1,2,r,i),(s=P(s))[0]===null)return 0;if(M(s[0])||L(s[0])){const o=fn(s[0],r.spatialReference);return o===null?0:o.hasZ===!0?ys(o,le(_(s[1],-1))):$.planarLength(o,le(_(s[1],-1)))}if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return s[0].hasZ===!0?ys(s[0],le(_(s[1],-1))):$.planarLength(s[0],le(_(s[1],-1)))})},t.lengthgeodetic=function(r,i){return e(r,i,(u,a,s)=>{if(y(s,1,2,r,i),(s=P(s))[0]===null)return 0;if(M(s[0])||L(s[0])){const o=fn(s[0],r.spatialReference);return o===null?0:$.geodesicLength(o,le(_(s[1],-1)))}if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return $.geodesicLength(s[0],le(_(s[1],-1)))})},t.distance=function(r,i){return e(r,i,(u,a,s)=>{s=P(s),y(s,2,3,r,i);let o=s[0];(M(s[0])||L(s[0]))&&(o=Rn(s[0],r.spatialReference));let l=s[1];if((M(s[1])||L(s[1]))&&(l=Rn(s[1],r.spatialReference)),!(o instanceof N))throw new h(r,c.InvalidParameter,i);if(!(l instanceof N))throw new h(r,c.InvalidParameter,i);return $.distance(o,l,le(_(s[2],-1)))})},t.distancegeodetic=function(r,i){return e(r,i,(u,a,s)=>{s=P(s),y(s,2,3,r,i);const o=s[0],l=s[1];if(!(o instanceof W))throw new h(r,c.InvalidParameter,i);if(!(l instanceof W))throw new h(r,c.InvalidParameter,i);const d=new ce({paths:[],spatialReference:o.spatialReference});return d.addPath([o,l]),$.geodesicLength(d,le(_(s[2],-1)))})},t.densify=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,2,3,r,i),s[0]===null)return null;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);const o=p(s[1]);if(isNaN(o))throw new h(r,c.InvalidParameter,i);if(o<=0)throw new h(r,c.InvalidParameter,i);return s[0]instanceof he||s[0]instanceof ce?$.densify(s[0],o,le(_(s[2],-1))):s[0]instanceof we?$.densify(gs(s[0]),o,le(_(s[2],-1))):s[0]})},t.densifygeodetic=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,2,3,r,i),s[0]===null)return null;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);const o=p(s[1]);if(isNaN(o))throw new h(r,c.InvalidParameter,i);if(o<=0)throw new h(r,c.InvalidParameter,i);return s[0]instanceof he||s[0]instanceof ce?$.geodesicDensify(s[0],o,le(_(s[2],-1))):s[0]instanceof we?$.geodesicDensify(gs(s[0]),o,le(_(s[2],-1))):s[0]})},t.generalize=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,2,4,r,i),s[0]===null)return null;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);const o=p(s[1]);if(isNaN(o))throw new h(r,c.InvalidParameter,i);return $.generalize(s[0],o,Pt(_(s[2],!0)),le(_(s[3],-1)))})},t.buffer=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,2,3,r,i),s[0]===null)return null;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);const o=p(s[1]);if(isNaN(o))throw new h(r,c.InvalidParameter,i);return o===0?$e(s[0]):$.buffer(s[0],o,le(_(s[2],-1)))})},t.buffergeodetic=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,2,3,r,i),s[0]===null)return null;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);const o=p(s[1]);if(isNaN(o))throw new h(r,c.InvalidParameter,i);return o===0?$e(s[0]):$.geodesicBuffer(s[0],o,le(_(s[2],-1)))})},t.offset=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,2,6,r,i),s[0]===null)return null;if(!(s[0]instanceof he||s[0]instanceof ce))throw new h(r,c.InvalidParameter,i);const o=p(s[1]);if(isNaN(o))throw new h(r,c.InvalidParameter,i);const l=p(_(s[4],10));if(isNaN(l))throw new h(r,c.InvalidParameter,i);const d=p(_(s[5],0));if(isNaN(d))throw new h(r,c.InvalidParameter,i);return $.offset(s[0],o,le(_(s[2],-1)),b(_(s[3],"round")).toLowerCase(),l,d)})},t.rotate=function(r,i){return e(r,i,(u,a,s)=>{s=P(s),y(s,2,3,r,i);let o=s[0];if(o===null)return null;if(!(o instanceof N))throw new h(r,c.InvalidParameter,i);o instanceof we&&(o=he.fromExtent(o));const l=p(s[1]);if(isNaN(l))throw new h(r,c.InvalidParameter,i);const d=_(s[2],null);if(d===null)return $.rotate(o,l);if(d instanceof W)return $.rotate(o,l,d);throw new h(r,c.InvalidParameter,i)})},t.centroid=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,1,1,r,i),s[0]===null)return null;let o=s[0];if((M(s[0])||L(s[0]))&&(o=Rn(s[0],r.spatialReference)),o===null)return null;if(!(o instanceof N))throw new h(r,c.InvalidParameter,i);return o instanceof W?re($e(s[0]),r.spatialReference):o instanceof he?o.centroid:o instanceof ce?vc(o):o instanceof Ne?bc(o):o instanceof we?o.center:null})},t.multiparttosinglepart=function(r,i){return e(r,i,(u,a,s)=>{s=P(s),y(s,1,1,r,i);const o=[];if(s[0]===null)return null;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);if(s[0]instanceof W)return[re($e(s[0]),r.spatialReference)];if(s[0]instanceof we)return[re($e(s[0]),r.spatialReference)];const l=$.simplify(s[0]);if(l instanceof he){const d=[],f=[];for(let m=0;m{if(s=P(s),y(s,1,1,r,i),s[0]===null)return!0;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return $.isSimple(s[0])})},t.simplify=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,1,1,r,i),s[0]===null)return null;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return $.simplify(s[0])})},t.convexhull=function(r,i){return e(r,i,(u,a,s)=>{if(s=P(s),y(s,1,1,r,i),s[0]===null)return null;if(!(s[0]instanceof N))throw new h(r,c.InvalidParameter,i);return $.convexHull(s[0])})}}var _c=Object.freeze(Object.defineProperty({__proto__:null,registerFunctions:Fi,setGeometryEngine:Bc},Symbol.toStringTag,{value:"Module"}));function Ar(t,e,n){return n===void 0||+n==0?Math[t](e):(e=+e,n=+n,isNaN(e)||typeof n!="number"||n%1!=0?NaN:(e=e.toString().split("e"),+((e=(e=Math[t](+(e[0]+"e"+(e[1]?+e[1]-n:-n)))).toString().split("e"))[0]+"e"+(e[1]?+e[1]+n:n))))}function hu(t,e){function n(r,i,u){const a=p(r);return isNaN(a)?a:isNaN(i)||isNaN(u)||i>u?NaN:au?u:a}t.number=function(r,i){return e(r,i,(u,a,s)=>{y(s,1,2,r,i);const o=s[0];if(G(o))return o;if(o===null)return 0;if(Q(o)||z(o))return Number(o);if(M(o))return NaN;if(o===""||o===void 0)return Number(o);if(v(o)){if(s[1]!==void 0){let l=lt(s[1],"\u2030","");return l=lt(l,"\xA4",""),Hs(o,{pattern:l})}return Number(o.trim())}return Number(o)})},t.abs=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.abs(p(s[0]))))},t.acos=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.acos(p(s[0]))))},t.asin=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.asin(p(s[0]))))},t.atan=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.atan(p(s[0]))))},t.atan2=function(r,i){return e(r,i,(u,a,s)=>(y(s,2,2,r,i),Math.atan2(p(s[0]),p(s[1]))))},t.ceil=function(r,i){return e(r,i,(u,a,s)=>{if(y(s,1,2,r,i),s.length===2){let o=p(s[1]);return isNaN(o)&&(o=0),Ar("ceil",p(s[0]),-1*o)}return Math.ceil(p(s[0]))})},t.round=function(r,i){return e(r,i,(u,a,s)=>{if(y(s,1,2,r,i),s.length===2){let o=p(s[1]);return isNaN(o)&&(o=0),Ar("round",p(s[0]),-1*o)}return Math.round(p(s[0]))})},t.floor=function(r,i){return e(r,i,(u,a,s)=>{if(y(s,1,2,r,i),s.length===2){let o=p(s[1]);return isNaN(o)&&(o=0),Ar("floor",p(s[0]),-1*o)}return Math.floor(p(s[0]))})},t.cos=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.cos(p(s[0]))))},t.isnan=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),typeof s[0]=="number"&&isNaN(s[0])))},t.exp=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.exp(p(s[0]))))},t.log=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.log(p(s[0]))))},t.pow=function(r,i){return e(r,i,(u,a,s)=>(y(s,2,2,r,i),p(s[0])**p(s[1])))},t.random=function(r,i){return e(r,i,(u,a,s)=>(y(s,0,0,r,i),Math.random()))},t.sin=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.sin(p(s[0]))))},t.sqrt=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.sqrt(p(s[0]))))},t.tan=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),Math.tan(p(s[0]))))},t.defaultvalue=function(r,i){return e(r,i,(u,a,s)=>(y(s,2,2,r,i),s[0]===null||s[0]===""||s[0]===void 0?s[1]:s[0]))},t.isempty=function(r,i){return e(r,i,(u,a,s)=>(y(s,1,1,r,i),s[0]===null||s[0]===""||s[0]===void 0))},t.boolean=function(r,i){return e(r,i,(u,a,s)=>{y(s,1,1,r,i);const o=s[0];return Pt(o)})},t.constrain=function(r,i){return e(r,i,(u,a,s)=>{y(s,3,3,r,i);const o=p(s[1]),l=p(s[2]);if(M(s[0])){const d=[];for(const f of s[0])d.push(n(f,o,l));return d}if(L(s[0])){const d=[];for(let f=0;f=e&&e!==-1)return n}return n}function Sr(t,e,n=1e3){switch(t.toLowerCase()){case"distinct":return $c(e,n);case"avg":case"mean":return fu(gt(e));case"min":return Math.min.apply(Math,gt(e));case"sum":return Lc(gt(e));case"max":return Math.max.apply(Math,gt(e));case"stdev":case"stddev":return Math.sqrt(Ds(gt(e)));case"var":case"variance":return Ds(gt(e));case"count":return e.length}return 0}function it(t,e,n,r){if(r.length===1){if(M(r[0]))return Sr(t,r[0],-1);if(L(r[0]))return Sr(t,r[0].toArray(),-1)}return Sr(t,r,-1)}function du(t,e){t.stdev=function(n,r){return e(n,r,(i,u,a)=>it("stdev",i,u,a))},t.variance=function(n,r){return e(n,r,(i,u,a)=>it("variance",i,u,a))},t.average=function(n,r){return e(n,r,(i,u,a)=>it("mean",i,u,a))},t.mean=function(n,r){return e(n,r,(i,u,a)=>it("mean",i,u,a))},t.sum=function(n,r){return e(n,r,(i,u,a)=>it("sum",i,u,a))},t.min=function(n,r){return e(n,r,(i,u,a)=>it("min",i,u,a))},t.max=function(n,r){return e(n,r,(i,u,a)=>it("max",i,u,a))},t.distinct=function(n,r){return e(n,r,(i,u,a)=>it("distinct",i,u,a))},t.count=function(n,r){return e(n,r,(i,u,a)=>{if(y(a,1,1,n,r),M(a[0])||v(a[0]))return a[0].length;if(L(a[0]))return a[0].length();throw new h(n,c.InvalidParameter,r)})}}class mu extends O{constructor(e){super(),this.declaredClass="esri.arcade.Portal",this.immutable=!1,this.setField("url",e),this.immutable=!0}}class Rc extends O{constructor(e,n,r,i,u,a){super(),this.attachmentUrl=u,this.declaredClass="esri.arcade.Attachment",this.immutable=!1,this.setField("id",e),this.setField("name",n),this.setField("contenttype",r),this.setField("size",i),this.setField("exifinfo",a),this.immutable=!0}}const Ci=t=>(e,n,r)=>(r=r||14,+t(e,n).toFixed(r)),Pc=(t,e)=>t+e,Uc=(t,e)=>t*e,zc=(t,e)=>t/e,ws=(t,e,n)=>Ci(Pc)(t,e,n),_t=(t,e,n)=>Ci(Uc)(t,e,n),jn=(t,e,n)=>Ci(zc)(t,e,n),Wn=360,Gc=400,Vc=2*Math.PI,Pe=3600,xs=3240,mn=60,ot=60,Fs=180*Pe/Math.PI,sn=Wn*mn*ot,vr=90*Pe,bt=180*Pe,qc=270*Pe,pu=String.fromCharCode(7501),an="\xB0";function en(t){if(v(t)===!1)throw new h(null,c.InvalidParameter,null);return t}function Kr(t,e){const n=10**e;return Math.round(t*n)/n}function Zc(t,e){return t%e}function It(t){const e=parseFloat(t.toString().replace(Math.trunc(t).toString(),"0"))*Math.sign(t);return t<0?{fraction:e,integer:Math.ceil(t)}:{fraction:e,integer:Math.floor(t)}}var J,w,V,Qr;function Ot(t,e){switch(t){case J.north:return e==="SHORT"?"N":"North";case J.east:return e==="SHORT"?"E":"East";case J.south:return e==="SHORT"?"S":"South";case J.west:return e==="SHORT"?"W":"West"}}function br(t,e,n){for(;t.length=qc?J.north:J.south,r=n===J.north?Math.min(sn-e,e):Math.abs(e-bt),i=e>bt?J.west:J.east;return new Hc(n,r,i)}static createFromAngleMeridianAndDirection(e,n,r){return new de(new Se(de.secondsQuadrantToNorthAzimuth(e.extractAngularUnits(w.seconds),n,r)))}static secondsQuadrantToNorthAzimuth(e,n,r){return n===J.north?r===J.east?e:sn-e:r===J.east?bt-e:bt+e}static _convertDirectionFormat(e,n,r){let i=0;switch(n){case V.north_azimuth:i=e;break;case V.polar:i=vr-e;break;case V.quadrant:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"});case V.south_azimuth:i=e+bt}let u=0;switch(r){case V.north_azimuth:u=i;break;case V.polar:u=vr-i;break;case V.quadrant:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"});case V.south_azimuth:u=i-bt}return u=Zc(u,sn),u<0?sn+u:u}}function As(t,e,n){let r=null;switch(e){case w.decimal_degrees:r=_t(t,Pe);break;case w.seconds:r=t;break;case w.gradians:r=_t(t,xs);break;case w.radians:r=_t(t,Fs);break;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}switch(n){case w.decimal_degrees:return jn(r,Pe);case w.seconds:return r;case w.gradians:return jn(r,xs);case w.radians:return r/Fs;default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}class Se{constructor(e){this._seconds=e}static createFromAngleAndUnits(e,n){return new Se(As(e,n,w.seconds))}extractAngularUnits(e){return As(this._seconds,w.seconds,wn(e))}static createFromDegreesMinutesSeconds(e,n,r){return new Se(ws(ws(_t(e,Pe),_t(n,ot)),r))}}function wn(t){switch(Vs(t),t){case w.decimal_degrees:case w.truncated_degrees:case w.degrees_minutes_seconds:return w.decimal_degrees;case w.gradians:return w.gradians;case w.fractional_degree_minutes:return w.fractional_degree_minutes;case w.radians:return w.radians;case w.seconds:case w.fractional_minute_seconds:return w.seconds}}class Ei{constructor(e,n,r,i){this.view=e,this.angle=n,this.merdian=r,this.direction=i,this._dms=null,this._formattedDms=null}static createFromStringAndBearing(e,n,r){return new Ei(e,n.getAngle(r),n.getMeridian(r),n.getDirection(r))}fetchAngle(){return this.angle}fetchMeridian(){return this.merdian}fetchDirection(){return this.direction}fetchView(){return this.view}fetchDms(){return this._dms===null&&this._calculateDms(),this._dms}fetchFormattedDms(){return this._formattedDms===null&&this._calculateDms(),this._formattedDms}_calculateDms(){let e=null,n=w.truncated_degrees,r=0;for(let i=0;i0?1:0));case w.truncated_degrees:case w.fractional_degree_minutes:return u=Ir(i.fetchFormattedDms().getField(e),kr(e)),br(u.toFixed(r),"0",n+r+(r>0?1:0));case w.fractional_minute_seconds:return u=Ir(Kr(i.fetchDms().getField(e),r),kr(e)),br(u.toFixed(r),"0",n+r+(r>0?1:0));default:throw new h(null,c.LogicError,null,{reason:"unexpected evaluation"})}}function Wc(t,e,n){if(n===V.quadrant)throw new h(null,c.LogicError,null,{reason:"conversion error"});if(e===w.degrees_minutes_seconds){const r=qe.numberToDms(t);return de.createFromAngleAndDirection(Se.createFromDegreesMinutesSeconds(r.m_degrees,r.m_minutes,r.m_seconds),n)}return de.createFromAngleAndDirection(Se.createFromAngleAndUnits(t,wn(e)),n)}function Jc(t){switch(p(t)){case 1:return{first:J.north,second:J.east};case 2:return{first:J.south,second:J.east};case 3:return{first:J.south,second:J.west};case 4:return{first:J.north,second:J.west}}return null}function Ss(t){switch(t.toUpperCase().trim()){case"N":case"NORTH":return J.north;case"E":case"EAST":return J.east;case"S":case"SOUTH":return J.south;case"W":case"WEST":return J.west}return null}function kt(t){const e=parseFloat(t);if(G(e)){if(isNaN(e))throw new h(null,c.LogicError,null,{reason:"invalid conversion"});return e}throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}function Tr(t,e,n){const r=n===V.quadrant;let i=null,u=null,a=0,s=0,o=0;if(r){if(t.length<2)throw new h(null,c.LogicError,null,{reason:"conversion error"});o=1;const l=Jc(b(t[t.length-1]));if(l?(i=l.first,u=l.second):(a=1,i=Ss(b(t[0])),u=Ss(b(t[t.length-1]))),i===null||u===null)throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}switch(e){case w.decimal_degrees:case w.radians:case w.gradians:if(t.length===0)throw new h(null,c.LogicError,null,{reason:"invalid conversion"});return r?de.createFromAngleMeridianAndDirection(Se.createFromAngleAndUnits(kt(t[a]),wn(e)),i,u):de.createFromAngleAndDirection(Se.createFromAngleAndUnits(kt(t[a]),wn(e)),n);case w.degrees_minutes_seconds:if(s=t.length-o-a,s===3){const l=Se.createFromDegreesMinutesSeconds(kt(t[a]),kt(t[a+1]),kt(t[a+2]));return r?de.createFromAngleMeridianAndDirection(l,i,u):de.createFromAngleAndDirection(l,n)}if(s===1){const l=kt(t[a]),d=qe.numberToDms(l),f=Se.createFromDegreesMinutesSeconds(d.m_degrees,d.m_minutes,d.m_seconds);return r?de.createFromAngleMeridianAndDirection(f,i,u):de.createFromAngleAndDirection(f,n)}}throw new h(null,c.LogicError,null,{reason:"invalid conversion"})}function Yc(t){const e=[" ","-","/","'",'"',"\\","^",an,pu," ","\r",` `,"*"];let n="";for(let r=0;rr!=="")}function Kc(t,e,n){if(G(t))return Wc(p(t),e,n);if(v(t))return Tr(Yc(t),e,n);if(M(t))return Tr(t,e,n);if(L(t))return Tr(t.toArray(),e,n);throw new h(null,c.LogicError,null,{reason:"conversion error"})}function Qc(t,e,n){const r=wn(n);if(r&&n!==w.degrees_minutes_seconds)return t.getAngle(e).extractAngularUnits(r);throw new h(null,c.LogicError,null,{reason:"conversion error"})}function Xc(t,e,n){const r=t.getAngle(e);if(e===V.quadrant&&n===w.degrees_minutes_seconds){const i=qe.secondsToDMS(r.extractAngularUnits(w.seconds));return[Ot(t.getMeridian(e),"SHORT"),i.m_degrees,i.m_minutes,i.m_seconds,Ot(t.getDirection(e),"SHORT")]}if(n===w.degrees_minutes_seconds){const i=qe.secondsToDMS(r.extractAngularUnits(w.seconds));return[i.m_degrees,i.m_minutes,i.m_seconds]}return e===V.quadrant?[Ot(t.getMeridian(e),"SHORT"),r.extractAngularUnits(n),Ot(t.getDirection(e),"SHORT")]:[r.extractAngularUnits(n)]}function eh(t,e){let n="";switch(t){case w.decimal_degrees:n=e===V.quadrant?"DD.DD"+an:"DDD.DD"+an;break;case w.degrees_minutes_seconds:n=e===V.quadrant?"dd"+an+` mm' ss"`:"ddd"+an+` mm' ss.ss"`;break;case w.radians:n="R.RR";break;case w.gradians:n="GGG.GG"+pu;break;default:throw new h(null,c.LogicError,null,{reason:"conversion error"})}return e===V.quadrant&&(n="p "+n+" b"),n}function Xr(t,e,n){const r={padding:0,rounding:0,newpos:e};let i=!1;for(;e>6,128|63&i):i<55296||i>=57344?e.push(224|i>>12,128|i>>6&63,128|63&i):(n++,i=65536+((1023&i)<<10|1023&t.charCodeAt(n)),e.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|63&i))}return new Uint8Array(e)}class ih{constructor(e){this._seed=e,this._totallen=0,this._bufs=[],this.init()}init(){return this._bufs=[],this._totallen=0,this}updateFloatArray(e){const n=[];for(const r of e)isNaN(r)?n.push("NaN"):r===1/0?n.push("Infinity"):r===-1/0?n.push("-Infinity"):r===0?n.push("0"):n.push(r.toString(16));this.update(Is(n.join("")))}updateIntArray(e){const n=Int32Array.from(e);this.update(new Uint8Array(n.buffer))}updateUint8Array(e){this.update(Uint8Array.from(e))}updateWithString(e){return this.update(Is(e))}update(e){return this._bufs.push(e),this._totallen+=e.length,this}digest(){const e=new Uint8Array(this._totallen);let n=0;for(const r of this._bufs)e.set(r,n),n+=r.length;return this.init(),this._xxHash32(e,this._seed)}_xxHash32(e,n=0){const r=e;let i=n+bs&4294967295,u=0;if(r.length>=16){const s=[n+Tt+Mt&4294967295,n+Mt&4294967295,n+0&4294967295,n-Tt&4294967295],o=e,l=o.length-16;let d=0;for(u=0;(4294967280&u)<=l;u+=4){const f=u,m=o[f+0]+(o[f+1]<<8),g=o[f+2]+(o[f+3]<<8),D=m*Mt+(g*Mt<<16);let k=s[d]+D&4294967295;k=k<<13|k>>>19;const F=65535&k,U=k>>>16;s[d]=F*Tt+(U*Tt<<16)&4294967295,d=d+1&3}i=(s[0]<<1|s[0]>>>31)+(s[1]<<7|s[1]>>>25)+(s[2]<<12|s[2]>>>20)+(s[3]<<18|s[3]>>>14)&4294967295}i=i+e.length&4294967295;const a=e.length-4;for(;u<=a;u+=4){const s=u,o=r[s+0]+(r[s+1]<<8),l=r[s+2]+(r[s+3]<<8);i=i+(o*Bn+(l*Bn<<16))&4294967295,i=i<<17|i>>>15,i=(65535&i)*vs+((i>>>16)*vs<<16)&4294967295}for(;u>>21,i=(65535&i)*Tt+((i>>>16)*Tt<<16)&4294967295;return i^=i>>>15,i=((65535&i)*Mt&4294967295)+((i>>>16)*Mt<<16),i^=i>>>13,i=((65535&i)*Bn&4294967295)+((i>>>16)*Bn<<16),i^=i>>>16,i<0?i+4294967296:i}}function ks(t,e){if(!t||!e)return t===e;if(t.x===e.x&&t.y===e.y){if(t.hasZ){if(t.z!==e.z)return!1}else if(e.hasZ)return!1;if(t.hasM){if(t.m!==e.m)return!1}else if(e.hasM)return!1;return!0}return!1}function ke(t,e,n){if(t!==null)if(M(t)){if(e.updateUint8Array([61]),n.map.has(t)){const r=n.map.get(t);e.updateIntArray([61237541^r])}else{n.map.set(t,n.currentLength++);for(const r of t)ke(r,e,n);n.map.delete(t),n.currentLength--}e.updateUint8Array([199])}else if(L(t)){if(e.updateUint8Array([61]),n.map.has(t)){const r=n.map.get(t);e.updateIntArray([61237541^r])}else{n.map.set(t,n.currentLength++);for(const r of t.toArray())ke(r,e,n);n.map.delete(t),n.currentLength--}e.updateUint8Array([199])}else{if(Q(t))return e.updateIntArray([t.getTime()]),void e.updateUint8Array([241]);if(v(t))return e.updateIntArray([t.length]),e.updateWithString(t),void e.updateUint8Array([41]);if(z(t))e.updateUint8Array([t===!0?1:0,113]);else{if(G(t))return e.updateFloatArray([t]),void e.updateUint8Array([173]);if(t instanceof Rc)throw new h(n.context,c.UnsupportedHashType,n.node);if(t instanceof mu)throw new h(n.context,c.UnsupportedHashType,n.node);if(!(t instanceof O)){if(ne(t))throw new h(n.context,c.UnsupportedHashType,n.node);if(t instanceof W)return e.updateIntArray([3833836621]),e.updateIntArray([0]),e.updateFloatArray([t.x]),e.updateIntArray([1]),e.updateFloatArray([t.y]),t.hasZ&&(e.updateIntArray([2]),e.updateFloatArray([t.z])),t.hasM&&(e.updateIntArray([3]),e.updateFloatArray([t.m])),e.updateIntArray([3765347959]),void ke(t.spatialReference.wkid,e,n);if(t instanceof he){e.updateIntArray([1266616829]);for(let r=0;r(y(a,1,1,n,r),new mu(b(a[0]))))},t.typeof=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=pi(a[0]);if(s==="Unrecognised Type")throw new h(n,c.UnrecognisedType,r);return s})},t.trim=function(n,r){return e(n,r,(i,u,a)=>(y(a,1,1,n,r),b(a[0]).trim()))},t.tohex=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=p(a[0]);return isNaN(s)?s:s.toString(16)})},t.upper=function(n,r){return e(n,r,(i,u,a)=>(y(a,1,1,n,r),b(a[0]).toUpperCase()))},t.proper=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,2,n,r);let s=1;a.length===2&&b(a[1]).toLowerCase()==="firstword"&&(s=2);const o=/\s/,l=b(a[0]);let d="",f=!0;for(let m=0;m(y(a,1,1,n,r),b(a[0]).toLowerCase()))},t.guid=function(n,r){return e(n,r,(i,u,a)=>{if(y(a,0,1,n,r),a.length>0)switch(b(a[0]).toLowerCase()){case"digits":return Nt().replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return Nt();case"digits-hyphen-braces":return"{"+Nt()+"}";case"digits-hyphen-parentheses":return"("+Nt()+")"}return"{"+Nt()+"}"})},t.standardizeguid=function(n,r){return e(n,r,(i,u,a)=>{y(a,2,2,n,r);let s=b(a[0]);if(s===""||s===null)return"";const o=/^(\{|\()?(?[0-9a-z]{8})(\-?)(?[0-9a-z]{4})(\-?)(?[0-9a-z]{4})(\-?)(?[0-9a-z]{4})(\-?)(?[0-9a-z]{12})(\}|\))?$/gim.exec(s);if(!o)return"";const l=o.groups;switch(s=l.partA+"-"+l.partB+"-"+l.partC+"-"+l.partD+"-"+l.partE,b(a[1]).toLowerCase()){case"digits":return s.replace("-","").replace("-","").replace("-","").replace("-","");case"digits-hyphen":return s;case"digits-hyphen-braces":return"{"+s+"}";case"digits-hyphen-parentheses":return"("+s+")"}return"{"+s+"}"})},t.console=function(n,r){return e(n,r,(i,u,a)=>(a.length===0||(a.length===1?n.console(b(a[0])):n.console(b(a))),A))},t.mid=function(n,r){return e(n,r,(i,u,a)=>{y(a,2,3,n,r);let s=p(a[1]);if(isNaN(s))return"";if(s<0&&(s=0),a.length===2)return b(a[0]).substr(s);let o=p(a[2]);return isNaN(o)?"":(o<0&&(o=0),b(a[0]).substr(s,o))})},t.find=function(n,r){return e(n,r,(i,u,a)=>{y(a,2,3,n,r);let s=0;if(a.length>2){if(s=p(_(a[2],0)),isNaN(s))return-1;s<0&&(s=0)}return b(a[1]).indexOf(b(a[0]),s)})},t.left=function(n,r){return e(n,r,(i,u,a)=>{y(a,2,2,n,r);let s=p(a[1]);return isNaN(s)?"":(s<0&&(s=0),b(a[0]).substr(0,s))})},t.right=function(n,r){return e(n,r,(i,u,a)=>{y(a,2,2,n,r);let s=p(a[1]);return isNaN(s)?"":(s<0&&(s=0),b(a[0]).substr(-1*s,s))})},t.split=function(n,r){return e(n,r,(i,u,a)=>{let s;y(a,2,4,n,r);let o=p(_(a[2],-1));const l=Pt(_(a[3],!1));if(o===-1||o===null||l===!0?s=b(a[0]).split(b(a[1])):(isNaN(o)&&(o=-1),o<-1&&(o=-1),s=b(a[0]).split(b(a[1]),o)),l===!1)return s;const d=[];for(let f=0;f=o);f++)s[f]!==""&&s[f]!==void 0&&d.push(s[f]);return d})},t.text=function(n,r){return e(n,r,(i,u,a)=>(y(a,1,2,n,r),Ae(a[0],a[1])))},t.concatenate=function(n,r){return e(n,r,(i,u,a)=>{const s=[];if(a.length<1)return"";if(M(a[0])){const o=_(a[2],"");for(let l=0;l1?s.join(a[1]):s.join("")}if(L(a[0])){const o=_(a[2],"");for(let l=0;l1?s.join(a[1]):s.join("")}for(let o=0;o{if(y(a,1,1,n,r),M(a[0])){const s=a[0].slice(0);return s.reverse(),s}if(L(a[0])){const s=a[0].toArray().slice(0);return s.reverse(),s}throw new h(n,c.InvalidParameter,r)})},t.replace=function(n,r){return e(n,r,(i,u,a)=>{y(a,3,4,n,r);const s=b(a[0]),o=b(a[1]),l=b(a[2]);return a.length!==4||Pt(a[3])?lt(s,o,l):s.replace(o,l)})},t.schema=function(n,r){return e(n,r,(i,u,a)=>{if(ne(a[0])){const s=tu(a[0]);return s?O.convertObjectToArcadeDictionary(s):null}throw new h(n,c.InvalidParameter,r)})},t.subtypes=function(n,r){return e(n,r,(i,u,a)=>{if(y(a,1,1,n,r),ne(a[0])){const s=Pn(a[0]);return s?O.convertObjectToArcadeDictionary(s):null}throw new h(n,c.InvalidParameter,r)})},t.subtypecode=function(n,r){return e(n,r,(i,u,a)=>{if(y(a,1,1,n,r),ne(a[0])){const s=Pn(a[0]);if(!s)return null;if(s.subtypeField&&a[0].hasField(s.subtypeField)){const o=a[0].field(s.subtypeField);for(const l of s.subtypes)if(l.code===o)return l.code;return null}return null}throw new h(n,c.InvalidParameter,r)})},t.subtypename=function(n,r){return e(n,r,(i,u,a)=>{if(y(a,1,1,n,r),ne(a[0])){const s=Pn(a[0]);if(!s)return"";if(s.subtypeField&&a[0].hasField(s.subtypeField)){const o=a[0].field(s.subtypeField);for(const l of s.subtypes)if(l.code===o)return l.name;return""}return""}throw new h(n,c.InvalidParameter,r)})},t.gdbversion=function(n,r){return e(n,r,(i,u,a)=>{if(y(a,1,1,n,r),ne(a[0]))return a[0].gdbVersion();throw new h(n,c.InvalidParameter,r)})},t.domain=function(n,r){return e(n,r,(i,u,a)=>{if(y(a,2,3,n,r),ne(a[0])){const s=Qa(a[0],b(a[1]),a[2]===void 0?void 0:p(a[2]));return s&&s.domain?s.domain.type==="coded-value"||s.domain.type==="codedValue"?O.convertObjectToArcadeDictionary({type:"codedValue",name:s.domain.name,dataType:cs[s.field.type],codedValues:s.domain.codedValues.map(o=>({name:o.name,code:o.code}))}):O.convertObjectToArcadeDictionary({type:"range",name:s.domain.name,dataType:cs[s.field.type],min:s.domain.min,max:s.domain.max}):null}throw new h(n,c.InvalidParameter,r)})},t.domainname=function(n,r){return e(n,r,(i,u,a)=>{if(y(a,2,4,n,r),ne(a[0]))return Xa(a[0],b(a[1]),a[2],a[3]===void 0?void 0:p(a[3]));throw new h(n,c.InvalidParameter,r)})},t.domaincode=function(n,r){return e(n,r,(i,u,a)=>{if(y(a,2,4,n,r),ne(a[0]))return eu(a[0],b(a[1]),a[2],a[3]===void 0?void 0:p(a[3]));throw new h(n,c.InvalidParameter,r)})},t.urlencode=function(n,r){return e(n,r,(i,u,a)=>{if(y(a,1,1,n,r),a[0]===null)return"";if(a[0]instanceof O){let s="";for(const o of a[0].keys()){const l=a[0].field(o);s!==""&&(s+="&"),s+=l===null?encodeURIComponent(o)+"=":encodeURIComponent(o)+"="+encodeURIComponent(l)}return s}return encodeURIComponent(b(a[0]))})},t.hash=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,1,n,r);const s=new ih(0);return ke(a[0],s,{context:n,node:r,map:new Map,currentLength:0}),s.digest()})},t.convertdirection=function(n,r){return e(n,r,(i,u,a)=>(y(a,3,3,n,r),rh(a[0],a[1],a[2])))},t.fromjson=function(n,r){return e(n,r,(i,u,a)=>{if(y(a,1,1,n,r),v(a[0])===!1)throw new h(n,c.InvalidParameter,r);return O.convertJsonToArcade(JSON.parse(b(a[0])))})},t.expects=function(n,r){return e(n,r,(i,u,a)=>{if(a.length<1)throw new h(n,c.WrongNumberOfParameters,r);return A})},t.tocharcode=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,2,n,r);const s=p(_(a[1],0)),o=b(a[0]);if(o.length===0&&a.length===1)return null;if(o.length<=s||s<0)throw new h(n,c.OutOfBounds,r);return o.charCodeAt(s)})},t.tocodepoint=function(n,r){return e(n,r,(i,u,a)=>{y(a,1,2,n,r);const s=p(_(a[1],0)),o=b(a[0]);if(o.length===0&&a.length===1)return null;if(o.length<=s||s<0)throw new h(n,c.OutOfBounds,r);return o.codePointAt(s)})},t.fromcharcode=function(n,r){return e(n,r,(i,u,a)=>{if(a.length<1)throw new h(n,c.WrongNumberOfParameters,r);const s=a.map(o=>Math.trunc(p(o))).filter(o=>o>=0&&o<=65535);return s.length===0?null:String.fromCharCode.apply(null,s)})},t.fromcodepoint=function(n,r){return e(n,r,(i,u,a)=>{if(a.length<1)throw new h(n,c.WrongNumberOfParameters,r);let s;try{s=a.map(o=>Math.trunc(p(o))).filter(o=>o<=1114111&&o>>>0===o)}catch{return null}return s.length===0?null:String.fromCodePoint.apply(null,s)})}}class cr{constructor(e,n){this._moduleSingletons=e,this._syntaxModules=n}loadLibrary(e){if(this._syntaxModules==null)return null;const n=this._syntaxModules[e.toLowerCase()];return n?{syntax:n.script,uri:n.uri}:null}}class sh extends Ft{constructor(e,n){super(),this.paramCount=n,this.fn=e}createFunction(e){return(...n)=>{if(n.length!==this.paramCount)throw new h(e,c.WrongNumberOfParameters,null);return this.fn(...n)}}call(e,n){return this.fn(...n.arguments)}marshalledCall(e,n,r,i){return i(e,n,(u,a,s)=>{s=s.map(l=>!X(l)||l instanceof et?l:Lt(l,e,i));const o=this.call(r,{arguments:s});return at(o)?o.then(l=>Lt(l,r,i)):o})}}function Te(t,e,n){try{return n(t,null,e.arguments)}catch(r){throw r}}function I(t,e){try{switch(e.type){case"EmptyStatement":return"lc.voidOperation";case"VariableDeclarator":return wh(t,e);case"VariableDeclaration":return Dh(t,e);case"BlockStatement":case"Program":return ei(t,e);case"FunctionDeclaration":return yh(t,e);case"ImportDeclaration":return ph(t,e);case"ExportNamedDeclaration":return gh(t,e);case"ReturnStatement":return mh(t,e);case"IfStatement":return yu(t,e);case"ExpressionStatement":return dh(t,e);case"AssignmentExpression":return fh(t,e);case"UpdateExpression":return ch(t,e);case"BreakStatement":return"break";case"ContinueStatement":return"continue";case"TemplateLiteral":return Eh(t,e);case"TemplateElement":return JSON.stringify(e.value?e.value.cooked:"");case"ForStatement":return lh(t,e);case"ForInStatement":return oh(t,e);case"WhileStatement":return hh(t,e);case"Identifier":return vh(t,e);case"MemberExpression":return xh(t,e);case"Literal":return e.value===null||e.value===void 0?"null":JSON.stringify(e.value);case"CallExpression":return bh(t,e);case"UnaryExpression":return Fh(t,e);case"BinaryExpression":return Ah(t,e);case"LogicalExpression":return Sh(t,e);case"ArrayExpression":return Ch(t,e);case"ObjectExpression":return ah(t,e);case"Property":return uh(t,e);case"Array":throw new fe(t,c.NeverReach,e);default:throw new fe(t,c.Unrecognised,e)}}catch(n){throw n}}function ah(t,e){let n="lang.dictionary([";for(let r=0;r0&&(n+=","),n+="lang.strCheck("+(i.key.type==="Identifier"?"'"+i.key.name+"'":I(t,i.key))+",'ObjectExpression'),lang.aCheck("+I(t,i.value)+", 'ObjectExpression')"}return n+="])",n}function uh(t,e){throw new fe(t,c.NeverReach,e)}function oh(t,e){const n=Ze(t),r=Ze(t),i=Ze(t);let u="var "+n+" = "+I(t,e.right)+`; `;e.left.type==="VariableDeclaration"&&(u+=I(t,e.left));let a=e.left.type==="VariableDeclaration"?e.left.declarations[0].id.name:e.left.name;a=a.toLowerCase(),be(a);let s="";t.localScope!==null&&(t.localScope[a]!==void 0?s="lscope['"+a+"']":t.localScope._SymbolsMap[a]!==void 0&&(s="lscope['"+t.localScope._SymbolsMap[a]+"']"));let o="";if(s===""){if(t.globalScope[a]!==void 0)s="gscope['"+a+"']";else if(t.globalScope._SymbolsMap[a]!==void 0)s="gscope['"+t.globalScope._SymbolsMap[a]+"']";else if(t.localScope!==null)if(t.undeclaredGlobalsInFunctions.has(a))s="gscope['"+t.undeclaredGlobalsInFunctions.get(a).manglename+"']",o=t.undeclaredGlobalsInFunctions.get(a).manglename;else{const l={manglename:Ve(t),node:e.left};t.undeclaredGlobalsInFunctions.set(a,l),s="gscope['"+l.manglename+"']",o=l.manglename}}return o&&(u+="lang.chkAssig('"+o+`',runtimeCtx); `),u+="if ("+n+`===null) { lastStatement = lc.voidOperation; } @@ -131,7 +131,7 @@ return lang.__awaiter(this, void 0, void 0, function* () { var lastStatement=lc.voidOperation; `+u+` return lastStatement; } - return this.postProcess(mainBody()); `;const s=i.moduleFactory,o=i.moduleFactoryMap,l=i.exports,d={};for(const m in l)d[m]=i.mangleMap[m]!==void 0?i.mangleMap[m]:m;const f={lc:nu,lang:xu,mangles:i.mangleMap,postProcess(m){if(m instanceof Ee&&(m=m.value),m instanceof Rt&&(m=m.value),m===A&&(m=null),m===Ue)throw new h(null,c.IllegalResult,null);if(m===jt)throw new h(null,c.IllegalResult,null);if(X(m))throw new h(null,c.IllegalResult,null);return m},prepare(m,g){let D=m.spatialReference;D==null&&(D=xn.WebMercator);const k=wu(m.vars,m.customfunctions,g);return{localStack:[],isAsync:g,moduleFactory:s,moduleFactoryMap:o,mangleMap:this.mangles,moduleSingletons:{},exports:l,gdefs:{},exportmangle:d,spatialReference:D,globalScope:k,abortSignal:m.abortSignal===void 0||m.abortSignal===null?{aborted:!1}:m.abortSignal,localScope:null,services:m.services,console:m.console?m.console:Jn,lrucache:m.lrucache,interceptor:m.interceptor,symbols:{symbolCounter:0},depthCounter:{depth:1}}}};return new Function("context","spatialReference",a).bind(f)}async function Nh(){return Et([await Ke(()=>import("./geomasync.a1913b84.js"),["assets/geomasync.a1913b84.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/geometryEngineAsync.3b47a469.js","assets/number.8c2c26f3.js"])],"async"),!0}class un extends nr{constructor(e){super(null),this.moduleContext=e}hasGlobal(e){return this.moduleContext.exports[e]===void 0&&(e=e.toLowerCase()),this.moduleContext.exports[e]!==void 0}setGlobal(e,n){const r=this.moduleContext.globalScope,i=e.toLowerCase();if(X(n))throw new h(null,c.AssignModuleFunction,null);r[this.moduleContext.exportmangle[i]]=n}global(e){const n=this.moduleContext.globalScope;e=e.toLowerCase();const r=n[this.moduleContext.exportmangle[e]];if(r===void 0)throw new h(null,c.InvalidIdentifier,null);if(X(r)&&!(r instanceof et)){const i=new et;return i.fn=r,i.parameterEvaluator=Te,i.context=this.moduleContext,n[this.moduleContext.exportmangle[e]]=i,i}return r}}function Oh(t,e,n=!1){const r={isAsync:n,moduleFactory:e.moduleFactory,moduleFactoryMap:{},libraryResolver:new cr(null,t.loadedModules),globalScope:Du(e.vars,n?zt:ue,e.customfunctions),customfunctions:e.customfunctions,localScope:null,mangleMap:{},undeclaredGlobalsInFunctions:new Map,depthCounter:{depth:1},exports:{},console:Jn,lrucache:e.lrucache,interceptor:e.interceptor,services:e.services,symbols:{symbolCounter:0}};let i=I(r,t);i===""&&(i="lc.voidOperation; ");let u="";u=n?`var runtimeCtx=this.prepare(context, true); + return this.postProcess(mainBody()); `;const s=i.moduleFactory,o=i.moduleFactoryMap,l=i.exports,d={};for(const m in l)d[m]=i.mangleMap[m]!==void 0?i.mangleMap[m]:m;const f={lc:nu,lang:xu,mangles:i.mangleMap,postProcess(m){if(m instanceof Ee&&(m=m.value),m instanceof Rt&&(m=m.value),m===A&&(m=null),m===Ue)throw new h(null,c.IllegalResult,null);if(m===jt)throw new h(null,c.IllegalResult,null);if(X(m))throw new h(null,c.IllegalResult,null);return m},prepare(m,g){let D=m.spatialReference;D==null&&(D=xn.WebMercator);const k=wu(m.vars,m.customfunctions,g);return{localStack:[],isAsync:g,moduleFactory:s,moduleFactoryMap:o,mangleMap:this.mangles,moduleSingletons:{},exports:l,gdefs:{},exportmangle:d,spatialReference:D,globalScope:k,abortSignal:m.abortSignal===void 0||m.abortSignal===null?{aborted:!1}:m.abortSignal,localScope:null,services:m.services,console:m.console?m.console:Jn,lrucache:m.lrucache,interceptor:m.interceptor,symbols:{symbolCounter:0},depthCounter:{depth:1}}}};return new Function("context","spatialReference",a).bind(f)}async function Nh(){return Et([await Ke(()=>import("./geomasync.ca31aba0.js"),["assets/geomasync.ca31aba0.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/geometryEngineAsync.68619ff9.js","assets/number.9e690eda.js"])],"async"),!0}class un extends nr{constructor(e){super(null),this.moduleContext=e}hasGlobal(e){return this.moduleContext.exports[e]===void 0&&(e=e.toLowerCase()),this.moduleContext.exports[e]!==void 0}setGlobal(e,n){const r=this.moduleContext.globalScope,i=e.toLowerCase();if(X(n))throw new h(null,c.AssignModuleFunction,null);r[this.moduleContext.exportmangle[i]]=n}global(e){const n=this.moduleContext.globalScope;e=e.toLowerCase();const r=n[this.moduleContext.exportmangle[e]];if(r===void 0)throw new h(null,c.InvalidIdentifier,null);if(X(r)&&!(r instanceof et)){const i=new et;return i.fn=r,i.parameterEvaluator=Te,i.context=this.moduleContext,n[this.moduleContext.exportmangle[e]]=i,i}return r}}function Oh(t,e,n=!1){const r={isAsync:n,moduleFactory:e.moduleFactory,moduleFactoryMap:{},libraryResolver:new cr(null,t.loadedModules),globalScope:Du(e.vars,n?zt:ue,e.customfunctions),customfunctions:e.customfunctions,localScope:null,mangleMap:{},undeclaredGlobalsInFunctions:new Map,depthCounter:{depth:1},exports:{},console:Jn,lrucache:e.lrucache,interceptor:e.interceptor,services:e.services,symbols:{symbolCounter:0}};let i=I(r,t);i===""&&(i="lc.voidOperation; ");let u="";u=n?`var runtimeCtx=this.prepare(context, true); var lc = this.lc; var lang = this.lang; var gscope=runtimeCtx.globalScope; return lang.__awaiter(this, void 0, void 0, function* () { @@ -160,4 +160,4 @@ return lang.__awaiter(this, void 0, void 0, function* () { return "Hello World " + hello; } `,uri:"mock"};const s=e.replace("mock:","");if(De.mocks[s]!==void 0)return{url:"",scheme:"mock",data:De.mocks[s],uri:e}}throw new ln(wt.UnrecognisedUri,{uri:e})}async fetchModule(e){const n=De.cachedModules.getFromCache(e.uri);if(n)return n;const r=this.fetchSource(e);De.cachedModules.addToCache(e.uri,r);let i=null;try{i=await r}catch(u){throw De.cachedModules.removeFromCache(e.uri),u}return i}async fetchSource(e){var n;if(e.scheme==="portal"){const r=await no(e.url,{responseType:"text",query:{}});if(r.data)return Yn(r.data,[])}if(e.scheme==="mock")return Yn((n=e.data)!=null?n:"",[]);throw new ln(wt.UnsupportedUriProtocol)}static create(e){return new De(e)}static getDefault(){var e;return(e=this._default)!=null?e:De._default=De._moduleResolverFactory()}static set moduleResolverClass(e){this._moduleResolverFactory=e,this._default=null}}De.mocks={},De.cachedModules=new jh(30),De._default=null,De._moduleResolverFactory=()=>{const t=qs.getDefault();return new De(t.url)};class Wh extends Ft{constructor(e,n){super(),this.definition=null,this.context=null,this.definition=e,this.context=n}createFunction(e){return(...n)=>{const r={spatialReference:this.context.spatialReference,console:this.context.console,lrucache:this.context.lrucache,exports:this.context.exports,libraryResolver:this.context.libraryResolver,interceptor:this.context.interceptor,localScope:{},depthCounter:{depth:e.depthCounter.depth+1},globalScope:this.context.globalScope};if(r.depthCounter.depth>64)throw new h(e,c.MaximumCallDepth,null);return Br(this.definition,r,n,null)}}call(e,n){return Ye(e,n,(r,i,u)=>{const a={spatialReference:e.spatialReference,globalScope:e.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};if(a.depthCounter.depth>64)throw new h(e,c.MaximumCallDepth,n);return Br(this.definition,a,u,n)})}marshalledCall(e,n,r,i){return i(e,n,(u,a,s)=>{const o={spatialReference:e.spatialReference,globalScope:r.globalScope,depthCounter:{depth:e.depthCounter.depth+1},libraryResolver:e.libraryResolver,exports:e.exports,console:e.console,lrucache:e.lrucache,interceptor:e.interceptor,localScope:{}};return s=s.map(l=>!X(l)||l instanceof et?l:Lt(l,e,i)),Lt(Br(this.definition,o,s,n),r,i)})}}class Gt extends nr{constructor(e){super(e)}global(e){const n=this.executingContext.globalScope[e.toLowerCase()];if(n.valueset||(n.value=T(this.executingContext,n.node),n.valueset=!0),X(n.value)&&!(n.value instanceof et)){const r=new et;r.fn=n.value,r.parameterEvaluator=Ye,r.context=this.executingContext,n.value=r}return n.value}setGlobal(e,n){if(X(n))throw new h(null,c.AssignModuleFunction,null);this.executingContext.globalScope[e.toLowerCase()]={value:n,valueset:!0,node:null}}hasGlobal(e){return this.executingContext.exports[e]===void 0&&(e=e.toLowerCase()),this.executingContext.exports[e]!==void 0}loadModule(e){let n=e.spatialReference;n==null&&(n=new xn({wkid:102100})),this.moduleScope=Iu({},e.customfunctions),this.executingContext={spatialReference:n,globalScope:this.moduleScope,localScope:null,libraryResolver:new cr(e.libraryResolver._moduleSingletons,this.source.syntax.loadedModules),exports:{},console:e.console?e.console:ku,lrucache:e.lrucache,interceptor:e.interceptor,depthCounter:{depth:1}},T(this.executingContext,this.source.syntax)}}function Jh(t,e){const n=[];for(let r=0;r=r.length)throw new h(t,c.OutOfBounds,e);n=p(r[i]),r[i]=e.operator==="++"?n+1:n-1}else if(r instanceof O){if(v(i)===!1)throw new h(t,c.KeyAccessorMustBeString,e);if(r.hasField(i)!==!0)throw new h(t,c.FieldNotFound,e);n=p(r.field(i)),r.setField(i,e.operator==="++"?n+1:n-1)}else if(ne(r)){if(v(i)===!1)throw new h(t,c.KeyAccessorMustBeString,e);if(r.hasField(i)!==!0)throw new h(t,c.FieldNotFound,e);n=p(r.field(i)),r.setField(i,e.operator==="++"?n+1:n-1)}else{if(L(r))throw new h(t,c.Immutable,e);if(!(r instanceof Gt))throw new h(t,c.InvalidParameter,e);if(v(i)===!1)throw new h(t,c.ModuleAccessorMustBeString,e);if(r.hasGlobal(i)!==!0)throw new h(t,c.ModuleExportNotFound,e);n=p(r.global(i)),r.setGlobal(i,e.operator==="++"?n+1:n-1)}return e.prefix===!1?n:e.operator==="++"?n+1:n-1}if(r=e.argument.type==="Identifier"?e.argument.name.toLowerCase():"",!r)throw new h(t,c.InvalidIdentifier,e);if(t.localScope!=null&&t.localScope[r]!==void 0)return n=p(t.localScope[r].value),t.localScope[r]={value:e.operator==="++"?n+1:n-1,valueset:!0,node:e},e.prefix===!1?n:e.operator==="++"?n+1:n-1;if(t.globalScope[r]!==void 0)return n=p(t.globalScope[r].value),t.globalScope[r]={value:e.operator==="++"?n+1:n-1,valueset:!0,node:e},e.prefix===!1?n:e.operator==="++"?n+1:n-1;throw new h(t,c.InvalidIdentifier,e)}function We(t,e,n,r,i){switch(e){case"=":return t===A?null:t;case"/=":return p(n)/p(t);case"*=":return p(n)*p(t);case"-=":return p(n)-p(t);case"+=":return v(n)||v(t)?b(n)+b(t):p(n)+p(t);case"%=":return p(n)%p(t);default:throw new h(i,c.UnsupportedOperator,r)}}function rf(t,e){const n=T(t,e.right);let r=null,i="";if(e.left.type==="MemberExpression"){if(r=T(t,e.left.object),e.left.computed===!0)i=T(t,e.left.property);else{if(e.left.property.type!=="Identifier")throw new h(t,c.InvalidIdentifier,e);i=e.left.property.name}if(M(r)){if(!G(i))throw new h(t,c.ArrayAccessorMustBeNumber,e);if(i<0&&(i=r.length+i),i<0||i>r.length)throw new h(t,c.OutOfBounds,e);if(i===r.length){if(e.operator!=="=")throw new h(t,c.OutOfBounds,e);r[i]=We(n,e.operator,r[i],e,t)}else r[i]=We(n,e.operator,r[i],e,t)}else if(r instanceof O){if(v(i)===!1)throw new h(t,c.KeyAccessorMustBeString,e);if(r.hasField(i)===!0)r.setField(i,We(n,e.operator,r.field(i),e,t));else{if(e.operator!=="=")throw new h(t,c.FieldNotFound,e,{key:i});r.setField(i,We(n,e.operator,null,e,t))}}else if(ne(r)){if(v(i)===!1)throw new h(t,c.KeyAccessorMustBeString,e);if(r.hasField(i)===!0)r.setField(i,We(n,e.operator,r.field(i),e,t));else{if(e.operator!=="=")throw new h(t,c.FieldNotFound,e,{key:i});r.setField(i,We(n,e.operator,null,e,t))}}else{if(L(r))throw new h(t,c.Immutable,e);if(!(r instanceof Gt))throw new h(t,c.InvalidIdentifier,e);if(v(i)===!1)throw new h(t,c.ModuleAccessorMustBeString,e);if(r.hasGlobal(i)!==!0)throw new h(t,c.ModuleExportNotFound,e);r.setGlobal(i,We(n,e.operator,r.global(i),e,t))}return A}if(r=e.left.name.toLowerCase(),t.localScope!=null&&t.localScope[r]!==void 0)return t.localScope[r]={value:We(n,e.operator,t.localScope[r].value,e,t),valueset:!0,node:e.right},A;if(t.globalScope[r]!==void 0)return t.globalScope[r]={value:We(n,e.operator,t.globalScope[r].value,e,t),valueset:!0,node:e.right},A;throw new h(t,c.InvalidIdentifier,e)}function sf(t,e){if(e.expression.type==="AssignmentExpression"||e.expression.type==="UpdateExpression")return T(t,e.expression);if(e.expression.type==="CallExpression"){const n=T(t,e.expression);return n===A?A:new Rt(n)}{const n=T(t,e.expression);return n===A?A:new Rt(n)}}function af(t,e){const n=T(t,e.test);if(n===!0)return T(t,e.consequent);if(n===!1)return e.alternate!==null?T(t,e.alternate):A;throw new h(t,c.BooleanConditionRequired,e)}function uf(t,e){let n=A;for(let r=0;r=n.length||r<0)throw new h(t,c.OutOfBounds,e);return n[r]}throw new h(t,c.InvalidMemberAccessKey,e)}if(v(n)){if(G(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length+r),r>=n.length||r<0)throw new h(t,c.OutOfBounds,e);return n[r]}throw new h(t,c.InvalidMemberAccessKey,e)}if(L(n)){if(G(r)&&isFinite(r)&&Math.floor(r)===r){if(r<0&&(r=n.length()+r),r>=n.length()||r<0)throw new h(t,c.OutOfBounds,e);return n.get(r)}throw new h(t,c.InvalidMemberAccessKey,e)}throw new h(t,c.InvalidMemberAccessKey,e)}}catch(n){throw n}}function pf(t,e){try{const n=T(t,e.argument);if(z(n)){if(e.operator==="!")return!n;if(e.operator==="-")return-1*p(n);if(e.operator==="+")return 1*p(n);if(e.operator==="~")return~p(n);throw new h(t,c.UnsupportedUnaryOperator,e)}if(e.operator==="~")return~p(n);if(e.operator==="-")return-1*p(n);if(e.operator==="+")return 1*p(n);throw new h(t,c.UnsupportedUnaryOperator,e)}catch(n){throw n}}function gf(t,e){try{const n=[];for(let r=0;r>":case">>>":case"^":case"&":return wi(p(r),p(i),e.operator);case"==":return Be(r,i);case"!=":return!Be(r,i);case"<":case">":case"<=":case">=":return Di(r,i,e.operator);case"+":return v(r)||v(i)?b(r)+b(i):p(r)+p(i);case"-":return p(r)-p(i);case"*":return p(r)*p(i);case"/":return p(r)/p(i);case"%":return p(r)%p(i);default:throw new h(t,c.UnsupportedOperator,e)}}catch(n){throw n}}function Df(t,e){try{const n=T(t,e.left);if(z(n))switch(e.operator){case"||":if(n===!0)return n;{const r=T(t,e.right);if(z(r))return r;throw new h(t,c.LogicExpressionOrAnd,e)}case"&&":if(n===!1)return n;{const r=T(t,e.right);if(z(r))return r;throw new h(t,c.LogicExpressionOrAnd,e)}default:throw new h(t,c.LogicExpressionOrAnd,e)}throw new h(t,c.LogicalExpressionOnlyBoolean,e)}catch(n){throw n}}function wf(t,e){return e.value?e.value.cooked:""}function xf(t,e,n){if(X(t))throw new h(e,c.NoFunctionInTemplateLiteral,n);return t}function Ff(t,e){let n="",r=0;for(const i of e.quasis)n+=i.value?i.value.cooked:"",i.tail===!1&&(n+=e.expressions[r]?b(xf(T(t,e.expressions[r]),t,e)):"",r++);return n}function Su(t,e){let n;try{const r=e.name.toLowerCase();if(t.localScope!=null&&t.localScope[r]!==void 0)return n=t.localScope[r],n.valueset===!0||(n.value=T(t,n.node),n.valueset=!0),n.value;if(t.globalScope[r]!==void 0)return n=t.globalScope[r],n.valueset===!0||(n.value=T(t,n.node),n.valueset=!0),n.value;throw new h(t,c.InvalidIdentifier,e)}catch(r){throw r}}function Cf(t,e){try{if(e.callee.type==="MemberExpression"){const n=T(t,e.callee.object);if(!(n instanceof Gt))throw new h(t,c.FuncionNotFound,e);const r=e.callee.computed===!1?e.callee.property.name:T(t,e.callee.property);if(!n.hasGlobal(r))throw new h(t,c.FuncionNotFound,e);const i=n.global(r);if(!X(i))throw new h(t,c.CallNonFunction,e);return i.call(t,e)}if(e.callee.type!=="Identifier")throw new h(t,c.FuncionNotFound,e);if(t.localScope!=null&&t.localScope[e.callee.name.toLowerCase()]!==void 0){const n=t.localScope[e.callee.name.toLowerCase()];if(X(n.value))return n.value.call(t,e);throw new h(t,c.CallNonFunction,e)}if(t.globalScope[e.callee.name.toLowerCase()]!==void 0){const n=t.globalScope[e.callee.name.toLowerCase()];if(X(n.value))return n.value.call(t,e);throw new h(t,c.CallNonFunction,e)}throw new h(t,c.FuncionNotFound,e)}catch(n){throw n}}const ye={};function vu(t,e,n,r){try{const i=T(t,e.arguments[n]);if(Be(i,r))return T(t,e.arguments[n+1]);{const u=e.arguments.length-n;return u===1?T(t,e.arguments[n]):u===2?null:u===3?T(t,e.arguments[n+2]):vu(t,e,n+2,r)}}catch(i){throw i}}function bu(t,e,n,r){try{if(r===!0)return T(t,e.arguments[n+1]);if(e.arguments.length-n===3)return T(t,e.arguments[n+2]);{const i=T(t,e.arguments[n+2]);if(z(i)===!1)throw new h(t,c.BooleanConditionRequired,e.arguments[n+2]);return bu(t,e,n+2,i)}}catch(i){throw i}}function Br(t,e,n,r){try{const i=t.body;if(n.length!==t.params.length)throw new h(e,c.WrongNumberOfParameters,r);if(e.localScope!=null)for(let a=0;aimport("./geometryEngine.cfc395ce.js"),["assets/geometryEngine.cfc395ce.js","assets/geometryEngineBase.82b25ca5.js","assets/hydrated.905f3857.js","assets/index.d94abe07.js","assets/index.f5419ca5.css"]),Ke(()=>Promise.resolve().then(function(){return _c}),void 0)]);return Nu=!0,e.setGeometryEngine(t),!0}let Lr=null;function ki(){return Lr!==null||(Lr=Lu()),Lr}async function Lu(){await Nh(),ze=await Ke(()=>import("./arcadeAsyncRuntime.9a6ca0c0.js"),["assets/arcadeAsyncRuntime.9a6ca0c0.js","assets/geomasync.a1913b84.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/geometryEngineAsync.3b47a469.js","assets/number.8c2c26f3.js"]);for(const t of ii)ze.extend(t),Et(t,"async");return ii=null,!0}function $u(){return Mu}function Ru(){return!!ze}function Pu(){return Nu}let $r=null;function Ti(){return $r||($r=Uu(),$r)}async function Uu(){await ki();const[t,e,n,r,i]=await Promise.all([Ke(()=>import("./featureSetUtils.f1157478.js").then(function(u){return u.h}),["assets/featureSetUtils.f1157478.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/SpatialFilter.dc70612a.js","assets/WhereClause.253310fe.js","assets/geometryEngineAsync.3b47a469.js","assets/executeForIds.bade5c1b.js"]),Ke(()=>import("./featuresetbase.df0355d2.js"),["assets/featuresetbase.df0355d2.js","assets/featureSetUtils.f1157478.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/SpatialFilter.dc70612a.js","assets/WhereClause.253310fe.js","assets/geometryEngineAsync.3b47a469.js","assets/executeForIds.bade5c1b.js","assets/number.8c2c26f3.js"]),Ke(()=>import("./featuresetgeom.d91e9a0c.js"),["assets/featuresetgeom.d91e9a0c.js","assets/SpatialFilter.dc70612a.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/WhereClause.253310fe.js","assets/geometryEngineAsync.3b47a469.js","assets/number.8c2c26f3.js"]),Ke(()=>import("./featuresetstats.d56be13b.js"),["assets/featuresetstats.d56be13b.js","assets/WhereClause.253310fe.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/number.8c2c26f3.js"]),Ke(()=>import("./featuresetstring.4242b3c8.js"),["assets/featuresetstring.4242b3c8.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/number.8c2c26f3.js"])]);return Zu=t,ze.extend([e,n,r,i]),Et([e,n,r,i],"async"),Mu=!0,!0}function zu(t,e=[]){return t.usesFeatureSet===void 0&&Sn(t,e),t.usesFeatureSet===!0}function Mf(t,e=[]){return t.isAsync===void 0&&Sn(t,e),t.isAsync===!0}function Nf(t,e){if(e){for(const n of e)if(hr(t,n))return!0;return!1}return!1}async function Gu(t,e,n=[],r=!1,i=null){return Mi(new Set,t,e,n,r,i)}async function Mi(t,e,n,r=[],i=!1,u=null){const a=typeof e=="string"?vi(e):e,s=[];return a&&(Pu()===!1&&(fr(a)||i)&&s.push(Ii()),Ru()===!1&&(a.isAsync===!0||n)&&s.push(ki()),$u()===!1&&(zu(a)||Nf(a,r))&&s.push(Ti())),s.length&&await Promise.all(s),await Vu(t,a,u,n,i),!0}function Of(t,e=[]){return t.usesModules===void 0&&Sn(t,e),t.usesModules===!0}async function Vu(t,e,n=null,r=!1,i=!1){const u=iu(e);n===null&&u.length>0&&(n=De.getDefault()),e.loadedModules={};for(const a of u){Vs(n);const s=n.normalizeModuleUri(a.source);if(t.has(s.uri))throw new h(null,c.CircularModules,null);t.add(s.uri);const o=await n.fetchModule(s);await Mi(t,o,r,[],i,n),t.delete(s.uri),o.isAsync&&(e.isAsync=!0),o.usesFeatureSet&&(e.usesFeatureSet=!0),o.usesGeometry&&(e.usesGeometry=!0),e.loadedModules[a.libname]={uri:s.uri,script:o}}}function qu(t){if(fr(t))return!0;const e=Jr(t);let n=!1;for(let r=0;r{Us.test(a)&&(a=a.replace(Us,""),i.push(a))});const u=i.filter(a=>a.includes("*"));return i=i.filter(a=>!u.includes(a)),e&&u.forEach(a=>{const s=new RegExp(`^${a.split(/\*+/).map(Lf).join(".*")}$`,"i");e.forEach(o=>s.test(o)?i.push(o):null)}),[...new Set(i.sort())]}function Hf(t){return hr(t,"$view")}function jf(t,e){return!!t&&hr(t,e)}function Wf(t){if(!(!t||t.spatialReference==null&&(t.scale==null||t.viewingMode==null)))return{view:t.viewingMode&&t.scale!=null?new O({viewingMode:t.viewingMode,scale:t.scale}):null,sr:t.spatialReference}}function Jf({url:t,spatialReference:e,lrucache:n,interceptor:r}){const i=dr();return i?i.createFeatureSetCollectionFromService(t,e,n,r):null}function Yf({layer:t,spatialReference:e,outFields:n,returnGeometry:r,lrucache:i,interceptor:u}){if(t===null)return null;const a=dr();return a?a.constructFeatureSet(t,e,n,r!=null?r:!0,i,u):null}function Kf(t){if((t==null?void 0:t.map)===null)return null;const e=dr();return e?e.createFeatureSetCollectionFromMap(t.map,t.spatialReference,t.lrucache,t.interceptor):null}function Qf(t){return O.convertJsonToArcade(t)}function Xf(t,e,n=[]){return Gu(t,e,n)}function ed(){return Ii()}function td(){return Ti()}function nd(t){return t.type==="simple"||t.type==="class-breaks"||t.type==="unique-value"||t.type==="dot-density"||t.type==="dictionary"||t.type==="pie-chart"}function rd(t){return t.declaredClass==="esri.layers.support.LabelClass"}function id(t){return t.declaredClass==="esri.PopupTemplate"}function Hu(t,e){var r;if(!t)return!1;if(typeof t=="string")return e(t);const n=t;if(nd(n)){if(n.type==="dot-density"){const a=(r=n.attributes)==null?void 0:r.some(s=>e(s.valueExpression));if(a)return a}const i=n.visualVariables,u=!!i&&i.some(a=>{let s=e(a.valueExpression);return a.type==="size"&&(_i(a.minSize)&&(s=s||e(a.minSize.valueExpression)),_i(a.maxSize)&&(s=s||e(a.maxSize.valueExpression))),s});return!(!("valueExpression"in n)||!e(n.valueExpression))||u}if(rd(n)){const i=n.labelExpressionInfo&&n.labelExpressionInfo.expression;return!(!i||!e(i))||!1}return!!id(n)&&(!!n.expressionInfos&&n.expressionInfos.some(i=>e(i.expression))||Array.isArray(n.content)&&n.content.some(i=>{var u;return i.type==="expression"&&e((u=i.expressionInfo)==null?void 0:u.expression)}))}function sd(t){const e=vn(t);return!!e&&qu(e)}function ad(t){return Hu(t,sd)}function ud(t){const e=vn(t);return!!e&&fr(e)}function od(t){return Hu(t,ud)}var Ed=Object.freeze(Object.defineProperty({__proto__:null,convertFeatureLayerToFeatureSet:Yf,convertJsonToArcade:Qf,convertMapToFeatureSetCollection:Kf,convertServiceUrlToWorkspace:Jf,createExecContext:Pf,createFeature:Uf,createFunction:Rf,createSyntaxTree:vn,dependsOnView:Hf,enableFeatureSetOperations:td,enableGeometryOperations:ed,evalSyntaxTree:Gf,executeAsyncFunction:qf,executeFunction:Vf,extractFieldNames:Zf,getArcadeType:$f,getViewInfo:Wf,hasGeometryFunctions:ad,hasGeometryOperations:od,hasVariable:jf,loadScriptDependencies:Xf,updateExecContext:zf,arcade:Bf,Dictionary:O,arcadeFeature:q},Symbol.toStringTag,{value:"Module"}));export{wd as $,jt as A,gu as B,cu as C,Ee as D,L as E,X as F,jr as G,le as H,Rn as I,O as J,b as K,Pt as L,au as M,hu as N,vc as O,rr as P,Di as Q,bc as R,fn as S,Cc as T,Xt as U,y as V,Dn as W,Be as X,M as Y,G as Z,z as _,Ct as a,us as a0,hd as a1,as as a2,lc as a3,Dd as a4,Fd as a5,xd as a6,Rc as a7,ai as a8,B as a9,dd as aa,fd as ab,md as ac,pd as ad,yd as ae,uc as af,ls as ag,gd as ah,mu as ai,me as aj,oc as ak,lt as al,Sr as am,Cd as an,Qa as ao,ar as ap,Pn as aq,Xa as ar,Ya as as,eu as at,Ka as au,Ae as av,tu as aw,cs as ax,Ed as ay,Rt as b,ne as c,wi as d,c as e,du as f,re as g,q as h,Ft as i,Ue as j,A as k,et as l,Yr as m,Lt as n,Wr as o,nr as p,P as q,p as r,cr as s,h as t,ao as u,$e as v,v as w,On as x,_ as y,Q as z}; +`,tab:" ",singlequote:"'",doublequote:'"',forwardslash:"/",backwardslash:"\\"});r.immutable=!1,n.textformatting={value:r,valueset:!0,node:null};for(const i in e)n[i]={value:new Ct(e[i]),native:!0,valueset:!0,node:null};for(const i in t)t[i]&&t[i].declaredClass==="esri.Graphic"?n[i]={value:q.createFromGraphic(t[i]),valueset:!0,node:null}:n[i]={value:t[i],valueset:!0,node:null};return n}gn.prototype=ye,gn.prototype.infinity={value:Number.POSITIVE_INFINITY,valueset:!0,node:null},gn.prototype.pi={value:Math.PI,valueset:!0,node:null};function ku(t){console.log(t)}function Tu(t){const e={mode:"sync",compiled:!1,functions:{},signatures:[],standardFunction:Ye,evaluateIdentifier:Su};for(let n=0;nimport("./geometryEngine.a80c0474.js"),["assets/geometryEngine.a80c0474.js","assets/geometryEngineBase.82b25ca5.js","assets/hydrated.406495cb.js","assets/index.221827cd.js","assets/index.f5419ca5.css"]),Ke(()=>Promise.resolve().then(function(){return _c}),void 0)]);return Nu=!0,e.setGeometryEngine(t),!0}let Lr=null;function ki(){return Lr!==null||(Lr=Lu()),Lr}async function Lu(){await Nh(),ze=await Ke(()=>import("./arcadeAsyncRuntime.f9b6facc.js"),["assets/arcadeAsyncRuntime.f9b6facc.js","assets/geomasync.ca31aba0.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/geometryEngineAsync.68619ff9.js","assets/number.9e690eda.js"]);for(const t of ii)ze.extend(t),Et(t,"async");return ii=null,!0}function $u(){return Mu}function Ru(){return!!ze}function Pu(){return Nu}let $r=null;function Ti(){return $r||($r=Uu(),$r)}async function Uu(){await ki();const[t,e,n,r,i]=await Promise.all([Ke(()=>import("./featureSetUtils.e062de4c.js").then(function(u){return u.h}),["assets/featureSetUtils.e062de4c.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/SpatialFilter.fd0a95ff.js","assets/WhereClause.5b749615.js","assets/geometryEngineAsync.68619ff9.js","assets/executeForIds.9f78e2a6.js"]),Ke(()=>import("./featuresetbase.dc4264cd.js"),["assets/featuresetbase.dc4264cd.js","assets/featureSetUtils.e062de4c.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/SpatialFilter.fd0a95ff.js","assets/WhereClause.5b749615.js","assets/geometryEngineAsync.68619ff9.js","assets/executeForIds.9f78e2a6.js","assets/number.9e690eda.js"]),Ke(()=>import("./featuresetgeom.d2fdc1e5.js"),["assets/featuresetgeom.d2fdc1e5.js","assets/SpatialFilter.fd0a95ff.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/WhereClause.5b749615.js","assets/geometryEngineAsync.68619ff9.js","assets/number.9e690eda.js"]),Ke(()=>import("./featuresetstats.a24876b2.js"),["assets/featuresetstats.a24876b2.js","assets/WhereClause.5b749615.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/number.9e690eda.js"]),Ke(()=>import("./featuresetstring.0a520808.js"),["assets/featuresetstring.0a520808.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/number.9e690eda.js"])]);return Zu=t,ze.extend([e,n,r,i]),Et([e,n,r,i],"async"),Mu=!0,!0}function zu(t,e=[]){return t.usesFeatureSet===void 0&&Sn(t,e),t.usesFeatureSet===!0}function Mf(t,e=[]){return t.isAsync===void 0&&Sn(t,e),t.isAsync===!0}function Nf(t,e){if(e){for(const n of e)if(hr(t,n))return!0;return!1}return!1}async function Gu(t,e,n=[],r=!1,i=null){return Mi(new Set,t,e,n,r,i)}async function Mi(t,e,n,r=[],i=!1,u=null){const a=typeof e=="string"?vi(e):e,s=[];return a&&(Pu()===!1&&(fr(a)||i)&&s.push(Ii()),Ru()===!1&&(a.isAsync===!0||n)&&s.push(ki()),$u()===!1&&(zu(a)||Nf(a,r))&&s.push(Ti())),s.length&&await Promise.all(s),await Vu(t,a,u,n,i),!0}function Of(t,e=[]){return t.usesModules===void 0&&Sn(t,e),t.usesModules===!0}async function Vu(t,e,n=null,r=!1,i=!1){const u=iu(e);n===null&&u.length>0&&(n=De.getDefault()),e.loadedModules={};for(const a of u){Vs(n);const s=n.normalizeModuleUri(a.source);if(t.has(s.uri))throw new h(null,c.CircularModules,null);t.add(s.uri);const o=await n.fetchModule(s);await Mi(t,o,r,[],i,n),t.delete(s.uri),o.isAsync&&(e.isAsync=!0),o.usesFeatureSet&&(e.usesFeatureSet=!0),o.usesGeometry&&(e.usesGeometry=!0),e.loadedModules[a.libname]={uri:s.uri,script:o}}}function qu(t){if(fr(t))return!0;const e=Jr(t);let n=!1;for(let r=0;r{Us.test(a)&&(a=a.replace(Us,""),i.push(a))});const u=i.filter(a=>a.includes("*"));return i=i.filter(a=>!u.includes(a)),e&&u.forEach(a=>{const s=new RegExp(`^${a.split(/\*+/).map(Lf).join(".*")}$`,"i");e.forEach(o=>s.test(o)?i.push(o):null)}),[...new Set(i.sort())]}function Hf(t){return hr(t,"$view")}function jf(t,e){return!!t&&hr(t,e)}function Wf(t){if(!(!t||t.spatialReference==null&&(t.scale==null||t.viewingMode==null)))return{view:t.viewingMode&&t.scale!=null?new O({viewingMode:t.viewingMode,scale:t.scale}):null,sr:t.spatialReference}}function Jf({url:t,spatialReference:e,lrucache:n,interceptor:r}){const i=dr();return i?i.createFeatureSetCollectionFromService(t,e,n,r):null}function Yf({layer:t,spatialReference:e,outFields:n,returnGeometry:r,lrucache:i,interceptor:u}){if(t===null)return null;const a=dr();return a?a.constructFeatureSet(t,e,n,r!=null?r:!0,i,u):null}function Kf(t){if((t==null?void 0:t.map)===null)return null;const e=dr();return e?e.createFeatureSetCollectionFromMap(t.map,t.spatialReference,t.lrucache,t.interceptor):null}function Qf(t){return O.convertJsonToArcade(t)}function Xf(t,e,n=[]){return Gu(t,e,n)}function ed(){return Ii()}function td(){return Ti()}function nd(t){return t.type==="simple"||t.type==="class-breaks"||t.type==="unique-value"||t.type==="dot-density"||t.type==="dictionary"||t.type==="pie-chart"}function rd(t){return t.declaredClass==="esri.layers.support.LabelClass"}function id(t){return t.declaredClass==="esri.PopupTemplate"}function Hu(t,e){var r;if(!t)return!1;if(typeof t=="string")return e(t);const n=t;if(nd(n)){if(n.type==="dot-density"){const a=(r=n.attributes)==null?void 0:r.some(s=>e(s.valueExpression));if(a)return a}const i=n.visualVariables,u=!!i&&i.some(a=>{let s=e(a.valueExpression);return a.type==="size"&&(_i(a.minSize)&&(s=s||e(a.minSize.valueExpression)),_i(a.maxSize)&&(s=s||e(a.maxSize.valueExpression))),s});return!(!("valueExpression"in n)||!e(n.valueExpression))||u}if(rd(n)){const i=n.labelExpressionInfo&&n.labelExpressionInfo.expression;return!(!i||!e(i))||!1}return!!id(n)&&(!!n.expressionInfos&&n.expressionInfos.some(i=>e(i.expression))||Array.isArray(n.content)&&n.content.some(i=>{var u;return i.type==="expression"&&e((u=i.expressionInfo)==null?void 0:u.expression)}))}function sd(t){const e=vn(t);return!!e&&qu(e)}function ad(t){return Hu(t,sd)}function ud(t){const e=vn(t);return!!e&&fr(e)}function od(t){return Hu(t,ud)}var Ed=Object.freeze(Object.defineProperty({__proto__:null,convertFeatureLayerToFeatureSet:Yf,convertJsonToArcade:Qf,convertMapToFeatureSetCollection:Kf,convertServiceUrlToWorkspace:Jf,createExecContext:Pf,createFeature:Uf,createFunction:Rf,createSyntaxTree:vn,dependsOnView:Hf,enableFeatureSetOperations:td,enableGeometryOperations:ed,evalSyntaxTree:Gf,executeAsyncFunction:qf,executeFunction:Vf,extractFieldNames:Zf,getArcadeType:$f,getViewInfo:Wf,hasGeometryFunctions:ad,hasGeometryOperations:od,hasVariable:jf,loadScriptDependencies:Xf,updateExecContext:zf,arcade:Bf,Dictionary:O,arcadeFeature:q},Symbol.toStringTag,{value:"Module"}));export{wd as $,jt as A,gu as B,cu as C,Ee as D,L as E,X as F,jr as G,le as H,Rn as I,O as J,b as K,Pt as L,au as M,hu as N,vc as O,rr as P,Di as Q,bc as R,fn as S,Cc as T,Xt as U,y as V,Dn as W,Be as X,M as Y,G as Z,z as _,Ct as a,us as a0,hd as a1,as as a2,lc as a3,Dd as a4,Fd as a5,xd as a6,Rc as a7,ai as a8,B as a9,dd as aa,fd as ab,md as ac,pd as ad,yd as ae,uc as af,ls as ag,gd as ah,mu as ai,me as aj,oc as ak,lt as al,Sr as am,Cd as an,Qa as ao,ar as ap,Pn as aq,Xa as ar,Ya as as,eu as at,Ka as au,Ae as av,tu as aw,cs as ax,Ed as ay,Rt as b,ne as c,wi as d,c as e,du as f,re as g,q as h,Ft as i,Ue as j,A as k,et as l,Yr as m,Lt as n,Wr as o,nr as p,P as q,p as r,cr as s,h as t,ao as u,$e as v,v as w,On as x,_ as y,Q as z}; diff --git a/assets/arcgisLayers.c7a7062a.js b/assets/arcgisLayers.296603be.js similarity index 90% rename from assets/arcgisLayers.c7a7062a.js rename to assets/arcgisLayers.296603be.js index 261a594..4f5cedb 100644 --- a/assets/arcgisLayers.c7a7062a.js +++ b/assets/arcgisLayers.296603be.js @@ -1 +1 @@ -import{at as L,cy as O,j as h,n as P,cz as T,c as m,cA as g,bX as C}from"./index.d94abe07.js";import{a as i,r as F}from"./fetchService.36bd4782.js";import{a as N}from"./lazyLayerLoader.f961f278.js";async function k(e){var s;const l=(s=e.properties)==null?void 0:s.customParameters,r=await J(e.url,l),a={...e.properties,url:e.url};if(!r.sublayerIds)return r.layerOrTableId!=null&&(a.layerId=r.layerOrTableId,a.sourceJSON=r.sourceJSON),new r.Constructor(a);const n=new(await L(()=>import("./GroupLayer.04359856.js"),["assets/GroupLayer.04359856.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/lazyLayerLoader.f961f278.js"])).default({title:r.parsedUrl.title});return U(n,r,a),n}function v(e,l){return e?e.find(r=>r.id===l):null}function U(e,l,r){function a(n,s){const o={...r,layerId:n,sublayerTitleMode:"service-name"};return m(s)&&(o.sourceJSON=s),new l.Constructor(o)}l.sublayerIds.forEach(n=>{const s=a(n,v(l.sublayerInfos,n));e.add(s)}),l.tableIds.forEach(n=>{const s=a(n,v(l.tableInfos,n));e.tables.add(s)})}async function J(e,l){var I,p;let r=O(e);if(h(r)&&(r=await V(e,l)),h(r))throw new P("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:e});const{serverType:a,sublayer:n}=r;let s;const o={FeatureServer:"FeatureLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer"};switch(a){case"MapServer":s=n!=null?"FeatureLayer":E(e,l).then(t=>t?"TileLayer":"MapImageLayer");break;case"ImageServer":s=i(e,{customParameters:l}).then(t=>{const y=t.tileInfo&&t.tileInfo.format;return t.tileInfo?(y==null?void 0:y.toUpperCase())!=="LERC"||t.cacheType&&t.cacheType.toLowerCase()!=="elevation"?"ImageryTileLayer":"ElevationLayer":"ImageryLayer"});break;case"SceneServer":s=i(r.url.path,{customParameters:l}).then(t=>{var y;if(t){if((t==null?void 0:t.layerType)==="Voxel")return"VoxelLayer";if((t==null?void 0:t.layers)&&Array.isArray(t.layers)&&t.layers.length>0){const b={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"},S=(y=t.layers[0])==null?void 0:y.layerType;if(b[S]!=null)return b[S]}}return"SceneLayer"});break;default:s=o[a]}const u={FeatureLayer:!0,SceneLayer:!0},d=a==="FeatureServer",c={parsedUrl:r,Constructor:null,layerOrTableId:d?n:null,sublayerIds:null,tableIds:null},f=await s;if(u[f]&&n==null){const t=await _(e,a,l);d&&(c.sublayerInfos=t.layerInfos,c.tableInfos=t.tableInfos),t.layerIds.length+t.tableIds.length!==1?(c.sublayerIds=t.layerIds,c.tableIds=t.tableIds):d&&(c.layerOrTableId=(I=t.layerIds[0])!=null?I:t.tableIds[0],c.sourceJSON=(p=t.layerInfos[0])!=null?p:t.tableInfos[0])}return c.Constructor=await x(f),c}async function V(e,l){var u;const r=await i(e,{customParameters:l});let a=null,n=null;const s=r.type;if(s==="Feature Layer"||s==="Table"?(a="FeatureServer",n=r.id):s==="indexedVector"?a="VectorTileServer":r.hasOwnProperty("mapName")?a="MapServer":r.hasOwnProperty("bandCount")&&r.hasOwnProperty("pixelSizeX")?a="ImageServer":r.hasOwnProperty("maxRecordCount")&&r.hasOwnProperty("allowGeometryUpdates")?a="FeatureServer":r.hasOwnProperty("streamUrls")?a="StreamServer":w(r)?(a="SceneServer",n=r.id):r.hasOwnProperty("layers")&&w((u=r.layers)==null?void 0:u[0])&&(a="SceneServer"),!a)return null;const o=n!=null?T(e):null;return{title:m(o)&&r.name||g(e),serverType:a,sublayer:n,url:{path:m(o)?o.serviceUrl:C(e).path}}}function w(e){return(e==null?void 0:e.hasOwnProperty("store"))&&e.hasOwnProperty("id")&&typeof e.id=="number"}async function _(e,l,r){let a,n=!1;if(l==="FeatureServer"){const u=await F(e,{customParameters:r});n=!!u.layersJSON,a=u.layersJSON||u.serviceJSON}else a=await i(e,{customParameters:r});const s=a==null?void 0:a.layers,o=a==null?void 0:a.tables;return{layerIds:(s==null?void 0:s.map(u=>u.id).reverse())||[],tableIds:(o==null?void 0:o.map(u=>u.id).reverse())||[],layerInfos:n?s:[],tableInfos:n?o:[]}}async function x(e){return(0,N[e])()}async function E(e,l){return(await i(e,{customParameters:l})).tileInfo}export{k as fromUrl}; +import{at as L,cy as O,j as h,n as P,cz as T,c as m,cA as g,bX as C}from"./index.221827cd.js";import{a as i,r as F}from"./fetchService.88193309.js";import{a as N}from"./lazyLayerLoader.4d2df2af.js";async function k(e){var s;const l=(s=e.properties)==null?void 0:s.customParameters,r=await J(e.url,l),a={...e.properties,url:e.url};if(!r.sublayerIds)return r.layerOrTableId!=null&&(a.layerId=r.layerOrTableId,a.sourceJSON=r.sourceJSON),new r.Constructor(a);const n=new(await L(()=>import("./GroupLayer.d2d54b11.js"),["assets/GroupLayer.d2d54b11.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/lazyLayerLoader.4d2df2af.js"])).default({title:r.parsedUrl.title});return U(n,r,a),n}function v(e,l){return e?e.find(r=>r.id===l):null}function U(e,l,r){function a(n,s){const o={...r,layerId:n,sublayerTitleMode:"service-name"};return m(s)&&(o.sourceJSON=s),new l.Constructor(o)}l.sublayerIds.forEach(n=>{const s=a(n,v(l.sublayerInfos,n));e.add(s)}),l.tableIds.forEach(n=>{const s=a(n,v(l.tableInfos,n));e.tables.add(s)})}async function J(e,l){var I,p;let r=O(e);if(h(r)&&(r=await V(e,l)),h(r))throw new P("arcgis-layers:url-mismatch","The url '${url}' is not a valid arcgis resource",{url:e});const{serverType:a,sublayer:n}=r;let s;const o={FeatureServer:"FeatureLayer",StreamServer:"StreamLayer",VectorTileServer:"VectorTileLayer"};switch(a){case"MapServer":s=n!=null?"FeatureLayer":E(e,l).then(t=>t?"TileLayer":"MapImageLayer");break;case"ImageServer":s=i(e,{customParameters:l}).then(t=>{const y=t.tileInfo&&t.tileInfo.format;return t.tileInfo?(y==null?void 0:y.toUpperCase())!=="LERC"||t.cacheType&&t.cacheType.toLowerCase()!=="elevation"?"ImageryTileLayer":"ElevationLayer":"ImageryLayer"});break;case"SceneServer":s=i(r.url.path,{customParameters:l}).then(t=>{var y;if(t){if((t==null?void 0:t.layerType)==="Voxel")return"VoxelLayer";if((t==null?void 0:t.layers)&&Array.isArray(t.layers)&&t.layers.length>0){const b={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"},S=(y=t.layers[0])==null?void 0:y.layerType;if(b[S]!=null)return b[S]}}return"SceneLayer"});break;default:s=o[a]}const u={FeatureLayer:!0,SceneLayer:!0},d=a==="FeatureServer",c={parsedUrl:r,Constructor:null,layerOrTableId:d?n:null,sublayerIds:null,tableIds:null},f=await s;if(u[f]&&n==null){const t=await _(e,a,l);d&&(c.sublayerInfos=t.layerInfos,c.tableInfos=t.tableInfos),t.layerIds.length+t.tableIds.length!==1?(c.sublayerIds=t.layerIds,c.tableIds=t.tableIds):d&&(c.layerOrTableId=(I=t.layerIds[0])!=null?I:t.tableIds[0],c.sourceJSON=(p=t.layerInfos[0])!=null?p:t.tableInfos[0])}return c.Constructor=await x(f),c}async function V(e,l){var u;const r=await i(e,{customParameters:l});let a=null,n=null;const s=r.type;if(s==="Feature Layer"||s==="Table"?(a="FeatureServer",n=r.id):s==="indexedVector"?a="VectorTileServer":r.hasOwnProperty("mapName")?a="MapServer":r.hasOwnProperty("bandCount")&&r.hasOwnProperty("pixelSizeX")?a="ImageServer":r.hasOwnProperty("maxRecordCount")&&r.hasOwnProperty("allowGeometryUpdates")?a="FeatureServer":r.hasOwnProperty("streamUrls")?a="StreamServer":w(r)?(a="SceneServer",n=r.id):r.hasOwnProperty("layers")&&w((u=r.layers)==null?void 0:u[0])&&(a="SceneServer"),!a)return null;const o=n!=null?T(e):null;return{title:m(o)&&r.name||g(e),serverType:a,sublayer:n,url:{path:m(o)?o.serviceUrl:C(e).path}}}function w(e){return(e==null?void 0:e.hasOwnProperty("store"))&&e.hasOwnProperty("id")&&typeof e.id=="number"}async function _(e,l,r){let a,n=!1;if(l==="FeatureServer"){const u=await F(e,{customParameters:r});n=!!u.layersJSON,a=u.layersJSON||u.serviceJSON}else a=await i(e,{customParameters:r});const s=a==null?void 0:a.layers,o=a==null?void 0:a.tables;return{layerIds:(s==null?void 0:s.map(u=>u.id).reverse())||[],tableIds:(o==null?void 0:o.map(u=>u.id).reverse())||[],layerInfos:n?s:[],tableInfos:n?o:[]}}async function x(e){return(0,N[e])()}async function E(e,l){return(await i(e,{customParameters:l})).tileInfo}export{k as fromUrl}; diff --git a/assets/calcite-action.6526d132.js b/assets/calcite-action.101f7577.js similarity index 60% rename from assets/calcite-action.6526d132.js rename to assets/calcite-action.101f7577.js index 5b82240..b0ccf46 100644 --- a/assets/calcite-action.6526d132.js +++ b/assets/calcite-action.101f7577.js @@ -1,4 +1,4 @@ -import{A as t,d as o}from"./action.a0f1f825.js";import"./index.d94abe07.js";import"./observers.11f150c2.js";import"./interactive.d71a7a54.js";import"./icon.8e346cc3.js";import"./loader.3df23557.js";import"./guid.ae96513b.js";/*! +import{A as t,d as o}from"./action.033e9799.js";import"./index.221827cd.js";import"./observers.440ad120.js";import"./interactive.d71a7a54.js";import"./icon.781cca93.js";import"./loader.d1e283c7.js";import"./guid.ae96513b.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.0-beta.97 diff --git a/assets/calcite-flow-item.4a278560.js b/assets/calcite-flow-item.62da4be8.js similarity index 99% rename from assets/calcite-flow-item.4a278560.js rename to assets/calcite-flow-item.62da4be8.js index c9c9787..7bf9bef 100644 --- a/assets/calcite-flow-item.4a278560.js +++ b/assets/calcite-flow-item.62da4be8.js @@ -1,4 +1,4 @@ -import{h as n,p as k,H as w,hn as d,t as E,ho as ee,hp as te,a as $,hq as A,hr as ie,hs as U,g as K}from"./index.d94abe07.js";import{g as X}from"./guid.ae96513b.js";import{d as x}from"./action.a0f1f825.js";import{d as C}from"./icon.8e346cc3.js";import{d as y}from"./loader.3df23557.js";import{d as ne,f as ae,c as oe,u as se,a as le,r as ce,F,b as re}from"./tooltip.e0637362.js";import{u as V}from"./interactive.d71a7a54.js";import{c as de}from"./observers.11f150c2.js";import{d as q}from"./scrim.5d8801d4.js";/*! +import{h as n,p as k,H as w,hn as d,t as E,ho as ee,hp as te,a as $,hq as A,hr as ie,hs as U,g as K}from"./index.221827cd.js";import{g as X}from"./guid.ae96513b.js";import{d as x}from"./action.033e9799.js";import{d as C}from"./icon.781cca93.js";import{d as y}from"./loader.d1e283c7.js";import{d as ne,f as ae,c as oe,u as se,a as le,r as ce,F,b as re}from"./tooltip.1fb2f0ea.js";import{u as V}from"./interactive.d71a7a54.js";import{c as de}from"./observers.440ad120.js";import{d as q}from"./scrim.51d512d2.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.0-beta.97 diff --git a/assets/calcite-flow.ddd9f745.js b/assets/calcite-flow.45a3e267.js similarity index 97% rename from assets/calcite-flow.ddd9f745.js rename to assets/calcite-flow.45a3e267.js index 92b8052..71a69e5 100644 --- a/assets/calcite-flow.ddd9f745.js +++ b/assets/calcite-flow.45a3e267.js @@ -1,4 +1,4 @@ -import{p as d,H as u,h as s}from"./index.d94abe07.js";import{c as h}from"./observers.11f150c2.js";/*! +import{p as d,H as u,h as s}from"./index.221827cd.js";import{c as h}from"./observers.440ad120.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.0-beta.97 diff --git a/assets/calcite-icon.8f7a3cfc.js b/assets/calcite-icon.8b0ddff6.js similarity index 69% rename from assets/calcite-icon.8f7a3cfc.js rename to assets/calcite-icon.8b0ddff6.js index 79e5a77..e7597a4 100644 --- a/assets/calcite-icon.8f7a3cfc.js +++ b/assets/calcite-icon.8b0ddff6.js @@ -1,4 +1,4 @@ -import{I as o,d as t}from"./icon.8e346cc3.js";import"./index.d94abe07.js";import"./observers.11f150c2.js";/*! +import{I as o,d as t}from"./icon.781cca93.js";import"./index.221827cd.js";import"./observers.440ad120.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.0-beta.97 diff --git a/assets/calcite-list-item.bd111fd1.js b/assets/calcite-list-item.c5e3f8cb.js similarity index 96% rename from assets/calcite-list-item.bd111fd1.js rename to assets/calcite-list-item.c5e3f8cb.js index 36873bd..f2f444e 100644 --- a/assets/calcite-list-item.bd111fd1.js +++ b/assets/calcite-list-item.c5e3f8cb.js @@ -1,4 +1,4 @@ -import{p as f,H as p,hA as a,h as n,a as h}from"./index.d94abe07.js";import{c as b,d as v}from"./conditionalSlot.39f4bfa2.js";import{u as y}from"./interactive.d71a7a54.js";import"./observers.11f150c2.js";/*! +import{p as f,H as p,hA as a,h as n,a as h}from"./index.221827cd.js";import{c as b,d as v}from"./conditionalSlot.32d69949.js";import{u as y}from"./interactive.d71a7a54.js";import"./observers.440ad120.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.0-beta.97 diff --git a/assets/calcite-list.8f1cbf55.js b/assets/calcite-list.73c0b6c3.js similarity index 98% rename from assets/calcite-list.8f1cbf55.js rename to assets/calcite-list.73c0b6c3.js index 8bb3995..4a7b60d 100644 --- a/assets/calcite-list.8f1cbf55.js +++ b/assets/calcite-list.73c0b6c3.js @@ -1,4 +1,4 @@ -import{p as o,H as c,h as i,a as s}from"./index.d94abe07.js";import{u as r}from"./interactive.d71a7a54.js";/*! +import{p as o,H as c,h as i,a as s}from"./index.221827cd.js";import{u as r}from"./interactive.d71a7a54.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.0-beta.97 diff --git a/assets/calcite-notice.49afa2e1.js b/assets/calcite-notice.41dd0b76.js similarity index 98% rename from assets/calcite-notice.49afa2e1.js rename to assets/calcite-notice.41dd0b76.js index 4875330..e38461b 100644 --- a/assets/calcite-notice.49afa2e1.js +++ b/assets/calcite-notice.41dd0b76.js @@ -1,4 +1,4 @@ -import{p as h,H as g,hn as c,hz as l,h as t,hA as p}from"./index.d94abe07.js";import{c as u,d as f}from"./conditionalSlot.39f4bfa2.js";import{d as b}from"./icon.8e346cc3.js";import"./observers.11f150c2.js";/*! +import{p as h,H as g,hn as c,hz as l,h as t,hA as p}from"./index.221827cd.js";import{c as u,d as f}from"./conditionalSlot.32d69949.js";import{d as b}from"./icon.781cca93.js";import"./observers.440ad120.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.0-beta.97 diff --git a/assets/calcite-scrim.7f1cb3c0.js b/assets/calcite-scrim.b8319447.js similarity index 67% rename from assets/calcite-scrim.7f1cb3c0.js rename to assets/calcite-scrim.b8319447.js index 20f0b3d..8333931 100644 --- a/assets/calcite-scrim.7f1cb3c0.js +++ b/assets/calcite-scrim.b8319447.js @@ -1,4 +1,4 @@ -import{S as t,d as m}from"./scrim.5d8801d4.js";import"./index.d94abe07.js";import"./loader.3df23557.js";import"./guid.ae96513b.js";/*! +import{S as t,d as m}from"./scrim.51d512d2.js";import"./index.221827cd.js";import"./loader.d1e283c7.js";import"./guid.ae96513b.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.0-beta.97 diff --git a/assets/calcite-tooltip.583e6f48.js b/assets/calcite-tooltip.8ddd4c89.js similarity index 70% rename from assets/calcite-tooltip.583e6f48.js rename to assets/calcite-tooltip.8ddd4c89.js index caacbb1..a9d20f8 100644 --- a/assets/calcite-tooltip.583e6f48.js +++ b/assets/calcite-tooltip.8ddd4c89.js @@ -1,4 +1,4 @@ -import{T as o,b as t}from"./tooltip.e0637362.js";import"./index.d94abe07.js";import"./guid.ae96513b.js";/*! +import{T as o,b as t}from"./tooltip.1fb2f0ea.js";import"./index.221827cd.js";import"./guid.ae96513b.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.0-beta.97 diff --git a/assets/centroid.cc817cc5.js b/assets/centroid.06db4b74.js similarity index 97% rename from assets/centroid.cc817cc5.js rename to assets/centroid.06db4b74.js index fa8ab99..c806f3f 100644 --- a/assets/centroid.cc817cc5.js +++ b/assets/centroid.06db4b74.js @@ -1 +1 @@ -import{j as G}from"./index.d94abe07.js";function P(n,r){return n?r?4:3:r?3:2}function x(n,r,o,l,s){if(G(r)||!r.lengths.length)return null;const u=(s==null?void 0:s.originPosition)==="upperLeft"?-1:1;n.lengths.length&&(n.lengths.length=0),n.coords.length&&(n.coords.length=0);const t=n.coords,N=[],e=o?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:i,coords:E}=r,F=P(o,l);let b=0;for(const I of i){const c=O(e,E,b,I,o,l,u);c&&N.push(c),b+=I*F}if(N.sort((I,c)=>{let T=u*I[2]-u*c[2];return T===0&&o&&(T=I[4]-c[4]),T}),N.length){let I=6*N[0][2];t[0]=N[0][0]/I,t[1]=N[0][1]/I,o&&(I=6*N[0][4],t[2]=I!==0?N[0][3]/I:0),(t[0]e[1]||t[1]e[3]||o&&(t[2]e[5]))&&(t.length=0)}if(!t.length){const I=r.lengths[0]?S(E,0,i[0],o,l):null;if(!I)return null;t[0]=I[0],t[1]=I[1],o&&I.length>2&&(t[2]=I[2])}return n}function O(n,r,o,l,s,u,t=1){const N=P(s,u);let e=o,i=o+N,E=0,F=0,b=0,I=0,c=0;for(let _=0,V=l-1;_n[1]&&(n[1]=h),mn[3]&&(n[3]=m),s&&(fn[5]&&(n[5]=f))}if(I*t>0&&(I*=-1),c*t>0&&(c*=-1),!I)return null;const T=[E,F,.5*I];return s&&(T[3]=b,T[4]=.5*c),T}function S(n,r,o,l,s){const u=P(l,s);let t=r,N=r+u,e=0,i=0,E=0,F=0;for(let b=0,I=o-1;b0?l?[i/e,E/e,F/e]:[i/e,E/e]:o>0?l?[n[r],n[r+1],n[r+2]]:[n[r],n[r+1]]:null}function d(n,r,o,l){const s=o-n,u=l-r;return Math.sqrt(s*s+u*u)}function a(n,r,o,l,s,u){const t=l-n,N=s-r,e=u-o;return Math.sqrt(t*t+N*N+e*e)}function q(n,r,o,l){return[n+.5*(o-n),r+.5*(l-r)]}function M(n,r,o,l,s,u){return[n+.5*(l-n),r+.5*(s-r),o+.5*(u-o)]}export{x as e}; +import{j as G}from"./index.221827cd.js";function P(n,r){return n?r?4:3:r?3:2}function x(n,r,o,l,s){if(G(r)||!r.lengths.length)return null;const u=(s==null?void 0:s.originPosition)==="upperLeft"?-1:1;n.lengths.length&&(n.lengths.length=0),n.coords.length&&(n.coords.length=0);const t=n.coords,N=[],e=o?[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY]:[Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.NEGATIVE_INFINITY],{lengths:i,coords:E}=r,F=P(o,l);let b=0;for(const I of i){const c=O(e,E,b,I,o,l,u);c&&N.push(c),b+=I*F}if(N.sort((I,c)=>{let T=u*I[2]-u*c[2];return T===0&&o&&(T=I[4]-c[4]),T}),N.length){let I=6*N[0][2];t[0]=N[0][0]/I,t[1]=N[0][1]/I,o&&(I=6*N[0][4],t[2]=I!==0?N[0][3]/I:0),(t[0]e[1]||t[1]e[3]||o&&(t[2]e[5]))&&(t.length=0)}if(!t.length){const I=r.lengths[0]?S(E,0,i[0],o,l):null;if(!I)return null;t[0]=I[0],t[1]=I[1],o&&I.length>2&&(t[2]=I[2])}return n}function O(n,r,o,l,s,u,t=1){const N=P(s,u);let e=o,i=o+N,E=0,F=0,b=0,I=0,c=0;for(let _=0,V=l-1;_n[1]&&(n[1]=h),mn[3]&&(n[3]=m),s&&(fn[5]&&(n[5]=f))}if(I*t>0&&(I*=-1),c*t>0&&(c*=-1),!I)return null;const T=[E,F,.5*I];return s&&(T[3]=b,T[4]=.5*c),T}function S(n,r,o,l,s){const u=P(l,s);let t=r,N=r+u,e=0,i=0,E=0,F=0;for(let b=0,I=o-1;b0?l?[i/e,E/e,F/e]:[i/e,E/e]:o>0?l?[n[r],n[r+1],n[r+2]]:[n[r],n[r+1]]:null}function d(n,r,o,l){const s=o-n,u=l-r;return Math.sqrt(s*s+u*u)}function a(n,r,o,l,s,u){const t=l-n,N=s-r,e=u-o;return Math.sqrt(t*t+N*N+e*e)}function q(n,r,o,l){return[n+.5*(o-n),r+.5*(l-r)]}function M(n,r,o,l,s,u){return[n+.5*(l-n),r+.5*(s-r),o+.5*(u-o)]}export{x as e}; diff --git a/assets/clientSideDefaults.f5f7bfa0.js b/assets/clientSideDefaults.d40b9315.js similarity index 92% rename from assets/clientSideDefaults.f5f7bfa0.js rename to assets/clientSideDefaults.d40b9315.js index 6870f91..cb340c6 100644 --- a/assets/clientSideDefaults.f5f7bfa0.js +++ b/assets/clientSideDefaults.d40b9315.js @@ -1,4 +1,4 @@ -import{fa as o,fb as u,fc as n,m as a,b4 as i}from"./index.d94abe07.js";import{t as c}from"./QueryEngineCapabilities.78217f95.js";function h(t){return{renderer:{type:"simple",symbol:t==="esriGeometryPoint"||t==="esriGeometryMultipoint"?o:t==="esriGeometryPolyline"?u:n}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let y=1;function f(t,s){if(a("esri-csp-restrictions"))return()=>({[s]:null,...t});try{let r=`this.${s} = null;`;for(const e in t)r+=`this${l.test(e)?`.${e}`:`["${e}"]`} = ${JSON.stringify(t[e])};`;const p=new Function(` +import{fa as o,fb as u,fc as n,m as a,b4 as i}from"./index.221827cd.js";import{t as c}from"./QueryEngineCapabilities.78217f95.js";function h(t){return{renderer:{type:"simple",symbol:t==="esriGeometryPoint"||t==="esriGeometryMultipoint"?o:t==="esriGeometryPolyline"?u:n}}}const l=/^[_$a-zA-Z][_$a-zA-Z0-9]*$/;let y=1;function f(t,s){if(a("esri-csp-restrictions"))return()=>({[s]:null,...t});try{let r=`this.${s} = null;`;for(const e in t)r+=`this${l.test(e)?`.${e}`:`["${e}"]`} = ${JSON.stringify(t[e])};`;const p=new Function(` return class AttributesClass$${y++} { constructor() { ${r}; diff --git a/assets/conditionalSlot.39f4bfa2.js b/assets/conditionalSlot.32d69949.js similarity index 83% rename from assets/conditionalSlot.39f4bfa2.js rename to assets/conditionalSlot.32d69949.js index 7d529e7..4fe97e3 100644 --- a/assets/conditionalSlot.39f4bfa2.js +++ b/assets/conditionalSlot.32d69949.js @@ -1,4 +1,4 @@ -import{ho as c}from"./index.d94abe07.js";import{c as i}from"./observers.11f150c2.js";/*! +import{ho as c}from"./index.221827cd.js";import{c as i}from"./observers.440ad120.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.0-beta.97 diff --git a/assets/createConnection.60903ce1.js b/assets/createConnection.0e3796d4.js similarity index 98% rename from assets/createConnection.60903ce1.js rename to assets/createConnection.0e3796d4.js index fddfbfa..cd1404f 100644 --- a/assets/createConnection.60903ce1.js +++ b/assets/createConnection.0e3796d4.js @@ -1 +1 @@ -import{W as x,n as c,a6 as _,a7 as p,a8 as b,gF as L,c as h,j as g,dT as C,s as a,be as E,K as F,U as O,c9 as N,at as q,dd as P,bd as k,eQ as j,aT as T,go as v}from"./index.d94abe07.js";let w=class extends x.EventedAccessor{get connectionError(){return this.errorString?new c("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}};_([p({readOnly:!0})],w.prototype,"connectionError",null),w=_([b("esri.layers.support.StreamConnection")],w);const W=w;var f;(function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"})(f||(f={}));let y=class extends W{constructor(e){super(),this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:o}=e;this._config=e,this._featureZScaler=L(t,o,r),this._open()}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){h(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(g(this._websocket))return"disconnected";switch(this._websocket.readyState){case f.CONNECTING:case f.OPEN:return"connected";case f.CLOSING:case f.CLOSED:return"disconnected"}}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,r=0){try{if(this.destroyed)return;const o=C(e,this._config.customParameters);this._websocket=await this._createWebSocket(o),this.notifyChange("connectionStatus")}catch(o){const s=t/1e3;return this._config.maxReconnectionAttempts&&r>=this._config.maxReconnectionAttempts?(a.getLogger(this.declaredClass).error(new c("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(a.getLogger(this.declaredClass).error(new c("websocket-connection",`Failed to connect. Attempting to reconnect in ${s}s`,o)),await E(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),r+1))}}_createWebSocket(e){return new Promise((t,r)=>{const o=new WebSocket(e);o.onopen=()=>{if(o.onopen=null,this.destroyed)return o.onclose=null,void o.close();o.onclose=s=>this._onClose(s),o.onerror=s=>this._onError(s),o.onmessage=s=>this._onMessage(s),t(o)},o.onclose=s=>{o.onopen=o.onclose=null,r(s)}})}async _handshake(e=1e4){const t=this._websocket;if(g(t))return;const r=F(),o=t.onmessage,{filter:s,outFields:n,spatialReference:l}=this._config;return r.timeout(e),t.onmessage=u=>{var i;let d=null;try{d=JSON.parse(u.data)}catch{}d&&typeof d=="object"||(a.getLogger(this.declaredClass).error(new c("websocket-connection","Protocol violation. Handshake failed - malformed message",u.data)),r.reject(),this.destroy()),((i=d.spatialReference)==null?void 0:i.wkid)!==(l==null?void 0:l.wkid)&&(a.getLogger(this.declaredClass).error(new c("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${l.wkid}`,u.data)),r.reject(),this.destroy()),d.format!=="json"&&(a.getLogger(this.declaredClass).error(new c("websocket-connection","Protocol violation. Handshake failed - format is not set",u.data)),r.reject(),this.destroy()),s&&d.filter!==s&&a.getLogger(this.declaredClass).error(new c("websocket-connection","Tried to set filter, but server doesn't support it")),n&&d.outFields!==n&&a.getLogger(this.declaredClass).error(new c("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=o,r.resolve()},t.send(JSON.stringify({filter:s,outFields:n,format:"json",spatialReference:{wkid:l.wkid}})),r.promise}_onMessage(e){try{const t=JSON.parse(e.data);if(t.type!=="featureResult")throw new c("websocket-connection","Protocol violation - Expected to find message of type 'featureResult'",t);for(const r of t.features)h(this._featureZScaler)&&this._featureZScaler(r.geometry),this.onFeature(r)}catch(t){return a.getLogger(this.declaredClass).error(new c("websocket-connection","Failed to parse message",t)),void this.destroy()}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),a.getLogger(this.declaredClass).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),e.code!==1e3&&a.getLogger(this.declaredClass).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};_([p()],y.prototype,"connectionStatus",null),_([p()],y.prototype,"errorString",void 0),y=_([b("esri.layers.graphics.sources.connections.WebSocketConnection")],y);const D=1e4,I={maxQueryDepth:5,maxRecordCountFactor:3};let m=class extends y{constructor(e){super({...I,...e})}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||a.getLogger(this.declaredClass).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:r,outFields:o}=this._config;this.destroyed||this._setFilter(r,o)}_onMessage(e){let t;try{t=this._enrich(JSON.parse(e.data)),h(this._featureZScaler)&&this._featureZScaler(t.geometry)}catch(r){return void a.getLogger(this.declaredClass).error(new c("geoevent-connection","Failed to parse message",r))}this.onFeature(t)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},r=O(e.path,{query:t,responseType:"json"}),o=(await r).data;return this._serviceDefinition=o,o}_fetchWebSocketUrl(e,t){const r=e[0],{urls:o,token:s}=r,n=this._inferWebSocketBaseUrl(o);return C(`${n}/subscribe`,{outSR:""+t.wkid,token:s})}_inferWebSocketBaseUrl(e){if(e.length===1)return e[0];for(const t of e)if(t.includes("wss"))return t;return a.getLogger(this.declaredClass).error(new c("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const r=this._websocket;if(g(r)||g(e)&&g(t))return;const o=JSON.stringify({filter:this._serializeFilter(e,t)});let s=!1;const n=F(),l=()=>{s||(this.destroyed||this._websocket!==r||a.getLogger(this.declaredClass).error(new c("geoevent-connection","Server timed out when setting filter")),n.reject())},u=d=>{const i=JSON.parse(d.data);i.filter&&(i.error&&(a.getLogger(this.declaredClass).error(new c("geoevent-connection","Failed to set service filter",i.error)),this._set("errorString",`Could not set service filter - ${i.error}`),n.reject(i.error)),r.onmessage=this._onMessage.bind(this),s=!0,n.resolve())};return r.onmessage=u,r.send(o),setTimeout(l,D),n.promise}_serializeFilter(e,t){const r={};if(g(e)&&g(t))return r;if(h(e)&&e.geometry)try{const o=N(e.geometry);if(o.type!=="extent")throw new c(`Expected extent but found type ${o.type}`);r.geometry=JSON.stringify(o.shiftCentralMeridian())}catch(o){a.getLogger(this.declaredClass).error(new c("geoevent-connection","Encountered an error when setting connection geometryDefinition",o))}return h(e)&&e.where&&e.where!=="1 = 1"&&(r.where=e.where),h(t)&&(r.outFields=t.join(",")),r}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,r=e.attributes[t];if(!this._relatedFeatures.has(r))return a.getLogger(this.declaredClass).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:o,geometry:s}=this._relatedFeatures.get(r);for(const n in o)e.attributes[n]=o[n];return s&&(e.geometry=s),e.geometry||e.centroid||a.getLogger(this.declaredClass).error(new c("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,r=this._queryRelatedFeatures(e),o=this._queryArchive(t);await r;const s=await o;if(!s)return;for(const n of s.features)this.onFeature(this._enrich(n))}catch(e){a.getLogger(this.declaredClass).error(new c("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 q(()=>import("./index.d94abe07.js").then(function(R){return R.l0}),["assets/index.d94abe07.js","assets/index.f5419ca5.css"])).default({url:e}),{capabilities:r}=await t.load(),o=r.query.supportsMaxRecordCountFactor,s=r.query.supportsPagination,n=r.query.supportsCentroid,l=this._config.maxRecordCountFactor,u=t.capabilities.query.maxRecordCount,d=o?u*l:u,i=new P;if(i.outFields=k(this._config.outFields,["*"]),i.where=k(j(this._config.filter,"where"),"1=1"),i.returnGeometry=!0,i.returnExceededLimitFeatures=!0,i.outSpatialReference=T.fromJSON(this._config.spatialReference),n&&(i.returnCentroid=!0),o&&(i.maxRecordCountFactor=l),s)return i.num=d,t.destroy(),this._queryPages(e,i);const S=await v(e,i,this._config.sourceSpatialReference);return t.destroy(),S.data}async _queryPages(e,t,r=[],o=0){t.start=h(t.num)?o*t.num:null;const{data:s}=await v(e,t,this._config.sourceSpatialReference);return s.exceededTransferLimit&&or.push(n)),this._queryPages(e,t,r,o+1)):(r.forEach(n=>s.features.push(n)),s)}_addRelatedFeatures(e){const t=new Map,r=e.features,o=this._serviceDefinition.relatedFeatures.joinField;for(const s of r){const n=s.attributes[o];t.set(n,s)}this._relatedFeatures=t}};m=_([b("esri.layers.graphics.sources.connections.GeoEventConnection")],m);const $=m;function A(e,t,r,o,s,n,l,u){const d=e.path.indexOf("wss://")===0||e.path.indexOf("ws://")===0,i={source:e,sourceSpatialReference:t,spatialReference:r,geometryType:o,filter:s,maxReconnectionAttempts:n,maxReconnectionInterval:l,customParameters:u};return d?new y(i):new $(i)}export{A as createConnection}; +import{W as x,n as c,a6 as _,a7 as p,a8 as b,gF as L,c as h,j as g,dT as C,s as a,be as E,K as F,U as O,c9 as N,at as q,dd as P,bd as k,eQ as j,aT as T,go as v}from"./index.221827cd.js";let w=class extends x.EventedAccessor{get connectionError(){return this.errorString?new c("stream-connection",this.errorString):null}onFeature(e){this.emit("data-received",e)}};_([p({readOnly:!0})],w.prototype,"connectionError",null),w=_([b("esri.layers.support.StreamConnection")],w);const W=w;var f;(function(e){e[e.CONNECTING=0]="CONNECTING",e[e.OPEN=1]="OPEN",e[e.CLOSING=2]="CLOSING",e[e.CLOSED=3]="CLOSED"})(f||(f={}));let y=class extends W{constructor(e){super(),this.errorString=null;const{geometryType:t,spatialReference:r,sourceSpatialReference:o}=e;this._config=e,this._featureZScaler=L(t,o,r),this._open()}async _open(){await this._tryCreateWebSocket(),this.destroyed||await this._handshake()}destroy(){h(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(g(this._websocket))return"disconnected";switch(this._websocket.readyState){case f.CONNECTING:case f.OPEN:return"connected";case f.CLOSING:case f.CLOSED:return"disconnected"}}async _tryCreateWebSocket(e=this._config.source.path,t=1e3,r=0){try{if(this.destroyed)return;const o=C(e,this._config.customParameters);this._websocket=await this._createWebSocket(o),this.notifyChange("connectionStatus")}catch(o){const s=t/1e3;return this._config.maxReconnectionAttempts&&r>=this._config.maxReconnectionAttempts?(a.getLogger(this.declaredClass).error(new c("websocket-connection","Exceeded maxReconnectionAttempts attempts. No further attempts will be made")),void this.destroy()):(a.getLogger(this.declaredClass).error(new c("websocket-connection",`Failed to connect. Attempting to reconnect in ${s}s`,o)),await E(t),this._tryCreateWebSocket(e,Math.min(1.5*t,1e3*this._config.maxReconnectionInterval),r+1))}}_createWebSocket(e){return new Promise((t,r)=>{const o=new WebSocket(e);o.onopen=()=>{if(o.onopen=null,this.destroyed)return o.onclose=null,void o.close();o.onclose=s=>this._onClose(s),o.onerror=s=>this._onError(s),o.onmessage=s=>this._onMessage(s),t(o)},o.onclose=s=>{o.onopen=o.onclose=null,r(s)}})}async _handshake(e=1e4){const t=this._websocket;if(g(t))return;const r=F(),o=t.onmessage,{filter:s,outFields:n,spatialReference:l}=this._config;return r.timeout(e),t.onmessage=u=>{var i;let d=null;try{d=JSON.parse(u.data)}catch{}d&&typeof d=="object"||(a.getLogger(this.declaredClass).error(new c("websocket-connection","Protocol violation. Handshake failed - malformed message",u.data)),r.reject(),this.destroy()),((i=d.spatialReference)==null?void 0:i.wkid)!==(l==null?void 0:l.wkid)&&(a.getLogger(this.declaredClass).error(new c("websocket-connection",`Protocol violation. Handshake failed - expected wkid of ${l.wkid}`,u.data)),r.reject(),this.destroy()),d.format!=="json"&&(a.getLogger(this.declaredClass).error(new c("websocket-connection","Protocol violation. Handshake failed - format is not set",u.data)),r.reject(),this.destroy()),s&&d.filter!==s&&a.getLogger(this.declaredClass).error(new c("websocket-connection","Tried to set filter, but server doesn't support it")),n&&d.outFields!==n&&a.getLogger(this.declaredClass).error(new c("websocket-connection","Tried to set outFields, but server doesn't support it")),t.onmessage=o,r.resolve()},t.send(JSON.stringify({filter:s,outFields:n,format:"json",spatialReference:{wkid:l.wkid}})),r.promise}_onMessage(e){try{const t=JSON.parse(e.data);if(t.type!=="featureResult")throw new c("websocket-connection","Protocol violation - Expected to find message of type 'featureResult'",t);for(const r of t.features)h(this._featureZScaler)&&this._featureZScaler(r.geometry),this.onFeature(r)}catch(t){return a.getLogger(this.declaredClass).error(new c("websocket-connection","Failed to parse message",t)),void this.destroy()}}_onError(e){const t="Encountered an error over WebSocket connection";this._set("errorString",t),a.getLogger(this.declaredClass).error("websocket-connection",t)}_onClose(e){this._websocket=null,this.notifyChange("connectionStatus"),e.code!==1e3&&a.getLogger(this.declaredClass).error("websocket-connection",`WebSocket closed unexpectedly with error code ${e.code}`),this.destroyed||this._open()}};_([p()],y.prototype,"connectionStatus",null),_([p()],y.prototype,"errorString",void 0),y=_([b("esri.layers.graphics.sources.connections.WebSocketConnection")],y);const D=1e4,I={maxQueryDepth:5,maxRecordCountFactor:3};let m=class extends y{constructor(e){super({...I,...e})}async _open(){const e=await this._fetchServiceDefinition(this._config.source);e.timeInfo.trackIdField||a.getLogger(this.declaredClass).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:r,outFields:o}=this._config;this.destroyed||this._setFilter(r,o)}_onMessage(e){let t;try{t=this._enrich(JSON.parse(e.data)),h(this._featureZScaler)&&this._featureZScaler(t.geometry)}catch(r){return void a.getLogger(this.declaredClass).error(new c("geoevent-connection","Failed to parse message",r))}this.onFeature(t)}async _fetchServiceDefinition(e){const t={f:"json",...this._config.customParameters},r=O(e.path,{query:t,responseType:"json"}),o=(await r).data;return this._serviceDefinition=o,o}_fetchWebSocketUrl(e,t){const r=e[0],{urls:o,token:s}=r,n=this._inferWebSocketBaseUrl(o);return C(`${n}/subscribe`,{outSR:""+t.wkid,token:s})}_inferWebSocketBaseUrl(e){if(e.length===1)return e[0];for(const t of e)if(t.includes("wss"))return t;return a.getLogger(this.declaredClass).error(new c("geoevent-connection","Unable to infer WebSocket url",e)),null}async _setFilter(e,t){const r=this._websocket;if(g(r)||g(e)&&g(t))return;const o=JSON.stringify({filter:this._serializeFilter(e,t)});let s=!1;const n=F(),l=()=>{s||(this.destroyed||this._websocket!==r||a.getLogger(this.declaredClass).error(new c("geoevent-connection","Server timed out when setting filter")),n.reject())},u=d=>{const i=JSON.parse(d.data);i.filter&&(i.error&&(a.getLogger(this.declaredClass).error(new c("geoevent-connection","Failed to set service filter",i.error)),this._set("errorString",`Could not set service filter - ${i.error}`),n.reject(i.error)),r.onmessage=this._onMessage.bind(this),s=!0,n.resolve())};return r.onmessage=u,r.send(o),setTimeout(l,D),n.promise}_serializeFilter(e,t){const r={};if(g(e)&&g(t))return r;if(h(e)&&e.geometry)try{const o=N(e.geometry);if(o.type!=="extent")throw new c(`Expected extent but found type ${o.type}`);r.geometry=JSON.stringify(o.shiftCentralMeridian())}catch(o){a.getLogger(this.declaredClass).error(new c("geoevent-connection","Encountered an error when setting connection geometryDefinition",o))}return h(e)&&e.where&&e.where!=="1 = 1"&&(r.where=e.where),h(t)&&(r.outFields=t.join(",")),r}_enrich(e){if(!this._relatedFeatures)return e;const t=this._serviceDefinition.relatedFeatures.joinField,r=e.attributes[t];if(!this._relatedFeatures.has(r))return a.getLogger(this.declaredClass).warn("geoevent-connection","Feature join failed. Is the join field configured correctly?",e),e;const{attributes:o,geometry:s}=this._relatedFeatures.get(r);for(const n in o)e.attributes[n]=o[n];return s&&(e.geometry=s),e.geometry||e.centroid||a.getLogger(this.declaredClass).error(new c("geoevent-connection","Found malformed feature - no geometry found",e)),e}async _queryBuddyServices(){try{const{relatedFeatures:e,keepLatestArchive:t}=this._serviceDefinition,r=this._queryRelatedFeatures(e),o=this._queryArchive(t);await r;const s=await o;if(!s)return;for(const n of s.features)this.onFeature(this._enrich(n))}catch(e){a.getLogger(this.declaredClass).error(new c("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 q(()=>import("./index.221827cd.js").then(function(R){return R.l0}),["assets/index.221827cd.js","assets/index.f5419ca5.css"])).default({url:e}),{capabilities:r}=await t.load(),o=r.query.supportsMaxRecordCountFactor,s=r.query.supportsPagination,n=r.query.supportsCentroid,l=this._config.maxRecordCountFactor,u=t.capabilities.query.maxRecordCount,d=o?u*l:u,i=new P;if(i.outFields=k(this._config.outFields,["*"]),i.where=k(j(this._config.filter,"where"),"1=1"),i.returnGeometry=!0,i.returnExceededLimitFeatures=!0,i.outSpatialReference=T.fromJSON(this._config.spatialReference),n&&(i.returnCentroid=!0),o&&(i.maxRecordCountFactor=l),s)return i.num=d,t.destroy(),this._queryPages(e,i);const S=await v(e,i,this._config.sourceSpatialReference);return t.destroy(),S.data}async _queryPages(e,t,r=[],o=0){t.start=h(t.num)?o*t.num:null;const{data:s}=await v(e,t,this._config.sourceSpatialReference);return s.exceededTransferLimit&&or.push(n)),this._queryPages(e,t,r,o+1)):(r.forEach(n=>s.features.push(n)),s)}_addRelatedFeatures(e){const t=new Map,r=e.features,o=this._serviceDefinition.relatedFeatures.joinField;for(const s of r){const n=s.attributes[o];t.set(n,s)}this._relatedFeatures=t}};m=_([b("esri.layers.graphics.sources.connections.GeoEventConnection")],m);const $=m;function A(e,t,r,o,s,n,l,u){const d=e.path.indexOf("wss://")===0||e.path.indexOf("ws://")===0,i={source:e,sourceSpatialReference:t,spatialReference:r,geometryType:o,filter:s,maxReconnectionAttempts:n,maxReconnectionInterval:l,customParameters:u};return d?new y(i):new $(i)}export{A as createConnection}; diff --git a/assets/createSymbolSchema.e54d2060.js b/assets/createSymbolSchema.827eb617.js similarity index 91% rename from assets/createSymbolSchema.e54d2060.js rename to assets/createSymbolSchema.827eb617.js index 0e9f901..a2d837e 100644 --- a/assets/createSymbolSchema.e54d2060.js +++ b/assets/createSymbolSchema.827eb617.js @@ -1 +1 @@ -import{b as u,S}from"./Utils.7f6f3a6b.js";import{f as y,_ as V,A as b}from"./MaterialKey.229b1dd6.js";import"./index.d94abe07.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.4c97bad5.js";import"./VertexElementDescriptor.1fdca6da.js";function p(e){var r;return e.type==="line-marker"?{type:"line-marker",color:(r=e.color)==null?void 0:r.toJSON(),placement:e.placement,style:e.style}:e.constructor.fromJSON(e.toJSON()).toJSON()}function f(e){return b(e)}function O(e,r,t=!1){if(!e)return null;switch(e.type){case"simple-fill":case"picture-fill":return x(e,r,t);case"simple-marker":case"picture-marker":return g(e,r,t);case"simple-line":return K(e,r,t);case"text":return z(e,r,t);case"label":return d(e,r,t);case"cim":return{type:"cim",rendererKey:r.vvFlags,data:e.data,maxVVSize:r.maxVVSize};case"CIMSymbolReference":return{type:"cim",rendererKey:r.vvFlags,data:e,maxVVSize:r.maxVVSize};case"web-style":return{...p(e),type:"web-style",hash:e.hash(),rendererKey:r.vvFlags,maxVVSize:r.maxVVSize};default:throw new Error(`symbol not supported ${e.type}`)}}function d(e,r,t){const a=e.toJSON(),l=y(u.LABEL,{...r,placement:a.labelPlacement});return{materialKey:t?f(l):l,hash:e.hash(),...a,labelPlacement:a.labelPlacement}}function x(e,r,t){const a=y(u.FILL,r),l=t?f(a):a,s=e.clone(),n=s.outline,i=V(r.symbologyType);i||(s.outline=null);const c={materialKey:l,hash:s.hash(),...p(s)};if(i)return c;const m=[];if(m.push(c),n){const o=y(u.LINE,{...r,isOutline:!0}),h={materialKey:t?f(o):o,hash:n.hash(),...p(n)};m.push(h)}return{type:"composite-symbol",layers:m,hash:m.reduce((o,h)=>h.hash+o,"")}}function K(e,r,t){var m;const a=V(r.symbologyType)?S.DEFAULT:r.symbologyType,l=y(u.LINE,{...r,symbologyType:a}),s=t?f(l):l,n=e.clone(),i=n.marker;n.marker=null;const c=[];if(c.push({materialKey:s,hash:n.hash(),...p(n)}),i){const o=y(u.MARKER,r),h=t?f(o):o;i.color=(m=i.color)!=null?m:n.color,c.push({materialKey:h,hash:i.hash(),lineWidth:n.width,...p(i)})}return{type:"composite-symbol",layers:c,hash:c.reduce((o,h)=>h.hash+o,"")}}function g(e,r,t){const a=y(u.MARKER,r),l=t?f(a):a,s=p(e);return{materialKey:l,hash:e.hash(),...s,angle:e.angle,maxVVSize:r.maxVVSize}}function z(e,r,t){const a=y(u.TEXT,r),l=t?f(a):a,s=p(e);return{materialKey:l,hash:e.hash(),...s,angle:e.angle,maxVVSize:r.maxVVSize}}export{O as createSymbolSchema}; +import{b as u,S}from"./Utils.2136650a.js";import{f as y,_ as V,A as b}from"./MaterialKey.0cadabc1.js";import"./index.221827cd.js";import"./enums.0295eb81.js";import"./enums.2d9e6f64.js";import"./Texture.940076b2.js";import"./VertexElementDescriptor.1fdca6da.js";function p(e){var r;return e.type==="line-marker"?{type:"line-marker",color:(r=e.color)==null?void 0:r.toJSON(),placement:e.placement,style:e.style}:e.constructor.fromJSON(e.toJSON()).toJSON()}function f(e){return b(e)}function O(e,r,t=!1){if(!e)return null;switch(e.type){case"simple-fill":case"picture-fill":return x(e,r,t);case"simple-marker":case"picture-marker":return g(e,r,t);case"simple-line":return K(e,r,t);case"text":return z(e,r,t);case"label":return d(e,r,t);case"cim":return{type:"cim",rendererKey:r.vvFlags,data:e.data,maxVVSize:r.maxVVSize};case"CIMSymbolReference":return{type:"cim",rendererKey:r.vvFlags,data:e,maxVVSize:r.maxVVSize};case"web-style":return{...p(e),type:"web-style",hash:e.hash(),rendererKey:r.vvFlags,maxVVSize:r.maxVVSize};default:throw new Error(`symbol not supported ${e.type}`)}}function d(e,r,t){const a=e.toJSON(),l=y(u.LABEL,{...r,placement:a.labelPlacement});return{materialKey:t?f(l):l,hash:e.hash(),...a,labelPlacement:a.labelPlacement}}function x(e,r,t){const a=y(u.FILL,r),l=t?f(a):a,s=e.clone(),n=s.outline,i=V(r.symbologyType);i||(s.outline=null);const c={materialKey:l,hash:s.hash(),...p(s)};if(i)return c;const m=[];if(m.push(c),n){const o=y(u.LINE,{...r,isOutline:!0}),h={materialKey:t?f(o):o,hash:n.hash(),...p(n)};m.push(h)}return{type:"composite-symbol",layers:m,hash:m.reduce((o,h)=>h.hash+o,"")}}function K(e,r,t){var m;const a=V(r.symbologyType)?S.DEFAULT:r.symbologyType,l=y(u.LINE,{...r,symbologyType:a}),s=t?f(l):l,n=e.clone(),i=n.marker;n.marker=null;const c=[];if(c.push({materialKey:s,hash:n.hash(),...p(n)}),i){const o=y(u.MARKER,r),h=t?f(o):o;i.color=(m=i.color)!=null?m:n.color,c.push({materialKey:h,hash:i.hash(),lineWidth:n.width,...p(i)})}return{type:"composite-symbol",layers:c,hash:c.reduce((o,h)=>h.hash+o,"")}}function g(e,r,t){const a=y(u.MARKER,r),l=t?f(a):a,s=p(e);return{materialKey:l,hash:e.hash(),...s,angle:e.angle,maxVVSize:r.maxVVSize}}function z(e,r,t){const a=y(u.TEXT,r),l=t?f(a):a,s=p(e);return{materialKey:l,hash:e.hash(),...s,angle:e.angle,maxVVSize:r.maxVVSize}}export{O as createSymbolSchema}; diff --git a/assets/dataUtils.0f9b810f.js b/assets/dataUtils.e7623e56.js similarity index 99% rename from assets/dataUtils.0f9b810f.js rename to assets/dataUtils.e7623e56.js index 9b47f26..7de65f0 100644 --- a/assets/dataUtils.0f9b810f.js +++ b/assets/dataUtils.e7623e56.js @@ -1 +1 @@ -import{ct as xt,j as Y,u as Mt,c as ft,s as yt,m as z,v as kt,bf as ut,ax as bt,cU as At,dC as It}from"./index.d94abe07.js";import{r as at,g as tt}from"./pixelUtils.82950e1a.js";const W=new Map;W.set("meter-per-second",1),W.set("kilometer-per-hour",.277778),W.set("knots",.514444),W.set("feet-per-second",.3048),W.set("mile-per-hour",.44704);const ot=180/Math.PI,it=5,et=new xt({esriMetersPerSecond:"meter-per-second",esriKilometersPerHour:"kilometer-per-hour",esriKnots:"knots",esriFeetPerSecond:"feet-per-second",esriMilesPerHour:"mile-per-hour"});function st(t,n){return W.get(t)/W.get(n)||1}function dt(t){return(450-t)%360}function mt(t,n="geographic"){const[o,c]=t,i=Math.sqrt(o*o+c*c);let a=Math.atan2(c,o)*ot;return a=(360+a)%360,n==="geographic"&&(a=dt(a)),[i,a]}function pt(t,n="geographic"){let o=t[1];n==="geographic"&&(o=dt(o)),o%=360;const c=t[0];return[c*Math.cos(o/ot),c*Math.sin(o/ot)]}function Jt(t,n,o,c="geographic"){if(!at(t)||Y(o))return t;const i=n==="vector-magdir"?t.clone():Mt(lt(t,n)),a=i.pixels[1];for(let d=0;d0){const[X,G]=T(y,A,n,l),[Q,L]=T(k,I,n,l);F.push(X),F.push(G),F.push(H),F.push(Z),F.push(Q),F.push(L)}else{const[X,G]=T(y,w,n,l),[Q,L]=T(x,f,n,l),[O,nt]=T(M,P,n,l);_.push(H),_.push(Z),_.push(O),_.push(nt),_.push(Q),_.push(L),_.push(X),_.push(G)}A+=a,I+=a,w+=a,f+=a,P+=a}const[N,S]=T(e+b,r+d,n,l),D=(c/2+s)*g,[V,q]=T(e+D,r+d,n,l),[j,E]=T(e+b,r-h,n,l),[B,C]=T(e+D,r-h,n,l);return{pennants:F,barbs:_,shaft:[N,S,V,q,j,E,B,C]}}function T(t,n,o,c=1){const i=Math.sqrt(t*t+n*n)/c,a=(2*Math.PI+Math.atan2(n,t))%(2*Math.PI);return[i,(2*Math.PI+a-o)%(2*Math.PI)]}const $=[0,1,3,6,10,16,21,27,33,40,47,55,63],Dt=[0,.5,1,1.5,2],Ft=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function K(t,n,o,c){const i=st(c||"knots",o);let a;for(a=1;af>0).length:m*u,y=new Float32Array(I*l),w=new Uint32Array(e*I),x=n.invertDirection?gt(0,0,0,!1):vt;for(let f=0;f=it){const I=(h[b]+360)%360/180*Math.PI,{pennants:y,barbs:w,shaft:x}=rt[Math.min(Math.floor(k/5),29)];if(y.length+w.length===0)continue;let f=e.length/l;const p=(g+.5)/c,A=(u+.5)/i;for(let M=0;M=(v-M)*(U-P)*(1-i)){I[A]=1;const[F,_]=mt([b[A]/p,k[A]/p]);b[A]=F,k[A]=_}else I[A]=0,b[A]=0,k[A]=0}const w=new tt({width:m,height:u,pixels:[b,k],mask:I});return w.updateStatistics(),w}const R=yt.getLogger("esri.views.2d.engine.flow.dataUtils"),qt=10;async function Xt(t,n,o,c){const i=performance.now(),a=Lt(n,o),d=performance.now(),h=Tt(n,a,o.width,o.height),l=performance.now(),e=Bt(h,!0),r=performance.now(),s=t==="Streamlines"?jt(e,qt):Rt(e),m=performance.now();return z("esri-2d-profiler")&&(R.info("I.1","_createFlowFieldFromData (ms)",Math.round(d-i)),R.info("I.2","_getStreamlines (ms)",Math.round(l-d)),R.info("I.3","createAnimatedLinesData (ms)",Math.round(r-l)),R.info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(m-r)),R.info("I.5","createFlowMesh (ms)",Math.round(m-i)),R.info("I.6","Mesh size (bytes)",s.vertexData.buffer.byteLength+s.indexData.buffer.byteLength)),await Promise.resolve(),kt(c),s}function Lt(t,n){const o=Nt(n.data,n.width,n.height,t.smoothing);return t.interpolate?(c,i)=>{const a=Math.floor(c),d=Math.floor(i);if(a<0||a>=n.width)return[0,0];if(d<0||d>=n.height)return[0,0];const h=c-a,l=i-d,e=a,r=d,s=a{const a=Math.round(c),d=Math.round(i);return a<0||a>=n.width||d<0||d>=n.height?[0,0]:[o[2*(d*n.width+a)+0],o[2*(d*n.width+a)+1]]}}function Ot(t,n,o,c,i,a,d,h,l){const e=[];let r=o,s=c,m=0,[u,g]=n(r,s);u*=t.velocityScale,g*=t.velocityScale;const b=Math.sqrt(u*u+g*g);let k,I;e.push({x:r,y:s,t:m,speed:b});for(let y=0;yt.maxTurnAngle)return e;if(t.collisions){const M=Math.round(r*l),P=Math.round(s*l);if(M<0||M>d-1||P<0||P>h-1)return e;const v=a[P*d+M];if(v!==-1&&v!==i)return e;a[P*d+M]=i}e.push({x:r,y:s,t:m,speed:f}),k=p,I=A}return e}function Tt(t,n,o,c){const i=[],a=new ut,d=1/Math.max(t.lineCollisionWidth,1),h=Math.round(o*d),l=Math.round(c*d),e=new Int32Array(h*l);for(let s=0;ss.sort-m.sort);for(const{x:s,y:m}of r)if(a.getFloat()=n)continue;const g=a[u+i];s+=g*t[2*(e*n+(r+u))+0],m+=g*t[2*(e*n+(r+u))+1]}h[2*(e*n+r)+0]=s,h[2*(e*n+r)+1]=m}const l=new Float32Array(t.length);for(let e=0;e=o)continue;const g=a[u+i];s+=g*h[2*((r+u)*n+e)+0],m+=g*h[2*((r+u)*n+e)+1]}l[2*(r*n+e)+0]=s,l[2*(r*n+e)+1]=m}return l}function Bt(t,n){const o=new ut,c=t.reduce((l,e)=>l+e.length,0),i=new Float32Array(4*c),a=new Array(t.length);let d=0,h=0;for(const l of t){const e=d;for(const r of l)i[4*d+0]=r.x,i[4*d+1]=r.y,i[4*d+2]=r.t,i[4*d+3]=r.speed,d++;a[h++]={startVertex:e,numberOfVertices:l.length,totalTime:l[l.length-1].t,timeSeed:n?o.getFloat():0}}return{lineVertices:i,lineDescriptors:a}}function jt(t,n){const{lineVertices:c,lineDescriptors:i}=t;let a=0,d=0;for(const u of i)a+=2*u.numberOfVertices,d+=6*(u.numberOfVertices-1);const h=new Float32Array(a*9),l=new Uint32Array(d);let e=0,r=0;function s(){l[r++]=e-2,l[r++]=e,l[r++]=e-1,l[r++]=e,l[r++]=e+1,l[r++]=e-1}function m(u,g,b,k,I,y,w,x){const f=e*9;let p=0;h[f+p++]=u,h[f+p++]=g,h[f+p++]=1,h[f+p++]=b,h[f+p++]=y,h[f+p++]=w,h[f+p++]=k/2,h[f+p++]=I/2,h[f+p++]=x,e++,h[f+p++]=u,h[f+p++]=g,h[f+p++]=-1,h[f+p++]=b,h[f+p++]=y,h[f+p++]=w,h[f+p++]=-k/2,h[f+p++]=-I/2,h[f+p++]=x,e++}for(const u of i){const{totalTime:g,timeSeed:b}=u;let k=null,I=null,y=null,w=null,x=null,f=null;for(let p=0;p0){U=A-k,F=M-I;const S=Math.sqrt(U*U+F*F);if(U/=S,F/=S,p>1){let D=U+x,V=F+f;const q=Math.sqrt(D*D+V*V);D/=q,V/=q;const j=Math.min(1/(D*U+V*F),n);D*=j,V*=j,_=-V,N=D}else _=-F,N=U;_!==null&&N!==null&&(m(k,I,y,_,N,g,b,v),s())}k=A,I=M,y=P,x=U,f=F,w=v}m(k,I,y,-f,x,g,b,w)}return{vertexData:h,indexData:l}}function Rt(t){const{lineVertices:i,lineDescriptors:a}=t;let d=0,h=0;for(const S of a){const D=S.numberOfVertices-1;d+=4*D*2,h+=6*D*2}const l=new Float32Array(d*16),e=new Uint32Array(h);let r,s,m,u,g,b,k,I,y,w,x,f,p,A,M=0,P=0;function v(){e[P++]=M-8,e[P++]=M-7,e[P++]=M-6,e[P++]=M-7,e[P++]=M-5,e[P++]=M-6,e[P++]=M-4,e[P++]=M-3,e[P++]=M-2,e[P++]=M-3,e[P++]=M-1,e[P++]=M-2}function U(S,D,V,q,j,E,B,C,J,H,Z,X,G,Q){const L=M*16;let O=0;for(const nt of[1,2])for(const wt of[1,2,3,4])l[L+O++]=S,l[L+O++]=D,l[L+O++]=V,l[L+O++]=q,l[L+O++]=B,l[L+O++]=C,l[L+O++]=J,l[L+O++]=H,l[L+O++]=nt,l[L+O++]=wt,l[L+O++]=G,l[L+O++]=Q,l[L+O++]=j/2,l[L+O++]=E/2,l[L+O++]=Z/2,l[L+O++]=X/2,M++}function F(S,D){let V=y+x,q=w+f;const j=Math.sqrt(V*V+q*q);V/=j,q/=j;const E=y*V+w*q;V/=E,q/=E;let B=x+p,C=f+A;const J=Math.sqrt(B*B+C*C);B/=J,C/=J;const H=x*B+f*C;B/=H,C/=H,U(r,s,m,u,-q,V,g,b,k,I,-C,B,S,D),v()}function _(S,D,V,q,j,E){if(y=x,w=f,x=p,f=A,y==null&&w==null&&(y=x,w=f),g!=null&&b!=null){p=S-g,A=D-b;const B=Math.sqrt(p*p+A*A);p/=B,A/=B}y!=null&&w!=null&&F(j,E),r=g,s=b,m=k,u=I,g=S,b=D,k=V,I=q}function N(S,D){y=x,w=f,x=p,f=A,y==null&&w==null&&(y=x,w=f),y!=null&&w!=null&&F(S,D)}for(const S of a){r=null,s=null,m=null,u=null,g=null,b=null,k=null,I=null,y=null,w=null,x=null,f=null,p=null,A=null;const{totalTime:D,timeSeed:V}=S;for(let q=0;q=o||(y.data[2*(f*o+w+p)+0]=x.data[2*(f*x.width+p)+0],y.data[2*(f*o+w+p)+1]=x.data[2*(f*x.width+p)+1],y.mask[f*o+w+p]=x.mask[f*x.width+p]);w+=x.width}return z("esri-2d-profiler")&&R.info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-d)),y}async function ht(t,n,o,c,i,a){const d={requestProjectedLocalDirections:!0,signal:a};if(ft(i)&&(d.timeExtent=i),t.type==="imagery"){await t.load({signal:a});const e=t.rasterInfo.dataType,r=await t.fetchImage(n,o,c,d);return!r||Y(r.pixelData)||Y(r.pixelData.pixelBlock)?{data:new Float32Array(o*c*2),mask:new Uint8Array(o*c),width:o,height:c}:ct(e,r.pixelData.pixelBlock)}await t.load({signal:a});const h=t.rasterInfo.dataType,l=await t.fetchPixels(n,o,c,d);return!l||Y(l.pixelBlock)?{data:new Float32Array(o*c*2),mask:new Uint8Array(o*c),width:o,height:c}:ct(h,l.pixelBlock)}export{_t as D,Wt as F,Gt as a,mt as b,et as c,lt as d,Xt as f,Ht as g,zt as j,st as l,Jt as m,Kt as x}; +import{ct as xt,j as Y,u as Mt,c as ft,s as yt,m as z,v as kt,bf as ut,ax as bt,cU as At,dC as It}from"./index.221827cd.js";import{r as at,g as tt}from"./pixelUtils.9c6f8dae.js";const W=new Map;W.set("meter-per-second",1),W.set("kilometer-per-hour",.277778),W.set("knots",.514444),W.set("feet-per-second",.3048),W.set("mile-per-hour",.44704);const ot=180/Math.PI,it=5,et=new xt({esriMetersPerSecond:"meter-per-second",esriKilometersPerHour:"kilometer-per-hour",esriKnots:"knots",esriFeetPerSecond:"feet-per-second",esriMilesPerHour:"mile-per-hour"});function st(t,n){return W.get(t)/W.get(n)||1}function dt(t){return(450-t)%360}function mt(t,n="geographic"){const[o,c]=t,i=Math.sqrt(o*o+c*c);let a=Math.atan2(c,o)*ot;return a=(360+a)%360,n==="geographic"&&(a=dt(a)),[i,a]}function pt(t,n="geographic"){let o=t[1];n==="geographic"&&(o=dt(o)),o%=360;const c=t[0];return[c*Math.cos(o/ot),c*Math.sin(o/ot)]}function Jt(t,n,o,c="geographic"){if(!at(t)||Y(o))return t;const i=n==="vector-magdir"?t.clone():Mt(lt(t,n)),a=i.pixels[1];for(let d=0;d0){const[X,G]=T(y,A,n,l),[Q,L]=T(k,I,n,l);F.push(X),F.push(G),F.push(H),F.push(Z),F.push(Q),F.push(L)}else{const[X,G]=T(y,w,n,l),[Q,L]=T(x,f,n,l),[O,nt]=T(M,P,n,l);_.push(H),_.push(Z),_.push(O),_.push(nt),_.push(Q),_.push(L),_.push(X),_.push(G)}A+=a,I+=a,w+=a,f+=a,P+=a}const[N,S]=T(e+b,r+d,n,l),D=(c/2+s)*g,[V,q]=T(e+D,r+d,n,l),[j,E]=T(e+b,r-h,n,l),[B,C]=T(e+D,r-h,n,l);return{pennants:F,barbs:_,shaft:[N,S,V,q,j,E,B,C]}}function T(t,n,o,c=1){const i=Math.sqrt(t*t+n*n)/c,a=(2*Math.PI+Math.atan2(n,t))%(2*Math.PI);return[i,(2*Math.PI+a-o)%(2*Math.PI)]}const $=[0,1,3,6,10,16,21,27,33,40,47,55,63],Dt=[0,.5,1,1.5,2],Ft=[0,.25,.5,1,1.5,2,2.5,3,3.5,4];function K(t,n,o,c){const i=st(c||"knots",o);let a;for(a=1;af>0).length:m*u,y=new Float32Array(I*l),w=new Uint32Array(e*I),x=n.invertDirection?gt(0,0,0,!1):vt;for(let f=0;f=it){const I=(h[b]+360)%360/180*Math.PI,{pennants:y,barbs:w,shaft:x}=rt[Math.min(Math.floor(k/5),29)];if(y.length+w.length===0)continue;let f=e.length/l;const p=(g+.5)/c,A=(u+.5)/i;for(let M=0;M=(v-M)*(U-P)*(1-i)){I[A]=1;const[F,_]=mt([b[A]/p,k[A]/p]);b[A]=F,k[A]=_}else I[A]=0,b[A]=0,k[A]=0}const w=new tt({width:m,height:u,pixels:[b,k],mask:I});return w.updateStatistics(),w}const R=yt.getLogger("esri.views.2d.engine.flow.dataUtils"),qt=10;async function Xt(t,n,o,c){const i=performance.now(),a=Lt(n,o),d=performance.now(),h=Tt(n,a,o.width,o.height),l=performance.now(),e=Bt(h,!0),r=performance.now(),s=t==="Streamlines"?jt(e,qt):Rt(e),m=performance.now();return z("esri-2d-profiler")&&(R.info("I.1","_createFlowFieldFromData (ms)",Math.round(d-i)),R.info("I.2","_getStreamlines (ms)",Math.round(l-d)),R.info("I.3","createAnimatedLinesData (ms)",Math.round(r-l)),R.info("I.4","create{Streamlines|Particles}Mesh (ms)",Math.round(m-r)),R.info("I.5","createFlowMesh (ms)",Math.round(m-i)),R.info("I.6","Mesh size (bytes)",s.vertexData.buffer.byteLength+s.indexData.buffer.byteLength)),await Promise.resolve(),kt(c),s}function Lt(t,n){const o=Nt(n.data,n.width,n.height,t.smoothing);return t.interpolate?(c,i)=>{const a=Math.floor(c),d=Math.floor(i);if(a<0||a>=n.width)return[0,0];if(d<0||d>=n.height)return[0,0];const h=c-a,l=i-d,e=a,r=d,s=a{const a=Math.round(c),d=Math.round(i);return a<0||a>=n.width||d<0||d>=n.height?[0,0]:[o[2*(d*n.width+a)+0],o[2*(d*n.width+a)+1]]}}function Ot(t,n,o,c,i,a,d,h,l){const e=[];let r=o,s=c,m=0,[u,g]=n(r,s);u*=t.velocityScale,g*=t.velocityScale;const b=Math.sqrt(u*u+g*g);let k,I;e.push({x:r,y:s,t:m,speed:b});for(let y=0;yt.maxTurnAngle)return e;if(t.collisions){const M=Math.round(r*l),P=Math.round(s*l);if(M<0||M>d-1||P<0||P>h-1)return e;const v=a[P*d+M];if(v!==-1&&v!==i)return e;a[P*d+M]=i}e.push({x:r,y:s,t:m,speed:f}),k=p,I=A}return e}function Tt(t,n,o,c){const i=[],a=new ut,d=1/Math.max(t.lineCollisionWidth,1),h=Math.round(o*d),l=Math.round(c*d),e=new Int32Array(h*l);for(let s=0;ss.sort-m.sort);for(const{x:s,y:m}of r)if(a.getFloat()=n)continue;const g=a[u+i];s+=g*t[2*(e*n+(r+u))+0],m+=g*t[2*(e*n+(r+u))+1]}h[2*(e*n+r)+0]=s,h[2*(e*n+r)+1]=m}const l=new Float32Array(t.length);for(let e=0;e=o)continue;const g=a[u+i];s+=g*h[2*((r+u)*n+e)+0],m+=g*h[2*((r+u)*n+e)+1]}l[2*(r*n+e)+0]=s,l[2*(r*n+e)+1]=m}return l}function Bt(t,n){const o=new ut,c=t.reduce((l,e)=>l+e.length,0),i=new Float32Array(4*c),a=new Array(t.length);let d=0,h=0;for(const l of t){const e=d;for(const r of l)i[4*d+0]=r.x,i[4*d+1]=r.y,i[4*d+2]=r.t,i[4*d+3]=r.speed,d++;a[h++]={startVertex:e,numberOfVertices:l.length,totalTime:l[l.length-1].t,timeSeed:n?o.getFloat():0}}return{lineVertices:i,lineDescriptors:a}}function jt(t,n){const{lineVertices:c,lineDescriptors:i}=t;let a=0,d=0;for(const u of i)a+=2*u.numberOfVertices,d+=6*(u.numberOfVertices-1);const h=new Float32Array(a*9),l=new Uint32Array(d);let e=0,r=0;function s(){l[r++]=e-2,l[r++]=e,l[r++]=e-1,l[r++]=e,l[r++]=e+1,l[r++]=e-1}function m(u,g,b,k,I,y,w,x){const f=e*9;let p=0;h[f+p++]=u,h[f+p++]=g,h[f+p++]=1,h[f+p++]=b,h[f+p++]=y,h[f+p++]=w,h[f+p++]=k/2,h[f+p++]=I/2,h[f+p++]=x,e++,h[f+p++]=u,h[f+p++]=g,h[f+p++]=-1,h[f+p++]=b,h[f+p++]=y,h[f+p++]=w,h[f+p++]=-k/2,h[f+p++]=-I/2,h[f+p++]=x,e++}for(const u of i){const{totalTime:g,timeSeed:b}=u;let k=null,I=null,y=null,w=null,x=null,f=null;for(let p=0;p0){U=A-k,F=M-I;const S=Math.sqrt(U*U+F*F);if(U/=S,F/=S,p>1){let D=U+x,V=F+f;const q=Math.sqrt(D*D+V*V);D/=q,V/=q;const j=Math.min(1/(D*U+V*F),n);D*=j,V*=j,_=-V,N=D}else _=-F,N=U;_!==null&&N!==null&&(m(k,I,y,_,N,g,b,v),s())}k=A,I=M,y=P,x=U,f=F,w=v}m(k,I,y,-f,x,g,b,w)}return{vertexData:h,indexData:l}}function Rt(t){const{lineVertices:i,lineDescriptors:a}=t;let d=0,h=0;for(const S of a){const D=S.numberOfVertices-1;d+=4*D*2,h+=6*D*2}const l=new Float32Array(d*16),e=new Uint32Array(h);let r,s,m,u,g,b,k,I,y,w,x,f,p,A,M=0,P=0;function v(){e[P++]=M-8,e[P++]=M-7,e[P++]=M-6,e[P++]=M-7,e[P++]=M-5,e[P++]=M-6,e[P++]=M-4,e[P++]=M-3,e[P++]=M-2,e[P++]=M-3,e[P++]=M-1,e[P++]=M-2}function U(S,D,V,q,j,E,B,C,J,H,Z,X,G,Q){const L=M*16;let O=0;for(const nt of[1,2])for(const wt of[1,2,3,4])l[L+O++]=S,l[L+O++]=D,l[L+O++]=V,l[L+O++]=q,l[L+O++]=B,l[L+O++]=C,l[L+O++]=J,l[L+O++]=H,l[L+O++]=nt,l[L+O++]=wt,l[L+O++]=G,l[L+O++]=Q,l[L+O++]=j/2,l[L+O++]=E/2,l[L+O++]=Z/2,l[L+O++]=X/2,M++}function F(S,D){let V=y+x,q=w+f;const j=Math.sqrt(V*V+q*q);V/=j,q/=j;const E=y*V+w*q;V/=E,q/=E;let B=x+p,C=f+A;const J=Math.sqrt(B*B+C*C);B/=J,C/=J;const H=x*B+f*C;B/=H,C/=H,U(r,s,m,u,-q,V,g,b,k,I,-C,B,S,D),v()}function _(S,D,V,q,j,E){if(y=x,w=f,x=p,f=A,y==null&&w==null&&(y=x,w=f),g!=null&&b!=null){p=S-g,A=D-b;const B=Math.sqrt(p*p+A*A);p/=B,A/=B}y!=null&&w!=null&&F(j,E),r=g,s=b,m=k,u=I,g=S,b=D,k=V,I=q}function N(S,D){y=x,w=f,x=p,f=A,y==null&&w==null&&(y=x,w=f),y!=null&&w!=null&&F(S,D)}for(const S of a){r=null,s=null,m=null,u=null,g=null,b=null,k=null,I=null,y=null,w=null,x=null,f=null,p=null,A=null;const{totalTime:D,timeSeed:V}=S;for(let q=0;q=o||(y.data[2*(f*o+w+p)+0]=x.data[2*(f*x.width+p)+0],y.data[2*(f*o+w+p)+1]=x.data[2*(f*x.width+p)+1],y.mask[f*o+w+p]=x.mask[f*x.width+p]);w+=x.width}return z("esri-2d-profiler")&&R.info("I.10","loadImagery, general exit (ms)",Math.round(performance.now()-d)),y}async function ht(t,n,o,c,i,a){const d={requestProjectedLocalDirections:!0,signal:a};if(ft(i)&&(d.timeExtent=i),t.type==="imagery"){await t.load({signal:a});const e=t.rasterInfo.dataType,r=await t.fetchImage(n,o,c,d);return!r||Y(r.pixelData)||Y(r.pixelData.pixelBlock)?{data:new Float32Array(o*c*2),mask:new Uint8Array(o*c),width:o,height:c}:ct(e,r.pixelData.pixelBlock)}await t.load({signal:a});const h=t.rasterInfo.dataType,l=await t.fetchPixels(n,o,c,d);return!l||Y(l.pixelBlock)?{data:new Float32Array(o*c*2),mask:new Uint8Array(o*c),width:o,height:c}:ct(h,l.pixelBlock)}export{_t as D,Wt as F,Gt as a,mt as b,et as c,lt as d,Xt as f,Ht as g,zt as j,st as l,Jt as m,Kt as x}; diff --git a/assets/deduplicate.17ab7923.js b/assets/deduplicate.ef93b18a.js similarity index 95% rename from assets/deduplicate.17ab7923.js rename to assets/deduplicate.ef93b18a.js index 0ff9fdd..53d8bed 100644 --- a/assets/deduplicate.17ab7923.js +++ b/assets/deduplicate.ef93b18a.js @@ -1 +1 @@ -import{fI as O}from"./index.d94abe07.js";function D(h,e,r){var C;const n=h.byteLength/(4*e),o=new Uint32Array(h,0,n*e);let f=new Uint32Array(n);const g=(C=r==null?void 0:r.minReduction)!=null?C:0,s=(r==null?void 0:r.originalIndices)||null,p=s?s.length:0,u=(r==null?void 0:r.componentOffsets)||null;let U=0;if(u)for(let t=0;tU&&(U=i)}else U=n;const w=Math.floor(1.1*U)+1;(a==null||a.length<2*w)&&(a=new Uint32Array(O(2*w)));for(let t=0;t<2*w;t++)a[t]=0;let c=0;const A=!!u&&!!s,b=A?p:n,m=A?new Uint32Array(p):null,M=1.96;let I=g!==0?Math.ceil(4*M*M/(g*g)*g*(1-g)):b,d=1,j=u?u[1]:b;for(let t=0;t=w&&(y-=w)}k===c&&(a[2*y]=q,a[2*y+1]=i+1,c++),f[i]=k}if(g!==0&&1-c/n>>2)|0;return n>>>0}let a=null;export{D as n}; +import{fI as O}from"./index.221827cd.js";function D(h,e,r){var C;const n=h.byteLength/(4*e),o=new Uint32Array(h,0,n*e);let f=new Uint32Array(n);const g=(C=r==null?void 0:r.minReduction)!=null?C:0,s=(r==null?void 0:r.originalIndices)||null,p=s?s.length:0,u=(r==null?void 0:r.componentOffsets)||null;let U=0;if(u)for(let t=0;tU&&(U=i)}else U=n;const w=Math.floor(1.1*U)+1;(a==null||a.length<2*w)&&(a=new Uint32Array(O(2*w)));for(let t=0;t<2*w;t++)a[t]=0;let c=0;const A=!!u&&!!s,b=A?p:n,m=A?new Uint32Array(p):null,M=1.96;let I=g!==0?Math.ceil(4*M*M/(g*g)*g*(1-g)):b,d=1,j=u?u[1]:b;for(let t=0;t=w&&(y-=w)}k===c&&(a[2*y]=q,a[2*y+1]=i+1,c++),f[i]=k}if(g!==0&&1-c/n>>2)|0;return n>>>0}let a=null;export{D as n}; diff --git a/assets/drapedUtils.e64c9295.js b/assets/drapedUtils.0866c85c.js similarity index 95% rename from assets/drapedUtils.e64c9295.js rename to assets/drapedUtils.0866c85c.js index ed18bdb..b7dba32 100644 --- a/assets/drapedUtils.e64c9295.js +++ b/assets/drapedUtils.0866c85c.js @@ -1 +1 @@ -import{cU as m,c as h,cq as c}from"./index.d94abe07.js";function u(e,n){return n?"xoffset"in n&&n.xoffset?Math.max(e,Math.abs(n.xoffset)):"yoffset"in n&&n.yoffset?Math.max(e,Math.abs(n.yoffset||0)):e:e}function b(e){let n=0,t=0;for(let s=0;sa.type==="size").map(a=>{const{maxSize:f,minSize:o}=a;return(p(f,e)+p(o,e))/2});let s=0;const r=t.length;if(r===0)return e;for(let a=0;a{i=u(i,a.symbol)}),i}if(n.type==="class-breaks"){let i=s;return n.classBreakInfos.forEach(a=>{i=u(i,a.symbol)}),i}return n.type==="dot-density"||n.type,s}function z(e,n,t,s=new m){let r;if(t.type==="2d")r=n*t.resolution;else if(t.type==="3d"){const x=t.overlayPixelSizeInMapUnits(e),l=t.basemapSpatialReference;r=h(l)&&!l.equals(t.spatialReference)?c(l)/c(t.spatialReference):n*x}const i=e.x-r,a=e.y-r,f=e.x+r,o=e.y+r,{spatialReference:y}=t;return s.xmin=Math.min(i,f),s.ymin=Math.min(a,o),s.xmax=Math.max(i,f),s.ymax=Math.max(a,o),s.spatialReference=y,s}new m;export{z as a,d as s}; +import{cU as m,c as h,cq as c}from"./index.221827cd.js";function u(e,n){return n?"xoffset"in n&&n.xoffset?Math.max(e,Math.abs(n.xoffset)):"yoffset"in n&&n.yoffset?Math.max(e,Math.abs(n.yoffset||0)):e:e}function b(e){let n=0,t=0;for(let s=0;sa.type==="size").map(a=>{const{maxSize:f,minSize:o}=a;return(p(f,e)+p(o,e))/2});let s=0;const r=t.length;if(r===0)return e;for(let a=0;a{i=u(i,a.symbol)}),i}if(n.type==="class-breaks"){let i=s;return n.classBreakInfos.forEach(a=>{i=u(i,a.symbol)}),i}return n.type==="dot-density"||n.type,s}function z(e,n,t,s=new m){let r;if(t.type==="2d")r=n*t.resolution;else if(t.type==="3d"){const x=t.overlayPixelSizeInMapUnits(e),l=t.basemapSpatialReference;r=h(l)&&!l.equals(t.spatialReference)?c(l)/c(t.spatialReference):n*x}const i=e.x-r,a=e.y-r,f=e.x+r,o=e.y+r,{spatialReference:y}=t;return s.xmin=Math.min(i,f),s.ymin=Math.min(a,o),s.xmax=Math.max(i,f),s.ymax=Math.max(a,o),s.spatialReference=y,s}new m;export{z as a,d as s}; diff --git a/assets/edgeProcessing.b309b825.js b/assets/edgeProcessing.a9e4d72e.js similarity index 97% rename from assets/edgeProcessing.b309b825.js rename to assets/edgeProcessing.a9e4d72e.js index c2d897c..94528ed 100644 --- a/assets/edgeProcessing.b309b825.js +++ b/assets/edgeProcessing.a9e4d72e.js @@ -1 +1 @@ -import{n as It}from"./deduplicate.17ab7923.js";import{T as F}from"./InterleavedLayout.f9d79992.js";import{O as u}from"./VertexAttribute.42396f25.js";import{C as D}from"./enums.2d9e6f64.js";import{t as At}from"./VertexElementDescriptor.1fdca6da.js";import{dC as nt,fw as ht,fx as Ot,O as W,fy as ot,fz as z,fA as St,fB as wt,fC as lt,fD as rt,fE as ut,fF as Tt,M as E,bf as Et,fG as vt}from"./index.d94abe07.js";function j(t,e=0){const o=t.stride;return t.fieldNames.filter(s=>{const r=t.fields.get(s).optional;return!(r&&r.glPadding)}).map(s=>{const r=t.fields.get(s),c=r.constructor.ElementCount,g=$t(r.constructor.ElementType),a=r.offset,p=!(!r.optional||!r.optional.glNormalized);return new At(s,c,g,a,o,p,e)})}function $t(t){const e=Pt[t];if(e)return e;throw new Error("BufferType not supported in WebGL")}const Pt={u8:D.UNSIGNED_BYTE,u16:D.UNSIGNED_SHORT,u32:D.UNSIGNED_INT,i8:D.BYTE,i16:D.SHORT,i32:D.INT,f32:D.FLOAT},yt=F().vec3f(u.POSITION).u16(u.COMPONENTINDEX).u16(u.U16PADDING),Dt=F().vec2u8(u.SIDENESS);j(Dt);const gt=F().vec3f(u.POSITION0).vec3f(u.POSITION1).u16(u.COMPONENTINDEX).u8(u.VARIANTOFFSET,{glNormalized:!0}).u8(u.VARIANTSTROKE).u8(u.VARIANTEXTENSION,{glNormalized:!0}).u8(u.U8PADDING,{glPadding:!0}).u16(u.U16PADDING,{glPadding:!0}),X=gt.clone().vec3f(u.NORMAL),K=gt.clone().vec3f(u.NORMALA).vec3f(u.NORMALB);u.POSITION0,u.POSITION1,u.COMPONENTINDEX,u.VARIANTOFFSET,u.VARIANTSTROKE,u.VARIANTEXTENSION,u.NORMAL,u.NORMALA,u.NORMALB,u.SIDENESS;const V=-1;var st;function Vt(t,e,o,s=_t){const r=t.vertices.position,c=t.vertices.componentIndex,g=nt(s.anglePlanar),a=nt(s.angleSignificantEdge),p=Math.cos(a),f=Math.cos(g),l=k.edge,I=l.position0,A=l.position1,d=l.faceNormal0,v=l.faceNormal1,h=Ft(t),$=xt(t),n=$.length/4,i=e.allocate(n);let m=0;const N=n,O=o.allocate(N);let T=0,P=0,S=0;const Q=ht(0,n),_=new Float32Array(n);Ot(_,(L,w,x)=>{r.getVec($[4*w+0],I),r.getVec($[4*w+1],A),x[w]=Tt(I,A)}),Q.sort((L,w)=>_[w]-_[L]);const Z=new Array,tt=new Array;for(let L=0;Le}function Rt(t,e){const o=St(t.cosAngle),s=k.fwd,r=k.ortho;return wt(s,t.position1,t.position0),o*(z(lt(r,t.faceNormal0,t.faceNormal1),s)>0?-1:1)>e}function xt(t){const e=t.faces.length/3,o=t.faces,s=t.neighbors;let r=0;for(let a=0;a{n{if(n{const m=2*n,N=i-n;for(let O=1;O=0&&f[m+2*S]>T;S--)f[m+2*S+2]=f[m+2*S],f[m+2*S+3]=f[m+2*S+1];f[m+2*S+2]=T,f[m+2*S+3]=P}};for(let n=0;nn===t[3*i]?0:n===t[3*i+1]?1:n===t[3*i+2]?2:-1,h=(n,i)=>{const m=v(n,i);d[3*i+m]=-1},$=(n,i,m,N)=>{const O=v(n,i);d[3*i+O]=N;const T=v(m,N);d[3*N+T]=i};for(let n=0;n{const r=t.fields.get(s).optional;return!(r&&r.glPadding)}).map(s=>{const r=t.fields.get(s),c=r.constructor.ElementCount,g=$t(r.constructor.ElementType),a=r.offset,p=!(!r.optional||!r.optional.glNormalized);return new At(s,c,g,a,o,p,e)})}function $t(t){const e=Pt[t];if(e)return e;throw new Error("BufferType not supported in WebGL")}const Pt={u8:D.UNSIGNED_BYTE,u16:D.UNSIGNED_SHORT,u32:D.UNSIGNED_INT,i8:D.BYTE,i16:D.SHORT,i32:D.INT,f32:D.FLOAT},yt=F().vec3f(u.POSITION).u16(u.COMPONENTINDEX).u16(u.U16PADDING),Dt=F().vec2u8(u.SIDENESS);j(Dt);const gt=F().vec3f(u.POSITION0).vec3f(u.POSITION1).u16(u.COMPONENTINDEX).u8(u.VARIANTOFFSET,{glNormalized:!0}).u8(u.VARIANTSTROKE).u8(u.VARIANTEXTENSION,{glNormalized:!0}).u8(u.U8PADDING,{glPadding:!0}).u16(u.U16PADDING,{glPadding:!0}),X=gt.clone().vec3f(u.NORMAL),K=gt.clone().vec3f(u.NORMALA).vec3f(u.NORMALB);u.POSITION0,u.POSITION1,u.COMPONENTINDEX,u.VARIANTOFFSET,u.VARIANTSTROKE,u.VARIANTEXTENSION,u.NORMAL,u.NORMALA,u.NORMALB,u.SIDENESS;const V=-1;var st;function Vt(t,e,o,s=_t){const r=t.vertices.position,c=t.vertices.componentIndex,g=nt(s.anglePlanar),a=nt(s.angleSignificantEdge),p=Math.cos(a),f=Math.cos(g),l=k.edge,I=l.position0,A=l.position1,d=l.faceNormal0,v=l.faceNormal1,h=Ft(t),$=xt(t),n=$.length/4,i=e.allocate(n);let m=0;const N=n,O=o.allocate(N);let T=0,P=0,S=0;const Q=ht(0,n),_=new Float32Array(n);Ot(_,(L,w,x)=>{r.getVec($[4*w+0],I),r.getVec($[4*w+1],A),x[w]=Tt(I,A)}),Q.sort((L,w)=>_[w]-_[L]);const Z=new Array,tt=new Array;for(let L=0;Le}function Rt(t,e){const o=St(t.cosAngle),s=k.fwd,r=k.ortho;return wt(s,t.position1,t.position0),o*(z(lt(r,t.faceNormal0,t.faceNormal1),s)>0?-1:1)>e}function xt(t){const e=t.faces.length/3,o=t.faces,s=t.neighbors;let r=0;for(let a=0;a{n{if(n{const m=2*n,N=i-n;for(let O=1;O=0&&f[m+2*S]>T;S--)f[m+2*S+2]=f[m+2*S],f[m+2*S+3]=f[m+2*S+1];f[m+2*S+2]=T,f[m+2*S+3]=P}};for(let n=0;nn===t[3*i]?0:n===t[3*i+1]?1:n===t[3*i+2]?2:-1,h=(n,i)=>{const m=v(n,i);d[3*i+m]=-1},$=(n,i,m,N)=>{const O=v(n,i);d[3*i+O]=N;const T=v(m,N);d[3*N+T]=i};for(let n=0;n{s=d,l=u})};e.emit("apply-edits",o);try{const{results:d,edits:u}=await G(e,t,a,n),c=A=>A.filter(v=>!v.error).map(I),p={edits:u,addedFeatures:c(d.addFeatureResults),updatedFeatures:c(d.updateFeatureResults),deletedFeatures:c(d.deleteFeatureResults),addedAttachments:c(d.addAttachmentResults),updatedAttachments:c(d.updateAttachmentResults),deletedAttachments:c(d.deleteAttachmentResults)};return(r=d.editedFeatureResults)!=null&&r.length&&(p.editedFeatures=d.editedFeatureResults),(p.addedFeatures.length||p.updatedFeatures.length||p.deletedFeatures.length||p.addedAttachments.length||p.updatedAttachments.length||p.deletedAttachments.length)&&(e.emit("edits",p),E(e)&&S.emit("edits",{layer:e,event:p})),s(p),d}catch(d){throw l(d),d}}async function G(e,t,a,n){if(await e.load(),!U(t))throw new i(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!e.editingEnabled)throw new i(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:s,options:l}=await T(e,a,n);return s.addFeatures.length||s.updateFeatures.length||s.deleteFeatures.length||s.addAttachments.length||s.updateAttachments.length||s.deleteAttachments.length?{edits:s,results:await t.applyEdits(s,l)}:{edits:s,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function T(e,t,a){const n=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),s=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),l=h(e.infoFor3D);if(!t||!n&&!s)throw new i(`${e.type}-layer:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!e.capabilities.data.isVersioned&&a&&a.gdbVersion)throw new i(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!e.capabilities.editing.supportsRollbackOnFailure&&a&&a.rollbackOnFailureEnabled)throw new i(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");if(!e.capabilities.editing.supportsGlobalId&&a&&a.globalIdUsed)throw new i(`${e.type}-layer:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!e.capabilities.editing.supportsGlobalId&&s)throw new i(`${e.type}-layer:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if((!a||!a.globalIdUsed)&&s)throw new i(`${e.type}-layer:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true");const o={...a};if(o.rollbackOnFailureEnabled!=null||e.capabilities.editing.supportsRollbackOnFailure||(o.rollbackOnFailureEnabled=!0),o.rollbackOnFailureEnabled===!1&&o.returnServiceEditsOption==="original-and-current-features")throw new i(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true.");if(!e.capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference&&o.returnServiceEditsInSourceSR)throw new i(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(o.returnServiceEditsInSourceSR&&o.returnServiceEditsOption!=="original-and-current-features")throw new i(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsOption' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const r={...t};if(r.addFeatures=t&&m.isCollection(t.addFeatures)?t.addFeatures.toArray():r.addFeatures||[],r.updateFeatures=t&&m.isCollection(t.updateFeatures)?t.updateFeatures.toArray():r.updateFeatures||[],r.deleteFeatures=t&&m.isCollection(t.deleteFeatures)?t.deleteFeatures.toArray():r.deleteFeatures||[],r.addFeatures.length&&!e.capabilities.operations.supportsAdd)throw new i(`${e.type}-layer:unsupported-operation`,"Layer does not support adding features.");if(r.updateFeatures.length&&!e.capabilities.operations.supportsUpdate)throw new i(`${e.type}-layer:unsupported-operation`,"Layer does not support updating features.");if(r.deleteFeatures.length&&!e.capabilities.operations.supportsDelete)throw new i(`${e.type}-layer:unsupported-operation`,"Layer does not support deleting features.");r.addAttachments=r.addAttachments||[],r.updateAttachments=r.updateAttachments||[],r.deleteAttachments=r.deleteAttachments||[],r.addFeatures=r.addFeatures.map(b),r.updateFeatures=r.updateFeatures.map(b),r.addAssets=[];const d=a&&a.globalIdUsed||l;return r.addFeatures.forEach(u=>k(u,e,d)),r.updateFeatures.forEach(u=>x(u,e,d)),r.deleteFeatures.forEach(u=>B(u,e,d)),r.addAttachments.forEach(u=>g(u,e)),r.updateAttachments.forEach(u=>g(u,e)),l&&await _(r,e),{edits:await D(r),options:o}}function f(e,t,a){if(a){if("attributes"in e&&!e.attributes[t.globalIdField])throw new i(`${t.type}-layer:invalid-parameter`,"Feature should have 'globalId' when 'globalIdUsed' is true");if(!("attributes"in e)&&!e.globalId)throw new i(`${t.type}-layer:invalid-parameter`,"'globalId' of the feature should be passed when 'globalIdUsed' is true")}if("geometry"in e&&h(e.geometry)){if(e.geometry.hasZ&&t.capabilities.data.supportsZ===!1)throw new i(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&t.capabilities.data.supportsM===!1)throw new i(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function k(e,t,a){f(e,t,a)}function B(e,t,a){f(e,t,a)}function x(e,t,a){if(f(e,t,a),"geometry"in e&&h(e.geometry)&&!t.capabilities.editing.supportsGeometryUpdate)throw new i(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function g(e,t){const{feature:a,attachment:n}=e;if(!a||"attributes"in a&&!a.attributes[t.globalIdField])throw new i(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in a)&&!a.globalId)throw new i(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!n.globalId)throw new i(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!n.data&&!n.uploadId)throw new i(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(n.data instanceof File&&!!n.data.name)&&!n.name)throw new i(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities.editing.supportsUploadWithItemId&&n.uploadId)throw new i(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if(typeof n.data=="string"){const s=R(n.data);if(s&&!s.isBase64)throw new i(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}async function D(e){const t=e.addFeatures,a=e.updateFeatures,n=t.concat(a).map(r=>r.geometry),s=await O(n),l=t.length,o=a.length;return s.slice(0,l).forEach((r,d)=>e.addFeatures[d].geometry=r),s.slice(l,l+o).forEach((r,d)=>e.updateFeatures[d].geometry=r),e}function b(e){const t=new $;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}async function _(e,t){if(w(t.infoFor3D))return;const{infoFor3D:a}=t;let n=!1;for(const o of a.editFormats)if(o===y.GLTF_BINARY){n=!0;break}const s=[];for(const o of e.addFeatures)s.push(F(o,e,t,n));for(const o of e.updateFeatures)s.push(F(o,e,t,n));const l=await Promise.allSettled(s);for(const o of l)if(o.status==="rejected")throw o.reason}async function F(e,t,a,n){if(w(e.geometry)||e.geometry.type!=="mesh")return;const s=e.geometry,l=a.globalIdField;if(h(a.parsedUrl)&&h(s.external)&&Array.isArray(s.external.source)&&s.external.source.length===1&&"source"in s.external.source[0]&&typeof s.external.source[0].source=="string"&&s.external.source[0].source.startsWith(a.parsedUrl.path))return;if(!n)throw new i(`${a.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");const o=await s.toBinaryGLTF(),r=await o.buffer(),d=`{${L()}}`,u=`${d}.glb`;t.addAssets.push({featureGlobalId:e.getAttribute(l),assetMapGlobalId:d,assetName:u,flags:0,data:r.data,mimeType:r.type,assetType:y.GLTF_BINARY,feature:e})}export{j as applyEdits}; +import{b4 as I,h$ as E,i0 as S,n as i,c as h,cE as m,cv as R,e2 as O,d1 as $,j as w,i1 as L}from"./index.221827cd.js";var y;(function(e){e.GLTF_BINARY="3D_glb",e.GLTF_JSON="3D_gltf"})(y||(y={}));function U(e){return e&&e.applyEdits!=null}async function j(e,t,a,n={}){var r;let s,l;const o={edits:a,result:new Promise((d,u)=>{s=d,l=u})};e.emit("apply-edits",o);try{const{results:d,edits:u}=await G(e,t,a,n),c=A=>A.filter(v=>!v.error).map(I),p={edits:u,addedFeatures:c(d.addFeatureResults),updatedFeatures:c(d.updateFeatureResults),deletedFeatures:c(d.deleteFeatureResults),addedAttachments:c(d.addAttachmentResults),updatedAttachments:c(d.updateAttachmentResults),deletedAttachments:c(d.deleteAttachmentResults)};return(r=d.editedFeatureResults)!=null&&r.length&&(p.editedFeatures=d.editedFeatureResults),(p.addedFeatures.length||p.updatedFeatures.length||p.deletedFeatures.length||p.addedAttachments.length||p.updatedAttachments.length||p.deletedAttachments.length)&&(e.emit("edits",p),E(e)&&S.emit("edits",{layer:e,event:p})),s(p),d}catch(d){throw l(d),d}}async function G(e,t,a,n){if(await e.load(),!U(t))throw new i(`${e.type}-layer:no-editing-support`,"Layer source does not support applyEdits capability",{layer:e});if(!e.editingEnabled)throw new i(`${e.type}-layer:editing-disabled`,"Editing is disabled for layer",{layer:e});const{edits:s,options:l}=await T(e,a,n);return s.addFeatures.length||s.updateFeatures.length||s.deleteFeatures.length||s.addAttachments.length||s.updateAttachments.length||s.deleteAttachments.length?{edits:s,results:await t.applyEdits(s,l)}:{edits:s,results:{addFeatureResults:[],updateFeatureResults:[],deleteFeatureResults:[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}}async function T(e,t,a){const n=t&&(t.addFeatures||t.updateFeatures||t.deleteFeatures),s=t&&(t.addAttachments||t.updateAttachments||t.deleteAttachments),l=h(e.infoFor3D);if(!t||!n&&!s)throw new i(`${e.type}-layer:missing-parameters`,"'addFeatures', 'updateFeatures', 'deleteFeatures', 'addAttachments', 'updateAttachments' or 'deleteAttachments' parameter is required");if(!e.capabilities.data.isVersioned&&a&&a.gdbVersion)throw new i(`${e.type}-layer:invalid-parameter`,"'gdbVersion' is applicable only if the layer supports versioned data. See: 'capabilities.data.isVersioned'");if(!e.capabilities.editing.supportsRollbackOnFailure&&a&&a.rollbackOnFailureEnabled)throw new i(`${e.type}-layer:invalid-parameter`,"This layer does not support 'rollbackOnFailureEnabled' parameter. See: 'capabilities.editing.supportsRollbackOnFailure'");if(!e.capabilities.editing.supportsGlobalId&&a&&a.globalIdUsed)throw new i(`${e.type}-layer:invalid-parameter`,"This layer does not support 'globalIdUsed' parameter. See: 'capabilities.editing.supportsGlobalId'");if(!e.capabilities.editing.supportsGlobalId&&s)throw new i(`${e.type}-layer:invalid-parameter`,"'addAttachments', 'updateAttachments' and 'deleteAttachments' are applicable only if the layer supports global ids. See: 'capabilities.editing.supportsGlobalId'");if((!a||!a.globalIdUsed)&&s)throw new i(`${e.type}-layer:invalid-parameter`,"When 'addAttachments', 'updateAttachments' or 'deleteAttachments' is specified, globalIdUsed should be set to true");const o={...a};if(o.rollbackOnFailureEnabled!=null||e.capabilities.editing.supportsRollbackOnFailure||(o.rollbackOnFailureEnabled=!0),o.rollbackOnFailureEnabled===!1&&o.returnServiceEditsOption==="original-and-current-features")throw new i(`${e.type}-layer:invalid-parameter`,"'original-and-current-features' is valid for 'returnServiceEditsOption' only when 'rollBackOnFailure' is true.");if(!e.capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference&&o.returnServiceEditsInSourceSR)throw new i(`${e.type}-layer:invalid-parameter`,"This layer does not support 'returnServiceEditsInSourceSR' parameter. See: 'capabilities.editing.supportsReturnServiceEditsInSourceSpatialReference'");if(o.returnServiceEditsInSourceSR&&o.returnServiceEditsOption!=="original-and-current-features")throw new i(`${e.type}-layer:invalid-parameter`,"'returnServiceEditsOption' is valid only when 'returnServiceEditsOption' is set to 'original-and-current-features'");const r={...t};if(r.addFeatures=t&&m.isCollection(t.addFeatures)?t.addFeatures.toArray():r.addFeatures||[],r.updateFeatures=t&&m.isCollection(t.updateFeatures)?t.updateFeatures.toArray():r.updateFeatures||[],r.deleteFeatures=t&&m.isCollection(t.deleteFeatures)?t.deleteFeatures.toArray():r.deleteFeatures||[],r.addFeatures.length&&!e.capabilities.operations.supportsAdd)throw new i(`${e.type}-layer:unsupported-operation`,"Layer does not support adding features.");if(r.updateFeatures.length&&!e.capabilities.operations.supportsUpdate)throw new i(`${e.type}-layer:unsupported-operation`,"Layer does not support updating features.");if(r.deleteFeatures.length&&!e.capabilities.operations.supportsDelete)throw new i(`${e.type}-layer:unsupported-operation`,"Layer does not support deleting features.");r.addAttachments=r.addAttachments||[],r.updateAttachments=r.updateAttachments||[],r.deleteAttachments=r.deleteAttachments||[],r.addFeatures=r.addFeatures.map(b),r.updateFeatures=r.updateFeatures.map(b),r.addAssets=[];const d=a&&a.globalIdUsed||l;return r.addFeatures.forEach(u=>k(u,e,d)),r.updateFeatures.forEach(u=>x(u,e,d)),r.deleteFeatures.forEach(u=>B(u,e,d)),r.addAttachments.forEach(u=>g(u,e)),r.updateAttachments.forEach(u=>g(u,e)),l&&await _(r,e),{edits:await D(r),options:o}}function f(e,t,a){if(a){if("attributes"in e&&!e.attributes[t.globalIdField])throw new i(`${t.type}-layer:invalid-parameter`,"Feature should have 'globalId' when 'globalIdUsed' is true");if(!("attributes"in e)&&!e.globalId)throw new i(`${t.type}-layer:invalid-parameter`,"'globalId' of the feature should be passed when 'globalIdUsed' is true")}if("geometry"in e&&h(e.geometry)){if(e.geometry.hasZ&&t.capabilities.data.supportsZ===!1)throw new i(`${t.type}-layer:z-unsupported`,"Layer does not support z values while feature has z values.");if(e.geometry.hasM&&t.capabilities.data.supportsM===!1)throw new i(`${t.type}-layer:m-unsupported`,"Layer does not support m values while feature has m values.")}}function k(e,t,a){f(e,t,a)}function B(e,t,a){f(e,t,a)}function x(e,t,a){if(f(e,t,a),"geometry"in e&&h(e.geometry)&&!t.capabilities.editing.supportsGeometryUpdate)throw new i(`${t.type}-layer:unsupported-operation`,"Layer does not support geometry updates.")}function g(e,t){const{feature:a,attachment:n}=e;if(!a||"attributes"in a&&!a.attributes[t.globalIdField])throw new i(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to a feature with 'globalId'");if(!("attributes"in a)&&!a.globalId)throw new i(`${t.type}-layer:invalid-parameter`,"Attachment should have reference to 'globalId' of the parent feature");if(!n.globalId)throw new i(`${t.type}-layer:invalid-parameter`,"Attachment should have 'globalId'");if(!n.data&&!n.uploadId)throw new i(`${t.type}-layer:invalid-parameter`,"Attachment should have 'data' or 'uploadId'");if(!(n.data instanceof File&&!!n.data.name)&&!n.name)throw new i(`${t.type}-layer:invalid-parameter`,"'name' is required when attachment is specified as Base64 encoded string using 'data'");if(!t.capabilities.editing.supportsUploadWithItemId&&n.uploadId)throw new i(`${t.type}-layer:invalid-parameter`,"This layer does not support 'uploadId' parameter. See: 'capabilities.editing.supportsUploadWithItemId'");if(typeof n.data=="string"){const s=R(n.data);if(s&&!s.isBase64)throw new i(`${t.type}-layer:invalid-parameter`,"Attachment 'data' should be a Blob, File or Base64 encoded string")}}async function D(e){const t=e.addFeatures,a=e.updateFeatures,n=t.concat(a).map(r=>r.geometry),s=await O(n),l=t.length,o=a.length;return s.slice(0,l).forEach((r,d)=>e.addFeatures[d].geometry=r),s.slice(l,l+o).forEach((r,d)=>e.updateFeatures[d].geometry=r),e}function b(e){const t=new $;return e.attributes||(e.attributes={}),t.geometry=e.geometry,t.attributes=e.attributes,t}async function _(e,t){if(w(t.infoFor3D))return;const{infoFor3D:a}=t;let n=!1;for(const o of a.editFormats)if(o===y.GLTF_BINARY){n=!0;break}const s=[];for(const o of e.addFeatures)s.push(F(o,e,t,n));for(const o of e.updateFeatures)s.push(F(o,e,t,n));const l=await Promise.allSettled(s);for(const o of l)if(o.status==="rejected")throw o.reason}async function F(e,t,a,n){if(w(e.geometry)||e.geometry.type!=="mesh")return;const s=e.geometry,l=a.globalIdField;if(h(a.parsedUrl)&&h(s.external)&&Array.isArray(s.external.source)&&s.external.source.length===1&&"source"in s.external.source[0]&&typeof s.external.source[0].source=="string"&&s.external.source[0].source.startsWith(a.parsedUrl.path))return;if(!n)throw new i(`${a.type}-layer:binary-gltf-asset-not-supported`,"3DObjectFeatureLayer requires binary glTF (.glb) support for updating mesh geometry.");const o=await s.toBinaryGLTF(),r=await o.buffer(),d=`{${L()}}`,u=`${d}.glb`;t.addAssets.push({featureGlobalId:e.getAttribute(l),assetMapGlobalId:d,assetName:u,flags:0,data:r.data,mimeType:r.type,assetType:y.GLTF_BINARY,feature:e})}export{j as applyEdits}; diff --git a/assets/executeForIds.bade5c1b.js b/assets/executeForIds.9f78e2a6.js similarity index 76% rename from assets/executeForIds.bade5c1b.js rename to assets/executeForIds.9f78e2a6.js index 10e2160..cf92e7a 100644 --- a/assets/executeForIds.bade5c1b.js +++ b/assets/executeForIds.9f78e2a6.js @@ -1 +1 @@ -import{dQ as r,gp as d,dd as c,hW as e}from"./index.d94abe07.js";async function p(n,t,o){const a=r(n);return d(a,c.from(t),{...o}).then(s=>s.data.count)}async function u(n,t,o){const a=r(n);return e(a,c.from(t),{...o}).then(s=>s.data.objectIds)}export{p as n,u as s}; +import{dQ as r,gp as d,dd as c,hW as e}from"./index.221827cd.js";async function p(n,t,o){const a=r(n);return d(a,c.from(t),{...o}).then(s=>s.data.count)}async function u(n,t,o){const a=r(n);return e(a,c.from(t),{...o}).then(s=>s.data.objectIds)}export{p as n,u as s}; diff --git a/assets/featureLayerUtils.37a0188b.js b/assets/featureLayerUtils.878164f5.js similarity index 95% rename from assets/featureLayerUtils.37a0188b.js rename to assets/featureLayerUtils.878164f5.js index bc1aa97..36a8969 100644 --- a/assets/featureLayerUtils.37a0188b.js +++ b/assets/featureLayerUtils.878164f5.js @@ -1 +1 @@ -import{s as K,dn as m,hX as D,n,hY as F,hZ as R,cB as _,j,cD as Y,bW as q,cy as z,c as $,h_ as B}from"./index.d94abe07.js";import{i as w}from"./originUtils.2d0aad75.js";import{r as M}from"./fetchService.36bd4782.js";import{o as h}from"./jsonContext.3176ed6f.js";import{i as f,a as U,c as g,f as d}from"./portalItemUtils.57ded807.js";import"./multiOriginJSONSupportUtils.38b69b9c.js";const C=K.getLogger("esri.layers.FeatureLayer"),y="Feature Service";function c(a,e){return`Layer (title: ${a.title}, id: ${a.id}) of type '${a.declaredClass}' ${e}`}function N(a,e){if(e.type!==y)throw new n("feature-layer:portal-item-wrong-type",c(a,`should have portal item of type "${y}"`))}async function O(a){if(await a.load(),D(a))throw new n("feature-layer:save",c(a,"using an in-memory source cannot be saved to a portal item"))}function G(a,e){var r;let t=((r=a.messages)!=null?r:[]).filter(({type:s})=>s==="error").map(({name:s,message:o,details:l})=>new n(s,o,l));if(e!=null&&e.ignoreUnsupported&&(t=t.filter(({name:s})=>s!=="layer:unsupported"&&s!=="symbol:unsupported"&&s!=="symbol-layer:unsupported"&&s!=="property:unsupported"&&s!=="url:unsupported")),t.length>0)throw new n("feature-layer:save","Failed to save feature layer due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:t})}async function v(a,e,t){"beforeSave"in a&&typeof a.beforeSave=="function"&&await a.beforeSave();const r=a.write({},e);return G(e,t),r}function x(a){const{layer:e,layerJSON:t}=a;return e.isTable?{layers:[],tables:[t]}:{layers:[t],tables:[]}}function b(a){f(a,d.JSAPI),a.typeKeywords&&(a.typeKeywords=a.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t))}function Z(a){const e=a.portalItem;if(!e)throw C.error("save: requires the portalItem property to be set"),new n("feature-layer:portal-item-not-set",c(a,"requires the portalItem property to be set"));if(!e.loaded)throw new n("feature-layer:portal-item-not-loaded",c(a,"cannot be saved to a portal item that does not exist or is inaccessible"));N(a,e)}async function E(a,e){var t;return/\/\d+\/?$/.test((t=a.url)!=null?t:"")?x(e[0]):W(a,e)}async function W(a,e){const{layer:{url:t,customParameters:r,apiKey:s}}=e[0];let o=await a.fetchData("json");o&&o.layers!=null&&o.tables!=null||(o=await X(o,{url:t!=null?t:"",customParameters:r,apiKey:s},e.map(l=>l.layer.layerId)));for(const l of e)P(l.layer,l.layerJSON,o);return o}async function X(a,e,t){var r,s;a||(a={}),(r=a).layers||(r.layers=[]),(s=a).tables||(s.tables=[]);const{url:o,customParameters:l,apiKey:i}=e,{serviceJSON:u,layersJSON:p}=await M(o,{customParameters:l,apiKey:i}),I=A(a.layers,u.layers,t),S=A(a.tables,u.tables,t);a.layers=I.itemResources,a.tables=S.itemResources;const T=[...I.added,...S.added],L=p?[...p.layers,...p.tables]:[];return await k(a,T,o,L),a}function A(a,e,t){const r=F(a,e,(o,l)=>o.id===l.id);a=a.filter(o=>!r.removed.some(l=>l.id===o.id));const s=r.added.map(({id:o})=>({id:o}));return s.forEach(({id:o})=>{a.push({id:o})}),{itemResources:a,added:s.filter(({id:o})=>!t.includes(o))}}async function k(a,e,t,r){const s=e.map(({id:o})=>new R({url:t,layerId:o,sourceJSON:r.find(({id:l})=>l===o)}));await _(s.map(o=>o.load())),s.forEach(o=>{const{layerId:l,loaded:i,defaultPopupTemplate:u}=o;!i||j(u)||P(o,{id:l,popupInfo:u.toJSON()},a)})}function P(a,e,t){a.isTable?J(t.tables,e):J(t.layers,e)}function J(a,e){if(!a)return;const t=a.findIndex(({id:r})=>r===e.id);t===-1?a.push(e):a[t]=e}function H(a){const{portalItem:e}=a;return B(a)&&!a.dynamicDataSource&&!!(e!=null&&e.loaded)&&e.type===y}async function Q(a){if(!(a!=null&&a.length))throw new n("feature-layer-utils-saveall:missing-parameters","'layers' array should contain at least one feature layer");await Promise.all(a.map(r=>r.load()));for(const r of a)if(!H(r))throw new n("feature-layer-utils-saveall:invalid-parameters",`'layers' array should only contain layers or tables in a feature service loaded from 'Feature Service' item. ${c(r,"does not conform")}`,{layer:r});const e=a.map(r=>r.portalItem.id);if(new Set(e).size>1)throw new n("feature-layer-utils-saveall:invalid-parameters","All layers in the 'layers' array should be loaded from the same portal item");const t=a.map(r=>r.layerId);if(new Set(t).size!==t.length)throw new n("feature-layer-utils-saveall:invalid-parameters","'layers' array should contain only one instance each of layer or table in a feature service")}function V(a,e){var o,l;var t,r;let s=Y.from(e);return s.id&&(s=s.clone(),s.id=null),(o=(t=s).type)!=null||(t.type=y),(l=(r=s).portal)!=null||(r.portal=q.getDefault()),N(a,s),s}async function aa(a,e){const{url:t,layerId:r,title:s,fullExtent:o,isTable:l}=a,i=z(t),u=$(i)&&i.serverType==="FeatureServer";e.url=u?t:`${t}/${r}`,e.title||(e.title=s),e.extent=null,!l&&$(o)&&(e.extent=await U(o)),g(e,d.METADATA),g(e,d.MULTI_LAYER),f(e,d.SINGLE_LAYER),l&&f(e,d.TABLE),b(e)}async function ea(a,e,t){var s;const r=a.portal;await(r==null?void 0:r._signIn()),await((s=r==null?void 0:r.user)==null?void 0:s.addItem({item:a,data:e,folder:t==null?void 0:t.folder}))}const da=m(ta);async function ta(a,e){await O(a),Z(a);const t=a.portalItem,r=h(t),s=await v(a,r,e),o=await E(t,[{layer:a,layerJSON:s}]);return b(t),await t.update({data:o}),w(r),t}const ca=m(async(a,e)=>{await Q(a);const t=a[0].portalItem,r=h(t),s=await Promise.all(a.map(l=>v(l,r,e))),o=await E(t,a.map((l,i)=>({layer:l,layerJSON:s[i]})));return b(t),await t.update({data:o}),await Promise.all(a.slice(1).map(l=>l.portalItem.reload())),w(r),t.clone()}),ya=m(ra);async function ra(a,e,t){await O(a);const r=V(a,e),s=h(r),o=x({layer:a,layerJSON:await v(a,s,t)});return await aa(a,r),await ea(r,o,t),a.portalItem=r,w(s),r}export{da as save,ca as saveAll,ya as saveAs}; +import{s as K,dn as m,hX as D,n,hY as F,hZ as R,cB as _,j,cD as Y,bW as q,cy as z,c as $,h_ as B}from"./index.221827cd.js";import{i as w}from"./originUtils.2d0aad75.js";import{r as M}from"./fetchService.88193309.js";import{o as h}from"./jsonContext.fe51f9bd.js";import{i as f,a as U,c as g,f as d}from"./portalItemUtils.92eef7f6.js";import"./multiOriginJSONSupportUtils.38b69b9c.js";const C=K.getLogger("esri.layers.FeatureLayer"),y="Feature Service";function c(a,e){return`Layer (title: ${a.title}, id: ${a.id}) of type '${a.declaredClass}' ${e}`}function N(a,e){if(e.type!==y)throw new n("feature-layer:portal-item-wrong-type",c(a,`should have portal item of type "${y}"`))}async function O(a){if(await a.load(),D(a))throw new n("feature-layer:save",c(a,"using an in-memory source cannot be saved to a portal item"))}function G(a,e){var r;let t=((r=a.messages)!=null?r:[]).filter(({type:s})=>s==="error").map(({name:s,message:o,details:l})=>new n(s,o,l));if(e!=null&&e.ignoreUnsupported&&(t=t.filter(({name:s})=>s!=="layer:unsupported"&&s!=="symbol:unsupported"&&s!=="symbol-layer:unsupported"&&s!=="property:unsupported"&&s!=="url:unsupported")),t.length>0)throw new n("feature-layer:save","Failed to save feature layer due to unsupported or invalid content. See 'details.errors' for more detailed information",{errors:t})}async function v(a,e,t){"beforeSave"in a&&typeof a.beforeSave=="function"&&await a.beforeSave();const r=a.write({},e);return G(e,t),r}function x(a){const{layer:e,layerJSON:t}=a;return e.isTable?{layers:[],tables:[t]}:{layers:[t],tables:[]}}function b(a){f(a,d.JSAPI),a.typeKeywords&&(a.typeKeywords=a.typeKeywords.filter((e,t,r)=>r.indexOf(e)===t))}function Z(a){const e=a.portalItem;if(!e)throw C.error("save: requires the portalItem property to be set"),new n("feature-layer:portal-item-not-set",c(a,"requires the portalItem property to be set"));if(!e.loaded)throw new n("feature-layer:portal-item-not-loaded",c(a,"cannot be saved to a portal item that does not exist or is inaccessible"));N(a,e)}async function E(a,e){var t;return/\/\d+\/?$/.test((t=a.url)!=null?t:"")?x(e[0]):W(a,e)}async function W(a,e){const{layer:{url:t,customParameters:r,apiKey:s}}=e[0];let o=await a.fetchData("json");o&&o.layers!=null&&o.tables!=null||(o=await X(o,{url:t!=null?t:"",customParameters:r,apiKey:s},e.map(l=>l.layer.layerId)));for(const l of e)P(l.layer,l.layerJSON,o);return o}async function X(a,e,t){var r,s;a||(a={}),(r=a).layers||(r.layers=[]),(s=a).tables||(s.tables=[]);const{url:o,customParameters:l,apiKey:i}=e,{serviceJSON:u,layersJSON:p}=await M(o,{customParameters:l,apiKey:i}),I=A(a.layers,u.layers,t),S=A(a.tables,u.tables,t);a.layers=I.itemResources,a.tables=S.itemResources;const T=[...I.added,...S.added],L=p?[...p.layers,...p.tables]:[];return await k(a,T,o,L),a}function A(a,e,t){const r=F(a,e,(o,l)=>o.id===l.id);a=a.filter(o=>!r.removed.some(l=>l.id===o.id));const s=r.added.map(({id:o})=>({id:o}));return s.forEach(({id:o})=>{a.push({id:o})}),{itemResources:a,added:s.filter(({id:o})=>!t.includes(o))}}async function k(a,e,t,r){const s=e.map(({id:o})=>new R({url:t,layerId:o,sourceJSON:r.find(({id:l})=>l===o)}));await _(s.map(o=>o.load())),s.forEach(o=>{const{layerId:l,loaded:i,defaultPopupTemplate:u}=o;!i||j(u)||P(o,{id:l,popupInfo:u.toJSON()},a)})}function P(a,e,t){a.isTable?J(t.tables,e):J(t.layers,e)}function J(a,e){if(!a)return;const t=a.findIndex(({id:r})=>r===e.id);t===-1?a.push(e):a[t]=e}function H(a){const{portalItem:e}=a;return B(a)&&!a.dynamicDataSource&&!!(e!=null&&e.loaded)&&e.type===y}async function Q(a){if(!(a!=null&&a.length))throw new n("feature-layer-utils-saveall:missing-parameters","'layers' array should contain at least one feature layer");await Promise.all(a.map(r=>r.load()));for(const r of a)if(!H(r))throw new n("feature-layer-utils-saveall:invalid-parameters",`'layers' array should only contain layers or tables in a feature service loaded from 'Feature Service' item. ${c(r,"does not conform")}`,{layer:r});const e=a.map(r=>r.portalItem.id);if(new Set(e).size>1)throw new n("feature-layer-utils-saveall:invalid-parameters","All layers in the 'layers' array should be loaded from the same portal item");const t=a.map(r=>r.layerId);if(new Set(t).size!==t.length)throw new n("feature-layer-utils-saveall:invalid-parameters","'layers' array should contain only one instance each of layer or table in a feature service")}function V(a,e){var o,l;var t,r;let s=Y.from(e);return s.id&&(s=s.clone(),s.id=null),(o=(t=s).type)!=null||(t.type=y),(l=(r=s).portal)!=null||(r.portal=q.getDefault()),N(a,s),s}async function aa(a,e){const{url:t,layerId:r,title:s,fullExtent:o,isTable:l}=a,i=z(t),u=$(i)&&i.serverType==="FeatureServer";e.url=u?t:`${t}/${r}`,e.title||(e.title=s),e.extent=null,!l&&$(o)&&(e.extent=await U(o)),g(e,d.METADATA),g(e,d.MULTI_LAYER),f(e,d.SINGLE_LAYER),l&&f(e,d.TABLE),b(e)}async function ea(a,e,t){var s;const r=a.portal;await(r==null?void 0:r._signIn()),await((s=r==null?void 0:r.user)==null?void 0:s.addItem({item:a,data:e,folder:t==null?void 0:t.folder}))}const da=m(ta);async function ta(a,e){await O(a),Z(a);const t=a.portalItem,r=h(t),s=await v(a,r,e),o=await E(t,[{layer:a,layerJSON:s}]);return b(t),await t.update({data:o}),w(r),t}const ca=m(async(a,e)=>{await Q(a);const t=a[0].portalItem,r=h(t),s=await Promise.all(a.map(l=>v(l,r,e))),o=await E(t,a.map((l,i)=>({layer:l,layerJSON:s[i]})));return b(t),await t.update({data:o}),await Promise.all(a.slice(1).map(l=>l.portalItem.reload())),w(r),t.clone()}),ya=m(ra);async function ra(a,e,t){await O(a);const r=V(a,e),s=h(r),o=x({layer:a,layerJSON:await v(a,s,t)});return await aa(a,r),await ea(r,o,t),a.portalItem=r,w(s),r}export{da as save,ca as saveAll,ya as saveAs}; diff --git a/assets/featureSetUtils.f1157478.js b/assets/featureSetUtils.e062de4c.js similarity index 99% rename from assets/featureSetUtils.f1157478.js rename to assets/featureSetUtils.e062de4c.js index bcb491a..b2c619b 100644 --- a/assets/featureSetUtils.f1157478.js +++ b/assets/featureSetUtils.e062de4c.js @@ -1 +1 @@ -import{aT as se,hD as we,ba as V,cN as Fe,d1 as q,ci as Se,gG as B,ky as pe,kz as _e,dd as O,gl as be,gm as Ie,d3 as Ce,gY as De,kA as de,hZ as R,U as j,c9 as ve,iY as he,dS as H,iW as Re,cY as ke,hO as ce,bW as xe,cD as Te}from"./index.d94abe07.js";import{C as L,t as y,i as P,o as C,n as D,c as K,s as v,l as Ne,d as Ae,f as Y,a as T,b as N,N as Le,y as ye,e as Oe,w as z,p as Pe,g as G,m as Ee,h as qe,j as g}from"./SpatialFilter.dc70612a.js";import{$ as ie,a0 as S,a1 as je,a2 as k,v as Ge,a3 as J,a4 as re,a5 as Be,a6 as $,J as Ue,a7 as We}from"./arcadeUtils.9e078218.js";import{WhereClause as A}from"./WhereClause.253310fe.js";import{n as Me,s as Qe}from"./executeForIds.bade5c1b.js";class ge{constructor(){this.declaredRootClass="esri.arcade.featureSetCollection",this._layerById={},this._layerByName={}}add(e,t,s){this._layerById[t]=s,this._layerByName[e]=s}async featureSetByName(e,t=!0,s=["*"]){return this._layerByName[e]===void 0?null:this._layerByName[e]}async featureSetById(e,t=!0,s=["*"]){return this._layerById[e]===void 0?null:this._layerById[e]}castToText(e=!1){return"object, FeatureSetCollection"}}class U extends L{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.actions.AttributeFilter",this._maxProcessing=1e3,this._parent=e.parentfeatureset,e.whereclause instanceof A?(this._whereclause=e.whereclause,this._whereClauseFunction=null):(this._whereClauseFunction=e.whereclause,this._whereclause=null)}_initialiseFeatureSet(){this._parent!==null?(this.fields=this._parent.fields.slice(0),this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.fields=[],this.typeIdField="",this.objectIdField="",this.globalIdField="",this.spatialReference=new se({wkid:4326}),this.geometryType=ie.point)}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._parent._getFilteredSet("",null,this._whereclause,null,e);return this._checkCancelled(e),this._whereClauseFunction!==null?this._wset=new y(t._candidates.slice(0).concat(t._known.slice(0)),[],t._ordered,this._clonePageDefinition(t.pagesDefinition)):this._wset=new y(t._candidates.slice(0),t._known.slice(0),t._ordered,this._clonePageDefinition(t.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){var s;let t=(s=this._parent)==null?void 0:s._isInFeatureSet(e);return t===S.NotInFeatureSet?t:(t=this._idstates[e],t===void 0?S.Unknown:t)}_getFeature(e,t,s){return this._parent._getFeature(e,t,s)}_getFeatures(e,t,s,i){return this._parent._getFeatures(e,t,s,i)}_featureFromCache(e){return this._parent._featureFromCache(e)}executeWhereClause(e){var t,s;return(s=(t=this._whereclause)==null?void 0:t.testFeature(e))!=null?s:!1}async executeWhereClauseDeferred(e){if(this._whereClauseFunction!==null){const t=this._whereClauseFunction(e);return we(t),t}return this.executeWhereClause(e)}async _fetchAndRefineFeatures(e,t,s){var n,l,u;const i=new y([],e,!1,null),r=Math.min(t,e.length);if(await((n=this._parent)==null?void 0:n._getFeatures(i,-1,r,s)),this._checkCancelled(s),this._whereClauseFunction==null){for(let o=0;o":case"=":if(e.left.type==="column-reference"&&e.right.type==="string"){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&this.lkp[e.right.value.toString()]!==void 0)return" ("+i+" "+e.operator+" "+this.lkp[e.right.value.toString()].toString()+") "}else if(e.right.type==="column-reference"&&e.left.type==="string"&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return" ("+this.lkp[e.right.value.toString()].toString()+" "+e.operator+" "+i+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,s,w.BADNESS,r)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,s,w.BADNESS,r)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":return" ("+this.evaluateNodeToWhereClause(e.left,t,s,w.BADNESS,r)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,s,w.BADNESS,r)+") "}case"null":return"null";case"boolean":return e.value===!0?"1":"0";case"string":return"'"+e.value.toString().replace(/'/g,"''")+"'";case"timestamp":case"date":return Y(e.value,t);case"number":return e.value.toString();case"current-time":return Ae(e.mode==="date",t);case"column-reference":return s&&s.toLowerCase()===e.column.toLowerCase()?"("+i+")":e.column;case"function":{const o=this.evaluateNodeToWhereClause(e.args,t,s,w.BADNESS,r);return Ne(e.name,o,t)}}throw new T(N.UnsupportedSyntax,{node:e.type})}extractValue(e){return this.codefield instanceof A?this.reverseLkp[this.codefield.calculateValueCompiled(e)]:this.reverseLkp[e.attributes[this.codefield]]}}w.BADNESS="_!!!_BAD_LKP_!!!!";class Je extends X{constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:K(e,this.field.name,v(this._sql,k.Standardised),t.getFieldsIndex())}}extractValue(e){return this._sql.calculateValueCompiled(e)}}class Ke extends L{constructor(e){super(e),this._calcFunc=null,this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=[],this._extraFilter=null,this._extraFilter=e.extraFilter,this._parent=e.parentfeatureset,this._maxProcessing=30,this.adaptedFields=e.adaptedFields}static findField(e,t){for(const s of e)if(s.name.toLowerCase()===t.toString().toLowerCase())return s;return null}_initialiseFeatureSet(){this._parent!==null?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.spatialReference=new se({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=ie.point,this.typeIdField="",this.types=null),this.fields=[];for(const e of this.adaptedFields)e.postInitialization(this,this._parent),this.fields.push(e.field)}async _getSet(e){var t;if(this._wset===null){await this._ensureLoaded();let s=null;return s=this._extraFilter?await this._getFilteredSet("",null,null,null,e):await((t=this._parent)==null?void 0:t._getSet(e)),this._checkCancelled(e),Fe(s),this._wset=new y(s._candidates.slice(0),s._known.slice(0),s._ordered,this._clonePageDefinition(s.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){return V(this._parent)._isInFeatureSet(e)}async _getFeatures(e,t,s,i){var o,d;const r=[];t!==-1&&this._featureCache[t]===void 0&&r.push(t);const a=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(e,a)===!0)return await this._expandPagedSet(e,a,0,0,i),this._getFeatures(e,t,s,i);let n=0;for(let h=e._lastFetchedIndex;h=a)));h++);if(r.length===0)return"success";e=new y([],r,e._ordered,null);const l=Math.min(r.length,s);await((o=this._parent)==null?void 0:o._getFeatures(e,-1,l,i)),this._checkCancelled(i);const u=[];for(let h=0;h0&&(i=i.replaceFields(d))}s!==null?this._extraFilter!==null&&(s=P(this._extraFilter,s)):s=this._extraFilter,await this._ensureLoaded();const u=await V(this._parent)._getFilteredSet(e,t,s,i,r);let o;return this._checkCancelled(r),o=a===!0?new y(u._candidates.slice(0).concat(u._known.slice(0)),[],l===!0&&u._ordered,this._clonePageDefinition(u.pagesDefinition)):new y(u._candidates.slice(0),u._known.slice(0),l===!0&&u._ordered,this._clonePageDefinition(u.pagesDefinition)),o}_reformulateWithoutAdaptions(e){const t={cannot:!1,where:e};if(e!==null){for(const s of this.adaptedFields)if(ye(e,s.field.name)===!0){const i=s.rewriteSql(e,this);if(i.rewritten!==!0){t.cannot=!0,t.where=null;break}t.where=i.where}}return t}async _stat(e,t,s,i,r,a,n){let l=!1,u=this._reformulateWithoutAdaptions(t);if(l=u.cannot,t=u.where,u=this._reformulateWithoutAdaptions(r),l=l||u.cannot,(r=u.where)!==null?this._extraFilter!==null&&(r=P(this._extraFilter,r)):r=this._extraFilter,l===!0)return r===null&&s===""&&i===null?this._manualStat(e,t,a,n):{calculated:!1};const o=await V(this._parent)._stat(e,t,s,i,r,a,n);return o.calculated===!1?r===null&&s===""&&i===null?this._manualStat(e,t,a,n):{calculated:!1}:o}async _canDoAggregates(e,t,s,i,r){if(this._parent===null)return!1;for(let l=0;l{for(let i=0;i0?(await J(this._refineSetBlock(e,this._maxProcessingRate(),i)),this._checkCancelled(i),this.getIdColumnDictionary(e,t,s,i)):t}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,s,i){return this._parent._getFeatures(e,t,s,i)}_featureFromCache(e){if(this._featureCache[e]===void 0){const t=this._parent._featureFromCache(e);return t===void 0?void 0:t===null?null:(this._featureCache[e]=t,t)}return this._featureCache[e]}async _fetchAndRefineFeatures(){throw new C(D.NeverReach)}async _getFilteredSet(e,t,s,i,r){await this._ensureLoaded();const a=await this._parent._getFilteredSet(e,t,s,i===null?this._orderbyclause:i,r);this._checkCancelled(r);const n=new y(a._candidates.slice(0),a._known.slice(0),a._ordered,this._clonePageDefinition(a.pagesDefinition));let l=!0;if(a._candidates.length>0&&(l=!1),n._ordered===!1){let u=await this.manualOrderSet(n,r);return l===!1&&(t===null&&s===null||(u=new y(u._candidates.slice(0).concat(u._known.slice(0)),[],u._ordered,this._clonePageDefinition(u.pagesDefinition)))),u}return n}static registerAction(){L._featuresetFunctions.orderBy=function(e){return e===""?this:new M({parentfeatureset:this,orderbyclause:new W(e)})}}}function ze(c){if(c.parseTree.type==="function"){if(c.parseTree.args.value.length===0)return{name:c.parseTree.name,expr:null};if(c.parseTree.args.value.length>1)throw new T(N.MissingStatisticParameters);const e=A.create(Oe(c.parseTree.args.value[0],k.Standardised,c.parameters),c.fieldsIndex);return{name:c.parseTree.name,expr:e}}return null}class Q{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new Q;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,s){const i=new Q;i.field=e;const r=A.create(t,s),a=ze(r);if(a===null)throw new T(N.UnsupportedSqlFunction,{function:""});const n=a.name.toUpperCase().trim();if(n==="MIN"){if(i.typeofstat="MIN",i.workingexpr=a.expr,r===null)throw new T(N.InvalidFunctionParameters,{function:"min"})}else if(n==="MAX"){if(i.typeofstat="MAX",i.workingexpr=a.expr,r===null)throw new T(N.InvalidFunctionParameters,{function:"max"})}else if(n==="COUNT")i.typeofstat="COUNT",i.workingexpr=a.expr;else if(n==="STDEV"){if(i.typeofstat="STDDEV",i.workingexpr=a.expr,r===null)throw new T(N.InvalidFunctionParameters,{function:"stdev"})}else if(n==="SUM"){if(i.typeofstat="SUM",i.workingexpr=a.expr,r===null)throw new T(N.InvalidFunctionParameters,{function:"sum"})}else if(n==="MEAN"){if(i.typeofstat="AVG",i.workingexpr=a.expr,r===null)throw new T(N.InvalidFunctionParameters,{function:n})}else if(n==="AVG"){if(i.typeofstat="AVG",i.workingexpr=a.expr,r===null)throw new T(N.InvalidFunctionParameters,{function:"avg"})}else{if(n!=="VAR")throw new T(N.UnsupportedSqlFunction,{function:n});if(i.typeofstat="VAR",i.workingexpr=a.expr,r===null)throw new T(N.InvalidFunctionParameters,{function:"var"})}return i}toStatisticsName(){switch(this.typeofstat.toUpperCase()){case"MIN":return"min";case"MAX":return"max";case"SUM":return"sum";case"COUNT":default:return"count";case"VAR":return"var";case"STDDEV":return"stddev";case"AVG":return"avg"}}}function Ze(c){if(!c)return"COUNT";switch(c.toLowerCase()){case"max":return"MAX";case"var":case"variance":return"VAR";case"avg":case"average":case"mean":return"AVG";case"min":return"MIN";case"sum":return"SUM";case"stdev":case"stddev":return"STDDEV";case"count":return"COUNT"}return"COUNT"}class ae extends L{constructor(e){super(e),this._decodedStatsfield=[],this._decodedGroupbyfield=[],this._candosimplegroupby=!0,this.phsyicalgroupbyfields=[],this.objectIdField="ROW__ID",this._internalObjectIdField="ROW__ID",this._adaptedFields=[],this.declaredClass="esri.arcade.featureset.actions.Aggregate",this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}async _getSet(e){if(this._wset===null){const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,this._wset}return this._wset}_isInFeatureSet(){return S.InFeatureSet}_nextUniqueName(e){for(;e["T"+this._uniqueIds.toString()]===1;)this._uniqueIds++;const t="T"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e={};let t=!1,s=1;const i=this._parent?this._parent.getFieldsIndex():new Se([]);for(this.objectIdField="ROW__ID",this.globalIdField="";t===!1;){let a=!1;for(let n=0;n0)for(const a of this._parent.fields)this._adaptedFields.push(new ee(a));for(let a=0;a0&&(l=new Ke({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),n.nowhereclause===!0)a=new y(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new M({parentfeatureset:l,orderbyclause:new W(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}});else{let u=l;if(s!==null){let o=null;s&&(o=this._reformulateWhereClauseWithoutGroupByFields(s)),u=new U({parentfeatureset:u,whereclause:o})}a=new y(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new M({parentfeatureset:u,orderbyclause:new W(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}})}return a}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=K(e,t.tofieldname,v(t.workingexpr,k.Standardised),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=K(e,t.tofieldname,v(t.expression,k.Standardised),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const s of this._decodedGroupbyfield)s.tofieldname!==s.name&&t.push({field:s.tofieldname,newfield:s.name});return t.length>0?e.replaceFields(t):e}_clonePageDefinition(e){return e===null?null:e.aggregatefeaturesetpagedefinition===!0?{aggregatefeaturesetpagedefinition:!0,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,internal:e.internal}:this._parent._clonePageDefinition(e)}async _refineSetBlock(e,t,s){return this._checkIfNeedToExpandCandidatePage(e,this._maxQuery)===!0?(await this._expandPagedSet(e,this._maxQuery,0,0,s),this._refineSetBlock(e,t,s)):(this._checkCancelled(s),e._candidates.length,this._refineKnowns(e,t),e._candidates.length,e._candidates.length,e)}_expandPagedSet(e,t,s,i,r){return this._expandPagedSetFeatureSet(e,t,s,i,r)}async _getPhysicalPage(e,t,s){if(e.pagesDefinition.aggregatefeaturesetpagedefinition===!0)return this._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,s,[]);const i=await this._getAgregagtePhysicalPage(e,t,s);for(const r of i){const a={geometry:r.geometry,attributes:{}};for(const n of this._decodedGroupbyfield)a.attributes[n.tofieldname]=r.attributes[n.name];for(const n of this._decodedStatsfield)a.attributes[n.tofieldname]=r.attributes[n.field];this._featureCache[a.attributes[this.objectIdField]]=new q(a)}return i.length}_sequentialGetPhysicalItem(e,t,s,i){return new Promise((r,a)=>{e.pagesDefinition.internal.iterator===null&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(s)),e.pagesDefinition.internal.fullyResolved===!0||t===0?r(i.length):this._nextAggregateItem(e,t,s,i,n=>{n===null?r(i.length):(t-=1,r(this._sequentialGetPhysicalItem(e,t,s,i)))},a)})}_nextAggregateItem(e,t,s,i,r,a){try{J(e.pagesDefinition.internal.iterator.next()).then(n=>{if(n===null)if(e.pagesDefinition.internal.workingItem!==null){const l=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);i.push(l),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(l.attributes[this.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,r(null)}else e.pagesDefinition.internal.fullyResolved=!0,r(null);else{const l=this._generateAggregateHash(n);if(e.pagesDefinition.internal.workingItem===null)e.pagesDefinition.internal.workingItem={features:[n],id:l};else{if(l!==e.pagesDefinition.internal.workingItem.id){const u=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return i.push(u),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(u.attributes[this.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[n],id:l},void r(u)}e.pagesDefinition.internal.workingItem.features.push(n)}this._nextAggregateItem(e,t,s,i,r,a)}},a)}catch(n){a(n)}}_calculateFieldStat(e,t,s){const i=[];for(let r=0;rthis._topnum&&(this._wset._known=this._wset._known.slice(0,this._topnum)),this._setKnownLength(this._wset)>=this._topnum&&(this._wset._candidates=[]),this._wset}return this._wset}_setKnownLength(e){return e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"?e._known.length-1:e._known.length}_isInFeatureSet(e){const t=this._parent._isInFeatureSet(e);if(t===S.NotInFeatureSet)return t;const s=this._idstates[e];return s===S.InFeatureSet||s===S.NotInFeatureSet?s:t===S.InFeatureSet&&s===void 0?this._countedinthis._topnum&&(t=this._topnum),this._countedin>=this._topnum&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset){let n=e._known.length;return n>0&&e._known[n-1]==="GETPAGES"&&(e._known.length=n-1),n=e._candidates.length,n>0&&e._candidates[n-1]==="GETPAGES"&&(e._candidates.length=n-1),"success"}const a=await this._parent._expandPagedSet(e,t,s,i,r);return this._setKnownLength(e)>this._topnum&&(e._known.length=this._topnum),this._setKnownLength(e)>=this._topnum&&(e._candidates.length=0),a}async _getFeatures(e,t,s,i){const r=[],a=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(e,a)===!0)return await this._expandPagedSet(e,a,0,0,i),this._getFeatures(e,t,s,i);t!==-1&&this._featureCache[t]===void 0&&r.push(t);let n=0;for(let o=e._lastFetchedIndex;oa)));o++);if(r.length===0)return"success";const l=new y([],r,!1,null),u=Math.min(r.length,s);await this._parent._getFeatures(l,-1,u,i);for(let o=0;o=this._topnum)break}else if(n===S.NotInFeatureSet)i===null?i={start:a,end:a}:i.end===a-1?i.end=a:(r.push(i),i={start:a,end:a}),s+=1;else if(n===S.Unknown)break;if(s>=t)break}i!==null&&r.push(i);for(let a=r.length-1;a>=0;a--)e._candidates.splice(r[a].start,r[a].end-r[a].start+1);this._setKnownLength(e)>this._topnum&&(e._known=e._known.slice(0,this._topnum)),this._setKnownLength(e)>=this._topnum&&(e._candidates=[])}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}static registerAction(){L._featuresetFunctions.top=function(e){return new ne({parentfeatureset:this,topnum:e})}}}class Z extends L{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this.formulaCredential=null,this._pageJustIds=!1,this._requestStandardised=!1,this._useDefinitionExpression=!0,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return re}end(){return this._layer}optimisePagingFeatureQueries(e){this._pageJustIds=e}convertQueryToLruCacheKey(e){const t=Be(e.toJSON());return pe(t,_e.String)}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){var e;if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),this._layer.outFields&&!(this._layer.outFields.length===1&&this._layer.outFields[0]==="*")){const t=[];for(const s of this.fields)if(s.type==="oid")t.push(s);else for(const i of this._layer.outFields)if(i.toLowerCase()===s.name.toLowerCase()){t.push(s);break}this.fields=t}if(this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const t=[],s=[];for(const i of this.fields)if(i.type==="oid")t.push(i),s.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){t.push(i),s.push(i.name);break}this.fields=t,this._overrideFields=s}if(this._layer.source&&this._layer.source.sourceJSON){const t=this._layer.source.sourceJSON.currentVersion;this._layer.source.sourceJSON.useStandardizedQueries===!0?(this._databaseType=k.StandardisedNoInterval,t!=null&&t>=10.61&&(this._databaseType=k.Standardised)):t!=null&&(t>=10.5&&(this._databaseType=k.StandardisedNoInterval,this._requestStandardised=!0),t>=10.61&&(this._databaseType=k.Standardised))}this.objectIdField=this._layer.objectIdField;for(const t of this.fields)t.type==="global-id"&&(this.globalIdField=t.name);this.hasM=this._layer.supportsM,this.hasZ=this._layer.supportsZ,this.typeIdField=(e=this._layer.typeIdField)!=null?e:"",this.types=this._layer.types}_isInFeatureSet(){return S.InFeatureSet}async _refineSetBlock(e){return e}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new O;t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch{return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||this._layer.capabilities.query.supportsPagination!==!0)}_cacheableFeatureSetSourceKey(){return this._layer.url}pbfSupportedForQuery(e){var s,i;const t=(i=(s=this._layer)==null?void 0:s.capabilities)==null?void 0:i.query;return!e.outStatistics&&(t==null?void 0:t.supportsFormatPBF)===!0&&(t==null?void 0:t.supportsQuantizationEditMode)===!0}async queryPBF(e){e.quantizationParameters={mode:"edit"};const t=await be(this._layer.parsedUrl,e,new Ie({}));return Ce.fromJSON(De(t.data)).unquantize()}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion?this._layer.gdbVersion:"SDE.DEFAULT":""}nativeCapabilities(){var e;return{title:(e=this._layer.title)!=null?e:"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}executeQuery(e,t){const s=t==="execute"?he:t==="executeForCount"?Me:Qe,i=t==="execute"&&this.pbfSupportedForQuery(e);let r=null;if(this.recentlyUsedQueries){const a=this.convertQueryToLruCacheKey(e);r=this.recentlyUsedQueries.getFromCache(a),r===null&&(r=i!==!0?s(this._layer.parsedUrl.path,e):this.queryPBF(e),this.recentlyUsedQueries.addToCache(a,r),r=r.catch(n=>{var l;throw(l=this.recentlyUsedQueries)==null||l.removeFromCache(a),n}))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),r===null&&(r=i!==!0?s(this._layer.parsedUrl.path,e):this.queryPBF(e)),r}async _getFilteredSet(e,t,s,i,r){const a=await this.databaseType();if(this.isTable()&&t&&e!==null&&e!=="")return new y([],[],!0,null);if(this._canUsePagination())return this._getFilteredSetUsingPaging(e,t,s,i,r);let n="",l=!1;i!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(n=i.constructClause(),l=!0);const u=new O;u.where=s===null?t===null?"1=1":"":v(s,a),this._requestStandardised&&(u.sqlFormat="standard"),u.spatialRelationship=this._makeRelationshipEnum(e),u.outSpatialReference=this.spatialReference,u.orderByFields=n!==""?n.split(","):null,u.geometry=t===null?null:t,u.relationParameter=this._makeRelationshipParam(e);let o=await this.executeQuery(u,"executeForIds");return o===null&&(o=[]),this._checkCancelled(r),new y([],o,l,null)}_expandPagedSet(e,t,s,i,r){return this._expandPagedSetFeatureSet(e,t,s,i,r)}async _getFilteredSetUsingPaging(e,t,s,i,r){var f;let a="",n=!1;i!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(a=i.constructClause(),n=!0);const l=await this.databaseType();let u=s===null?t===null?"1=1":"":v(s,l);this._layer.definitionExpression&&this._useDefinitionExpression&&(u=u!==""?"(("+this._layer.definitionExpression+") AND ("+u+"))":this._layer.definitionExpression);let o=this._maxQueryRate();const d=(f=this._layer.capabilities)==null?void 0:f.query.maxRecordCount;d!==void 0&&d=this._maxProcessingRate()-1))break}if(a>=s&&r.length===0)break}if(r.length===0)return"success";const n=new O;this._requestStandardised&&(n.sqlFormat="standard"),n.objectIds=r,n.outFields=this._overrideFields!==null?this._overrideFields:this._fieldsIncludingObjectId(this._layer.outFields?this._layer.outFields:["*"]),n.returnGeometry=!0,this._removeGeometry===!0&&(n.returnGeometry=!1),n.outSpatialReference=this.spatialReference;const l=await this.executeQuery(n,"execute");if(this._checkCancelled(i),l.error!==void 0)throw new C(D.RequestFailed,{reason:l.error});const u=this._layer.objectIdField;for(let o=0;o=n)break}return m.features.length===0?l:m.features.length===((_=this._layer.capabilities)==null?void 0:_.query.maxRecordCount)&&l.length"+e.pagesDefinition.internal.lastMaxId.toString()+")":e.pagesDefinition.generatedOid+">"+e.pagesDefinition.internal.lastMaxId.toString());const r=e.pagesDefinition.internal.lastRetrieved,a=r,n=e.pagesDefinition.internal.lastPage,l=new O;if(this._requestStandardised&&(l.sqlFormat="standard"),l.where=i,l.spatialRelationship=e.pagesDefinition.spatialRel,l.relationParameter=e.pagesDefinition.relationParam,l.outFields=e.pagesDefinition.outFields,l.outStatistics=e.pagesDefinition.outStatistics,l.geometry=e.pagesDefinition.geometry,l.groupByFieldsForStatistics=e.pagesDefinition.groupByFieldsForStatistics,l.num=e.pagesDefinition.resultRecordCount,l.start=e.pagesDefinition.internal.lastPage,l.returnGeometry=e.pagesDefinition.returnGeometry,l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,this.isTable()&&l.geometry&&l.spatialRelationship)return[];const u=await this.executeQuery(l,"execute");if(this._checkCancelled(s),!u.hasOwnProperty("features"))throw new C(D.InvalidStatResponse);const o=[];if(e.pagesDefinition.internal.lastPage!==n)return[];for(let d=0;d0||s&&s>0)&&(n.size=[t&&t>0?t:0,s&&s>0?s:t+1]),i&&i.length>0&&(n.attachmentTypes=i),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:n,method:"attachments"});const l=await this._layer.queryAttachments(n),u=[];return l&&l[e]&&l[e].forEach(o=>{const d=this._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+o.id.toString();let h=null;r&&o.exifInfo&&(h=Ue.convertJsonToArcade(o.exifInfo,!0)),u.push(new We(o.id,o.name,o.contentType,o.size,d,h))}),u}return[]}async queryRelatedFeatures(e){var i;const t={f:"json",relationshipId:e.relationshipId.toString(),definitionExpression:e.where,outFields:(i=e.outFields)==null?void 0:i.join(","),returnGeometry:e.returnGeometry.toString()};e.resultOffset!==void 0&&e.resultOffset!==null&&(t.resultOffset=e.resultOffset.toString()),e.resultRecordCount!==void 0&&e.resultRecordCount!==null&&(t.resultRecordCount=e.resultRecordCount.toString()),e.orderByFields&&(t.orderByFields=e.orderByFields.join(",")),e.objectIds&&e.objectIds.length>0&&(t.objectIds=e.objectIds.join(",")),e.outSpatialReference&&(t.outSR=JSON.stringify(e.outSpatialReference.toJSON())),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const s=await j(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(s.data){const r={},a=s.data;if(a&&a.relatedRecordGroups){const n=a.spatialReference;for(const l of a.relatedRecordGroups){const u=l.objectId,o=[];for(const d of l.relatedRecords){d.geometry&&(d.geometry.spatialReference=n);const h=new q({geometry:d.geometry?ve(d.geometry):null,attributes:d.attributes});o.push(h)}r[u]={features:o,exceededTransferLimit:a.exceededTransferLimit===!0}}}return r}throw new C(D.InvalidRequest)}async getFeatureByObjectId(e,t){const s=new O;s.outFields=t,s.returnGeometry=!1,s.outSpatialReference=this.spatialReference,s.where=this.objectIdField+"="+e.toString(),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:s,method:"execute"});const i=await he(this._layer.parsedUrl.path,s);return i.features.length===1?i.features[0]:null}async getIdentityUser(){var t;await this.load();const e=(t=H)==null?void 0:t.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){var i;await this.load();const e=(i=H)==null?void 0:i.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl;let t=this._layer.url;const s=t.toLowerCase().indexOf("/rest/services");if(t=s>-1?t.substring(0,s):t,t){t+="/rest/info";try{const r=await j(t,{query:{f:"json"}});let a="";return r.data&&r.data.owningSystemUrl&&(a=r.data.owningSystemUrl),a}catch{return""}}return""}getDataSourceFeatureSet(){var t,s,i,r;const e=new Z({layer:this._layer,spatialReference:(t=this.spatialReference)!=null?t:void 0,outFields:(s=this._overrideFields)!=null?s:void 0,includeGeometry:!this._removeGeometry,lrucache:(i=this.recentlyUsedQueries)!=null?i:void 0,interceptor:(r=this.featureSetQueryInterceptor)!=null?r:void 0});return e._useDefinitionExpression=!1,e}}class le extends L{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.isTable===!0&&(this._forceIsTable=!0),e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return re}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),this._layer.outFields&&!(this._layer.outFields.length===1&&this._layer.outFields[0]==="*")){const e=[];for(const t of this.fields)if(t.type==="oid")e.push(t);else for(const s of this._layer.outFields)if(s.toLowerCase()===t.name.toLowerCase()){e.push(t);break}this.fields=e}if(this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const e=[],t=[];for(const s of this.fields)if(s.type==="oid")e.push(s),t.push(s.name);else for(const i of this._overrideFields)if(i.toLowerCase()===s.name.toLowerCase()){e.push(s),t.push(s.name);break}this.fields=e,this._overrideFields=t}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)e.type==="global-id"&&(this.globalIdField=e.name);this.hasM=this._layer.supportsM,this.hasZ=this._layer.supportsZ,this._databaseType=k.Standardised,this.typeIdField=this._layer.typeIdField,this.types=this._layer.types}isTable(){return this._forceIsTable||this._layer.isTable||this._layer.type==="table"||!this._layer.geometryType}_isInFeatureSet(){return S.InFeatureSet}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_changeFeature(e){const t={};for(const s of this.fields)t[s.name]=e.attributes[s.name];return new q({geometry:this._removeGeometry===!0?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,s,i,r){let a="",n=!1;if(i!==null&&(a=i.constructClause(),n=!0),this.isTable()&&t&&e!==null&&e!=="")return new y([],[],!0,null);const l=new O;l.where=s===null?t===null?"1=1":"":v(s,k.Standardised),l.spatialRelationship=this._makeRelationshipEnum(e),l.outSpatialReference=this.spatialReference,l.orderByFields=a!==""?a.split(","):null,l.geometry=t===null?null:t,l.returnGeometry=!0,l.relationParameter=this._makeRelationshipParam(e);const u=await this._layer.queryFeatures(l);if(u===null)return new y([],[],n,null);this._checkCancelled(r);const o=[];return u.features.forEach(d=>{const h=d.attributes[this._layer.objectIdField];o.push(h),this._featureCache[h]=this._changeFeature(d)}),new y([],o,n,null)}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}async _queryAllFeatures(){if(this._wset)return this._wset;const e=new O;if(e.where="1=1",await this._ensureLoaded(),this._layer.source&&this._layer.source.items){const i=[];return this._layer.source.items.forEach(r=>{const a=r.attributes[this._layer.objectIdField];i.push(a),this._featureCache[a]=this._changeFeature(r)}),this._wset=new y([],i,!1,null),this._wset}const t=await this._layer.queryFeatures(e),s=[];return t.features.forEach(i=>{const r=i.attributes[this._layer.objectIdField];s.push(r),this._featureCache[r]=this._changeFeature(i)}),this._wset=new y([],s,!1,null),this._wset}async _getFeatures(e,t,s){const i=[];t!==-1&&this._featureCache[t]===void 0&&i.push(t);for(let r=e._lastFetchedIndex;rs)));r++);if(i.length===0)return"success";throw new C(D.MissingFeatures)}async _refineSetBlock(e){return e}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}relationshipMetaData(){return[]}static _cloneAttr(e){const t={};for(const s in e)t[s]=e[s];return t}nativeCapabilities(){var e;return{title:(e=this._layer.title)!=null?e:"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let s=e.layerDefinition.objectIdField;const i=e.layerDefinition.typeIdField?e.layerDefinition.typeIdField:"",r=[];if(e.layerDefinition.types)for(const f of e.layerDefinition.types)r.push(Re.fromJSON(f));let a=e.layerDefinition.geometryType;a===void 0&&(a=e.featureSet.geometryType||"");let n=e.featureSet.features;const l=t.toJSON();if(s===""||s===void 0){let f=!1;for(const p of e.layerDefinition.fields)if(p.type==="oid"||p.type==="esriFieldTypeOID"){s=p.name,f=!0;break}if(f===!1){let p="FID",m=!0,I=0;for(;m;){let _=!0;for(const b of e.layerDefinition.fields)if(b.name===p){_=!1;break}_===!0?m=!1:(I++,p="FID"+I.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:p,alias:p});const F=[];for(let _=0;__.name):["*"]);u.outFields=o,u.relationshipId=this.relationship.id,u.where="1=1";let d=!0;this._removeGeometry===!0&&(d=!1),u.returnGeometry=d,this._requestStandardised&&(u.sqlFormat="standard"),u.outSpatialReference=this.spatialReference,u.orderByFields=n!==""?n.split(","):null;const h=await a.source.queryRelatedFeatures(u);this._checkCancelled(r);const f=h[this._findObjectId]?h[this._findObjectId].features:[],p=[];for(let _=0;_b.name):["*"]);return p=new y(h||f?["GETPAGES"]:[],h||f?[]:["GETPAGES"],n,{outFields:I.join(","),resultRecordCount:o,resultOffset:0,objectIds:[this._findObjectId],where:u,orderByFields:a,returnGeometry:m,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),await this._expandPagedSet(p,o,0,0,r),p}_expandPagedSet(e,t,s,i,r){return this._expandPagedSetFeatureSet(e,t,s,i,r)}_clonePageDefinition(e){return e===null?null:e.groupbypage!==!0?{groupbypage:!1,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,s){const i=e.pagesDefinition.internal.lastRetrieved,r=i,a=e.pagesDefinition.internal.lastPage,n=this._layer.nativeCapabilities(),l=new ce;this._requestStandardised===!0&&(l.sqlFormat="standard"),l.relationshipId=this.relationship.id,l.objectIds=e.pagesDefinition.objectIds,l.resultOffset=e.pagesDefinition.internal.lastPage,l.resultRecordCount=e.pagesDefinition.resultRecordCount,l.outFields=e.pagesDefinition.outFields.split(","),l.where=e.pagesDefinition.where,l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,l.returnGeometry=e.pagesDefinition.returnGeometry,l.outSpatialReference=this.spatialReference;const u=await n.source.queryRelatedFeatures(l);if(this._checkCancelled(s),e.pagesDefinition.internal.lastPage!==a)return 0;const o=u[this._findObjectId]?u[this._findObjectId].features:[];for(let h=0;hs)))&&!(n>=s&&r.length===0);l++);if(r.length===0)return"success";throw new C(D.MissingFeatures)}async _refineSetBlock(e,t,s){return e}async _stat(e,t,s,i,r,a,n){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,s,i,r){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,s,i,r){return this._relatedLayer.queryAttachments(e,t,s,i,r)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}}function Ye(){g.applicationCache===null&&(g.applicationCache=new g)}async function te(c,e){if(g.applicationCache){const t=g.applicationCache.getLayerInfo(c);if(t){const r=await t;return new R({url:c,outFields:e,sourceJSON:r})}const s=new R({url:c,outFields:e}),i=(async()=>(await s.load(),s.sourceJSON))();if(g.applicationCache){g.applicationCache.setLayerInfo(c,i);try{return await i,s}catch(r){throw g.applicationCache.clearLayerInfo(c),r}}return await i,s}return new R({url:c,outFields:e})}async function oe(c,e,t,s,i,r=null){return E(await te(c,["*"]),e,t,s,i,r)}function E(c,e=null,t=null,s=!0,i=null,r=null){const a={layer:c,spatialReference:e,outFields:t,includeGeometry:s,lrucache:i,interceptor:r};return c._hasMemorySource()===!0?new le(a):new Z(a)}async function He(c){if(g.applicationCache!==null){const t=g.applicationCache.getLayerInfo(c);if(t!==null)return t}const e=(async()=>{const t=await j(c,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(c,e);try{return await e}catch(t){throw g.applicationCache.clearLayerInfo(c),t}}return e}async function $e(c,e){const t="QUERYDATAELEMTS:"+e.toString()+":"+c;if(g.applicationCache!==null){const i=g.applicationCache.getLayerInfo(t);if(i!==null)return i}const s=(async()=>{const i=await j(c+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([e.toString()]),f:"json"}});if(i.data){const r=i.data;if(r.layerDataElements&&r.layerDataElements[0])return r.layerDataElements[0]}throw new C(D.DataElementsNotFound)})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(t,s);try{return await s}catch(i){throw g.applicationCache.clearLayerInfo(t),i}}return s}async function me(c){if(g.applicationCache!==null){const t=g.applicationCache.getLayerInfo(c);if(t!==null)return t}const e=(async()=>{const t=await j(c,{responseType:"json",query:{f:"json"}});if(t.data){const s=t.data;return s.layers||(s.layers=[]),s.tables||(s.tables=[]),s}return{layers:[],tables:[]}})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(c,e);try{return await e}catch(t){throw g.applicationCache.clearLayerInfo(c),t}}return e}async function et(c,e){const t={metadata:null,networkId:-1,unVersion:3,terminals:[],queryelem:null,layerNameLkp:{},lkp:null},s=await me(c);if(t.metadata=s,s.controllerDatasetLayers&&s.controllerDatasetLayers.utilityNetworkLayerId!==void 0&&s.controllerDatasetLayers.utilityNetworkLayerId!==null){if(s.layers)for(const a of s.layers)t.layerNameLkp[a.id]=a.name;if(s.tables)for(const a of s.tables)t.layerNameLkp[a.id]=a.name;const i=s.controllerDatasetLayers.utilityNetworkLayerId;t.networkId=i;const r=await $e(c,i);if(r){t.queryelem=r,t.queryelem&&t.queryelem.dataElement&&t.queryelem.dataElement.schemaGeneration!==void 0&&(t.unVersion=t.queryelem.dataElement.schemaGeneration),t.lkp={},t.queryelem.dataElement.domainNetworks||(t.queryelem.dataElement.domainNetworks=[]);for(const n of t.queryelem.dataElement.domainNetworks){for(const l of n.edgeSources?n.edgeSources:[]){const u={layerId:l.layerId,sourceId:l.sourceId,className:t.layerNameLkp[l.layerId]?t.layerNameLkp[l.layerId]:null};u.className&&(t.lkp[u.className]=u)}for(const l of n.junctionSources?n.junctionSources:[]){const u={layerId:l.layerId,sourceId:l.sourceId,className:t.layerNameLkp[l.layerId]?t.layerNameLkp[l.layerId]:null};u.className&&(t.lkp[u.className]=u)}}if(t.queryelem.dataElement.terminalConfigurations)for(const n of t.queryelem.dataElement.terminalConfigurations)for(const l of n.terminals)t.terminals.push({terminalId:l.terminalId,terminalName:l.terminalName});const a=await He(c+"/"+i);if(a.systemLayers&&a.systemLayers.associationsTableId!==void 0&&a.systemLayers.associationsTableId!==null){const n=[];t.unVersion>=4&&(n.push("STATUS"),n.push("PERCENTALONG"));let l=await oe(c+"/"+a.systemLayers.associationsTableId.toString(),e,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...n],!1,null,null);return await l.load(),t.unVersion>=4&&(l=l.filter(A.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62,63)",l.getFieldsIndex())),await l.load()),{lkp:t.lkp,associations:l,unVersion:t.unVersion,terminals:t.terminals}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}async function tt(c,e,t,s=null,i=null,r=!0,a=null,n=null){let l=c.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+e.relatedTableId.toString():l+"/"+e.relatedTableId.toString();const u=await oe(l,s,i,r,a,n);return new Xe({layer:c,relatedLayer:u,relationship:e,objectId:t,spatialReference:s,outFields:i,includeGeometry:r,lrucache:a,interceptor:n})}U.registerAction(),ae.registerAction(),M.registerAction(),qe.registerAction(),ne.registerAction();class st extends ge{constructor(e,t=null,s=null,i=null){super(),this._map=e,this._overridespref=t,this._lrucache=s,this._interceptor=i,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,s=null){const i=E(e,this._overridespref,s===null?["*"]:s,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:i,opitem:e,includeGeometry:t,outFields:JSON.stringify(s)}),i}async featureSetByName(e,t=!0,s=null){if(this._map.loaded!==void 0&&this._map.load!==void 0&&this._map.loaded===!1)return await this._map.load(),this.featureSetByName(e,t,s);s===null&&(s=["*"]),s=(s=s.slice(0)).sort();const i=JSON.stringify(s);for(let a=0;aa instanceof R&&a.title===e);if(r)return this._makeAndAddFeatureSet(r,t,s);if(this._map.tables){const a=this._map.tables.find(n=>!!(n.title&&n.title===e||n.title&&n.title===e));if(a){if(a instanceof R)return this._makeAndAddFeatureSet(a,t,s);if(!a._materializedTable){const n=a.outFields?a:{...a,outFields:["*"]};a._materializedTable=new R(n)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,s)}}return null}async featureSetById(e,t=!0,s=["*"]){if(this._map.loaded!==void 0&&this._map.load!==void 0&&this._map.loaded===!1)return await this._map.load(),this.featureSetById(e,t,s);s===null&&(s=["*"]),s=(s=s.slice(0)).sort();const i=JSON.stringify(s);for(let a=0;aa instanceof R&&a.id===e);if(r)return this._makeAndAddFeatureSet(r,t,s);if(this._map.tables){const a=this._map.tables.find(n=>n.id===e);if(a){if(a instanceof R)return this._makeAndAddFeatureSet(a,t,s);if(!a._materializedTable){const n={...a,outFields:["*"]};a._materializedTable=new R(n)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,s)}}return null}}class ue extends ge{constructor(e,t=null,s=null,i=null){super(),this._url=e,this._overridespref=t,this._lrucache=s,this._interceptor=i,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,s=null){const i=E(e,this._overridespref,s===null?["*"]:s,t,this._lrucache);return this._instantLayers.push({featureset:i,opitem:e,includeGeometry:t,outFields:JSON.stringify(s)}),i}async _loadMetaData(){const e=await me(this._url);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new ue(this._url,this._overridespref,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,s=null){s===null&&(s=["*"]),s=(s=s.slice(0)).sort();const i=JSON.stringify(s);for(let n=0;n":case"=":if(e.left.type==="column-reference"&&e.right.type==="string"){if(e.left.column.toUpperCase()===this.field.name.toUpperCase()&&this.lkp[e.right.value.toString()]!==void 0)return" ("+i+" "+e.operator+" "+this.lkp[e.right.value.toString()].toString()+") "}else if(e.right.type==="column-reference"&&e.left.type==="string"&&e.right.column.toUpperCase()===this.field.name.toUpperCase())return" ("+this.lkp[e.right.value.toString()].toString()+" "+e.operator+" "+i+") ";return" ("+this.evaluateNodeToWhereClause(e.left,t,s,w.BADNESS,r)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,s,w.BADNESS,r)+") ";case"<":case">":case">=":case"<=":case"*":case"-":case"+":case"/":return" ("+this.evaluateNodeToWhereClause(e.left,t,s,w.BADNESS,r)+" "+e.operator+" "+this.evaluateNodeToWhereClause(e.right,t,s,w.BADNESS,r)+") "}case"null":return"null";case"boolean":return e.value===!0?"1":"0";case"string":return"'"+e.value.toString().replace(/'/g,"''")+"'";case"timestamp":case"date":return Y(e.value,t);case"number":return e.value.toString();case"current-time":return Ae(e.mode==="date",t);case"column-reference":return s&&s.toLowerCase()===e.column.toLowerCase()?"("+i+")":e.column;case"function":{const o=this.evaluateNodeToWhereClause(e.args,t,s,w.BADNESS,r);return Ne(e.name,o,t)}}throw new T(N.UnsupportedSyntax,{node:e.type})}extractValue(e){return this.codefield instanceof A?this.reverseLkp[this.codefield.calculateValueCompiled(e)]:this.reverseLkp[e.attributes[this.codefield]]}}w.BADNESS="_!!!_BAD_LKP_!!!!";class Je extends X{constructor(e,t){super(e),this._sql=t}rewriteSql(e,t){return{rewritten:!0,where:K(e,this.field.name,v(this._sql,k.Standardised),t.getFieldsIndex())}}extractValue(e){return this._sql.calculateValueCompiled(e)}}class Ke extends L{constructor(e){super(e),this._calcFunc=null,this.declaredClass="esri.arcade.featureset.actions.Adapted",this.adaptedFields=[],this._extraFilter=null,this._extraFilter=e.extraFilter,this._parent=e.parentfeatureset,this._maxProcessing=30,this.adaptedFields=e.adaptedFields}static findField(e,t){for(const s of e)if(s.name.toLowerCase()===t.toString().toLowerCase())return s;return null}_initialiseFeatureSet(){this._parent!==null?(this.geometryType=this._parent.geometryType,this.objectIdField=this._parent.objectIdField,this.globalIdField=this._parent.globalIdField,this.spatialReference=this._parent.spatialReference,this.hasM=this._parent.hasM,this.hasZ=this._parent.hasZ,this.typeIdField=this._parent.typeIdField,this.types=this._parent.types):(this.spatialReference=new se({wkid:4326}),this.objectIdField="",this.globalIdField="",this.geometryType=ie.point,this.typeIdField="",this.types=null),this.fields=[];for(const e of this.adaptedFields)e.postInitialization(this,this._parent),this.fields.push(e.field)}async _getSet(e){var t;if(this._wset===null){await this._ensureLoaded();let s=null;return s=this._extraFilter?await this._getFilteredSet("",null,null,null,e):await((t=this._parent)==null?void 0:t._getSet(e)),this._checkCancelled(e),Fe(s),this._wset=new y(s._candidates.slice(0),s._known.slice(0),s._ordered,this._clonePageDefinition(s.pagesDefinition)),this._wset}return this._wset}_isInFeatureSet(e){return V(this._parent)._isInFeatureSet(e)}async _getFeatures(e,t,s,i){var o,d;const r=[];t!==-1&&this._featureCache[t]===void 0&&r.push(t);const a=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(e,a)===!0)return await this._expandPagedSet(e,a,0,0,i),this._getFeatures(e,t,s,i);let n=0;for(let h=e._lastFetchedIndex;h=a)));h++);if(r.length===0)return"success";e=new y([],r,e._ordered,null);const l=Math.min(r.length,s);await((o=this._parent)==null?void 0:o._getFeatures(e,-1,l,i)),this._checkCancelled(i);const u=[];for(let h=0;h0&&(i=i.replaceFields(d))}s!==null?this._extraFilter!==null&&(s=P(this._extraFilter,s)):s=this._extraFilter,await this._ensureLoaded();const u=await V(this._parent)._getFilteredSet(e,t,s,i,r);let o;return this._checkCancelled(r),o=a===!0?new y(u._candidates.slice(0).concat(u._known.slice(0)),[],l===!0&&u._ordered,this._clonePageDefinition(u.pagesDefinition)):new y(u._candidates.slice(0),u._known.slice(0),l===!0&&u._ordered,this._clonePageDefinition(u.pagesDefinition)),o}_reformulateWithoutAdaptions(e){const t={cannot:!1,where:e};if(e!==null){for(const s of this.adaptedFields)if(ye(e,s.field.name)===!0){const i=s.rewriteSql(e,this);if(i.rewritten!==!0){t.cannot=!0,t.where=null;break}t.where=i.where}}return t}async _stat(e,t,s,i,r,a,n){let l=!1,u=this._reformulateWithoutAdaptions(t);if(l=u.cannot,t=u.where,u=this._reformulateWithoutAdaptions(r),l=l||u.cannot,(r=u.where)!==null?this._extraFilter!==null&&(r=P(this._extraFilter,r)):r=this._extraFilter,l===!0)return r===null&&s===""&&i===null?this._manualStat(e,t,a,n):{calculated:!1};const o=await V(this._parent)._stat(e,t,s,i,r,a,n);return o.calculated===!1?r===null&&s===""&&i===null?this._manualStat(e,t,a,n):{calculated:!1}:o}async _canDoAggregates(e,t,s,i,r){if(this._parent===null)return!1;for(let l=0;l{for(let i=0;i0?(await J(this._refineSetBlock(e,this._maxProcessingRate(),i)),this._checkCancelled(i),this.getIdColumnDictionary(e,t,s,i)):t}_isInFeatureSet(e){return this._parent._isInFeatureSet(e)}_getFeatures(e,t,s,i){return this._parent._getFeatures(e,t,s,i)}_featureFromCache(e){if(this._featureCache[e]===void 0){const t=this._parent._featureFromCache(e);return t===void 0?void 0:t===null?null:(this._featureCache[e]=t,t)}return this._featureCache[e]}async _fetchAndRefineFeatures(){throw new C(D.NeverReach)}async _getFilteredSet(e,t,s,i,r){await this._ensureLoaded();const a=await this._parent._getFilteredSet(e,t,s,i===null?this._orderbyclause:i,r);this._checkCancelled(r);const n=new y(a._candidates.slice(0),a._known.slice(0),a._ordered,this._clonePageDefinition(a.pagesDefinition));let l=!0;if(a._candidates.length>0&&(l=!1),n._ordered===!1){let u=await this.manualOrderSet(n,r);return l===!1&&(t===null&&s===null||(u=new y(u._candidates.slice(0).concat(u._known.slice(0)),[],u._ordered,this._clonePageDefinition(u.pagesDefinition)))),u}return n}static registerAction(){L._featuresetFunctions.orderBy=function(e){return e===""?this:new M({parentfeatureset:this,orderbyclause:new W(e)})}}}function ze(c){if(c.parseTree.type==="function"){if(c.parseTree.args.value.length===0)return{name:c.parseTree.name,expr:null};if(c.parseTree.args.value.length>1)throw new T(N.MissingStatisticParameters);const e=A.create(Oe(c.parseTree.args.value[0],k.Standardised,c.parameters),c.fieldsIndex);return{name:c.parseTree.name,expr:e}}return null}class Q{constructor(){this.field="",this.tofieldname="",this.typeofstat="MIN",this.workingexpr=null}clone(){const e=new Q;return e.field=this.field,e.tofieldname=this.tofieldname,e.typeofstat=this.typeofstat,e.workingexpr=this.workingexpr,e}static parseStatField(e,t,s){const i=new Q;i.field=e;const r=A.create(t,s),a=ze(r);if(a===null)throw new T(N.UnsupportedSqlFunction,{function:""});const n=a.name.toUpperCase().trim();if(n==="MIN"){if(i.typeofstat="MIN",i.workingexpr=a.expr,r===null)throw new T(N.InvalidFunctionParameters,{function:"min"})}else if(n==="MAX"){if(i.typeofstat="MAX",i.workingexpr=a.expr,r===null)throw new T(N.InvalidFunctionParameters,{function:"max"})}else if(n==="COUNT")i.typeofstat="COUNT",i.workingexpr=a.expr;else if(n==="STDEV"){if(i.typeofstat="STDDEV",i.workingexpr=a.expr,r===null)throw new T(N.InvalidFunctionParameters,{function:"stdev"})}else if(n==="SUM"){if(i.typeofstat="SUM",i.workingexpr=a.expr,r===null)throw new T(N.InvalidFunctionParameters,{function:"sum"})}else if(n==="MEAN"){if(i.typeofstat="AVG",i.workingexpr=a.expr,r===null)throw new T(N.InvalidFunctionParameters,{function:n})}else if(n==="AVG"){if(i.typeofstat="AVG",i.workingexpr=a.expr,r===null)throw new T(N.InvalidFunctionParameters,{function:"avg"})}else{if(n!=="VAR")throw new T(N.UnsupportedSqlFunction,{function:n});if(i.typeofstat="VAR",i.workingexpr=a.expr,r===null)throw new T(N.InvalidFunctionParameters,{function:"var"})}return i}toStatisticsName(){switch(this.typeofstat.toUpperCase()){case"MIN":return"min";case"MAX":return"max";case"SUM":return"sum";case"COUNT":default:return"count";case"VAR":return"var";case"STDDEV":return"stddev";case"AVG":return"avg"}}}function Ze(c){if(!c)return"COUNT";switch(c.toLowerCase()){case"max":return"MAX";case"var":case"variance":return"VAR";case"avg":case"average":case"mean":return"AVG";case"min":return"MIN";case"sum":return"SUM";case"stdev":case"stddev":return"STDDEV";case"count":return"COUNT"}return"COUNT"}class ae extends L{constructor(e){super(e),this._decodedStatsfield=[],this._decodedGroupbyfield=[],this._candosimplegroupby=!0,this.phsyicalgroupbyfields=[],this.objectIdField="ROW__ID",this._internalObjectIdField="ROW__ID",this._adaptedFields=[],this.declaredClass="esri.arcade.featureset.actions.Aggregate",this._uniqueIds=1,this._maxQuery=10,this._maxProcessing=10,this._parent=e.parentfeatureset,this._config=e}isTable(){return!0}async _getSet(e){if(this._wset===null){const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,this._wset}return this._wset}_isInFeatureSet(){return S.InFeatureSet}_nextUniqueName(e){for(;e["T"+this._uniqueIds.toString()]===1;)this._uniqueIds++;const t="T"+this._uniqueIds.toString();return e[t]=1,t}_convertToEsriFieldType(e){return e}_initialiseFeatureSet(){const e={};let t=!1,s=1;const i=this._parent?this._parent.getFieldsIndex():new Se([]);for(this.objectIdField="ROW__ID",this.globalIdField="";t===!1;){let a=!1;for(let n=0;n0)for(const a of this._parent.fields)this._adaptedFields.push(new ee(a));for(let a=0;a0&&(l=new Ke({parentfeatureset:this._parent,adaptedFields:this._adaptedFields,extraFilter:null})),n.nowhereclause===!0)a=new y(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new M({parentfeatureset:l,orderbyclause:new W(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}});else{let u=l;if(s!==null){let o=null;s&&(o=this._reformulateWhereClauseWithoutGroupByFields(s)),u=new U({parentfeatureset:u,whereclause:o})}a=new y(["GETPAGES"],[],!1,{aggregatefeaturesetpagedefinition:!0,resultOffset:0,resultRecordCount:this._maxQuery,internal:{fullyResolved:!1,workingItem:null,type:"manual",iterator:null,set:[],subfeatureset:new M({parentfeatureset:u,orderbyclause:new W(this.phsyicalgroupbyfields.join(",")+","+this._parent.objectIdField+" ASC")})}})}return a}_reformulateWhereClauseWithoutStatsFields(e){for(const t of this._decodedStatsfield)e=K(e,t.tofieldname,v(t.workingexpr,k.Standardised),this._parent.getFieldsIndex());return e}_reformulateWhereClauseWithoutGroupByFields(e){for(const t of this._decodedGroupbyfield)t.tofieldname!==t.name&&(e=K(e,t.tofieldname,v(t.expression,k.Standardised),this._parent.getFieldsIndex()));return e}_reformulateOrderClauseWithoutGroupByFields(e){const t=[];for(const s of this._decodedGroupbyfield)s.tofieldname!==s.name&&t.push({field:s.tofieldname,newfield:s.name});return t.length>0?e.replaceFields(t):e}_clonePageDefinition(e){return e===null?null:e.aggregatefeaturesetpagedefinition===!0?{aggregatefeaturesetpagedefinition:!0,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,internal:e.internal}:this._parent._clonePageDefinition(e)}async _refineSetBlock(e,t,s){return this._checkIfNeedToExpandCandidatePage(e,this._maxQuery)===!0?(await this._expandPagedSet(e,this._maxQuery,0,0,s),this._refineSetBlock(e,t,s)):(this._checkCancelled(s),e._candidates.length,this._refineKnowns(e,t),e._candidates.length,e._candidates.length,e)}_expandPagedSet(e,t,s,i,r){return this._expandPagedSetFeatureSet(e,t,s,i,r)}async _getPhysicalPage(e,t,s){if(e.pagesDefinition.aggregatefeaturesetpagedefinition===!0)return this._sequentialGetPhysicalItem(e,e.pagesDefinition.resultRecordCount,s,[]);const i=await this._getAgregagtePhysicalPage(e,t,s);for(const r of i){const a={geometry:r.geometry,attributes:{}};for(const n of this._decodedGroupbyfield)a.attributes[n.tofieldname]=r.attributes[n.name];for(const n of this._decodedStatsfield)a.attributes[n.tofieldname]=r.attributes[n.field];this._featureCache[a.attributes[this.objectIdField]]=new q(a)}return i.length}_sequentialGetPhysicalItem(e,t,s,i){return new Promise((r,a)=>{e.pagesDefinition.internal.iterator===null&&(e.pagesDefinition.internal.iterator=e.pagesDefinition.internal.subfeatureset.iterator(s)),e.pagesDefinition.internal.fullyResolved===!0||t===0?r(i.length):this._nextAggregateItem(e,t,s,i,n=>{n===null?r(i.length):(t-=1,r(this._sequentialGetPhysicalItem(e,t,s,i)))},a)})}_nextAggregateItem(e,t,s,i,r,a){try{J(e.pagesDefinition.internal.iterator.next()).then(n=>{if(n===null)if(e.pagesDefinition.internal.workingItem!==null){const l=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);i.push(l),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(l.attributes[this.objectIdField]),e.pagesDefinition.internal.fullyResolved=!0,r(null)}else e.pagesDefinition.internal.fullyResolved=!0,r(null);else{const l=this._generateAggregateHash(n);if(e.pagesDefinition.internal.workingItem===null)e.pagesDefinition.internal.workingItem={features:[n],id:l};else{if(l!==e.pagesDefinition.internal.workingItem.id){const u=this._calculateAndAppendAggregateItem(e.pagesDefinition.internal.workingItem);return i.push(u),e.pagesDefinition.internal.workingItem=null,e.pagesDefinition.internal.set.push(u.attributes[this.objectIdField]),t-=1,e.pagesDefinition.internal.workingItem={features:[n],id:l},void r(u)}e.pagesDefinition.internal.workingItem.features.push(n)}this._nextAggregateItem(e,t,s,i,r,a)}},a)}catch(n){a(n)}}_calculateFieldStat(e,t,s){const i=[];for(let r=0;rthis._topnum&&(this._wset._known=this._wset._known.slice(0,this._topnum)),this._setKnownLength(this._wset)>=this._topnum&&(this._wset._candidates=[]),this._wset}return this._wset}_setKnownLength(e){return e._known.length>0&&e._known[e._known.length-1]==="GETPAGES"?e._known.length-1:e._known.length}_isInFeatureSet(e){const t=this._parent._isInFeatureSet(e);if(t===S.NotInFeatureSet)return t;const s=this._idstates[e];return s===S.InFeatureSet||s===S.NotInFeatureSet?s:t===S.InFeatureSet&&s===void 0?this._countedinthis._topnum&&(t=this._topnum),this._countedin>=this._topnum&&e.pagesDefinition.internal.set.length<=e.pagesDefinition.resultOffset){let n=e._known.length;return n>0&&e._known[n-1]==="GETPAGES"&&(e._known.length=n-1),n=e._candidates.length,n>0&&e._candidates[n-1]==="GETPAGES"&&(e._candidates.length=n-1),"success"}const a=await this._parent._expandPagedSet(e,t,s,i,r);return this._setKnownLength(e)>this._topnum&&(e._known.length=this._topnum),this._setKnownLength(e)>=this._topnum&&(e._candidates.length=0),a}async _getFeatures(e,t,s,i){const r=[],a=this._maxQueryRate();if(this._checkIfNeedToExpandKnownPage(e,a)===!0)return await this._expandPagedSet(e,a,0,0,i),this._getFeatures(e,t,s,i);t!==-1&&this._featureCache[t]===void 0&&r.push(t);let n=0;for(let o=e._lastFetchedIndex;oa)));o++);if(r.length===0)return"success";const l=new y([],r,!1,null),u=Math.min(r.length,s);await this._parent._getFeatures(l,-1,u,i);for(let o=0;o=this._topnum)break}else if(n===S.NotInFeatureSet)i===null?i={start:a,end:a}:i.end===a-1?i.end=a:(r.push(i),i={start:a,end:a}),s+=1;else if(n===S.Unknown)break;if(s>=t)break}i!==null&&r.push(i);for(let a=r.length-1;a>=0;a--)e._candidates.splice(r[a].start,r[a].end-r[a].start+1);this._setKnownLength(e)>this._topnum&&(e._known=e._known.slice(0,this._topnum)),this._setKnownLength(e)>=this._topnum&&(e._candidates=[])}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}static registerAction(){L._featuresetFunctions.top=function(e){return new ne({parentfeatureset:this,topnum:e})}}}class Z extends L{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerDynamic",this._removeGeometry=!1,this._overrideFields=null,this.formulaCredential=null,this._pageJustIds=!1,this._requestStandardised=!1,this._useDefinitionExpression=!0,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return re}end(){return this._layer}optimisePagingFeatureQueries(e){this._pageJustIds=e}convertQueryToLruCacheKey(e){const t=Be(e.toJSON());return pe(t,_e.String)}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}_initialiseFeatureSet(){var e;if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),this._layer.outFields&&!(this._layer.outFields.length===1&&this._layer.outFields[0]==="*")){const t=[];for(const s of this.fields)if(s.type==="oid")t.push(s);else for(const i of this._layer.outFields)if(i.toLowerCase()===s.name.toLowerCase()){t.push(s);break}this.fields=t}if(this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const t=[],s=[];for(const i of this.fields)if(i.type==="oid")t.push(i),s.push(i.name);else for(const r of this._overrideFields)if(r.toLowerCase()===i.name.toLowerCase()){t.push(i),s.push(i.name);break}this.fields=t,this._overrideFields=s}if(this._layer.source&&this._layer.source.sourceJSON){const t=this._layer.source.sourceJSON.currentVersion;this._layer.source.sourceJSON.useStandardizedQueries===!0?(this._databaseType=k.StandardisedNoInterval,t!=null&&t>=10.61&&(this._databaseType=k.Standardised)):t!=null&&(t>=10.5&&(this._databaseType=k.StandardisedNoInterval,this._requestStandardised=!0),t>=10.61&&(this._databaseType=k.Standardised))}this.objectIdField=this._layer.objectIdField;for(const t of this.fields)t.type==="global-id"&&(this.globalIdField=t.name);this.hasM=this._layer.supportsM,this.hasZ=this._layer.supportsZ,this.typeIdField=(e=this._layer.typeIdField)!=null?e:"",this.types=this._layer.types}_isInFeatureSet(){return S.InFeatureSet}async _refineSetBlock(e){return e}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}async _runDatabaseProbe(e){await this._ensureLoaded();const t=new O;t.where=e.replace("OBJECTID",this._layer.objectIdField);try{return await this._layer.queryObjectIds(t),!0}catch{return!1}}_canUsePagination(){return!(!this._layer.capabilities||!this._layer.capabilities.query||this._layer.capabilities.query.supportsPagination!==!0)}_cacheableFeatureSetSourceKey(){return this._layer.url}pbfSupportedForQuery(e){var s,i;const t=(i=(s=this._layer)==null?void 0:s.capabilities)==null?void 0:i.query;return!e.outStatistics&&(t==null?void 0:t.supportsFormatPBF)===!0&&(t==null?void 0:t.supportsQuantizationEditMode)===!0}async queryPBF(e){e.quantizationParameters={mode:"edit"};const t=await be(this._layer.parsedUrl,e,new Ie({}));return Ce.fromJSON(De(t.data)).unquantize()}get gdbVersion(){return this._layer&&this._layer.capabilities&&this._layer.capabilities.data&&this._layer.capabilities.data.isVersioned?this._layer.gdbVersion?this._layer.gdbVersion:"SDE.DEFAULT":""}nativeCapabilities(){var e;return{title:(e=this._layer.title)!=null?e:"",source:this,canQueryRelated:!0,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:this._requestStandardised}}executeQuery(e,t){const s=t==="execute"?he:t==="executeForCount"?Me:Qe,i=t==="execute"&&this.pbfSupportedForQuery(e);let r=null;if(this.recentlyUsedQueries){const a=this.convertQueryToLruCacheKey(e);r=this.recentlyUsedQueries.getFromCache(a),r===null&&(r=i!==!0?s(this._layer.parsedUrl.path,e):this.queryPBF(e),this.recentlyUsedQueries.addToCache(a,r),r=r.catch(n=>{var l;throw(l=this.recentlyUsedQueries)==null||l.removeFromCache(a),n}))}return this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:e,method:t}),r===null&&(r=i!==!0?s(this._layer.parsedUrl.path,e):this.queryPBF(e)),r}async _getFilteredSet(e,t,s,i,r){const a=await this.databaseType();if(this.isTable()&&t&&e!==null&&e!=="")return new y([],[],!0,null);if(this._canUsePagination())return this._getFilteredSetUsingPaging(e,t,s,i,r);let n="",l=!1;i!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(n=i.constructClause(),l=!0);const u=new O;u.where=s===null?t===null?"1=1":"":v(s,a),this._requestStandardised&&(u.sqlFormat="standard"),u.spatialRelationship=this._makeRelationshipEnum(e),u.outSpatialReference=this.spatialReference,u.orderByFields=n!==""?n.split(","):null,u.geometry=t===null?null:t,u.relationParameter=this._makeRelationshipParam(e);let o=await this.executeQuery(u,"executeForIds");return o===null&&(o=[]),this._checkCancelled(r),new y([],o,l,null)}_expandPagedSet(e,t,s,i,r){return this._expandPagedSetFeatureSet(e,t,s,i,r)}async _getFilteredSetUsingPaging(e,t,s,i,r){var f;let a="",n=!1;i!==null&&this._layer.capabilities&&this._layer.capabilities.query&&this._layer.capabilities.query.supportsOrderBy===!0&&(a=i.constructClause(),n=!0);const l=await this.databaseType();let u=s===null?t===null?"1=1":"":v(s,l);this._layer.definitionExpression&&this._useDefinitionExpression&&(u=u!==""?"(("+this._layer.definitionExpression+") AND ("+u+"))":this._layer.definitionExpression);let o=this._maxQueryRate();const d=(f=this._layer.capabilities)==null?void 0:f.query.maxRecordCount;d!==void 0&&d=this._maxProcessingRate()-1))break}if(a>=s&&r.length===0)break}if(r.length===0)return"success";const n=new O;this._requestStandardised&&(n.sqlFormat="standard"),n.objectIds=r,n.outFields=this._overrideFields!==null?this._overrideFields:this._fieldsIncludingObjectId(this._layer.outFields?this._layer.outFields:["*"]),n.returnGeometry=!0,this._removeGeometry===!0&&(n.returnGeometry=!1),n.outSpatialReference=this.spatialReference;const l=await this.executeQuery(n,"execute");if(this._checkCancelled(i),l.error!==void 0)throw new C(D.RequestFailed,{reason:l.error});const u=this._layer.objectIdField;for(let o=0;o=n)break}return m.features.length===0?l:m.features.length===((_=this._layer.capabilities)==null?void 0:_.query.maxRecordCount)&&l.length"+e.pagesDefinition.internal.lastMaxId.toString()+")":e.pagesDefinition.generatedOid+">"+e.pagesDefinition.internal.lastMaxId.toString());const r=e.pagesDefinition.internal.lastRetrieved,a=r,n=e.pagesDefinition.internal.lastPage,l=new O;if(this._requestStandardised&&(l.sqlFormat="standard"),l.where=i,l.spatialRelationship=e.pagesDefinition.spatialRel,l.relationParameter=e.pagesDefinition.relationParam,l.outFields=e.pagesDefinition.outFields,l.outStatistics=e.pagesDefinition.outStatistics,l.geometry=e.pagesDefinition.geometry,l.groupByFieldsForStatistics=e.pagesDefinition.groupByFieldsForStatistics,l.num=e.pagesDefinition.resultRecordCount,l.start=e.pagesDefinition.internal.lastPage,l.returnGeometry=e.pagesDefinition.returnGeometry,l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,this.isTable()&&l.geometry&&l.spatialRelationship)return[];const u=await this.executeQuery(l,"execute");if(this._checkCancelled(s),!u.hasOwnProperty("features"))throw new C(D.InvalidStatResponse);const o=[];if(e.pagesDefinition.internal.lastPage!==n)return[];for(let d=0;d0||s&&s>0)&&(n.size=[t&&t>0?t:0,s&&s>0?s:t+1]),i&&i.length>0&&(n.attachmentTypes=i),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:n,method:"attachments"});const l=await this._layer.queryAttachments(n),u=[];return l&&l[e]&&l[e].forEach(o=>{const d=this._layer.parsedUrl.path+"/"+e.toString()+"/attachments/"+o.id.toString();let h=null;r&&o.exifInfo&&(h=Ue.convertJsonToArcade(o.exifInfo,!0)),u.push(new We(o.id,o.name,o.contentType,o.size,d,h))}),u}return[]}async queryRelatedFeatures(e){var i;const t={f:"json",relationshipId:e.relationshipId.toString(),definitionExpression:e.where,outFields:(i=e.outFields)==null?void 0:i.join(","),returnGeometry:e.returnGeometry.toString()};e.resultOffset!==void 0&&e.resultOffset!==null&&(t.resultOffset=e.resultOffset.toString()),e.resultRecordCount!==void 0&&e.resultRecordCount!==null&&(t.resultRecordCount=e.resultRecordCount.toString()),e.orderByFields&&(t.orderByFields=e.orderByFields.join(",")),e.objectIds&&e.objectIds.length>0&&(t.objectIds=e.objectIds.join(",")),e.outSpatialReference&&(t.outSR=JSON.stringify(e.outSpatialReference.toJSON())),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preRequestCallback({layer:this._layer,queryPayload:t,method:"relatedrecords",url:this._layer.parsedUrl.path+"/queryRelatedRecords"});const s=await j(this._layer.parsedUrl.path+"/queryRelatedRecords",{responseType:"json",query:t});if(s.data){const r={},a=s.data;if(a&&a.relatedRecordGroups){const n=a.spatialReference;for(const l of a.relatedRecordGroups){const u=l.objectId,o=[];for(const d of l.relatedRecords){d.geometry&&(d.geometry.spatialReference=n);const h=new q({geometry:d.geometry?ve(d.geometry):null,attributes:d.attributes});o.push(h)}r[u]={features:o,exceededTransferLimit:a.exceededTransferLimit===!0}}}return r}throw new C(D.InvalidRequest)}async getFeatureByObjectId(e,t){const s=new O;s.outFields=t,s.returnGeometry=!1,s.outSpatialReference=this.spatialReference,s.where=this.objectIdField+"="+e.toString(),this.featureSetQueryInterceptor&&this.featureSetQueryInterceptor.preLayerQueryCallback({layer:this._layer,query:s,method:"execute"});const i=await he(this._layer.parsedUrl.path,s);return i.features.length===1?i.features[0]:null}async getIdentityUser(){var t;await this.load();const e=(t=H)==null?void 0:t.findCredential(this._layer.url);return e?e.userId:null}async getOwningSystemUrl(){var i;await this.load();const e=(i=H)==null?void 0:i.findServerInfo(this._layer.url);if(e)return e.owningSystemUrl;let t=this._layer.url;const s=t.toLowerCase().indexOf("/rest/services");if(t=s>-1?t.substring(0,s):t,t){t+="/rest/info";try{const r=await j(t,{query:{f:"json"}});let a="";return r.data&&r.data.owningSystemUrl&&(a=r.data.owningSystemUrl),a}catch{return""}}return""}getDataSourceFeatureSet(){var t,s,i,r;const e=new Z({layer:this._layer,spatialReference:(t=this.spatialReference)!=null?t:void 0,outFields:(s=this._overrideFields)!=null?s:void 0,includeGeometry:!this._removeGeometry,lrucache:(i=this.recentlyUsedQueries)!=null?i:void 0,interceptor:(r=this.featureSetQueryInterceptor)!=null?r:void 0});return e._useDefinitionExpression=!1,e}}class le extends L{constructor(e){super(e),this.declaredClass="esri.arcade.featureset.sources.FeatureLayerMemory",this._removeGeometry=!1,this._overrideFields=null,this._forceIsTable=!1,e.spatialReference&&(this.spatialReference=e.spatialReference),this._transparent=!0,this._maxProcessing=1e3,this._layer=e.layer,this._wset=null,e.isTable===!0&&(this._forceIsTable=!0),e.outFields!==void 0&&(this._overrideFields=e.outFields),e.includeGeometry!==void 0&&(this._removeGeometry=e.includeGeometry===!1)}_maxQueryRate(){return re}end(){return this._layer}optimisePagingFeatureQueries(){}async loadImpl(){return this._layer.loaded===!0?(this._initialiseFeatureSet(),this):(await this._layer.load(),this._initialiseFeatureSet(),this)}get gdbVersion(){return""}_initialiseFeatureSet(){if(this.spatialReference==null&&(this.spatialReference=this._layer.spatialReference),this.geometryType=this._layer.geometryType,this.fields=this._layer.fields.slice(0),this._layer.outFields&&!(this._layer.outFields.length===1&&this._layer.outFields[0]==="*")){const e=[];for(const t of this.fields)if(t.type==="oid")e.push(t);else for(const s of this._layer.outFields)if(s.toLowerCase()===t.name.toLowerCase()){e.push(t);break}this.fields=e}if(this._overrideFields!==null)if(this._overrideFields.length===1&&this._overrideFields[0]==="*")this._overrideFields=null;else{const e=[],t=[];for(const s of this.fields)if(s.type==="oid")e.push(s),t.push(s.name);else for(const i of this._overrideFields)if(i.toLowerCase()===s.name.toLowerCase()){e.push(s),t.push(s.name);break}this.fields=e,this._overrideFields=t}this.objectIdField=this._layer.objectIdField;for(const e of this.fields)e.type==="global-id"&&(this.globalIdField=e.name);this.hasM=this._layer.supportsM,this.hasZ=this._layer.supportsZ,this._databaseType=k.Standardised,this.typeIdField=this._layer.typeIdField,this.types=this._layer.types}isTable(){return this._forceIsTable||this._layer.isTable||this._layer.type==="table"||!this._layer.geometryType}_isInFeatureSet(){return S.InFeatureSet}_candidateIdTransform(e){return e}async _getSet(e){if(this._wset===null){await this._ensureLoaded();const t=await this._getFilteredSet("",null,null,null,e);return this._wset=t,t}return this._wset}_changeFeature(e){const t={};for(const s of this.fields)t[s.name]=e.attributes[s.name];return new q({geometry:this._removeGeometry===!0?null:e.geometry,attributes:t})}async _getFilteredSet(e,t,s,i,r){let a="",n=!1;if(i!==null&&(a=i.constructClause(),n=!0),this.isTable()&&t&&e!==null&&e!=="")return new y([],[],!0,null);const l=new O;l.where=s===null?t===null?"1=1":"":v(s,k.Standardised),l.spatialRelationship=this._makeRelationshipEnum(e),l.outSpatialReference=this.spatialReference,l.orderByFields=a!==""?a.split(","):null,l.geometry=t===null?null:t,l.returnGeometry=!0,l.relationParameter=this._makeRelationshipParam(e);const u=await this._layer.queryFeatures(l);if(u===null)return new y([],[],n,null);this._checkCancelled(r);const o=[];return u.features.forEach(d=>{const h=d.attributes[this._layer.objectIdField];o.push(h),this._featureCache[h]=this._changeFeature(d)}),new y([],o,n,null)}_makeRelationshipEnum(e){if(e.includes("esriSpatialRelRelation"))return"relation";switch(e){case"esriSpatialRelRelation":return"relation";case"esriSpatialRelIntersects":return"intersects";case"esriSpatialRelContains":return"contains";case"esriSpatialRelOverlaps":return"overlaps";case"esriSpatialRelWithin":return"within";case"esriSpatialRelTouches":return"touches";case"esriSpatialRelCrosses":return"crosses";case"esriSpatialRelEnvelopeIntersects":return"envelope-intersects"}return e}_makeRelationshipParam(e){return e.includes("esriSpatialRelRelation")?e.split(":")[1]:""}async _queryAllFeatures(){if(this._wset)return this._wset;const e=new O;if(e.where="1=1",await this._ensureLoaded(),this._layer.source&&this._layer.source.items){const i=[];return this._layer.source.items.forEach(r=>{const a=r.attributes[this._layer.objectIdField];i.push(a),this._featureCache[a]=this._changeFeature(r)}),this._wset=new y([],i,!1,null),this._wset}const t=await this._layer.queryFeatures(e),s=[];return t.features.forEach(i=>{const r=i.attributes[this._layer.objectIdField];s.push(r),this._featureCache[r]=this._changeFeature(i)}),this._wset=new y([],s,!1,null),this._wset}async _getFeatures(e,t,s){const i=[];t!==-1&&this._featureCache[t]===void 0&&i.push(t);for(let r=e._lastFetchedIndex;rs)));r++);if(i.length===0)return"success";throw new C(D.MissingFeatures)}async _refineSetBlock(e){return e}async _stat(){return{calculated:!1}}async _canDoAggregates(){return!1}relationshipMetaData(){return[]}static _cloneAttr(e){const t={};for(const s in e)t[s]=e[s];return t}nativeCapabilities(){var e;return{title:(e=this._layer.title)!=null?e:"",canQueryRelated:!1,source:this,capabilities:this._layer.capabilities,databaseType:this._databaseType,requestStandardised:!0}}static create(e,t){let s=e.layerDefinition.objectIdField;const i=e.layerDefinition.typeIdField?e.layerDefinition.typeIdField:"",r=[];if(e.layerDefinition.types)for(const f of e.layerDefinition.types)r.push(Re.fromJSON(f));let a=e.layerDefinition.geometryType;a===void 0&&(a=e.featureSet.geometryType||"");let n=e.featureSet.features;const l=t.toJSON();if(s===""||s===void 0){let f=!1;for(const p of e.layerDefinition.fields)if(p.type==="oid"||p.type==="esriFieldTypeOID"){s=p.name,f=!0;break}if(f===!1){let p="FID",m=!0,I=0;for(;m;){let _=!0;for(const b of e.layerDefinition.fields)if(b.name===p){_=!1;break}_===!0?m=!1:(I++,p="FID"+I.toString())}e.layerDefinition.fields.push({type:"esriFieldTypeOID",name:p,alias:p});const F=[];for(let _=0;__.name):["*"]);u.outFields=o,u.relationshipId=this.relationship.id,u.where="1=1";let d=!0;this._removeGeometry===!0&&(d=!1),u.returnGeometry=d,this._requestStandardised&&(u.sqlFormat="standard"),u.outSpatialReference=this.spatialReference,u.orderByFields=n!==""?n.split(","):null;const h=await a.source.queryRelatedFeatures(u);this._checkCancelled(r);const f=h[this._findObjectId]?h[this._findObjectId].features:[],p=[];for(let _=0;_b.name):["*"]);return p=new y(h||f?["GETPAGES"]:[],h||f?[]:["GETPAGES"],n,{outFields:I.join(","),resultRecordCount:o,resultOffset:0,objectIds:[this._findObjectId],where:u,orderByFields:a,returnGeometry:m,returnIdsOnly:"false",internal:{set:[],lastRetrieved:0,lastPage:0,fullyResolved:!1}}),await this._expandPagedSet(p,o,0,0,r),p}_expandPagedSet(e,t,s,i,r){return this._expandPagedSetFeatureSet(e,t,s,i,r)}_clonePageDefinition(e){return e===null?null:e.groupbypage!==!0?{groupbypage:!1,outFields:e.outFields,resultRecordCount:e.resultRecordCount,resultOffset:e.resultOffset,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}:{groupbypage:!0,outFields:e.outFields,resultRecordCount:e.resultRecordCount,useOIDpagination:e.useOIDpagination,generatedOid:e.generatedOid,groupByFieldsForStatistics:e.groupByFieldsForStatistics,resultOffset:e.resultOffset,outStatistics:e.outStatistics,geometry:e.geometry,where:e.where,objectIds:e.objectIds,orderByFields:e.orderByFields,returnGeometry:e.returnGeometry,returnIdsOnly:e.returnIdsOnly,internal:e.internal}}async _getPhysicalPage(e,t,s){const i=e.pagesDefinition.internal.lastRetrieved,r=i,a=e.pagesDefinition.internal.lastPage,n=this._layer.nativeCapabilities(),l=new ce;this._requestStandardised===!0&&(l.sqlFormat="standard"),l.relationshipId=this.relationship.id,l.objectIds=e.pagesDefinition.objectIds,l.resultOffset=e.pagesDefinition.internal.lastPage,l.resultRecordCount=e.pagesDefinition.resultRecordCount,l.outFields=e.pagesDefinition.outFields.split(","),l.where=e.pagesDefinition.where,l.orderByFields=e.pagesDefinition.orderByFields!==""?e.pagesDefinition.orderByFields.split(","):null,l.returnGeometry=e.pagesDefinition.returnGeometry,l.outSpatialReference=this.spatialReference;const u=await n.source.queryRelatedFeatures(l);if(this._checkCancelled(s),e.pagesDefinition.internal.lastPage!==a)return 0;const o=u[this._findObjectId]?u[this._findObjectId].features:[];for(let h=0;hs)))&&!(n>=s&&r.length===0);l++);if(r.length===0)return"success";throw new C(D.MissingFeatures)}async _refineSetBlock(e,t,s){return e}async _stat(e,t,s,i,r,a,n){return{calculated:!1}}get gdbVersion(){return this._relatedLayer.gdbVersion}async _canDoAggregates(e,t,s,i,r){return!1}relationshipMetaData(){return this._relatedLayer.relationshipMetaData()}serviceUrl(){return this._relatedLayer.serviceUrl()}queryAttachments(e,t,s,i,r){return this._relatedLayer.queryAttachments(e,t,s,i,r)}getFeatureByObjectId(e,t){return this._relatedLayer.getFeatureByObjectId(e,t)}getOwningSystemUrl(){return this._relatedLayer.getOwningSystemUrl()}getIdentityUser(){return this._relatedLayer.getIdentityUser()}getDataSourceFeatureSet(){return this._relatedLayer}}function Ye(){g.applicationCache===null&&(g.applicationCache=new g)}async function te(c,e){if(g.applicationCache){const t=g.applicationCache.getLayerInfo(c);if(t){const r=await t;return new R({url:c,outFields:e,sourceJSON:r})}const s=new R({url:c,outFields:e}),i=(async()=>(await s.load(),s.sourceJSON))();if(g.applicationCache){g.applicationCache.setLayerInfo(c,i);try{return await i,s}catch(r){throw g.applicationCache.clearLayerInfo(c),r}}return await i,s}return new R({url:c,outFields:e})}async function oe(c,e,t,s,i,r=null){return E(await te(c,["*"]),e,t,s,i,r)}function E(c,e=null,t=null,s=!0,i=null,r=null){const a={layer:c,spatialReference:e,outFields:t,includeGeometry:s,lrucache:i,interceptor:r};return c._hasMemorySource()===!0?new le(a):new Z(a)}async function He(c){if(g.applicationCache!==null){const t=g.applicationCache.getLayerInfo(c);if(t!==null)return t}const e=(async()=>{const t=await j(c,{responseType:"json",query:{f:"json"}});return t.data?t.data:null})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(c,e);try{return await e}catch(t){throw g.applicationCache.clearLayerInfo(c),t}}return e}async function $e(c,e){const t="QUERYDATAELEMTS:"+e.toString()+":"+c;if(g.applicationCache!==null){const i=g.applicationCache.getLayerInfo(t);if(i!==null)return i}const s=(async()=>{const i=await j(c+"/queryDataElements",{method:"post",responseType:"json",query:{layers:JSON.stringify([e.toString()]),f:"json"}});if(i.data){const r=i.data;if(r.layerDataElements&&r.layerDataElements[0])return r.layerDataElements[0]}throw new C(D.DataElementsNotFound)})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(t,s);try{return await s}catch(i){throw g.applicationCache.clearLayerInfo(t),i}}return s}async function me(c){if(g.applicationCache!==null){const t=g.applicationCache.getLayerInfo(c);if(t!==null)return t}const e=(async()=>{const t=await j(c,{responseType:"json",query:{f:"json"}});if(t.data){const s=t.data;return s.layers||(s.layers=[]),s.tables||(s.tables=[]),s}return{layers:[],tables:[]}})();if(g.applicationCache!==null){g.applicationCache.setLayerInfo(c,e);try{return await e}catch(t){throw g.applicationCache.clearLayerInfo(c),t}}return e}async function et(c,e){const t={metadata:null,networkId:-1,unVersion:3,terminals:[],queryelem:null,layerNameLkp:{},lkp:null},s=await me(c);if(t.metadata=s,s.controllerDatasetLayers&&s.controllerDatasetLayers.utilityNetworkLayerId!==void 0&&s.controllerDatasetLayers.utilityNetworkLayerId!==null){if(s.layers)for(const a of s.layers)t.layerNameLkp[a.id]=a.name;if(s.tables)for(const a of s.tables)t.layerNameLkp[a.id]=a.name;const i=s.controllerDatasetLayers.utilityNetworkLayerId;t.networkId=i;const r=await $e(c,i);if(r){t.queryelem=r,t.queryelem&&t.queryelem.dataElement&&t.queryelem.dataElement.schemaGeneration!==void 0&&(t.unVersion=t.queryelem.dataElement.schemaGeneration),t.lkp={},t.queryelem.dataElement.domainNetworks||(t.queryelem.dataElement.domainNetworks=[]);for(const n of t.queryelem.dataElement.domainNetworks){for(const l of n.edgeSources?n.edgeSources:[]){const u={layerId:l.layerId,sourceId:l.sourceId,className:t.layerNameLkp[l.layerId]?t.layerNameLkp[l.layerId]:null};u.className&&(t.lkp[u.className]=u)}for(const l of n.junctionSources?n.junctionSources:[]){const u={layerId:l.layerId,sourceId:l.sourceId,className:t.layerNameLkp[l.layerId]?t.layerNameLkp[l.layerId]:null};u.className&&(t.lkp[u.className]=u)}}if(t.queryelem.dataElement.terminalConfigurations)for(const n of t.queryelem.dataElement.terminalConfigurations)for(const l of n.terminals)t.terminals.push({terminalId:l.terminalId,terminalName:l.terminalName});const a=await He(c+"/"+i);if(a.systemLayers&&a.systemLayers.associationsTableId!==void 0&&a.systemLayers.associationsTableId!==null){const n=[];t.unVersion>=4&&(n.push("STATUS"),n.push("PERCENTALONG"));let l=await oe(c+"/"+a.systemLayers.associationsTableId.toString(),e,["OBJECTID","FROMNETWORKSOURCEID","TONETWORKSOURCEID","FROMGLOBALID","TOGLOBALID","TOTERMINALID","FROMTERMINALID","ASSOCIATIONTYPE","ISCONTENTVISIBLE","GLOBALID",...n],!1,null,null);return await l.load(),t.unVersion>=4&&(l=l.filter(A.create("STATUS NOT IN (1, 2, 3, 4, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 41, 42, 43, 44, 45, 46, 47, 49, 50, 51, 52, 53, 54, 55, 57, 58, 59, 60, 61, 62,63)",l.getFieldsIndex())),await l.load()),{lkp:t.lkp,associations:l,unVersion:t.unVersion,terminals:t.terminals}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}return{associations:null,unVersion:t.unVersion,lkp:null,terminals:[]}}async function tt(c,e,t,s=null,i=null,r=!0,a=null,n=null){let l=c.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+e.relatedTableId.toString():l+"/"+e.relatedTableId.toString();const u=await oe(l,s,i,r,a,n);return new Xe({layer:c,relatedLayer:u,relationship:e,objectId:t,spatialReference:s,outFields:i,includeGeometry:r,lrucache:a,interceptor:n})}U.registerAction(),ae.registerAction(),M.registerAction(),qe.registerAction(),ne.registerAction();class st extends ge{constructor(e,t=null,s=null,i=null){super(),this._map=e,this._overridespref=t,this._lrucache=s,this._interceptor=i,this._instantLayers=[]}_makeAndAddFeatureSet(e,t=!0,s=null){const i=E(e,this._overridespref,s===null?["*"]:s,t,this._lrucache,this._interceptor);return this._instantLayers.push({featureset:i,opitem:e,includeGeometry:t,outFields:JSON.stringify(s)}),i}async featureSetByName(e,t=!0,s=null){if(this._map.loaded!==void 0&&this._map.load!==void 0&&this._map.loaded===!1)return await this._map.load(),this.featureSetByName(e,t,s);s===null&&(s=["*"]),s=(s=s.slice(0)).sort();const i=JSON.stringify(s);for(let a=0;aa instanceof R&&a.title===e);if(r)return this._makeAndAddFeatureSet(r,t,s);if(this._map.tables){const a=this._map.tables.find(n=>!!(n.title&&n.title===e||n.title&&n.title===e));if(a){if(a instanceof R)return this._makeAndAddFeatureSet(a,t,s);if(!a._materializedTable){const n=a.outFields?a:{...a,outFields:["*"]};a._materializedTable=new R(n)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,s)}}return null}async featureSetById(e,t=!0,s=["*"]){if(this._map.loaded!==void 0&&this._map.load!==void 0&&this._map.loaded===!1)return await this._map.load(),this.featureSetById(e,t,s);s===null&&(s=["*"]),s=(s=s.slice(0)).sort();const i=JSON.stringify(s);for(let a=0;aa instanceof R&&a.id===e);if(r)return this._makeAndAddFeatureSet(r,t,s);if(this._map.tables){const a=this._map.tables.find(n=>n.id===e);if(a){if(a instanceof R)return this._makeAndAddFeatureSet(a,t,s);if(!a._materializedTable){const n={...a,outFields:["*"]};a._materializedTable=new R(n)}return await a._materializedTable.load(),this._makeAndAddFeatureSet(a._materializedTable,t,s)}}return null}}class ue extends ge{constructor(e,t=null,s=null,i=null){super(),this._url=e,this._overridespref=t,this._lrucache=s,this._interceptor=i,this.metadata=null,this._instantLayers=[]}get url(){return this._url}_makeAndAddFeatureSet(e,t=!0,s=null){const i=E(e,this._overridespref,s===null?["*"]:s,t,this._lrucache);return this._instantLayers.push({featureset:i,opitem:e,includeGeometry:t,outFields:JSON.stringify(s)}),i}async _loadMetaData(){const e=await me(this._url);return this.metadata=e,e}load(){return this._loadMetaData()}clone(){return new ue(this._url,this._overridespref,this._lrucache,this._interceptor)}async featureSetByName(e,t=!0,s=null){s===null&&(s=["*"]),s=(s=s.slice(0)).sort();const i=JSON.stringify(s);for(let n=0;n0){const h=[];for(let i=0;i{N(e,0,2,n,r);let i=v(e[1],""),a=i===!0;if(i=i===!0||i===!1?"":A(i),e.length===0||e[0]instanceof Z){let d=null;n.services&&n.services.portal&&(d=n.services.portal),e.length>0&&(d=G(e[0],d));const o=await fe(d,i,a);if(o){const t=JSON.parse(JSON.stringify(o));for(const l of["lastLogin","created","modified"])t[l]!==void 0&&t[l]!==null&&(t[l]=new Date(t[l]));return L.convertObjectToArcadeDictionary(t)}return null}let f=null;if(P(e[0])&&(f=e[0]),f){if(a=!1,i)return null;await f.load();const d=await f.getOwningSystemUrl();if(!d){if(!i){const l=await f.getIdentityUser();return l?L.convertObjectToArcadeDictionary({username:l}):null}return null}let o=null;n.services&&n.services.portal&&(o=n.services.portal),o=G(new Z(d),o);const t=await fe(o,i,a);if(t){const l=JSON.parse(JSON.stringify(t));for(const c of["lastLogin","created","modified"])l[c]!==void 0&&l[c]!==null&&(l[c]=new Date(l[c]));return L.convertObjectToArcadeDictionary(l)}return null}throw new p(n,y.InvalidParameter,r)})},s.signatures.push({name:"getuser",min:1,max:2}),s.functions.featuresetbyid=function(n,r){return s.standardFunctionAsync(n,r,(m,h,e)=>{if(N(e,2,4,n,r),e[0]instanceof ce){const i=A(e[1]);let a=v(e[2],null);const f=z(v(e[3],!0));if(a===null&&(a=["*"]),x(a)===!1)throw new p(n,y.InvalidParameter,r);return e[0].featureSetById(i,f,a)}throw new p(n,y.InvalidParameter,r)})},s.signatures.push({name:"featuresetbyid",min:2,max:4}),s.functions.getfeatureset=function(n,r){return s.standardFunctionAsync(n,r,(m,h,e)=>{if(N(e,1,2,n,r),_(e[0])){let i=v(e[1],"datasource");return i===null&&(i="datasource"),i=A(i).toLowerCase(),De(e[0].fullSchema(),i,n.lrucache,n.interceptor,n.spatialReference)}throw new p(n,y.InvalidParameter,r)})},s.signatures.push({name:"getfeatureset",min:1,max:2}),s.functions.featuresetbyportalitem=function(n,r){return s.standardFunctionAsync(n,r,(m,h,e)=>{if(N(e,2,5,n,r),e[0]===null)throw new p(n,y.PortalRequired,r);if(e[0]instanceof Z){const o=A(e[1]),t=A(e[2]);let l=v(e[3],null);const c=z(v(e[4],!0));if(l===null&&(l=["*"]),x(l)===!1)throw new p(n,y.InvalidParameter,r);let F=null;return n.services&&n.services.portal&&(F=n.services.portal),F=G(e[0],F),ue(o,t,n.spatialReference,l,c,F,n.lrucache,n.interceptor)}if(C(e[0])===!1)throw new p(n,y.PortalRequired,r);const i=A(e[0]),a=A(e[1]);let f=v(e[2],null);const d=z(v(e[3],!0));if(f===null&&(f=["*"]),x(f)===!1)throw new p(n,y.InvalidParameter,r);if(n.services&&n.services.portal)return ue(i,a,n.spatialReference,f,d,n.services.portal,n.lrucache,n.interceptor);throw new p(n,y.PortalRequired,r)})},s.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),s.functions.featuresetbyname=function(n,r){return s.standardFunctionAsync(n,r,(m,h,e)=>{if(N(e,2,4,n,r),e[0]instanceof ce){const i=A(e[1]);let a=v(e[2],null);const f=z(v(e[3],!0));if(a===null&&(a=["*"]),x(a)===!1)throw new p(n,y.InvalidParameter,r);return e[0].featureSetByName(i,f,a)}throw new p(n,y.InvalidParameter,r)})},s.signatures.push({name:"featuresetbyname",min:2,max:4}),s.functions.featureset=function(n,r){return s.standardFunction(n,r,(m,h,e)=>{N(e,1,1,n,r);let i=e[0];const a={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",fields:[]},featureSet:{geometryType:"",features:[]}};if(C(i))i=JSON.parse(i),i.layerDefinition!==void 0?(a.layerDefinition=i.layerDefinition,a.featureSet=i.featureSet,i.layerDefinition.spatialReference&&(a.layerDefinition.spatialReference=i.layerDefinition.spatialReference)):(a.featureSet.features=i.features,a.featureSet.geometryType=i.geometryType,a.layerDefinition.geometryType=a.featureSet.geometryType,a.layerDefinition.objectIdField=i.objectIdFieldName,a.layerDefinition.typeIdField=i.typeIdFieldName,a.layerDefinition.globalIdField=i.globalIdFieldName,a.layerDefinition.fields=i.fields,i.spatialReference&&(a.layerDefinition.spatialReference=i.spatialReference));else{if(!(e[0]instanceof L))throw new p(n,y.InvalidParameter,r);{i=JSON.parse(e[0].castToText(!0));const f=u(i,"layerdefinition");if(f!==null){a.layerDefinition.geometryType=u(f,"geometrytype",""),a.featureSet.geometryType=a.layerDefinition.geometryType,a.layerDefinition.globalIdField=u(f,"globalidfield",""),a.layerDefinition.objectIdField=u(f,"objectidfield",""),a.layerDefinition.typeIdField=u(f,"typeidfield","");const d=u(f,"spatialreference",null);d&&(a.layerDefinition.spatialReference=ie(d));for(const t of u(f,"fields",[])){const l={name:u(t,"name",""),alias:u(t,"alias",""),type:u(t,"type",""),nullable:u(t,"nullable",!0),editable:u(t,"editable",!0),length:u(t,"length",null),domain:pe(u(t,"domain"))};a.layerDefinition.fields.push(l)}const o=u(i,"featureset",null);if(o){const t={};for(const l of a.layerDefinition.fields)t[l.name.toLowerCase()]=l.name;for(const l of u(o,"features",[])){const c={},F=u(l,"attributes",{});for(const b in F)c[t[b.toLowerCase()]]=F[b];a.featureSet.features.push({attributes:c,geometry:ye(u(l,"geometry",null))})}}}else{a.layerDefinition.geometryType=u(i,"geometrytype",""),a.featureSet.geometryType=a.layerDefinition.geometryType,a.layerDefinition.objectIdField=u(i,"objectidfieldname",""),a.layerDefinition.typeIdField=u(i,"typeidfieldname","");const d=u(i,"spatialreference",null);d&&(a.layerDefinition.spatialReference=ie(d));for(const t of u(i,"fields",[])){const l={name:u(t,"name",""),alias:u(t,"alias",""),type:u(t,"type",""),nullable:u(t,"nullable",!0),editable:u(t,"editable",!0),length:u(t,"length",null),domain:pe(u(t,"domain"))};a.layerDefinition.fields.push(l)}const o={};for(const t of a.layerDefinition.fields)o[t.name.toLowerCase()]=t.name;for(const t of u(i,"features",[])){const l={},c=u(t,"attributes",{});for(const F in c)l[o[F.toLowerCase()]]=c[F];a.featureSet.features.push({attributes:l,geometry:ye(u(t,"geometry",null))})}}}}if(Me(a)===!1)throw new p(n,y.InvalidParameter,r);return be.create(a,n.spatialReference)})},s.signatures.push({name:"featureset",min:1,max:1}),s.functions.filter=function(n,r){return s.standardFunctionAsync(n,r,async(m,h,e)=>{if(N(e,2,2,n,r),x(e[0])||j(e[0])){const i=[];let a=e[0];a instanceof he&&(a=a.toArray());let f=null;if(!Fe(e[1]))throw new p(n,y.InvalidParameter,r);f=e[1].createFunction(n);for(const d of a){const o=f(d);Re(o)?await o===!0&&i.push(d):o===!0&&i.push(d)}return i}if(P(e[0])){const i=await e[0].load(),a=E.create(e[1],i.getFieldsIndex()),f=a.getVariables();if(f.length>0){const d=[];for(let t=0;t{if(N(e,2,2,n,r),P(e[0])){const i=new Ne(e[1]);return new Ae({parentfeatureset:e[0],orderbyclause:i})}throw new p(n,y.InvalidParameter,r)})},s.signatures.push({name:"orderby",min:2,max:2}),s.functions.top=function(n,r){return s.standardFunctionAsync(n,r,async(m,h,e)=>{if(N(e,2,2,n,r),P(e[0]))return new xe({parentfeatureset:e[0],topnum:e[1]});if(x(e[0]))return H(e[1])>=e[0].length?e[0].slice(0):e[0].slice(0,H(e[1]));if(j(e[0]))return H(e[1])>=e[0].length()?e[0].slice(0):e[0].slice(0,H(e[1]));throw new p(n,y.InvalidParameter,r)})},s.signatures.push({name:"top",min:2,max:2}),s.functions.first=function(n,r){return s.standardFunctionAsync(n,r,async(m,h,e)=>{if(N(e,1,1,n,r),P(e[0])){const i=await e[0].first(m.abortSignal);if(i!==null){const a=Ie.createFromGraphicLikeObject(i.geometry,i.attributes,e[0]);return a._underlyingGraphic=i,a}return i}return x(e[0])?e[0].length===0?null:e[0][0]:j(e[0])?e[0].length()===0?null:e[0].get(0):null})},s.signatures.push({name:"first",min:1,max:1}),s.functions.attachments=function(n,r){return s.standardFunctionAsync(n,r,async(m,h,e)=>{N(e,1,2,n,r);const i={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(e.length>1){if(e[1]instanceof L){if(e[1].hasField("minsize")&&(i.minsize=H(e[1].field("minsize"))),e[1].hasField("metadata")&&(i.returnMetadata=z(e[1].field("metadata"))),e[1].hasField("maxsize")&&(i.maxsize=H(e[1].field("maxsize"))),e[1].hasField("types")){const a=Ee(e[1].field("types"),!1);a.length>0&&(i.types=a)}}else if(e[1]!==null)throw new p(n,y.InvalidParameter,r)}if(_(e[0])){let a=e[0]._layer;return a instanceof ne&&(a=$(a,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),a===null?[]:P(a)===!1?[]:(await a.load(),a.queryAttachments(e[0].field(a.objectIdField),i.minsize,i.maxsize,i.types,i.returnMetadata))}if(e[0]===null)return[];throw new p(n,y.InvalidParameter,r)})},s.signatures.push({name:"attachments",min:1,max:2}),s.functions.featuresetbyrelationshipname=function(n,r){return s.standardFunctionAsync(n,r,async(m,h,e)=>{N(e,2,4,n,r);const i=e[0],a=A(e[1]);let f=v(e[2],null);const d=z(v(e[3],!0));if(f===null&&(f=["*"]),x(f)===!1)throw new p(n,y.InvalidParameter,r);if(e[0]===null)return null;if(!_(e[0]))throw new p(n,y.InvalidParameter,r);let o=i._layer;if(o instanceof ne&&(o=$(o,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),o===null||P(o)===!1)return null;o=await o.load();const t=o.relationshipMetaData().filter(I=>I.name===a);if(t.length===0)return null;if(t[0].relationshipTableId!==void 0&&t[0].relationshipTableId!==null&&t[0].relationshipTableId>-1)return ve(o,t[0],i.field(o.objectIdField),o.spatialReference,f,d,n.lrucache,n.interceptor);let l=o.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+t[0].relatedTableId.toString():l+"/"+t[0].relatedTableId.toString();const c=await Se(l,o.spatialReference,f,d,n.lrucache,n.interceptor);await c.load();let F=c.relationshipMetaData();if(F=F.filter(I=>I.id===t[0].id),i.hasField(t[0].keyField)===!1||i.field(t[0].keyField)===null){const I=await o.getFeatureByObjectId(i.field(o.objectIdField),[t[0].keyField]);if(I){const D=E.create(F[0].keyField+"= @id",c.getFieldsIndex());return D.parameters={id:I.attributes[t[0].keyField]},c.filter(D)}return new Pe({parentfeatureset:c})}const b=E.create(F[0].keyField+"= @id",c.getFieldsIndex());return b.parameters={id:i.field(t[0].keyField)},c.filter(b)})},s.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),s.functions.featuresetbyassociation=function(n,r){return s.standardFunctionAsync(n,r,async(m,h,e)=>{N(e,2,3,n,r);const i=e[0],a=A(v(e[1],"")).toLowerCase(),f=C(e[2])?A(e[2]):null;if(e[0]===null)return null;if(!_(e[0]))throw new p(n,y.InvalidParameter,r);let d=i._layer;if(d instanceof ne&&(d=$(d,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),d===null||P(d)===!1)return null;await d.load();const o=d.serviceUrl(),t=await Le(o,n.spatialReference);let l=null,c=null,F=!1;if(f!==null&&f!==""&&f!==void 0){for(const w of t.terminals)w.terminalName===f&&(c=w.terminalId);c===null&&(F=!0)}const b=t.associations.getFieldsIndex(),I=b.get("TOGLOBALID").name,D=b.get("FROMGLOBALID").name,U=b.get("TOTERMINALID").name,K=b.get("FROMTERMINALID").name,J=b.get("FROMNETWORKSOURCEID").name,V=b.get("TONETWORKSOURCEID").name,M=b.get("ASSOCIATIONTYPE").name,ge=b.get("ISCONTENTVISIBLE").name,we=b.get("OBJECTID").name;for(const w of d.fields)if(w.type==="global-id"){l=i.field(w.name);break}let R=null,ae=new k(new W({name:"percentalong",alias:"percentalong",type:"double"}),E.create("0",t.associations.getFieldsIndex())),re=new k(new W({name:"side",alias:"side",type:"string"}),E.create("''",t.associations.getFieldsIndex()));const S="globalid",se="globalId",le={};for(const w in t.lkp)le[w]=t.lkp[w].sourceId;const O=new Te(new W({name:"classname",alias:"classname",type:"string"}),null,le);let g="";switch(a){case"midspan":{g=`((${I}='${l}') OR ( ${D}='${l}')) AND (${M} IN (5))`,O.codefield=E.create(`CASE WHEN (${I}='${l}') THEN ${J} ELSE ${V} END`,t.associations.getFieldsIndex());const w=X(T.findField(t.associations.fields,D));w.name=S,w.alias=S,R=new k(w,E.create(`CASE WHEN (${D}='${l}') THEN ${I} ELSE ${D} END`,t.associations.getFieldsIndex())),ae=t.unVersion>=4?new ee(T.findField(t.associations.fields,b.get("PERCENTALONG").name)):new k(new W({name:"percentalong",alias:"percentalong",type:"double"}),E.create("0",t.associations.getFieldsIndex()));break}case"junctionedge":{g=`((${I}='${l}') OR ( ${D}='${l}')) AND (${M} IN (4,6))`,O.codefield=E.create(`CASE WHEN (${I}='${l}') THEN ${J} ELSE ${V} END`,t.associations.getFieldsIndex());const w=X(T.findField(t.associations.fields,D));w.name=S,w.alias=S,R=new k(w,E.create(`CASE WHEN (${D}='${l}') THEN ${I} ELSE ${D} END`,t.associations.getFieldsIndex())),re=new k(new W({name:"side",alias:"side",type:"string"}),E.create(`CASE WHEN (${M}=4) THEN 'from' ELSE 'to' END`,t.associations.getFieldsIndex()));break}case"connected":{let w=`${I}='@T'`,oe=`${D}='@T'`;c!==null&&(w+=` AND ${U}=@A`,oe+=` AND ${K}=@A`),g="(("+w+") OR ("+oe+"))",g=q(g,"@T",l!=null?l:""),w=q(w,"@T",l!=null?l:""),c!==null&&(w=q(w,"@A",c.toString()),g=q(g,"@A",c.toString())),O.codefield=E.create("CASE WHEN "+w+` THEN ${J} ELSE ${V} END`,t.associations.getFieldsIndex());const Y=X(T.findField(t.associations.fields,D));Y.name=S,Y.alias=S,R=new k(Y,E.create("CASE WHEN "+w+` THEN ${D} ELSE ${I} END`,t.associations.getFieldsIndex()));break}case"container":g=`${I}='${l}' AND ${M} = 2`,c!==null&&(g+=` AND ${U} = `+c.toString()),O.codefield=J,g="( "+g+" )",R=new B(T.findField(t.associations.fields,D),S,S);case"content":g=`(${D}='${l}' AND ${M} = 2)`,c!==null&&(g+=` AND ${K} = `+c.toString()),O.codefield=V,g="( "+g+" )",R=new B(T.findField(t.associations.fields,I),S,S);break;case"structure":g=`(${I}='${l}' AND ${M} = 3)`,c!==null&&(g+=` AND ${U} = `+c.toString()),O.codefield=J,g="( "+g+" )",R=new B(T.findField(t.associations.fields,D),S,se);break;case"attached":g=`(${D}='${l}' AND ${M} = 3)`,c!==null&&(g+=` AND ${K} = `+c.toString()),O.codefield=V,g="( "+g+" )",R=new B(T.findField(t.associations.fields,I),S,se);break;default:throw new p(n,y.InvalidParameter,r)}return F&&(g="1 <> 1"),new T({parentfeatureset:t.associations,adaptedFields:[new ee(T.findField(t.associations.fields,we)),new ee(T.findField(t.associations.fields,ge)),R,re,O,ae],extraFilter:g?E.create(g,t.associations.getFieldsIndex()):null})})},s.signatures.push({name:"featuresetbyassociation",min:2,max:6}),s.functions.groupby=function(n,r){return s.standardFunctionAsync(n,r,async(m,h,e)=>{if(N(e,3,3,n,r),!P(e[0]))throw new p(n,y.InvalidParameter,r);const i=await e[0].load(),a=[],f=[];let d=!1,o=[];if(C(e[1]))o.push(e[1]);else if(e[1]instanceof L)o.push(e[1]);else if(x(e[1]))o=e[1];else{if(!j(e[1]))throw new p(n,y.InvalidParameter,r);o=e[1].toArray()}for(const t of o)if(C(t)){const l=E.create(A(t),i.getFieldsIndex()),c=me(l)===!0?A(t):"%%%%FIELDNAME";a.push({name:c,expression:l}),c==="%%%%FIELDNAME"&&(d=!0)}else{if(!(t instanceof L))throw new p(n,y.InvalidParameter,r);{const l=t.hasField("name")?t.field("name"):"%%%%FIELDNAME",c=t.hasField("expression")?t.field("expression"):"";if(l==="%%%%FIELDNAME"&&(d=!0),!l)throw new p(n,y.InvalidParameter,r);a.push({name:l,expression:E.create(c||l,i.getFieldsIndex())})}}if(o=[],C(e[2]))o.push(e[2]);else if(x(e[2]))o=e[2];else if(j(e[2]))o=e[2].toArray();else{if(!(e[2]instanceof L))throw new p(n,y.InvalidParameter,r);o.push(e[2])}for(const t of o){if(!(t instanceof L))throw new p(n,y.InvalidParameter,r);{const l=t.hasField("name")?t.field("name"):"",c=t.hasField("statistic")?t.field("statistic"):"",F=t.hasField("expression")?t.field("expression"):"";if(!l||!c||!F)throw new p(n,y.InvalidParameter,r);f.push({name:l,statistic:c.toLowerCase(),expression:E.create(F,i.getFieldsIndex())})}}if(d){const t={};for(const c of i.fields)t[c.name.toLowerCase()]=1;for(const c of a)c.name!=="%%%%FIELDNAME"&&(t[c.name.toLowerCase()]=1);for(const c of f)c.name!=="%%%%FIELDNAME"&&(t[c.name.toLowerCase()]=1);let l=0;for(const c of a)if(c.name==="%%%%FIELDNAME"){for(;t["field_"+l.toString()]===1;)l++;t["field_"+l.toString()]=1,c.name="FIELD_"+l.toString()}}for(const t of a)await te(t.expression,s,n);for(const t of f)await te(t.expression,s,n);return e[0].groupby(a,f)})},s.signatures.push({name:"groupby",min:3,max:3}),s.functions.distinct=function(n,r){return s.standardFunctionAsync(n,r,async(m,h,e)=>{if(P(e[0])){N(e,2,2,n,r);const i=await e[0].load(),a=[];let f=[];if(C(e[1]))f.push(e[1]);else if(e[1]instanceof L)f.push(e[1]);else if(x(e[1]))f=e[1];else{if(!j(e[1]))throw new p(n,y.InvalidParameter,r);f=e[1].toArray()}let d=!1;for(const o of f)if(C(o)){const t=E.create(A(o),i.getFieldsIndex()),l=me(t)===!0?A(o):"%%%%FIELDNAME";a.push({name:l,expression:t}),l==="%%%%FIELDNAME"&&(d=!0)}else{if(!(o instanceof L))throw new p(n,y.InvalidParameter,r);{const t=o.hasField("name")?o.field("name"):"%%%%FIELDNAME",l=o.hasField("expression")?o.field("expression"):"";if(t==="%%%%FIELDNAME"&&(d=!0),!t)throw new p(n,y.InvalidParameter,r);a.push({name:t,expression:E.create(l||t,i.getFieldsIndex())})}}if(d){const o={};for(const l of i.fields)o[l.name.toLowerCase()]=1;for(const l of a)l.name!=="%%%%FIELDNAME"&&(o[l.name.toLowerCase()]=1);let t=0;for(const l of a)if(l.name==="%%%%FIELDNAME"){for(;o["field_"+t.toString()]===1;)t++;o["field_"+t.toString()]=1,l.name="FIELD_"+t.toString()}}for(const o of a)await te(o.expression,s,n);return e[0].groupby(a,[])}return Oe("distinct",m,h,e)})})}export{qe as registerFunctions}; +import{V as N,y as v,K as A,ai as Z,J as L,P,t as p,e as y,L as z,Y as x,c as _,w as C,E as j,aj as he,F as Fe,r as H,h as Ie,ak as Ee,al as q,a1 as X,am as Q}from"./arcadeUtils.09abf965.js";import{D as G,q as fe,e as ce,v as De,G as ue,d as be,c as de,a as Ne,b as Ae,f as xe,F as $,k as ve,N as Se,C as Le,x as k,E as Te,W as B,A as T,g as ee}from"./featureSetUtils.e062de4c.js";import{u as Pe,w as me}from"./SpatialFilter.fd0a95ff.js";import{hD as Re,hZ as ne,gG as W}from"./index.221827cd.js";import{WhereClause as E}from"./WhereClause.5b749615.js";import"./number.9e690eda.js";import"./executeForIds.9f78e2a6.js";import"./geometryEngineAsync.68619ff9.js";function Oe(s,n,r,m){if(m.length===1){if(x(m[0]))return Q(s,m[0],-1);if(j(m[0]))return Q(s,m[0].toArray(),-1)}return Q(s,m,-1)}async function te(s,n,r){const m=s.getVariables();if(m.length>0){const h=[];for(let i=0;i{N(e,0,2,n,r);let i=v(e[1],""),a=i===!0;if(i=i===!0||i===!1?"":A(i),e.length===0||e[0]instanceof Z){let d=null;n.services&&n.services.portal&&(d=n.services.portal),e.length>0&&(d=G(e[0],d));const o=await fe(d,i,a);if(o){const t=JSON.parse(JSON.stringify(o));for(const l of["lastLogin","created","modified"])t[l]!==void 0&&t[l]!==null&&(t[l]=new Date(t[l]));return L.convertObjectToArcadeDictionary(t)}return null}let f=null;if(P(e[0])&&(f=e[0]),f){if(a=!1,i)return null;await f.load();const d=await f.getOwningSystemUrl();if(!d){if(!i){const l=await f.getIdentityUser();return l?L.convertObjectToArcadeDictionary({username:l}):null}return null}let o=null;n.services&&n.services.portal&&(o=n.services.portal),o=G(new Z(d),o);const t=await fe(o,i,a);if(t){const l=JSON.parse(JSON.stringify(t));for(const c of["lastLogin","created","modified"])l[c]!==void 0&&l[c]!==null&&(l[c]=new Date(l[c]));return L.convertObjectToArcadeDictionary(l)}return null}throw new p(n,y.InvalidParameter,r)})},s.signatures.push({name:"getuser",min:1,max:2}),s.functions.featuresetbyid=function(n,r){return s.standardFunctionAsync(n,r,(m,h,e)=>{if(N(e,2,4,n,r),e[0]instanceof ce){const i=A(e[1]);let a=v(e[2],null);const f=z(v(e[3],!0));if(a===null&&(a=["*"]),x(a)===!1)throw new p(n,y.InvalidParameter,r);return e[0].featureSetById(i,f,a)}throw new p(n,y.InvalidParameter,r)})},s.signatures.push({name:"featuresetbyid",min:2,max:4}),s.functions.getfeatureset=function(n,r){return s.standardFunctionAsync(n,r,(m,h,e)=>{if(N(e,1,2,n,r),_(e[0])){let i=v(e[1],"datasource");return i===null&&(i="datasource"),i=A(i).toLowerCase(),De(e[0].fullSchema(),i,n.lrucache,n.interceptor,n.spatialReference)}throw new p(n,y.InvalidParameter,r)})},s.signatures.push({name:"getfeatureset",min:1,max:2}),s.functions.featuresetbyportalitem=function(n,r){return s.standardFunctionAsync(n,r,(m,h,e)=>{if(N(e,2,5,n,r),e[0]===null)throw new p(n,y.PortalRequired,r);if(e[0]instanceof Z){const o=A(e[1]),t=A(e[2]);let l=v(e[3],null);const c=z(v(e[4],!0));if(l===null&&(l=["*"]),x(l)===!1)throw new p(n,y.InvalidParameter,r);let F=null;return n.services&&n.services.portal&&(F=n.services.portal),F=G(e[0],F),ue(o,t,n.spatialReference,l,c,F,n.lrucache,n.interceptor)}if(C(e[0])===!1)throw new p(n,y.PortalRequired,r);const i=A(e[0]),a=A(e[1]);let f=v(e[2],null);const d=z(v(e[3],!0));if(f===null&&(f=["*"]),x(f)===!1)throw new p(n,y.InvalidParameter,r);if(n.services&&n.services.portal)return ue(i,a,n.spatialReference,f,d,n.services.portal,n.lrucache,n.interceptor);throw new p(n,y.PortalRequired,r)})},s.signatures.push({name:"featuresetbyportalitem",min:2,max:5}),s.functions.featuresetbyname=function(n,r){return s.standardFunctionAsync(n,r,(m,h,e)=>{if(N(e,2,4,n,r),e[0]instanceof ce){const i=A(e[1]);let a=v(e[2],null);const f=z(v(e[3],!0));if(a===null&&(a=["*"]),x(a)===!1)throw new p(n,y.InvalidParameter,r);return e[0].featureSetByName(i,f,a)}throw new p(n,y.InvalidParameter,r)})},s.signatures.push({name:"featuresetbyname",min:2,max:4}),s.functions.featureset=function(n,r){return s.standardFunction(n,r,(m,h,e)=>{N(e,1,1,n,r);let i=e[0];const a={layerDefinition:{geometryType:"",objectIdField:"",globalIdField:"",typeIdField:"",fields:[]},featureSet:{geometryType:"",features:[]}};if(C(i))i=JSON.parse(i),i.layerDefinition!==void 0?(a.layerDefinition=i.layerDefinition,a.featureSet=i.featureSet,i.layerDefinition.spatialReference&&(a.layerDefinition.spatialReference=i.layerDefinition.spatialReference)):(a.featureSet.features=i.features,a.featureSet.geometryType=i.geometryType,a.layerDefinition.geometryType=a.featureSet.geometryType,a.layerDefinition.objectIdField=i.objectIdFieldName,a.layerDefinition.typeIdField=i.typeIdFieldName,a.layerDefinition.globalIdField=i.globalIdFieldName,a.layerDefinition.fields=i.fields,i.spatialReference&&(a.layerDefinition.spatialReference=i.spatialReference));else{if(!(e[0]instanceof L))throw new p(n,y.InvalidParameter,r);{i=JSON.parse(e[0].castToText(!0));const f=u(i,"layerdefinition");if(f!==null){a.layerDefinition.geometryType=u(f,"geometrytype",""),a.featureSet.geometryType=a.layerDefinition.geometryType,a.layerDefinition.globalIdField=u(f,"globalidfield",""),a.layerDefinition.objectIdField=u(f,"objectidfield",""),a.layerDefinition.typeIdField=u(f,"typeidfield","");const d=u(f,"spatialreference",null);d&&(a.layerDefinition.spatialReference=ie(d));for(const t of u(f,"fields",[])){const l={name:u(t,"name",""),alias:u(t,"alias",""),type:u(t,"type",""),nullable:u(t,"nullable",!0),editable:u(t,"editable",!0),length:u(t,"length",null),domain:pe(u(t,"domain"))};a.layerDefinition.fields.push(l)}const o=u(i,"featureset",null);if(o){const t={};for(const l of a.layerDefinition.fields)t[l.name.toLowerCase()]=l.name;for(const l of u(o,"features",[])){const c={},F=u(l,"attributes",{});for(const b in F)c[t[b.toLowerCase()]]=F[b];a.featureSet.features.push({attributes:c,geometry:ye(u(l,"geometry",null))})}}}else{a.layerDefinition.geometryType=u(i,"geometrytype",""),a.featureSet.geometryType=a.layerDefinition.geometryType,a.layerDefinition.objectIdField=u(i,"objectidfieldname",""),a.layerDefinition.typeIdField=u(i,"typeidfieldname","");const d=u(i,"spatialreference",null);d&&(a.layerDefinition.spatialReference=ie(d));for(const t of u(i,"fields",[])){const l={name:u(t,"name",""),alias:u(t,"alias",""),type:u(t,"type",""),nullable:u(t,"nullable",!0),editable:u(t,"editable",!0),length:u(t,"length",null),domain:pe(u(t,"domain"))};a.layerDefinition.fields.push(l)}const o={};for(const t of a.layerDefinition.fields)o[t.name.toLowerCase()]=t.name;for(const t of u(i,"features",[])){const l={},c=u(t,"attributes",{});for(const F in c)l[o[F.toLowerCase()]]=c[F];a.featureSet.features.push({attributes:l,geometry:ye(u(t,"geometry",null))})}}}}if(Me(a)===!1)throw new p(n,y.InvalidParameter,r);return be.create(a,n.spatialReference)})},s.signatures.push({name:"featureset",min:1,max:1}),s.functions.filter=function(n,r){return s.standardFunctionAsync(n,r,async(m,h,e)=>{if(N(e,2,2,n,r),x(e[0])||j(e[0])){const i=[];let a=e[0];a instanceof he&&(a=a.toArray());let f=null;if(!Fe(e[1]))throw new p(n,y.InvalidParameter,r);f=e[1].createFunction(n);for(const d of a){const o=f(d);Re(o)?await o===!0&&i.push(d):o===!0&&i.push(d)}return i}if(P(e[0])){const i=await e[0].load(),a=E.create(e[1],i.getFieldsIndex()),f=a.getVariables();if(f.length>0){const d=[];for(let t=0;t{if(N(e,2,2,n,r),P(e[0])){const i=new Ne(e[1]);return new Ae({parentfeatureset:e[0],orderbyclause:i})}throw new p(n,y.InvalidParameter,r)})},s.signatures.push({name:"orderby",min:2,max:2}),s.functions.top=function(n,r){return s.standardFunctionAsync(n,r,async(m,h,e)=>{if(N(e,2,2,n,r),P(e[0]))return new xe({parentfeatureset:e[0],topnum:e[1]});if(x(e[0]))return H(e[1])>=e[0].length?e[0].slice(0):e[0].slice(0,H(e[1]));if(j(e[0]))return H(e[1])>=e[0].length()?e[0].slice(0):e[0].slice(0,H(e[1]));throw new p(n,y.InvalidParameter,r)})},s.signatures.push({name:"top",min:2,max:2}),s.functions.first=function(n,r){return s.standardFunctionAsync(n,r,async(m,h,e)=>{if(N(e,1,1,n,r),P(e[0])){const i=await e[0].first(m.abortSignal);if(i!==null){const a=Ie.createFromGraphicLikeObject(i.geometry,i.attributes,e[0]);return a._underlyingGraphic=i,a}return i}return x(e[0])?e[0].length===0?null:e[0][0]:j(e[0])?e[0].length()===0?null:e[0].get(0):null})},s.signatures.push({name:"first",min:1,max:1}),s.functions.attachments=function(n,r){return s.standardFunctionAsync(n,r,async(m,h,e)=>{N(e,1,2,n,r);const i={minsize:-1,maxsize:-1,types:null,returnMetadata:!1};if(e.length>1){if(e[1]instanceof L){if(e[1].hasField("minsize")&&(i.minsize=H(e[1].field("minsize"))),e[1].hasField("metadata")&&(i.returnMetadata=z(e[1].field("metadata"))),e[1].hasField("maxsize")&&(i.maxsize=H(e[1].field("maxsize"))),e[1].hasField("types")){const a=Ee(e[1].field("types"),!1);a.length>0&&(i.types=a)}}else if(e[1]!==null)throw new p(n,y.InvalidParameter,r)}if(_(e[0])){let a=e[0]._layer;return a instanceof ne&&(a=$(a,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),a===null?[]:P(a)===!1?[]:(await a.load(),a.queryAttachments(e[0].field(a.objectIdField),i.minsize,i.maxsize,i.types,i.returnMetadata))}if(e[0]===null)return[];throw new p(n,y.InvalidParameter,r)})},s.signatures.push({name:"attachments",min:1,max:2}),s.functions.featuresetbyrelationshipname=function(n,r){return s.standardFunctionAsync(n,r,async(m,h,e)=>{N(e,2,4,n,r);const i=e[0],a=A(e[1]);let f=v(e[2],null);const d=z(v(e[3],!0));if(f===null&&(f=["*"]),x(f)===!1)throw new p(n,y.InvalidParameter,r);if(e[0]===null)return null;if(!_(e[0]))throw new p(n,y.InvalidParameter,r);let o=i._layer;if(o instanceof ne&&(o=$(o,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),o===null||P(o)===!1)return null;o=await o.load();const t=o.relationshipMetaData().filter(I=>I.name===a);if(t.length===0)return null;if(t[0].relationshipTableId!==void 0&&t[0].relationshipTableId!==null&&t[0].relationshipTableId>-1)return ve(o,t[0],i.field(o.objectIdField),o.spatialReference,f,d,n.lrucache,n.interceptor);let l=o.serviceUrl();if(!l)return null;l=l.charAt(l.length-1)==="/"?l+t[0].relatedTableId.toString():l+"/"+t[0].relatedTableId.toString();const c=await Se(l,o.spatialReference,f,d,n.lrucache,n.interceptor);await c.load();let F=c.relationshipMetaData();if(F=F.filter(I=>I.id===t[0].id),i.hasField(t[0].keyField)===!1||i.field(t[0].keyField)===null){const I=await o.getFeatureByObjectId(i.field(o.objectIdField),[t[0].keyField]);if(I){const D=E.create(F[0].keyField+"= @id",c.getFieldsIndex());return D.parameters={id:I.attributes[t[0].keyField]},c.filter(D)}return new Pe({parentfeatureset:c})}const b=E.create(F[0].keyField+"= @id",c.getFieldsIndex());return b.parameters={id:i.field(t[0].keyField)},c.filter(b)})},s.signatures.push({name:"featuresetbyrelationshipname",min:2,max:4}),s.functions.featuresetbyassociation=function(n,r){return s.standardFunctionAsync(n,r,async(m,h,e)=>{N(e,2,3,n,r);const i=e[0],a=A(v(e[1],"")).toLowerCase(),f=C(e[2])?A(e[2]):null;if(e[0]===null)return null;if(!_(e[0]))throw new p(n,y.InvalidParameter,r);let d=i._layer;if(d instanceof ne&&(d=$(d,n.spatialReference,["*"],!0,n.lrucache,n.interceptor)),d===null||P(d)===!1)return null;await d.load();const o=d.serviceUrl(),t=await Le(o,n.spatialReference);let l=null,c=null,F=!1;if(f!==null&&f!==""&&f!==void 0){for(const w of t.terminals)w.terminalName===f&&(c=w.terminalId);c===null&&(F=!0)}const b=t.associations.getFieldsIndex(),I=b.get("TOGLOBALID").name,D=b.get("FROMGLOBALID").name,U=b.get("TOTERMINALID").name,K=b.get("FROMTERMINALID").name,J=b.get("FROMNETWORKSOURCEID").name,V=b.get("TONETWORKSOURCEID").name,M=b.get("ASSOCIATIONTYPE").name,ge=b.get("ISCONTENTVISIBLE").name,we=b.get("OBJECTID").name;for(const w of d.fields)if(w.type==="global-id"){l=i.field(w.name);break}let R=null,ae=new k(new W({name:"percentalong",alias:"percentalong",type:"double"}),E.create("0",t.associations.getFieldsIndex())),re=new k(new W({name:"side",alias:"side",type:"string"}),E.create("''",t.associations.getFieldsIndex()));const S="globalid",se="globalId",le={};for(const w in t.lkp)le[w]=t.lkp[w].sourceId;const O=new Te(new W({name:"classname",alias:"classname",type:"string"}),null,le);let g="";switch(a){case"midspan":{g=`((${I}='${l}') OR ( ${D}='${l}')) AND (${M} IN (5))`,O.codefield=E.create(`CASE WHEN (${I}='${l}') THEN ${J} ELSE ${V} END`,t.associations.getFieldsIndex());const w=X(T.findField(t.associations.fields,D));w.name=S,w.alias=S,R=new k(w,E.create(`CASE WHEN (${D}='${l}') THEN ${I} ELSE ${D} END`,t.associations.getFieldsIndex())),ae=t.unVersion>=4?new ee(T.findField(t.associations.fields,b.get("PERCENTALONG").name)):new k(new W({name:"percentalong",alias:"percentalong",type:"double"}),E.create("0",t.associations.getFieldsIndex()));break}case"junctionedge":{g=`((${I}='${l}') OR ( ${D}='${l}')) AND (${M} IN (4,6))`,O.codefield=E.create(`CASE WHEN (${I}='${l}') THEN ${J} ELSE ${V} END`,t.associations.getFieldsIndex());const w=X(T.findField(t.associations.fields,D));w.name=S,w.alias=S,R=new k(w,E.create(`CASE WHEN (${D}='${l}') THEN ${I} ELSE ${D} END`,t.associations.getFieldsIndex())),re=new k(new W({name:"side",alias:"side",type:"string"}),E.create(`CASE WHEN (${M}=4) THEN 'from' ELSE 'to' END`,t.associations.getFieldsIndex()));break}case"connected":{let w=`${I}='@T'`,oe=`${D}='@T'`;c!==null&&(w+=` AND ${U}=@A`,oe+=` AND ${K}=@A`),g="(("+w+") OR ("+oe+"))",g=q(g,"@T",l!=null?l:""),w=q(w,"@T",l!=null?l:""),c!==null&&(w=q(w,"@A",c.toString()),g=q(g,"@A",c.toString())),O.codefield=E.create("CASE WHEN "+w+` THEN ${J} ELSE ${V} END`,t.associations.getFieldsIndex());const Y=X(T.findField(t.associations.fields,D));Y.name=S,Y.alias=S,R=new k(Y,E.create("CASE WHEN "+w+` THEN ${D} ELSE ${I} END`,t.associations.getFieldsIndex()));break}case"container":g=`${I}='${l}' AND ${M} = 2`,c!==null&&(g+=` AND ${U} = `+c.toString()),O.codefield=J,g="( "+g+" )",R=new B(T.findField(t.associations.fields,D),S,S);case"content":g=`(${D}='${l}' AND ${M} = 2)`,c!==null&&(g+=` AND ${K} = `+c.toString()),O.codefield=V,g="( "+g+" )",R=new B(T.findField(t.associations.fields,I),S,S);break;case"structure":g=`(${I}='${l}' AND ${M} = 3)`,c!==null&&(g+=` AND ${U} = `+c.toString()),O.codefield=J,g="( "+g+" )",R=new B(T.findField(t.associations.fields,D),S,se);break;case"attached":g=`(${D}='${l}' AND ${M} = 3)`,c!==null&&(g+=` AND ${K} = `+c.toString()),O.codefield=V,g="( "+g+" )",R=new B(T.findField(t.associations.fields,I),S,se);break;default:throw new p(n,y.InvalidParameter,r)}return F&&(g="1 <> 1"),new T({parentfeatureset:t.associations,adaptedFields:[new ee(T.findField(t.associations.fields,we)),new ee(T.findField(t.associations.fields,ge)),R,re,O,ae],extraFilter:g?E.create(g,t.associations.getFieldsIndex()):null})})},s.signatures.push({name:"featuresetbyassociation",min:2,max:6}),s.functions.groupby=function(n,r){return s.standardFunctionAsync(n,r,async(m,h,e)=>{if(N(e,3,3,n,r),!P(e[0]))throw new p(n,y.InvalidParameter,r);const i=await e[0].load(),a=[],f=[];let d=!1,o=[];if(C(e[1]))o.push(e[1]);else if(e[1]instanceof L)o.push(e[1]);else if(x(e[1]))o=e[1];else{if(!j(e[1]))throw new p(n,y.InvalidParameter,r);o=e[1].toArray()}for(const t of o)if(C(t)){const l=E.create(A(t),i.getFieldsIndex()),c=me(l)===!0?A(t):"%%%%FIELDNAME";a.push({name:c,expression:l}),c==="%%%%FIELDNAME"&&(d=!0)}else{if(!(t instanceof L))throw new p(n,y.InvalidParameter,r);{const l=t.hasField("name")?t.field("name"):"%%%%FIELDNAME",c=t.hasField("expression")?t.field("expression"):"";if(l==="%%%%FIELDNAME"&&(d=!0),!l)throw new p(n,y.InvalidParameter,r);a.push({name:l,expression:E.create(c||l,i.getFieldsIndex())})}}if(o=[],C(e[2]))o.push(e[2]);else if(x(e[2]))o=e[2];else if(j(e[2]))o=e[2].toArray();else{if(!(e[2]instanceof L))throw new p(n,y.InvalidParameter,r);o.push(e[2])}for(const t of o){if(!(t instanceof L))throw new p(n,y.InvalidParameter,r);{const l=t.hasField("name")?t.field("name"):"",c=t.hasField("statistic")?t.field("statistic"):"",F=t.hasField("expression")?t.field("expression"):"";if(!l||!c||!F)throw new p(n,y.InvalidParameter,r);f.push({name:l,statistic:c.toLowerCase(),expression:E.create(F,i.getFieldsIndex())})}}if(d){const t={};for(const c of i.fields)t[c.name.toLowerCase()]=1;for(const c of a)c.name!=="%%%%FIELDNAME"&&(t[c.name.toLowerCase()]=1);for(const c of f)c.name!=="%%%%FIELDNAME"&&(t[c.name.toLowerCase()]=1);let l=0;for(const c of a)if(c.name==="%%%%FIELDNAME"){for(;t["field_"+l.toString()]===1;)l++;t["field_"+l.toString()]=1,c.name="FIELD_"+l.toString()}}for(const t of a)await te(t.expression,s,n);for(const t of f)await te(t.expression,s,n);return e[0].groupby(a,f)})},s.signatures.push({name:"groupby",min:3,max:3}),s.functions.distinct=function(n,r){return s.standardFunctionAsync(n,r,async(m,h,e)=>{if(P(e[0])){N(e,2,2,n,r);const i=await e[0].load(),a=[];let f=[];if(C(e[1]))f.push(e[1]);else if(e[1]instanceof L)f.push(e[1]);else if(x(e[1]))f=e[1];else{if(!j(e[1]))throw new p(n,y.InvalidParameter,r);f=e[1].toArray()}let d=!1;for(const o of f)if(C(o)){const t=E.create(A(o),i.getFieldsIndex()),l=me(t)===!0?A(o):"%%%%FIELDNAME";a.push({name:l,expression:t}),l==="%%%%FIELDNAME"&&(d=!0)}else{if(!(o instanceof L))throw new p(n,y.InvalidParameter,r);{const t=o.hasField("name")?o.field("name"):"%%%%FIELDNAME",l=o.hasField("expression")?o.field("expression"):"";if(t==="%%%%FIELDNAME"&&(d=!0),!t)throw new p(n,y.InvalidParameter,r);a.push({name:t,expression:E.create(l||t,i.getFieldsIndex())})}}if(d){const o={};for(const l of i.fields)o[l.name.toLowerCase()]=1;for(const l of a)l.name!=="%%%%FIELDNAME"&&(o[l.name.toLowerCase()]=1);let t=0;for(const l of a)if(l.name==="%%%%FIELDNAME"){for(;o["field_"+t.toString()]===1;)t++;o["field_"+t.toString()]=1,l.name="FIELD_"+t.toString()}}for(const o of a)await te(o.expression,s,n);return e[0].groupby(a,[])}return Oe("distinct",m,h,e)})})}export{qe as registerFunctions}; diff --git a/assets/featuresetgeom.d91e9a0c.js b/assets/featuresetgeom.d2fdc1e5.js similarity index 90% rename from assets/featuresetgeom.d91e9a0c.js rename to assets/featuresetgeom.d2fdc1e5.js index 2cf6af3..ccb337e 100644 --- a/assets/featuresetgeom.d91e9a0c.js +++ b/assets/featuresetgeom.d2fdc1e5.js @@ -1 +1 @@ -import{q as S,V as F,K as p,P as i,t as o,e as l,an as w}from"./arcadeUtils.9e078218.js";import{u as c,h}from"./SpatialFilter.dc70612a.js";import{cY as u}from"./index.d94abe07.js";import{R as I,m as A,S as P,x as g,O as C,p as O,h as R}from"./geometryEngineAsync.3b47a469.js";import"./number.8c2c26f3.js";import"./WhereClause.253310fe.js";function f(r){return r instanceof u}function s(r,t,a,d){return d(r,t,async(y,e,n)=>{if(n.length<2)throw new o(r,l.WrongNumberOfParameters,t);if((n=S(n))[0]===null&&n[1]===null)return!1;if(i(n[0])){if(n[1]instanceof u)return new h({parentfeatureset:n[0],relation:a,relationGeom:n[1]});if(n[1]===null)return new c({parentfeatureset:n[0]});throw new o(r,l.InvalidParameter,t)}if(f(n[0])){if(f(n[1])){switch(a){case"esriSpatialRelEnvelopeIntersects":return R(w(n[0]),w(n[1]));case"esriSpatialRelIntersects":return R(n[0],n[1]);case"esriSpatialRelContains":return O(n[0],n[1]);case"esriSpatialRelOverlaps":return C(n[0],n[1]);case"esriSpatialRelWithin":return g(n[0],n[1]);case"esriSpatialRelTouches":return P(n[0],n[1]);case"esriSpatialRelCrosses":return A(n[0],n[1])}throw new o(r,l.InvalidParameter,t)}if(i(n[1]))return new h({parentfeatureset:n[1],relation:a,relationGeom:n[0]});if(n[1]===null)return!1;throw new o(r,l.InvalidParameter,t)}if(n[0]!==null)throw new o(r,l.InvalidParameter,t);return i(n[1])?new c({parentfeatureset:n[1]}):!(n[1]instanceof u||n[1]===null)&&void 0})}function q(r){r.mode==="async"&&(r.functions.intersects=function(t,a){return s(t,a,"esriSpatialRelIntersects",r.standardFunctionAsync)},r.functions.envelopeintersects=function(t,a){return s(t,a,"esriSpatialRelEnvelopeIntersects",r.standardFunctionAsync)},r.signatures.push({name:"envelopeintersects",min:2,max:2}),r.functions.contains=function(t,a){return s(t,a,"esriSpatialRelContains",r.standardFunctionAsync)},r.functions.overlaps=function(t,a){return s(t,a,"esriSpatialRelOverlaps",r.standardFunctionAsync)},r.functions.within=function(t,a){return s(t,a,"esriSpatialRelWithin",r.standardFunctionAsync)},r.functions.touches=function(t,a){return s(t,a,"esriSpatialRelTouches",r.standardFunctionAsync)},r.functions.crosses=function(t,a){return s(t,a,"esriSpatialRelCrosses",r.standardFunctionAsync)},r.functions.relate=function(t,a){return r.standardFunctionAsync(t,a,(d,y,e)=>{if(e=S(e),F(e,3,3,t,a),f(e[0])&&f(e[1]))return I(e[0],e[1],p(e[2]));if(e[0]instanceof u&&e[1]===null||e[1]instanceof u&&e[0]===null)return!1;if(i(e[0])&&e[1]===null)return new c({parentfeatureset:e[0]});if(i(e[1])&&e[0]===null)return new c({parentfeatureset:e[1]});if(i(e[0])&&e[1]instanceof u)return e[0].relate(e[1],p(e[2]));if(i(e[1])&&e[0]instanceof u)return e[1].relate(e[0],p(e[2]));if(e[0]===null&&e[1]===null)return!1;throw new o(t,l.InvalidParameter,a)})})}export{q as registerFunctions}; +import{q as S,V as F,K as p,P as i,t as o,e as l,an as w}from"./arcadeUtils.09abf965.js";import{u as c,h}from"./SpatialFilter.fd0a95ff.js";import{cY as u}from"./index.221827cd.js";import{R as I,m as A,S as P,x as g,O as C,p as O,h as R}from"./geometryEngineAsync.68619ff9.js";import"./number.9e690eda.js";import"./WhereClause.5b749615.js";function f(r){return r instanceof u}function s(r,t,a,d){return d(r,t,async(y,e,n)=>{if(n.length<2)throw new o(r,l.WrongNumberOfParameters,t);if((n=S(n))[0]===null&&n[1]===null)return!1;if(i(n[0])){if(n[1]instanceof u)return new h({parentfeatureset:n[0],relation:a,relationGeom:n[1]});if(n[1]===null)return new c({parentfeatureset:n[0]});throw new o(r,l.InvalidParameter,t)}if(f(n[0])){if(f(n[1])){switch(a){case"esriSpatialRelEnvelopeIntersects":return R(w(n[0]),w(n[1]));case"esriSpatialRelIntersects":return R(n[0],n[1]);case"esriSpatialRelContains":return O(n[0],n[1]);case"esriSpatialRelOverlaps":return C(n[0],n[1]);case"esriSpatialRelWithin":return g(n[0],n[1]);case"esriSpatialRelTouches":return P(n[0],n[1]);case"esriSpatialRelCrosses":return A(n[0],n[1])}throw new o(r,l.InvalidParameter,t)}if(i(n[1]))return new h({parentfeatureset:n[1],relation:a,relationGeom:n[0]});if(n[1]===null)return!1;throw new o(r,l.InvalidParameter,t)}if(n[0]!==null)throw new o(r,l.InvalidParameter,t);return i(n[1])?new c({parentfeatureset:n[1]}):!(n[1]instanceof u||n[1]===null)&&void 0})}function q(r){r.mode==="async"&&(r.functions.intersects=function(t,a){return s(t,a,"esriSpatialRelIntersects",r.standardFunctionAsync)},r.functions.envelopeintersects=function(t,a){return s(t,a,"esriSpatialRelEnvelopeIntersects",r.standardFunctionAsync)},r.signatures.push({name:"envelopeintersects",min:2,max:2}),r.functions.contains=function(t,a){return s(t,a,"esriSpatialRelContains",r.standardFunctionAsync)},r.functions.overlaps=function(t,a){return s(t,a,"esriSpatialRelOverlaps",r.standardFunctionAsync)},r.functions.within=function(t,a){return s(t,a,"esriSpatialRelWithin",r.standardFunctionAsync)},r.functions.touches=function(t,a){return s(t,a,"esriSpatialRelTouches",r.standardFunctionAsync)},r.functions.crosses=function(t,a){return s(t,a,"esriSpatialRelCrosses",r.standardFunctionAsync)},r.functions.relate=function(t,a){return r.standardFunctionAsync(t,a,(d,y,e)=>{if(e=S(e),F(e,3,3,t,a),f(e[0])&&f(e[1]))return I(e[0],e[1],p(e[2]));if(e[0]instanceof u&&e[1]===null||e[1]instanceof u&&e[0]===null)return!1;if(i(e[0])&&e[1]===null)return new c({parentfeatureset:e[0]});if(i(e[1])&&e[0]===null)return new c({parentfeatureset:e[1]});if(i(e[0])&&e[1]instanceof u)return e[0].relate(e[1],p(e[2]));if(i(e[1])&&e[0]instanceof u)return e[1].relate(e[0],p(e[2]));if(e[0]===null&&e[1]===null)return!1;throw new o(t,l.InvalidParameter,a)})})}export{q as registerFunctions}; diff --git a/assets/featuresetstats.d56be13b.js b/assets/featuresetstats.a24876b2.js similarity index 90% rename from assets/featuresetstats.d56be13b.js rename to assets/featuresetstats.a24876b2.js index b65c285..91dc9cc 100644 --- a/assets/featuresetstats.d56be13b.js +++ b/assets/featuresetstats.a24876b2.js @@ -1 +1 @@ -import{V as h,P as d,Y as l,w as F,E as m,t as A,e as v,am as c,y as i}from"./arcadeUtils.9e078218.js";import{WhereClause as g}from"./WhereClause.253310fe.js";import"./index.d94abe07.js";import"./number.8c2c26f3.js";async function o(t,r,a,n,u,e){if(n.length===1){if(l(n[0]))return c(t,n[0],i(n[1],-1));if(m(n[0]))return c(t,n[0].toArray(),i(n[1],-1))}else if(n.length===2){if(l(n[0]))return c(t,n[0],i(n[1],-1));if(m(n[0]))return c(t,n[0].toArray(),i(n[1],-1));if(d(n[0])){const s=await n[0].load(),f=await y(g.create(n[1],s.getFieldsIndex()),e,u);return n[0].calculateStatistic(t,f,i(n[2],1e3),r.abortSignal)}}else if(n.length===3&&d(n[0])){const s=await n[0].load(),f=await y(g.create(n[1],s.getFieldsIndex()),e,u);return n[0].calculateStatistic(t,f,i(n[2],1e3),r.abortSignal)}return c(t,n,-1)}async function y(t,r,a){const n=t.getVariables();if(n.length>0){const u=[];for(let s=0;so("stdev",n,u,e,r,t))},t.functions.variance=function(r,a){return t.standardFunctionAsync(r,a,(n,u,e)=>o("variance",n,u,e,r,t))},t.functions.average=function(r,a){return t.standardFunctionAsync(r,a,(n,u,e)=>o("mean",n,u,e,r,t))},t.functions.mean=function(r,a){return t.standardFunctionAsync(r,a,(n,u,e)=>o("mean",n,u,e,r,t))},t.functions.sum=function(r,a){return t.standardFunctionAsync(r,a,(n,u,e)=>o("sum",n,u,e,r,t))},t.functions.min=function(r,a){return t.standardFunctionAsync(r,a,(n,u,e)=>o("min",n,u,e,r,t))},t.functions.max=function(r,a){return t.standardFunctionAsync(r,a,(n,u,e)=>o("max",n,u,e,r,t))},t.functions.count=function(r,a){return t.standardFunctionAsync(r,a,(n,u,e)=>{if(h(e,1,1,r,a),d(e[0]))return e[0].count(n.abortSignal);if(l(e[0])||F(e[0]))return e[0].length;if(m(e[0]))return e[0].length();throw new A(r,v.InvalidParameter,a)})})}export{b as registerFunctions}; +import{V as h,P as d,Y as l,w as F,E as m,t as A,e as v,am as c,y as i}from"./arcadeUtils.09abf965.js";import{WhereClause as g}from"./WhereClause.5b749615.js";import"./index.221827cd.js";import"./number.9e690eda.js";async function o(t,r,a,n,u,e){if(n.length===1){if(l(n[0]))return c(t,n[0],i(n[1],-1));if(m(n[0]))return c(t,n[0].toArray(),i(n[1],-1))}else if(n.length===2){if(l(n[0]))return c(t,n[0],i(n[1],-1));if(m(n[0]))return c(t,n[0].toArray(),i(n[1],-1));if(d(n[0])){const s=await n[0].load(),f=await y(g.create(n[1],s.getFieldsIndex()),e,u);return n[0].calculateStatistic(t,f,i(n[2],1e3),r.abortSignal)}}else if(n.length===3&&d(n[0])){const s=await n[0].load(),f=await y(g.create(n[1],s.getFieldsIndex()),e,u);return n[0].calculateStatistic(t,f,i(n[2],1e3),r.abortSignal)}return c(t,n,-1)}async function y(t,r,a){const n=t.getVariables();if(n.length>0){const u=[];for(let s=0;so("stdev",n,u,e,r,t))},t.functions.variance=function(r,a){return t.standardFunctionAsync(r,a,(n,u,e)=>o("variance",n,u,e,r,t))},t.functions.average=function(r,a){return t.standardFunctionAsync(r,a,(n,u,e)=>o("mean",n,u,e,r,t))},t.functions.mean=function(r,a){return t.standardFunctionAsync(r,a,(n,u,e)=>o("mean",n,u,e,r,t))},t.functions.sum=function(r,a){return t.standardFunctionAsync(r,a,(n,u,e)=>o("sum",n,u,e,r,t))},t.functions.min=function(r,a){return t.standardFunctionAsync(r,a,(n,u,e)=>o("min",n,u,e,r,t))},t.functions.max=function(r,a){return t.standardFunctionAsync(r,a,(n,u,e)=>o("max",n,u,e,r,t))},t.functions.count=function(r,a){return t.standardFunctionAsync(r,a,(n,u,e)=>{if(h(e,1,1,r,a),d(e[0]))return e[0].count(n.abortSignal);if(l(e[0])||F(e[0]))return e[0].length;if(m(e[0]))return e[0].length();throw new A(r,v.InvalidParameter,a)})})}export{b as registerFunctions}; diff --git a/assets/featuresetstring.4242b3c8.js b/assets/featuresetstring.0a520808.js similarity index 95% rename from assets/featuresetstring.4242b3c8.js rename to assets/featuresetstring.0a520808.js index 08746dc..51da759 100644 --- a/assets/featuresetstring.4242b3c8.js +++ b/assets/featuresetstring.0a520808.js @@ -1 +1 @@ -import{V as o,c as s,ao as A,r as u,K as m,P as c,ap as w,t as v,e as f,aq as b,J as l,ar as h,as as x,at as g,au as F,av as P,y as I,aw as V,ax as p}from"./arcadeUtils.9e078218.js";import"./index.d94abe07.js";import"./number.8c2c26f3.js";function y(a){return a&&a.domain?a.domain.type==="coded-value"||a.domain.type==="codedValue"?l.convertObjectToArcadeDictionary({type:"codedValue",name:a.domain.name,dataType:p[a.field.type],codedValues:a.domain.codedValues.map(e=>({name:e.name,code:e.code}))}):l.convertObjectToArcadeDictionary({type:"range",name:a.domain.name,dataType:p[a.field.type],min:a.domain.min,max:a.domain.max}):null}function O(a){a.mode==="async"&&(a.functions.domain=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,2,3,e,t),s(n[0]))return y(A(n[0],m(n[1]),n[2]===void 0?void 0:u(n[2])));if(c(n[0]))return await n[0]._ensureLoaded(),y(w(m(n[1]),n[0],null,n[2]===void 0?void 0:u(n[2])));throw new v(e,f.InvalidParameter,t)})},a.functions.subtypes=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,1,1,e,t),s(n[0])){const r=b(n[0]);return r?l.convertObjectToArcadeDictionary(r):null}if(c(n[0])){await n[0]._ensureLoaded();const r=n[0].subtypes();return r?l.convertObjectToArcadeDictionary(r):null}throw new v(e,f.InvalidParameter,t)})},a.functions.domainname=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,2,4,e,t),s(n[0]))return h(n[0],m(n[1]),n[2],n[3]===void 0?void 0:u(n[3]));if(c(n[0])){await n[0]._ensureLoaded();const r=w(m(n[1]),n[0],null,n[3]===void 0?void 0:u(n[3]));return x(r,n[2])}throw new v(e,f.InvalidParameter,t)})},a.signatures.push({name:"domainname",min:2,max:4}),a.functions.domaincode=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,2,4,e,t),s(n[0]))return g(n[0],m(n[1]),n[2],n[3]===void 0?void 0:u(n[3]));if(c(n[0])){await n[0]._ensureLoaded();const r=w(m(n[1]),n[0],null,n[3]===void 0?void 0:u(n[3]));return F(r,n[2])}throw new v(e,f.InvalidParameter,t)})},a.signatures.push({name:"domaincode",min:2,max:4})),a.functions.text=function(e,t){return a.standardFunctionAsync(e,t,(i,d,n)=>{if(o(n,1,2,e,t),!c(n[0]))return P(n[0],n[1]);{const r=I(n[1],"");if(r==="")return n[0].castToText();if(r.toLowerCase()==="schema")return n[0].convertToText("schema",i.abortSignal);if(r.toLowerCase()==="featureset")return n[0].convertToText("featureset",i.abortSignal)}})},a.functions.gdbversion=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,1,1,e,t),s(n[0]))return n[0].gdbVersion();if(c(n[0]))return(await n[0].load()).gdbVersion;throw new v(e,f.InvalidParameter,t)})},a.functions.schema=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,1,1,e,t),c(n[0]))return await n[0].load(),l.convertObjectToArcadeDictionary(n[0].schema());if(s(n[0])){const r=V(n[0]);return r?l.convertObjectToArcadeDictionary(r):null}throw new v(e,f.InvalidParameter,t)})}}export{O as registerFunctions}; +import{V as o,c as s,ao as A,r as u,K as m,P as c,ap as w,t as v,e as f,aq as b,J as l,ar as h,as as x,at as g,au as F,av as P,y as I,aw as V,ax as p}from"./arcadeUtils.09abf965.js";import"./index.221827cd.js";import"./number.9e690eda.js";function y(a){return a&&a.domain?a.domain.type==="coded-value"||a.domain.type==="codedValue"?l.convertObjectToArcadeDictionary({type:"codedValue",name:a.domain.name,dataType:p[a.field.type],codedValues:a.domain.codedValues.map(e=>({name:e.name,code:e.code}))}):l.convertObjectToArcadeDictionary({type:"range",name:a.domain.name,dataType:p[a.field.type],min:a.domain.min,max:a.domain.max}):null}function O(a){a.mode==="async"&&(a.functions.domain=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,2,3,e,t),s(n[0]))return y(A(n[0],m(n[1]),n[2]===void 0?void 0:u(n[2])));if(c(n[0]))return await n[0]._ensureLoaded(),y(w(m(n[1]),n[0],null,n[2]===void 0?void 0:u(n[2])));throw new v(e,f.InvalidParameter,t)})},a.functions.subtypes=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,1,1,e,t),s(n[0])){const r=b(n[0]);return r?l.convertObjectToArcadeDictionary(r):null}if(c(n[0])){await n[0]._ensureLoaded();const r=n[0].subtypes();return r?l.convertObjectToArcadeDictionary(r):null}throw new v(e,f.InvalidParameter,t)})},a.functions.domainname=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,2,4,e,t),s(n[0]))return h(n[0],m(n[1]),n[2],n[3]===void 0?void 0:u(n[3]));if(c(n[0])){await n[0]._ensureLoaded();const r=w(m(n[1]),n[0],null,n[3]===void 0?void 0:u(n[3]));return x(r,n[2])}throw new v(e,f.InvalidParameter,t)})},a.signatures.push({name:"domainname",min:2,max:4}),a.functions.domaincode=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,2,4,e,t),s(n[0]))return g(n[0],m(n[1]),n[2],n[3]===void 0?void 0:u(n[3]));if(c(n[0])){await n[0]._ensureLoaded();const r=w(m(n[1]),n[0],null,n[3]===void 0?void 0:u(n[3]));return F(r,n[2])}throw new v(e,f.InvalidParameter,t)})},a.signatures.push({name:"domaincode",min:2,max:4})),a.functions.text=function(e,t){return a.standardFunctionAsync(e,t,(i,d,n)=>{if(o(n,1,2,e,t),!c(n[0]))return P(n[0],n[1]);{const r=I(n[1],"");if(r==="")return n[0].castToText();if(r.toLowerCase()==="schema")return n[0].convertToText("schema",i.abortSignal);if(r.toLowerCase()==="featureset")return n[0].convertToText("featureset",i.abortSignal)}})},a.functions.gdbversion=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,1,1,e,t),s(n[0]))return n[0].gdbVersion();if(c(n[0]))return(await n[0].load()).gdbVersion;throw new v(e,f.InvalidParameter,t)})},a.functions.schema=function(e,t){return a.standardFunctionAsync(e,t,async(i,d,n)=>{if(o(n,1,1,e,t),c(n[0]))return await n[0].load(),l.convertObjectToArcadeDictionary(n[0].schema());if(s(n[0])){const r=V(n[0]);return r?l.convertObjectToArcadeDictionary(r):null}throw new v(e,f.InvalidParameter,t)})}}export{O as registerFunctions}; diff --git a/assets/fetchRasterInfo.d4fdc8d4.js b/assets/fetchRasterInfo.3f6af61b.js similarity index 99% rename from assets/fetchRasterInfo.d4fdc8d4.js rename to assets/fetchRasterInfo.3f6af61b.js index 8d4f0fb..4ef346e 100644 --- a/assets/fetchRasterInfo.d4fdc8d4.js +++ b/assets/fetchRasterInfo.3f6af61b.js @@ -1 +1 @@ -import{ct as me,i$ as Pe,b9 as w,a6 as s,a7 as l,bQ as re,ei as E,j0 as Ge,h1 as ct,a8 as B,cx as z,h0 as Mt,eW as Ve,d2 as Z,eX as We,b4 as S,e0 as Je,iX as Oe,j1 as Fe,j as ee,c as g,af as _e,e2 as dt,d1 as ut,e5 as gt,iF as pt,j2 as It,j3 as mt,j4 as yt,j5 as wt,j6 as te,iG as ne,j7 as xe,j8 as ye,ii as ht,ef as Ke,c9 as At,cY as ft,cU as se,az as Dt,d6 as bt,n as T,j9 as Qe,u as O,ja as Be,gG as Ct,dQ as Tt,e3 as jt,e4 as Lt,U as k,aT as St,d3 as vt}from"./index.d94abe07.js";import{p as Nt}from"./multidimensionalUtils.4f713da1.js";import{g as U}from"./pixelUtils.82950e1a.js";import{h as le,n as X,g as xt,i as Bt,e as $e}from"./RasterSymbolizer.4ee6ff2c.js";import{c as x,l as zt,d as Ut,g as Ht}from"./dataUtils.0f9b810f.js";import"./generateRendererUtils.ebdde5b7.js";var ce;const K=new me({flow_from:"flow-from",flow_to:"flow-to"});let h=ce=class extends Pe(z){constructor(e){super(e),this.density=.8,this.color=new w([255,255,255,1]),this.maxPathLength=200,this.trailWidth=1.5,this.flowSpeed=10,this.trailLength=100,this.smoothing=0,this.flowRepresentation="flow-from",this.type="flow",this.authoringInfo=null,this.legendOptions=null,this.trailCap="butt",this.background="none"}clone(){var C,u;const{density:e,maxPathLength:t,trailWidth:i,flowSpeed:a,trailLength:r,smoothing:o,flowRepresentation:n,trailCap:c,background:m}=this,M=this.color.clone(),y=(this.visualVariables||[]).map(d=>d.clone()),p=(C=this.authoringInfo)==null?void 0:C.clone(),v=(u=this.legendOptions)==null?void 0:u.clone();return new ce({density:e,color:M,maxPathLength:t,trailWidth:i,flowSpeed:a,trailLength:r,trailCap:c,background:m,smoothing:o,flowRepresentation:n,visualVariables:y,authoringInfo:p,legendOptions:v})}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}};s([l({type:Number,json:{write:!0}})],h.prototype,"density",void 0),s([l({type:w,json:{write:{allowNull:!0}}})],h.prototype,"color",void 0),s([l({type:Number,cast:re,json:{write:!0}})],h.prototype,"maxPathLength",void 0),s([l({type:Number,cast:re,json:{write:!0}})],h.prototype,"trailWidth",void 0),s([l({type:Number,json:{write:!0}})],h.prototype,"flowSpeed",void 0),s([l({type:Number,json:{write:!0}})],h.prototype,"trailLength",void 0),s([l({type:Number,cast:re,json:{write:!1}})],h.prototype,"smoothing",void 0),s([l({type:K.apiValues,json:{type:K.jsonValues,read:{reader:K.read},write:{writer:K.write}}})],h.prototype,"flowRepresentation",void 0),s([E({flowRenderer:"flow"})],h.prototype,"type",void 0),s([l({type:Ge,json:{write:!0}})],h.prototype,"authoringInfo",void 0),s([l({type:ct,json:{write:!0}})],h.prototype,"legendOptions",void 0),s([l({type:String,json:{write:!0}})],h.prototype,"trailCap",void 0),s([l({type:String,json:{write:!0}})],h.prototype,"background",void 0),h=ce=s([B("esri.renderers.FlowRenderer")],h);const Xe=h;let R=class extends z{constructor(){super(...arguments),this.value=null,this.label=null,this.color=null}};s([l({type:Number,json:{write:!0}})],R.prototype,"value",void 0),s([l({type:String,json:{write:!0}})],R.prototype,"label",void 0),s([l({type:w,json:{type:[Mt],write:!0}})],R.prototype,"color",void 0),R=s([B("esri.renderers.support.ColormapInfo")],R);const qe=R;var V;let W=V=class extends z{constructor(e){super(e),this.colormapInfos=null,this.type="raster-colormap"}static createFromColormap(e,t){if(!e)return null;const i=e[0].length===5,a=[...e].sort(r=>r[0][0]-r[1][0]).map(r=>{var o;return qe.fromJSON({value:r[0],color:i?r.slice(1,5):r.slice(1,4).concat([255]),label:t?(o=t[r[0]])!=null?o:"":r[0]})});return new V({colormapInfos:a})}static createFromColorramp(e){const t=le(e,256);return V.createFromColormap(t)}clone(){return new V({colormapInfos:this.colormapInfos.map(e=>e.toJSON())})}extractColormap(){return this.colormapInfos.map(({value:e,color:t})=>[e,t.r,t.g,t.b,t.a>1?t.a:255*t.a&255]).sort((e,t)=>e[0]-t[0])}};s([l({type:[qe],json:{write:!0}})],W.prototype,"colormapInfos",void 0),s([E({rasterColormap:"raster-colormap"})],W.prototype,"type",void 0),W=V=s([B("esri.renderers.RasterColormapRenderer")],W);const we=W;var Me;let b=Me=class extends z{constructor(e){super(e),this.altitude=45,this.azimuth=315,this.colorRamp=null,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.scalingType="none",this.type="raster-shaded-relief",this.zFactor=1}readColorRamp(e){return We(e)}clone(){return new Me({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,scalingType:this.scalingType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,colorRamp:S(this.colorRamp)})}};s([l({type:Number,json:{write:!0}})],b.prototype,"altitude",void 0),s([l({type:Number,json:{write:!0}})],b.prototype,"azimuth",void 0),s([l({types:Ve,json:{write:!0}})],b.prototype,"colorRamp",void 0),s([Z("colorRamp")],b.prototype,"readColorRamp",null),s([l({type:["traditional","multi-directional"],json:{write:!0}})],b.prototype,"hillshadeType",void 0),s([l({type:Number,json:{write:!0}})],b.prototype,"pixelSizePower",void 0),s([l({type:Number,json:{write:!0}})],b.prototype,"pixelSizeFactor",void 0),s([l({type:["none","adjusted"],json:{write:!0}})],b.prototype,"scalingType",void 0),s([E({rasterShadedRelief:"raster-shaded-relief"})],b.prototype,"type",void 0),s([l({type:Number,json:{write:!0}})],b.prototype,"zFactor",void 0),b=Me=s([B("esri.renderers.RasterShadedReliefRenderer")],b);const Ye=b;var de;let I=de=class extends z{constructor(e){super(e),this.colorRamp=null,this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.maxPercent=null,this.minPercent=null,this.numberOfStandardDeviations=null,this.outputMax=null,this.outputMin=null,this.sigmoidStrengthLevel=null,this.statistics=[],this.histograms=null,this.useGamma=!1,this.stretchType="none",this.type="raster-stretch"}readColorRamp(e){if(e)return We(e)}writeStatistics(e,t,i){e!=null&&e.length&&(Array.isArray(e[0])||(e=e.map(a=>[a.min,a.max,a.avg,a.stddev])),t[i]=e)}readStretchType(e,t){let i=t.stretchType;return typeof i=="number"&&(i=xt[i]),X.read(i)}clone(){return new de({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:S(this.statistics),gamma:S(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:S(this.colorRamp),histograms:S(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})}};s([l({types:Ve,json:{write:!0}})],I.prototype,"colorRamp",void 0),s([Z("colorRamp")],I.prototype,"readColorRamp",null),s([l({type:Boolean,json:{write:!0}})],I.prototype,"computeGamma",void 0),s([l({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],I.prototype,"dynamicRangeAdjustment",void 0),s([l({type:[Number],json:{write:!0}})],I.prototype,"gamma",void 0),s([l({type:Number,json:{write:!0}})],I.prototype,"maxPercent",void 0),s([l({type:Number,json:{write:!0}})],I.prototype,"minPercent",void 0),s([l({type:Number,json:{write:!0}})],I.prototype,"numberOfStandardDeviations",void 0),s([l({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],I.prototype,"outputMax",void 0),s([l({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],I.prototype,"outputMin",void 0),s([l({type:Number,json:{write:!0}})],I.prototype,"sigmoidStrengthLevel",void 0),s([l({json:{type:[[Number]],write:!0}})],I.prototype,"statistics",void 0),s([l()],I.prototype,"histograms",void 0),s([Je("statistics")],I.prototype,"writeStatistics",null),s([l({type:Boolean,json:{write:!0}})],I.prototype,"useGamma",void 0),s([l({type:X.apiValues,json:{type:X.jsonValues,write:X.write}})],I.prototype,"stretchType",void 0),s([Z("stretchType",["stretchType"])],I.prototype,"readStretchType",null),s([E({rasterStretch:"raster-stretch"})],I.prototype,"type",void 0),I=de=s([B("esri.renderers.RasterStretchRenderer")],I);const he=I;var ue;const ze=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]),Q=new me({beaufort_ft:"beaufort-ft",beaufort_km:"beaufort-km",beaufort_kn:"beaufort-kn",beaufort_m:"beaufort-m",beaufort_mi:"beaufort-mi",classified_arrow:"classified-arrow",ocean_current_kn:"ocean-current-kn",ocean_current_m:"ocean-current-m",simple_scalar:"simple-scalar",single_arrow:"single-arrow",wind_speed:"wind-barb"}),$=new me({flow_from:"flow-from",flow_to:"flow-to"});let A=ue=class extends Pe(z){constructor(e){super(e),this.attributeField="Magnitude",this.flowRepresentation="flow-from",this.rotationType="arithmetic",this.style="single-arrow",this.symbolTileSize=50,this.type="vector-field"}readInputUnit(e,t){return ze.has(e)?x.fromJSON(e):null}readOutputUnit(e,t){return ze.has(e)?x.fromJSON(e):null}get styleRenderer(){const e=this.style,t=this.attributeField,i=this._createStyleRenderer(e);return i.field=t,i}get sizeVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="size"&&e.push(t);if(e.length===0){const t=new Oe({field:"Magnitude",minSize:.2*this.symbolTileSize,maxSize:.8*this.symbolTileSize});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}get rotationVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="rotation"&&e.push(t);if(e.length===0){const t=new Fe({field:"Direction",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}clone(){return new ue({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:S(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(e,t=!1,i=[]){var v;const a=new Array,r=zt(this.inputUnit,this.outputUnit),o=((v=this.rotationVariables[0])==null?void 0:v.rotationType)||this.rotationType,n=t?Ut(e.pixelBlock,"vector-uv",o,r):Ht(e.pixelBlock,"vector-magdir",r);if(ee(n))return a;const c=e.extent,m=g(n.mask)&&n.mask.length>0;let M=0;const y=(c.xmax-c.xmin)/n.width,p=(c.ymax-c.ymin)/n.height;for(let C=0;CL.intersects(d));if((!m||n.mask[M])&&!j){const L={Magnitude:n.pixels[0][M],Direction:n.pixels[1][M]},N=new ut({geometry:{type:"point",x:d.x,y:d.y,spatialReference:c.spatialReference},attributes:L});N.symbol=this._getVisualVariablesAppliedSymbol(N),a.push(N)}}return a}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getClassBreakInfos(){var e;return(e=this.styleRenderer)==null?void 0:e.classBreakInfos}getDefaultSymbol(){var e;return(e=this.styleRenderer)==null?void 0:e.defaultSymbol}_getDefaultSymbol(e){return new gt({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",outline:new pt({width:0}),size:20,color:e||new w([0,92,230])})}_getVisualVariablesAppliedSymbol(e){var r,o;if(!e)return;const t=(o=(r=this.styleRenderer)==null?void 0:r.getSymbol(e))==null?void 0:o.clone(),i=this.sizeVariables,a=this.rotationVariables;if(i&&i.length&&this.sizeVariables.forEach(n=>It(t,mt([n],e))),a&&a.length){const n=this.flowRepresentation==="flow-to"==(this.style==="ocean-current-kn"||this.style==="ocean-current-m")?0:180;e.attributes.Direction=e.attributes.Direction+n,this.rotationVariables.forEach(c=>yt(t,wt(c,e),c.axis))}return t}_createStyleRenderer(e){let t={defaultSymbol:this._getDefaultSymbol(),classBreakInfos:[]};switch(e){case"single-arrow":t=this._createSingleArrowRenderer();break;case"beaufort-kn":t=this._createBeaufortKnotsRenderer();break;case"beaufort-m":t=this._createBeaufortMeterRenderer();break;case"beaufort-ft":t=this._createBeaufortFeetRenderer();break;case"beaufort-mi":t=this._createBeaufortMilesRenderer();break;case"beaufort-km":t=this._createBeaufortKilometersRenderer();break;case"ocean-current-m":t=this._createCurrentMeterRenderer();break;case"ocean-current-kn":t=this._createCurrentKnotsRenderer();break;case"simple-scalar":t=this._createSimpleScalarRenderer();break;case"wind-barb":t=this._createWindBarbsRenderer();break;case"classified-arrow":t=this._createClassifiedArrowRenderer()}return new te(t)}_createSingleArrowRenderer(){return{defaultSymbol:this._getDefaultSymbol()}}_createBeaufortKnotsRenderer(){const e=[0,1,3,6,10,16,21,27,33,40,47,55,63],t=[[40,146,199],[89,162,186],[129,179,171],[160,194,155],[191,212,138],[218,230,119],[250,250,100],[252,213,83],[252,179,102],[250,141,52],[247,110,42],[240,71,29]];return{defaultSymbol:this._getDefaultSymbol(new w([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortMeterRenderer(){const e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7],t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]];return{defaultSymbol:this._getDefaultSymbol(new w([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortFeetRenderer(){const e=this._getDefaultSymbol(new w([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],a=3.28084;return t=t.map(r=>r*a),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortMilesRenderer(){const e=this._getDefaultSymbol(new w([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],a=2.23694;return t=t.map(r=>r*a),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortKilometersRenderer(){const e=this._getDefaultSymbol(new w([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],a=3.6;return t=t.map(r=>r*a),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createCurrentMeterRenderer(){const e=[0,.5,1,1.5,2],t=[[78,26,153],[179,27,26],[202,128,26],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new w([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createCurrentKnotsRenderer(){const e=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],t=[[0,0,0],[0,37,100],[78,26,153],[151,0,100],[179,27,26],[177,78,26],[202,128,26],[177,179,52],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new w([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createClassifiedArrowRenderer(){var a;const e=this._getDefaultSymbol(new w([56,168,0]));let t=[0,1e-6,3.5,7,10.5,14];if((a=this.sizeVariables)!=null&&a.length){const r=this.sizeVariables[0].minDataValue,o=this.sizeVariables[0].maxDataValue;if(r&&o){const n=(o-r)/5;t=Array.from(Array(6).keys()).map(c=>r+n*c)}}const i=[[56,168,0],[139,309,0],[255,255,0],[255,128,0],[255,0,0]];return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createSimpleScalarRenderer(){return{defaultSymbol:ne.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAQAAABLVLlLAAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAABIAAAASABGyWs+AAAC3ElEQVRIx9XXvW4cVRQH8N982btpsIREJECyiCXsxX4DKh6AliqGKCBBE2SlwlHgAbBD/AKmyEYUeQ1KahPZSZQvBCkQLTHZ7KGY8Xodz4w3a1NwbzVzz/znfJ//zbStVC5q3icKak9GAs2QIdDx3PtW/S011NW3p+M5Eomh11ipTIKe6+4LQzHaQ+G+63pIZNJJQXMpljwTwj1brpgx5w1zZlyx5Z4QnllEIm2xeeSUHBf0hV0bejo1Uh09G3aFvgXk7cCJFBc9EdaRVuHJJaOdKyTV2TVhYLMduNR0Q9gxL5GaaTDw8GzejrDRBpxWoGsySRW0dttKuattwNkIlFw2YXgzOdYq4Ox49PlM+JrKd5OusjTWhBuVxUfMX/KXXZ3WEmkuqa67wspR4BTbwtKr/5u4fFgStse/T7EifFPnnYl9zPq4vmUOPrRndgoHjDti1gOPqlyXoifcRNGQzUd31lDyfHmob1Gp35vSr+P6vilcQ5Egtyd8YF/ySg9NhPM+9M/IOaHwp5+PSZayXTvCogEUwlatC3J8LLwYtcWB8EuDXQVuCkV5/B4eNHb7wGBs87LBDS+xjdVSn09wq1G8dFM+9tSUhIGneLvUdniKxKpTYljCpu3j7rVWlHj/P23v4NPGUEyeCQnexe9lJjzEQqMjJs+EzNAX6B98dBZVRmroJx95x/A/6gln18EyfCUsl+qdXb/tjvfbw+mwforpUOBz4XLVoBwAn3aWnfeH246NyBXhrq7TTN5lNSP9RkU+puUJm3W2Tsdq0nZWM07srk7MwQrZSRysjjGWBLRJNsNbfj2JMR4AbxpU1XLAb9Mxfpsq5EjMuuiR8L0JiHOOBX3hiUvOmavN0nMueSzcceFk0BK4pMqLo7vDD1Z0qrtDx7Itt4Xwm9UqbMmk8S0Dtuzb2pvOU99Z1nLTOfleNmvfZfP2pYZmPfajwosKdDBNpacNpVGGsWX9CyDI8Xq/Sj6QAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE0LTExLTEwVDAzOjE3OjU4LTA1OjAwF+tHyQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0xMS0xMFQwMzoxNzo1OC0wNTowMGa2/3UAAAAASUVORK5CYII=",height:20,width:20,type:"esriPMS",angle:0})}}_createWindBarbsRenderer(){const e=Array.from(Array(31).keys()).map(r=>5*r),t=[{range:"0-5",path:"M20 20 M5 20 A15 15 0 1 0 35 20 A15 15 0 1 0 5 20 M20 20 M10 20 A10 10 0 1 0 30 20 A10 10 0 1 0 10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTIwIDIwIE01IDIwIEExNSAxNSAwIDEgMCAzNSAyMCBBMTUgMTUgMCAxIDAgNSAyMCBNMjAgMjAgTTEwIDIwIEExMCAxMCAwIDEgMCAzMCAyMCBBMTAgMTAgMCAxIDAgMTAgMjAiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"5-10",path:"M25 0 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"10-15",path:"M25 0 L25 40 L10 45 L25 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"15-20",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjEyIDAgMTUgNDUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"20-25",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"25-30",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIEwyNSAzNSBNMjUgMzAgTDE3LjUgMzIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"30-35",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"35-40",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"40-45",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"45-50",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"50-55",path:"M25 0 L25 40 L10 40 L25 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"55-60",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxNy41IDMyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"60-65",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"65-70",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"70-75",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"75-80",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"80-85",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"85-90",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxNy41IDE3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"90-95",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"95-100",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20 L25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCBMMjUgMTUgTTI1IDEwIEwxNy41IDEyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"100-105",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"105-110",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDE3LjUgMjcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"110-115",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"115-120",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDE3LjUgMjIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"120-125",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"125-130",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDE3LjUgMTcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"130-135",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"135-140",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDE3LjUgMTIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"140-145",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"145-150",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IE0yNSAxMCBNMjUgNSBMMTcuNSA3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="}],i=ne.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAQAAADtq6NDAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAEY0lEQVRIx5XXWWxWRRQH8N+d+31tUdGAVjGglYJABFEBY91jfDAg7piYaFTccA++uMQEFRcSXlATtxiXqMQt4G4iisYl0ai4sIQYtVFZ1KIFKdTS0l4f7vRCS5fPebozc+bM/2z/Mzcx0AgSiUxXnKfIdMn875FIhX53U2n/B/s+kKM4UINTjTBZImixxnrv+9a2iL6zEoUBXcoudrWj/OtHm3wt02lfU9Qao9OnHvIhgmww84MEl1qnxfNmGrqHxAizLdPpC6chGcAxKGGcL+30gOERf1BSpUqVslQSV8d5ReZFe8VQ9avufJn31cWwlJV7iafKStGOE/1qvfH9qUxxu8ydUdmuSKbGO8YUdT2inKLG69pM70tliktl5qIkCAJGmusDG7Vqsc0WjZa4UBlBiA5YZIcjYzB7qDtH5kaUJFLs7RGZTZ42W4PRRmtwvbdt1+wGiaS4drEtDttdZYIDNVuAclR3vA3+dI3qHqmVSy7U6Tv1MScCPvPR7nIpFlsdCy3FdTLPGhK92e2CUITjMJ9ocwKxnsZqc3O3JwMma3d6UVLnyVxB4aXemZqvPqLdpJhW3KVVbY4yYImPo6M5Urv50fj+0z/FG9YaEiENs8UtMfXUaTeTePNHlhXfA1UU+2lyD1Il3Gtt9+adfpNG7dNlpg2U/T3KYLZ2dUWFdTgp3/rQ4sK973qnInV5TIf40x3dhvrJPBiqyWUo4wAtLqhQYS71qK+QKOFRywmGK/kpikzV6WMKhh58vGWs4TIJNjiEYLIuP8Tt4/zmLyqk+AyrJSbF+Qq1DgqRUPMxyl+9q3IQhX/rMCJ6tEunriDs1oSyQZKlr9AkhT2ZIARbJfaJS1vtVbHB+Rgi0RK/y1q1BWsEEyLoz40xtGKcARPVWB1BTPO7f4LNtpkUl1aoMbViLyZo0GRjPD3BxnxjqXeLYlvhqYrzMMG3HoyJXa3JjfnGlbYYFlP7Jh3qKsKY4hQ7TY0nG+xwRL61n63mxHtqNHosigyMLmClNwvuecFnOZB88nNBDzNkzhxEZaKMBVoKapggMzvHHXBEpNSSFAvtcFRsVn0bW8LlMmcXs+c0Kne3gRR32+zg4uXwjC6zit6Wt4a8LXVfcp/MtQXHn2ynGbuCmb8GvvFeJLEE82ReU9/n6+dkq2x3buG9Wn94smcgAw631RPR7BTH+kbmHReZoEpOdEe7zWqZl40s0JWs9Hmv7hjBHqPDwsjGKVJnWWqjbdZp1KhJi0aPmxYZsIRhlttgeF+Jlke41QcOQKoqilSb6HJzSvNG3G/UoWnxwsmt+sVaYwd63dRbqdnMyCPVeyRPvpYgdavM22oGKoMUVRbJfOWMwidJ8Zzb1UvmWK/VVUXzHaTjjrVYh1897HT7xxYEVUaa5SWb/WO+YUWa9SrwvigzM8YlzlYv2GSdVCYxxlBtVnnFq5olwp5/BEk/OLsf5LUmG2+inRJdVvjZ97ZH9/zP34ug1O91pf4p+D+JYBpvrKxfbwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0xMS0xMFQwMzoxMjowOS0wNTowMB9ViV0AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTQtMTEtMTBUMDM6MTI6MDktMDU6MDBuCDHhAAAAAElFTkSuQmCC",height:20,width:20,type:"esriPMS",angle:0}),a=e.map((r,o)=>{let n;if(o!==e.length-1)if(o===0)n={minValue:r,maxValue:e[o+1],symbol:i};else{const c=ne.fromJSON({type:"esriPMS",imageData:t[o].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0});n={minValue:r,maxValue:e[o+1],symbol:c}}return new xe(n)});return{defaultSymbol:i,classBreakInfos:a}}_getClassBreaks(e,t){return t.map((i,a)=>new xe({minValue:e[a],maxValue:e[a+1],symbol:this._getDefaultSymbol(new w(i))}))}};s([l({type:String,json:{write:!0}})],A.prototype,"attributeField",void 0),s([l({type:$.apiValues,json:{type:$.jsonValues,read:{reader:$.read},write:{writer:$.write}}})],A.prototype,"flowRepresentation",void 0),s([l({type:["geographic","arithmetic"],json:{write:!0}})],A.prototype,"rotationType",void 0),s([l({type:Q.apiValues,json:{type:Q.jsonValues,read:{reader:Q.read},write:{writer:Q.write}}})],A.prototype,"style",void 0),s([l({json:{write:!0}})],A.prototype,"symbolTileSize",void 0),s([l({type:x.apiValues,json:{type:x.jsonValues,write:{writer:x.write}}})],A.prototype,"inputUnit",void 0),s([Z("inputUnit")],A.prototype,"readInputUnit",null),s([l({type:x.apiValues,json:{type:x.jsonValues,read:{reader:x.read},write:{writer:x.write}}})],A.prototype,"outputUnit",void 0),s([Z("outputUnit")],A.prototype,"readOutputUnit",null),s([E({vectorField:"vector-field"})],A.prototype,"type",void 0),s([l({type:te})],A.prototype,"styleRenderer",null),s([l({type:Oe})],A.prototype,"sizeVariables",null),s([l({type:Fe})],A.prototype,"rotationVariables",null),A=ue=s([B("esri.renderers.VectorFieldRenderer")],A);const Ae=A,Ue={key:"type",base:null,typeMap:{"unique-value":ye,"class-breaks":te,"raster-colormap":we,"raster-stretch":he,"vector-field":Ae,"raster-shaded-relief":Ye,flow:Xe}},He={...Ue,typeMap:{...Ue.typeMap}};delete He.typeMap["vector-field"],delete He.typeMap.flow;const Zt={uniqueValue:ye,classBreaks:te,rasterStretch:he,rasterColormap:we,vectorField:Ae,rasterShadedRelief:Ye,flowRenderer:Xe};function kt(e){return e&&Zt[e.type]||null}function ca(e,t){if(!e)return null;if(e.type==="classBreaks"&&e.classificationMethod){const a=e.authoringInfo||{classificationMethod:""};a.classificationMethod=e.classificationMethod,e.authoringInfo=a}e.type==="vectorField"&&e.visualVariables&&!Array.isArray(e.visualVariables)&&(e.visualVariables=[e.visualVariables]);const i=kt(e);if(i){const a=new i;return a.read(e,t),a}return t&&t.messages&&e&&t.messages.push(new ht("renderer:unsupported","Renderers of type '"+(e.type||"unknown")+"' are not supported",{definition:e,context:t})),null}var ge;const q=new Set(["raster","raster2","dem","fillraster"]),Y=new Set(["rasters"]),Ze=e=>e&&e.rasterFunction?f.fromJSON(e):e,oe=e=>e&&e instanceof f?e.toJSON():e,pe=e=>(e==null?void 0:e.functionName)&&!e.declaredClass,ke=e=>pe(e)?new f(e):e,Rt=e=>{if(e==null)return null;e=S(e);const t={};for(const i of Object.keys(e))q.has(i.toLowerCase())?t[i]=Ze(e[i]):Y.has(i.toLowerCase())&&Array.isArray(e[i])?t[i]=e[i].map(Ze):t[i]=e[i];return t};let f=ge=class extends z{constructor(e){super(e),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.rasterFunctionDefinition=null}set functionArguments(e){if(e){const t=Object.keys(e);if(t.some(i=>q.has(i.toLowerCase())&&pe(e[i]))||t.some(i=>Y.has(i.toLowerCase())&&Array.isArray(e[i])&&e[i].some(a=>pe(a)))){e=S(e);for(const i of t)q.has(i.toLowerCase())?e[i]=ke(e[i]):Y.has(i.toLowerCase())&&Array.isArray(e[i])&&(e[i]=e[i].map(a=>ke(a)))}}this._set("functionArguments",e)}readFunctionArguments(e){return Rt(e)}writeFunctionArguments(e,t,i){const a={};for(const r of Object.keys(e))q.has(r.toLowerCase())?a[r]=oe(e[r]):Y.has(r.toLowerCase())&&Array.isArray(e[r])?a[r]=e[r].map(oe):a[r]=oe(e[r]);t[i]=a}readFunctionName(e,t){const i=t.rasterFunctionInfos;return t.name||(i&&i.length&&i[0].name!=="None"?i[0].name:t.rasterFunctionDefinition?t.rasterFunctionDefinition.name:t.rasterFunction)}clone(){return new ge({functionName:this.functionName,functionArguments:S(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:S(this.rasterFunctionDefinition)})}};s([l({json:{type:Object,name:"rasterFunctionArguments"}})],f.prototype,"functionArguments",null),s([Z("functionArguments")],f.prototype,"readFunctionArguments",null),s([Je("functionArguments")],f.prototype,"writeFunctionArguments",null),s([l({json:{type:String,write:{target:"rasterFunction"}}})],f.prototype,"functionName",void 0),s([Z("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],f.prototype,"readFunctionName",null),s([E({C128:"c128",C64:"c64",F32:"f32",F64:"f64",S16:"s16",S32:"s32",S8:"s8",U1:"u1",U16:"u16",U2:"u2",U32:"u32",U4:"u4",U8:"u8",UNKNOWN:"unknown"},{ignoreUnknown:!1}),l({json:{default:"unknown"}})],f.prototype,"outputPixelType",void 0),s([l({type:String,json:{read:!0,write:!0}})],f.prototype,"variableName",void 0),s([l({type:Object,json:{name:"rasterFunctionDefinition"}})],f.prototype,"rasterFunctionDefinition",void 0),f=ge=s([B("esri.layers.support.RasterFunction")],f);const Ma=f,da=Ke()({RSP_NearestNeighbor:"nearest",RSP_BilinearInterpolation:"bilinear",RSP_CubicConvolution:"cubic",RSP_Majority:"majority"}),ua=Ke()({esriNoDataMatchAny:"any",esriNoDataMatchAll:"all"});var Ie;const Et={base:ft,key:"type",typeMap:{extent:se,polygon:Dt}};let H=Ie=class extends z{constructor(e){super(e),this.areaOfInterest=null,this.subsetDefinitions=null}get dimensions(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Map;e.forEach(a=>{if(!a.dimensionName)return;let r,o;if(Array.isArray(a.values[0])){const n=a.values;r=n[0][0],o=n[a.values.length-1][1]}else{const n=a.values;r=n[0],o=n[a.values.length-1]}if(t.has(a.dimensionName)){const n=t.get(a.dimensionName);n[0]=Math.min(r,n[0]),n[1]=Math.max(o,n[1])}else t.set(a.dimensionName,[r,o])});const i=[];for(const a of t)i.push({name:a[0],extent:a[1]});return i}get variables(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Set;return e.forEach(i=>{i.variableName&&t.add(i.variableName)}),[...t]}clone(){var i;const e=(i=this.subsetDefinitions)==null?void 0:i.map(a=>a.clone()),t=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new Ie({areaOfInterest:t,subsetDefinitions:e})}};s([l({types:Et,json:{read:At,write:!0}})],H.prototype,"areaOfInterest",void 0),s([l({readOnly:!0})],H.prototype,"dimensions",null),s([l({readOnly:!0})],H.prototype,"variables",null),s([l({type:[Nt],json:{write:!0}})],H.prototype,"subsetDefinitions",void 0),H=Ie=s([B("esri.layers.support.MultidimensionalSubset")],H);const ga=H;class pa{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const t=await bt("RasterWorker");this._destroyed?t.close():this._workerThread=t}destroy(){this._destroyed=!0,this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(t,i){if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");const a=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:t.pixelBlock.toJSON(),type:t.dataType},i);return a?new U(a):null}async decode(t,i){if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");const a=await this._workerThread.invoke("decode",t,i);return a?new U(a):null}async symbolize(t,i){if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");const a={extent:t.extent&&t.extent.toJSON(),pixelBlock:g(t.pixelBlock)&&t.pixelBlock.toJSON(),simpleStretchParams:t.simpleStretchParams,bandIds:t.bandIds},r=await this._workerThread.invoke("symbolize",a,i);return r?new U(r):null}async updateSymbolizer(t,i){var r;if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");const a=(r=t==null?void 0:t.rendererJSON)==null?void 0:r.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:t.toJSON(),histograms:a},i))}async updateRasterFunction(t,i){if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");await Promise.all(this._workerThread.broadcast("updateRasterFunction",{rasterFunctionJSON:t.toJSON()},i))}async process(t,i){var r;if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");const a=await this._workerThread.invoke("process",{extent:(r=t.extent)==null?void 0:r.toJSON(),primaryPixelBlocks:t.primaryPixelBlocks.map(o=>g(o)?o.toJSON():null),primaryRasterIds:t.primaryRasterIds},i);return a?new U(a):null}async stretch(t,i){if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const a={srcPixelBlock:t.pixelBlock.toJSON(),stretchParams:t.stretchParams},r=await this._workerThread.invoke("stretch",a,i);return r?new U(r):null}async split(t,i){if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const a={srcPixelBlock:t.pixelBlock.toJSON(),tileSize:t.tileSize,maximumPyramidLevel:t.maximumPyramidLevel},r=await this._workerThread.invoke("split",a,i);return r&&r.forEach((o,n)=>{r.set(n,o?U.fromJSON(o):null)}),r}async estimateStatisticsHistograms(t,i){if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const a={srcPixelBlock:t.pixelBlock.toJSON()};return await this._workerThread.invoke("estimateStatisticsHistograms",a,i)}async mosaicAndTransform(t,i){var o;if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");if(!((o=t==null?void 0:t.srcPixelBlocks)!=null&&o.length))return{pixelBlock:null};const a={...t,srcPixelBlocks:t.srcPixelBlocks.map(n=>g(n)?n.toJSON():null)},r=await this._workerThread.invoke("mosaicAndTransform",a,i);return{pixelBlock:r.pixelBlock?new U(r.pixelBlock):null,localNorthDirections:r.localNorthDirections}}async createFlowMesh(t,i){if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");const a={buffer:t.flowData.data.buffer,maskBuffer:t.flowData.mask.buffer,width:t.flowData.width,height:t.flowData.height},{meshType:r,simulationSettings:o}=t,n=await this._workerThread.invoke("createFlowMesh",{meshType:r,flowData:a,simulationSettings:o},{...i,transferList:[a.buffer,a.maskBuffer]});return{vertexData:new Float32Array(n.vertexBuffer),indexData:new Uint32Array(n.indexBuffer)}}getProjectionOffsetGrid(t,i){if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");const a=g(t.datumTransformation)?t.datumTransformation.steps.map(n=>({wkid:n.wkid,wkt:n.wkt,isInverse:n.isInverse})):null,r=g(t.rasterTransform)?t.rasterTransform.toJSON():null,o={projectedExtent:t.projectedExtent.toJSON(),srcBufferExtent:t.srcBufferExtent.toJSON(),pixelSize:t.pixelSize,hasWrapAround:t.hasWrapAround,spacing:t.spacing,datumTransformationSteps:a,rasterTransform:r,isAdaptive:t.isAdaptive,includeGCSGrid:t.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",o,i)}}const Pt=.25,Gt=Qe.fromJSON({type:"multipart",colorRamps:[{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]}),Re=Qe.fromJSON(Bt[0]),et=new Set(["scientific","standard-time","vector-uv","vector-magdir","vector-u","vector-v","vector-magnitude","vector-direction"]);function Ia(e,t){const{attributeTable:i,colormap:a}=e;if(fe(e)){const r=ta(e);if(g(r))return r}if(g(a)){const r=Qt(e);if(g(r))return r}if(g(i)){const r=_t(e);if(g(r))return r}return Vt(e,t)}function ma(e,t=!1){const i=["raster-stretch"];return it(e)&&i.push("raster-colormap"),at(e)&&i.push("unique-value"),Xt(e,t)&&i.push("class-breaks"),$t(e)&&i.push("raster-shaded-relief"),fe(e)&&i.push("vector-field"),Yt(e)&&i.push("flow"),i}function ya(e,t,i){const a=["nearest","bilinear","cubic","majority"].find(r=>r===(i==null?void 0:i.toLowerCase()));return t==="Map"?a!=null?a:"bilinear":e.dataType==="standard-time"?a!=null?a:"nearest":e.dataType==="thematic"||e.attributeTable||e.colormap?a==="nearest"||a==="majority"?a:"nearest":a!=null?a:"bilinear"}function Vt(e,t){e=Wt(e,t==null?void 0:t.variableName);const{bandCount:i}=e;let{bandIds:a,stretchType:r}=t||{};a!=null&&a.some(p=>p>=i)&&(a=null);let o=O(e.statistics),n=O(e.histograms);i>1?(a=a!=null&&a.length?a:Jt(e),o=o==null?null:a==null?void 0:a.map(p=>o[p]),n=n==null?null:a==null?void 0:a.map(p=>n[p])):a=[0],r==null&&(r=Ft(e));let c=!1;switch(r){case"none":c=!1;break;case"percent-clip":c=!(n!=null&&n.length);break;default:c=!(o!=null&&o.length)}const{dataType:m}=e,M=(a==null?void 0:a.length)===1&&et.has(m)?Gt:null,y=new he({stretchType:r,dynamicRangeAdjustment:c,colorRamp:M,outputMin:0,outputMax:255,gamma:(a==null?void 0:a.length)===1?[1]:[1,1,1],useGamma:!1});return r==="percent-clip"?y.maxPercent=y.minPercent=Pt:r==="standard-deviation"&&(y.numberOfStandardDeviations=2),c||!g(e.multidimensionalInfo)&&!(t!=null&&t.includeStatisticsInStretch)||(r==="percent-clip"?y.histograms=n:r!=="min-max"&&r!=="standard-deviation"||(y.statistics=o)),y}function Wt(e,t){if(t==null)return e;let i=O(e.statistics),a=O(e.histograms);const{multidimensionalInfo:r}=e;if(t&&g(r)){const o=r.variables.find(n=>n.name===t);if(o){const{statistics:n,histograms:c}=o;n!=null&&n.length&&(i=n),c!=null&&c.length&&(a=c)}}return $e.fromJSON({...e.toJSON(),statistics:i,histograms:a})}function Jt(e){const t=e.bandCount;if(t===1)return null;if(t===2)return[0];const i=e.keyProperties&&e.keyProperties.BandProperties;let a;if(i&&i.length===t){const{red:r,green:o,blue:n,nir:c}=Ot(i);r!=null&&o!=null&&n!=null?a=[r,o,n]:c!=null&&r!=null&&o!=null&&(a=[c,r,o])}return!a&&t>=3&&(a=[0,1,2]),a}function Ot(e){var i;const t={};for(let a=0;a=410&&n<=480&&c>=480&&c<=540?t.blue=a:t.green==null&&n>=490&&n<=560&&c>=560&&c<=610?t.green=a:t.red==null&&n>=595&&n<=670&&c>=660&&c<=730?t.red=a:t.nir==null&&n>=700&&n<=860&&c>=800&&c<=950&&(t.nir=a)}}return t}function Ft(e){let t="percent-clip";const{pixelType:i,dataType:a,histograms:r,statistics:o}=e;return i!=="u8"||a!=="processed"&&g(r)&&g(o)?i==="u8"||a==="elevation"||et.has(a)?t="min-max":g(r)?t="percent-clip":g(o)&&(t="min-max"):t="none",t}function _t(e,t,i,a){if(!at(e,t))return null;const{attributeTable:r,statistics:o}=e,n=tt(r,t),c=J(r,"red"),m=J(r,"green"),M=J(r,"blue"),y=new Ge,p=[],v=new Set,C=!!(c&&m&&M);if(g(r))r.features.forEach(u=>{const d=u.attributes[n.name];if(!v.has(u.attributes[n.name])&&d!=null){v.add(d);const j=C&&(c.type==="single"||c.type==="double")&&(m.type==="single"||m.type==="double")&&(M.type==="single"||M.type==="double")&&!r.features.some(N=>N.attributes[c.name]>1||N.attributes[m.name]>1||N.attributes[M.name]>1),L=j?255:1;p.push(new Be({value:u.attributes[n.name],label:u.attributes[n.name]+"",symbol:{type:"simple-fill",style:"solid",outline:null,color:new w(C?[u.attributes[c.name]*L,u.attributes[m.name]*L,u.attributes[M.name]*L,1]:[0,0,0,0])}}))}});else if(o!=null&&o[0])for(let u=o[0].min;u<=o[0].max;u++)p.push(new Be({value:u,label:u.toString(),symbol:{type:"simple-fill",style:"solid",outline:null,color:new w([0,0,0,0])}}));if(p.sort((u,d)=>u.value&&typeof u.value.valueOf()=="string"?0:u.value>d.value?1:-1),!C){const u=le(Re,p.length);p.forEach((d,j)=>d.symbol.color=new w(u[j].slice(1,4))),y.colorRamp=Re}if(i||a){const u=i||le(a,p.length).map(d=>d.slice(1));p.forEach((d,j)=>d.symbol.color=new w(u[j])),y.colorRamp=a}return new ye({field:n.name,uniqueValueInfos:p,authoringInfo:y})}function tt(e,t,i){let a;return g(e)?(a=t?e.fields.find(r=>t.toLowerCase()===r.name.toLowerCase()):Kt(e.fields),a||(i||(a=e.fields.find(r=>r.type==="string")),a||(a=J(e,"value")))):a=new Ct({name:"value"}),a}function Kt(e){let t;for(let i=0;ii.name.toLowerCase()===t)}function at(e,t){const{attributeTable:i,bandCount:a}=e;return ee(i)&&qt(e)?!0:!(ee(i)||a>1||t&&i.fields.find(r=>r.name.toLowerCase()===t.toLowerCase())==null)}function it(e){const{bandCount:t,colormap:i}=e;return g(i)&&i.length>0&&t===1}function Qt(e){if(!it(e))return null;let t;const{attributeTable:i,colormap:a}=e;if(g(i)){const r=J(i,"value"),o=tt(i,null,!0);o.type==="string"&&(t={},i.features.forEach(n=>{const c=n.attributes;t[c[r.name]]=o?c[o.name]:c[r.name]}))}return we.createFromColormap(O(a),t)}function $t(e){const{bandCount:t,dataType:i,pixelType:a}=e;return i==="elevation"||i==="generic"&&t===1&&(a==="s16"||a==="s32"||a==="f32"||a==="f64")}function Xt(e,t=!1){const{attributeTable:i,bandCount:a}=e;return a===1&&(!t||g(i)||g(e.histograms))}function qt(e){var t,i,a;return["u8","s8"].includes(e.pixelType)&&((i=(t=e.statistics)==null?void 0:t[0])==null?void 0:i.min)!=null&&((a=e.statistics[0])==null?void 0:a.max)!=null&&e.bandCount===1}function fe(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}function Yt(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}const ea=new Map([["m/s","meter-per-second"],["km/h","kilometer-per-hour"],["knots","knots"],["ft/s","feet-per-second"],["mph","mile-per-hour"]]);function ta(e){if(!fe(e))return null;let t;if(g(e.statistics)&&e.statistics.length&&(e.dataType==="vector-magdir"||e.dataType==="vector-uv")){const{minMagnitude:r,maxMagnitude:o}=aa(e.dataType,e.statistics);t=[{type:"size",field:"Magnitude",minSize:10,maxSize:40,minDataValue:r,maxDataValue:o}]}const i=g(e.multidimensionalInfo)?ea.get(e.multidimensionalInfo.variables[0].unit):null,a=new Ae({visualVariables:t,inputUnit:i,rotationType:"geographic"});return a.visualVariables=[...a.sizeVariables,...a.rotationVariables],a}function Ee(e){var t;return{color:(t=e.symbolLayers[0].material)==null?void 0:t.color,type:"esriSFS",style:"esriSFSSolid"}}function wa(e){var t,i,a;if(e.type==="uniqueValue"){const r=e.uniqueValueInfos,o=r==null?void 0:r[0].symbol;return(t=o==null?void 0:o.symbolLayers)!=null&&t.length&&(e.uniqueValueInfos=r==null?void 0:r.map(n=>({value:n.value,label:n.label,symbol:n.symbol?Ee(n.symbol):null}))),e}if(e.type==="classBreaks"){const r=e.classBreakInfos;return(a=(i=r[0].symbol)==null?void 0:i.symbolLayers)!=null&&a.length&&(e.classBreakInfos=r.map(o=>({classMinValue:o.classMinValue,classMaxValue:o.classMaxValue,label:o.label,symbol:o.symbol?Ee(o.symbol):null}))),e}return e}function aa(e,t){let i,a;if(e==="vector-magdir")i=t[0].min,a=t[0].max;else{const r=t[0].min,o=t[0].max,n=t[1].min,c=t[1].max;i=0,a=Math.max(Math.abs(r),Math.abs(n),Math.abs(o),Math.abs(c))}return{minMagnitude:i,maxMagnitude:a}}async function rt(e,t,i){var be,Ce,Te,je,Le,Se,ve;const a=Tt(e),{renderingRule:r,sourceJSON:o}=t||{},n=r?JSON.stringify(r.rasterFunctionDefinition||r):null,c=jt({...a.query,renderingRule:n,f:"json"}),m=Lt(c,i);e=a.path;const M=o||await k(e,m).then(D=>D.data),y=M.hasRasterAttributeTable?k(`${e}/rasterAttributeTable`,m):null,p=M.hasColormap?k(`${e}/colormap`,m):null,v=M.hasHistograms?k(`${e}/histograms`,m):null,C=M.currentVersion>=10.3?k(`${e}/keyProperties`,m):null,u=M.hasMultidimensions?k(`${e}/multidimensionalInfo`,m):null,d=await Promise.allSettled([y,p,v,C,u]);let j=null;if(M.minValues&&M.minValues.length===M.bandCount){j=[];for(let D=0;D{var Ne;(Ne=D.statistics)!=null&&Ne.length&&D.statistics.forEach(_=>{_.avg=_.mean,_.stddev=_.standardDeviation})});const{defaultVariable:ae,serviceDataType:F}=M;ae&&ae!==P.DefaultVariable&&(P.DefaultVariable=ae),F&&F.includes("esriImageServiceDataTypeVector")&&!F.includes(P.DataType)&&(P.DataType=F.replace("esriImageServiceDataType",""));let ie=M.noDataValue;return((ve=M.noDataValues)==null?void 0:ve.length)&&M.noDataValues.some(D=>D!==ie)&&(ie=M.noDataValues),new $e({width:N,height:nt,bandCount:M.bandCount,extent:se.fromJSON(M.extent),spatialReference:De,pixelSize:new _e({x:M.pixelSizeX,y:M.pixelSizeY,spatialReference:De}),pixelType:M.pixelType.toLowerCase(),statistics:j,attributeTable:ot,colormap:st,histograms:lt,keyProperties:P,noDataValue:ie,multidimensionalInfo:G})}function ha(e,t,i){return rt(e,{sourceJSON:t},i)}function Aa(e,t,i){return rt(e,{renderingRule:t},i)}export{wa as $,Jt as L,ya as V,He as a,ga as c,Aa as f,ua as i,Ia as j,ma as k,Ue as l,ha as m,pa as n,da as o,ca as u,Ma as w}; +import{ct as me,i$ as Pe,b9 as w,a6 as s,a7 as l,bQ as re,ei as E,j0 as Ge,h1 as ct,a8 as B,cx as z,h0 as Mt,eW as Ve,d2 as Z,eX as We,b4 as S,e0 as Je,iX as Oe,j1 as Fe,j as ee,c as g,af as _e,e2 as dt,d1 as ut,e5 as gt,iF as pt,j2 as It,j3 as mt,j4 as yt,j5 as wt,j6 as te,iG as ne,j7 as xe,j8 as ye,ii as ht,ef as Ke,c9 as At,cY as ft,cU as se,az as Dt,d6 as bt,n as T,j9 as Qe,u as O,ja as Be,gG as Ct,dQ as Tt,e3 as jt,e4 as Lt,U as k,aT as St,d3 as vt}from"./index.221827cd.js";import{p as Nt}from"./multidimensionalUtils.59c05ac5.js";import{g as U}from"./pixelUtils.9c6f8dae.js";import{h as le,n as X,g as xt,i as Bt,e as $e}from"./RasterSymbolizer.093b1748.js";import{c as x,l as zt,d as Ut,g as Ht}from"./dataUtils.e7623e56.js";import"./generateRendererUtils.5c972fdb.js";var ce;const K=new me({flow_from:"flow-from",flow_to:"flow-to"});let h=ce=class extends Pe(z){constructor(e){super(e),this.density=.8,this.color=new w([255,255,255,1]),this.maxPathLength=200,this.trailWidth=1.5,this.flowSpeed=10,this.trailLength=100,this.smoothing=0,this.flowRepresentation="flow-from",this.type="flow",this.authoringInfo=null,this.legendOptions=null,this.trailCap="butt",this.background="none"}clone(){var C,u;const{density:e,maxPathLength:t,trailWidth:i,flowSpeed:a,trailLength:r,smoothing:o,flowRepresentation:n,trailCap:c,background:m}=this,M=this.color.clone(),y=(this.visualVariables||[]).map(d=>d.clone()),p=(C=this.authoringInfo)==null?void 0:C.clone(),v=(u=this.legendOptions)==null?void 0:u.clone();return new ce({density:e,color:M,maxPathLength:t,trailWidth:i,flowSpeed:a,trailLength:r,trailCap:c,background:m,smoothing:o,flowRepresentation:n,visualVariables:y,authoringInfo:p,legendOptions:v})}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}};s([l({type:Number,json:{write:!0}})],h.prototype,"density",void 0),s([l({type:w,json:{write:{allowNull:!0}}})],h.prototype,"color",void 0),s([l({type:Number,cast:re,json:{write:!0}})],h.prototype,"maxPathLength",void 0),s([l({type:Number,cast:re,json:{write:!0}})],h.prototype,"trailWidth",void 0),s([l({type:Number,json:{write:!0}})],h.prototype,"flowSpeed",void 0),s([l({type:Number,json:{write:!0}})],h.prototype,"trailLength",void 0),s([l({type:Number,cast:re,json:{write:!1}})],h.prototype,"smoothing",void 0),s([l({type:K.apiValues,json:{type:K.jsonValues,read:{reader:K.read},write:{writer:K.write}}})],h.prototype,"flowRepresentation",void 0),s([E({flowRenderer:"flow"})],h.prototype,"type",void 0),s([l({type:Ge,json:{write:!0}})],h.prototype,"authoringInfo",void 0),s([l({type:ct,json:{write:!0}})],h.prototype,"legendOptions",void 0),s([l({type:String,json:{write:!0}})],h.prototype,"trailCap",void 0),s([l({type:String,json:{write:!0}})],h.prototype,"background",void 0),h=ce=s([B("esri.renderers.FlowRenderer")],h);const Xe=h;let R=class extends z{constructor(){super(...arguments),this.value=null,this.label=null,this.color=null}};s([l({type:Number,json:{write:!0}})],R.prototype,"value",void 0),s([l({type:String,json:{write:!0}})],R.prototype,"label",void 0),s([l({type:w,json:{type:[Mt],write:!0}})],R.prototype,"color",void 0),R=s([B("esri.renderers.support.ColormapInfo")],R);const qe=R;var V;let W=V=class extends z{constructor(e){super(e),this.colormapInfos=null,this.type="raster-colormap"}static createFromColormap(e,t){if(!e)return null;const i=e[0].length===5,a=[...e].sort(r=>r[0][0]-r[1][0]).map(r=>{var o;return qe.fromJSON({value:r[0],color:i?r.slice(1,5):r.slice(1,4).concat([255]),label:t?(o=t[r[0]])!=null?o:"":r[0]})});return new V({colormapInfos:a})}static createFromColorramp(e){const t=le(e,256);return V.createFromColormap(t)}clone(){return new V({colormapInfos:this.colormapInfos.map(e=>e.toJSON())})}extractColormap(){return this.colormapInfos.map(({value:e,color:t})=>[e,t.r,t.g,t.b,t.a>1?t.a:255*t.a&255]).sort((e,t)=>e[0]-t[0])}};s([l({type:[qe],json:{write:!0}})],W.prototype,"colormapInfos",void 0),s([E({rasterColormap:"raster-colormap"})],W.prototype,"type",void 0),W=V=s([B("esri.renderers.RasterColormapRenderer")],W);const we=W;var Me;let b=Me=class extends z{constructor(e){super(e),this.altitude=45,this.azimuth=315,this.colorRamp=null,this.hillshadeType="traditional",this.pixelSizePower=.664,this.pixelSizeFactor=.024,this.scalingType="none",this.type="raster-shaded-relief",this.zFactor=1}readColorRamp(e){return We(e)}clone(){return new Me({hillshadeType:this.hillshadeType,altitude:this.altitude,azimuth:this.azimuth,zFactor:this.zFactor,scalingType:this.scalingType,pixelSizeFactor:this.pixelSizeFactor,pixelSizePower:this.pixelSizePower,colorRamp:S(this.colorRamp)})}};s([l({type:Number,json:{write:!0}})],b.prototype,"altitude",void 0),s([l({type:Number,json:{write:!0}})],b.prototype,"azimuth",void 0),s([l({types:Ve,json:{write:!0}})],b.prototype,"colorRamp",void 0),s([Z("colorRamp")],b.prototype,"readColorRamp",null),s([l({type:["traditional","multi-directional"],json:{write:!0}})],b.prototype,"hillshadeType",void 0),s([l({type:Number,json:{write:!0}})],b.prototype,"pixelSizePower",void 0),s([l({type:Number,json:{write:!0}})],b.prototype,"pixelSizeFactor",void 0),s([l({type:["none","adjusted"],json:{write:!0}})],b.prototype,"scalingType",void 0),s([E({rasterShadedRelief:"raster-shaded-relief"})],b.prototype,"type",void 0),s([l({type:Number,json:{write:!0}})],b.prototype,"zFactor",void 0),b=Me=s([B("esri.renderers.RasterShadedReliefRenderer")],b);const Ye=b;var de;let I=de=class extends z{constructor(e){super(e),this.colorRamp=null,this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.maxPercent=null,this.minPercent=null,this.numberOfStandardDeviations=null,this.outputMax=null,this.outputMin=null,this.sigmoidStrengthLevel=null,this.statistics=[],this.histograms=null,this.useGamma=!1,this.stretchType="none",this.type="raster-stretch"}readColorRamp(e){if(e)return We(e)}writeStatistics(e,t,i){e!=null&&e.length&&(Array.isArray(e[0])||(e=e.map(a=>[a.min,a.max,a.avg,a.stddev])),t[i]=e)}readStretchType(e,t){let i=t.stretchType;return typeof i=="number"&&(i=xt[i]),X.read(i)}clone(){return new de({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:S(this.statistics),gamma:S(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,colorRamp:S(this.colorRamp),histograms:S(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment})}};s([l({types:Ve,json:{write:!0}})],I.prototype,"colorRamp",void 0),s([Z("colorRamp")],I.prototype,"readColorRamp",null),s([l({type:Boolean,json:{write:!0}})],I.prototype,"computeGamma",void 0),s([l({type:Boolean,json:{write:{target:"dra"},read:{source:"dra"}}})],I.prototype,"dynamicRangeAdjustment",void 0),s([l({type:[Number],json:{write:!0}})],I.prototype,"gamma",void 0),s([l({type:Number,json:{write:!0}})],I.prototype,"maxPercent",void 0),s([l({type:Number,json:{write:!0}})],I.prototype,"minPercent",void 0),s([l({type:Number,json:{write:!0}})],I.prototype,"numberOfStandardDeviations",void 0),s([l({type:Number,json:{read:{source:"max"},write:{target:"max"}}})],I.prototype,"outputMax",void 0),s([l({type:Number,json:{read:{source:"min"},write:{target:"min"}}})],I.prototype,"outputMin",void 0),s([l({type:Number,json:{write:!0}})],I.prototype,"sigmoidStrengthLevel",void 0),s([l({json:{type:[[Number]],write:!0}})],I.prototype,"statistics",void 0),s([l()],I.prototype,"histograms",void 0),s([Je("statistics")],I.prototype,"writeStatistics",null),s([l({type:Boolean,json:{write:!0}})],I.prototype,"useGamma",void 0),s([l({type:X.apiValues,json:{type:X.jsonValues,write:X.write}})],I.prototype,"stretchType",void 0),s([Z("stretchType",["stretchType"])],I.prototype,"readStretchType",null),s([E({rasterStretch:"raster-stretch"})],I.prototype,"type",void 0),I=de=s([B("esri.renderers.RasterStretchRenderer")],I);const he=I;var ue;const ze=new Set(["esriMetersPerSecond","esriKilometersPerHour","esriKnots","esriFeetPerSecond","esriMilesPerHour"]),Q=new me({beaufort_ft:"beaufort-ft",beaufort_km:"beaufort-km",beaufort_kn:"beaufort-kn",beaufort_m:"beaufort-m",beaufort_mi:"beaufort-mi",classified_arrow:"classified-arrow",ocean_current_kn:"ocean-current-kn",ocean_current_m:"ocean-current-m",simple_scalar:"simple-scalar",single_arrow:"single-arrow",wind_speed:"wind-barb"}),$=new me({flow_from:"flow-from",flow_to:"flow-to"});let A=ue=class extends Pe(z){constructor(e){super(e),this.attributeField="Magnitude",this.flowRepresentation="flow-from",this.rotationType="arithmetic",this.style="single-arrow",this.symbolTileSize=50,this.type="vector-field"}readInputUnit(e,t){return ze.has(e)?x.fromJSON(e):null}readOutputUnit(e,t){return ze.has(e)?x.fromJSON(e):null}get styleRenderer(){const e=this.style,t=this.attributeField,i=this._createStyleRenderer(e);return i.field=t,i}get sizeVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="size"&&e.push(t);if(e.length===0){const t=new Oe({field:"Magnitude",minSize:.2*this.symbolTileSize,maxSize:.8*this.symbolTileSize});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}get rotationVariables(){const e=[];if(this.visualVariables)for(const t of this.visualVariables)t.type==="rotation"&&e.push(t);if(e.length===0){const t=new Fe({field:"Direction",rotationType:this.rotationType});this.visualVariables?this.visualVariables.push(t):this._set("visualVariables",[t]),e.push(t)}return e}clone(){return new ue({attributeField:this.attributeField,flowRepresentation:this.flowRepresentation,rotationType:this.rotationType,symbolTileSize:this.symbolTileSize,style:this.style,visualVariables:S(this.visualVariables),inputUnit:this.inputUnit,outputUnit:this.outputUnit})}async getGraphicsFromPixelData(e,t=!1,i=[]){var v;const a=new Array,r=zt(this.inputUnit,this.outputUnit),o=((v=this.rotationVariables[0])==null?void 0:v.rotationType)||this.rotationType,n=t?Ut(e.pixelBlock,"vector-uv",o,r):Ht(e.pixelBlock,"vector-magdir",r);if(ee(n))return a;const c=e.extent,m=g(n.mask)&&n.mask.length>0;let M=0;const y=(c.xmax-c.xmin)/n.width,p=(c.ymax-c.ymin)/n.height;for(let C=0;CL.intersects(d));if((!m||n.mask[M])&&!j){const L={Magnitude:n.pixels[0][M],Direction:n.pixels[1][M]},N=new ut({geometry:{type:"point",x:d.x,y:d.y,spatialReference:c.spatialReference},attributes:L});N.symbol=this._getVisualVariablesAppliedSymbol(N),a.push(N)}}return a}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getClassBreakInfos(){var e;return(e=this.styleRenderer)==null?void 0:e.classBreakInfos}getDefaultSymbol(){var e;return(e=this.styleRenderer)==null?void 0:e.defaultSymbol}_getDefaultSymbol(e){return new gt({path:"M14,32 14,18 9,23 16,3 22,23 17,18 17,32 z",outline:new pt({width:0}),size:20,color:e||new w([0,92,230])})}_getVisualVariablesAppliedSymbol(e){var r,o;if(!e)return;const t=(o=(r=this.styleRenderer)==null?void 0:r.getSymbol(e))==null?void 0:o.clone(),i=this.sizeVariables,a=this.rotationVariables;if(i&&i.length&&this.sizeVariables.forEach(n=>It(t,mt([n],e))),a&&a.length){const n=this.flowRepresentation==="flow-to"==(this.style==="ocean-current-kn"||this.style==="ocean-current-m")?0:180;e.attributes.Direction=e.attributes.Direction+n,this.rotationVariables.forEach(c=>yt(t,wt(c,e),c.axis))}return t}_createStyleRenderer(e){let t={defaultSymbol:this._getDefaultSymbol(),classBreakInfos:[]};switch(e){case"single-arrow":t=this._createSingleArrowRenderer();break;case"beaufort-kn":t=this._createBeaufortKnotsRenderer();break;case"beaufort-m":t=this._createBeaufortMeterRenderer();break;case"beaufort-ft":t=this._createBeaufortFeetRenderer();break;case"beaufort-mi":t=this._createBeaufortMilesRenderer();break;case"beaufort-km":t=this._createBeaufortKilometersRenderer();break;case"ocean-current-m":t=this._createCurrentMeterRenderer();break;case"ocean-current-kn":t=this._createCurrentKnotsRenderer();break;case"simple-scalar":t=this._createSimpleScalarRenderer();break;case"wind-barb":t=this._createWindBarbsRenderer();break;case"classified-arrow":t=this._createClassifiedArrowRenderer()}return new te(t)}_createSingleArrowRenderer(){return{defaultSymbol:this._getDefaultSymbol()}}_createBeaufortKnotsRenderer(){const e=[0,1,3,6,10,16,21,27,33,40,47,55,63],t=[[40,146,199],[89,162,186],[129,179,171],[160,194,155],[191,212,138],[218,230,119],[250,250,100],[252,213,83],[252,179,102],[250,141,52],[247,110,42],[240,71,29]];return{defaultSymbol:this._getDefaultSymbol(new w([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortMeterRenderer(){const e=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7],t=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]];return{defaultSymbol:this._getDefaultSymbol(new w([214,47,39])),classBreakInfos:this._getClassBreaks(e,t)}}_createBeaufortFeetRenderer(){const e=this._getDefaultSymbol(new w([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],a=3.28084;return t=t.map(r=>r*a),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortMilesRenderer(){const e=this._getDefaultSymbol(new w([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],a=2.23694;return t=t.map(r=>r*a),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createBeaufortKilometersRenderer(){const e=this._getDefaultSymbol(new w([214,47,39]));let t=[0,.2,1.8,3.3,5.4,8.5,11,14.1,17.2,20.8,24.4,28.6,32.7];const i=[[69,117,181],[101,137,184],[132,158,186],[162,180,189],[192,204,190],[222,227,191],[255,255,191],[255,220,161],[250,185,132],[245,152,105],[237,117,81],[232,21,21]],a=3.6;return t=t.map(r=>r*a),{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createCurrentMeterRenderer(){const e=[0,.5,1,1.5,2],t=[[78,26,153],[179,27,26],[202,128,26],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new w([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createCurrentKnotsRenderer(){const e=[0,.25,.5,1,1.5,2,2.5,3,3.5,4],t=[[0,0,0],[0,37,100],[78,26,153],[151,0,100],[179,27,26],[177,78,26],[202,128,26],[177,179,52],[177,177,177]];return{defaultSymbol:this._getDefaultSymbol(new w([177,177,177])),classBreakInfos:this._getClassBreaks(e,t)}}_createClassifiedArrowRenderer(){var a;const e=this._getDefaultSymbol(new w([56,168,0]));let t=[0,1e-6,3.5,7,10.5,14];if((a=this.sizeVariables)!=null&&a.length){const r=this.sizeVariables[0].minDataValue,o=this.sizeVariables[0].maxDataValue;if(r&&o){const n=(o-r)/5;t=Array.from(Array(6).keys()).map(c=>r+n*c)}}const i=[[56,168,0],[139,309,0],[255,255,0],[255,128,0],[255,0,0]];return{defaultSymbol:e,classBreakInfos:this._getClassBreaks(t,i)}}_createSimpleScalarRenderer(){return{defaultSymbol:ne.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACsAAAArCAQAAABLVLlLAAAABGdBTUEAAYagMeiWXwAAAAJiS0dEAACqjSMyAAAACXBIWXMAAABIAAAASABGyWs+AAAC3ElEQVRIx9XXvW4cVRQH8N982btpsIREJECyiCXsxX4DKh6AliqGKCBBE2SlwlHgAbBD/AKmyEYUeQ1KahPZSZQvBCkQLTHZ7KGY8Xodz4w3a1NwbzVzz/znfJ//zbStVC5q3icKak9GAs2QIdDx3PtW/S011NW3p+M5Eomh11ipTIKe6+4LQzHaQ+G+63pIZNJJQXMpljwTwj1brpgx5w1zZlyx5Z4QnllEIm2xeeSUHBf0hV0bejo1Uh09G3aFvgXk7cCJFBc9EdaRVuHJJaOdKyTV2TVhYLMduNR0Q9gxL5GaaTDw8GzejrDRBpxWoGsySRW0dttKuattwNkIlFw2YXgzOdYq4Ox49PlM+JrKd5OusjTWhBuVxUfMX/KXXZ3WEmkuqa67wspR4BTbwtKr/5u4fFgStse/T7EifFPnnYl9zPq4vmUOPrRndgoHjDti1gOPqlyXoifcRNGQzUd31lDyfHmob1Gp35vSr+P6vilcQ5Egtyd8YF/ySg9NhPM+9M/IOaHwp5+PSZayXTvCogEUwlatC3J8LLwYtcWB8EuDXQVuCkV5/B4eNHb7wGBs87LBDS+xjdVSn09wq1G8dFM+9tSUhIGneLvUdniKxKpTYljCpu3j7rVWlHj/P23v4NPGUEyeCQnexe9lJjzEQqMjJs+EzNAX6B98dBZVRmroJx95x/A/6gln18EyfCUsl+qdXb/tjvfbw+mwforpUOBz4XLVoBwAn3aWnfeH246NyBXhrq7TTN5lNSP9RkU+puUJm3W2Tsdq0nZWM07srk7MwQrZSRysjjGWBLRJNsNbfj2JMR4AbxpU1XLAb9Mxfpsq5EjMuuiR8L0JiHOOBX3hiUvOmavN0nMueSzcceFk0BK4pMqLo7vDD1Z0qrtDx7Itt4Xwm9UqbMmk8S0Dtuzb2pvOU99Z1nLTOfleNmvfZfP2pYZmPfajwosKdDBNpacNpVGGsWX9CyDI8Xq/Sj6QAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDE0LTExLTEwVDAzOjE3OjU4LTA1OjAwF+tHyQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAxNC0xMS0xMFQwMzoxNzo1OC0wNTowMGa2/3UAAAAASUVORK5CYII=",height:20,width:20,type:"esriPMS",angle:0})}}_createWindBarbsRenderer(){const e=Array.from(Array(31).keys()).map(r=>5*r),t=[{range:"0-5",path:"M20 20 M5 20 A15 15 0 1 0 35 20 A15 15 0 1 0 5 20 M20 20 M10 20 A10 10 0 1 0 30 20 A10 10 0 1 0 10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTIwIDIwIE01IDIwIEExNSAxNSAwIDEgMCAzNSAyMCBBMTUgMTUgMCAxIDAgNSAyMCBNMjAgMjAgTTEwIDIwIEExMCAxMCAwIDEgMCAzMCAyMCBBMTAgMTAgMCAxIDAgMTAgMjAiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"5-10",path:"M25 0 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"10-15",path:"M25 0 L25 40 L10 45 L25 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNyA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"15-20",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L17.5 37.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjEyIDAgMTUgNDUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxNy41IDM3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"20-25",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"25-30",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjkgMCAyNiA0NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8cGF0aCBkPSJNMjUgMCBMMjUgNDAgTDEwIDQ1IEwyNSA0MCBNMjUgMzUgTDEwIDQwIEwyNSAzNSBNMjUgMzAgTDE3LjUgMzIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"30-35",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"35-40",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"40-45",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"45-50",path:"M25 0 L25 40 L10 45 L25 40 M25 35 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0NiI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0NSBMMjUgNDAgTTI1IDM1IEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"50-55",path:"M25 0 L25 40 L10 40 L25 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"55-60",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L17.5 32.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMHB4IiBoZWlnaHQ9IjIwcHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxNy41IDMyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"60-65",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"65-70",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxNy41IDI3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"70-75",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"75-80",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxNy41IDIyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"80-85",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"85-90",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxNy41IDE3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"90-95",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"95-100",path:"M25 0 L25 40 L10 40 L25 35 M25 30 L10 35 L25 30 M25 25 L10 30 L25 25 M25 20 L10 25 L25 20 M25 15 L10 20 L25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTTI1IDMwIEwxMCAzNSBMMjUgMzAgTTI1IDI1IEwxMCAzMCBMMjUgMjUgTTI1IDIwIEwxMCAyNSBMMjUgMjAgTTI1IDE1IEwxMCAyMCBMMjUgMTUgTTI1IDEwIEwxNy41IDEyLjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="},{range:"100-105",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIzMnB4IiBoZWlnaHQ9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"105-110",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L17.5 27.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDE3LjUgMjcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"110-115",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"115-120",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L17.5 22.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDE3LjUgMjIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"120-125",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"125-130",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L17.5 17.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDE3LjUgMTcuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"130-135",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"135-140",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDE3LjUgMTIuNSIgc3R5bGU9InN0cm9rZTpyZ2IoMCwwLDApO3N0cm9rZS13aWR0aDoxLjUiLz4KIDwvc3ZnPg=="},{range:"140-145",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IiBzdHlsZT0ic3Ryb2tlOnJnYigwLDAsMCk7c3Ryb2tlLXdpZHRoOjEuNSIvPgogPC9zdmc+"},{range:"145-150",path:"M25 0 L25 40 L10 40 L25 35 L10 35 L25 30 M25 25 L10 30 M25 25 M25 20 L10 25 M25 20 M25 15 L10 20 M25 15 M25 10 L17.5 12.5",imageData:"PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMzJweCIgd2lkdGg9IjMycHgiIHZpZXdCb3g9IjkgMCAyNiA0MSI+CiAgPHBhdGggZD0iTTI1IDAgTDI1IDQwIEwxMCA0MCBMMjUgMzUgTDEwIDM1IEwyNSAzMCBNMjUgMjUgTDEwIDMwIE0yNSAyNSBNMjUgMjAgTDEwIDI1IE0yNSAyMCBNMjUgMTUgTDEwIDIwIE0yNSAxNSBNMjUgMTAgTDEwIDE1IE0yNSAxMCBNMjUgNSBMMTcuNSA3LjUiIHN0eWxlPSJzdHJva2U6cmdiKDAsMCwwKTtzdHJva2Utd2lkdGg6MS41Ii8+CiA8L3N2Zz4="}],i=ne.fromJSON({imageData:"iVBORw0KGgoAAAANSUhEUgAAACgAAAApCAQAAADtq6NDAAAABGdBTUEAALGPC/xhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAJiS0dEAP+Hj8y/AAAACXBIWXMAAA7DAAAOwwHHb6hkAAAEY0lEQVRIx5XXWWxWRRQH8N+d+31tUdGAVjGglYJABFEBY91jfDAg7piYaFTccA++uMQEFRcSXlATtxiXqMQt4G4iisYl0ai4sIQYtVFZ1KIFKdTS0l4f7vRCS5fPebozc+bM/2z/Mzcx0AgSiUxXnKfIdMn875FIhX53U2n/B/s+kKM4UINTjTBZImixxnrv+9a2iL6zEoUBXcoudrWj/OtHm3wt02lfU9Qao9OnHvIhgmww84MEl1qnxfNmGrqHxAizLdPpC6chGcAxKGGcL+30gOERf1BSpUqVslQSV8d5ReZFe8VQ9avufJn31cWwlJV7iafKStGOE/1qvfH9qUxxu8ydUdmuSKbGO8YUdT2inKLG69pM70tliktl5qIkCAJGmusDG7Vqsc0WjZa4UBlBiA5YZIcjYzB7qDtH5kaUJFLs7RGZTZ42W4PRRmtwvbdt1+wGiaS4drEtDttdZYIDNVuAclR3vA3+dI3qHqmVSy7U6Tv1MScCPvPR7nIpFlsdCy3FdTLPGhK92e2CUITjMJ9ocwKxnsZqc3O3JwMma3d6UVLnyVxB4aXemZqvPqLdpJhW3KVVbY4yYImPo6M5Urv50fj+0z/FG9YaEiENs8UtMfXUaTeTePNHlhXfA1UU+2lyD1Il3Gtt9+adfpNG7dNlpg2U/T3KYLZ2dUWFdTgp3/rQ4sK973qnInV5TIf40x3dhvrJPBiqyWUo4wAtLqhQYS71qK+QKOFRywmGK/kpikzV6WMKhh58vGWs4TIJNjiEYLIuP8Tt4/zmLyqk+AyrJSbF+Qq1DgqRUPMxyl+9q3IQhX/rMCJ6tEunriDs1oSyQZKlr9AkhT2ZIARbJfaJS1vtVbHB+Rgi0RK/y1q1BWsEEyLoz40xtGKcARPVWB1BTPO7f4LNtpkUl1aoMbViLyZo0GRjPD3BxnxjqXeLYlvhqYrzMMG3HoyJXa3JjfnGlbYYFlP7Jh3qKsKY4hQ7TY0nG+xwRL61n63mxHtqNHosigyMLmClNwvuecFnOZB88nNBDzNkzhxEZaKMBVoKapggMzvHHXBEpNSSFAvtcFRsVn0bW8LlMmcXs+c0Kne3gRR32+zg4uXwjC6zit6Wt4a8LXVfcp/MtQXHn2ynGbuCmb8GvvFeJLEE82ReU9/n6+dkq2x3buG9Wn94smcgAw631RPR7BTH+kbmHReZoEpOdEe7zWqZl40s0JWs9Hmv7hjBHqPDwsjGKVJnWWqjbdZp1KhJi0aPmxYZsIRhlttgeF+Jlke41QcOQKoqilSb6HJzSvNG3G/UoWnxwsmt+sVaYwd63dRbqdnMyCPVeyRPvpYgdavM22oGKoMUVRbJfOWMwidJ8Zzb1UvmWK/VVUXzHaTjjrVYh1897HT7xxYEVUaa5SWb/WO+YUWa9SrwvigzM8YlzlYv2GSdVCYxxlBtVnnFq5olwp5/BEk/OLsf5LUmG2+inRJdVvjZ97ZH9/zP34ug1O91pf4p+D+JYBpvrKxfbwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAxNC0xMS0xMFQwMzoxMjowOS0wNTowMB9ViV0AAAAldEVYdGRhdGU6bW9kaWZ5ADIwMTQtMTEtMTBUMDM6MTI6MDktMDU6MDBuCDHhAAAAAElFTkSuQmCC",height:20,width:20,type:"esriPMS",angle:0}),a=e.map((r,o)=>{let n;if(o!==e.length-1)if(o===0)n={minValue:r,maxValue:e[o+1],symbol:i};else{const c=ne.fromJSON({type:"esriPMS",imageData:t[o].imageData,contentType:"image/svg+xml",height:32,width:32,angle:0});n={minValue:r,maxValue:e[o+1],symbol:c}}return new xe(n)});return{defaultSymbol:i,classBreakInfos:a}}_getClassBreaks(e,t){return t.map((i,a)=>new xe({minValue:e[a],maxValue:e[a+1],symbol:this._getDefaultSymbol(new w(i))}))}};s([l({type:String,json:{write:!0}})],A.prototype,"attributeField",void 0),s([l({type:$.apiValues,json:{type:$.jsonValues,read:{reader:$.read},write:{writer:$.write}}})],A.prototype,"flowRepresentation",void 0),s([l({type:["geographic","arithmetic"],json:{write:!0}})],A.prototype,"rotationType",void 0),s([l({type:Q.apiValues,json:{type:Q.jsonValues,read:{reader:Q.read},write:{writer:Q.write}}})],A.prototype,"style",void 0),s([l({json:{write:!0}})],A.prototype,"symbolTileSize",void 0),s([l({type:x.apiValues,json:{type:x.jsonValues,write:{writer:x.write}}})],A.prototype,"inputUnit",void 0),s([Z("inputUnit")],A.prototype,"readInputUnit",null),s([l({type:x.apiValues,json:{type:x.jsonValues,read:{reader:x.read},write:{writer:x.write}}})],A.prototype,"outputUnit",void 0),s([Z("outputUnit")],A.prototype,"readOutputUnit",null),s([E({vectorField:"vector-field"})],A.prototype,"type",void 0),s([l({type:te})],A.prototype,"styleRenderer",null),s([l({type:Oe})],A.prototype,"sizeVariables",null),s([l({type:Fe})],A.prototype,"rotationVariables",null),A=ue=s([B("esri.renderers.VectorFieldRenderer")],A);const Ae=A,Ue={key:"type",base:null,typeMap:{"unique-value":ye,"class-breaks":te,"raster-colormap":we,"raster-stretch":he,"vector-field":Ae,"raster-shaded-relief":Ye,flow:Xe}},He={...Ue,typeMap:{...Ue.typeMap}};delete He.typeMap["vector-field"],delete He.typeMap.flow;const Zt={uniqueValue:ye,classBreaks:te,rasterStretch:he,rasterColormap:we,vectorField:Ae,rasterShadedRelief:Ye,flowRenderer:Xe};function kt(e){return e&&Zt[e.type]||null}function ca(e,t){if(!e)return null;if(e.type==="classBreaks"&&e.classificationMethod){const a=e.authoringInfo||{classificationMethod:""};a.classificationMethod=e.classificationMethod,e.authoringInfo=a}e.type==="vectorField"&&e.visualVariables&&!Array.isArray(e.visualVariables)&&(e.visualVariables=[e.visualVariables]);const i=kt(e);if(i){const a=new i;return a.read(e,t),a}return t&&t.messages&&e&&t.messages.push(new ht("renderer:unsupported","Renderers of type '"+(e.type||"unknown")+"' are not supported",{definition:e,context:t})),null}var ge;const q=new Set(["raster","raster2","dem","fillraster"]),Y=new Set(["rasters"]),Ze=e=>e&&e.rasterFunction?f.fromJSON(e):e,oe=e=>e&&e instanceof f?e.toJSON():e,pe=e=>(e==null?void 0:e.functionName)&&!e.declaredClass,ke=e=>pe(e)?new f(e):e,Rt=e=>{if(e==null)return null;e=S(e);const t={};for(const i of Object.keys(e))q.has(i.toLowerCase())?t[i]=Ze(e[i]):Y.has(i.toLowerCase())&&Array.isArray(e[i])?t[i]=e[i].map(Ze):t[i]=e[i];return t};let f=ge=class extends z{constructor(e){super(e),this.functionName=null,this.outputPixelType="unknown",this.variableName=null,this.rasterFunctionDefinition=null}set functionArguments(e){if(e){const t=Object.keys(e);if(t.some(i=>q.has(i.toLowerCase())&&pe(e[i]))||t.some(i=>Y.has(i.toLowerCase())&&Array.isArray(e[i])&&e[i].some(a=>pe(a)))){e=S(e);for(const i of t)q.has(i.toLowerCase())?e[i]=ke(e[i]):Y.has(i.toLowerCase())&&Array.isArray(e[i])&&(e[i]=e[i].map(a=>ke(a)))}}this._set("functionArguments",e)}readFunctionArguments(e){return Rt(e)}writeFunctionArguments(e,t,i){const a={};for(const r of Object.keys(e))q.has(r.toLowerCase())?a[r]=oe(e[r]):Y.has(r.toLowerCase())&&Array.isArray(e[r])?a[r]=e[r].map(oe):a[r]=oe(e[r]);t[i]=a}readFunctionName(e,t){const i=t.rasterFunctionInfos;return t.name||(i&&i.length&&i[0].name!=="None"?i[0].name:t.rasterFunctionDefinition?t.rasterFunctionDefinition.name:t.rasterFunction)}clone(){return new ge({functionName:this.functionName,functionArguments:S(this.functionArguments),outputPixelType:this.outputPixelType,variableName:this.variableName,rasterFunctionDefinition:S(this.rasterFunctionDefinition)})}};s([l({json:{type:Object,name:"rasterFunctionArguments"}})],f.prototype,"functionArguments",null),s([Z("functionArguments")],f.prototype,"readFunctionArguments",null),s([Je("functionArguments")],f.prototype,"writeFunctionArguments",null),s([l({json:{type:String,write:{target:"rasterFunction"}}})],f.prototype,"functionName",void 0),s([Z("functionName",["rasterFunction","rasterFunctionInfos","rasterFunctionDefinition"])],f.prototype,"readFunctionName",null),s([E({C128:"c128",C64:"c64",F32:"f32",F64:"f64",S16:"s16",S32:"s32",S8:"s8",U1:"u1",U16:"u16",U2:"u2",U32:"u32",U4:"u4",U8:"u8",UNKNOWN:"unknown"},{ignoreUnknown:!1}),l({json:{default:"unknown"}})],f.prototype,"outputPixelType",void 0),s([l({type:String,json:{read:!0,write:!0}})],f.prototype,"variableName",void 0),s([l({type:Object,json:{name:"rasterFunctionDefinition"}})],f.prototype,"rasterFunctionDefinition",void 0),f=ge=s([B("esri.layers.support.RasterFunction")],f);const Ma=f,da=Ke()({RSP_NearestNeighbor:"nearest",RSP_BilinearInterpolation:"bilinear",RSP_CubicConvolution:"cubic",RSP_Majority:"majority"}),ua=Ke()({esriNoDataMatchAny:"any",esriNoDataMatchAll:"all"});var Ie;const Et={base:ft,key:"type",typeMap:{extent:se,polygon:Dt}};let H=Ie=class extends z{constructor(e){super(e),this.areaOfInterest=null,this.subsetDefinitions=null}get dimensions(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Map;e.forEach(a=>{if(!a.dimensionName)return;let r,o;if(Array.isArray(a.values[0])){const n=a.values;r=n[0][0],o=n[a.values.length-1][1]}else{const n=a.values;r=n[0],o=n[a.values.length-1]}if(t.has(a.dimensionName)){const n=t.get(a.dimensionName);n[0]=Math.min(r,n[0]),n[1]=Math.max(o,n[1])}else t.set(a.dimensionName,[r,o])});const i=[];for(const a of t)i.push({name:a[0],extent:a[1]});return i}get variables(){const{subsetDefinitions:e}=this;if(e==null||e.length===0)return[];const t=new Set;return e.forEach(i=>{i.variableName&&t.add(i.variableName)}),[...t]}clone(){var i;const e=(i=this.subsetDefinitions)==null?void 0:i.map(a=>a.clone()),t=this.areaOfInterest?this.areaOfInterest.clone():this.areaOfInterest;return new Ie({areaOfInterest:t,subsetDefinitions:e})}};s([l({types:Et,json:{read:At,write:!0}})],H.prototype,"areaOfInterest",void 0),s([l({readOnly:!0})],H.prototype,"dimensions",null),s([l({readOnly:!0})],H.prototype,"variables",null),s([l({type:[Nt],json:{write:!0}})],H.prototype,"subsetDefinitions",void 0),H=Ie=s([B("esri.layers.support.MultidimensionalSubset")],H);const ga=H;class pa{constructor(){this._workerThread=null,this._destroyed=!1}async initialize(){const t=await bt("RasterWorker");this._destroyed?t.close():this._workerThread=t}destroy(){this._destroyed=!0,this._workerThread&&(this._workerThread.close(),this._workerThread=null)}async convertVectorFieldData(t,i){if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");const a=await this._workerThread.invoke("convertVectorFieldData",{pixelBlock:t.pixelBlock.toJSON(),type:t.dataType},i);return a?new U(a):null}async decode(t,i){if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");const a=await this._workerThread.invoke("decode",t,i);return a?new U(a):null}async symbolize(t,i){if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");const a={extent:t.extent&&t.extent.toJSON(),pixelBlock:g(t.pixelBlock)&&t.pixelBlock.toJSON(),simpleStretchParams:t.simpleStretchParams,bandIds:t.bandIds},r=await this._workerThread.invoke("symbolize",a,i);return r?new U(r):null}async updateSymbolizer(t,i){var r;if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");const a=(r=t==null?void 0:t.rendererJSON)==null?void 0:r.histograms;await Promise.all(this._workerThread.broadcast("updateSymbolizer",{symbolizerJSON:t.toJSON(),histograms:a},i))}async updateRasterFunction(t,i){if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");await Promise.all(this._workerThread.broadcast("updateRasterFunction",{rasterFunctionJSON:t.toJSON()},i))}async process(t,i){var r;if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");const a=await this._workerThread.invoke("process",{extent:(r=t.extent)==null?void 0:r.toJSON(),primaryPixelBlocks:t.primaryPixelBlocks.map(o=>g(o)?o.toJSON():null),primaryRasterIds:t.primaryRasterIds},i);return a?new U(a):null}async stretch(t,i){if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const a={srcPixelBlock:t.pixelBlock.toJSON(),stretchParams:t.stretchParams},r=await this._workerThread.invoke("stretch",a,i);return r?new U(r):null}async split(t,i){if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const a={srcPixelBlock:t.pixelBlock.toJSON(),tileSize:t.tileSize,maximumPyramidLevel:t.maximumPyramidLevel},r=await this._workerThread.invoke("split",a,i);return r&&r.forEach((o,n)=>{r.set(n,o?U.fromJSON(o):null)}),r}async estimateStatisticsHistograms(t,i){if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");if(!(t!=null&&t.pixelBlock))return null;const a={srcPixelBlock:t.pixelBlock.toJSON()};return await this._workerThread.invoke("estimateStatisticsHistograms",a,i)}async mosaicAndTransform(t,i){var o;if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");if(!((o=t==null?void 0:t.srcPixelBlocks)!=null&&o.length))return{pixelBlock:null};const a={...t,srcPixelBlocks:t.srcPixelBlocks.map(n=>g(n)?n.toJSON():null)},r=await this._workerThread.invoke("mosaicAndTransform",a,i);return{pixelBlock:r.pixelBlock?new U(r.pixelBlock):null,localNorthDirections:r.localNorthDirections}}async createFlowMesh(t,i){if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");const a={buffer:t.flowData.data.buffer,maskBuffer:t.flowData.mask.buffer,width:t.flowData.width,height:t.flowData.height},{meshType:r,simulationSettings:o}=t,n=await this._workerThread.invoke("createFlowMesh",{meshType:r,flowData:a,simulationSettings:o},{...i,transferList:[a.buffer,a.maskBuffer]});return{vertexData:new Float32Array(n.vertexBuffer),indexData:new Uint32Array(n.indexBuffer)}}getProjectionOffsetGrid(t,i){if(!this._workerThread)throw new T("raster-jobhandler:no-connection","no available worker connection");const a=g(t.datumTransformation)?t.datumTransformation.steps.map(n=>({wkid:n.wkid,wkt:n.wkt,isInverse:n.isInverse})):null,r=g(t.rasterTransform)?t.rasterTransform.toJSON():null,o={projectedExtent:t.projectedExtent.toJSON(),srcBufferExtent:t.srcBufferExtent.toJSON(),pixelSize:t.pixelSize,hasWrapAround:t.hasWrapAround,spacing:t.spacing,datumTransformationSteps:a,rasterTransform:r,isAdaptive:t.isAdaptive,includeGCSGrid:t.includeGCSGrid};return this._workerThread.invoke("getProjectionOffsetGrid",o,i)}}const Pt=.25,Gt=Qe.fromJSON({type:"multipart",colorRamps:[{fromColor:[0,0,255],toColor:[0,255,255]},{fromColor:[0,255,255],toColor:[255,255,0]},{fromColor:[255,255,0],toColor:[255,0,0]}]}),Re=Qe.fromJSON(Bt[0]),et=new Set(["scientific","standard-time","vector-uv","vector-magdir","vector-u","vector-v","vector-magnitude","vector-direction"]);function Ia(e,t){const{attributeTable:i,colormap:a}=e;if(fe(e)){const r=ta(e);if(g(r))return r}if(g(a)){const r=Qt(e);if(g(r))return r}if(g(i)){const r=_t(e);if(g(r))return r}return Vt(e,t)}function ma(e,t=!1){const i=["raster-stretch"];return it(e)&&i.push("raster-colormap"),at(e)&&i.push("unique-value"),Xt(e,t)&&i.push("class-breaks"),$t(e)&&i.push("raster-shaded-relief"),fe(e)&&i.push("vector-field"),Yt(e)&&i.push("flow"),i}function ya(e,t,i){const a=["nearest","bilinear","cubic","majority"].find(r=>r===(i==null?void 0:i.toLowerCase()));return t==="Map"?a!=null?a:"bilinear":e.dataType==="standard-time"?a!=null?a:"nearest":e.dataType==="thematic"||e.attributeTable||e.colormap?a==="nearest"||a==="majority"?a:"nearest":a!=null?a:"bilinear"}function Vt(e,t){e=Wt(e,t==null?void 0:t.variableName);const{bandCount:i}=e;let{bandIds:a,stretchType:r}=t||{};a!=null&&a.some(p=>p>=i)&&(a=null);let o=O(e.statistics),n=O(e.histograms);i>1?(a=a!=null&&a.length?a:Jt(e),o=o==null?null:a==null?void 0:a.map(p=>o[p]),n=n==null?null:a==null?void 0:a.map(p=>n[p])):a=[0],r==null&&(r=Ft(e));let c=!1;switch(r){case"none":c=!1;break;case"percent-clip":c=!(n!=null&&n.length);break;default:c=!(o!=null&&o.length)}const{dataType:m}=e,M=(a==null?void 0:a.length)===1&&et.has(m)?Gt:null,y=new he({stretchType:r,dynamicRangeAdjustment:c,colorRamp:M,outputMin:0,outputMax:255,gamma:(a==null?void 0:a.length)===1?[1]:[1,1,1],useGamma:!1});return r==="percent-clip"?y.maxPercent=y.minPercent=Pt:r==="standard-deviation"&&(y.numberOfStandardDeviations=2),c||!g(e.multidimensionalInfo)&&!(t!=null&&t.includeStatisticsInStretch)||(r==="percent-clip"?y.histograms=n:r!=="min-max"&&r!=="standard-deviation"||(y.statistics=o)),y}function Wt(e,t){if(t==null)return e;let i=O(e.statistics),a=O(e.histograms);const{multidimensionalInfo:r}=e;if(t&&g(r)){const o=r.variables.find(n=>n.name===t);if(o){const{statistics:n,histograms:c}=o;n!=null&&n.length&&(i=n),c!=null&&c.length&&(a=c)}}return $e.fromJSON({...e.toJSON(),statistics:i,histograms:a})}function Jt(e){const t=e.bandCount;if(t===1)return null;if(t===2)return[0];const i=e.keyProperties&&e.keyProperties.BandProperties;let a;if(i&&i.length===t){const{red:r,green:o,blue:n,nir:c}=Ot(i);r!=null&&o!=null&&n!=null?a=[r,o,n]:c!=null&&r!=null&&o!=null&&(a=[c,r,o])}return!a&&t>=3&&(a=[0,1,2]),a}function Ot(e){var i;const t={};for(let a=0;a=410&&n<=480&&c>=480&&c<=540?t.blue=a:t.green==null&&n>=490&&n<=560&&c>=560&&c<=610?t.green=a:t.red==null&&n>=595&&n<=670&&c>=660&&c<=730?t.red=a:t.nir==null&&n>=700&&n<=860&&c>=800&&c<=950&&(t.nir=a)}}return t}function Ft(e){let t="percent-clip";const{pixelType:i,dataType:a,histograms:r,statistics:o}=e;return i!=="u8"||a!=="processed"&&g(r)&&g(o)?i==="u8"||a==="elevation"||et.has(a)?t="min-max":g(r)?t="percent-clip":g(o)&&(t="min-max"):t="none",t}function _t(e,t,i,a){if(!at(e,t))return null;const{attributeTable:r,statistics:o}=e,n=tt(r,t),c=J(r,"red"),m=J(r,"green"),M=J(r,"blue"),y=new Ge,p=[],v=new Set,C=!!(c&&m&&M);if(g(r))r.features.forEach(u=>{const d=u.attributes[n.name];if(!v.has(u.attributes[n.name])&&d!=null){v.add(d);const j=C&&(c.type==="single"||c.type==="double")&&(m.type==="single"||m.type==="double")&&(M.type==="single"||M.type==="double")&&!r.features.some(N=>N.attributes[c.name]>1||N.attributes[m.name]>1||N.attributes[M.name]>1),L=j?255:1;p.push(new Be({value:u.attributes[n.name],label:u.attributes[n.name]+"",symbol:{type:"simple-fill",style:"solid",outline:null,color:new w(C?[u.attributes[c.name]*L,u.attributes[m.name]*L,u.attributes[M.name]*L,1]:[0,0,0,0])}}))}});else if(o!=null&&o[0])for(let u=o[0].min;u<=o[0].max;u++)p.push(new Be({value:u,label:u.toString(),symbol:{type:"simple-fill",style:"solid",outline:null,color:new w([0,0,0,0])}}));if(p.sort((u,d)=>u.value&&typeof u.value.valueOf()=="string"?0:u.value>d.value?1:-1),!C){const u=le(Re,p.length);p.forEach((d,j)=>d.symbol.color=new w(u[j].slice(1,4))),y.colorRamp=Re}if(i||a){const u=i||le(a,p.length).map(d=>d.slice(1));p.forEach((d,j)=>d.symbol.color=new w(u[j])),y.colorRamp=a}return new ye({field:n.name,uniqueValueInfos:p,authoringInfo:y})}function tt(e,t,i){let a;return g(e)?(a=t?e.fields.find(r=>t.toLowerCase()===r.name.toLowerCase()):Kt(e.fields),a||(i||(a=e.fields.find(r=>r.type==="string")),a||(a=J(e,"value")))):a=new Ct({name:"value"}),a}function Kt(e){let t;for(let i=0;ii.name.toLowerCase()===t)}function at(e,t){const{attributeTable:i,bandCount:a}=e;return ee(i)&&qt(e)?!0:!(ee(i)||a>1||t&&i.fields.find(r=>r.name.toLowerCase()===t.toLowerCase())==null)}function it(e){const{bandCount:t,colormap:i}=e;return g(i)&&i.length>0&&t===1}function Qt(e){if(!it(e))return null;let t;const{attributeTable:i,colormap:a}=e;if(g(i)){const r=J(i,"value"),o=tt(i,null,!0);o.type==="string"&&(t={},i.features.forEach(n=>{const c=n.attributes;t[c[r.name]]=o?c[o.name]:c[r.name]}))}return we.createFromColormap(O(a),t)}function $t(e){const{bandCount:t,dataType:i,pixelType:a}=e;return i==="elevation"||i==="generic"&&t===1&&(a==="s16"||a==="s32"||a==="f32"||a==="f64")}function Xt(e,t=!1){const{attributeTable:i,bandCount:a}=e;return a===1&&(!t||g(i)||g(e.histograms))}function qt(e){var t,i,a;return["u8","s8"].includes(e.pixelType)&&((i=(t=e.statistics)==null?void 0:t[0])==null?void 0:i.min)!=null&&((a=e.statistics[0])==null?void 0:a.max)!=null&&e.bandCount===1}function fe(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}function Yt(e){const{dataType:t}=e;return t==="vector-uv"||t==="vector-magdir"}const ea=new Map([["m/s","meter-per-second"],["km/h","kilometer-per-hour"],["knots","knots"],["ft/s","feet-per-second"],["mph","mile-per-hour"]]);function ta(e){if(!fe(e))return null;let t;if(g(e.statistics)&&e.statistics.length&&(e.dataType==="vector-magdir"||e.dataType==="vector-uv")){const{minMagnitude:r,maxMagnitude:o}=aa(e.dataType,e.statistics);t=[{type:"size",field:"Magnitude",minSize:10,maxSize:40,minDataValue:r,maxDataValue:o}]}const i=g(e.multidimensionalInfo)?ea.get(e.multidimensionalInfo.variables[0].unit):null,a=new Ae({visualVariables:t,inputUnit:i,rotationType:"geographic"});return a.visualVariables=[...a.sizeVariables,...a.rotationVariables],a}function Ee(e){var t;return{color:(t=e.symbolLayers[0].material)==null?void 0:t.color,type:"esriSFS",style:"esriSFSSolid"}}function wa(e){var t,i,a;if(e.type==="uniqueValue"){const r=e.uniqueValueInfos,o=r==null?void 0:r[0].symbol;return(t=o==null?void 0:o.symbolLayers)!=null&&t.length&&(e.uniqueValueInfos=r==null?void 0:r.map(n=>({value:n.value,label:n.label,symbol:n.symbol?Ee(n.symbol):null}))),e}if(e.type==="classBreaks"){const r=e.classBreakInfos;return(a=(i=r[0].symbol)==null?void 0:i.symbolLayers)!=null&&a.length&&(e.classBreakInfos=r.map(o=>({classMinValue:o.classMinValue,classMaxValue:o.classMaxValue,label:o.label,symbol:o.symbol?Ee(o.symbol):null}))),e}return e}function aa(e,t){let i,a;if(e==="vector-magdir")i=t[0].min,a=t[0].max;else{const r=t[0].min,o=t[0].max,n=t[1].min,c=t[1].max;i=0,a=Math.max(Math.abs(r),Math.abs(n),Math.abs(o),Math.abs(c))}return{minMagnitude:i,maxMagnitude:a}}async function rt(e,t,i){var be,Ce,Te,je,Le,Se,ve;const a=Tt(e),{renderingRule:r,sourceJSON:o}=t||{},n=r?JSON.stringify(r.rasterFunctionDefinition||r):null,c=jt({...a.query,renderingRule:n,f:"json"}),m=Lt(c,i);e=a.path;const M=o||await k(e,m).then(D=>D.data),y=M.hasRasterAttributeTable?k(`${e}/rasterAttributeTable`,m):null,p=M.hasColormap?k(`${e}/colormap`,m):null,v=M.hasHistograms?k(`${e}/histograms`,m):null,C=M.currentVersion>=10.3?k(`${e}/keyProperties`,m):null,u=M.hasMultidimensions?k(`${e}/multidimensionalInfo`,m):null,d=await Promise.allSettled([y,p,v,C,u]);let j=null;if(M.minValues&&M.minValues.length===M.bandCount){j=[];for(let D=0;D{var Ne;(Ne=D.statistics)!=null&&Ne.length&&D.statistics.forEach(_=>{_.avg=_.mean,_.stddev=_.standardDeviation})});const{defaultVariable:ae,serviceDataType:F}=M;ae&&ae!==P.DefaultVariable&&(P.DefaultVariable=ae),F&&F.includes("esriImageServiceDataTypeVector")&&!F.includes(P.DataType)&&(P.DataType=F.replace("esriImageServiceDataType",""));let ie=M.noDataValue;return((ve=M.noDataValues)==null?void 0:ve.length)&&M.noDataValues.some(D=>D!==ie)&&(ie=M.noDataValues),new $e({width:N,height:nt,bandCount:M.bandCount,extent:se.fromJSON(M.extent),spatialReference:De,pixelSize:new _e({x:M.pixelSizeX,y:M.pixelSizeY,spatialReference:De}),pixelType:M.pixelType.toLowerCase(),statistics:j,attributeTable:ot,colormap:st,histograms:lt,keyProperties:P,noDataValue:ie,multidimensionalInfo:G})}function ha(e,t,i){return rt(e,{sourceJSON:t},i)}function Aa(e,t,i){return rt(e,{renderingRule:t},i)}export{wa as $,Jt as L,ya as V,He as a,ga as c,Aa as f,ua as i,Ia as j,ma as k,Ue as l,ha as m,pa as n,da as o,ca as u,Ma as w}; diff --git a/assets/fetchService.36bd4782.js b/assets/fetchService.88193309.js similarity index 89% rename from assets/fetchService.36bd4782.js rename to assets/fetchService.88193309.js index 7fb974c..181b9a1 100644 --- a/assets/fetchService.36bd4782.js +++ b/assets/fetchService.88193309.js @@ -1 +1 @@ -import{U as u}from"./index.d94abe07.js";async function f(r,e){var t,y,i;let a=await o(r,e);a=a||{},a.layers=((t=a.layers)==null?void 0:t.filter(l))||[];const s={serviceJSON:a};if(((y=a.currentVersion)!=null?y:0)<10.5)return s;const n=await o(r+"/layers",e);return s.layersJSON={layers:((i=n==null?void 0:n.layers)==null?void 0:i.filter(l))||[],tables:(n==null?void 0:n.tables)||[]},s}function l(r){return!r.type||r.type==="Feature Layer"}async function o(r,e){return(await u(r,{responseType:"json",query:{f:"json",...e==null?void 0:e.customParameters,token:e==null?void 0:e.apiKey}})).data}export{o as a,f as r}; +import{U as u}from"./index.221827cd.js";async function f(r,e){var t,y,i;let a=await o(r,e);a=a||{},a.layers=((t=a.layers)==null?void 0:t.filter(l))||[];const s={serviceJSON:a};if(((y=a.currentVersion)!=null?y:0)<10.5)return s;const n=await o(r+"/layers",e);return s.layersJSON={layers:((i=n==null?void 0:n.layers)==null?void 0:i.filter(l))||[],tables:(n==null?void 0:n.tables)||[]},s}function l(r){return!r.type||r.type==="Feature Layer"}async function o(r,e){return(await u(r,{responseType:"json",query:{f:"json",...e==null?void 0:e.customParameters,token:e==null?void 0:e.apiKey}})).data}export{o as a,f as r}; diff --git a/assets/floatRGBA.df11258c.js b/assets/floatRGBA.3f71f8e9.js similarity index 83% rename from assets/floatRGBA.df11258c.js rename to assets/floatRGBA.3f71f8e9.js index d10e7ff..600e9f3 100644 --- a/assets/floatRGBA.df11258c.js +++ b/assets/floatRGBA.3f71f8e9.js @@ -1 +1 @@ -import{a1 as f}from"./index.d94abe07.js";function p(o,e,t=0){const r=f(o,0,c);for(let n=0;n<4;n++)e[t+n]=Math.floor(256*u(r*l[n]))}function a(o,e=0){let t=0;for(let r=0;r<4;r++)t+=o[e+r]*i[r];return t}const l=[1,256,65536,16777216],i=[1/256,1/65536,1/16777216,1/4294967296],c=a(new Uint8ClampedArray([255,255,255,255]));function u(o){return o-Math.floor(o)}export{p as o,a as r}; +import{a1 as f}from"./index.221827cd.js";function p(o,e,t=0){const r=f(o,0,c);for(let n=0;n<4;n++)e[t+n]=Math.floor(256*u(r*l[n]))}function a(o,e=0){let t=0;for(let r=0;r<4;r++)t+=o[e+r]*i[r];return t}const l=[1,256,65536,16777216],i=[1/256,1/65536,1/16777216,1/4294967296],c=a(new Uint8ClampedArray([255,255,255,255]));function u(o){return o-Math.floor(o)}export{p as o,a as r}; diff --git a/assets/generateRendererUtils.ebdde5b7.js b/assets/generateRendererUtils.5c972fdb.js similarity index 98% rename from assets/generateRendererUtils.ebdde5b7.js rename to assets/generateRendererUtils.5c972fdb.js index ec78fc9..4695c38 100644 --- a/assets/generateRendererUtils.ebdde5b7.js +++ b/assets/generateRendererUtils.5c972fdb.js @@ -1 +1 @@ -import{ct as q,a6 as v,a7 as V,eV as I,eW as D,eX as F,a8 as z,cx as B,s as N}from"./index.d94abe07.js";const S=new q({classBreaksDef:"class-breaks-definition",uniqueValueDef:"unique-value-definition"});let x=class extends B{constructor(){super(...arguments),this.baseSymbol=null,this.colorRamp=null,this.type=null}};v([V({type:I,json:{write:!0}})],x.prototype,"baseSymbol",void 0),v([V({types:D,json:{read:{reader:F},write:!0}})],x.prototype,"colorRamp",void 0),v([V({json:{read:S.read,write:S.write}})],x.prototype,"type",void 0),x=v([z("esri.rest.support.ClassificationDefinition")],x);const T=x,$=new q({esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation",esriClassifyDefinedInterval:"defined-interval"}),C=new q({esriNormalizeByLog:"log",esriNormalizeByPercentOfTotal:"percent-of-total",esriNormalizeByField:"field"});let y=class extends T{constructor(){super(...arguments),this.breakCount=null,this.classificationField=null,this.classificationMethod=null,this.normalizationField=null,this.normalizationType=null,this.type="class-breaks-definition"}set standardDeviationInterval(a){this.classificationMethod==="standard-deviation"&&this._set("standardDeviationInterval",a)}set definedInterval(a){this.classificationMethod==="defined-interval"&&this._set("definedInterval",a)}};v([V({json:{write:!0}})],y.prototype,"breakCount",void 0),v([V({json:{write:!0}})],y.prototype,"classificationField",void 0),v([V({type:String,json:{read:$.read,write:$.write}})],y.prototype,"classificationMethod",void 0),v([V({json:{write:!0}})],y.prototype,"normalizationField",void 0),v([V({json:{read:C.read,write:C.write}})],y.prototype,"normalizationType",void 0),v([V({value:null,json:{write:!0}})],y.prototype,"standardDeviationInterval",null),v([V({value:null,json:{write:!0}})],y.prototype,"definedInterval",null),v([V()],y.prototype,"type",void 0),y=v([z("esri.rest.support.ClassBreaksDefinition")],y);const W=y,E=N.getLogger("esri.rest.support.generateRendererUtils");function M(a,r){return Number(a.toFixed(r))}function X(a){const{normalizationTotal:r}=a;return{classBreaks:L(a),normalizationTotal:r}}function L(a){const r=a.definition,{classificationMethod:n,breakCount:i,normalizationType:u,definedInterval:h}=r,c=[];let l=a.values;if(l.length===0)return[];l=l.sort((s,f)=>s-f);const d=l[0],p=l[l.length-1];if(n==="equal-interval")if(l.length>=i){const s=(p-d)/i;let f=d;for(let t=1;t{c.push({minValue:s,maxValue:s,label:b(s,s,u)})});else if(n==="natural-breaks"){const s=R(l),f=a.valueFrequency||s.valueFrequency,t=_(s.uniqueValues,f,i);let e=d;for(let o=1;oo){const m=M(s.uniqueValues[t[o]],6);c.push({minValue:e,maxValue:m,label:b(e,m,u)}),e=m}c.push({minValue:e,maxValue:p,label:b(e,p,u)})}else if(n==="quantile")if(l.length>=i&&d!==p){let s=d,f=Math.ceil(l.length/i),t=0;for(let e=1;el.length&&(o=l.length-1),o<0&&(o=0),c.push({minValue:s,maxValue:l[o],label:b(s,l[o],u)}),s=l[o],t+=f,f=Math.ceil((l.length-t)/(i-e))}c.push({minValue:s,maxValue:p,label:b(s,p,u)})}else{let s=-1;for(let f=0;f=1;g--){const k=M(s-(g-.5)*t,6);c.push({minValue:o,maxValue:k,label:b(o,k,u)}),o=k,e++}let m=M(s+.5*t,6);c.push({minValue:o,maxValue:m,label:b(o,m,u)}),o=m,e++;for(let g=1;g<=i;g++)m=e===2*i?p:M(s+(g+.5)*t,6),c.push({minValue:o,maxValue:m,label:b(o,m,u)}),o=m,e++}}else if(n==="defined-interval"){if(!h)return c;const s=l[0],f=l[l.length-1],t=Math.ceil((f-s)/h);let e=s;for(let o=1;oi&&(n=i);for(let c=0;c0&&o!==a[e+1]&&Math.abs(s-d[e])>Math.abs(s-d[e-1]))a[e]=o;else if(eMath.abs(s-d[e+1])){a[e+1]=o-1;break}f=l,l=0,h=[],c=[];for(let e=0;ef){for(let e=0;e0;t--)for(;n[t]!==n[t-1]+1;){n[t]=n[t]-1;const e=w(t-1,n,i,u);d=e.sbMean,c=e.sbSdcm;const o=w(t,n,i,u);if(p=o.sbMean,l=o.sbSdcm,!(c+l=1?1:h>=.5?.5:.25,h}function O(a){let r=0;for(let n=0;ns-f);const d=l[0],p=l[l.length-1];if(n==="equal-interval")if(l.length>=i){const s=(p-d)/i;let f=d;for(let t=1;t{c.push({minValue:s,maxValue:s,label:b(s,s,u)})});else if(n==="natural-breaks"){const s=R(l),f=a.valueFrequency||s.valueFrequency,t=_(s.uniqueValues,f,i);let e=d;for(let o=1;oo){const m=M(s.uniqueValues[t[o]],6);c.push({minValue:e,maxValue:m,label:b(e,m,u)}),e=m}c.push({minValue:e,maxValue:p,label:b(e,p,u)})}else if(n==="quantile")if(l.length>=i&&d!==p){let s=d,f=Math.ceil(l.length/i),t=0;for(let e=1;el.length&&(o=l.length-1),o<0&&(o=0),c.push({minValue:s,maxValue:l[o],label:b(s,l[o],u)}),s=l[o],t+=f,f=Math.ceil((l.length-t)/(i-e))}c.push({minValue:s,maxValue:p,label:b(s,p,u)})}else{let s=-1;for(let f=0;f=1;g--){const k=M(s-(g-.5)*t,6);c.push({minValue:o,maxValue:k,label:b(o,k,u)}),o=k,e++}let m=M(s+.5*t,6);c.push({minValue:o,maxValue:m,label:b(o,m,u)}),o=m,e++;for(let g=1;g<=i;g++)m=e===2*i?p:M(s+(g+.5)*t,6),c.push({minValue:o,maxValue:m,label:b(o,m,u)}),o=m,e++}}else if(n==="defined-interval"){if(!h)return c;const s=l[0],f=l[l.length-1],t=Math.ceil((f-s)/h);let e=s;for(let o=1;oi&&(n=i);for(let c=0;c0&&o!==a[e+1]&&Math.abs(s-d[e])>Math.abs(s-d[e-1]))a[e]=o;else if(eMath.abs(s-d[e+1])){a[e+1]=o-1;break}f=l,l=0,h=[],c=[];for(let e=0;ef){for(let e=0;e0;t--)for(;n[t]!==n[t-1]+1;){n[t]=n[t]-1;const e=w(t-1,n,i,u);d=e.sbMean,c=e.sbSdcm;const o=w(t,n,i,u);if(p=o.sbMean,l=o.sbSdcm,!(c+l=1?1:h>=.5?.5:.25,h}function O(a){let r=0;for(let n=0;n2)return!0;return!1}function D(n){return!k(n)}function E(n){return k(n)}function k(n){let t=0;for(let e=0;e=0;o--)S(n,t[o],e);n.lengths.push(t.length)}function S(n,t,e){const[o,r,a]=t;n.coords.push(o,r),e.hasZ&&n.coords.push(a||0)}function Q(n){switch(typeof n){case"string":return"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function V(n){if(!n)throw new P("geojson-layer:empty","GeoJSON data is empty");if(n.type!=="Feature"&&n.type!=="FeatureCollection")throw new P("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:n});const{crs:t}=n;if(!t)return;const e=typeof t=="string"?t:t.type==="name"?t.properties.name:t.type==="EPSG"?t.properties.code:null,o=new RegExp(".*(CRS84H?|4326)$","i");if(!e||!o.test(e))throw new P("geojson-layer:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:t})}function W(n,t={}){const e=[],o=new Set,r=new Set;let a,c=!1,i=null,l=!1,{geometryType:s=null}=t,d=!1;for(const g of M(n)){const{geometry:w,properties:f,id:y}=g;if((!w||(s||(s=b(w.type)),b(w.type)===s))&&(c||(c=x(C(w))),l||(l=y!=null,l&&(a=typeof y,i=Object.keys(f).filter(p=>f[p]===y))),l&&y!=null&&(i.length>1?i=i.filter(p=>f[p]===y):i.length===1&&(i=f[i[0]]===y?i:[])),!d&&f)){let p=!0;for(const u in f){if(o.has(u))continue;const F=f[u];if(F==null){p=!1,r.add(u);continue}const j=Q(F);j!=="unknown"?(r.delete(u),o.add(u),e.push({name:G(u),alias:u,type:j})):r.add(u)}d=p}}const m=G((i==null?void 0:i.length)===1&&i[0]||null);if(m){for(const g of e)if(g.name===m&&J(g)){g.type="esriFieldTypeOID";break}}return{fields:e,geometryType:s,hasZ:c,objectIdFieldName:m,objectIdFieldType:a,unknownFields:Array.from(r)}}function X(n,t){return Array.from(Z(M(n),t))}export{X as I,W as L,V as T,b as s}; +import{n as P,gz as G,gA as J,eZ as N,aJ as $}from"./index.221827cd.js";const A={LineString:"esriGeometryPolyline",MultiLineString:"esriGeometryPolyline",MultiPoint:"esriGeometryMultipoint",Point:"esriGeometryPoint",Polygon:"esriGeometryPolygon",MultiPolygon:"esriGeometryPolygon"};function b(n){return A[n]}function*M(n){switch(n.type){case"Feature":yield n;break;case"FeatureCollection":for(const t of n.features)t&&(yield t)}}function*C(n){if(!n)return null;switch(n.type){case"Point":yield n.coordinates;break;case"LineString":case"MultiPoint":yield*n.coordinates;break;case"MultiLineString":case"Polygon":for(const t of n.coordinates)yield*t;break;case"MultiPolygon":for(const t of n.coordinates)for(const e of t)yield*e}}function*Z(n,t={}){var r;const{geometryType:e,objectIdField:o}=t;for(const a of n){const{geometry:c,properties:i,id:l}=a;if(c&&b(c.type)!==e)continue;const s=i||{};let d=(r=s[o])!=null?r:null;o&&l!=null&&!s[o]&&(s[o]=d=l),yield new N(c?R(new $,c,t):null,s,null,d)}}function x(n){for(const t of n)if(t.length>2)return!0;return!1}function D(n){return!k(n)}function E(n){return k(n)}function k(n){let t=0;for(let e=0;e=0;o--)S(n,t[o],e);n.lengths.push(t.length)}function S(n,t,e){const[o,r,a]=t;n.coords.push(o,r),e.hasZ&&n.coords.push(a||0)}function Q(n){switch(typeof n){case"string":return"esriFieldTypeString";case"number":return"esriFieldTypeDouble";default:return"unknown"}}function V(n){if(!n)throw new P("geojson-layer:empty","GeoJSON data is empty");if(n.type!=="Feature"&&n.type!=="FeatureCollection")throw new P("geojson-layer:unsupported-geojson-object","missing or not supported GeoJSON object type",{data:n});const{crs:t}=n;if(!t)return;const e=typeof t=="string"?t:t.type==="name"?t.properties.name:t.type==="EPSG"?t.properties.code:null,o=new RegExp(".*(CRS84H?|4326)$","i");if(!e||!o.test(e))throw new P("geojson-layer:unsupported-crs","unsupported GeoJSON 'crs' member",{crs:t})}function W(n,t={}){const e=[],o=new Set,r=new Set;let a,c=!1,i=null,l=!1,{geometryType:s=null}=t,d=!1;for(const g of M(n)){const{geometry:w,properties:f,id:y}=g;if((!w||(s||(s=b(w.type)),b(w.type)===s))&&(c||(c=x(C(w))),l||(l=y!=null,l&&(a=typeof y,i=Object.keys(f).filter(p=>f[p]===y))),l&&y!=null&&(i.length>1?i=i.filter(p=>f[p]===y):i.length===1&&(i=f[i[0]]===y?i:[])),!d&&f)){let p=!0;for(const u in f){if(o.has(u))continue;const F=f[u];if(F==null){p=!1,r.add(u);continue}const j=Q(F);j!=="unknown"?(r.delete(u),o.add(u),e.push({name:G(u),alias:u,type:j})):r.add(u)}d=p}}const m=G((i==null?void 0:i.length)===1&&i[0]||null);if(m){for(const g of e)if(g.name===m&&J(g)){g.type="esriFieldTypeOID";break}}return{fields:e,geometryType:s,hasZ:c,objectIdFieldName:m,objectIdFieldType:a,unknownFields:Array.from(r)}}function X(n,t){return Array.from(Z(M(n),t))}export{X as I,W as L,V as T,b as s}; diff --git a/assets/geomasync.a1913b84.js b/assets/geomasync.ca31aba0.js similarity index 98% rename from assets/geomasync.a1913b84.js rename to assets/geomasync.ca31aba0.js index 07bbe5e..3d4fb75 100644 --- a/assets/geomasync.a1913b84.js +++ b/assets/geomasync.ca31aba0.js @@ -1 +1 @@ -import{cY as s,cU as N,cS as F,af as S,az as R,cR as L,c9 as W,dO as G,cq as Q}from"./index.d94abe07.js";import{q as o,V as h,z as q,K as J,t as a,e as u,Y as P,E as I,g as z,v as g,P as O,x as b,y as w,G as K,H as m,S as Z,I as k,r as A,L as X,O as _,R as $,T as nn,U as C}from"./arcadeUtils.9e078218.js";import{A as tn,h as en,S as rn,m as an,x as un,p as cn,O as ln,g as fn,R as on,D as sn,b as dn,E as wn,k as hn,y as mn,w as pn,W as T,K as U,F as M,M as E,d as yn,C as j,U as H,B as gn,L as vn,P as Pn,v as In,H as V,N as Y,J as An,j as Fn}from"./geometryEngineAsync.3b47a469.js";import"./number.8c2c26f3.js";function B(r){return G.indexOf("4.")===0?R.fromExtent(r):new R({spatialReference:r.spatialReference,rings:[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]})}function v(r,t,e){if(h(r,2,2,t,e),!(r[0]instanceof s&&r[1]instanceof s)){if(!(r[0]instanceof s&&r[1]===null)){if(!(r[1]instanceof s&&r[0]===null)){if(r[0]!==null||r[1]!==null)throw new a(t,u.InvalidParameter,e)}}}}async function D(r,t){if(r.type!=="polygon"&&r.type!=="polyline"&&r.type!=="extent")return 0;let e=1;(r.spatialReference.vcsWkid||r.spatialReference.latestVcsWkid)&&(e=nn(r.spatialReference)/Q(r.spatialReference));let l=0;if(r.type==="polyline")for(const n of r.paths)for(let i=1;i(v(n=o(n),t,e),n[0]===null||n[1]===null||tn(n[0],n[1])))},r.functions.intersects=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>(v(n=o(n),t,e),n[0]!==null&&n[1]!==null&&en(n[0],n[1])))},r.functions.touches=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>(v(n=o(n),t,e),n[0]!==null&&n[1]!==null&&rn(n[0],n[1])))},r.functions.crosses=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>(v(n=o(n),t,e),n[0]!==null&&n[1]!==null&&an(n[0],n[1])))},r.functions.within=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>(v(n=o(n),t,e),n[0]!==null&&n[1]!==null&&un(n[0],n[1])))},r.functions.contains=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>(v(n=o(n),t,e),n[0]!==null&&n[1]!==null&&cn(n[0],n[1])))},r.functions.overlaps=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>(v(n=o(n),t,e),n[0]!==null&&n[1]!==null&&ln(n[0],n[1])))},r.functions.equals=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>(h(n,2,2,t,e),n[0]===n[1]||(n[0]instanceof s&&n[1]instanceof s?fn(n[0],n[1]):!(!q(n[0])||!q(n[1]))&&n[0].getTime()===n[1].getTime())))},r.functions.relate=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,3,3,t,e),n[0]instanceof s&&n[1]instanceof s)return on(n[0],n[1],J(n[2]));if(n[0]instanceof s&&n[1]===null||n[1]instanceof s&&n[0]===null||n[0]===null&&n[1]===null)return!1;throw new a(t,u.InvalidParameter,e)})},r.functions.intersection=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>(v(n=o(n),t,e),n[0]===null||n[1]===null?null:sn(n[0],n[1])))},r.functions.union=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{const i=[];if((n=o(n)).length===0)throw new a(t,u.WrongNumberOfParameters,e);if(n.length===1)if(P(n[0])){const c=o(n[0]);for(let d=0;d(v(n=o(n),t,e),n[0]!==null&&n[1]===null?g(n[0]):n[0]===null?null:wn(n[0],n[1])))},r.functions.symmetricdifference=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>(v(n=o(n),t,e),n[0]===null&&n[1]===null?null:n[0]===null?g(n[1]):n[1]===null?g(n[0]):hn(n[0],n[1])))},r.functions.clip=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,2,2,t,e),!(n[1]instanceof N)&&n[1]!==null)throw new a(t,u.InvalidParameter,e);if(n[0]===null)return null;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return n[1]===null?null:mn(n[0],n[1])})},r.functions.cut=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,2,2,t,e),!(n[1]instanceof F)&&n[1]!==null)throw new a(t,u.InvalidParameter,e);if(n[0]===null)return[];if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return n[1]===null?[g(n[0])]:pn(n[0],n[1])})},r.functions.area=function(t,e){return r.standardFunctionAsync(t,e,async(l,f,n)=>{if(h(n,1,2,t,e),(n=o(n))[0]===null)return 0;if(O(n[0])){const i=await n[0].sumArea(b(w(n[1],-1)),!1,t.abortSignal);if(t.abortSignal.aborted)throw new a(t,u.Cancelled,e);return i}if(P(n[0])||I(n[0])){const i=K(n[0],t.spatialReference);return i===null?0:T(i,b(w(n[1],-1)))}if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return T(n[0],b(w(n[1],-1)))})},r.functions.areageodetic=function(t,e){return r.standardFunctionAsync(t,e,async(l,f,n)=>{if(h(n,1,2,t,e),(n=o(n))[0]===null)return 0;if(O(n[0])){const i=await n[0].sumArea(b(w(n[1],-1)),!0,t.abortSignal);if(t.abortSignal.aborted)throw new a(t,u.Cancelled,e);return i}if(P(n[0])||I(n[0])){const i=K(n[0],t.spatialReference);return i===null?0:U(i,b(w(n[1],-1)))}if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return U(n[0],b(w(n[1],-1)))})},r.functions.length=function(t,e){return r.standardFunctionAsync(t,e,async(l,f,n)=>{if(h(n,1,2,t,e),(n=o(n))[0]===null)return 0;if(O(n[0])){const i=await n[0].sumLength(m(w(n[1],-1)),!1,t.abortSignal);if(t.abortSignal.aborted)throw new a(t,u.Cancelled,e);return i}if(P(n[0])||I(n[0])){const i=Z(n[0],t.spatialReference);return i===null?0:M(i,m(w(n[1],-1)))}if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return M(n[0],m(w(n[1],-1)))})},r.functions.length3d=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(h(n,1,2,t,e),(n=o(n))[0]===null)return 0;if(P(n[0])||I(n[0])){const i=Z(n[0],t.spatialReference);return i===null?0:i.hasZ===!0?D(i,m(w(n[1],-1))):M(i,m(w(n[1],-1)))}if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return n[0].hasZ===!0?D(n[0],m(w(n[1],-1))):M(n[0],m(w(n[1],-1)))})},r.functions.lengthgeodetic=function(t,e){return r.standardFunctionAsync(t,e,async(l,f,n)=>{if(h(n,1,2,t,e),(n=o(n))[0]===null)return 0;if(O(n[0])){const i=await n[0].sumLength(m(w(n[1],-1)),!0,t.abortSignal);if(t.abortSignal.aborted)throw new a(t,u.Cancelled,e);return i}if(P(n[0])||I(n[0])){const i=Z(n[0],t.spatialReference);return i===null?0:E(i,m(w(n[1],-1)))}if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return E(n[0],m(w(n[1],-1)))})},r.functions.distance=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{n=o(n),h(n,2,3,t,e);let i=n[0];(P(n[0])||I(n[0]))&&(i=k(n[0],t.spatialReference));let c=n[1];if((P(n[1])||I(n[1]))&&(c=k(n[1],t.spatialReference)),!(i instanceof s))throw new a(t,u.InvalidParameter,e);if(!(c instanceof s))throw new a(t,u.InvalidParameter,e);return yn(i,c,m(w(n[2],-1)))})},r.functions.distancegeodetic=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{n=o(n),h(n,2,3,t,e);const i=n[0],c=n[1];if(!(i instanceof S))throw new a(t,u.InvalidParameter,e);if(!(c instanceof S))throw new a(t,u.InvalidParameter,e);const d=new F({paths:[],spatialReference:i.spatialReference});return d.addPath([i,c]),E(d,m(w(n[2],-1)))})},r.functions.densify=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,2,3,t,e),n[0]===null)return null;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);const i=A(n[1]);if(isNaN(i))throw new a(t,u.InvalidParameter,e);if(i<=0)throw new a(t,u.InvalidParameter,e);return n[0]instanceof R||n[0]instanceof F?j(n[0],i,m(w(n[2],-1))):n[0]instanceof N?j(B(n[0]),i,m(w(n[2],-1))):n[0]})},r.functions.densifygeodetic=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,2,3,t,e),n[0]===null)return null;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);const i=A(n[1]);if(isNaN(i))throw new a(t,u.InvalidParameter,e);if(i<=0)throw new a(t,u.InvalidParameter,e);return n[0]instanceof R||n[0]instanceof F?H(n[0],i,m(w(n[2],-1))):n[0]instanceof N?H(B(n[0]),i,m(w(n[2],-1))):n[0]})},r.functions.generalize=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,2,4,t,e),n[0]===null)return null;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);const i=A(n[1]);if(isNaN(i))throw new a(t,u.InvalidParameter,e);return gn(n[0],i,X(w(n[2],!0)),m(w(n[3],-1)))})},r.functions.buffer=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,2,3,t,e),n[0]===null)return null;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);const i=A(n[1]);if(isNaN(i))throw new a(t,u.InvalidParameter,e);return i===0?g(n[0]):vn(n[0],i,m(w(n[2],-1)))})},r.functions.buffergeodetic=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,2,3,t,e),n[0]===null)return null;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);const i=A(n[1]);if(isNaN(i))throw new a(t,u.InvalidParameter,e);return i===0?g(n[0]):Pn(n[0],i,m(w(n[2],-1)))})},r.functions.offset=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,2,6,t,e),n[0]===null)return null;if(!(n[0]instanceof R||n[0]instanceof F))throw new a(t,u.InvalidParameter,e);const i=A(n[1]);if(isNaN(i))throw new a(t,u.InvalidParameter,e);const c=A(w(n[4],10));if(isNaN(c))throw new a(t,u.InvalidParameter,e);const d=A(w(n[5],0));if(isNaN(d))throw new a(t,u.InvalidParameter,e);return In(n[0],i,m(w(n[2],-1)),J(w(n[3],"round")).toLowerCase(),c,d)})},r.functions.rotate=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{n=o(n),h(n,2,3,t,e);let i=n[0];if(i===null)return null;if(!(i instanceof s))throw new a(t,u.InvalidParameter,e);i instanceof N&&(i=R.fromExtent(i));const c=A(n[1]);if(isNaN(c))throw new a(t,u.InvalidParameter,e);const d=w(n[2],null);if(d===null)return V(i,c);if(d instanceof S)return V(i,c,d);throw new a(t,u.InvalidParameter,e)})},r.functions.centroid=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,1,1,t,e),n[0]===null)return null;let i=n[0];if((P(n[0])||I(n[0]))&&(i=k(n[0],t.spatialReference)),i===null)return null;if(!(i instanceof s))throw new a(t,u.InvalidParameter,e);return i instanceof S?z(g(n[0]),t.spatialReference):i instanceof R?i.centroid:i instanceof F?_(i):i instanceof L?$(i):i instanceof N?i.center:null})},r.functions.multiparttosinglepart=function(t,e){return r.standardFunctionAsync(t,e,async(l,f,n)=>{n=o(n),h(n,1,1,t,e);const i=[];if(n[0]===null)return null;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);if(n[0]instanceof S)return[z(g(n[0]),t.spatialReference)];if(n[0]instanceof N)return[z(g(n[0]),t.spatialReference)];const c=await Y(n[0]);if(c instanceof R){const d=[],y=[];for(let p=0;p{if(n=o(n),h(n,1,1,t,e),n[0]===null)return!0;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return An(n[0])})},r.functions.simplify=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,1,1,t,e),n[0]===null)return null;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return Y(n[0])})},r.functions.convexhull=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,1,1,t,e),n[0]===null)return null;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return Fn(n[0])})})}export{Sn as registerFunctions}; +import{cY as s,cU as N,cS as F,af as S,az as R,cR as L,c9 as W,dO as G,cq as Q}from"./index.221827cd.js";import{q as o,V as h,z as q,K as J,t as a,e as u,Y as P,E as I,g as z,v as g,P as O,x as b,y as w,G as K,H as m,S as Z,I as k,r as A,L as X,O as _,R as $,T as nn,U as C}from"./arcadeUtils.09abf965.js";import{A as tn,h as en,S as rn,m as an,x as un,p as cn,O as ln,g as fn,R as on,D as sn,b as dn,E as wn,k as hn,y as mn,w as pn,W as T,K as U,F as M,M as E,d as yn,C as j,U as H,B as gn,L as vn,P as Pn,v as In,H as V,N as Y,J as An,j as Fn}from"./geometryEngineAsync.68619ff9.js";import"./number.9e690eda.js";function B(r){return G.indexOf("4.")===0?R.fromExtent(r):new R({spatialReference:r.spatialReference,rings:[[[r.xmin,r.ymin],[r.xmin,r.ymax],[r.xmax,r.ymax],[r.xmax,r.ymin],[r.xmin,r.ymin]]]})}function v(r,t,e){if(h(r,2,2,t,e),!(r[0]instanceof s&&r[1]instanceof s)){if(!(r[0]instanceof s&&r[1]===null)){if(!(r[1]instanceof s&&r[0]===null)){if(r[0]!==null||r[1]!==null)throw new a(t,u.InvalidParameter,e)}}}}async function D(r,t){if(r.type!=="polygon"&&r.type!=="polyline"&&r.type!=="extent")return 0;let e=1;(r.spatialReference.vcsWkid||r.spatialReference.latestVcsWkid)&&(e=nn(r.spatialReference)/Q(r.spatialReference));let l=0;if(r.type==="polyline")for(const n of r.paths)for(let i=1;i(v(n=o(n),t,e),n[0]===null||n[1]===null||tn(n[0],n[1])))},r.functions.intersects=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>(v(n=o(n),t,e),n[0]!==null&&n[1]!==null&&en(n[0],n[1])))},r.functions.touches=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>(v(n=o(n),t,e),n[0]!==null&&n[1]!==null&&rn(n[0],n[1])))},r.functions.crosses=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>(v(n=o(n),t,e),n[0]!==null&&n[1]!==null&&an(n[0],n[1])))},r.functions.within=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>(v(n=o(n),t,e),n[0]!==null&&n[1]!==null&&un(n[0],n[1])))},r.functions.contains=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>(v(n=o(n),t,e),n[0]!==null&&n[1]!==null&&cn(n[0],n[1])))},r.functions.overlaps=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>(v(n=o(n),t,e),n[0]!==null&&n[1]!==null&&ln(n[0],n[1])))},r.functions.equals=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>(h(n,2,2,t,e),n[0]===n[1]||(n[0]instanceof s&&n[1]instanceof s?fn(n[0],n[1]):!(!q(n[0])||!q(n[1]))&&n[0].getTime()===n[1].getTime())))},r.functions.relate=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,3,3,t,e),n[0]instanceof s&&n[1]instanceof s)return on(n[0],n[1],J(n[2]));if(n[0]instanceof s&&n[1]===null||n[1]instanceof s&&n[0]===null||n[0]===null&&n[1]===null)return!1;throw new a(t,u.InvalidParameter,e)})},r.functions.intersection=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>(v(n=o(n),t,e),n[0]===null||n[1]===null?null:sn(n[0],n[1])))},r.functions.union=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{const i=[];if((n=o(n)).length===0)throw new a(t,u.WrongNumberOfParameters,e);if(n.length===1)if(P(n[0])){const c=o(n[0]);for(let d=0;d(v(n=o(n),t,e),n[0]!==null&&n[1]===null?g(n[0]):n[0]===null?null:wn(n[0],n[1])))},r.functions.symmetricdifference=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>(v(n=o(n),t,e),n[0]===null&&n[1]===null?null:n[0]===null?g(n[1]):n[1]===null?g(n[0]):hn(n[0],n[1])))},r.functions.clip=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,2,2,t,e),!(n[1]instanceof N)&&n[1]!==null)throw new a(t,u.InvalidParameter,e);if(n[0]===null)return null;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return n[1]===null?null:mn(n[0],n[1])})},r.functions.cut=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,2,2,t,e),!(n[1]instanceof F)&&n[1]!==null)throw new a(t,u.InvalidParameter,e);if(n[0]===null)return[];if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return n[1]===null?[g(n[0])]:pn(n[0],n[1])})},r.functions.area=function(t,e){return r.standardFunctionAsync(t,e,async(l,f,n)=>{if(h(n,1,2,t,e),(n=o(n))[0]===null)return 0;if(O(n[0])){const i=await n[0].sumArea(b(w(n[1],-1)),!1,t.abortSignal);if(t.abortSignal.aborted)throw new a(t,u.Cancelled,e);return i}if(P(n[0])||I(n[0])){const i=K(n[0],t.spatialReference);return i===null?0:T(i,b(w(n[1],-1)))}if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return T(n[0],b(w(n[1],-1)))})},r.functions.areageodetic=function(t,e){return r.standardFunctionAsync(t,e,async(l,f,n)=>{if(h(n,1,2,t,e),(n=o(n))[0]===null)return 0;if(O(n[0])){const i=await n[0].sumArea(b(w(n[1],-1)),!0,t.abortSignal);if(t.abortSignal.aborted)throw new a(t,u.Cancelled,e);return i}if(P(n[0])||I(n[0])){const i=K(n[0],t.spatialReference);return i===null?0:U(i,b(w(n[1],-1)))}if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return U(n[0],b(w(n[1],-1)))})},r.functions.length=function(t,e){return r.standardFunctionAsync(t,e,async(l,f,n)=>{if(h(n,1,2,t,e),(n=o(n))[0]===null)return 0;if(O(n[0])){const i=await n[0].sumLength(m(w(n[1],-1)),!1,t.abortSignal);if(t.abortSignal.aborted)throw new a(t,u.Cancelled,e);return i}if(P(n[0])||I(n[0])){const i=Z(n[0],t.spatialReference);return i===null?0:M(i,m(w(n[1],-1)))}if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return M(n[0],m(w(n[1],-1)))})},r.functions.length3d=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(h(n,1,2,t,e),(n=o(n))[0]===null)return 0;if(P(n[0])||I(n[0])){const i=Z(n[0],t.spatialReference);return i===null?0:i.hasZ===!0?D(i,m(w(n[1],-1))):M(i,m(w(n[1],-1)))}if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return n[0].hasZ===!0?D(n[0],m(w(n[1],-1))):M(n[0],m(w(n[1],-1)))})},r.functions.lengthgeodetic=function(t,e){return r.standardFunctionAsync(t,e,async(l,f,n)=>{if(h(n,1,2,t,e),(n=o(n))[0]===null)return 0;if(O(n[0])){const i=await n[0].sumLength(m(w(n[1],-1)),!0,t.abortSignal);if(t.abortSignal.aborted)throw new a(t,u.Cancelled,e);return i}if(P(n[0])||I(n[0])){const i=Z(n[0],t.spatialReference);return i===null?0:E(i,m(w(n[1],-1)))}if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return E(n[0],m(w(n[1],-1)))})},r.functions.distance=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{n=o(n),h(n,2,3,t,e);let i=n[0];(P(n[0])||I(n[0]))&&(i=k(n[0],t.spatialReference));let c=n[1];if((P(n[1])||I(n[1]))&&(c=k(n[1],t.spatialReference)),!(i instanceof s))throw new a(t,u.InvalidParameter,e);if(!(c instanceof s))throw new a(t,u.InvalidParameter,e);return yn(i,c,m(w(n[2],-1)))})},r.functions.distancegeodetic=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{n=o(n),h(n,2,3,t,e);const i=n[0],c=n[1];if(!(i instanceof S))throw new a(t,u.InvalidParameter,e);if(!(c instanceof S))throw new a(t,u.InvalidParameter,e);const d=new F({paths:[],spatialReference:i.spatialReference});return d.addPath([i,c]),E(d,m(w(n[2],-1)))})},r.functions.densify=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,2,3,t,e),n[0]===null)return null;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);const i=A(n[1]);if(isNaN(i))throw new a(t,u.InvalidParameter,e);if(i<=0)throw new a(t,u.InvalidParameter,e);return n[0]instanceof R||n[0]instanceof F?j(n[0],i,m(w(n[2],-1))):n[0]instanceof N?j(B(n[0]),i,m(w(n[2],-1))):n[0]})},r.functions.densifygeodetic=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,2,3,t,e),n[0]===null)return null;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);const i=A(n[1]);if(isNaN(i))throw new a(t,u.InvalidParameter,e);if(i<=0)throw new a(t,u.InvalidParameter,e);return n[0]instanceof R||n[0]instanceof F?H(n[0],i,m(w(n[2],-1))):n[0]instanceof N?H(B(n[0]),i,m(w(n[2],-1))):n[0]})},r.functions.generalize=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,2,4,t,e),n[0]===null)return null;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);const i=A(n[1]);if(isNaN(i))throw new a(t,u.InvalidParameter,e);return gn(n[0],i,X(w(n[2],!0)),m(w(n[3],-1)))})},r.functions.buffer=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,2,3,t,e),n[0]===null)return null;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);const i=A(n[1]);if(isNaN(i))throw new a(t,u.InvalidParameter,e);return i===0?g(n[0]):vn(n[0],i,m(w(n[2],-1)))})},r.functions.buffergeodetic=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,2,3,t,e),n[0]===null)return null;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);const i=A(n[1]);if(isNaN(i))throw new a(t,u.InvalidParameter,e);return i===0?g(n[0]):Pn(n[0],i,m(w(n[2],-1)))})},r.functions.offset=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,2,6,t,e),n[0]===null)return null;if(!(n[0]instanceof R||n[0]instanceof F))throw new a(t,u.InvalidParameter,e);const i=A(n[1]);if(isNaN(i))throw new a(t,u.InvalidParameter,e);const c=A(w(n[4],10));if(isNaN(c))throw new a(t,u.InvalidParameter,e);const d=A(w(n[5],0));if(isNaN(d))throw new a(t,u.InvalidParameter,e);return In(n[0],i,m(w(n[2],-1)),J(w(n[3],"round")).toLowerCase(),c,d)})},r.functions.rotate=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{n=o(n),h(n,2,3,t,e);let i=n[0];if(i===null)return null;if(!(i instanceof s))throw new a(t,u.InvalidParameter,e);i instanceof N&&(i=R.fromExtent(i));const c=A(n[1]);if(isNaN(c))throw new a(t,u.InvalidParameter,e);const d=w(n[2],null);if(d===null)return V(i,c);if(d instanceof S)return V(i,c,d);throw new a(t,u.InvalidParameter,e)})},r.functions.centroid=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,1,1,t,e),n[0]===null)return null;let i=n[0];if((P(n[0])||I(n[0]))&&(i=k(n[0],t.spatialReference)),i===null)return null;if(!(i instanceof s))throw new a(t,u.InvalidParameter,e);return i instanceof S?z(g(n[0]),t.spatialReference):i instanceof R?i.centroid:i instanceof F?_(i):i instanceof L?$(i):i instanceof N?i.center:null})},r.functions.multiparttosinglepart=function(t,e){return r.standardFunctionAsync(t,e,async(l,f,n)=>{n=o(n),h(n,1,1,t,e);const i=[];if(n[0]===null)return null;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);if(n[0]instanceof S)return[z(g(n[0]),t.spatialReference)];if(n[0]instanceof N)return[z(g(n[0]),t.spatialReference)];const c=await Y(n[0]);if(c instanceof R){const d=[],y=[];for(let p=0;p{if(n=o(n),h(n,1,1,t,e),n[0]===null)return!0;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return An(n[0])})},r.functions.simplify=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,1,1,t,e),n[0]===null)return null;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return Y(n[0])})},r.functions.convexhull=function(t,e){return r.standardFunctionAsync(t,e,(l,f,n)=>{if(n=o(n),h(n,1,1,t,e),n[0]===null)return null;if(!(n[0]instanceof s))throw new a(t,u.InvalidParameter,e);return Fn(n[0])})})}export{Sn as registerFunctions}; diff --git a/assets/geometryEngine.cfc395ce.js b/assets/geometryEngine.a80c0474.js similarity index 96% rename from assets/geometryEngine.cfc395ce.js rename to assets/geometryEngine.a80c0474.js index 653d31b..cd123c9 100644 --- a/assets/geometryEngine.cfc395ce.js +++ b/assets/geometryEngine.a80c0474.js @@ -1 +1 @@ -import{G as t}from"./geometryEngineBase.82b25ca5.js";import{hydratedAdapter as i}from"./hydrated.905f3857.js";import"./index.d94abe07.js";function a(e){return Array.isArray(e)?e[0].spatialReference:e&&e.spatialReference}function g(e){return t.extendedSpatialReferenceInfo(e)}function m(e,n){return t.clip(i,a(e),e,n)}function h(e,n){return t.cut(i,a(e),e,n)}function w(e,n){return t.contains(i,a(e),e,n)}function R(e,n){return t.crosses(i,a(e),e,n)}function x(e,n,r){return t.distance(i,a(e),e,n,r)}function y(e,n){return t.equals(i,a(e),e,n)}function S(e,n){return t.intersects(i,a(e),e,n)}function A(e,n){return t.touches(i,a(e),e,n)}function D(e,n){return t.within(i,a(e),e,n)}function L(e,n){return t.disjoint(i,a(e),e,n)}function T(e,n){return t.overlaps(i,a(e),e,n)}function V(e,n,r){return t.relate(i,a(e),e,n,r)}function v(e){return t.isSimple(i,a(e),e)}function z(e){return t.simplify(i,a(e),e)}function H(e,n=!1){return t.convexHull(i,a(e),e,n)}function I(e,n){return t.difference(i,a(e),e,n)}function J(e,n){return t.symmetricDifference(i,a(e),e,n)}function N(e,n){return t.intersect(i,a(e),e,n)}function O(e,n=null){return t.union(i,a(e),e,n)}function b(e,n,r,s,c,o){return t.offset(i,a(e),e,n,r,s,c,o)}function j(e,n,r,s=!1){return t.buffer(i,a(e),e,n,r,s)}function q(e,n,r,s,c,o){return t.geodesicBuffer(i,a(e),e,n,r,s,c,o)}function B(e,n,r=!0){return t.nearestCoordinate(i,a(e),e,n,r)}function C(e,n){return t.nearestVertex(i,a(e),e,n)}function E(e,n,r,s){return t.nearestVertices(i,a(e),e,n,r,s)}function f(e){var n,r;return"xmin"in e?"center"in e?e.center:null:"x"in e?e:"extent"in e&&(r=(n=e.extent)==null?void 0:n.center)!=null?r:null}function P(e,n,r){if(e==null)throw new u;const s=e.spatialReference;if((r=r!=null?r:f(e))==null)throw new u;const c=e.constructor.fromJSON(t.rotate(e,n,r));return c.spatialReference=s,c}function G(e,n){if(e==null)throw new u;const r=e.spatialReference;if((n=n!=null?n:f(e))==null)throw new u;const s=e.constructor.fromJSON(t.flipHorizontal(e,n));return s.spatialReference=r,s}function $(e,n){if(e==null)throw new u;const r=e.spatialReference;if((n=n!=null?n:f(e))==null)throw new u;const s=e.constructor.fromJSON(t.flipVertical(e,n));return s.spatialReference=r,s}function k(e,n,r,s){return t.generalize(i,a(e),e,n,r,s)}function F(e,n,r){return t.densify(i,a(e),e,n,r)}function K(e,n,r,s=0){return t.geodesicDensify(i,a(e),e,n,r,s)}function M(e,n){return t.planarArea(i,a(e),e,n)}function Q(e,n){return t.planarLength(i,a(e),e,n)}function U(e,n,r){return t.geodesicArea(i,a(e),e,n,r)}function W(e,n,r){return t.geodesicLength(i,a(e),e,n,r)}function X(e,n){return t.intersectLinesToPoints(i,a(e),e,n)}function Y(e,n){t.changeDefaultSpatialReferenceTolerance(e,n)}function Z(e){t.clearDefaultSpatialReferenceTolerance(e)}class u extends Error{constructor(){super("Illegal Argument Exception")}}export{j as buffer,Y as changeDefaultSpatialReferenceTolerance,Z as clearDefaultSpatialReferenceTolerance,m as clip,w as contains,H as convexHull,R as crosses,h as cut,F as densify,I as difference,L as disjoint,x as distance,y as equals,g as extendedSpatialReferenceInfo,G as flipHorizontal,$ as flipVertical,k as generalize,U as geodesicArea,q as geodesicBuffer,K as geodesicDensify,W as geodesicLength,N as intersect,X as intersectLinesToPoints,S as intersects,v as isSimple,B as nearestCoordinate,C as nearestVertex,E as nearestVertices,b as offset,T as overlaps,M as planarArea,Q as planarLength,V as relate,P as rotate,z as simplify,J as symmetricDifference,A as touches,O as union,D as within}; +import{G as t}from"./geometryEngineBase.82b25ca5.js";import{hydratedAdapter as i}from"./hydrated.406495cb.js";import"./index.221827cd.js";function a(e){return Array.isArray(e)?e[0].spatialReference:e&&e.spatialReference}function g(e){return t.extendedSpatialReferenceInfo(e)}function m(e,n){return t.clip(i,a(e),e,n)}function h(e,n){return t.cut(i,a(e),e,n)}function w(e,n){return t.contains(i,a(e),e,n)}function R(e,n){return t.crosses(i,a(e),e,n)}function x(e,n,r){return t.distance(i,a(e),e,n,r)}function y(e,n){return t.equals(i,a(e),e,n)}function S(e,n){return t.intersects(i,a(e),e,n)}function A(e,n){return t.touches(i,a(e),e,n)}function D(e,n){return t.within(i,a(e),e,n)}function L(e,n){return t.disjoint(i,a(e),e,n)}function T(e,n){return t.overlaps(i,a(e),e,n)}function V(e,n,r){return t.relate(i,a(e),e,n,r)}function v(e){return t.isSimple(i,a(e),e)}function z(e){return t.simplify(i,a(e),e)}function H(e,n=!1){return t.convexHull(i,a(e),e,n)}function I(e,n){return t.difference(i,a(e),e,n)}function J(e,n){return t.symmetricDifference(i,a(e),e,n)}function N(e,n){return t.intersect(i,a(e),e,n)}function O(e,n=null){return t.union(i,a(e),e,n)}function b(e,n,r,s,c,o){return t.offset(i,a(e),e,n,r,s,c,o)}function j(e,n,r,s=!1){return t.buffer(i,a(e),e,n,r,s)}function q(e,n,r,s,c,o){return t.geodesicBuffer(i,a(e),e,n,r,s,c,o)}function B(e,n,r=!0){return t.nearestCoordinate(i,a(e),e,n,r)}function C(e,n){return t.nearestVertex(i,a(e),e,n)}function E(e,n,r,s){return t.nearestVertices(i,a(e),e,n,r,s)}function f(e){var n,r;return"xmin"in e?"center"in e?e.center:null:"x"in e?e:"extent"in e&&(r=(n=e.extent)==null?void 0:n.center)!=null?r:null}function P(e,n,r){if(e==null)throw new u;const s=e.spatialReference;if((r=r!=null?r:f(e))==null)throw new u;const c=e.constructor.fromJSON(t.rotate(e,n,r));return c.spatialReference=s,c}function G(e,n){if(e==null)throw new u;const r=e.spatialReference;if((n=n!=null?n:f(e))==null)throw new u;const s=e.constructor.fromJSON(t.flipHorizontal(e,n));return s.spatialReference=r,s}function $(e,n){if(e==null)throw new u;const r=e.spatialReference;if((n=n!=null?n:f(e))==null)throw new u;const s=e.constructor.fromJSON(t.flipVertical(e,n));return s.spatialReference=r,s}function k(e,n,r,s){return t.generalize(i,a(e),e,n,r,s)}function F(e,n,r){return t.densify(i,a(e),e,n,r)}function K(e,n,r,s=0){return t.geodesicDensify(i,a(e),e,n,r,s)}function M(e,n){return t.planarArea(i,a(e),e,n)}function Q(e,n){return t.planarLength(i,a(e),e,n)}function U(e,n,r){return t.geodesicArea(i,a(e),e,n,r)}function W(e,n,r){return t.geodesicLength(i,a(e),e,n,r)}function X(e,n){return t.intersectLinesToPoints(i,a(e),e,n)}function Y(e,n){t.changeDefaultSpatialReferenceTolerance(e,n)}function Z(e){t.clearDefaultSpatialReferenceTolerance(e)}class u extends Error{constructor(){super("Illegal Argument Exception")}}export{j as buffer,Y as changeDefaultSpatialReferenceTolerance,Z as clearDefaultSpatialReferenceTolerance,m as clip,w as contains,H as convexHull,R as crosses,h as cut,F as densify,I as difference,L as disjoint,x as distance,y as equals,g as extendedSpatialReferenceInfo,G as flipHorizontal,$ as flipVertical,k as generalize,U as geodesicArea,q as geodesicBuffer,K as geodesicDensify,W as geodesicLength,N as intersect,X as intersectLinesToPoints,S as intersects,v as isSimple,B as nearestCoordinate,C as nearestVertex,E as nearestVertices,b as offset,T as overlaps,M as planarArea,Q as planarLength,V as relate,P as rotate,z as simplify,J as symmetricDifference,A as touches,O as union,D as within}; diff --git a/assets/geometryEngineAsync.3b47a469.js b/assets/geometryEngineAsync.68619ff9.js similarity index 97% rename from assets/geometryEngineAsync.3b47a469.js rename to assets/geometryEngineAsync.68619ff9.js index 0bb527b..ee89ad6 100644 --- a/assets/geometryEngineAsync.3b47a469.js +++ b/assets/geometryEngineAsync.68619ff9.js @@ -1 +1 @@ -import{c9 as f,d6 as w}from"./index.d94abe07.js";function i(t){var r;return Array.isArray(t)?(r=t[0])==null?void 0:r.spatialReference:t==null?void 0:t.spatialReference}function l(t){return t&&(Array.isArray(t)?t.map(l):t.toJSON?t.toJSON():t)}function u(t){return Array.isArray(t)?t.map(r=>f(r)):f(t)}function m(t,r){let n;return Array.isArray(t)?n=t:(n=[],n.push(t),r!=null&&n.push(r)),n}let s;async function d(){return s||(s=w("geometryEngineWorker",{strategy:"distributed"})),s}async function e(t,r){return(await d()).invoke("executeGEOperation",{operation:t,parameters:l(r)})}async function h(t,r){return u(await e("clip",[i(t),t,r]))}async function x(t,r){return u(await e("cut",[i(t),t,r]))}function v(t,r){return e("contains",[i(t),t,r])}function E(t,r){return e("crosses",[i(t),t,r])}function O(t,r,n){return e("distance",[i(t),t,r,n])}function R(t,r){return e("equals",[i(t),t,r])}function S(t,r){return e("intersects",[i(t),t,r])}function J(t,r){return e("touches",[i(t),t,r])}function N(t,r){return e("within",[i(t),t,r])}function b(t,r){return e("disjoint",[i(t),t,r])}function k(t,r){return e("overlaps",[i(t),t,r])}function D(t,r,n){return e("relate",[i(t),t,r,n])}function L(t){return e("isSimple",[i(t),t])}async function j(t){return u(await e("simplify",[i(t),t]))}async function B(t,r=!1){return u(await e("convexHull",[i(t),t,r]))}async function G(t,r){return u(await e("difference",[i(t),t,r]))}async function H(t,r){return u(await e("symmetricDifference",[i(t),t,r]))}async function W(t,r){return u(await e("intersect",[i(t),t,r]))}async function $(t,r=null){const n=m(t,r);return u(await e("union",[i(n),n]))}async function q(t,r,n,a,c,o){return u(await e("offset",[i(t),t,r,n,a,c,o]))}async function z(t,r,n,a=!1){const c=[i(t),t,r,n,a];return u(await e("buffer",c))}async function C(t,r,n,a,c,o){const p=[i(t),t,r,n,a,c,o];return u(await e("geodesicBuffer",p))}function g(t){var r;return"xmin"in t?t.center:"x"in t?t:(r=t.extent)==null?void 0:r.center}async function F(t,r,n){if(t==null)throw new y;const a=t.spatialReference;if((n=n!=null?n:g(t))==null)throw new y;const c=t.constructor.fromJSON(await e("rotate",[a,t,r,n]));return c.spatialReference=a,c}async function I(t,r,n,a){return u(await e("generalize",[i(t),t,r,n,a]))}async function K(t,r,n){return u(await e("densify",[i(t),t,r,n]))}async function M(t,r,n,a=0){return u(await e("geodesicDensify",[i(t),t,r,n,a]))}function P(t,r){return e("planarArea",[i(t),t,r])}function U(t,r){return e("planarLength",[i(t),t,r])}function Z(t,r,n){return e("geodesicArea",[i(t),t,r,n])}function Q(t,r,n){return e("geodesicLength",[i(t),t,r,n])}class y extends Error{constructor(){super("Illegal Argument Exception")}}export{b as A,I as B,K as C,W as D,G as E,U as F,F as H,L as J,Z as K,z as L,Q as M,j as N,k as O,C as P,D as R,J as S,M as U,P as W,$ as b,O as d,R as g,S as h,B as j,H as k,E as m,v as p,q as v,x as w,N as x,h as y}; +import{c9 as f,d6 as w}from"./index.221827cd.js";function i(t){var r;return Array.isArray(t)?(r=t[0])==null?void 0:r.spatialReference:t==null?void 0:t.spatialReference}function l(t){return t&&(Array.isArray(t)?t.map(l):t.toJSON?t.toJSON():t)}function u(t){return Array.isArray(t)?t.map(r=>f(r)):f(t)}function m(t,r){let n;return Array.isArray(t)?n=t:(n=[],n.push(t),r!=null&&n.push(r)),n}let s;async function d(){return s||(s=w("geometryEngineWorker",{strategy:"distributed"})),s}async function e(t,r){return(await d()).invoke("executeGEOperation",{operation:t,parameters:l(r)})}async function h(t,r){return u(await e("clip",[i(t),t,r]))}async function x(t,r){return u(await e("cut",[i(t),t,r]))}function v(t,r){return e("contains",[i(t),t,r])}function E(t,r){return e("crosses",[i(t),t,r])}function O(t,r,n){return e("distance",[i(t),t,r,n])}function R(t,r){return e("equals",[i(t),t,r])}function S(t,r){return e("intersects",[i(t),t,r])}function J(t,r){return e("touches",[i(t),t,r])}function N(t,r){return e("within",[i(t),t,r])}function b(t,r){return e("disjoint",[i(t),t,r])}function k(t,r){return e("overlaps",[i(t),t,r])}function D(t,r,n){return e("relate",[i(t),t,r,n])}function L(t){return e("isSimple",[i(t),t])}async function j(t){return u(await e("simplify",[i(t),t]))}async function B(t,r=!1){return u(await e("convexHull",[i(t),t,r]))}async function G(t,r){return u(await e("difference",[i(t),t,r]))}async function H(t,r){return u(await e("symmetricDifference",[i(t),t,r]))}async function W(t,r){return u(await e("intersect",[i(t),t,r]))}async function $(t,r=null){const n=m(t,r);return u(await e("union",[i(n),n]))}async function q(t,r,n,a,c,o){return u(await e("offset",[i(t),t,r,n,a,c,o]))}async function z(t,r,n,a=!1){const c=[i(t),t,r,n,a];return u(await e("buffer",c))}async function C(t,r,n,a,c,o){const p=[i(t),t,r,n,a,c,o];return u(await e("geodesicBuffer",p))}function g(t){var r;return"xmin"in t?t.center:"x"in t?t:(r=t.extent)==null?void 0:r.center}async function F(t,r,n){if(t==null)throw new y;const a=t.spatialReference;if((n=n!=null?n:g(t))==null)throw new y;const c=t.constructor.fromJSON(await e("rotate",[a,t,r,n]));return c.spatialReference=a,c}async function I(t,r,n,a){return u(await e("generalize",[i(t),t,r,n,a]))}async function K(t,r,n){return u(await e("densify",[i(t),t,r,n]))}async function M(t,r,n,a=0){return u(await e("geodesicDensify",[i(t),t,r,n,a]))}function P(t,r){return e("planarArea",[i(t),t,r])}function U(t,r){return e("planarLength",[i(t),t,r])}function Z(t,r,n){return e("geodesicArea",[i(t),t,r,n])}function Q(t,r,n){return e("geodesicLength",[i(t),t,r,n])}class y extends Error{constructor(){super("Illegal Argument Exception")}}export{b as A,I as B,K as C,W as D,G as E,U as F,F as H,L as J,Z as K,z as L,Q as M,j as N,k as O,C as P,D as R,J as S,M as U,P as W,$ as b,O as d,R as g,S as h,B as j,H as k,E as m,v as p,q as v,x as w,N as x,h as y}; diff --git a/assets/geometryServiceUtils.88d2a7a3.js b/assets/geometryServiceUtils.89c8be1f.js similarity index 93% rename from assets/geometryServiceUtils.88d2a7a3.js rename to assets/geometryServiceUtils.89c8be1f.js index bc6e76d..3e019a2 100644 --- a/assets/geometryServiceUtils.88d2a7a3.js +++ b/assets/geometryServiceUtils.89c8be1f.js @@ -1 +1 @@ -import{a6 as c,a7 as l,a8 as h,cx as S,aA as m,hB as d,dQ as w,e4 as R,U as v,hC as J,F as u,n as f,bW as N}from"./index.d94abe07.js";let n=class extends S{constructor(r){super(r),this.geometries=null,this.outSpatialReference=null,this.transformation=null,this.transformForward=null}toJSON(){const r=this.geometries.map(o=>o.toJSON()),t=this.geometries[0],e={};return e.outSR=this.outSpatialReference.wkid||JSON.stringify(this.outSpatialReference.toJSON()),e.inSR=t.spatialReference.wkid||JSON.stringify(t.spatialReference.toJSON()),e.geometries=JSON.stringify({geometryType:m(t),geometries:r}),this.transformation&&(e.transformation=this.transformation.wkid||JSON.stringify(this.transformation)),this.transformForward!=null&&(e.transformForward=this.transformForward),e}};c([l()],n.prototype,"geometries",void 0),c([l({json:{read:{source:"outSR"}}})],n.prototype,"outSpatialReference",void 0),c([l()],n.prototype,"transformation",void 0),c([l()],n.prototype,"transformForward",void 0),n=c([h("esri.rest.support.ProjectParameters")],n);const p=n,O=d(p);async function j(r,t,e){t=O(t);const o=w(r),i={...o.query,f:"json",...t.toJSON()},a=t.outSpatialReference,s=m(t.geometries[0]),g=R(i,e);return v(o.path+"/project",g).then(({data:{geometries:y}})=>J(y,s,a))}async function $(r=null,t){var i,a;if(u.geometryServiceUrl)return u.geometryServiceUrl;if(!r)throw new f("internal:geometry-service-url-not-configured");let e;e="portal"in r?r.portal||N.getDefault():r,await e.load({signal:t});const o=(a=(i=e.helperServices)==null?void 0:i.geometry)==null?void 0:a.url;if(!o)throw new f("internal:geometry-service-url-not-configured");return o}async function U(r,t,e=null,o){const i=await $(e,o),a=new p;a.geometries=[r],a.outSpatialReference=t;const s=await j(i,a,{signal:o});if(s&&Array.isArray(s)&&s.length===1)return s[0];throw new f("internal:geometry-service-projection-failed")}export{$ as getGeometryServiceURL,U as projectGeometry}; +import{a6 as c,a7 as l,a8 as h,cx as S,aA as m,hB as d,dQ as w,e4 as R,U as v,hC as J,F as u,n as f,bW as N}from"./index.221827cd.js";let n=class extends S{constructor(r){super(r),this.geometries=null,this.outSpatialReference=null,this.transformation=null,this.transformForward=null}toJSON(){const r=this.geometries.map(o=>o.toJSON()),t=this.geometries[0],e={};return e.outSR=this.outSpatialReference.wkid||JSON.stringify(this.outSpatialReference.toJSON()),e.inSR=t.spatialReference.wkid||JSON.stringify(t.spatialReference.toJSON()),e.geometries=JSON.stringify({geometryType:m(t),geometries:r}),this.transformation&&(e.transformation=this.transformation.wkid||JSON.stringify(this.transformation)),this.transformForward!=null&&(e.transformForward=this.transformForward),e}};c([l()],n.prototype,"geometries",void 0),c([l({json:{read:{source:"outSR"}}})],n.prototype,"outSpatialReference",void 0),c([l()],n.prototype,"transformation",void 0),c([l()],n.prototype,"transformForward",void 0),n=c([h("esri.rest.support.ProjectParameters")],n);const p=n,O=d(p);async function j(r,t,e){t=O(t);const o=w(r),i={...o.query,f:"json",...t.toJSON()},a=t.outSpatialReference,s=m(t.geometries[0]),g=R(i,e);return v(o.path+"/project",g).then(({data:{geometries:y}})=>J(y,s,a))}async function $(r=null,t){var i,a;if(u.geometryServiceUrl)return u.geometryServiceUrl;if(!r)throw new f("internal:geometry-service-url-not-configured");let e;e="portal"in r?r.portal||N.getDefault():r,await e.load({signal:t});const o=(a=(i=e.helperServices)==null?void 0:i.geometry)==null?void 0:a.url;if(!o)throw new f("internal:geometry-service-url-not-configured");return o}async function U(r,t,e=null,o){const i=await $(e,o),a=new p;a.geometries=[r],a.outSpatialReference=t;const s=await j(i,a,{signal:o});if(s&&Array.isArray(s)&&s.length===1)return s[0];throw new f("internal:geometry-service-projection-failed")}export{$ as getGeometryServiceURL,U as projectGeometry}; diff --git a/assets/georeference.c844666d.js b/assets/georeference.1d7480c1.js similarity index 96% rename from assets/georeference.c844666d.js rename to assets/georeference.1d7480c1.js index 6471dfb..7cf0a90 100644 --- a/assets/georeference.c844666d.js +++ b/assets/georeference.1d7480c1.js @@ -1 +1 @@ -import{fy as ir,fJ as sr,dC as lr,a6 as T,a7 as A,a8 as fr,cx as cr,M as _,aj as ur,fK as pr,fL as K,fM as W,fN as M,fO as w,fP as yr,fQ as G,fR as gr,af as mr,c as S,fS as hr,fT as Tr,fU as B,s as Ar,fV as k,ec as J,eb as Z,fW as $r,fE as Pr,fX as dr,fY as Fr,fZ as Er,j as m,f_ as C,f$ as Q,g0 as Mr,cq as Rr,g1 as xr,g2 as vr}from"./index.d94abe07.js";import{e as X}from"./mat3f64.6d32a1d7.js";import{e as $,o as _r}from"./mat4f64.ff2a477c.js";import{v as z,y as wr,x as Cr}from"./quat.b3994f2f.js";import{e as I}from"./quatf64.4ae3e6f1.js";import{T as p,i as u}from"./BufferView.89055914.js";import{t as F,e as Or,r as P,o as rr}from"./vec33.4564cd5b.js";function E(r=br){return[r[0],r[1],r[2],r[3]]}function ct(r,t,e=E()){return ir(e,r),e[3]=t,e}function ut(r,t,e=E()){return z(R,r,j(r)),z(D,t,j(t)),wr(R,D,R),Nr(e,sr(Cr(e,R)))}function pt(r){return r}function j(r){return lr(r[3])}function Nr(r,t){return r[3]=t,r}const br=[0,0,1,0],R=I(),D=I();E();var Y;let g=Y=class extends cr{constructor(r){super(r),this.origin=_(),this.translation=_(),this.rotation=E(),this.scale=ur(1,1,1),this.geographic=!0}get localMatrix(){const r=$();return z(H,this.rotation,j(this.rotation)),pr(r,H,this.translation,this.scale),r}get localMatrixInverse(){return K($(),this.localMatrix)}applyLocal(r,t){return W(t,r,this.localMatrix)}applyLocalInverse(r,t){return W(t,r,this.localMatrixInverse)}project(r,t){const e=new Float64Array(r.length),o=p.fromTypedArray(e),n=p.fromTypedArray(r);if(this.geographic){const l=M(t),f=$();return w(t,this.origin,f,l),yr(f,f,this.localMatrix),F(o,n,f),G(e,l,0,e,t,0,e.length/3),e}const{localMatrix:a,origin:i}=this;gr(a,_r)?Or(o,n):F(o,n,a);for(let l=0;l=4&&n!==E.ELEMENT_ARRAY_BUFFER&&(this._bufferView.byteStride=a),t.bufferViews.push(this._bufferView),this._numComponentsForDataType=this._calculateNumComponentsForDataType()}push(e){const t=this._data.length;if(this._data.push(e),this._accessorIndex>=0){const s=t%this._numComponentsForDataType,r=this._accessorMin[s];this._accessorMin[s]=typeof r!="number"?e:Math.min(r,e);const n=this._accessorMax[s];this._accessorMax[s]=typeof n!="number"?e:Math.max(n,e)}}get dataSize(){return this._data.length*this._sizeComponentType()}get byteSize(){function e(t,s){return s*Math.ceil(t/s)}return e(this.dataSize,4)}getByteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}get byteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}_createTypedArray(e,t){switch(this._componentType){case d.BYTE:return new Int8Array(e,t);case d.FLOAT:return new Float32Array(e,t);case d.SHORT:return new Int16Array(e,t);case d.UNSIGNED_BYTE:return new Uint8Array(e,t);case d.UNSIGNED_INT:return new Uint32Array(e,t);case d.UNSIGNED_SHORT:return new Uint16Array(e,t)}}writeOutToBuffer(e,t){this._createTypedArray(e,t).set(this._data)}writeAsync(e){if(this._asyncWritePromise)throw new Error("Can't write multiple bufferView values asynchronously");return this._asyncWritePromise=e.then(t=>{const s=new Uint8Array(t);for(let r=0;r=0)throw new Error("Accessor was started without ending the previous one");this._accessorIndex=this._data.length,this._accessorAttribute=e;const t=this._numComponentsForDataType;this._accessorMin=new Array(t),this._accessorMax=new Array(t)}endAccessor(){if(this._accessorIndex<0)throw new Error("An accessor was not started, but was attempted to be ended");const e=this._getElementSize(),t=this._numComponentsForDataType,s=(this._data.length-this._accessorIndex)/t;if(s%1)throw new Error("An accessor was ended with missing component values");for(let n=0;nthis._finalizedPromiseResolve=e)}finalize(){const e=this._bufferView;return new Promise(t=>{const s=this._buffer.getViewFinalizePromises(this);this._asyncWritePromise&&s.push(this._asyncWritePromise),t(G(s))}).then(()=>{this._isFinalized=!0,e.byteOffset=this.getByteOffset(),e.byteLength=this.dataSize,this._finalizedPromiseResolve&&this._finalizedPromiseResolve()})}_getElementSize(){return this._sizeComponentType()*this._numComponentsForDataType}_sizeComponentType(){switch(this._componentType){case d.BYTE:case d.UNSIGNED_BYTE:return 1;case d.SHORT:case d.UNSIGNED_SHORT:return 2;case d.UNSIGNED_INT:case d.FLOAT:return 4}}_calculateNumComponentsForDataType(){switch(this._dataType){case p.SCALAR:return 1;case p.VEC2:return 2;case p.VEC3:return 3;case p.VEC4:case p.MAT2:return 4;case p.MAT3:return 9;case p.MAT4:return 16}}}class J{constructor(e){this._gltf=e,this._bufferViews=[],this._isFinalized=!1,e.buffers||(e.buffers=[]),this.index=e.buffers.length;const t={byteLength:-1};e.buffers.push(t),this._buffer=t}addBufferView(e,t,s){if(this._finalizePromise)throw new Error("Cannot add buffer view after fiinalizing buffer");const r=new pe(this,this._gltf,e,t,s);return this._bufferViews.push(r),r}getByteOffset(e){let t=0;for(const s of this._bufferViews){if(s===e)return t;t+=s.byteSize}throw new Error("Given bufferView was not present in this buffer")}getViewFinalizePromises(e){const t=[];for(const s of this._bufferViews){if(e&&s===e)return t;t.push(s.finalized)}return t}getArrayBuffer(){if(!this._isFinalized)throw new Error("Cannot get ArrayBuffer from Buffer before it is finalized");const e=this._getTotalSize(),t=new ArrayBuffer(e);let s=0;for(const r of this._bufferViews)r.writeOutToBuffer(t,s),s+=r.byteSize;return t}finalize(){var e;if(this._finalizePromise)throw new Error(`Buffer ${this.index} was already finalized`);return this._finalizePromise=new Promise(t=>{t(G(this.getViewFinalizePromises()))}).then(()=>{this._isFinalized=!0;const t=this.getArrayBuffer();this._buffer.byteLength=t.byteLength,this._buffer.uri=t}),(e=this._gltf.extras)==null||e.promises.push(this._finalizePromise),this._finalizePromise}_getTotalSize(){let e=0;for(const t of this._bufferViews)e+=t.byteSize;return e}}function me(i,e){if(i.components)for(const t of i.components)t.faces&&t.shading==="smooth"&&ge(t,e)}function ge(i,e){K(e.normal)&&(e.normal=new Float32Array(e.position.length));const t=i.faces,{position:s,normal:r}=e,n=t.length/3;for(let a=0;a{this._addScene(r)}),s&&t.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const t={};e.name&&(t.name=e.name),e.forEachNode(s=>{t.nodes||(t.nodes=[]);const r=this._addNode(s);t.nodes.push(r)}),this.gltf.scenes.push(t)}_addNode(e){this.gltf.nodes||(this.gltf.nodes=[]);const t={};e.name&&(t.name=e.name);const s=e.translation;Y(s,te)||(t.translation=U(s));const r=e.rotation;ne(r,oe)||(t.rotation=he(r));const n=e.scale;Y(n,W)||(t.scale=U(n)),e.mesh&&e.mesh.vertexAttributes.position?t.mesh=this._addMesh(e.mesh):e.forEachNode(h=>{t.children||(t.children=[]);const o=this._addNode(h);t.children.push(o)});const a=this.gltf.nodes.length;return this.gltf.nodes.push(t),a}_addMesh(e){this.gltf.meshes||(this.gltf.meshes=[]);const t={primitives:[]},s=this.gltf.extras,r=s.options.bufferOutputType===R.GLB;let n;n=r?s.binChunkBuffer:new J(this.gltf),this.params.origin||(this.params.origin=we(e));const a=ue(e.vertexAttributes,e.transform,this.params.origin,{geographic:this.params.geographic,unit:"meters"});me(e,a),this._flipYZAxis(a);const h=n.addBufferView(d.FLOAT,p.VEC3,E.ARRAY_BUFFER);let o,c,l,u;a.normal&&(o=n.addBufferView(d.FLOAT,p.VEC3,E.ARRAY_BUFFER)),e.vertexAttributes.uv&&(c=n.addBufferView(d.FLOAT,p.VEC2,E.ARRAY_BUFFER)),a.tangent&&(l=n.addBufferView(d.FLOAT,p.VEC4,E.ARRAY_BUFFER)),e.vertexAttributes.color&&(u=n.addBufferView(d.UNSIGNED_BYTE,p.VEC4,E.ARRAY_BUFFER)),h.startAccessor("POSITION"),o&&o.startAccessor("NORMAL"),c&&c.startAccessor("TEXCOORD_0"),l&&l.startAccessor("TANGENT"),u&&u.startAccessor("COLOR_0");const w=a.position.length/3,{position:m,normal:x,tangent:_}=a,{color:N,uv:A}=e.vertexAttributes;for(let f=0;f0&&e.components[0].faces?(B=n.addBufferView(d.UNSIGNED_INT,p.SCALAR,E.ELEMENT_ARRAY_BUFFER),this._addMeshVertexIndexed(B,e.components,t,$,z,V,F,D)):this._addMeshVertexNonIndexed(e.components,t,$,z,V,F,D),h.finalize(),o&&o.finalize(),c&&c.finalize(),l&&l.finalize(),B&&B.finalize(),u&&u.finalize(),r||n.finalize();const X=this.gltf.meshes.length;return this.gltf.meshes.push(t),X}_flipYZAxis({position:e,normal:t,tangent:s}){this._flipYZBuffer(e,3),this._flipYZBuffer(t,3),this._flipYZBuffer(s,4)}_flipYZBuffer(e,t){if(!K(e))for(let s=1,r=2;sh**2.1,n=h=>{const o=h.toRgba();return o[0]=r(o[0]/255),o[1]=r(o[1]/255),o[2]=r(o[2]/255),o};if(g(e.color)&&(s.pbrMetallicRoughness.baseColorFactor=n(e.color)),g(e.colorTexture)&&(s.pbrMetallicRoughness.baseColorTexture={index:this._addTexture(e.colorTexture)}),g(e.normalTexture)&&(s.normalTexture={index:this._addTexture(e.normalTexture)}),e instanceof fe){if(g(e.emissiveTexture)&&(s.emissiveTexture={index:this._addTexture(e.emissiveTexture)}),g(e.emissiveColor)){const h=n(e.emissiveColor);s.emissiveFactor=[h[0],h[1],h[2]]}g(e.occlusionTexture)&&(s.occlusionTexture={index:this._addTexture(e.occlusionTexture)}),g(e.metallicRoughnessTexture)&&(s.pbrMetallicRoughness.metallicRoughnessTexture={index:this._addTexture(e.metallicRoughnessTexture)}),s.pbrMetallicRoughness.metallicFactor=e.metallic,s.pbrMetallicRoughness.roughnessFactor=e.roughness}else s.pbrMetallicRoughness.metallicFactor=1,s.pbrMetallicRoughness.roughnessFactor=1,be.warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const a=this.gltf.materials.length;return this.gltf.materials.push(s),this._materialMap.push(e),a}_addTexture(e){var s;const t=(s=this.gltf.textures)!=null?s:[];return this.gltf.textures=t,se(this._textureMap,e,()=>{const r={sampler:this._addSampler(e),source:this._addImage(e)},n=t.length;return t.push(r),n})}_addImage(e){const t=this._imageMap.get(e);if(t!=null)return t;this.gltf.images||(this.gltf.images=[]);const s={};if(e.url)s.uri=e.url;else{const n=e.data;s.extras=n;for(let h=0;h(s.mimeType=l,c));h.writeAsync(o).then(()=>{h.finalize()}),s.bufferView=h.index;break}case b.DataURI:s.uri=le(n);break;default:a.promises.push(k(n).then(({data:h,type:o})=>{s.uri=h,s.mimeType=o}))}}const r=this.gltf.images.length;return this.gltf.images.push(s),this._imageMap.set(e,r),r}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let t=y.REPEAT,s=y.REPEAT;if(typeof e.wrap=="string")switch(e.wrap){case"clamp":t=y.CLAMP_TO_EDGE,s=y.CLAMP_TO_EDGE;break;case"mirror":t=y.MIRRORED_REPEAT,s=y.MIRRORED_REPEAT}else{switch(e.wrap.vertical){case"clamp":s=y.CLAMP_TO_EDGE;break;case"mirror":s=y.MIRRORED_REPEAT}switch(e.wrap.horizontal){case"clamp":t=y.CLAMP_TO_EDGE;break;case"mirror":t=y.MIRRORED_REPEAT}}const r={wrapS:t,wrapT:s};for(let a=0;a{const m={origin:n};delete a.extras;const x=typeof e.jsonSpacing=="number"?e.jsonSpacing:4,_=JSON.stringify(a,(N,A)=>{if(N!=="extras"){if(A instanceof ArrayBuffer){if(de(A))switch(e.imageOutputType){case b.DataURI:case b.GLB:break;case b.External:default:{const O=`img${c}.png`;return c++,m[O]=A,O}}switch(e.bufferOutputType){case R.DataURI:return _e(A);case R.GLB:if(l)throw new Error("Already encountered an ArrayBuffer, there should only be one in the GLB format.");return void(l=A);case R.External:default:{const O=`data${o}.bin`;return o++,m[O]=A,O}}}return A}},x);return e.bufferOutputType===R.GLB||e.imageOutputType===b.GLB?m[j]=new T(_,l).buffer:m[Oe]=_,m})}function Me(i,e){return Se(i,{bufferOutputType:R.GLB,imageOutputType:b.GLB,jsonSpacing:0},e)}class Be{constructor(e,t){this._file={type:"model/gltf-binary",data:e},this.origin=t}buffer(){return Promise.resolve(this._file)}download(e){re(new Blob([this._file.data],{type:this._file.type}),e)}}function He(i,e){const t=new Re,s=new xe;return t.addScene(s),s.addNode(new Ne(i)),Me(t,e).then(r=>new Be(r[j],r.origin))}export{He as toBinaryGLTF}; +import{cB as G,j as K,O as I,fD as v,fC as Q,fE as q,c as g,af as P,M,s as ee,fS as Y,kJ as te,fU as U,kU as W,e6 as se,eD as ie,kV as re}from"./index.221827cd.js";import{K as ne,k as ae}from"./quat.d9562009.js";import{o as oe,r as he,e as ce}from"./quatf64.4ae3e6f1.js";import{c as fe}from"./meshFeatureSet.eec93388.js";import{i as ue}from"./georeference.1d7480c1.js";import{C as d,D as y}from"./enums.2d9e6f64.js";import{o as k,i as le,g as de,s as _e}from"./imageutils.5e4d6270.js";import"./mat3f64.6d32a1d7.js";import"./imageUtils.753f41b1.js";import"./earcut.afc1d357.js";import"./deduplicate.ef93b18a.js";import"./mat4f64.ff2a477c.js";import"./BufferView.6eee27cd.js";import"./vec33.46fc6802.js";var C;(function(i){i[i.JSON=1313821514]="JSON",i[i.BIN=5130562]="BIN"})(C||(C={}));class T{constructor(e,t){if(!e)throw new Error("GLB requires a JSON gltf chunk");this._length=T.HEADER_SIZE,this._length+=T.CHUNK_HEADER_SIZE;const s=this._textToArrayBuffer(e);if(this._length+=this._alignTo(s.byteLength,4),t&&(this._length+=T.CHUNK_HEADER_SIZE,this._length+=t.byteLength,t.byteLength%4))throw new Error("Expected BIN chunk length to be divisible by 4 at this point");this.buffer=new ArrayBuffer(this._length),this._outView=new DataView(this.buffer),this._writeHeader();const r=this._writeChunk(s,12,C.JSON,32);t&&this._writeChunk(t,r,C.BIN)}_writeHeader(){this._outView.setUint32(0,T.MAGIC,!0),this._outView.setUint32(4,T.VERSION,!0),this._outView.setUint32(8,this._length,!0)}_writeChunk(e,t,s,r=0){const n=this._alignTo(e.byteLength,4);for(this._outView.setUint32(t,n,!0),this._outView.setUint32(t+=4,s,!0),this._writeArrayBuffer(this._outView.buffer,e,t+=4,0,e.byteLength),t+=e.byteLength;t%4;)r&&this._outView.setUint8(t,r),t++;return t}_writeArrayBuffer(e,t,s,r,n){new Uint8Array(e,s,n).set(new Uint8Array(t,r,n),0)}_textToArrayBuffer(e){return new TextEncoder().encode(e).buffer}_alignTo(e,t){return t*Math.ceil(e/t)}}T.HEADER_SIZE=12,T.CHUNK_HEADER_SIZE=8,T.MAGIC=1179937895,T.VERSION=2;var R,b,E,p,H,L,Z;(function(i){i[i.External=0]="External",i[i.DataURI=1]="DataURI",i[i.GLB=2]="GLB"})(R||(R={})),function(i){i[i.External=0]="External",i[i.DataURI=1]="DataURI",i[i.GLB=2]="GLB"}(b||(b={})),function(i){i[i.ARRAY_BUFFER=34962]="ARRAY_BUFFER",i[i.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER"}(E||(E={})),function(i){i.SCALAR="SCALAR",i.VEC2="VEC2",i.VEC3="VEC3",i.VEC4="VEC4",i.MAT2="MAT2",i.MAT3="MAT3",i.MAT4="MAT4"}(p||(p={})),function(i){i[i.POINTS=0]="POINTS",i[i.LINES=1]="LINES",i[i.LINE_LOOP=2]="LINE_LOOP",i[i.LINE_STRIP=3]="LINE_STRIP",i[i.TRIANGLES=4]="TRIANGLES",i[i.TRIANGLE_STRIP=5]="TRIANGLE_STRIP",i[i.TRIANGLE_FAN=6]="TRIANGLE_FAN"}(H||(H={})),function(i){i.OPAQUE="OPAQUE",i.MASK="MASK",i.BLEND="BLEND"}(L||(L={})),function(i){i[i.NoColor=0]="NoColor",i[i.FaceColor=1]="FaceColor",i[i.VertexColor=2]="VertexColor"}(Z||(Z={}));class pe{constructor(e,t,s,r,n){this._buffer=e,this._componentType=s,this._dataType=r,this._data=[],this._isFinalized=!1,this._accessorIndex=-1,this._accessorAttribute=null,this._accessorMin=null,this._accessorMax=null,t.bufferViews||(t.bufferViews=[]),this.index=t.bufferViews.length,this._bufferView={buffer:e.index,byteLength:-1,target:n};const a=this._getElementSize();a>=4&&n!==E.ELEMENT_ARRAY_BUFFER&&(this._bufferView.byteStride=a),t.bufferViews.push(this._bufferView),this._numComponentsForDataType=this._calculateNumComponentsForDataType()}push(e){const t=this._data.length;if(this._data.push(e),this._accessorIndex>=0){const s=t%this._numComponentsForDataType,r=this._accessorMin[s];this._accessorMin[s]=typeof r!="number"?e:Math.min(r,e);const n=this._accessorMax[s];this._accessorMax[s]=typeof n!="number"?e:Math.max(n,e)}}get dataSize(){return this._data.length*this._sizeComponentType()}get byteSize(){function e(t,s){return s*Math.ceil(t/s)}return e(this.dataSize,4)}getByteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}get byteOffset(){if(!this._isFinalized)throw new Error("Cannot get BufferView offset until it is finalized");return this._buffer.getByteOffset(this)}_createTypedArray(e,t){switch(this._componentType){case d.BYTE:return new Int8Array(e,t);case d.FLOAT:return new Float32Array(e,t);case d.SHORT:return new Int16Array(e,t);case d.UNSIGNED_BYTE:return new Uint8Array(e,t);case d.UNSIGNED_INT:return new Uint32Array(e,t);case d.UNSIGNED_SHORT:return new Uint16Array(e,t)}}writeOutToBuffer(e,t){this._createTypedArray(e,t).set(this._data)}writeAsync(e){if(this._asyncWritePromise)throw new Error("Can't write multiple bufferView values asynchronously");return this._asyncWritePromise=e.then(t=>{const s=new Uint8Array(t);for(let r=0;r=0)throw new Error("Accessor was started without ending the previous one");this._accessorIndex=this._data.length,this._accessorAttribute=e;const t=this._numComponentsForDataType;this._accessorMin=new Array(t),this._accessorMax=new Array(t)}endAccessor(){if(this._accessorIndex<0)throw new Error("An accessor was not started, but was attempted to be ended");const e=this._getElementSize(),t=this._numComponentsForDataType,s=(this._data.length-this._accessorIndex)/t;if(s%1)throw new Error("An accessor was ended with missing component values");for(let n=0;nthis._finalizedPromiseResolve=e)}finalize(){const e=this._bufferView;return new Promise(t=>{const s=this._buffer.getViewFinalizePromises(this);this._asyncWritePromise&&s.push(this._asyncWritePromise),t(G(s))}).then(()=>{this._isFinalized=!0,e.byteOffset=this.getByteOffset(),e.byteLength=this.dataSize,this._finalizedPromiseResolve&&this._finalizedPromiseResolve()})}_getElementSize(){return this._sizeComponentType()*this._numComponentsForDataType}_sizeComponentType(){switch(this._componentType){case d.BYTE:case d.UNSIGNED_BYTE:return 1;case d.SHORT:case d.UNSIGNED_SHORT:return 2;case d.UNSIGNED_INT:case d.FLOAT:return 4}}_calculateNumComponentsForDataType(){switch(this._dataType){case p.SCALAR:return 1;case p.VEC2:return 2;case p.VEC3:return 3;case p.VEC4:case p.MAT2:return 4;case p.MAT3:return 9;case p.MAT4:return 16}}}class J{constructor(e){this._gltf=e,this._bufferViews=[],this._isFinalized=!1,e.buffers||(e.buffers=[]),this.index=e.buffers.length;const t={byteLength:-1};e.buffers.push(t),this._buffer=t}addBufferView(e,t,s){if(this._finalizePromise)throw new Error("Cannot add buffer view after fiinalizing buffer");const r=new pe(this,this._gltf,e,t,s);return this._bufferViews.push(r),r}getByteOffset(e){let t=0;for(const s of this._bufferViews){if(s===e)return t;t+=s.byteSize}throw new Error("Given bufferView was not present in this buffer")}getViewFinalizePromises(e){const t=[];for(const s of this._bufferViews){if(e&&s===e)return t;t.push(s.finalized)}return t}getArrayBuffer(){if(!this._isFinalized)throw new Error("Cannot get ArrayBuffer from Buffer before it is finalized");const e=this._getTotalSize(),t=new ArrayBuffer(e);let s=0;for(const r of this._bufferViews)r.writeOutToBuffer(t,s),s+=r.byteSize;return t}finalize(){var e;if(this._finalizePromise)throw new Error(`Buffer ${this.index} was already finalized`);return this._finalizePromise=new Promise(t=>{t(G(this.getViewFinalizePromises()))}).then(()=>{this._isFinalized=!0;const t=this.getArrayBuffer();this._buffer.byteLength=t.byteLength,this._buffer.uri=t}),(e=this._gltf.extras)==null||e.promises.push(this._finalizePromise),this._finalizePromise}_getTotalSize(){let e=0;for(const t of this._bufferViews)e+=t.byteSize;return e}}function me(i,e){if(i.components)for(const t of i.components)t.faces&&t.shading==="smooth"&&ge(t,e)}function ge(i,e){K(e.normal)&&(e.normal=new Float32Array(e.position.length));const t=i.faces,{position:s,normal:r}=e,n=t.length/3;for(let a=0;a{this._addScene(r)}),s&&t.binChunkBuffer.finalize()}_addScene(e){this.gltf.scenes||(this.gltf.scenes=[]);const t={};e.name&&(t.name=e.name),e.forEachNode(s=>{t.nodes||(t.nodes=[]);const r=this._addNode(s);t.nodes.push(r)}),this.gltf.scenes.push(t)}_addNode(e){this.gltf.nodes||(this.gltf.nodes=[]);const t={};e.name&&(t.name=e.name);const s=e.translation;Y(s,te)||(t.translation=U(s));const r=e.rotation;ne(r,oe)||(t.rotation=he(r));const n=e.scale;Y(n,W)||(t.scale=U(n)),e.mesh&&e.mesh.vertexAttributes.position?t.mesh=this._addMesh(e.mesh):e.forEachNode(h=>{t.children||(t.children=[]);const o=this._addNode(h);t.children.push(o)});const a=this.gltf.nodes.length;return this.gltf.nodes.push(t),a}_addMesh(e){this.gltf.meshes||(this.gltf.meshes=[]);const t={primitives:[]},s=this.gltf.extras,r=s.options.bufferOutputType===R.GLB;let n;n=r?s.binChunkBuffer:new J(this.gltf),this.params.origin||(this.params.origin=we(e));const a=ue(e.vertexAttributes,e.transform,this.params.origin,{geographic:this.params.geographic,unit:"meters"});me(e,a),this._flipYZAxis(a);const h=n.addBufferView(d.FLOAT,p.VEC3,E.ARRAY_BUFFER);let o,c,l,u;a.normal&&(o=n.addBufferView(d.FLOAT,p.VEC3,E.ARRAY_BUFFER)),e.vertexAttributes.uv&&(c=n.addBufferView(d.FLOAT,p.VEC2,E.ARRAY_BUFFER)),a.tangent&&(l=n.addBufferView(d.FLOAT,p.VEC4,E.ARRAY_BUFFER)),e.vertexAttributes.color&&(u=n.addBufferView(d.UNSIGNED_BYTE,p.VEC4,E.ARRAY_BUFFER)),h.startAccessor("POSITION"),o&&o.startAccessor("NORMAL"),c&&c.startAccessor("TEXCOORD_0"),l&&l.startAccessor("TANGENT"),u&&u.startAccessor("COLOR_0");const w=a.position.length/3,{position:m,normal:x,tangent:_}=a,{color:N,uv:A}=e.vertexAttributes;for(let f=0;f0&&e.components[0].faces?(B=n.addBufferView(d.UNSIGNED_INT,p.SCALAR,E.ELEMENT_ARRAY_BUFFER),this._addMeshVertexIndexed(B,e.components,t,$,z,V,F,D)):this._addMeshVertexNonIndexed(e.components,t,$,z,V,F,D),h.finalize(),o&&o.finalize(),c&&c.finalize(),l&&l.finalize(),B&&B.finalize(),u&&u.finalize(),r||n.finalize();const X=this.gltf.meshes.length;return this.gltf.meshes.push(t),X}_flipYZAxis({position:e,normal:t,tangent:s}){this._flipYZBuffer(e,3),this._flipYZBuffer(t,3),this._flipYZBuffer(s,4)}_flipYZBuffer(e,t){if(!K(e))for(let s=1,r=2;sh**2.1,n=h=>{const o=h.toRgba();return o[0]=r(o[0]/255),o[1]=r(o[1]/255),o[2]=r(o[2]/255),o};if(g(e.color)&&(s.pbrMetallicRoughness.baseColorFactor=n(e.color)),g(e.colorTexture)&&(s.pbrMetallicRoughness.baseColorTexture={index:this._addTexture(e.colorTexture)}),g(e.normalTexture)&&(s.normalTexture={index:this._addTexture(e.normalTexture)}),e instanceof fe){if(g(e.emissiveTexture)&&(s.emissiveTexture={index:this._addTexture(e.emissiveTexture)}),g(e.emissiveColor)){const h=n(e.emissiveColor);s.emissiveFactor=[h[0],h[1],h[2]]}g(e.occlusionTexture)&&(s.occlusionTexture={index:this._addTexture(e.occlusionTexture)}),g(e.metallicRoughnessTexture)&&(s.pbrMetallicRoughness.metallicRoughnessTexture={index:this._addTexture(e.metallicRoughnessTexture)}),s.pbrMetallicRoughness.metallicFactor=e.metallic,s.pbrMetallicRoughness.roughnessFactor=e.roughness}else s.pbrMetallicRoughness.metallicFactor=1,s.pbrMetallicRoughness.roughnessFactor=1,be.warnOnce("Meshes exported to GLTF without MeshMaterialMetallicRoughness material will appear different when imported back.");const a=this.gltf.materials.length;return this.gltf.materials.push(s),this._materialMap.push(e),a}_addTexture(e){var s;const t=(s=this.gltf.textures)!=null?s:[];return this.gltf.textures=t,se(this._textureMap,e,()=>{const r={sampler:this._addSampler(e),source:this._addImage(e)},n=t.length;return t.push(r),n})}_addImage(e){const t=this._imageMap.get(e);if(t!=null)return t;this.gltf.images||(this.gltf.images=[]);const s={};if(e.url)s.uri=e.url;else{const n=e.data;s.extras=n;for(let h=0;h(s.mimeType=l,c));h.writeAsync(o).then(()=>{h.finalize()}),s.bufferView=h.index;break}case b.DataURI:s.uri=le(n);break;default:a.promises.push(k(n).then(({data:h,type:o})=>{s.uri=h,s.mimeType=o}))}}const r=this.gltf.images.length;return this.gltf.images.push(s),this._imageMap.set(e,r),r}_addSampler(e){this.gltf.samplers||(this.gltf.samplers=[]);let t=y.REPEAT,s=y.REPEAT;if(typeof e.wrap=="string")switch(e.wrap){case"clamp":t=y.CLAMP_TO_EDGE,s=y.CLAMP_TO_EDGE;break;case"mirror":t=y.MIRRORED_REPEAT,s=y.MIRRORED_REPEAT}else{switch(e.wrap.vertical){case"clamp":s=y.CLAMP_TO_EDGE;break;case"mirror":s=y.MIRRORED_REPEAT}switch(e.wrap.horizontal){case"clamp":t=y.CLAMP_TO_EDGE;break;case"mirror":t=y.MIRRORED_REPEAT}}const r={wrapS:t,wrapT:s};for(let a=0;a{const m={origin:n};delete a.extras;const x=typeof e.jsonSpacing=="number"?e.jsonSpacing:4,_=JSON.stringify(a,(N,A)=>{if(N!=="extras"){if(A instanceof ArrayBuffer){if(de(A))switch(e.imageOutputType){case b.DataURI:case b.GLB:break;case b.External:default:{const O=`img${c}.png`;return c++,m[O]=A,O}}switch(e.bufferOutputType){case R.DataURI:return _e(A);case R.GLB:if(l)throw new Error("Already encountered an ArrayBuffer, there should only be one in the GLB format.");return void(l=A);case R.External:default:{const O=`data${o}.bin`;return o++,m[O]=A,O}}}return A}},x);return e.bufferOutputType===R.GLB||e.imageOutputType===b.GLB?m[j]=new T(_,l).buffer:m[Oe]=_,m})}function Me(i,e){return Se(i,{bufferOutputType:R.GLB,imageOutputType:b.GLB,jsonSpacing:0},e)}class Be{constructor(e,t){this._file={type:"model/gltf-binary",data:e},this.origin=t}buffer(){return Promise.resolve(this._file)}download(e){re(new Blob([this._file.data],{type:this._file.type}),e)}}function He(i,e){const t=new Re,s=new xe;return t.addScene(s),s.addNode(new Ne(i)),Me(t,e).then(r=>new Be(r[j],r.origin))}export{He as toBinaryGLTF}; diff --git a/assets/hydrated.905f3857.js b/assets/hydrated.406495cb.js similarity index 90% rename from assets/hydrated.905f3857.js rename to assets/hydrated.406495cb.js index f867284..44447f5 100644 --- a/assets/hydrated.905f3857.js +++ b/assets/hydrated.406495cb.js @@ -1 +1 @@ -import{af as r,az as c,cS as h,cR as x,cU as m}from"./index.d94abe07.js";const Z={convertToGEGeometry:g,exportPoint:p,exportPolygon:u,exportPolyline:f,exportMultipoint:l,exportExtent:M};function g(t,e){if(e==null)return null;let a="cache"in e?e.cache._geVersion:void 0;return a==null&&(a=t.convertJSONToGeometry(e),"cache"in e&&(e.cache._geVersion=a)),a}function p(t,e,a){const o=t.hasZ(e),i=t.hasM(e),s=new r({x:t.getPointX(e),y:t.getPointY(e),spatialReference:a});return o&&(s.z=t.getPointZ(e)),i&&(s.m=t.getPointM(e)),s.cache._geVersion=e,s}function u(t,e,a){const o=new c({rings:t.exportPaths(e),hasZ:t.hasZ(e),hasM:t.hasM(e),spatialReference:a});return o.cache._geVersion=e,o}function f(t,e,a){const o=new h({paths:t.exportPaths(e),hasZ:t.hasZ(e),hasM:t.hasM(e),spatialReference:a});return o.cache._geVersion=e,o}function l(t,e,a){const o=new x({hasZ:t.hasZ(e),hasM:t.hasM(e),points:t.exportPoints(e),spatialReference:a});return o.cache._geVersion=e,o}function M(t,e,a){const o=t.hasZ(e),i=t.hasM(e),s=new m({xmin:t.getXMin(e),ymin:t.getYMin(e),xmax:t.getXMax(e),ymax:t.getYMax(e),spatialReference:a});if(o){const n=t.getZExtent(e);s.zmin=n.vmin,s.zmax=n.vmax}if(i){const n=t.getMExtent(e);s.mmin=n.vmin,s.mmax=n.vmax}return s.cache._geVersion=e,s}export{Z as hydratedAdapter}; +import{af as r,az as c,cS as h,cR as x,cU as m}from"./index.221827cd.js";const Z={convertToGEGeometry:g,exportPoint:p,exportPolygon:u,exportPolyline:f,exportMultipoint:l,exportExtent:M};function g(t,e){if(e==null)return null;let a="cache"in e?e.cache._geVersion:void 0;return a==null&&(a=t.convertJSONToGeometry(e),"cache"in e&&(e.cache._geVersion=a)),a}function p(t,e,a){const o=t.hasZ(e),i=t.hasM(e),s=new r({x:t.getPointX(e),y:t.getPointY(e),spatialReference:a});return o&&(s.z=t.getPointZ(e)),i&&(s.m=t.getPointM(e)),s.cache._geVersion=e,s}function u(t,e,a){const o=new c({rings:t.exportPaths(e),hasZ:t.hasZ(e),hasM:t.hasM(e),spatialReference:a});return o.cache._geVersion=e,o}function f(t,e,a){const o=new h({paths:t.exportPaths(e),hasZ:t.hasZ(e),hasM:t.hasM(e),spatialReference:a});return o.cache._geVersion=e,o}function l(t,e,a){const o=new x({hasZ:t.hasZ(e),hasM:t.hasM(e),points:t.exportPoints(e),spatialReference:a});return o.cache._geVersion=e,o}function M(t,e,a){const o=t.hasZ(e),i=t.hasM(e),s=new m({xmin:t.getXMin(e),ymin:t.getYMin(e),xmax:t.getXMax(e),ymax:t.getYMax(e),spatialReference:a});if(o){const n=t.getZExtent(e);s.zmin=n.vmin,s.zmax=n.vmax}if(i){const n=t.getMExtent(e);s.mmin=n.vmin,s.mmax=n.vmax}return s.cache._geVersion=e,s}export{Z as hydratedAdapter}; diff --git a/assets/icon.8e346cc3.js b/assets/icon.781cca93.js similarity index 98% rename from assets/icon.8e346cc3.js rename to assets/icon.781cca93.js index 4e24518..2f2c39e 100644 --- a/assets/icon.8e346cc3.js +++ b/assets/icon.781cca93.js @@ -1,4 +1,4 @@ -import{p as d,H as p,g as b,h as r,t as v,a as g,B as y,b as w}from"./index.d94abe07.js";import{c as D}from"./observers.11f150c2.js";/*! +import{p as d,H as p,g as b,h as r,t as v,a as g,B as y,b as w}from"./index.221827cd.js";import{c as D}from"./observers.440ad120.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.0-beta.97 diff --git a/assets/imageUtils.b93c1581.js b/assets/imageUtils.215a62b1.js similarity index 89% rename from assets/imageUtils.b93c1581.js rename to assets/imageUtils.215a62b1.js index e29a274..6e63a9e 100644 --- a/assets/imageUtils.b93c1581.js +++ b/assets/imageUtils.215a62b1.js @@ -1 +1 @@ -import{a6 as I,a8 as L}from"./index.d94abe07.js";import{n as M}from"./BitmapTileContainer.3a622161.js";const $=t=>{let e=class extends t{attach(){this.view.timeline.record(`${this.layer.title} (BitmapTileLayer) Attach`),this._bitmapView=new M(this._tileInfoView),this.container.addChild(this._bitmapView)}detach(){var i;this.container.removeChild(this._bitmapView),(i=this._bitmapView)==null||i.removeAllChildren()}};return e=I([L("esri.views.2d.layers.BitmapTileLayerView2D")],e),e};function C(t){return t instanceof HTMLImageElement?t.naturalWidth:t.width}function T(t){return t instanceof HTMLImageElement?t.naturalHeight:t.height}function b(t,e,i,o){if(i.level===o.level)return e;const n=t.tileInfo.size,r=t.getTileResolution(i.level),l=t.getTileResolution(o.level);let a=t.getLODInfoAt(o.level);const m=a.getXForColumn(o.col),d=a.getYForRow(o.row);a=t.getLODInfoAt(i.level);const u=a.getXForColumn(i.col),w=a.getYForRow(i.row),s=C(e)/n[0],h=T(e)/n[1],g=Math.round(s*((m-u)/r)),f=Math.round(h*(-(d-w)/r)),v=Math.round(s*n[0]*(l/r)),p=Math.round(h*n[1]*(l/r)),c=V(n);return c.getContext("2d").drawImage(e,g,f,v,p,0,0,n[0],n[1]),c}function V(t){const e=document.createElement("canvas");return[e.width,e.height]=t,e}export{b as n,V as o,$ as t}; +import{a6 as I,a8 as L}from"./index.221827cd.js";import{n as M}from"./BitmapTileContainer.f5b20598.js";const $=t=>{let e=class extends t{attach(){this.view.timeline.record(`${this.layer.title} (BitmapTileLayer) Attach`),this._bitmapView=new M(this._tileInfoView),this.container.addChild(this._bitmapView)}detach(){var i;this.container.removeChild(this._bitmapView),(i=this._bitmapView)==null||i.removeAllChildren()}};return e=I([L("esri.views.2d.layers.BitmapTileLayerView2D")],e),e};function C(t){return t instanceof HTMLImageElement?t.naturalWidth:t.width}function T(t){return t instanceof HTMLImageElement?t.naturalHeight:t.height}function b(t,e,i,o){if(i.level===o.level)return e;const n=t.tileInfo.size,r=t.getTileResolution(i.level),l=t.getTileResolution(o.level);let a=t.getLODInfoAt(o.level);const m=a.getXForColumn(o.col),d=a.getYForRow(o.row);a=t.getLODInfoAt(i.level);const u=a.getXForColumn(i.col),w=a.getYForRow(i.row),s=C(e)/n[0],h=T(e)/n[1],g=Math.round(s*((m-u)/r)),f=Math.round(h*(-(d-w)/r)),v=Math.round(s*n[0]*(l/r)),p=Math.round(h*n[1]*(l/r)),c=V(n);return c.getContext("2d").drawImage(e,g,f,v,p,0,0,n[0],n[1]),c}function V(t){const e=document.createElement("canvas");return[e.width,e.height]=t,e}export{b as n,V as o,$ as t}; diff --git a/assets/imageutils.9dde1c66.js b/assets/imageutils.5e4d6270.js similarity index 95% rename from assets/imageutils.9dde1c66.js rename to assets/imageutils.5e4d6270.js index 82a7e91..d4bc0d7 100644 --- a/assets/imageutils.9dde1c66.js +++ b/assets/imageutils.5e4d6270.js @@ -1 +1 @@ -import{c,j as s,n as i,cu as g,cv as m}from"./index.d94abe07.js";function p(n){const t=r(n);return c(t)?t.toDataURL():""}async function d(n){const t=r(n);if(s(t))throw new i("imageToArrayBuffer","Unsupported image type");const e=await f(n),a=await new Promise(o=>t.toBlob(o,e));if(!a)throw new i("imageToArrayBuffer","Failed to encode image");return{data:await a.arrayBuffer(),type:e}}async function f(n){if(!(n instanceof HTMLImageElement))return"image/png";const t=n.src;if(g(t)){const e=m(t);return(e==null?void 0:e.mediaType)==="image/jpeg"?e.mediaType:"image/png"}return/\.png$/i.test(t)?"image/png":/\.(jpg|jpeg)$/i.test(t)?"image/jpeg":"image/png"}function r(n){if(n instanceof HTMLCanvasElement)return n;if(n instanceof HTMLVideoElement)return null;const t=document.createElement("canvas");t.width=n.width,t.height=n.height;const e=t.getContext("2d");return n instanceof HTMLImageElement?e.drawImage(n,0,0,n.width,n.height):n instanceof ImageData&&e.putImageData(n,0,0),t}function h(n){const t=[],e=new Uint8Array(n);for(let a=0;at.toBlob(o,e));if(!a)throw new i("imageToArrayBuffer","Failed to encode image");return{data:await a.arrayBuffer(),type:e}}async function f(n){if(!(n instanceof HTMLImageElement))return"image/png";const t=n.src;if(g(t)){const e=m(t);return(e==null?void 0:e.mediaType)==="image/jpeg"?e.mediaType:"image/png"}return/\.png$/i.test(t)?"image/png":/\.(jpg|jpeg)$/i.test(t)?"image/jpeg":"image/png"}function r(n){if(n instanceof HTMLCanvasElement)return n;if(n instanceof HTMLVideoElement)return null;const t=document.createElement("canvas");t.width=n.width,t.height=n.height;const e=t.getContext("2d");return n instanceof HTMLImageElement?e.drawImage(n,0,0,n.width,n.height):n instanceof ImageData&&e.putImageData(n,0,0),t}function h(n){const t=[],e=new Uint8Array(n);for(let a=0;at in e?D6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var D=(e,t,i)=>(N6(e,typeof t!="symbol"?t+"":t,i),i);const j6=function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))s(r);new MutationObserver(r=>{for(const n of r)if(n.type==="childList")for(const o of n.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&s(o)}).observe(document,{childList:!0,subtree:!0});function i(r){const n={};return r.integrity&&(n.integrity=r.integrity),r.referrerpolicy&&(n.referrerPolicy=r.referrerpolicy),r.crossorigin==="use-credentials"?n.credentials="include":r.crossorigin==="anonymous"?n.credentials="omit":n.credentials="same-origin",n}function s(r){if(r.ep)return;r.ep=!0;const n=i(r);fetch(r.href,n)}};j6();const V6="modulepreload",FI={},z6="/",z=function(t,i){return!i||i.length===0?t():Promise.all(i.map(s=>{if(s=`${z6}${s}`,s in FI)return;FI[s]=!0;const r=s.endsWith(".css"),n=r?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${s}"]${n}`))return;const o=document.createElement("link");if(o.rel=r?"stylesheet":V6,r||(o.as="script",o.crossOrigin=""),o.href=s,document.head.appendChild(o),r)return new Promise((a,l)=>{o.addEventListener("load",a),o.addEventListener("error",()=>l(new Error(`Unable to preload CSS for ${s}`)))})})).then(()=>t())};function c(e,t,i,s){var r,n=arguments.length,o=n<3?t:s===null?s=Object.getOwnPropertyDescriptor(t,i):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(e,t,i,s);else for(var a=e.length-1;a>=0;a--)(r=e[a])&&(o=(n<3?r(o):n>3?r(t,i,o):r(t,i))||o);return n>3&&o&&Object.defineProperty(t,i,o),o}let Na;function V(e){return typeof Na[e]=="function"?Na[e]=Na[e](globalThis):Na[e]}var h3,d3,p3,f3;Na=((h3=globalThis.dojoConfig)==null?void 0:h3.has)||((d3=globalThis.esriConfig)==null?void 0:d3.has)?{...(p3=globalThis.dojoConfig)==null?void 0:p3.has,...(f3=globalThis.esriConfig)==null?void 0:f3.has}:{},V.add=(e,t,i,s)=>((s||Na[e]===void 0)&&(Na[e]=t),i&&V(e)),V.cache=Na,V.add("esri-deprecation-warnings",!0),(()=>{var t;V.add("host-webworker",globalThis.WorkerGlobalScope!==void 0&&self instanceof globalThis.WorkerGlobalScope);const e=typeof window!="undefined"&&typeof location!="undefined"&&typeof document!="undefined"&&window.location===location&&window.document===document;if(V.add("host-browser",e),V.add("host-node",typeof globalThis.process=="object"&&((t=globalThis.process.versions)==null?void 0:t.node)&&globalThis.process.versions.v8),V.add("dom",e),V("host-browser")){const i=navigator,s=i.userAgent,r=i.appVersion,n=parseFloat(r);if(V.add("wp",parseFloat(s.split("Windows Phone")[1])||void 0),V.add("msapp",parseFloat(s.split("MSAppHost/")[1])||void 0),V.add("khtml",r.includes("Konqueror")?n:void 0),V.add("edge",parseFloat(s.split("Edge/")[1])||void 0),V.add("opr",parseFloat(s.split("OPR/")[1])||void 0),V.add("webkit",!V("wp")&&!V("edge")&&parseFloat(s.split("WebKit/")[1])||void 0),V.add("chrome",!V("edge")&&!V("opr")&&parseFloat(s.split("Chrome/")[1])||void 0),V.add("android",!V("wp")&&parseFloat(s.split("Android ")[1])||void 0),V.add("safari",!r.includes("Safari")||V("wp")||V("chrome")||V("android")||V("edge")||V("opr")?void 0:parseFloat(r.split("Version/")[1])),V.add("mac",r.includes("Macintosh")),!V("wp")&&s.match(/(iPhone|iPod|iPad)/)){const o=RegExp.$1.replace(/P/,"p"),a=s.match(/OS ([\d_]+)/)?RegExp.$1:"1",l=parseFloat(a.replace(/_/,".").replace(/_/g,""));V.add(o,l),V.add("ios",l)}V.add("trident",parseFloat(r.split("Trident/")[1])||void 0),V("webkit")||(!s.includes("Gecko")||V("wp")||V("khtml")||V("trident")||V("edge")||V.add("mozilla",n),V("mozilla")&&V.add("ff",parseFloat(s.split("Firefox/")[1]||s.split("Minefield/")[1])||void 0))}})(),(()=>{if(globalThis.navigator){const e=navigator.userAgent,t=/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini|IEMobile/i.test(e),i=/iPhone/i.test(e);t&&V.add("esri-mobile",t),i&&V.add("esri-iPhone",i),V.add("esri-geolocation",!!navigator.geolocation)}V.add("esri-canvas-svg-support",!V("trident")),V.add("esri-wasm","WebAssembly"in globalThis),V.add("esri-shared-array-buffer",()=>{const e="SharedArrayBuffer"in globalThis,t=globalThis.crossOriginIsolated===!1;return e&&!t}),V.add("wasm-simd",()=>{const e=[0,97,115,109,1,0,0,0,1,5,1,96,0,1,123,3,2,1,0,10,10,1,8,0,65,0,253,15,253,98,11];return WebAssembly.validate(new Uint8Array(e))}),V.add("esri-atomics","Atomics"in globalThis),V.add("esri-workers","Worker"in globalThis),V.add("web-feat:cache","caches"in globalThis),V.add("esri-workers-arraybuffer-transfer",!V("safari")||Number(V("safari"))>=12),V.add("featurelayer-simplify-thresholds",[.5,.5,.5,.5]),V.add("featurelayer-simplify-payload-size-factors",[1,1,4]),V.add("featurelayer-snapshot-enabled",!0),V.add("featurelayer-snapshot-point-min-threshold",8e4),V.add("featurelayer-snapshot-point-max-threshold",4e5),V.add("featurelayer-snapshot-point-coverage",.1),V.add("featurelayer-advanced-symbols",!1),V.add("featurelayer-pbf",!0),V.add("featurelayer-pbf-statistics",!1),V.add("feature-layers-workers",!0),V.add("feature-polyline-generalization-factor",1),V.add("mapview-transitions-duration",200),V.add("mapview-srswitch-adjust-rotation-scale-threshold",24e6),V.add("mapserver-pbf-enabled",!1),V.add("mapimagelayer-popup-identify-max-tolerance",20),V.add("heatmap-allow-raster-fallback",!0),V.add("heatmap-force-raster",!1),V("host-webworker")||V("host-browser")&&(V.add("esri-csp-restrictions",()=>{try{new Function}catch{return!0}return!1}),V.add("esri-image-decode",()=>{if("decode"in new Image){const e=new Image;return e.src='data:image/svg+xml;charset=UTF-8,',void e.decode().then(()=>{V.add("esri-image-decode",!0,!0,!0)}).catch(()=>{V.add("esri-image-decode",!1,!0,!0)})}return!1}),V.add("esri-url-encodes-apostrophe",()=>{const e=window.document.createElement("a");return e.href="?'",e.href.includes("?%27")}))})();const B6=null;function M(e){return e!=null}function N(e){return e==null}function ja(e,t){return M(e)?t(e):B6}function X0e(e){return e}function Hs(e,t){return _3(e,t),e}function _3(e,t){if(N(e))throw new Error(t!=null?t:"value is None")}function FM(e,t){return M(e)?e:typeof t=="function"?t():t}function Z0e(e,t){return M(e)?e:t}function $t(e){return M(e)&&e.destroy(),null}function Q0e(e){return M(e)&&e.dispose(),null}function Bt(e){return M(e)&&e.remove(),null}function k0(e){return M(e)&&e.abort(),null}function K0e(e){return M(e)&&e.release(),null}function U6(e,t,i){return M(e)&&M(t)?M(i)?i(e,t):e.equals(t):e===t}function q6(e){return null}function eve(e,t){const i=new Array;for(const s of e)i.push(sp(s,null,t));return i}function tve(e,t){for(const i of e)ja(i,t)}function sp(e,t,i){return M(e)?i(e):t}function ive(e){return e.filter(t=>M(t))}function w3(e,...t){let i=e;for(let s=0;sr.findIndex(t.bind(null,i))===s):e.filter((i,s,r)=>r.indexOf(i)===s)}function Xv(e,t,i){if(N(e)&&N(t))return!0;if(N(e)||N(t)||e.length!==t.length)return!1;if(i){for(let s=0;s!e.some(o=>i(o,n))),r=e.filter(n=>!t.some(o=>i(o,n)))):(s=t.filter(n=>!e.includes(n)),r=e.filter(n=>!t.includes(n))),{added:s,removed:r}}function ove(e){return e&&typeof e.length=="number"}const W6=!!Array.prototype.fill;function ave(e,t){if(W6)return new Array(e).fill(t);const i=new Array(e);for(let s=0;s{const n=h1(r);return r!=null&&n==null&&(i=!1),n});return i?s:null}if($3(e))return e.clone();if(!I3(e)){const i=new(Object.getPrototypeOf(e)).constructor;for(const s of Object.getOwnPropertyNames(e)){const r=e[s],n=h1(r);if(r!=null&&n==null)return null;i[s]=n}return i}return null}function $3(e){return typeof e.clone=="function"}function T3(e){return typeof e.map=="function"&&typeof e.forEach=="function"}function I3(e){return typeof e.notifyChange=="function"&&typeof e.watch=="function"}function DI(e){if(Object.prototype.toString.call(e)!=="[object Object]")return!1;const t=Object.getPrototypeOf(e);return t===null||t===Object.prototype}function E3(e){if(Z6(e)||Q6(e)||K6(e)||e9(e)||t9(e)||i9(e)||s9(e)||r9(e)||n9(e))return X6(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof ArrayBuffer)return e.slice(0,e.byteLength);if(e instanceof Map){const t=new Map;for(const[i,s]of e)t.set(i,R(s));return t}if(e instanceof Set){const t=new Set;for(const i of e)t.add(R(i));return t}return null}function DM(e,t){return e===t||typeof e=="number"&&isNaN(e)&&typeof t=="number"&&isNaN(t)||typeof(e||{}).getTime=="function"&&typeof(t||{}).getTime=="function"&&e.getTime()===t.getTime()||!1}function o9(e,t){return e===t||(e==null||typeof e=="string"?e===t:typeof e=="number"?e===t||typeof t=="number"&&isNaN(e)&&isNaN(t):e instanceof Date?t instanceof Date&&e.getTime()===t.getTime():Array.isArray(e)?Array.isArray(t)&&Xv(e,t):e instanceof Set?t instanceof Set&&l9(e,t):e instanceof Map?t instanceof Map&&c9(e,t):!!DI(e)&&DI(t)&&a9(e,t))}function a9(e,t){if(e===null||t===null)return!1;const i=Object.keys(e);if(t===null||Object.keys(t).length!==i.length)return!1;for(const s of i)if(e[s]!==t[s]||!Object.prototype.hasOwnProperty.call(t,s))return!1;return!0}function l9(e,t){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}function c9(e,t){if(e.size!==t.size)return!1;for(const[i,s]of e){const r=t.get(i);if(r!==s||r===void 0&&!t.has(i))return!1}return!0}function k3(e,t,i=!1){return P3(e,t,i)}function rd(e,t){if(t!=null)return t[e]||C3(e.split("."),!1,t)}function Ei(e,t,i){const s=e.split("."),r=s.pop(),n=C3(s,!0,i);n&&r&&(n[r]=t)}function C3(e,t,i){let s=i;for(const r of e){if(s==null)return;if(!(r in s)){if(!t)return;s[r]={}}s=s[r]}return s}function P3(e,t,i){return t?Object.keys(t).reduce((s,r)=>{let n=s[r],o=t[r];return n===o?s:n===void 0?(s[r]=R(o),s):(Array.isArray(o)||Array.isArray(s)?(n=n?Array.isArray(n)?s[r]=n.concat():s[r]=[n]:s[r]=[],o&&(Array.isArray(o)||(o=[o]),i?o.forEach(a=>{n.includes(a)||n.push(a)}):s[r]=o.concat())):o&&typeof o=="object"?s[r]=P3(n,o,i):s.hasOwnProperty(r)&&!t.hasOwnProperty(r)||(s[r]=o),s)},e||{}):e}var m3;const je={analysisTheme:{accentColor:[255,128,0],textColor:"white"},apiKey:void 0,applicationUrl:(m3=globalThis.location)==null?void 0:m3.href,assetsPath:"",fontsUrl:"https://static.arcgis.com/fonts",geometryServiceUrl:"https://utility.arcgisonline.com/arcgis/rest/services/Geometry/GeometryServer",geoRSSServiceUrl:"https://utility.arcgis.com/sharing/rss",kmlServiceUrl:"https://utility.arcgis.com/sharing/kml",portalUrl:"https://www.arcgis.com",routeServiceUrl:"https://route-api.arcgis.com/arcgis/rest/services/World/Route/NAServer/Route_World",workers:{loaderConfig:{has:{},paths:{},map:{},packages:[]}},request:{crossOriginNoCorsDomains:null,httpsDomains:["arcgis.com","arcgisonline.com","esrikr.com","premiumservices.blackbridge.com","esripremium.accuweather.com","gbm.digitalglobe.com","firstlook.digitalglobe.com","msi.digitalglobe.com"],interceptors:[],maxUrlLength:2e3,priority:"high",proxyRules:[],proxyUrl:null,timeout:6e4,trustedServers:[],useIdentity:!0},log:{interceptors:[],level:null}};if(globalThis.esriConfig&&(k3(je,globalThis.esriConfig,!0),delete je.has),!je.assetsPath){{const e="4.25.5";je.assetsPath=`https://js.arcgis.com/${e.slice(0,-2)}/@arcgis/core/assets`}je.defaultAssetsPath=je.assetsPath}const u9=/\{([^\}]+)\}/g;function NI(e){return e!=null?e:""}function In(e,t){return e.replace(u9,typeof t=="object"?(i,s)=>NI(rd(s,t)):(i,s)=>NI(t(s)))}function hve(e,t){return e.replace(/([\.$?*|{}\(\)\[\]\\\/\+\-^])/g,i=>t&&t.includes(i)?i:`\\${i}`)}function NM(e){let t=0;for(let i=0;it._loggedMessages.warn.clear()}}static get testSingleton(){return{resetLoggers(t={}){const i=q._loggers;return q._loggers=t,i},set throttlingDisabled(t){q._throttlingDisabled=t}}}static getLogger(t){let i=q._loggers[t];return i||(i=new q({module:t})),i}_log(t,i,...s){if(!!this._matchLevel(t)){if(i!=="always"&&!q._throttlingDisabled){const r=this._argsToKey(s),n=this._loggedMessages[t].get(r);if(i==="once"&&n!=null||i==="oncePerTick"&&n&&n>=q._tickCounter)return;this._loggedMessages[t].set(r,q._tickCounter),q._scheduleTickCounterIncrement()}for(const r of je.log.interceptors)if(r(t,this.module,...s))return;this._inheritedWriter()(t,this.module,...s)}}_parentWithMember(t,i){let s=this;for(;M(s);){const r=s[t];if(M(r))return r;s=s.parent}return i}_inheritedWriter(){return this._parentWithMember("writer",this._consoleWriter)}_consoleWriter(t,i,...s){console[t](`[${i}]`,...s)}_matchLevel(t){const i=je.log.level?je.log.level:"warn";return jI[this._parentWithMember("level",i)]<=jI[t]}_argsToKey(...t){const i=(s,r)=>typeof r!="object"||Array.isArray(r)?r:"[Object]";return NM(JSON.stringify(t,i))}static _scheduleTickCounterIncrement(){q._tickCounterScheduled||(q._tickCounterScheduled=!0,Promise.resolve().then(()=>{q._tickCounter++,q._tickCounterScheduled=!1}))}}q._loggers={},q._tickCounter=0,q._tickCounterScheduled=!1,q._throttlingDisabled=!1;function Zv(e,t){for(const[i,s]of e)if(t(s,i))return!0;return!1}function A3(e,t,i){const s=e.get(t);if(s!==void 0)return s;const r=i();return e.set(t,r),r}const _h=q.getLogger("esri.core.accessorSupport.ensureTypes");function h9(e){return e==null?e:new Date(e)}function d9(e){return e==null?e:!!e}function Mm(e){return e==null?e:e.toString()}function Ys(e){return e==null?e:(e=parseFloat(e),isNaN(e)?0:e)}function jM(e){return e==null?e:Math.round(parseFloat(e))}function O3(e){return e&&e.constructor&&e.constructor.__accessorMetadata__!==void 0}function C0(e,t){return t!=null&&e&&!(t instanceof e)}function R3(e){return e&&"isCollection"in e}function VI(e){return e&&e.Type?typeof e.Type=="function"?e.Type:e.Type.base:null}function p9(e,t){if(!t||!t.constructor||!R3(t.constructor))return d1(e,t)?t:new e(t);const i=VI(e.prototype.itemType),s=VI(t.constructor.prototype.itemType);return i?s?i===s?t:i.prototype.isPrototypeOf(s.prototype)?new e(t):(d1(e,t),t):new e(t):t}function d1(e,t){return!!O3(t)&&(_h.error("Accessor#set","Assigning an instance of '"+(t.declaredClass||"unknown")+"' which is not a subclass of '"+Qv(e)+"'"),!0)}function VM(e,t){return t==null?t:R3(e)?p9(e,t):C0(e,t)?d1(e,t)?t:new e(t):t}function Qv(e){return e&&e.prototype&&e.prototype.declaredClass||"unknown"}const f9=new WeakMap;function m9(e){switch(e){case Number:return Ys;case Ge:return jM;case Boolean:return d9;case String:return Mm;case Date:return h9;default:return A3(f9,e,()=>VM.bind(null,e))}}function Dt(e,t){const i=m9(e);return arguments.length===1?i:i(t)}function Lf(e,t,i){return arguments.length===1?Lf.bind(null,e):t&&(Array.isArray(t)?t.map(s=>e(s,i)):[e(t,i)])}function y9(e,t){return arguments.length===1?Lf(Dt.bind(null,e)):Lf(Dt.bind(null,e),t)}function L3(e,t,i){return t!==0&&Array.isArray(i)?i.map(s=>L3(e,t-1,s)):e(i)}function P0(e,t,i){if(arguments.length===2)return P0.bind(null,e,t);if(!i)return i;let s=t,r=i=L3(e,t,i);for(;s>0&&Array.isArray(r);)s--,r=r[0];if(r!==void 0)for(let n=0;n{const i=typeof t;return!(i==="string"||i==="number"||i==="function"&&e.length>1)})}function p1(e,t){if(arguments.length===2)return p1(e).call(null,t);const i=new Set,s=e.filter(a=>typeof a!="function"),r=e.filter(a=>typeof a=="function");for(const a of e)typeof a!="string"&&typeof a!="number"||i.add(a);let n=null,o=null;return(a,l)=>{if(a==null)return a;const u=typeof a,d=u==="string"||u==="number";return d&&(i.has(a)||r.some(f=>u==="string"&&f===String||u==="number"&&f===Number))||u==="object"&&r.some(f=>!C0(a,f))?a:(d&&s.length?(n||(n=s.map(f=>typeof f=="string"?`'${f}'`:`${f}`).join(", ")),_h.error("Accessor#set",`'${a}' is not a valid value for this property, only the following values are valid: ${n}`)):typeof a=="object"&&r.length?(o||(o=r.map(f=>Qv(f)).join(", ")),_h.error("Accessor#set",`'${a}' is not a valid value for this property, value must be one of ${o}`)):_h.error("Accessor#set",`'${a}' is not a valid value for this property`),l&&(l.valid=!1),null)}}function En(e,t){if(arguments.length===2)return En(e).call(null,t);const i={},s=[],r=[];for(const l in e.typeMap){const u=e.typeMap[l];i[l]=Dt(u),s.push(Qv(u)),r.push(l)}const n=()=>`'${s.join("', '")}'`,o=()=>`'${r.join("', '")}'`,a=typeof e.key=="string"?l=>l[e.key]:e.key;return l=>{if(e.base&&!C0(e.base,l)||l==null)return l;const u=a(l)||e.defaultKeyValue,d=i[u];if(!d)return _h.error("Accessor#set",`Invalid property value, value needs to be one of ${n()}, or a plain object that can autocast (having .type = ${o()})`),null;if(!C0(e.typeMap[u],l))return l;if(typeof e.key=="string"&&!O3(l)){const f={};for(const m in l)m!==e.key&&(f[m]=l[m]);return d(f)}return d(l)}}class Ge{}const pve={native:e=>({type:"native",value:e}),array:e=>({type:"array",value:e}),oneOf:e=>({type:"one-of",values:e})};function v9(e){if(!e||!("type"in e))return!1;switch(e.type){case"native":case"array":case"one-of":return!0}return!1}function D3(e){switch(e.type){case"native":return Dt(e.value);case"array":return Lf(D3(e.value));case"one-of":return b9(e);default:return null}}function b9(e){let t=null;return(i,s)=>m1(i,e)?i:(t==null&&(t=f1(e)),_h.error("Accessor#set",`Invalid property value, value needs to be of type ${t}`),s&&(s.valid=!1),null)}function f1(e){switch(e.type){case"native":switch(e.value){case Number:return"number";case String:return"string";case Boolean:return"boolean";case Ge:return"integer";case Date:return"date";default:return Qv(e.value)}case"array":return`array of ${f1(e.value)}`;case"one-of":{const t=e.values.map(i=>f1(i));return`one of ${t.slice(0,t.length-1)} or ${t[t.length-1]}`}}return"unknown"}function m1(e,t){if(e==null)return!0;switch(t.type){case"native":switch(t.value){case Number:case Ge:return typeof e=="number";case Boolean:return typeof e=="boolean";case String:return typeof e=="string"}return e instanceof t.value;case"array":return!!Array.isArray(e)&&!e.some(i=>!m1(i,t.value));case"one-of":return t.values.some(i=>m1(e,i))}}function Kv(e){return nd(()=>e.forEach(t=>M(t)&&t.remove()))}function nd(e){return{remove:()=>{e&&(e(),e=void 0)}}}function ki(e){return e?e.__accessor__?e.__accessor__:e.propertyInvalidated?e:null:null}function _9(e,t){return e!=null&&e.metadatas&&e.metadatas[t]!=null}function dg(e,t,i){return i?A0(e,t,{policy:i,path:""}):A0(e,t,null)}function A0(e,t,i){return t?Object.keys(t).reduce((s,r)=>{let n=null,o="merge";if(i&&(n=i.path?`${i.path}.${r}`:r,o=i.policy(n)),o==="replace")return s[r]=t[r],s;if(s[r]===void 0)return s[r]=R(t[r]),s;let a=s[r],l=t[r];if(a===l)return s;if(Array.isArray(l)||Array.isArray(s))a=a?Array.isArray(a)?s[r]=a.concat():s[r]=[a]:s[r]=[],l&&(Array.isArray(l)||(l=[l]),l.forEach(u=>{a.includes(u)||a.push(u)}));else if(l&&typeof l=="object")if(i){const u=i.path;i.path=n,s[r]=A0(a,l,i),i.path=u}else s[r]=A0(a,l,null);else s.hasOwnProperty(r)&&!t.hasOwnProperty(r)||(s[r]=l);return s},e||{}):e}function N3(e){return Array.isArray(e)?e:e.split(".")}function zI(e){return e.includes(",")?e.split(",").map(t=>t.trim()):[e.trim()]}function w9(e){if(Array.isArray(e)){const t=[];for(const i of e)t.push(...zI(i));return t}return zI(e)}function j3(e,t,i,s){const r=w9(t);if(r.length!==1){const n=r.map(o=>s(e,o,i));return Kv(n)}return s(e,r[0],i)}function V3(e){let t=!1;return()=>{t||(t=!0,e())}}function z3(e,t){const i=e[e.length-1]==="?"?e.slice(0,-1):e;if(t.getItemAt!=null||Array.isArray(t)){const r=parseInt(i,10);if(!isNaN(r))return Array.isArray(t)?t[r]:t.getItemAt(r)}const s=ki(t);return _9(s,i)?s.get(i):t[i]}function B3(e,t,i){if(e==null)return e;const s=z3(t[i],e);return!s&&i{if(s==="")return"$";const r=rd(s,t),n=r!=null?r:"";if(n===void 0)throw new Error(`could not find key "${s}" in template`);return n.toString()})}class tb{constructor(t,i,s){var r;this.name=t,this.details=s,this instanceof tb&&(this.message=(r=i&&T9(i,s))!=null?r:"")}toString(){return"["+this.name+"]: "+this.message}}class L extends tb{constructor(t,i,s){if(super(t,i,s),!(this instanceof L))return new L(t,i,s)}toJSON(){if(this.details!=null)try{return{name:this.name,message:this.message,details:JSON.parse(JSON.stringify(this.details,(t,i)=>{if(i&&typeof i=="object"&&typeof i.toJSON=="function")return i;try{return R(i)}catch{return"[object]"}}))}}catch(t){throw q.getLogger("esri.core.Error").error(t),t}return{name:this.name,message:this.message,details:this.details}}static fromJSON(t){return new L(t.name,t.message,t.details)}}L.prototype.type="error";function R0(e,t,i){if(e&&t)if(typeof t=="object")for(const s of Object.getOwnPropertyNames(t))R0(e,s,t[s]);else{if(t.includes(".")){const r=t.split("."),n=r.splice(r.length-1,1)[0];return void R0(O0(e,r),n,i)}const s=e.__accessor__;s!=null&&I9(t,s),e[t]=i}}function I9(e,t){if(V("esri-unknown-property-errors")&&!E9(e,t))throw new L("set:unknown-property",k9(e,t))}function E9(e,t){return t.metadatas[e]!=null}function k9(e,t){return"setting unknown property '"+e+"' on instance of "+t.host.declaredClass}function h(e={}){return(t,i)=>{if(t===Function.prototype)throw new Error(`Inappropriate use of @property() on a static field: ${t.name}.${i}. Accessor does not support static properties.`);const s=Object.getOwnPropertyDescriptor(t,i),r=eb(t,i);s&&(s.get||s.set?(r.get=s.get||r.get,r.set=s.set||r.set):"value"in s&&("value"in e&&q.getLogger("esri.core.accessorSupport.decorators.property").warn(`@property() will redefine the value of "${i}" on "${t.constructor.name}" already defined in the metadata`,e),r.value=e.value=s.value)),e.readOnly!=null&&(r.readOnly=e.readOnly);const n=e.aliasOf;if(n){const l=typeof n=="string"?n:n.source,u=typeof n=="string"?null:n.overridable===!0;let d;r.dependsOn=[l],r.get=function(){let f=O0(this,l);if(typeof f=="function"){d||(d=l.split(".").slice(0,-1).join("."));const m=O0(this,d);m&&(f=f.bind(m))}return f},r.readOnly||(r.set=u?function(f){this._override(i,f)}:function(f){R0(this,l,f)})}const o=e.type,a=e.types;r.cast||(o?r.cast=C9(o):a&&(Array.isArray(a)?r.cast=Lf(En(a[0])):r.cast=En(a))),S9(r,e),e.range&&(r.cast=P9(r.cast,e.range))}}function U3(e,t,i){const s=eb(e,i);s.json||(s.json={});let r=s.json;return t!==void 0&&(r.origins||(r.origins={}),r.origins[t]||(r.origins[t]={}),r=r.origins[t]),r}function C9(e){let t=0,i=e;if(v9(e))return D3(e);for(;Array.isArray(i)&&i.length===1&&typeof i[0]!="string"&&typeof i[0]!="number";)i=i[0],t++;const s=i;if(F3(s))return t===0?p1(s):P0(p1(s),t);if(t===1)return y9(s);if(t>1)return g9(s,t);const r=e;return r.from?r.from:Dt(r)}function P9(e,t){return i=>{let s=+e(i);return t.step!=null&&(s=Math.round(s/t.step)*t.step),t.min!=null&&(s=Math.max(t.min,s)),t.max!=null&&(s=Math.min(t.max,s)),s}}const A9=Object.prototype.toString;function O9(e){const t="__accessorMetadata__"in e?Dt(e):e;return function(...i){if(i.push(t),typeof i[2]=="number")throw new Error("Using @cast has parameter decorator is not supported since 4.16");return R9.apply(this,i)}}function R9(e,t,i,s){eb(e,t).cast=s}function L9(e){return(t,i)=>{eb(t,e).cast=t[i]}}function Oe(...e){if(e.length!==3||typeof e[1]!="string")return e.length===1&&A9.call(e[0])==="[object Function]"?O9(e[0]):e.length===1&&typeof e[0]=="string"?L9(e[0]):void 0}var _o;(function(e){e[e.INITIALIZING=0]="INITIALIZING",e[e.CONSTRUCTING=1]="CONSTRUCTING",e[e.CONSTRUCTED=2]="CONSTRUCTED"})(_o||(_o={}));var Be;(function(e){e[e.Dirty=1]="Dirty",e[e.Overriden=2]="Overriden",e[e.Computing=4]="Computing",e[e.NonNullable=8]="NonNullable",e[e.HasDefaultValue=16]="HasDefaultValue",e[e.DepTrackingInitialized=32]="DepTrackingInitialized",e[e.AutoTracked=64]="AutoTracked",e[e.ExplicitlyTracking=128]="ExplicitlyTracking"})(Be||(Be={}));const L0={onObservableAccessed:()=>{},onTrackingEnd:()=>{}},rp=[];let of=L0;function _e(e){of.onObservableAccessed(e)}let pg=!1,fg=!1;function Co(e,t,i){if(pg)return zM(e,t,i);q3(e);const s=t.call(i);return G3(),s}function F9(e,t){return Co(L0,e,t)}function zM(e,t,i){const s=pg;pg=!0,q3(e);let r=null;try{r=t.call(i)}catch(n){fg&&q.getLogger("esri.core.accessorSupport.tracking").error(n)}return G3(),pg=s,r}function q3(e){of=e,rp.push(e)}function G3(){const e=rp.length;if(e>1){const t=rp.pop();of=rp[e-2],t.onTrackingEnd()}else if(e===1){const t=rp.pop();of=L0,t.onTrackingEnd()}else of=L0}function W3(e,t){if(t.flags&Be.DepTrackingInitialized)return;const i=fg;fg=!1,t.flags&Be.AutoTracked?zM(t,t.metadata.get,e):H3(e,t),fg=i}const D9=[];function H3(e,t){t.flags&Be.ExplicitlyTracking||(t.flags|=Be.ExplicitlyTracking,zM(t,()=>{const i=t.metadata.dependsOn||D9;for(const s of i)if(typeof s!="string"||s.includes(".")){const r=N3(s);for(let n=0,o=e;n{t[n]=r}),delete t[s]}}}class Bi extends tb{constructor(t,i,s){if(super(t,i,s),!(this instanceof Bi))return new Bi(t,i,s)}}Bi.prototype.type="warning";function Y3(e){return!!e&&e.prototype&&e.prototype.declaredClass&&e.prototype.declaredClass.indexOf("esri.core.Collection")===0}const y1=q.getLogger("esri.core.accessorSupport.extensions.serializableProperty.reader");function GI(e,t,i){var s,r;e&&(!i&&!t.read||((s=t.read)==null?void 0:s.reader)||((r=t.read)==null?void 0:r.enabled)===!1||z9(e)&&Ei("read.reader",dl(e),t))}function dl(e){var i,s,r;const t=(i=e.ndimArray)!=null?i:0;if(t>1)return V9(e);if(t===1)return WI(e);if("type"in e&&X3(e.type)){const n=(r=(s=e.type.prototype)==null?void 0:s.itemType)==null?void 0:r.Type,o=WI(typeof n=="function"?{type:n}:{types:n});return(a,l,u)=>{const d=o(a,l,u);return d&&new e.type(d)}}return BM(e)}function BM(e){return"type"in e?j9(e.type):B9(e.types)}function j9(e){return e.prototype.read?(t,i,s)=>{if(t==null)return t;const r=typeof t;if(r!=="object")return void y1.error(`Expected JSON value of type 'object' to deserialize type '${e.prototype.declaredClass}', but got '${r}'`);const n=new e;return n.read(t,s),n}:e.fromJSON}function J3(e,t,i,s){return s!==0&&Array.isArray(t)?t.map(r=>J3(e,r,i,s-1)):e(t,void 0,i)}function V9(e){var r;const t=BM(e),i=J3.bind(null,t),s=(r=e.ndimArray)!=null?r:0;return(n,o,a)=>{if(n==null)return n;n=i(n,a,s);let l=s,u=n;for(;l>0&&Array.isArray(u);)l--,u=u[0];if(u!==void 0)for(let d=0;d{if(i==null)return i;if(Array.isArray(i)){const o=[];for(const a of i){const l=t(a,void 0,r);l!==void 0&&o.push(l)}return o}const n=t(i,void 0,r);return n!==void 0?[n]:void 0}}function X3(e){if(!Y3(e))return!1;const t=e.prototype.itemType;return!(!t||!t.Type)&&(typeof t.Type=="function"?UM(t.Type):Z3(t.Type))}function z9(e){return"types"in e?Z3(e.types):UM(e.type)}function UM(e){return!Array.isArray(e)&&!!e&&e.prototype&&("read"in e.prototype||"fromJSON"in e||X3(e))}function Z3(e){for(const t in e.typeMap)if(!UM(e.typeMap[t]))return!1;return!0}function B9(e){var s;let t=null;const i=(s=e.errorContext)!=null?s:"type";return(r,n,o)=>{if(r==null)return r;const a=typeof r;if(a!=="object")return void y1.error(`Expected JSON value of type 'object' to deserialize, but got '${a}'`);t||(t=U9(e));const l=e.key;if(typeof l!="string")return;const u=r[l],d=u?t[u]:e.defaultKeyValue?e.typeMap[e.defaultKeyValue]:void 0;if(!d){const m=`Type '${u||"unknown"}' is not supported`;return o&&o.messages&&r&&o.messages.push(new Bi(`${i}:unsupported`,m,{definition:r,context:o})),void y1.error(m)}const f=new d;return f.read(r,o),f}}function U9(e){var i,s;const t={};for(const r in e.typeMap){const n=e.typeMap[r],o=Tm(n.prototype);if(typeof e.key=="function")continue;const a=o.properties[e.key];if(!a)continue;((i=a.json)==null?void 0:i.type)&&Array.isArray(a.json.type)&&a.json.type.length===1&&typeof a.json.type[0]=="string"&&(t[a.json.type[0]]=n);const l=(s=a.json)==null?void 0:s.write;if(!l||!l.writer){t[r]=n;continue}const u=l.target,d=typeof u=="string"?u:e.key,f={};l.writer(r,f,d),f[d]&&(t[f[d]]=n)}return t}function q9(e){if(e.json||(e.json={}),YI(e.json),JI(e.json),HI(e.json),e.json.origins)for(const t in e.json.origins)YI(e.json.origins[t]),JI(e.json.origins[t]),HI(e.json.origins[t]);return!0}function HI(e){e.name&&(e.read&&typeof e.read=="object"?e.read.source===void 0&&(e.read.source=e.name):e.read={source:e.name},e.write&&typeof e.write=="object"?e.write.target===void 0&&(e.write.target=e.name):e.write={target:e.name})}function YI(e){typeof e.read=="boolean"?e.read={enabled:e.read}:typeof e.read=="function"?e.read={enabled:!0,reader:e.read}:e.read&&typeof e.read=="object"&&e.read.enabled===void 0&&(e.read.enabled=!0)}function JI(e){typeof e.write=="boolean"?e.write={enabled:e.write}:typeof e.write=="function"?e.write={enabled:!0,writer:e.write}:e.write&&typeof e.write=="object"&&e.write.enabled===void 0&&(e.write.enabled=!0)}function XI(e,t){var s;if(!t.write||t.write.writer||t.write.enabled===!1&&!t.write.overridePolicy)return;const i=(s=e==null?void 0:e.ndimArray)!=null?s:0;e&&(i===1||"type"in e&&Y3(e.type))?t.write.writer=H9:i>1?t.write.writer=Y9(i):t.types?Array.isArray(t.types)?t.write.writer=W9(t.types[0]):t.write.writer=G9(t.types):t.write.writer=Ff}function G9(e){return(t,i,s,r)=>t?Q3(t,e,r)?Ff(t,i,s,r):void 0:Ff(t,i,s,r)}function Q3(e,t,i){var s,r;for(const n in t.typeMap)if(e instanceof t.typeMap[n])return!0;if(i!=null&&i.messages){const n=(s=t.errorContext)!=null?s:"type",o=`Values of type '${(r=typeof t.key!="function"?e[t.key]:e.declaredClass)!=null?r:"Unknown"}' cannot be written`;i&&i.messages&&e&&i.messages.push(new L(`${n}:unsupported`,o,{definition:e,context:i})),q.getLogger("esri.core.accessorSupport.extensions.serializableProperty.writer").error(o)}return!1}function W9(e){return(t,i,s,r)=>!t||!Array.isArray(t)?Ff(t,i,s,r):Ff(t.filter(n=>Q3(n,e,r)),i,s,r)}function Ff(e,t,i,s){Ei(i,F0(e,s),t)}function F0(e,t){return e&&typeof e.write=="function"?e.write({},t):e&&typeof e.toJSON=="function"?e.toJSON():typeof e=="number"?D0(e):e}function D0(e){return e===-1/0?-Number.MAX_VALUE:e===1/0?Number.MAX_VALUE:isNaN(e)?null:e}function H9(e,t,i,s){let r;e===null?r=null:e&&typeof e.map=="function"?(r=e.map(n=>F0(n,s)),typeof r.toArray=="function"&&(r=r.toArray())):r=[F0(e,s)],Ei(i,r,t)}function K3(e,t,i){return i!==0&&Array.isArray(e)?e.map(s=>K3(s,t,i-1)):F0(e,t)}function Y9(e){return(t,i,s,r)=>{let n;if(t===null)n=null;else{n=K3(t,r,e);let o=e,a=n;for(;o>0&&Array.isArray(a);)o--,a=a[0];if(a!==void 0)for(let l=0;l{t.prototype.declaredClass=e,ez(t);const i=[],s=[];let r=t.prototype;for(;r;)r.hasOwnProperty("initialize")&&!v_.has(r.initialize)&&(v_.add(r.initialize),i.push(r.initialize)),r.hasOwnProperty("destroy")&&!b_.has(r.destroy)&&(b_.add(r.destroy),s.push(r.destroy)),r=Object.getPrototypeOf(r);v_.clear(),b_.clear();class n extends t{constructor(...a){if(super(...a),this.constructor===n&&typeof this.postscript=="function"){if(i.length&&Object.defineProperty(this,"initialize",{enumerable:!1,configurable:!0,value(){for(let l=i.length-1;l>=0;l--)i[l].call(this)}}),s.length){let l=!1;Object.defineProperty(this,"destroy",{enumerable:!1,configurable:!0,value(){if(!l){l=!0;for(let u=0;uthis.fromJSON(s),this.write=(s,r,n)=>{const o=this.toJSON(s);o!==void 0&&Ei(n,o,r)},this.write.isJSONMapWriter=!0}toJSON(t){if(this._apiToJSON.hasOwnProperty(t)){const i=this._apiToJSON[t];return this._options.useNumericKeys?+i:i}return this._options.ignoreUnknown?void 0:t}fromJSON(t){return this._jsonToAPI.hasOwnProperty(t)?this._jsonToAPI[t]:this._options.ignoreUnknown?void 0:t}_invertMap(t){const i={};for(const s in t)i[t[s]]=s;return i}_getKeysSorted(t){const i=[];for(const s in t)i.push(s);return i.sort(),i}}function mi(){return function(e,t){return new Ie(e,{ignoreUnknown:!0,...t})}}let af;var y3,g3,v3;const __=(v3=(y3=globalThis.esriConfig)==null?void 0:y3.locale)!=null?v3:(g3=globalThis.dojoConfig)==null?void 0:g3.locale;function iR(){var e,t;return(t=__!=null?__:(e=globalThis.navigator)==null?void 0:e.language)!=null?t:"en"}function Rr(){return af===void 0&&(af=iR()),af}const lf=[];function tz(e){return lf.push(e),{remove(){lf.splice(lf.indexOf(e),1)}}}const b1=[];function GM(e){return b1.push(e),{remove(){lf.splice(b1.indexOf(e),1)}}}function iz(){const e=iR();af!==e&&(af=e,[...b1].forEach(t=>{t.call(null,e)}),[...lf].forEach(t=>{t.call(null,e)}))}var b3;(b3=globalThis.addEventListener)==null||b3.call(globalThis,"languagechange",iz);const Wr={year:"numeric",month:"numeric",day:"numeric"},Id={year:"numeric",month:"long",day:"numeric"},Ed={year:"numeric",month:"short",day:"numeric"},kd={year:"numeric",month:"long",weekday:"long",day:"numeric"},Ls={hour:"numeric",minute:"numeric"},ar={...Ls,second:"numeric"},WM={"short-date":Wr,"short-date-short-time":{...Wr,...Ls},"short-date-short-time-24":{...Wr,...Ls,hour12:!1},"short-date-long-time":{...Wr,...ar},"short-date-long-time-24":{...Wr,...ar,hour12:!1},"short-date-le":Wr,"short-date-le-short-time":{...Wr,...Ls},"short-date-le-short-time-24":{...Wr,...Ls,hour12:!1},"short-date-le-long-time":{...Wr,...ar},"short-date-le-long-time-24":{...Wr,...ar,hour12:!1},"long-month-day-year":Id,"long-month-day-year-short-time":{...Id,...Ls},"long-month-day-year-short-time-24":{...Id,...Ls,hour12:!1},"long-month-day-year-long-time":{...Id,...ar},"long-month-day-year-long-time-24":{...Id,...ar,hour12:!1},"day-short-month-year":Ed,"day-short-month-year-short-time":{...Ed,...Ls},"day-short-month-year-short-time-24":{...Ed,...Ls,hour12:!1},"day-short-month-year-long-time":{...Ed,...ar},"day-short-month-year-long-time-24":{...Ed,...ar,hour12:!1},"long-date":kd,"long-date-short-time":{...kd,...Ls},"long-date-short-time-24":{...kd,...Ls,hour12:!1},"long-date-long-time":{...kd,...ar},"long-date-long-time-24":{...kd,...ar,hour12:!1},"long-month-year":{month:"long",year:"numeric"},"short-month-year":{month:"short",year:"numeric"},year:{year:"numeric"},"short-time":Ls,"long-time":ar},Df=mi()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"});Df.apiValues;Df.toJSON.bind(Df);Df.fromJSON.bind(Df);const sz={ar:"ar-u-nu-latn-ca-gregory"};let _1=new WeakMap,sR=WM["short-date-short-time"];function rz(e){const t=e||sR;let i=_1.get(t);if(!i){const s=Rr(),r=sz[Rr()]||s;i=new Intl.DateTimeFormat(r,t),_1.set(t,i)}return i}function HM(e){return e?WM[e]:null}function Po(e,t){return rz(t).format(e)}GM(()=>{_1=new WeakMap,sR=WM["short-date-short-time"]});const nz={ar:"ar-u-nu-latn"};let mg=new WeakMap,rR={};function oz(e){const t=e||rR;if(!mg.has(t)){const i=Rr(),s=nz[Rr()]||i;mg.set(t,new Intl.NumberFormat(s,e))}return mg.get(t)}function nR(e={}){const t={};return e.digitSeparator!=null&&(t.useGrouping=e.digitSeparator),e.places!=null&&(t.minimumFractionDigits=t.maximumFractionDigits=e.places),t}function sl(e,t){return e===-0&&(e=0),oz(t).format(e)}GM(()=>{mg=new WeakMap,rR={}});const oR=q.getLogger("esri.intl.substitute");function fn(e,t,i={}){const{format:s={}}=i;return In(e,r=>az(r,t,s))}function az(e,t,i){var l;let s,r;const n=e.indexOf(":");if(n===-1?s=e.trim():(s=e.slice(0,n).trim(),r=e.slice(n+1).trim()),!s)return"";const o=rd(s,t);if(o==null)return"";const a=(l=r?i==null?void 0:i[r]:null)!=null?l:i==null?void 0:i[s];return a?lz(o,a):r?cz(o,r):YM(o)}function lz(e,t){switch(t.type){case"date":return Po(e,t.intlOptions);case"number":return sl(e,t.intlOptions);default:return oR.warn("missing format descriptor for key {key}"),YM(e)}}function cz(e,t){switch(t.toLowerCase()){case"dateformat":return Po(e);case"numberformat":return sl(e);default:return oR.warn(`inline format is unsupported since 4.12: ${t}`),/^(dateformat|datestring)/i.test(t)?Po(e):/^numberformat/i.test(t)?sl(e):YM(e)}}function YM(e){switch(typeof e){case"string":return e;case"number":return sl(e);case"boolean":return""+e;default:return e instanceof Date?Po(e):""}}function uz(e){return{setTimeout:(t,i)=>{const s=e.setTimeout(t,i);return{remove:()=>e.clearTimeout(s)}}}}const Im=uz(globalThis),ZI=new Set;function hz(e,t,i=!1){i&&ZI.has(t)||(i&&ZI.add(t),e.warn(`\u{1F6D1} DEPRECATED - ${t}`))}function dz(e,t,i={}){if(V("esri-deprecation-warnings")){const{moduleName:s}=i;aR(e,`Property: ${(s?s+"::":"")+t}`,i)}}function aR(e,t,i={}){if(V("esri-deprecation-warnings")){const{replacement:s,version:r,see:n,warnOnce:o}=i;let a=t;s&&(a+=` \u{1F6E0}\uFE0F Replacement: ${s}`),r&&(a+=` \u2699\uFE0F Version: ${r}`),n&&(a+=` - \u{1F517} See ${n} for more details.`),hz(e,a,o)}}function ib(e){return e&&(typeof e.on=="function"||typeof e.addEventListener=="function")}function sb(e,t,i){if(!ib(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,i);if(Array.isArray(t)){const s=t.slice();for(const r of s)e.addEventListener(r,i);return{remove(){for(const r of s)e.removeEventListener(r,i)}}}return e.addEventListener(t,i),{remove(){e.removeEventListener(t,i)}}}function lR(e,t,i){if(!ib(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,i);const s=sb(e,t,r=>{s.remove(),i.call(e,r)});return{remove(){s.remove()}}}const pz={Win:"Meta",Scroll:"ScrollLock",Spacebar:" ",Down:"ArrowDown",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Del:"Delete",Apps:"ContextMenu",Esc:"Escape",Multiply:"*",Add:"+",Subtract:"-",Decimal:".",Divide:"/"};function yc({key:e}){return pz[e]||e}function _t(e="Aborted"){return new L("AbortError",e)}function Ft(e,t="Aborted"){if(jr(e))throw _t(t)}function rb(e){return M(e)?"aborted"in e?e:e.signal:e}function jr(e){const t=rb(e);return M(t)&&t.aborted}function Em(e){if(Ks(e))throw e}function w1(e){if(!Ks(e))throw e}function Vr(e,t){const i=rb(e);if(!N(i)){if(!i.aborted)return lR(i,"abort",()=>t());t()}}function JM(e,t){const i=rb(e);if(!N(i))return Ft(i),lR(i,"abort",()=>t(_t()))}function fz(e,t){const i=rb(t);return N(i)?e:new Promise((s,r)=>{let n=Vr(t,()=>r(_t()));const o=()=>n=Bt(n);e.then(o,o),e.then(s,r)})}function Ks(e){return(e==null?void 0:e.name)==="AbortError"}async function wh(e){try{return await e}catch(t){if(!Ks(t))throw t;return}}function Ao(){let e=null;const t=new Promise((i,s)=>{e={promise:void 0,resolve:i,reject:s}});return e.promise=t,e}async function as(e){if(!e)return;if(typeof e.forEach!="function"){const i=Object.keys(e),s=i.map(o=>e[o]),r=await as(s),n={};return i.map((o,a)=>n[o]=r[a]),n}const t=e;return new Promise(i=>{const s=[];let r=t.length;r===0&&i(s),t.forEach(n=>{const o={promise:n||Promise.resolve(n)};s.push(o),o.promise.then(a=>{o.value=a}).catch(a=>{o.error=a}).then(()=>{--r,r===0&&i(s)})})})}async function mz(e){return(await as(e)).filter(t=>!!t.value).map(t=>t.value)}function nb(e,t,i){const s=new AbortController;return Vr(i,()=>s.abort()),new Promise((r,n)=>{let o=setTimeout(()=>{o=0,r(t)},e);Vr(s,()=>{o&&(clearTimeout(o),n(_t()))})})}function No(e){return e&&typeof e.then=="function"}function x1(e){return No(e)?e:Promise.resolve(e)}function cR(e,t=-1){let i,s,r,n,o=null;const a=(...l)=>{if(i){s=l,n&&n.reject(_t()),n=Ao();const m=n.promise;if(o){const y=o;o=null,y.abort()}return m}if(r=n||Ao(),n=null,t>0){const m=new AbortController;i=x1(e(...l,m.signal));const y=i;nb(t).then(()=>{i===y&&(n?m.abort():o=m)})}else i=1,i=x1(e(...l));const u=()=>{const m=s;s=r=i=o=null,m!=null&&a(...m)},d=i,f=r;return d.then(u,u),d.then(f.resolve,f.reject),f.promise};return a}function yz(){let e,t;const i=new Promise((r,n)=>{e=r,t=n}),s=r=>{e(r)};return s.resolve=r=>e(r),s.reject=r=>t(r),s.timeout=(r,n)=>Im.setTimeout(()=>s.reject(n),r),s.promise=i,s}async function QI(e){await Promise.resolve(),Ft(e)}const KI=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,gz={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function eE(e){var t;return(t=gz[e])!=null?t:!1}const np=[],xh=new Map;function tE(e){for(const t of xh.keys())hR(e.pattern,t)&&xh.delete(t)}function vz(e){return np.includes(e)||(tE(e),np.unshift(e)),{remove(){const t=np.indexOf(e);t>-1&&(np.splice(t,1),tE(e))}}}async function uR(e){const t=Rr();xh.has(e)||xh.set(e,_z(e,t));const i=xh.get(e);return i&&await wz.add(i),i}function bz(e){if(!KI.test(e))return null;const t=KI.exec(e);if(t===null)return null;const[,i,s]=t,r=i+(s?"-"+s.toUpperCase():"");return eE(r)?r:eE(i)?i:null}async function _z(e,t){const i=[];for(const s of np)if(hR(s.pattern,e))try{return await s.fetchMessageBundle(e,t)}catch(r){i.push(r)}throw i.length?new L("intl:message-bundle-error",`Errors occurred while loading "${e}"`,{errors:i}):new L("intl:no-message-bundle-loader",`No loader found for message bundle "${e}"`)}function hR(e,t){return typeof e=="string"?t.startsWith(e):e.test(t)}GM(()=>{xh.clear()});const wz=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(e){return this._increase(),e.then(()=>this._decrease(),()=>this._decrease()),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=Ao())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&this._numLoading===0&&(this._dfd.resolve(),this._dfd=null)}},xz=q.getLogger("esri.core.urlUtils"),od=je.request,iE="esri/config: esriConfig.request.proxyUrl is not set.",dR=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,pR=/^\s*http:/i,Sz=/^\s*https:/i,Mz=/^\s*file:/i,$z=/:\d+$/,Tz=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,Iz=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),Ez=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class Sh{constructor(t=""){this.uri=t,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let i=this.uri.match(Iz);this.scheme=i[2]||(i[1]?"":null),this.authority=i[4]||(i[3]?"":null),this.path=i[5],this.query=i[7]||(i[6]?"":null),this.fragment=i[9]||(i[8]?"":null),this.authority!=null&&(i=this.authority.match(Ez),this.user=i[3]||null,this.password=i[4]||null,this.host=i[6]||i[7],this.port=i[9]||null)}toString(){return this.uri}}const ny={},kz=new Sh(je.applicationUrl);let Ti=kz;const Cz=Pz();let XM=Cz;const ZM=()=>Ti,fve=()=>XM;function Pz(){const e=Ti.path,t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${`${Ti.scheme}://${Ti.host}${Ti.port!=null?`:${Ti.port}`:""}`}${t}`}function Ai(e){if(!e)return null;const t={path:null,query:null},i=new Sh(e),s=e.indexOf("?");return i.query===null?t.path=e:(t.path=e.substring(0,s),t.query=fR(i.query)),i.fragment&&(t.hash=i.fragment,i.query===null&&(t.path=t.path.substring(0,t.path.length-(i.fragment.length+1)))),t}function fR(e){const t=e.split("&"),i={};for(const s of t){if(!s)continue;const r=s.indexOf("=");let n,o;r<0?(n=decodeURIComponent(s),o=""):(n=decodeURIComponent(s.slice(0,r)),o=decodeURIComponent(s.slice(r+1)));let a=i[n];typeof a=="string"&&(a=i[n]=[a]),Array.isArray(a)?a.push(o):i[n]=o}return i}function sE(e){return e&&typeof e=="object"&&"toJSON"in e&&typeof e.toJSON=="function"}function Nf(e,t){return e?t&&typeof t=="function"?Object.keys(e).map(i=>encodeURIComponent(i)+"="+encodeURIComponent(t(i,e[i]))).join("&"):Object.keys(e).map(i=>{const s=e[i];if(s==null)return"";const r=encodeURIComponent(i)+"=",n=t&&t[i];return n?r+encodeURIComponent(n(s)):Array.isArray(s)?s.map(o=>sE(o)?r+encodeURIComponent(JSON.stringify(o)):r+encodeURIComponent(o)).join("&"):sE(s)?r+encodeURIComponent(JSON.stringify(s)):r+encodeURIComponent(s)}).filter(i=>i).join("&"):""}function Az(e=!1){let t,i=od.proxyUrl;if(typeof e=="string"){t=Nz(e);const s=ob(e);s&&(i=s.proxyUrl)}else t=!!e;if(!i)throw xz.warn(iE),new L("urlutils:proxy-not-set",iE);return t&&S1()&&(i=i$(i)),Ai(i)}function mve(e){const t=ob(e);let i,s;if(t){const r=QM(t.proxyUrl);i=r.path,s=r.query?fR(r.query):null}if(i){const r=Ai(e);e=i+"?"+r.path;const n=Nf({...s,...r.query});n&&(e=`${e}?${n}`)}return e}const Cd={path:"",query:""};function QM(e){const t=e.indexOf("?");return t!==-1?(Cd.path=e.slice(0,t),Cd.query=e.slice(t+1)):(Cd.path=e,Cd.query=null),Cd}function mR(e){return e=(e=N0(e=qz(e=QM(e).path),!0)).toLowerCase()}function Oz(e){const t={proxyUrl:e.proxyUrl,urlPrefix:mR(e.urlPrefix)},i=od.proxyRules,s=t.urlPrefix;let r=i.length;for(let n=0;n0?e.substring(0,t):e.replace(/\/+$/,"")}function gR(e){const t=s=>s==null||s instanceof RegExp&&s.test(e)||typeof s=="string"&&e.startsWith(s),i=od.interceptors;if(i){for(const s of i)if(Array.isArray(s.urls)){if(s.urls.some(t))return s}else if(t(s.urls))return s}return null}function jf(e,t,i=!1){if(!e||!t)return!1;const s=$1(e),r=$1(t);return!(!i&&s.scheme!==r.scheme)&&s.host!=null&&r.host!=null&&s.host.toLowerCase()===r.host.toLowerCase()&&s.port===r.port}function KM(e){if(typeof e=="string"){if(!Ms(e))return!0;e=$1(e)}if(jf(e,Ti))return!0;const t=od.trustedServers||[];for(let i=0;i(y=f.indexOf(m,y))===-1?f.length:y;let l=a(r,"/",r.indexOf("//")+2),u=-1;for(;r.slice(0,l+1)===n.slice(0,l)+"/"&&(u=l+1,l!==r.length);)l=a(r,"/",l+1);if(u===-1||o&&u0)for(let f=0;fn?r.concat(n.split("/")):r,[]);for(let r=0;r0&&i[i.length-1]!==".."?i.pop():(!n&&r===s.length-1||n&&(n!=="."||i.length===0))&&i.push(n)}return i.join("/")}function Lr(e,t=!1){if(e==null||ab(e)||hu(e))return null;let i=e.indexOf("://");if(i===-1&&kn(e))i=2;else{if(i===-1)return null;i+=3}const s=e.indexOf("/",i);return s!==-1&&(e=e.slice(0,s)),t&&(e=N0(e,!0)),e}function Ms(e){return kn(e)||t$(e)}function ab(e){return e!=null&&e.slice(0,5)==="blob:"}function hu(e){return e!=null&&e.slice(0,5)==="data:"}function yve(e){const t=vR(e);if(!t||!t.isBase64)return null;const i=atob(t.data),s=new Uint8Array(i.length);for(let r=0;r1&&e[0]==="/"&&e[1]==="/"&&(e=e.slice(2)),e)}function Bz(e){const t=e.indexOf("//"),i=e.indexOf("/",t+2);return i===-1?e:e.slice(0,i)}function Uz(e){let t=0;if(Ms(e)){const s=e.indexOf("//");s!==-1&&(t=s+2)}const i=e.lastIndexOf("/");return is===r||s.endsWith(`.${r}`))||S1()&&!ob(e))&&(e=i$(e)),e}function M1(e,t,i){if(!(t&&i&&e&&Ms(e)))return e;const s=e.indexOf("//"),r=e.indexOf("/",s+2),n=e.indexOf(":",s+2),o=Math.min(r<0?e.length:r,n<0?e.length:n);return e.slice(s+2,o).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,s+2)}${i}${e.slice(o)}`}function $1(e){return typeof e=="string"?new Sh(Js(e)):(e.scheme||(e.scheme=Ti.scheme),e)}function _ve(e){return Yz.test(e)}function wR(e,t){const i=Ai(e),s=Object.keys(i.query||{});return s.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${s.join(", ")}.`),i.path}function xR(e,t,i){const s=Ai(e),r=s.query||{};return r[t]=String(i),`${s.path}?${Nf(r)}`}function w_(e,t){const i=Ai(e),s=i.query||{};for(const n in t)s[n]=t[n];const r=Nf(s);return r?`${i.path}?${r}`:i.path}function wve(e){if(N(e))return null;const t=e.match(SR);return t?t[2]:null}function nE(e){if(N(e))return null;const t=e.match(SR);return t?{path:t[1],extension:t[2]}:{path:e,extension:null}}const SR=/([^.]*)\.([^\/]*)$/,Yz=/(^data:image\/svg|\.svg$)/i,MR="20221121",$R="f520630575ed53cf8b49e5f1492799065ee366e5",TR="4.25",Jz={async request(e,t){var a,l;const{default:i}=await z(()=>Promise.resolve().then(function(){return m7}),void 0),s=e.options,r=s.responseType;s.signal=t==null?void 0:t.signal,s.responseType=r==="native"||r==="native-request-init"?"native-request-init":r&&["blob","json","text"].includes(r)&&((a=gR(e.url))==null?void 0:a.after)?r:"array-buffer";const n=await i(e.url,s),o={data:n.data,ssl:n.ssl};switch((l=n.requestOptions)==null?void 0:l.responseType){case"native-request-init":return delete o.data.signal,o;case"blob":o.data=await o.data.arrayBuffer();break;case"json":o.data=new TextEncoder().encode(JSON.stringify(o.data)).buffer;break;case"text":o.data=new TextEncoder().encode(o.data).buffer}return{result:o,transferList:[o.data]}}};let bt;function xve(e){bt=e}function Sve(e){const t=bt&&bt.findCredential(e);return t&&t.token?xR(e,"token",t.token):e}V("host-webworker");const Xz=/^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/i,Zz={devext:{customBaseUrl:"mapsdevext.arcgis.com",portalHostname:"devext.arcgis.com"},qaext:{customBaseUrl:"mapsqa.arcgis.com",portalHostname:"qaext.arcgis.com"},www:{customBaseUrl:"maps.arcgis.com",portalHostname:"www.arcgis.com"}};function Mve(e){const t=e==null?void 0:e.match(Xz);if(!t)return null;const[,i,s,r]=t;if(!i)return null;let n=null,o=null,a=null;const{devext:l,qaext:u,www:d}=Zz;if(s)if(n=i,r)switch(r.toLowerCase()){case"devext":({customBaseUrl:o,portalHostname:a}=l);break;case"qa":({customBaseUrl:o,portalHostname:a}=u);break;default:return null}else({customBaseUrl:o,portalHostname:a}=d);else switch(i.toLowerCase()){case"devext":({customBaseUrl:o,portalHostname:a}=l);break;case"qaext":({customBaseUrl:o,portalHostname:a}=u);break;case"www":({customBaseUrl:o,portalHostname:a}=d);break;default:return null}return{customBaseUrl:o,isPortal:!1,portalHostname:a,urlKey:n}}function Qz(e){return/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(e)}const Kz=["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"];function IR(e){const t=Lr(e,!0);return!!t&&t.endsWith(".arcgis.com")&&!Kz.includes(t)&&!e.endsWith("/sharing/rest/generateToken")}function e7(e,t,i=!1,s){return new Promise((r,n)=>{if(jr(s))return void n(oE());let o=()=>{u(),n(new Error(`Unable to load ${t}`))},a=()=>{const d=e;u(),r(d)},l=()=>{if(!e)return;const d=e;u(),d.src="",n(oE())};const u=()=>{V("esri-image-decode")||(e.removeEventListener("error",o),e.removeEventListener("load",a)),o=null,a=null,e=null,M(s)&&s.removeEventListener("abort",l),l=null,i&&URL.revokeObjectURL(t)};M(s)&&s.addEventListener("abort",l),V("esri-image-decode")?e.decode().then(a,o):(e.addEventListener("error",o),e.addEventListener("load",a))})}function oE(){try{return new DOMException("Aborted","AbortError")}catch{const e=new Error;return e.name="AbortError",e}}function t7(e){var i,s,r;je.request.crossOriginNoCorsDomains||(je.request.crossOriginNoCorsDomains={});const t=je.request.crossOriginNoCorsDomains;for(let n of e)n=n.toLowerCase(),/^https?:\/\//.test(n)?t[(i=Lr(n))!=null?i:""]=0:(t[(s=Lr("http://"+n))!=null?s:""]=0,t[(r=Lr("https://"+n))!=null?r:""]=0)}function i7(e){const t=je.request.crossOriginNoCorsDomains;if(t){let i=Lr(e);if(i)return i=i.toLowerCase(),!jf(i,ZM())&&t[i]o.abort());const a={controller:o,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:n,params:r,redoRequest:!1,useIdentity:Tr.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},l=await p7(a);return(u=n==null?void 0:n.after)==null||u.call(n,l),l}let j0;const Tr=je.request,ER="FormData"in globalThis,r7=[499,498,403,401],n7=["COM_0056","COM_0057","SB_0008"],o7=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],s$=()=>null,V0=Symbol();function a7(e){const t=Lr(e);t&&!kt._corsServers.includes(t)&&kt._corsServers.push(t)}function aE(e){const t=Lr(e);return!t||t.endsWith(".arcgis.com")||kt._corsServers.includes(t)||KM(t)}function Pr(e,t,i,s){let r="Error";const n={url:i.url,requestOptions:i.requestOptions,getHeader:s$,ssl:!1};if(t instanceof L)return t.details?(t.details=R(t.details),t.details.url=i.url,t.details.requestOptions=i.requestOptions):t.details=n,t;if(t){const o=s&&(u=>s.headers.get(u)),a=s&&s.status,l=t.message;l&&(r=l),o&&(n.getHeader=o),n.httpStatus=(t.httpCode!=null?t.httpCode:t.code)||a||0,n.subCode=t.subcode,n.messageCode=t.messageCode,typeof t.details=="string"?n.messages=[t.details]:n.messages=t.details,n.raw=V0 in t?t[V0]:t}return Ks(t)?_t():new L(e,r,n)}async function l7(){V("host-webworker")?j0||(j0=await z(()=>import("./request.493a15ad.js"),[])):kt._abortableFetch||(kt._abortableFetch=globalThis.fetch.bind(globalThis))}async function T1(){bt||await z(()=>import("./IdentityManager.9f244ffe.js"),[])}async function c7(e){var a;const t=e.params.url,i=e.params.requestOptions,s=e.controller.signal,r=i.body;let n=null,o=null;if(ER&&"HTMLFormElement"in globalThis&&(r instanceof FormData?n=r:r instanceof HTMLFormElement&&(n=new FormData(r))),typeof r=="string"&&(o=r),e.fetchOptions={cache:i.cacheBust&&!kt._abortableFetch.polyfill?"no-cache":"default",credentials:"same-origin",headers:i.headers||{},method:i.method==="head"?"HEAD":"GET",mode:"cors",priority:Tr.priority,redirect:"follow",signal:s},(n||o)&&(e.fetchOptions.body=n||o),i.authMode==="anonymous"&&(e.useIdentity=!1),e.hasToken=!!(/token=/i.test(t)||((a=i.query)==null?void 0:a.token)||(n==null?void 0:n.get("token"))),!e.hasToken&&je.apiKey&&IR(t)&&(i.query||(i.query={}),i.query.token=je.apiKey,e.hasToken=!0),e.useIdentity&&!e.hasToken&&!e.credentialToken&&!kR(t)&&!jr(s)){let l;i.authMode==="immediate"?(await T1(),l=await bt.getCredential(t,{signal:s}),e.credential=l):i.authMode==="no-prompt"?(await T1(),l=await bt.getCredential(t,{prompt:!1,signal:s}).catch(()=>{}),e.credential=l):bt&&(l=bt.findCredential(t)),l&&(e.credentialToken=l.token,e.useSSL=!!l.ssl)}}function kR(e){return o7.some(t=>t.test(e))}async function u7(e){var m,y;let t=e.params.url;const i=e.params.requestOptions,s=(m=e.fetchOptions)!=null?m:{},r=ab(t)||hu(t),n=i.responseType||"json",o=r?0:i.timeout!=null?i.timeout:Tr.timeout;let a=!1;if(!r){e.useSSL&&(t=i$(t)),i.cacheBust&&s.cache==="default"&&(t=xR(t,"request.preventCache",Date.now()));let g={...i.query};e.credentialToken&&(g.token=e.credentialToken);let v=Nf(g);V("esri-url-encodes-apostrophe")&&(v=v.replace(/'/g,"%27"));const b=t.length+1+v.length;let _;a=i.method==="delete"||i.method==="post"||i.method==="put"||!!i.body||b>Tr.maxUrlLength;const x=i.useProxy||!!ob(t);if(x){const $=Az(t);_=$.path,!a&&_.length+1+b>Tr.maxUrlLength&&(a=!0),$.query&&(g={...$.query,...g})}if(s.method==="HEAD"&&(a||x)){if(a)throw b>Tr.maxUrlLength?Pr("request:invalid-parameters",new Error("URL exceeds maximum length"),e.params):Pr("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),e.params);if(x)throw Pr("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),e.params)}if(a?(s.method=i.method==="delete"?"DELETE":i.method==="put"?"PUT":"POST",i.body?t=w_(t,g):(s.body=Nf(g),s.headers||(s.headers={}),s.headers["Content-Type"]="application/x-www-form-urlencoded")):t=w_(t,g),x&&(e.useProxy=!0,t=`${_}?${t}`),g.token&&ER&&s.body instanceof FormData&&!Qz(t)&&s.body.set("token",g.token),i.hasOwnProperty("withCredentials"))e.withCredentials=i.withCredentials;else if(!jf(t,ZM())){if(KM(t))e.withCredentials=!0;else if(bt){const $=bt.findServerInfo(t);$&&$.webTierAuth&&(e.withCredentials=!0)}}e.withCredentials&&(s.credentials="include",i7(t)&&await s7(a?w_(t,g):t))}let l,u,d=0,f=!1;o>0&&(d=setTimeout(()=>{f=!0,e.controller.abort()},o));try{if(i.responseType==="native-request-init")u=s,u.url=t;else if(i.responseType!=="image"||s.cache!=="default"||s.method!=="GET"||a||d7(i.headers)||!r&&!e.useProxy&&Tr.proxyUrl&&!aE(t)){if(l=await kt._abortableFetch(t,s),e.useProxy||a7(t),i.responseType==="native")u=l;else if(s.method!=="HEAD")if(l.ok){switch(n){case"array-buffer":u=await l.arrayBuffer();break;case"blob":case"image":u=await l.blob();break;default:u=await l.text()}if(d&&(clearTimeout(d),d=0),n==="json"||n==="xml"||n==="document")if(u)switch(n){case"json":u=JSON.parse(u);break;case"xml":u=lE(u,"application/xml");break;case"document":u=lE(u,"text/html")}else u=null;if(u){if(n==="array-buffer"||n==="blob"){const g=l.headers.get("Content-Type");if(g&&/application\/json|text\/plain/i.test(g)&&u[n==="blob"?"size":"byteLength"]<=750)try{const v=await new Response(u).json();v.error&&(u=v)}catch{}}n==="image"&&u instanceof Blob&&(u=await cE(URL.createObjectURL(u),e,!0))}}else u=await l.text()}else u=await cE(t,e)}catch(g){if(g.name==="AbortError")throw f?new Error("Timeout exceeded"):_t("Request canceled");if(!(!l&&g instanceof TypeError&&Tr.proxyUrl)||i.body||i.method==="delete"||i.method==="head"||i.method==="post"||i.method==="put"||e.useProxy||aE(t))throw g;e.redoRequest=!0,Oz({proxyUrl:Tr.proxyUrl,urlPrefix:(y=Lr(t))!=null?y:""})}finally{d&&clearTimeout(d)}return[l,u]}async function h7(e,t){if(e.responseData!=null)return e.responseData;if(e.headers&&(t.requestOptions.headers={...t.requestOptions.headers,...e.headers}),e.query&&(t.requestOptions.query={...t.requestOptions.query,...e.query}),e.before){let i,s;try{s=await e.before(t)}catch(r){i=Pr("request:interceptor",r,t)}if((s instanceof Error||s instanceof L)&&(i=Pr("request:interceptor",s,t)),i)throw e.error&&e.error(i),i;return s}}function d7(e){if(e){for(const t of Object.getOwnPropertyNames(e))if(e[t])return!0}return!1}function lE(e,t){let i;try{i=new DOMParser().parseFromString(e,t)}catch{}if(!i||i.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return i}async function p7(e){var n;let t,i;await c7(e);try{do[t,i]=await u7(e);while(!await f7(e,t,i))}catch(o){const a=Pr("request:server",o,e.params,t);throw a.details.ssl=e.useSSL,e.interceptor&&e.interceptor.error&&e.interceptor.error(a),a}const s=e.params.url;if(i&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(s)){if(!e.hasToken&&!e.credentialToken&&((n=i.user)==null?void 0:n.username)&&!KM(s)){const o=Lr(s,!0);o&&Tr.trustedServers.push(o)}Array.isArray(i.authorizedCrossOriginNoCorsDomains)&&t7(i.authorizedCrossOriginNoCorsDomains)}const r=e.credential;if(r&&bt){const o=bt.findServerInfo(r.server);let a=o&&o.owningSystemUrl;if(a){a=a.replace(/\/?$/,"/sharing");const l=bt.findCredential(a,r.userId);l&&bt._getIdenticalSvcIdx(a,l)===-1&&l.resources.unshift(a)}}return{data:i,getHeader:t?o=>t==null?void 0:t.headers.get(o):s$,requestOptions:e.params.requestOptions,ssl:e.useSSL,url:e.params.url}}async function f7(e,t,i){if(e.redoRequest)return e.redoRequest=!1,!1;const s=e.params.requestOptions;if(!t||s.responseType==="native"||s.responseType==="native-request-init")return!0;let r,n;if(!t.ok)throw r=new Error(`Unable to load ${t.url} status: ${t.status}`),r[V0]=i,r;i&&(i.error?r=i.error:i.status==="error"&&Array.isArray(i.messages)&&(r={...i},r[V0]=i,r.details=i.messages));let o,a=null;r&&(n=Number(r.code),a=r.hasOwnProperty("subcode")?Number(r.subcode):null,o=r.messageCode,o=o&&o.toUpperCase());const l=s.authMode;if(n===403&&(a===4||r.message&&r.message.toLowerCase().includes("ssl")&&!r.message.toLowerCase().includes("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&(l!=="no-prompt"||n===498)&&n!==void 0&&r7.includes(n)&&!kR(e.params.url)&&(n!==403||o&&!n7.includes(o)&&(a==null||a===2&&e.credentialToken))){await T1();try{const u=await bt.getCredential(e.params.url,{error:Pr("request:server",r,e.params),prompt:l!=="no-prompt",signal:e.controller.signal,token:e.credentialToken});return e.credential=u,e.credentialToken=u.token,e.useSSL=e.useSSL||u.ssl,!1}catch(u){if(l==="no-prompt")return e.credential=void 0,e.credentialToken=void 0,!1;r=u}}if(r)throw r;return!0}function cE(e,t,i=!1){const s=t.controller.signal,r=new Image;return t.withCredentials?r.crossOrigin="use-credentials":r.crossOrigin="anonymous",r.alt="",r.fetchPriority=Tr.priority,r.src=e,e7(r,e,i,s)}kt._abortableFetch=null,kt._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"];var m7=Object.freeze(Object.defineProperty({__proto__:null,default:kt},Symbol.toStringTag,{value:"Module"}));async function y7(e,t,i,s){const r=t.exec(i);if(!r)throw new L("esri-intl:invalid-bundle",`Bundle id "${i}" is not compatible with the pattern "${t}"`);const n=r[1]?`${r[1]}/`:"",o=r[2],a=bz(s),l=`${n}${o}.json`,u=a?`${n}${o}_${a}.json`:l;let d;try{d=await uE(e(u))}catch(f){if(u===l)throw new L("intl:unknown-bundle",`Bundle "${i}" cannot be loaded`,{error:f});try{d=await uE(e(l))}catch(m){throw new L("intl:unknown-bundle",`Bundle "${i}" cannot be loaded`,{error:m})}}return d}async function uE(e){if(M(hE.fetchBundleAsset))return hE.fetchBundleAsset(e);const t=await kt(e,{responseType:"text"});return JSON.parse(t.data)}class g7{constructor({base:t="",pattern:i,location:s=new URL(window.location.href)}){let r;r=typeof s=="string"?n=>new URL(n,new URL(s,window.location.href)).href:s instanceof URL?n=>new URL(n,s).href:s,this.pattern=typeof i=="string"?new RegExp(`^${i}`):i,this.getAssetUrl=r,t=t?t.endsWith("/")?t:t+"/":"",this.matcher=new RegExp(`^${t}(?:(.*)/)?(.*)$`)}fetchMessageBundle(t,i){return y7(this.getAssetUrl,this.matcher,t,i)}}function v7(e){return new g7(e)}const hE={},b7=q.getLogger("esri.assets");function Ne(e){if(!je.assetsPath)throw b7.errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new L("assets:path-not-set","config.assetsPath is not set");return Xc(je.assetsPath,e)}vz(v7({pattern:"esri/",location:Ne}));function r$(e){return typeof e=="string"?document.getElementById(e):e!=null?e:null}function CR(e){for(;e.hasChildNodes();)e.removeChild(e.firstChild)}function dE(e,t){const i=t.parentNode;i&&i.insertBefore(e,t)}function pE(e,t){for(;;){const i=e.firstChild;if(!i)break;t.appendChild(i)}}function $ve(e){const t=[];return function*(){yield*t;for(const i of e)t.push(i),yield i}}function _7(e,t){for(const i of e)if(i!=null&&t(i))return i}function z0(e){return e!=null&&typeof e[Symbol.iterator]=="function"}class qi{constructor(){this._groups=new Map}destroy(){this.removeAll()}get size(){let t=0;return this._groups.forEach(i=>{t+=i.length}),t}add(t,i){if(z0(t)){const s=this._getOrCreateGroup(i);for(const r of t)this._isHandle(r)&&s.push(r)}else this._isHandle(t)&&this._getOrCreateGroup(i).push(t);return this}forEach(t,i){if(typeof t=="function")this._groups.forEach(s=>s.forEach(t));else{const s=this._getGroup(t);s&&i&&s.forEach(i)}}has(t){return this._groups.has(this._ensureGroupKey(t))}remove(t){if(typeof t!="string"&&z0(t)){for(const i of t)this.remove(i);return this}return this.has(t)?(this._removeAllFromGroup(this._getGroup(t)),this._groups.delete(this._ensureGroupKey(t)),this):this}removeAll(){return this._groups.forEach(t=>this._removeAllFromGroup(t)),this._groups.clear(),this}_isHandle(t){return t&&!!t.remove}_getOrCreateGroup(t){if(this.has(t))return this._getGroup(t);const i=[];return this._groups.set(this._ensureGroupKey(t),i),i}_getGroup(t){return this._groups.get(this._ensureGroupKey(t))}_ensureGroupKey(t){return t||"_default_"}_removeAllFromGroup(t){t.forEach(i=>i.remove())}}function w7(e){return e&&e.release&&typeof e.release=="function"}function x7(e){return e&&e.acquire&&typeof e.acquire=="function"}class zr{constructor(t,i,s,r=1,n=0){if(this._ctor=t,this._acquireFunction=i,this._releaseFunction=s,this.allocationSize=r,this._pool=new Array(n),this._initialSize=n,this._ctor)for(let o=0;o=this._pool.length)){for(let i=t;i{t&&t.has(r)||i.set(r,R(s))}),i}get(t){return this._values.get(t)}originOf(){return Pe.USER}keys(){return[...this._values.keys()]}set(t,i){this._values.set(t,i)}delete(t){this._values.delete(t)}has(t){return this._values.has(t)}forEach(t){this._values.forEach(t)}}function oy(e,t,i){return e!==void 0}function mE(e,t,i,s){return e!==void 0&&(!(i==null&&e.flags&Be.NonNullable)||(s.lifecycle,_o.INITIALIZING,!1))}function M7(e){return e&&typeof e.destroy=="function"}q.getLogger("esri.core.accessorSupport.Properties");class $7{constructor(t){this.host=t,this.properties=new Map,this.ctorArgs=null,this.destroyed=!1,this.lifecycle=_o.INITIALIZING,this.store=new n$,this._origin=Pe.USER;const i=this.host.constructor.__accessorMetadata__,s=i.properties;for(const r in s){const n=new fE(this,r,s[r]);this.properties.set(r,n)}this.metadatas=s,this._autoDestroy=i.autoDestroy}initialize(){this.lifecycle=_o.CONSTRUCTING}constructed(){this.lifecycle=_o.CONSTRUCTED}destroy(){if(this.destroyed=!0,this._autoDestroy)for(const[t,i]of this.properties){const s=this.internalGet(t);s&&M7(s)&&(s.destroy(),~i.flags&Be.NonNullable&&this._internalSet(i,null)),i.destroy()}else for(const[t,i]of this.properties)i.destroy()}get initialized(){return this.lifecycle!==_o.INITIALIZING}get(t){const i=this.properties.get(t);if(i.metadata.get)return i.getComputed();_e(i);const s=this.store;return s.has(t)?s.get(t):i.metadata.value}originOf(t){const i=this.store.originOf(t);if(i===void 0){const s=this.properties.get(t);if(s!==void 0&&s.flags&Be.HasDefaultValue)return"defaults"}return B0(i)}has(t){return!!this.properties.has(t)&&this.store.has(t)}keys(){return[...this.properties.keys()]}internalGet(t){const i=this.properties.get(t);if(oy(i))return this.store.has(t)?this.store.get(t):i.metadata.value}internalSet(t,i){const s=this.properties.get(t);oy(s)&&this._internalSet(s,i)}getDependsInfo(t,i,s){const r=this.properties.get(i);if(!oy(r))return"";const n=new Set,o=Co({onObservableAccessed:l=>n.add(l),onTrackingEnd:()=>{}},()=>{var l;return(l=r.metadata.get)==null?void 0:l.call(t)});let a=`${s}${t.declaredClass.split(".").pop()}.${i}: ${o} + \u{1F517} See ${n} for more details.`),hz(e,a,o)}}function ib(e){return e&&(typeof e.on=="function"||typeof e.addEventListener=="function")}function sb(e,t,i){if(!ib(e))throw new TypeError("target is not a Evented or EventTarget object");if("on"in e)return e.on(t,i);if(Array.isArray(t)){const s=t.slice();for(const r of s)e.addEventListener(r,i);return{remove(){for(const r of s)e.removeEventListener(r,i)}}}return e.addEventListener(t,i),{remove(){e.removeEventListener(t,i)}}}function lR(e,t,i){if(!ib(e))throw new TypeError("target is not a Evented or EventTarget object");if("once"in e)return e.once(t,i);const s=sb(e,t,r=>{s.remove(),i.call(e,r)});return{remove(){s.remove()}}}const pz={Win:"Meta",Scroll:"ScrollLock",Spacebar:" ",Down:"ArrowDown",Left:"ArrowLeft",Right:"ArrowRight",Up:"ArrowUp",Del:"Delete",Apps:"ContextMenu",Esc:"Escape",Multiply:"*",Add:"+",Subtract:"-",Decimal:".",Divide:"/"};function yc({key:e}){return pz[e]||e}function _t(e="Aborted"){return new L("AbortError",e)}function Ft(e,t="Aborted"){if(jr(e))throw _t(t)}function rb(e){return M(e)?"aborted"in e?e:e.signal:e}function jr(e){const t=rb(e);return M(t)&&t.aborted}function Em(e){if(Ks(e))throw e}function w1(e){if(!Ks(e))throw e}function Vr(e,t){const i=rb(e);if(!N(i)){if(!i.aborted)return lR(i,"abort",()=>t());t()}}function JM(e,t){const i=rb(e);if(!N(i))return Ft(i),lR(i,"abort",()=>t(_t()))}function fz(e,t){const i=rb(t);return N(i)?e:new Promise((s,r)=>{let n=Vr(t,()=>r(_t()));const o=()=>n=Bt(n);e.then(o,o),e.then(s,r)})}function Ks(e){return(e==null?void 0:e.name)==="AbortError"}async function wh(e){try{return await e}catch(t){if(!Ks(t))throw t;return}}function Ao(){let e=null;const t=new Promise((i,s)=>{e={promise:void 0,resolve:i,reject:s}});return e.promise=t,e}async function as(e){if(!e)return;if(typeof e.forEach!="function"){const i=Object.keys(e),s=i.map(o=>e[o]),r=await as(s),n={};return i.map((o,a)=>n[o]=r[a]),n}const t=e;return new Promise(i=>{const s=[];let r=t.length;r===0&&i(s),t.forEach(n=>{const o={promise:n||Promise.resolve(n)};s.push(o),o.promise.then(a=>{o.value=a}).catch(a=>{o.error=a}).then(()=>{--r,r===0&&i(s)})})})}async function mz(e){return(await as(e)).filter(t=>!!t.value).map(t=>t.value)}function nb(e,t,i){const s=new AbortController;return Vr(i,()=>s.abort()),new Promise((r,n)=>{let o=setTimeout(()=>{o=0,r(t)},e);Vr(s,()=>{o&&(clearTimeout(o),n(_t()))})})}function No(e){return e&&typeof e.then=="function"}function x1(e){return No(e)?e:Promise.resolve(e)}function cR(e,t=-1){let i,s,r,n,o=null;const a=(...l)=>{if(i){s=l,n&&n.reject(_t()),n=Ao();const m=n.promise;if(o){const y=o;o=null,y.abort()}return m}if(r=n||Ao(),n=null,t>0){const m=new AbortController;i=x1(e(...l,m.signal));const y=i;nb(t).then(()=>{i===y&&(n?m.abort():o=m)})}else i=1,i=x1(e(...l));const u=()=>{const m=s;s=r=i=o=null,m!=null&&a(...m)},d=i,f=r;return d.then(u,u),d.then(f.resolve,f.reject),f.promise};return a}function yz(){let e,t;const i=new Promise((r,n)=>{e=r,t=n}),s=r=>{e(r)};return s.resolve=r=>e(r),s.reject=r=>t(r),s.timeout=(r,n)=>Im.setTimeout(()=>s.reject(n),r),s.promise=i,s}async function QI(e){await Promise.resolve(),Ft(e)}const KI=/^([a-z]{2})(?:[-_]([A-Za-z]{2}))?$/,gz={ar:!0,bg:!0,bs:!0,ca:!0,cs:!0,da:!0,de:!0,el:!0,en:!0,es:!0,et:!0,fi:!0,fr:!0,he:!0,hr:!0,hu:!0,id:!0,it:!0,ja:!0,ko:!0,lt:!0,lv:!0,nb:!0,nl:!0,pl:!0,"pt-BR":!0,"pt-PT":!0,ro:!0,ru:!0,sk:!0,sl:!0,sr:!0,sv:!0,th:!0,tr:!0,uk:!0,vi:!0,"zh-CN":!0,"zh-HK":!0,"zh-TW":!0};function eE(e){var t;return(t=gz[e])!=null?t:!1}const np=[],xh=new Map;function tE(e){for(const t of xh.keys())hR(e.pattern,t)&&xh.delete(t)}function vz(e){return np.includes(e)||(tE(e),np.unshift(e)),{remove(){const t=np.indexOf(e);t>-1&&(np.splice(t,1),tE(e))}}}async function uR(e){const t=Rr();xh.has(e)||xh.set(e,_z(e,t));const i=xh.get(e);return i&&await wz.add(i),i}function bz(e){if(!KI.test(e))return null;const t=KI.exec(e);if(t===null)return null;const[,i,s]=t,r=i+(s?"-"+s.toUpperCase():"");return eE(r)?r:eE(i)?i:null}async function _z(e,t){const i=[];for(const s of np)if(hR(s.pattern,e))try{return await s.fetchMessageBundle(e,t)}catch(r){i.push(r)}throw i.length?new L("intl:message-bundle-error",`Errors occurred while loading "${e}"`,{errors:i}):new L("intl:no-message-bundle-loader",`No loader found for message bundle "${e}"`)}function hR(e,t){return typeof e=="string"?t.startsWith(e):e.test(t)}GM(()=>{xh.clear()});const wz=new class{constructor(){this._numLoading=0,this._dfd=null}async waitForAll(){this._dfd&&await this._dfd.promise}add(e){return this._increase(),e.then(()=>this._decrease(),()=>this._decrease()),this.waitForAll()}_increase(){this._numLoading++,this._dfd||(this._dfd=Ao())}_decrease(){this._numLoading=Math.max(this._numLoading-1,0),this._dfd&&this._numLoading===0&&(this._dfd.resolve(),this._dfd=null)}},xz=q.getLogger("esri.core.urlUtils"),od=je.request,iE="esri/config: esriConfig.request.proxyUrl is not set.",dR=/^\s*[a-z][a-z0-9-+.]*:(?![0-9])/i,pR=/^\s*http:/i,Sz=/^\s*https:/i,Mz=/^\s*file:/i,$z=/:\d+$/,Tz=/^https?:\/\/[^/]+\.arcgis.com\/sharing(\/|$)/i,Iz=new RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$"),Ez=new RegExp("^((([^\\[:]+):)?([^@]+)@)?(\\[([^\\]]+)\\]|([^\\[:]*))(:([0-9]+))?$");class Sh{constructor(t=""){this.uri=t,this.scheme=null,this.authority=null,this.path=null,this.query=null,this.fragment=null,this.user=null,this.password=null,this.host=null,this.port=null;let i=this.uri.match(Iz);this.scheme=i[2]||(i[1]?"":null),this.authority=i[4]||(i[3]?"":null),this.path=i[5],this.query=i[7]||(i[6]?"":null),this.fragment=i[9]||(i[8]?"":null),this.authority!=null&&(i=this.authority.match(Ez),this.user=i[3]||null,this.password=i[4]||null,this.host=i[6]||i[7],this.port=i[9]||null)}toString(){return this.uri}}const ny={},kz=new Sh(je.applicationUrl);let Ti=kz;const Cz=Pz();let XM=Cz;const ZM=()=>Ti,fve=()=>XM;function Pz(){const e=Ti.path,t=e.substring(0,e.lastIndexOf(e.split("/")[e.split("/").length-1]));return`${`${Ti.scheme}://${Ti.host}${Ti.port!=null?`:${Ti.port}`:""}`}${t}`}function Ai(e){if(!e)return null;const t={path:null,query:null},i=new Sh(e),s=e.indexOf("?");return i.query===null?t.path=e:(t.path=e.substring(0,s),t.query=fR(i.query)),i.fragment&&(t.hash=i.fragment,i.query===null&&(t.path=t.path.substring(0,t.path.length-(i.fragment.length+1)))),t}function fR(e){const t=e.split("&"),i={};for(const s of t){if(!s)continue;const r=s.indexOf("=");let n,o;r<0?(n=decodeURIComponent(s),o=""):(n=decodeURIComponent(s.slice(0,r)),o=decodeURIComponent(s.slice(r+1)));let a=i[n];typeof a=="string"&&(a=i[n]=[a]),Array.isArray(a)?a.push(o):i[n]=o}return i}function sE(e){return e&&typeof e=="object"&&"toJSON"in e&&typeof e.toJSON=="function"}function Nf(e,t){return e?t&&typeof t=="function"?Object.keys(e).map(i=>encodeURIComponent(i)+"="+encodeURIComponent(t(i,e[i]))).join("&"):Object.keys(e).map(i=>{const s=e[i];if(s==null)return"";const r=encodeURIComponent(i)+"=",n=t&&t[i];return n?r+encodeURIComponent(n(s)):Array.isArray(s)?s.map(o=>sE(o)?r+encodeURIComponent(JSON.stringify(o)):r+encodeURIComponent(o)).join("&"):sE(s)?r+encodeURIComponent(JSON.stringify(s)):r+encodeURIComponent(s)}).filter(i=>i).join("&"):""}function Az(e=!1){let t,i=od.proxyUrl;if(typeof e=="string"){t=Nz(e);const s=ob(e);s&&(i=s.proxyUrl)}else t=!!e;if(!i)throw xz.warn(iE),new L("urlutils:proxy-not-set",iE);return t&&S1()&&(i=i$(i)),Ai(i)}function mve(e){const t=ob(e);let i,s;if(t){const r=QM(t.proxyUrl);i=r.path,s=r.query?fR(r.query):null}if(i){const r=Ai(e);e=i+"?"+r.path;const n=Nf({...s,...r.query});n&&(e=`${e}?${n}`)}return e}const Cd={path:"",query:""};function QM(e){const t=e.indexOf("?");return t!==-1?(Cd.path=e.slice(0,t),Cd.query=e.slice(t+1)):(Cd.path=e,Cd.query=null),Cd}function mR(e){return e=(e=N0(e=qz(e=QM(e).path),!0)).toLowerCase()}function Oz(e){const t={proxyUrl:e.proxyUrl,urlPrefix:mR(e.urlPrefix)},i=od.proxyRules,s=t.urlPrefix;let r=i.length;for(let n=0;n0?e.substring(0,t):e.replace(/\/+$/,"")}function gR(e){const t=s=>s==null||s instanceof RegExp&&s.test(e)||typeof s=="string"&&e.startsWith(s),i=od.interceptors;if(i){for(const s of i)if(Array.isArray(s.urls)){if(s.urls.some(t))return s}else if(t(s.urls))return s}return null}function jf(e,t,i=!1){if(!e||!t)return!1;const s=$1(e),r=$1(t);return!(!i&&s.scheme!==r.scheme)&&s.host!=null&&r.host!=null&&s.host.toLowerCase()===r.host.toLowerCase()&&s.port===r.port}function KM(e){if(typeof e=="string"){if(!Ms(e))return!0;e=$1(e)}if(jf(e,Ti))return!0;const t=od.trustedServers||[];for(let i=0;i(y=f.indexOf(m,y))===-1?f.length:y;let l=a(r,"/",r.indexOf("//")+2),u=-1;for(;r.slice(0,l+1)===n.slice(0,l)+"/"&&(u=l+1,l!==r.length);)l=a(r,"/",l+1);if(u===-1||o&&u0)for(let f=0;fn?r.concat(n.split("/")):r,[]);for(let r=0;r0&&i[i.length-1]!==".."?i.pop():(!n&&r===s.length-1||n&&(n!=="."||i.length===0))&&i.push(n)}return i.join("/")}function Lr(e,t=!1){if(e==null||ab(e)||hu(e))return null;let i=e.indexOf("://");if(i===-1&&kn(e))i=2;else{if(i===-1)return null;i+=3}const s=e.indexOf("/",i);return s!==-1&&(e=e.slice(0,s)),t&&(e=N0(e,!0)),e}function Ms(e){return kn(e)||t$(e)}function ab(e){return e!=null&&e.slice(0,5)==="blob:"}function hu(e){return e!=null&&e.slice(0,5)==="data:"}function yve(e){const t=vR(e);if(!t||!t.isBase64)return null;const i=atob(t.data),s=new Uint8Array(i.length);for(let r=0;r1&&e[0]==="/"&&e[1]==="/"&&(e=e.slice(2)),e)}function Bz(e){const t=e.indexOf("//"),i=e.indexOf("/",t+2);return i===-1?e:e.slice(0,i)}function Uz(e){let t=0;if(Ms(e)){const s=e.indexOf("//");s!==-1&&(t=s+2)}const i=e.lastIndexOf("/");return is===r||s.endsWith(`.${r}`))||S1()&&!ob(e))&&(e=i$(e)),e}function M1(e,t,i){if(!(t&&i&&e&&Ms(e)))return e;const s=e.indexOf("//"),r=e.indexOf("/",s+2),n=e.indexOf(":",s+2),o=Math.min(r<0?e.length:r,n<0?e.length:n);return e.slice(s+2,o).toLowerCase()!==t.toLowerCase()?e:`${e.slice(0,s+2)}${i}${e.slice(o)}`}function $1(e){return typeof e=="string"?new Sh(Js(e)):(e.scheme||(e.scheme=Ti.scheme),e)}function _ve(e){return Yz.test(e)}function wR(e,t){const i=Ai(e),s=Object.keys(i.query||{});return s.length>0&&t&&t.warn("removeQueryParameters()",`Url query parameters are not supported, the following parameters have been removed: ${s.join(", ")}.`),i.path}function xR(e,t,i){const s=Ai(e),r=s.query||{};return r[t]=String(i),`${s.path}?${Nf(r)}`}function w_(e,t){const i=Ai(e),s=i.query||{};for(const n in t)s[n]=t[n];const r=Nf(s);return r?`${i.path}?${r}`:i.path}function wve(e){if(N(e))return null;const t=e.match(SR);return t?t[2]:null}function nE(e){if(N(e))return null;const t=e.match(SR);return t?{path:t[1],extension:t[2]}:{path:e,extension:null}}const SR=/([^.]*)\.([^\/]*)$/,Yz=/(^data:image\/svg|\.svg$)/i,MR="20221121",$R="f520630575ed53cf8b49e5f1492799065ee366e5",TR="4.25",Jz={async request(e,t){var a,l;const{default:i}=await z(()=>Promise.resolve().then(function(){return m7}),void 0),s=e.options,r=s.responseType;s.signal=t==null?void 0:t.signal,s.responseType=r==="native"||r==="native-request-init"?"native-request-init":r&&["blob","json","text"].includes(r)&&((a=gR(e.url))==null?void 0:a.after)?r:"array-buffer";const n=await i(e.url,s),o={data:n.data,ssl:n.ssl};switch((l=n.requestOptions)==null?void 0:l.responseType){case"native-request-init":return delete o.data.signal,o;case"blob":o.data=await o.data.arrayBuffer();break;case"json":o.data=new TextEncoder().encode(JSON.stringify(o.data)).buffer;break;case"text":o.data=new TextEncoder().encode(o.data).buffer}return{result:o,transferList:[o.data]}}};let bt;function xve(e){bt=e}function Sve(e){const t=bt&&bt.findCredential(e);return t&&t.token?xR(e,"token",t.token):e}V("host-webworker");const Xz=/^https:\/\/([a-z\d-]+)(\.maps([^.]*))?\.arcgis\.com/i,Zz={devext:{customBaseUrl:"mapsdevext.arcgis.com",portalHostname:"devext.arcgis.com"},qaext:{customBaseUrl:"mapsqa.arcgis.com",portalHostname:"qaext.arcgis.com"},www:{customBaseUrl:"maps.arcgis.com",portalHostname:"www.arcgis.com"}};function Mve(e){const t=e==null?void 0:e.match(Xz);if(!t)return null;const[,i,s,r]=t;if(!i)return null;let n=null,o=null,a=null;const{devext:l,qaext:u,www:d}=Zz;if(s)if(n=i,r)switch(r.toLowerCase()){case"devext":({customBaseUrl:o,portalHostname:a}=l);break;case"qa":({customBaseUrl:o,portalHostname:a}=u);break;default:return null}else({customBaseUrl:o,portalHostname:a}=d);else switch(i.toLowerCase()){case"devext":({customBaseUrl:o,portalHostname:a}=l);break;case"qaext":({customBaseUrl:o,portalHostname:a}=u);break;case"www":({customBaseUrl:o,portalHostname:a}=d);break;default:return null}return{customBaseUrl:o,isPortal:!1,portalHostname:a,urlKey:n}}function Qz(e){return/\/(sharing|usrsvcs)\/(appservices|servers)\//i.test(e)}const Kz=["elevation3d.arcgis.com","js.arcgis.com","jsdev.arcgis.com","jsqa.arcgis.com","static.arcgis.com"];function IR(e){const t=Lr(e,!0);return!!t&&t.endsWith(".arcgis.com")&&!Kz.includes(t)&&!e.endsWith("/sharing/rest/generateToken")}function e7(e,t,i=!1,s){return new Promise((r,n)=>{if(jr(s))return void n(oE());let o=()=>{u(),n(new Error(`Unable to load ${t}`))},a=()=>{const d=e;u(),r(d)},l=()=>{if(!e)return;const d=e;u(),d.src="",n(oE())};const u=()=>{V("esri-image-decode")||(e.removeEventListener("error",o),e.removeEventListener("load",a)),o=null,a=null,e=null,M(s)&&s.removeEventListener("abort",l),l=null,i&&URL.revokeObjectURL(t)};M(s)&&s.addEventListener("abort",l),V("esri-image-decode")?e.decode().then(a,o):(e.addEventListener("error",o),e.addEventListener("load",a))})}function oE(){try{return new DOMException("Aborted","AbortError")}catch{const e=new Error;return e.name="AbortError",e}}function t7(e){var i,s,r;je.request.crossOriginNoCorsDomains||(je.request.crossOriginNoCorsDomains={});const t=je.request.crossOriginNoCorsDomains;for(let n of e)n=n.toLowerCase(),/^https?:\/\//.test(n)?t[(i=Lr(n))!=null?i:""]=0:(t[(s=Lr("http://"+n))!=null?s:""]=0,t[(r=Lr("https://"+n))!=null?r:""]=0)}function i7(e){const t=je.request.crossOriginNoCorsDomains;if(t){let i=Lr(e);if(i)return i=i.toLowerCase(),!jf(i,ZM())&&t[i]o.abort());const a={controller:o,credential:void 0,credentialToken:void 0,fetchOptions:void 0,hasToken:!1,interceptor:n,params:r,redoRequest:!1,useIdentity:Tr.useIdentity,useProxy:!1,useSSL:!1,withCredentials:!1},l=await p7(a);return(u=n==null?void 0:n.after)==null||u.call(n,l),l}let j0;const Tr=je.request,ER="FormData"in globalThis,r7=[499,498,403,401],n7=["COM_0056","COM_0057","SB_0008"],o7=[/\/arcgis\/tokens/i,/\/sharing(\/rest)?\/generatetoken/i,/\/rest\/info/i],s$=()=>null,V0=Symbol();function a7(e){const t=Lr(e);t&&!kt._corsServers.includes(t)&&kt._corsServers.push(t)}function aE(e){const t=Lr(e);return!t||t.endsWith(".arcgis.com")||kt._corsServers.includes(t)||KM(t)}function Pr(e,t,i,s){let r="Error";const n={url:i.url,requestOptions:i.requestOptions,getHeader:s$,ssl:!1};if(t instanceof L)return t.details?(t.details=R(t.details),t.details.url=i.url,t.details.requestOptions=i.requestOptions):t.details=n,t;if(t){const o=s&&(u=>s.headers.get(u)),a=s&&s.status,l=t.message;l&&(r=l),o&&(n.getHeader=o),n.httpStatus=(t.httpCode!=null?t.httpCode:t.code)||a||0,n.subCode=t.subcode,n.messageCode=t.messageCode,typeof t.details=="string"?n.messages=[t.details]:n.messages=t.details,n.raw=V0 in t?t[V0]:t}return Ks(t)?_t():new L(e,r,n)}async function l7(){V("host-webworker")?j0||(j0=await z(()=>import("./request.aa5275d6.js"),[])):kt._abortableFetch||(kt._abortableFetch=globalThis.fetch.bind(globalThis))}async function T1(){bt||await z(()=>import("./IdentityManager.0784430d.js"),[])}async function c7(e){var a;const t=e.params.url,i=e.params.requestOptions,s=e.controller.signal,r=i.body;let n=null,o=null;if(ER&&"HTMLFormElement"in globalThis&&(r instanceof FormData?n=r:r instanceof HTMLFormElement&&(n=new FormData(r))),typeof r=="string"&&(o=r),e.fetchOptions={cache:i.cacheBust&&!kt._abortableFetch.polyfill?"no-cache":"default",credentials:"same-origin",headers:i.headers||{},method:i.method==="head"?"HEAD":"GET",mode:"cors",priority:Tr.priority,redirect:"follow",signal:s},(n||o)&&(e.fetchOptions.body=n||o),i.authMode==="anonymous"&&(e.useIdentity=!1),e.hasToken=!!(/token=/i.test(t)||((a=i.query)==null?void 0:a.token)||(n==null?void 0:n.get("token"))),!e.hasToken&&je.apiKey&&IR(t)&&(i.query||(i.query={}),i.query.token=je.apiKey,e.hasToken=!0),e.useIdentity&&!e.hasToken&&!e.credentialToken&&!kR(t)&&!jr(s)){let l;i.authMode==="immediate"?(await T1(),l=await bt.getCredential(t,{signal:s}),e.credential=l):i.authMode==="no-prompt"?(await T1(),l=await bt.getCredential(t,{prompt:!1,signal:s}).catch(()=>{}),e.credential=l):bt&&(l=bt.findCredential(t)),l&&(e.credentialToken=l.token,e.useSSL=!!l.ssl)}}function kR(e){return o7.some(t=>t.test(e))}async function u7(e){var m,y;let t=e.params.url;const i=e.params.requestOptions,s=(m=e.fetchOptions)!=null?m:{},r=ab(t)||hu(t),n=i.responseType||"json",o=r?0:i.timeout!=null?i.timeout:Tr.timeout;let a=!1;if(!r){e.useSSL&&(t=i$(t)),i.cacheBust&&s.cache==="default"&&(t=xR(t,"request.preventCache",Date.now()));let g={...i.query};e.credentialToken&&(g.token=e.credentialToken);let v=Nf(g);V("esri-url-encodes-apostrophe")&&(v=v.replace(/'/g,"%27"));const b=t.length+1+v.length;let _;a=i.method==="delete"||i.method==="post"||i.method==="put"||!!i.body||b>Tr.maxUrlLength;const x=i.useProxy||!!ob(t);if(x){const $=Az(t);_=$.path,!a&&_.length+1+b>Tr.maxUrlLength&&(a=!0),$.query&&(g={...$.query,...g})}if(s.method==="HEAD"&&(a||x)){if(a)throw b>Tr.maxUrlLength?Pr("request:invalid-parameters",new Error("URL exceeds maximum length"),e.params):Pr("request:invalid-parameters",new Error("cannot use POST request when method is 'head'"),e.params);if(x)throw Pr("request:invalid-parameters",new Error("cannot use proxy when method is 'head'"),e.params)}if(a?(s.method=i.method==="delete"?"DELETE":i.method==="put"?"PUT":"POST",i.body?t=w_(t,g):(s.body=Nf(g),s.headers||(s.headers={}),s.headers["Content-Type"]="application/x-www-form-urlencoded")):t=w_(t,g),x&&(e.useProxy=!0,t=`${_}?${t}`),g.token&&ER&&s.body instanceof FormData&&!Qz(t)&&s.body.set("token",g.token),i.hasOwnProperty("withCredentials"))e.withCredentials=i.withCredentials;else if(!jf(t,ZM())){if(KM(t))e.withCredentials=!0;else if(bt){const $=bt.findServerInfo(t);$&&$.webTierAuth&&(e.withCredentials=!0)}}e.withCredentials&&(s.credentials="include",i7(t)&&await s7(a?w_(t,g):t))}let l,u,d=0,f=!1;o>0&&(d=setTimeout(()=>{f=!0,e.controller.abort()},o));try{if(i.responseType==="native-request-init")u=s,u.url=t;else if(i.responseType!=="image"||s.cache!=="default"||s.method!=="GET"||a||d7(i.headers)||!r&&!e.useProxy&&Tr.proxyUrl&&!aE(t)){if(l=await kt._abortableFetch(t,s),e.useProxy||a7(t),i.responseType==="native")u=l;else if(s.method!=="HEAD")if(l.ok){switch(n){case"array-buffer":u=await l.arrayBuffer();break;case"blob":case"image":u=await l.blob();break;default:u=await l.text()}if(d&&(clearTimeout(d),d=0),n==="json"||n==="xml"||n==="document")if(u)switch(n){case"json":u=JSON.parse(u);break;case"xml":u=lE(u,"application/xml");break;case"document":u=lE(u,"text/html")}else u=null;if(u){if(n==="array-buffer"||n==="blob"){const g=l.headers.get("Content-Type");if(g&&/application\/json|text\/plain/i.test(g)&&u[n==="blob"?"size":"byteLength"]<=750)try{const v=await new Response(u).json();v.error&&(u=v)}catch{}}n==="image"&&u instanceof Blob&&(u=await cE(URL.createObjectURL(u),e,!0))}}else u=await l.text()}else u=await cE(t,e)}catch(g){if(g.name==="AbortError")throw f?new Error("Timeout exceeded"):_t("Request canceled");if(!(!l&&g instanceof TypeError&&Tr.proxyUrl)||i.body||i.method==="delete"||i.method==="head"||i.method==="post"||i.method==="put"||e.useProxy||aE(t))throw g;e.redoRequest=!0,Oz({proxyUrl:Tr.proxyUrl,urlPrefix:(y=Lr(t))!=null?y:""})}finally{d&&clearTimeout(d)}return[l,u]}async function h7(e,t){if(e.responseData!=null)return e.responseData;if(e.headers&&(t.requestOptions.headers={...t.requestOptions.headers,...e.headers}),e.query&&(t.requestOptions.query={...t.requestOptions.query,...e.query}),e.before){let i,s;try{s=await e.before(t)}catch(r){i=Pr("request:interceptor",r,t)}if((s instanceof Error||s instanceof L)&&(i=Pr("request:interceptor",s,t)),i)throw e.error&&e.error(i),i;return s}}function d7(e){if(e){for(const t of Object.getOwnPropertyNames(e))if(e[t])return!0}return!1}function lE(e,t){let i;try{i=new DOMParser().parseFromString(e,t)}catch{}if(!i||i.getElementsByTagName("parsererror").length)throw new SyntaxError("XML Parse error");return i}async function p7(e){var n;let t,i;await c7(e);try{do[t,i]=await u7(e);while(!await f7(e,t,i))}catch(o){const a=Pr("request:server",o,e.params,t);throw a.details.ssl=e.useSSL,e.interceptor&&e.interceptor.error&&e.interceptor.error(a),a}const s=e.params.url;if(i&&/\/sharing\/rest\/(accounts|portals)\/self/i.test(s)){if(!e.hasToken&&!e.credentialToken&&((n=i.user)==null?void 0:n.username)&&!KM(s)){const o=Lr(s,!0);o&&Tr.trustedServers.push(o)}Array.isArray(i.authorizedCrossOriginNoCorsDomains)&&t7(i.authorizedCrossOriginNoCorsDomains)}const r=e.credential;if(r&&bt){const o=bt.findServerInfo(r.server);let a=o&&o.owningSystemUrl;if(a){a=a.replace(/\/?$/,"/sharing");const l=bt.findCredential(a,r.userId);l&&bt._getIdenticalSvcIdx(a,l)===-1&&l.resources.unshift(a)}}return{data:i,getHeader:t?o=>t==null?void 0:t.headers.get(o):s$,requestOptions:e.params.requestOptions,ssl:e.useSSL,url:e.params.url}}async function f7(e,t,i){if(e.redoRequest)return e.redoRequest=!1,!1;const s=e.params.requestOptions;if(!t||s.responseType==="native"||s.responseType==="native-request-init")return!0;let r,n;if(!t.ok)throw r=new Error(`Unable to load ${t.url} status: ${t.status}`),r[V0]=i,r;i&&(i.error?r=i.error:i.status==="error"&&Array.isArray(i.messages)&&(r={...i},r[V0]=i,r.details=i.messages));let o,a=null;r&&(n=Number(r.code),a=r.hasOwnProperty("subcode")?Number(r.subcode):null,o=r.messageCode,o=o&&o.toUpperCase());const l=s.authMode;if(n===403&&(a===4||r.message&&r.message.toLowerCase().includes("ssl")&&!r.message.toLowerCase().includes("permission"))){if(!e.useSSL)return e.useSSL=!0,!1}else if(!e.hasToken&&e.useIdentity&&(l!=="no-prompt"||n===498)&&n!==void 0&&r7.includes(n)&&!kR(e.params.url)&&(n!==403||o&&!n7.includes(o)&&(a==null||a===2&&e.credentialToken))){await T1();try{const u=await bt.getCredential(e.params.url,{error:Pr("request:server",r,e.params),prompt:l!=="no-prompt",signal:e.controller.signal,token:e.credentialToken});return e.credential=u,e.credentialToken=u.token,e.useSSL=e.useSSL||u.ssl,!1}catch(u){if(l==="no-prompt")return e.credential=void 0,e.credentialToken=void 0,!1;r=u}}if(r)throw r;return!0}function cE(e,t,i=!1){const s=t.controller.signal,r=new Image;return t.withCredentials?r.crossOrigin="use-credentials":r.crossOrigin="anonymous",r.alt="",r.fetchPriority=Tr.priority,r.src=e,e7(r,e,i,s)}kt._abortableFetch=null,kt._corsServers=["https://server.arcgisonline.com","https://services.arcgisonline.com"];var m7=Object.freeze(Object.defineProperty({__proto__:null,default:kt},Symbol.toStringTag,{value:"Module"}));async function y7(e,t,i,s){const r=t.exec(i);if(!r)throw new L("esri-intl:invalid-bundle",`Bundle id "${i}" is not compatible with the pattern "${t}"`);const n=r[1]?`${r[1]}/`:"",o=r[2],a=bz(s),l=`${n}${o}.json`,u=a?`${n}${o}_${a}.json`:l;let d;try{d=await uE(e(u))}catch(f){if(u===l)throw new L("intl:unknown-bundle",`Bundle "${i}" cannot be loaded`,{error:f});try{d=await uE(e(l))}catch(m){throw new L("intl:unknown-bundle",`Bundle "${i}" cannot be loaded`,{error:m})}}return d}async function uE(e){if(M(hE.fetchBundleAsset))return hE.fetchBundleAsset(e);const t=await kt(e,{responseType:"text"});return JSON.parse(t.data)}class g7{constructor({base:t="",pattern:i,location:s=new URL(window.location.href)}){let r;r=typeof s=="string"?n=>new URL(n,new URL(s,window.location.href)).href:s instanceof URL?n=>new URL(n,s).href:s,this.pattern=typeof i=="string"?new RegExp(`^${i}`):i,this.getAssetUrl=r,t=t?t.endsWith("/")?t:t+"/":"",this.matcher=new RegExp(`^${t}(?:(.*)/)?(.*)$`)}fetchMessageBundle(t,i){return y7(this.getAssetUrl,this.matcher,t,i)}}function v7(e){return new g7(e)}const hE={},b7=q.getLogger("esri.assets");function Ne(e){if(!je.assetsPath)throw b7.errorOnce("The API assets location needs to be set using config.assetsPath. More information: https://arcg.is/1OzLe50"),new L("assets:path-not-set","config.assetsPath is not set");return Xc(je.assetsPath,e)}vz(v7({pattern:"esri/",location:Ne}));function r$(e){return typeof e=="string"?document.getElementById(e):e!=null?e:null}function CR(e){for(;e.hasChildNodes();)e.removeChild(e.firstChild)}function dE(e,t){const i=t.parentNode;i&&i.insertBefore(e,t)}function pE(e,t){for(;;){const i=e.firstChild;if(!i)break;t.appendChild(i)}}function $ve(e){const t=[];return function*(){yield*t;for(const i of e)t.push(i),yield i}}function _7(e,t){for(const i of e)if(i!=null&&t(i))return i}function z0(e){return e!=null&&typeof e[Symbol.iterator]=="function"}class qi{constructor(){this._groups=new Map}destroy(){this.removeAll()}get size(){let t=0;return this._groups.forEach(i=>{t+=i.length}),t}add(t,i){if(z0(t)){const s=this._getOrCreateGroup(i);for(const r of t)this._isHandle(r)&&s.push(r)}else this._isHandle(t)&&this._getOrCreateGroup(i).push(t);return this}forEach(t,i){if(typeof t=="function")this._groups.forEach(s=>s.forEach(t));else{const s=this._getGroup(t);s&&i&&s.forEach(i)}}has(t){return this._groups.has(this._ensureGroupKey(t))}remove(t){if(typeof t!="string"&&z0(t)){for(const i of t)this.remove(i);return this}return this.has(t)?(this._removeAllFromGroup(this._getGroup(t)),this._groups.delete(this._ensureGroupKey(t)),this):this}removeAll(){return this._groups.forEach(t=>this._removeAllFromGroup(t)),this._groups.clear(),this}_isHandle(t){return t&&!!t.remove}_getOrCreateGroup(t){if(this.has(t))return this._getGroup(t);const i=[];return this._groups.set(this._ensureGroupKey(t),i),i}_getGroup(t){return this._groups.get(this._ensureGroupKey(t))}_ensureGroupKey(t){return t||"_default_"}_removeAllFromGroup(t){t.forEach(i=>i.remove())}}function w7(e){return e&&e.release&&typeof e.release=="function"}function x7(e){return e&&e.acquire&&typeof e.acquire=="function"}class zr{constructor(t,i,s,r=1,n=0){if(this._ctor=t,this._acquireFunction=i,this._releaseFunction=s,this.allocationSize=r,this._pool=new Array(n),this._initialSize=n,this._ctor)for(let o=0;o=this._pool.length)){for(let i=t;i{t&&t.has(r)||i.set(r,R(s))}),i}get(t){return this._values.get(t)}originOf(){return Pe.USER}keys(){return[...this._values.keys()]}set(t,i){this._values.set(t,i)}delete(t){this._values.delete(t)}has(t){return this._values.has(t)}forEach(t){this._values.forEach(t)}}function oy(e,t,i){return e!==void 0}function mE(e,t,i,s){return e!==void 0&&(!(i==null&&e.flags&Be.NonNullable)||(s.lifecycle,_o.INITIALIZING,!1))}function M7(e){return e&&typeof e.destroy=="function"}q.getLogger("esri.core.accessorSupport.Properties");class $7{constructor(t){this.host=t,this.properties=new Map,this.ctorArgs=null,this.destroyed=!1,this.lifecycle=_o.INITIALIZING,this.store=new n$,this._origin=Pe.USER;const i=this.host.constructor.__accessorMetadata__,s=i.properties;for(const r in s){const n=new fE(this,r,s[r]);this.properties.set(r,n)}this.metadatas=s,this._autoDestroy=i.autoDestroy}initialize(){this.lifecycle=_o.CONSTRUCTING}constructed(){this.lifecycle=_o.CONSTRUCTED}destroy(){if(this.destroyed=!0,this._autoDestroy)for(const[t,i]of this.properties){const s=this.internalGet(t);s&&M7(s)&&(s.destroy(),~i.flags&Be.NonNullable&&this._internalSet(i,null)),i.destroy()}else for(const[t,i]of this.properties)i.destroy()}get initialized(){return this.lifecycle!==_o.INITIALIZING}get(t){const i=this.properties.get(t);if(i.metadata.get)return i.getComputed();_e(i);const s=this.store;return s.has(t)?s.get(t):i.metadata.value}originOf(t){const i=this.store.originOf(t);if(i===void 0){const s=this.properties.get(t);if(s!==void 0&&s.flags&Be.HasDefaultValue)return"defaults"}return B0(i)}has(t){return!!this.properties.has(t)&&this.store.has(t)}keys(){return[...this.properties.keys()]}internalGet(t){const i=this.properties.get(t);if(oy(i))return this.store.has(t)?this.store.get(t):i.metadata.value}internalSet(t,i){const s=this.properties.get(t);oy(s)&&this._internalSet(s,i)}getDependsInfo(t,i,s){const r=this.properties.get(i);if(!oy(r))return"";const n=new Set,o=Co({onObservableAccessed:l=>n.add(l),onTrackingEnd:()=>{}},()=>{var l;return(l=r.metadata.get)==null?void 0:l.call(t)});let a=`${s}${t.declaredClass.split(".").pop()}.${i}: ${o} `;if(n.size===0)return a;s+=" ";for(const l of n){if(!(l instanceof fE))continue;const u=l.properties.host,d=l.propertyName,f=ki(u);a+=f?f.getDependsInfo(u,d,s):`${s}${d}: undefined `}return a}setAtOrigin(t,i,s){const r=this.properties.get(t);if(oy(r))return this._setAtOrigin(r,i,s)}isOverridden(t){const i=this.properties.get(t);return i!==void 0&&!!(i.flags&Be.Overriden)}clearOverride(t){const i=this.properties.get(t);i!==void 0&&i.flags&Be.Overriden&&(i.flags&=~Be.Overriden,i.notifyChange())}override(t,i){const s=this.properties.get(t);if(!mE(s,t,i,this))return;const r=s.metadata.cast;if(r){const n=this._cast(r,i),{valid:o,value:a}=n;if(x_.release(n),!o)return;i=a}s.flags|=Be.Overriden,this._internalSet(s,i)}set(t,i){const s=this.properties.get(t);if(!mE(s,t,i,this))return;const r=s.metadata.cast;if(r){const o=this._cast(r,i),{valid:a,value:l}=o;if(x_.release(o),!a)return;i=l}const n=s.metadata.set;n?n.call(this.host,i):this._internalSet(s,i)}setDefaultOrigin(t){this._origin=Va(t)}getDefaultOrigin(){return B0(this._origin)}notifyChange(t){const i=this.properties.get(t);i!==void 0&&i.notifyChange()}invalidate(t){const i=this.properties.get(t);i!==void 0&&i.invalidate()}commit(t){const i=this.properties.get(t);i!==void 0&&i.commit()}_internalSet(t,i){const s=this.lifecycle!==_o.INITIALIZING?this._origin:Pe.DEFAULTS;this._setAtOrigin(t,i,s)}_setAtOrigin(t,i,s){const r=this.store,n=t.propertyName;r.has(n,s)&&DM(i,r.get(n))&&~t.flags&Be.Overriden&&s===r.originOf(n)||(t.invalidate(),r.set(n,i,s),t.commit(),W3(this.host,t))}_cast(t,i){const s=x_.acquire();return s.valid=!0,s.value=i,t&&(s.value=t.call(this.host,i,s)),s}}class T7{constructor(){this.value=null,this.valid=!0}acquire(){this.valid=!0}release(){this.value=null}}const x_=new zr(T7);function I7(e){e.length=0}class Vi{constructor(t=50,i=50){this._pool=new zr(Array,void 0,I7,i,t)}acquire(){return this._pool.acquire()}release(t){this._pool.release(t)}prune(){this._pool.prune(0)}static acquire(){return S_.acquire()}static release(t){return S_.release(t)}static prune(){S_.prune()}}const S_=new Vi(100);class AR extends zr{constructor(){super(...arguments),this._set=new Set}destroy(){super.destroy(),this._set=q6(this._set)}acquire(...t){const i=super.acquire(...t);return this._set.delete(i),i}release(t){t&&!this._set.has(t)&&(super.release(t),this._set.add(t))}_dispose(t){this._set.delete(t),super._dispose(t)}}const ay=[];function U0(e){ay.push(e),ay.length===1&&queueMicrotask(()=>{const t=ay.slice();ay.length=0;for(const i of t)i()})}class cf{constructor(t,i=30){this.name=t,this._counter=0,this._samples=new Array(i)}record(t){M(t)&&(this._samples[++this._counter%this._samples.length]=t)}get median(){return this._samples.slice().sort((t,i)=>t-i)[Math.floor(this._samples.length/2)]}get average(){return this._samples.reduce((t,i)=>t+i,0)/this._samples.length}get last(){return this._samples[this._counter%this._samples.length]}}var E1;(function(e){const t=(n,o,a,l)=>{let u=o,d=o;const f=a>>>1,m=n[u-1];for(;d<=f;){d=u<<1,dno?1:0;function s(n,o,a,l){o===void 0&&(o=0),a===void 0&&(a=n.length),l===void 0&&(l=i);for(let d=a>>>1;d>o;d--)t(n,d,a,l);const u=o+1;for(let d=a-1;d>o;d--){const f=n[o];n[o]=n[d],n[d]=f,t(n,u,d,l)}}function*r(n,o,a,l){o===void 0&&(o=0),a===void 0&&(a=n.length),l===void 0&&(l=i);for(let d=a>>>1;d>o;d--)t(n,d,a,l),yield;const u=o+1;for(let d=a-1;d>o;d--){const f=n[o];n[o]=n[d],n[d]=f,t(n,u,d,l),yield}}e.sort=s,e.iterableSort=r})(E1||(E1={}));const yE=E1,E7=1.5,k7=1.1;class Vc{constructor(t){this.data=[],this._length=0,this._allocator=void 0,this._deallocator=()=>null,this._shrink=()=>{},this._hint=new x3,t&&(t.initialSize&&(this.data=new Array(t.initialSize)),t.allocator&&(this._allocator=t.allocator),t.deallocator!==void 0&&(this._deallocator=t.deallocator),t.shrink&&(this._shrink=()=>gE(this)))}toArray(){return this.data.slice(0,this.length)}filter(t){const i=new Array;for(let s=0;s=this._length))return this.data[t]}includes(t,i){const s=this.data.indexOf(t,i);return s!==-1&&sthis._length){if(this._allocator){for(;this._length=this.length||t<0))return this.swapElements(t,this.length-1),this.pop()}removeUnorderedMany(t,i=t.length,s){this.length=Y6(this.data,t,this.length,i,this._hint,s),this._shrink()}front(){if(this.length!==0)return this.data[0]}back(){if(this.length!==0)return this.data[this.length-1]}swapElements(t,i){if(t>=this.length||i>=this.length||t===i)return;const s=this.data[t];this.data[t]=this.data[i],this.data[i]=s}sort(t){yE.sort(this.data,0,this.length,t)}iterableSort(t){return yE.iterableSort(this.data,0,this.length,t)}some(t,i){for(let s=0;sE7*e.length&&(e.data.length=Math.floor(e.length*k7))}function Tve(e){return e}class C7{constructor(t){this.phases=t,this.paused=!1,this.ticks=-1,this.removed=!1}}class P7{constructor(t){this.callback=t,this.isActive=!0}remove(){this.isActive=!1}}let k1=0;const Pd={time:0,deltaTime:0,elapsedFrameTime:0,frameDuration:0},C1=["prepare","preRender","render","postRender","update","finish"],P1=[],Zc=new Vc;class A7{constructor(t){this._task=t}remove(){this._task.removed=!0}pause(){this._task.paused=!0}resume(){this._task.paused=!1}}const q0={frameTasks:Zc,willDispatch:!1,clearFrameTasks:O7,dispatch:LR,executeFrameTasks:R7};function ad(e){const t=new P7(e);return P1.push(t),q0.willDispatch||(q0.willDispatch=!0,U0(LR)),t}function Dh(e){const t=new C7(e);return Zc.push(t),G0==null&&(k1=performance.now(),G0=requestAnimationFrame(OR)),new A7(t)}let G0=null;function O7(e=!1){Zc.forAll(t=>{t.removed=!0}),e&&RR()}function OR(){const e=performance.now();G0=null,G0=Zc.length>0?requestAnimationFrame(OR):null,q0.executeFrameTasks(e)}function R7(e){const t=e-k1;k1=e;const i=1e3/60,s=Math.max(0,t-i);for(let r=0;r{var l;a.paused||a.removed||(r===0&&a.ticks++,a.phases[o]&&(Pd.time=e,Pd.deltaTime=a.ticks===0?0:t,Pd.elapsedFrameTime=performance.now()-e,Pd.frameDuration=i-s,(l=a.phases[o])==null||l.call(a,Pd)))}),L7[r].record(performance.now()-n)}RR(),F7.record(performance.now()-e)}const ly=new Vc;function RR(){Zc.forAll(e=>{e.removed&&ly.push(e)}),Zc.removeUnorderedMany(ly.data,ly.length),ly.clear()}function LR(){for(;P1.length;){const e=P1.shift();e.isActive&&e.callback()}q0.willDispatch=!1}function Ive(e=1,t){const i=yz(),s=()=>{jr(t)?i.reject(_t()):e===0?i():(--e,U0(()=>s()))};return s(),i.promise}const L7=C1.map(e=>new cf(e)),F7=new cf("total");function D7(e,t){for(const i of e.entries())if(t(i[0]))return!0;return!1}let N7=0;function uf(){return++N7}class lb{constructor(t){this._notify=t,this._accessed=[],this._handles=[],this._invalidCount=0}destroy(){this._accessed.length=0,this.clear()}onInvalidated(){this._invalidCount++}onCommitted(){const t=this._invalidCount;if(t===1)return this._invalidCount=0,void this._notify();this._invalidCount=t>0?t-1:0}onObservableAccessed(t){this._accessed.includes(t)||this._accessed.push(t)}onTrackingEnd(){const t=this._handles,i=this._accessed;for(let s=0;ss())}}function B7(){const e=yg.acquire();e.length=To.size;let t=0;for(const i of To)e[t]=i,++t;return To.clear(),e}const A1=new Set;function U7(e){return A1.add(e),{remove(){A1.delete(e)}}}function q7(e,t,i){let s=j3(e,t,i,(r,n,o)=>{let a,l,u=DR(()=>$m(r,n),(d,f)=>{r.__accessor__.destroyed||a&&a.uid!==l?s.remove():(a||(a=Vf.acquireUntracked(d,o,f,r,n),l=a.uid),Y0(a))});return{remove:V3(()=>{u.remove(),a&&(a.uid!==l||a.removed||(a.removed=!0,Y0(a)),a=null),s=u=null})}});return s}function G7(e,t,i){const s=j3(e,t,i,(r,n,o)=>{let a=!1;return FR(()=>$m(r,n),(l,u)=>{r.__accessor__.destroyed?s.remove():a||(a=!0,DM(u,l)||o.call(r,l,u,n,r),a=!1)})});return s}function W7(e,t,i,s=!1){return!e.__accessor__||e.__accessor__.destroyed?{remove(){}}:s?G7(e,t,i):q7(e,t,i)}function H7(e,t,i){let s,r,n=DR(e,(o,a)=>{s&&s.uid!==r?n.remove():(s||(s=Vf.acquireTracked(o,t,a,i),r=s.uid),Y0(s))});return{remove:V3(()=>{n.remove(),s&&(s.uid!==r||s.removed||(s.removed=!0,Y0(s)),s=null),n=null})}}function Y7(e,t,i){let s=!1;return FR(e,(r,n)=>{s||(s=!0,i(n,r)||t(r,n),s=!1)})}function J7(e,t,i=!1,s=o9){return i?Y7(e,t,s):H7(e,t,s)}function vE(e){return D7(To,t=>t.oldValue===e)}var zR,BR;function X7(e){var t;if(e==null)return{value:e};if(Array.isArray(e))return{type:[e[0]],value:null};switch(typeof e){case"object":return((t=e.constructor)==null?void 0:t.__accessorMetadata__)||e instanceof Date?{type:e.constructor,value:e}:e;case"boolean":return{type:Boolean,value:e};case"string":return{type:String,value:e};case"number":return{type:Number,value:e};case"function":return{type:e,value:null};default:return}}const Pl=Symbol("Accessor-Handles"),O1=Symbol("Accessor-Initialized");class oe{constructor(...t){if(this[zR]=null,this[BR]=!1,this.constructor===oe)throw new Error("[accessor] cannot instantiate Accessor. This can be fixed by creating a subclass of Accessor");Object.defineProperty(this,"__accessor__",{enumerable:!1,value:new $7(this)}),t.length>0&&this.normalizeCtorArgs&&(this.__accessor__.ctorArgs=this.normalizeCtorArgs.apply(this,t))}static createSubclass(t={}){if(Array.isArray(t))throw new Error("Multi-inheritance unsupported since 4.16");const{properties:i,declaredClass:s,constructor:r}=t;delete t.declaredClass,delete t.properties,delete t.constructor;const n=this;class o extends n{constructor(...l){super(...l),this.inherited=null,r&&r.apply(this,l)}}Tm(o.prototype);for(const a in t){const l=t[a];o.prototype[a]=typeof l=="function"?function(...u){const d=this.inherited;let f;this.inherited=function(...m){if(n.prototype[a])return n.prototype[a].apply(this,m)};try{f=l.apply(this,u)}catch(m){throw this.inherited=d,m}return this.inherited=d,f}:t[a]}for(const a in i){const l=X7(i[a]);h(l)(o.prototype,a)}return S(s)(o)}postscript(t){const i=this.__accessor__,s=i.ctorArgs||t;i.initialize(),s&&(this.set(s),i.ctorArgs=null),i.constructed(),this.initialize(),this[O1]=!0}initialize(){}destroy(){this.destroyed||(this[Pl]=$t(this[Pl]),V7(this),this.__accessor__.destroy())}get constructed(){return this.__accessor__&&this.__accessor__.initialized||!1}get initialized(){return this[O1]}get destroyed(){return this.__accessor__&&this.__accessor__.destroyed||!1}commitProperty(t){this.get(t)}get(t){return O0(this,t)}hasOwnProperty(t){return this.__accessor__?this.__accessor__.has(t):Object.prototype.hasOwnProperty.call(this,t)}keys(){return this.__accessor__?this.__accessor__.keys():[]}set(t,i){return R0(this,t,i),this}watch(t,i,s){return W7(this,t,i,s)}own(t){this.addHandles(t)}addHandles(t,i){let s=this[Pl];N(s)&&(s=this[Pl]=new qi),s.add(t,i)}removeHandles(t){const i=this[Pl];N(i)||i.remove(t)}hasHandles(t){const i=this[Pl];return!!M(i)&&i.has(t)}_override(t,i){i===void 0?this.__accessor__.clearOverride(t):this.__accessor__.override(t,i)}_clearOverride(t){return this.__accessor__.clearOverride(t)}_overrideIfSome(t,i){i==null?this.__accessor__.clearOverride(t):this.__accessor__.override(t,i)}_isOverridden(t){return this.__accessor__.isOverridden(t)}notifyChange(t){this.__accessor__.notifyChange(t)}_get(t){return this.__accessor__.internalGet(t)}_set(t,i){return this.__accessor__.internalSet(t,i),this}}zR=Pl,BR=O1;class $h{constructor(){this._emitter=new $h.EventEmitter(this)}emit(t,i){return this._emitter.emit(t,i)}on(t,i){return this._emitter.on(t,i)}once(t,i){return this._emitter.once(t,i)}hasEventListener(t){return this._emitter.hasEventListener(t)}}(function(e){class t{constructor(r=null){this._target=r,this._listenersMap=null}clear(){this._listenersMap&&this._listenersMap.clear(),this._listenersMap=null}emit(r,n){const o=this._listenersMap&&this._listenersMap.get(r);if(!o)return!1;const a=this._target||this;return[...o].forEach(l=>{l.call(a,n)}),o.length>0}on(r,n){if(Array.isArray(r)){const a=r.map(l=>this.on(l,n));return Kv(a)}if(r.includes(","))throw new TypeError("Evented.on() with a comma delimited string of event types is not supported");this._listenersMap||(this._listenersMap=new Map);const o=this._listenersMap.get(r)||[];return o.push(n),this._listenersMap.set(r,o),{remove:()=>{const a=this._listenersMap&&this._listenersMap.get(r)||[],l=a.indexOf(n);l>=0&&a.splice(l,1)}}}once(r,n){const o=this.on(r,a=>{o.remove(),n.call(null,a)});return o}hasEventListener(r){const n=this._listenersMap&&this._listenersMap.get(r);return n!=null&&n.length>0}}e.EventEmitter=t,e.EventedMixin=s=>{let r=class extends s{constructor(){super(...arguments),this._emitter=new t}destroy(){this._emitter.clear()}emit(n,o){return this._emitter.emit(n,o)}on(n,o){return this._emitter.on(n,o)}once(n,o){return this._emitter.once(n,o)}hasEventListener(n){return this._emitter.hasEventListener(n)}};return r=c([S("esri.core.Evented")],r),r};let i=class extends oe{constructor(){super(...arguments),this._emitter=new $h.EventEmitter(this)}destroy(){this._emitter.clear()}emit(s,r){return this._emitter.emit(s,r)}on(s,r){return this._emitter.on(s,r)}once(s,r){return this._emitter.once(s,r)}hasEventListener(s){return this._emitter.hasEventListener(s)}};i=c([S("esri.core.Evented")],i),e.EventedAccessor=i})($h||($h={}));const jo=$h;var Pa;(function(e){e[e.PENDING=0]="PENDING",e[e.RESOLVED=1]="RESOLVED",e[e.REJECTED=2]="REJECTED"})(Pa||(Pa={}));class Z7{constructor(t){this.instance=t,this._resolver=Ao(),this._status=Pa.PENDING,this._resolvingPromises=[],this._resolver.promise.then(()=>{this._status=Pa.RESOLVED,this._cleanUp()},()=>{this._status=Pa.REJECTED,this._cleanUp()})}addResolvingPromise(t){this._resolvingPromises.push(t),this._tryResolve()}isResolved(){return this._status===Pa.RESOLVED}isRejected(){return this._status===Pa.REJECTED}isFulfilled(){return this._status!==Pa.PENDING}abort(){this._resolver.reject(_t())}when(t,i){return this._resolver.promise.then(t,i)}_cleanUp(){this._allPromise=this._resolvingPromises=this._allPromise=null}_tryResolve(){if(this.isFulfilled())return;const t=Ao(),i=[...this._resolvingPromises,t.promise],s=this._allPromise=Promise.all(i);s.then(()=>{this.isFulfilled()||this._allPromise!==s||this._resolver.resolve(this.instance)},r=>{this.isFulfilled()||this._allPromise!==s||Ks(r)||this._resolver.reject(r)}),t.resolve()}}const cb=e=>{let t=class extends e{constructor(...i){super(...i),this._promiseProps=new Z7(this),this.addResolvingPromise(Promise.resolve())}isResolved(){return this._promiseProps.isResolved()}isRejected(){return this._promiseProps.isRejected()}isFulfilled(){return this._promiseProps.isFulfilled()}when(i,s){return new Promise((r,n)=>{this._promiseProps.when(r,n)}).then(i,s)}catch(i){return this.when(null,i)}addResolvingPromise(i){i&&!this._promiseProps.isFulfilled()&&this._promiseProps.addResolvingPromise("_promiseProps"in i?i.when():i)}};return t=c([S("esri.core.Promise")],t),t};let J0=class extends cb(oe){};J0=c([S("esri.core.Promise")],J0);function Z(e,t,i={}){return o$(e,t,i,UR)}function Qs(e,t,i={}){return o$(e,t,i,qR)}function o$(e,t,i={},s){let r=null;const n=i.once?(o,a)=>{s(o)&&(Bt(r),t(o,a))}:(o,a)=>{s(o)&&t(o,a)};if(r=J7(e,n,i.sync,i.equals),i.initial){const o=e();n(o,o)}return r}function Is(e,t,i,s={}){let r=null,n=null,o=null;function a(){var d;r&&n&&(n.remove(),(d=s.onListenerRemove)==null||d.call(s,r),r=null,n=null)}function l(d){s.once&&s.once&&Bt(o),i(d)}const u=Z(e,(d,f)=>{var m;a(),ib(d)&&(r=d,n=sb(d,t,l),(m=s.onListenerAdd)==null||m.call(s,d))},{sync:s.sync,initial:!0});return o=nd(()=>{u.remove(),a()}),o}function ub(e,t){return Q7(e,qR,t)}function Q7(e,t,i){if(jr(i))return Promise.reject(_t());const s=e();if(t!=null&&t(s))return Promise.resolve(s);let r=null;function n(){r=Bt(r)}return new Promise((o,a)=>{r=Kv([Vr(i,()=>{n(),a(_t())}),o$(e,l=>{n(),o(l)},{sync:!1,once:!0},t!=null?t:UR)])})}function UR(e){return!0}function qR(e){return!!e}const Nh={sync:!0},Le={initial:!0},Al={sync:!0,initial:!0},K7="randomUUID"in crypto;function eB(){if(K7)return crypto.randomUUID();const e=crypto.getRandomValues(new Uint16Array(8));e[3]=4095&e[3]|16384,e[4]=16383&e[4]|32768;const t=i=>e[i].toString(16).padStart(4,"0");return t(0)+t(1)+"-"+t(2)+"-"+t(3)+"-"+t(4)+"-"+t(5)+t(6)+t(7)}/*! * @esri/arcgis-html-sanitizer - v3.0.1 - Tue Nov 15 2022 09:46:54 GMT-0800 (Pacific Standard Time) @@ -45,14 +45,14 @@ var D6=Object.defineProperty;var N6=(e,t,i)=>t in e?D6(e,t,{enumerable:!0,config AXIS["Geocentric Y",OTHER], AXIS["Geocentric Z",NORTH], AUTHORITY["EPSG","4978"] -]`});function Qve(e){return e&&(yb(e)||e===ov)?ov:e&&(gb(e)||e===av)?av:bF}function mW(e){return M(e)&&(yb(e)||e===ov)?Io:M(e)&&(gb(e)||e===av)?rl:it}function Kve(e){return b$(e)?Io:_$(e)?rl:it}const ebe=39.37,yW=it.radius*Math.PI/200,_F=/UNIT\[([^\]]+)\]\]$/i,zc=w,wF=/UNIT\[([^\]]+)\]/i,gW=new Set([4261,4305,4807,4810,4811,4812,4816,4819,4821,4901,4902,37225,104139,104140]),vW=mi()({meter:"meters",foot:"feet",foot_us:"us-feet",foot_clarke:"clarke-feet",yard_clarke:"clarke-yards",link_clarke:"clarke-links",yard_sears:"sears-yards",foot_sears:"sears-feet",chain_sears:"sears-chains",chain_benoit_1895_b:"benoit-1895-b-chains",yard_indian:"indian-yards",yard_indian_1937:"indian-1937-yards",foot_gold_coast:"gold-coast-feet",chain_sears_1922_truncated:"sears-1922-truncated-chains","50_kilometers":"50-kilometers","150_kilometers":"150-kilometers"}),Hr=e=>e*e,Uo=e=>e*e*e,Gf={length:{baseUnit:"meters",units:{millimeters:{inBaseUnits:.001},centimeters:{inBaseUnits:.01},decimeters:{inBaseUnits:.1},meters:{inBaseUnits:1},kilometers:{inBaseUnits:1e3},inches:{inBaseUnits:.0254},feet:{inBaseUnits:.3048},yards:{inBaseUnits:.9144},miles:{inBaseUnits:1609.344},"nautical-miles":{inBaseUnits:1852},"us-feet":{inBaseUnits:1200/3937}}},area:{baseUnit:"square-meters",units:{"square-millimeters":{inBaseUnits:Hr(.001)},"square-centimeters":{inBaseUnits:Hr(.01)},"square-decimeters":{inBaseUnits:Hr(.1)},"square-meters":{inBaseUnits:1},"square-kilometers":{inBaseUnits:Hr(1e3)},"square-inches":{inBaseUnits:Hr(.0254)},"square-feet":{inBaseUnits:Hr(.3048)},"square-yards":{inBaseUnits:Hr(.9144)},"square-miles":{inBaseUnits:Hr(1609.344)},"square-us-feet":{inBaseUnits:Hr(1200/3937)},acres:{inBaseUnits:.0015625*Hr(1609.344)},ares:{inBaseUnits:100},hectares:{inBaseUnits:1e4}}},volume:{baseUnit:"liters",units:{liters:{inBaseUnits:1},"cubic-millimeters":{inBaseUnits:1e3*Uo(.001)},"cubic-centimeters":{inBaseUnits:1e3*Uo(.01)},"cubic-decimeters":{inBaseUnits:1e3*Uo(.1)},"cubic-meters":{inBaseUnits:1e3},"cubic-kilometers":{inBaseUnits:1e3*Uo(1e3)},"cubic-inches":{inBaseUnits:1e3*Uo(.0254)},"cubic-feet":{inBaseUnits:1e3*Uo(.3048)},"cubic-yards":{inBaseUnits:1e3*Uo(.9144)},"cubic-miles":{inBaseUnits:1e3*Uo(1609.344)}}},angle:{baseUnit:"radians",units:{radians:{inBaseUnits:1},degrees:{inBaseUnits:Math.PI/180}}}},bW=(()=>{const e={};for(const t in Gf)for(const i in Gf[t].units)e[i]=t;return e})();function _W(e,t,i){return e*Gf[i].units[t].inBaseUnits}function wW(e,t,i){return e/Gf[i].units[t].inBaseUnits}function U1(e){const t=bW[e];if(!t)throw new Error("unknown type");return t}function WE(e,t=null){return t=t||U1(e),Gf[t].baseUnit===e}function Fs(e,t,i){if(t===i)return e;const s=U1(t);if(s!==U1(i))throw new Error("incompatible units");const r=WE(t,s)?e:_W(e,t,s);return WE(i,s)?r:wW(r,i,s)}function xW(e,t,i){return Fs(e,t,"meters")/(i*Math.PI/180)}function xF(e){return vW.fromJSON(e.toLowerCase())||null}function Vh(e){if(M(e)&&!lW(e))return 1;const t=Pm(e);return t>1e5?1:t}function SW(e){return Pm(e)>=mW(e).metersPerDegree?"meters":$W(e)}function Pm(e,t=it.metersPerDegree){return FM(MW(e,!0),t)}function MW(e,t=!1){const i=M(e)?e.wkid:null,s=M(e)?e.wkt:null;let r=null;if(i){if(b$(i))return Io.metersPerDegree;if(_$(i))return rl.metersPerDegree;r=zc.values[zc[i]],!r&&t&&gW.has(i)&&(r=yW)}else s&&($F(s)?r=HE(_F.exec(s),r):MF(s)&&(r=HE(wF.exec(s),r)));return r}function HE(e,t){return e&&e[1]?SF(e[1]):t}function SF(e){return parseFloat(e.split(",")[1])}function $W(e){const t=M(e)?e.wkid:null,i=M(e)?e.wkt:null;let s=null;if(t)s=zc.units[zc[t]];else if(i){const r=$F(i)?_F:MF(i)?wF:null;if(r){const n=r.exec(i);n&&n[1]&&(s=IW(n[1]))}}return M(s)?xF(s):null}function MF(e){return/^GEOCCS/i.test(e)}function $F(e){return/^PROJCS/i.test(e)}const TW=1e-7;function IW(e){const t=/[\\"\\']{1}([^\\"\\']+)/.exec(e);let i=t&&t[1];if(!i||!zc.units.includes(i)){const s=SF(e);i=null;const r=zc.values;for(let n=0;n0?(i[0]=2*(a*o+d*s+l*n-u*r)/f,i[1]=2*(l*o+d*r+u*s-a*n)/f,i[2]=2*(u*o+d*n+a*r-l*s)/f):(i[0]=2*(a*o+d*s+l*n-u*r),i[1]=2*(l*o+d*r+u*s-a*n),i[2]=2*(u*o+d*n+a*r-l*s)),CF(e,t,i),e}const WW=On();function HW(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function YW(e,t){const i=t[0],s=t[1],r=t[2],n=t[4],o=t[5],a=t[6],l=t[8],u=t[9],d=t[10];return e[0]=Math.sqrt(i*i+s*s+r*r),e[1]=Math.sqrt(n*n+o*o+a*a),e[2]=Math.sqrt(l*l+u*u+d*d),e}function JW(e,t){const i=t[0]+t[5]+t[10];let s=0;return i>0?(s=2*Math.sqrt(i+1),e[3]=.25*s,e[0]=(t[6]-t[9])/s,e[1]=(t[8]-t[2])/s,e[2]=(t[1]-t[4])/s):t[0]>t[5]&&t[0]>t[10]?(s=2*Math.sqrt(1+t[0]-t[5]-t[10]),e[3]=(t[6]-t[9])/s,e[0]=.25*s,e[1]=(t[1]+t[4])/s,e[2]=(t[8]+t[2])/s):t[5]>t[10]?(s=2*Math.sqrt(1+t[5]-t[0]-t[10]),e[3]=(t[8]-t[2])/s,e[0]=(t[1]+t[4])/s,e[1]=.25*s,e[2]=(t[6]+t[9])/s):(s=2*Math.sqrt(1+t[10]-t[0]-t[5]),e[3]=(t[1]-t[4])/s,e[0]=(t[8]+t[2])/s,e[1]=(t[6]+t[9])/s,e[2]=.25*s),e}function XW(e,t,i,s){const r=t[0],n=t[1],o=t[2],a=t[3],l=r+r,u=n+n,d=o+o,f=r*l,m=r*u,y=r*d,g=n*u,v=n*d,b=o*d,_=a*l,x=a*u,$=a*d,I=s[0],T=s[1],k=s[2];return e[0]=(1-(g+b))*I,e[1]=(m+$)*I,e[2]=(y-x)*I,e[3]=0,e[4]=(m-$)*T,e[5]=(1-(f+b))*T,e[6]=(v+_)*T,e[7]=0,e[8]=(y+x)*k,e[9]=(v-_)*k,e[10]=(1-(f+g))*k,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function ZW(e,t,i,s,r){const n=t[0],o=t[1],a=t[2],l=t[3],u=n+n,d=o+o,f=a+a,m=n*u,y=n*d,g=n*f,v=o*d,b=o*f,_=a*f,x=l*u,$=l*d,I=l*f,T=s[0],k=s[1],A=s[2],F=r[0],G=r[1],U=r[2],J=(1-(v+_))*T,H=(y+I)*T,te=(g-$)*T,se=(y-I)*k,me=(1-(m+_))*k,Ee=(b+x)*k,re=(g+$)*A,ne=(b-x)*A,ke=(1-(m+v))*A;return e[0]=J,e[1]=H,e[2]=te,e[3]=0,e[4]=se,e[5]=me,e[6]=Ee,e[7]=0,e[8]=re,e[9]=ne,e[10]=ke,e[11]=0,e[12]=i[0]+F-(J*F+se*G+re*U),e[13]=i[1]+G-(H*F+me*G+ne*U),e[14]=i[2]+U-(te*F+Ee*G+ke*U),e[15]=1,e}function QW(e,t){const i=t[0],s=t[1],r=t[2],n=t[3],o=i+i,a=s+s,l=r+r,u=i*o,d=s*o,f=s*a,m=r*o,y=r*a,g=r*l,v=n*o,b=n*a,_=n*l;return e[0]=1-f-g,e[1]=d+_,e[2]=m-b,e[3]=0,e[4]=d-_,e[5]=1-u-g,e[6]=y+v,e[7]=0,e[8]=m+b,e[9]=y-v,e[10]=1-u-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function KW(e,t,i,s,r,n,o){const a=1/(i-t),l=1/(r-s),u=1/(n-o);return e[0]=2*n*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*n*l,e[6]=0,e[7]=0,e[8]=(i+t)*a,e[9]=(r+s)*l,e[10]=(o+n)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*n*2*u,e[15]=0,e}function eH(e,t,i,s,r){const n=1/Math.tan(t/2);let o;return e[0]=n/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0?(o=1/(s-r),e[10]=(r+s)*o,e[14]=2*r*s*o):(e[10]=-1,e[14]=-2*s),e}function tH(e,t,i,s){const r=Math.tan(t.upDegrees*Math.PI/180),n=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),l=2/(o+a),u=2/(r+n);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-(o-a)*l*.5,e[9]=(r-n)*u*.5,e[10]=s/(i-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*i/(i-s),e[15]=0,e}function iH(e,t,i,s,r,n,o){const a=1/(t-i),l=1/(s-r),u=1/(n-o);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+i)*a,e[13]=(r+s)*l,e[14]=(o+n)*u,e[15]=1,e}function sH(e,t,i,s){let r,n,o,a,l,u,d,f,m,y;const g=t[0],v=t[1],b=t[2],_=s[0],x=s[1],$=s[2],I=i[0],T=i[1],k=i[2],A=er();return Math.abs(g-I)0&&(y=1/Math.sqrt(y),d*=y,f*=y,m*=y);let g=l*m-u*f,v=u*d-a*m,b=a*f-l*d;return y=g*g+v*v+b*b,y>0&&(y=1/Math.sqrt(y),g*=y,v*=y,b*=y),e[0]=g,e[1]=v,e[2]=b,e[3]=0,e[4]=f*b-m*v,e[5]=m*g-d*b,e[6]=d*v-f*g,e[7]=0,e[8]=d,e[9]=f,e[10]=m,e[11]=0,e[12]=r,e[13]=n,e[14]=o,e[15]=1,e}function nH(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function oH(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2+e[9]**2+e[10]**2+e[11]**2+e[12]**2+e[13]**2+e[14]**2+e[15]**2)}function aH(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e[6]=t[6]+i[6],e[7]=t[7]+i[7],e[8]=t[8]+i[8],e[9]=t[9]+i[9],e[10]=t[10]+i[10],e[11]=t[11]+i[11],e[12]=t[12]+i[12],e[13]=t[13]+i[13],e[14]=t[14]+i[14],e[15]=t[15]+i[15],e}function PF(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e[6]=t[6]-i[6],e[7]=t[7]-i[7],e[8]=t[8]-i[8],e[9]=t[9]-i[9],e[10]=t[10]-i[10],e[11]=t[11]-i[11],e[12]=t[12]-i[12],e[13]=t[13]-i[13],e[14]=t[14]-i[14],e[15]=t[15]-i[15],e}function lH(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12]*i,e[13]=t[13]*i,e[14]=t[14]*i,e[15]=t[15]*i,e}function cH(e,t,i,s){return e[0]=t[0]+i[0]*s,e[1]=t[1]+i[1]*s,e[2]=t[2]+i[2]*s,e[3]=t[3]+i[3]*s,e[4]=t[4]+i[4]*s,e[5]=t[5]+i[5]*s,e[6]=t[6]+i[6]*s,e[7]=t[7]+i[7]*s,e[8]=t[8]+i[8]*s,e[9]=t[9]+i[9]*s,e[10]=t[10]+i[10]*s,e[11]=t[11]+i[11]*s,e[12]=t[12]+i[12]*s,e[13]=t[13]+i[13]*s,e[14]=t[14]+i[14]*s,e[15]=t[15]+i[15]*s,e}function uH(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function hH(e,t){if(e===t)return!0;const i=e[0],s=e[1],r=e[2],n=e[3],o=e[4],a=e[5],l=e[6],u=e[7],d=e[8],f=e[9],m=e[10],y=e[11],g=e[12],v=e[13],b=e[14],_=e[15],x=t[0],$=t[1],I=t[2],T=t[3],k=t[4],A=t[5],F=t[6],G=t[7],U=t[8],J=t[9],H=t[10],te=t[11],se=t[12],me=t[13],Ee=t[14],re=t[15],ne=er();return Math.abs(i-x)<=ne*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(s-$)<=ne*Math.max(1,Math.abs(s),Math.abs($))&&Math.abs(r-I)<=ne*Math.max(1,Math.abs(r),Math.abs(I))&&Math.abs(n-T)<=ne*Math.max(1,Math.abs(n),Math.abs(T))&&Math.abs(o-k)<=ne*Math.max(1,Math.abs(o),Math.abs(k))&&Math.abs(a-A)<=ne*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(l-F)<=ne*Math.max(1,Math.abs(l),Math.abs(F))&&Math.abs(u-G)<=ne*Math.max(1,Math.abs(u),Math.abs(G))&&Math.abs(d-U)<=ne*Math.max(1,Math.abs(d),Math.abs(U))&&Math.abs(f-J)<=ne*Math.max(1,Math.abs(f),Math.abs(J))&&Math.abs(m-H)<=ne*Math.max(1,Math.abs(m),Math.abs(H))&&Math.abs(y-te)<=ne*Math.max(1,Math.abs(y),Math.abs(te))&&Math.abs(g-se)<=ne*Math.max(1,Math.abs(g),Math.abs(se))&&Math.abs(v-me)<=ne*Math.max(1,Math.abs(v),Math.abs(me))&&Math.abs(b-Ee)<=ne*Math.max(1,Math.abs(b),Math.abs(Ee))&&Math.abs(_-re)<=ne*Math.max(1,Math.abs(_),Math.abs(re))}function dH(e){const t=er(),i=e[0],s=e[1],r=e[2],n=e[4],o=e[5],a=e[6],l=e[8],u=e[9],d=e[10];return Math.abs(1-(i*i+n*n+l*l))<=t&&Math.abs(1-(s*s+o*o+u*u))<=t&&Math.abs(1-(r*r+a*a+d*d))<=t}const pH=EF,fH=PF;Object.freeze(Object.defineProperty({__proto__:null,copy:CW,set:pl,identity:vb,transpose:Vo,invert:PW,adjoint:AW,determinant:OW,multiply:EF,translate:RW,scale:LW,rotate:FW,rotateX:DW,rotateY:NW,rotateZ:jW,fromTranslation:kF,fromScaling:VW,fromRotation:zW,fromXRotation:BW,fromYRotation:UW,fromZRotation:qW,fromRotationTranslation:CF,fromQuat2:GW,getTranslation:HW,getScaling:YW,getRotation:JW,fromRotationTranslationScale:XW,fromRotationTranslationScaleOrigin:ZW,fromQuat:QW,frustum:KW,perspective:eH,perspectiveFromFieldOfView:tH,ortho:iH,lookAt:sH,targetTo:rH,str:nH,frob:oH,add:aH,subtract:PF,multiplyScalar:lH,multiplyScalarAndAdd:cH,exactEquals:uH,equals:hH,isOrthoNormal:dH,mul:pH,sub:fH},Symbol.toStringTag,{value:"Module"}));function Q(e,t,i){let s,r;return t===void 0||Array.isArray(t)?(r=e,i=t,s=[void 0]):(r=t,s=Array.isArray(e)?e:[e]),(n,o)=>{const a=n.constructor.prototype;s.forEach(l=>{const u=U3(n,l,r);u.read&&typeof u.read=="object"||(u.read={}),u.read.reader=a[o],i&&(u.read.source=(u.read.source||[]).concat(i))})}}let Jr=class extends W{constructor(...e){super(...e),this.type=null,this.hasM=!1,this.hasZ=!1,this.spatialReference=xe.WGS84}get cache(){return this.commitProperty("spatialReference"),{}}get extent(){return null}readSpatialReference(e,t){if(e instanceof xe)return e;if(e!=null){const i=new xe;return i.read(e,t),i}return e}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}clearCache(){this.notifyChange("cache")}getCacheValue(e){return this.cache[e]}setCacheValue(e,t){this.cache[e]=t}};c([h()],Jr.prototype,"type",void 0),c([h({readOnly:!0})],Jr.prototype,"cache",null),c([h({readOnly:!0})],Jr.prototype,"extent",null),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],Jr.prototype,"hasM",void 0),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],Jr.prototype,"hasZ",void 0),c([h({type:xe,json:{write:!0}})],Jr.prototype,"spatialReference",void 0),c([Q("spatialReference")],Jr.prototype,"readSpatialReference",null),Jr=c([S("esri.geometry.Geometry")],Jr);const fl=Jr;function mH(e,t){const i=e.x-t.x,s=e.y-t.y,r=e.hasZ&&t.hasZ?e.z-t.z:0;return Math.sqrt(i*i+s*s+r*r)}const yH=57.29577951308232,gH=.017453292519943;function YE(e){return e*yH}function JE(e){return e*gH}function tbe(e){return Math.PI/2-2*Math.atan(Math.exp(-e/it.radius))}function q1(e){return e.wkid!=null||e.wkt!=null}const k_=[0,0];function lv(e,t,i,s,r){const n=e,o=r;if(o.spatialReference=i,"x"in n&&"x"in o)[o.x,o.y]=t(n.x,n.y,k_,s);else if("xmin"in n&&"xmin"in o)[o.xmin,o.ymin]=t(n.xmin,n.ymin,k_,s),[o.xmax,o.ymax]=t(n.xmax,n.ymax,k_,s);else if("paths"in n&&"paths"in o||"rings"in n&&"rings"in o){const a="paths"in n?n.paths:n.rings,l=[];let u;for(let d=0;d2&&u[m].push(f[m][2]),f[m].length>3&&u[m].push(f[m][3])}"paths"in o?o.paths=l:o.rings=l}else if("points"in n&&"points"in o){const a=n.points,l=[];for(let u=0;u2&&l[u].push(a[u][2]),a[u].length>3&&l[u].push(a[u][3]);o.points=l}return r}function vg(e,t){const i=e&&(q1(e)?e:e.spatialReference),s=t&&(q1(t)?t:t.spatialReference);return!(e&&"type"in e&&e.type==="mesh"||t&&"type"in t&&t.type==="mesh"||!i||!s)&&(!!Kt(s,i)||tu(s)&&qf(i)||tu(i)&&qf(s))}function bb(e,t){if(N(e))return null;const i=e.spatialReference,s=t&&(q1(t)?t:t.spatialReference);return vg(i,s)?Kt(i,s)?R(e):tu(s)?lv(e,ph,xe.WebMercator,!1,R(e)):qf(s)?lv(e,df,xe.WGS84,!1,R(e)):null:null}function ph(e,t,i=[0,0]){t>89.99999?t=89.99999:t<-89.99999&&(t=-89.99999);const s=JE(t);return i[0]=JE(e)*it.radius,i[1]=it.halfSemiMajorAxis*Math.log((1+Math.sin(s))/(1-Math.sin(s))),i}function df(e,t,i=[0,0],s=!1){const r=YE(e/it.radius);return i[0]=s?r:r-360*Math.floor((r+180)/360),i[1]=YE(Math.PI/2-2*Math.atan(Math.exp(-t/it.radius))),i}function Za(e,t=!1,i=R(e)){return lv(e,ph,xe.WebMercator,t,i)}function op(e,t=!1,i=R(e)){return lv(e,df,xe.WGS84,t,i)}var bg;const Rd=[0,0];function XE(e){return e&&(e.declaredClass==="esri.geometry.SpatialReference"||e.wkid!=null)}let Li=bg=class extends fl{constructor(...e){super(...e),this.x=0,this.y=0,this.z=void 0,this.m=void 0,this.type="point"}static copy(e,t){t._set("x",e._get("x")),t._set("y",e._get("y")),t._set("z",e._get("z")),t._set("m",e._get("m"));const i=e._get("spatialReference");t._set("spatialReference",Object.isFrozen(i)?i:i.clone())}normalizeCtorArgs(e,t,i,s,r){let n;if(Array.isArray(e))n=e,r=t,e=n[0],t=n[1],i=n[2],s=n[3];else if(e&&typeof e=="object"){if(n=e,e=n.x!=null?n.x:n.longitude,t=n.y!=null?n.y:n.latitude,i=n.z,s=n.m,(r=n.spatialReference)&&r.declaredClass!=="esri.geometry.SpatialReference"&&(r=new xe(r)),n.longitude!=null||n.latitude!=null){if(n.longitude==null)q.getLogger(this.declaredClass).warn(".longitude=","Latitude was defined without longitude");else if(n.latitude==null)q.getLogger(this.declaredClass).warn(".latitude=","Longitude was defined without latitude");else if(!n.declaredClass&&r&&r.isWebMercator){const a=ph(n.longitude,n.latitude,Rd);e=a[0],t=a[1]}}}else XE(i)?(r=i,i=null):XE(s)&&(r=s,s=null);const o={x:e,y:t};return o.x==null&&o.y!=null?q.getLogger(this.declaredClass).warn(".y=","Y coordinate was defined without an X coordinate"):o.y==null&&o.x!=null&&q.getLogger(this.declaredClass).warn(".x=","X coordinate was defined without a Y coordinate"),r!=null&&(o.spatialReference=r),i!=null&&(o.z=i),s!=null&&(o.m=s),o}get cache(){return this.commitProperty("x"),this.commitProperty("y"),this.commitProperty("z"),this.commitProperty("m"),this.commitProperty("spatialReference"),{}}get hasM(){return this.m!==void 0}set hasM(e){e!==(this._get("m")!==void 0)&&(this._set("m",e?0:void 0),this._set("hasM",e))}get hasZ(){return this.z!==void 0}set hasZ(e){e!==(this._get("z")!==void 0)&&(this._set("z",e?0:void 0),this._set("hasZ",e))}get latitude(){const{spatialReference:e,x:t,y:i}=this;if(e){if(e.isWebMercator)return df(t,i,Rd)[1];if(e.isGeographic)return i}return null}set latitude(e){const{spatialReference:t,x:i}=this;e!=null&&t&&(t.isWebMercator?this._set("y",ph(i,e,Rd)[1]):t.isGeographic&&this._set("y",e),this._set("latitude",e))}get longitude(){const{x:e,y:t,spatialReference:i}=this;if(i){if(i.isWebMercator)return df(e,t,Rd)[0];if(i.isGeographic)return e}return null}set longitude(e){const{y:t,spatialReference:i}=this;e!=null&&i&&(i.isWebMercator?this._set("x",ph(e,t,Rd)[0]):i.isGeographic&&this._set("x",e),this._set("longitude",e))}writeX(e,t,i){t[i]=isNaN(e)?"NaN":e}readX(e){return typeof e=="string"?NaN:e}clone(){const e=new bg;return e.x=this.x,e.y=this.y,e.z=this.z,e.m=this.m,e.spatialReference=this.spatialReference,e}copy(e){return bg.copy(e,this),this}equals(e){if(N(e))return!1;const{x:t,y:i,z:s,m:r,spatialReference:n}=this,{z:o,m:a}=e;let{x:l,y:u,spatialReference:d}=e;if(!n.equals(d))if(n.isWebMercator&&d.isWGS84)[l,u]=ph(l,u),d=n;else{if(!n.isWGS84||!d.isWebMercator)return!1;[l,u]=df(l,u),d=n}return t===l&&i===u&&s===o&&r===a&&n.wkid===d.wkid}offset(e,t,i){var s;return this.x+=e,this.y+=t,i!=null&&(this.z=((s=this.z)!=null?s:0)+i),this}normalize(){if(!this.spatialReference)return this;const e=Dr(this.spatialReference);if(!e)return this;let t=this.x;const[i,s]=e.valid,r=2*s;let n;return t>s?(n=Math.ceil(Math.abs(t-s)/r),t-=n*r):tisNaN(e)?e:Ys(e))],Li.prototype,"x",void 0),c([ie("x")],Li.prototype,"writeX",null),c([Q("x")],Li.prototype,"readX",null),c([h({type:Number,json:{write:!0}})],Li.prototype,"y",void 0),c([h({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasZ}}}}})],Li.prototype,"z",void 0),c([h({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasM}}}}})],Li.prototype,"m",void 0),Li=bg=c([S("esri.geometry.Point")],Li),Li.prototype.toJSON.isDefaultToJSON=!0;const be=Li,C_=[0,0];function _b(e,t){return!!M(t)&&ji(e,t.x,t.y,t.z)}function ibe(e,t){if(!t.points||t.points.length)return!1;for(const i of t.points)if(!zh(e,i))return!1;return!0}function vH(e,t){const{xmin:i,ymin:s,zmin:r,xmax:n,ymax:o,zmax:a}=t;return e.hasZ&&t.hasZ?ji(e,i,s,r)&&ji(e,i,o,r)&&ji(e,n,o,r)&&ji(e,n,s,r)&&ji(e,i,s,a)&&ji(e,i,o,a)&&ji(e,n,o,a)&&ji(e,n,s,a):ji(e,i,s)&&ji(e,i,o)&&ji(e,n,o)&&ji(e,n,s)}function zh(e,t){return ji(e,t[0],t[1])}function bH(e,t){return ji(e,t[0],t[1],t[2])}function ji(e,t,i,s){return t>=e.xmin&&t<=e.xmax&&i>=e.ymin&&i<=e.ymax&&(s==null||!e.hasZ||s>=e.zmin&&s<=e.zmax)}function AF(e,t){return C_[1]=t.y,C_[0]=t.x,_H(e,C_)}function _H(e,t){return OF(e.rings,t)}function OF(e,t){if(!e)return!1;if(wH(e))return ZE(!1,e,t);let i=!1;for(let s=0,r=e.length;s=r||m=r)&&u+(r-d)/(m-d)*(f-u)=0&&I<=1&&T>=0&&T<=1&&(r&&(r[0]=n+I*(a-n),r[1]=o+I*(l-o)),!0)}function CH(e){switch(e){case"esriGeometryEnvelope":case"extent":return SH;case"esriGeometryMultipoint":case"multipoint":return MH;case"esriGeometryPoint":case"point":return xH;case"esriGeometryPolygon":case"polygon":return TH;case"esriGeometryPolyline":case"polyline":return EH}}var Ds;function PH(e){return e&&(e.declaredClass==="esri.geometry.SpatialReference"||e.wkid!=null)}function qo(e,t,i){return t==null?i:i==null?t:e(t,i)}let Ut=Ds=class extends fl{constructor(...e){super(...e),this.type="extent",this.xmin=0,this.ymin=0,this.mmin=void 0,this.zmin=void 0,this.xmax=0,this.ymax=0,this.mmax=void 0,this.zmax=void 0}normalizeCtorArgs(e,t,i,s,r){return PH(e)?{spatialReference:e,xmin:0,ymin:0,xmax:0,ymax:0}:typeof e=="object"?(e.spatialReference=e.spatialReference==null?xe.WGS84:e.spatialReference,e):{xmin:e,ymin:t,xmax:i,ymax:s,spatialReference:r!=null?r:xe.WGS84}}static fromBounds(e,t){return new Ds({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:t})}static fromPoint(e){return new Ds({xmin:e.x,ymin:e.y,zmin:e.z,xmax:e.x,ymax:e.y,zmax:e.z,spatialReference:e.spatialReference})}get cache(){return this.commitProperty("xmin"),this.commitProperty("ymin"),this.commitProperty("zmin"),this.commitProperty("mmin"),this.commitProperty("xmax"),this.commitProperty("ymax"),this.commitProperty("zmax"),this.commitProperty("mmax"),this.commitProperty("spatialReference"),{}}get center(){const e=new be({x:.5*(this.xmin+this.xmax),y:.5*(this.ymin+this.ymax),spatialReference:this.spatialReference});return this.hasZ&&(e.z=.5*(this.zmin+this.zmax)),this.hasM&&(e.m=.5*(this.mmin+this.mmax)),e}get extent(){return this.clone()}get hasM(){return this.mmin!=null&&this.mmax!=null}get hasZ(){return this.zmin!=null&&this.zmax!=null}get height(){return Math.abs(this.ymax-this.ymin)}get width(){return Math.abs(this.xmax-this.xmin)}centerAt(e){const t=this.center;return e.z!=null&&this.hasZ?this.offset(e.x-t.x,e.y-t.y,e.z-t.z):this.offset(e.x-t.x,e.y-t.y)}clone(){const e=new Ds;return e.xmin=this.xmin,e.ymin=this.ymin,e.xmax=this.xmax,e.ymax=this.ymax,e.spatialReference=this.spatialReference,this.zmin!=null&&(e.zmin=this.zmin,e.zmax=this.zmax),this.mmin!=null&&(e.mmin=this.mmin,e.mmax=this.mmax),e}contains(e){if(!e)return!1;const t=this.spatialReference,i=e.spatialReference;return t&&i&&!t.equals(i)&&vg(t,i)&&(e=t.isWebMercator?Za(e):op(e,!0)),e.type==="point"?_b(this,e):e.type==="extent"&&vH(this,e)}equals(e){if(this===e)return!0;if(N(e))return!1;const t=this.spatialReference,i=e.spatialReference;return t&&i&&!t.equals(i)&&vg(t,i)&&(e=t.isWebMercator?Za(e):op(e,!0)),this.xmin===e.xmin&&this.ymin===e.ymin&&this.zmin===e.zmin&&this.mmin===e.mmin&&this.xmax===e.xmax&&this.ymax===e.ymax&&this.zmax===e.zmax&&this.mmax===e.mmax}expand(e){const t=.5*(1-e),i=this.width*t,s=this.height*t;if(this.xmin+=i,this.ymin+=s,this.xmax-=i,this.ymax-=s,this.hasZ){const r=(this.zmax-this.zmin)*t;this.zmin+=r,this.zmax-=r}if(this.hasM){const r=(this.mmax-this.mmin)*t;this.mmin+=r,this.mmax-=r}return this}intersects(e){if(N(e))return!1;e.type==="mesh"&&(e=e.extent);const t=this.spatialReference,i=e.spatialReference;return t&&i&&!Kt(t,i)&&vg(t,i)&&(e=t.isWebMercator?Za(e):op(e,!0)),CH(e.type)(this,e)}normalize(){const e=this._normalize(!1,!0);return Array.isArray(e)?e:[e]}offset(e,t,i){return this.xmin+=e,this.ymin+=t,this.xmax+=e,this.ymax+=t,i!=null&&(this.zmin+=i,this.zmax+=i),this}shiftCentralMeridian(){return this._normalize(!0)}union(e){return this===e||(this.xmin=Math.min(this.xmin,e.xmin),this.ymin=Math.min(this.ymin,e.ymin),this.xmax=Math.max(this.xmax,e.xmax),this.ymax=Math.max(this.ymax,e.ymax),(this.hasZ||e.hasZ)&&(this.zmin=qo(Math.min,this.zmin,e.zmin),this.zmax=qo(Math.max,this.zmax,e.zmax)),(this.hasM||e.hasM)&&(this.mmin=qo(Math.min,this.mmin,e.mmin),this.mmax=qo(Math.max,this.mmax,e.mmax))),this}intersection(e){return this===e?this:N(e)||!this.intersects(e)?null:(this.xmin=Math.max(this.xmin,e.xmin),this.ymin=Math.max(this.ymin,e.ymin),this.xmax=Math.min(this.xmax,e.xmax),this.ymax=Math.min(this.ymax,e.ymax),(this.hasZ||e.hasZ)&&(this.zmin=qo(Math.max,this.zmin,e.zmin),this.zmax=qo(Math.min,this.zmax,e.zmax)),(this.hasM||e.hasM)&&(this.mmin=qo(Math.max,this.mmin,e.mmin),this.mmax=qo(Math.min,this.mmax,e.mmax)),this)}toJSON(e){return this.write({},e)}_shiftCM(e=Dr(this.spatialReference)){var s;if(!e||!this.spatialReference)return this;const t=this.spatialReference,i=this._getCM(e);if(i){const r=t.isWebMercator?op(i):i;this.xmin-=i.x,this.xmax-=i.x,t.isWebMercator||(r.x=this._normalizeX(r.x,e).x),this.spatialReference=new xe(In((s=t.isWGS84?e.altTemplate:null)!=null?s:e.wkTemplate,{Central_Meridian:r.x}))}return this}_getCM(e){let t=null;const[i,s]=e.valid,r=this.xmin,n=this.xmax;return r>=i&&r<=s&&n>=i&&n<=s||(t=this.center),t}_normalize(e,t,i){const s=this.spatialReference;if(!s)return this;const r=i!=null?i:Dr(s);if(r==null)return this;const n=this._getParts(r).map(l=>l.extent);if(n.length<2)return n[0]||this;if(n.length>2)return e?this._shiftCM(r):this.set({xmin:r.valid[0],xmax:r.valid[1]});if(e)return this._shiftCM(r);if(t)return n;let o=!0,a=!0;return n.forEach(l=>{l.hasZ||(o=!1),l.hasM||(a=!1)}),{rings:n.map(l=>{const u=[[l.xmin,l.ymin],[l.xmin,l.ymax],[l.xmax,l.ymax],[l.xmax,l.ymin],[l.xmin,l.ymin]];if(o){const d=(l.zmax-l.zmin)/2;for(let f=0;f0;if(a>2*m){const x=new Ds(lv||_?t.push({extent:new Ds(y,r,m,n,o),frameIds:[g]},{extent:new Ds(f,r,v,n,o),frameIds:[b]}):t.push({extent:new Ds(y,r,v,n,o),frameIds:[g]});this.cache._parts=t}const i=this.hasZ,s=this.hasM;if(i||s){const r={};i&&(r.zmin=this.zmin,r.zmax=this.zmax),s&&(r.mmin=this.mmin,r.mmax=this.mmax);for(let n=0;ns?(n=Math.ceil(Math.abs(e-s)/r),e-=n*r,o=n):et==null?i:i==null?t:e(t,i)}function AH(e){return e&&(e.declaredClass==="esri.geometry.SpatialReference"||e.wkid!=null)}let na=W1=class extends fl{constructor(...e){super(...e),this.points=[],this.type="multipoint"}normalizeCtorArgs(e,t){if(!e&&!t)return{};const i={};Array.isArray(e)?(i.points=e,i.spatialReference=t):AH(e)?i.spatialReference=e:(e.points&&(i.points=e.points),e.spatialReference&&(i.spatialReference=e.spatialReference),e.hasZ&&(i.hasZ=e.hasZ),e.hasM&&(i.hasM=e.hasM));const s=i.points&&i.points[0];return s&&(i.hasZ===void 0&&i.hasM===void 0?(i.hasZ=s.length>2,i.hasM=!1):i.hasZ===void 0?i.hasZ=s.length>3:i.hasM===void 0&&(i.hasM=s.length>3)),i}get cache(){return this.commitProperty("points"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const e=this.points;if(!e.length)return null;const t=new Ze,i=this.hasZ,s=this.hasM,r=i?3:2,n=e[0],o=QE(Math.min),a=QE(Math.max);let l,u,d,f,[m,y]=n,[g,v]=n;for(let b=0,_=e.length;b<_;b++){const x=e[b],[$,I]=x;if(m=o(m,$),y=o(y,I),g=a(g,$),v=a(v,I),i&&x.length>2){const T=x[2];l=o(l,T),d=a(d,T)}if(s&&x.length>r){const T=x[r];u=o(u,T),f=a(f,T)}}return t.xmin=m,t.ymin=y,t.xmax=g,t.ymax=v,t.spatialReference=this.spatialReference,i?(t.zmin=l,t.zmax=d):(t.zmin=void 0,t.zmax=void 0),s?(t.mmin=u,t.mmax=f):(t.mmin=void 0,t.mmax=void 0),t}writePoints(e,t){t.points=R(this.points)}addPoint(e){return Bh(this,e),Array.isArray(e)?this.points.push(e):this.points.push(e.toArray()),this.notifyChange("points"),this}clone(){const e={points:R(this.points),spatialReference:this.spatialReference};return this.hasZ&&(e.hasZ=!0),this.hasM&&(e.hasM=!0),new W1(e)}getPoint(e){if(!this._validateInputs(e))return null;const t=this.points[e],i={x:t[0],y:t[1],spatialReference:this.spatialReference};let s=2;return this.hasZ&&(i.z=t[2],s=3),this.hasM&&(i.m=t[s]),new be(i)}removePoint(e){if(!this._validateInputs(e))return null;const t=new be(this.points.splice(e,1)[0],this.spatialReference);return this.notifyChange("points"),t}setPoint(e,t){return this._validateInputs(e)?(Bh(this,t),Array.isArray(t)||(t=t.toArray()),this.points[e]=t,this.notifyChange("points"),this):this}toJSON(e){return this.write({},e)}_validateInputs(e){return e!=null&&e>=0&&eimport("./pe-wasm.031781a0.js"),[]).then(e=>e.p).then(({default:e})=>e({locateFile:t=>Ne(`esri/geometry/support/${t}`)})).then(e=>{jF(e)}),P_)}var H1,ot,Y1;(function(e){function t(n,o,a){O.ensureCache.prepare();const l=vc(a),u=a===l,d=O.ensureFloat64(l),f=O._pe_geog_to_proj(O.getPointer(n),o,d);return f&&Da(a,o,d,u),f}function i(n,o,a,l){switch(l){case ot.PE_TRANSFORM_P_TO_G:return s(n,o,a);case ot.PE_TRANSFORM_G_TO_P:return t(n,o,a)}return 0}function s(n,o,a){return r(n,o,a,0)}function r(n,o,a,l){O.ensureCache.prepare();const u=vc(a),d=a===u,f=O.ensureFloat64(u),m=O._pe_proj_to_geog_center(O.getPointer(n),o,f,l);return m&&Da(a,o,f,d),m}e.geogToProj=t,e.projGeog=i,e.projToGeog=s,e.projToGeogCenter=r})(H1||(H1={})),function(e){function t(){e.PE_BUFFER_MAX=O.PeDefs.prototype.PE_BUFFER_MAX,e.PE_NAME_MAX=O.PeDefs.prototype.PE_NAME_MAX,e.PE_MGRS_MAX=O.PeDefs.prototype.PE_MGRS_MAX,e.PE_USNG_MAX=O.PeDefs.prototype.PE_USNG_MAX,e.PE_DD_MAX=O.PeDefs.prototype.PE_DD_MAX,e.PE_DDM_MAX=O.PeDefs.prototype.PE_DDM_MAX,e.PE_DMS_MAX=O.PeDefs.prototype.PE_DMS_MAX,e.PE_UTM_MAX=O.PeDefs.prototype.PE_UTM_MAX,e.PE_PARM_MAX=O.PeDefs.prototype.PE_PARM_MAX,e.PE_TYPE_NONE=O.PeDefs.prototype.PE_TYPE_NONE,e.PE_TYPE_GEOGCS=O.PeDefs.prototype.PE_TYPE_GEOGCS,e.PE_TYPE_PROJCS=O.PeDefs.prototype.PE_TYPE_PROJCS,e.PE_TYPE_GEOGTRAN=O.PeDefs.prototype.PE_TYPE_GEOGTRAN,e.PE_TYPE_COORDSYS=O.PeDefs.prototype.PE_TYPE_COORDSYS,e.PE_TYPE_UNIT=O.PeDefs.prototype.PE_TYPE_UNIT,e.PE_TYPE_LINUNIT=O.PeDefs.prototype.PE_TYPE_LINUNIT,e.PE_STR_OPTS_NONE=O.PeDefs.prototype.PE_STR_OPTS_NONE,e.PE_STR_AUTH_NONE=O.PeDefs.prototype.PE_STR_AUTH_NONE,e.PE_STR_AUTH_TOP=O.PeDefs.prototype.PE_STR_AUTH_TOP,e.PE_STR_NAME_CANON=O.PeDefs.prototype.PE_STR_NAME_CANON,e.PE_PARM_X0=O.PeDefs.prototype.PE_PARM_X0,e.PE_PARM_ND=O.PeDefs.prototype.PE_PARM_ND,e.PE_TRANSFORM_1_TO_2=O.PeDefs.prototype.PE_TRANSFORM_1_TO_2,e.PE_TRANSFORM_2_TO_1=O.PeDefs.prototype.PE_TRANSFORM_2_TO_1,e.PE_TRANSFORM_P_TO_G=O.PeDefs.prototype.PE_TRANSFORM_P_TO_G,e.PE_TRANSFORM_G_TO_P=O.PeDefs.prototype.PE_TRANSFORM_G_TO_P,e.PE_HORIZON_RECT=O.PeDefs.prototype.PE_HORIZON_RECT,e.PE_HORIZON_POLY=O.PeDefs.prototype.PE_HORIZON_POLY,e.PE_HORIZON_LINE=O.PeDefs.prototype.PE_HORIZON_LINE,e.PE_HORIZON_DELTA=O.PeDefs.prototype.PE_HORIZON_DELTA}e.init=t}(ot||(ot={})),function(e){const t={},i={},s=y=>{if(y){const g=y.getType();switch(g){case ot.PE_TYPE_GEOGCS:y=O.castObject(y,O.PeGeogcs);break;case ot.PE_TYPE_PROJCS:y=O.castObject(y,O.PeProjcs);break;case ot.PE_TYPE_GEOGTRAN:y=O.castObject(y,O.PeGeogtran);break;default:g&ot.PE_TYPE_UNIT&&(y=O.castObject(y,O.PeUnit))}}return y};function r(){O.PeFactory.prototype.initialize(null)}function n(y){return o(ot.PE_TYPE_COORDSYS,y)}function o(y,g){let v=null,b=t[y];if(b||(b={},t[y]=b),b.hasOwnProperty(String(g)))v=b[g];else{const _=O.PeFactory.prototype.factoryByType(y,g);O.compare(_,O.NULL)||(v=_,b[g]=v)}return v=s(v),v}function a(y,g){let v=null,b=i[y];if(b||(b={},i[y]=b),b.hasOwnProperty(g))v=b[g];else{const _=O.PeFactory.prototype.fromString(y,g);O.compare(_,O.NULL)||(v=_,b[g]=v)}return v=s(v),v}function l(y){return o(ot.PE_TYPE_GEOGCS,y)}function u(y){return o(ot.PE_TYPE_GEOGTRAN,y)}function d(y){return O.PeFactory.prototype.getCode(y)}function f(y){return o(ot.PE_TYPE_PROJCS,y)}function m(y){return o(ot.PE_TYPE_UNIT,y)}e.initialize=r,e.coordsys=n,e.factoryByType=o,e.fromString=a,e.geogcs=l,e.geogtran=u,e.getCode=d,e.projcs=f,e.unit=m}(Y1||(Y1={}));let NF=null;var cv,J1,X1,Z1,uv,Q1,hv,dv,K1;function jF(e){function t(n,o,a){n[o]=a(n[o])}O=e,ot.init(),cv.init(),uv.init(),hv.init(),dv.init(),NF=class extends O.PeGCSExtent{destroy(){O.destroy(this)}};const i=[O.PeDatum,O.PeGeogcs,O.PeGeogtran,O.PeObject,O.PeParameter,O.PePrimem,O.PeProjcs,O.PeSpheroid,O.PeUnit];for(const n of i)t(n.prototype,"getName",o=>function(){return o.call(this,new Array(ot.PE_NAME_MAX))});for(const n of[O.PeGeogtran,O.PeProjcs])t(n.prototype,"getParameters",o=>function(){const a=new Array(ot.PE_PARM_MAX);let l=o.call(this);for(let u=0;ufunction(){const o=this.getSize();if(!o)return null;const a=[];return Da(a,o,n.call(this)),a}),t(O.PeGTlistExtendedEntry.prototype,"getEntries",n=>{const o=O._pe_getPeGTlistExtendedGTsSize();return function(){let a=null;const l=n.call(this);if(!O.compare(l,O.NULL)){a=[l];const u=this.getSteps();if(u>1){const d=O.getPointer(l);for(let f=1;ffunction(){let o=this._cache;if(o||(o=new Map,this._cache=o),o.has(n))return o.get(n);let a=null;const l=n.call(this);if(!O.compare(l,O.NULL)){a=[l];const u=l.getNump();if(u>1){const d=O.getPointer(l);for(let f=1;f{t.push(i[0],i[1])})):t=e,t}function Da(e,t,i,s=!1){if(s)for(let r=0;r<2*t;r++)e[r]=O.getValue(i+r*Float64Array.BYTES_PER_ELEMENT,"double");else{const r=e.length===0;for(let n=0;n1)){const y=O.getPointer(m);for(let g=1;g{jn(r);const n=r.getGeogtran();jn(n),n.getParameters().forEach(jn),[n.getGeogcs1(),n.getGeogcs2()].forEach(o=>{jn(o);const a=o.getDatum();jn(a),jn(a.getSpheroid()),jn(o.getPrimem()),jn(o.getUnit())})});O.PeGTlistExtendedEntry.prototype.Delete(i[0])}}e.destroy=t}(J1||(J1={})),function(e){function t(i,s,r,n,o){O.ensureCache.prepare();const a=vc(r),l=r===a,u=O.ensureFloat64(a);let d=0;n&&(d=O.ensureFloat64(n));const f=O._pe_geog_to_geog(O.getPointer(i),s,u,d,o);return f&&Da(r,s,u,l),f}e.geogToGeog=t}(X1||(X1={})),function(e){const t=(u,d,f,m,y,g)=>{let v,b;switch(O.ensureCache.prepare(),u){case"dd":v=O._pe_geog_to_dd,b=ot.PE_DD_MAX;break;case"ddm":v=O._pe_geog_to_ddm,b=ot.PE_DDM_MAX;break;case"dms":v=O._pe_geog_to_dms,b=ot.PE_DMS_MAX}let _=0;d&&(_=O.getPointer(d));const x=vc(m),$=O.ensureFloat64(x),I=gy(f,b),T=v(_,f,$,y,O.ensureInt32(I));if(T)for(let k=0;k{let g;switch(O.ensureCache.prepare(),u){case"dd":g=O._pe_dd_to_geog;break;case"ddm":g=O._pe_ddm_to_geog;break;case"dms":g=O._pe_dms_to_geog}let v=0;d&&(v=O.getPointer(d));const b=m.map(I=>O.ensureString(I)),_=O.ensureInt32(b),x=O.ensureFloat64(new Array(2*f)),$=g(v,f,_,x);return $&&Da(y,f,x),$};function s(u,d,f,m,y){return t("dms",u,d,f,m,y)}function r(u,d,f,m){return i("dms",u,d,f,m)}function n(u,d,f,m,y){return t("ddm",u,d,f,m,y)}function o(u,d,f,m){return i("ddm",u,d,f,m)}function a(u,d,f,m,y){return t("dd",u,d,f,m,y)}function l(u,d,f,m){return i("dd",u,d,f,m)}e.geogToDms=s,e.dmsToGeog=r,e.geogToDdm=n,e.ddmToGeog=o,e.geogToDd=a,e.ddToGeog=l}(Z1||(Z1={})),function(e){function t(){e.PE_MGRS_STYLE_NEW=O.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW,e.PE_MGRS_STYLE_OLD=O.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD,e.PE_MGRS_STYLE_AUTO=O.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO,e.PE_MGRS_180_ZONE_1_PLUS=O.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS,e.PE_MGRS_ADD_SPACES=O.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES}function i(r,n,o,a,l,u,d){O.ensureCache.prepare();let f=0;r&&(f=O.getPointer(r));const m=vc(o),y=O.ensureFloat64(m),g=gy(n,ot.PE_MGRS_MAX),v=O.ensureInt32(g),b=O._pe_geog_to_mgrs_extended(f,n,y,a,l,u,v);if(b)for(let _=0;_O.ensureString(g)),f=O.ensureInt32(d),m=O.ensureFloat64(new Array(2*n)),y=O._pe_mgrs_to_geog_extended(u,n,f,a,m);return y&&Da(l,n,m),y}e.init=t,e.geogToMgrsExtended=i,e.mgrsToGeogExtended=s}(uv||(uv={})),function(e){function t(s,r,n,o,a,l,u){O.ensureCache.prepare();let d=0;s&&(d=O.getPointer(s));const f=vc(n),m=O.ensureFloat64(f),y=gy(r,ot.PE_MGRS_MAX),g=O.ensureInt32(y),v=O._pe_geog_to_usng(d,r,m,o,a,l,g);if(v)for(let b=0;bO.ensureString(m)),u=O.ensureInt32(l),d=O.ensureFloat64(new Array(2*r)),f=O._pe_usng_to_geog(a,r,u,d);return f&&Da(o,r,d),f}e.geogToUsng=t,e.usngToGeog=i}(Q1||(Q1={})),function(e){function t(){e.PE_UTM_OPTS_NONE=O.PeNotationUtm.prototype.PE_UTM_OPTS_NONE,e.PE_UTM_OPTS_ADD_SPACES=O.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES,e.PE_UTM_OPTS_NS=O.PeNotationUtm.prototype.PE_UTM_OPTS_NS}function i(r,n,o,a,l){O.ensureCache.prepare();let u=0;r&&(u=O.getPointer(r));const d=vc(o),f=O.ensureFloat64(d),m=gy(n,ot.PE_UTM_MAX),y=O.ensureInt32(m),g=O._pe_geog_to_utm(u,n,f,a,y);if(g)for(let v=0;vO.ensureString(g)),f=O.ensureInt32(d),m=O.ensureFloat64(new Array(2*n)),y=O._pe_utm_to_geog(u,n,f,a,m);return y&&Da(l,n,m),y}e.init=t,e.geogToUtm=i,e.utmToGeog=s}(hv||(hv={})),function(e){const t=new Map;function i(){e.PE_PCSINFO_OPTION_NONE=O.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE,e.PE_PCSINFO_OPTION_DOMAIN=O.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN,e.PE_POLE_OUTSIDE_BOUNDARY=O.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY,e.PE_POLE_POINT=O.PePCSInfo.prototype.PE_POLE_POINT}function s(r,n=e.PE_PCSINFO_OPTION_DOMAIN){let o=null,a=null;return t.has(r)&&(a=t.get(r),a[n]&&(o=a[n])),o||(o=O.PePCSInfo.prototype.generate(r,n),a||(a=[],t.set(r,a)),a[n]=o),o}e.init=i,e.generate=s}(dv||(dv={})),function(e){function t(){return O.PeVersion.prototype.version_string()}e.versionString=t}(K1||(K1={}));const RH=Object.freeze(Object.defineProperty({__proto__:null,get _pe(){return O},isLoaded:FF,isSupported:OH,load:DF,get PeCSTransformations(){return H1},get PeDefs(){return ot},get PeFactory(){return Y1},get PeGCSExtent(){return NF},get PeGTlistExtended(){return cv},get PeGTlistExtendedEntry(){return J1},get PeGTTransformations(){return X1},get PeNotationDms(){return Z1},get PeNotationMgrs(){return uv},get PeNotationUsng(){return Q1},get PeNotationUtm(){return hv},get PePCSInfo(){return dv},get PeVersion(){return K1},_init:jF},Symbol.toStringTag,{value:"Module"}));function LH(e,t){const i=t[0]-e[0],s=t[1]-e[1];if(e.length>2&&t.length>2){const r=e[2]-t[2];return Math.sqrt(i*i+s*s+r*r)}return Math.sqrt(i*i+s*s)}function FH(e,t,i){const s=e[0]+i*(t[0]-e[0]),r=e[1]+i*(t[1]-e[1]);return e.length>2&&t.length>2?[s,r,e[2]+i*(t[2]-e[2])]:[s,r]}function DH(e,t,i,s){const[r,n]=t,[o,a]=i[s],[l,u]=i[s+1],d=l-o,f=u-a,m=d*d+f*f,y=(r-o)*d+(n-a)*f,g=Math.min(1,Math.max(0,y/m));return e[0]=o+d*g,e[1]=a+f*g,e}function sbe(e,t,i){const s=i.rings;let r,n,o=!1,a=1/0;for(let l=0;lt!=n[1]>t&&e<(n[0]-r[0])*(t-r[1])/(n[1]-r[1])+r[0]&&(o=!o),a=Math.min(a,NH(e,t,r,n))}return a===0?0:(o?1:-1)*Math.sqrt(a)}function NH(e,t,i,s){let r=i[0],n=i[1],o=s[0]-r,a=s[1]-n;if(o!==0||a!==0){const l=((e-r)*o+(t-n)*a)/(o*o+a*a);l>1?(r=s[0],n=s[1]):l>0&&(r+=o*l,n+=a*l)}return o=e-r,a=t-n,o*o+a*a}function jH(e,t){return FH(e,t,.5)}function VF(e,t,i){const s=e.length;let r=0,n=0,o=0;for(let a=0;a2&&u.length>2&&i&&(n+=l[0]*u[2]-u[0]*l[2],d=3),l.length>d&&u.length>d&&t&&(o+=l[0]*u[d]-u[0]*l[d])}return r<=0&&n<=0&&o<=0}function VH(e){const t=e.length;return t>2&&Xv(e[0],e[t-1])}function rbe(e){var t,i;if("rings"in e&&(zH(e),e.rings.length>0&&!VF(e.rings[0],(t=e.hasM)!=null?t:!1,(i=e.hasZ)!=null?i:!1)))for(const s of e.rings)s.reverse()}function zH(e){if("rings"in e)for(const t of e.rings)VH(t)||t.push(t[0].slice())}function zF(e){if(!e||e.length<3)return 0;let t=0;const i=e.length-1;for(let s=0;s{let a=n[2]-o[2];return a===0&&t&&(a=n[4]-o[4]),a}),s.length&&(i[0]=s[0][0],i[1]=s[0][1],t&&(i[2]=s[0][3]),(i[0]r[1]||i[1]r[3]||t&&(i[2]r[5]))&&(i.length=0)),!i.length){const n=e[0]&&e[0].length?qH(e[0],t):null;if(!n)return null;i[0]=n[0],i[1]=n[1],t&&n.length>2&&(i[2]=n[2])}return i}function UH(e,t,i){let s=0,r=0,n=0,o=0,a=0;const l=e.length?e[0][0]:0,u=e.length?e[0][1]:0,d=e.length&&t?e[0][2]:0;for(let m=0;m2&&g.length>2){const U=_-d,J=k-d,H=x*J-A*U;n+=(U+J)*H,a+=H}vi[1]&&(i[1]=v),bi[3]&&(i[3]=b),t&&(_i[5]&&(i[5]=_))}if(o>0&&(o*=-1),a>0&&(a*=-1),!o)return null;o*=.5,a*=.5;const f=[s/(6*o)+l,r/(6*o)+u,o];return t&&(i[4]===i[5]||a===0?(f[3]=(i[4]+i[5])/2,f[4]=0):(f[3]=n/(6*a)+d,f[4]=a)),f}function qH(e,t){const i=t?[0,0,0]:[0,0],s=t?[0,0,0]:[0,0];let r=0,n=0,o=0,a=0;for(let l=0,u=e.length;l2&&f.length>2&&(i[2]=d[2],s[2]=f[2]);const m=LH(i,s);if(m){r+=m;const y=jH(d,f);n+=m*y[0],o+=m*y[1],t&&y.length>2&&(a+=m*y[2])}}}return r>0?t?[n/r,o/r,a/r]:[n/r,o/r]:e.length?e[0]:null}const GH=1e-6;function obe(e){if(!e||!e.rings)return null;const{rings:t}=e;let i=0;for(let n=0;n2){const $=b[2];n=Ba(n,$),o=Ua(o,$)}if(s&&b.length>r){const $=b[r];a=Ba(n,$),l=Ua(o,$)}}}return i?s?(e[0]=u,e[1]=d,e[2]=n,e[3]=a,e[4]=f,e[5]=m,e[6]=o,e[7]=l,e.length=8,e):(e[0]=u,e[1]=d,e[2]=n,e[3]=f,e[4]=m,e[5]=o,e.length=6,e):s?(e[0]=u,e[1]=d,e[2]=a,e[3]=f,e[4]=m,e[5]=l,e.length=6,e):(e[0]=u,e[1]=d,e[2]=f,e[3]=m,e.length=4,e)}function JF(e,t,i,s,r,n){const o=t.xmin,a=t.xmax,l=t.ymin,u=t.ymax;let d=t.zmin,f=t.zmax,m=t.mmin,y=t.mmax;return r?(d=d||0,f=f||0,n?(m=m||0,y=y||0,e[0]=o,e[1]=l,e[2]=d,e[3]=m,e[4]=a,e[5]=u,e[6]=f,e[7]=y,e):(e[0]=o,e[1]=l,e[2]=d,e[3]=a,e[4]=u,e[5]=f,e)):n?(m=m||0,y=y||0,e[0]=o,e[1]=l,e[2]=m,e[3]=a,e[4]=u,e[5]=y,e):(e[0]=o,e[1]=l,e[2]=a,e[3]=u,e)}function M$(e,t,i,s,r,n){const o=i?3:2,a=s&&n,l=i&&r;if(!t.length||!t[0].length)return null;let u,d,f,m,[y,g]=t[0],[v,b]=t[0];for(let _=0;_2){const T=x[2];u=Ba(u,T),d=Ua(d,T)}if(a&&x.length>o){const T=x[o];f=Ba(u,T),m=Ua(d,T)}}return r?(u=u||0,d=d||0,n?(f=f||0,m=m||0,e[0]=y,e[1]=g,e[2]=u,e[3]=f,e[4]=v,e[5]=b,e[6]=d,e[7]=m,e):(e[0]=y,e[1]=g,e[2]=u,e[3]=v,e[4]=b,e[5]=d,e)):n?(f=f||0,m=m||0,e[0]=y,e[1]=g,e[2]=f,e[3]=v,e[4]=b,e[5]=m,e):(e[0]=y,e[1]=g,e[2]=v,e[3]=b,e)}function YH(e){return e.xmin!==void 0&&e.ymin!==void 0&&e.xmax!==void 0&&e.ymax!==void 0}function JH(e){return e.points!==void 0}function XH(e){return e.x!==void 0&&e.y!==void 0}function ZH(e){return e.paths!==void 0}function QH(e){return e.rings!==void 0}const $$=[];function XF(e,t,i,s){return{xmin:e,ymin:t,xmax:i,ymax:s}}function ZF(e,t,i,s,r,n){return{xmin:e,ymin:t,zmin:i,xmax:s,ymax:r,zmax:n}}function QF(e,t,i,s,r,n){return{xmin:e,ymin:t,mmin:i,xmax:s,ymax:r,mmax:n}}function KF(e,t,i,s,r,n,o,a){return{xmin:e,ymin:t,zmin:i,mmin:s,xmax:r,ymax:n,zmax:o,mmax:a}}function T$(e,t=!1,i=!1){return t?i?KF(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]):ZF(e[0],e[1],e[2],e[3],e[4],e[5]):i?QF(e[0],e[1],e[2],e[3],e[4],e[5]):XF(e[0],e[1],e[2],e[3])}function cbe(e){return e?YH(e)?e:XH(e)?eY(e):QH(e)?eD(e):ZH(e)?tD(e):JH(e)?KH(e):null:null}function KH(e){const{hasZ:t,hasM:i,points:s}=e;return T$(M$($$,s,t!=null?t:!1,i!=null?i:!1),t,i)}function eY(e){const{x:t,y:i,z:s,m:r}=e,n=r!=null;return s!=null?n?KF(t,i,s,r,t,i,s,r):ZF(t,i,s,t,i,s):n?QF(t,i,r,t,i,r):XF(t,i,t,i)}function eD(e){const{hasZ:t,hasM:i,rings:s}=e,r=Uh($$,s,t!=null?t:!1,i!=null?i:!1);return r?T$(r,t,i):null}function tD(e){const{hasZ:t,hasM:i,paths:s}=e,r=Uh($$,s,t!=null?t:!1,i!=null?i:!1);return r?T$(r,t,i):null}var _g;function KE(e){return!Array.isArray(e[0])}let Xr=_g=class extends fl{constructor(...e){super(...e),this.rings=[],this.type="polygon"}static fromExtent(e){const t=e.clone().normalize(),i=e.spatialReference;let s=!1,r=!1;for(const o of t)o.hasZ&&(s=!0),o.hasM&&(r=!0);const n={rings:t.map(o=>{const a=[[o.xmin,o.ymin],[o.xmin,o.ymax],[o.xmax,o.ymax],[o.xmax,o.ymin],[o.xmin,o.ymin]];if(s&&o.hasZ){const l=o.zmin+.5*(o.zmax-o.zmin);for(let u=0;u2,s=n.length>3):i===void 0?i=s?n.length>3:n.length>2:s===void 0&&(s=i?n.length>3:n.length>2)),{rings:r,spatialReference:t,hasZ:i,hasM:s}}get cache(){return this.commitProperty("rings"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get centroid(){const e=BH(this);if(!e||isNaN(e[0])||isNaN(e[1])||this.hasZ&&isNaN(e[2]))return null;const t=new be;return t.x=e[0],t.y=e[1],t.spatialReference=this.spatialReference,this.hasZ&&(t.z=e[2]),t}get extent(){const{spatialReference:e}=this,t=eD(this);if(!t)return null;const i=new Ze(t);return i.spatialReference=e,i}get isSelfIntersecting(){return kH(this.rings)}writeRings(e,t){t.rings=R(this.rings)}addRing(e){if(!e)return;const t=this.rings,i=t.length;if(KE(e)){const s=[];for(let r=0,n=e.length;rr===l&&n===u&&(o==null&&d==null||o===d)&&(a==null&&f==null||a===f);for(let r=0;rthis.hasZ?this.hasM?[i.x,i.y,i.z,i.m]:[i.x,i.y,i.z]:[i.x,i.y]):e,VF(t,this.hasM,this.hasZ)}getPoint(e,t){if(!this._validateInputs(e,t))return null;const i=this.rings[e][t],s=this.hasZ,r=this.hasM;return s&&!r?new be(i[0],i[1],i[2],void 0,this.spatialReference):r&&!s?new be(i[0],i[1],void 0,i[2],this.spatialReference):s&&r?new be(i[0],i[1],i[2],i[3],this.spatialReference):new be(i[0],i[1],this.spatialReference)}insertPoint(e,t,i){return this._validateInputs(e,t,!0)?(Bh(this,i),Array.isArray(i)||(i=i.toArray()),this.rings[e].splice(t,0,i),this.notifyChange("rings"),this):this}removePoint(e,t){if(!this._validateInputs(e,t))return null;const i=new be(this.rings[e].splice(t,1)[0],this.spatialReference);return this.notifyChange("rings"),i}removeRing(e){if(!this._validateInputs(e,null))return null;const t=this.rings.splice(e,1)[0],i=this.spatialReference,s=t.map(r=>new be(r,i));return this.notifyChange("rings"),s}setPoint(e,t,i){return this._validateInputs(e,t)?(Bh(this,i),Array.isArray(i)||(i=i.toArray()),this.rings[e][t]=i,this.notifyChange("rings"),this):this}_validateInputs(e,t,i=!1){if(e==null||e<0||e>=this.rings.length)return!1;if(t!=null){const s=this.rings[e];if(i&&(t<0||t>s.length)||!i&&(t<0||t>=s.length))return!1}return!0}toJSON(e){return this.write({},e)}};c([h({readOnly:!0})],Xr.prototype,"cache",null),c([h({readOnly:!0})],Xr.prototype,"centroid",null),c([h({readOnly:!0})],Xr.prototype,"extent",null),c([h({readOnly:!0})],Xr.prototype,"isSelfIntersecting",null),c([h({type:[[[Number]]],json:{write:{isRequired:!0}}})],Xr.prototype,"rings",void 0),c([ie("rings")],Xr.prototype,"writeRings",null),Xr=_g=c([S("esri.geometry.Polygon")],Xr),Xr.prototype.toJSON.isDefaultToJSON=!0;const Oo=Xr;var ex;function tY(e){return!Array.isArray(e[0])}let oa=ex=class extends fl{constructor(...e){super(...e),this.paths=[],this.type="polyline"}normalizeCtorArgs(e,t){let i,s,r=null,n=null;return e&&!Array.isArray(e)?(r=e.paths?e.paths:null,t||(e.spatialReference?t=e.spatialReference:e.paths||(t=e)),i=e.hasZ,s=e.hasM):r=e,r=r||[],t=t||xe.WGS84,r.length&&r[0]&&r[0][0]!=null&&typeof r[0][0]=="number"&&(r=[r]),n=r[0]&&r[0][0],n&&(i===void 0&&s===void 0?(i=n.length>2,s=!1):i===void 0?i=!s&&n.length>3:s===void 0&&(s=!i&&n.length>3)),{paths:r,spatialReference:t,hasZ:i,hasM:s}}get cache(){return this.commitProperty("paths"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const{spatialReference:e}=this,t=tD(this);if(!t)return null;const i=new Ze(t);return i.spatialReference=e,i}writePaths(e,t){t.paths=R(this.paths)}addPath(e){if(!e)return;const t=this.paths,i=t.length;if(tY(e)){const s=[];for(let r=0,n=e.length;rnew be(r,i));return this.notifyChange("paths"),s}removePoint(e,t){if(!this._validateInputs(e,t))return null;const i=new be(this.paths[e].splice(t,1)[0],this.spatialReference);return this.notifyChange("paths"),i}setPoint(e,t,i){return this._validateInputs(e,t)?(Bh(this,i),Array.isArray(i)||(i=i.toArray()),this.paths[e][t]=i,this.notifyChange("paths"),this):this}_validateInputs(e,t,i=!1){if(e==null||e<0||e>=this.paths.length)return!1;if(t!=null){const s=this.paths[e];if(i&&(t<0||t>s.length)||!i&&(t<0||t>=s.length))return!1}return!0}toJSON(e){return this.write({},e)}};c([h({readOnly:!0})],oa.prototype,"cache",null),c([h({readOnly:!0})],oa.prototype,"extent",null),c([h({type:[[[Number]]],json:{write:{isRequired:!0}}})],oa.prototype,"paths",void 0),c([ie("paths")],oa.prototype,"writePaths",null),oa=ex=c([S("esri.geometry.Polyline")],oa),oa.prototype.toJSON.isDefaultToJSON=!0;const Ar=oa;function nl(e=nY){return[e[0],e[1],e[2],e[3]]}function ube(e){return[e[0],e[1],e[2],e[3]]}function iD(e,t){return e!==t&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]),e}function hbe(e,t,i,s,r=nl()){return r[0]=e,r[1]=t,r[2]=i,r[3]=s,r}function dbe(e,t=nl()){return t[0]=e.xmin,t[1]=e.ymin,t[2]=e.xmax,t[3]=e.ymax,t}function pbe(e,t){return new Ze({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:t})}function fbe(e,t){t[0]e[2]&&(e[2]=t[0]),t[1]e[3]&&(e[3]=t[1])}function mbe(e,t,i){if(N(t))iD(i,e);else if("length"in t)tx(t)?(i[0]=Math.min(e[0],t[0]),i[1]=Math.min(e[1],t[1]),i[2]=Math.max(e[2],t[2]),i[3]=Math.max(e[3],t[3])):t.length!==2&&t.length!==3||(i[0]=Math.min(e[0],t[0]),i[1]=Math.min(e[1],t[1]),i[2]=Math.max(e[2],t[0]),i[3]=Math.max(e[3],t[1]));else switch(t.type){case"extent":i[0]=Math.min(e[0],t.xmin),i[1]=Math.min(e[1],t.ymin),i[2]=Math.max(e[2],t.xmax),i[3]=Math.max(e[3],t.ymax);break;case"point":i[0]=Math.min(e[0],t.x),i[1]=Math.min(e[1],t.y),i[2]=Math.max(e[2],t.x),i[3]=Math.max(e[3],t.y)}}function iY(e){return N(e)||e[0]>=e[2]?0:e[2]-e[0]}function sY(e){return e[1]>=e[3]?0:e[3]-e[1]}function ybe(e){return iY(e)*sY(e)}function gbe(e,t,i){return t>=e[0]&&i>=e[1]&&t<=e[2]&&i<=e[3]}function vbe(e,t,i){return t[0]>=e[0]-i&&t[1]>=e[1]-i&&t[0]<=e[2]+i&&t[1]<=e[3]+i}function bbe(e,t){return Math.max(t[0],e[0])<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])<=Math.min(t[3],e[3])}function rY(e,t){return t[0]>=e[0]&&t[2]<=e[2]&&t[1]>=e[1]&&t[3]<=e[3]}function _be(e){return e?iD(e,ek):nl(ek)}function tx(e){return e!=null&&e.length===4}function wbe(e,t){return tx(e)&&tx(t)?e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]:e===t}const ek=[1/0,1/0,-1/0,-1/0],nY=[0,0,0,0],Go=it.radius,lr=it.eccentricitySquared,oY={a1:Go*lr,a2:Go*lr*Go*lr,a3:Go*lr*lr/2,a4:Go*lr*Go*lr*2.5,a5:Go*lr+Go*lr*lr/2,a6:1-lr};1/294.9786982,1/298.257222101,it.radius,it.flattening,rl.radius,rl.flattening,1/192.0430107526882,Io.radius,Io.flattening,1/10.2079945799458,1/43.61604095563141,Io.radius;let vy=0;class Ih{constructor(t){this.uid=vy++,t?(this._wkt=t.wkt!=null?t.wkt:null,this._wkid=t.wkid!=null?t.wkid:-1,this._isInverse=t.isInverse!=null&&t.isInverse===!0):(this._wkt=null,this._wkid=-1,this._isInverse=!1)}static fromGE(t){const i=new Ih;return i._wkt=t.wkt,i._wkid=t.wkid,i._isInverse=t.isInverse,i}get wkt(){return this._wkt}set wkt(t){this._wkt=t,this.uid=vy++}get wkid(){return this._wkid}set wkid(t){this._wkid=t,this.uid=vy++}get isInverse(){return this._isInverse}set isInverse(t){this._isInverse=t,this.uid=vy++}getInverse(){const t=new Ih;return t._wkt=this.wkt,t._wkid=this._wkid,t._isInverse=!this.isInverse,t}}class qa{constructor(t){if(this.steps=[],this._cachedProjection={},this._chain="",this._gtlistentry=null,t&&t.steps)for(const i of t.steps)i instanceof Ih?this.steps.push(i):this.steps.push(new Ih({wkid:i.wkid,wkt:i.wkt,isInverse:i.isInverse}))}static cacheKey(t,i){return[t.wkid!==void 0&&t.wkid!==null?t.wkid.toString():"-1",t.wkt!==void 0&&t.wkt!==null?t.wkt.toString():"",i.wkid!==void 0&&i.wkid!==null?i.wkid.toString():"-1",i.wkt!==void 0&&i.wkt!==null?i.wkt.toString():""].join(",")}static fromGE(t){const i=new qa;let s="";for(const r of t.steps){const n=Ih.fromGE(r);i.steps.push(n),s+=n.uid.toString()+","}return i._cachedProjection={},i._gtlistentry=null,i._chain=s,i}getInverse(){const t=new qa;t.steps=[];for(let i=this.steps.length-1;i>=0;i--){const s=this.steps[i];t.steps.push(s.getInverse())}return t}getGTListEntry(){let t="";for(const i of this.steps)t+=i.uid.toString()+",";return t!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=t),this._gtlistentry}assignCachedGe(t,i,s){this._cachedProjection[qa.cacheKey(t,i)]=s}getCachedGeTransformation(t,i){let s="";for(const n of this.steps)s+=n.uid.toString()+",";s!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=s);const r=this._cachedProjection[qa.cacheKey(t,i)];return r===void 0?null:r}}function sD(e,t,i){if(N(t)||N(i)||i.vcsWkid||Kt(t,i))return null;const s=Vh(t)/Vh(i);if(s===1)return null;switch(e){case"point":case"esriGeometryPoint":return r=>aY(r,s);case"polyline":case"esriGeometryPolyline":return r=>cY(r,s);case"polygon":case"esriGeometryPolygon":return r=>lY(r,s);case"multipoint":case"esriGeometryMultipoint":return r=>uY(r,s);case"extent":case"esriGeometryExtent":return r=>hY(r,s);default:return null}}function aY(e,t){e&&e.z!=null&&(e.z*=t)}function lY(e,t){if(e)for(const i of e.rings)for(const s of i)s.length>2&&(s[2]*=t)}function cY(e,t){if(e)for(const i of e.paths)for(const s of i)s.length>2&&(s[2]*=t)}function uY(e,t){if(e)for(const i of e.points)i.length>2&&(i[2]*=t)}function hY(e,t){e&&e.zmin!=null&&e.zmax!=null&&(e.zmin*=t,e.zmax*=t)}let Qa=null,Wf=null,A_=null,O_={};const rD=new S$;function ol(){return!!Qa&&FF()}function al(e){return N(A_)&&(A_=Promise.all([DF(),z(()=>import("./geometryEngineBase.82b25ca5.js"),[]).then(t=>t.g),z(()=>import("./hydrated.905f3857.js"),[])])),A_.then(([,t,{hydratedAdapter:i}])=>{Ft(e),Wf=i,Qa=t.default,Qa._enableProjection(RH),rD.notify()})}function hd(e,t,i=null,s=null){return Array.isArray(e)?e.length===0?[]:tk(Wf,e,e[0].spatialReference,t,i,s):tk(Wf,[e],e.spatialReference,t,i,s)[0]}function tk(e,t,i,s,r=null,n=null){if(N(i)||N(s))return t;if(Ro(i,s,r))return t.map(o=>mY(o,i,s));if(N(r)){const o=qa.cacheKey(i,s);O_[o]!==void 0?r=O_[o]:(r=pY(i,s,void 0),N(r)&&(r=new qa),O_[o]=r)}if(N(Qa)||N(e))throw new I$;return M(n)?Qa._project(e,t,i,s,r,n):Qa._project(e,t,i,s,r)}function xbe(e,t){const i=dY([e],t);return M(i.pending)?{pending:i.pending,geometry:null}:M(i.geometries)?{pending:null,geometry:i.geometries[0]}:{pending:null,geometry:null}}function dY(e,t){if(!ol()){for(const i of e)if(M(i)&&!Kt(i.spatialReference,t)&&ci(i.spatialReference)&&ci(t)&&!Ro(i.spatialReference,t))return _e(rD),{pending:al(),geometries:null}}return{pending:null,geometries:e.map(i=>N(i)?null:Kt(i.spatialReference,t)?i:ci(i.spatialReference)&&ci(t)?fY(i,t):null)}}function pY(e,t,i=null){if(N(e)||N(t))return null;if(N(Qa)||N(Wf))throw new I$;const s=Qa._getTransformation(Wf,e,t,i,i==null?void 0:i.spatialReference);return s!==null?qa.fromGE(s):null}class I$ extends L{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}var C;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.SPHERICAL_ECEF=1]="SPHERICAL_ECEF",e[e.WGS84=2]="WGS84",e[e.WEB_MERCATOR=3]="WEB_MERCATOR",e[e.WGS84_ECEF=4]="WGS84_ECEF",e[e.CGCS2000=5]="CGCS2000",e[e.WGS84_COMPARABLE_LON_LAT=6]="WGS84_COMPARABLE_LON_LAT",e[e.SPHERICAL_MARS_PCPF=7]="SPHERICAL_MARS_PCPF",e[e.GCSMARS2000=8]="GCSMARS2000",e[e.SPHERICAL_MOON_PCPF=9]="SPHERICAL_MOON_PCPF",e[e.GCSMOON2000=10]="GCSMOON2000",e[e.LON_LAT=11]="LON_LAT",e[e.PLATE_CARREE=12]="PLATE_CARREE"})(C||(C={}));function fY(e,t){try{const i=hd(e,t);if(i==null)return null;"xmin"in e&&"xmin"in i&&(i.zmin=e.zmin,i.zmax=e.zmax);const s=sD(i.type,e.spatialReference,t);return M(s)&&s(i),i}catch(i){if(!(i instanceof I$))throw i;return null}}function Ro(e,t,i){return!i&&(!!Kt(e,t)||ci(e)&&ci(t)&&!!lD(e,t,cD))}async function Sbe(e,t,i,s){if(ol())return QI(s);if(Array.isArray(e)){for(const{source:r,dest:n,geographicTransformation:o}of e)if(!Ro(r,n,o))return al(s)}else if(!Ro(e,t,i))return al(s);return QI(s)}function mY(e,t,i){return e?"x"in e?yY(e,t,new be,i,0):"xmin"in e?bY(e,t,new Ze,i,0):"rings"in e?nD(e,t,new Oo,i,0):"paths"in e?vY(e,t,new Ar,i,0):"points"in e?gY(e,t,new wb,i,0):null:null}function yY(e,t,i,s,r){zt[0]=e.x,zt[1]=e.y;const n=e.z;return zt[2]=n!==void 0?n:r,Am(zt,t,0,zt,s,0,1)?(i.x=zt[0],i.y=zt[1],i.spatialReference=s,n===void 0?(i.z=void 0,i.hasZ=!1):(i.z=zt[2],i.hasZ=!0),e.m===void 0?(i.m=void 0,i.hasM=!1):(i.m=e.m,i.hasM=!0),i):null}function gY(e,t,i,s,r){const{points:n,hasZ:o,hasM:a}=e,l=[],u=n.length,d=[];for(const f of n)d.push(f[0],f[1],o?f[2]:r);if(!Am(d,t,0,d,s,0,u))return null;for(let f=0;f.3?(v=l/m*(1+g*(r.a1+T+y*k)/m),U=Math.asin(v),_=v*v,b=Math.sqrt(1-_)):(b=d/m*(1-y*(r.a5-T-g*k)/m),U=Math.acos(b),_=1-b*b,v=Math.sqrt(_)),x=1-it.eccentricitySquared*_,$=it.radius/Math.sqrt(x),I=r.a6*$,T=d-$*b,k=l-I*v,F=b*T+v*k,A=b*k-v*T,G=A/(I/x+F),U+=G,H=F+A*G/2,a<0&&(U=-U),i[s++]=qh*J,i[s++]=qh*U,i[s]=H}function OY(e,t,i,s){Cc(e,t,i,s),Ic(i,s,i,s)}function RY(e,t,i,s){Cc(e,t,i,s),Hf(i,s,i,s)}const ap={[C.WGS84]:{[C.CGCS2000]:null,[C.GCSMARS2000]:null,[C.GCSMOON2000]:null,[C.LON_LAT]:He,[C.WGS84_COMPARABLE_LON_LAT]:He,[C.SPHERICAL_ECEF]:Ic,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:Hf,[C.PLATE_CARREE]:$c,[C.WGS84]:He,[C.WGS84_ECEF]:kc},[C.CGCS2000]:{[C.CGCS2000]:He,[C.GCSMARS2000]:null,[C.GCSMOON2000]:null,[C.LON_LAT]:He,[C.WGS84_COMPARABLE_LON_LAT]:He,[C.SPHERICAL_ECEF]:Ic,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:null,[C.PLATE_CARREE]:$c,[C.WGS84]:null,[C.WGS84_ECEF]:kc},[C.GCSMARS2000]:{[C.CGCS2000]:null,[C.GCSMARS2000]:He,[C.GCSMOON2000]:null,[C.LON_LAT]:He,[C.WGS84_COMPARABLE_LON_LAT]:null,[C.SPHERICAL_ECEF]:null,[C.SPHERICAL_MARS_PCPF]:ak,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:null,[C.PLATE_CARREE]:null,[C.WGS84]:null,[C.WGS84_ECEF]:null},[C.GCSMOON2000]:{[C.CGCS2000]:null,[C.GCSMARS2000]:null,[C.GCSMOON2000]:He,[C.LON_LAT]:He,[C.WGS84_COMPARABLE_LON_LAT]:null,[C.SPHERICAL_ECEF]:null,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:ok,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:null,[C.PLATE_CARREE]:null,[C.WGS84]:null,[C.WGS84_ECEF]:null},[C.WEB_MERCATOR]:{[C.CGCS2000]:null,[C.GCSMARS2000]:null,[C.GCSMOON2000]:null,[C.LON_LAT]:Eh,[C.WGS84_COMPARABLE_LON_LAT]:Eh,[C.SPHERICAL_ECEF]:wY,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:He,[C.PLATE_CARREE]:MY,[C.WGS84]:Eh,[C.WGS84_ECEF]:xY},[C.WGS84_ECEF]:{[C.CGCS2000]:Cc,[C.GCSMARS2000]:null,[C.GCSMOON2000]:null,[C.LON_LAT]:Cc,[C.WGS84_COMPARABLE_LON_LAT]:Cc,[C.SPHERICAL_ECEF]:OY,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:RY,[C.PLATE_CARREE]:$Y,[C.WGS84]:Cc,[C.WGS84_ECEF]:He},[C.SPHERICAL_ECEF]:{[C.CGCS2000]:Ec,[C.GCSMARS2000]:null,[C.GCSMOON2000]:null,[C.LON_LAT]:Ec,[C.WGS84_COMPARABLE_LON_LAT]:Ec,[C.SPHERICAL_ECEF]:He,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:CY,[C.PLATE_CARREE]:TY,[C.WGS84]:Ec,[C.WGS84_ECEF]:PY},[C.SPHERICAL_MARS_PCPF]:{[C.CGCS2000]:null,[C.GCSMARS2000]:ck,[C.GCSMOON2000]:null,[C.LON_LAT]:ck,[C.WGS84_COMPARABLE_LON_LAT]:null,[C.SPHERICAL_ECEF]:null,[C.SPHERICAL_MARS_PCPF]:He,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:null,[C.PLATE_CARREE]:null,[C.WGS84]:null,[C.WGS84_ECEF]:null},[C.SPHERICAL_MOON_PCPF]:{[C.CGCS2000]:null,[C.GCSMARS2000]:null,[C.GCSMOON2000]:lk,[C.LON_LAT]:lk,[C.WGS84_COMPARABLE_LON_LAT]:null,[C.SPHERICAL_ECEF]:null,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:He,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:null,[C.PLATE_CARREE]:null,[C.WGS84]:null,[C.WGS84_ECEF]:null},[C.UNKNOWN]:{[C.CGCS2000]:null,[C.GCSMARS2000]:null,[C.GCSMOON2000]:null,[C.LON_LAT]:null,[C.WGS84_COMPARABLE_LON_LAT]:null,[C.SPHERICAL_ECEF]:null,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:He,[C.WEB_MERCATOR]:null,[C.PLATE_CARREE]:null,[C.WGS84]:null,[C.WGS84_ECEF]:null},[C.LON_LAT]:{[C.CGCS2000]:He,[C.GCSMARS2000]:He,[C.GCSMOON2000]:He,[C.LON_LAT]:He,[C.WGS84_COMPARABLE_LON_LAT]:He,[C.SPHERICAL_ECEF]:Ic,[C.SPHERICAL_MARS_PCPF]:ak,[C.SPHERICAL_MOON_PCPF]:ok,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:Hf,[C.PLATE_CARREE]:$c,[C.WGS84]:He,[C.WGS84_ECEF]:kc},[C.WGS84_COMPARABLE_LON_LAT]:{[C.CGCS2000]:null,[C.GCSMARS2000]:null,[C.GCSMOON2000]:null,[C.LON_LAT]:He,[C.WGS84_COMPARABLE_LON_LAT]:He,[C.SPHERICAL_ECEF]:Ic,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:null,[C.PLATE_CARREE]:$c,[C.WGS84]:He,[C.WGS84_ECEF]:kc},[C.PLATE_CARREE]:{[C.CGCS2000]:Tc,[C.GCSMARS2000]:null,[C.GCSMOON2000]:null,[C.LON_LAT]:Tc,[C.WGS84_COMPARABLE_LON_LAT]:Tc,[C.SPHERICAL_ECEF]:IY,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:EY,[C.PLATE_CARREE]:He,[C.WGS84]:Tc,[C.WGS84_ECEF]:kY}};function lD(e,t,i=C$()){return N(e)||N(t)?null:LY(e,t,i).projector}function LY(e,t,i){if(N(e)||N(t)||i.source.spatialReference===e&&i.dest.spatialReference===t)return i;const s=pv(e,i.source),r=pv(t,i.dest);return s===C.UNKNOWN&&r===C.UNKNOWN?Kt(e,t)?i.projector=He:i.projector=null:i.projector=ap[s][r],i}function C$(){return{source:{spatialReference:null,spatialReferenceId:C.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:C.UNKNOWN,metersPerUnit:1},projector:He}}const FY={spatialReference:null,spatialReferenceId:C.UNKNOWN},DY={spatialReference:null,spatialReferenceId:C.UNKNOWN},cD=C$();C$();const Sn=WG(1),qh=cF(1),by=On(),Wo=On(),Ho=On(),zt=On();async function NY(e){if(!e)return;const t=e.includes("-vector")?e.slice(0,e.indexOf("-vector")):e,i=await uR("esri/t9n/basemaps");return i[e]||i[t]}const Gh={streets:{id:"streets",classic:!0,deprecated:!0,get thumbnailUrl(){return Ne("esri/images/basemap/streets.jpg")},baseMapLayers:[{id:"streets-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Street Map",showLegend:!1,visibility:!0,opacity:1}]},satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"Hybrid Reference Layer",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Terrain Base",showLegend:!1,visibility:!0,opacity:1},{id:"terrain-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Reference Overlay",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},topo:{id:"topo",classic:!0,deprecated:!0,get thumbnailUrl(){return Ne("esri/images/basemap/topo.jpg")},baseMapLayers:[{id:"topo-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Topo Map",showLegend:!1,visibility:!0,opacity:1}]},gray:{id:"gray",classic:!0,deprecated:!0,get thumbnailUrl(){return Ne("esri/images/basemap/gray.jpg")},baseMapLayers:[{id:"gray-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Light Gray Base",showLegend:!1,visibility:!0,opacity:1},{id:"gray-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Light Gray Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},"dark-gray":{id:"dark-gray",classic:!0,deprecated:!0,get thumbnailUrl(){return Ne("esri/images/basemap/dark-gray.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Dark Gray Base",showLegend:!1,visibility:!0,opacity:1},{id:"dark-gray-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Dark Gray Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},"national-geographic":{id:"national-geographic",classic:!0,deprecated:!0,get thumbnailUrl(){return Ne("esri/images/basemap/national-geographic.jpg")},baseMapLayers:[{id:"national-geographic-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer",title:"NatGeo World Map",showLegend:!1,layerType:"ArcGISTiledMapServiceLayer",visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"arcgis-imagery":{get thumbnailUrl(){return Ne("esri/images/basemap/hybrid.jpg")},title:"Imagery Hybrid",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-imagery-standard":{get thumbnailUrl(){return Ne("esri/images/basemap/satellite.jpg")},title:"Imagery",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"}]},"arcgis-imagery-labels":{title:"Hybrid [Reference]",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-light-gray":{get thumbnailUrl(){return Ne("esri/images/basemap/gray-vector.jpg")},title:"Light Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Base",title:"Light Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Labels",title:"Light Gray Canvas Labels",isReference:!0}]},"arcgis-dark-gray":{get thumbnailUrl(){return Ne("esri/images/basemap/dark-gray.jpg")},title:"Dark Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Base",title:"Dark Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Labels",title:"Dark Gray Canvas Labels",isReference:!0}]},"arcgis-navigation":{get thumbnailUrl(){return Ne("esri/images/basemap/streets-navigation.jpg")},title:"Navigation",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Navigation",title:"World Navigation Map"}]},"arcgis-navigation-night":{title:"Navigation (Dark Mode)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:NavigationNight",title:"World Navigation Map (Dark Mode)"}]},"arcgis-streets":{get thumbnailUrl(){return Ne("esri/images/basemap/streets-vector.jpg")},title:"Streets",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Streets",title:"World Street Map"}]},"arcgis-streets-night":{get thumbnailUrl(){return Ne("esri/images/basemap/streets-night.jpg")},title:"Streets (Night)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsNight",title:"World Street Map (Night)"}]},"arcgis-streets-relief":{get thumbnailUrl(){return Ne("esri/images/basemap/streets-relief.jpg")},title:"Streets (with Relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsRelief:Base",title:"World Street Map (with Relief)"}]},"arcgis-topographic":{get thumbnailUrl(){return Ne("esri/images/basemap/topo.jpg")},title:"Topographic",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Topographic:Base",title:"World Topographic Map"}]},"arcgis-oceans":{get thumbnailUrl(){return Ne("esri/images/basemap/oceans.jpg")},title:"Oceans",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Ocean Base",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Oceans:Labels",title:"World Ocean Reference",isReference:!0}]},"osm-standard":{title:"OpenStreetMap",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Standard",title:"OpenStreetMap"}]},"osm-standard-relief":{title:"OpenStreetMap (with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StandardRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-streets":{title:"OpenStreetMap (Streets)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Streets",title:"OpenStreetMap (Streets)"}]},"osm-streets-relief":{title:"OpenStreetMap (Streets with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StreetsRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-light-gray":{title:"OpenStreetMap (Light Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Base",title:"OSM (Light Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Labels",title:"OSM (Light Gray Reference)",isReference:!0}]},"osm-dark-gray":{title:"OpenStreetMap (Dark Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Base",title:"OSM (Dark Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Labels",title:"OSM (Dark Gray Reference)",isReference:!0}]},"arcgis-terrain":{title:"Terrain with Labels",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Base",title:"World Terrain Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Detail",title:"World Terrain Reference",isReference:!0}]},"arcgis-community":{title:"Community",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Community",title:"Community"}]},"arcgis-charted-territory":{title:"Charted Territory",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ChartedTerritory:Base",title:"Charted Territory"}]},"arcgis-colored-pencil":{title:"Colored Pencil",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ColoredPencil",title:"Colored Pencil"}]},"arcgis-nova":{title:"Nova",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Nova",title:"Nova"}]},"arcgis-modern-antique":{title:"Modern Antique",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ModernAntique:Base",title:"Modern Antique"}]},"arcgis-midcentury":{title:"Mid-Century",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Midcentury",title:"Mid-Century"}]},"arcgis-newspaper":{title:"Newspaper",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Newspaper",title:"Newspaper"}]},"arcgis-hillshade-light":{title:"Hillshade",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"}]},"arcgis-hillshade-dark":{title:"Hillshade (Dark)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade (Dark)",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade_Dark/MapServer"}]},"arcgis-human-geography":{title:"Human Geography",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Base",title:"Human Geography Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Detail",title:"Human Geography Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Label",title:"Human Geography Label",isReference:!0}]},"arcgis-human-geography-dark":{title:"Human Geography (Dark)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Base",title:"Human Geography Dark Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Detail",title:"Human Geography Dark Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Label",title:"Human Geography Dark Label",isReference:!0}]}};var ze;(function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE",e[e.MOVE=4]="MOVE"})(ze||(ze={}));function P$(e){return(t,i)=>{t[i]=e}}var yo;class jY{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(t){this.defaultPrevented=!1,this.item=t}}const Cs=new zr(jY,void 0,e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1}),VY=()=>{};function R_(e){return e?e instanceof bc?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function L_(e){if(e&&e.length)return e[0]}function zY(e,t,i,s){const r=Math.min(e.length-i,t.length-s);let n=0;for(;n{e.push(r),uD(e,i.call(s,r,n,o),i,s)})}const Yo=new Set,Jo=new Set,Xo=new Set,F_=new Map;let BY=0,bc=yo=class extends jo.EventedAccessor{constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._timer=null,this._observable=new S$,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:BY++})}static isCollection(e){return e!=null&&e instanceof yo}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof yo?{items:e}:e:{}}destroy(){this.removeAll()}*[Symbol.iterator](){yield*this.items}get items(){return _e(this._observable),this._items}set items(e){this._emitBeforeChanges(ze.ADD)||(this._splice(0,this.length,R_(e)),this._emitAfterChanges(ze.ADD))}hasEventListener(e){return e==="change"?this._chgListeners.length>0:this._emitter.hasEventListener(e)}on(e,t){if(e==="change"){const i=this._chgListeners,s={removed:!1,callback:t};return i.push(s),this._notifications&&this._notifications.push({listeners:i.slice(),items:this._items.slice(),changes:[]}),{remove(){this.remove=VY,s.removed=!0,i.splice(i.indexOf(s),1)}}}return this._emitter.on(e,t)}once(e,t){const i=this.on(e,t);return{remove(){i.remove()}}}add(e,t){if(_e(this._observable),this._emitBeforeChanges(ze.ADD))return this;const i=this.getNextIndex(t!=null?t:null);return this._splice(i,0,[e]),this._emitAfterChanges(ze.ADD),this}addMany(e,t=this._items.length){if(_e(this._observable),!e||!e.length)return this;if(this._emitBeforeChanges(ze.ADD))return this;const i=this.getNextIndex(t);return this._splice(i,0,R_(e)),this._emitAfterChanges(ze.ADD),this}at(e){if(_e(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if(_e(this._observable),!this.length||this._emitBeforeChanges(ze.REMOVE))return[];const e=this._splice(0,this.length)||[];return this._emitAfterChanges(ze.REMOVE),e}clone(){return _e(this._observable),this._createNewInstance({items:this._items.map(R)})}concat(...e){_e(this._observable);const t=e.map(R_);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if(_e(this._observable),!this.length||this._emitBeforeChanges(ze.REMOVE))return;const i=this._splice(0,this.length),s=i.length;for(let r=0;rt&&(e=t),e}includes(e,t=0){return _e(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return _e(this._observable),this._items.indexOf(e,t)}join(e=","){return _e(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return _e(this._observable),this._items.lastIndexOf(e,t)}map(e,t){_e(this._observable);const i=this._items.map(e,t);return new yo({items:i})}reorder(e,t=this.length-1){_e(this._observable);const i=this.indexOf(e);if(i!==-1){if(t<0?t=0:t>=this.length&&(t=this.length-1),i!==t){if(this._emitBeforeChanges(ze.MOVE))return e;this._splice(i,1),this._splice(t,0,[e]),this._emitAfterChanges(ze.MOVE)}return e}}pop(){if(_e(this._observable),!this.length||this._emitBeforeChanges(ze.REMOVE))return;const e=L_(this._splice(this.length-1,1));return this._emitAfterChanges(ze.REMOVE),e}push(...e){return _e(this._observable),this._emitBeforeChanges(ze.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(ze.ADD)),this.length}reduce(e,t){_e(this._observable);const i=this._items;return arguments.length===2?i.reduce(e,t):i.reduce(e)}reduceRight(e,t){_e(this._observable);const i=this._items;return arguments.length===2?i.reduceRight(e,t):i.reduceRight(e)}remove(e){return _e(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if(_e(this._observable),e<0||e>=this.length||this._emitBeforeChanges(ze.REMOVE))return;const t=L_(this._splice(e,1));return this._emitAfterChanges(ze.REMOVE),t}removeMany(e){if(_e(this._observable),!e||!e.length||this._emitBeforeChanges(ze.REMOVE))return[];const t=e instanceof yo?e.toArray():e,i=this._items,s=[],r=t.length;for(let n=0;n-1){const l=1+zY(t,i,n+1,a+1),u=this._splice(a,l);u&&u.length>0&&s.push.apply(s,u),n+=l-1}}return this._emitAfterChanges(ze.REMOVE),s}reverse(){if(_e(this._observable),this._emitBeforeChanges(ze.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(ze.MOVE),this}shift(){if(_e(this._observable),!this.length||this._emitBeforeChanges(ze.REMOVE))return;const e=L_(this._splice(0,1));return this._emitAfterChanges(ze.REMOVE),e}slice(e=0,t=this.length){return _e(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return _e(this._observable),this._items.some(e,t)}sort(e){if(_e(this._observable),!this.length||this._emitBeforeChanges(ze.MOVE))return this;const t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(ze.MOVE),this}splice(e,t,...i){_e(this._observable);const s=(t?ze.REMOVE:0)|(i.length?ze.ADD:0);if(this._emitBeforeChanges(s))return[];const r=this._splice(e,t,i)||[];return this._emitAfterChanges(s),r}toArray(){return _e(this._observable),this._items.slice()}toJSON(){return _e(this._observable),this.toArray()}toLocaleString(){return _e(this._observable),this._items.toLocaleString()}toString(){return _e(this._observable),this._items.toString()}unshift(...e){return _e(this._observable),!e.length||this._emitBeforeChanges(ze.ADD)||(this._splice(0,0,e),this._emitAfterChanges(ze.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,i){const s=this._items,r=this.itemType;let n,o;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._timer=ad(()=>this._dispatchChange())),t){if(o=s.splice(e,t),this.hasEventListener("before-remove")){const a=Cs.acquire();a.target=this,a.cancellable=!0;for(let l=0,u=o.length;l{s.push(l)});const r=Vi.acquire();Jo.forEach(l=>{r.push(l)});const n=this._items,o=t.items,a=Vi.acquire();if(Xo.forEach(l=>{o.indexOf(l)!==n.indexOf(l)&&a.push(l)}),t.listeners&&(s.length||r.length||a.length)){const l={target:this,added:s,removed:r,moved:a},u=t.listeners.length;for(let d=0;d{if(!e)return yo;if(F_.has(e))return F_.get(e);let t=null;if(typeof e=="function")t=e.prototype.declaredClass;else if(e.base)t=e.base.prototype.declaredClass;else for(const s in e.typeMap){const r=e.typeMap[s].prototype.declaredClass;t?t+=` | ${r}`:t=r}let i=class extends yo{};return c([P$({Type:e,ensureType:typeof e=="function"?Dt(e):En(e)})],i.prototype,"itemType",void 0),i=c([S(`esri.core.Collection<${t}>`)],i),F_.set(e,i),i},c([h()],bc.prototype,"length",void 0),c([h()],bc.prototype,"items",null),bc=yo=c([S("esri.core.Collection")],bc);const he=bc;function ou(e,t,i=he){return t||(t=new i),t===e||(t.removeAll(),UY(e)?t.addMany(e):e&&t.add(e)),t}function hD(e){return e}function UY(e){return e&&(Array.isArray(e)||"items"in e&&Array.isArray(e.items))}const qY="not-loaded",GY="loading",WY="failed",uk="loaded",dD=e=>{let t=class extends e{constructor(...i){super(...i),this._loadController=null,this.loadError=null,this.loadStatus="not-loaded",this._set("loadWarnings",[]),this.addResolvingPromise(new Promise(s=>{const r=this.load.bind(this);this.load=n=>{const o=new Promise((a,l)=>{const u=JM(n,l);this.destroyed&&l(new L("load:instance-destroyed",`Instance of '${this.declaredClass||this.constructor.name}' is already destroyed`,{instance:this})),this._promiseProps.when(a,l).finally(()=>{u&&u.remove()})});if(this.loadStatus===qY){this._set("loadStatus",GY);const a=this._loadController=new AbortController;r({signal:a.signal}),Vr(a.signal,()=>{this._promiseProps.abort()})}return s(),o}})),this.when(()=>{this._set("loadStatus",uk),this._loadController=null},s=>{this._set("loadStatus",WY),this._set("loadError",s),this._loadController=null})}get loaded(){return this.loadStatus===uk}get loadWarnings(){return this._get("loadWarnings")}load(){return null}cancelLoad(){var i;return this.isFulfilled()||(this._set("loadError",new L("load:cancelled","Cancelled")),(i=this._loadController)==null||i.abort()),this}};return c([h({readOnly:!0})],t.prototype,"loaded",null),c([h({readOnly:!0})],t.prototype,"loadError",void 0),c([h({clonable:!1})],t.prototype,"loadStatus",void 0),c([h({type:[Bi],readOnly:!0})],t.prototype,"loadWarnings",null),t=c([S("esri.core.Loadable")],t),t};let lp=class extends dD(J0){};lp=c([S("esri.core.Loadable")],lp),function(e){function t(i){return!(!i||!i.load)}e.LoadableMixin=dD,e.isLoadable=t}(lp||(lp={}));const Lo=lp;function HY(e,t,i){return as(e.map((s,r)=>t.apply(i,[s,r])))}async function YY(e,t,i){return(await as(e.map((s,r)=>t.apply(i,[s,r])))).map(s=>s.value)}function A$(e){return{ok:!0,value:e}}function O$(e){return{ok:!1,error:e}}function JY(e){return M(e)&&e.ok===!0?e.value:null}function XY(e){return M(e)&&e.ok===!1?e.error:null}async function xb(e){if(N(e))return{ok:!1,error:new Error("no promise provided")};try{return A$(await e)}catch(t){return O$(t)}}async function Ibe(e){try{return A$(await e)}catch(t){return Em(t),O$(t)}}function pD(e,t){return new aa(e,t)}let aa=class extends oe{constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=k0(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:i}=this._abortController;this.promise=e(i),this.promise.then(s=>{this._result=A$(s),this._cleanup()},s=>{this._result=O$(s),this._cleanup()}),this._abortHandle=Vr(t,this.abort)}get value(){return JY(this._result)}get error(){return XY(this._result)}get finished(){return M(this._result)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=Bt(this._abortHandle),this._abortController=null}};c([h()],aa.prototype,"value",null),c([h()],aa.prototype,"error",null),c([h()],aa.prototype,"finished",null),c([h()],aa.prototype,"promise",void 0),c([h()],aa.prototype,"_result",void 0),aa=c([S("esri.core.asyncUtils.ReactiveTask")],aa);async function fD(e,t){return await e.load(),ZY(e,t)}async function ZY(e,t){const i=[],s=(...n)=>{for(const o of n)N(o)||(Array.isArray(o)?s(...o):he.isCollection(o)?o.forEach(a=>s(a)):Lo.isLoadable(o)&&i.push(o))};t(s);let r=null;if(await YY(i,async n=>{(await xb(QY(n)?n.loadAll():n.load())).ok!==!1||r||(r=n)}),r)throw r.loadError;return e}function QY(e){return"loadAll"in e&&typeof e.loadAll=="function"}var ix;const KY=new Ie({avgRating:"avg-rating",numRatings:"num-ratings",numComments:"num-comments",numViews:"num-views"});let Ns=ix=class extends oe{constructor(e){super(e),this.categories=null,this.disableExtraQuery=!1,this.extent=null,this.filter=null,this.num=10,this.query=null,this.sortField=null,this.start=1}get sortOrder(){return this._get("sortOrder")||"asc"}set sortOrder(e){e!=="asc"&&e!=="desc"||this._set("sortOrder",e)}clone(){return new ix({categories:this.categories?R(this.categories):null,disableExtraQuery:this.disableExtraQuery,extent:this.extent?this.extent.clone():null,filter:this.filter,num:this.num,query:this.query,sortField:this.sortField,sortOrder:this.sortOrder,start:this.start})}toRequestOptions(e,t){let i,s;if(this.categories&&(i=this.categories.map(o=>Array.isArray(o)?JSON.stringify(o):o)),this.extent){const o=bb(this.extent,xe.WGS84);M(o)&&(s=`${o.xmin},${o.ymin},${o.xmax},${o.ymax}`)}let r=this.query;!this.disableExtraQuery&&e.extraQuery&&(r="("+r+")"+e.extraQuery);const n={categories:i,bbox:s,q:r,filter:this.filter,num:this.num,sortField:null,sortOrder:null,start:this.start};return this.sortField&&(n.sortField=this.sortField.split(",").map(o=>KY.toJSON(o.trim())).join(","),n.sortOrder=this.sortOrder),{query:{...t,...n}}}};c([h()],Ns.prototype,"categories",void 0),c([h()],Ns.prototype,"disableExtraQuery",void 0),c([h({type:Ze})],Ns.prototype,"extent",void 0),c([h()],Ns.prototype,"filter",void 0),c([h()],Ns.prototype,"num",void 0),c([h()],Ns.prototype,"query",void 0),c([h()],Ns.prototype,"sortField",void 0),c([h()],Ns.prototype,"sortOrder",null),c([h()],Ns.prototype,"start",void 0),Ns=ix=c([S("esri.portal.PortalQueryParams")],Ns);const wo=Ns;let Ol=class extends oe{constructor(e){super(e),this.nextQueryParams=null,this.queryParams=null,this.results=null,this.total=null}};c([h()],Ol.prototype,"nextQueryParams",void 0),c([h()],Ol.prototype,"queryParams",void 0),c([h()],Ol.prototype,"results",void 0),c([h()],Ol.prototype,"total",void 0),Ol=c([S("esri.portal.PortalQueryResult")],Ol);const eJ=Ol;let Wn=class extends W{constructor(e){super(e),this.created=null,this.id=null,this.portal=null,this.title=null,this.username=null}get url(){const e=this.get("portal.restUrl");return e?`${e}/content/users/${this.username}/${this.id}`:null}toJSON(){throw new L("internal:not-yet-implemented","PortalFolder.toJSON is not yet implemented")}};c([h({type:Date})],Wn.prototype,"created",void 0),c([h()],Wn.prototype,"id",void 0),c([h()],Wn.prototype,"portal",void 0),c([h()],Wn.prototype,"title",void 0),c([h({readOnly:!0})],Wn.prototype,"url",null),c([h()],Wn.prototype,"username",void 0),Wn=c([S("esri.portal.PortalFolder")],Wn);const tJ=Wn;let qt=class extends W{constructor(e){super(e),this.access=null,this.created=null,this.description=null,this.id=null,this.isInvitationOnly=!1,this.modified=null,this.owner=null,this.portal=null,this.snippet=null,this.sortField=null,this.sortOrder=null,this.tags=null,this.title=null}get thumbnailUrl(){var i;const e=this.url,t=this.thumbnail;return e&&t&&this.portal?(i=this.portal)==null?void 0:i._normalizeUrl(`${e}/info/${t}?f=json`):null}get url(){const e=this.get("portal.restUrl");return e?e+"/community/groups/"+this.id:null}fetchCategorySchema(e){return Hs(this.portal)._request(this.url+"/categorySchema",e).then(t=>{const i=t.categorySchema||[];return i.some(s=>s.source==="contentCategorySetsGroupQuery.LivingAtlas")?this._fetchCategorySchemaSet("LivingAtlas",e):i})}fetchMembers(e){return Hs(this.portal)._request(this.url+"/users",e)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}toJSON(){throw new L("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}queryItems(e,t){let i=Dt(wo,e);const s=Hs(this.portal);return parseFloat(s.currentVersion)>5?(i=i||new wo,s._queryPortal(`/content/groups/${this.id}/search`,i,"PortalItem",t)):(i=i?i.clone():new wo,i.query="group:"+this.id+(i.query?" "+i.query:""),s.queryItems(i,t))}_fetchCategorySchemaSet(e,t){const i=Hs(this.portal);return i._fetchSelf(i.authMode,!0,t).then(s=>{const r=s.contentCategorySetsGroupQuery;if(r){const n=new wo;return n.disableExtraQuery=!0,n.num=1,n.query=r,i.queryGroups(n,t)}throw new L("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery value not found")}).then(s=>{if(s.total){const r=s.results[0],n=new wo;return n.num=1,n.query=`typekeywords:"${e}"`,r.queryItems(n,t)}throw new L("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery group not found")}).then(s=>s.total?s.results[0].fetchData("json",t).then(r=>{const n=r&&r.categorySchema;return n&&n.length?n:[]}):[])}};c([h()],qt.prototype,"access",void 0),c([h({type:Date})],qt.prototype,"created",void 0),c([h()],qt.prototype,"description",void 0),c([h()],qt.prototype,"id",void 0),c([h()],qt.prototype,"isInvitationOnly",void 0),c([h({type:Date})],qt.prototype,"modified",void 0),c([h()],qt.prototype,"owner",void 0),c([h()],qt.prototype,"portal",void 0),c([h()],qt.prototype,"snippet",void 0),c([h()],qt.prototype,"sortField",void 0),c([h()],qt.prototype,"sortOrder",void 0),c([h()],qt.prototype,"tags",void 0),c([h()],qt.prototype,"thumbnail",void 0),c([h({readOnly:!0})],qt.prototype,"thumbnailUrl",null),c([h()],qt.prototype,"title",void 0),c([h({readOnly:!0})],qt.prototype,"url",null),qt=c([S("esri.portal.PortalGroup")],qt);const sx=qt;var iJ=Object.freeze(Object.defineProperty({__proto__:null,default:sx},Symbol.toStringTag,{value:"Module"})),rx;let Qe=rx=class extends W{constructor(...e){super(...e),this.access=null,this.created=null,this.culture=null,this.description=null,this.email=null,this.fullName=null,this.modified=null,this.orgId=null,this.portal=null,this.preferredView=null,this.privileges=null,this.region=null,this.role=null,this.roleId=null,this.sourceJSON=null,this.units=null,this.username=null,this.userType=null}get thumbnailUrl(){const e=this.url,t=this.thumbnail;return e&&t?this.portal._normalizeUrl(`${e}/info/${t}?f=json`):null}get userContentUrl(){const e=this.get("portal.restUrl");return e?`${e}/content/users/${this.username}`:null}get url(){const e=this.get("portal.restUrl");return e?`${e}/community/users/${this.username}`:null}addItem(e){const t=e&&e.item,i=e&&e.data,s=e&&e.folder,r={method:"post"};t&&(r.query=t.createPostQuery(),i!=null&&(typeof i=="string"?r.query.text=i:typeof i=="object"&&(r.query.text=JSON.stringify(i))));let n=this.userContentUrl;return s&&(n+="/"+(typeof s=="string"?s:s.id)),this.portal._request(n+"/addItem",r).then(o=>(t.id=o.id,t.portal=this.portal,t.loaded?t.reload():t.load()))}deleteItem(e){let t=this.userContentUrl;return e.ownerFolder&&(t+="/"+e.ownerFolder),this.portal._request(t+`/items/${e.id}/delete`,{method:"post"}).then(()=>{e.id=null,e.portal=null})}deleteItems(e){const t=this.userContentUrl+"/deleteItems",i=e.map(s=>s.id);if(i.length){const s={method:"post",query:{items:i.join(",")}};return this.portal._request(t,s).then(()=>{e.forEach(r=>{r.id=null,r.portal=null})})}return Promise.resolve(void 0)}fetchFolders(){var t;const e={query:{num:1}};return this.portal._request((t=this.userContentUrl)!=null?t:"",e).then(i=>{let s;return s=i&&i.folders?i.folders.map(r=>{const n=tJ.fromJSON(r);return n.portal=this.portal,n}):[],s})}fetchGroups(){var e;return this.portal._request((e=this.url)!=null?e:"").then(t=>{let i;return i=t&&t.groups?t.groups.map(s=>{const r=sx.fromJSON(s);return r.portal=this.portal,r}):[],i})}fetchItems(e){var r;const t=e!=null?e:{};let i,s=(r=this.userContentUrl)!=null?r:"";return t.folder&&(s+="/"+t.folder.id),z(()=>Promise.resolve().then(function(){return mD}),void 0).then(({default:n})=>{i=n;const o={folders:!1,num:t.num||10,start:t.start||1,sortField:t.sortField||"created",sortOrder:t.sortOrder||"asc"};return this.portal._request(s,{query:o})}).then(n=>{let o;return n&&n.items?(o=n.items.map(a=>{const l=i.fromJSON(a);return l.portal=this.portal,l}),Promise.all(o.map(a=>a.load())).catch(a=>a).then(()=>({items:o,nextStart:n.nextStart,total:n.total}))):{items:[],nextStart:-1,total:0}})}fetchTags(){return this.portal._request(this.url+"/tags").then(e=>e.tags)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}queryFavorites(e){return this.favGroupId?(this._favGroup||(this._favGroup=new sx({id:this.favGroupId,portal:this.portal})),this._favGroup.queryItems(e)):Promise.reject(new L("internal:unknown","Unknown internal error",{internalError:"Unknown favGroupId"}))}toJSON(){throw new L("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");const t=new rx;return t.sourceJSON=e,t.read(e),t}};c([h()],Qe.prototype,"access",void 0),c([h({type:Date})],Qe.prototype,"created",void 0),c([h()],Qe.prototype,"culture",void 0),c([h()],Qe.prototype,"description",void 0),c([h()],Qe.prototype,"email",void 0),c([h()],Qe.prototype,"favGroupId",void 0),c([h()],Qe.prototype,"fullName",void 0),c([h({type:Date})],Qe.prototype,"modified",void 0),c([h()],Qe.prototype,"orgId",void 0),c([h()],Qe.prototype,"portal",void 0),c([h()],Qe.prototype,"preferredView",void 0),c([h()],Qe.prototype,"privileges",void 0),c([h()],Qe.prototype,"region",void 0),c([h()],Qe.prototype,"role",void 0),c([h()],Qe.prototype,"roleId",void 0),c([h()],Qe.prototype,"sourceJSON",void 0),c([h()],Qe.prototype,"thumbnail",void 0),c([h({readOnly:!0})],Qe.prototype,"thumbnailUrl",null),c([h()],Qe.prototype,"units",void 0),c([h({readOnly:!0})],Qe.prototype,"userContentUrl",null),c([h({readOnly:!0})],Qe.prototype,"url",null),c([h()],Qe.prototype,"username",void 0),c([h()],Qe.prototype,"userType",void 0),Qe=rx=c([S("esri.portal.PortalUser")],Qe);const R$=Qe;var sJ=Object.freeze(Object.defineProperty({__proto__:null,default:R$},Symbol.toStringTag,{value:"Module"})),ps;let D_;const hk={PortalGroup:()=>z(()=>Promise.resolve().then(function(){return iJ}),void 0),PortalItem:()=>z(()=>Promise.resolve().then(function(){return mD}),void 0),PortalUser:()=>z(()=>Promise.resolve().then(function(){return sJ}),void 0)};let K=ps=class extends Cm(Lo){constructor(e){super(e),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=je.portalUrl,this.urlKey=null,this.user=null,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(e){return typeof e=="string"?{url:e}:e}destroy(){this._esriIdCredentialCreateHandle=Bt(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(e){if(e)for(const t of e)je.request.trustedServers.includes(t)||je.request.trustedServers.push(t);return e}readDefaultBasemap(e){return this._readBasemap(e)}readDefaultDevBasemap(e){return this._readBasemap(e)}readDefaultVectorBasemap(e){return this._readBasemap(e)}get extraQuery(){const e=!(this.user&&this.user.orgId)||this.canSearchPublic;return this.id&&!e?` AND orgid:${this.id}`:null}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get restUrl(){let e=this.url;if(e){const t=e.indexOf("/sharing");e=t>0?e.substring(0,t):this.url.replace(/\/+$/,""),e+="/sharing/rest"}return e}get thumbnailUrl(){const e=this.restUrl,t=this.thumbnail;return e&&t?this._normalizeSSL(e+"/portals/self/resources/"+t):null}readUrlKey(e){return e&&e.toLowerCase()}readUser(e){let t=null;return e&&(t=R$.fromJSON(e),t.portal=this),t}load(e){const t=z(()=>Promise.resolve().then(function(){return fJ}),void 0).then(({default:i})=>{Ft(e),D_=i}).then(()=>this.sourceJSON?this.sourceJSON:this._fetchSelf(this.authMode,!1,e)).then(i=>{if(bt){const s=bt;this.credential=s.findCredential(this.restUrl),this.credential||this.authMode!==ps.AUTH_MODE_AUTO||(this._esriIdCredentialCreateHandle=s.on("credential-create",()=>{s.findCredential(this.restUrl)&&this._signIn().catch(()=>{})}))}this.sourceJSON=i,this.read(i)});return this.addResolvingPromise(t),Promise.resolve(this)}async createElevationLayers(){await this.load();const e=this._getHelperService("defaultElevationLayers"),t=(await z(()=>import("./ElevationLayer.7d5a34eb.js"),["assets/ElevationLayer.7d5a34eb.js","assets/ArcGISCachedService.e7d85534.js","assets/TilemapCache.11964483.js"])).default;return e?e.map(i=>new t({id:i.id,url:i.url})):[]}fetchBasemaps(e,t){const i=new wo;return i.query=e||(je.apiKey&&IR(this.url)?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),i.disableExtraQuery=!0,this.queryGroups(i,t).then(s=>{if(i.num=100,i.query='type:"Web Map" -type:"Web Application"',s.total){const r=s.results[0];return i.sortField=r.sortField||"name",i.sortOrder=r.sortOrder||"desc",r.queryItems(i,t)}return null}).then(s=>{let r;return r=s&&s.total?s.results.filter(n=>n.type==="Web Map").map(n=>new D_({portalItem:n})):[],r})}fetchCategorySchema(e){return this.hasCategorySchema?this._request(this.restUrl+"/portals/self/categorySchema",e).then(t=>t.categorySchema):jr(e)?Promise.reject(_t()):Promise.resolve([])}fetchFeaturedGroups(e){const t=this.featuredGroups,i=new wo;if(i.num=100,i.sortField="title",t&&t.length){const s=[];for(const r of t)s.push(`(title:"${r.title}" AND owner:${r.owner})`);return i.query=s.join(" OR "),this.queryGroups(i,e).then(r=>r.results)}return jr(e)?Promise.reject(_t()):Promise.resolve([])}fetchRegions(e){var i;const t=((i=this.user)==null?void 0:i.culture)||this.culture||Rr();return this._request(this.restUrl+"/portals/regions",{...e,query:{culture:t}})}fetchSettings(e){var i;const t=((i=this.user)==null?void 0:i.culture)||this.culture||Rr();return this._request(this.restUrl+"/portals/self/settings",{...e,query:{culture:t}})}static getDefault(){return ps._default&&!ps._default.destroyed||(ps._default=new ps),ps._default}queryGroups(e,t){return this._queryPortal("/community/groups",e,"PortalGroup",t)}queryItems(e,t){return this._queryPortal("/search",e,"PortalItem",t)}queryUsers(e,t){return e.sortField||(e.sortField="username"),this._queryPortal("/community/users",e,"PortalUser",t)}toJSON(){throw new L("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new ps({sourceJSON:e})}_getHelperService(e){const t=this.helperServices&&this.helperServices[e];if(!t)throw new L("portal:service-not-found",`The \`helperServices\` do not include an entry named "${e}"`);return t}_getHelperServiceUrl(e){const t=this._getHelperService(e);if(!(t!=null&&t.url))throw new L("portal:service-url-not-found",`The \`helperServices\` entry "${e}" does not include a \`url\` value`);return t.url}_fetchSelf(e=this.authMode,t=!1,i){const s=this.restUrl+"/portals/self",r={authMode:e,query:{culture:Rr().toLowerCase()},...i};return r.authMode==="auto"&&(r.authMode="no-prompt"),t&&(r.query.default=!0),this._request(s,r)}_queryPortal(e,t,i,s){const r=Dt(wo,t),n=o=>this._request(this.restUrl+e,{...r.toRequestOptions(this),...s}).then(a=>{const l=r.clone();return l.start=a.nextStart,new eJ({nextQueryParams:l,queryParams:r,total:a.total,results:ps._resultsToTypedArray(o,{portal:this},a,s)})}).then(a=>Promise.all(a.results.map(l=>typeof l.when=="function"?l.when():a)).then(()=>a,l=>(Em(l),a)));return i&&hk[i]?hk[i]().then(({default:o})=>(Ft(s),n(o))):n()}_signIn(){if(this.authMode===ps.AUTH_MODE_ANONYMOUS)return Promise.reject(new L("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if(this.loadStatus==="failed")return Promise.reject(this.loadError);const e=t=>Promise.resolve().then(()=>this.loadStatus==="not-loaded"?(t||(this.authMode="immediate"),this.load().then(()=>null)):this.loadStatus==="loading"?this.load().then(()=>this.credential?null:(this.credential=t,this._fetchSelf("immediate"))):this.user&&this.credential===t?null:(this.credential=t,this._fetchSelf("immediate"))).then(i=>{i&&(this.sourceJSON=i,this.read(i))});return bt?bt.getCredential(this.restUrl).then(t=>e(t)):e(this.credential)}_normalizeSSL(e){return e.replace(/^http:/i,"https:").replace(":7080",":7443")}_normalizeUrl(e){const t=this.credential&&this.credential.token;return this._normalizeSSL(t?e+(e.includes("?")?"&":"?")+"token="+t:e)}_requestToTypedArray(e,t,i){return this._request(e,t).then(s=>{const r=ps._resultsToTypedArray(i,{portal:this},s);return Promise.all(r.map(n=>typeof n.when=="function"?n.when():s)).then(()=>r,()=>r)})}_readBasemap(e){if(e){const t=D_.fromJSON(e);return t.portalItem={portal:this},t}return null}_request(e,t={}){const i={f:"json",...t.query},{authMode:s=this.authMode===ps.AUTH_MODE_ANONYMOUS?"anonymous":"auto",body:r=null,cacheBust:n=!1,method:o="auto",responseType:a="json",signal:l}=t,u={authMode:s,body:r,cacheBust:n,method:o,query:i,responseType:a,timeout:0,signal:l};return kt(this._normalizeSSL(e),u).then(d=>d.data)}static _resultsToTypedArray(e,t,i,s){let r;if(i){const n=M(s)?s.signal:null;r=i.listings||i.notifications||i.userInvitations||i.tags||i.items||i.groups||i.comments||i.provisions||i.results||i.relatedItems||i,(e||t)&&(r=r.map(o=>{const a=Object.assign(e?e.fromJSON(o):o,t);return typeof a.load=="function"&&a.load(n),a}))}else r=[];return r}};K.AUTH_MODE_ANONYMOUS="anonymous",K.AUTH_MODE_AUTO="auto",K.AUTH_MODE_IMMEDIATE="immediate",c([h()],K.prototype,"access",void 0),c([h()],K.prototype,"allSSL",void 0),c([h()],K.prototype,"authMode",void 0),c([h()],K.prototype,"authorizedCrossOriginDomains",void 0),c([Q("authorizedCrossOriginDomains")],K.prototype,"readAuthorizedCrossOriginDomains",null),c([h()],K.prototype,"basemapGalleryGroupQuery",void 0),c([h()],K.prototype,"bingKey",void 0),c([h()],K.prototype,"canListApps",void 0),c([h()],K.prototype,"canListData",void 0),c([h()],K.prototype,"canListPreProvisionedItems",void 0),c([h()],K.prototype,"canProvisionDirectPurchase",void 0),c([h()],K.prototype,"canSearchPublic",void 0),c([h()],K.prototype,"canShareBingPublic",void 0),c([h()],K.prototype,"canSharePublic",void 0),c([h()],K.prototype,"canSignInArcGIS",void 0),c([h()],K.prototype,"canSignInIDP",void 0),c([h()],K.prototype,"colorSetsGroupQuery",void 0),c([h()],K.prototype,"commentsEnabled",void 0),c([h({type:Date})],K.prototype,"created",void 0),c([h()],K.prototype,"credential",void 0),c([h()],K.prototype,"culture",void 0),c([h()],K.prototype,"currentVersion",void 0),c([h()],K.prototype,"customBaseUrl",void 0),c([h()],K.prototype,"defaultBasemap",void 0),c([Q("defaultBasemap")],K.prototype,"readDefaultBasemap",null),c([h()],K.prototype,"defaultDevBasemap",void 0),c([Q("defaultDevBasemap")],K.prototype,"readDefaultDevBasemap",null),c([h({type:Ze})],K.prototype,"defaultExtent",void 0),c([h()],K.prototype,"defaultVectorBasemap",void 0),c([Q("defaultVectorBasemap")],K.prototype,"readDefaultVectorBasemap",null),c([h()],K.prototype,"description",void 0),c([h()],K.prototype,"devBasemapGalleryGroupQuery",void 0),c([h()],K.prototype,"eueiEnabled",void 0),c([h({readOnly:!0})],K.prototype,"extraQuery",null),c([h()],K.prototype,"featuredGroups",void 0),c([h()],K.prototype,"featuredItemsGroupQuery",void 0),c([h()],K.prototype,"galleryTemplatesGroupQuery",void 0),c([h()],K.prototype,"livingAtlasGroupQuery",void 0),c([h()],K.prototype,"hasCategorySchema",void 0),c([h()],K.prototype,"helpBase",void 0),c([h()],K.prototype,"helperServices",void 0),c([h()],K.prototype,"helpMap",void 0),c([h()],K.prototype,"homePageFeaturedContent",void 0),c([h()],K.prototype,"homePageFeaturedContentCount",void 0),c([h()],K.prototype,"httpPort",void 0),c([h()],K.prototype,"httpsPort",void 0),c([h()],K.prototype,"id",void 0),c([h()],K.prototype,"ipCntryCode",void 0),c([h({readOnly:!0})],K.prototype,"isOrganization",null),c([h()],K.prototype,"isPortal",void 0),c([h()],K.prototype,"isReadOnly",void 0),c([h({readOnly:!0})],K.prototype,"itemPageUrl",null),c([h()],K.prototype,"layerTemplatesGroupQuery",void 0),c([h()],K.prototype,"maxTokenExpirationMinutes",void 0),c([h({type:Date})],K.prototype,"modified",void 0),c([h()],K.prototype,"name",void 0),c([h()],K.prototype,"portalHostname",void 0),c([h()],K.prototype,"portalMode",void 0),c([h()],K.prototype,"portalProperties",void 0),c([h()],K.prototype,"region",void 0),c([h({readOnly:!0})],K.prototype,"restUrl",null),c([h()],K.prototype,"rotatorPanels",void 0),c([h()],K.prototype,"showHomePageDescription",void 0),c([h()],K.prototype,"sourceJSON",void 0),c([h()],K.prototype,"staticImagesUrl",void 0),c([h({json:{name:"2DStylesGroupQuery"}})],K.prototype,"stylesGroupQuery2d",void 0),c([h({json:{name:"stylesGroupQuery"}})],K.prototype,"stylesGroupQuery3d",void 0),c([h()],K.prototype,"supportsHostedServices",void 0),c([h()],K.prototype,"symbolSetsGroupQuery",void 0),c([h()],K.prototype,"templatesGroupQuery",void 0),c([h()],K.prototype,"thumbnail",void 0),c([h({readOnly:!0})],K.prototype,"thumbnailUrl",null),c([h()],K.prototype,"units",void 0),c([h()],K.prototype,"url",void 0),c([h()],K.prototype,"urlKey",void 0),c([Q("urlKey")],K.prototype,"readUrlKey",null),c([h()],K.prototype,"user",void 0),c([Q("user")],K.prototype,"readUser",null),c([h()],K.prototype,"useStandardizedQuery",void 0),c([h()],K.prototype,"useVectorBasemaps",void 0),c([h()],K.prototype,"vectorBasemapGalleryGroupQuery",void 0),K=ps=c([S("esri.portal.Portal")],K);const cs=K;let la=class extends oe{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e&&e.portalItem&&e.path?{...e,path:this._normalizePath(e.path,e.portalItem)}:e}set path(e){M(e)&&Ms(e)?q.getLogger(this.declaredClass).error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",e)}_castPath(e){return this._normalizePath(e,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",t){const i=this.url;if(N(i))throw new L("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal._request(i,{responseType:e,query:{token:this.portalItem.apiKey},signal:w3(t,"signal")})}async update(e,t){return(await z(()=>import("./resourceUtils.6d10bf82.js"),[])).addOrUpdateResource(this,"update",e,t)}hasPath(){return M(this.path)}_normalizePath(e,t){return N(e)?e:(e=e.replace(/^\/+/,""),M(t)&&Ms(e)&&(e=e$(e,t.itemUrl)),e.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}};c([h()],la.prototype,"portalItem",void 0),c([h({type:String,value:null})],la.prototype,"path",null),c([Oe("path")],la.prototype,"_castPath",null),c([h({type:String,readOnly:!0})],la.prototype,"url",null),c([h({type:String,readOnly:!0})],la.prototype,"itemRelativeUrl",null),la=c([S("esri.portal.PortalItemResource")],la);const rJ=la;let cp=class extends oe{constructor(e){super(e),this.created=null,this.rating=null}};c([h()],cp.prototype,"created",void 0),c([h()],cp.prototype,"rating",void 0),cp=c([S("esri.portal.PortalRating")],cp);const N_=cp;var Au;const nJ=new Set(["Map Service","Feature Service","Feature Collection","Scene Service","Image Service","Stream Service","Vector Tile Service","GeoJson","CSV","KML","WFS","WMTS","WMS","Feed"]),oJ=new Set(["KML","GeoJson","CSV"]);let Se=Au=class extends Cm(Lo){constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}static from(e){return VM(Au,e)}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let i=e;return e==="Feature Service"||e==="Feature Collection"?i=t.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":e==="Image Service"?i=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":e==="Scene Service"?i="Scene Layer":e==="Video Service"?i="Video Layer":e==="Scene Package"?i="Scene Layer Package":e==="Stream Service"?i="Feature Layer":e==="Geoprocessing Service"&&this.portal&&this.portal.isPortal?i=t.includes("Web Tool")?"Tool":"Geoprocessing Service":e==="Geocoding Service"?i="Locator":e==="Geoenrichment Service"?i="GeoEnrichment Service":e==="Microsoft Powerpoint"?i="Microsoft PowerPoint":e==="GeoJson"?i="GeoJSON":e==="Globe Service"?i="Globe Layer":e==="Vector Tile Service"?i="Tile Layer":e==="netCDF"?i="NetCDF":e==="Map Service"?i=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e&&e.toLowerCase().includes("add in")?i=e.replace(/(add in)/gi,"Add-In"):e==="datastore catalog service"?i="Big Data File Share":e==="Compact Tile Package"?i="Tile Package (tpkx)":e==="OGCFeatureServer"?i="OGC Feature Layer":e==="web mapping application"&&t.includes("configurableApp")&&(i="Instant App"),i}readExtent(e){return e&&e.length?new Ze(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type&&this.type.toLowerCase()||"",t=this.typeKeywords||[],i="esri/images/portal/",s="16";let r,n=!1,o=!1,a=!1,l=!1,u=!1,d=!1;return e.indexOf("service")>0||e==="feature collection"||e==="kml"||e==="wms"||e==="wmts"||e==="wfs"?(n=t.includes("Hosted Service"),e==="feature service"||e==="feature collection"||e==="kml"||e==="wfs"?(o=t.includes("Table"),a=t.includes("Route Layer"),l=t.includes("Markup"),u=t.includes("Spatiotemporal"),d=t.includes("UtilityNetwork"),r=u&&o?"spatiotemporaltable":o?"table":a?"routelayer":l?"markup":u?"spatiotemporal":n?"featureshosted":d?"utilitynetwork":"features"):r=e==="map service"||e==="wms"||e==="wmts"?n||t.includes("Tiled")||e==="wmts"?"maptiles":"mapimages":e==="scene service"?t.includes("Line")?"sceneweblayerline":t.includes("3DObject")?"sceneweblayermultipatch":t.includes("Point")?"sceneweblayerpoint":t.includes("IntegratedMesh")?"sceneweblayermesh":t.includes("PointCloud")?"sceneweblayerpointcloud":t.includes("Polygon")?"sceneweblayerpolygon":t.includes("Building")?"sceneweblayerbuilding":t.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":e==="image service"?t.includes("Elevation 3D Layer")?"elevationlayer":t.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":e==="stream service"?"streamlayer":e==="video service"?"mediaservice":e==="vector tile service"?"vectortile":e==="datastore catalog service"?"datastorecollection":e==="geocoding service"?"geocodeservice":e==="geoprocessing service"?t.includes("Web Tool")&&this.portal&&this.portal.isPortal?"tool":"layers":e==="geodata service"?"geodataservice":"layers"):r=e==="web map"||e==="cityengine web scene"?"maps":e==="web scene"?t.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":e==="web mapping application"&&t.includes("configurableApp")?"instantapps":e==="web mapping application"||e==="mobile application"||e==="application"||e==="operation view"||e==="desktop application"?"apps":e==="map document"||e==="map package"||e==="published map"||e==="scene document"||e==="globe document"||e==="basemap package"||e==="mobile basemap package"||e==="mobile map package"||e==="project package"||e==="project template"||e==="pro map"||e==="layout"||e==="layer"&&t.includes("ArcGIS Pro")||e==="explorer map"&&t.indexOf("Explorer Document")?"mapsgray":e==="service definition"||e==="csv"||e==="shapefile"||e==="cad drawing"||e==="geojson"||e==="360 vr experience"||e==="netcdf"||e==="administrative report"?"datafiles":e==="explorer add in"||e==="desktop add in"||e==="windows viewer add in"||e==="windows viewer configuration"?"appsgray":e==="arcgis pro add in"||e==="arcgis pro configuration"?"addindesktop":e==="rule package"||e==="file geodatabase"||e==="sqlite geodatabase"||e==="csv collection"||e==="kml collection"||e==="windows mobile package"||e==="map template"||e==="desktop application template"||e==="gml"||e==="arcpad package"||e==="code sample"||e==="form"||e==="document link"||e==="earth configuration"||e==="operations dashboard add in"||e==="rules package"||e==="image"||e==="workflow manager package"||e==="explorer map"&&t.includes("Explorer Mapping Application")||t.includes("Document")?"datafilesgray":e==="network analysis service"||e==="geoprocessing service"||e==="geodata service"||e==="geometry service"||e==="geoprocessing package"||e==="locator package"||e==="geoprocessing sample"||e==="workflow manager service"?"toolsgray":e==="layer"||e==="layer package"||e==="explorer layer"?"layersgray":e==="scene package"?"scenepackage":e==="mobile scene package"?"mobilescenepackage":e==="tile package"||e==="compact tile package"?"tilepackage":e==="task file"?"taskfile":e==="report template"?"report-template":e==="statistical data collection"?"statisticaldatacollection":e==="insights workbook"?"workbook":e==="insights model"?"insightsmodel":e==="insights page"?"insightspage":e==="insights theme"?"insightstheme":e==="hub initiative"?"hubinitiative":e==="hubpage"?"hubpage":e==="hub event"?"hubevent":e==="hub site application"?"hubsite":e==="hub project"?"hubproject":e==="relational database connection"?"relationaldatabaseconnection":e==="big data file share"?"datastorecollection":e==="image collection"?"imagecollection":e==="style"?"style":e==="desktop style"?"desktopstyle":e==="dashboard"?"dashboard":e==="raster function template"?"rasterprocessingtemplate":e==="vector tile package"?"vectortilepackage":e==="ortho mapping project"?"orthomappingproject":e==="ortho mapping template"?"orthomappingtemplate":e==="solution"?"solutions":e==="geopackage"?"geopackage":e==="deep learning package"?"deeplearningpackage":e==="real time analytic"?"realtimeanalytics":e==="big data analytic"?"bigdataanalytics":e==="feed"?"feed":e==="excalibur imagery project"?"excaliburimageryproject":e==="notebook"?"notebook":e==="storymap"?"storymap":e==="survey123 add in"?"survey123addin":e==="mission"?"mission":e==="mission report"?"missionreport":e==="quickcapture project"?"quickcaptureproject":e==="pro report"?"proreport":e==="pro report template"?"proreporttemplate":e==="urban model"?"urbanmodel":e==="web experience"?"experiencebuilder":e==="web experience template"?"webexperiencetemplate":e==="experience builder widget"?"experiencebuilderwidget":e==="experience builder widget package"?"experiencebuilderwidgetpackage":e==="workflow"?"workflow":e==="insights script"?"insightsscript":e==="kernel gateway connection"?"kernelgatewayconnection":e==="hub initiative template"?"hubinitiativetemplate":e==="storymap theme"?"storymaptheme":e==="knowledge graph"?"knowledgegraph":e==="native application"?"nativeapp":e==="native application installer"?"nativeappinstaller":e==="link chart"?"linkchart":e==="investigation"?"investigation":e==="ogcfeatureserver"?"features":e==="pro project"?"proproject":e==="insights workbook package"?"insightsworkbookpackage":e==="apache parquet"?"apacheparquet":e==="notebook code snippets"||e==="notebook code snippet library"?"notebookcodesnippets":e==="suitability model"?"suitabilitymodel":e==="esri classifier definition"?"classifierdefinition":e==="esri classification schema"?"classificationschema":e==="insights data engineering workbook"?"dataengineeringworkbook":e==="insights data engineering model"?"dataengineeringmodel":e==="deep learning studio project"?"deeplearningproject":e==="discussion"?"discussion":"maps",r?Ne(i+r+s+".png"):null}get isLayer(){return this.type!=null&&nJ.has(this.type)}get itemPageUrl(){var t;const e=(t=this.portal)==null?void 0:t.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){var t;const e=(t=this.portal)==null?void 0:t.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get thumbnailUrl(){var i,s;const e=this.itemUrl,t=this.thumbnail;return e&&t&&(s=(i=this.portal)==null?void 0:i._normalizeUrl(`${e}/info/${t}?f=json`))!=null?s:null}get userItemUrl(){const e=this.get("portal.restUrl");if(!e)return null;const t=this.owner||this.get("portal.user.username");return t?`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`:null}load(e){var s;const t=(s=this.portal)!=null?s:this.portal=cs.getDefault(),i=t.load(e).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t._request(this.itemUrl,{signal:M(e)?e.signal:null,query:{token:this.apiKey}}):{}).then(r=>{this.sourceJSON=r,this.read(r)});return this.addResolvingPromise(i),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}};return e instanceof N_&&(e=e.rating),e==null||isNaN(e)||typeof e!="number"||(t.query.rating=e),this.portal?(await this.portal._request(this.itemUrl+"/addRating",t),new N_({rating:e,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:R(this.applicationProxies),avgRating:this.avgRating,categories:R(this.categories),created:R(this.created),culture:this.culture,description:this.description,extent:R(this.extent),groupCategories:R(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:R(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:R(this.screenshots),size:this.size,snippet:this.snippet,spatialReference:this.spatialReference,tags:R(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:R(this.typeKeywords),url:this.url};return this.loaded&&(e.loadStatus="loaded"),new Au({sourceJSON:this.sourceJSON}).set(e)}createPostQuery(){const e=this.toJSON();for(const i of["tags","typeKeywords","categories"])e[i]&&(e[i]=e[i].join(", "));const{extent:t}=e;return t&&(e.extent=JSON.stringify(t)),e}async deleteRating(){await Hs(this.portal)._request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return Hs(this.portal)._request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await Hs(this.portal)._request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return t.rating!=null?(t.created=new Date(t.created),new N_(t)):null}fetchRelatedItems(e,t){return Hs(this.portal)._requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},Au)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){var e;return Hs(this.portal)._request((e=this.itemUrl)!=null?e:"",{cacheBust:!0,query:{token:this.apiKey}}).then(t=>(this.sourceJSON=t,this.read(t),this))}update(e){return this.id?this.load().then(()=>Hs(this.portal)._signIn()).then(()=>{const t=e&&e.data,i={method:"post"};i.query=this.createPostQuery();for(const s in i.query)i.query[s]===null&&(i.query[s]="");return i.query.clearEmptyFields=!0,t!=null&&(typeof t=="string"?i.query.text=t:typeof t=="object"&&(i.query.text=JSON.stringify(t))),this.portal._request(`${this.userItemUrl}/update`,i).then(()=>this.reload())}):Promise.reject(new L("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}updateThumbnail(e){return this.id?this.load().then(()=>this.portal._signIn()).then(()=>{const t=e.thumbnail,i=e.filename,s={method:"post"};if(typeof t=="string")hu(t)?s.query={data:t}:s.query={url:Js(t)},M(i)&&(s.query.filename=i);else{const r=new FormData;M(i)?r.append("file",t,i):r.append("file",t),s.body=r}return this.portal._request(`${this.userItemUrl}/updateThumbnail`,s).then(()=>this.reload())}):Promise.reject(new L("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){return(await z(()=>import("./resourceUtils.6d10bf82.js"),[])).fetchResources(this,e,t)}async addResource(e,t,i){const s=await z(()=>import("./resourceUtils.6d10bf82.js"),[]);return e.portalItem=this,s.addOrUpdateResource(e,"add",t,i)}async removeResource(e,t){const i=await z(()=>import("./resourceUtils.6d10bf82.js"),[]);if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new L("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return i.removeResource(this,e,t)}async removeAllResources(e){return(await z(()=>import("./resourceUtils.6d10bf82.js"),[])).removeAllResources(this,e)}resourceFromPath(e){return new rJ({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:R(this.categories),created:this.created&&this.created.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,licenseInfo:this.licenseInfo,modified:this.modified&&this.modified.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,spatialReference:this.spatialReference,tags:R(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:R(this.typeKeywords),url:this.url};return M3(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new Au({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)t==="tags"&&e[t]!==null&&(e[t]=e[t].join(", ")),t==="typeKeywords"&&e[t]!==null&&(e[t]=e[t].join(", ")),t==="extent"&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};c([h({type:["private","shared","org","public"]})],Se.prototype,"access",void 0),c([h()],Se.prototype,"accessInformation",void 0),c([h({type:String})],Se.prototype,"apiKey",void 0),c([h({json:{read:{source:"appProxies"}}})],Se.prototype,"applicationProxies",void 0),c([h()],Se.prototype,"avgRating",void 0),c([h()],Se.prototype,"categories",void 0),c([h({type:Date})],Se.prototype,"created",void 0),c([h()],Se.prototype,"culture",void 0),c([h()],Se.prototype,"description",void 0),c([h({readOnly:!0})],Se.prototype,"displayName",null),c([h({type:Ze})],Se.prototype,"extent",void 0),c([Q("extent")],Se.prototype,"readExtent",null),c([h()],Se.prototype,"groupCategories",void 0),c([h({readOnly:!0})],Se.prototype,"iconUrl",null),c([h()],Se.prototype,"id",void 0),c([h({readOnly:!0})],Se.prototype,"isLayer",null),c([h()],Se.prototype,"itemControl",void 0),c([h({readOnly:!0})],Se.prototype,"itemPageUrl",null),c([h({readOnly:!0})],Se.prototype,"itemUrl",null),c([h()],Se.prototype,"licenseInfo",void 0),c([h({type:Date})],Se.prototype,"modified",void 0),c([h()],Se.prototype,"name",void 0),c([h()],Se.prototype,"numComments",void 0),c([h()],Se.prototype,"numRatings",void 0),c([h()],Se.prototype,"numViews",void 0),c([h()],Se.prototype,"owner",void 0),c([h()],Se.prototype,"ownerFolder",void 0),c([h({type:cs})],Se.prototype,"portal",void 0),c([h()],Se.prototype,"screenshots",void 0),c([h()],Se.prototype,"size",void 0),c([h()],Se.prototype,"snippet",void 0),c([h()],Se.prototype,"sourceJSON",void 0),c([h({type:String})],Se.prototype,"spatialReference",void 0),c([h()],Se.prototype,"tags",void 0),c([h()],Se.prototype,"thumbnail",void 0),c([h({readOnly:!0})],Se.prototype,"thumbnailUrl",null),c([h()],Se.prototype,"title",void 0),c([h()],Se.prototype,"type",void 0),c([h()],Se.prototype,"typeKeywords",void 0),c([h({type:String,json:{read(e,t){var i;if(oJ.has(t.type)){const s=(i=this.portal)==null?void 0:i.restUrl;e||(e=s&&this.id?`${s}/content/items/${this.id}/data`:null)}return e}}})],Se.prototype,"url",void 0),c([h({readOnly:!0})],Se.prototype,"userItemUrl",null),Se=Au=c([S("esri.portal.PortalItem")],Se);const fv=Se;var mD=Object.freeze(Object.defineProperty({__proto__:null,default:fv},Symbol.toStringTag,{value:"Module"}));function L$(e){var t;return(e==null?void 0:e.type)==="feature"&&!e.url&&((t=e.source)==null?void 0:t.type)==="memory"}function Ebe(e){var t;return(e==null?void 0:e.type)==="feature"&&((t=e.source)==null?void 0:t.type)==="feature-layer"}const aJ=new Set(["bing-maps","imagery","imagery-tile","map-image","open-street-map","tile","unknown","unsupported","vector-tile","web-tile","wms","wmts"]),lJ=new Set(["csv","feature","geo-rss","geojson","group","imagery","imagery-tile","kml","map-image","map-notes","ogc-feature","route","subtype-group","tile","unknown","unsupported","vector-tile","web-tile","wfs","wms","wmts"]);function cJ(e){return e.layerContainerType==="basemap"?aJ:e.layerContainerType==="operational-layers"?lJ:null}function uJ(e,t){if(t.restrictedWebMapWriting){const i=cJ(t);return!M(i)||i.has(e.type)&&!L$(e)}return!0}function hJ(e,t){if(L$(e)){const i=rd("featureCollection.layers",t),s=i&&i[0]&&i[0].layerDefinition;s&&j_(e,s)}else e.type==="stream"?j_(e,t.layerDefinition=t.layerDefinition||{}):e.type!=="group"&&j_(e,t)}function j_(e,t){"maxScale"in e&&(t.maxScale=D0(e.maxScale)),"minScale"in e&&(t.minScale=D0(e.minScale))}function dJ(e,t){if(hJ(e,t),"blendMode"in e&&(t.blendMode=e.blendMode,t.blendMode==="normal"&&delete t.blendMode),t.opacity=D0(e.opacity),t.title=e.title||"Layer",t.visibility=e.visible,"legendEnabled"in e&&e.type!=="wmts")if(L$(e)){const i=t.featureCollection;i&&(i.showLegend=e.legendEnabled)}else t.showLegend=e.legendEnabled}function dk(e,t,i){if(!("write"in e)||!e.write)return i&&i.messages&&i.messages.push(new L("layer:unsupported",`Layers (${e.title}, ${e.id}) of type '${e.declaredClass}' cannot be persisted`,{layer:e})),null;if(uJ(e,i)){const s={};return e.write(s,i)?s:null}return M(t)&&dJ(e,t=R(t)),t}var wg;let pJ=0;const yD="esri.Basemap";let js=wg=class extends Cm(Lo){constructor(e){super(e),this.id=null,this.portalItem=null,this.spatialReference=null,this.thumbnailUrl=null,this.title="Basemap",this.id=Date.now().toString(16)+"-basemap-"+pJ++,this.baseLayers=new he,this.referenceLayers=new he;const t=s=>{s.parent&&s.parent!==this&&"remove"in s.parent&&s.parent.remove(s),s.parent=this,s.type==="elevation"&&q.getLogger(this.declaredClass).error(`Layer '${s.title}, id:${s.id}' of type '${s.type}' is not supported as a basemap layer and will therefore be ignored.`)},i=s=>{s.parent=null};this.baseLayers.on("after-add",s=>t(s.item)),this.referenceLayers.on("after-add",s=>t(s.item)),this.baseLayers.on("after-remove",s=>i(s.item)),this.referenceLayers.on("after-remove",s=>i(s.item))}initialize(){this.when().catch(e=>{q.getLogger(this.declaredClass).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){var i;const e=this.baseLayers.removeAll();for(const s of e)s.destroy();const t=this.referenceLayers.removeAll();for(const s of t)s.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),(i=this.portalItem)==null||i.destroy(),this.portalItem=null}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set baseLayers(e){this._set("baseLayers",ou(e,this._get("baseLayers")))}_writeBaseLayers(e,t,i){const s=[];e&&(i={...i,layerContainerType:"basemap"},this.baseLayers.forEach(r=>{const n=dk(r,i.webmap?i.webmap.getLayerJSONFromResourceInfo(r):null,i);M(n)&&s.push(n)}),this.referenceLayers.forEach(r=>{const n=dk(r,i.webmap?i.webmap.getLayerJSONFromResourceInfo(r):null,i);M(n)&&(n.isReference=!0,s.push(n))})),t.baseMapLayers=s}set referenceLayers(e){this._set("referenceLayers",ou(e,this._get("referenceLayers")))}writeTitle(e,t){t.title=e||"Basemap"}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return fD(this,e=>{e(this.baseLayers,this.referenceLayers)})}clone(){const e={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.slice(),referenceLayers:this.referenceLayers.slice()};return this.loaded&&(e.loadStatus="loaded"),new wg({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set("resourceInfo",{data:e,context:t}),super.read(e,t)}write(e,t){return e=e||{},t&&t.origin||(t={origin:"web-map",...t}),super.write(e,t),!this.loaded&&this.resourceInfo&&this.resourceInfo.data.baseMapLayers&&(e.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(i=>{const s=R(i);return s.url&&kn(s.url)&&(s.url=`https:${s.url}`),s.templateUrl&&kn(s.templateUrl)&&(s.templateUrl=`https:${s.templateUrl}`),s})),e}async _loadFromSource(e){const{resourceInfo:t,portalItem:i}=this;Ft(e);const s=[];if(t){const r=t.context?t.context.url:null;if(s.push(this._loadLayersFromJSON(t.data,r,e)),t.data.id&&!t.data.title){const n=t.data.id;s.push(NY(n).then(o=>{o&&this.read({title:o},t.context)}))}}else i&&s.push(this._loadFromItem(i,e));await Promise.all(s)}async _loadLayersFromJSON(e,t,i){const s=this.resourceInfo&&this.resourceInfo.context,r=this.portalItem&&this.portalItem.portal||s&&s.portal||null,n=s&&s.origin==="web-scene"?"web-scene":"web-map",{populateOperationalLayers:o}=await z(()=>import("./layersCreator.eb921b3a.js"),["assets/layersCreator.eb921b3a.js","assets/lazyLayerLoader.f961f278.js","assets/portalLayers.8fee158d.js","assets/layersLoader.67118e89.js","assets/jsonContext.3176ed6f.js","assets/portalItemUtils.57ded807.js"]),a=[];if(Ft(i),e.baseMapLayers&&Array.isArray(e.baseMapLayers)){const l={context:{origin:n,url:t,portal:r,layerContainerType:"basemap"},defaultLayerType:"DefaultTileLayer"},u=o(this.baseLayers,e.baseMapLayers.filter(f=>!f.isReference),l);a.push(u);const d=o(this.referenceLayers,e.baseMapLayers.filter(f=>f.isReference),l);a.push(d)}await as(a)}async _loadFromItem(e,t){var n,o;const i=await e.load(t),s=await i.fetchData("json",t),r=Ai((n=e.itemUrl)!=null?n:"");return this._set("resourceInfo",{data:(o=s.baseMap)!=null?o:{},context:{origin:"web-map",portal:e.portal||cs.getDefault(),url:r}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:s.spatialReference},this.resourceInfo.context),this.read({title:e.title,thumbnailUrl:e.thumbnailUrl},{origin:"portal-item",portal:e.portal||cs.getDefault(),url:r}),this._loadLayersFromJSON(this.resourceInfo.data,r,t)}static fromId(e){const t=Gh[e];if(t){if(t.deprecated){let i=null;e==="dark-gray"?i="dark-gray-vector":e==="gray"?i="gray-vector":e==="streets"?i="streets-vector":e==="topo"&&(i="topo-vector"),aR(q.getLogger(yD),`The ${e} basemap has entered mature support and is no longer being updated.`,{replacement:i,see:"https://arcg.is/1iq8aD",warnOnce:!0})}return wg.fromJSON(t)}return null}};c([h({json:{write:{ignoreOrigin:!0,target:"baseMapLayers",writer(e,t,i,s){this._writeBaseLayers(e,t,s)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:he}},writer(e,t,i,s){this._writeBaseLayers(e,t,s)}}}}}})],js.prototype,"baseLayers",null),c([h({type:String,json:{origins:{"web-scene":{write:!0}}}})],js.prototype,"id",void 0),c([h({type:fv})],js.prototype,"portalItem",void 0),c([h()],js.prototype,"referenceLayers",null),c([h({readOnly:!0})],js.prototype,"resourceInfo",void 0),c([h({type:xe})],js.prototype,"spatialReference",void 0),c([h()],js.prototype,"thumbnailUrl",void 0),c([h({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],js.prototype,"title",void 0),c([ie("title")],js.prototype,"writeTitle",null),js=wg=c([S(yD)],js);const mv=js;var fJ=Object.freeze(Object.defineProperty({__proto__:null,default:mv},Symbol.toStringTag,{value:"Module"}));const pk=q.getLogger("esri.support.basemapUtils");function mJ(){return{}}function gD(e){for(const t in e){const i=e[t];(i==null?void 0:i.destroyed)===!1&&i.destroy(),delete e[t]}}function xg(e,t){let i;if(typeof e=="string"){if(!(e in Gh)){const s=Object.entries(Gh).filter(([r,n])=>je.apiKey&&!n.classic||!je.apiKey&&n.classic&&!n.deprecated).map(([r])=>`"${r}"`).join(", ");return pk.warn(`Unable to find basemap definition for: ${e}. Try one of these: ${s}`),null}t&&(i=t[e]),i||(i=mv.fromId(e),t&&(t[e]=i))}else i=Dt(mv,e);return i!=null&&i.destroyed&&(pk.warn("The provided basemap is already destroyed",{basemap:i}),i=null),i}function yJ(e){let t=null;const i=vJ(e),s=!i.baseLayers.length;for(const r in Gh){const n=wJ(i,vD(Gh[r]),{mustMatchReferences:s});if(n==="equal"){t=r;break}n==="base-layers-equal"&&(t=r)}return t}function gJ(e,t){var r,n,o;if(N(t)||N(e))return{spatialReference:null,updating:!1};if(t.loadStatus==="not-loaded")return t.load(),{spatialReference:null,updating:!0};if(t.spatialReference)return{spatialReference:t.spatialReference,updating:!1};if(t.baseLayers.length===0)return{spatialReference:null,updating:!1};const i=t.baseLayers.getItemAt(0);switch(i.loadStatus){case"not-loaded":i.load();case"loading":return{spatialReference:null,updating:!0};case"failed":return{spatialReference:null,updating:!1}}const s=(("supportedSpatialReferences"in i?i.supportedSpatialReferences:null)||["tileInfo"in i?(r=i.tileInfo)==null?void 0:r.spatialReference:i.spatialReference]).filter(Boolean);return e.spatialReference?{spatialReference:(o=(n=s.find(a=>e.spatialReference.equals(a)))!=null?n:s[0])!=null?o:null,updating:!1}:{spatialReference:s[0],updating:!1}}function vJ(e){return e?!e.loaded&&e.resourceInfo?vD(e.resourceInfo.data):{baseLayers:fk(e.baseLayers),referenceLayers:fk(e.referenceLayers)}:null}function fk(e){return(he.isCollection(e)?e.toArray():e).map(bJ)}function bJ(e){var t,i;return{type:e.type,url:bD("urlTemplate"in e&&e.urlTemplate||e.url||"styleUrl"in e&&e.styleUrl),minScale:"minScale"in e&&e.minScale!=null?e.minScale:0,maxScale:"maxScale"in e&&e.maxScale!=null?e.maxScale:0,opacity:e.opacity!=null?e.opacity:1,visible:e.visible==null||!!e.visible,sublayers:e.type!=="map-image"&&e.type!=="wms"||!M(e.sublayers)||(t=e.sublayers)==null?void 0:t.map(s=>({id:s.id,visible:s.visible})),activeLayerId:e.type==="wmts"?(i=e.activeLayer)==null?void 0:i.id:void 0}}function vD(e){return e?{baseLayers:mk(e.baseMapLayers.filter(t=>!t.isReference)),referenceLayers:mk(e.baseMapLayers.filter(t=>t.isReference))}:null}function mk(e){return e.map(t=>_J(t))}function _J(e){let t;switch(e.layerType){case"VectorTileLayer":t="vector-tile";break;case"ArcGISTiledMapServiceLayer":t="tile";break;default:t="unknown"}return{type:t,url:bD(e.templateUrl||e.urlTemplate||e.styleUrl||e.url),minScale:e.minScale!=null?e.minScale:0,maxScale:e.maxScale!=null?e.maxScale:0,opacity:e.opacity!=null?e.opacity:1,visible:e.visibility==null||!!e.visibility,sublayers:void 0,activeLayerId:void 0}}function wJ(e,t,i){return e!=null!=(t!=null)?"not-equal":e?yk(e.baseLayers,t.baseLayers)?yk(e.referenceLayers,t.referenceLayers)?"equal":i.mustMatchReferences?"not-equal":"base-layers-equal":"not-equal":"equal"}function yk(e,t){if(e.length!==t.length)return!1;for(let i=0;ithis.nextBasemap,e=>{e&&!e.loaded&&e.load().catch(()=>{})},Le)}destroy(){this.view=null,gD(this._basemapCache),this._basemapCache=null}get _nextBasemapSpatialReferenceTask(){return gJ(this.view,this.nextBasemap)}get _viewSpatialReferenceLocked(){return!("spatialReferenceLocked"in this.view)||this.view.spatialReferenceLocked}get activeBasemap(){var e,t,i;return xg((i=(t=(e=this.view)==null?void 0:e.map)==null?void 0:t.basemap)!=null?i:"topo",this._basemapCache)}castNextBasemap(e){return xg(e,this._basemapCache)}get state(){const{view:e}=this;if(!(e!=null&&e.ready)||this._nextBasemapSpatialReferenceTask.updating)return"disabled";const{spatialReference:t}=this._nextBasemapSpatialReferenceTask;return this._viewSpatialReferenceLocked&&M(t)&&!e.spatialReference.equals(t)?"incompatible-next-basemap":this._loadingProjectionEngine?"loading":"ready"}async toggle(){if(this.state==="disabled"||this.state==="incompatible-next-basemap")return;const{activeBasemap:e,nextBasemap:t}=this,i=this._viewSpatialReferenceLocked;if(!i){if(await ub(()=>!this._nextBasemapSpatialReferenceTask.updating),t!==this.nextBasemap||e!==this.activeBasemap)return;const{spatialReference:s}=this._nextBasemapSpatialReferenceTask;if(!M(s)||Kt(this.view.spatialReference,s)||ol()||Ro(this.view.spatialReference,s)||(this._loadingProjectionEngine=!0,await al(),this._loadingProjectionEngine=!1),t!==this.nextBasemap||e!==this.activeBasemap)return}this.view.map.basemap=t,i||!M(this._nextBasemapSpatialReferenceTask.spatialReference)||Kt(this.view.spatialReference,this._nextBasemapSpatialReferenceTask.spatialReference)||(this.view.spatialReference=this._nextBasemapSpatialReferenceTask.spatialReference),this.nextBasemap=e}static getThumbnailUrl(e){if(!e)return null;const{thumbnailUrl:t}=e;if(t)return t;const i=yJ(e);if(i)return Gh[i].thumbnailUrl;const s=e.baseLayers.find(r=>!!V1(r)().get("portalItem.thumbnailUrl"));return s?V1(s)().get("portalItem.thumbnailUrl"):null}};c([h()],Vs.prototype,"_loadingProjectionEngine",void 0),c([h({readOnly:!0})],Vs.prototype,"_nextBasemapSpatialReferenceTask",null),c([h({readOnly:!0})],Vs.prototype,"_viewSpatialReferenceLocked",null),c([h({readOnly:!0})],Vs.prototype,"activeBasemap",null),c([h()],Vs.prototype,"nextBasemap",void 0),c([Oe("nextBasemap")],Vs.prototype,"castNextBasemap",null),c([h({readOnly:!0})],Vs.prototype,"state",null),c([h()],Vs.prototype,"view",void 0),c([h()],Vs.prototype,"toggle",null),Vs=c([S("esri.widgets.BasemapToggle.BasemapToggleViewModel")],Vs);const F$=Vs;function xs(){return function(e,t){if(!e[t])throw new TypeError(`Cannot auto bind undefined function '${t}'`);return{value:MJ(e[t])}}}function SJ(e){const{type:t}=e;return e instanceof KeyboardEvent||t==="keyup"||t==="keydown"||t==="keypress"}function MJ(e){return function(t,...i){SJ(t)?sU(t.key)&&(t.preventDefault(),t.stopPropagation(),t.target.click()):e.call(this,t,...i)}}function di(e){return(t,i)=>{t.hasOwnProperty("_messageBundleProps")||(t._messageBundleProps=t._messageBundleProps?t._messageBundleProps.slice():[]),t._messageBundleProps.push({bundlePath:e,propertyName:i})}}var $J=function(e){return{vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}},_D=function(e,t){for(var i=0,s=e.length;iimport("./calcite-icon.8f7a3cfc.js"),["assets/calcite-icon.8f7a3cfc.js","assets/icon.8e346cc3.js","assets/observers.11f150c2.js"]),z(()=>import("./calcite-scrim.7f1cb3c0.js"),["assets/calcite-scrim.7f1cb3c0.js","assets/scrim.5d8801d4.js","assets/loader.3df23557.js","assets/guid.ae96513b.js"])])}get activeBasemap(){return this.viewModel.activeBasemap}get label(){var e,t;return(t=(e=this.messages)==null?void 0:e.widgetLabel)!=null?t:""}set label(e){this._overrideIfSome("label",e)}get nextBasemap(){return this.viewModel.nextBasemap}set nextBasemap(e){this.viewModel.nextBasemap=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}castVisibleElements(e){return{...vk,...e}}toggle(){return this.viewModel.toggle()}render(){const e=this.viewModel,t=e.state==="disabled"?null:e.activeBasemap,i=e.state==="disabled"?null:e.nextBasemap,s=e.state==="loading",r=e.state==="incompatible-next-basemap",n=i?i.title:"",o=i&&i.loadStatus!=="loaded";let a;const l=this.visibleElements.title&&n,u=r;return(l||u)&&(a=P("div",{class:Ps.overlay,key:"overlay"},l?P("span",{class:Ps.title,title:n},n):null,u?P("calcite-scrim",{class:Ps.overlayScrim,title:this.messages.incompatibleSpatialReference},P("calcite-icon",{icon:"exclamation-mark-triangle"})):null)),P("div",{class:this.classes(Ps.base,r?Ps.disabled:null),role:"button","data-basemap-id":i?i.id:"",bind:this,onclick:this._toggle,onkeydown:this._toggle,tabIndex:r?-1:0,title:this.label},P("div",{class:this.classes(Ps.container,Ps.secondaryBasemapImage)},P("div",{class:Ps.image,styles:gk(t)})),P("div",{class:Ps.container},P("div",{class:this.classes(Ps.image,o?Ps.imageLoading:null),styles:gk(i)},o||s?P("calcite-scrim",null,P("span",{"aria-hidden":"true",role:"presentation",class:Ps.loaderAnimation})):null),a))}_toggle(){this.toggle()}};c([h({readOnly:!0})],zs.prototype,"activeBasemap",null),c([h()],zs.prototype,"label",null),c([h(),di("esri/widgets/BasemapToggle/t9n/BasemapToggle")],zs.prototype,"messages",void 0),c([h()],zs.prototype,"nextBasemap",null),c([h()],zs.prototype,"view",null),c([h({type:F$})],zs.prototype,"viewModel",void 0),c([h()],zs.prototype,"visibleElements",void 0),c([Oe("visibleElements")],zs.prototype,"castVisibleElements",null),c([xs()],zs.prototype,"_toggle",null),zs=c([S("esri.widgets.BasemapToggle")],zs);const IJ=zs;let kh=class extends oe{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._handles=new qi,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll(),this._handles.destroy()}add(e,t,i={}){return this._installWatch(e,t,i,Z)}addWhen(e,t,i={}){return this._installWatch(e,t,i,Qs)}addOnCollectionChange(e,t,{initial:i=!1,final:s=!1}={}){const r=++this._handleId;return this._handles.add([Is(e,"after-changes",this._createSyncUpdatingCallback(),Nh),Is(e,"change",t,{onListenerAdd:i?n=>t({added:n.toArray(),removed:[]}):void 0,onListenerRemove:s?n=>t({added:[],removed:n.toArray()}):void 0})],r),{remove:()=>this._handles.remove(r)}}addPromise(e){if(N(e))return e;const t=++this._handleId;this._handles.add({remove:()=>{this._pendingPromises.delete(e)&&(this._pendingPromises.size!==0||this._handles.has(_y)||this._set("updating",!1))}},t),this._pendingPromises.add(e),this._set("updating",!0);const i=()=>this._handles.remove(t);return e.then(i,i),e}removeAll(){this._pendingPromises.clear(),this._handles.removeAll(),this._set("updating",!1)}_installWatch(e,t,i={},s){const r=++this._handleId;i.sync||this._installSyncUpdatingWatch(e,r);const n=s(e,t,i);return this._handles.add(n,r),{remove:()=>this._handles.remove(r)}}_installSyncUpdatingWatch(e,t){const i=this._createSyncUpdatingCallback(),s=Z(e,i,{sync:!0,equals:()=>!1});return this._handles.add(s,t),s}_createSyncUpdatingCallback(){return()=>{this._handles.remove(_y),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this._handles.add(ad(()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this._handles.remove(_y))}),_y)}}};c([h({readOnly:!0})],kh.prototype,"updating",void 0),kh=c([S("esri.core.support.WatchUpdatingTracking")],kh);const _y=-42,pu=e=>{let t=class extends e{destroy(){var i,s;this.destroyed||((i=this._get("handles"))==null||i.destroy(),(s=this._get("updatingHandles"))==null||s.destroy())}get handles(){return this._get("handles")||new qi}get updatingHandles(){return this._get("updatingHandles")||new kh}};return c([h({readOnly:!0})],t.prototype,"handles",null),c([h({readOnly:!0})],t.prototype,"updatingHandles",null),t=c([S("esri.core.HandleOwner")],t),t};let yv=class extends pu(oe){};yv=c([S("esri.core.HandleOwner")],yv);let pf=class extends pu(he){constructor(e){super(e),this.handles.add([this.on("before-add",t=>{N(t.item)&&t.preventDefault()}),this.on("after-add",t=>this._own(t.item)),this.on("after-remove",t=>this._release(t.item))])}get owner(){return this._get("owner")}set owner(e){e!==this._get("owner")&&(this._releaseAll(),this._set("owner",e),this._ownAll())}_ownAll(){for(const e of this.items)this._own(e)}_releaseAll(){for(const e of this.items)this._release(e)}_createNewInstance(e){return this.itemType?new(he.ofType(this.itemType.Type))(e):new he(e)}};function nx(e,t){return{type:e,cast:hD,set(i){const s=ou(i,this._get(t),e);s.owner=this,this._set(t,s)}}}c([h()],pf.prototype,"owner",null),pf=c([S("esri.core.support.OwningCollection")],pf);const EJ=mi()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),bk=mi()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"});function wD(e){return e.xmin!==void 0&&e.ymin!==void 0&&e.xmax!==void 0&&e.ymax!==void 0}function D$(e){return e.points!==void 0}function N$(e){return e.x!==void 0&&e.y!==void 0}function j$(e){return e.paths!==void 0}function Bc(e){return e.rings!==void 0}function ll(e){return N(e)?null:e instanceof fl?e:N$(e)?be.fromJSON(e):j$(e)?Ar.fromJSON(e):Bc(e)?Oo.fromJSON(e):D$(e)?wb.fromJSON(e):wD(e)?Ze.fromJSON(e):null}function Sb(e){return e?N$(e)?"esriGeometryPoint":j$(e)?"esriGeometryPolyline":Bc(e)?"esriGeometryPolygon":wD(e)?"esriGeometryEnvelope":D$(e)?"esriGeometryMultipoint":null:null}const kJ={esriGeometryPoint:be,esriGeometryPolyline:Ar,esriGeometryPolygon:Oo,esriGeometryEnvelope:Ze,esriGeometryMultipoint:wb};function CJ(e){return e&&kJ[e]||null}const fu={base:fl,key:"type",typeMap:{extent:Ze,multipoint:wb,point:be,polyline:Ar,polygon:Oo}};En(fu);let xD=0;const Om=e=>{let t=class extends e{constructor(...i){super(...i),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+xD++})}};return t=c([S("esri.core.Identifiable")],t),t},V$=e=>{let t=class extends e{constructor(...i){super(...i),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:xD++})}};return t=c([S("esri.core.NumericIdentifiable")],t),t};let _k=class extends Om(class{}){};_k=c([S("esri.core.Identifiable")],_k);async function PJ(e){const t="portalItem"in e?e:{portalItem:e},i=await z(()=>import("./portalLayers.8fee158d.js"),["assets/portalLayers.8fee158d.js","assets/lazyLayerLoader.f961f278.js","assets/layersLoader.67118e89.js","assets/jsonContext.3176ed6f.js","assets/portalItemUtils.57ded807.js"]);try{return await i.fromItem(t)}catch(s){const r=t&&t.portalItem,n=r&&r.id||"unset",o=r&&r.portal&&r.portal.url||je.portalUrl;throw q.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+o+"', id: '"+n+"')",s),s}}let AJ=0,Gt=class extends jo.EventedMixin(Om(Lo)){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new Ze(-180,-90,180,90,xe.WGS84),this.id=Date.now().toString(16)+"-layer-"+AJ++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=xe.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(e){const t=typeof e=="string"?{url:e}:e;return(await z(()=>import("./arcgisLayers.c7a7062a.js"),["assets/arcgisLayers.c7a7062a.js","assets/fetchService.36bd4782.js","assets/lazyLayerLoader.f961f278.js"])).fromUrl(t)}static fromPortalItem(e){return PJ(e)}initialize(){this.when().catch(e=>{var t,i;Ks(e)||q.getLogger(this.declaredClass).error("#load()",`Failed to load layer (title: '${(t=this.title)!=null?t:"no title"}', id: '${(i=this.id)!=null?i:"no id"}')`,{error:e})})}destroy(){if(this.parent){const e=this,t=this.parent;"layers"in t&&t.layers.includes(e)?t.layers.remove(e):"tables"in t&&t.tables.includes(e)?t.tables.remove(e):"baseLayers"in t&&t.baseLayers.includes(e)?t.baseLayers.remove(e):"baseLayers"in t&&t.referenceLayers.includes(e)&&t.referenceLayers.remove(e)}}get hasAttributionData(){return this.attributionDataUrl!=null}get parsedUrl(){return Ai(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await kt(e,{query:{f:"json"},responseType:"json"})).data;throw new L("layer:no-attribution-data","Layer does not have attribution data")}};c([h({type:String})],Gt.prototype,"attributionDataUrl",void 0),c([h({type:Ze})],Gt.prototype,"fullExtent",void 0),c([h({readOnly:!0})],Gt.prototype,"hasAttributionData",null),c([h({type:String,clonable:!1})],Gt.prototype,"id",void 0),c([h({type:Boolean,nonNullable:!0})],Gt.prototype,"legendEnabled",void 0),c([h({type:["show","hide","hide-children"]})],Gt.prototype,"listMode",void 0),c([h({type:Number,range:{min:0,max:1},nonNullable:!0})],Gt.prototype,"opacity",void 0),c([h({clonable:!1})],Gt.prototype,"parent",void 0),c([h({readOnly:!0})],Gt.prototype,"parsedUrl",null),c([h({type:Boolean})],Gt.prototype,"popupEnabled",void 0),c([h({type:Boolean})],Gt.prototype,"attributionVisible",void 0),c([h({type:xe})],Gt.prototype,"spatialReference",void 0),c([h({type:String})],Gt.prototype,"title",void 0),c([h({readOnly:!0,json:{read:!1}})],Gt.prototype,"type",void 0),c([h()],Gt.prototype,"url",void 0),c([h({type:Boolean,nonNullable:!0})],Gt.prototype,"visible",void 0),Gt=c([S("esri.layers.Layer")],Gt);const Yf=Gt,gv={transparent:[0,0,0,0],black:[0,0,0,1],silver:[192,192,192,1],gray:[128,128,128,1],white:[255,255,255,1],maroon:[128,0,0,1],red:[255,0,0,1],purple:[128,0,128,1],fuchsia:[255,0,255,1],green:[0,128,0,1],lime:[0,255,0,1],olive:[128,128,0,1],yellow:[255,255,0,1],navy:[0,0,128,1],blue:[0,0,255,1],teal:[0,128,128,1],aqua:[0,255,255,1],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],blanchedalmond:[255,235,205,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],oldlace:[253,245,230,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],rebeccapurple:[102,51,153,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],whitesmoke:[245,245,245,1],yellowgreen:[154,205,50,1]};function SD(e){return gv[e]||gv[e.toLowerCase()]}function z$(e){var t;return(t=gv[e])!=null?t:gv[e.toLowerCase()]}function OJ(e){return[...z$(e)]}function V_(e,t,i){i<0&&++i,i>1&&--i;const s=6*i;return s<1?e+(t-e)*s:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function MD(e,t,i,s=1){const r=(e%360+360)%360/360,n=i<=.5?i*(t+1):i+t-i*t,o=2*i-n;return[Math.round(255*V_(o,n,r+1/3)),Math.round(255*V_(o,n,r)),Math.round(255*V_(o,n,r-1/3)),s]}function RJ(e){const t=e.length>5,i=t?8:4,s=(1<>=i,a[3]=r*l/255),l=o&s,o>>=i,a[2]=r*l,l=o&s,o>>=i,a[1]=r*l,l=o&s,o>>=i,a[0]=r*l,a}const LJ=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i,FJ="screenUtils.toPt: input not recognized!",$D=96;function TD(e){return e?e/72*$D:0}function Fo(e){return e?72*e/$D:0}function Fe(e){if(typeof e=="string"){const t=e.match(LJ);if(t){const i=Number(t[1]),s=t[3]&&t[3].toLowerCase(),r=e.charAt(0)==="-",n=s==="px"?Fo(i):i;return r?-n:n}return console.warn(FJ),null}return e}function ns(e=0,t=0){return{x:e,y:t}}function kbe(e=0,t=0){return[e,t]}function Mb(){const e=new Float32Array(16);return e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function DJ(e){const t=new Float32Array(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function NJ(e,t,i,s,r,n,o,a,l,u,d,f,m,y,g,v){const b=new Float32Array(16);return b[0]=e,b[1]=t,b[2]=i,b[3]=s,b[4]=r,b[5]=n,b[6]=o,b[7]=a,b[8]=l,b[9]=u,b[10]=d,b[11]=f,b[12]=m,b[13]=y,b[14]=g,b[15]=v,b}function jJ(e,t){return new Float32Array(e,t,16)}const VJ=Mb();Object.freeze(Object.defineProperty({__proto__:null,create:Mb,clone:DJ,fromValues:NJ,createView:jJ,IDENTITY:VJ},Symbol.toStringTag,{value:"Module"}));const zJ=(e,t)=>{const i=pl(e,t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1);return Vo(i,i)},BJ=(e,t)=>{const i=pl(e,t,0,0,.5-.5*t,0,t,0,.5-.5*t,0,0,t,.5-.5*t,0,0,0,1);return Vo(i,i)},UJ=(e,t)=>{const i=1-t,s=pl(e,.2126+.7874*i,.7152-.7152*i,.0722-.0722*i,0,.2126-.2126*i,.7152+.2848*i,.0722-.0722*i,0,.2126-.2126*i,.7152-.7152*i,.0722+.9278*i,0,0,0,0,1);return Vo(s,s)},qJ=(e,t)=>{const i=Math.sin(t*Math.PI/180),s=Math.cos(t*Math.PI/180),r=pl(e,.213+.787*s-.213*i,.715-.715*s-.715*i,.072-.072*s+.928*i,0,.213-.213*s+.143*i,.715+.285*s+.14*i,.072-.072*s-.283*i,0,.213-.213*s-.787*i,.715-.715*s+.715*i,.072+.928*s+.072*i,0,0,0,0,1);return Vo(r,r)},GJ=(e,t)=>{const i=1-2*t,s=pl(e,i,0,0,t,0,i,0,t,0,0,i,t,0,0,0,1);return Vo(s,s)},WJ=(e,t)=>{const i=pl(e,.213+.787*t,.715-.715*t,.072-.072*t,0,.213-.213*t,.715+.285*t,.072-.072*t,0,.213-.213*t,.715-.715*t,.072+.928*t,0,0,0,0,1);return Vo(i,i)},HJ=(e,t)=>{const i=1-t,s=pl(e,.393+.607*i,.769-.769*i,.189-.189*i,0,.349-.349*i,.686+.314*i,.168-.168*i,0,.272-.272*i,.534-.534*i,.131+.869*i,0,0,0,0,1);return Vo(s,s)};class $b{constructor(t,i,s){this.strength=t,this.radius=i,this.threshold=s,this.type="bloom"}interpolate(t,i,s){this.strength=ts(t.strength,i.strength,s),this.radius=ts(t.radius,i.radius,s),this.threshold=ts(t.threshold,i.threshold,s)}clone(){return new $b(this.strength,this.radius,this.threshold)}toJSON(){return{type:"bloom",radius:ff(this.radius),strength:this.strength,threshold:this.threshold}}}class Tb{constructor(t){this.radius=t,this.type="blur"}interpolate(t,i,s){this.radius=Math.round(ts(t.radius,i.radius,s))}clone(){return new Tb(this.radius)}toJSON(){return{type:"blur",radius:ff(this.radius)}}}class Jf{constructor(t,i){this.type=t,this.amount=i,this.type!=="invert"&&this.type!=="grayscale"&&this.type!=="sepia"||(this.amount=Math.min(this.amount,1))}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(t,i,s){this.amount=ts(t.amount,i.amount,s),this._updateMatrix()}clone(){return new Jf(this.type,this.amount)}toJSON(){return{type:this.type,amount:this.amount}}_updateMatrix(){const t=this._colorMatrix||Mb();switch(this.type){case"brightness":this._colorMatrix=zJ(t,this.amount);break;case"contrast":this._colorMatrix=BJ(t,this.amount);break;case"grayscale":this._colorMatrix=UJ(t,this.amount);break;case"invert":this._colorMatrix=GJ(t,this.amount);break;case"saturate":this._colorMatrix=WJ(t,this.amount);break;case"sepia":this._colorMatrix=HJ(t,this.amount)}}}class Ib{constructor(t,i,s,r){this.offsetX=t,this.offsetY=i,this.blurRadius=s,this.color=r,this.type="drop-shadow"}interpolate(t,i,s){this.offsetX=ts(t.offsetX,i.offsetX,s),this.offsetY=ts(t.offsetY,i.offsetY,s),this.blurRadius=ts(t.blurRadius,i.blurRadius,s),this.color[0]=Math.round(ts(t.color[0],i.color[0],s)),this.color[1]=Math.round(ts(t.color[1],i.color[1],s)),this.color[2]=Math.round(ts(t.color[2],i.color[2],s)),this.color[3]=ts(t.color[3],i.color[3],s)}clone(){return new Ib(this.offsetX,this.offsetY,this.blurRadius,[...this.color])}toJSON(){const t=[...this.color];return t[3]*=255,{type:"drop-shadow",xoffset:ff(this.offsetX),yoffset:ff(this.offsetY),blurRadius:ff(this.blurRadius),color:t}}}class Eb{constructor(t){this.angle=t,this.type="hue-rotate"}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(t,i,s){this.angle=ts(t.angle,i.angle,s),this._updateMatrix()}clone(){return new Eb(this.angle)}toJSON(){return{type:"hue-rotate",angle:this.angle}}_updateMatrix(){const t=this._colorMatrix||Mb();this._colorMatrix=qJ(t,this.angle)}}class kb{constructor(t){this.amount=t,this.type="opacity",this.amount=Math.min(this.amount,1)}interpolate(t,i,s){this.amount=ts(t.amount,i.amount,s)}clone(){return new kb(this.amount)}toJSON(){return{type:"opacity",amount:this.amount}}}function ts(e,t,i){return e+(t-e)*i}function ff(e){return Math.round(1e3*Fo(e))/1e3}function YJ(e){switch(e.type){case"grayscale":case"sepia":case"invert":return new Jf(e.type,0);case"saturate":case"brightness":case"contrast":return new Jf(e.type,1);case"opacity":return new kb(1);case"hue-rotate":return new Eb(0);case"blur":return new Tb(0);case"drop-shadow":return new Ib(0,0,0,[...z$("transparent")]);case"bloom":return new $b(0,0,1)}}function JJ(e,t){const i=e.length>t.length?e:t;return(e.length>t.length?t:e).every((s,r)=>s.type===i[r].type)}function XJ(e,t){const i=e.length>t.length?e:t,s=e.length>t.length?t:e;for(let r=s.length;r{if(!Number.isFinite(i.scale)||i.scale<=0)throw new L("effect:invalid-scale","scale must be finite and greater than 0",{stop:i});return{scale:i.scale,effects:Sk(i.value)}});t.sort((i,s)=>s.effects.length-i.effects.length);for(let i=0;is.scale-i.scale),t}function Sk(e){let t;if(!e)return[];try{t=ID.exports.parse(e)}catch(i){throw new L("effect:invalid-syntax","Invalid effect syntax",{value:e,error:i})}return t.map(i=>QJ(i))}function QJ(e){try{switch(e.name){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":return KJ(e);case"opacity":return eX(e);case"hue-rotate":return tX(e);case"blur":return iX(e);case"drop-shadow":return sX(e);case"bloom":return rX(e)}}catch(t){throw t.details.filter=e,t}throw new L("effect:unknown-effect",`Effect '${e.name}' is not supported`,{effect:e})}function KJ(e){let t=1;return dd(e.parameters,1),e.parameters.length===1&&(t=Ir(e.parameters[0])),new Jf(e.name,t)}function eX(e){let t=1;return dd(e.parameters,1),e.parameters.length===1&&(t=Ir(e.parameters[0])),new kb(t)}function tX(e){let t=0;return dd(e.parameters,1),e.parameters.length===1&&(t=uX(e.parameters[0])),new Eb(t)}function iX(e){let t=0;return dd(e.parameters,1),e.parameters.length===1&&(t=q$(e.parameters[0]),Rm(t,e.parameters[0])),new Tb(t)}function sX(e){const t=[];let i=null;for(const s of e.parameters)if(s.type==="color"){if(t.length&&Object.freeze(t),i)throw new L("effect:type-error","Accepts only one color",{});i=hX(s)}else{const r=q$(s);if(Object.isFrozen(t))throw new L("effect:type-error"," parameters not consecutive",{lengths:t});t.push(r),t.length===3&&Rm(r,s)}if(t.length<2||t.length>3)throw new L("effect:type-error",`Expected {2,3}, Actual: {${t.length}}`,{lengths:t});return new Ib(t[0],t[1],t[2]||0,i||kD("black"))}function rX(e){let t=1,i=0,s=0;return dd(e.parameters,3),e.parameters[0]&&(t=Ir(e.parameters[0])),e.parameters[1]&&(i=q$(e.parameters[1]),Rm(i,e.parameters[1])),e.parameters[2]&&(s=Ir(e.parameters[2])),new $b(t,i,s)}function dd(e,t){if(e.length>t)throw new L("effect:type-error",`Function supports up to ${t} parameters, Actual: ${e.length}`,{parameters:e})}function Cb(e){if(e.type==="color")return"";if(e.unit){if(U$[e.unit])return"";if(B$[e.unit])return"";if(e.unit==="%")return""}return""}function Rm(e,t){if(e<0)throw new L("effect:type-error",`Negative values are not allowed, Actual: ${e}`,{term:t})}function nX(e){if(e.type!=="quantity"||e.unit!==null)throw new L("effect:type-error",`Expected , Actual: ${Cb(e)}`,{term:e})}function oX(e){if(e.type!=="quantity"||e.unit!==null&&e.unit!=="%")throw new L("effect:type-error",`Expected or , Actual: ${Cb(e)}`,{term:e})}xk=function(){function e(r,n){function o(){this.constructor=r}o.prototype=n.prototype,r.prototype=new o}function t(r,n,o,a){var l=Error.call(this,r);return Object.setPrototypeOf&&Object.setPrototypeOf(l,t.prototype),l.expected=n,l.found=o,l.location=a,l.name="SyntaxError",l}function i(r,n,o){return o=o||" ",r.length>n?r:(n-=r.length,r+(o+=o.repeat(n)).slice(0,n))}function s(r,n){var o,a={},l=(n=n!==void 0?n:{}).grammarSource,u={start:RI},d=RI,f="none",m=")",y=",",g="(",v="%",b="px",_="cm",x="mm",$="in",I="pt",T="pc",k="deg",A="rad",F="grad",G="turn",U="#",J=".",H="e",te=/^[ \t\n\r]/,se=/^[a-z\-]/,me=/^[0-9a-fA-F]/,Ee=/^[+\-]/,re=/^[0-9]/,ne=Nn("none"),ke=ti("none",!1),ir=ti(")",!1),sr=ti(",",!1),rr=Nn("whitespace"),nr=Td([" "," ",` +]`});function Qve(e){return e&&(yb(e)||e===ov)?ov:e&&(gb(e)||e===av)?av:bF}function mW(e){return M(e)&&(yb(e)||e===ov)?Io:M(e)&&(gb(e)||e===av)?rl:it}function Kve(e){return b$(e)?Io:_$(e)?rl:it}const ebe=39.37,yW=it.radius*Math.PI/200,_F=/UNIT\[([^\]]+)\]\]$/i,zc=w,wF=/UNIT\[([^\]]+)\]/i,gW=new Set([4261,4305,4807,4810,4811,4812,4816,4819,4821,4901,4902,37225,104139,104140]),vW=mi()({meter:"meters",foot:"feet",foot_us:"us-feet",foot_clarke:"clarke-feet",yard_clarke:"clarke-yards",link_clarke:"clarke-links",yard_sears:"sears-yards",foot_sears:"sears-feet",chain_sears:"sears-chains",chain_benoit_1895_b:"benoit-1895-b-chains",yard_indian:"indian-yards",yard_indian_1937:"indian-1937-yards",foot_gold_coast:"gold-coast-feet",chain_sears_1922_truncated:"sears-1922-truncated-chains","50_kilometers":"50-kilometers","150_kilometers":"150-kilometers"}),Hr=e=>e*e,Uo=e=>e*e*e,Gf={length:{baseUnit:"meters",units:{millimeters:{inBaseUnits:.001},centimeters:{inBaseUnits:.01},decimeters:{inBaseUnits:.1},meters:{inBaseUnits:1},kilometers:{inBaseUnits:1e3},inches:{inBaseUnits:.0254},feet:{inBaseUnits:.3048},yards:{inBaseUnits:.9144},miles:{inBaseUnits:1609.344},"nautical-miles":{inBaseUnits:1852},"us-feet":{inBaseUnits:1200/3937}}},area:{baseUnit:"square-meters",units:{"square-millimeters":{inBaseUnits:Hr(.001)},"square-centimeters":{inBaseUnits:Hr(.01)},"square-decimeters":{inBaseUnits:Hr(.1)},"square-meters":{inBaseUnits:1},"square-kilometers":{inBaseUnits:Hr(1e3)},"square-inches":{inBaseUnits:Hr(.0254)},"square-feet":{inBaseUnits:Hr(.3048)},"square-yards":{inBaseUnits:Hr(.9144)},"square-miles":{inBaseUnits:Hr(1609.344)},"square-us-feet":{inBaseUnits:Hr(1200/3937)},acres:{inBaseUnits:.0015625*Hr(1609.344)},ares:{inBaseUnits:100},hectares:{inBaseUnits:1e4}}},volume:{baseUnit:"liters",units:{liters:{inBaseUnits:1},"cubic-millimeters":{inBaseUnits:1e3*Uo(.001)},"cubic-centimeters":{inBaseUnits:1e3*Uo(.01)},"cubic-decimeters":{inBaseUnits:1e3*Uo(.1)},"cubic-meters":{inBaseUnits:1e3},"cubic-kilometers":{inBaseUnits:1e3*Uo(1e3)},"cubic-inches":{inBaseUnits:1e3*Uo(.0254)},"cubic-feet":{inBaseUnits:1e3*Uo(.3048)},"cubic-yards":{inBaseUnits:1e3*Uo(.9144)},"cubic-miles":{inBaseUnits:1e3*Uo(1609.344)}}},angle:{baseUnit:"radians",units:{radians:{inBaseUnits:1},degrees:{inBaseUnits:Math.PI/180}}}},bW=(()=>{const e={};for(const t in Gf)for(const i in Gf[t].units)e[i]=t;return e})();function _W(e,t,i){return e*Gf[i].units[t].inBaseUnits}function wW(e,t,i){return e/Gf[i].units[t].inBaseUnits}function U1(e){const t=bW[e];if(!t)throw new Error("unknown type");return t}function WE(e,t=null){return t=t||U1(e),Gf[t].baseUnit===e}function Fs(e,t,i){if(t===i)return e;const s=U1(t);if(s!==U1(i))throw new Error("incompatible units");const r=WE(t,s)?e:_W(e,t,s);return WE(i,s)?r:wW(r,i,s)}function xW(e,t,i){return Fs(e,t,"meters")/(i*Math.PI/180)}function xF(e){return vW.fromJSON(e.toLowerCase())||null}function Vh(e){if(M(e)&&!lW(e))return 1;const t=Pm(e);return t>1e5?1:t}function SW(e){return Pm(e)>=mW(e).metersPerDegree?"meters":$W(e)}function Pm(e,t=it.metersPerDegree){return FM(MW(e,!0),t)}function MW(e,t=!1){const i=M(e)?e.wkid:null,s=M(e)?e.wkt:null;let r=null;if(i){if(b$(i))return Io.metersPerDegree;if(_$(i))return rl.metersPerDegree;r=zc.values[zc[i]],!r&&t&&gW.has(i)&&(r=yW)}else s&&($F(s)?r=HE(_F.exec(s),r):MF(s)&&(r=HE(wF.exec(s),r)));return r}function HE(e,t){return e&&e[1]?SF(e[1]):t}function SF(e){return parseFloat(e.split(",")[1])}function $W(e){const t=M(e)?e.wkid:null,i=M(e)?e.wkt:null;let s=null;if(t)s=zc.units[zc[t]];else if(i){const r=$F(i)?_F:MF(i)?wF:null;if(r){const n=r.exec(i);n&&n[1]&&(s=IW(n[1]))}}return M(s)?xF(s):null}function MF(e){return/^GEOCCS/i.test(e)}function $F(e){return/^PROJCS/i.test(e)}const TW=1e-7;function IW(e){const t=/[\\"\\']{1}([^\\"\\']+)/.exec(e);let i=t&&t[1];if(!i||!zc.units.includes(i)){const s=SF(e);i=null;const r=zc.values;for(let n=0;n0?(i[0]=2*(a*o+d*s+l*n-u*r)/f,i[1]=2*(l*o+d*r+u*s-a*n)/f,i[2]=2*(u*o+d*n+a*r-l*s)/f):(i[0]=2*(a*o+d*s+l*n-u*r),i[1]=2*(l*o+d*r+u*s-a*n),i[2]=2*(u*o+d*n+a*r-l*s)),CF(e,t,i),e}const WW=On();function HW(e,t){return e[0]=t[12],e[1]=t[13],e[2]=t[14],e}function YW(e,t){const i=t[0],s=t[1],r=t[2],n=t[4],o=t[5],a=t[6],l=t[8],u=t[9],d=t[10];return e[0]=Math.sqrt(i*i+s*s+r*r),e[1]=Math.sqrt(n*n+o*o+a*a),e[2]=Math.sqrt(l*l+u*u+d*d),e}function JW(e,t){const i=t[0]+t[5]+t[10];let s=0;return i>0?(s=2*Math.sqrt(i+1),e[3]=.25*s,e[0]=(t[6]-t[9])/s,e[1]=(t[8]-t[2])/s,e[2]=(t[1]-t[4])/s):t[0]>t[5]&&t[0]>t[10]?(s=2*Math.sqrt(1+t[0]-t[5]-t[10]),e[3]=(t[6]-t[9])/s,e[0]=.25*s,e[1]=(t[1]+t[4])/s,e[2]=(t[8]+t[2])/s):t[5]>t[10]?(s=2*Math.sqrt(1+t[5]-t[0]-t[10]),e[3]=(t[8]-t[2])/s,e[0]=(t[1]+t[4])/s,e[1]=.25*s,e[2]=(t[6]+t[9])/s):(s=2*Math.sqrt(1+t[10]-t[0]-t[5]),e[3]=(t[1]-t[4])/s,e[0]=(t[8]+t[2])/s,e[1]=(t[6]+t[9])/s,e[2]=.25*s),e}function XW(e,t,i,s){const r=t[0],n=t[1],o=t[2],a=t[3],l=r+r,u=n+n,d=o+o,f=r*l,m=r*u,y=r*d,g=n*u,v=n*d,b=o*d,_=a*l,x=a*u,$=a*d,I=s[0],T=s[1],k=s[2];return e[0]=(1-(g+b))*I,e[1]=(m+$)*I,e[2]=(y-x)*I,e[3]=0,e[4]=(m-$)*T,e[5]=(1-(f+b))*T,e[6]=(v+_)*T,e[7]=0,e[8]=(y+x)*k,e[9]=(v-_)*k,e[10]=(1-(f+g))*k,e[11]=0,e[12]=i[0],e[13]=i[1],e[14]=i[2],e[15]=1,e}function ZW(e,t,i,s,r){const n=t[0],o=t[1],a=t[2],l=t[3],u=n+n,d=o+o,f=a+a,m=n*u,y=n*d,g=n*f,v=o*d,b=o*f,_=a*f,x=l*u,$=l*d,I=l*f,T=s[0],k=s[1],A=s[2],F=r[0],G=r[1],U=r[2],J=(1-(v+_))*T,H=(y+I)*T,te=(g-$)*T,se=(y-I)*k,me=(1-(m+_))*k,Ee=(b+x)*k,re=(g+$)*A,ne=(b-x)*A,ke=(1-(m+v))*A;return e[0]=J,e[1]=H,e[2]=te,e[3]=0,e[4]=se,e[5]=me,e[6]=Ee,e[7]=0,e[8]=re,e[9]=ne,e[10]=ke,e[11]=0,e[12]=i[0]+F-(J*F+se*G+re*U),e[13]=i[1]+G-(H*F+me*G+ne*U),e[14]=i[2]+U-(te*F+Ee*G+ke*U),e[15]=1,e}function QW(e,t){const i=t[0],s=t[1],r=t[2],n=t[3],o=i+i,a=s+s,l=r+r,u=i*o,d=s*o,f=s*a,m=r*o,y=r*a,g=r*l,v=n*o,b=n*a,_=n*l;return e[0]=1-f-g,e[1]=d+_,e[2]=m-b,e[3]=0,e[4]=d-_,e[5]=1-u-g,e[6]=y+v,e[7]=0,e[8]=m+b,e[9]=y-v,e[10]=1-u-f,e[11]=0,e[12]=0,e[13]=0,e[14]=0,e[15]=1,e}function KW(e,t,i,s,r,n,o){const a=1/(i-t),l=1/(r-s),u=1/(n-o);return e[0]=2*n*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=2*n*l,e[6]=0,e[7]=0,e[8]=(i+t)*a,e[9]=(r+s)*l,e[10]=(o+n)*u,e[11]=-1,e[12]=0,e[13]=0,e[14]=o*n*2*u,e[15]=0,e}function eH(e,t,i,s,r){const n=1/Math.tan(t/2);let o;return e[0]=n/i,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=n,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[11]=-1,e[12]=0,e[13]=0,e[15]=0,r!=null&&r!==1/0?(o=1/(s-r),e[10]=(r+s)*o,e[14]=2*r*s*o):(e[10]=-1,e[14]=-2*s),e}function tH(e,t,i,s){const r=Math.tan(t.upDegrees*Math.PI/180),n=Math.tan(t.downDegrees*Math.PI/180),o=Math.tan(t.leftDegrees*Math.PI/180),a=Math.tan(t.rightDegrees*Math.PI/180),l=2/(o+a),u=2/(r+n);return e[0]=l,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=u,e[6]=0,e[7]=0,e[8]=-(o-a)*l*.5,e[9]=(r-n)*u*.5,e[10]=s/(i-s),e[11]=-1,e[12]=0,e[13]=0,e[14]=s*i/(i-s),e[15]=0,e}function iH(e,t,i,s,r,n,o){const a=1/(t-i),l=1/(s-r),u=1/(n-o);return e[0]=-2*a,e[1]=0,e[2]=0,e[3]=0,e[4]=0,e[5]=-2*l,e[6]=0,e[7]=0,e[8]=0,e[9]=0,e[10]=2*u,e[11]=0,e[12]=(t+i)*a,e[13]=(r+s)*l,e[14]=(o+n)*u,e[15]=1,e}function sH(e,t,i,s){let r,n,o,a,l,u,d,f,m,y;const g=t[0],v=t[1],b=t[2],_=s[0],x=s[1],$=s[2],I=i[0],T=i[1],k=i[2],A=er();return Math.abs(g-I)0&&(y=1/Math.sqrt(y),d*=y,f*=y,m*=y);let g=l*m-u*f,v=u*d-a*m,b=a*f-l*d;return y=g*g+v*v+b*b,y>0&&(y=1/Math.sqrt(y),g*=y,v*=y,b*=y),e[0]=g,e[1]=v,e[2]=b,e[3]=0,e[4]=f*b-m*v,e[5]=m*g-d*b,e[6]=d*v-f*g,e[7]=0,e[8]=d,e[9]=f,e[10]=m,e[11]=0,e[12]=r,e[13]=n,e[14]=o,e[15]=1,e}function nH(e){return"mat4("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+", "+e[9]+", "+e[10]+", "+e[11]+", "+e[12]+", "+e[13]+", "+e[14]+", "+e[15]+")"}function oH(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2+e[9]**2+e[10]**2+e[11]**2+e[12]**2+e[13]**2+e[14]**2+e[15]**2)}function aH(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e[6]=t[6]+i[6],e[7]=t[7]+i[7],e[8]=t[8]+i[8],e[9]=t[9]+i[9],e[10]=t[10]+i[10],e[11]=t[11]+i[11],e[12]=t[12]+i[12],e[13]=t[13]+i[13],e[14]=t[14]+i[14],e[15]=t[15]+i[15],e}function PF(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e[6]=t[6]-i[6],e[7]=t[7]-i[7],e[8]=t[8]-i[8],e[9]=t[9]-i[9],e[10]=t[10]-i[10],e[11]=t[11]-i[11],e[12]=t[12]-i[12],e[13]=t[13]-i[13],e[14]=t[14]-i[14],e[15]=t[15]-i[15],e}function lH(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e[9]=t[9]*i,e[10]=t[10]*i,e[11]=t[11]*i,e[12]=t[12]*i,e[13]=t[13]*i,e[14]=t[14]*i,e[15]=t[15]*i,e}function cH(e,t,i,s){return e[0]=t[0]+i[0]*s,e[1]=t[1]+i[1]*s,e[2]=t[2]+i[2]*s,e[3]=t[3]+i[3]*s,e[4]=t[4]+i[4]*s,e[5]=t[5]+i[5]*s,e[6]=t[6]+i[6]*s,e[7]=t[7]+i[7]*s,e[8]=t[8]+i[8]*s,e[9]=t[9]+i[9]*s,e[10]=t[10]+i[10]*s,e[11]=t[11]+i[11]*s,e[12]=t[12]+i[12]*s,e[13]=t[13]+i[13]*s,e[14]=t[14]+i[14]*s,e[15]=t[15]+i[15]*s,e}function uH(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]&&e[9]===t[9]&&e[10]===t[10]&&e[11]===t[11]&&e[12]===t[12]&&e[13]===t[13]&&e[14]===t[14]&&e[15]===t[15]}function hH(e,t){if(e===t)return!0;const i=e[0],s=e[1],r=e[2],n=e[3],o=e[4],a=e[5],l=e[6],u=e[7],d=e[8],f=e[9],m=e[10],y=e[11],g=e[12],v=e[13],b=e[14],_=e[15],x=t[0],$=t[1],I=t[2],T=t[3],k=t[4],A=t[5],F=t[6],G=t[7],U=t[8],J=t[9],H=t[10],te=t[11],se=t[12],me=t[13],Ee=t[14],re=t[15],ne=er();return Math.abs(i-x)<=ne*Math.max(1,Math.abs(i),Math.abs(x))&&Math.abs(s-$)<=ne*Math.max(1,Math.abs(s),Math.abs($))&&Math.abs(r-I)<=ne*Math.max(1,Math.abs(r),Math.abs(I))&&Math.abs(n-T)<=ne*Math.max(1,Math.abs(n),Math.abs(T))&&Math.abs(o-k)<=ne*Math.max(1,Math.abs(o),Math.abs(k))&&Math.abs(a-A)<=ne*Math.max(1,Math.abs(a),Math.abs(A))&&Math.abs(l-F)<=ne*Math.max(1,Math.abs(l),Math.abs(F))&&Math.abs(u-G)<=ne*Math.max(1,Math.abs(u),Math.abs(G))&&Math.abs(d-U)<=ne*Math.max(1,Math.abs(d),Math.abs(U))&&Math.abs(f-J)<=ne*Math.max(1,Math.abs(f),Math.abs(J))&&Math.abs(m-H)<=ne*Math.max(1,Math.abs(m),Math.abs(H))&&Math.abs(y-te)<=ne*Math.max(1,Math.abs(y),Math.abs(te))&&Math.abs(g-se)<=ne*Math.max(1,Math.abs(g),Math.abs(se))&&Math.abs(v-me)<=ne*Math.max(1,Math.abs(v),Math.abs(me))&&Math.abs(b-Ee)<=ne*Math.max(1,Math.abs(b),Math.abs(Ee))&&Math.abs(_-re)<=ne*Math.max(1,Math.abs(_),Math.abs(re))}function dH(e){const t=er(),i=e[0],s=e[1],r=e[2],n=e[4],o=e[5],a=e[6],l=e[8],u=e[9],d=e[10];return Math.abs(1-(i*i+n*n+l*l))<=t&&Math.abs(1-(s*s+o*o+u*u))<=t&&Math.abs(1-(r*r+a*a+d*d))<=t}const pH=EF,fH=PF;Object.freeze(Object.defineProperty({__proto__:null,copy:CW,set:pl,identity:vb,transpose:Vo,invert:PW,adjoint:AW,determinant:OW,multiply:EF,translate:RW,scale:LW,rotate:FW,rotateX:DW,rotateY:NW,rotateZ:jW,fromTranslation:kF,fromScaling:VW,fromRotation:zW,fromXRotation:BW,fromYRotation:UW,fromZRotation:qW,fromRotationTranslation:CF,fromQuat2:GW,getTranslation:HW,getScaling:YW,getRotation:JW,fromRotationTranslationScale:XW,fromRotationTranslationScaleOrigin:ZW,fromQuat:QW,frustum:KW,perspective:eH,perspectiveFromFieldOfView:tH,ortho:iH,lookAt:sH,targetTo:rH,str:nH,frob:oH,add:aH,subtract:PF,multiplyScalar:lH,multiplyScalarAndAdd:cH,exactEquals:uH,equals:hH,isOrthoNormal:dH,mul:pH,sub:fH},Symbol.toStringTag,{value:"Module"}));function Q(e,t,i){let s,r;return t===void 0||Array.isArray(t)?(r=e,i=t,s=[void 0]):(r=t,s=Array.isArray(e)?e:[e]),(n,o)=>{const a=n.constructor.prototype;s.forEach(l=>{const u=U3(n,l,r);u.read&&typeof u.read=="object"||(u.read={}),u.read.reader=a[o],i&&(u.read.source=(u.read.source||[]).concat(i))})}}let Jr=class extends W{constructor(...e){super(...e),this.type=null,this.hasM=!1,this.hasZ=!1,this.spatialReference=xe.WGS84}get cache(){return this.commitProperty("spatialReference"),{}}get extent(){return null}readSpatialReference(e,t){if(e instanceof xe)return e;if(e!=null){const i=new xe;return i.read(e,t),i}return e}clone(){return console.warn(".clone() is not implemented for "+this.declaredClass),null}clearCache(){this.notifyChange("cache")}getCacheValue(e){return this.cache[e]}setCacheValue(e,t){this.cache[e]=t}};c([h()],Jr.prototype,"type",void 0),c([h({readOnly:!0})],Jr.prototype,"cache",null),c([h({readOnly:!0})],Jr.prototype,"extent",null),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],Jr.prototype,"hasM",void 0),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],Jr.prototype,"hasZ",void 0),c([h({type:xe,json:{write:!0}})],Jr.prototype,"spatialReference",void 0),c([Q("spatialReference")],Jr.prototype,"readSpatialReference",null),Jr=c([S("esri.geometry.Geometry")],Jr);const fl=Jr;function mH(e,t){const i=e.x-t.x,s=e.y-t.y,r=e.hasZ&&t.hasZ?e.z-t.z:0;return Math.sqrt(i*i+s*s+r*r)}const yH=57.29577951308232,gH=.017453292519943;function YE(e){return e*yH}function JE(e){return e*gH}function tbe(e){return Math.PI/2-2*Math.atan(Math.exp(-e/it.radius))}function q1(e){return e.wkid!=null||e.wkt!=null}const k_=[0,0];function lv(e,t,i,s,r){const n=e,o=r;if(o.spatialReference=i,"x"in n&&"x"in o)[o.x,o.y]=t(n.x,n.y,k_,s);else if("xmin"in n&&"xmin"in o)[o.xmin,o.ymin]=t(n.xmin,n.ymin,k_,s),[o.xmax,o.ymax]=t(n.xmax,n.ymax,k_,s);else if("paths"in n&&"paths"in o||"rings"in n&&"rings"in o){const a="paths"in n?n.paths:n.rings,l=[];let u;for(let d=0;d2&&u[m].push(f[m][2]),f[m].length>3&&u[m].push(f[m][3])}"paths"in o?o.paths=l:o.rings=l}else if("points"in n&&"points"in o){const a=n.points,l=[];for(let u=0;u2&&l[u].push(a[u][2]),a[u].length>3&&l[u].push(a[u][3]);o.points=l}return r}function vg(e,t){const i=e&&(q1(e)?e:e.spatialReference),s=t&&(q1(t)?t:t.spatialReference);return!(e&&"type"in e&&e.type==="mesh"||t&&"type"in t&&t.type==="mesh"||!i||!s)&&(!!Kt(s,i)||tu(s)&&qf(i)||tu(i)&&qf(s))}function bb(e,t){if(N(e))return null;const i=e.spatialReference,s=t&&(q1(t)?t:t.spatialReference);return vg(i,s)?Kt(i,s)?R(e):tu(s)?lv(e,ph,xe.WebMercator,!1,R(e)):qf(s)?lv(e,df,xe.WGS84,!1,R(e)):null:null}function ph(e,t,i=[0,0]){t>89.99999?t=89.99999:t<-89.99999&&(t=-89.99999);const s=JE(t);return i[0]=JE(e)*it.radius,i[1]=it.halfSemiMajorAxis*Math.log((1+Math.sin(s))/(1-Math.sin(s))),i}function df(e,t,i=[0,0],s=!1){const r=YE(e/it.radius);return i[0]=s?r:r-360*Math.floor((r+180)/360),i[1]=YE(Math.PI/2-2*Math.atan(Math.exp(-t/it.radius))),i}function Za(e,t=!1,i=R(e)){return lv(e,ph,xe.WebMercator,t,i)}function op(e,t=!1,i=R(e)){return lv(e,df,xe.WGS84,t,i)}var bg;const Rd=[0,0];function XE(e){return e&&(e.declaredClass==="esri.geometry.SpatialReference"||e.wkid!=null)}let Li=bg=class extends fl{constructor(...e){super(...e),this.x=0,this.y=0,this.z=void 0,this.m=void 0,this.type="point"}static copy(e,t){t._set("x",e._get("x")),t._set("y",e._get("y")),t._set("z",e._get("z")),t._set("m",e._get("m"));const i=e._get("spatialReference");t._set("spatialReference",Object.isFrozen(i)?i:i.clone())}normalizeCtorArgs(e,t,i,s,r){let n;if(Array.isArray(e))n=e,r=t,e=n[0],t=n[1],i=n[2],s=n[3];else if(e&&typeof e=="object"){if(n=e,e=n.x!=null?n.x:n.longitude,t=n.y!=null?n.y:n.latitude,i=n.z,s=n.m,(r=n.spatialReference)&&r.declaredClass!=="esri.geometry.SpatialReference"&&(r=new xe(r)),n.longitude!=null||n.latitude!=null){if(n.longitude==null)q.getLogger(this.declaredClass).warn(".longitude=","Latitude was defined without longitude");else if(n.latitude==null)q.getLogger(this.declaredClass).warn(".latitude=","Longitude was defined without latitude");else if(!n.declaredClass&&r&&r.isWebMercator){const a=ph(n.longitude,n.latitude,Rd);e=a[0],t=a[1]}}}else XE(i)?(r=i,i=null):XE(s)&&(r=s,s=null);const o={x:e,y:t};return o.x==null&&o.y!=null?q.getLogger(this.declaredClass).warn(".y=","Y coordinate was defined without an X coordinate"):o.y==null&&o.x!=null&&q.getLogger(this.declaredClass).warn(".x=","X coordinate was defined without a Y coordinate"),r!=null&&(o.spatialReference=r),i!=null&&(o.z=i),s!=null&&(o.m=s),o}get cache(){return this.commitProperty("x"),this.commitProperty("y"),this.commitProperty("z"),this.commitProperty("m"),this.commitProperty("spatialReference"),{}}get hasM(){return this.m!==void 0}set hasM(e){e!==(this._get("m")!==void 0)&&(this._set("m",e?0:void 0),this._set("hasM",e))}get hasZ(){return this.z!==void 0}set hasZ(e){e!==(this._get("z")!==void 0)&&(this._set("z",e?0:void 0),this._set("hasZ",e))}get latitude(){const{spatialReference:e,x:t,y:i}=this;if(e){if(e.isWebMercator)return df(t,i,Rd)[1];if(e.isGeographic)return i}return null}set latitude(e){const{spatialReference:t,x:i}=this;e!=null&&t&&(t.isWebMercator?this._set("y",ph(i,e,Rd)[1]):t.isGeographic&&this._set("y",e),this._set("latitude",e))}get longitude(){const{x:e,y:t,spatialReference:i}=this;if(i){if(i.isWebMercator)return df(e,t,Rd)[0];if(i.isGeographic)return e}return null}set longitude(e){const{y:t,spatialReference:i}=this;e!=null&&i&&(i.isWebMercator?this._set("x",ph(e,t,Rd)[0]):i.isGeographic&&this._set("x",e),this._set("longitude",e))}writeX(e,t,i){t[i]=isNaN(e)?"NaN":e}readX(e){return typeof e=="string"?NaN:e}clone(){const e=new bg;return e.x=this.x,e.y=this.y,e.z=this.z,e.m=this.m,e.spatialReference=this.spatialReference,e}copy(e){return bg.copy(e,this),this}equals(e){if(N(e))return!1;const{x:t,y:i,z:s,m:r,spatialReference:n}=this,{z:o,m:a}=e;let{x:l,y:u,spatialReference:d}=e;if(!n.equals(d))if(n.isWebMercator&&d.isWGS84)[l,u]=ph(l,u),d=n;else{if(!n.isWGS84||!d.isWebMercator)return!1;[l,u]=df(l,u),d=n}return t===l&&i===u&&s===o&&r===a&&n.wkid===d.wkid}offset(e,t,i){var s;return this.x+=e,this.y+=t,i!=null&&(this.z=((s=this.z)!=null?s:0)+i),this}normalize(){if(!this.spatialReference)return this;const e=Dr(this.spatialReference);if(!e)return this;let t=this.x;const[i,s]=e.valid,r=2*s;let n;return t>s?(n=Math.ceil(Math.abs(t-s)/r),t-=n*r):tisNaN(e)?e:Ys(e))],Li.prototype,"x",void 0),c([ie("x")],Li.prototype,"writeX",null),c([Q("x")],Li.prototype,"readX",null),c([h({type:Number,json:{write:!0}})],Li.prototype,"y",void 0),c([h({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasZ}}}}})],Li.prototype,"z",void 0),c([h({type:Number,json:{write:{overridePolicy(){return{enabled:this.hasM}}}}})],Li.prototype,"m",void 0),Li=bg=c([S("esri.geometry.Point")],Li),Li.prototype.toJSON.isDefaultToJSON=!0;const be=Li,C_=[0,0];function _b(e,t){return!!M(t)&&ji(e,t.x,t.y,t.z)}function ibe(e,t){if(!t.points||t.points.length)return!1;for(const i of t.points)if(!zh(e,i))return!1;return!0}function vH(e,t){const{xmin:i,ymin:s,zmin:r,xmax:n,ymax:o,zmax:a}=t;return e.hasZ&&t.hasZ?ji(e,i,s,r)&&ji(e,i,o,r)&&ji(e,n,o,r)&&ji(e,n,s,r)&&ji(e,i,s,a)&&ji(e,i,o,a)&&ji(e,n,o,a)&&ji(e,n,s,a):ji(e,i,s)&&ji(e,i,o)&&ji(e,n,o)&&ji(e,n,s)}function zh(e,t){return ji(e,t[0],t[1])}function bH(e,t){return ji(e,t[0],t[1],t[2])}function ji(e,t,i,s){return t>=e.xmin&&t<=e.xmax&&i>=e.ymin&&i<=e.ymax&&(s==null||!e.hasZ||s>=e.zmin&&s<=e.zmax)}function AF(e,t){return C_[1]=t.y,C_[0]=t.x,_H(e,C_)}function _H(e,t){return OF(e.rings,t)}function OF(e,t){if(!e)return!1;if(wH(e))return ZE(!1,e,t);let i=!1;for(let s=0,r=e.length;s=r||m=r)&&u+(r-d)/(m-d)*(f-u)=0&&I<=1&&T>=0&&T<=1&&(r&&(r[0]=n+I*(a-n),r[1]=o+I*(l-o)),!0)}function CH(e){switch(e){case"esriGeometryEnvelope":case"extent":return SH;case"esriGeometryMultipoint":case"multipoint":return MH;case"esriGeometryPoint":case"point":return xH;case"esriGeometryPolygon":case"polygon":return TH;case"esriGeometryPolyline":case"polyline":return EH}}var Ds;function PH(e){return e&&(e.declaredClass==="esri.geometry.SpatialReference"||e.wkid!=null)}function qo(e,t,i){return t==null?i:i==null?t:e(t,i)}let Ut=Ds=class extends fl{constructor(...e){super(...e),this.type="extent",this.xmin=0,this.ymin=0,this.mmin=void 0,this.zmin=void 0,this.xmax=0,this.ymax=0,this.mmax=void 0,this.zmax=void 0}normalizeCtorArgs(e,t,i,s,r){return PH(e)?{spatialReference:e,xmin:0,ymin:0,xmax:0,ymax:0}:typeof e=="object"?(e.spatialReference=e.spatialReference==null?xe.WGS84:e.spatialReference,e):{xmin:e,ymin:t,xmax:i,ymax:s,spatialReference:r!=null?r:xe.WGS84}}static fromBounds(e,t){return new Ds({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:t})}static fromPoint(e){return new Ds({xmin:e.x,ymin:e.y,zmin:e.z,xmax:e.x,ymax:e.y,zmax:e.z,spatialReference:e.spatialReference})}get cache(){return this.commitProperty("xmin"),this.commitProperty("ymin"),this.commitProperty("zmin"),this.commitProperty("mmin"),this.commitProperty("xmax"),this.commitProperty("ymax"),this.commitProperty("zmax"),this.commitProperty("mmax"),this.commitProperty("spatialReference"),{}}get center(){const e=new be({x:.5*(this.xmin+this.xmax),y:.5*(this.ymin+this.ymax),spatialReference:this.spatialReference});return this.hasZ&&(e.z=.5*(this.zmin+this.zmax)),this.hasM&&(e.m=.5*(this.mmin+this.mmax)),e}get extent(){return this.clone()}get hasM(){return this.mmin!=null&&this.mmax!=null}get hasZ(){return this.zmin!=null&&this.zmax!=null}get height(){return Math.abs(this.ymax-this.ymin)}get width(){return Math.abs(this.xmax-this.xmin)}centerAt(e){const t=this.center;return e.z!=null&&this.hasZ?this.offset(e.x-t.x,e.y-t.y,e.z-t.z):this.offset(e.x-t.x,e.y-t.y)}clone(){const e=new Ds;return e.xmin=this.xmin,e.ymin=this.ymin,e.xmax=this.xmax,e.ymax=this.ymax,e.spatialReference=this.spatialReference,this.zmin!=null&&(e.zmin=this.zmin,e.zmax=this.zmax),this.mmin!=null&&(e.mmin=this.mmin,e.mmax=this.mmax),e}contains(e){if(!e)return!1;const t=this.spatialReference,i=e.spatialReference;return t&&i&&!t.equals(i)&&vg(t,i)&&(e=t.isWebMercator?Za(e):op(e,!0)),e.type==="point"?_b(this,e):e.type==="extent"&&vH(this,e)}equals(e){if(this===e)return!0;if(N(e))return!1;const t=this.spatialReference,i=e.spatialReference;return t&&i&&!t.equals(i)&&vg(t,i)&&(e=t.isWebMercator?Za(e):op(e,!0)),this.xmin===e.xmin&&this.ymin===e.ymin&&this.zmin===e.zmin&&this.mmin===e.mmin&&this.xmax===e.xmax&&this.ymax===e.ymax&&this.zmax===e.zmax&&this.mmax===e.mmax}expand(e){const t=.5*(1-e),i=this.width*t,s=this.height*t;if(this.xmin+=i,this.ymin+=s,this.xmax-=i,this.ymax-=s,this.hasZ){const r=(this.zmax-this.zmin)*t;this.zmin+=r,this.zmax-=r}if(this.hasM){const r=(this.mmax-this.mmin)*t;this.mmin+=r,this.mmax-=r}return this}intersects(e){if(N(e))return!1;e.type==="mesh"&&(e=e.extent);const t=this.spatialReference,i=e.spatialReference;return t&&i&&!Kt(t,i)&&vg(t,i)&&(e=t.isWebMercator?Za(e):op(e,!0)),CH(e.type)(this,e)}normalize(){const e=this._normalize(!1,!0);return Array.isArray(e)?e:[e]}offset(e,t,i){return this.xmin+=e,this.ymin+=t,this.xmax+=e,this.ymax+=t,i!=null&&(this.zmin+=i,this.zmax+=i),this}shiftCentralMeridian(){return this._normalize(!0)}union(e){return this===e||(this.xmin=Math.min(this.xmin,e.xmin),this.ymin=Math.min(this.ymin,e.ymin),this.xmax=Math.max(this.xmax,e.xmax),this.ymax=Math.max(this.ymax,e.ymax),(this.hasZ||e.hasZ)&&(this.zmin=qo(Math.min,this.zmin,e.zmin),this.zmax=qo(Math.max,this.zmax,e.zmax)),(this.hasM||e.hasM)&&(this.mmin=qo(Math.min,this.mmin,e.mmin),this.mmax=qo(Math.max,this.mmax,e.mmax))),this}intersection(e){return this===e?this:N(e)||!this.intersects(e)?null:(this.xmin=Math.max(this.xmin,e.xmin),this.ymin=Math.max(this.ymin,e.ymin),this.xmax=Math.min(this.xmax,e.xmax),this.ymax=Math.min(this.ymax,e.ymax),(this.hasZ||e.hasZ)&&(this.zmin=qo(Math.max,this.zmin,e.zmin),this.zmax=qo(Math.min,this.zmax,e.zmax)),(this.hasM||e.hasM)&&(this.mmin=qo(Math.max,this.mmin,e.mmin),this.mmax=qo(Math.min,this.mmax,e.mmax)),this)}toJSON(e){return this.write({},e)}_shiftCM(e=Dr(this.spatialReference)){var s;if(!e||!this.spatialReference)return this;const t=this.spatialReference,i=this._getCM(e);if(i){const r=t.isWebMercator?op(i):i;this.xmin-=i.x,this.xmax-=i.x,t.isWebMercator||(r.x=this._normalizeX(r.x,e).x),this.spatialReference=new xe(In((s=t.isWGS84?e.altTemplate:null)!=null?s:e.wkTemplate,{Central_Meridian:r.x}))}return this}_getCM(e){let t=null;const[i,s]=e.valid,r=this.xmin,n=this.xmax;return r>=i&&r<=s&&n>=i&&n<=s||(t=this.center),t}_normalize(e,t,i){const s=this.spatialReference;if(!s)return this;const r=i!=null?i:Dr(s);if(r==null)return this;const n=this._getParts(r).map(l=>l.extent);if(n.length<2)return n[0]||this;if(n.length>2)return e?this._shiftCM(r):this.set({xmin:r.valid[0],xmax:r.valid[1]});if(e)return this._shiftCM(r);if(t)return n;let o=!0,a=!0;return n.forEach(l=>{l.hasZ||(o=!1),l.hasM||(a=!1)}),{rings:n.map(l=>{const u=[[l.xmin,l.ymin],[l.xmin,l.ymax],[l.xmax,l.ymax],[l.xmax,l.ymin],[l.xmin,l.ymin]];if(o){const d=(l.zmax-l.zmin)/2;for(let f=0;f0;if(a>2*m){const x=new Ds(lv||_?t.push({extent:new Ds(y,r,m,n,o),frameIds:[g]},{extent:new Ds(f,r,v,n,o),frameIds:[b]}):t.push({extent:new Ds(y,r,v,n,o),frameIds:[g]});this.cache._parts=t}const i=this.hasZ,s=this.hasM;if(i||s){const r={};i&&(r.zmin=this.zmin,r.zmax=this.zmax),s&&(r.mmin=this.mmin,r.mmax=this.mmax);for(let n=0;ns?(n=Math.ceil(Math.abs(e-s)/r),e-=n*r,o=n):et==null?i:i==null?t:e(t,i)}function AH(e){return e&&(e.declaredClass==="esri.geometry.SpatialReference"||e.wkid!=null)}let na=W1=class extends fl{constructor(...e){super(...e),this.points=[],this.type="multipoint"}normalizeCtorArgs(e,t){if(!e&&!t)return{};const i={};Array.isArray(e)?(i.points=e,i.spatialReference=t):AH(e)?i.spatialReference=e:(e.points&&(i.points=e.points),e.spatialReference&&(i.spatialReference=e.spatialReference),e.hasZ&&(i.hasZ=e.hasZ),e.hasM&&(i.hasM=e.hasM));const s=i.points&&i.points[0];return s&&(i.hasZ===void 0&&i.hasM===void 0?(i.hasZ=s.length>2,i.hasM=!1):i.hasZ===void 0?i.hasZ=s.length>3:i.hasM===void 0&&(i.hasM=s.length>3)),i}get cache(){return this.commitProperty("points"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const e=this.points;if(!e.length)return null;const t=new Ze,i=this.hasZ,s=this.hasM,r=i?3:2,n=e[0],o=QE(Math.min),a=QE(Math.max);let l,u,d,f,[m,y]=n,[g,v]=n;for(let b=0,_=e.length;b<_;b++){const x=e[b],[$,I]=x;if(m=o(m,$),y=o(y,I),g=a(g,$),v=a(v,I),i&&x.length>2){const T=x[2];l=o(l,T),d=a(d,T)}if(s&&x.length>r){const T=x[r];u=o(u,T),f=a(f,T)}}return t.xmin=m,t.ymin=y,t.xmax=g,t.ymax=v,t.spatialReference=this.spatialReference,i?(t.zmin=l,t.zmax=d):(t.zmin=void 0,t.zmax=void 0),s?(t.mmin=u,t.mmax=f):(t.mmin=void 0,t.mmax=void 0),t}writePoints(e,t){t.points=R(this.points)}addPoint(e){return Bh(this,e),Array.isArray(e)?this.points.push(e):this.points.push(e.toArray()),this.notifyChange("points"),this}clone(){const e={points:R(this.points),spatialReference:this.spatialReference};return this.hasZ&&(e.hasZ=!0),this.hasM&&(e.hasM=!0),new W1(e)}getPoint(e){if(!this._validateInputs(e))return null;const t=this.points[e],i={x:t[0],y:t[1],spatialReference:this.spatialReference};let s=2;return this.hasZ&&(i.z=t[2],s=3),this.hasM&&(i.m=t[s]),new be(i)}removePoint(e){if(!this._validateInputs(e))return null;const t=new be(this.points.splice(e,1)[0],this.spatialReference);return this.notifyChange("points"),t}setPoint(e,t){return this._validateInputs(e)?(Bh(this,t),Array.isArray(t)||(t=t.toArray()),this.points[e]=t,this.notifyChange("points"),this):this}toJSON(e){return this.write({},e)}_validateInputs(e){return e!=null&&e>=0&&eimport("./pe-wasm.031781a0.js"),[]).then(e=>e.p).then(({default:e})=>e({locateFile:t=>Ne(`esri/geometry/support/${t}`)})).then(e=>{jF(e)}),P_)}var H1,ot,Y1;(function(e){function t(n,o,a){O.ensureCache.prepare();const l=vc(a),u=a===l,d=O.ensureFloat64(l),f=O._pe_geog_to_proj(O.getPointer(n),o,d);return f&&Da(a,o,d,u),f}function i(n,o,a,l){switch(l){case ot.PE_TRANSFORM_P_TO_G:return s(n,o,a);case ot.PE_TRANSFORM_G_TO_P:return t(n,o,a)}return 0}function s(n,o,a){return r(n,o,a,0)}function r(n,o,a,l){O.ensureCache.prepare();const u=vc(a),d=a===u,f=O.ensureFloat64(u),m=O._pe_proj_to_geog_center(O.getPointer(n),o,f,l);return m&&Da(a,o,f,d),m}e.geogToProj=t,e.projGeog=i,e.projToGeog=s,e.projToGeogCenter=r})(H1||(H1={})),function(e){function t(){e.PE_BUFFER_MAX=O.PeDefs.prototype.PE_BUFFER_MAX,e.PE_NAME_MAX=O.PeDefs.prototype.PE_NAME_MAX,e.PE_MGRS_MAX=O.PeDefs.prototype.PE_MGRS_MAX,e.PE_USNG_MAX=O.PeDefs.prototype.PE_USNG_MAX,e.PE_DD_MAX=O.PeDefs.prototype.PE_DD_MAX,e.PE_DDM_MAX=O.PeDefs.prototype.PE_DDM_MAX,e.PE_DMS_MAX=O.PeDefs.prototype.PE_DMS_MAX,e.PE_UTM_MAX=O.PeDefs.prototype.PE_UTM_MAX,e.PE_PARM_MAX=O.PeDefs.prototype.PE_PARM_MAX,e.PE_TYPE_NONE=O.PeDefs.prototype.PE_TYPE_NONE,e.PE_TYPE_GEOGCS=O.PeDefs.prototype.PE_TYPE_GEOGCS,e.PE_TYPE_PROJCS=O.PeDefs.prototype.PE_TYPE_PROJCS,e.PE_TYPE_GEOGTRAN=O.PeDefs.prototype.PE_TYPE_GEOGTRAN,e.PE_TYPE_COORDSYS=O.PeDefs.prototype.PE_TYPE_COORDSYS,e.PE_TYPE_UNIT=O.PeDefs.prototype.PE_TYPE_UNIT,e.PE_TYPE_LINUNIT=O.PeDefs.prototype.PE_TYPE_LINUNIT,e.PE_STR_OPTS_NONE=O.PeDefs.prototype.PE_STR_OPTS_NONE,e.PE_STR_AUTH_NONE=O.PeDefs.prototype.PE_STR_AUTH_NONE,e.PE_STR_AUTH_TOP=O.PeDefs.prototype.PE_STR_AUTH_TOP,e.PE_STR_NAME_CANON=O.PeDefs.prototype.PE_STR_NAME_CANON,e.PE_PARM_X0=O.PeDefs.prototype.PE_PARM_X0,e.PE_PARM_ND=O.PeDefs.prototype.PE_PARM_ND,e.PE_TRANSFORM_1_TO_2=O.PeDefs.prototype.PE_TRANSFORM_1_TO_2,e.PE_TRANSFORM_2_TO_1=O.PeDefs.prototype.PE_TRANSFORM_2_TO_1,e.PE_TRANSFORM_P_TO_G=O.PeDefs.prototype.PE_TRANSFORM_P_TO_G,e.PE_TRANSFORM_G_TO_P=O.PeDefs.prototype.PE_TRANSFORM_G_TO_P,e.PE_HORIZON_RECT=O.PeDefs.prototype.PE_HORIZON_RECT,e.PE_HORIZON_POLY=O.PeDefs.prototype.PE_HORIZON_POLY,e.PE_HORIZON_LINE=O.PeDefs.prototype.PE_HORIZON_LINE,e.PE_HORIZON_DELTA=O.PeDefs.prototype.PE_HORIZON_DELTA}e.init=t}(ot||(ot={})),function(e){const t={},i={},s=y=>{if(y){const g=y.getType();switch(g){case ot.PE_TYPE_GEOGCS:y=O.castObject(y,O.PeGeogcs);break;case ot.PE_TYPE_PROJCS:y=O.castObject(y,O.PeProjcs);break;case ot.PE_TYPE_GEOGTRAN:y=O.castObject(y,O.PeGeogtran);break;default:g&ot.PE_TYPE_UNIT&&(y=O.castObject(y,O.PeUnit))}}return y};function r(){O.PeFactory.prototype.initialize(null)}function n(y){return o(ot.PE_TYPE_COORDSYS,y)}function o(y,g){let v=null,b=t[y];if(b||(b={},t[y]=b),b.hasOwnProperty(String(g)))v=b[g];else{const _=O.PeFactory.prototype.factoryByType(y,g);O.compare(_,O.NULL)||(v=_,b[g]=v)}return v=s(v),v}function a(y,g){let v=null,b=i[y];if(b||(b={},i[y]=b),b.hasOwnProperty(g))v=b[g];else{const _=O.PeFactory.prototype.fromString(y,g);O.compare(_,O.NULL)||(v=_,b[g]=v)}return v=s(v),v}function l(y){return o(ot.PE_TYPE_GEOGCS,y)}function u(y){return o(ot.PE_TYPE_GEOGTRAN,y)}function d(y){return O.PeFactory.prototype.getCode(y)}function f(y){return o(ot.PE_TYPE_PROJCS,y)}function m(y){return o(ot.PE_TYPE_UNIT,y)}e.initialize=r,e.coordsys=n,e.factoryByType=o,e.fromString=a,e.geogcs=l,e.geogtran=u,e.getCode=d,e.projcs=f,e.unit=m}(Y1||(Y1={}));let NF=null;var cv,J1,X1,Z1,uv,Q1,hv,dv,K1;function jF(e){function t(n,o,a){n[o]=a(n[o])}O=e,ot.init(),cv.init(),uv.init(),hv.init(),dv.init(),NF=class extends O.PeGCSExtent{destroy(){O.destroy(this)}};const i=[O.PeDatum,O.PeGeogcs,O.PeGeogtran,O.PeObject,O.PeParameter,O.PePrimem,O.PeProjcs,O.PeSpheroid,O.PeUnit];for(const n of i)t(n.prototype,"getName",o=>function(){return o.call(this,new Array(ot.PE_NAME_MAX))});for(const n of[O.PeGeogtran,O.PeProjcs])t(n.prototype,"getParameters",o=>function(){const a=new Array(ot.PE_PARM_MAX);let l=o.call(this);for(let u=0;ufunction(){const o=this.getSize();if(!o)return null;const a=[];return Da(a,o,n.call(this)),a}),t(O.PeGTlistExtendedEntry.prototype,"getEntries",n=>{const o=O._pe_getPeGTlistExtendedGTsSize();return function(){let a=null;const l=n.call(this);if(!O.compare(l,O.NULL)){a=[l];const u=this.getSteps();if(u>1){const d=O.getPointer(l);for(let f=1;ffunction(){let o=this._cache;if(o||(o=new Map,this._cache=o),o.has(n))return o.get(n);let a=null;const l=n.call(this);if(!O.compare(l,O.NULL)){a=[l];const u=l.getNump();if(u>1){const d=O.getPointer(l);for(let f=1;f{t.push(i[0],i[1])})):t=e,t}function Da(e,t,i,s=!1){if(s)for(let r=0;r<2*t;r++)e[r]=O.getValue(i+r*Float64Array.BYTES_PER_ELEMENT,"double");else{const r=e.length===0;for(let n=0;n1)){const y=O.getPointer(m);for(let g=1;g{jn(r);const n=r.getGeogtran();jn(n),n.getParameters().forEach(jn),[n.getGeogcs1(),n.getGeogcs2()].forEach(o=>{jn(o);const a=o.getDatum();jn(a),jn(a.getSpheroid()),jn(o.getPrimem()),jn(o.getUnit())})});O.PeGTlistExtendedEntry.prototype.Delete(i[0])}}e.destroy=t}(J1||(J1={})),function(e){function t(i,s,r,n,o){O.ensureCache.prepare();const a=vc(r),l=r===a,u=O.ensureFloat64(a);let d=0;n&&(d=O.ensureFloat64(n));const f=O._pe_geog_to_geog(O.getPointer(i),s,u,d,o);return f&&Da(r,s,u,l),f}e.geogToGeog=t}(X1||(X1={})),function(e){const t=(u,d,f,m,y,g)=>{let v,b;switch(O.ensureCache.prepare(),u){case"dd":v=O._pe_geog_to_dd,b=ot.PE_DD_MAX;break;case"ddm":v=O._pe_geog_to_ddm,b=ot.PE_DDM_MAX;break;case"dms":v=O._pe_geog_to_dms,b=ot.PE_DMS_MAX}let _=0;d&&(_=O.getPointer(d));const x=vc(m),$=O.ensureFloat64(x),I=gy(f,b),T=v(_,f,$,y,O.ensureInt32(I));if(T)for(let k=0;k{let g;switch(O.ensureCache.prepare(),u){case"dd":g=O._pe_dd_to_geog;break;case"ddm":g=O._pe_ddm_to_geog;break;case"dms":g=O._pe_dms_to_geog}let v=0;d&&(v=O.getPointer(d));const b=m.map(I=>O.ensureString(I)),_=O.ensureInt32(b),x=O.ensureFloat64(new Array(2*f)),$=g(v,f,_,x);return $&&Da(y,f,x),$};function s(u,d,f,m,y){return t("dms",u,d,f,m,y)}function r(u,d,f,m){return i("dms",u,d,f,m)}function n(u,d,f,m,y){return t("ddm",u,d,f,m,y)}function o(u,d,f,m){return i("ddm",u,d,f,m)}function a(u,d,f,m,y){return t("dd",u,d,f,m,y)}function l(u,d,f,m){return i("dd",u,d,f,m)}e.geogToDms=s,e.dmsToGeog=r,e.geogToDdm=n,e.ddmToGeog=o,e.geogToDd=a,e.ddToGeog=l}(Z1||(Z1={})),function(e){function t(){e.PE_MGRS_STYLE_NEW=O.PeNotationMgrs.prototype.PE_MGRS_STYLE_NEW,e.PE_MGRS_STYLE_OLD=O.PeNotationMgrs.prototype.PE_MGRS_STYLE_OLD,e.PE_MGRS_STYLE_AUTO=O.PeNotationMgrs.prototype.PE_MGRS_STYLE_AUTO,e.PE_MGRS_180_ZONE_1_PLUS=O.PeNotationMgrs.prototype.PE_MGRS_180_ZONE_1_PLUS,e.PE_MGRS_ADD_SPACES=O.PeNotationMgrs.prototype.PE_MGRS_ADD_SPACES}function i(r,n,o,a,l,u,d){O.ensureCache.prepare();let f=0;r&&(f=O.getPointer(r));const m=vc(o),y=O.ensureFloat64(m),g=gy(n,ot.PE_MGRS_MAX),v=O.ensureInt32(g),b=O._pe_geog_to_mgrs_extended(f,n,y,a,l,u,v);if(b)for(let _=0;_O.ensureString(g)),f=O.ensureInt32(d),m=O.ensureFloat64(new Array(2*n)),y=O._pe_mgrs_to_geog_extended(u,n,f,a,m);return y&&Da(l,n,m),y}e.init=t,e.geogToMgrsExtended=i,e.mgrsToGeogExtended=s}(uv||(uv={})),function(e){function t(s,r,n,o,a,l,u){O.ensureCache.prepare();let d=0;s&&(d=O.getPointer(s));const f=vc(n),m=O.ensureFloat64(f),y=gy(r,ot.PE_MGRS_MAX),g=O.ensureInt32(y),v=O._pe_geog_to_usng(d,r,m,o,a,l,g);if(v)for(let b=0;bO.ensureString(m)),u=O.ensureInt32(l),d=O.ensureFloat64(new Array(2*r)),f=O._pe_usng_to_geog(a,r,u,d);return f&&Da(o,r,d),f}e.geogToUsng=t,e.usngToGeog=i}(Q1||(Q1={})),function(e){function t(){e.PE_UTM_OPTS_NONE=O.PeNotationUtm.prototype.PE_UTM_OPTS_NONE,e.PE_UTM_OPTS_ADD_SPACES=O.PeNotationUtm.prototype.PE_UTM_OPTS_ADD_SPACES,e.PE_UTM_OPTS_NS=O.PeNotationUtm.prototype.PE_UTM_OPTS_NS}function i(r,n,o,a,l){O.ensureCache.prepare();let u=0;r&&(u=O.getPointer(r));const d=vc(o),f=O.ensureFloat64(d),m=gy(n,ot.PE_UTM_MAX),y=O.ensureInt32(m),g=O._pe_geog_to_utm(u,n,f,a,y);if(g)for(let v=0;vO.ensureString(g)),f=O.ensureInt32(d),m=O.ensureFloat64(new Array(2*n)),y=O._pe_utm_to_geog(u,n,f,a,m);return y&&Da(l,n,m),y}e.init=t,e.geogToUtm=i,e.utmToGeog=s}(hv||(hv={})),function(e){const t=new Map;function i(){e.PE_PCSINFO_OPTION_NONE=O.PePCSInfo.prototype.PE_PCSINFO_OPTION_NONE,e.PE_PCSINFO_OPTION_DOMAIN=O.PePCSInfo.prototype.PE_PCSINFO_OPTION_DOMAIN,e.PE_POLE_OUTSIDE_BOUNDARY=O.PePCSInfo.prototype.PE_POLE_OUTSIDE_BOUNDARY,e.PE_POLE_POINT=O.PePCSInfo.prototype.PE_POLE_POINT}function s(r,n=e.PE_PCSINFO_OPTION_DOMAIN){let o=null,a=null;return t.has(r)&&(a=t.get(r),a[n]&&(o=a[n])),o||(o=O.PePCSInfo.prototype.generate(r,n),a||(a=[],t.set(r,a)),a[n]=o),o}e.init=i,e.generate=s}(dv||(dv={})),function(e){function t(){return O.PeVersion.prototype.version_string()}e.versionString=t}(K1||(K1={}));const RH=Object.freeze(Object.defineProperty({__proto__:null,get _pe(){return O},isLoaded:FF,isSupported:OH,load:DF,get PeCSTransformations(){return H1},get PeDefs(){return ot},get PeFactory(){return Y1},get PeGCSExtent(){return NF},get PeGTlistExtended(){return cv},get PeGTlistExtendedEntry(){return J1},get PeGTTransformations(){return X1},get PeNotationDms(){return Z1},get PeNotationMgrs(){return uv},get PeNotationUsng(){return Q1},get PeNotationUtm(){return hv},get PePCSInfo(){return dv},get PeVersion(){return K1},_init:jF},Symbol.toStringTag,{value:"Module"}));function LH(e,t){const i=t[0]-e[0],s=t[1]-e[1];if(e.length>2&&t.length>2){const r=e[2]-t[2];return Math.sqrt(i*i+s*s+r*r)}return Math.sqrt(i*i+s*s)}function FH(e,t,i){const s=e[0]+i*(t[0]-e[0]),r=e[1]+i*(t[1]-e[1]);return e.length>2&&t.length>2?[s,r,e[2]+i*(t[2]-e[2])]:[s,r]}function DH(e,t,i,s){const[r,n]=t,[o,a]=i[s],[l,u]=i[s+1],d=l-o,f=u-a,m=d*d+f*f,y=(r-o)*d+(n-a)*f,g=Math.min(1,Math.max(0,y/m));return e[0]=o+d*g,e[1]=a+f*g,e}function sbe(e,t,i){const s=i.rings;let r,n,o=!1,a=1/0;for(let l=0;lt!=n[1]>t&&e<(n[0]-r[0])*(t-r[1])/(n[1]-r[1])+r[0]&&(o=!o),a=Math.min(a,NH(e,t,r,n))}return a===0?0:(o?1:-1)*Math.sqrt(a)}function NH(e,t,i,s){let r=i[0],n=i[1],o=s[0]-r,a=s[1]-n;if(o!==0||a!==0){const l=((e-r)*o+(t-n)*a)/(o*o+a*a);l>1?(r=s[0],n=s[1]):l>0&&(r+=o*l,n+=a*l)}return o=e-r,a=t-n,o*o+a*a}function jH(e,t){return FH(e,t,.5)}function VF(e,t,i){const s=e.length;let r=0,n=0,o=0;for(let a=0;a2&&u.length>2&&i&&(n+=l[0]*u[2]-u[0]*l[2],d=3),l.length>d&&u.length>d&&t&&(o+=l[0]*u[d]-u[0]*l[d])}return r<=0&&n<=0&&o<=0}function VH(e){const t=e.length;return t>2&&Xv(e[0],e[t-1])}function rbe(e){var t,i;if("rings"in e&&(zH(e),e.rings.length>0&&!VF(e.rings[0],(t=e.hasM)!=null?t:!1,(i=e.hasZ)!=null?i:!1)))for(const s of e.rings)s.reverse()}function zH(e){if("rings"in e)for(const t of e.rings)VH(t)||t.push(t[0].slice())}function zF(e){if(!e||e.length<3)return 0;let t=0;const i=e.length-1;for(let s=0;s{let a=n[2]-o[2];return a===0&&t&&(a=n[4]-o[4]),a}),s.length&&(i[0]=s[0][0],i[1]=s[0][1],t&&(i[2]=s[0][3]),(i[0]r[1]||i[1]r[3]||t&&(i[2]r[5]))&&(i.length=0)),!i.length){const n=e[0]&&e[0].length?qH(e[0],t):null;if(!n)return null;i[0]=n[0],i[1]=n[1],t&&n.length>2&&(i[2]=n[2])}return i}function UH(e,t,i){let s=0,r=0,n=0,o=0,a=0;const l=e.length?e[0][0]:0,u=e.length?e[0][1]:0,d=e.length&&t?e[0][2]:0;for(let m=0;m2&&g.length>2){const U=_-d,J=k-d,H=x*J-A*U;n+=(U+J)*H,a+=H}vi[1]&&(i[1]=v),bi[3]&&(i[3]=b),t&&(_i[5]&&(i[5]=_))}if(o>0&&(o*=-1),a>0&&(a*=-1),!o)return null;o*=.5,a*=.5;const f=[s/(6*o)+l,r/(6*o)+u,o];return t&&(i[4]===i[5]||a===0?(f[3]=(i[4]+i[5])/2,f[4]=0):(f[3]=n/(6*a)+d,f[4]=a)),f}function qH(e,t){const i=t?[0,0,0]:[0,0],s=t?[0,0,0]:[0,0];let r=0,n=0,o=0,a=0;for(let l=0,u=e.length;l2&&f.length>2&&(i[2]=d[2],s[2]=f[2]);const m=LH(i,s);if(m){r+=m;const y=jH(d,f);n+=m*y[0],o+=m*y[1],t&&y.length>2&&(a+=m*y[2])}}}return r>0?t?[n/r,o/r,a/r]:[n/r,o/r]:e.length?e[0]:null}const GH=1e-6;function obe(e){if(!e||!e.rings)return null;const{rings:t}=e;let i=0;for(let n=0;n2){const $=b[2];n=Ba(n,$),o=Ua(o,$)}if(s&&b.length>r){const $=b[r];a=Ba(n,$),l=Ua(o,$)}}}return i?s?(e[0]=u,e[1]=d,e[2]=n,e[3]=a,e[4]=f,e[5]=m,e[6]=o,e[7]=l,e.length=8,e):(e[0]=u,e[1]=d,e[2]=n,e[3]=f,e[4]=m,e[5]=o,e.length=6,e):s?(e[0]=u,e[1]=d,e[2]=a,e[3]=f,e[4]=m,e[5]=l,e.length=6,e):(e[0]=u,e[1]=d,e[2]=f,e[3]=m,e.length=4,e)}function JF(e,t,i,s,r,n){const o=t.xmin,a=t.xmax,l=t.ymin,u=t.ymax;let d=t.zmin,f=t.zmax,m=t.mmin,y=t.mmax;return r?(d=d||0,f=f||0,n?(m=m||0,y=y||0,e[0]=o,e[1]=l,e[2]=d,e[3]=m,e[4]=a,e[5]=u,e[6]=f,e[7]=y,e):(e[0]=o,e[1]=l,e[2]=d,e[3]=a,e[4]=u,e[5]=f,e)):n?(m=m||0,y=y||0,e[0]=o,e[1]=l,e[2]=m,e[3]=a,e[4]=u,e[5]=y,e):(e[0]=o,e[1]=l,e[2]=a,e[3]=u,e)}function M$(e,t,i,s,r,n){const o=i?3:2,a=s&&n,l=i&&r;if(!t.length||!t[0].length)return null;let u,d,f,m,[y,g]=t[0],[v,b]=t[0];for(let _=0;_2){const T=x[2];u=Ba(u,T),d=Ua(d,T)}if(a&&x.length>o){const T=x[o];f=Ba(u,T),m=Ua(d,T)}}return r?(u=u||0,d=d||0,n?(f=f||0,m=m||0,e[0]=y,e[1]=g,e[2]=u,e[3]=f,e[4]=v,e[5]=b,e[6]=d,e[7]=m,e):(e[0]=y,e[1]=g,e[2]=u,e[3]=v,e[4]=b,e[5]=d,e)):n?(f=f||0,m=m||0,e[0]=y,e[1]=g,e[2]=f,e[3]=v,e[4]=b,e[5]=m,e):(e[0]=y,e[1]=g,e[2]=v,e[3]=b,e)}function YH(e){return e.xmin!==void 0&&e.ymin!==void 0&&e.xmax!==void 0&&e.ymax!==void 0}function JH(e){return e.points!==void 0}function XH(e){return e.x!==void 0&&e.y!==void 0}function ZH(e){return e.paths!==void 0}function QH(e){return e.rings!==void 0}const $$=[];function XF(e,t,i,s){return{xmin:e,ymin:t,xmax:i,ymax:s}}function ZF(e,t,i,s,r,n){return{xmin:e,ymin:t,zmin:i,xmax:s,ymax:r,zmax:n}}function QF(e,t,i,s,r,n){return{xmin:e,ymin:t,mmin:i,xmax:s,ymax:r,mmax:n}}function KF(e,t,i,s,r,n,o,a){return{xmin:e,ymin:t,zmin:i,mmin:s,xmax:r,ymax:n,zmax:o,mmax:a}}function T$(e,t=!1,i=!1){return t?i?KF(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7]):ZF(e[0],e[1],e[2],e[3],e[4],e[5]):i?QF(e[0],e[1],e[2],e[3],e[4],e[5]):XF(e[0],e[1],e[2],e[3])}function cbe(e){return e?YH(e)?e:XH(e)?eY(e):QH(e)?eD(e):ZH(e)?tD(e):JH(e)?KH(e):null:null}function KH(e){const{hasZ:t,hasM:i,points:s}=e;return T$(M$($$,s,t!=null?t:!1,i!=null?i:!1),t,i)}function eY(e){const{x:t,y:i,z:s,m:r}=e,n=r!=null;return s!=null?n?KF(t,i,s,r,t,i,s,r):ZF(t,i,s,t,i,s):n?QF(t,i,r,t,i,r):XF(t,i,t,i)}function eD(e){const{hasZ:t,hasM:i,rings:s}=e,r=Uh($$,s,t!=null?t:!1,i!=null?i:!1);return r?T$(r,t,i):null}function tD(e){const{hasZ:t,hasM:i,paths:s}=e,r=Uh($$,s,t!=null?t:!1,i!=null?i:!1);return r?T$(r,t,i):null}var _g;function KE(e){return!Array.isArray(e[0])}let Xr=_g=class extends fl{constructor(...e){super(...e),this.rings=[],this.type="polygon"}static fromExtent(e){const t=e.clone().normalize(),i=e.spatialReference;let s=!1,r=!1;for(const o of t)o.hasZ&&(s=!0),o.hasM&&(r=!0);const n={rings:t.map(o=>{const a=[[o.xmin,o.ymin],[o.xmin,o.ymax],[o.xmax,o.ymax],[o.xmax,o.ymin],[o.xmin,o.ymin]];if(s&&o.hasZ){const l=o.zmin+.5*(o.zmax-o.zmin);for(let u=0;u2,s=n.length>3):i===void 0?i=s?n.length>3:n.length>2:s===void 0&&(s=i?n.length>3:n.length>2)),{rings:r,spatialReference:t,hasZ:i,hasM:s}}get cache(){return this.commitProperty("rings"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get centroid(){const e=BH(this);if(!e||isNaN(e[0])||isNaN(e[1])||this.hasZ&&isNaN(e[2]))return null;const t=new be;return t.x=e[0],t.y=e[1],t.spatialReference=this.spatialReference,this.hasZ&&(t.z=e[2]),t}get extent(){const{spatialReference:e}=this,t=eD(this);if(!t)return null;const i=new Ze(t);return i.spatialReference=e,i}get isSelfIntersecting(){return kH(this.rings)}writeRings(e,t){t.rings=R(this.rings)}addRing(e){if(!e)return;const t=this.rings,i=t.length;if(KE(e)){const s=[];for(let r=0,n=e.length;rr===l&&n===u&&(o==null&&d==null||o===d)&&(a==null&&f==null||a===f);for(let r=0;rthis.hasZ?this.hasM?[i.x,i.y,i.z,i.m]:[i.x,i.y,i.z]:[i.x,i.y]):e,VF(t,this.hasM,this.hasZ)}getPoint(e,t){if(!this._validateInputs(e,t))return null;const i=this.rings[e][t],s=this.hasZ,r=this.hasM;return s&&!r?new be(i[0],i[1],i[2],void 0,this.spatialReference):r&&!s?new be(i[0],i[1],void 0,i[2],this.spatialReference):s&&r?new be(i[0],i[1],i[2],i[3],this.spatialReference):new be(i[0],i[1],this.spatialReference)}insertPoint(e,t,i){return this._validateInputs(e,t,!0)?(Bh(this,i),Array.isArray(i)||(i=i.toArray()),this.rings[e].splice(t,0,i),this.notifyChange("rings"),this):this}removePoint(e,t){if(!this._validateInputs(e,t))return null;const i=new be(this.rings[e].splice(t,1)[0],this.spatialReference);return this.notifyChange("rings"),i}removeRing(e){if(!this._validateInputs(e,null))return null;const t=this.rings.splice(e,1)[0],i=this.spatialReference,s=t.map(r=>new be(r,i));return this.notifyChange("rings"),s}setPoint(e,t,i){return this._validateInputs(e,t)?(Bh(this,i),Array.isArray(i)||(i=i.toArray()),this.rings[e][t]=i,this.notifyChange("rings"),this):this}_validateInputs(e,t,i=!1){if(e==null||e<0||e>=this.rings.length)return!1;if(t!=null){const s=this.rings[e];if(i&&(t<0||t>s.length)||!i&&(t<0||t>=s.length))return!1}return!0}toJSON(e){return this.write({},e)}};c([h({readOnly:!0})],Xr.prototype,"cache",null),c([h({readOnly:!0})],Xr.prototype,"centroid",null),c([h({readOnly:!0})],Xr.prototype,"extent",null),c([h({readOnly:!0})],Xr.prototype,"isSelfIntersecting",null),c([h({type:[[[Number]]],json:{write:{isRequired:!0}}})],Xr.prototype,"rings",void 0),c([ie("rings")],Xr.prototype,"writeRings",null),Xr=_g=c([S("esri.geometry.Polygon")],Xr),Xr.prototype.toJSON.isDefaultToJSON=!0;const Oo=Xr;var ex;function tY(e){return!Array.isArray(e[0])}let oa=ex=class extends fl{constructor(...e){super(...e),this.paths=[],this.type="polyline"}normalizeCtorArgs(e,t){let i,s,r=null,n=null;return e&&!Array.isArray(e)?(r=e.paths?e.paths:null,t||(e.spatialReference?t=e.spatialReference:e.paths||(t=e)),i=e.hasZ,s=e.hasM):r=e,r=r||[],t=t||xe.WGS84,r.length&&r[0]&&r[0][0]!=null&&typeof r[0][0]=="number"&&(r=[r]),n=r[0]&&r[0][0],n&&(i===void 0&&s===void 0?(i=n.length>2,s=!1):i===void 0?i=!s&&n.length>3:s===void 0&&(s=!i&&n.length>3)),{paths:r,spatialReference:t,hasZ:i,hasM:s}}get cache(){return this.commitProperty("paths"),this.commitProperty("hasZ"),this.commitProperty("hasM"),this.commitProperty("spatialReference"),{}}get extent(){const{spatialReference:e}=this,t=tD(this);if(!t)return null;const i=new Ze(t);return i.spatialReference=e,i}writePaths(e,t){t.paths=R(this.paths)}addPath(e){if(!e)return;const t=this.paths,i=t.length;if(tY(e)){const s=[];for(let r=0,n=e.length;rnew be(r,i));return this.notifyChange("paths"),s}removePoint(e,t){if(!this._validateInputs(e,t))return null;const i=new be(this.paths[e].splice(t,1)[0],this.spatialReference);return this.notifyChange("paths"),i}setPoint(e,t,i){return this._validateInputs(e,t)?(Bh(this,i),Array.isArray(i)||(i=i.toArray()),this.paths[e][t]=i,this.notifyChange("paths"),this):this}_validateInputs(e,t,i=!1){if(e==null||e<0||e>=this.paths.length)return!1;if(t!=null){const s=this.paths[e];if(i&&(t<0||t>s.length)||!i&&(t<0||t>=s.length))return!1}return!0}toJSON(e){return this.write({},e)}};c([h({readOnly:!0})],oa.prototype,"cache",null),c([h({readOnly:!0})],oa.prototype,"extent",null),c([h({type:[[[Number]]],json:{write:{isRequired:!0}}})],oa.prototype,"paths",void 0),c([ie("paths")],oa.prototype,"writePaths",null),oa=ex=c([S("esri.geometry.Polyline")],oa),oa.prototype.toJSON.isDefaultToJSON=!0;const Ar=oa;function nl(e=nY){return[e[0],e[1],e[2],e[3]]}function ube(e){return[e[0],e[1],e[2],e[3]]}function iD(e,t){return e!==t&&(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3]),e}function hbe(e,t,i,s,r=nl()){return r[0]=e,r[1]=t,r[2]=i,r[3]=s,r}function dbe(e,t=nl()){return t[0]=e.xmin,t[1]=e.ymin,t[2]=e.xmax,t[3]=e.ymax,t}function pbe(e,t){return new Ze({xmin:e[0],ymin:e[1],xmax:e[2],ymax:e[3],spatialReference:t})}function fbe(e,t){t[0]e[2]&&(e[2]=t[0]),t[1]e[3]&&(e[3]=t[1])}function mbe(e,t,i){if(N(t))iD(i,e);else if("length"in t)tx(t)?(i[0]=Math.min(e[0],t[0]),i[1]=Math.min(e[1],t[1]),i[2]=Math.max(e[2],t[2]),i[3]=Math.max(e[3],t[3])):t.length!==2&&t.length!==3||(i[0]=Math.min(e[0],t[0]),i[1]=Math.min(e[1],t[1]),i[2]=Math.max(e[2],t[0]),i[3]=Math.max(e[3],t[1]));else switch(t.type){case"extent":i[0]=Math.min(e[0],t.xmin),i[1]=Math.min(e[1],t.ymin),i[2]=Math.max(e[2],t.xmax),i[3]=Math.max(e[3],t.ymax);break;case"point":i[0]=Math.min(e[0],t.x),i[1]=Math.min(e[1],t.y),i[2]=Math.max(e[2],t.x),i[3]=Math.max(e[3],t.y)}}function iY(e){return N(e)||e[0]>=e[2]?0:e[2]-e[0]}function sY(e){return e[1]>=e[3]?0:e[3]-e[1]}function ybe(e){return iY(e)*sY(e)}function gbe(e,t,i){return t>=e[0]&&i>=e[1]&&t<=e[2]&&i<=e[3]}function vbe(e,t,i){return t[0]>=e[0]-i&&t[1]>=e[1]-i&&t[0]<=e[2]+i&&t[1]<=e[3]+i}function bbe(e,t){return Math.max(t[0],e[0])<=Math.min(t[2],e[2])&&Math.max(t[1],e[1])<=Math.min(t[3],e[3])}function rY(e,t){return t[0]>=e[0]&&t[2]<=e[2]&&t[1]>=e[1]&&t[3]<=e[3]}function _be(e){return e?iD(e,ek):nl(ek)}function tx(e){return e!=null&&e.length===4}function wbe(e,t){return tx(e)&&tx(t)?e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]:e===t}const ek=[1/0,1/0,-1/0,-1/0],nY=[0,0,0,0],Go=it.radius,lr=it.eccentricitySquared,oY={a1:Go*lr,a2:Go*lr*Go*lr,a3:Go*lr*lr/2,a4:Go*lr*Go*lr*2.5,a5:Go*lr+Go*lr*lr/2,a6:1-lr};1/294.9786982,1/298.257222101,it.radius,it.flattening,rl.radius,rl.flattening,1/192.0430107526882,Io.radius,Io.flattening,1/10.2079945799458,1/43.61604095563141,Io.radius;let vy=0;class Ih{constructor(t){this.uid=vy++,t?(this._wkt=t.wkt!=null?t.wkt:null,this._wkid=t.wkid!=null?t.wkid:-1,this._isInverse=t.isInverse!=null&&t.isInverse===!0):(this._wkt=null,this._wkid=-1,this._isInverse=!1)}static fromGE(t){const i=new Ih;return i._wkt=t.wkt,i._wkid=t.wkid,i._isInverse=t.isInverse,i}get wkt(){return this._wkt}set wkt(t){this._wkt=t,this.uid=vy++}get wkid(){return this._wkid}set wkid(t){this._wkid=t,this.uid=vy++}get isInverse(){return this._isInverse}set isInverse(t){this._isInverse=t,this.uid=vy++}getInverse(){const t=new Ih;return t._wkt=this.wkt,t._wkid=this._wkid,t._isInverse=!this.isInverse,t}}class qa{constructor(t){if(this.steps=[],this._cachedProjection={},this._chain="",this._gtlistentry=null,t&&t.steps)for(const i of t.steps)i instanceof Ih?this.steps.push(i):this.steps.push(new Ih({wkid:i.wkid,wkt:i.wkt,isInverse:i.isInverse}))}static cacheKey(t,i){return[t.wkid!==void 0&&t.wkid!==null?t.wkid.toString():"-1",t.wkt!==void 0&&t.wkt!==null?t.wkt.toString():"",i.wkid!==void 0&&i.wkid!==null?i.wkid.toString():"-1",i.wkt!==void 0&&i.wkt!==null?i.wkt.toString():""].join(",")}static fromGE(t){const i=new qa;let s="";for(const r of t.steps){const n=Ih.fromGE(r);i.steps.push(n),s+=n.uid.toString()+","}return i._cachedProjection={},i._gtlistentry=null,i._chain=s,i}getInverse(){const t=new qa;t.steps=[];for(let i=this.steps.length-1;i>=0;i--){const s=this.steps[i];t.steps.push(s.getInverse())}return t}getGTListEntry(){let t="";for(const i of this.steps)t+=i.uid.toString()+",";return t!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=t),this._gtlistentry}assignCachedGe(t,i,s){this._cachedProjection[qa.cacheKey(t,i)]=s}getCachedGeTransformation(t,i){let s="";for(const n of this.steps)s+=n.uid.toString()+",";s!==this._chain&&(this._gtlistentry=null,this._cachedProjection={},this._chain=s);const r=this._cachedProjection[qa.cacheKey(t,i)];return r===void 0?null:r}}function sD(e,t,i){if(N(t)||N(i)||i.vcsWkid||Kt(t,i))return null;const s=Vh(t)/Vh(i);if(s===1)return null;switch(e){case"point":case"esriGeometryPoint":return r=>aY(r,s);case"polyline":case"esriGeometryPolyline":return r=>cY(r,s);case"polygon":case"esriGeometryPolygon":return r=>lY(r,s);case"multipoint":case"esriGeometryMultipoint":return r=>uY(r,s);case"extent":case"esriGeometryExtent":return r=>hY(r,s);default:return null}}function aY(e,t){e&&e.z!=null&&(e.z*=t)}function lY(e,t){if(e)for(const i of e.rings)for(const s of i)s.length>2&&(s[2]*=t)}function cY(e,t){if(e)for(const i of e.paths)for(const s of i)s.length>2&&(s[2]*=t)}function uY(e,t){if(e)for(const i of e.points)i.length>2&&(i[2]*=t)}function hY(e,t){e&&e.zmin!=null&&e.zmax!=null&&(e.zmin*=t,e.zmax*=t)}let Qa=null,Wf=null,A_=null,O_={};const rD=new S$;function ol(){return!!Qa&&FF()}function al(e){return N(A_)&&(A_=Promise.all([DF(),z(()=>import("./geometryEngineBase.82b25ca5.js"),[]).then(t=>t.g),z(()=>import("./hydrated.406495cb.js"),[])])),A_.then(([,t,{hydratedAdapter:i}])=>{Ft(e),Wf=i,Qa=t.default,Qa._enableProjection(RH),rD.notify()})}function hd(e,t,i=null,s=null){return Array.isArray(e)?e.length===0?[]:tk(Wf,e,e[0].spatialReference,t,i,s):tk(Wf,[e],e.spatialReference,t,i,s)[0]}function tk(e,t,i,s,r=null,n=null){if(N(i)||N(s))return t;if(Ro(i,s,r))return t.map(o=>mY(o,i,s));if(N(r)){const o=qa.cacheKey(i,s);O_[o]!==void 0?r=O_[o]:(r=pY(i,s,void 0),N(r)&&(r=new qa),O_[o]=r)}if(N(Qa)||N(e))throw new I$;return M(n)?Qa._project(e,t,i,s,r,n):Qa._project(e,t,i,s,r)}function xbe(e,t){const i=dY([e],t);return M(i.pending)?{pending:i.pending,geometry:null}:M(i.geometries)?{pending:null,geometry:i.geometries[0]}:{pending:null,geometry:null}}function dY(e,t){if(!ol()){for(const i of e)if(M(i)&&!Kt(i.spatialReference,t)&&ci(i.spatialReference)&&ci(t)&&!Ro(i.spatialReference,t))return _e(rD),{pending:al(),geometries:null}}return{pending:null,geometries:e.map(i=>N(i)?null:Kt(i.spatialReference,t)?i:ci(i.spatialReference)&&ci(t)?fY(i,t):null)}}function pY(e,t,i=null){if(N(e)||N(t))return null;if(N(Qa)||N(Wf))throw new I$;const s=Qa._getTransformation(Wf,e,t,i,i==null?void 0:i.spatialReference);return s!==null?qa.fromGE(s):null}class I$ extends L{constructor(){super("projection:not-loaded","projection engine not fully loaded yet, please call load()")}}var C;(function(e){e[e.UNKNOWN=0]="UNKNOWN",e[e.SPHERICAL_ECEF=1]="SPHERICAL_ECEF",e[e.WGS84=2]="WGS84",e[e.WEB_MERCATOR=3]="WEB_MERCATOR",e[e.WGS84_ECEF=4]="WGS84_ECEF",e[e.CGCS2000=5]="CGCS2000",e[e.WGS84_COMPARABLE_LON_LAT=6]="WGS84_COMPARABLE_LON_LAT",e[e.SPHERICAL_MARS_PCPF=7]="SPHERICAL_MARS_PCPF",e[e.GCSMARS2000=8]="GCSMARS2000",e[e.SPHERICAL_MOON_PCPF=9]="SPHERICAL_MOON_PCPF",e[e.GCSMOON2000=10]="GCSMOON2000",e[e.LON_LAT=11]="LON_LAT",e[e.PLATE_CARREE=12]="PLATE_CARREE"})(C||(C={}));function fY(e,t){try{const i=hd(e,t);if(i==null)return null;"xmin"in e&&"xmin"in i&&(i.zmin=e.zmin,i.zmax=e.zmax);const s=sD(i.type,e.spatialReference,t);return M(s)&&s(i),i}catch(i){if(!(i instanceof I$))throw i;return null}}function Ro(e,t,i){return!i&&(!!Kt(e,t)||ci(e)&&ci(t)&&!!lD(e,t,cD))}async function Sbe(e,t,i,s){if(ol())return QI(s);if(Array.isArray(e)){for(const{source:r,dest:n,geographicTransformation:o}of e)if(!Ro(r,n,o))return al(s)}else if(!Ro(e,t,i))return al(s);return QI(s)}function mY(e,t,i){return e?"x"in e?yY(e,t,new be,i,0):"xmin"in e?bY(e,t,new Ze,i,0):"rings"in e?nD(e,t,new Oo,i,0):"paths"in e?vY(e,t,new Ar,i,0):"points"in e?gY(e,t,new wb,i,0):null:null}function yY(e,t,i,s,r){zt[0]=e.x,zt[1]=e.y;const n=e.z;return zt[2]=n!==void 0?n:r,Am(zt,t,0,zt,s,0,1)?(i.x=zt[0],i.y=zt[1],i.spatialReference=s,n===void 0?(i.z=void 0,i.hasZ=!1):(i.z=zt[2],i.hasZ=!0),e.m===void 0?(i.m=void 0,i.hasM=!1):(i.m=e.m,i.hasM=!0),i):null}function gY(e,t,i,s,r){const{points:n,hasZ:o,hasM:a}=e,l=[],u=n.length,d=[];for(const f of n)d.push(f[0],f[1],o?f[2]:r);if(!Am(d,t,0,d,s,0,u))return null;for(let f=0;f.3?(v=l/m*(1+g*(r.a1+T+y*k)/m),U=Math.asin(v),_=v*v,b=Math.sqrt(1-_)):(b=d/m*(1-y*(r.a5-T-g*k)/m),U=Math.acos(b),_=1-b*b,v=Math.sqrt(_)),x=1-it.eccentricitySquared*_,$=it.radius/Math.sqrt(x),I=r.a6*$,T=d-$*b,k=l-I*v,F=b*T+v*k,A=b*k-v*T,G=A/(I/x+F),U+=G,H=F+A*G/2,a<0&&(U=-U),i[s++]=qh*J,i[s++]=qh*U,i[s]=H}function OY(e,t,i,s){Cc(e,t,i,s),Ic(i,s,i,s)}function RY(e,t,i,s){Cc(e,t,i,s),Hf(i,s,i,s)}const ap={[C.WGS84]:{[C.CGCS2000]:null,[C.GCSMARS2000]:null,[C.GCSMOON2000]:null,[C.LON_LAT]:He,[C.WGS84_COMPARABLE_LON_LAT]:He,[C.SPHERICAL_ECEF]:Ic,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:Hf,[C.PLATE_CARREE]:$c,[C.WGS84]:He,[C.WGS84_ECEF]:kc},[C.CGCS2000]:{[C.CGCS2000]:He,[C.GCSMARS2000]:null,[C.GCSMOON2000]:null,[C.LON_LAT]:He,[C.WGS84_COMPARABLE_LON_LAT]:He,[C.SPHERICAL_ECEF]:Ic,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:null,[C.PLATE_CARREE]:$c,[C.WGS84]:null,[C.WGS84_ECEF]:kc},[C.GCSMARS2000]:{[C.CGCS2000]:null,[C.GCSMARS2000]:He,[C.GCSMOON2000]:null,[C.LON_LAT]:He,[C.WGS84_COMPARABLE_LON_LAT]:null,[C.SPHERICAL_ECEF]:null,[C.SPHERICAL_MARS_PCPF]:ak,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:null,[C.PLATE_CARREE]:null,[C.WGS84]:null,[C.WGS84_ECEF]:null},[C.GCSMOON2000]:{[C.CGCS2000]:null,[C.GCSMARS2000]:null,[C.GCSMOON2000]:He,[C.LON_LAT]:He,[C.WGS84_COMPARABLE_LON_LAT]:null,[C.SPHERICAL_ECEF]:null,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:ok,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:null,[C.PLATE_CARREE]:null,[C.WGS84]:null,[C.WGS84_ECEF]:null},[C.WEB_MERCATOR]:{[C.CGCS2000]:null,[C.GCSMARS2000]:null,[C.GCSMOON2000]:null,[C.LON_LAT]:Eh,[C.WGS84_COMPARABLE_LON_LAT]:Eh,[C.SPHERICAL_ECEF]:wY,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:He,[C.PLATE_CARREE]:MY,[C.WGS84]:Eh,[C.WGS84_ECEF]:xY},[C.WGS84_ECEF]:{[C.CGCS2000]:Cc,[C.GCSMARS2000]:null,[C.GCSMOON2000]:null,[C.LON_LAT]:Cc,[C.WGS84_COMPARABLE_LON_LAT]:Cc,[C.SPHERICAL_ECEF]:OY,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:RY,[C.PLATE_CARREE]:$Y,[C.WGS84]:Cc,[C.WGS84_ECEF]:He},[C.SPHERICAL_ECEF]:{[C.CGCS2000]:Ec,[C.GCSMARS2000]:null,[C.GCSMOON2000]:null,[C.LON_LAT]:Ec,[C.WGS84_COMPARABLE_LON_LAT]:Ec,[C.SPHERICAL_ECEF]:He,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:CY,[C.PLATE_CARREE]:TY,[C.WGS84]:Ec,[C.WGS84_ECEF]:PY},[C.SPHERICAL_MARS_PCPF]:{[C.CGCS2000]:null,[C.GCSMARS2000]:ck,[C.GCSMOON2000]:null,[C.LON_LAT]:ck,[C.WGS84_COMPARABLE_LON_LAT]:null,[C.SPHERICAL_ECEF]:null,[C.SPHERICAL_MARS_PCPF]:He,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:null,[C.PLATE_CARREE]:null,[C.WGS84]:null,[C.WGS84_ECEF]:null},[C.SPHERICAL_MOON_PCPF]:{[C.CGCS2000]:null,[C.GCSMARS2000]:null,[C.GCSMOON2000]:lk,[C.LON_LAT]:lk,[C.WGS84_COMPARABLE_LON_LAT]:null,[C.SPHERICAL_ECEF]:null,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:He,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:null,[C.PLATE_CARREE]:null,[C.WGS84]:null,[C.WGS84_ECEF]:null},[C.UNKNOWN]:{[C.CGCS2000]:null,[C.GCSMARS2000]:null,[C.GCSMOON2000]:null,[C.LON_LAT]:null,[C.WGS84_COMPARABLE_LON_LAT]:null,[C.SPHERICAL_ECEF]:null,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:He,[C.WEB_MERCATOR]:null,[C.PLATE_CARREE]:null,[C.WGS84]:null,[C.WGS84_ECEF]:null},[C.LON_LAT]:{[C.CGCS2000]:He,[C.GCSMARS2000]:He,[C.GCSMOON2000]:He,[C.LON_LAT]:He,[C.WGS84_COMPARABLE_LON_LAT]:He,[C.SPHERICAL_ECEF]:Ic,[C.SPHERICAL_MARS_PCPF]:ak,[C.SPHERICAL_MOON_PCPF]:ok,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:Hf,[C.PLATE_CARREE]:$c,[C.WGS84]:He,[C.WGS84_ECEF]:kc},[C.WGS84_COMPARABLE_LON_LAT]:{[C.CGCS2000]:null,[C.GCSMARS2000]:null,[C.GCSMOON2000]:null,[C.LON_LAT]:He,[C.WGS84_COMPARABLE_LON_LAT]:He,[C.SPHERICAL_ECEF]:Ic,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:null,[C.PLATE_CARREE]:$c,[C.WGS84]:He,[C.WGS84_ECEF]:kc},[C.PLATE_CARREE]:{[C.CGCS2000]:Tc,[C.GCSMARS2000]:null,[C.GCSMOON2000]:null,[C.LON_LAT]:Tc,[C.WGS84_COMPARABLE_LON_LAT]:Tc,[C.SPHERICAL_ECEF]:IY,[C.SPHERICAL_MARS_PCPF]:null,[C.SPHERICAL_MOON_PCPF]:null,[C.UNKNOWN]:null,[C.WEB_MERCATOR]:EY,[C.PLATE_CARREE]:He,[C.WGS84]:Tc,[C.WGS84_ECEF]:kY}};function lD(e,t,i=C$()){return N(e)||N(t)?null:LY(e,t,i).projector}function LY(e,t,i){if(N(e)||N(t)||i.source.spatialReference===e&&i.dest.spatialReference===t)return i;const s=pv(e,i.source),r=pv(t,i.dest);return s===C.UNKNOWN&&r===C.UNKNOWN?Kt(e,t)?i.projector=He:i.projector=null:i.projector=ap[s][r],i}function C$(){return{source:{spatialReference:null,spatialReferenceId:C.UNKNOWN,metersPerUnit:1},dest:{spatialReference:null,spatialReferenceId:C.UNKNOWN,metersPerUnit:1},projector:He}}const FY={spatialReference:null,spatialReferenceId:C.UNKNOWN},DY={spatialReference:null,spatialReferenceId:C.UNKNOWN},cD=C$();C$();const Sn=WG(1),qh=cF(1),by=On(),Wo=On(),Ho=On(),zt=On();async function NY(e){if(!e)return;const t=e.includes("-vector")?e.slice(0,e.indexOf("-vector")):e,i=await uR("esri/t9n/basemaps");return i[e]||i[t]}const Gh={streets:{id:"streets",classic:!0,deprecated:!0,get thumbnailUrl(){return Ne("esri/images/basemap/streets.jpg")},baseMapLayers:[{id:"streets-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Street Map",showLegend:!1,visibility:!0,opacity:1}]},satellite:{id:"satellite",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/satellite.jpg")},baseMapLayers:[{id:"satellite-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1}]},hybrid:{id:"hybrid",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/hybrid.jpg")},baseMapLayers:[{id:"hybrid-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Imagery",showLegend:!1,visibility:!0,opacity:1},{id:"hybrid-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/30d6b8271e1849cd9c3042060001f425/resources/styles/root.json",layerType:"VectorTileLayer",title:"Hybrid Reference Layer",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},terrain:{id:"terrain",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/terrain.jpg")},baseMapLayers:[{id:"terrain-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Terrain_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Terrain Base",showLegend:!1,visibility:!0,opacity:1},{id:"terrain-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Reference_Overlay/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Reference Overlay",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},topo:{id:"topo",classic:!0,deprecated:!0,get thumbnailUrl(){return Ne("esri/images/basemap/topo.jpg")},baseMapLayers:[{id:"topo-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Topo Map",showLegend:!1,visibility:!0,opacity:1}]},gray:{id:"gray",classic:!0,deprecated:!0,get thumbnailUrl(){return Ne("esri/images/basemap/gray.jpg")},baseMapLayers:[{id:"gray-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Light Gray Base",showLegend:!1,visibility:!0,opacity:1},{id:"gray-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Light_Gray_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Light Gray Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},"dark-gray":{id:"dark-gray",classic:!0,deprecated:!0,get thumbnailUrl(){return Ne("esri/images/basemap/dark-gray.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Dark Gray Base",showLegend:!1,visibility:!0,opacity:1},{id:"dark-gray-reference-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/Canvas/World_Dark_Gray_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Dark Gray Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},oceans:{id:"oceans",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/oceans.jpg")},baseMapLayers:[{id:"oceans-base-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Base",showLegend:!1,visibility:!0,opacity:1},{id:"oceans-reference-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Ocean/World_Ocean_Reference/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Ocean Reference",isReference:!0,showLegend:!1,visibility:!0,opacity:1}]},"national-geographic":{id:"national-geographic",classic:!0,deprecated:!0,get thumbnailUrl(){return Ne("esri/images/basemap/national-geographic.jpg")},baseMapLayers:[{id:"national-geographic-base-layer",url:"//services.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer",title:"NatGeo World Map",showLegend:!1,layerType:"ArcGISTiledMapServiceLayer",visibility:!0,opacity:1}]},osm:{id:"osm",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/osm.jpg")},baseMapLayers:[{id:"osm-base-layer",layerType:"OpenStreetMap",title:"Open Street Map",showLegend:!1,visibility:!0,opacity:1}]},"dark-gray-vector":{id:"dark-gray-vector",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/dark-gray-vector.jpg")},baseMapLayers:[{id:"dark-gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/5e9b3685f4c24d8781073dd928ebda50/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Base",visibility:!0,opacity:1},{id:"dark-gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/747cb7a5329c478cbe6981076cc879c5/resources/styles/root.json",layerType:"VectorTileLayer",title:"Dark Gray Reference",isReference:!0,visibility:!0,opacity:1}]},"gray-vector":{id:"gray-vector",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/gray-vector.jpg")},baseMapLayers:[{id:"gray-base-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/291da5eab3a0412593b66d384379f89f/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Base",visibility:!0,opacity:1},{id:"gray-reference-layer",styleUrl:"https://cdn.arcgis.com/sharing/rest/content/items/1768e8369a214dfab4e2167d5c5f2454/resources/styles/root.json",layerType:"VectorTileLayer",title:"Light Gray Reference",isReference:!0,visibility:!0,opacity:1}]},"streets-vector":{id:"streets-vector",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/streets-vector.jpg")},baseMapLayers:[{id:"streets-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/de26a3cf4cc9451298ea173c4b324736/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets",visibility:!0,opacity:1}]},"topo-vector":{id:"topo-vector",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/topo-vector.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"topo-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/7dc6cea0b1764a1f9af2e679f642f0f5/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Topo",visibility:!0,opacity:1}]},"streets-night-vector":{id:"streets-night-vector",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/streets-night.jpg")},baseMapLayers:[{id:"streets-night-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/86f556a2d1fd468181855a35e344567f/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Night",visibility:!0,opacity:1}]},"streets-relief-vector":{id:"streets-relief-vector",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/streets-relief.jpg")},baseMapLayers:[{id:"world-hillshade-layer",url:"//services.arcgisonline.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer",layerType:"ArcGISTiledMapServiceLayer",title:"World Hillshade",showLegend:!1,visibility:!0,opacity:1},{id:"streets-relief-vector-base-layer",styleUrl:"//www.arcgis.com/sharing/rest/content/items/b266e6d17fc345b498345613930fbd76/resources/styles/root.json",title:"World Streets Relief",layerType:"VectorTileLayer",visibility:!0,opacity:1}]},"streets-navigation-vector":{id:"streets-navigation-vector",classic:!0,get thumbnailUrl(){return Ne("esri/images/basemap/streets-navigation.jpg")},baseMapLayers:[{id:"streets-navigation-vector-base-layer",styleUrl:"//cdn.arcgis.com/sharing/rest/content/items/63c47b7177f946b49902c24129b87252/resources/styles/root.json",layerType:"VectorTileLayer",title:"World Streets Navigation",visibility:!0,opacity:1}]},"arcgis-imagery":{get thumbnailUrl(){return Ne("esri/images/basemap/hybrid.jpg")},title:"Imagery Hybrid",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-imagery-standard":{get thumbnailUrl(){return Ne("esri/images/basemap/satellite.jpg")},title:"Imagery",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Imagery",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/World_Imagery/MapServer"}]},"arcgis-imagery-labels":{title:"Hybrid [Reference]",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Imagery:Labels",title:"Hybrid Reference Layer",isReference:!0}]},"arcgis-light-gray":{get thumbnailUrl(){return Ne("esri/images/basemap/gray-vector.jpg")},title:"Light Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Base",title:"Light Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:LightGray:Labels",title:"Light Gray Canvas Labels",isReference:!0}]},"arcgis-dark-gray":{get thumbnailUrl(){return Ne("esri/images/basemap/dark-gray.jpg")},title:"Dark Gray Canvas",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Base",title:"Dark Gray Canvas Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:DarkGray:Labels",title:"Dark Gray Canvas Labels",isReference:!0}]},"arcgis-navigation":{get thumbnailUrl(){return Ne("esri/images/basemap/streets-navigation.jpg")},title:"Navigation",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Navigation",title:"World Navigation Map"}]},"arcgis-navigation-night":{title:"Navigation (Dark Mode)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:NavigationNight",title:"World Navigation Map (Dark Mode)"}]},"arcgis-streets":{get thumbnailUrl(){return Ne("esri/images/basemap/streets-vector.jpg")},title:"Streets",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Streets",title:"World Street Map"}]},"arcgis-streets-night":{get thumbnailUrl(){return Ne("esri/images/basemap/streets-night.jpg")},title:"Streets (Night)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsNight",title:"World Street Map (Night)"}]},"arcgis-streets-relief":{get thumbnailUrl(){return Ne("esri/images/basemap/streets-relief.jpg")},title:"Streets (with Relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:StreetsRelief:Base",title:"World Street Map (with Relief)"}]},"arcgis-topographic":{get thumbnailUrl(){return Ne("esri/images/basemap/topo.jpg")},title:"Topographic",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Topographic:Base",title:"World Topographic Map"}]},"arcgis-oceans":{get thumbnailUrl(){return Ne("esri/images/basemap/oceans.jpg")},title:"Oceans",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Ocean Base",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Ocean/World_Ocean_Base/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Oceans:Labels",title:"World Ocean Reference",isReference:!0}]},"osm-standard":{title:"OpenStreetMap",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Standard",title:"OpenStreetMap"}]},"osm-standard-relief":{title:"OpenStreetMap (with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StandardRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-streets":{title:"OpenStreetMap (Streets)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:Streets",title:"OpenStreetMap (Streets)"}]},"osm-streets-relief":{title:"OpenStreetMap (Streets with relief)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:StreetsRelief:Base",layerType:"VectorTileLayer",title:"OpenStreetMap Relief Base"}]},"osm-light-gray":{title:"OpenStreetMap (Light Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Base",title:"OSM (Light Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:LightGray:Labels",title:"OSM (Light Gray Reference)",isReference:!0}]},"osm-dark-gray":{title:"OpenStreetMap (Dark Gray Canvas)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Base",title:"OSM (Dark Gray Base)"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/OSM:DarkGray:Labels",title:"OSM (Dark Gray Reference)",isReference:!0}]},"arcgis-terrain":{title:"Terrain with Labels",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Base",title:"World Terrain Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Terrain:Detail",title:"World Terrain Reference",isReference:!0}]},"arcgis-community":{title:"Community",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Community",title:"Community"}]},"arcgis-charted-territory":{title:"Charted Territory",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ChartedTerritory:Base",title:"Charted Territory"}]},"arcgis-colored-pencil":{title:"Colored Pencil",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ColoredPencil",title:"Colored Pencil"}]},"arcgis-nova":{title:"Nova",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Nova",title:"Nova"}]},"arcgis-modern-antique":{title:"Modern Antique",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:ModernAntique:Base",title:"Modern Antique"}]},"arcgis-midcentury":{title:"Mid-Century",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Midcentury",title:"Mid-Century"}]},"arcgis-newspaper":{title:"Newspaper",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:Newspaper",title:"Newspaper"}]},"arcgis-hillshade-light":{title:"Hillshade",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade/MapServer"}]},"arcgis-hillshade-dark":{title:"Hillshade (Dark)",baseMapLayers:[{layerType:"ArcGISTiledMapServiceLayer",showLegend:!1,title:"World Hillshade (Dark)",url:"https://ibasemaps-api.arcgis.com/arcgis/rest/services/Elevation/World_Hillshade_Dark/MapServer"}]},"arcgis-human-geography":{title:"Human Geography",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Base",title:"Human Geography Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Detail",title:"Human Geography Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeography:Label",title:"Human Geography Label",isReference:!0}]},"arcgis-human-geography-dark":{title:"Human Geography (Dark)",baseMapLayers:[{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Base",title:"Human Geography Dark Base"},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Detail",title:"Human Geography Dark Detail",isReference:!0},{layerType:"VectorTileLayer",styleUrl:"https://basemaps-api.arcgis.com/arcgis/rest/services/styles/ArcGIS:HumanGeographyDark:Label",title:"Human Geography Dark Label",isReference:!0}]}};var ze;(function(e){e[e.ADD=1]="ADD",e[e.REMOVE=2]="REMOVE",e[e.MOVE=4]="MOVE"})(ze||(ze={}));function P$(e){return(t,i)=>{t[i]=e}}var yo;class jY{constructor(){this.target=null,this.cancellable=!1,this.defaultPrevented=!1,this.item=void 0,this.type=void 0}preventDefault(){this.cancellable&&(this.defaultPrevented=!0)}reset(t){this.defaultPrevented=!1,this.item=t}}const Cs=new zr(jY,void 0,e=>{e.item=null,e.target=null,e.defaultPrevented=!1,e.cancellable=!1}),VY=()=>{};function R_(e){return e?e instanceof bc?e.toArray():e.length?Array.prototype.slice.apply(e):[]:[]}function L_(e){if(e&&e.length)return e[0]}function zY(e,t,i,s){const r=Math.min(e.length-i,t.length-s);let n=0;for(;n{e.push(r),uD(e,i.call(s,r,n,o),i,s)})}const Yo=new Set,Jo=new Set,Xo=new Set,F_=new Map;let BY=0,bc=yo=class extends jo.EventedAccessor{constructor(e){super(e),this._chgListeners=[],this._notifications=null,this._timer=null,this._observable=new S$,this.length=0,this._items=[],Object.defineProperty(this,"uid",{value:BY++})}static isCollection(e){return e!=null&&e instanceof yo}normalizeCtorArgs(e){return e?Array.isArray(e)||e instanceof yo?{items:e}:e:{}}destroy(){this.removeAll()}*[Symbol.iterator](){yield*this.items}get items(){return _e(this._observable),this._items}set items(e){this._emitBeforeChanges(ze.ADD)||(this._splice(0,this.length,R_(e)),this._emitAfterChanges(ze.ADD))}hasEventListener(e){return e==="change"?this._chgListeners.length>0:this._emitter.hasEventListener(e)}on(e,t){if(e==="change"){const i=this._chgListeners,s={removed:!1,callback:t};return i.push(s),this._notifications&&this._notifications.push({listeners:i.slice(),items:this._items.slice(),changes:[]}),{remove(){this.remove=VY,s.removed=!0,i.splice(i.indexOf(s),1)}}}return this._emitter.on(e,t)}once(e,t){const i=this.on(e,t);return{remove(){i.remove()}}}add(e,t){if(_e(this._observable),this._emitBeforeChanges(ze.ADD))return this;const i=this.getNextIndex(t!=null?t:null);return this._splice(i,0,[e]),this._emitAfterChanges(ze.ADD),this}addMany(e,t=this._items.length){if(_e(this._observable),!e||!e.length)return this;if(this._emitBeforeChanges(ze.ADD))return this;const i=this.getNextIndex(t);return this._splice(i,0,R_(e)),this._emitAfterChanges(ze.ADD),this}at(e){if(_e(this._observable),(e=Math.trunc(e)||0)<0&&(e+=this.length),!(e<0||e>=this.length))return this._items[e]}removeAll(){if(_e(this._observable),!this.length||this._emitBeforeChanges(ze.REMOVE))return[];const e=this._splice(0,this.length)||[];return this._emitAfterChanges(ze.REMOVE),e}clone(){return _e(this._observable),this._createNewInstance({items:this._items.map(R)})}concat(...e){_e(this._observable);const t=e.map(R_);return this._createNewInstance({items:this._items.concat(...t)})}drain(e,t){if(_e(this._observable),!this.length||this._emitBeforeChanges(ze.REMOVE))return;const i=this._splice(0,this.length),s=i.length;for(let r=0;rt&&(e=t),e}includes(e,t=0){return _e(this._observable),this._items.includes(e,t)}indexOf(e,t=0){return _e(this._observable),this._items.indexOf(e,t)}join(e=","){return _e(this._observable),this._items.join(e)}lastIndexOf(e,t=this.length-1){return _e(this._observable),this._items.lastIndexOf(e,t)}map(e,t){_e(this._observable);const i=this._items.map(e,t);return new yo({items:i})}reorder(e,t=this.length-1){_e(this._observable);const i=this.indexOf(e);if(i!==-1){if(t<0?t=0:t>=this.length&&(t=this.length-1),i!==t){if(this._emitBeforeChanges(ze.MOVE))return e;this._splice(i,1),this._splice(t,0,[e]),this._emitAfterChanges(ze.MOVE)}return e}}pop(){if(_e(this._observable),!this.length||this._emitBeforeChanges(ze.REMOVE))return;const e=L_(this._splice(this.length-1,1));return this._emitAfterChanges(ze.REMOVE),e}push(...e){return _e(this._observable),this._emitBeforeChanges(ze.ADD)||(this._splice(this.length,0,e),this._emitAfterChanges(ze.ADD)),this.length}reduce(e,t){_e(this._observable);const i=this._items;return arguments.length===2?i.reduce(e,t):i.reduce(e)}reduceRight(e,t){_e(this._observable);const i=this._items;return arguments.length===2?i.reduceRight(e,t):i.reduceRight(e)}remove(e){return _e(this._observable),this.removeAt(this.indexOf(e))}removeAt(e){if(_e(this._observable),e<0||e>=this.length||this._emitBeforeChanges(ze.REMOVE))return;const t=L_(this._splice(e,1));return this._emitAfterChanges(ze.REMOVE),t}removeMany(e){if(_e(this._observable),!e||!e.length||this._emitBeforeChanges(ze.REMOVE))return[];const t=e instanceof yo?e.toArray():e,i=this._items,s=[],r=t.length;for(let n=0;n-1){const l=1+zY(t,i,n+1,a+1),u=this._splice(a,l);u&&u.length>0&&s.push.apply(s,u),n+=l-1}}return this._emitAfterChanges(ze.REMOVE),s}reverse(){if(_e(this._observable),this._emitBeforeChanges(ze.MOVE))return this;const e=this._splice(0,this.length);return e&&(e.reverse(),this._splice(0,0,e)),this._emitAfterChanges(ze.MOVE),this}shift(){if(_e(this._observable),!this.length||this._emitBeforeChanges(ze.REMOVE))return;const e=L_(this._splice(0,1));return this._emitAfterChanges(ze.REMOVE),e}slice(e=0,t=this.length){return _e(this._observable),this._createNewInstance({items:this._items.slice(e,t)})}some(e,t){return _e(this._observable),this._items.some(e,t)}sort(e){if(_e(this._observable),!this.length||this._emitBeforeChanges(ze.MOVE))return this;const t=this._splice(0,this.length);return arguments.length?t.sort(e):t.sort(),this._splice(0,0,t),this._emitAfterChanges(ze.MOVE),this}splice(e,t,...i){_e(this._observable);const s=(t?ze.REMOVE:0)|(i.length?ze.ADD:0);if(this._emitBeforeChanges(s))return[];const r=this._splice(e,t,i)||[];return this._emitAfterChanges(s),r}toArray(){return _e(this._observable),this._items.slice()}toJSON(){return _e(this._observable),this.toArray()}toLocaleString(){return _e(this._observable),this._items.toLocaleString()}toString(){return _e(this._observable),this._items.toString()}unshift(...e){return _e(this._observable),!e.length||this._emitBeforeChanges(ze.ADD)||(this._splice(0,0,e),this._emitAfterChanges(ze.ADD)),this.length}_createNewInstance(e){return new this.constructor(e)}_splice(e,t,i){const s=this._items,r=this.itemType;let n,o;if(!this._notifications&&this.hasEventListener("change")&&(this._notifications=[{listeners:this._chgListeners.slice(),items:this._items.slice(),changes:[]}],this._timer&&this._timer.remove(),this._timer=ad(()=>this._dispatchChange())),t){if(o=s.splice(e,t),this.hasEventListener("before-remove")){const a=Cs.acquire();a.target=this,a.cancellable=!0;for(let l=0,u=o.length;l{s.push(l)});const r=Vi.acquire();Jo.forEach(l=>{r.push(l)});const n=this._items,o=t.items,a=Vi.acquire();if(Xo.forEach(l=>{o.indexOf(l)!==n.indexOf(l)&&a.push(l)}),t.listeners&&(s.length||r.length||a.length)){const l={target:this,added:s,removed:r,moved:a},u=t.listeners.length;for(let d=0;d{if(!e)return yo;if(F_.has(e))return F_.get(e);let t=null;if(typeof e=="function")t=e.prototype.declaredClass;else if(e.base)t=e.base.prototype.declaredClass;else for(const s in e.typeMap){const r=e.typeMap[s].prototype.declaredClass;t?t+=` | ${r}`:t=r}let i=class extends yo{};return c([P$({Type:e,ensureType:typeof e=="function"?Dt(e):En(e)})],i.prototype,"itemType",void 0),i=c([S(`esri.core.Collection<${t}>`)],i),F_.set(e,i),i},c([h()],bc.prototype,"length",void 0),c([h()],bc.prototype,"items",null),bc=yo=c([S("esri.core.Collection")],bc);const he=bc;function ou(e,t,i=he){return t||(t=new i),t===e||(t.removeAll(),UY(e)?t.addMany(e):e&&t.add(e)),t}function hD(e){return e}function UY(e){return e&&(Array.isArray(e)||"items"in e&&Array.isArray(e.items))}const qY="not-loaded",GY="loading",WY="failed",uk="loaded",dD=e=>{let t=class extends e{constructor(...i){super(...i),this._loadController=null,this.loadError=null,this.loadStatus="not-loaded",this._set("loadWarnings",[]),this.addResolvingPromise(new Promise(s=>{const r=this.load.bind(this);this.load=n=>{const o=new Promise((a,l)=>{const u=JM(n,l);this.destroyed&&l(new L("load:instance-destroyed",`Instance of '${this.declaredClass||this.constructor.name}' is already destroyed`,{instance:this})),this._promiseProps.when(a,l).finally(()=>{u&&u.remove()})});if(this.loadStatus===qY){this._set("loadStatus",GY);const a=this._loadController=new AbortController;r({signal:a.signal}),Vr(a.signal,()=>{this._promiseProps.abort()})}return s(),o}})),this.when(()=>{this._set("loadStatus",uk),this._loadController=null},s=>{this._set("loadStatus",WY),this._set("loadError",s),this._loadController=null})}get loaded(){return this.loadStatus===uk}get loadWarnings(){return this._get("loadWarnings")}load(){return null}cancelLoad(){var i;return this.isFulfilled()||(this._set("loadError",new L("load:cancelled","Cancelled")),(i=this._loadController)==null||i.abort()),this}};return c([h({readOnly:!0})],t.prototype,"loaded",null),c([h({readOnly:!0})],t.prototype,"loadError",void 0),c([h({clonable:!1})],t.prototype,"loadStatus",void 0),c([h({type:[Bi],readOnly:!0})],t.prototype,"loadWarnings",null),t=c([S("esri.core.Loadable")],t),t};let lp=class extends dD(J0){};lp=c([S("esri.core.Loadable")],lp),function(e){function t(i){return!(!i||!i.load)}e.LoadableMixin=dD,e.isLoadable=t}(lp||(lp={}));const Lo=lp;function HY(e,t,i){return as(e.map((s,r)=>t.apply(i,[s,r])))}async function YY(e,t,i){return(await as(e.map((s,r)=>t.apply(i,[s,r])))).map(s=>s.value)}function A$(e){return{ok:!0,value:e}}function O$(e){return{ok:!1,error:e}}function JY(e){return M(e)&&e.ok===!0?e.value:null}function XY(e){return M(e)&&e.ok===!1?e.error:null}async function xb(e){if(N(e))return{ok:!1,error:new Error("no promise provided")};try{return A$(await e)}catch(t){return O$(t)}}async function Ibe(e){try{return A$(await e)}catch(t){return Em(t),O$(t)}}function pD(e,t){return new aa(e,t)}let aa=class extends oe{constructor(e,t){super({}),this._result=null,this._abortHandle=null,this.abort=()=>{this._abortController=k0(this._abortController)},this.remove=this.abort,this._abortController=new AbortController;const{signal:i}=this._abortController;this.promise=e(i),this.promise.then(s=>{this._result=A$(s),this._cleanup()},s=>{this._result=O$(s),this._cleanup()}),this._abortHandle=Vr(t,this.abort)}get value(){return JY(this._result)}get error(){return XY(this._result)}get finished(){return M(this._result)}normalizeCtorArgs(){return{}}destroy(){this.abort()}_cleanup(){this._abortHandle=Bt(this._abortHandle),this._abortController=null}};c([h()],aa.prototype,"value",null),c([h()],aa.prototype,"error",null),c([h()],aa.prototype,"finished",null),c([h()],aa.prototype,"promise",void 0),c([h()],aa.prototype,"_result",void 0),aa=c([S("esri.core.asyncUtils.ReactiveTask")],aa);async function fD(e,t){return await e.load(),ZY(e,t)}async function ZY(e,t){const i=[],s=(...n)=>{for(const o of n)N(o)||(Array.isArray(o)?s(...o):he.isCollection(o)?o.forEach(a=>s(a)):Lo.isLoadable(o)&&i.push(o))};t(s);let r=null;if(await YY(i,async n=>{(await xb(QY(n)?n.loadAll():n.load())).ok!==!1||r||(r=n)}),r)throw r.loadError;return e}function QY(e){return"loadAll"in e&&typeof e.loadAll=="function"}var ix;const KY=new Ie({avgRating:"avg-rating",numRatings:"num-ratings",numComments:"num-comments",numViews:"num-views"});let Ns=ix=class extends oe{constructor(e){super(e),this.categories=null,this.disableExtraQuery=!1,this.extent=null,this.filter=null,this.num=10,this.query=null,this.sortField=null,this.start=1}get sortOrder(){return this._get("sortOrder")||"asc"}set sortOrder(e){e!=="asc"&&e!=="desc"||this._set("sortOrder",e)}clone(){return new ix({categories:this.categories?R(this.categories):null,disableExtraQuery:this.disableExtraQuery,extent:this.extent?this.extent.clone():null,filter:this.filter,num:this.num,query:this.query,sortField:this.sortField,sortOrder:this.sortOrder,start:this.start})}toRequestOptions(e,t){let i,s;if(this.categories&&(i=this.categories.map(o=>Array.isArray(o)?JSON.stringify(o):o)),this.extent){const o=bb(this.extent,xe.WGS84);M(o)&&(s=`${o.xmin},${o.ymin},${o.xmax},${o.ymax}`)}let r=this.query;!this.disableExtraQuery&&e.extraQuery&&(r="("+r+")"+e.extraQuery);const n={categories:i,bbox:s,q:r,filter:this.filter,num:this.num,sortField:null,sortOrder:null,start:this.start};return this.sortField&&(n.sortField=this.sortField.split(",").map(o=>KY.toJSON(o.trim())).join(","),n.sortOrder=this.sortOrder),{query:{...t,...n}}}};c([h()],Ns.prototype,"categories",void 0),c([h()],Ns.prototype,"disableExtraQuery",void 0),c([h({type:Ze})],Ns.prototype,"extent",void 0),c([h()],Ns.prototype,"filter",void 0),c([h()],Ns.prototype,"num",void 0),c([h()],Ns.prototype,"query",void 0),c([h()],Ns.prototype,"sortField",void 0),c([h()],Ns.prototype,"sortOrder",null),c([h()],Ns.prototype,"start",void 0),Ns=ix=c([S("esri.portal.PortalQueryParams")],Ns);const wo=Ns;let Ol=class extends oe{constructor(e){super(e),this.nextQueryParams=null,this.queryParams=null,this.results=null,this.total=null}};c([h()],Ol.prototype,"nextQueryParams",void 0),c([h()],Ol.prototype,"queryParams",void 0),c([h()],Ol.prototype,"results",void 0),c([h()],Ol.prototype,"total",void 0),Ol=c([S("esri.portal.PortalQueryResult")],Ol);const eJ=Ol;let Wn=class extends W{constructor(e){super(e),this.created=null,this.id=null,this.portal=null,this.title=null,this.username=null}get url(){const e=this.get("portal.restUrl");return e?`${e}/content/users/${this.username}/${this.id}`:null}toJSON(){throw new L("internal:not-yet-implemented","PortalFolder.toJSON is not yet implemented")}};c([h({type:Date})],Wn.prototype,"created",void 0),c([h()],Wn.prototype,"id",void 0),c([h()],Wn.prototype,"portal",void 0),c([h()],Wn.prototype,"title",void 0),c([h({readOnly:!0})],Wn.prototype,"url",null),c([h()],Wn.prototype,"username",void 0),Wn=c([S("esri.portal.PortalFolder")],Wn);const tJ=Wn;let qt=class extends W{constructor(e){super(e),this.access=null,this.created=null,this.description=null,this.id=null,this.isInvitationOnly=!1,this.modified=null,this.owner=null,this.portal=null,this.snippet=null,this.sortField=null,this.sortOrder=null,this.tags=null,this.title=null}get thumbnailUrl(){var i;const e=this.url,t=this.thumbnail;return e&&t&&this.portal?(i=this.portal)==null?void 0:i._normalizeUrl(`${e}/info/${t}?f=json`):null}get url(){const e=this.get("portal.restUrl");return e?e+"/community/groups/"+this.id:null}fetchCategorySchema(e){return Hs(this.portal)._request(this.url+"/categorySchema",e).then(t=>{const i=t.categorySchema||[];return i.some(s=>s.source==="contentCategorySetsGroupQuery.LivingAtlas")?this._fetchCategorySchemaSet("LivingAtlas",e):i})}fetchMembers(e){return Hs(this.portal)._request(this.url+"/users",e)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}toJSON(){throw new L("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}queryItems(e,t){let i=Dt(wo,e);const s=Hs(this.portal);return parseFloat(s.currentVersion)>5?(i=i||new wo,s._queryPortal(`/content/groups/${this.id}/search`,i,"PortalItem",t)):(i=i?i.clone():new wo,i.query="group:"+this.id+(i.query?" "+i.query:""),s.queryItems(i,t))}_fetchCategorySchemaSet(e,t){const i=Hs(this.portal);return i._fetchSelf(i.authMode,!0,t).then(s=>{const r=s.contentCategorySetsGroupQuery;if(r){const n=new wo;return n.disableExtraQuery=!0,n.num=1,n.query=r,i.queryGroups(n,t)}throw new L("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery value not found")}).then(s=>{if(s.total){const r=s.results[0],n=new wo;return n.num=1,n.query=`typekeywords:"${e}"`,r.queryItems(n,t)}throw new L("portal-group:fetchCategorySchema","contentCategorySetsGroupQuery group not found")}).then(s=>s.total?s.results[0].fetchData("json",t).then(r=>{const n=r&&r.categorySchema;return n&&n.length?n:[]}):[])}};c([h()],qt.prototype,"access",void 0),c([h({type:Date})],qt.prototype,"created",void 0),c([h()],qt.prototype,"description",void 0),c([h()],qt.prototype,"id",void 0),c([h()],qt.prototype,"isInvitationOnly",void 0),c([h({type:Date})],qt.prototype,"modified",void 0),c([h()],qt.prototype,"owner",void 0),c([h()],qt.prototype,"portal",void 0),c([h()],qt.prototype,"snippet",void 0),c([h()],qt.prototype,"sortField",void 0),c([h()],qt.prototype,"sortOrder",void 0),c([h()],qt.prototype,"tags",void 0),c([h()],qt.prototype,"thumbnail",void 0),c([h({readOnly:!0})],qt.prototype,"thumbnailUrl",null),c([h()],qt.prototype,"title",void 0),c([h({readOnly:!0})],qt.prototype,"url",null),qt=c([S("esri.portal.PortalGroup")],qt);const sx=qt;var iJ=Object.freeze(Object.defineProperty({__proto__:null,default:sx},Symbol.toStringTag,{value:"Module"})),rx;let Qe=rx=class extends W{constructor(...e){super(...e),this.access=null,this.created=null,this.culture=null,this.description=null,this.email=null,this.fullName=null,this.modified=null,this.orgId=null,this.portal=null,this.preferredView=null,this.privileges=null,this.region=null,this.role=null,this.roleId=null,this.sourceJSON=null,this.units=null,this.username=null,this.userType=null}get thumbnailUrl(){const e=this.url,t=this.thumbnail;return e&&t?this.portal._normalizeUrl(`${e}/info/${t}?f=json`):null}get userContentUrl(){const e=this.get("portal.restUrl");return e?`${e}/content/users/${this.username}`:null}get url(){const e=this.get("portal.restUrl");return e?`${e}/community/users/${this.username}`:null}addItem(e){const t=e&&e.item,i=e&&e.data,s=e&&e.folder,r={method:"post"};t&&(r.query=t.createPostQuery(),i!=null&&(typeof i=="string"?r.query.text=i:typeof i=="object"&&(r.query.text=JSON.stringify(i))));let n=this.userContentUrl;return s&&(n+="/"+(typeof s=="string"?s:s.id)),this.portal._request(n+"/addItem",r).then(o=>(t.id=o.id,t.portal=this.portal,t.loaded?t.reload():t.load()))}deleteItem(e){let t=this.userContentUrl;return e.ownerFolder&&(t+="/"+e.ownerFolder),this.portal._request(t+`/items/${e.id}/delete`,{method:"post"}).then(()=>{e.id=null,e.portal=null})}deleteItems(e){const t=this.userContentUrl+"/deleteItems",i=e.map(s=>s.id);if(i.length){const s={method:"post",query:{items:i.join(",")}};return this.portal._request(t,s).then(()=>{e.forEach(r=>{r.id=null,r.portal=null})})}return Promise.resolve(void 0)}fetchFolders(){var t;const e={query:{num:1}};return this.portal._request((t=this.userContentUrl)!=null?t:"",e).then(i=>{let s;return s=i&&i.folders?i.folders.map(r=>{const n=tJ.fromJSON(r);return n.portal=this.portal,n}):[],s})}fetchGroups(){var e;return this.portal._request((e=this.url)!=null?e:"").then(t=>{let i;return i=t&&t.groups?t.groups.map(s=>{const r=sx.fromJSON(s);return r.portal=this.portal,r}):[],i})}fetchItems(e){var r;const t=e!=null?e:{};let i,s=(r=this.userContentUrl)!=null?r:"";return t.folder&&(s+="/"+t.folder.id),z(()=>Promise.resolve().then(function(){return mD}),void 0).then(({default:n})=>{i=n;const o={folders:!1,num:t.num||10,start:t.start||1,sortField:t.sortField||"created",sortOrder:t.sortOrder||"asc"};return this.portal._request(s,{query:o})}).then(n=>{let o;return n&&n.items?(o=n.items.map(a=>{const l=i.fromJSON(a);return l.portal=this.portal,l}),Promise.all(o.map(a=>a.load())).catch(a=>a).then(()=>({items:o,nextStart:n.nextStart,total:n.total}))):{items:[],nextStart:-1,total:0}})}fetchTags(){return this.portal._request(this.url+"/tags").then(e=>e.tags)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}queryFavorites(e){return this.favGroupId?(this._favGroup||(this._favGroup=new sx({id:this.favGroupId,portal:this.portal})),this._favGroup.queryItems(e)):Promise.reject(new L("internal:unknown","Unknown internal error",{internalError:"Unknown favGroupId"}))}toJSON(){throw new L("internal:not-yet-implemented","PortalGroup.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");const t=new rx;return t.sourceJSON=e,t.read(e),t}};c([h()],Qe.prototype,"access",void 0),c([h({type:Date})],Qe.prototype,"created",void 0),c([h()],Qe.prototype,"culture",void 0),c([h()],Qe.prototype,"description",void 0),c([h()],Qe.prototype,"email",void 0),c([h()],Qe.prototype,"favGroupId",void 0),c([h()],Qe.prototype,"fullName",void 0),c([h({type:Date})],Qe.prototype,"modified",void 0),c([h()],Qe.prototype,"orgId",void 0),c([h()],Qe.prototype,"portal",void 0),c([h()],Qe.prototype,"preferredView",void 0),c([h()],Qe.prototype,"privileges",void 0),c([h()],Qe.prototype,"region",void 0),c([h()],Qe.prototype,"role",void 0),c([h()],Qe.prototype,"roleId",void 0),c([h()],Qe.prototype,"sourceJSON",void 0),c([h()],Qe.prototype,"thumbnail",void 0),c([h({readOnly:!0})],Qe.prototype,"thumbnailUrl",null),c([h()],Qe.prototype,"units",void 0),c([h({readOnly:!0})],Qe.prototype,"userContentUrl",null),c([h({readOnly:!0})],Qe.prototype,"url",null),c([h()],Qe.prototype,"username",void 0),c([h()],Qe.prototype,"userType",void 0),Qe=rx=c([S("esri.portal.PortalUser")],Qe);const R$=Qe;var sJ=Object.freeze(Object.defineProperty({__proto__:null,default:R$},Symbol.toStringTag,{value:"Module"})),ps;let D_;const hk={PortalGroup:()=>z(()=>Promise.resolve().then(function(){return iJ}),void 0),PortalItem:()=>z(()=>Promise.resolve().then(function(){return mD}),void 0),PortalUser:()=>z(()=>Promise.resolve().then(function(){return sJ}),void 0)};let K=ps=class extends Cm(Lo){constructor(e){super(e),this._esriIdCredentialCreateHandle=null,this.access=null,this.allSSL=!1,this.authMode="auto",this.authorizedCrossOriginDomains=null,this.basemapGalleryGroupQuery=null,this.bingKey=null,this.canListApps=!1,this.canListData=!1,this.canListPreProvisionedItems=!1,this.canProvisionDirectPurchase=!1,this.canSearchPublic=!0,this.canShareBingPublic=!1,this.canSharePublic=!1,this.canSignInArcGIS=!1,this.canSignInIDP=!1,this.colorSetsGroupQuery=null,this.commentsEnabled=!1,this.created=null,this.culture=null,this.customBaseUrl=null,this.defaultBasemap=null,this.defaultDevBasemap=null,this.defaultExtent=null,this.defaultVectorBasemap=null,this.description=null,this.devBasemapGalleryGroupQuery=null,this.eueiEnabled=null,this.featuredGroups=null,this.featuredItemsGroupQuery=null,this.galleryTemplatesGroupQuery=null,this.livingAtlasGroupQuery=null,this.hasCategorySchema=!1,this.helperServices=null,this.homePageFeaturedContent=null,this.homePageFeaturedContentCount=null,this.httpPort=null,this.httpsPort=null,this.id=null,this.ipCntryCode=null,this.isPortal=!1,this.isReadOnly=!1,this.layerTemplatesGroupQuery=null,this.maxTokenExpirationMinutes=null,this.modified=null,this.name=null,this.portalHostname=null,this.portalMode=null,this.portalProperties=null,this.region=null,this.rotatorPanels=null,this.showHomePageDescription=!1,this.sourceJSON=null,this.supportsHostedServices=!1,this.symbolSetsGroupQuery=null,this.templatesGroupQuery=null,this.units=null,this.url=je.portalUrl,this.urlKey=null,this.user=null,this.useStandardizedQuery=!1,this.useVectorBasemaps=!1,this.vectorBasemapGalleryGroupQuery=null}normalizeCtorArgs(e){return typeof e=="string"?{url:e}:e}destroy(){this._esriIdCredentialCreateHandle=Bt(this._esriIdCredentialCreateHandle)}readAuthorizedCrossOriginDomains(e){if(e)for(const t of e)je.request.trustedServers.includes(t)||je.request.trustedServers.push(t);return e}readDefaultBasemap(e){return this._readBasemap(e)}readDefaultDevBasemap(e){return this._readBasemap(e)}readDefaultVectorBasemap(e){return this._readBasemap(e)}get extraQuery(){const e=!(this.user&&this.user.orgId)||this.canSearchPublic;return this.id&&!e?` AND orgid:${this.id}`:null}get isOrganization(){return!!this.access}get itemPageUrl(){return this.url?`${this.url}/home/item.html`:null}get restUrl(){let e=this.url;if(e){const t=e.indexOf("/sharing");e=t>0?e.substring(0,t):this.url.replace(/\/+$/,""),e+="/sharing/rest"}return e}get thumbnailUrl(){const e=this.restUrl,t=this.thumbnail;return e&&t?this._normalizeSSL(e+"/portals/self/resources/"+t):null}readUrlKey(e){return e&&e.toLowerCase()}readUser(e){let t=null;return e&&(t=R$.fromJSON(e),t.portal=this),t}load(e){const t=z(()=>Promise.resolve().then(function(){return fJ}),void 0).then(({default:i})=>{Ft(e),D_=i}).then(()=>this.sourceJSON?this.sourceJSON:this._fetchSelf(this.authMode,!1,e)).then(i=>{if(bt){const s=bt;this.credential=s.findCredential(this.restUrl),this.credential||this.authMode!==ps.AUTH_MODE_AUTO||(this._esriIdCredentialCreateHandle=s.on("credential-create",()=>{s.findCredential(this.restUrl)&&this._signIn().catch(()=>{})}))}this.sourceJSON=i,this.read(i)});return this.addResolvingPromise(t),Promise.resolve(this)}async createElevationLayers(){await this.load();const e=this._getHelperService("defaultElevationLayers"),t=(await z(()=>import("./ElevationLayer.0f63abe9.js"),["assets/ElevationLayer.0f63abe9.js","assets/ArcGISCachedService.a530cd26.js","assets/TilemapCache.b64a2ea8.js"])).default;return e?e.map(i=>new t({id:i.id,url:i.url})):[]}fetchBasemaps(e,t){const i=new wo;return i.query=e||(je.apiKey&&IR(this.url)?this.devBasemapGalleryGroupQuery:this.useVectorBasemaps?this.vectorBasemapGalleryGroupQuery:this.basemapGalleryGroupQuery),i.disableExtraQuery=!0,this.queryGroups(i,t).then(s=>{if(i.num=100,i.query='type:"Web Map" -type:"Web Application"',s.total){const r=s.results[0];return i.sortField=r.sortField||"name",i.sortOrder=r.sortOrder||"desc",r.queryItems(i,t)}return null}).then(s=>{let r;return r=s&&s.total?s.results.filter(n=>n.type==="Web Map").map(n=>new D_({portalItem:n})):[],r})}fetchCategorySchema(e){return this.hasCategorySchema?this._request(this.restUrl+"/portals/self/categorySchema",e).then(t=>t.categorySchema):jr(e)?Promise.reject(_t()):Promise.resolve([])}fetchFeaturedGroups(e){const t=this.featuredGroups,i=new wo;if(i.num=100,i.sortField="title",t&&t.length){const s=[];for(const r of t)s.push(`(title:"${r.title}" AND owner:${r.owner})`);return i.query=s.join(" OR "),this.queryGroups(i,e).then(r=>r.results)}return jr(e)?Promise.reject(_t()):Promise.resolve([])}fetchRegions(e){var i;const t=((i=this.user)==null?void 0:i.culture)||this.culture||Rr();return this._request(this.restUrl+"/portals/regions",{...e,query:{culture:t}})}fetchSettings(e){var i;const t=((i=this.user)==null?void 0:i.culture)||this.culture||Rr();return this._request(this.restUrl+"/portals/self/settings",{...e,query:{culture:t}})}static getDefault(){return ps._default&&!ps._default.destroyed||(ps._default=new ps),ps._default}queryGroups(e,t){return this._queryPortal("/community/groups",e,"PortalGroup",t)}queryItems(e,t){return this._queryPortal("/search",e,"PortalItem",t)}queryUsers(e,t){return e.sortField||(e.sortField="username"),this._queryPortal("/community/users",e,"PortalUser",t)}toJSON(){throw new L("internal:not-yet-implemented","Portal.toJSON is not yet implemented")}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new ps({sourceJSON:e})}_getHelperService(e){const t=this.helperServices&&this.helperServices[e];if(!t)throw new L("portal:service-not-found",`The \`helperServices\` do not include an entry named "${e}"`);return t}_getHelperServiceUrl(e){const t=this._getHelperService(e);if(!(t!=null&&t.url))throw new L("portal:service-url-not-found",`The \`helperServices\` entry "${e}" does not include a \`url\` value`);return t.url}_fetchSelf(e=this.authMode,t=!1,i){const s=this.restUrl+"/portals/self",r={authMode:e,query:{culture:Rr().toLowerCase()},...i};return r.authMode==="auto"&&(r.authMode="no-prompt"),t&&(r.query.default=!0),this._request(s,r)}_queryPortal(e,t,i,s){const r=Dt(wo,t),n=o=>this._request(this.restUrl+e,{...r.toRequestOptions(this),...s}).then(a=>{const l=r.clone();return l.start=a.nextStart,new eJ({nextQueryParams:l,queryParams:r,total:a.total,results:ps._resultsToTypedArray(o,{portal:this},a,s)})}).then(a=>Promise.all(a.results.map(l=>typeof l.when=="function"?l.when():a)).then(()=>a,l=>(Em(l),a)));return i&&hk[i]?hk[i]().then(({default:o})=>(Ft(s),n(o))):n()}_signIn(){if(this.authMode===ps.AUTH_MODE_ANONYMOUS)return Promise.reject(new L("portal:invalid-auth-mode",`Current "authMode"' is "${this.authMode}"`));if(this.loadStatus==="failed")return Promise.reject(this.loadError);const e=t=>Promise.resolve().then(()=>this.loadStatus==="not-loaded"?(t||(this.authMode="immediate"),this.load().then(()=>null)):this.loadStatus==="loading"?this.load().then(()=>this.credential?null:(this.credential=t,this._fetchSelf("immediate"))):this.user&&this.credential===t?null:(this.credential=t,this._fetchSelf("immediate"))).then(i=>{i&&(this.sourceJSON=i,this.read(i))});return bt?bt.getCredential(this.restUrl).then(t=>e(t)):e(this.credential)}_normalizeSSL(e){return e.replace(/^http:/i,"https:").replace(":7080",":7443")}_normalizeUrl(e){const t=this.credential&&this.credential.token;return this._normalizeSSL(t?e+(e.includes("?")?"&":"?")+"token="+t:e)}_requestToTypedArray(e,t,i){return this._request(e,t).then(s=>{const r=ps._resultsToTypedArray(i,{portal:this},s);return Promise.all(r.map(n=>typeof n.when=="function"?n.when():s)).then(()=>r,()=>r)})}_readBasemap(e){if(e){const t=D_.fromJSON(e);return t.portalItem={portal:this},t}return null}_request(e,t={}){const i={f:"json",...t.query},{authMode:s=this.authMode===ps.AUTH_MODE_ANONYMOUS?"anonymous":"auto",body:r=null,cacheBust:n=!1,method:o="auto",responseType:a="json",signal:l}=t,u={authMode:s,body:r,cacheBust:n,method:o,query:i,responseType:a,timeout:0,signal:l};return kt(this._normalizeSSL(e),u).then(d=>d.data)}static _resultsToTypedArray(e,t,i,s){let r;if(i){const n=M(s)?s.signal:null;r=i.listings||i.notifications||i.userInvitations||i.tags||i.items||i.groups||i.comments||i.provisions||i.results||i.relatedItems||i,(e||t)&&(r=r.map(o=>{const a=Object.assign(e?e.fromJSON(o):o,t);return typeof a.load=="function"&&a.load(n),a}))}else r=[];return r}};K.AUTH_MODE_ANONYMOUS="anonymous",K.AUTH_MODE_AUTO="auto",K.AUTH_MODE_IMMEDIATE="immediate",c([h()],K.prototype,"access",void 0),c([h()],K.prototype,"allSSL",void 0),c([h()],K.prototype,"authMode",void 0),c([h()],K.prototype,"authorizedCrossOriginDomains",void 0),c([Q("authorizedCrossOriginDomains")],K.prototype,"readAuthorizedCrossOriginDomains",null),c([h()],K.prototype,"basemapGalleryGroupQuery",void 0),c([h()],K.prototype,"bingKey",void 0),c([h()],K.prototype,"canListApps",void 0),c([h()],K.prototype,"canListData",void 0),c([h()],K.prototype,"canListPreProvisionedItems",void 0),c([h()],K.prototype,"canProvisionDirectPurchase",void 0),c([h()],K.prototype,"canSearchPublic",void 0),c([h()],K.prototype,"canShareBingPublic",void 0),c([h()],K.prototype,"canSharePublic",void 0),c([h()],K.prototype,"canSignInArcGIS",void 0),c([h()],K.prototype,"canSignInIDP",void 0),c([h()],K.prototype,"colorSetsGroupQuery",void 0),c([h()],K.prototype,"commentsEnabled",void 0),c([h({type:Date})],K.prototype,"created",void 0),c([h()],K.prototype,"credential",void 0),c([h()],K.prototype,"culture",void 0),c([h()],K.prototype,"currentVersion",void 0),c([h()],K.prototype,"customBaseUrl",void 0),c([h()],K.prototype,"defaultBasemap",void 0),c([Q("defaultBasemap")],K.prototype,"readDefaultBasemap",null),c([h()],K.prototype,"defaultDevBasemap",void 0),c([Q("defaultDevBasemap")],K.prototype,"readDefaultDevBasemap",null),c([h({type:Ze})],K.prototype,"defaultExtent",void 0),c([h()],K.prototype,"defaultVectorBasemap",void 0),c([Q("defaultVectorBasemap")],K.prototype,"readDefaultVectorBasemap",null),c([h()],K.prototype,"description",void 0),c([h()],K.prototype,"devBasemapGalleryGroupQuery",void 0),c([h()],K.prototype,"eueiEnabled",void 0),c([h({readOnly:!0})],K.prototype,"extraQuery",null),c([h()],K.prototype,"featuredGroups",void 0),c([h()],K.prototype,"featuredItemsGroupQuery",void 0),c([h()],K.prototype,"galleryTemplatesGroupQuery",void 0),c([h()],K.prototype,"livingAtlasGroupQuery",void 0),c([h()],K.prototype,"hasCategorySchema",void 0),c([h()],K.prototype,"helpBase",void 0),c([h()],K.prototype,"helperServices",void 0),c([h()],K.prototype,"helpMap",void 0),c([h()],K.prototype,"homePageFeaturedContent",void 0),c([h()],K.prototype,"homePageFeaturedContentCount",void 0),c([h()],K.prototype,"httpPort",void 0),c([h()],K.prototype,"httpsPort",void 0),c([h()],K.prototype,"id",void 0),c([h()],K.prototype,"ipCntryCode",void 0),c([h({readOnly:!0})],K.prototype,"isOrganization",null),c([h()],K.prototype,"isPortal",void 0),c([h()],K.prototype,"isReadOnly",void 0),c([h({readOnly:!0})],K.prototype,"itemPageUrl",null),c([h()],K.prototype,"layerTemplatesGroupQuery",void 0),c([h()],K.prototype,"maxTokenExpirationMinutes",void 0),c([h({type:Date})],K.prototype,"modified",void 0),c([h()],K.prototype,"name",void 0),c([h()],K.prototype,"portalHostname",void 0),c([h()],K.prototype,"portalMode",void 0),c([h()],K.prototype,"portalProperties",void 0),c([h()],K.prototype,"region",void 0),c([h({readOnly:!0})],K.prototype,"restUrl",null),c([h()],K.prototype,"rotatorPanels",void 0),c([h()],K.prototype,"showHomePageDescription",void 0),c([h()],K.prototype,"sourceJSON",void 0),c([h()],K.prototype,"staticImagesUrl",void 0),c([h({json:{name:"2DStylesGroupQuery"}})],K.prototype,"stylesGroupQuery2d",void 0),c([h({json:{name:"stylesGroupQuery"}})],K.prototype,"stylesGroupQuery3d",void 0),c([h()],K.prototype,"supportsHostedServices",void 0),c([h()],K.prototype,"symbolSetsGroupQuery",void 0),c([h()],K.prototype,"templatesGroupQuery",void 0),c([h()],K.prototype,"thumbnail",void 0),c([h({readOnly:!0})],K.prototype,"thumbnailUrl",null),c([h()],K.prototype,"units",void 0),c([h()],K.prototype,"url",void 0),c([h()],K.prototype,"urlKey",void 0),c([Q("urlKey")],K.prototype,"readUrlKey",null),c([h()],K.prototype,"user",void 0),c([Q("user")],K.prototype,"readUser",null),c([h()],K.prototype,"useStandardizedQuery",void 0),c([h()],K.prototype,"useVectorBasemaps",void 0),c([h()],K.prototype,"vectorBasemapGalleryGroupQuery",void 0),K=ps=c([S("esri.portal.Portal")],K);const cs=K;let la=class extends oe{constructor(e){super(e),this.portalItem=null}normalizeCtorArgs(e){return e&&e.portalItem&&e.path?{...e,path:this._normalizePath(e.path,e.portalItem)}:e}set path(e){M(e)&&Ms(e)?q.getLogger(this.declaredClass).error("portalitemresource:invalid-path","A portal item resource path must be relative"):this._set("path",e)}_castPath(e){return this._normalizePath(e,this.portalItem)}get url(){return this.portalItem&&this.path?`${this.portalItem.itemUrl}/resources/${this.path}`:null}get itemRelativeUrl(){return this.portalItem&&this.path?`./resources/${this.path}`:null}fetch(e="json",t){const i=this.url;if(N(i))throw new L("portal-item-resource:fetch","Portal item resource does not refer to a valid item or path");return this.portalItem.portal._request(i,{responseType:e,query:{token:this.portalItem.apiKey},signal:w3(t,"signal")})}async update(e,t){return(await z(()=>import("./resourceUtils.f4b6e42a.js"),[])).addOrUpdateResource(this,"update",e,t)}hasPath(){return M(this.path)}_normalizePath(e,t){return N(e)?e:(e=e.replace(/^\/+/,""),M(t)&&Ms(e)&&(e=e$(e,t.itemUrl)),e.replace(/^\/+/,"").replace(/^(\.\/)?resources\//,""))}};c([h()],la.prototype,"portalItem",void 0),c([h({type:String,value:null})],la.prototype,"path",null),c([Oe("path")],la.prototype,"_castPath",null),c([h({type:String,readOnly:!0})],la.prototype,"url",null),c([h({type:String,readOnly:!0})],la.prototype,"itemRelativeUrl",null),la=c([S("esri.portal.PortalItemResource")],la);const rJ=la;let cp=class extends oe{constructor(e){super(e),this.created=null,this.rating=null}};c([h()],cp.prototype,"created",void 0),c([h()],cp.prototype,"rating",void 0),cp=c([S("esri.portal.PortalRating")],cp);const N_=cp;var Au;const nJ=new Set(["Map Service","Feature Service","Feature Collection","Scene Service","Image Service","Stream Service","Vector Tile Service","GeoJson","CSV","KML","WFS","WMTS","WMS","Feed"]),oJ=new Set(["KML","GeoJson","CSV"]);let Se=Au=class extends Cm(Lo){constructor(e){super(e),this.access=null,this.accessInformation=null,this.apiKey=null,this.applicationProxies=null,this.avgRating=null,this.categories=null,this.created=null,this.culture=null,this.description=null,this.extent=null,this.groupCategories=null,this.id=null,this.itemControl=null,this.licenseInfo=null,this.modified=null,this.name=null,this.numComments=null,this.numRatings=null,this.numViews=null,this.owner=null,this.ownerFolder=null,this.portal=null,this.screenshots=null,this.size=null,this.snippet=null,this.sourceJSON=null,this.spatialReference=null,this.tags=null,this.title=null,this.type=null,this.typeKeywords=null,this.url=null}static from(e){return VM(Au,e)}destroy(){this.portal=null}get displayName(){const e=this.type,t=this.typeKeywords||[];let i=e;return e==="Feature Service"||e==="Feature Collection"?i=t.includes("Table")?"Table":t.includes("Route Layer")?"Route Layer":t.includes("Markup")?"Markup":"Feature Layer":e==="Image Service"?i=t.includes("Elevation 3D Layer")?"Elevation Layer":t.includes("Tiled Imagery")?"Tiled Imagery Layer":"Imagery Layer":e==="Scene Service"?i="Scene Layer":e==="Video Service"?i="Video Layer":e==="Scene Package"?i="Scene Layer Package":e==="Stream Service"?i="Feature Layer":e==="Geoprocessing Service"&&this.portal&&this.portal.isPortal?i=t.includes("Web Tool")?"Tool":"Geoprocessing Service":e==="Geocoding Service"?i="Locator":e==="Geoenrichment Service"?i="GeoEnrichment Service":e==="Microsoft Powerpoint"?i="Microsoft PowerPoint":e==="GeoJson"?i="GeoJSON":e==="Globe Service"?i="Globe Layer":e==="Vector Tile Service"?i="Tile Layer":e==="netCDF"?i="NetCDF":e==="Map Service"?i=t.includes("Spatiotemporal")||!t.includes("Hosted Service")&&!t.includes("Tiled")||t.includes("Relational")?"Map Image Layer":"Tile Layer":e&&e.toLowerCase().includes("add in")?i=e.replace(/(add in)/gi,"Add-In"):e==="datastore catalog service"?i="Big Data File Share":e==="Compact Tile Package"?i="Tile Package (tpkx)":e==="OGCFeatureServer"?i="OGC Feature Layer":e==="web mapping application"&&t.includes("configurableApp")&&(i="Instant App"),i}readExtent(e){return e&&e.length?new Ze(e[0][0],e[0][1],e[1][0],e[1][1]):null}get iconUrl(){const e=this.type&&this.type.toLowerCase()||"",t=this.typeKeywords||[],i="esri/images/portal/",s="16";let r,n=!1,o=!1,a=!1,l=!1,u=!1,d=!1;return e.indexOf("service")>0||e==="feature collection"||e==="kml"||e==="wms"||e==="wmts"||e==="wfs"?(n=t.includes("Hosted Service"),e==="feature service"||e==="feature collection"||e==="kml"||e==="wfs"?(o=t.includes("Table"),a=t.includes("Route Layer"),l=t.includes("Markup"),u=t.includes("Spatiotemporal"),d=t.includes("UtilityNetwork"),r=u&&o?"spatiotemporaltable":o?"table":a?"routelayer":l?"markup":u?"spatiotemporal":n?"featureshosted":d?"utilitynetwork":"features"):r=e==="map service"||e==="wms"||e==="wmts"?n||t.includes("Tiled")||e==="wmts"?"maptiles":"mapimages":e==="scene service"?t.includes("Line")?"sceneweblayerline":t.includes("3DObject")?"sceneweblayermultipatch":t.includes("Point")?"sceneweblayerpoint":t.includes("IntegratedMesh")?"sceneweblayermesh":t.includes("PointCloud")?"sceneweblayerpointcloud":t.includes("Polygon")?"sceneweblayerpolygon":t.includes("Building")?"sceneweblayerbuilding":t.includes("Voxel")?"sceneweblayervoxel":"sceneweblayer":e==="image service"?t.includes("Elevation 3D Layer")?"elevationlayer":t.includes("Tiled Imagery")?"tiledimagerylayer":"imagery":e==="stream service"?"streamlayer":e==="video service"?"mediaservice":e==="vector tile service"?"vectortile":e==="datastore catalog service"?"datastorecollection":e==="geocoding service"?"geocodeservice":e==="geoprocessing service"?t.includes("Web Tool")&&this.portal&&this.portal.isPortal?"tool":"layers":e==="geodata service"?"geodataservice":"layers"):r=e==="web map"||e==="cityengine web scene"?"maps":e==="web scene"?t.includes("ViewingMode-Local")?"webscenelocal":"websceneglobal":e==="web mapping application"&&t.includes("configurableApp")?"instantapps":e==="web mapping application"||e==="mobile application"||e==="application"||e==="operation view"||e==="desktop application"?"apps":e==="map document"||e==="map package"||e==="published map"||e==="scene document"||e==="globe document"||e==="basemap package"||e==="mobile basemap package"||e==="mobile map package"||e==="project package"||e==="project template"||e==="pro map"||e==="layout"||e==="layer"&&t.includes("ArcGIS Pro")||e==="explorer map"&&t.indexOf("Explorer Document")?"mapsgray":e==="service definition"||e==="csv"||e==="shapefile"||e==="cad drawing"||e==="geojson"||e==="360 vr experience"||e==="netcdf"||e==="administrative report"?"datafiles":e==="explorer add in"||e==="desktop add in"||e==="windows viewer add in"||e==="windows viewer configuration"?"appsgray":e==="arcgis pro add in"||e==="arcgis pro configuration"?"addindesktop":e==="rule package"||e==="file geodatabase"||e==="sqlite geodatabase"||e==="csv collection"||e==="kml collection"||e==="windows mobile package"||e==="map template"||e==="desktop application template"||e==="gml"||e==="arcpad package"||e==="code sample"||e==="form"||e==="document link"||e==="earth configuration"||e==="operations dashboard add in"||e==="rules package"||e==="image"||e==="workflow manager package"||e==="explorer map"&&t.includes("Explorer Mapping Application")||t.includes("Document")?"datafilesgray":e==="network analysis service"||e==="geoprocessing service"||e==="geodata service"||e==="geometry service"||e==="geoprocessing package"||e==="locator package"||e==="geoprocessing sample"||e==="workflow manager service"?"toolsgray":e==="layer"||e==="layer package"||e==="explorer layer"?"layersgray":e==="scene package"?"scenepackage":e==="mobile scene package"?"mobilescenepackage":e==="tile package"||e==="compact tile package"?"tilepackage":e==="task file"?"taskfile":e==="report template"?"report-template":e==="statistical data collection"?"statisticaldatacollection":e==="insights workbook"?"workbook":e==="insights model"?"insightsmodel":e==="insights page"?"insightspage":e==="insights theme"?"insightstheme":e==="hub initiative"?"hubinitiative":e==="hubpage"?"hubpage":e==="hub event"?"hubevent":e==="hub site application"?"hubsite":e==="hub project"?"hubproject":e==="relational database connection"?"relationaldatabaseconnection":e==="big data file share"?"datastorecollection":e==="image collection"?"imagecollection":e==="style"?"style":e==="desktop style"?"desktopstyle":e==="dashboard"?"dashboard":e==="raster function template"?"rasterprocessingtemplate":e==="vector tile package"?"vectortilepackage":e==="ortho mapping project"?"orthomappingproject":e==="ortho mapping template"?"orthomappingtemplate":e==="solution"?"solutions":e==="geopackage"?"geopackage":e==="deep learning package"?"deeplearningpackage":e==="real time analytic"?"realtimeanalytics":e==="big data analytic"?"bigdataanalytics":e==="feed"?"feed":e==="excalibur imagery project"?"excaliburimageryproject":e==="notebook"?"notebook":e==="storymap"?"storymap":e==="survey123 add in"?"survey123addin":e==="mission"?"mission":e==="mission report"?"missionreport":e==="quickcapture project"?"quickcaptureproject":e==="pro report"?"proreport":e==="pro report template"?"proreporttemplate":e==="urban model"?"urbanmodel":e==="web experience"?"experiencebuilder":e==="web experience template"?"webexperiencetemplate":e==="experience builder widget"?"experiencebuilderwidget":e==="experience builder widget package"?"experiencebuilderwidgetpackage":e==="workflow"?"workflow":e==="insights script"?"insightsscript":e==="kernel gateway connection"?"kernelgatewayconnection":e==="hub initiative template"?"hubinitiativetemplate":e==="storymap theme"?"storymaptheme":e==="knowledge graph"?"knowledgegraph":e==="native application"?"nativeapp":e==="native application installer"?"nativeappinstaller":e==="link chart"?"linkchart":e==="investigation"?"investigation":e==="ogcfeatureserver"?"features":e==="pro project"?"proproject":e==="insights workbook package"?"insightsworkbookpackage":e==="apache parquet"?"apacheparquet":e==="notebook code snippets"||e==="notebook code snippet library"?"notebookcodesnippets":e==="suitability model"?"suitabilitymodel":e==="esri classifier definition"?"classifierdefinition":e==="esri classification schema"?"classificationschema":e==="insights data engineering workbook"?"dataengineeringworkbook":e==="insights data engineering model"?"dataengineeringmodel":e==="deep learning studio project"?"deeplearningproject":e==="discussion"?"discussion":"maps",r?Ne(i+r+s+".png"):null}get isLayer(){return this.type!=null&&nJ.has(this.type)}get itemPageUrl(){var t;const e=(t=this.portal)==null?void 0:t.itemPageUrl;return e&&this.id?`${e}?id=${this.id}`:null}get itemUrl(){var t;const e=(t=this.portal)==null?void 0:t.restUrl;return e&&this.id?`${e}/content/items/${this.id}`:null}get thumbnailUrl(){var i,s;const e=this.itemUrl,t=this.thumbnail;return e&&t&&(s=(i=this.portal)==null?void 0:i._normalizeUrl(`${e}/info/${t}?f=json`))!=null?s:null}get userItemUrl(){const e=this.get("portal.restUrl");if(!e)return null;const t=this.owner||this.get("portal.user.username");return t?`${e}/content/users/${this.ownerFolder?`${t}/${this.ownerFolder}`:t}/items/${this.id}`:null}load(e){var s;const t=(s=this.portal)!=null?s:this.portal=cs.getDefault(),i=t.load(e).then(()=>this.sourceJSON?this.sourceJSON:this.id&&this.itemUrl?t._request(this.itemUrl,{signal:M(e)?e.signal:null,query:{token:this.apiKey}}):{}).then(r=>{this.sourceJSON=r,this.read(r)});return this.addResolvingPromise(i),Promise.resolve(this)}async addRating(e){const t={method:"post",query:{}};return e instanceof N_&&(e=e.rating),e==null||isNaN(e)||typeof e!="number"||(t.query.rating=e),this.portal?(await this.portal._request(this.itemUrl+"/addRating",t),new N_({rating:e,created:new Date})):null}clone(){const e={access:this.access,accessInformation:this.accessInformation,applicationProxies:R(this.applicationProxies),avgRating:this.avgRating,categories:R(this.categories),created:R(this.created),culture:this.culture,description:this.description,extent:R(this.extent),groupCategories:R(this.groupCategories),id:this.id,itemControl:this.itemControl,licenseInfo:this.licenseInfo,modified:R(this.modified),name:this.name,numComments:this.numComments,numRatings:this.numRatings,numViews:this.numViews,owner:this.owner,ownerFolder:this.ownerFolder,portal:this.portal,screenshots:R(this.screenshots),size:this.size,snippet:this.snippet,spatialReference:this.spatialReference,tags:R(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:R(this.typeKeywords),url:this.url};return this.loaded&&(e.loadStatus="loaded"),new Au({sourceJSON:this.sourceJSON}).set(e)}createPostQuery(){const e=this.toJSON();for(const i of["tags","typeKeywords","categories"])e[i]&&(e[i]=e[i].join(", "));const{extent:t}=e;return t&&(e.extent=JSON.stringify(t)),e}async deleteRating(){await Hs(this.portal)._request(this.itemUrl+"/deleteRating",{method:"post"})}fetchData(e="json",t){return Hs(this.portal)._request(this.itemUrl+"/data",{responseType:e,...t,query:{token:this.apiKey}})}async fetchRating(e){const t=await Hs(this.portal)._request(this.itemUrl+"/rating",{query:{token:this.apiKey},...e});return t.rating!=null?(t.created=new Date(t.created),new N_(t)):null}fetchRelatedItems(e,t){return Hs(this.portal)._requestToTypedArray(this.itemUrl+"/relatedItems",{query:{...e,token:this.apiKey},...t},Au)}getThumbnailUrl(e){let t=this.thumbnailUrl;return t&&e&&(t+=`&w=${e}`),t}reload(){var e;return Hs(this.portal)._request((e=this.itemUrl)!=null?e:"",{cacheBust:!0,query:{token:this.apiKey}}).then(t=>(this.sourceJSON=t,this.read(t),this))}update(e){return this.id?this.load().then(()=>Hs(this.portal)._signIn()).then(()=>{const t=e&&e.data,i={method:"post"};i.query=this.createPostQuery();for(const s in i.query)i.query[s]===null&&(i.query[s]="");return i.query.clearEmptyFields=!0,t!=null&&(typeof t=="string"?i.query.text=t:typeof t=="object"&&(i.query.text=JSON.stringify(t))),this.portal._request(`${this.userItemUrl}/update`,i).then(()=>this.reload())}):Promise.reject(new L("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}updateThumbnail(e){return this.id?this.load().then(()=>this.portal._signIn()).then(()=>{const t=e.thumbnail,i=e.filename,s={method:"post"};if(typeof t=="string")hu(t)?s.query={data:t}:s.query={url:Js(t)},M(i)&&(s.query.filename=i);else{const r=new FormData;M(i)?r.append("file",t,i):r.append("file",t),s.body=r}return this.portal._request(`${this.userItemUrl}/updateThumbnail`,s).then(()=>this.reload())}):Promise.reject(new L("portal:item-does-not-exist","The item does not exist yet and cannot be updated"))}async fetchResources(e={},t){return(await z(()=>import("./resourceUtils.f4b6e42a.js"),[])).fetchResources(this,e,t)}async addResource(e,t,i){const s=await z(()=>import("./resourceUtils.f4b6e42a.js"),[]);return e.portalItem=this,s.addOrUpdateResource(e,"add",t,i)}async removeResource(e,t){const i=await z(()=>import("./resourceUtils.f4b6e42a.js"),[]);if(e.portalItem&&e.portalItem.itemUrl!==this.itemUrl)throw new L("removeresource:portal-item-mismatch","The portal item associated with the provided resource does not match the item");return i.removeResource(this,e,t)}async removeAllResources(e){return(await z(()=>import("./resourceUtils.f4b6e42a.js"),[])).removeAllResources(this,e)}resourceFromPath(e){return new rJ({portalItem:this,path:e})}toJSON(){const e=this.extent,t={accessInformation:this.accessInformation,categories:R(this.categories),created:this.created&&this.created.getTime(),description:this.description,extent:e&&[[e.xmin,e.ymin],[e.xmax,e.ymax]],id:this.id,licenseInfo:this.licenseInfo,modified:this.modified&&this.modified.getTime(),name:this.name,owner:this.owner,ownerFolder:this.ownerFolder,snippet:this.snippet,spatialReference:this.spatialReference,tags:R(this.tags),thumbnail:this.thumbnail,title:this.title,type:this.type,typeKeywords:R(this.typeKeywords),url:this.url};return M3(t)}static fromJSON(e){if(!e)return null;if(e.declaredClass)throw new Error("JSON object is already hydrated");return new Au({sourceJSON:e})}_getPostQuery(){const e=this.toJSON();for(const t in e)t==="tags"&&e[t]!==null&&(e[t]=e[t].join(", ")),t==="typeKeywords"&&e[t]!==null&&(e[t]=e[t].join(", ")),t==="extent"&&e[t]&&(e[t]=JSON.stringify(e[t]));return e}};c([h({type:["private","shared","org","public"]})],Se.prototype,"access",void 0),c([h()],Se.prototype,"accessInformation",void 0),c([h({type:String})],Se.prototype,"apiKey",void 0),c([h({json:{read:{source:"appProxies"}}})],Se.prototype,"applicationProxies",void 0),c([h()],Se.prototype,"avgRating",void 0),c([h()],Se.prototype,"categories",void 0),c([h({type:Date})],Se.prototype,"created",void 0),c([h()],Se.prototype,"culture",void 0),c([h()],Se.prototype,"description",void 0),c([h({readOnly:!0})],Se.prototype,"displayName",null),c([h({type:Ze})],Se.prototype,"extent",void 0),c([Q("extent")],Se.prototype,"readExtent",null),c([h()],Se.prototype,"groupCategories",void 0),c([h({readOnly:!0})],Se.prototype,"iconUrl",null),c([h()],Se.prototype,"id",void 0),c([h({readOnly:!0})],Se.prototype,"isLayer",null),c([h()],Se.prototype,"itemControl",void 0),c([h({readOnly:!0})],Se.prototype,"itemPageUrl",null),c([h({readOnly:!0})],Se.prototype,"itemUrl",null),c([h()],Se.prototype,"licenseInfo",void 0),c([h({type:Date})],Se.prototype,"modified",void 0),c([h()],Se.prototype,"name",void 0),c([h()],Se.prototype,"numComments",void 0),c([h()],Se.prototype,"numRatings",void 0),c([h()],Se.prototype,"numViews",void 0),c([h()],Se.prototype,"owner",void 0),c([h()],Se.prototype,"ownerFolder",void 0),c([h({type:cs})],Se.prototype,"portal",void 0),c([h()],Se.prototype,"screenshots",void 0),c([h()],Se.prototype,"size",void 0),c([h()],Se.prototype,"snippet",void 0),c([h()],Se.prototype,"sourceJSON",void 0),c([h({type:String})],Se.prototype,"spatialReference",void 0),c([h()],Se.prototype,"tags",void 0),c([h()],Se.prototype,"thumbnail",void 0),c([h({readOnly:!0})],Se.prototype,"thumbnailUrl",null),c([h()],Se.prototype,"title",void 0),c([h()],Se.prototype,"type",void 0),c([h()],Se.prototype,"typeKeywords",void 0),c([h({type:String,json:{read(e,t){var i;if(oJ.has(t.type)){const s=(i=this.portal)==null?void 0:i.restUrl;e||(e=s&&this.id?`${s}/content/items/${this.id}/data`:null)}return e}}})],Se.prototype,"url",void 0),c([h({readOnly:!0})],Se.prototype,"userItemUrl",null),Se=Au=c([S("esri.portal.PortalItem")],Se);const fv=Se;var mD=Object.freeze(Object.defineProperty({__proto__:null,default:fv},Symbol.toStringTag,{value:"Module"}));function L$(e){var t;return(e==null?void 0:e.type)==="feature"&&!e.url&&((t=e.source)==null?void 0:t.type)==="memory"}function Ebe(e){var t;return(e==null?void 0:e.type)==="feature"&&((t=e.source)==null?void 0:t.type)==="feature-layer"}const aJ=new Set(["bing-maps","imagery","imagery-tile","map-image","open-street-map","tile","unknown","unsupported","vector-tile","web-tile","wms","wmts"]),lJ=new Set(["csv","feature","geo-rss","geojson","group","imagery","imagery-tile","kml","map-image","map-notes","ogc-feature","route","subtype-group","tile","unknown","unsupported","vector-tile","web-tile","wfs","wms","wmts"]);function cJ(e){return e.layerContainerType==="basemap"?aJ:e.layerContainerType==="operational-layers"?lJ:null}function uJ(e,t){if(t.restrictedWebMapWriting){const i=cJ(t);return!M(i)||i.has(e.type)&&!L$(e)}return!0}function hJ(e,t){if(L$(e)){const i=rd("featureCollection.layers",t),s=i&&i[0]&&i[0].layerDefinition;s&&j_(e,s)}else e.type==="stream"?j_(e,t.layerDefinition=t.layerDefinition||{}):e.type!=="group"&&j_(e,t)}function j_(e,t){"maxScale"in e&&(t.maxScale=D0(e.maxScale)),"minScale"in e&&(t.minScale=D0(e.minScale))}function dJ(e,t){if(hJ(e,t),"blendMode"in e&&(t.blendMode=e.blendMode,t.blendMode==="normal"&&delete t.blendMode),t.opacity=D0(e.opacity),t.title=e.title||"Layer",t.visibility=e.visible,"legendEnabled"in e&&e.type!=="wmts")if(L$(e)){const i=t.featureCollection;i&&(i.showLegend=e.legendEnabled)}else t.showLegend=e.legendEnabled}function dk(e,t,i){if(!("write"in e)||!e.write)return i&&i.messages&&i.messages.push(new L("layer:unsupported",`Layers (${e.title}, ${e.id}) of type '${e.declaredClass}' cannot be persisted`,{layer:e})),null;if(uJ(e,i)){const s={};return e.write(s,i)?s:null}return M(t)&&dJ(e,t=R(t)),t}var wg;let pJ=0;const yD="esri.Basemap";let js=wg=class extends Cm(Lo){constructor(e){super(e),this.id=null,this.portalItem=null,this.spatialReference=null,this.thumbnailUrl=null,this.title="Basemap",this.id=Date.now().toString(16)+"-basemap-"+pJ++,this.baseLayers=new he,this.referenceLayers=new he;const t=s=>{s.parent&&s.parent!==this&&"remove"in s.parent&&s.parent.remove(s),s.parent=this,s.type==="elevation"&&q.getLogger(this.declaredClass).error(`Layer '${s.title}, id:${s.id}' of type '${s.type}' is not supported as a basemap layer and will therefore be ignored.`)},i=s=>{s.parent=null};this.baseLayers.on("after-add",s=>t(s.item)),this.referenceLayers.on("after-add",s=>t(s.item)),this.baseLayers.on("after-remove",s=>i(s.item)),this.referenceLayers.on("after-remove",s=>i(s.item))}initialize(){this.when().catch(e=>{q.getLogger(this.declaredClass).error("#load()",`Failed to load basemap (title: '${this.title}', id: '${this.id}')`,e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){var i;const e=this.baseLayers.removeAll();for(const s of e)s.destroy();const t=this.referenceLayers.removeAll();for(const s of t)s.destroy();this.baseLayers.destroy(),this.referenceLayers.destroy(),(i=this.portalItem)==null||i.destroy(),this.portalItem=null}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set baseLayers(e){this._set("baseLayers",ou(e,this._get("baseLayers")))}_writeBaseLayers(e,t,i){const s=[];e&&(i={...i,layerContainerType:"basemap"},this.baseLayers.forEach(r=>{const n=dk(r,i.webmap?i.webmap.getLayerJSONFromResourceInfo(r):null,i);M(n)&&s.push(n)}),this.referenceLayers.forEach(r=>{const n=dk(r,i.webmap?i.webmap.getLayerJSONFromResourceInfo(r):null,i);M(n)&&(n.isReference=!0,s.push(n))})),t.baseMapLayers=s}set referenceLayers(e){this._set("referenceLayers",ou(e,this._get("referenceLayers")))}writeTitle(e,t){t.title=e||"Basemap"}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return fD(this,e=>{e(this.baseLayers,this.referenceLayers)})}clone(){const e={id:this.id,title:this.title,portalItem:this.portalItem,baseLayers:this.baseLayers.slice(),referenceLayers:this.referenceLayers.slice()};return this.loaded&&(e.loadStatus="loaded"),new wg({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set("resourceInfo",{data:e,context:t}),super.read(e,t)}write(e,t){return e=e||{},t&&t.origin||(t={origin:"web-map",...t}),super.write(e,t),!this.loaded&&this.resourceInfo&&this.resourceInfo.data.baseMapLayers&&(e.baseMapLayers=this.resourceInfo.data.baseMapLayers.map(i=>{const s=R(i);return s.url&&kn(s.url)&&(s.url=`https:${s.url}`),s.templateUrl&&kn(s.templateUrl)&&(s.templateUrl=`https:${s.templateUrl}`),s})),e}async _loadFromSource(e){const{resourceInfo:t,portalItem:i}=this;Ft(e);const s=[];if(t){const r=t.context?t.context.url:null;if(s.push(this._loadLayersFromJSON(t.data,r,e)),t.data.id&&!t.data.title){const n=t.data.id;s.push(NY(n).then(o=>{o&&this.read({title:o},t.context)}))}}else i&&s.push(this._loadFromItem(i,e));await Promise.all(s)}async _loadLayersFromJSON(e,t,i){const s=this.resourceInfo&&this.resourceInfo.context,r=this.portalItem&&this.portalItem.portal||s&&s.portal||null,n=s&&s.origin==="web-scene"?"web-scene":"web-map",{populateOperationalLayers:o}=await z(()=>import("./layersCreator.67b651fa.js"),["assets/layersCreator.67b651fa.js","assets/lazyLayerLoader.4d2df2af.js","assets/portalLayers.72750f56.js","assets/layersLoader.afdddce2.js","assets/jsonContext.fe51f9bd.js","assets/portalItemUtils.92eef7f6.js"]),a=[];if(Ft(i),e.baseMapLayers&&Array.isArray(e.baseMapLayers)){const l={context:{origin:n,url:t,portal:r,layerContainerType:"basemap"},defaultLayerType:"DefaultTileLayer"},u=o(this.baseLayers,e.baseMapLayers.filter(f=>!f.isReference),l);a.push(u);const d=o(this.referenceLayers,e.baseMapLayers.filter(f=>f.isReference),l);a.push(d)}await as(a)}async _loadFromItem(e,t){var n,o;const i=await e.load(t),s=await i.fetchData("json",t),r=Ai((n=e.itemUrl)!=null?n:"");return this._set("resourceInfo",{data:(o=s.baseMap)!=null?o:{},context:{origin:"web-map",portal:e.portal||cs.getDefault(),url:r}}),this.read(this.resourceInfo.data,this.resourceInfo.context),this.read({spatialReference:s.spatialReference},this.resourceInfo.context),this.read({title:e.title,thumbnailUrl:e.thumbnailUrl},{origin:"portal-item",portal:e.portal||cs.getDefault(),url:r}),this._loadLayersFromJSON(this.resourceInfo.data,r,t)}static fromId(e){const t=Gh[e];if(t){if(t.deprecated){let i=null;e==="dark-gray"?i="dark-gray-vector":e==="gray"?i="gray-vector":e==="streets"?i="streets-vector":e==="topo"&&(i="topo-vector"),aR(q.getLogger(yD),`The ${e} basemap has entered mature support and is no longer being updated.`,{replacement:i,see:"https://arcg.is/1iq8aD",warnOnce:!0})}return wg.fromJSON(t)}return null}};c([h({json:{write:{ignoreOrigin:!0,target:"baseMapLayers",writer(e,t,i,s){this._writeBaseLayers(e,t,s)}},origins:{"web-scene":{write:{ignoreOrigin:!0,target:{baseMapLayers:{type:he}},writer(e,t,i,s){this._writeBaseLayers(e,t,s)}}}}}})],js.prototype,"baseLayers",null),c([h({type:String,json:{origins:{"web-scene":{write:!0}}}})],js.prototype,"id",void 0),c([h({type:fv})],js.prototype,"portalItem",void 0),c([h()],js.prototype,"referenceLayers",null),c([h({readOnly:!0})],js.prototype,"resourceInfo",void 0),c([h({type:xe})],js.prototype,"spatialReference",void 0),c([h()],js.prototype,"thumbnailUrl",void 0),c([h({type:String,json:{origins:{"web-scene":{write:{isRequired:!0}}}}})],js.prototype,"title",void 0),c([ie("title")],js.prototype,"writeTitle",null),js=wg=c([S(yD)],js);const mv=js;var fJ=Object.freeze(Object.defineProperty({__proto__:null,default:mv},Symbol.toStringTag,{value:"Module"}));const pk=q.getLogger("esri.support.basemapUtils");function mJ(){return{}}function gD(e){for(const t in e){const i=e[t];(i==null?void 0:i.destroyed)===!1&&i.destroy(),delete e[t]}}function xg(e,t){let i;if(typeof e=="string"){if(!(e in Gh)){const s=Object.entries(Gh).filter(([r,n])=>je.apiKey&&!n.classic||!je.apiKey&&n.classic&&!n.deprecated).map(([r])=>`"${r}"`).join(", ");return pk.warn(`Unable to find basemap definition for: ${e}. Try one of these: ${s}`),null}t&&(i=t[e]),i||(i=mv.fromId(e),t&&(t[e]=i))}else i=Dt(mv,e);return i!=null&&i.destroyed&&(pk.warn("The provided basemap is already destroyed",{basemap:i}),i=null),i}function yJ(e){let t=null;const i=vJ(e),s=!i.baseLayers.length;for(const r in Gh){const n=wJ(i,vD(Gh[r]),{mustMatchReferences:s});if(n==="equal"){t=r;break}n==="base-layers-equal"&&(t=r)}return t}function gJ(e,t){var r,n,o;if(N(t)||N(e))return{spatialReference:null,updating:!1};if(t.loadStatus==="not-loaded")return t.load(),{spatialReference:null,updating:!0};if(t.spatialReference)return{spatialReference:t.spatialReference,updating:!1};if(t.baseLayers.length===0)return{spatialReference:null,updating:!1};const i=t.baseLayers.getItemAt(0);switch(i.loadStatus){case"not-loaded":i.load();case"loading":return{spatialReference:null,updating:!0};case"failed":return{spatialReference:null,updating:!1}}const s=(("supportedSpatialReferences"in i?i.supportedSpatialReferences:null)||["tileInfo"in i?(r=i.tileInfo)==null?void 0:r.spatialReference:i.spatialReference]).filter(Boolean);return e.spatialReference?{spatialReference:(o=(n=s.find(a=>e.spatialReference.equals(a)))!=null?n:s[0])!=null?o:null,updating:!1}:{spatialReference:s[0],updating:!1}}function vJ(e){return e?!e.loaded&&e.resourceInfo?vD(e.resourceInfo.data):{baseLayers:fk(e.baseLayers),referenceLayers:fk(e.referenceLayers)}:null}function fk(e){return(he.isCollection(e)?e.toArray():e).map(bJ)}function bJ(e){var t,i;return{type:e.type,url:bD("urlTemplate"in e&&e.urlTemplate||e.url||"styleUrl"in e&&e.styleUrl),minScale:"minScale"in e&&e.minScale!=null?e.minScale:0,maxScale:"maxScale"in e&&e.maxScale!=null?e.maxScale:0,opacity:e.opacity!=null?e.opacity:1,visible:e.visible==null||!!e.visible,sublayers:e.type!=="map-image"&&e.type!=="wms"||!M(e.sublayers)||(t=e.sublayers)==null?void 0:t.map(s=>({id:s.id,visible:s.visible})),activeLayerId:e.type==="wmts"?(i=e.activeLayer)==null?void 0:i.id:void 0}}function vD(e){return e?{baseLayers:mk(e.baseMapLayers.filter(t=>!t.isReference)),referenceLayers:mk(e.baseMapLayers.filter(t=>t.isReference))}:null}function mk(e){return e.map(t=>_J(t))}function _J(e){let t;switch(e.layerType){case"VectorTileLayer":t="vector-tile";break;case"ArcGISTiledMapServiceLayer":t="tile";break;default:t="unknown"}return{type:t,url:bD(e.templateUrl||e.urlTemplate||e.styleUrl||e.url),minScale:e.minScale!=null?e.minScale:0,maxScale:e.maxScale!=null?e.maxScale:0,opacity:e.opacity!=null?e.opacity:1,visible:e.visibility==null||!!e.visibility,sublayers:void 0,activeLayerId:void 0}}function wJ(e,t,i){return e!=null!=(t!=null)?"not-equal":e?yk(e.baseLayers,t.baseLayers)?yk(e.referenceLayers,t.referenceLayers)?"equal":i.mustMatchReferences?"not-equal":"base-layers-equal":"not-equal":"equal"}function yk(e,t){if(e.length!==t.length)return!1;for(let i=0;ithis.nextBasemap,e=>{e&&!e.loaded&&e.load().catch(()=>{})},Le)}destroy(){this.view=null,gD(this._basemapCache),this._basemapCache=null}get _nextBasemapSpatialReferenceTask(){return gJ(this.view,this.nextBasemap)}get _viewSpatialReferenceLocked(){return!("spatialReferenceLocked"in this.view)||this.view.spatialReferenceLocked}get activeBasemap(){var e,t,i;return xg((i=(t=(e=this.view)==null?void 0:e.map)==null?void 0:t.basemap)!=null?i:"topo",this._basemapCache)}castNextBasemap(e){return xg(e,this._basemapCache)}get state(){const{view:e}=this;if(!(e!=null&&e.ready)||this._nextBasemapSpatialReferenceTask.updating)return"disabled";const{spatialReference:t}=this._nextBasemapSpatialReferenceTask;return this._viewSpatialReferenceLocked&&M(t)&&!e.spatialReference.equals(t)?"incompatible-next-basemap":this._loadingProjectionEngine?"loading":"ready"}async toggle(){if(this.state==="disabled"||this.state==="incompatible-next-basemap")return;const{activeBasemap:e,nextBasemap:t}=this,i=this._viewSpatialReferenceLocked;if(!i){if(await ub(()=>!this._nextBasemapSpatialReferenceTask.updating),t!==this.nextBasemap||e!==this.activeBasemap)return;const{spatialReference:s}=this._nextBasemapSpatialReferenceTask;if(!M(s)||Kt(this.view.spatialReference,s)||ol()||Ro(this.view.spatialReference,s)||(this._loadingProjectionEngine=!0,await al(),this._loadingProjectionEngine=!1),t!==this.nextBasemap||e!==this.activeBasemap)return}this.view.map.basemap=t,i||!M(this._nextBasemapSpatialReferenceTask.spatialReference)||Kt(this.view.spatialReference,this._nextBasemapSpatialReferenceTask.spatialReference)||(this.view.spatialReference=this._nextBasemapSpatialReferenceTask.spatialReference),this.nextBasemap=e}static getThumbnailUrl(e){if(!e)return null;const{thumbnailUrl:t}=e;if(t)return t;const i=yJ(e);if(i)return Gh[i].thumbnailUrl;const s=e.baseLayers.find(r=>!!V1(r)().get("portalItem.thumbnailUrl"));return s?V1(s)().get("portalItem.thumbnailUrl"):null}};c([h()],Vs.prototype,"_loadingProjectionEngine",void 0),c([h({readOnly:!0})],Vs.prototype,"_nextBasemapSpatialReferenceTask",null),c([h({readOnly:!0})],Vs.prototype,"_viewSpatialReferenceLocked",null),c([h({readOnly:!0})],Vs.prototype,"activeBasemap",null),c([h()],Vs.prototype,"nextBasemap",void 0),c([Oe("nextBasemap")],Vs.prototype,"castNextBasemap",null),c([h({readOnly:!0})],Vs.prototype,"state",null),c([h()],Vs.prototype,"view",void 0),c([h()],Vs.prototype,"toggle",null),Vs=c([S("esri.widgets.BasemapToggle.BasemapToggleViewModel")],Vs);const F$=Vs;function xs(){return function(e,t){if(!e[t])throw new TypeError(`Cannot auto bind undefined function '${t}'`);return{value:MJ(e[t])}}}function SJ(e){const{type:t}=e;return e instanceof KeyboardEvent||t==="keyup"||t==="keydown"||t==="keypress"}function MJ(e){return function(t,...i){SJ(t)?sU(t.key)&&(t.preventDefault(),t.stopPropagation(),t.target.click()):e.call(this,t,...i)}}function di(e){return(t,i)=>{t.hasOwnProperty("_messageBundleProps")||(t._messageBundleProps=t._messageBundleProps?t._messageBundleProps.slice():[]),t._messageBundleProps.push({bundlePath:e,propertyName:i})}}var $J=function(e){return{vnodeSelector:"",properties:void 0,children:void 0,text:e.toString(),domNode:null}},_D=function(e,t){for(var i=0,s=e.length;iimport("./calcite-icon.8b0ddff6.js"),["assets/calcite-icon.8b0ddff6.js","assets/icon.781cca93.js","assets/observers.440ad120.js"]),z(()=>import("./calcite-scrim.b8319447.js"),["assets/calcite-scrim.b8319447.js","assets/scrim.51d512d2.js","assets/loader.d1e283c7.js","assets/guid.ae96513b.js"])])}get activeBasemap(){return this.viewModel.activeBasemap}get label(){var e,t;return(t=(e=this.messages)==null?void 0:e.widgetLabel)!=null?t:""}set label(e){this._overrideIfSome("label",e)}get nextBasemap(){return this.viewModel.nextBasemap}set nextBasemap(e){this.viewModel.nextBasemap=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}castVisibleElements(e){return{...vk,...e}}toggle(){return this.viewModel.toggle()}render(){const e=this.viewModel,t=e.state==="disabled"?null:e.activeBasemap,i=e.state==="disabled"?null:e.nextBasemap,s=e.state==="loading",r=e.state==="incompatible-next-basemap",n=i?i.title:"",o=i&&i.loadStatus!=="loaded";let a;const l=this.visibleElements.title&&n,u=r;return(l||u)&&(a=P("div",{class:Ps.overlay,key:"overlay"},l?P("span",{class:Ps.title,title:n},n):null,u?P("calcite-scrim",{class:Ps.overlayScrim,title:this.messages.incompatibleSpatialReference},P("calcite-icon",{icon:"exclamation-mark-triangle"})):null)),P("div",{class:this.classes(Ps.base,r?Ps.disabled:null),role:"button","data-basemap-id":i?i.id:"",bind:this,onclick:this._toggle,onkeydown:this._toggle,tabIndex:r?-1:0,title:this.label},P("div",{class:this.classes(Ps.container,Ps.secondaryBasemapImage)},P("div",{class:Ps.image,styles:gk(t)})),P("div",{class:Ps.container},P("div",{class:this.classes(Ps.image,o?Ps.imageLoading:null),styles:gk(i)},o||s?P("calcite-scrim",null,P("span",{"aria-hidden":"true",role:"presentation",class:Ps.loaderAnimation})):null),a))}_toggle(){this.toggle()}};c([h({readOnly:!0})],zs.prototype,"activeBasemap",null),c([h()],zs.prototype,"label",null),c([h(),di("esri/widgets/BasemapToggle/t9n/BasemapToggle")],zs.prototype,"messages",void 0),c([h()],zs.prototype,"nextBasemap",null),c([h()],zs.prototype,"view",null),c([h({type:F$})],zs.prototype,"viewModel",void 0),c([h()],zs.prototype,"visibleElements",void 0),c([Oe("visibleElements")],zs.prototype,"castVisibleElements",null),c([xs()],zs.prototype,"_toggle",null),zs=c([S("esri.widgets.BasemapToggle")],zs);const IJ=zs;let kh=class extends oe{constructor(){super(...arguments),this.updating=!1,this._handleId=0,this._handles=new qi,this._scheduleHandleId=0,this._pendingPromises=new Set}destroy(){this.removeAll(),this._handles.destroy()}add(e,t,i={}){return this._installWatch(e,t,i,Z)}addWhen(e,t,i={}){return this._installWatch(e,t,i,Qs)}addOnCollectionChange(e,t,{initial:i=!1,final:s=!1}={}){const r=++this._handleId;return this._handles.add([Is(e,"after-changes",this._createSyncUpdatingCallback(),Nh),Is(e,"change",t,{onListenerAdd:i?n=>t({added:n.toArray(),removed:[]}):void 0,onListenerRemove:s?n=>t({added:[],removed:n.toArray()}):void 0})],r),{remove:()=>this._handles.remove(r)}}addPromise(e){if(N(e))return e;const t=++this._handleId;this._handles.add({remove:()=>{this._pendingPromises.delete(e)&&(this._pendingPromises.size!==0||this._handles.has(_y)||this._set("updating",!1))}},t),this._pendingPromises.add(e),this._set("updating",!0);const i=()=>this._handles.remove(t);return e.then(i,i),e}removeAll(){this._pendingPromises.clear(),this._handles.removeAll(),this._set("updating",!1)}_installWatch(e,t,i={},s){const r=++this._handleId;i.sync||this._installSyncUpdatingWatch(e,r);const n=s(e,t,i);return this._handles.add(n,r),{remove:()=>this._handles.remove(r)}}_installSyncUpdatingWatch(e,t){const i=this._createSyncUpdatingCallback(),s=Z(e,i,{sync:!0,equals:()=>!1});return this._handles.add(s,t),s}_createSyncUpdatingCallback(){return()=>{this._handles.remove(_y),++this._scheduleHandleId;const e=this._scheduleHandleId;this._get("updating")||this._set("updating",!0),this._handles.add(ad(()=>{e===this._scheduleHandleId&&(this._set("updating",this._pendingPromises.size>0),this._handles.remove(_y))}),_y)}}};c([h({readOnly:!0})],kh.prototype,"updating",void 0),kh=c([S("esri.core.support.WatchUpdatingTracking")],kh);const _y=-42,pu=e=>{let t=class extends e{destroy(){var i,s;this.destroyed||((i=this._get("handles"))==null||i.destroy(),(s=this._get("updatingHandles"))==null||s.destroy())}get handles(){return this._get("handles")||new qi}get updatingHandles(){return this._get("updatingHandles")||new kh}};return c([h({readOnly:!0})],t.prototype,"handles",null),c([h({readOnly:!0})],t.prototype,"updatingHandles",null),t=c([S("esri.core.HandleOwner")],t),t};let yv=class extends pu(oe){};yv=c([S("esri.core.HandleOwner")],yv);let pf=class extends pu(he){constructor(e){super(e),this.handles.add([this.on("before-add",t=>{N(t.item)&&t.preventDefault()}),this.on("after-add",t=>this._own(t.item)),this.on("after-remove",t=>this._release(t.item))])}get owner(){return this._get("owner")}set owner(e){e!==this._get("owner")&&(this._releaseAll(),this._set("owner",e),this._ownAll())}_ownAll(){for(const e of this.items)this._own(e)}_releaseAll(){for(const e of this.items)this._release(e)}_createNewInstance(e){return this.itemType?new(he.ofType(this.itemType.Type))(e):new he(e)}};function nx(e,t){return{type:e,cast:hD,set(i){const s=ou(i,this._get(t),e);s.owner=this,this._set(t,s)}}}c([h()],pf.prototype,"owner",null),pf=c([S("esri.core.support.OwningCollection")],pf);const EJ=mi()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon"}),bk=mi()({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh"});function wD(e){return e.xmin!==void 0&&e.ymin!==void 0&&e.xmax!==void 0&&e.ymax!==void 0}function D$(e){return e.points!==void 0}function N$(e){return e.x!==void 0&&e.y!==void 0}function j$(e){return e.paths!==void 0}function Bc(e){return e.rings!==void 0}function ll(e){return N(e)?null:e instanceof fl?e:N$(e)?be.fromJSON(e):j$(e)?Ar.fromJSON(e):Bc(e)?Oo.fromJSON(e):D$(e)?wb.fromJSON(e):wD(e)?Ze.fromJSON(e):null}function Sb(e){return e?N$(e)?"esriGeometryPoint":j$(e)?"esriGeometryPolyline":Bc(e)?"esriGeometryPolygon":wD(e)?"esriGeometryEnvelope":D$(e)?"esriGeometryMultipoint":null:null}const kJ={esriGeometryPoint:be,esriGeometryPolyline:Ar,esriGeometryPolygon:Oo,esriGeometryEnvelope:Ze,esriGeometryMultipoint:wb};function CJ(e){return e&&kJ[e]||null}const fu={base:fl,key:"type",typeMap:{extent:Ze,multipoint:wb,point:be,polyline:Ar,polygon:Oo}};En(fu);let xD=0;const Om=e=>{let t=class extends e{constructor(...i){super(...i),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:Date.now().toString(16)+"-object-"+xD++})}};return t=c([S("esri.core.Identifiable")],t),t},V$=e=>{let t=class extends e{constructor(...i){super(...i),Object.defineProperty(this,"uid",{writable:!1,configurable:!1,value:xD++})}};return t=c([S("esri.core.NumericIdentifiable")],t),t};let _k=class extends Om(class{}){};_k=c([S("esri.core.Identifiable")],_k);async function PJ(e){const t="portalItem"in e?e:{portalItem:e},i=await z(()=>import("./portalLayers.72750f56.js"),["assets/portalLayers.72750f56.js","assets/lazyLayerLoader.4d2df2af.js","assets/layersLoader.afdddce2.js","assets/jsonContext.fe51f9bd.js","assets/portalItemUtils.92eef7f6.js"]);try{return await i.fromItem(t)}catch(s){const r=t&&t.portalItem,n=r&&r.id||"unset",o=r&&r.portal&&r.portal.url||je.portalUrl;throw q.getLogger("esri.layers.support.fromPortalItem").error("#fromPortalItem()","Failed to create layer from portal item (portal: '"+o+"', id: '"+n+"')",s),s}}let AJ=0,Gt=class extends jo.EventedMixin(Om(Lo)){constructor(){super(...arguments),this.attributionDataUrl=null,this.fullExtent=new Ze(-180,-90,180,90,xe.WGS84),this.id=Date.now().toString(16)+"-layer-"+AJ++,this.legendEnabled=!0,this.listMode="show",this.opacity=1,this.parent=null,this.popupEnabled=!0,this.attributionVisible=!0,this.spatialReference=xe.WGS84,this.title=null,this.type=null,this.url=null,this.visible=!0}static async fromArcGISServerUrl(e){const t=typeof e=="string"?{url:e}:e;return(await z(()=>import("./arcgisLayers.296603be.js"),["assets/arcgisLayers.296603be.js","assets/fetchService.88193309.js","assets/lazyLayerLoader.4d2df2af.js"])).fromUrl(t)}static fromPortalItem(e){return PJ(e)}initialize(){this.when().catch(e=>{var t,i;Ks(e)||q.getLogger(this.declaredClass).error("#load()",`Failed to load layer (title: '${(t=this.title)!=null?t:"no title"}', id: '${(i=this.id)!=null?i:"no id"}')`,{error:e})})}destroy(){if(this.parent){const e=this,t=this.parent;"layers"in t&&t.layers.includes(e)?t.layers.remove(e):"tables"in t&&t.tables.includes(e)?t.tables.remove(e):"baseLayers"in t&&t.baseLayers.includes(e)?t.baseLayers.remove(e):"baseLayers"in t&&t.referenceLayers.includes(e)&&t.referenceLayers.remove(e)}}get hasAttributionData(){return this.attributionDataUrl!=null}get parsedUrl(){return Ai(this.url)}async fetchAttributionData(){const e=this.attributionDataUrl;if(this.hasAttributionData&&e)return(await kt(e,{query:{f:"json"},responseType:"json"})).data;throw new L("layer:no-attribution-data","Layer does not have attribution data")}};c([h({type:String})],Gt.prototype,"attributionDataUrl",void 0),c([h({type:Ze})],Gt.prototype,"fullExtent",void 0),c([h({readOnly:!0})],Gt.prototype,"hasAttributionData",null),c([h({type:String,clonable:!1})],Gt.prototype,"id",void 0),c([h({type:Boolean,nonNullable:!0})],Gt.prototype,"legendEnabled",void 0),c([h({type:["show","hide","hide-children"]})],Gt.prototype,"listMode",void 0),c([h({type:Number,range:{min:0,max:1},nonNullable:!0})],Gt.prototype,"opacity",void 0),c([h({clonable:!1})],Gt.prototype,"parent",void 0),c([h({readOnly:!0})],Gt.prototype,"parsedUrl",null),c([h({type:Boolean})],Gt.prototype,"popupEnabled",void 0),c([h({type:Boolean})],Gt.prototype,"attributionVisible",void 0),c([h({type:xe})],Gt.prototype,"spatialReference",void 0),c([h({type:String})],Gt.prototype,"title",void 0),c([h({readOnly:!0,json:{read:!1}})],Gt.prototype,"type",void 0),c([h()],Gt.prototype,"url",void 0),c([h({type:Boolean,nonNullable:!0})],Gt.prototype,"visible",void 0),Gt=c([S("esri.layers.Layer")],Gt);const Yf=Gt,gv={transparent:[0,0,0,0],black:[0,0,0,1],silver:[192,192,192,1],gray:[128,128,128,1],white:[255,255,255,1],maroon:[128,0,0,1],red:[255,0,0,1],purple:[128,0,128,1],fuchsia:[255,0,255,1],green:[0,128,0,1],lime:[0,255,0,1],olive:[128,128,0,1],yellow:[255,255,0,1],navy:[0,0,128,1],blue:[0,0,255,1],teal:[0,128,128,1],aqua:[0,255,255,1],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],blanchedalmond:[255,235,205,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],oldlace:[253,245,230,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],rebeccapurple:[102,51,153,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],whitesmoke:[245,245,245,1],yellowgreen:[154,205,50,1]};function SD(e){return gv[e]||gv[e.toLowerCase()]}function z$(e){var t;return(t=gv[e])!=null?t:gv[e.toLowerCase()]}function OJ(e){return[...z$(e)]}function V_(e,t,i){i<0&&++i,i>1&&--i;const s=6*i;return s<1?e+(t-e)*s:2*i<1?t:3*i<2?e+(t-e)*(2/3-i)*6:e}function MD(e,t,i,s=1){const r=(e%360+360)%360/360,n=i<=.5?i*(t+1):i+t-i*t,o=2*i-n;return[Math.round(255*V_(o,n,r+1/3)),Math.round(255*V_(o,n,r)),Math.round(255*V_(o,n,r-1/3)),s]}function RJ(e){const t=e.length>5,i=t?8:4,s=(1<>=i,a[3]=r*l/255),l=o&s,o>>=i,a[2]=r*l,l=o&s,o>>=i,a[1]=r*l,l=o&s,o>>=i,a[0]=r*l,a}const LJ=/^-?(\d+(\.\d+)?)\s*((px)|(pt))?$/i,FJ="screenUtils.toPt: input not recognized!",$D=96;function TD(e){return e?e/72*$D:0}function Fo(e){return e?72*e/$D:0}function Fe(e){if(typeof e=="string"){const t=e.match(LJ);if(t){const i=Number(t[1]),s=t[3]&&t[3].toLowerCase(),r=e.charAt(0)==="-",n=s==="px"?Fo(i):i;return r?-n:n}return console.warn(FJ),null}return e}function ns(e=0,t=0){return{x:e,y:t}}function kbe(e=0,t=0){return[e,t]}function Mb(){const e=new Float32Array(16);return e[0]=1,e[5]=1,e[10]=1,e[15]=1,e}function DJ(e){const t=new Float32Array(16);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}function NJ(e,t,i,s,r,n,o,a,l,u,d,f,m,y,g,v){const b=new Float32Array(16);return b[0]=e,b[1]=t,b[2]=i,b[3]=s,b[4]=r,b[5]=n,b[6]=o,b[7]=a,b[8]=l,b[9]=u,b[10]=d,b[11]=f,b[12]=m,b[13]=y,b[14]=g,b[15]=v,b}function jJ(e,t){return new Float32Array(e,t,16)}const VJ=Mb();Object.freeze(Object.defineProperty({__proto__:null,create:Mb,clone:DJ,fromValues:NJ,createView:jJ,IDENTITY:VJ},Symbol.toStringTag,{value:"Module"}));const zJ=(e,t)=>{const i=pl(e,t,0,0,0,0,t,0,0,0,0,t,0,0,0,0,1);return Vo(i,i)},BJ=(e,t)=>{const i=pl(e,t,0,0,.5-.5*t,0,t,0,.5-.5*t,0,0,t,.5-.5*t,0,0,0,1);return Vo(i,i)},UJ=(e,t)=>{const i=1-t,s=pl(e,.2126+.7874*i,.7152-.7152*i,.0722-.0722*i,0,.2126-.2126*i,.7152+.2848*i,.0722-.0722*i,0,.2126-.2126*i,.7152-.7152*i,.0722+.9278*i,0,0,0,0,1);return Vo(s,s)},qJ=(e,t)=>{const i=Math.sin(t*Math.PI/180),s=Math.cos(t*Math.PI/180),r=pl(e,.213+.787*s-.213*i,.715-.715*s-.715*i,.072-.072*s+.928*i,0,.213-.213*s+.143*i,.715+.285*s+.14*i,.072-.072*s-.283*i,0,.213-.213*s-.787*i,.715-.715*s+.715*i,.072+.928*s+.072*i,0,0,0,0,1);return Vo(r,r)},GJ=(e,t)=>{const i=1-2*t,s=pl(e,i,0,0,t,0,i,0,t,0,0,i,t,0,0,0,1);return Vo(s,s)},WJ=(e,t)=>{const i=pl(e,.213+.787*t,.715-.715*t,.072-.072*t,0,.213-.213*t,.715+.285*t,.072-.072*t,0,.213-.213*t,.715-.715*t,.072+.928*t,0,0,0,0,1);return Vo(i,i)},HJ=(e,t)=>{const i=1-t,s=pl(e,.393+.607*i,.769-.769*i,.189-.189*i,0,.349-.349*i,.686+.314*i,.168-.168*i,0,.272-.272*i,.534-.534*i,.131+.869*i,0,0,0,0,1);return Vo(s,s)};class $b{constructor(t,i,s){this.strength=t,this.radius=i,this.threshold=s,this.type="bloom"}interpolate(t,i,s){this.strength=ts(t.strength,i.strength,s),this.radius=ts(t.radius,i.radius,s),this.threshold=ts(t.threshold,i.threshold,s)}clone(){return new $b(this.strength,this.radius,this.threshold)}toJSON(){return{type:"bloom",radius:ff(this.radius),strength:this.strength,threshold:this.threshold}}}class Tb{constructor(t){this.radius=t,this.type="blur"}interpolate(t,i,s){this.radius=Math.round(ts(t.radius,i.radius,s))}clone(){return new Tb(this.radius)}toJSON(){return{type:"blur",radius:ff(this.radius)}}}class Jf{constructor(t,i){this.type=t,this.amount=i,this.type!=="invert"&&this.type!=="grayscale"&&this.type!=="sepia"||(this.amount=Math.min(this.amount,1))}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(t,i,s){this.amount=ts(t.amount,i.amount,s),this._updateMatrix()}clone(){return new Jf(this.type,this.amount)}toJSON(){return{type:this.type,amount:this.amount}}_updateMatrix(){const t=this._colorMatrix||Mb();switch(this.type){case"brightness":this._colorMatrix=zJ(t,this.amount);break;case"contrast":this._colorMatrix=BJ(t,this.amount);break;case"grayscale":this._colorMatrix=UJ(t,this.amount);break;case"invert":this._colorMatrix=GJ(t,this.amount);break;case"saturate":this._colorMatrix=WJ(t,this.amount);break;case"sepia":this._colorMatrix=HJ(t,this.amount)}}}class Ib{constructor(t,i,s,r){this.offsetX=t,this.offsetY=i,this.blurRadius=s,this.color=r,this.type="drop-shadow"}interpolate(t,i,s){this.offsetX=ts(t.offsetX,i.offsetX,s),this.offsetY=ts(t.offsetY,i.offsetY,s),this.blurRadius=ts(t.blurRadius,i.blurRadius,s),this.color[0]=Math.round(ts(t.color[0],i.color[0],s)),this.color[1]=Math.round(ts(t.color[1],i.color[1],s)),this.color[2]=Math.round(ts(t.color[2],i.color[2],s)),this.color[3]=ts(t.color[3],i.color[3],s)}clone(){return new Ib(this.offsetX,this.offsetY,this.blurRadius,[...this.color])}toJSON(){const t=[...this.color];return t[3]*=255,{type:"drop-shadow",xoffset:ff(this.offsetX),yoffset:ff(this.offsetY),blurRadius:ff(this.blurRadius),color:t}}}class Eb{constructor(t){this.angle=t,this.type="hue-rotate"}get colorMatrix(){return this._colorMatrix||this._updateMatrix(),this._colorMatrix}interpolate(t,i,s){this.angle=ts(t.angle,i.angle,s),this._updateMatrix()}clone(){return new Eb(this.angle)}toJSON(){return{type:"hue-rotate",angle:this.angle}}_updateMatrix(){const t=this._colorMatrix||Mb();this._colorMatrix=qJ(t,this.angle)}}class kb{constructor(t){this.amount=t,this.type="opacity",this.amount=Math.min(this.amount,1)}interpolate(t,i,s){this.amount=ts(t.amount,i.amount,s)}clone(){return new kb(this.amount)}toJSON(){return{type:"opacity",amount:this.amount}}}function ts(e,t,i){return e+(t-e)*i}function ff(e){return Math.round(1e3*Fo(e))/1e3}function YJ(e){switch(e.type){case"grayscale":case"sepia":case"invert":return new Jf(e.type,0);case"saturate":case"brightness":case"contrast":return new Jf(e.type,1);case"opacity":return new kb(1);case"hue-rotate":return new Eb(0);case"blur":return new Tb(0);case"drop-shadow":return new Ib(0,0,0,[...z$("transparent")]);case"bloom":return new $b(0,0,1)}}function JJ(e,t){const i=e.length>t.length?e:t;return(e.length>t.length?t:e).every((s,r)=>s.type===i[r].type)}function XJ(e,t){const i=e.length>t.length?e:t,s=e.length>t.length?t:e;for(let r=s.length;r{if(!Number.isFinite(i.scale)||i.scale<=0)throw new L("effect:invalid-scale","scale must be finite and greater than 0",{stop:i});return{scale:i.scale,effects:Sk(i.value)}});t.sort((i,s)=>s.effects.length-i.effects.length);for(let i=0;is.scale-i.scale),t}function Sk(e){let t;if(!e)return[];try{t=ID.exports.parse(e)}catch(i){throw new L("effect:invalid-syntax","Invalid effect syntax",{value:e,error:i})}return t.map(i=>QJ(i))}function QJ(e){try{switch(e.name){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":return KJ(e);case"opacity":return eX(e);case"hue-rotate":return tX(e);case"blur":return iX(e);case"drop-shadow":return sX(e);case"bloom":return rX(e)}}catch(t){throw t.details.filter=e,t}throw new L("effect:unknown-effect",`Effect '${e.name}' is not supported`,{effect:e})}function KJ(e){let t=1;return dd(e.parameters,1),e.parameters.length===1&&(t=Ir(e.parameters[0])),new Jf(e.name,t)}function eX(e){let t=1;return dd(e.parameters,1),e.parameters.length===1&&(t=Ir(e.parameters[0])),new kb(t)}function tX(e){let t=0;return dd(e.parameters,1),e.parameters.length===1&&(t=uX(e.parameters[0])),new Eb(t)}function iX(e){let t=0;return dd(e.parameters,1),e.parameters.length===1&&(t=q$(e.parameters[0]),Rm(t,e.parameters[0])),new Tb(t)}function sX(e){const t=[];let i=null;for(const s of e.parameters)if(s.type==="color"){if(t.length&&Object.freeze(t),i)throw new L("effect:type-error","Accepts only one color",{});i=hX(s)}else{const r=q$(s);if(Object.isFrozen(t))throw new L("effect:type-error"," parameters not consecutive",{lengths:t});t.push(r),t.length===3&&Rm(r,s)}if(t.length<2||t.length>3)throw new L("effect:type-error",`Expected {2,3}, Actual: {${t.length}}`,{lengths:t});return new Ib(t[0],t[1],t[2]||0,i||kD("black"))}function rX(e){let t=1,i=0,s=0;return dd(e.parameters,3),e.parameters[0]&&(t=Ir(e.parameters[0])),e.parameters[1]&&(i=q$(e.parameters[1]),Rm(i,e.parameters[1])),e.parameters[2]&&(s=Ir(e.parameters[2])),new $b(t,i,s)}function dd(e,t){if(e.length>t)throw new L("effect:type-error",`Function supports up to ${t} parameters, Actual: ${e.length}`,{parameters:e})}function Cb(e){if(e.type==="color")return"";if(e.unit){if(U$[e.unit])return"";if(B$[e.unit])return"";if(e.unit==="%")return""}return""}function Rm(e,t){if(e<0)throw new L("effect:type-error",`Negative values are not allowed, Actual: ${e}`,{term:t})}function nX(e){if(e.type!=="quantity"||e.unit!==null)throw new L("effect:type-error",`Expected , Actual: ${Cb(e)}`,{term:e})}function oX(e){if(e.type!=="quantity"||e.unit!==null&&e.unit!=="%")throw new L("effect:type-error",`Expected or , Actual: ${Cb(e)}`,{term:e})}xk=function(){function e(r,n){function o(){this.constructor=r}o.prototype=n.prototype,r.prototype=new o}function t(r,n,o,a){var l=Error.call(this,r);return Object.setPrototypeOf&&Object.setPrototypeOf(l,t.prototype),l.expected=n,l.found=o,l.location=a,l.name="SyntaxError",l}function i(r,n,o){return o=o||" ",r.length>n?r:(n-=r.length,r+(o+=o.repeat(n)).slice(0,n))}function s(r,n){var o,a={},l=(n=n!==void 0?n:{}).grammarSource,u={start:RI},d=RI,f="none",m=")",y=",",g="(",v="%",b="px",_="cm",x="mm",$="in",I="pt",T="pc",k="deg",A="rad",F="grad",G="turn",U="#",J=".",H="e",te=/^[ \t\n\r]/,se=/^[a-z\-]/,me=/^[0-9a-fA-F]/,Ee=/^[+\-]/,re=/^[0-9]/,ne=Nn("none"),ke=ti("none",!1),ir=ti(")",!1),sr=ti(",",!1),rr=Nn("whitespace"),nr=Td([" "," ",` `,"\r"],!1,!1),Fn=Nn("function"),_l=ti("(",!1),Dn=Nn("identifier"),kI=Td([["a","z"],"-"],!1,!1),FV=Nn("percentage"),DV=ti("%",!1),NV=Nn("length"),jV=ti("px",!1),VV=ti("cm",!1),zV=ti("mm",!1),BV=ti("in",!1),UV=ti("pt",!1),qV=ti("pc",!1),GV=Nn("angle"),WV=ti("deg",!1),HV=ti("rad",!1),YV=ti("grad",!1),JV=ti("turn",!1),XV=Nn("number"),ZV=Nn("color"),QV=ti("#",!1),CI=Td([["0","9"],["a","f"],["A","F"]],!1,!1),PI=Td(["+","-"],!1,!1),Bo=Td([["0","9"]],!1,!1),KV=ti(".",!1),e6=ti("e",!1),t6=function(){return[]},i6=function(E,B){return{type:"function",name:E,parameters:B||[]}},s6=function(E,B){return B.length>0?F6(E,B,3):[E]},r6=function(E){return{type:"quantity",value:E.value,unit:E.unit}},n6=function(E){return{type:"color",colorType:E.type,value:E.value}},o6=function(E){return E},a6=function(){return sy()},l6=function(E){return{value:E,unit:"%"}},c6=function(E){return{value:E,unit:"px"}},u6=function(E){return{value:E,unit:"cm"}},h6=function(E){return{value:E,unit:"mm"}},d6=function(E){return{value:E,unit:"in"}},p6=function(E){return{value:E,unit:"pt"}},f6=function(E){return{value:E,unit:"pc"}},m6=function(E){return{value:E,unit:"deg"}},y6=function(E){return{value:E,unit:"rad"}},g6=function(E){return{value:E,unit:"grad"}},v6=function(E){return{value:E,unit:"turn"}},b6=function(E){return{value:E,unit:null}},_6=function(){return{type:"hex",value:sy()}},w6=function(E){return{type:"function",value:E}},x6=function(){return{type:"named",value:sy()}},S6=function(){return parseFloat(sy())},j=0,ht=0,iy=[{line:1,column:1}],Gr=0,m_=[],le=0;if("startRule"in n){if(!(n.startRule in u))throw new Error(`Can't start parsing from rule "`+n.startRule+'".');d=u[n.startRule]}function sy(){return r.substring(ht,j)}function ti(E,B){return{type:"literal",text:E,ignoreCase:B}}function Td(E,B,X){return{type:"class",parts:E,inverted:B,ignoreCase:X}}function M6(){return{type:"end"}}function Nn(E){return{type:"other",description:E}}function AI(E){var B,X=iy[E];if(X)return X;for(B=E-1;!iy[B];)B--;for(X={line:(X=iy[B]).line,column:X.column};BGr&&(Gr=j,m_=[]),m_.push(E))}function $6(E,B,X){return new t(t.buildMessage(E,B),E,B,X)}function RI(){var E;return(E=T6())===a&&(E=I6()),E}function T6(){var E,B;return le++,E=j,ii(),r.substr(j,4)===f?(B=f,j+=4):(B=a,le===0&&we(ke)),B!==a?(ii(),ht=E,E=t6()):(j=E,E=a),le--,E===a&&le===0&&we(ne),E}function I6(){var E,B;if(E=[],(B=y_())!==a)for(;B!==a;)E.push(B),B=y_();else E=a;return E}function y_(){var E,B,X,$e;return E=j,ii(),(B=k6())!==a?(ii(),(X=E6())===a&&(X=null),ii(),r.charCodeAt(j)===41?($e=m,j++):($e=a,le===0&&we(ir)),$e!==a?(ii(),ht=E,E=i6(B,X)):(j=E,E=a)):(j=E,E=a),E}function E6(){var E,B,X,$e,hi,mt,ks,ry;if(E=j,(B=g_())!==a){for(X=[],$e=j,hi=ii(),r.charCodeAt(j)===44?(mt=y,j++):(mt=a,le===0&&we(sr)),mt===a&&(mt=null),ks=ii(),(ry=g_())!==a?$e=hi=[hi,mt,ks,ry]:(j=$e,$e=a);$e!==a;)X.push($e),$e=j,hi=ii(),r.charCodeAt(j)===44?(mt=y,j++):(mt=a,le===0&&we(sr)),mt===a&&(mt=null),ks=ii(),(ry=g_())!==a?$e=hi=[hi,mt,ks,ry]:(j=$e,$e=a);ht=E,E=s6(B,X)}else j=E,E=a;return E}function g_(){var E,B;return E=j,(B=C6())===a&&(B=P6())===a&&(B=A6())===a&&(B=O6()),B!==a&&(ht=E,B=r6(B)),(E=B)===a&&(E=j,(B=R6())!==a&&(ht=E,B=n6(B)),E=B),E}function ii(){var E,B;for(le++,E=[],te.test(r.charAt(j))?(B=r.charAt(j),j++):(B=a,le===0&&we(nr));B!==a;)E.push(B),te.test(r.charAt(j))?(B=r.charAt(j),j++):(B=a,le===0&&we(nr));return le--,B=a,le===0&&we(rr),E}function k6(){var E,B,X;return le++,E=j,(B=LI())!==a?(r.charCodeAt(j)===40?(X=g,j++):(X=a,le===0&&we(_l)),X!==a?(ht=E,E=o6(B)):(j=E,E=a)):(j=E,E=a),le--,E===a&&(B=a,le===0&&we(Fn)),E}function LI(){var E,B,X;if(le++,E=j,B=[],se.test(r.charAt(j))?(X=r.charAt(j),j++):(X=a,le===0&&we(kI)),X!==a)for(;X!==a;)B.push(X),se.test(r.charAt(j))?(X=r.charAt(j),j++):(X=a,le===0&&we(kI));else B=a;return B!==a&&(ht=E,B=a6()),le--,(E=B)===a&&(B=a,le===0&&we(Dn)),E}function C6(){var E,B,X;return le++,E=j,ii(),(B=Es())!==a?(r.charCodeAt(j)===37?(X=v,j++):(X=a,le===0&&we(DV)),X!==a?(ht=E,E=l6(B)):(j=E,E=a)):(j=E,E=a),le--,E===a&&le===0&&we(FV),E}function P6(){var E,B,X;return le++,E=j,ii(),(B=Es())!==a?(r.substr(j,2)===b?(X=b,j+=2):(X=a,le===0&&we(jV)),X!==a?(ht=E,E=c6(B)):(j=E,E=a)):(j=E,E=a),E===a&&(E=j,ii(),(B=Es())!==a?(r.substr(j,2)===_?(X=_,j+=2):(X=a,le===0&&we(VV)),X!==a?(ht=E,E=u6(B)):(j=E,E=a)):(j=E,E=a),E===a&&(E=j,ii(),(B=Es())!==a?(r.substr(j,2)===x?(X=x,j+=2):(X=a,le===0&&we(zV)),X!==a?(ht=E,E=h6(B)):(j=E,E=a)):(j=E,E=a),E===a&&(E=j,ii(),(B=Es())!==a?(r.substr(j,2)===$?(X=$,j+=2):(X=a,le===0&&we(BV)),X!==a?(ht=E,E=d6(B)):(j=E,E=a)):(j=E,E=a),E===a&&(E=j,ii(),(B=Es())!==a?(r.substr(j,2)===I?(X=I,j+=2):(X=a,le===0&&we(UV)),X!==a?(ht=E,E=p6(B)):(j=E,E=a)):(j=E,E=a),E===a&&(E=j,ii(),(B=Es())!==a?(r.substr(j,2)===T?(X=T,j+=2):(X=a,le===0&&we(qV)),X!==a?(ht=E,E=f6(B)):(j=E,E=a)):(j=E,E=a)))))),le--,E===a&&le===0&&we(NV),E}function A6(){var E,B,X;return le++,E=j,(B=Es())!==a?(r.substr(j,3)===k?(X=k,j+=3):(X=a,le===0&&we(WV)),X!==a?(ht=E,E=m6(B)):(j=E,E=a)):(j=E,E=a),E===a&&(E=j,(B=Es())!==a?(r.substr(j,3)===A?(X=A,j+=3):(X=a,le===0&&we(HV)),X!==a?(ht=E,E=y6(B)):(j=E,E=a)):(j=E,E=a),E===a&&(E=j,(B=Es())!==a?(r.substr(j,4)===F?(X=F,j+=4):(X=a,le===0&&we(YV)),X!==a?(ht=E,E=g6(B)):(j=E,E=a)):(j=E,E=a),E===a&&(E=j,(B=Es())!==a?(r.substr(j,4)===G?(X=G,j+=4):(X=a,le===0&&we(JV)),X!==a?(ht=E,E=v6(B)):(j=E,E=a)):(j=E,E=a)))),le--,E===a&&(B=a,le===0&&we(GV)),E}function O6(){var E,B;return le++,E=j,ii(),(B=Es())!==a?(ht=E,E=b6(B)):(j=E,E=a),le--,E===a&&le===0&&we(XV),E}function R6(){var E,B,X,$e;if(le++,E=j,r.charCodeAt(j)===35?(B=U,j++):(B=a,le===0&&we(QV)),B!==a){if(X=[],me.test(r.charAt(j))?($e=r.charAt(j),j++):($e=a,le===0&&we(CI)),$e!==a)for(;$e!==a;)X.push($e),me.test(r.charAt(j))?($e=r.charAt(j),j++):($e=a,le===0&&we(CI));else X=a;X!==a?(ht=E,E=_6()):(j=E,E=a)}else j=E,E=a;return E===a&&(E=j,(B=y_())!==a&&(ht=E,B=w6(B)),(E=B)===a&&(E=j,(B=LI())!==a&&(ht=E,B=x6()),E=B)),le--,E===a&&(B=a,le===0&&we(ZV)),E}function Es(){var E,B,X,$e,hi,mt,ks;for(E=j,Ee.test(r.charAt(j))?(r.charAt(j),j++):le===0&&we(PI),B=j,X=[],re.test(r.charAt(j))?($e=r.charAt(j),j++):($e=a,le===0&&we(Bo));$e!==a;)X.push($e),re.test(r.charAt(j))?($e=r.charAt(j),j++):($e=a,le===0&&we(Bo));if(r.charCodeAt(j)===46?($e=J,j++):($e=a,le===0&&we(KV)),$e!==a){if(hi=[],re.test(r.charAt(j))?(mt=r.charAt(j),j++):(mt=a,le===0&&we(Bo)),mt!==a)for(;mt!==a;)hi.push(mt),re.test(r.charAt(j))?(mt=r.charAt(j),j++):(mt=a,le===0&&we(Bo));else hi=a;hi!==a?B=X=[X,$e,hi]:(j=B,B=a)}else j=B,B=a;if(B===a)if(B=[],re.test(r.charAt(j))?(X=r.charAt(j),j++):(X=a,le===0&&we(Bo)),X!==a)for(;X!==a;)B.push(X),re.test(r.charAt(j))?(X=r.charAt(j),j++):(X=a,le===0&&we(Bo));else B=a;if(B!==a){if(X=j,r.charCodeAt(j)===101?($e=H,j++):($e=a,le===0&&we(e6)),$e!==a){if(Ee.test(r.charAt(j))?(hi=r.charAt(j),j++):(hi=a,le===0&&we(PI)),hi===a&&(hi=null),mt=[],re.test(r.charAt(j))?(ks=r.charAt(j),j++):(ks=a,le===0&&we(Bo)),ks!==a)for(;ks!==a;)mt.push(ks),re.test(r.charAt(j))?(ks=r.charAt(j),j++):(ks=a,le===0&&we(Bo));else mt=a;mt!==a?X=$e=[$e,hi,mt]:(j=X,X=a)}else j=X,X=a;X===a&&(X=null),ht=E,E=S6()}else j=E,E=a;return E}function L6(E,B){return E.map(function(X){return X[B]})}function F6(E,B,X){return[E].concat(L6(B,X))}if((o=d())!==a&&j===r.length)return o;throw o!==a&&j `+u+` `+f+` | `+l.line+" | "+m+` `+f+" | "+i("",l.column-1," ")+i("",y,"^")}else n+=` - at `+u}return n},t.buildMessage=function(r,n){var o={literal:function(y){return'"'+l(y.text)+'"'},class:function(y){var g=y.parts.map(function(v){return Array.isArray(v)?u(v[0])+"-"+u(v[1]):u(v)});return"["+(y.inverted?"^":"")+g.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(y){return y.description}};function a(y){return y.charCodeAt(0).toString(16).toUpperCase()}function l(y){return y.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(g){return"\\x0"+a(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+a(g)})}function u(y){return y.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(g){return"\\x0"+a(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+a(g)})}function d(y){return o[y.type](y)}function f(y){var g,v,b=y.map(d);if(b.sort(),b.length>0){for(g=1,v=1;g, Actual: ${Cb(e)}`,{term:e})}const U$={px:1,cm:96/2.54,mm:96/2.54/10,in:96,pc:16,pt:96/72};function lX(e){if(e.type!=="quantity"||!(e.value===0&&e.unit===null||e.unit&&U$[e.unit]!=null))throw new L("effect:type-error",`Expected , Actual: ${Cb(e)}`,{term:e})}function Ir(e){oX(e);const t=e.value;return Rm(t,e),e.unit==="%"?.01*t:t}function cX(e){return nX(e),Rm(e.value,e),e.value}function uX(e){return aX(e),e.value*B$[e.unit]||0}function q$(e){return lX(e),e.value*U$[e.unit]||0}function hX(e){switch(e.colorType){case"hex":return RJ(e.value);case"named":return kD(e.value);case"function":return fX(e.value)}}function kD(e){if(!SD(e))throw new L("effect:unknown-color",`color '${e}' isn't valid`,{namedColor:e});return OJ(e)}const dX=/^rgba?/i,pX=/^hsla?/i;function fX(e){if(dd(e.parameters,4),dX.test(e.name))return[Ir(e.parameters[0]),Ir(e.parameters[1]),Ir(e.parameters[2]),e.parameters[3]?Ir(e.parameters[3]):1];if(pX.test(e.name))return MD(cX(e.parameters[0]),Ir(e.parameters[1]),Ir(e.parameters[2]),e.parameters[3]?Ir(e.parameters[3]):1);throw new L("effect:syntax-error",`Invalid color function '${e.name}'`,{colorFunction:e})}function G$(e,t,i){var s;try{return yX(e)}catch(r){(s=i==null?void 0:i.messages)==null||s.push(r)}return null}function W$(e,t,i,s){try{const r=mX(e);Ei(i,r,t)}catch(r){s.messages&&s.messages.push(r)}}function mX(e){const t=ED(e);return t?ZJ(t)?t.map(i=>i.toJSON()):t.map(({scale:i,effects:s})=>({scale:i,value:s.map(r=>r.toJSON())})):null}function yX(e){if(!e||e.length===0)return null;if(gX(e)){const t=[];for(const i of e)t.push({scale:i.scale,value:Mk(i.value)});return t}return Mk(e)}function gX(e){const t=e[0];return!!t&&"scale"in t}function Mk(e){if(!e||!e.length)return"";const t=[];for(const i of e){let s=[];switch(i.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":s=[Vn(i,"amount")];break;case"blur":s=[Vn(i,"radius","pt")];break;case"hue-rotate":s=[Vn(i,"angle","deg")];break;case"drop-shadow":s=[Vn(i,"xoffset","pt"),Vn(i,"yoffset","pt"),Vn(i,"blurRadius","pt"),vX(i,"color")];break;case"bloom":s=[Vn(i,"strength"),Vn(i,"radius","pt"),Vn(i,"threshold")]}const r=`${i.type}(${s.filter(Boolean).join(" ")})`;ED(r),t.push(r)}return t.join(" ")}function Vn(e,t,i){if(e[t]==null)throw new L("effect:missing-parameter",`Missing parameter '${t}' in ${e.type} effect`,{effect:e});return i?e[t]+i:""+e[t]}function vX(e,t){if(e[t]==null)throw new L("effect:missing-parameter",`Missing parameter '${t}' in ${e.type} effect`,{effect:e});const i=e[t];return`rgba(${i[0]||0}, ${i[1]||0}, ${i[2]||0}, ${i[3]/255||0})`}const $k={read:{reader:G$},write:{allowNull:!0,writer:W$}},CD=e=>{let t=class extends e{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return c([h({type:["average","color-burn","color-dodge","color","darken","destination-atop","destination-in","destination-out","destination-over","difference","exclusion","hard-light","hue","invert","lighten","lighter","luminosity","minus","multiply","normal","overlay","plus","reflect","saturation","screen","soft-light","source-atop","source-in","source-out","vivid-light","xor"],nonNullable:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:!0},"portal-item":{read:!0,write:!0}}}})],t.prototype,"blendMode",void 0),c([h({json:{read:!1,write:!1,origins:{"web-map":$k,"portal-item":$k}}})],t.prototype,"effect",void 0),t=c([S("esri.layers.mixins.BlendLayer")],t),t},PD=e=>{let t=class extends e{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const i={minScale:this.minScale,maxScale:this.maxScale},s=this.parent;s&&"effectiveScaleRange"in s&&bX(i,s.effectiveScaleRange);const r=this._get("effectiveScaleRange");return r&&r.minScale===i.minScale&&r.maxScale===i.maxScale?r:i}};return c([h({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"minScale",void 0),c([h({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"maxScale",void 0),c([h({readOnly:!0})],t.prototype,"effectiveScaleRange",null),t=c([S("esri.layers.mixins.ScaleRangeLayer")],t),t};function bX(e,t){return e.minScale=e.minScale>0?t.minScale>0?Math.min(e.minScale,t.minScale):e.minScale:t.minScale,e.maxScale=e.maxScale>0?t.maxScale>0?Math.max(e.maxScale,t.maxScale):e.maxScale:t.maxScale,e}const xt=e=>{let t=class extends e{clone(){var l;const i=Hs(ki(this),"unable to clone instance of non-accessor class"),s=i.metadatas,r=i.store,n={},o=new Map;for(const u in s){const d=s[u],f=r==null?void 0:r.originOf(u),m=d.clonable;if(d.readOnly||m===!1||f!==Pe.USER&&f!==Pe.DEFAULTS&&f!==Pe.WEB_MAP&&f!==Pe.WEB_SCENE)continue;const y=this[u];let g=null;g=typeof m=="function"?m(y):m==="reference"?y:h1(y),y!=null&&g==null||(f===Pe.DEFAULTS?o.set(u,g):n[u]=g)}const a=new(Object.getPrototypeOf(this)).constructor(n);if(o.size){const u=(l=ki(a))==null?void 0:l.store;if(u)for(const[d,f]of o)u.set(d,f,Pe.DEFAULTS)}return a}};return t=c([S("esri.core.Clonable")],t),t};let Tk=class extends xt(oe){};Tk=c([S("esri.core.Clonable")],Tk);var Wh;function _X(e,t){switch(e.type){case"range":{const i="range"in e?e.range[0]:e.minValue,s="range"in e?e.range[1]:e.maxValue;if(i!=null&&+ts)return Wh.VALUE_OUT_OF_RANGE;break}case"coded-value":case"codedValue":if(e.codedValues==null||e.codedValues.every(i=>i==null||i.code!==t))return Wh.INVALID_CODED_VALUE}return null}(function(e){e.VALUE_OUT_OF_RANGE="domain-validation-error::value-out-of-range",e.INVALID_CODED_VALUE="domain-validation-error::invalid-coded-value"})(Wh||(Wh={}));const wX=q.getLogger("esri.support.arcadeOnDemand");let z_;function Do(){return z_||(z_=(async()=>{const e=await z(()=>import("./arcadeUtils.9e078218.js").then(function(t){return t.ay}),["assets/arcadeUtils.9e078218.js","assets/number.8c2c26f3.js"]);return{arcade:e.arcade,arcadeUtils:e,Dictionary:e.Dictionary,Feature:e.arcadeFeature}})()),z_}const Cbe=(e,t,i)=>Lm.create(e,t,i,null,["$feature"]),Pbe=(e,t,i)=>Lm.create(e,t,i,null,["$feature","$view"]),xX=(e,t,i,s)=>Lm.create(e,t,i,s,["$feature","$view"]);class Lm{constructor(t,i,s,r,n,o,a,l){this.script=t,this.evaluate=n;const u=Array.isArray(a)?a:a.fields;this.fields=u,this._syntaxTree=r,this._arcade=i,this._arcadeDictionary=s,this._arcadeFeature=o,this._spatialReference=l,this._referencesGeometry=i.scriptTouchesGeometry(this._syntaxTree),this._referencesScale=this._arcade.referencesMember(this._syntaxTree,"scale")}static async create(t,i,s,r,n,o){const{arcade:a,Feature:l,Dictionary:u}=await Do(),d=xe.fromJSON(i);let f=null;try{f=a.parseScript(t,o)}catch(F){return wX.error(new L("arcade-bad-expression","Failed to parse arcade script",{script:t,error:F})),null}const m=n.reduce((F,G)=>({...F,[G]:null}),{});let y=null;M(r)&&(y=new u(r),y.immutable=!0,m.$config=null);const g=a.scriptUsesGeometryEngine(f),v=g&&a.enableGeometrySupport(),b=a.scriptUsesFeatureSet(f)&&a.enableFeatureSetSupport(),_=a.scriptIsAsync(f),x=_&&a.enableAsyncSupport(),$={vars:m,spatialReference:d,useAsync:!!x};await Promise.all([v,b,x]);const I=new Set;await a.loadDependentModules(I,f,null,_,g);const T=new u;T.immutable=!1,T.setField("scale",0);const k=a.compileScript(f,$),A=F=>("$view"in F&&F.$view&&(T.setField("scale",F.$view.scale),F.$view=T),y&&(F.$config=y),k({vars:F,spatialReference:d}));return new Lm(t,a,u,f,A,new l,s,d)}repurposeFeature(t){return t.geometry&&!t.geometry.spatialReference&&(t.geometry.spatialReference=this._spatialReference),this._arcadeFeature.repurposeFromGraphicLikeObject(t.geometry,t.attributes,{fields:this.fields}),this._arcadeFeature}createDictionary(){return new this._arcadeDictionary}referencesMember(t){return this._arcade.referencesMember(this._syntaxTree,t)}referencesFunction(t){return this._arcade.referencesFunction(this._syntaxTree,t)}referencesGeometry(){return this._referencesGeometry}referencesScale(){return this._referencesScale}extractFieldLiterals(){return this._arcade.extractExpectedFieldLiterals(this._syntaxTree)}}const SX=/^([0-9])/,MX=/[^A-Za-z0-9_\u0080-\uffff]/g,$X=/_{2,}/g,TX=/^_/,IX=/_$/;function EX(e){return e?e.trim().replace(MX,"_").replace($X,"_").replace(TX,"").replace(IX,"").replace(SX,"F$1"):null}const kX=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],CX=["field","normalizationField"];function Ik(e,t){if(e!=null&&t!=null){for(const i of Array.isArray(e)?e:[e])if(Ek(kX,i,t),"visualVariables"in i&&i.visualVariables)for(const s of i.visualVariables)Ek(CX,s,t)}}function Ek(e,t,i){if(e)for(const s of e){const r=rd(s,t),n=r&&typeof r!="function"&&i.get(r);n&&Ei(s,n.name,t)}}function AD(e,t){var i,s,r,n,o;if(e!=null&&((i=t==null?void 0:t.fields)==null?void 0:i.length))if("startField"in e){const a=t.get(e.startField),l=t.get(e.endField);e.startField=(s=a==null?void 0:a.name)!=null?s:null,e.endField=(r=l==null?void 0:l.name)!=null?r:null}else{const a=t.get(e.startTimeField),l=t.get(e.endTimeField);e.startTimeField=(n=a==null?void 0:a.name)!=null?n:null,e.endTimeField=(o=l==null?void 0:l.name)!=null?o:null}}const B_=new Set;function OD(e,t){return e&&t?(B_.clear(),Xf(B_,e,t),Array.from(B_).sort()):[]}function Xf(e,t,i){var s;if(i)if((s=t==null?void 0:t.fields)!=null&&s.length)if(i.includes("*"))for(const{name:r}of t.fields)e.add(r);else for(const r of i)$s(e,t,r);else{if(i.includes("*"))return e.clear(),void e.add("*");for(const r of i)r!=null&&e.add(r)}}function $s(e,t,i){if(typeof i=="string")if(t){const s=t.get(i);s&&e.add(s.name)}else e.add(i)}function Abe(e,t){var i;return N(t)||N(e)?[]:t.includes("*")?((i=e.fields)!=null?i:[]).map(s=>s.name):t}async function Ui(e,t,i){var n;if(!i)return;const{arcadeUtils:s}=await Do(),r=s.extractFieldNames(i,(n=t==null?void 0:t.fields)==null?void 0:n.map(o=>o.name));for(const o of r)$s(e,t,o)}async function RD(e,t,i){if(i&&i!=="1=1"){const s=(await z(()=>import("./WhereClause.253310fe.js"),[])).WhereClause.create(i,t);if(!s.isStandardized)throw new L("fieldUtils:collectFilterFields","Where clause is not standardized",{where:i});Xf(e,t,s.fieldNames)}}function PX({displayField:e,fields:t}){return e||(t&&t.length?U_(t,"name-or-title")||U_(t,"unique-identifier")||U_(t,"type-or-category")||AX(t):null)}function AX(e){for(const t of e){if(!t||!t.name)continue;const i=t.name.toLowerCase();if(i.includes("name")||i.includes("title"))return t.name}return null}function U_(e,t){for(const i of e)if(i&&i.valueType&&i.valueType===t)return i.name;return null}async function Obe(e,t){if(!t)return;const i=rd("elevationInfo.featureExpressionInfo",t);return i?i.collectRequiredFields(e,t.fieldsIndex):void 0}function OX(e,t,i){i.onStatisticExpression?Ui(e,t,i.onStatisticExpression.expression):e.add(i.onStatisticField)}async function Rbe(e,t,i){if(!t||!i||!("fields"in i))return;const s=[],r=i.popupTemplate;s.push(RX(e,t,r)),i.fields&&s.push(...i.fields.map(async n=>OX(e,t.fieldsIndex,n))),await Promise.all(s)}async function RX(e,t,i){const s=[];i!=null&&i.expressionInfos&&s.push(...i.expressionInfos.map(n=>Ui(e,t.fieldsIndex,n.expression)));const r=i==null?void 0:i.content;if(Array.isArray(r))for(const n of r)n.type==="expression"&&n.expressionInfo&&s.push(Ui(e,t.fieldsIndex,n.expressionInfo.expression));await Promise.all(s)}async function Lbe(e,t,i){t&&(t.timeInfo&&M(i)&&i.timeExtent&&Xf(e,t.fieldsIndex,[t.timeInfo.startField,t.timeInfo.endField]),t.floorInfo&&Xf(e,t.fieldsIndex,[t.floorInfo.floorField]),M(i)&&M(i.where)&&await RD(e,t.fieldsIndex,i.where))}async function Fbe(e,t,i){t&&i&&await Promise.all(i.map(s=>LX(e,t,s)))}async function LX(e,t,i){t&&i&&(i.valueExpression?await Ui(e,t.fieldsIndex,i.valueExpression):i.field&&$s(e,t.fieldsIndex,i.field))}function Dbe(e){if(!e)return[];const t="editFieldsInfo"in e&&e.editFieldsInfo;return t?OD(e.fieldsIndex,[t&&t.creatorField,t&&t.creationDateField,t&&t.editorField,t&&t.editDateField]):[]}async function Nbe(e,t){const{labelingInfo:i,fieldsIndex:s}=t;i&&i.length&&await Promise.all(i.map(r=>FX(e,s,r)))}async function FX(e,t,i){if(!i)return;const s=i.getLabelExpression(),r=i.where;if(s.type==="arcade")await Ui(e,t,s.expression);else{const n=s.expression.match(/{[^}]*}/g);n&&n.forEach(o=>{$s(e,t,o.slice(1,-1))})}await RD(e,t,r)}function DX(e){const t=e.defaultValue;return t!==void 0&&DD(e,t)?t:e.nullable?null:void 0}function LD(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}function NX(e){return e===null||LD(e)}const H$="isInteger"in Number?Number.isInteger:e=>typeof e=="number"&&isFinite(e)&&Math.floor(e)===e;function jX(e){return e===null||H$(e)}function FD(e){return e!=null&&typeof e=="string"}function VX(e){return e===null||FD(e)}function zX(){return!0}function DD(e,t){let i;switch(e.type){case"date":case"integer":case"long":case"small-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":i=e.nullable?jX:H$;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":i=e.nullable?NX:LD;break;case"string":case"esriFieldTypeString":i=e.nullable?VX:FD;break;default:i=zX}return arguments.length===1?i:i(t)}const BX=["integer","small-integer","single","double"],UX=new Set([...BX,"esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSingle","esriFieldTypeDouble"]);function Y$(e){return e!=null&&UX.has(e.type)}function jbe(e){return e!=null&&(e.type==="string"||e.type==="esriFieldTypeString")}var vv,bv;function Vbe(e){return e==null||typeof e=="number"&&isNaN(e)?null:e}function zbe(e,t){return e.nullable&&t===null?null:Y$(e)&&!qX(e.type,Number(t))?vv.OUT_OF_RANGE:DD(e,t)?e.domain?_X(e.domain,t):null:bv.INVALID_TYPE}function qX(e,t){const i=typeof e=="string"?ND(e):e;if(!i)return!1;const s=i.min,r=i.max;return i.isInteger?H$(t)&&t>=s&&t<=r:t>=s&&t<=r}function ND(e){switch(e){case"esriFieldTypeSmallInteger":case"small-integer":return GX;case"esriFieldTypeInteger":case"integer":return WX;case"esriFieldTypeSingle":case"single":return HX;case"esriFieldTypeDouble":case"double":return YX}}(function(e){e.OUT_OF_RANGE="numeric-range-validation-error::out-of-range"})(vv||(vv={})),function(e){e.INVALID_TYPE="type-validation-error::invalid-type"}(bv||(bv={}));const GX={min:-32768,max:32767,isInteger:!0},WX={min:-2147483648,max:2147483647,isInteger:!0},HX={min:-34e37,max:12e37,isInteger:!1},YX={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1};function Bbe(e,t,i){switch(e){case Wh.INVALID_CODED_VALUE:return`Value ${i} is not in the coded domain - field: ${t.name}, domain: ${JSON.stringify(t.domain)}`;case Wh.VALUE_OUT_OF_RANGE:return`Value ${i} is out of the range of valid values - field: ${t.name}, domain: ${JSON.stringify(t.domain)}`;case bv.INVALID_TYPE:return`Value ${i} is not a valid value for the field type - field: ${t.name}, type: ${t.type}, nullable: ${t.nullable}`;case vv.OUT_OF_RANGE:{const{min:s,max:r}=ND(t.type);return`Value ${i} is out of range for the number type - field: ${t.name}, type: ${t.type}, value range is ${s} to ${r}`}}}function JX(e,t){return!XX(e,t,null)}function XX(e,t,i){if(!t||!t.attributes||!e){if(M(i))for(const n of e!=null?e:[])i.add(n);return!0}const s=t.attributes;let r=!1;for(const n of e)if(!(n in s)){if(r=!0,!M(i))break;i.add(n)}return r}function jD(e){return["raster.itempixelvalue","raster.servicepixelvalue"].some(t=>e.toLowerCase().startsWith(t))}let Sg=class extends W{constructor(e){super(e),this.type=null}};c([h({type:["attachments","custom","fields","media","text","expression","relationship"],readOnly:!0,json:{read:!1,write:!0}})],Sg.prototype,"type",void 0),Sg=c([S("esri.popup.content.Content")],Sg);const ml=Sg;var ox;let Rl=ox=class extends ml{constructor(e){super(e),this.description=null,this.displayType="auto",this.title=null,this.type="attachments"}clone(){return new ox({description:this.description,displayType:this.displayType,title:this.title})}};c([h({type:String,json:{write:!0}})],Rl.prototype,"description",void 0),c([h({type:["auto","preview","list"],json:{write:!0}})],Rl.prototype,"displayType",void 0),c([h({type:String,json:{write:!0}})],Rl.prototype,"title",void 0),c([h({type:["attachments"],readOnly:!0,json:{read:!1,write:!0}})],Rl.prototype,"type",void 0),Rl=ox=c([S("esri.popup.content.AttachmentsContent")],Rl);const Zf=Rl;var ax;let Ll=ax=class extends ml{constructor(e){super(e),this.creator=null,this.destroyer=null,this.outFields=null,this.type="custom"}clone(){return new ax({creator:this.creator,destroyer:this.destroyer,outFields:Array.isArray(this.outFields)?R(this.outFields):null})}};c([h()],Ll.prototype,"creator",void 0),c([h()],Ll.prototype,"destroyer",void 0),c([h()],Ll.prototype,"outFields",void 0),c([h({type:["custom"],readOnly:!0})],Ll.prototype,"type",void 0),Ll=ax=c([S("esri.popup.content.CustomContent")],Ll);const ZX=Ll;var lx;let Ou=lx=class extends W{constructor(e){super(e),this.title=null,this.expression=null,this.returnType="dictionary"}clone(){return new lx({title:this.title,expression:this.expression})}};c([h({type:String,json:{write:!0}})],Ou.prototype,"title",void 0),c([h({type:String,json:{write:!0}})],Ou.prototype,"expression",void 0),c([h({type:["dictionary"],readOnly:!0,json:{read:!1,write:!0}})],Ou.prototype,"returnType",void 0),Ou=lx=c([S("esri.popup.ElementExpressionInfo")],Ou);const VD=Ou;var cx;let up=cx=class extends ml{constructor(e){super(e),this.expressionInfo=null,this.type="expression"}clone(){var e;return new cx({expressionInfo:(e=this.expressionInfo)==null?void 0:e.clone()})}};c([h({type:VD,json:{write:!0}})],up.prototype,"expressionInfo",void 0),c([h({type:["expression"],readOnly:!0,json:{read:!1,write:!0}})],up.prototype,"type",void 0),up=cx=c([S("esri.popup.content.ExpressionContent")],up);const J$=up;function ue(e,t={}){var r;const i=e instanceof Ie?e:new Ie(e,t),s={type:(r=t==null?void 0:t.ignoreUnknown)==null||r?i.apiValues:String,json:{type:i.jsonValues,read:!(t!=null&&t.readOnly)&&{reader:i.read},write:{writer:i.write}}};return(t==null?void 0:t.readOnly)!==void 0&&(s.readOnly=!!t.readOnly),(t==null?void 0:t.default)!==void 0&&(s.json.default=t.default),(t==null?void 0:t.name)!==void 0&&(s.json.name=t.name),h(s)}const Qf=mi()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"});Qf.toJSON.bind(Qf);Qf.fromJSON.bind(Qf);var ux;let Fl=ux=class extends W{constructor(e){super(e),this.dateFormat=null,this.dateTimeFormatOptions=null,this.digitSeparator=!1,this.places=null}clone(){return new ux({dateFormat:this.dateFormat,digitSeparator:this.digitSeparator,places:this.places})}format(e){return this.dateFormat?Po(e,{...HM(this.dateFormat),...this.dateTimeFormatOptions}):sl(e,nR(this))}formatRasterPixelValue(e){if(e.includes("-"))return e;let t,i;return e.trim().includes(",")?(t=",",i=t+" ",this._formatDelimitedString(e,t,i,this)):e.trim().includes(";")?(t=";",i=t+" ",this._formatDelimitedString(e,t,i,this)):e.trim().includes(" ")?(t=i=" ",this._formatDelimitedString(e,t,i,this)):this.format(Number(e))}_formatDelimitedString(e,t,i,s){return e&&t&&i&&s?e.trim().split(t).map(r=>this.format(Number(r))).join(i):e}};c([ue(Qf)],Fl.prototype,"dateFormat",void 0),c([h({type:Object,json:{read:!1}})],Fl.prototype,"dateTimeFormatOptions",void 0),c([h({type:Boolean,json:{write:!0}})],Fl.prototype,"digitSeparator",void 0),c([h({type:Ge,json:{write:!0}})],Fl.prototype,"places",void 0),Fl=ux=c([S("esri.popup.support.FieldInfoFormat")],Fl);const fh=Fl;var hx;let hr=hx=class extends W{constructor(e){super(e),this.fieldName=null,this.format=null,this.isEditable=!1,this.label=null,this.stringFieldOption="text-box",this.statisticType=null,this.tooltip=null,this.visible=!0}clone(){return new hx({fieldName:this.fieldName,format:this.format?R(this.format):null,isEditable:this.isEditable,label:this.label,stringFieldOption:this.stringFieldOption,statisticType:this.statisticType,tooltip:this.tooltip,visible:this.visible})}};c([h({type:String,json:{write:!0}})],hr.prototype,"fieldName",void 0),c([h({type:fh,json:{write:!0}})],hr.prototype,"format",void 0),c([h({type:Boolean,json:{write:!0,default:!1}})],hr.prototype,"isEditable",void 0),c([h({type:String,json:{write:!0}})],hr.prototype,"label",void 0),c([ue(new Ie({richtext:"rich-text",textarea:"text-area",textbox:"text-box"}),{default:"text-box"})],hr.prototype,"stringFieldOption",void 0),c([h({type:["count","sum","min","max","avg","stddev","var"],json:{write:!0}})],hr.prototype,"statisticType",void 0),c([h({type:String,json:{write:!0}})],hr.prototype,"tooltip",void 0),c([h({type:Boolean,json:{write:!0}})],hr.prototype,"visible",void 0),hr=hx=c([S("esri.popup.FieldInfo")],hr);const Fm=hr;var dx;let Hn=dx=class extends ml{constructor(e){super(e),this.attributes=null,this.description=null,this.fieldInfos=null,this.title=null,this.type="fields"}writeFieldInfos(e,t){t.fieldInfos=e&&e.map(i=>i.toJSON())}clone(){return new dx(R({attributes:this.attributes,description:this.description,fieldInfos:this.fieldInfos,title:this.title}))}};c([h({type:Object,json:{write:!0}})],Hn.prototype,"attributes",void 0),c([h({type:String,json:{write:!0}})],Hn.prototype,"description",void 0),c([h({type:[Fm]})],Hn.prototype,"fieldInfos",void 0),c([ie("fieldInfos")],Hn.prototype,"writeFieldInfos",null),c([h({type:String,json:{write:!0}})],Hn.prototype,"title",void 0),c([h({type:["fields"],readOnly:!0,json:{read:!1,write:!0}})],Hn.prototype,"type",void 0),Hn=dx=c([S("esri.popup.content.FieldsContent")],Hn);const Hh=Hn;let Dl=class extends W{constructor(e){super(e),this.altText=null,this.caption="",this.title="",this.type=null}};c([h({type:String,json:{write:!0}})],Dl.prototype,"altText",void 0),c([h({type:String,json:{write:!0}})],Dl.prototype,"caption",void 0),c([h({type:String,json:{write:!0}})],Dl.prototype,"title",void 0),c([h({type:["image","bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],Dl.prototype,"type",void 0),Dl=c([S("esri.popup.content.mixins.MediaInfo")],Dl);const X$=Dl;var px;let Ru=px=class extends oe{constructor(e){super(e),this.fieldName=null,this.tooltip=null,this.value=null}clone(){return new px({fieldName:this.fieldName,tooltip:this.tooltip,value:this.value})}};c([h()],Ru.prototype,"fieldName",void 0),c([h()],Ru.prototype,"tooltip",void 0),c([h()],Ru.prototype,"value",void 0),Ru=px=c([S("esri.popup.content.support.ChartMediaInfoValueSeries")],Ru);const zD=Ru;var fx;let Nl=fx=class extends W{constructor(e){super(e),this.fields=[],this.normalizeField=null,this.series=[],this.tooltipField=null}clone(){return new fx({fields:R(this.fields),normalizeField:this.normalizeField,tooltipField:this.tooltipField})}};c([h({type:[String],json:{write:!0}})],Nl.prototype,"fields",void 0),c([h({type:String,json:{write:!0}})],Nl.prototype,"normalizeField",void 0),c([h({type:[zD],json:{read:!1}})],Nl.prototype,"series",void 0),c([h({type:String,json:{write:!0}})],Nl.prototype,"tooltipField",void 0),Nl=fx=c([S("esri.popup.content.support.ChartMediaInfoValue")],Nl);const QX=Nl;let hp=class extends X${constructor(e){super(e),this.type=null,this.value=null}};c([h({type:["bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],hp.prototype,"type",void 0),c([h({type:QX,json:{write:!0}})],hp.prototype,"value",void 0),hp=c([S("esri.popup.content.mixins.ChartMediaInfo")],hp);const Pb=hp,Ab=mi()({barchart:"bar-chart",columnchart:"column-chart",linechart:"line-chart",piechart:"pie-chart"});var mx;let Mg=mx=class extends Pb{constructor(e){super(e),this.type="bar-chart"}clone(){return new mx({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};c([h({type:["bar-chart"],readOnly:!0,json:{type:["barchart"],read:!1,write:Ab.write}})],Mg.prototype,"type",void 0),Mg=mx=c([S("esri.popup.content.BarChartMediaInfo")],Mg);const BD=Mg;var yx;let $g=yx=class extends Pb{constructor(e){super(e),this.type="column-chart"}clone(){return new yx({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};c([h({type:["column-chart"],readOnly:!0,json:{type:["columnchart"],read:!1,write:Ab.write}})],$g.prototype,"type",void 0),$g=yx=c([S("esri.popup.content.ColumnChartMediaInfo")],$g);const UD=$g;var gx;let dp=gx=class extends W{constructor(e){super(e),this.linkURL=null,this.sourceURL=null}clone(){return new gx({linkURL:this.linkURL,sourceURL:this.sourceURL})}};c([h({type:String,json:{write:!0}})],dp.prototype,"linkURL",void 0),c([h({type:String,json:{write:!0}})],dp.prototype,"sourceURL",void 0),dp=gx=c([S("esri.popup.content.support.ImageMediaInfoValue")],dp);const KX=dp;var vx;let Lu=vx=class extends X${constructor(e){super(e),this.refreshInterval=null,this.type="image",this.value=null}clone(){return new vx({altText:this.altText,title:this.title,caption:this.caption,refreshInterval:this.refreshInterval,value:this.value?this.value.clone():null})}};c([h({type:Number,json:{write:!0}})],Lu.prototype,"refreshInterval",void 0),c([h({type:["image"],readOnly:!0,json:{read:!1,write:!0}})],Lu.prototype,"type",void 0),c([h({type:KX,json:{write:!0}})],Lu.prototype,"value",void 0),Lu=vx=c([S("esri.popup.content.ImageMediaInfo")],Lu);const qD=Lu;var bx;let Tg=bx=class extends Pb{constructor(e){super(e),this.type="line-chart"}clone(){return new bx({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};c([h({type:["line-chart"],readOnly:!0,json:{type:["linechart"],read:!1,write:Ab.write}})],Tg.prototype,"type",void 0),Tg=bx=c([S("esri.popup.content.LineChartMediaInfo")],Tg);const GD=Tg;var _x;let Ig=_x=class extends Pb{constructor(e){super(e),this.type="pie-chart"}clone(){return new _x({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};c([h({type:["pie-chart"],readOnly:!0,json:{type:["piechart"],read:!1,write:Ab.write}})],Ig.prototype,"type",void 0),Ig=_x=c([S("esri.popup.content.PieChartMediaInfo")],Ig);const WD=Ig,HD={base:X$,key:"type",defaultKeyValue:"image",typeMap:{"bar-chart":BD,"column-chart":UD,"line-chart":GD,"pie-chart":WD,image:qD}};var wx;let dr=wx=class extends ml{constructor(e){super(e),this.activeMediaInfoIndex=null,this.attributes=null,this.description=null,this.mediaInfos=null,this.title=null,this.type="media"}readMediaInfos(e){return e&&e.map(t=>t.type==="image"?qD.fromJSON(t):t.type==="barchart"?BD.fromJSON(t):t.type==="columnchart"?UD.fromJSON(t):t.type==="linechart"?GD.fromJSON(t):t.type==="piechart"?WD.fromJSON(t):void 0).filter(Boolean)}writeMediaInfos(e,t){t.mediaInfos=e&&e.map(i=>i.toJSON())}clone(){return new wx(R({activeMediaInfoIndex:this.activeMediaInfoIndex,attributes:this.attributes,description:this.description,mediaInfos:this.mediaInfos,title:this.title}))}};c([h()],dr.prototype,"activeMediaInfoIndex",void 0),c([h({type:Object,json:{write:!0}})],dr.prototype,"attributes",void 0),c([h({type:String,json:{write:!0}})],dr.prototype,"description",void 0),c([h({types:[HD]})],dr.prototype,"mediaInfos",void 0),c([Q("mediaInfos")],dr.prototype,"readMediaInfos",null),c([ie("mediaInfos")],dr.prototype,"writeMediaInfos",null),c([h({type:String,json:{write:!0}})],dr.prototype,"title",void 0),c([h({type:["media"],readOnly:!0,json:{read:!1,write:!0}})],dr.prototype,"type",void 0),dr=wx=c([S("esri.popup.content.MediaContent")],dr);const Kf=dr;var xx;let pp=xx=class extends W{constructor(e){super(e),this.field=null,this.order=null}clone(){return new xx({field:this.field,order:this.order})}};c([h({type:String,json:{write:!0}})],pp.prototype,"field",void 0),c([h({type:["asc","desc"],json:{write:!0}})],pp.prototype,"order",void 0),pp=xx=c([S("esri.popup.support.RelatedRecordsInfoFieldOrder")],pp);const Z$=pp;let Zr=class extends xt(ml){constructor(e){super(e),this.description=null,this.displayCount=null,this.displayType="list",this.orderByFields=null,this.relationshipId=null,this.title=null,this.type="relationship"}};c([h({type:String,json:{write:!0}})],Zr.prototype,"description",void 0),c([h({type:Number,json:{type:Ge,write:!0}})],Zr.prototype,"displayCount",void 0),c([h({type:["list"],json:{write:!0}})],Zr.prototype,"displayType",void 0),c([h({type:[Z$],json:{write:!0}})],Zr.prototype,"orderByFields",void 0),c([h({type:Number,json:{type:Ge,write:!0}})],Zr.prototype,"relationshipId",void 0),c([h({type:String,json:{write:!0}})],Zr.prototype,"title",void 0),c([h({type:["relationship"],readOnly:!0,json:{read:!1,write:!0}})],Zr.prototype,"type",void 0),Zr=c([S("esri.popup.content.RelationshipContent")],Zr);const _v=Zr;var Sx;let fp=Sx=class extends ml{constructor(e){super(e),this.text=null,this.type="text"}clone(){return new Sx({text:this.text})}};c([h({type:String,json:{write:!0}})],fp.prototype,"text",void 0),c([h({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],fp.prototype,"type",void 0),fp=Sx=c([S("esri.popup.content.TextContent")],fp);const Yh=fp,eZ={base:null,key:"type",typeMap:{attachment:Zf,media:Kf,text:Yh,expression:J$,field:Hh,relationship:_v}};var Mx;let jl=Mx=class extends W{constructor(e){super(e),this.name=null,this.title=null,this.expression=null,this.returnType=null}clone(){return new Mx({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};c([h({type:String,json:{write:!0}})],jl.prototype,"name",void 0),c([h({type:String,json:{write:!0}})],jl.prototype,"title",void 0),c([h({type:String,json:{write:!0}})],jl.prototype,"expression",void 0),c([h({type:["string","number"],json:{write:!0}})],jl.prototype,"returnType",void 0),jl=Mx=c([S("esri.popup.ExpressionInfo")],jl);const YD=jl;var $x;let mp=$x=class extends W{constructor(e){super(e),this.returnTopmostRaster=null,this.showNoDataRecords=null}clone(){return new $x({showNoDataRecords:this.showNoDataRecords,returnTopmostRaster:this.returnTopmostRaster})}};c([h({type:Boolean,json:{write:!0}})],mp.prototype,"returnTopmostRaster",void 0),c([h({type:Boolean,json:{write:!0}})],mp.prototype,"showNoDataRecords",void 0),mp=$x=c([S("esri.popup.LayerOptions")],mp);const tZ=mp;var Tx;let yp=Tx=class extends W{constructor(e){super(e),this.showRelatedRecords=null,this.orderByFields=null}clone(){return new Tx({showRelatedRecords:this.showRelatedRecords,orderByFields:this.orderByFields?R(this.orderByFields):null})}};c([h({type:Boolean,json:{write:!0}})],yp.prototype,"showRelatedRecords",void 0),c([h({type:[Z$],json:{write:!0}})],yp.prototype,"orderByFields",void 0),yp=Tx=c([S("esri.popup.RelatedRecordsInfo")],yp);const iZ=yp;var Ix;let pr=Ix=class extends Om(oe){constructor(e){super(e),this.active=!1,this.className=null,this.disabled=!1,this.id=null,this.indicator=!1,this.title=null,this.type=null,this.visible=!0}clone(){return new Ix({active:this.active,className:this.className,disabled:this.disabled,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible})}};c([h()],pr.prototype,"active",void 0),c([h()],pr.prototype,"className",void 0),c([h()],pr.prototype,"disabled",void 0),c([h()],pr.prototype,"id",void 0),c([h()],pr.prototype,"indicator",void 0),c([h()],pr.prototype,"title",void 0),c([h()],pr.prototype,"type",void 0),c([h()],pr.prototype,"visible",void 0),pr=Ix=c([S("esri.support.actions.ActionBase")],pr);const Ob=pr;var Ex;let Eg=Ex=class extends Ob{constructor(e){super(e),this.image=null,this.type="button"}clone(){return new Ex({active:this.active,className:this.className,disabled:this.disabled,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image})}};c([h()],Eg.prototype,"image",void 0),Eg=Ex=c([S("esri.support.Action.ActionButton")],Eg);const pd=Eg;var kx;let gp=kx=class extends Ob{constructor(e){super(e),this.image=null,this.type="toggle",this.value=!1}clone(){return new kx({active:this.active,className:this.className,disabled:this.disabled,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image,value:this.value})}};c([h()],gp.prototype,"image",void 0),c([h()],gp.prototype,"value",void 0),gp=kx=c([S("esri.support.Action.ActionToggle")],gp);const JD=gp,sZ="esri.PopupTemplate",rZ=q.getLogger(sZ),Ld="relationships/",kk="expression/",nZ=he.ofType({key:"type",defaultKeyValue:"button",base:Ob,typeMap:{button:pd,toggle:JD}}),oZ={base:ml,key:"type",typeMap:{media:Kf,custom:ZX,text:Yh,attachments:Zf,fields:Hh,expression:J$,relationship:_v}},aZ=["attachments","fields","media","text","expression","relationship"];let Wt=class extends xt(W){constructor(){super(...arguments),this.actions=null,this.content="",this.expressionInfos=null,this.fieldInfos=null,this.layerOptions=null,this.lastEditInfoEnabled=!0,this.outFields=null,this.overwriteActions=!1,this.returnGeometry=!1,this.title=""}castContent(e){return Array.isArray(e)?e.map(t=>En(oZ,t)):typeof e=="string"||typeof e=="function"||e instanceof HTMLElement||No(e)?e:(rZ.error("content error","unsupported content value",{value:e}),null)}readContent(e,t){const{popupElements:i}=t;return Array.isArray(i)&&i.length>0?this._readPopupInfoElements(t.description,t.mediaInfos,i):this._readPopupInfo(t)}writeContent(e,t,i,s){typeof e!="string"?Array.isArray(e)&&(t.popupElements=e.filter(r=>aZ.includes(r.type)).map(r=>r&&r.toJSON(s)),t.popupElements.forEach(r=>{r.type==="attachments"?this._writeAttachmentContent(t):r.type==="media"?this._writeMediaContent(r,t):r.type==="text"?this._writeTextContent(r,t):r.type==="relationship"&&this._writeRelationshipContent(r,t)})):t.description=e}writeFieldInfos(e,t,i,s){const{content:r}=this,n=Array.isArray(r)?r:null;if(e){const o=n?n.filter(l=>l.type==="fields"):[],a=o.length&&o.every(l=>{var u;return(u=l.fieldInfos)==null?void 0:u.length});t.fieldInfos=e.filter(Boolean).map(l=>{const u=l.toJSON(s);return a&&(u.visible=!1),u})}if(n)for(const o of n)o.type==="fields"&&this._writeFieldsContent(o,t)}writeLayerOptions(e,t,i,s){t[i]=!e||e.showNoDataRecords===null&&e.returnTopmostRaster===null?null:e.toJSON(s)}writeTitle(e,t){t.title=e||""}async collectRequiredFields(e,t){const i=this.expressionInfos||[];await this._collectExpressionInfoFields(e,t,[...i,...this._getContentExpressionInfos(this.content,i)]),Xf(e,t,[...this.outFields||[],...this._getActionsFields(this.actions),...this._getTitleFields(this.title),...this._getContentFields(this.content)])}async getRequiredFields(e){const t=new Set;return await this.collectRequiredFields(t,e),[...t].sort()}_writeFieldsContent(e,t){if(!Array.isArray(e.fieldInfos)||!e.fieldInfos.length)return;const i=R(e.fieldInfos);Array.isArray(t.fieldInfos)?i.forEach(s=>{const r=t.fieldInfos.find(n=>n.fieldName.toLowerCase()===s.fieldName.toLowerCase());r?r.visible=!0:t.fieldInfos.push(s)}):t.fieldInfos=i}_writeAttachmentContent(e){e.showAttachments||(e.showAttachments=!0)}_writeRelationshipContent(e,t){var r,n;const i=((r=e.orderByFields)==null?void 0:r.map(o=>this._toFieldOrderJSON(o,e.relationshipId)))||[],s=[...((n=t.relatedRecordsInfo)==null?void 0:n.orderByFields)||[],...i];t.relatedRecordsInfo={showRelatedRecords:!0,...(s==null?void 0:s.length)&&{orderByFields:s}}}_writeTextContent(e,t){!t.description&&e.text&&(t.description=e.text)}_writeMediaContent(e,t){if(!Array.isArray(e.mediaInfos)||!e.mediaInfos.length)return;const i=R(e.mediaInfos);Array.isArray(t.mediaInfos)?t.mediaInfos=[...t.mediaInfos,...i]:t.mediaInfos=i}_readPopupInfoElements(e,t,i){const s={description:!1,mediaInfos:!1};return i.map(r=>r.type==="media"?(r.mediaInfos||!t||s.mediaInfos||(r.mediaInfos=t,s.mediaInfos=!0),Kf.fromJSON(r)):r.type==="text"?(r.text||!e||s.description||(r.text=e,s.description=!0),Yh.fromJSON(r)):r.type==="attachments"?Zf.fromJSON(r):r.type==="fields"?Hh.fromJSON(r):r.type==="expression"?J$.fromJSON(r):r.type==="relationship"?_v.fromJSON(r):void 0).filter(Boolean)}_toRelationshipContent(e){const{field:t,order:i}=e;if(!(t!=null&&t.startsWith(Ld)))return null;const s=t.replace(Ld,"").split("/");if(s.length!==2)return null;const r=parseInt(s[0],10),n=s[1];return typeof r=="number"&&n?_v.fromJSON({relationshipId:r,orderByFields:[{field:n,order:i}]}):null}_toFieldOrderJSON(e,t){const{order:i,field:s}=e;return{field:`${Ld}${t}/${s}`,order:i}}_readPopupInfo({description:e,mediaInfos:t,showAttachments:i,relatedRecordsInfo:s={showRelatedRecords:!1}}){const r=[];e?r.push(new Yh({text:e})):r.push(new Hh),Array.isArray(t)&&t.length&&r.push(Kf.fromJSON({mediaInfos:t})),i&&r.push(Zf.fromJSON({displayType:"auto"}));const{showRelatedRecords:n,orderByFields:o}=s;return n&&(o==null?void 0:o.length)&&o.forEach(a=>{const l=this._toRelationshipContent(a);l&&r.push(l)}),r.length?r:e}_getContentElementFields(e){var i;const t=e==null?void 0:e.type;if(t==="attachments")return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description)];if(t==="custom")return e.outFields||[];if(t==="fields")return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description),...this._getFieldInfoFields((i=e.fieldInfos)!=null?i:this.fieldInfos)];if(t==="media"){const s=e.mediaInfos||[];return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description),...s.reduce((r,n)=>[...r,...this._getMediaInfoFields(n)],[])]}return t==="text"?this._extractFieldNames(e.text):[]}_getMediaInfoFields(e){const{caption:t,title:i,value:s}=e,r=s||{},{fields:n,normalizeField:o,tooltipField:a,sourceURL:l,linkURL:u}=r,d=[...this._extractFieldNames(i),...this._extractFieldNames(t),...this._extractFieldNames(l),...this._extractFieldNames(u),...n!=null?n:[]];return o&&d.push(o),a&&d.push(a),d}_getContentExpressionInfos(e,t){return Array.isArray(e)?e.reduce((i,s)=>[...i,...s.type==="expression"&&s.expressionInfo?[s.expressionInfo]:[]],t):[]}_getContentFields(e){return typeof e=="string"?this._extractFieldNames(e):Array.isArray(e)?e.reduce((t,i)=>[...t,...this._getContentElementFields(i)],[]):[]}async _collectExpressionInfoFields(e,t,i){i&&await Promise.all(i.map(s=>Ui(e,t,s.expression)))}_getFieldInfoFields(e){return e?e.filter(t=>t.visible===void 0||!!t.visible).map(t=>t.fieldName).filter(t=>!t.startsWith(Ld)&&!t.startsWith(kk)):[]}_getActionsFields(e){return e?e.toArray().reduce((t,i)=>[...t,...this._getActionFields(i)],[]):[]}_getActionFields(e){const{className:t,title:i,type:s}=e,r=s==="button"||s==="toggle"?e.image:"";return[...this._extractFieldNames(i),...this._extractFieldNames(t),...this._extractFieldNames(r)]}_getTitleFields(e){return typeof e=="string"?this._extractFieldNames(e):[]}_extractFieldNames(e){if(!e||typeof e!="string")return[];const t=/{[^}]*}/g,i=e.match(t);if(!i)return[];const s=/\{(\w+):.+\}/,r=i.filter(n=>!(n.indexOf(`{${Ld}`)===0||n.indexOf(`{${kk}`)===0)).map(n=>n.replace(s,"{$1}"));return r?r.map(n=>n.slice(1,-1)):[]}};c([h({type:nZ})],Wt.prototype,"actions",void 0),c([h()],Wt.prototype,"content",void 0),c([Oe("content")],Wt.prototype,"castContent",null),c([Q("content",["description","fieldInfos","popupElements","mediaInfos","showAttachments","relatedRecordsInfo"])],Wt.prototype,"readContent",null),c([ie("content",{popupElements:{type:he.ofType(eZ)},showAttachments:{type:Boolean},mediaInfos:{type:he.ofType(HD)},description:{type:String},relatedRecordsInfo:{type:iZ}})],Wt.prototype,"writeContent",null),c([h({type:[YD],json:{write:!0}})],Wt.prototype,"expressionInfos",void 0),c([h({type:[Fm]})],Wt.prototype,"fieldInfos",void 0),c([ie("fieldInfos")],Wt.prototype,"writeFieldInfos",null),c([h({type:tZ})],Wt.prototype,"layerOptions",void 0),c([ie("layerOptions")],Wt.prototype,"writeLayerOptions",null),c([h({type:Boolean,json:{read:{source:"showLastEditInfo"},write:{target:"showLastEditInfo"},default:!0}})],Wt.prototype,"lastEditInfoEnabled",void 0),c([h()],Wt.prototype,"outFields",void 0),c([h()],Wt.prototype,"overwriteActions",void 0),c([h()],Wt.prototype,"returnGeometry",void 0),c([h({json:{type:String}})],Wt.prototype,"title",void 0),c([ie("title")],Wt.prototype,"writeTitle",null),Wt=c([S("esri.PopupTemplate")],Wt);const Dm=Wt;function wy(e){return ls(jM(e),0,255)}function xy(e,t,i){return e=Number(e),isNaN(e)?i:ei?i:e}class Pt{constructor(t){this.r=255,this.g=255,this.b=255,this.a=1,t&&this.setColor(t)}static blendColors(t,i,s,r=new Pt){return r.r=Math.round(t.r+(i.r-t.r)*s),r.g=Math.round(t.g+(i.g-t.g)*s),r.b=Math.round(t.b+(i.b-t.b)*s),r.a=t.a+(i.a-t.a)*s,r._sanitize()}static fromRgb(t,i){const s=t.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);if(s){const r=s[2].split(/\s*,\s*/),n=s[1];if(n==="rgb"&&r.length===3||n==="rgba"&&r.length===4){const o=r[0];if(o.charAt(o.length-1)==="%"){const a=r.map(l=>2.56*parseFloat(l));return r.length===4&&(a[3]=parseFloat(r[3])),Pt.fromArray(a,i)}return Pt.fromArray(r.map(a=>parseFloat(a)),i)}if(n==="hsl"&&r.length===3||n==="hsla"&&r.length===4)return Pt.fromArray(MD(parseFloat(r[0]),parseFloat(r[1])/100,parseFloat(r[2])/100,parseFloat(r[3])),i)}return null}static fromHex(t,i=new Pt){if(t.length!==4&&t.length!==7||t[0]!=="#")return null;const s=t.length===4?4:8,r=(1<{const a=n&r;n>>=s,i[o]=s===4?17*a:a}),i.a=1,i)}static fromArray(t,i=new Pt){return i._set(Number(t[0]),Number(t[1]),Number(t[2]),Number(t[3])),isNaN(i.a)&&(i.a=1),i._sanitize()}static fromString(t,i){const s=SD(t)?z$(t):null;return s&&Pt.fromArray(s,i)||Pt.fromRgb(t,i)||Pt.fromHex(t,i)}static fromJSON(t){return t&&new Pt([t[0],t[1],t[2],t[3]/255])}static toUnitRGB(t){return M(t)?[t.r/255,t.g/255,t.b/255]:null}static toUnitRGBA(t){return M(t)?[t.r/255,t.g/255,t.b/255,t.a!=null?t.a:1]:null}get isBright(){return .299*this.r+.587*this.g+.114*this.b>=127}setColor(t){var i,s,r,n;return typeof t=="string"?Pt.fromString(t,this):Array.isArray(t)?Pt.fromArray(t,this):(this._set((i=t.r)!=null?i:0,(s=t.g)!=null?s:0,(r=t.b)!=null?r:0,(n=t.a)!=null?n:1),t instanceof Pt||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(){const t=this.r.toString(16),i=this.g.toString(16),s=this.b.toString(16);return`#${t.length<2?"0"+t:t}${i.length<2?"0"+i:i}${s.length<2?"0"+s:s}`}toCss(t=!1){const i=this.r+", "+this.g+", "+this.b;return t?`rgba(${i}, ${this.a})`:`rgb(${i})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(t=Pt.AlphaMode.ALWAYS){const i=wy(this.r),s=wy(this.g),r=wy(this.b);return t===Pt.AlphaMode.ALWAYS||this.a!==1?[i,s,r,wy(255*this.a)]:[i,s,r]}clone(){return new Pt(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(t){return M(t)&&t.r===this.r&&t.g===this.g&&t.b===this.b&&t.a===this.a}_sanitize(){return this.r=Math.round(xy(this.r,0,255)),this.g=Math.round(xy(this.g,0,255)),this.b=Math.round(xy(this.b,0,255)),this.a=xy(this.a,0,1),this}_set(t,i,s,r){this.r=t,this.g=i,this.b=s,this.a=r}}Pt.prototype.declaredClass="esri.Color",function(e){var t;(t=e.AlphaMode||(e.AlphaMode={}))[t.ALWAYS=0]="ALWAYS",t[t.UNLESS_OPAQUE=1]="UNLESS_OPAQUE"}(Pt||(Pt={}));const pe=Pt,Ck=new Ie({esriSMS:"simple-marker",esriPMS:"picture-marker",esriSLS:"simple-line",esriSFS:"simple-fill",esriPFS:"picture-fill",esriTS:"text",esriSHD:"shield-label-symbol",PointSymbol3D:"point-3d",LineSymbol3D:"line-3d",PolygonSymbol3D:"polygon-3d",WebStyleSymbol:"web-style",MeshSymbol3D:"mesh-3d",LabelSymbol3D:"label-3d",CIMSymbolReference:"cim"});let lZ=0,Fu=class extends W{constructor(e){super(e),this.id="sym"+lZ++,this.type=null,this.color=new pe([0,0,0,1])}readColor(e){return e&&e[0]!=null?[e[0],e[1],e[2],e[3]/255]:e}async collectRequiredFields(e,t){}hash(){return JSON.stringify(this.toJSON())}clone(){}};c([h({type:Ck.apiValues,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:Ck.write}}})],Fu.prototype,"type",void 0),c([h({type:pe,json:{write:{allowNull:!0}}})],Fu.prototype,"color",void 0),c([Q("color")],Fu.prototype,"readColor",null),Fu=c([S("esri.symbols.Symbol")],Fu);const us=Fu;var Cx;let ca=Cx=class extends us{constructor(e){super(e),this.data=null,this.type="cim"}readData(e,t){return t}writeData(e,t){if(e)for(const i in e)t[i]=e[i]}async collectRequiredFields(e,t){var i;if(((i=this.data)==null?void 0:i.type)==="CIMSymbolReference"){const s=this.data.primitiveOverrides;if(s){const r=s.map(n=>{const o=n.valueExpressionInfo;return Ui(e,t,o.expression)});await Promise.all(r)}}}clone(){return new Cx({data:R(this.data)})}hash(){return NM(JSON.stringify(this.data)).toString()}};c([h({json:{write:!1}})],ca.prototype,"color",void 0),c([h({json:{write:!0}})],ca.prototype,"data",void 0),c([Q("data",["symbol"])],ca.prototype,"readData",null),c([ie("data",{})],ca.prototype,"writeData",null),c([ue({CIMSymbolReference:"cim"},{readOnly:!0})],ca.prototype,"type",void 0),ca=Cx=c([S("esri.symbols.CIMSymbol")],ca);const Nm=ca;let Du=class extends W{constructor(e){super(e),this.enabled=!0,this.type=null}writeEnabled(e,t,i){e||(t[i]=e)}};c([h({type:Boolean,json:{read:{source:"enable"},write:{target:"enable"}}})],Du.prototype,"enabled",void 0),c([ie("enabled")],Du.prototype,"writeEnabled",null),c([h({type:["icon","object","line","path","fill","water","extrude","text"],readOnly:!0})],Du.prototype,"type",void 0),Du=c([S("esri.symbols.Symbol3DLayer")],Du);const Rn=Du;function Rb(e){const t=jM(100*(1-e));return Math.max(0,Math.min(t,100))}function em(e){const t=1-e/100;return Math.max(0,Math.min(t,1))}function cZ(e,t){const i=t.transparency!=null?em(t.transparency):1,s=t.color;return s&&Array.isArray(s)?new pe([s[0]||0,s[1]||0,s[2]||0,i]):null}function uZ(e,t){t.color=e.toJSON().slice(0,3);const i=Rb(e.a);i!==0&&(t.transparency=i)}const yl={type:pe,json:{type:[Ge],default:null,read:{source:["color","transparency"],reader:cZ},write:{target:{color:{type:[Ge]},transparency:{type:Ge}},writer:uZ}}},Cn={type:Number,cast:Fe,json:{write:!0}};let Vl=class extends W{constructor(e){super(e),this.color=new pe([0,0,0,1]),this.extensionLength=0,this.size=Fo(1)}clone(){}cloneProperties(){return{color:R(this.color),size:this.size,extensionLength:this.extensionLength}}};c([h({type:["solid","sketch"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],Vl.prototype,"type",void 0),c([h(yl)],Vl.prototype,"color",void 0),c([h({...Cn,json:{write:{overridePolicy:e=>({enabled:!!e})}}})],Vl.prototype,"extensionLength",void 0),c([h(Cn)],Vl.prototype,"size",void 0),Vl=c([S("esri.symbols.edges.Edges3D")],Vl);const Q$=Vl;var Px;let kg=Px=class extends Q${constructor(e){super(e),this.type="sketch"}clone(){return new Px(this.cloneProperties())}};c([ue({sketch:"sketch"},{readOnly:!0})],kg.prototype,"type",void 0),kg=Px=c([S("esri.symbols.edges.SketchEdges3D")],kg);const hZ=kg;var Ax;let Cg=Ax=class extends Q${constructor(e){super(e),this.type="solid"}clone(){return new Ax(this.cloneProperties())}};c([ue({solid:"solid"},{readOnly:!0})],Cg.prototype,"type",void 0),Cg=Ax=c([S("esri.symbols.support.SolidEdges3D")],Cg);const dZ=Cg,XD={types:{key:"type",base:Q$,typeMap:{solid:dZ,sketch:hZ}},json:{write:!0}};var Ox;let Ts=Ox=class extends W{constructor(e){super(e),this.color=null}clone(){const e={color:M(this.color)?this.color.clone():null};return new Ox(e)}};c([h(yl)],Ts.prototype,"color",void 0),Ts=Ox=c([S("esri.symbols.support.Symbol3DMaterial")],Ts);var Rx;let ua=Rx=class extends Rn{constructor(e){super(e),this.type="extrude",this.size=1,this.material=null,this.castShadows=!0,this.edges=null}clone(){return new Rx({edges:this.edges&&this.edges.clone(),enabled:this.enabled,material:M(this.material)?this.material.clone():null,castShadows:this.castShadows,size:this.size})}};c([ue({Extrude:"extrude"},{readOnly:!0})],ua.prototype,"type",void 0),c([h({type:Number,json:{write:{enabled:!0,isRequired:!0}},nonNullable:!0})],ua.prototype,"size",void 0),c([h({type:Ts,json:{write:!0}})],ua.prototype,"material",void 0),c([h({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],ua.prototype,"castShadows",void 0),c([h(XD)],ua.prototype,"edges",void 0),ua=Rx=c([S("esri.symbols.ExtrudeSymbol3DLayer")],ua);const ZD=ua;let vp=class extends us{constructor(e){super(e),this.type="simple-line",this.width=.75}hash(){return`${this.type}.${this.width}`}};c([ue({esriSLS:"simple-line"},{readOnly:!0})],vp.prototype,"type",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],vp.prototype,"width",void 0),vp=c([S("esri.symbols.LineSymbol")],vp);const pZ=vp,fZ=["begin","end","begin-end"],QD=["arrow","circle","square","diamond","cross","x"];var Lx;let Qr=Lx=class extends W{constructor(e){super(e),this.placement="begin-end",this.type="line-marker",this.style="arrow"}writeStyle(e,t,i,s){t[i]=(s==null?void 0:s.origin)==="web-map"?"arrow":e}set color(e){this._set("color",e)}readColor(e){return e&&e[0]!=null?[e[0],e[1],e[2],e[3]/255]:e}writeColor(e,t,i,s){(s==null?void 0:s.origin)==="web-map"||(t[i]=e)}clone(){return new Lx({color:R(this.color),placement:this.placement,style:this.style})}hash(){var e;return`${this.placement}.${(e=this.color)==null?void 0:e.hash()}.${this.style}`}};c([h({type:["begin","end","begin-end"],json:{write:!0}})],Qr.prototype,"placement",void 0),c([ue({"line-marker":"line-marker"},{readOnly:!0}),h({json:{origins:{"web-map":{write:!1}}}})],Qr.prototype,"type",void 0),c([h({type:QD})],Qr.prototype,"style",void 0),c([ie("style")],Qr.prototype,"writeStyle",null),c([h({type:pe,value:null,json:{write:{allowNull:!0}}})],Qr.prototype,"color",null),c([Q("color")],Qr.prototype,"readColor",null),c([ie("color")],Qr.prototype,"writeColor",null),Qr=Lx=c([S("esri.symbols.LineSymbolMarker")],Qr);const mZ=Qr;var Fx;const q_=new Ie({esriSLSSolid:"solid",esriSLSDash:"dash",esriSLSDot:"dot",esriSLSDashDot:"dash-dot",esriSLSDashDotDot:"long-dash-dot-dot",esriSLSNull:"none",esriSLSInsideFrame:"inside-frame",esriSLSShortDash:"short-dash",esriSLSShortDot:"short-dot",esriSLSShortDashDot:"short-dash-dot",esriSLSShortDashDotDot:"short-dash-dot-dot",esriSLSLongDash:"long-dash",esriSLSLongDashDot:"long-dash-dot"});let Yn=Fx=class extends pZ{constructor(...e){super(...e),this.type="simple-line",this.style="solid",this.cap="round",this.join="round",this.marker=null,this.miterLimit=2}normalizeCtorArgs(e,t,i,s,r,n){if(e&&typeof e!="string")return e;const o={};return e!=null&&(o.style=e),t!=null&&(o.color=t),i!=null&&(o.width=Fe(i)),s!=null&&(o.cap=s),r!=null&&(o.join=r),n!=null&&(o.miterLimit=Fe(n)),o}clone(){var e;return new Fx({color:R(this.color),style:this.style,width:this.width,cap:this.cap,join:this.join,miterLimit:this.miterLimit,marker:(e=this.marker)==null?void 0:e.clone()})}hash(){var e,t;return`${super.hash()}.${(e=this.color)==null?void 0:e.hash()}.${this.style}.${this.cap}.${this.join}.${this.miterLimit}.${(t=this.marker)==null?void 0:t.hash()}`}};c([ue({esriSLS:"simple-line"},{readOnly:!0})],Yn.prototype,"type",void 0),c([h({type:q_.apiValues,json:{read:q_.read,write:q_.write}})],Yn.prototype,"style",void 0),c([h({type:["butt","round","square"],json:{write:{overridePolicy:(e,t,i)=>({enabled:e!=="round"&&(i==null||i.origin==null)})}}})],Yn.prototype,"cap",void 0),c([h({type:["miter","round","bevel"],json:{write:{overridePolicy:(e,t,i)=>({enabled:e!=="round"&&(i==null||i.origin==null)})}}})],Yn.prototype,"join",void 0),c([h({types:{key:"type",base:null,defaultKeyValue:"line-marker",typeMap:{"line-marker":mZ}},json:{write:!0,origins:{"web-scene":{write:!1}}}})],Yn.prototype,"marker",void 0),c([h({type:Number,json:{read:!1,write:!1}})],Yn.prototype,"miterLimit",void 0),Yn=Fx=c([S("esri.symbols.SimpleLineSymbol")],Yn);const tr=Yn;let bp=class extends us{constructor(e){super(e),this.outline=null,this.type=null}hash(){return`${this.type}.${this.outline&&this.outline.hash()}`}};c([h({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":tr}},json:{default:null,write:!0}})],bp.prototype,"outline",void 0),c([h({type:["simple-fill","picture-fill"],readOnly:!0})],bp.prototype,"type",void 0),bp=c([S("esri.symbols.FillSymbol")],bp);const KD=bp;let Pg=class extends W{constructor(e){super(e)}clone(){}};c([h({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],Pg.prototype,"type",void 0),Pg=c([S("esri.symbols.patterns.LinePattern3D")],Pg);const eN=Pg,yZ=["dash","dash-dot","dot","long-dash","long-dash-dot","long-dash-dot-dot","none","short-dash","short-dash-dot","short-dash-dot-dot","short-dot","solid"];var Dx;const gZ=mi()({dash:"dash","dash-dot":"dash-dot","dash-dot-dot":"long-dash-dot-dot",dot:"dot","long-dash":"long-dash","long-dash-dot":"long-dash-dot",null:"none","short-dash":"short-dash","short-dash-dot":"short-dash-dot","short-dash-dot-dot":"short-dash-dot-dot","short-dot":"short-dot",solid:"solid"});let _p=Dx=class extends eN{constructor(e){super(e),this.type="style",this.style="solid"}clone(){const e={style:this.style};return new Dx(e)}};c([h({type:["style"]})],_p.prototype,"type",void 0),c([ue(gZ),h({type:yZ})],_p.prototype,"style",void 0),_p=Dx=c([S("esri.symbols.patterns.LineStylePattern3D")],_p);const K$=_p;let Ag=class extends W{constructor(e){super(e)}clone(){}};c([h({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],Ag.prototype,"type",void 0),Ag=c([S("esri.symbols.patterns.Pattern3D")],Ag);const tN=Ag,vZ=["backward-diagonal","cross","diagonal-cross","forward-diagonal","horizontal","none","solid","vertical"];var Nx;let wp=Nx=class extends tN{constructor(e){super(e),this.type="style",this.style="solid"}clone(){const e={style:this.style};return new Nx(e)}};c([h({type:["style"]})],wp.prototype,"type",void 0),c([h({type:vZ,json:{read:!0,write:!0}})],wp.prototype,"style",void 0),wp=Nx=c([S("esri.symbols.patterns.StylePattern3D")],wp);const iN=wp,bZ={types:{key:"type",base:tN,typeMap:{style:iN}},json:{write:!0}},sN={types:{key:"type",base:eN,typeMap:{style:K$}},json:{write:!0}},mf=new pe("white");new pe("black");const _Z=new pe([255,255,255,0]);function wZ(e){return e.r===0&&e.g===0&&e.b===0}var jx;let yf=jx=class extends Ts{constructor(e){super(e),this.colorMixMode=null}clone(){const e={color:M(this.color)?this.color.clone():null,colorMixMode:this.colorMixMode};return new jx(e)}};c([ue({multiply:"multiply",replace:"replace",tint:"tint"})],yf.prototype,"colorMixMode",void 0),yf=jx=c([S("esri.symbols.support.Symbol3DFillMaterial")],yf);function eT(e=TZ){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function tT(e,t,i,s,r,n,o=eT()){return o[0]=e,o[1]=t,o[2]=i,o[3]=s,o[4]=r,o[5]=n,o}function Ube(e,t){const i=isFinite(e[2])||isFinite(e[5]);return new Ze(i?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function qbe(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function Gbe(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function xZ(e){return e[0]>=e[3]?0:e[3]-e[0]}function SZ(e){return e[1]>=e[4]?0:e[4]-e[1]}function MZ(e){return e[2]>=e[5]?0:e[5]-e[2]}function Wbe(e,t=[0,0,0]){return t[0]=xZ(e),t[1]=SZ(e),t[2]=MZ(e),t}function Hbe(e,t,i=e){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i!==e&&(i[3]=e[3],i[4]=e[4],i[5]=e[5]),i}function Ybe(e,t,i=e){return i[3]=t[0],i[4]=t[1],i[5]=t[2],i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2]),e}function $Z(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Jbe(e){return e?$Z(e,Ak):eT(Ak)}function Xbe(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function Pk(e){return e.length===6}function Zbe(e,t,i){if(N(e)||N(t))return e===t;if(!Pk(e)||!Pk(t))return!1;if(i){for(let s=0;s{const t=Ys(e);return t===0?1:ls(t,.1,4)},nonNullable:!0},RZ=["left","right","center"],LZ=["baseline","top","middle","bottom"],oN={type:RZ,nonNullable:!0},aN={type:LZ,nonNullable:!0};var zx;let Xn=zx=class extends W{constructor(e){super(e),this.decoration="none",this.family="sans-serif",this.size=9,this.style="normal",this.weight="normal"}castSize(e){return Fe(e)}clone(){return new zx({decoration:this.decoration,family:this.family,size:this.size,style:this.style,weight:this.weight})}hash(){return`${this.decoration}.${this.family}.${this.size}.${this.style}.${this.weight}`}};c([h({type:PZ,json:{default:"none",write:!0}})],Xn.prototype,"decoration",void 0),c([h({type:String,json:{write:!0}})],Xn.prototype,"family",void 0),c([h({type:Number,json:{write:{overridePolicy:(e,t,i)=>({enabled:!i||!i.textSymbol3D})}}})],Xn.prototype,"size",void 0),c([Oe("size")],Xn.prototype,"castSize",null),c([h({type:AZ,json:{default:"normal",write:!0}})],Xn.prototype,"style",void 0),c([h({type:OZ,json:{default:"normal",write:!0}})],Xn.prototype,"weight",void 0),Xn=zx=c([S("esri.symbols.Font")],Xn);const Lb=Xn;function fd(e,t){const i=t&&t.url&&t.url.path;if(e&&i&&(e=Js(e,i,{preserveProtocolRelative:!0}),t.portalItem&&t.readResourcePaths)){const s=e$(e,t.portalItem.itemUrl);s!=null&&FZ.test(s)&&t.readResourcePaths.push(t.portalItem.resourceFromPath(s).path)}return Bx(e,t&&t.portal)}function Vm(e,t,i=tm.YES){if(e==null)return e;!Ms(e)&&t&&t.blockedRelativeUrls&&t.blockedRelativeUrls.push(e);let s=Js(e);if(t){const r=t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.rootPath||t.url&&t.url.path;if(r){const n=Bx(r,t.portal);s=e$(Bx(s,t.portal),n,n),s!=null&&s!==e&&t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.writtenUrls.push(s)}}return s=cN(s,t==null?void 0:t.portal),Ms(s)&&(s=Zs(s)),(t==null?void 0:t.resources)&&(t==null?void 0:t.portalItem)&&!Ms(s)&&!hu(s)&&i===tm.YES&&t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(s),compress:!1}),s}function sT(e,t,i){return fd(e,i)}function au(e,t,i,s){const r=Vm(e,s);r!==void 0&&(t[i]=r)}const lN=/\/items\/([^\/]+)\/resources\/(.*)/,FZ=/^\.\/resources\//;function DZ(e){var t,i,s;return(s=(i=(t=e==null?void 0:e.match(lN))!=null?t:null)==null?void 0:i[1])!=null?s:null}function NZ(e){var o;const t=(o=e==null?void 0:e.match(lN))!=null?o:null;if(t==null)return null;const i=t[2],s=i.lastIndexOf("/");if(s===-1){const{path:a,extension:l}=nE(i);return{prefix:null,filename:a,extension:l}}const{path:r,extension:n}=nE(i.slice(s+1));return{prefix:i.slice(0,s),filename:r,extension:n}}function cN(e,t){return t&&!t.isPortal&&t.urlKey&&t.customBaseUrl?M1(e,`${t.urlKey}.${t.customBaseUrl}`,t.portalHostname):e}function Bx(e,t){if(!t||t.isPortal||!t.urlKey||!t.customBaseUrl)return e;const i=`${t.urlKey}.${t.customBaseUrl}`,s=ZM();return jf(s,`${s.scheme}://${i}`)?M1(e,t.portalHostname,i):M1(e,i,t.portalHostname)}var tm;(function(e){e[e.YES=0]="YES",e[e.NO=1]="NO"})(tm||(tm={}));const e_e=Object.freeze(Object.defineProperty({__proto__:null,fromJSON:fd,toJSON:Vm,read:sT,write:au,itemIdFromResourceUrl:DZ,prefixAndFilenameFromResourceUrl:NZ,ensureMainOnlineDomain:cN,get MarkKeep(){return tm}},Symbol.toStringTag,{value:"Module"}));var Ux;const jZ=mi()({circle:"circle",square:"square",cross:"cross",x:"x",kite:"kite",triangle:"triangle"});let Bl=Ux=class extends W{constructor(e){super(e)}readHref(e,t,i){return e?fd(e,i):t.dataURI}writeHref(e,t,i,s){e&&(hu(e)?t.dataURI=e:(t.href=Vm(e,s),Ms(t.href)&&(t.href=Zs(t.href))))}clone(){return new Ux({href:this.href,primitive:this.primitive})}};c([h({type:String,json:{write:!0,read:{source:["href","dataURI"]}}})],Bl.prototype,"href",void 0),c([Q("href")],Bl.prototype,"readHref",null),c([ie("href",{href:{type:String},dataURI:{type:String}})],Bl.prototype,"writeHref",null),c([ue(jZ)],Bl.prototype,"primitive",void 0),Bl=Ux=c([S("esri.symbols.support.IconSymbol3DLayerResource")],Bl);var qx;let mh=qx=class extends oe{constructor(){super(...arguments),this.x=0,this.y=0}clone(){return new qx({x:this.x,y:this.y})}};c([h({type:Number})],mh.prototype,"x",void 0),c([h({type:Number})],mh.prototype,"y",void 0),mh=qx=c([S("esri.symbols.support.Symbol3DAnchorPosition2D")],mh);var Gx;let xp=Gx=class extends W{constructor(e){super(e),this.color=new pe([0,0,0,1]),this.size=Fo(1)}clone(){const e={color:M(this.color)?this.color.clone():null,size:this.size};return new Gx(e)}};c([h(yl)],xp.prototype,"color",void 0),c([h(Cn)],xp.prototype,"size",void 0),xp=Gx=c([S("esri.symbols.support.Symbol3DIconOutline")],xp);var Nu;const uN="esri.symbols.IconSymbol3DLayer";let Kr=Nu=class extends Rn{constructor(e){super(e),this.material=null,this.resource=null,this.type="icon",this.size=12,this.anchor="center",this.anchorPosition=null,this.outline=null}clone(){return new Nu({anchor:this.anchor,anchorPosition:this.anchorPosition&&this.anchorPosition.clone(),enabled:this.enabled,material:M(this.material)?this.material.clone():null,outline:M(this.outline)?this.outline.clone():null,resource:this.resource&&this.resource.clone(),size:this.size})}static fromSimpleMarkerSymbol(e){const t=e.color||mf,i=Ok(e),s=e.outline&&e.outline.width>0?{size:e.outline.width,color:(e.outline.color||mf).clone()}:null;return new Nu({size:e.size,resource:{primitive:zZ(e.style)},material:{color:t},outline:s,anchor:i?"relative":void 0,anchorPosition:i})}static fromPictureMarkerSymbol(e){const t=!e.color||wZ(e.color)?mf:e.color,i=Ok(e);return new Nu({size:e.width<=e.height?e.height:e.width,resource:{href:e.url},material:{color:t.clone()},anchor:i?"relative":void 0,anchorPosition:i})}static fromCIMSymbol(e){return new Nu({resource:{href:bR({mediaType:"application/json",data:JSON.stringify(e.data)})}})}};function Ok(e){const t="width"in e?e.width:e.size,i="height"in e?e.height:e.size,s=Rk(e.xoffset),r=Rk(e.yoffset);return(s||r)&&t&&i?{x:-s/t,y:r/i}:null}function Rk(e){return isFinite(e)?e:0}c([h({type:Ts,json:{write:!0}})],Kr.prototype,"material",void 0),c([h({type:Bl,json:{write:!0}})],Kr.prototype,"resource",void 0),c([ue({Icon:"icon"},{readOnly:!0})],Kr.prototype,"type",void 0),c([h(Cn)],Kr.prototype,"size",void 0),c([ue({center:"center",left:"left",right:"right",top:"top",bottom:"bottom",topLeft:"top-left",topRight:"top-right",bottomLeft:"bottom-left",bottomRight:"bottom-right",relative:"relative"}),h({json:{default:"center"}})],Kr.prototype,"anchor",void 0),c([h({type:mh,json:{type:[Number],read:{reader:e=>new mh({x:e[0],y:e[1]})},write:{writer:(e,t)=>{t.anchorPosition=[e.x,e.y]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],Kr.prototype,"anchorPosition",void 0),c([h({type:xp,json:{write:!0}})],Kr.prototype,"outline",void 0),Kr=Nu=c([S(uN)],Kr);const VZ={circle:"circle",cross:"cross",diamond:"kite",square:"square",x:"x",triangle:"triangle",path:null};function zZ(e){return VZ[e]||(q.getLogger(uN).warn(`${e} cannot be mapped to Icon symbol. Fallback to "circle"`),"circle")}const Pc=Kr;let Ul=class extends xt(W){constructor(e){super(e),this.type="style",this.placement="begin-end",this.style="arrow",this.color=null}equals(e){return M(e)&&e.placement===this.placement&&e.style===this.style&&(N(this.color)&&N(e.color)||M(this.color)&&M(e.color)&&this.color.toJSON()===e.color.toJSON())}};c([h({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],Ul.prototype,"type",void 0),c([h({type:fZ,json:{default:"begin-end",write:!0}})],Ul.prototype,"placement",void 0),c([h({type:QD,json:{default:"arrow",write:!0}})],Ul.prototype,"style",void 0),c([h({type:pe,json:{type:[Ge],default:null,write:!0}})],Ul.prototype,"color",void 0),Ul=c([S("esri.symbols.LineStyleMarker3D")],Ul);const Wx=Ul;var Rg;let en=Rg=class extends Rn{constructor(e){super(e),this.material=null,this.type="line",this.join="miter",this.cap="butt",this.size=Fo(1),this.pattern=null,this.marker=null}clone(){const e={enabled:this.enabled,material:M(this.material)?this.material.clone():null,size:this.size,join:this.join,cap:this.cap,pattern:M(this.pattern)?this.pattern.clone():null,marker:M(this.marker)?this.marker.clone():null};return new Rg(e)}static fromSimpleLineSymbol(e){var i,s,r;const t={enabled:!0,size:(i=e.width)!=null?i:Fo(1),cap:e.cap||"butt",join:e.join||"miter",pattern:e.style&&e.style!=="inside-frame"?new K$({style:e.style}):null,material:new Ts({color:(e.color||mf).clone()}),marker:e.marker?new Wx({placement:e.marker.placement,style:e.marker.style,color:(r=(s=e.marker.color)==null?void 0:s.clone())!=null?r:null}):null};return new Rg(t)}};c([h({type:Ts,json:{write:!0}})],en.prototype,"material",void 0),c([ue({Line:"line"},{readOnly:!0})],en.prototype,"type",void 0),c([h({type:rN,json:{write:!0,default:"miter"}})],en.prototype,"join",void 0),c([h({type:iT,json:{write:!0,default:"butt"}})],en.prototype,"cap",void 0),c([h(Cn)],en.prototype,"size",void 0),c([h(sN)],en.prototype,"pattern",void 0),c([h({types:{key:"type",base:Wx,typeMap:{style:Wx}},json:{write:!0}})],en.prototype,"marker",void 0),en=Rg=c([S("esri.symbols.LineSymbol3DLayer")],en);const zm=en;var Hx;const BZ=mi()({sphere:"sphere",cylinder:"cylinder",cube:"cube",cone:"cone",diamond:"diamond",tetrahedron:"tetrahedron",invertedCone:"inverted-cone"});let Sp=Hx=class extends W{clone(){return new Hx({href:this.href,primitive:this.primitive})}};c([h({type:String,json:{read:sT,write:au}})],Sp.prototype,"href",void 0),c([ue(BZ)],Sp.prototype,"primitive",void 0),Sp=Hx=c([S("esri.symbols.support.ObjectSymbol3DLayerResource")],Sp);var Yx;let _c=Yx=class extends oe{constructor(){super(...arguments),this.x=0,this.y=0,this.z=0}clone(){return new Yx({x:this.x,y:this.y,z:this.z})}};c([h({type:Number})],_c.prototype,"x",void 0),c([h({type:Number})],_c.prototype,"y",void 0),c([h({type:Number})],_c.prototype,"z",void 0),_c=Yx=c([S("esri.symbols.support.Symbol3DAnchorPosition3D")],_c);var Jx;let wi=Jx=class extends Rn{constructor(e){super(e),this.material=null,this.castShadows=!0,this.resource=null,this.type="object",this.width=void 0,this.height=void 0,this.depth=void 0,this.anchor=void 0,this.anchorPosition=void 0,this.heading=void 0,this.tilt=void 0,this.roll=void 0}clone(){return new Jx({heading:this.heading,tilt:this.tilt,roll:this.roll,anchor:this.anchor,anchorPosition:this.anchorPosition&&this.anchorPosition.clone(),depth:this.depth,enabled:this.enabled,height:this.height,material:M(this.material)?this.material.clone():null,castShadows:this.castShadows,resource:this.resource&&this.resource.clone(),width:this.width})}get isPrimitive(){return!this.resource||typeof this.resource.href!="string"}};c([h({type:Ts,json:{write:!0}})],wi.prototype,"material",void 0),c([h({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],wi.prototype,"castShadows",void 0),c([h({type:Sp,json:{write:!0}})],wi.prototype,"resource",void 0),c([ue({Object:"object"},{readOnly:!0})],wi.prototype,"type",void 0),c([h({type:Number,json:{write:!0}})],wi.prototype,"width",void 0),c([h({type:Number,json:{write:!0}})],wi.prototype,"height",void 0),c([h({type:Number,json:{write:!0}})],wi.prototype,"depth",void 0),c([ue({center:"center",top:"top",bottom:"bottom",origin:"origin",relative:"relative"}),h({json:{default:"origin"}})],wi.prototype,"anchor",void 0),c([h({type:_c,json:{type:[Number],read:{reader:e=>new _c({x:e[0],y:e[1],z:e[2]})},write:{writer:(e,t)=>{t.anchorPosition=[e.x,e.y,e.z]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],wi.prototype,"anchorPosition",void 0),c([h({type:Number,json:{write:!0}})],wi.prototype,"heading",void 0),c([h({type:Number,json:{write:!0}})],wi.prototype,"tilt",void 0),c([h({type:Number,json:{write:!0}})],wi.prototype,"roll",void 0),c([h({readOnly:!0})],wi.prototype,"isPrimitive",null),wi=Jx=c([S("esri.symbols.ObjectSymbol3DLayer")],wi);const rT=wi;var Xx;let Fi=Xx=class extends Rn{constructor(e){super(e),this.material=null,this.castShadows=!0,this.type="path",this.profile="circle",this.join="miter",this.cap="butt",this.width=void 0,this.height=void 0,this.anchor="center",this.profileRotation="all"}readWidth(e,t){return e!=null?e:t.height==null&&t.size!=null?t.size:void 0}readHeight(e,t){return e!=null?e:t.width==null&&t.size!=null?t.size:void 0}clone(){return new Xx({enabled:this.enabled,material:M(this.material)?this.material.clone():null,castShadows:this.castShadows,profile:this.profile,join:this.join,cap:this.cap,width:this.width,height:this.height,profileRotation:this.profileRotation,anchor:this.anchor})}};c([h({type:Ts,json:{write:!0}})],Fi.prototype,"material",void 0),c([h({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],Fi.prototype,"castShadows",void 0),c([ue({Path:"path"},{readOnly:!0})],Fi.prototype,"type",void 0),c([h({type:["circle","quad"],json:{write:!0,default:"circle"}})],Fi.prototype,"profile",void 0),c([h({type:rN,json:{write:!0,default:"miter"}})],Fi.prototype,"join",void 0),c([h({type:CZ,json:{write:!0,default:"butt"}})],Fi.prototype,"cap",void 0),c([h({type:Number,json:{write:{enabled:!0,target:{width:{type:Number},size:{type:Number}}}}})],Fi.prototype,"width",void 0),c([Q("width",["width","size","height"])],Fi.prototype,"readWidth",null),c([h({type:Number,json:{write:!0}})],Fi.prototype,"height",void 0),c([Q("height",["height","size","width"])],Fi.prototype,"readHeight",null),c([h({type:["center","bottom","top"],json:{write:!0,default:"center"}})],Fi.prototype,"anchor",void 0),c([h({type:["heading","all"],json:{write:!0,default:"all"}})],Fi.prototype,"profileRotation",void 0),Fi=Xx=c([S("esri.symbols.PathSymbol3DLayer")],Fi);const nT=Fi;var Zx;let yh=Zx=class extends W{constructor(){super(...arguments),this.color=new pe([0,0,0,1]),this.size=0}clone(){const e={color:R(this.color),size:this.size};return new Zx(e)}};c([h(yl)],yh.prototype,"color",void 0),c([h(Cn)],yh.prototype,"size",void 0),yh=Zx=c([S("esri.symbols.support.Symbol3DHalo")],yh);let gf=class extends xt(W){constructor(e){super(e),this.color=null}};c([h(yl)],gf.prototype,"color",void 0),gf=c([S("esri.symbols.support.Symbol3DTextBackground")],gf);var Lg;let Wi=Lg=class extends Rn{constructor(e){super(e),this._userSize=void 0,this.halo=null,this.horizontalAlignment="center",this.lineHeight=1,this.material=null,this.background=null,this.text=null,this.type="text",this.verticalAlignment="baseline"}get font(){return this._get("font")||null}set font(e){M(e)&&M(this._userSize)&&(e.size=this._userSize),this._set("font",e)}writeFont(e,t,i,s){const r={...s,textSymbol3D:!0};t.font=e.write({},r),delete t.font.size}get size(){return M(this._userSize)?this._userSize:M(this.font)&&this.font.size!=null?this.font.size:9}set size(e){this._userSize=e,M(this.font)&&(this.font.size=this._userSize),this.notifyChange("size")}clone(){const e=new Lg({enabled:this.enabled,font:this.font&&R(this.font),halo:this.halo&&R(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:M(this.material)?this.material.clone():null,text:this.text,verticalAlignment:this.verticalAlignment,background:R(this.background)});return e._userSize=this._userSize,e}static fromTextSymbol(e){return new Lg({font:M(e.font)?e.font.clone():new Lb,halo:UZ(e.haloColor,e.haloSize),horizontalAlignment:e.horizontalAlignment,lineHeight:e.lineHeight,material:e.color?new Ts({color:e.color.clone()}):null,text:e.text,verticalAlignment:e.verticalAlignment,background:e.backgroundColor?new gf({color:e.backgroundColor.clone()}):null})}};function UZ(e,t){return e&&t!=null&&t>0?new yh({color:R(e),size:t}):null}c([h({type:Lb,json:{write:!0}})],Wi.prototype,"font",null),c([ie("font")],Wi.prototype,"writeFont",null),c([h({type:yh,json:{write:!0}})],Wi.prototype,"halo",void 0),c([h({...oN,json:{default:"center",write:!0}})],Wi.prototype,"horizontalAlignment",void 0),c([h({...nN,json:{default:1,write:!0}})],Wi.prototype,"lineHeight",void 0),c([h({type:Ts,json:{write:!0}})],Wi.prototype,"material",void 0),c([h({type:gf,json:{write:!0}})],Wi.prototype,"background",void 0),c([h(Cn)],Wi.prototype,"size",null),c([h({type:String,json:{write:!0}})],Wi.prototype,"text",void 0),c([ue({Text:"text"},{readOnly:!0})],Wi.prototype,"type",void 0),c([h({...aN,json:{default:"baseline",write:!0}})],Wi.prototype,"verticalAlignment",void 0),Wi=Lg=c([S("esri.symbols.TextSymbol3DLayer")],Wi);const md=Wi;var Qx;let ha=Qx=class extends Rn{constructor(e){super(e),this.color=Kx.clone(),this.type="water",this.waterbodySize="medium",this.waveDirection=null,this.waveStrength="moderate"}clone(){return new Qx({color:R(this.color),waterbodySize:this.waterbodySize,waveDirection:this.waveDirection,waveStrength:this.waveStrength})}};c([h({type:pe,nonNullable:!0,json:{type:[Ge],write:(e,t,i)=>t[i]=e.toArray(pe.AlphaMode.UNLESS_OPAQUE),default:()=>Kx.clone(),defaultEquals:e=>e.toCss(!0)===Kx.toCss(!0)}})],ha.prototype,"color",void 0),c([ue({Water:"water"},{readOnly:!0})],ha.prototype,"type",void 0),c([h({type:["small","medium","large"],json:{write:!0,default:"medium"}})],ha.prototype,"waterbodySize",void 0),c([h({type:Number,json:{write:!0,default:null}})],ha.prototype,"waveDirection",void 0),c([h({type:["calm","rippled","slight","moderate"],json:{write:!0,default:"moderate"}})],ha.prototype,"waveStrength",void 0),ha=Qx=c([S("esri.symbols.WaterSymbol3DLayer")],ha);const Kx=new pe([0,119,190]),hN=ha;var eS;let ql=eS=class extends oe{constructor(e){super(e),this.name=null,this.styleUrl=null,this.styleName=null,this.portal=null}clone(){return new eS({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}};c([h({type:String})],ql.prototype,"name",void 0),c([h({type:String})],ql.prototype,"styleUrl",void 0),c([h({type:String})],ql.prototype,"styleName",void 0),c([h({type:cs})],ql.prototype,"portal",void 0),ql=eS=c([S("esri.symbols.support.StyleOrigin")],ql);const tS=ql;var iS;let vf=iS=class extends oe{constructor(){super(...arguments),this.url=""}clone(){return new iS({url:this.url})}};c([h({type:String})],vf.prototype,"url",void 0),vf=iS=c([S("esri.symbols.support.Thumbnail")],vf);const dN={icon:Pc,object:rT,line:zm,path:nT,fill:jm,extrude:ZD,text:md,water:hN},qZ=he.ofType({base:Rn,key:"type",typeMap:dN,errorContext:"symbol-layer"});let tn=class extends us{constructor(e){super(e),this.styleOrigin=null,this.thumbnail=null,this.type=null;const t=this.__accessor__&&this.__accessor__.metadatas&&this.__accessor__.metadatas.symbolLayers,i=t&&t.type||he;this._set("symbolLayers",new i)}get color(){return null}set color(e){this.constructed&&q.getLogger(this.declaredClass).error("Symbol3D does not support colors on the symbol level. Colors may be set on individual symbol layer materials instead.")}set symbolLayers(e){ou(e,this._get("symbolLayers"))}readStyleOrigin(e,t,i){if(e.styleUrl&&e.name){const s=fd(e.styleUrl,i);return new tS({styleUrl:s,name:e.name})}if(e.styleName&&e.name)return new tS({portal:i&&i.portal||cs.getDefault(),styleName:e.styleName,name:e.name});i&&i.messages&&i.messages.push(new Bi("symbol3d:incomplete-style-origin","Style origin requires either a 'styleUrl' or 'styleName' and a 'name' property",{context:i,definition:e}))}writeStyleOrigin(e,t,i,s){if(e.styleUrl&&e.name){let r=Vm(e.styleUrl,s);Ms(r)&&(r=Zs(r)),t.styleOrigin={styleUrl:r,name:e.name}}else e.styleName&&e.name&&(e.portal&&s&&s.portal&&!yR(e.portal.restUrl,s.portal.restUrl)?s&&s.messages&&s.messages.push(new Bi("symbol:cross-portal","The symbol style origin cannot be persisted because it refers to an item on a different portal than the one being saved to.",{symbol:this})):t.styleOrigin={styleName:e.styleName,name:e.name})}normalizeCtorArgs(e){return e instanceof Rn||e&&dN[e.type]?{symbolLayers:[e]}:Array.isArray(e)?{symbolLayers:e}:e}};c([h({json:{read:!1,write:!1}})],tn.prototype,"color",null),c([h({type:qZ,nonNullable:!0,json:{write:!0}}),Oe(hD)],tn.prototype,"symbolLayers",null),c([h({type:tS})],tn.prototype,"styleOrigin",void 0),c([Q("styleOrigin")],tn.prototype,"readStyleOrigin",null),c([ie("styleOrigin",{"styleOrigin.styleUrl":{type:String},"styleOrigin.styleName":{type:String},"styleOrigin.name":{type:String}})],tn.prototype,"writeStyleOrigin",null),c([h({type:vf,json:{read:!1}})],tn.prototype,"thumbnail",void 0),c([h({type:["point-3d","line-3d","polygon-3d","mesh-3d","label-3d"],readOnly:!0})],tn.prototype,"type",void 0),tn=c([S("esri.symbols.Symbol3D")],tn);const yd=tn;let Mp=class extends W{constructor(e){super(e),this.visible=!0}clone(){}};c([h({type:["line"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],Mp.prototype,"type",void 0),c([h({readOnly:!0})],Mp.prototype,"visible",void 0),Mp=c([S("esri.symbols.callouts.Callout3D")],Mp);const pN=Mp;var sS;let Fg=sS=class extends W{constructor(){super(...arguments),this.color=new pe("white")}clone(){return new sS({color:R(this.color)})}};c([h(yl)],Fg.prototype,"color",void 0),Fg=sS=c([S("esri.symbols.callouts.LineCallout3DBorder")],Fg);const fN=Fg;Object.freeze(Object.defineProperty({__proto__:null,default:fN},Symbol.toStringTag,{value:"Module"}));var rS;let da=rS=class extends pN{constructor(e){super(e),this.type="line",this.color=new pe([0,0,0,1]),this.size=Fo(1),this.border=null}get visible(){return this.size>0&&M(this.color)&&this.color.a>0}clone(){return new rS({color:R(this.color),size:this.size,border:R(this.border)})}};c([ue({line:"line"},{readOnly:!0})],da.prototype,"type",void 0),c([h(yl)],da.prototype,"color",void 0),c([h(Cn)],da.prototype,"size",void 0),c([h({type:fN,json:{write:!0}})],da.prototype,"border",void 0),c([h({readOnly:!0})],da.prototype,"visible",null),da=rS=c([S("esri.symbols.callouts.LineCallout3D")],da);const GZ=da;function oT(e){if(!e)return!1;const t=e.verticalOffset;return!!t&&!(t.screenLength<=0||M(t.maxWorldLength)&&t.maxWorldLength<=0)}function mN(e){if(!e||!e.supportsCallout||!e.supportsCallout())return!1;const t=e.callout;return!!t&&!!t.visible&&!!oT(e)}const yN={types:{key:"type",base:pN,typeMap:{line:GZ}},json:{write:!0}};var nS;let ju=nS=class extends W{constructor(e){super(e),this.screenLength=0,this.minWorldLength=0,this.maxWorldLength=null}clone(){return new nS({screenLength:this.screenLength,minWorldLength:this.minWorldLength,maxWorldLength:this.maxWorldLength})}};c([h(Cn)],ju.prototype,"screenLength",void 0),c([h({type:Number,nonNullable:!0,json:{write:!0,default:0}})],ju.prototype,"minWorldLength",void 0),c([h({type:Number,json:{write:!0}})],ju.prototype,"maxWorldLength",void 0),ju=nS=c([S("esri.symbols.support.Symbol3DVerticalOffset")],ju);const gN=ju;var Dg;const vN=he.ofType({base:null,key:"type",typeMap:{text:md}});let pa=Dg=class extends yd{constructor(e){super(e),this.verticalOffset=null,this.callout=null,this.styleOrigin=null,this.symbolLayers=new vN,this.type="label-3d"}supportsCallout(){return!0}hasVisibleCallout(){return mN(this)}hasVisibleVerticalOffset(){return oT(this)}clone(){return new Dg({styleOrigin:R(this.styleOrigin),symbolLayers:R(this.symbolLayers),thumbnail:R(this.thumbnail),callout:R(this.callout),verticalOffset:R(this.verticalOffset)})}static fromTextSymbol(e){return new Dg({symbolLayers:[md.fromTextSymbol(e)]})}};c([h({type:gN,json:{write:!0}})],pa.prototype,"verticalOffset",void 0),c([h(yN)],pa.prototype,"callout",void 0),c([h({json:{read:!1,write:!1}})],pa.prototype,"styleOrigin",void 0),c([h({type:vN})],pa.prototype,"symbolLayers",void 0),c([ue({LabelSymbol3D:"label-3d"},{readOnly:!0})],pa.prototype,"type",void 0),pa=Dg=c([S("esri.symbols.LabelSymbol3D")],pa);const Fb=pa;var Ng;const bN=he.ofType({base:null,key:"type",typeMap:{line:zm,path:nT}}),WZ=he.ofType({base:null,key:"type",typeMap:{line:zm,path:nT}});let $p=Ng=class extends yd{constructor(e){super(e),this.symbolLayers=new bN,this.type="line-3d"}clone(){return new Ng({styleOrigin:R(this.styleOrigin),symbolLayers:R(this.symbolLayers),thumbnail:R(this.thumbnail)})}static fromSimpleLineSymbol(e){return new Ng({symbolLayers:[zm.fromSimpleLineSymbol(e)]})}};c([h({type:bN,json:{type:WZ}})],$p.prototype,"symbolLayers",void 0),c([ue({LineSymbol3D:"line-3d"},{readOnly:!0})],$p.prototype,"type",void 0),$p=Ng=c([S("esri.symbols.LineSymbol3D")],$p);const Db=$p;let fa=class extends us{constructor(e){super(e),this.angle=0,this.type=null,this.xoffset=0,this.yoffset=0,this.size=9}hash(){return`${this.type}.${this.angle}.${this.size}.${this.xoffset}.${this.yoffset}`}};c([h({type:Number,json:{read:e=>e&&-1*e,write:(e,t)=>t.angle=e&&-1*e}})],fa.prototype,"angle",void 0),c([h({type:["simple-marker","picture-marker"],readOnly:!0})],fa.prototype,"type",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],fa.prototype,"xoffset",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],fa.prototype,"yoffset",void 0),c([h({type:Number,cast:e=>e==="auto"?e:Fe(e),json:{write:!0}})],fa.prototype,"size",void 0),fa=c([S("esri.symbols.MarkerSymbol")],fa);const _N=fa;var jg;const wN=he.ofType({base:null,key:"type",typeMap:{fill:jm}});let Tp=jg=class extends yd{constructor(e){super(e),this.symbolLayers=new wN,this.type="mesh-3d"}clone(){return new jg({styleOrigin:R(this.styleOrigin),symbolLayers:R(this.symbolLayers),thumbnail:R(this.thumbnail)})}static fromSimpleFillSymbol(e){return new jg({symbolLayers:[jm.fromSimpleFillSymbol(e)]})}};c([h({type:wN})],Tp.prototype,"symbolLayers",void 0),c([ue({MeshSymbol3D:"mesh-3d"},{readOnly:!0})],Tp.prototype,"type",void 0),Tp=jg=c([S("esri.symbols.MeshSymbol3D")],Tp);const Nb=Tp;function HZ(e,t,i){return t.imageData?bR({mediaType:t.contentType||"image/png",isBase64:!0,data:t.imageData}):xN(t.url,i)}function xN(e,t){var i;return JZ(t)&&!Ms(e)&&((i=t==null?void 0:t.layer)==null?void 0:i.parsedUrl)?Xc(t.layer.parsedUrl.path,"images",e):fd(e,t)}function YZ(e,t,i,s){if(hu(e)){const r=vR(e);if(!r)return;t.contentType=r.mediaType,t.imageData=r.data,i&&i.imageData===t.imageData&&i.url&&au(i.url,t,"url",s)}else au(e,t,"url",s)}const SN={json:{read:{source:["imageData","url"],reader:HZ},write:{writer(e,t,i,s){YZ(e,t,this.source,s)}}}},MN={readOnly:!0,json:{read:{source:["imageData","url"],reader(e,t,i){const s={};return t.imageData&&(s.imageData=t.imageData),t.contentType&&(s.contentType=t.contentType),t.url&&(s.url=xN(t.url,i)),s}}}};function JZ(e){var t,i;return!(e==null||e.origin!=="service"&&e.origin!=="portal-item"||((t=e.layer)==null?void 0:t.type)!=="feature"&&((i=e.layer)==null?void 0:i.type)!=="stream")}var oS;let Bs=oS=class extends KD{constructor(...e){super(...e),this.type="picture-fill",this.url=null,this.xscale=1,this.yscale=1,this.width=12,this.height=12,this.xoffset=0,this.yoffset=0,this.source=null}normalizeCtorArgs(e,t,i,s){if(e&&typeof e!="string"&&e.imageData==null)return e;const r={};return e&&(r.url=e),t&&(r.outline=t),i!=null&&(r.width=Fe(i)),s!=null&&(r.height=Fe(s)),r}clone(){const e=new oS({color:R(this.color),height:this.height,outline:this.outline&&this.outline.clone(),url:this.url,width:this.width,xoffset:this.xoffset,xscale:this.xscale,yoffset:this.yoffset,yscale:this.yscale});return e._set("source",R(this.source)),e}hash(){var e;return`${super.hash()}.${(e=this.color)==null?void 0:e.hash()}.${this.height}.${this.url}.${this.width}.${this.xoffset}.${this.xscale}.${this.yoffset}.${this.yscale}`}};c([ue({esriPFS:"picture-fill"},{readOnly:!0})],Bs.prototype,"type",void 0),c([h(SN)],Bs.prototype,"url",void 0),c([h({type:Number,json:{write:!0}})],Bs.prototype,"xscale",void 0),c([h({type:Number,json:{write:!0}})],Bs.prototype,"yscale",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],Bs.prototype,"width",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],Bs.prototype,"height",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],Bs.prototype,"xoffset",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],Bs.prototype,"yoffset",void 0),c([h(MN)],Bs.prototype,"source",void 0),Bs=oS=c([S("esri.symbols.PictureFillSymbol")],Bs);const $N=Bs;var aS;let fr=aS=class extends _N{constructor(...e){super(...e),this.color=null,this.type="picture-marker",this.url=null,this.source=null,this.height=12,this.width=12,this.size=null}normalizeCtorArgs(e,t,i){if(e&&typeof e!="string"&&e.imageData==null)return e;const s={};return e&&(s.url=e),t!=null&&(s.width=Fe(t)),i!=null&&(s.height=Fe(i)),s}readHeight(e,t){return t.size||e}readWidth(e,t){return t.size||e}clone(){const e=new aS({angle:this.angle,height:this.height,url:this.url,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset});return e._set("source",R(this.source)),e}hash(){return`${super.hash()}.${this.height}.${this.url}.${this.width}`}};c([h({json:{write:!1}})],fr.prototype,"color",void 0),c([ue({esriPMS:"picture-marker"},{readOnly:!0})],fr.prototype,"type",void 0),c([h(SN)],fr.prototype,"url",void 0),c([h(MN)],fr.prototype,"source",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],fr.prototype,"height",void 0),c([Q("height",["height","size"])],fr.prototype,"readHeight",null),c([h({type:Number,cast:Fe,json:{write:!0}})],fr.prototype,"width",void 0),c([h({json:{write:!1}})],fr.prototype,"size",void 0),fr=aS=c([S("esri.symbols.PictureMarkerSymbol")],fr);const jb=fr;var Gl;const TN=he.ofType({base:null,key:"type",typeMap:{icon:Pc,object:rT,text:md}});let Wl=Gl=class extends yd{constructor(e){super(e),this.verticalOffset=null,this.callout=null,this.symbolLayers=new TN,this.type="point-3d"}supportsCallout(){if((this.symbolLayers?this.symbolLayers.length:0)<1)return!1;for(const e of this.symbolLayers.items)switch(e.type){case"icon":case"text":case"object":continue;default:return!1}return!0}hasVisibleCallout(){return mN(this)}hasVisibleVerticalOffset(){return oT(this)}clone(){return new Gl({verticalOffset:R(this.verticalOffset),callout:R(this.callout),styleOrigin:R(this.styleOrigin),symbolLayers:R(this.symbolLayers),thumbnail:R(this.thumbnail)})}static fromSimpleMarkerSymbol(e){return new Gl({symbolLayers:[Pc.fromSimpleMarkerSymbol(e)]})}static fromPictureMarkerSymbol(e){return new Gl({symbolLayers:[Pc.fromPictureMarkerSymbol(e)]})}static fromCIMSymbol(e){var s,r;if(((r=(s=e.data)==null?void 0:s.symbol)==null?void 0:r.type)!=="CIMPointSymbol")return null;const i=e.data.symbol;return new Gl(i!=null&&i.callout?{symbolLayers:[Pc.fromCIMSymbol(e)],callout:{type:"line",size:.5,color:[0,0,0]},verticalOffset:{screenLength:40}}:{symbolLayers:[Pc.fromCIMSymbol(e)]})}static fromTextSymbol(e){return new Gl({symbolLayers:[md.fromTextSymbol(e)]})}};c([h({type:gN,json:{write:!0}})],Wl.prototype,"verticalOffset",void 0),c([h(yN)],Wl.prototype,"callout",void 0),c([h({type:TN,json:{origins:{"web-scene":{write:!0}}}})],Wl.prototype,"symbolLayers",void 0),c([ue({PointSymbol3D:"point-3d"},{readOnly:!0})],Wl.prototype,"type",void 0),Wl=Gl=c([S("esri.symbols.PointSymbol3D")],Wl);const Ac=Wl;var Ip;const IN=he.ofType({base:null,key:"type",typeMap:{extrude:ZD,fill:jm,icon:Pc,line:zm,object:rT,text:md,water:hN}});let Ep=Ip=class extends yd{constructor(e){super(e),this.symbolLayers=new IN,this.type="polygon-3d"}clone(){return new Ip({styleOrigin:R(this.styleOrigin),symbolLayers:R(this.symbolLayers),thumbnail:R(this.thumbnail)})}static fromJSON(e){const t=new Ip;if(t.read(e),t.symbolLayers.length===2&&t.symbolLayers.getItemAt(0).type==="fill"&&t.symbolLayers.getItemAt(1).type==="line"){const i=t.symbolLayers.getItemAt(0),s=t.symbolLayers.getItemAt(1);!s.enabled||e.symbolLayers&&e.symbolLayers[1]&&e.symbolLayers[1].enable===!1||(i.outline={size:s.size,color:M(s.material)?s.material.color:null}),t.symbolLayers.removeAt(1)}return t}static fromSimpleFillSymbol(e){return new Ip({symbolLayers:[jm.fromSimpleFillSymbol(e)]})}};c([h({type:IN,json:{write:!0}})],Ep.prototype,"symbolLayers",void 0),c([ue({PolygonSymbol3D:"polygon-3d"},{readOnly:!0})],Ep.prototype,"type",void 0),Ep=Ip=c([S("esri.symbols.PolygonSymbol3D")],Ep);const Bm=Ep;var lS;const G_=new Ie({esriSFSSolid:"solid",esriSFSNull:"none",esriSFSHorizontal:"horizontal",esriSFSVertical:"vertical",esriSFSForwardDiagonal:"forward-diagonal",esriSFSBackwardDiagonal:"backward-diagonal",esriSFSCross:"cross",esriSFSDiagonalCross:"diagonal-cross"});let Hl=lS=class extends KD{constructor(...e){super(...e),this.color=new pe([0,0,0,.25]),this.outline=new tr,this.type="simple-fill",this.style="solid"}normalizeCtorArgs(e,t,i){if(e&&typeof e!="string")return e;const s={};return e&&(s.style=e),t&&(s.outline=t),i&&(s.color=i),s}clone(){return new lS({color:R(this.color),outline:this.outline&&this.outline.clone(),style:this.style})}hash(){return`${super.hash()}${this.style}.${this.color&&this.color.hash()}`}};c([h()],Hl.prototype,"color",void 0),c([h()],Hl.prototype,"outline",void 0),c([ue({esriSFS:"simple-fill"},{readOnly:!0})],Hl.prototype,"type",void 0),c([h({type:G_.apiValues,json:{read:G_.read,write:G_.write}})],Hl.prototype,"style",void 0),Hl=lS=c([S("esri.symbols.SimpleFillSymbol")],Hl);const gl=Hl;var cS;const W_=new Ie({esriSMSCircle:"circle",esriSMSSquare:"square",esriSMSCross:"cross",esriSMSX:"x",esriSMSDiamond:"diamond",esriSMSTriangle:"triangle",esriSMSPath:"path"});let sn=cS=class extends _N{constructor(...e){super(...e),this.color=new pe([255,255,255,.25]),this.type="simple-marker",this.size=12,this.style="circle",this.outline=new tr}normalizeCtorArgs(e,t,i,s){if(e&&typeof e!="string")return e;const r={};return e&&(r.style=e),t!=null&&(r.size=Fe(t)),i&&(r.outline=i),s&&(r.color=s),r}writeColor(e,t){e&&this.style!=="x"&&this.style!=="cross"&&(t.color=e.toJSON()),e===null&&(t.color=null)}set path(e){this.style="path",this._set("path",e)}clone(){return new cS({angle:this.angle,color:R(this.color),outline:this.outline&&this.outline.clone(),path:this.path,size:this.size,style:this.style,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){var e;return`${super.hash()}.${this.color&&this.color.hash()}.${this.path}.${this.style}.${(e=this.outline)==null?void 0:e.hash()}`}};c([h()],sn.prototype,"color",void 0),c([ie("color")],sn.prototype,"writeColor",null),c([ue({esriSMS:"simple-marker"},{readOnly:!0})],sn.prototype,"type",void 0),c([h()],sn.prototype,"size",void 0),c([h({type:W_.apiValues,json:{read:W_.read,write:W_.write}})],sn.prototype,"style",void 0),c([h({type:String,json:{write:!0}})],sn.prototype,"path",null),c([h({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":tr}},json:{default:null,write:!0}})],sn.prototype,"outline",void 0),sn=cS=c([S("esri.symbols.SimpleMarkerSymbol")],sn);const vl=sn;var uS;let rt=uS=class extends us{constructor(...e){super(...e),this.backgroundColor=null,this.borderLineColor=null,this.borderLineSize=null,this.font=new Lb,this.horizontalAlignment="center",this.kerning=!0,this.haloColor=null,this.haloSize=null,this.rightToLeft=null,this.rotated=!1,this.text="",this.type="text",this.verticalAlignment="baseline",this.xoffset=0,this.yoffset=0,this.angle=0,this.width=null,this.lineWidth=192,this.lineHeight=1}normalizeCtorArgs(e,t,i){if(e&&typeof e!="string")return e;const s={};return e&&(s.text=e),t&&(s.font=t),i&&(s.color=i),s}writeLineWidth(e,t,i,s){s&&typeof s!="string"?s.origin:t[i]=e}castLineWidth(e){return Fe(e)}writeLineHeight(e,t,i,s){s&&typeof s!="string"?s.origin:t[i]=e}clone(){return new uS({angle:this.angle,backgroundColor:R(this.backgroundColor),borderLineColor:R(this.borderLineColor),borderLineSize:this.borderLineSize,color:R(this.color),font:this.font&&this.font.clone(),haloColor:R(this.haloColor),haloSize:this.haloSize,horizontalAlignment:this.horizontalAlignment,kerning:this.kerning,lineHeight:this.lineHeight,lineWidth:this.lineWidth,rightToLeft:this.rightToLeft,rotated:this.rotated,text:this.text,verticalAlignment:this.verticalAlignment,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){var e;return`${this.backgroundColor&&this.backgroundColor.hash()}.${this.borderLineColor}.${this.borderLineSize}.${(e=this.color)==null?void 0:e.hash()}.${this.font&&this.font.hash()}.${this.haloColor&&this.haloColor.hash()}.${this.haloSize}.${this.horizontalAlignment}.${this.kerning}.${this.rightToLeft}.${this.rotated}.${this.text}.${this.verticalAlignment}.${this.width}.${this.xoffset}.${this.yoffset}.${this.lineHeight}.${this.lineWidth}.${this.angle}`}};c([h({type:pe,json:{write:!0}})],rt.prototype,"backgroundColor",void 0),c([h({type:pe,json:{write:!0}})],rt.prototype,"borderLineColor",void 0),c([h({type:Number,json:{write:!0}})],rt.prototype,"borderLineSize",void 0),c([h({type:Lb,json:{write:!0}})],rt.prototype,"font",void 0),c([h({...oN,json:{write:!0}})],rt.prototype,"horizontalAlignment",void 0),c([h({type:Boolean,json:{write:!0}})],rt.prototype,"kerning",void 0),c([h({type:pe,json:{write:!0}})],rt.prototype,"haloColor",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],rt.prototype,"haloSize",void 0),c([h({type:Boolean,json:{write:!0}})],rt.prototype,"rightToLeft",void 0),c([h({type:Boolean,json:{write:!0}})],rt.prototype,"rotated",void 0),c([h({type:String,json:{write:!0}})],rt.prototype,"text",void 0),c([ue({esriTS:"text"},{readOnly:!0})],rt.prototype,"type",void 0),c([h({...aN,json:{write:!0}})],rt.prototype,"verticalAlignment",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],rt.prototype,"xoffset",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],rt.prototype,"yoffset",void 0),c([h({type:Number,json:{read:e=>e&&-1*e,write:(e,t)=>t.angle=e&&-1*e}})],rt.prototype,"angle",void 0),c([h({type:Number,json:{write:!0}})],rt.prototype,"width",void 0),c([h({type:Number})],rt.prototype,"lineWidth",void 0),c([ie("lineWidth")],rt.prototype,"writeLineWidth",null),c([Oe("lineWidth")],rt.prototype,"castLineWidth",null),c([h(nN)],rt.prototype,"lineHeight",void 0),c([ie("lineHeight")],rt.prototype,"writeLineHeight",null),rt=uS=c([S("esri.symbols.TextSymbol")],rt);const gd=rt;var hS;let mr=hS=class extends us{constructor(e){super(e),this.styleName=null,this.portal=null,this.styleUrl=null,this.thumbnail=null,this.name=null,this.type="web-style"}get _fetchCacheKey(){const e=M(this.portal)?this.portal:cs.getDefault(),t=e.user?e.user.username:null;return`${this.styleName}:${this.styleUrl}:${this.name}:${t}:${e.url}`}read(e,t){this.portal=t?t.portal:void 0,super.read(e,t)}clone(){return new hS({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}fetchSymbol(e){return this._fetchSymbol("webRef",e)}fetchCIMSymbol(e){return this._fetchSymbol("cimRef",e)}async _fetchSymbol(e,t){const i=M(t)?t.cache:null,s=i?this._fetchCacheKey:null;if(M(i)){const a=s&&i.get(s);if(a)return a.clone()}const r=await XZ();Ft(t);const n=r.resolveWebStyleSymbol(this,{portal:this.portal},e,t);n.catch(a=>{q.getLogger(this.declaredClass).error("#fetchSymbol()","Failed to create symbol from style",a)});const o=await n;return e==="webRef"&&o.type==="point-3d"||e==="cimRef"&&o.type==="cim"?(M(i)&&i.set(s,o.clone()),o):null}};function XZ(){return z(()=>import("./webStyleSymbolUtils.1a3d8f77.js"),["assets/webStyleSymbolUtils.1a3d8f77.js","assets/devEnvironmentUtils.d8d0484c.js"])}c([h({json:{write:!1}})],mr.prototype,"color",void 0),c([h({type:String,json:{write:!0}})],mr.prototype,"styleName",void 0),c([h({type:cs,json:{write:!1}})],mr.prototype,"portal",void 0),c([h({type:String,json:{read:sT,write:au}})],mr.prototype,"styleUrl",void 0),c([h({type:vf,json:{read:!1}})],mr.prototype,"thumbnail",void 0),c([h({type:String,json:{write:!0}})],mr.prototype,"name",void 0),c([ue({styleSymbolReference:"web-style"},{readOnly:!0})],mr.prototype,"type",void 0),c([h()],mr.prototype,"_fetchCacheKey",null),mr=hS=c([S("esri.symbols.WebStyleSymbol")],mr);const mu=mr;function Vb(e){if(!e)return!1;switch(e.type){case"picture-fill":case"picture-marker":case"simple-fill":case"simple-line":case"simple-marker":case"text":case"cim":return!0;default:return!1}}function Jh(e){if(!e)return!1;switch(e.type){case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":return!0;default:return!1}}const Uc={base:us,key:"type",typeMap:{"simple-fill":gl,"picture-fill":$N,"picture-marker":jb,"simple-line":tr,"simple-marker":vl,text:gd,"label-3d":Fb,"line-3d":Db,"mesh-3d":Nb,"point-3d":Ac,"polygon-3d":Bm,"web-style":mu,cim:Nm},errorContext:"symbol"},ZZ={base:us,key:"type",typeMap:{"picture-marker":jb,"simple-marker":vl,text:gd,"web-style":mu,cim:Nm},errorContext:"symbol"},QZ=dl({types:Uc}),zb={base:us,key:"type",typeMap:{"simple-fill":gl,"picture-fill":$N,"picture-marker":jb,"simple-line":tr,"simple-marker":vl,text:gd,"line-3d":Db,"mesh-3d":Nb,"point-3d":Ac,"polygon-3d":Bm,"web-style":mu,cim:Nm},errorContext:"symbol"},KZ={base:us,key:"type",typeMap:{text:gd,"label-3d":Fb},errorContext:"symbol"},Lk={base:us,key:"type",typeMap:{"line-3d":Db,"mesh-3d":Nb,"point-3d":Ac,"polygon-3d":Bm,"web-style":mu,cim:Nm},errorContext:"symbol"},eQ={base:us,key:"type",typeMap:{"label-3d":Fb},errorContext:"symbol"},EN=En(Uc);function tQ(e){if(!e)return null;const t={};for(const i in e){const s=ll(e[i]);s&&(t[i]=s)}return Object.keys(t).length!==0?t:null}function iQ(e){if(!M(e))return null;const t={};for(const i in e){const s=e[i];s&&(t[i]=s.toJSON())}return Object.keys(t).length!==0?t:null}let Hi=class extends xt(W){constructor(...e){super(...e),this.isAggregate=!1,this.layer=null,this.popupTemplate=null,this.sourceLayer=null,Object.defineProperty(this,"uid",{value:uf(),configurable:!0})}normalizeCtorArgs(e,t,i,s){return e&&!e.declaredClass?e:{geometry:e,symbol:t,attributes:i,popupTemplate:s}}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),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&&M(t.defaultPopupTemplate))return t.defaultPopupTemplate}return null}getAttribute(e){var t;return(t=this.attributes)==null?void 0:t[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{aggregateGeometries:iQ(this.aggregateGeometries),geometry:M(this.geometry)?this.geometry.toJSON():null,symbol:M(this.symbol)?this.symbol.toJSON():null,attributes:{...this.attributes},popupTemplate:this.popupTemplate&&this.popupTemplate.toJSON()}}notifyGeometryChanged(){this._notifyLayer("geometry",this.geometry,this.geometry)}notifyMeshTransformChanged(){M(this.geometry)&&this.geometry.type==="mesh"&&this._notifyLayer("transform",this.geometry.transform,this.geometry.transform)}_notifyLayer(e,t,i,s){if(!this.layer||!("graphicChanged"in this.layer))return;const r={graphic:this,property:e,oldValue:t,newValue:i};e==="attributes"&&(r.attributeName=s),this.layer.graphicChanged(r)}};c([h({value:null,json:{read:tQ}})],Hi.prototype,"aggregateGeometries",null),c([h({value:null})],Hi.prototype,"attributes",null),c([h({value:null,types:fu,json:{read:ll}})],Hi.prototype,"geometry",null),c([h({type:Boolean})],Hi.prototype,"isAggregate",void 0),c([h({clonable:"reference"})],Hi.prototype,"layer",void 0),c([h({type:Dm})],Hi.prototype,"popupTemplate",void 0),c([h({clonable:"reference"})],Hi.prototype,"sourceLayer",void 0),c([h({value:null,types:Uc})],Hi.prototype,"symbol",null),c([h({type:Boolean,value:!0})],Hi.prototype,"visible",null),Hi=c([S("esri.Graphic")],Hi),function(e){e.generateUID=uf}(Hi||(Hi={}));const Ci=Hi;let qc=class extends pf{_own(e){e.layer&&"remove"in e.layer&&e.layer!==this.owner&&e.layer.remove(e),e.layer=this.owner}_release(e){e.layer===this.owner&&(e.layer=null)}};c([P$({Type:Ci,ensureType:Dt(Ci)})],qc.prototype,"itemType",void 0),qc=c([S("esri.support.GraphicsCollection")],qc);var dS;let kp=dS=class extends W{constructor(e){super(e)}async collectRequiredFields(e,t){return Ui(e,t,this.expression)}clone(){return new dS({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};c([h({type:String,json:{write:!0}})],kp.prototype,"expression",void 0),c([h({type:String,json:{write:!0}})],kp.prototype,"title",void 0),kp=dS=c([S("esri.layers.support.FeatureExpressionInfo")],kp);const Fk=kp,aT={inches:Fs(1,"meters","inches"),feet:Fs(1,"meters","feet"),"us-feet":Fs(1,"meters","us-feet"),yards:Fs(1,"meters","yards"),miles:Fs(1,"meters","miles"),"nautical-miles":Fs(1,"meters","nautical-miles"),millimeters:Fs(1,"meters","millimeters"),centimeters:Fs(1,"meters","centimeters"),decimeters:Fs(1,"meters","decimeters"),meters:Fs(1,"meters","meters"),kilometers:Fs(1,"meters","kilometers"),"decimal-degrees":1/xW(1,"meters",it.radius)};function t_e(e){return 1/(aT[e]||1)}function sQ(){const e=Object.keys(aT);return e.sort(),e}const rQ=sQ();var pS;const Sy=mi()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),Dk=new Ie({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let Zn=pS=class extends W{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return e!=null?e:t.featureExpression&&t.featureExpression.value===0?{expression:"0"}:void 0}writeFeatureExpressionInfo(e,t,i,s){t[i]=e.write({},s),e.expression==="0"&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):M(e)||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}clone(){return new pS({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&U6(this.featureExpressionInfo,e.featureExpressionInfo)}};c([h({type:Fk,json:{write:!0}})],Zn.prototype,"featureExpressionInfo",void 0),c([Q("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],Zn.prototype,"readFeatureExpressionInfo",null),c([ie("featureExpressionInfo",{featureExpressionInfo:{type:Fk},"featureExpression.value":{type:[0]}})],Zn.prototype,"writeFeatureExpressionInfo",null),c([h({type:Sy.apiValues,nonNullable:!0,json:{type:Sy.jsonValues,read:Sy.read,write:{writer:Sy.write,isRequired:!0}}})],Zn.prototype,"mode",null),c([h({type:Number,json:{write:!0}})],Zn.prototype,"offset",void 0),c([h({type:rQ,json:{type:String,read:Dk.read,write:Dk.write}})],Zn.prototype,"unit",null),Zn=pS=c([S("esri.layers.support.ElevationInfo")],Zn);const kN=Zn;let Qn=class extends CD(PD(Yf)){constructor(e){super(e),this.elevationInfo=null,this.graphics=new qc,this.screenSizePerspectiveEnabled=!0,this.type="graphics",this.internal=!1}destroy(){this.removeAll(),this.graphics.destroy()}add(e){return this.graphics.add(e),this}addMany(e){return this.graphics.addMany(e),this}removeAll(){return this.graphics.removeAll(),this}remove(e){this.graphics.remove(e)}removeMany(e){this.graphics.removeMany(e)}on(e,t){return super.on(e,t)}graphicChanged(e){this.emit("graphic-update",e)}};c([h({type:kN})],Qn.prototype,"elevationInfo",void 0),c([h(nx(qc,"graphics"))],Qn.prototype,"graphics",void 0),c([h({type:["show","hide"]})],Qn.prototype,"listMode",void 0),c([h()],Qn.prototype,"screenSizePerspectiveEnabled",void 0),c([h({readOnly:!0})],Qn.prototype,"type",void 0),c([h({constructOnly:!0})],Qn.prototype,"internal",void 0),Qn=c([S("esri.layers.GraphicsLayer")],Qn);const CN=Qn;var fS;let Vg=fS=class extends W{constructor(e){super(e),this.type="none"}clone(){return new fS({type:this.type})}};c([ue({none:"none",stayAbove:"stay-above"})],Vg.prototype,"type",void 0),Vg=fS=c([S("esri.ground.NavigationConstraint")],Vg);let Ke=class extends oe{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.TESTS_DISABLE_OPTIMIZATIONS=!1,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1,this.TERRAIN_USE_LEGACY_SHADING=!1}};c([h()],Ke.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),c([h()],Ke.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),c([h()],Ke.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),c([h()],Ke.prototype,"DECONFLICTOR_SHOW_GRID",void 0),c([h()],Ke.prototype,"LABELS_SHOW_BORDER",void 0),c([h()],Ke.prototype,"TEXT_SHOW_BASELINE",void 0),c([h()],Ke.prototype,"TEXT_SHOW_BORDER",void 0),c([h()],Ke.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),c([h()],Ke.prototype,"OVERLAY_SHOW_CENTER",void 0),c([h()],Ke.prototype,"SHOW_POI",void 0),c([h()],Ke.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),c([h()],Ke.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),c([h()],Ke.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),c([h()],Ke.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),c([h()],Ke.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),c([h()],Ke.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),c([h()],Ke.prototype,"I3S_TREE_SHOW_TILES",void 0),c([h()],Ke.prototype,"I3S_SHOW_MODIFICATIONS",void 0),c([h()],Ke.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),c([h()],Ke.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),c([h()],Ke.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),c([h()],Ke.prototype,"LINE_WIREFRAMES",void 0),c([h()],Ke.prototype,"TERRAIN_USE_LEGACY_SHADING",void 0),Ke=c([S("esri.views.3d.support.DebugFlags")],Ke);const nQ=new Ke;var mS;let rn=mS=class extends Cm(Lo){constructor(e){super(e),this.opacity=1,this.shading=!nQ.TERRAIN_USE_LEGACY_SHADING,this.surfaceColor=null,this.navigationConstraint=null,this.layers=new he;const t=s=>{s.parent&&s.parent!==this&&"remove"in s.parent&&s.parent.remove(s),s.parent=this,s.type!=="elevation"&&s.type!=="base-elevation"&&q.getLogger(this.declaredClass).error(`Layer '${s.title}, id:${s.id}' of type '${s.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`)},i=s=>{s.parent=null};this.layers.on("after-add",s=>t(s.item)),this.layers.on("after-remove",s=>i(s.item))}initialize(){this.when().catch(e=>{q.getLogger(this.declaredClass).error("#load()","Failed to load ground",e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.layers.removeAll();for(const t of e)t.destroy();this.layers.destroy()}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set layers(e){this._set("layers",ou(e,this._get("layers")))}writeLayers(e,t,i,s){const r=[];e&&(s={...s,layerContainerType:"ground"},e.forEach(n=>{if("write"in n){const o={};V1(n)().write(o,s)&&r.push(o)}else s&&s.messages&&s.messages.push(new L("layer:unsupported",`Layers (${n.title}, ${n.id}) of type '${n.declaredClass}' cannot be persisted in the ground`,{layer:n}))})),t.layers=r}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return fD(this,e=>{e(this.layers)})}async queryElevation(e,t){await this.load({signal:t==null?void 0:t.signal});const{ElevationQuery:i}=await z(()=>import("./ElevationQuery.5a32e4bc.js"),[]);Ft(t);const s=new i,r=this.layers.filter(Nk).toArray();return s.queryAll(r,e,t)}async createElevationSampler(e,t){await this.load({signal:t==null?void 0:t.signal});const{ElevationQuery:i}=await z(()=>import("./ElevationQuery.5a32e4bc.js"),[]);Ft(t);const s=new i,r=this.layers.filter(Nk).toArray();return s.createSamplerAll(r,e,t)}clone(){const e={opacity:this.opacity,surfaceColor:R(this.surfaceColor),navigationConstraint:R(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(e.loadStatus="loaded"),new mS({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set("resourceInfo",{data:e,context:t}),super.read(e,t)}_loadFromSource(e){const t=this.resourceInfo;return t?this._loadLayersFromJSON(t.data,t.context,e):Promise.resolve()}_loadLayersFromJSON(e,t,i){const s=t&&t.origin||"web-scene",r=t&&t.portal||null,n=t&&t.url||null;return z(()=>import("./layersCreator.eb921b3a.js"),["assets/layersCreator.eb921b3a.js","assets/lazyLayerLoader.f961f278.js","assets/portalLayers.8fee158d.js","assets/layersLoader.67118e89.js","assets/jsonContext.3176ed6f.js","assets/portalItemUtils.57ded807.js"]).then(({populateOperationalLayers:o})=>{Ft(i);const a=[];if(e.layers&&Array.isArray(e.layers)){const l={context:{origin:s,url:n,portal:r,layerContainerType:"ground"},defaultLayerType:"ArcGISTiledElevationServiceLayer"};a.push(o(this.layers,e.layers,l))}return as(a)}).then(()=>{})}};function oQ(e){return e&&"createElevationSampler"in e}function Nk(e){return e.type==="elevation"||oQ(e)}c([h({json:{read:!1}})],rn.prototype,"layers",null),c([ie("layers")],rn.prototype,"writeLayers",null),c([h({readOnly:!0})],rn.prototype,"resourceInfo",void 0),c([h({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:Ge,read:{reader:em,source:"transparency"},write:{writer:(e,t)=>{t.transparency=Rb(e)},target:"transparency"}}})],rn.prototype,"opacity",void 0),c([h({type:Boolean,nonNullable:!0,json:{read:!1}})],rn.prototype,"shading",void 0),c([h({type:pe,json:{type:[Ge],write:(e,t)=>{t.surfaceColor=e.toJSON().slice(0,3)}}})],rn.prototype,"surfaceColor",void 0),c([h({type:Vg,json:{write:!0}})],rn.prototype,"navigationConstraint",void 0),rn=mS=c([S("esri.Ground")],rn);const wv=rn;let Vu=class extends he{constructor(e){super(e),this.getCollections=null}initialize(){this.own(NR(()=>this._refresh()))}destroy(){this.getCollections=null}_refresh(){const e=M(this.getCollections)?this.getCollections():null;if(N(e))return void this.removeAll();let t=0;for(const i of e)M(i)&&(t=this._processCollection(t,i));this.splice(t,this.length)}_createNewInstance(e){return new he(e)}_processCollection(e,t){if(!t)return e;const i=this.itemFilterFunction?this.itemFilterFunction:s=>!!s;for(const s of t)if(s){if(i(s)){const r=this.indexOf(s,e);r>=0?r!==e&&this.reorder(s,e):this.add(s,e),++e}if(this.getChildrenFunction){const r=this.getChildrenFunction(s);if(Array.isArray(r))for(const n of r)e=this._processCollection(e,n);else e=this._processCollection(e,r)}}return e}};c([h()],Vu.prototype,"getCollections",void 0),c([h()],Vu.prototype,"getChildrenFunction",void 0),c([h()],Vu.prototype,"itemFilterFunction",void 0),Vu=c([S("esri.core.CollectionFlattener")],Vu);const im=Vu;function aQ(e){var t;return!!(e&&e.loaded&&"capabilities"in e&&((t=e==null?void 0:e.capabilities)==null?void 0:t.operations)&&"supportsEditing"in e.capabilities.operations&&e.capabilities.operations.supportsEditing===!0)&&!("editingEnabled"in e&&!e.editingEnabled)}function lQ(e){return new im({getCollections:()=>[e.tables,e.layers],getChildrenFunction:t=>{const i=[];return"tables"in t&&i.push(t.tables),"layers"in t&&i.push(t.layers),i},itemFilterFunction:t=>{const i=t.parent;return i&&"tables"in i&&i.tables.includes(t)}})}const jk={"world-elevation":{id:"worldElevation",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"},"world-topobathymetry":{id:"worldTopoBathymetry",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/TopoBathy3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"}};function cQ(e){let t=null;if(typeof e=="string")if(e in jk){const i=jk[e];t=new wv({resourceInfo:{data:{layers:[i]}}})}else q.getLogger("esri.support.groundUtils").warn(`Unable to find ground definition for: ${e}. Try "world-elevation"`);else t=Dt(wv,e);return t}function yS(e,t,i){let s,r;if(e)for(let n=0,o=e.length;n{let t=class extends e{constructor(...i){super(...i),this.layers=new he;const s=o=>{o.parent&&"remove"in o.parent&&o.parent.remove(o)},r=o=>{o.parent=this,this.layerAdded(o),o.type!=="elevation"&&o.type!=="base-elevation"||q.getLogger(this.declaredClass).error(`Layer 'title:${o.title}, id:${o.id}' of type '${o.type}' is not supported as an operational layer and will therefore be ignored.`)},n=o=>{o.parent=null,this.layerRemoved(o)};this.layers.on("before-add",o=>s(o.item)),this.layers.on("after-add",o=>r(o.item)),this.layers.on("after-remove",o=>n(o.item))}destroy(){const i=this.layers.removeAll();for(const s of i)this.layerRemoved(s),s.destroy();this.layers.destroy()}set layers(i){this._set("layers",ou(i,this._get("layers")))}add(i,s){const r=this.layers;if(s=r.getNextIndex(s),i instanceof Yf){const n=i;n.parent===this?this.reorder(n,s):r.add(n,s)}else No(i)?i.then(n=>{this.destroyed||this.add(n,s)}):q.getLogger(this.declaredClass).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(i,s){const r=this.layers;s=r.getNextIndex(s),i.slice().forEach(n=>{n.parent!==this?(r.add(n,s),s+=1):this.reorder(n,s)})}findLayerById(i){return yS(this.layers,"id",i)}findLayerByUid(i){return yS(this.layers,"uid",i)}remove(i){return this.layers.remove(i)}removeMany(i){return this.layers.removeMany(i)}removeAll(){return this.layers.removeAll()}reorder(i,s){return this.layers.reorder(i,s)}layerAdded(i){}layerRemoved(i){}};return c([h()],t.prototype,"layers",null),t=c([S("esri.support.LayersMixin")],t),t};function gS(e,t,i){if(e)for(let s=0,r=e.length;s{let t=class extends e{constructor(...i){super(...i),this.tables=new he,this.tables.on("after-add",s=>{const r=s.item;r.parent&&r.parent!==this&&"tables"in r.parent&&r.parent.tables.remove(r),r.parent=this,r.type!=="feature"&&q.getLogger(this.declaredClass).error(`Layer 'title:${r.title}, id:${r.id}' of type '${r.type}' is not supported as a table and will therefore be ignored.`)}),this.tables.on("after-remove",s=>{s.item.parent=null})}destroy(){const i=this.tables.removeAll();for(const s of i)s.destroy();this.tables.destroy()}set tables(i){this._set("tables",ou(i,this._get("tables")))}findTableById(i){return gS(this.tables,"id",i)}findTableByUid(i){return gS(this.tables,"uid",i)}};return c([h()],t.prototype,"tables",null),t=c([S("esri.support.TablesMixin")],t),t};let nn=class extends hQ(uQ(jo.EventedMixin(oe))){constructor(e){super(e),this.allLayers=new im({getCollections:()=>{var t,i,s;return[(t=this.basemap)==null?void 0:t.baseLayers,(i=this.ground)==null?void 0:i.layers,this.layers,(s=this.basemap)==null?void 0:s.referenceLayers]},getChildrenFunction:t=>"layers"in t?t.layers:null}),this.allTables=lQ(this),this.basemap=null,this.editableLayers=new im({getCollections:()=>[this.allLayers],itemFilterFunction:aQ}),this.ground=new wv,this._basemapCache=mJ()}destroy(){var e,t;this.allLayers.destroy(),this.allTables.destroy(),this.editableLayers.destroy(),(e=this.ground)==null||e.destroy(),(t=this.basemap)==null||t.destroy(),gD(this._basemapCache),this._basemapCache=null}castBasemap(e){return xg(e,this._basemapCache)}castGround(e){const t=cQ(e);return N(t)?this._get("ground"):t}findLayerById(e){return this.allLayers.find(t=>t.id===e)}findTableById(e){return this.allTables.find(t=>t.id===e)}};c([h({readOnly:!0,dependsOn:[]})],nn.prototype,"allLayers",void 0),c([h({readOnly:!0})],nn.prototype,"allTables",void 0),c([h({type:mv})],nn.prototype,"basemap",void 0),c([Oe("basemap")],nn.prototype,"castBasemap",null),c([h({readOnly:!0})],nn.prototype,"editableLayers",void 0),c([h({type:wv,nonNullable:!0})],nn.prototype,"ground",void 0),c([Oe("ground")],nn.prototype,"castGround",null),nn=c([S("esri.Map")],nn);const PN=nn;class lT{constructor(t,i){this.min=t,this.max=i,this.range=i-t}ndiff(t,i=0){return Math.ceil((t-i)/this.range)*this.range+i}_normalize(t,i,s,r=0,n=!1){return(s-=r)i&&(s-=this.ndiff(s-i)),n&&s===i&&(s=t),s+r}normalize(t,i=0,s=!1){return this._normalize(this.min,this.max,t,i,s)}clamp(t,i=0){return ls(t-i,this.min,this.max)+i}monotonic(t,i,s){return tt&&sdQ.normalize(Ys(e)))],Kn.prototype,"heading",void 0),c([h({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),Oe(e=>ls(Ys(e),-180,180))],Kn.prototype,"tilt",void 0),c([h({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Kn.prototype,"fov",void 0),Kn=c([S("esri.Camera")],Kn);const pQ=Kn;var vS;let ma=vS=class extends W{constructor(e){super(e),this.rotation=0,this.scale=0,this.targetGeometry=null,this.camera=null}castRotation(e){return(e%=360)<0&&(e+=360),e}clone(){return new vS({rotation:this.rotation,scale:this.scale,targetGeometry:M(this.targetGeometry)?this.targetGeometry.clone():null,camera:M(this.camera)?this.camera.clone():null})}};function H_(){return{enabled:!this.camera}}c([h({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:H_}}}}})],ma.prototype,"rotation",void 0),c([Oe("rotation")],ma.prototype,"castRotation",null),c([h({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:H_}}}}})],ma.prototype,"scale",void 0),c([h({types:fu,json:{read:ll,write:!0,origins:{"web-scene":{read:ll,write:{overridePolicy:H_}}}}})],ma.prototype,"targetGeometry",void 0),c([h({type:pQ,json:{write:!0}})],ma.prototype,"camera",void 0),ma=vS=c([S("esri.Viewpoint")],ma);const Mn=ma;class xv{constructor(t=i=>i.values().next().value){this._peeker=t,this._items=new Set}get length(){return this._items.size}clear(){this._items.clear()}last(){if(this._items.size===0)return;let t;for(t of this._items);return t}peek(){if(this._items.size!==0)return this._peeker(this._items)}push(t){this.contains(t)||this._items.add(t)}contains(t){return this._items.has(t)}pop(){if(this.length===0)return;const t=this.peek();return this._items.delete(t),t}popLast(){if(this.length===0)return;const t=this.last();return this._items.delete(t),t}remove(t){this._items.delete(t)}filter(t){return this._items.forEach(i=>{t(i)||this._items.delete(i)}),this}}var li;(function(e){e[e.HANDSHAKE=0]="HANDSHAKE",e[e.OPEN=1]="OPEN",e[e.OPENED=2]="OPENED",e[e.RESPONSE=3]="RESPONSE",e[e.INVOKE=4]="INVOKE",e[e.ABORT=5]="ABORT",e[e.CLOSE=6]="CLOSE",e[e.OPEN_PORT=7]="OPEN_PORT",e[e.ON=8]="ON"})(li||(li={}));let fQ=0;function AN(){return fQ++}function mQ(e){return e&&typeof e=="object"&&("result"in e||"transferList"in e)}function sm(e){return e?typeof e=="string"?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function uT(e,t,i,s){if(t.type===li.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==li.INVOKE&&t.type!==li.RESPONSE)return void e.postMessage(t);let r;if(mQ(i)?(r=Vk(i.transferList),t.data=i.result):(r=Vk(s),t.data=i),r){if(V("ff")){for(const n of r)if("byteLength"in n&&n.byteLength>267386880){const o="Worker call with large ArrayBuffer would crash Firefox";switch(t.type){case li.INVOKE:throw o;case li.RESPONSE:return void uT(e,{type:li.RESPONSE,jobId:t.jobId,error:sm(o)})}}}e.postMessage(t,r)}else e.postMessage(t)}function rm(e){if(!e)return null;const t=e.data;return t?typeof t=="string"?JSON.parse(t):t:null}function Vk(e){if(!e||!e.length)return null;if(V("esri-workers-arraybuffer-transfer"))return e;const t=e.filter(i=>!yQ(i));return t.length?t:null}function yQ(e){return e instanceof ArrayBuffer||e&&e.constructor&&e.constructor.name==="ArrayBuffer"}const gQ={statsWorker:()=>z(()=>import("./statsWorker.46eac3dc.js"),["assets/statsWorker.46eac3dc.js","assets/quantizationUtils.0d428d19.js","assets/utils.8c53cad2.js","assets/generateRendererUtils.ebdde5b7.js"]),geometryEngineWorker:()=>z(()=>import("./geometryEngineWorker.c4184d57.js"),["assets/geometryEngineWorker.c4184d57.js","assets/geometryEngineJSON.f9e9a36f.js","assets/geometryEngineBase.82b25ca5.js","assets/json.879c9adc.js"]),CSVSourceWorker:()=>z(()=>import("./CSVSourceWorker.08ba4b81.js"),["assets/CSVSourceWorker.08ba4b81.js","assets/json.879c9adc.js","assets/FeatureStore.27890cc9.js","assets/PooledRBush.04520070.js","assets/centroid.cc817cc5.js","assets/projectionSupport.0542c13b.js","assets/QueryEngine.5a5ece4a.js","assets/QueryEngineResult.7611d68a.js","assets/quantizationUtils.0d428d19.js","assets/WhereClause.253310fe.js","assets/utils.8c53cad2.js","assets/generateRendererUtils.ebdde5b7.js","assets/utils.399e6089.js","assets/QueryEngineCapabilities.78217f95.js","assets/timeSupport.668a2439.js","assets/number.8c2c26f3.js","assets/clientSideDefaults.f5f7bfa0.js"]),EdgeProcessingWorker:()=>z(()=>import("./EdgeProcessingWorker.2beeabb2.js"),["assets/EdgeProcessingWorker.2beeabb2.js","assets/BufferView.89055914.js","assets/edgeProcessing.b309b825.js","assets/deduplicate.17ab7923.js","assets/InterleavedLayout.f9d79992.js","assets/types.44c7402c.js","assets/VertexAttribute.42396f25.js","assets/enums.2d9e6f64.js","assets/VertexElementDescriptor.1fdca6da.js"]),ElevationSamplerWorker:()=>z(()=>import("./ElevationSamplerWorker.4ebae562.js"),["assets/ElevationSamplerWorker.4ebae562.js","assets/PooledRBush.04520070.js","assets/georeference.c844666d.js","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/quat.b3994f2f.js","assets/quatf64.4ae3e6f1.js","assets/BufferView.89055914.js","assets/vec33.4564cd5b.js"]),FeatureServiceSnappingSourceWorker:()=>z(()=>import("./FeatureServiceSnappingSourceWorker.5ab08ebc.js"),["assets/FeatureServiceSnappingSourceWorker.5ab08ebc.js","assets/FeatureStore.27890cc9.js","assets/PooledRBush.04520070.js","assets/centroid.cc817cc5.js","assets/QueryEngine.5a5ece4a.js","assets/QueryEngineResult.7611d68a.js","assets/quantizationUtils.0d428d19.js","assets/WhereClause.253310fe.js","assets/utils.8c53cad2.js","assets/generateRendererUtils.ebdde5b7.js","assets/projectionSupport.0542c13b.js","assets/json.879c9adc.js","assets/utils.399e6089.js","assets/QueryEngineCapabilities.78217f95.js","assets/timeSupport.668a2439.js"]),GeoJSONSourceWorker:()=>z(()=>import("./GeoJSONSourceWorker.2e44a17b.js"),["assets/GeoJSONSourceWorker.2e44a17b.js","assets/FeatureStore.27890cc9.js","assets/PooledRBush.04520070.js","assets/centroid.cc817cc5.js","assets/projectionSupport.0542c13b.js","assets/json.879c9adc.js","assets/QueryEngine.5a5ece4a.js","assets/QueryEngineResult.7611d68a.js","assets/quantizationUtils.0d428d19.js","assets/WhereClause.253310fe.js","assets/utils.8c53cad2.js","assets/generateRendererUtils.ebdde5b7.js","assets/utils.399e6089.js","assets/QueryEngineCapabilities.78217f95.js","assets/timeSupport.668a2439.js","assets/geojson.8a0cb9d1.js","assets/clientSideDefaults.f5f7bfa0.js","assets/sourceUtils.61cd5549.js"]),LercWorker:()=>z(()=>import("./LercWorker.7426541e.js"),[]),MemorySourceWorker:()=>z(()=>import("./MemorySourceWorker.0c33bcc2.js"),["assets/MemorySourceWorker.0c33bcc2.js","assets/objectIdUtils.83ac3f67.js","assets/FeatureStore.27890cc9.js","assets/PooledRBush.04520070.js","assets/centroid.cc817cc5.js","assets/projectionSupport.0542c13b.js","assets/json.879c9adc.js","assets/QueryEngine.5a5ece4a.js","assets/QueryEngineResult.7611d68a.js","assets/quantizationUtils.0d428d19.js","assets/WhereClause.253310fe.js","assets/utils.8c53cad2.js","assets/generateRendererUtils.ebdde5b7.js","assets/utils.399e6089.js","assets/QueryEngineCapabilities.78217f95.js","assets/timeSupport.668a2439.js","assets/clientSideDefaults.f5f7bfa0.js","assets/sourceUtils.61cd5549.js"]),PBFDecoderWorker:()=>z(()=>import("./PBFDecoderWorker.4eacb33a.js"),[]),Pipeline:()=>z(()=>import("./Pipeline.4cffa97b.js"),["assets/Pipeline.4cffa97b.js","assets/QueryEngine.5a5ece4a.js","assets/QueryEngineResult.7611d68a.js","assets/quantizationUtils.0d428d19.js","assets/WhereClause.253310fe.js","assets/utils.8c53cad2.js","assets/generateRendererUtils.ebdde5b7.js","assets/projectionSupport.0542c13b.js","assets/json.879c9adc.js","assets/utils.399e6089.js","assets/QueryEngineCapabilities.78217f95.js","assets/timeSupport.668a2439.js","assets/FeatureStore2D.eebd57c6.js","assets/CircularArray.a4d7e1c2.js","assets/ComputedAttributeStorage.c1cb22b3.js","assets/centroid.cc817cc5.js","assets/enums.0295eb81.js","assets/visualVariablesUtils.32e27706.js","assets/Utils.7f6f3a6b.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/visualVariablesUtils.aff73e6d.js","assets/ogcFeatureUtils.ed8217a8.js","assets/geojson.8a0cb9d1.js","assets/clientSideDefaults.f5f7bfa0.js","assets/createConnection.60903ce1.js"]),PointCloudWorker:()=>z(()=>import("./PointCloudWorker.b6328283.js"),["assets/PointCloudWorker.b6328283.js","assets/quat.b3994f2f.js","assets/mat3f64.6d32a1d7.js","assets/quatf64.4ae3e6f1.js","assets/I3SBinaryReader.9c0bbe1b.js","assets/VertexAttribute.42396f25.js","assets/vec3f32.1121a836.js","assets/PointCloudUniqueValueRenderer.345f2613.js"]),RasterWorker:()=>z(()=>import("./RasterWorker.612f6623.js"),["assets/RasterWorker.612f6623.js","assets/pixelUtils.82950e1a.js","assets/RasterSymbolizer.4ee6ff2c.js","assets/colorUtils.bb6424b7.js","assets/utils.9731fda2.js","assets/rasterProjectionHelper.0a540f3d.js","assets/dataUtils.0f9b810f.js"]),SceneLayerSnappingSourceWorker:()=>z(()=>import("./SceneLayerSnappingSourceWorker.15d0e4f8.js"),["assets/SceneLayerSnappingSourceWorker.15d0e4f8.js","assets/Util.ea9235b8.js","assets/sphere.ec1f4496.js","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/quatf64.4ae3e6f1.js","assets/QueryEngineResult.7611d68a.js","assets/quantizationUtils.0d428d19.js","assets/WhereClause.253310fe.js","assets/utils.8c53cad2.js","assets/generateRendererUtils.ebdde5b7.js","assets/projectionSupport.0542c13b.js","assets/json.879c9adc.js","assets/utils.399e6089.js","assets/plane.86573aee.js","assets/edgeProcessing.b309b825.js","assets/deduplicate.17ab7923.js","assets/InterleavedLayout.f9d79992.js","assets/BufferView.89055914.js","assets/types.44c7402c.js","assets/VertexAttribute.42396f25.js","assets/enums.2d9e6f64.js","assets/VertexElementDescriptor.1fdca6da.js"]),SceneLayerWorker:()=>z(()=>import("./SceneLayerWorker.5a8acc10.js"),["assets/SceneLayerWorker.5a8acc10.js","assets/sphere.ec1f4496.js","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/quatf64.4ae3e6f1.js"]),WFSSourceWorker:()=>z(()=>import("./WFSSourceWorker.bb34a8ad.js"),["assets/WFSSourceWorker.bb34a8ad.js","assets/FeatureStore.27890cc9.js","assets/PooledRBush.04520070.js","assets/centroid.cc817cc5.js","assets/projectionSupport.0542c13b.js","assets/json.879c9adc.js","assets/QueryEngine.5a5ece4a.js","assets/QueryEngineResult.7611d68a.js","assets/quantizationUtils.0d428d19.js","assets/WhereClause.253310fe.js","assets/utils.8c53cad2.js","assets/generateRendererUtils.ebdde5b7.js","assets/utils.399e6089.js","assets/QueryEngineCapabilities.78217f95.js","assets/timeSupport.668a2439.js","assets/geojson.8a0cb9d1.js","assets/sourceUtils.61cd5549.js","assets/wfsUtils.f8061e44.js","assets/xmlUtils.56e603f6.js"]),WorkerTileHandler:()=>z(()=>import("./WorkerTileHandler.8091b1a1.js"),["assets/WorkerTileHandler.8091b1a1.js","assets/enums.54326430.js","assets/GeometryUtils.4f19e772.js","assets/Rect.95b0fd2e.js","assets/config.82550349.js","assets/StyleDefinition.d56936e4.js","assets/enums.0295eb81.js","assets/Geometry.d049a63c.js","assets/TileClipper.8c399a8a.js","assets/GeometryUtils.51c4032a.js","assets/StyleRepository.a1fecb1f.js","assets/enums.2d9e6f64.js","assets/VertexElementDescriptor.1fdca6da.js","assets/colorUtils.bb6424b7.js","assets/earcut.afc1d357.js","assets/BidiEngine.d8bba3fc.js"])},{CLOSE:zk,ABORT:Bk,INVOKE:Uk,RESPONSE:Fd,OPEN_PORT:qk,ON:vQ}=li,bQ=2;class _Q{constructor(t){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=t,this._timer=null,this._process=this._process.bind(this)}push(t){t.type===li.ABORT?this._cancelledJobIds.add(t.jobId):(this._invokeMessages.push(t),this._timer===null&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const t of this._invokeMessages)this._cancelledJobIds.has(t.jobId)||this._invoke(t);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class ss{constructor(t,i,s){this._port=t,this._getNextJob=s,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new _Q(r=>this._onInvokeMessage(r)),this._client=i.client,this._onMessage=this._onMessage.bind(this),this._channel=i.channel,this._schedule=i.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}static connect(t){const i=new MessageChannel;let s;s=typeof t=="function"?new t:"default"in t&&typeof t.default=="function"?new t.default:t;const r=new ss(i.port1,{channel:i,client:s},()=>null);return typeof s=="object"&&"remoteClient"in s&&(s.remoteClient=r),ss.clients.set(r,s),i.port2}static loadWorker(t){const i=gQ[t];return i?i():Promise.resolve(null)}close(){this._post({type:zk}),this._close()}isBusy(){return this._outJobs.size>0}invoke(t,i,s){const r=s&&s.signal,n=s&&s.transferList;if(!this._port)return Promise.reject(new L("worker:port-closed",`Cannot call invoke('${t}'), port is closed`,{methodName:t,data:i}));const o=AN();return new Promise((a,l)=>{if(jr(r))return this._processWork(),void l(_t());const u=Vr(r,()=>{const f=this._outJobs.get(o);f&&(this._outJobs.delete(o),this._processWork(),Bt(f.abortHandle),this._post({type:Bk,jobId:o}),l(_t()))}),d={resolve:a,reject:l,abortHandle:u,debugInfo:t};this._outJobs.set(o,d),this._post({type:Uk,jobId:o,methodName:t,abortable:r!=null},i,n)})}on(t,i){const s=new MessageChannel;function r(n){i(n.data)}return this._port.postMessage({type:li.ON,eventType:t,port:s.port2},[s.port2]),s.port1.addEventListener("message",r),s.port1.start(),{remove(){s.port1.postMessage({type:li.CLOSE}),s.port1.close(),s.port1.removeEventListener("message",r)}}}jobAdded(){this._processWork()}openPort(){const t=new MessageChannel;return this._post({type:qk,port:t.port2}),t.port1}_processWork(){if(this._outJobs.size>=bQ)return;const t=this._getNextJob();if(!t)return;const{methodName:i,data:s,invokeOptions:r,deferred:n}=t;this.invoke(i,s,r).then(o=>n.resolve(o)).catch(o=>n.reject(o))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach(t=>{Bt(t.abortHandle),t.reject(_t(`Worker closing, aborting job calling '${t.debugInfo}'`))}),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(t){M(this._schedule)?this._schedule(()=>this._processMessage(t)):this._processMessage(t)}_processMessage(t){const i=rm(t);if(i)switch(i.type){case Fd:this._onResponseMessage(i);break;case Uk:this._invokeQueue.push(i);break;case Bk:this._onAbortMessage(i);break;case zk:this._onCloseMessage();break;case qk:this._onOpenPortMessage(i);break;case vQ:this._onOnMessage(i)}}_onAbortMessage(t){const i=this._inJobs,s=t.jobId,r=i.get(s);this._invokeQueue.push(t),r&&(r.controller&&r.controller.abort(),i.delete(s))}_onCloseMessage(){const t=this._client;this._close(),t&&"destroy"in t&&ss.clients.get(this)===t&&t.destroy(),ss.clients.delete(this),t&&t.remoteClient&&(t.remoteClient=null)}_onInvokeMessage(t){const{methodName:i,jobId:s,data:r,abortable:n}=t,o=n?new AbortController:null,a=this._inJobs;let l,u=this._client,d=u[i];try{if(!d&&i&&i.includes(".")){const f=i.split(".");for(let m=0;m{a.has(s)&&(a.delete(s),this._post({type:Fd,jobId:s},f))},f=>{a.has(s)&&(a.delete(s),Ks(f)||this._post({type:Fd,jobId:s,error:sm(f||{message:`Error encountered at method ${i}`})}))})):this._post({type:Fd,jobId:s},l)}_onOpenPortMessage(t){new ss(t.port,{client:this._client},()=>null)}_onOnMessage(t){const{port:i}=t,s=this._client.on(t.eventType,n=>{i.postMessage(n)}),r=sb(t.port,"message",n=>{var o;((o=rm(n))==null?void 0:o.type)===li.CLOSE&&(r.remove(),s.remove(),i.close())})}_onResponseMessage(t){const{jobId:i,error:s,data:r}=t,n=this._outJobs;if(!n.has(i))return;const o=n.get(i);n.delete(i),this._processWork(),Bt(o.abortHandle),s?o.reject(L.fromJSON(JSON.parse(s))):o.resolve(r)}_post(t,i,s){return uT(this._port,t,i,s)}}ss.kernelInfo={revision:$R,version:TR,buildDate:MR},ss.clients=new Map;class wQ{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new xv}destroy(){this.close()}get closed(){return!this._clients||!this._clients.length}open(t,i){return new Promise((s,r)=>{let n=!0;const o=a=>{Ft(i.signal),n&&(n=!1,a())};this._clients.length=t.length,this._clientPromises.length=t.length,this._inUseClients.length=t.length;for(let a=0;a(this._clients[a]=new ss(u,i,()=>{var d;return(d=this._ongoingJobsQueue.pop())!=null?d:null}),o(s),this._clients[a]),()=>(o(r),null)):(this._clients[a]=new ss(l,i,()=>{var u;return(u=this._ongoingJobsQueue.pop())!=null?u:null}),this._clientPromises[a]=Promise.resolve(this._clients[a]),o(s))}})}broadcast(t,i,s){const r=new Array(this._clientPromises.length);for(let n=0;na==null?void 0:a.invoke(t,i,s))}return r}close(){let t;for(;t=this._ongoingJobsQueue.pop();)t.deferred.reject(_t(`Worker closing, aborting job calling '${t.methodName}'`));for(const i of this._clientPromises)i.then(s=>s==null?void 0:s.close());this._clients.length=0,this._clientPromises.length=0}invoke(t,i,s){let r;Array.isArray(s)?(q.getLogger("esri.core.workers.Connection").warn("invoke()","The transferList parameter is deprecated, use the options object instead"),r={transferList:s}):r=s;const n=Ao();this._ongoingJobsQueue.push({methodName:t,data:i,invokeOptions:r,deferred:n});for(let o=0;ol==null?void 0:l.jobAdded())}return n.promise}on(t,i){return Promise.all(this._clientPromises).then(()=>Kv(this._clients.map(s=>s.on(t,i))))}openPorts(){return new Promise(t=>{const i=new Array(this._clientPromises.length);let s=i.length;for(let r=0;r{n&&(i[r]=n.openPort()),--s==0&&t(i)})})}get test(){return{numClients:this._clients.length}}}const Gk={};function xQ(e,t){for(const i of e)if(i.name===t.name)return;e.push(t)}function SQ(e){var i;const t={async:e.async,isDebug:e.isDebug,locale:e.locale,baseUrl:e.baseUrl,has:{...e.has},map:{...e.map},packages:e.packages&&e.packages.concat()||[],paths:{...e.paths}};return e.hasOwnProperty("async")||(t.async=!0),e.hasOwnProperty("isDebug")||(t.isDebug=!1),e.baseUrl||(t.baseUrl=Gk.baseUrl),(i=Gk.packages)==null||i.forEach(s=>{var r;xQ((r=t.packages)!=null?r:[],s)}),t}class MQ{constructor(){const t=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach(i=>{this[i]=(...s)=>t[i](...s)})}}class zg{constructor(){this._dispatcher=new MQ,this._workerPostMessage({type:li.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(t){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=t,t&&this.addEventListener("message",t)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(t){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=t,t&&this.addEventListener("messageerror",t)}get onerror(){return this._onerrorHandler}set onerror(t){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=t,t&&this.addEventListener("error",t)}postMessage(t){U0(()=>{this._workerMessageHandler(new MessageEvent("message",{data:t}))})}dispatchEvent(t){return this._dispatcher.dispatchEvent(t)}addEventListener(t,i,s){this._dispatcher.addEventListener(t,i,s)}removeEventListener(t,i,s){this._dispatcher.removeEventListener(t,i,s)}_workerPostMessage(t){U0(()=>{this.dispatchEvent(new MessageEvent("message",{data:t}))})}async _workerMessageHandler(t){const i=rm(t);if(i&&i.type===li.OPEN){const{modulePath:s,jobId:r}=i;let n=await ss.loadWorker(s);n||(n=await z(()=>import(s),[]));const o=ss.connect(n);this._workerPostMessage({type:li.OPENED,jobId:r,data:o})}}}const bS=q.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:$Q}=li,TQ='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,i)=>{if(t){if(t.aborted)return i(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,version:r}=configuration.kernelInfo,{revision:t,version:n}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS API for JavaScript modules and assets. For more information visit https://bit.ly/3QnsuSo.\\nModules version: ${r}\\nAssets version: ${n}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let n;function t(e){const o=n.connect(e);self.postMessage({type:2,jobId:r,data:o},[o])}"function"==typeof define&&define.amd?require([workerPath],(e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((e=>(n=e.default,checkWorkerRevision(n),n.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),n=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(n),n.loadWorker(o.modulePath).then(t));break;case 3:if(outgoing.has(r)){const i=outgoing.get(r);outgoing.delete(r),o.error?i.reject(JSON.parse(o.error)):i.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});';let My,$y;const Wk="Failed to create Worker. Fallback to execute module in main thread";async function IQ(){if(!V("esri-workers")||(V("mozilla"),0))return Hk(new zg);if(!My&&!$y)try{const t=TQ.split('"{CONFIGURATION}"').join(`'${EQ()}'`);My=URL.createObjectURL(new Blob([t],{type:"text/javascript"}))}catch(t){$y=t||{}}let e;if(My)try{e=new Worker(My,{name:"esri-worker-"+kQ++})}catch{bS.warn(Wk,$y),e=new zg}else bS.warn(Wk,$y),e=new zg;return Hk(e)}async function Hk(e){return new Promise(t=>{function i(r){const n=rm(r);n&&n.type===$Q&&(e.removeEventListener("message",i),e.removeEventListener("error",s),t(e))}function s(r){r.preventDefault(),e.removeEventListener("message",i),e.removeEventListener("error",s),bS.warn("Failed to create Worker. Fallback to execute module in main thread",r),(e=new zg).addEventListener("message",i),e.addEventListener("error",s)}e.addEventListener("message",i),e.addEventListener("error",s)})}function EQ(){let e;if(je.default!=null){const r={...je};delete r.default,e=JSON.parse(JSON.stringify(r))}else e=JSON.parse(JSON.stringify(je));e.assetsPath=Js(e.assetsPath),e.defaultAssetsPath=e.defaultAssetsPath?Js(e.defaultAssetsPath):void 0,e.request.interceptors=[],e.log.interceptors=[],e.locale=Rr(),e.has={"esri-csp-restrictions":V("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":V("esri-2d-update-debug"),"featurelayer-pbf":V("featurelayer-pbf"),"featurelayer-simplify-thresholds":V("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":V("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":V("featurelayer-simplify-mobile-factor"),"esri-atomics":V("esri-atomics"),"esri-shared-array-buffer":V("esri-shared-array-buffer"),"esri-tiles-debug":V("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":V("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":V("feature-polyline-generalization-factor"),"host-webworker":1,"polylabel-placement-enabled":V("polylabel-placement-enabled")},e.workers.loaderUrl&&(e.workers.loaderUrl=Js(e.workers.loaderUrl)),e.workers.workerPath?e.workers.workerPath=Js(e.workers.workerPath):e.workers.workerPath=Js(Ne("esri/core/workers/RemoteClient.js")),e.workers.useDynamicImport=!1;const t=je.workers.loaderConfig,i=SQ({baseUrl:t==null?void 0:t.baseUrl,locale:Rr(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...t==null?void 0:t.has},map:{...t==null?void 0:t.map},paths:{...t==null?void 0:t.paths},packages:(t==null?void 0:t.packages)||[]}),s={version:TR,buildDate:MR,revision:$R};return JSON.stringify({esriConfig:e,loaderConfig:i,kernelInfo:s})}let kQ=0;const{ABORT:Yk,INVOKE:CQ,OPEN:PQ,OPENED:AQ,RESPONSE:Dd}=li;class hT{constructor(t,i){this._outJobs=new Map,this._inJobs=new Map,this.worker=t,this.id=i,t.addEventListener("message",this._onMessage.bind(this)),t.addEventListener("error",s=>{s.preventDefault(),q.getLogger("esri.core.workers.WorkerOwner").error(s)})}static async create(t){const i=await IQ();return new hT(i,t)}terminate(){this.worker.terminate()}async open(t,i={}){const{signal:s}=i,r=AN();return new Promise((n,o)=>{const a={resolve:n,reject:o,abortHandle:JM(s,()=>{this._outJobs.delete(r),this._post({type:Yk,jobId:r})})};this._outJobs.set(r,a),this._post({type:PQ,jobId:r,modulePath:t})})}_onMessage(t){const i=rm(t);if(i)switch(i.type){case AQ:this._onOpenedMessage(i);break;case Dd:this._onResponseMessage(i);break;case Yk:this._onAbortMessage(i);break;case CQ:this._onInvokeMessage(i)}}_onAbortMessage(t){const i=this._inJobs,s=t.jobId,r=i.get(s);r&&(r.controller&&r.controller.abort(),i.delete(s))}_onInvokeMessage(t){const{methodName:i,jobId:s,data:r,abortable:n}=t,o=n?new AbortController:null,a=this._inJobs,l=Jz[i];let u;try{if(typeof l!="function")throw new TypeError(`${i} is not a function`);u=l.call(null,r,{signal:o?o.signal:null})}catch(d){return void this._post({type:Dd,jobId:s,error:sm(d)})}No(u)?(a.set(s,{controller:o,promise:u}),u.then(d=>{a.has(s)&&(a.delete(s),this._post({type:Dd,jobId:s},d))},d=>{a.has(s)&&(a.delete(s),d||(d={message:"Error encountered at method"+i}),Ks(d)||this._post({type:Dd,jobId:s,error:sm(d||{message:`Error encountered at method ${i}`})}))})):this._post({type:Dd,jobId:s},u)}_onOpenedMessage(t){const{jobId:i,data:s}=t,r=this._outJobs.get(i);r&&(this._outJobs.delete(i),Bt(r.abortHandle),r.resolve(s))}_onResponseMessage(t){const{jobId:i,error:s,data:r}=t,n=this._outJobs.get(i);n&&(this._outJobs.delete(i),Bt(n.abortHandle),s?n.reject(L.fromJSON(JSON.parse(s))):n.resolve(r))}_post(t,i,s){return uT(this.worker,t,i,s)}}let Oc=V("esri-workers-debug")?1:V("esri-mobile")?Math.min(navigator.hardwareConcurrency-1,3):V("host-browser")?navigator.hardwareConcurrency-1:0;Oc||(Oc=V("safari")&&V("mac")||V("trident")?7:2);let Jk=0;const Bg=[];function OQ(){ON()}async function Ty(e,t){const i=new wQ;return await i.open(e,t),i}async function RQ(e,t={}){if(typeof e!="string")throw new L("workers:undefined-module","modulePath is missing");let i=t.strategy||"distributed";if(V("host-webworker")&&!V("esri-workers")&&(i="local"),i==="local"){let s=await ss.loadWorker(e);s||(s=await z(()=>import(e),[])),Ft(t.signal);const r=t.client||s;return Ty([ss.connect(s)],{...t,client:r})}if(await ON(),Ft(t.signal),i==="dedicated"){const s=Jk++%Oc;return Ty([await Bg[s].open(e,t)],t)}if(t.maxNumWorkers&&t.maxNumWorkers>0){const s=Math.min(t.maxNumWorkers,Oc);if(ss.open(e,t)),t)}let Iy=null;async function ON(){if(Iy)return Iy;new AbortController;const e=[];for(let t=0;t(Bg[t]=s,s));e.push(i)}return Iy=Promise.all(e),Iy}var _S;let on=_S=class extends W{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new _S({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};c([h({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],on.prototype,"cols",void 0),c([h({type:Ge,json:{write:!0}})],on.prototype,"level",void 0),c([h({type:String,json:{write:!0}})],on.prototype,"levelValue",void 0),c([h({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],on.prototype,"origin",void 0),c([h({type:Number,json:{write:!0}})],on.prototype,"resolution",void 0),c([h({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],on.prototype,"rows",void 0),c([h({type:Number,json:{write:!0}})],on.prototype,"scale",void 0),on=_S=c([S("esri.layers.support.LOD")],on);const dT=on;class LQ{constructor(t,i,s,r,n){this.id=t,this.level=i,this.row=s,this.col=r,this.extent=n}}var ya;const Xk=new Ie({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let Ht=ya=class extends W{constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.minScale=0,this.maxScale=0,this.size=null,this.spatialReference=null}static create(e={}){const{resolutionFactor:t=1,scales:i,size:s=256,spatialReference:r=xe.WebMercator,numLODs:n=24}=e;if(!ci(r)){const f=[];if(i)for(let m=0;m=0;y--)f.unshift({level:y,scale:m,resolution:m}),m*=2}return new ya({dpi:96,lods:f,origin:new be(0,0,r),size:[s,s],spatialReference:r})}const o=Dr(r),a=e.origin?new be({x:e.origin.x,y:e.origin.y,spatialReference:r}):new be(o?{x:o.origin[0],y:o.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),l=96,u=1/(Pm(r)*39.37*l),d=[];if(i)for(let f=0;f{s.push(n.scale),t=n.scale>t?n.scale:t,i=n.scale=t.length-1)return t[t.length-1];const i=Math.floor(e),s=i+1;return t[i]/(t[i]/t[s])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let s=0;for(;se&&n=t?this.zoomToScale(Math.ceil(i)):this.zoomToScale(Math.floor(i))}tileAt(e,t,i,s){const r=this.lodAt(e);if(!r)return null;let n,o;if(typeof t=="number")n=t,o=i;else if(Kt(t.spatialReference,this.spatialReference))n=t.x,o=t.y,s=i;else{const u=bb(t,this.spatialReference);if(N(u))return null;n=u.x,o=u.y,s=i}const a=r.resolution*this.size[0],l=r.resolution*this.size[1];return s||(s=new LQ(null,0,0,0,nl())),s.level=e,s.row=Math.floor((this.origin.y-o)/l+.001),s.col=Math.floor((n-this.origin.x)/a+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=ya.ExtrapolateOptions.NONE){let i=this.lodAt(e.level);if(!i&&t===ya.ExtrapolateOptions.POWER_OF_TWO){const o=this.lods[this.lods.length-1];o.levelArray.isArray(e)?e:typeof e=="number"?[e,e]:[256,256]})],Ht.prototype,"size",void 0),c([Q("size",["rows","cols"])],Ht.prototype,"readSize",null),c([ie("size",{cols:{type:Ge},rows:{type:Ge}})],Ht.prototype,"writeSize",null),c([h({type:xe,json:{write:!0}})],Ht.prototype,"spatialReference",void 0),Ht=ya=c([S("esri.layers.support.TileInfo")],Ht),function(e){var t;(t=e.ExtrapolateOptions||(e.ExtrapolateOptions={}))[t.NONE=0]="NONE",t[t.POWER_OF_TWO=1]="POWER_OF_TWO"}(Ht||(Ht={}));const FQ=Ht,Ug={widthBreakpoint:{getValue(e){const t=e.viewSize[0],i=e.breakpoints,s=this.values;return t<=i.xsmall?s.xsmall:t<=i.small?s.small:t<=i.medium?s.medium:t<=i.large?s.large:s.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue(e){const t=e.viewSize[1],i=e.breakpoints,s=this.values;return t<=i.xsmall?s.xsmall:t<=i.small?s.small:t<=i.medium?s.medium:t<=i.large?s.large:s.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue(e){const t=e.viewSize,i=t[0],s=t[1],r=this.values;return s>=i?r.portrait:r.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},Y_={xsmall:544,small:768,medium:992,large:1200};function DQ(e){const t=e;return t&&t.xsmall{let t=class extends e{constructor(...i){super(...i),this._breakpointsHandles=new qi,this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=Y_}initialize(){this._breakpointsHandles.add(Z(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),Le))}destroy(){this.destroyed||(this._removeActiveClassNames(),this._breakpointsHandles=$t(this._breakpointsHandles))}set breakpoints(i){if(i===this._get("breakpoints"))return;const s=DQ(i);if(!s){const r=JSON.stringify(Y_,null,2);console.warn("provided breakpoints are not valid, using defaults:"+r)}i=s?i:Y_,this._set("breakpoints",{...i})}_updateClassNames(){if(!this.container)return;const i=Vi.acquire(),s=Vi.acquire();let r,n=!1;for(r in Ug){const o=this[r],a=Ug[r].getValue({viewSize:this.size,breakpoints:this.breakpoints});o!==a&&(n=!0,this[r]=a,J_(r,o).forEach(l=>s.push(l)),J_(r,a).forEach(l=>i.push(l)))}n&&(this._applyClassNameChanges(i,s),Vi.release(i),Vi.release(s))}_applyClassNameChanges(i,s){const r=this.container;r&&(s.forEach(n=>r.classList.remove(n)),i.forEach(n=>r.classList.add(n)))}_removeActiveClassNames(){const i=this.container;if(!i)return;let s;for(s in Ug)J_(s,this[s]).forEach(r=>i.classList.remove(r))}};return c([h()],t.prototype,"breakpoints",null),c([h()],t.prototype,"orientation",void 0),c([h()],t.prototype,"widthBreakpoint",void 0),c([h()],t.prototype,"heightBreakpoint",void 0),t=c([S("esri.views.BreakpointsOwner")],t),t};let ga=class extends oe{constructor(){super(...arguments),this.items=new he,this._watchUpdatingTracking=new kh,this._callbacks=new Map,this._projector=D1(),this._hiddenProjector=D1()}get needsRender(){return this.items.length>0}get updating(){var e,t;return(t=(e=this._watchUpdatingTracking)==null?void 0:e.updating)!=null?t:!1}initialize(){const e=document.createElement("div");e.className="esri-overlay-surface",this._set("surface",e),this._hiddenSurface=document.createElement("div"),this._hiddenSurface.setAttribute("style","visibility: hidden;"),e.appendChild(this._hiddenSurface),this._watchUpdatingTracking.addOnCollectionChange(()=>this.items,t=>{for(const i of t.added){const s=()=>i.render();this._callbacks.set(i,s),this._projector.append(this.surface,s)}for(const i of t.removed){const s=this._projector.detach(this._callbacks.get(i));this.surface.removeChild(s.domNode),this._callbacks.delete(i)}})}addItem(e){this.items.add(e)}removeItem(e){this.items.remove(e)}destroy(){this.items.removeAll(),this._callbacks.forEach(e=>this._projector.detach(e)),this._callbacks=null,this._projector=null,this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(e){const t=this._hiddenSurface,i=this._hiddenProjector;let s=null;const r=()=>(s=e.render(),s);i.append(t,r),i.renderNow();const n={left:0,top:0,right:0,bottom:0};if(s&&s.domNode){const o=s.domNode.getBoundingClientRect();n.left=o.left,n.top=o.top,n.right=o.right,n.bottom=o.bottom}for(i.detach(r);t.firstChild;)t.removeChild(t.firstChild);return n}overlaps(e,t){const i=this.computeBoundingRect(e),s=this.computeBoundingRect(t);return Math.max(i.left,s.left)<=Math.min(i.right,s.right)&&Math.max(i.top,s.top)<=Math.min(i.bottom,s.bottom)}get hasVisibleItems(){return this.items.some(e=>e.visible)}async prepare(){await document.fonts.load(this._fontString()).catch(()=>{})}renderCanvas(e){if(!this.items.some(i=>i.visible))return;const t=e.getContext("2d");t.save(),t.font=this._fontString(),this.items.forEach(i=>{t.save(),i.renderCanvas(t),t.restore()}),t.restore()}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};c([h({readOnly:!0})],ga.prototype,"surface",void 0),c([h({readOnly:!0})],ga.prototype,"items",void 0),c([h({readOnly:!0})],ga.prototype,"needsRender",null),c([h({readOnly:!0})],ga.prototype,"_watchUpdatingTracking",void 0),c([h({readOnly:!0})],ga.prototype,"updating",null),ga=c([S("esri.views.overlay.ViewOverlay")],ga);const Zk=ga;function Ch(e,t,i,s){let r=null,n=1e3;typeof t=="number"?(n=t,s=i):(r=t!=null?t:null,n=i);let o,a=0;const l=()=>{a=0,e.apply(s,o)},u=(...d)=>{r&&r.apply(s,d),o=d,n?a||(a=setTimeout(l,n)):l()};return u.remove=()=>{a&&(clearTimeout(a),a=0)},u.forceUpdate=()=>{a&&(clearTimeout(a),l())},u.hasPendingUpdates=()=>!!a,u}function RN(e){return 32+e.length}function LN(e){return 16}function i_e(e){if(!e)return 0;let t=DN;for(const i in e)if(e.hasOwnProperty(i)){const s=e[i];switch(typeof s){case"string":t+=RN(s);break;case"number":t+=LN();break;case"boolean":t+=4}}return t}function jQ(e){if(!e)return 0;if(Array.isArray(e))return VQ(e);let t=DN;for(const i in e)e.hasOwnProperty(i)&&(t+=FN(e[i]));return t}function VQ(e){const t=e.length;if(t===0||typeof e[0]=="number")return 32+8*t;let i=NN;for(let s=0;sn.name===i);return r?UQ({tagName:s,tags:r.tags}):null}function UQ(e){const{tagName:t,tags:i}=e;if(!i||!t)return null;const s=i.find(r=>r.name===t);return s&&s.value||null}var wS;const qQ={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let Yi=wS=class extends W{constructor(e){super(e),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:e}=this,t=BQ({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:e});return qQ[t]||null}clone(){return new wS({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};c([h({type:String})],Yi.prototype,"contentType",void 0),c([h()],Yi.prototype,"exifInfo",void 0),c([h({readOnly:!0})],Yi.prototype,"orientationInfo",null),c([h({type:Ge})],Yi.prototype,"id",void 0),c([h({type:String})],Yi.prototype,"globalId",void 0),c([h({type:String})],Yi.prototype,"keywords",void 0),c([h({type:String})],Yi.prototype,"name",void 0),c([h({json:{read:!1}})],Yi.prototype,"parentGlobalId",void 0),c([h({json:{read:!1}})],Yi.prototype,"parentObjectId",void 0),c([h({type:Ge})],Yi.prototype,"size",void 0),c([h({json:{read:!1}})],Yi.prototype,"url",void 0),Yi=wS=c([S("esri.layers.support.AttachmentInfo")],Yi);const GQ=Yi;var xS;let ri=xS=class extends W{constructor(e){super(e),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10}clone(){return new xS(R({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};c([h({type:[String],json:{write:!0}})],ri.prototype,"attachmentTypes",void 0),c([h({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],ri.prototype,"attachmentsWhere",void 0),c([h({type:Boolean,json:{write:!0}})],ri.prototype,"cacheHint",void 0),c([h({type:[String],json:{write:!0}})],ri.prototype,"keywords",void 0),c([h({type:[Number],json:{write:!0}})],ri.prototype,"globalIds",void 0),c([h({json:{write:!0}})],ri.prototype,"name",void 0),c([h({type:Number,json:{read:{source:"resultRecordCount"}}})],ri.prototype,"num",void 0),c([h({type:[Number],json:{write:!0}})],ri.prototype,"objectIds",void 0),c([h({type:Boolean,json:{default:!1,write:!0}})],ri.prototype,"returnMetadata",void 0),c([h({type:[Number],json:{write:!0}})],ri.prototype,"size",void 0),c([h({type:Number,json:{read:{source:"resultOffset"}}})],ri.prototype,"start",void 0),c([ie("start"),ie("num")],ri.prototype,"writeStart",null),c([h({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],ri.prototype,"where",void 0),ri=xS=c([S("esri.rest.support.AttachmentQuery")],ri),ri.from=Dt(ri);const SS=ri,WQ="esri.widgets.Feature.support.featureUtils",Kk=q.getLogger(WQ),HQ=/href=(""|'')/gi,YQ=/(\{([^\{\r\n]+)\})/g,JQ=/\'/g,jN=/^\s*expression\//i,XQ=/(\n)/gi,ZQ=/[\u00A0-\u9999<>\&]/gim,QQ=/href\s*=\s*(?:\"([^\"]+)\"|\'([^\']+)\')/gi,KQ=/^(?:mailto:|tel:)/,VN="relationships/",MS=HM("short-date-short-time");function zN(e){if(!N(e))return e.get("sourceLayer")||e.get("layer")}async function Mv(e,t){return typeof e=="function"?e.call(null,t):e}function BN(e=""){if(e)return!KQ.test(e.trim().toLowerCase())}function pT(e){return!!e&&jN.test(e)}function eK(e,t){if(!pT(t)||!e)return null;const i=t.replace(jN,"").toLowerCase();let s;return e.some(r=>r.name.toLowerCase()===i&&(s=r,!0)),s}function UN(e,t){const i=eK(t,e==null?void 0:e.fieldName);return i?i.title||null:e?e.label||e.fieldName:null}function tK(e,t){const i=t.get(e.toLowerCase());return`{${i&&i.fieldName||e}}`}function iK(e){return e.replace(HQ,"")}function nm(e,t){const i=fT(t,e);return i?i.name:e}function sK(e,t){return e&&e.map(i=>nm(i,t))}function fT(e,t){return e&&typeof e.getField=="function"?e.getField(t):null}function qN(e){return`${e}`.trim()}function Rc({attributes:e,globalAttributes:t,layer:i,text:s,expressionAttributes:r,fieldInfoMap:n}){return s?$S({formattedAttributes:t,template:aK(s,{...t,...r,...e},i),fieldInfoMap:n}):""}function $S({formattedAttributes:e,template:t,fieldInfoMap:i}){return qN(iK(In(In(t,s=>tK(s,i)),e)))}function rK(e,t,i=!1){const s=t[e];if(typeof s=="string"){const r="%27",n=(i?encodeURIComponent(s):s).replace(JQ,r);t[e]=n}}function nK(e,t=!1){const i={...e};return Object.keys(i).forEach(s=>rK(s,i,t)),i}function oK(e,t,i){const s=(t=qN(t))&&t[0]!=="{";return In(e,nK(i,s))}function TS(e,t){return e.replace(YQ,(i,s,r)=>{const n=fT(t,r);return n?`{${n.name}}`:s})}function aK(e,t,i){const s=TS(e,i);return s&&s.replace(QQ,(r,n,o)=>oK(r,n||o,t))}function lK(e,t){if(typeof e=="string"&&t&&t.dateFormat==null&&(t.places!=null||t.digitSeparator!=null)){const i=Number(e);if(!isNaN(i))return i}return e}function cK(e){return(e==null?void 0:e.type)==="feature"}function eC(e){return!!(e!=null&&e.layer)}function uK(e){return(e==null?void 0:e.type)==="map-image"}function hK(e,t){var u;const i=t.fieldInfos,s=t.fieldName,r=(u=GN(i,s))==null?void 0:u.clone(),n=t.preventPlacesFormatting,o=t.layer,a=fT(o,s);if(r&&(a==null?void 0:a.type)==="date"){const d=r.format||new fh;d.dateFormat=d.dateFormat||"short-date-short-time",d.dateTimeFormatOptions=!eC(o)&&cK(o)&&o.datesInUnknownTimezone||eC(o)&&uK(o.layer)&&o.layer.datesInUnknownTimezone?{timeZone:"UTC"}:null,r.format=d}const l=r&&r.format;return typeof e=="string"&&jD(s)&&l?l.formatRasterPixelValue(e):typeof(e=lK(e,l))=="string"||e==null||l==null?Um(e):n?sl(e,{...nR(l),minimumFractionDigits:0,maximumFractionDigits:20}):l.format(e)}function GN(e,t){if(!e||!e.length||!t)return;const i=t.toLowerCase();let s;return e.some(r=>!(!r.fieldName||r.fieldName.toLowerCase()!==i)&&(s=r,!0)),s}function dK({fieldName:e,graphic:t,layer:i}){if(xo(e)||!i||typeof i.getFeatureType!="function")return null;const{typeIdField:s}=i;if(!s||e!==s)return null;const r=i.getFeatureType(t);return r?r.name:null}function pK({fieldName:e,value:t,graphic:i,layer:s}){if(xo(e)||!s||typeof s.getFieldDomain!="function")return null;const r=s.getFieldDomain(e,{feature:i});return r&&r.type==="coded-value"?r.getName(t):null}function fK(e,t){const{creatorField:i,creationDateField:s,editorField:r,editDateField:n}=e;if(!t)return;const o=t[n];if(typeof o=="number"){const l=t[r];return{type:"edit",date:Po(o,MS),user:l}}const a=t[s];if(typeof a=="number"){const l=t[i];return{type:"create",date:Po(a,MS),user:l}}return null}function mK(e,t){const i=new Map;return e&&e.forEach(s=>{const r=nm(s.fieldName,t);s.fieldName=r,i.set(r.toLowerCase(),s)}),i}function tC(e){const t=[];if(!e)return t;const{fieldInfos:i,content:s}=e;return i&&t.push(...i),s&&Array.isArray(s)&&s.forEach(r=>{if(r.type==="fields"){const n=r&&r.fieldInfos;n&&t.push(...n)}}),t}function mT(e){return e.replace(ZQ,t=>`&#${t.charCodeAt(0)};`)}function Um(e){return typeof e=="string"?e.replace(XQ,'
'):e}function WN(e){const{value:t,fieldName:i,fieldInfos:s,fieldInfoMap:r,layer:n,graphic:o}=e;if(t==null)return"";const a=pK({fieldName:i,value:t,graphic:o,layer:n});if(a)return a;const l=dK({fieldName:i,graphic:o,layer:n});if(l)return l;if(r.get(i.toLowerCase()))return hK(t,{fieldInfos:s||Array.from(r.values()),fieldName:i,layer:n});const u=n&&n.fieldsIndex;return u&&u.isDateField(i)?Po(t,MS):Um(t)}function X_({fieldInfos:e,attributes:t,layer:i,graphic:s,fieldInfoMap:r,relatedInfos:n}){const o={};return n==null||n.forEach(a=>_K({attributes:o,relatedInfo:a,fieldInfoMap:r,fieldInfos:e,layer:i})),Object.keys(t).forEach(a=>{const l=t[a];o[a]=WN({fieldName:a,fieldInfos:e,fieldInfoMap:r,layer:i,value:l,graphic:s})}),o}async function yK(e,t){var d,f;const{layer:i,graphic:s,outFields:r,objectIds:n,returnGeometry:o,spatialReference:a}=e,l=n[0];if(typeof l!="number"&&typeof l!="string"){const m="Could not query required fields for the specified feature. The feature's ID is invalid.",y={layer:i,graphic:s,objectId:l,requiredFields:r};return Kk.warn(m,y),null}if(!((f=(d=i.capabilities)==null?void 0:d.operations)!=null&&f.supportsQuery)){const m="The specified layer cannot be queried. The following fields will not be available.",y={layer:i,graphic:s,requiredFields:r,returnGeometry:o};return Kk.warn(m,y),null}const u=i.createQuery();return u.objectIds=n,u.outFields=r!=null&&r.length?r:[i.objectIdField],u.returnGeometry=!!o,u.returnZ=!!o,u.returnM=!!o,u.outSpatialReference=a,(await i.queryFeatures(u,t)).features[0]}async function gK(e){var s;if(!((s=e.expressionInfos)!=null&&s.length))return!1;const t=await Do(),{arcadeUtils:{hasGeometryFunctions:i}}=t;return i(e)}async function vK({graphic:e,popupTemplate:t,layer:i,spatialReference:s},r){if(!i||!t||(typeof i.load=="function"&&await i.load(r),!e.attributes))return;const n=e.attributes[i.objectIdField];if(n==null)return;const o=[n],a=await t.getRequiredFields(i.fieldsIndex),l=JX(a,e),u=l?[]:a,d=t.returnGeometry||await gK(t);if(l&&!d)return;const f=await yK({layer:i,graphic:e,outFields:u,objectIds:o,returnGeometry:d,spatialReference:s},r);f&&(f.geometry&&(e.geometry=f.geometry),f.attributes&&(e.attributes={...e.attributes,...f.attributes}))}function xo(e=""){return!!e&&e.includes(VN)}function bK(e){return e?`${VN}${e.layerId}/${e.fieldName}`:""}function iC({attributes:e,graphic:t,relatedInfo:i,fieldInfos:s,fieldInfoMap:r,layer:n}){e&&t&&i&&Object.keys(t.attributes).forEach(o=>{const a=bK({layerId:i.relation.id.toString(),fieldName:o}),l=t.attributes[o];e[a]=WN({fieldName:a,fieldInfos:s,fieldInfoMap:r,layer:n,value:l,graphic:t})})}function _K({attributes:e,relatedInfo:t,fieldInfoMap:i,fieldInfos:s,layer:r}){e&&t&&(t.relatedFeatures&&t.relatedFeatures&&t.relatedFeatures.forEach(n=>iC({attributes:e,graphic:n,relatedInfo:t,fieldInfoMap:i,fieldInfos:s,layer:r})),t.relatedStatsFeatures&&t.relatedStatsFeatures&&t.relatedStatsFeatures.forEach(n=>iC({attributes:e,graphic:n,relatedInfo:t,fieldInfoMap:i,fieldInfos:s,layer:r})))}const sC=e=>{if(!e)return!1;const t=e.toUpperCase();return t.includes("CURRENT_TIMESTAMP")||t.includes("CURRENT_DATE")||t.includes("CURRENT_TIME")},HN=({layer:e,method:t,query:i,definitionExpression:s})=>{var o,a;if(!((a=(o=e.capabilities)==null?void 0:o.query)!=null&&a.supportsCacheHint)||t==="attachments")return;const r=M(i.where)&&i.where,n=M(i.geometry)&&i.geometry;sC(s)||sC(r)||(n==null?void 0:n.type)==="extent"||i.resultType==="tile"||(i.cacheHint=!0)},wK=({query:e,layer:t,method:i})=>{HN({layer:t,method:i,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression}`})},xK=({queryPayload:e,layer:t,method:i})=>{HN({layer:t,method:i,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression}`})};function SK(e,t,i){return e&&t&&i?rC(e.allLayers,t,i)||rC(e.allTables,t,i):null}function rC(e,t,i){return e.find(s=>s!==t&&s.type==="feature"&&s.url===t.url&&s.layerId===i.relatedTableId)}const nC={editing:!1,operations:{add:!0,update:!0,delete:!0}},YN=he.ofType(GQ);let Ji=class extends oe{constructor(e){super(e),this._getAttachmentsPromise=null,this._attachmentLayer=null,this.abilities={...nC},this.activeAttachmentInfo=null,this.activeFileInfo=null,this.attachmentInfos=new YN,this.fileInfos=new he,this.graphic=null,this.mode="view",this.filesEnabled=!1,this.addHandles(Z(()=>this.graphic,()=>this._graphicChanged(),Le))}destroy(){this._attachmentLayer=null,this.graphic=null}castAbilities(e){return{...nC,...e}}get state(){return this._getAttachmentsPromise?"loading":this.graphic?"ready":"disabled"}get supportsResizeAttachments(){const{graphic:e}=this;if(!e)return!1;const t=e.layer||e.sourceLayer;return(t==null?void 0:t.loaded)&&"capabilities"in t&&"operations"in t.capabilities&&"supportsResizeAttachments"in t.capabilities.operations&&t.capabilities.operations.supportsResizeAttachments||!1}async getAttachments(){const{_attachmentLayer:e,attachmentInfos:t}=this;if(!e||typeof e.queryAttachments!="function")throw new L("invalid-layer","getAttachments(): A valid layer is required.");const i=this._getObjectId(),s=new SS({objectIds:[i],returnMetadata:!0}),r=[],n=e.queryAttachments(s).then(a=>a[i]||r).catch(()=>r);this._getAttachmentsPromise=n,this.notifyChange("state");const o=await n;return t.removeAll(),o.length&&t.addMany(o),this._getAttachmentsPromise=null,this.notifyChange("state"),o}async addAttachment(e,t=this.graphic){const{_attachmentLayer:i,attachmentInfos:s,abilities:r}=this;if(!t)throw new L("invalid-graphic","addAttachment(): A valid graphic is required.",{graphic:t});if(!e)throw new L("invalid-attachment","addAttachment(): An attachment is required.",{attachment:e});if(!r.operations.add)throw new L("invalid-abilities","addAttachment(): add abilities are required.");if(!i||typeof i.addAttachment!="function")throw new L("invalid-layer","addAttachment(): A valid layer is required.");const n=i.addAttachment(t,e).then(a=>this._queryAttachment(a.objectId,t)),o=await n;return s.add(o),o}async deleteAttachment(e){const{_attachmentLayer:t,attachmentInfos:i,graphic:s,abilities:r}=this;if(!e)throw new L("invalid-attachment-info","deleteAttachment(): An attachmentInfo is required.",{attachmentInfo:e});if(!r.operations.delete)throw new L("invalid-abilities","deleteAttachment(): delete abilities are required.");if(!t||typeof t.deleteAttachments!="function")throw new L("invalid-layer","deleteAttachment(): A valid layer is required.");const n=t.deleteAttachments(s,[e.id]).then(()=>e),o=await n;return i.remove(o),o}async updateAttachment(e,t=this.activeAttachmentInfo){const{_attachmentLayer:i,attachmentInfos:s,graphic:r,abilities:n}=this;if(!e)throw new L("invalid-attachment","updateAttachment(): An attachment is required.",{attachment:e});if(!t)throw new L("invalid-attachment-info","updateAttachment(): An attachmentInfo is required.",{attachmentInfo:t});if(!n.operations.update)throw new L("invalid-abilities","updateAttachment(): Update abilities are required.");const o=s.findIndex(u=>u===t);if(!i||typeof i.updateAttachment!="function")throw new L("invalid-layer","updateAttachment(): A valid layer is required.");const a=i.updateAttachment(r,t.id,e).then(u=>this._queryAttachment(u.objectId)),l=await a;return s.splice(o,1,l),l}async commitFiles(){return await Promise.all(this.fileInfos.items.map(e=>this.addAttachment(e.form))),this.fileInfos.removeAll(),this.getAttachments()}addFile(e,t){if(!e||!t)return null;const i={file:e,form:t};return this.fileInfos.add(i),i}updateFile(e,t,i=this.activeFileInfo){if(!e||!t||!i)return null;const s=this.fileInfos.findIndex(r=>i===r);return s>-1&&this.fileInfos.splice(s,1,{file:e,form:t}),this.fileInfos.items[s]}deleteFile(e){var i;const t=this.fileInfos.find(s=>s.file===e);return(i=this.fileInfos.remove(t))!=null?i:null}async _queryAttachment(e,t){if(!e)throw new L("invalid-attachment-id","Could not query attachment.");const{_attachmentLayer:i}=this,s=this._getObjectId(t),r=new SS({objectIds:[s],attachmentsWhere:`AttachmentId=${e}`,returnMetadata:!0});return i.queryAttachments(r).then(n=>n[s][0])}_getObjectId(e=this.graphic){var t;return(t=e==null?void 0:e.getObjectId())!=null?t:null}_graphicChanged(){this.graphic&&(this._setAttachmentLayer(),this.getAttachments().catch(()=>{}))}_setAttachmentLayer(){const{graphic:e}=this,t=zN(e);this._attachmentLayer=t?t.type==="scene"&&M(t.associatedLayer)?t.associatedLayer:t:null}};c([h()],Ji.prototype,"abilities",void 0),c([Oe("abilities")],Ji.prototype,"castAbilities",null),c([h()],Ji.prototype,"activeAttachmentInfo",void 0),c([h()],Ji.prototype,"activeFileInfo",void 0),c([h({readOnly:!0,type:YN})],Ji.prototype,"attachmentInfos",void 0),c([h()],Ji.prototype,"fileInfos",void 0),c([h({type:Ci})],Ji.prototype,"graphic",void 0),c([h()],Ji.prototype,"mode",void 0),c([h({readOnly:!0})],Ji.prototype,"state",null),c([h()],Ji.prototype,"filesEnabled",void 0),c([h({readOnly:!0})],Ji.prototype,"supportsResizeAttachments",null),Ji=c([S("esri.widgets.Attachments.AttachmentsViewModel")],Ji);const yT=Ji;function oC(e){const t=e.toLowerCase();return t==="image/bmp"||t==="image/emf"||t==="image/exif"||t==="image/gif"||t==="image/x-icon"||t==="image/jpeg"||t==="image/png"||t==="image/tiff"||t==="image/x-wmf"}function MK(e){const t=Ne("esri/themes/base/images/files/");return e?e==="text/plain"?`${t}text-32.svg`:e==="application/pdf"?`${t}pdf-32.svg`:e==="text/csv"?`${t}csv-32.svg`:e==="application/gpx+xml"?`${t}gpx-32.svg`:e==="application/x-dwf"?`${t}cad-32.svg`:e==="application/postscript"||e==="application/json"||e==="text/xml"||e==="model/vrml"?`${t}code-32.svg`:e==="application/x-zip-compressed"||e==="application/x-7z-compressed"||e==="application/x-gzip"||e==="application/x-tar"||e==="application/x-gtar"||e==="application/x-bzip2"||e==="application/gzip"||e==="application/x-compress"||e==="application/x-apple-diskimage"||e==="application/x-rar-compressed"||e==="application/zip"?`${t}zip-32.svg`:e.includes("image/")?`${t}image-32.svg`:e.includes("audio/")?`${t}sound-32.svg`:e.includes("video/")?`${t}video-32.svg`:e.includes("msexcel")||e.includes("ms-excel")||e.includes("spreadsheetml")?`${t}excel-32.svg`:e.includes("msword")||e.includes("ms-word")||e.includes("wordprocessingml")?`${t}word-32.svg`:e.includes("powerpoint")||e.includes("presentationml")?`${t}report-32.svg`:`${t}generic-32.svg`:`${t}generic-32.svg`}const aC={addButton:!0,addSubmitButton:!0,cancelAddButton:!0,cancelUpdateButton:!0,deleteButton:!0,errorMessage:!0,progressBar:!0,updateButton:!0},ee={base:"esri-attachments",loaderContainer:"esri-attachments__loader-container",loader:"esri-attachments__loader",fadeIn:"esri-attachments--fade-in",container:"esri-attachments__container",containerList:"esri-attachments__container--list",containerPreview:"esri-attachments__container--preview",actions:"esri-attachments__actions",deleteButton:"esri-attachments__delete-button",addAttachmentButton:"esri-attachments__add-attachment-button",errorMessage:"esri-attachments__error-message",items:"esri-attachments__items",item:"esri-attachments__item",itemButton:"esri-attachments__item-button",itemMask:"esri-attachments__item-mask",itemMaskIcon:"esri-attachments__item-mask--icon",itemImage:"esri-attachments__image",itemImageResizable:"esri-attachments__image--resizable",itemLabel:"esri-attachments__label",itemFilename:"esri-attachments__filename",itemChevronIcon:"esri-attachments__item-chevron-icon",itemLink:"esri-attachments__item-link",itemLinkOverlay:"esri-attachments__item-link-overlay",itemLinkOverlayIcon:"esri-attachments__item-link-overlay-icon",itemEditIcon:"esri-attachments__item-edit-icon",itemAddIcon:"esri-attachments__item-add-icon",itemAddButton:"esri-attachments__item-add-button",formNode:"esri-attachments__form-node",fileFieldset:"esri-attachments__file-fieldset",fileLabel:"esri-attachments__file-label",fileName:"esri-attachments__file-name",fileInput:"esri-attachments__file-input",metadata:"esri-attachments__metadata",metadataFieldset:"esri-attachments__metadata-fieldset",progressBar:"esri-attachments__progress-bar",esriWidget:"esri-widget",esriButton:"esri-button",buttonDisabled:"esri-button--disabled",esriButtonSecondary:"esri-button--secondary",esriButtonTertiary:"esri-button--tertiary",esriButtonThird:"esri-button--third",esriButtonSmall:"esri-button--small",esriButtonHalf:"esri-button--half",empty:"esri-widget__content--empty",iconExternalLink:"esri-icon-link-external",iconEdit:"esri-icon-edit",iconRight:"esri-icon-right",iconLeft:"esri-icon-left",iconPlus:"esri-icon-plus"},Z_=window.CSS;let xi=class extends yi{constructor(e,t){super(e,t),this.displayType="auto",this.messages=null,this.messagesUnits=null,this.selectedFile=null,this.submitting=!1,this.viewModel=new yT,this.visibleElements={...aC},this._supportsImageOrientation=Z_&&Z_.supports&&Z_.supports("image-orientation","from-image"),this._addAttachmentForm=null,this._updateAttachmentForm=null}initialize(){this.addHandles([Is(()=>{var e;return(e=this.viewModel)==null?void 0:e.attachmentInfos},"change",()=>this.scheduleRender()),Is(()=>{var e;return(e=this.viewModel)==null?void 0:e.fileInfos},"change",()=>this.scheduleRender()),Z(()=>{var e;return(e=this.viewModel)==null?void 0:e.mode},()=>this._modeChanged(),Le)])}loadDependencies(){return Promise.all([z(()=>import("./calcite-icon.8f7a3cfc.js"),["assets/calcite-icon.8f7a3cfc.js","assets/icon.8e346cc3.js","assets/observers.11f150c2.js"])])}get abilities(){return this.viewModel.abilities}set abilities(e){this.viewModel.abilities=e}get effectiveDisplayType(){const{displayType:e}=this;return e&&e!=="auto"?e:this.viewModel.supportsResizeAttachments?"preview":"list"}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get label(){var e,t;return(t=(e=this.messages)==null?void 0:e.widgetLabel)!=null?t:""}set label(e){this._overrideIfSome("label",e)}castVisibleElements(e){return{...aC,...e}}addAttachment(){const{_addAttachmentForm:e,viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.addAttachment(e).then(i=>(this._set("submitting",!1),this._set("error",null),t.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new L("attachments:add-attachment",this.messages.addErrorMessage,i)),i})}deleteAttachment(e){const{viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.deleteAttachment(e).then(i=>(this._set("submitting",!1),this._set("error",null),t.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new L("attachments:delete-attachment",this.messages.deleteErrorMessage,i)),i})}updateAttachment(){const{viewModel:e}=this,{_updateAttachmentForm:t}=this;return this._set("submitting",!0),this._set("error",null),e.updateAttachment(t).then(i=>(this._set("submitting",!1),this._set("error",null),e.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new L("attachments:update-attachment",this.messages.updateErrorMessage,i)),i})}addFile(){const e=this.viewModel.addFile(this.selectedFile,this._addAttachmentForm);return this.viewModel.mode="view",e}updateFile(){const{viewModel:e}=this,t=e.updateFile(this.selectedFile,this._updateAttachmentForm,e.activeFileInfo);return e.mode="view",t}deleteFile(e){const t=this.viewModel.deleteFile(e||this.viewModel.activeFileInfo.file);return this.viewModel.mode="view",t}render(){const{submitting:e,viewModel:t}=this,{state:i}=t;return P("div",{class:this.classes(ee.base,ee.esriWidget)},e?this.renderProgressBar():null,i==="loading"?this.renderLoading():this.renderAttachments(),this.renderErrorMessage())}renderErrorMessage(){const{error:e,visibleElements:t}=this;return e&&t.errorMessage?P("div",{key:"error-message",class:ee.errorMessage},e.message):null}renderAttachments(){const{activeFileInfo:e,mode:t,activeAttachmentInfo:i}=this.viewModel;return t==="add"?this.renderAddForm():t==="edit"?this.renderDetailsForm(i||e):this.renderAttachmentContainer()}renderLoading(){return P("div",{class:ee.loaderContainer,key:"loader"},P("div",{class:ee.loader}))}renderProgressBar(){return this.visibleElements.progressBar?P("div",{class:ee.progressBar,key:"progress-bar"}):null}renderAddForm(){const{submitting:e,selectedFile:t}=this,i=e||!t,s=this.visibleElements.cancelAddButton?P("button",{type:"button",bind:this,disabled:e,onclick:this._cancelForm,class:this.classes(ee.esriButton,ee.esriButtonTertiary,ee.esriButtonSmall,ee.esriButtonHalf,e&&ee.buttonDisabled)},this.messages.cancel):null,r=this.visibleElements.addSubmitButton?P("button",{type:"submit",disabled:i,class:this.classes(ee.esriButton,ee.esriButtonSecondary,ee.esriButtonSmall,ee.esriButtonHalf,{[ee.buttonDisabled]:i})},this.messages.add):null,n=t?P("span",{key:"file-name",class:ee.fileName},t.name):null,o=P("form",{bind:this,afterCreate:Z0,afterRemoved:SE,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},P("fieldset",{class:ee.fileFieldset},n,P("label",{class:this.classes(ee.fileLabel,ee.esriButton,ee.esriButtonSecondary)},t?this.messages.changeFile:this.messages.selectFile,P("input",{class:ee.fileInput,type:"file",name:"attachment",bind:this,onchange:this._handleFileInputChange}))),r,s);return P("div",{key:"add-form-container",class:ee.formNode},o)}renderDetailsForm(e){const{visibleElements:t,viewModel:i,selectedFile:s,submitting:r}=this,{abilities:n}=i,o=r||!s;let a,l,u,d;s?(a=s.type,l=s.name,u=s.size):"file"in e?(a=e.file.type,l=e.file.name,u=e.file.size):(a=e.contentType,l=e.name,u=e.size,d=e.url);const f=n.editing&&n.operations.delete&&t.deleteButton?P("button",{key:"delete-button",type:"button",disabled:r,bind:this,onclick:$=>this._submitDeleteAttachment($,e),class:this.classes(ee.esriButton,ee.esriButtonSmall,ee.esriButtonTertiary,ee.deleteButton,{[ee.buttonDisabled]:r})},this.messages.delete):void 0,m=n.editing&&n.operations.update&&t.updateButton?P("button",{disabled:o,key:"update-button",type:"submit",class:this.classes(ee.esriButton,ee.esriButtonSmall,ee.esriButtonThird,{[ee.buttonDisabled]:o})},this.messages.update):void 0,y=this.visibleElements.cancelUpdateButton?P("button",{disabled:r,key:"cancel-button",type:"button",bind:this,onclick:this._cancelForm,class:this.classes(ee.esriButton,ee.esriButtonSmall,ee.esriButtonTertiary,ee.esriButtonThird,{[ee.buttonDisabled]:r})},this.messages.cancel):void 0,g=n.editing&&n.operations.update?P("fieldset",{key:"file",class:ee.fileFieldset},P("span",{key:"file-name",class:ee.fileName},l),P("label",{class:this.classes(ee.fileLabel,ee.esriButton,ee.esriButtonSecondary)},this.messages.changeFile,P("input",{class:ee.fileInput,type:"file",name:"attachment",bind:this,onchange:this._handleFileInputChange}))):void 0,v=P("fieldset",{key:"size",class:ee.metadataFieldset},P("label",null,zQ(this.messagesUnits,u))),b=P("fieldset",{key:"content-type",class:ee.metadataFieldset},P("label",null,a)),_=M(d)?P("a",{class:ee.itemLink,href:d,rel:"noreferrer",target:"_blank"},this.renderImageMask(e,400),P("div",{class:ee.itemLinkOverlay},P("span",{class:ee.itemLinkOverlayIcon},P("calcite-icon",{icon:"launch"})))):this.renderImageMask(e,400),x=P("form",{bind:this,afterCreate:Z0,afterRemoved:SE,"data-node-ref":"_updateAttachmentForm",onsubmit:$=>this._submitUpdateAttachment($,e)},P("div",{class:ee.metadata},v,b),g,P("div",{class:ee.actions},f,y,m));return P("div",{key:"edit-form-container",class:ee.formNode},_,x)}renderImageMask(e,t){return"file"in e?this.renderGenericImageMask(e.file.name,e.file.type):this.renderImageMaskForAttachment(e,t)}renderGenericImageMask(e,t){const{supportsResizeAttachments:i}=this.viewModel,s=MK(t),r={[ee.itemImageResizable]:i};return P("div",{class:this.classes(ee.itemMaskIcon,ee.itemMask)},P("img",{title:e,alt:e,src:s,class:this.classes(r,ee.itemImage)}))}renderImageMaskForAttachment(e,t){const{supportsResizeAttachments:i}=this.viewModel,{contentType:s,name:r,url:n}=e;if(!i||!oC(s))return this.renderGenericImageMask(r,s);const o=this._getCSSTransform(e),a=o?{transform:o,"image-orientation":"none"}:{},l=`${n}${n.includes("?")?"&":"?"}w=${t}`,u={[ee.itemImageResizable]:i};return P("div",{class:this.classes(ee.itemMask)},P("img",{styles:a,alt:r,title:r,src:l,class:this.classes(u,ee.itemImage)}))}renderFile(e){const{file:t}=e;return P("li",{class:ee.item,key:t},P("button",{key:"details-button",bind:this,class:ee.itemButton,title:this.messages.attachmentDetails,"aria-label":this.messages.attachmentDetails,onclick:()=>this._startEditFile(e),type:"button"},this.renderImageMask(e),P("label",{class:ee.itemLabel},P("span",{class:ee.itemFilename},t.name||this.messages.noTitle),P("span",{"aria-hidden":"true",class:this.classes(ee.itemChevronIcon,xn(this.container)?ee.iconLeft:ee.iconRight)}))))}renderAttachmentInfo({attachmentInfo:e,displayType:t}){const{viewModel:i,effectiveDisplayType:s}=this,{abilities:r,supportsResizeAttachments:n}=i,{contentType:o,name:a,url:l}=e,u=this.renderImageMask(e,t==="list"?48:400),d=r.editing?P("span",{"aria-hidden":"true",class:this.classes(ee.itemChevronIcon,xn(this.container)?ee.iconLeft:ee.iconRight)}):null,f=[u,s==="preview"&&n&&oC(o)?null:P("label",{class:ee.itemLabel},P("span",{class:ee.itemFilename},a||this.messages.noTitle),d)],m=r.editing?P("button",{key:"details-button",bind:this,class:ee.itemButton,title:this.messages.attachmentDetails,"aria-label":this.messages.attachmentDetails,"data-attachment-info-id":e.id,onclick:()=>this._startEditAttachment(e),type:"button"},f):P("a",{key:"details-link",class:ee.itemButton,href:l,target:"_blank"},f);return P("li",{class:ee.item,key:e},m)}renderAttachmentContainer(){const{effectiveDisplayType:e,viewModel:t,visibleElements:i}=this,{attachmentInfos:s,abilities:r,fileInfos:n}=t,o=!!(s!=null&&s.length),a=!!(n!=null&&n.length),l={[ee.containerList]:e!=="preview",[ee.containerPreview]:e==="preview"},u=r.editing&&r.operations.add&&i.addButton?P("button",{bind:this,onclick:()=>this._startAddAttachment(),class:this.classes(ee.esriButton,ee.esriButtonTertiary,ee.addAttachmentButton),type:"button"},P("span",{"aria-hidden":"true",class:this.classes(ee.itemAddIcon,ee.iconPlus)}),this.messages.add):void 0,d=o?P("ul",{key:"attachments-list",class:ee.items},s.toArray().map(y=>this.renderAttachmentInfo({attachmentInfo:y,displayType:e}))):void 0,f=a?P("ul",{key:"file-list",class:ee.items},n.toArray().map(y=>this.renderFile(y))):void 0,m=a||o?void 0:P("div",{class:ee.empty},this.messages.noAttachments);return P("div",{key:"attachments-container",class:this.classes(ee.container,l)},d,f,m,u)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(e){const t=e.target,i=t&&t.files&&t.files.item(0);this._set("selectedFile",i)}_submitDeleteAttachment(e,t){e.preventDefault(),"file"in t?this.deleteFile(t.file):this.deleteAttachment(t)}_submitAddAttachment(e){e.preventDefault(),this.viewModel.filesEnabled?this.addFile():this.addAttachment()}_submitUpdateAttachment(e,t){e.preventDefault(),"file"in t?this.updateFile():this.updateAttachment()}_startEditAttachment(e){const{viewModel:t}=this;t.activeFileInfo=null,t.activeAttachmentInfo=e,t.mode="edit"}_startEditFile(e){const{viewModel:t}=this;t.activeAttachmentInfo=null,t.activeFileInfo=e,t.mode="edit"}_startAddAttachment(){this.viewModel.mode="add"}_cancelForm(e){e.preventDefault(),this.viewModel.mode="view"}_getCSSTransform(e){const{orientationInfo:t}=e;return!this._supportsImageOrientation&&t?[t.rotation?`rotate(${t.rotation}deg)`:"",t.mirrored?"scaleX(-1)":""].join(" "):""}};c([h()],xi.prototype,"abilities",null),c([h()],xi.prototype,"displayType",void 0),c([h({readOnly:!0})],xi.prototype,"effectiveDisplayType",null),c([h()],xi.prototype,"graphic",null),c([h()],xi.prototype,"label",null),c([h(),di("esri/widgets/Attachments/t9n/Attachments")],xi.prototype,"messages",void 0),c([h(),di("esri/core/t9n/Units")],xi.prototype,"messagesUnits",void 0),c([h({readOnly:!0})],xi.prototype,"selectedFile",void 0),c([h({readOnly:!0})],xi.prototype,"submitting",void 0),c([h({readOnly:!0})],xi.prototype,"error",void 0),c([h({type:yT})],xi.prototype,"viewModel",void 0),c([h()],xi.prototype,"visibleElements",void 0),c([Oe("visibleElements")],xi.prototype,"castVisibleElements",null),xi=c([S("esri.widgets.Attachments")],xi);const $K=xi;let Cp=class extends yT{constructor(e){super(e),this.description=null,this.title=null}};c([h()],Cp.prototype,"description",void 0),c([h()],Cp.prototype,"title",void 0),Cp=c([S("esri.widgets.Feature.FeatureAttachments.FeatureAttachmentsViewModel")],Cp);const gT=Cp,TK={heading:"esri-widget__heading"};function vT(e,t){const i=IK(e.level),s=`h${i}`;return delete e.level,P(s,{...e,class:aL(TK.heading,e.class),role:"heading","aria-level":String(i)},t)}function IK(e){return ls(Math.ceil(e),1,6)}const Q_={base:"esri-feature-element-info",title:"esri-feature-element-info__title",description:"esri-feature-element-info__description"};let zu=class extends yi{constructor(e,t){super(e,t),this.description=null,this.headingLevel=2,this.title=null}render(){return P("div",{class:Q_.base},this.renderTitle(),this.renderDescription())}renderTitle(){const{title:e}=this;return e?P(vT,{level:this.headingLevel,class:Q_.title},e):null}renderDescription(){const{description:e}=this;return e?P("div",{key:"description",class:Q_.description},e):null}};c([h()],zu.prototype,"description",void 0),c([h()],zu.prototype,"headingLevel",void 0),c([h()],zu.prototype,"title",void 0),zu=c([S("esri.widgets.Feature.support.FeatureElementInfo")],zu);const Bb=zu,EK={base:"esri-feature-attachments"};let an=class extends yi{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attachmentsWidget=new $K,this.headingLevel=2,this.viewModel=new gT}initialize(){this._featureElementInfo=new Bb,this.addHandles([Z(()=>{var e,t;return[(e=this.viewModel)==null?void 0:e.description,(t=this.viewModel)==null?void 0:t.title,this.headingLevel]},()=>this._setupFeatureElementInfo(),Le),Z(()=>{var e;return(e=this.viewModel)==null?void 0:e.graphic},e=>this.attachmentsWidget.graphic=e,Le)])}destroy(){this.attachmentsWidget.destroy(),this._featureElementInfo.destroy()}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get displayType(){return this.attachmentsWidget.displayType}set displayType(e){this.attachmentsWidget.displayType=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){var t;const{attachmentsWidget:e}=this;return P("div",{class:EK.base},(t=this._featureElementInfo)==null?void 0:t.render(),e==null?void 0:e.render())}_setupFeatureElementInfo(){const{description:e,title:t,headingLevel:i}=this;this._featureElementInfo.set({description:e,title:t,headingLevel:i})}};c([h({readOnly:!0})],an.prototype,"attachmentsWidget",void 0),c([h()],an.prototype,"description",null),c([h()],an.prototype,"displayType",null),c([h()],an.prototype,"graphic",null),c([h()],an.prototype,"headingLevel",void 0),c([h()],an.prototype,"title",null),c([h({type:gT})],an.prototype,"viewModel",void 0),an=c([S("esri.widgets.Feature.FeatureAttachments")],an);const kK=an;let va=class extends pu(oe){constructor(e){super(e),this._loadingPromise=null,this.created=null,this.creator=null,this.destroyer=null,this.graphic=null,this.handles.add(Z(()=>this.creator,t=>{this._destroyContent(),this._createContent(t)},Le))}destroy(){this._destroyContent()}get state(){return this._loadingPromise?"loading":"ready"}_destroyContent(){const{created:e,graphic:t,destroyer:i}=this;e&&(Mv(i,{graphic:t}).catch(()=>null),this._set("created",null))}async _createContent(e){const{graphic:t}=this,i=Mv(e,{graphic:t}).catch(()=>null);this._loadingPromise=i,this.notifyChange("state");const s=await i;i===this._loadingPromise&&(this._loadingPromise=null,this.notifyChange("state"),this._set("created",s))}};c([h({readOnly:!0})],va.prototype,"created",void 0),c([h()],va.prototype,"creator",void 0),c([h()],va.prototype,"destroyer",void 0),c([h({type:Ci})],va.prototype,"graphic",void 0),c([h({readOnly:!0})],va.prototype,"state",null),va=c([S("esri.widgets.Feature.FeatureContent.FeatureContentViewModel")],va);const $v=va;function CK(e){return t=>{t.hasOwnProperty("_delegatedEventNames")||(t._delegatedEventNames=t._delegatedEventNames?t._delegatedEventNames.slice():[]);const i=t._delegatedEventNames,s=Array.isArray(e)?e:PK(e);i.push(...s)}}function PK(e){return e.split(",").map(t=>t.trim())}const JN="calcite-theme-";function AK(){return getComputedStyle(document.body).getPropertyValue("--esri-calcite-theme-name").replace(/\s|'|"/g,"")}function Tv(){return AK().startsWith("dark")}function OK(){return`${JN}${Tv()?"dark":"light"}`}function RK(e){LK(e),e.classList.add(OK())}function LK(e){Array.from(e.classList).forEach(t=>{t.startsWith(JN)&&e.classList.remove(t)})}function XN(e){return e&&typeof e.render=="function"}function FK(e){return e&&typeof e.postMixInProperties=="function"&&typeof e.buildRendering=="function"&&typeof e.postCreate=="function"&&typeof e.startup=="function"}const K_={base:"esri-feature-content",loaderContainer:"esri-feature-content__loader-container",loader:"esri-feature-content__loader"};let Bu=class extends yi{constructor(e,t){super(e,t),this.viewModel=null,this._addTargetToAnchors=i=>{Array.from(i.querySelectorAll("a")).forEach(s=>{BN(s.href)&&!s.hasAttribute("target")&&s.setAttribute("target","_blank")})}}get creator(){return this.viewModel.creator}set creator(e){this.viewModel.creator=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}renderLoading(){return P("div",{class:K_.loaderContainer,key:"loader"},P("div",{class:K_.loader}))}renderCreated(){var t;const e=(t=this.viewModel)==null?void 0:t.created;return e?e instanceof HTMLElement?P("div",{key:e,bind:e,afterCreate:this._attachToNode}):XN(e)?P("div",{key:e},!e.destroyed&&e.render()):P("div",{key:e,innerHTML:e,afterCreate:this._addTargetToAnchors}):null}render(){var t;const e=(t=this.viewModel)==null?void 0:t.state;return P("div",{class:K_.base},e==="loading"?this.renderLoading():this.renderCreated())}_attachToNode(e){const t=this;e.appendChild(t)}};c([h()],Bu.prototype,"creator",null),c([h()],Bu.prototype,"graphic",null),c([h({type:$v})],Bu.prototype,"viewModel",void 0),Bu=c([S("esri.widgets.Feature.FeatureContent")],Bu);const qg=Bu;let eo=class extends oe{constructor(e){super(e),this.attributes=null,this.expressionInfos=null,this.description=null,this.fieldInfos=null,this.title=null}get formattedFieldInfos(){const{expressionInfos:e,fieldInfos:t}=this,i=[];return t==null||t.forEach(s=>{if(!(!s.hasOwnProperty("visible")||s.visible))return;const r=s.clone();r.label=UN(r,e),i.push(r)}),i}};c([h()],eo.prototype,"attributes",void 0),c([h({type:[YD]})],eo.prototype,"expressionInfos",void 0),c([h()],eo.prototype,"description",void 0),c([h({type:[Fm]})],eo.prototype,"fieldInfos",void 0),c([h({readOnly:!0})],eo.prototype,"formattedFieldInfos",null),c([h()],eo.prototype,"title",void 0),eo=c([S("esri.widgets.Feature.FeatureFields.FeatureFieldsViewModel")],eo);const Ub=eo,DK=[{pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,target:"_blank",label:"{messages.view}"},{pattern:/^\s*(tel:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(mailto:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"App Studio Player"},{pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Collector"},{pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Explorer"},{pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Navigator"},{pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Survey123"},{pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Trek2There"},{pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Workforce"},{pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"iForm"},{pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"FlowFinity"},{pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Laserfische"},{pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Microsoft Power Bi"}];function NK(e){let t=null;return DK.some(i=>(i.pattern.test(e)&&(t=i),!!t)),t}function jK(e,t){if(typeof t!="string"||!t)return t;const i=NK(t);if(!i)return t;const s=t.match(i.pattern),r=s&&s[2],n=In(In(i.label,{messages:e,hierPart:r}),{appName:i.appName}),o=i.target?` target="${i.target}"`:"",a=i.target==="_blank"?' rel="noreferrer"':"";return t.replace(i.pattern,`${n}`)}const Nd={base:"esri-feature-fields",fieldHeader:"esri-feature-fields__field-header",fieldData:"esri-feature-fields__field-data",fieldDataDate:"esri-feature-fields__field-data--date",esriTable:"esri-widget__table"};let yr=class extends yi{constructor(e,t){super(e,t),this._featureElementInfo=null,this.viewModel=new Ub,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new Bb,this.addHandles(Z(()=>{var e,t;return[(e=this.viewModel)==null?void 0:e.description,(t=this.viewModel)==null?void 0:t.title]},()=>this._setupFeatureElementInfo(),Le))}destroy(){this._featureElementInfo.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get expressionInfos(){return this.viewModel.expressionInfos}set expressionInfos(e){this.viewModel.expressionInfos=e}get fieldInfos(){return this.viewModel.fieldInfos}set fieldInfos(e){this.viewModel.fieldInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}renderFieldInfo(e,t){const{attributes:i}=this.viewModel,s=e.fieldName,r=e.label||s,n=i?i[s]==null?"":i[s]:"",o=!(!e.format||!e.format.dateFormat),a=typeof n=="number"&&!o?this._forceLTR(n):jK(this.messagesURIUtils,n),l={[Nd.fieldDataDate]:o};return P("tr",{key:`fields-element-info-row-${s}-${t}`},P("th",{key:`fields-element-info-row-header-${s}-${t}`,class:Nd.fieldHeader,innerHTML:r}),P("td",{key:`fields-element-info-row-data-${s}-${t}`,class:this.classes(Nd.fieldData,l),innerHTML:a}))}renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e!=null&&e.length?P("table",{class:Nd.esriTable,summary:this.messages.fieldsSummary},P("tbody",null,e.map((t,i)=>this.renderFieldInfo(t,i)))):null}render(){var e;return P("div",{class:Nd.base},(e=this._featureElementInfo)==null?void 0:e.render(),this.renderFields())}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo.set({description:e,title:t})}_forceLTR(e){return`‎${e}`}};c([h()],yr.prototype,"attributes",null),c([h()],yr.prototype,"description",null),c([h()],yr.prototype,"expressionInfos",null),c([h()],yr.prototype,"fieldInfos",null),c([h()],yr.prototype,"title",null),c([h({type:Ub,nonNullable:!0})],yr.prototype,"viewModel",void 0),c([h(),di("esri/widgets/Feature/t9n/Feature")],yr.prototype,"messages",void 0),c([h(),di("esri/widgets/support/t9n/uriUtils")],yr.prototype,"messagesURIUtils",void 0),yr=c([S("esri.widgets.Feature.FeatureFields")],yr);const ZN=yr,VK={maximumFractionDigits:20};function zK(e){return sl(e,VK)}var IS;let Yl=IS=class extends W{constructor(e){super(e),this.color=null,this.label=null,this.value=null}writeValue(e,t,i){t[i]=e!=null?e:0}clone(){return new IS({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};c([h({type:pe,json:{type:[Ge],write:!0}})],Yl.prototype,"color",void 0),c([h({type:String,json:{write:!0}})],Yl.prototype,"label",void 0),c([h({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],Yl.prototype,"value",void 0),c([ie("value")],Yl.prototype,"writeValue",null),Yl=IS=c([S("esri.renderers.visualVariables.support.ColorStop")],Yl);const BK=Yl,ew=-3;var Oa;(function(e){e[e.ALL=0]="ALL",e[e.SOME=1]="SOME"})(Oa||(Oa={}));class r_e{constructor(t,i,s){this._namespace=t,this._storage=i,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),this._namespace+=":",s&&(this._storage.registerRemoveFunc(this._namespace,s),this._removeFunc=!0)}destroy(){this._storage.clear(this._namespace),this._removeFunc&&this._storage.deregisterRemoveFunc(this._namespace),this._storage.deregister(this),this._storage=null}get namespace(){return this._namespace.slice(0,-1)}get hitRate(){return this._hit/(this._hit+this._miss)}get size(){return this._storage.size}get maxSize(){return this._storage.maxSize}resetHitRate(){this._hit=this._miss=0}put(t,i,s,r=0){this._storage.put(this._namespace+t,i,s,r)}get(t){const i=this._storage.get(this._namespace+t);return i===void 0?++this._miss:++this._hit,i}pop(t){const i=this._storage.pop(this._namespace+t);return i===void 0?++this._miss:++this._hit,i}updateSize(t,i,s){this._storage.updateSize(this._namespace+t,i,s)}clear(){this._storage.clear(this._namespace)}clearAll(){this._storage.clearAll()}getStats(){return this._storage.getStats()}resetStats(){this._storage.resetStats()}}class QN{constructor(t=10485760){this._maxSize=t,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new Vc,this._users=new Vc}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(t){this._users.push(t)}deregister(t){this._users.removeUnordered(t)}registerRemoveFunc(t,i){this._removeFuncs.push([t,i])}deregisterRemoveFunc(t){this._removeFuncs.filterInPlace(i=>i[0]!==t)}get size(){return this._size}get maxSize(){return this._maxSize}set maxSize(t){this._maxSize=Math.max(t,0),this._checkSizeLimit()}put(t,i,s,r){const n=this._db.get(t);if(n&&(this._size-=n.size,this._db.delete(t),n.entry!==i&&this._notifyRemove(t,n.entry,Oa.ALL)),s>this._maxSize)return void this._notifyRemove(t,i,Oa.ALL);if(i===void 0)return void console.warn("Refusing to cache undefined entry ");if(!s||s<0)return void console.warn("Refusing to cache entry with invalid size "+s);const o=1+Math.max(r,ew)-ew;this._db.set(t,{entry:i,size:s,lifetime:o,lives:o}),this._size+=s,this._checkSizeLimit()}updateSize(t,i,s){const r=this._db.get(t);if(r&&r.entry===i){for(this._size-=r.size;s>this._maxSize;){const n=this._notifyRemove(t,i,Oa.SOME);if(!(M(n)&&n>0))return void this._db.delete(t);s=n}r.size=s,this._size+=s,this._checkSizeLimit()}}pop(t){const i=this._db.get(t);if(i)return this._size-=i.size,this._db.delete(t),++this._hit,i.entry;++this._miss}get(t){const i=this._db.get(t);if(i!==void 0)return this._db.delete(t),i.lives=i.lifetime,this._db.set(t,i),++this._hit,i.entry;++this._miss}getStats(){const t={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},i={},s=new Array;this._db.forEach((o,a)=>{const l=o.lifetime;s[l]=(s[l]||0)+o.size,this._users.forAll(u=>{const d=u.namespace;if(a.startsWith(d)){const f=i[d]||0;i[d]=f+o.size}})});const r={};this._users.forAll(o=>{const a=o.namespace;if(!isNaN(o.hitRate)&&o.hitRate>0){const l=i[a]||0;i[a]=l,r[a]=Math.round(100*o.hitRate)+"%"}else r[a]="0%"});const n=Object.keys(i);n.sort((o,a)=>i[a]-i[o]),n.forEach(o=>t[o]=Math.round(i[o]/2**20)+"MB / "+r[o]);for(let o=s.length-1;o>=0;--o){const a=s[o];a&&(t["Priority "+(o+ew-1)]=Math.round(a/this.size*100)+"%")}return t}resetStats(){this._hit=this._miss=0,this._users.forAll(t=>t.resetHitRate())}clear(t){this._db.forEach((i,s)=>{s.startsWith(t)&&(this._size-=i.size,this._db.delete(s),this._notifyRemove(s,i.entry,Oa.ALL))})}clearAll(){this._db.forEach((t,i)=>this._notifyRemove(i,t.entry,Oa.ALL)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(t,i,s){let r;return this._removeFuncs.some(n=>{if(t.startsWith(n[0])){const o=n[1](i,s);return typeof o=="number"&&(r=o),!0}return!1}),r}_checkSizeLimit(){if(!(this._size<=this._maxSize))for(const[t,i]of this._db){if(this._db.delete(t),i.lives<=1){this._size-=i.size;const s=this._notifyRemove(t,i.entry,Oa.SOME);M(s)&&s>0&&(this._size+=s,i.lives=i.lifetime,i.size=s,this._db.set(t,i))}else--i.lives,this._db.set(t,i);if(this._size<=.9*this.maxSize)return}}}class UK{constructor(t,i){this._storage=new QN,this._storage.maxSize=t,i&&this._storage.registerRemoveFunc("",i)}put(t,i){this._storage.put(t,i,1,1)}pop(t){return this._storage.pop(t)}get(t){return this._storage.get(t)}clear(){this._storage.clearAll()}destroy(){this._storage.destroy()}}new UK(1e3);new pe([128,128,128]);const qK=new pe("white");function vu(e,t){if(!e)return null;let i=null;return Jh(e)?i=GK(e):Vb(e)&&(i=e.color?new pe(e.color):null),i?om(i,t):null}function GK(e){const t=e.symbolLayers;if(!t)return null;let i=null;return t.forEach(s=>{var r;s.type==="object"&&((r=s.resource)==null?void 0:r.href)!=null||(i=s.type==="water"?s.color:M(s.material)?s.material.color:null)}),i?new pe(i):null}function om(e,t){if(t==null||e==null)return e;const i=e.toRgba();return i[3]=i[3]*t,new pe(i)}function WK(e,t,i){const s=e.symbolLayers;if(!s)return;const r=n=>{var a;const o=M(n)?n:null;return om(t=(a=t!=null?t:o)!=null?a:i!=null?qK:null,i)};s.forEach(n=>{var o;if(n.type!=="object"||((o=n.resource)==null?void 0:o.href)==null||t)if(n.type==="water")n.color=r(n.color);else{const a=M(n.material)?n.material.color:null,l=r(a);N(n.material)?n.material=new Ts({color:l}):n.material.color=l,i!=null&&"outline"in n&&M(n.outline)&&M(n.outline.color)&&(n.outline.color=om(n.outline.color,i))}})}function HK(e,t,i){(t=t!=null?t:e.color)&&(e.color=om(t,i)),i!=null&&"outline"in e&&e.outline&&e.outline.color&&(e.outline.color=om(e.outline.color,i))}function tw(e,t,i){e&&(t||i!=null)&&(t&&(t=new pe(t)),Jh(e)?WK(e,t,i):Vb(e)&&HK(e,t,i))}async function YK(e,t){const i=e.symbolLayers;i&&await HY(i,async s=>JK(s,t))}async function JK(e,t){switch(e.type){case"extrude":ZK(e,t);break;case"icon":case"line":case"text":XK(e,t);break;case"path":KK(e,t);break;case"object":await QK(e,t)}}function XK(e,t){const i=KN(t);M(i)&&(e.size=i)}function KN(e){for(const t of e)if(typeof t=="number")return t;return null}function ZK(e,t){e.size=typeof t[2]=="number"?t[2]:0}async function QK(e,t){const{resourceSize:i,symbolSize:s}=await eee(e),r=e5(t,i,s);e.width=bf(t[0],s[0],i[0],r),e.depth=bf(t[1],s[1],i[1],r),e.height=bf(t[2],s[2],i[2],r)}function KK(e,t){const i=e5(t,GL,[e.width,void 0,e.height]);e.width=bf(t[0],e.width,1,i),e.height=bf(t[2],e.height,1,i)}function e5(e,t,i){for(let s=0;s<3;s++){const r=e[s];switch(r){case"symbol-value":{const n=i[s];return n!=null?n/t[s]:1}case"proportional":break;default:if(r&&t[s])return r/t[s]}}return 1}async function eee(e){const t=await z(()=>import("./symbolLayerUtils.072aa491.js"),[]),i=await t.computeObjectLayerResourceSize(e,10),{width:s,height:r,depth:n}=e,o=[s,n,r];let a=1;for(let l=0;l<3;l++){const u=o[l];if(u!=null){a=u/i[l];break}}for(let l=0;l<3;l++)o[l]==null&&(o[l]=i[l]*a);return{resourceSize:i,symbolSize:o}}function bf(e,t,i,s){switch(e){case"proportional":return i*s;case"symbol-value":return t!=null?t:i;default:return e}}function tee(e,t){const i=KN(t);if(!N(i))switch(e.type){case"simple-marker":e.size=i;break;case"picture-marker":{const s=e.width/e.height;s>1?(e.width=i,e.height=i*s):(e.width=i*s,e.height=i);break}case"simple-line":e.width=i;break;case"text":e.font.size=i}}async function iee(e,t){if(e&&t)return Jh(e)?YK(e,t):void(Vb(e)&&tee(e,t))}function see(e,t,i){if(e&&t!=null)if(Jh(e)){const s=e.symbolLayers;s&&s.forEach(r=>{if(r&&r.type==="object")switch(i){case"tilt":r.tilt=t;break;case"roll":r.roll=t;break;default:r.heading=t}})}else Vb(e)&&(e.type!=="simple-marker"&&e.type!=="picture-marker"&&e.type!=="text"||(e.angle=t))}const ree="<",nee=">",oee=HM("short-date");function aee(e,t,i,s){let r="";t===0?r=`${ree} `:t===i&&(r=`${nee} `);let n=null;return n=s?Po(e,oee):zK(e),r+n}const lee=new pe([64,64,64]);function cee(e,t){const i=[],s=e.length-1;return e.length===5?i.push(0,2,4):i.push(0,s),e.map((r,n)=>i.includes(n)?aee(r,n,s,t):null)}async function uee(e,t,i){let s=!1,r=[],n=[];if(e.stops){const u=e.stops;r=u.map(d=>d.value),s=u.some(d=>!!d.label),s&&(n=u.map(d=>d.label))}const o=r[0],a=r[r.length-1];if(o==null&&a==null)return null;const l=s?null:cee(r,i);return(await Promise.all(r.map(async(u,d)=>({value:u,color:e.type==="opacity"?await hee(u,e,t):(await z(()=>Promise.resolve().then(function(){return PT}),void 0)).getColor(e,u),label:s?n[d]:l[d]})))).reverse()}async function hee(e,t,i=lee){const s=new pe(i),r=(await z(()=>Promise.resolve().then(function(){return PT}),void 0)).getOpacity(t,e);return r!=null&&(s.a=r),s}var ES;let Pp=ES=class extends W{constructor(e){super(e),this.color=null,this.ratio=null}clone(){return new ES({color:this.color,ratio:this.ratio})}};c([h({type:pe,json:{type:[Ge],default:null,write:!0}})],Pp.prototype,"color",void 0),c([h({type:Number,json:{write:!0}})],Pp.prototype,"ratio",void 0),Pp=ES=c([S("esri.renderers.support.HeatmapColorStop")],Pp);const _f=Pp;function dee(e){if(!e.colorStops)return[];const t=[...e.colorStops].filter(s=>{var r;return((r=s.color)==null?void 0:r.a)>0});let i=t.length-1;if(t&&t[0]){const s=t[i];s&&s.ratio!==1&&(t.push(new _f({ratio:1,color:s.color})),i++)}return t.map((s,r)=>{var o,a;let n="";return r===0?n=((o=e.legendOptions)==null?void 0:o.minLabel)||"low":r===i&&(n=((a=e.legendOptions)==null?void 0:a.maxLabel)||"high"),{color:s.color,label:n,ratio:s.ratio}}).reverse()}q.getLogger("esri.renderers.support.utils");async function hs(e,t,i){A3(e,t,()=>[]).push(...i)}async function pee(e){var i,s,r,n;const t=new Map;if(!e)return t;if("visualVariables"in e&&e.visualVariables){const o=e.visualVariables.filter(a=>a.type==="color");for(const a of o){const l=(await uee(a)).map(u=>u.color);await hs(t,a.field||a.valueExpression,l)}}if(e.type==="heatmap"){const o=dee(e).map(a=>a.color);await hs(t,e.field||e.valueExpression,o)}else if(e.type==="pie-chart"){for(const o of e.attributes)await hs(t,o.field||o.valueExpression,[o.color]);await hs(t,"default",[(i=e==null?void 0:e.othersCategory)==null?void 0:i.color,vu(e.backgroundFillSymbol,null)])}else if(e.type==="dot-density"){for(const o of e.attributes)await hs(t,o.field||o.valueExpression,[o.color]);await hs(t,"default",[e.backgroundColor])}else if(e.type==="unique-value")if(((s=e.authoringInfo)==null?void 0:s.type)==="predominance")for(const o of(r=e.uniqueValueInfos)!=null?r:[])await hs(t,o.value.toString(),[vu(o.symbol,null)]);else{const o=((n=e.uniqueValueInfos)!=null?n:[]).map(f=>vu(f.symbol,null)),{field:a,field2:l,field3:u,valueExpression:d}=e;(a||d)&&await hs(t,a||d,o),l&&await hs(t,l,o),u&&await hs(t,u,o)}else if(e.type==="class-breaks"){const o=e.classBreakInfos.map(u=>vu(u.symbol,null)),{field:a,valueExpression:l}=e;await hs(t,a!=null?a:l,o)}else e.type==="simple"&&await hs(t,"default",[vu(e.symbol,null)]);return"defaultSymbol"in e&&e.defaultSymbol&&await hs(t,"default",[vu(e.defaultSymbol,null)]),t.forEach((o,a)=>{const l=G6(o.filter(Boolean),(u,d)=>JSON.stringify(u)===JSON.stringify(d));t.set(a,l)}),t}var kS;let Ap=kS=class extends W{constructor(e){super(e),this.name=null,this.code=null}clone(){return new kS({name:this.name,code:this.code})}};c([h({type:String,json:{write:!0}})],Ap.prototype,"name",void 0),c([h({type:[String,Number],json:{write:!0}})],Ap.prototype,"code",void 0),Ap=kS=c([S("esri.layers.support.CodedValue")],Ap);const fee=new Ie({inherited:"inherited",codedValue:"coded-value",range:"range"});let Op=class extends W{constructor(e){super(e),this.name=null,this.type=null}};c([h({type:String,json:{write:!0}})],Op.prototype,"name",void 0),c([ue(fee)],Op.prototype,"type",void 0),Op=c([S("esri.layers.support.Domain")],Op);const qb=Op;var CS;let Rp=CS=class extends qb{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const i=String(e);this.codedValues.some(s=>(String(s.code)===i&&(t=s.name),!!t))}return t}clone(){return new CS({codedValues:R(this.codedValues),name:this.name})}};c([h({type:[Ap],json:{write:!0}})],Rp.prototype,"codedValues",void 0),c([ue({codedValue:"coded-value"})],Rp.prototype,"type",void 0),Rp=CS=c([S("esri.layers.support.CodedValueDomain")],Rp);const t5=Rp;var PS;let Gg=PS=class extends qb{constructor(e){super(e),this.type="inherited"}clone(){return new PS}};c([ue({inherited:"inherited"})],Gg.prototype,"type",void 0),Gg=PS=c([S("esri.layers.support.InheritedDomain")],Gg);const i5=Gg;var AS;let Uu=AS=class extends qb{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new AS({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};c([h({type:Number,json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range&&t.range[1]},write:{enabled:!1,overridePolicy(){return{enabled:this.maxValue!=null&&this.minValue==null}},target:"range",writer(e,t,i){t[i]=[this.minValue||0,e]}}}})],Uu.prototype,"maxValue",void 0),c([h({type:Number,json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range&&t.range[0]},write:{target:"range",writer(e,t,i){t[i]=[e,this.maxValue||0]}}}})],Uu.prototype,"minValue",void 0),c([ue({range:"range"})],Uu.prototype,"type",void 0),Uu=AS=c([S("esri.layers.support.RangeDomain")],Uu);const s5=Uu,r5={key:"type",base:qb,typeMap:{range:s5,"coded-value":t5,inherited:i5}};function bT(e){if(!e||!e.type)return null;switch(e.type){case"range":return s5.fromJSON(e);case"codedValue":return t5.fromJSON(e);case"inherited":return i5.fromJSON(e)}return null}const mee=new Ie({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml"});var OS;const yee=new Ie({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let Si=OS=class extends W{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=-1,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){var s;let i=null;try{i=t?JSON.parse(t):null}catch{}return(s=i==null?void 0:i.value)!=null?s:null}readValueType(e,{description:t}){let i=null;try{i=t?JSON.parse(t):null}catch{}return i?yee.fromJSON(i.fieldValueType):null}clone(){return new OS({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain&&this.domain.clone()||null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};c([h({type:String,json:{write:!0}})],Si.prototype,"alias",void 0),c([h({type:[String,Number],json:{write:{allowNull:!0}}})],Si.prototype,"defaultValue",void 0),c([h()],Si.prototype,"description",void 0),c([Q("description")],Si.prototype,"readDescription",null),c([h({types:r5,json:{read:{reader:bT},write:!0}})],Si.prototype,"domain",void 0),c([h({type:Boolean,json:{write:!0}})],Si.prototype,"editable",void 0),c([h({type:Ge,json:{write:!0}})],Si.prototype,"length",void 0),c([h({type:String,json:{write:!0}})],Si.prototype,"name",void 0),c([h({type:Boolean,json:{write:!0}})],Si.prototype,"nullable",void 0),c([ue(mee)],Si.prototype,"type",void 0),c([h()],Si.prototype,"valueType",void 0),c([Q("valueType",["description"])],Si.prototype,"readValueType",null),c([h({type:Boolean,json:{read:!1}})],Si.prototype,"visible",void 0),Si=OS=c([S("esri.layers.support.Field")],Si);const _T=Si;var RS;let qu=RS=class extends W{constructor(e){super(e),this.type="map-layer"}clone(){const{mapLayerId:e,gdbVersion:t}=this;return new RS({mapLayerId:e,gdbVersion:t})}};c([ue({mapLayer:"map-layer"})],qu.prototype,"type",void 0),c([h({type:Ge,json:{write:!0}})],qu.prototype,"mapLayerId",void 0),c([h({type:String,json:{write:!0}})],qu.prototype,"gdbVersion",void 0),qu=RS=c([S("esri.layers.support.source.MapLayerSource")],qu);var LS;let to=LS=class extends W{constructor(e){super(e),this.type="query-table"}clone(){var o;const{workspaceId:e,query:t,oidFields:i,spatialReference:s,geometryType:r}=this,n={workspaceId:e,query:t,oidFields:i,spatialReference:(o=s==null?void 0:s.clone())!=null?o:void 0,geometryType:r};return new LS(n)}};c([ue({queryTable:"query-table"})],to.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],to.prototype,"workspaceId",void 0),c([h({type:String,json:{write:!0}})],to.prototype,"query",void 0),c([h({type:String,json:{write:!0}})],to.prototype,"oidFields",void 0),c([h({type:xe,json:{write:!0}})],to.prototype,"spatialReference",void 0),c([ue(EJ)],to.prototype,"geometryType",void 0),to=LS=c([S("esri.layers.support.source.QueryTableDataSource")],to);var FS;let Gu=FS=class extends W{constructor(e){super(e),this.type="raster"}clone(){const{workspaceId:e,dataSourceName:t}=this;return new FS({workspaceId:e,dataSourceName:t})}};c([ue({raster:"raster"})],Gu.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],Gu.prototype,"dataSourceName",void 0),c([h({type:String,json:{write:!0}})],Gu.prototype,"workspaceId",void 0),Gu=FS=c([S("esri.layers.support.source.RasterDataSource")],Gu);var DS;let Jl=DS=class extends W{constructor(e){super(e),this.type="table"}clone(){const{workspaceId:e,gdbVersion:t,dataSourceName:i}=this;return new DS({workspaceId:e,gdbVersion:t,dataSourceName:i})}};c([ue({table:"table"})],Jl.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],Jl.prototype,"workspaceId",void 0),c([h({type:String,json:{write:!0}})],Jl.prototype,"gdbVersion",void 0),c([h({type:String,json:{write:!0}})],Jl.prototype,"dataSourceName",void 0),Jl=DS=c([S("esri.layers.support.source.TableDataSource")],Jl);var NS,jS;const gee=mi()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let fs=NS=class extends W{constructor(e){super(e),this.type="join-table"}readLeftTableSource(e,t,i){return lC()(e,t,i)}castLeftTableSource(e){return En(VS(),e)}readRightTableSource(e,t,i){return lC()(e,t,i)}castRightTableSource(e){return En(VS(),e)}clone(){var o,a;const{leftTableKey:e,rightTableKey:t,leftTableSource:i,rightTableSource:s,joinType:r}=this,n={leftTableKey:e,rightTableKey:t,leftTableSource:(o=i==null?void 0:i.clone())!=null?o:void 0,rightTableSource:(a=s==null?void 0:s.clone())!=null?a:void 0,joinType:r};return new NS(n)}};c([ue({joinTable:"join-table"})],fs.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],fs.prototype,"leftTableKey",void 0),c([h({type:String,json:{write:!0}})],fs.prototype,"rightTableKey",void 0),c([h({json:{write:!0}})],fs.prototype,"leftTableSource",void 0),c([Q("leftTableSource")],fs.prototype,"readLeftTableSource",null),c([Oe("leftTableSource")],fs.prototype,"castLeftTableSource",null),c([h({json:{write:!0}})],fs.prototype,"rightTableSource",void 0),c([Q("rightTableSource")],fs.prototype,"readRightTableSource",null),c([Oe("rightTableSource")],fs.prototype,"castRightTableSource",null),c([ue(gee)],fs.prototype,"joinType",void 0),fs=NS=c([S("esri.layers.support.source.JoinTableDataSource")],fs);let iw=null;function lC(){return iw||(iw=dl({types:VS()})),iw}let sw=null;function VS(){return sw||(sw={key:"type",base:null,typeMap:{"data-layer":Er,"map-layer":qu}}),sw}const vee={key:"type",base:null,typeMap:{"join-table":fs,"query-table":to,raster:Gu,table:Jl}};let Er=jS=class extends W{constructor(e){super(e),this.type="data-layer"}clone(){const{fields:e,dataSource:t}=this;return new jS({fields:e,dataSource:t})}};c([ue({dataLayer:"data-layer"})],Er.prototype,"type",void 0),c([h({type:[_T],json:{write:!0}})],Er.prototype,"fields",void 0),c([h({types:vee,json:{write:!0}})],Er.prototype,"dataSource",void 0),Er=jS=c([S("esri.layers.support.source.DataLayerSource")],Er),Er.from=Dt(Er);function n_e(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function n5(e){return typeof e=="string"?Ai(e):R(e)}function bee(e,t,i){const s={};for(const r in e){if(r==="declaredClass")continue;const n=e[r];if(n!=null&&typeof n!="function")if(Array.isArray(n)){s[r]=[];for(let o=0;o{const f=ll(d);return f.spatialReference=n,f})}}function wee(e){return{geometryType:Sb(e[0]),geometries:e.map(t=>t.toJSON())}}function xee(e,t,i){const s=CJ(t);return e.map(r=>{const n=s.fromJSON(r);return n.spatialReference=i,n})}async function See(e,t,i){const s=typeof e=="string"?Ai(e):e,r=t[0].spatialReference,n=Sb(t[0]),o={...i,query:{...s.query,f:"json",sr:r.wkid?r.wkid:JSON.stringify(r),geometries:JSON.stringify(wee(t))}},{data:a}=await kt(s.path+"/simplify",o);return xee(a.geometries,n,r)}const a5=q.getLogger("esri.geometry.support.normalizeUtils");function Mee(e){return e.type==="polygon"}function $ee(e){return e[0].type==="polygon"}function Tee(e){return e[0].type==="polyline"}function Iee(e,t){if(!(e instanceof Ar||e instanceof Oo)){const r="straightLineDensify: the input geometry is neither polyline nor polygon";throw a5.error(r),new L(r)}const i=wf(e),s=[];for(const r of i){const n=[];s.push(n),n.push([r[0][0],r[0][1]]);for(let o=0;o1){for(let x=1;x<=g-1;x++){const $=x*t,I=y*$+a,T=m*$+l;n.push([I,T])}const v=(f+Math.floor(g-1)*t)/2,b=y*v+a,_=m*v+l;n.push([b,_])}n.push([u,d])}}return Mee(e)?new Oo({rings:s,spatialReference:e.spatialReference}):new Ar({paths:s,spatialReference:e.spatialReference})}function cC(e,t,i){if(t){const s=Iee(e,1e6);e=op(s,!0)}return i&&(e=o5(e,i)),e}function uC(e,t,i){if(Array.isArray(e)){const s=e[0];if(s>t){const r=Lc(s,t);e[0]=s+r*(-2*t)}else if(st){const r=Lc(s,t);e=e.clone().offset(r*(-2*t),0)}else if(s{if(u[0]<180)return!0;{let d=0;for(let m=0;md?y:d}d=Number(d.toFixed(9));const f=-360*Lc(d,180);for(let m=0;muC(A,a,l)),g.push(k)}else if(T.type==="extent"){const k=T.clone()._normalize(!1,!1,n);g.push(k.rings?new Oo(k):k)}else if(T.extent){const k=T.extent,A=Lc(k.xmin,l)*(2*a);let F=A===0?T.clone():o5(T.clone(),A);k.offset(A,0),k.intersects(d)&&k.xmax!==a?(m=k.xmax>m?k.xmax:m,F=cC(F,o),y.push(F),g.push("cut")):k.intersects(f)&&k.xmin!==l?(m=k.xmax*(2*a)>m?k.xmax*(2*a):m,F=cC(F,o,360),y.push(F),g.push("cut")):g.push(F)}else g.push(T.clone());else g.push(T);let v=Lc(m,a),b=-90;const _=v,x=new Ar;for(;v>0;){const T=360*v-180;x.addPath([[T,b],[T,-1*b]]),b*=-1,v--}if(y.length>0&&_>0){const T=Eee(y,await _ee(s,y,x,i)),k=[],A=[];for(let U=0;U1&&H.rings.length>=te.rings.length?(k.push(H),A.push("simplify")):A.push(o?Za(H):H)}}if(!k.length)return A;const F=await See(s,k,i),G=[];for(let U=0;Ur)for(;e>r;)e-=n}return e}function c5(e){const t={};for(const i in e){if(i==="declaredClass")continue;const s=e[i];if(s!=null&&typeof s!="function")if(Array.isArray(s)){t[i]=[];for(let r=0;r>3,this._dataType=7&i,!t||t===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const t=this._decodeVarint();return this._tag=t>>3,this._dataType=7&t,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let t=4294967295;return t=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128?t:(t=(t|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128?t:(t=(t|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128?t:(t=(t|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128?t:(t=(t|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128?t:void 0))))}getUInt64(){return this._decodeVarint()}getSInt32(){const t=this.getUInt32();if(t!==void 0)return t>>>1^-(1&t)|0}getSInt64(){return this._decodeSVarint()}getBool(){const t=this._data[this._pos]!==0;return this._skip(1),t}getEnum(){return this._decodeVarint()}getFixed64(){const t=this._dataView,i=this._pos,s=t.getUint32(i,!0)+t.getUint32(i+4,!0)*hC;return this._skip(8),s}getSFixed64(){const t=this._dataView,i=this._pos,s=t.getUint32(i,!0)+t.getInt32(i+4,!0)*hC;return this._skip(8),s}getDouble(){const t=this._dataView.getFloat64(this._pos,!0);return this._skip(8),t}getFixed32(){const t=this._dataView.getUint32(this._pos,!0);return this._skip(4),t}getSFixed32(){const t=this._dataView.getInt32(this._pos,!0);return this._skip(4),t}getFloat(){const t=this._dataView.getFloat32(this._pos,!0);return this._skip(4),t}getString(){const t=this._getLength(),i=this._pos,s=this._toString(this._data,i,i+t);return this._skip(t),s}getBytes(){const t=this._getLength(),i=this._pos,s=this._toBytes(this._data,i,i+t);return this._skip(t),s}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(t,i,s,r){const n=this.getMessage(),o=t(n,i,s,r);return n.release(),o}processMessage(t){const i=this.getMessage(),s=t(i);return i.release(),s}getMessage(){const t=this._getLength(),i=Gc.pool.acquire();return i._init(this._data,this._dataView,this._pos,this._pos+t),this._skip(t),i}release(){Gc.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case Ra.varint:this._decodeVarint();break;case Ra.fixed64:this._skip(8);break;case Ra.delimited:this._skip(this._getLength());break;case Ra.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(t){this._skip(t)}_skip(t){if(this._pos+t>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=t}_decodeVarint(){const t=this._data;let i=this._pos,s=0,r=0;if(this._end-i>=10)do{if(r=t[i++],s|=127&r,(128&r)==0||(r=t[i++],s|=(127&r)<<7,(128&r)==0)||(r=t[i++],s|=(127&r)<<14,(128&r)==0)||(r=t[i++],s|=(127&r)<<21,(128&r)==0)||(r=t[i++],s+=268435456*(127&r),(128&r)==0)||(r=t[i++],s+=34359738368*(127&r),(128&r)==0)||(r=t[i++],s+=4398046511104*(127&r),(128&r)==0)||(r=t[i++],s+=562949953421312*(127&r),(128&r)==0)||(r=t[i++],s+=72057594037927940*(127&r),(128&r)==0)||(r=t[i++],s+=9223372036854776e3*(127&r),(128&r)==0))break;throw new Error("Varint too long!")}while(0);else{let n=1;for(;i!==this._end&&(r=t[i],(128&r)!=0);)++i,s+=(127&r)*n,n*=128;if(i===this._end)throw new Error("Varint overrun!");++i,s+=r*n}return this._pos=i,s}_decodeSVarint(){const t=this._data;let i=this._pos,s=0,r=0;const n=1&t[i];if(this._end-i>=10)do{if(r=t[i++],s|=127&r,(128&r)==0||(r=t[i++],s|=(127&r)<<7,(128&r)==0)||(r=t[i++],s|=(127&r)<<14,(128&r)==0)||(r=t[i++],s|=(127&r)<<21,(128&r)==0)||(r=t[i++],s+=268435456*(127&r),(128&r)==0)||(r=t[i++],s+=34359738368*(127&r),(128&r)==0)||(r=t[i++],s+=4398046511104*(127&r),(128&r)==0)||(r=t[i++],s+=562949953421312*(127&r),(128&r)==0)||(r=t[i++],s+=72057594037927940*(127&r),(128&r)==0)||(r=t[i++],s+=9223372036854776e3*(127&r),(128&r)==0))break;throw new Error("Varint too long!")}while(0);else{let o=1;for(;i!==this._end&&(r=t[i],(128&r)!=0);)++i,s+=(127&r)*o,o*=128;if(i===this._end)throw new Error("Varint overrun!");++i,s+=r*o}return this._pos=i,n?-(s+1)/2:s/2}_getLength(){if(this._dataType!==Ra.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(t,i,s){if((s=Math.min(this._end,s))-i>Cee){const o=t.subarray(i,s);return kee.decode(o)}let r="",n="";for(let o=i;o{e._data=null,e._dataView=null});class zi{constructor(t=[],i=[],s=!1){this.lengths=t!=null?t:[],this.coords=i!=null?i:[],this.hasIndeterminateRingOrder=s}static fromRect(t){const[i,s,r,n]=t,o=r-i,a=n-s;return new zi([5],[i,s,o,0,0,a,-o,0,0,-a])}get isPoint(){return this.lengths.length===0}get maxLength(){return Math.max(...this.lengths)}get size(){return this.lengths.reduce((t,i)=>t+i)}forEachVertex(t){let i=0;this.lengths.length||t(this.coords[0],this.coords[1]);for(let s=0;si+s,0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(t,i){t.coords[this._coordinatePtr++]=i}addCoordinatePoint(t,i){t.coords.push(i)}addLength(t,i){t.lengths.push(i)}addQueryGeometry(t,i){t.queryGeometry=i.queryGeometry,t.queryGeometryType=i.queryGeometryType}createPointGeometry(){return new zi}}const dC=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML"],pC=["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"],fC=["upperLeft","lowerLeft"];function mC(e){return e>=dC.length?null:dC[e]}function Aee(e){return e>=pC.length?null:pC[e]}function yC(e){return e>=fC.length?null:fC[e]}function gC(e,t){return t>=e.geometryTypes.length?null:e.geometryTypes[t]}function Oee(e,t,i){const r=e.asUnsafe(),n=t.createPointGeometry(i);for(;r.next();)switch(r.tag()){case 3:{const o=r.getUInt32(),a=r.pos()+o;let l=0;for(;r.pos(){const r=s.data;if(r.hasOwnProperty("extent"))return s;if(r.features)throw new Error(vC);if(r.hasOwnProperty("count"))throw new Error(vC);return s})}function vd(e,t,i,s={},r={}){const n=typeof e=="string"?Ai(e):e,o=t.geometry?[t.geometry]:[];return s.responseType=i==="pbf"?"array-buffer":"json",l5(o,null,s).then(a=>{const l=a&&a[0];M(l)&&((t=t.clone()).geometry=l);const u=c5({...n.query,f:i,...r,...d5(t,r)});return kt(Xc(n.path,"query"),{...s,query:{...u,...s.query}})})}var c_e=Object.freeze(Object.defineProperty({__proto__:null,encodeGeometry:h5,executeQuery:p5,executeQueryForCount:Zee,executeQueryForExtent:Qee,executeQueryForIds:Xee,executeQueryPBF:Jee,executeQueryPBFBuffer:f5,queryToQueryStringParameters:d5,runQuery:vd},Symbol.toStringTag,{value:"Module"})),BS;const US=new Ie({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let ni=BS=class extends W{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){var r;const i=xe.fromJSON(t.spatialReference),s=[];for(let n=0;n0)for(let i=0;iMath.round((u-s)/t),o=u=>Math.round((r-u)/i),a=this.features,l=this._getQuantizationFunction(this.geometryType,n,o);for(let u=0,d=a.length;ud*n+s,l=d=>r-d*o,u=this._getHydrationFunction(e,a,l);for(const{geometry:d}of t)M(d)&&u&&u(d);return this.transform=null,this}_quantizePoints(e,t,i){let s,r;const n=[];for(let o=0,a=e.length;o0){const u=t(l[0]),d=i(l[1]);u===s&&d===r||(n.push([u-s,d-r]),s=u,r=d)}else s=t(l[0]),r=i(l[1]),n.push([s,r])}return n.length>0?n:null}_getQuantizationFunction(e,t,i){return e==="point"?s=>(s.x=t(s.x),s.y=i(s.y),s):e==="polyline"||e==="polygon"?s=>{const r=Bc(s)?s.rings:s.paths,n=[];for(let o=0,a=r.length;o0?(Bc(s)?s.rings=n:s.paths=n,s):null}:e==="multipoint"?s=>{const r=this._quantizePoints(s.points,t,i);return r&&r.length>0?(s.points=r,s):null}:e==="extent"?s=>s:null}_getHydrationFunction(e,t,i){return e==="point"?s=>{s.x=t(s.x),s.y=i(s.y)}:e==="polyline"||e==="polygon"?s=>{const r=Bc(s)?s.rings:s.paths;let n,o;for(let a=0,l=r.length;a0?(n+=m[0],o+=m[1]):(n=m[0],o=m[1]),m[0]=t(n),m[1]=i(o)}}}:e==="extent"?s=>{s.xmin=t(s.xmin),s.ymin=i(s.ymin),s.xmax=t(s.xmax),s.ymax=i(s.ymax)}:e==="multipoint"?s=>{const r=s.points;let n,o;for(let a=0,l=r.length;a0?(n+=u[0],o+=u[1]):(n=u[0],o=u[1]),u[0]=t(n),u[1]=i(o)}}:null}};c([h({type:String,json:{write:!0}})],ni.prototype,"displayFieldName",void 0),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],ni.prototype,"exceededTransferLimit",void 0),c([h({type:[Ci],json:{write:!0}})],ni.prototype,"features",void 0),c([Q("features")],ni.prototype,"readFeatures",null),c([h({type:[_T],json:{write:!0}})],ni.prototype,"fields",void 0),c([h({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:US.read}}})],ni.prototype,"geometryType",void 0),c([ie("geometryType")],ni.prototype,"writeGeometryType",null),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],ni.prototype,"hasM",void 0),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],ni.prototype,"hasZ",void 0),c([h({types:fu,json:{write:!0}})],ni.prototype,"queryGeometry",void 0),c([Q("queryGeometry")],ni.prototype,"readQueryGeometry",null),c([h({type:xe,json:{write:!0}})],ni.prototype,"spatialReference",void 0),c([ie("spatialReference")],ni.prototype,"writeSpatialReference",null),c([h({json:{write:!0}})],ni.prototype,"transform",void 0),ni=BS=c([S("esri.rest.support.FeatureSet")],ni),ni.prototype.toJSON.isDefaultToJSON=!0;const Wb=ni;var u_e=Object.freeze(Object.defineProperty({__proto__:null,default:Wb},Symbol.toStringTag,{value:"Module"}));const bC={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8},Kee={milliseconds:{getter:"getMilliseconds",setter:"setMilliseconds",multiplier:1},seconds:{getter:"getSeconds",setter:"setSeconds",multiplier:1},minutes:{getter:"getMinutes",setter:"setMinutes",multiplier:1},hours:{getter:"getHours",setter:"setHours",multiplier:1},days:{getter:"getDate",setter:"setDate",multiplier:1},weeks:{getter:"getDate",setter:"setDate",multiplier:7},months:{getter:"getMonth",setter:"setMonth",multiplier:1},years:{getter:"getFullYear",setter:"setFullYear",multiplier:1},decades:{getter:"getFullYear",setter:"setFullYear",multiplier:10},centuries:{getter:"getFullYear",setter:"setFullYear",multiplier:100}};function ete(e,t){const i=new Date(e,t+1,1);return i.setDate(0),i.getDate()}function Wc(e,t,i){const s=new Date(e.getTime());if(t&&i){const r=Kee[i],{getter:n,setter:o,multiplier:a}=r;if(i==="months"){const l=ete(s.getFullYear(),s.getMonth()+t);s.getDate()>l&&s.setDate(l)}s[o](s[n]()+t*a)}return s}function _C(e,t){switch(t){case"milliseconds":return new Date(e.getTime());case"seconds":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());case"minutes":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes());case"hours":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours());case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate());case"weeks":return new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay());case"months":return new Date(e.getFullYear(),e.getMonth(),1);case"years":return new Date(e.getFullYear(),0,1);case"decades":return new Date(e.getFullYear()-e.getFullYear()%10,0,1);case"centuries":return new Date(e.getFullYear()-e.getFullYear()%100,0,1);default:return new Date}}function tte(e,t,i){return e===0?0:e*bC[t]/bC[i]}var gr;let bs=gr=class extends W{constructor(e){super(e),this.end=null,this.start=null}static get allTime(){return wC}static get empty(){return ite}readEnd(e,t){return t.end!=null?new Date(t.end):null}writeEnd(e,t){t.end=e?e.getTime():null}get isAllTime(){return this.equals(gr.allTime)}get isEmpty(){return this.equals(gr.empty)}readStart(e,t){return t.start!=null?new Date(t.start):null}writeStart(e,t){t.start=e?e.getTime():null}clone(){return new gr({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=M(this.start)?this.start.getTime():this.start,i=M(this.end)?this.end.getTime():this.end,s=M(e.start)?e.start.getTime():e.start,r=M(e.end)?e.end.getTime():e.end;return t===s&&i===r}expandTo(e){if(this.isEmpty||this.isAllTime)return this.clone();const t=ja(this.start,s=>_C(s,e)),i=ja(this.end,s=>{const r=_C(s,e);return s.getTime()===r.getTime()?r:Wc(r,1,e)});return new gr({start:t,end:i})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return gr.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=sp(this.start,-1/0,a=>a.getTime()),i=sp(this.end,1/0,a=>a.getTime()),s=sp(e.start,-1/0,a=>a.getTime()),r=sp(e.end,1/0,a=>a.getTime());let n,o;if(s>=t&&s<=i?n=s:t>=s&&t<=r&&(n=t),i>=s&&i<=r?o=i:r>=t&&r<=i&&(o=r),n!=null&&o!=null&&!isNaN(n)&&!isNaN(o)){const a=new gr;return a.start=n===-1/0?null:new Date(n),a.end=o===1/0?null:new Date(o),a}return gr.empty}offset(e,t){if(this.isEmpty||this.isAllTime)return this.clone();const i=new gr,{start:s,end:r}=this;return M(s)&&(i.start=Wc(s,e,t)),M(r)&&(i.end=Wc(r,e,t)),i}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return wC.clone();const t=M(this.start)&&M(e.start)?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,i=M(this.end)&&M(e.end)?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new gr({start:t,end:i})}};c([h({type:Date,json:{write:{allowNull:!0}}})],bs.prototype,"end",void 0),c([Q("end")],bs.prototype,"readEnd",null),c([ie("end")],bs.prototype,"writeEnd",null),c([h({readOnly:!0,json:{read:!1}})],bs.prototype,"isAllTime",null),c([h({readOnly:!0,json:{read:!1}})],bs.prototype,"isEmpty",null),c([h({type:Date,json:{write:{allowNull:!0}}})],bs.prototype,"start",void 0),c([Q("start")],bs.prototype,"readStart",null),c([ie("start")],bs.prototype,"writeStart",null),bs=gr=c([S("esri.TimeExtent")],bs);const wC=new bs,ite=new bs({start:void 0,end:void 0}),Ln=bs;let Xl=class extends xt(W){constructor(e){super(e),this.onFields=null,this.operator=null,this.searchTerm=null,this.searchType=null}};c([h({type:[String],json:{write:{enabled:!0,overridePolicy(){return{enabled:M(this.onFields)&&this.onFields.length>0}}}}})],Xl.prototype,"onFields",void 0),c([h({type:String,json:{write:!0}})],Xl.prototype,"operator",void 0),c([h({type:String,json:{write:!0}})],Xl.prototype,"searchTerm",void 0),c([h({type:String,json:{write:!0}})],Xl.prototype,"searchType",void 0),Xl=c([S("esri.rest.support.FullTextSearch")],Xl);const ste=Xl;var qS;const xC=new Ie({upperLeft:"upper-left",lowerLeft:"lower-left"});let Zl=qS=class extends W{constructor(e){super(e),this.extent=null,this.mode="view",this.originPosition="upper-left",this.tolerance=1}clone(){return new qS(R({extent:this.extent,mode:this.mode,originPosition:this.originPosition,tolerance:this.tolerance}))}};c([h({type:Ze,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],Zl.prototype,"extent",void 0),c([h({type:["view","edit"],json:{write:!0}})],Zl.prototype,"mode",void 0),c([h({type:String,json:{read:xC.read,write:xC.write}})],Zl.prototype,"originPosition",void 0),c([h({type:Number,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],Zl.prototype,"tolerance",void 0),Zl=qS=c([S("esri.rest.support.QuantizationParameters")],Zl);const m5=Zl;var GS;const SC=new Ie({count:"count",sum:"sum",min:"min",max:"max",avg:"avg",stddev:"stddev",var:"var",exceedslimit:"exceedslimit",percentile_cont:"percentile-continuous",percentile_disc:"percentile-discrete",EnvelopeAggregate:"envelope-aggregate",CentroidAggregate:"centroid-aggregate",ConvexHullAggregate:"convex-hull-aggregate"});let vr=GS=class extends W{constructor(e){super(e),this.maxPointCount=void 0,this.maxRecordCount=void 0,this.maxVertexCount=void 0,this.onStatisticField=null,this.outStatisticFieldName=null,this.statisticType=null,this.statisticParameters=null}writeStatisticParameters(e,t){this.statisticType!=="percentile-continuous"&&this.statisticType!=="percentile-discrete"||(t.statisticParameters=R(e))}clone(){return new GS({maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount,onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,statisticType:this.statisticType,statisticParameters:R(this.statisticParameters)})}};c([h({type:Number,json:{write:!0}})],vr.prototype,"maxPointCount",void 0),c([h({type:Number,json:{write:!0}})],vr.prototype,"maxRecordCount",void 0),c([h({type:Number,json:{write:!0}})],vr.prototype,"maxVertexCount",void 0),c([h({type:String,json:{write:!0}})],vr.prototype,"onStatisticField",void 0),c([h({type:String,json:{write:!0}})],vr.prototype,"outStatisticFieldName",void 0),c([h({type:String,json:{read:{source:"statisticType",reader:SC.read},write:{target:"statisticType",writer:SC.write}}})],vr.prototype,"statisticType",void 0),c([h({type:Object})],vr.prototype,"statisticParameters",void 0),c([ie("statisticParameters")],vr.prototype,"writeStatisticParameters",null),vr=GS=c([S("esri.rest.support.StatisticDefinition")],vr);const y5=vr;var Ph;const rte=new Ie({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),nte=new Ie({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let de=Ph=class extends W{constructor(e){super(e),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.where=null}static from(e){return VM(Ph,e)}castDatumTransformation(e){return typeof e=="number"||typeof e=="object"?e:null}writeHistoricMoment(e,t){t.historicMoment=e&&e.getTime()}writeParameterValues(e,t){if(e){const i={};for(const s in e){const r=e[s];Array.isArray(r)?i[s]=r.map(n=>n instanceof Date?n.getTime():n):r instanceof Date?i[s]=r.getTime():i[s]=r}t.parameterValues=i}}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10,t.where="1=1"}writeWhere(e,t){t.where=e||"1=1"}clone(){return new Ph(R({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:M(this.historicMoment)?new Date(this.historicMoment.getTime()):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,where:this.where}))}};de.MAX_MAX_RECORD_COUNT_FACTOR=5,c([h({json:{write:!0}})],de.prototype,"aggregateIds",void 0),c([h({type:Boolean,json:{write:!0}})],de.prototype,"cacheHint",void 0),c([h({type:Boolean,json:{default:!1,write:!0}})],de.prototype,"compactGeometryEnabled",void 0),c([h({json:{write:!0}})],de.prototype,"datumTransformation",void 0),c([Oe("datumTransformation")],de.prototype,"castDatumTransformation",null),c([h({type:Boolean,json:{default:!1,write:!0}})],de.prototype,"defaultSpatialReferenceEnabled",void 0),c([h({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],de.prototype,"distance",void 0),c([h({type:Er,json:{write:!0}})],de.prototype,"dynamicDataSource",void 0),c([h({type:String,json:{write:!0}})],de.prototype,"formatOf3DObjects",void 0),c([h({type:[ste],json:{write:{enabled:!0,overridePolicy(){return{enabled:M(this.fullText)&&this.fullText.length>0}}}}})],de.prototype,"fullText",void 0),c([h({type:String,json:{write:!0}})],de.prototype,"gdbVersion",void 0),c([h({types:fu,json:{read:ll,write:!0}})],de.prototype,"geometry",void 0),c([h({type:Number,json:{write:!0}})],de.prototype,"geometryPrecision",void 0),c([h({type:[String],json:{write:!0}})],de.prototype,"groupByFieldsForStatistics",void 0),c([h({type:String,json:{write:!0}})],de.prototype,"having",void 0),c([h({type:Date})],de.prototype,"historicMoment",void 0),c([ie("historicMoment")],de.prototype,"writeHistoricMoment",null),c([h({type:Number,json:{write:!0}})],de.prototype,"maxAllowableOffset",void 0),c([h({type:Number,cast:e=>e<1?1:e>Ph.MAX_MAX_RECORD_COUNT_FACTOR?Ph.MAX_MAX_RECORD_COUNT_FACTOR:e,json:{write:{overridePolicy:e=>({enabled:e>1})}}})],de.prototype,"maxRecordCountFactor",void 0),c([h({type:["xyFootprint"],json:{write:!0}})],de.prototype,"multipatchOption",void 0),c([h({type:Number,json:{read:{source:"resultRecordCount"}}})],de.prototype,"num",void 0),c([h({json:{write:!0}})],de.prototype,"objectIds",void 0),c([h({type:[String],json:{write:!0}})],de.prototype,"orderByFields",void 0),c([h({type:[String],json:{write:!0}})],de.prototype,"outFields",void 0),c([h({type:xe,json:{name:"outSR",write:!0}})],de.prototype,"outSpatialReference",void 0),c([h({type:[y5],json:{write:{enabled:!0,overridePolicy(){return{enabled:M(this.outStatistics)&&this.outStatistics.length>0}}}}})],de.prototype,"outStatistics",void 0),c([h({json:{write:!0}})],de.prototype,"parameterValues",void 0),c([ie("parameterValues")],de.prototype,"writeParameterValues",null),c([h({type:be,json:{write:!0}})],de.prototype,"pixelSize",void 0),c([h({type:m5,json:{write:!0}})],de.prototype,"quantizationParameters",void 0),c([h({type:[Object],json:{write:!0}})],de.prototype,"rangeValues",void 0),c([h({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:this.spatialRelationship==="relation"}}}}})],de.prototype,"relationParameter",void 0),c([h({type:String,json:{write:!0}})],de.prototype,"resultType",void 0),c([h({type:Boolean,json:{default:!1,write:!0}})],de.prototype,"returnCentroid",void 0),c([h({type:Boolean,json:{default:!1,write:!0}})],de.prototype,"returnDistinctValues",void 0),c([h({type:Boolean,json:{default:!0,write:!0}})],de.prototype,"returnExceededLimitFeatures",void 0),c([h({type:Boolean,json:{write:!0}})],de.prototype,"returnGeometry",void 0),c([h({type:Boolean,json:{default:!1,write:!0}})],de.prototype,"returnQueryGeometry",void 0),c([h({type:Boolean,json:{default:!1,write:!0}})],de.prototype,"returnM",void 0),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],de.prototype,"returnZ",void 0),c([h({type:xe,json:{write:!0}})],de.prototype,"sourceSpatialReference",void 0),c([ue(rte,{ignoreUnknown:!1,name:"spatialRel"})],de.prototype,"spatialRelationship",void 0),c([h({type:Number,json:{read:{source:"resultOffset"}}})],de.prototype,"start",void 0),c([ie("start"),ie("num")],de.prototype,"writeStart",null),c([h({type:String,json:{write:!0}})],de.prototype,"sqlFormat",void 0),c([h({type:String,json:{write:!0}})],de.prototype,"text",void 0),c([h({type:Ln,json:{write:!0}})],de.prototype,"timeExtent",void 0),c([h({type:Boolean,json:{default:!1,write:!0}})],de.prototype,"timeReferenceUnknownClient",void 0),c([ue(nte,{ignoreUnknown:!1}),h({json:{write:{overridePolicy(e){return{enabled:!!e&&this.distance!=null&&this.distance>0}}}}})],de.prototype,"units",void 0),c([h({type:String,json:{write:{overridePolicy(e){return{enabled:e!=null||this.start!=null&&this.start>0}}}}})],de.prototype,"where",void 0),c([ie("where")],de.prototype,"writeWhere",null),de=Ph=c([S("esri.rest.support.Query")],de);const $n=de;async function rw(e,t,i){const s=await ote(e,t,i);return Wb.fromJSON(s)}async function ote(e,t,i){const s=n5(e),r={...i},n=$n.from(t),{data:o}=await p5(s,n,n.sourceSpatialReference,r);return o}function fi(e,t){return e?t?4:3:t?3:2}const bd=q.getLogger("esri.layers.graphics.featureConversionUtils"),g5={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0},ate=(e,t,i,s,r,n)=>{e[i]=r,e[i+1]=n},MC=(e,t,i,s,r,n)=>{e[i]=r,e[i+1]=n,e[i+2]=t[s+2]},lte=(e,t,i,s,r,n)=>{e[i]=r,e[i+1]=n,e[i+2]=t[s+3]},cte=(e,t,i,s,r,n)=>{e[i]=r,e[i+1]=n,e[i+2]=t[s+2],e[i+3]=t[s+3]};function wT(e,t,i,s){if(e){if(i)return t&&s?cte:MC;if(t&&s)return lte}else if(t&&s)return MC;return ate}function nw({scale:e,translate:t},i){return Math.round((i-t[0])/e[0])}function ow({scale:e,translate:t},i){return Math.round((t[1]-i)/e[1])}function aw({scale:e,translate:t},i,s){return i*e[s]+t[s]}function h_e(e,t,i){return e?t?i?MT(e):xT(e):i?ST(e):Hb(e):null}function Hb(e){const t=e.coords;return{x:t[0],y:t[1]}}function v5(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e}function xT(e){const t=e.coords;return{x:t[0],y:t[1],z:t[2]}}function ute(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.z,e}function ST(e){const t=e.coords;return{x:t[0],y:t[1],m:t[2]}}function hte(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.m,e}function MT(e){const t=e.coords;return{x:t[0],y:t[1],z:t[2],m:t[3]}}function dte(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.z,e.coords[3]=t.m,e}function pte(e,t,i,s){let r=Hb;i&&s?r=MT:i?r=xT:s&&(r=ST);for(const n of t){const{geometry:o,attributes:a}=n,l=M(o)?r(o):null;e.push({attributes:a,geometry:l})}return e}function $T(e,t){return e&&t?dte:e?ute:t?hte:v5}function b5(e,t,i,s,r){const n=$T(i,s);for(const{geometry:o,attributes:a}of t){const l=M(o)?n(new zi,o):null;e.push(new Pn(l,a,null,r?a[r]:void 0))}return e}function d_e(e,t,i=$T(t.z!=null,t.m!=null)){return i(e,t)}function fte(e,t,i,s){for(const{geometry:r,attributes:n}of t)e.push({attributes:n,geometry:M(r)?_5(r,i,s):null});return e}function _5(e,t,i){if(N(e))return null;const s=fi(t,i),r=[];for(let n=0;n=l&&(e.lengths.push(k),I=$)}return Br(e.coords,I),e.coords.length?e:null}function w_e(e,t,i,s,r,n,o=i,a=s){if(Eo(e),!t||!t.coords.length)return null;const l=g5[r],{coords:u,lengths:d}=t,f=fi(i,s),m=fi(i&&o,s&&a),y=wT(i,s,o,a);if(!d.length)return y(e.coords,u,0,0,u[0],u[1]),Eo(e,f,0),e;let g=0;const v=n*n;for(const b of d){if(b=l?e.lengths.push(I):Br(e.coords,_*m),g+=b*f}return e.coords.length?e:null}function _te(e,t,i,s){const r=e[t],n=e[t+1],o=e[i],a=e[i+1],l=e[s],u=e[s+1];let d=o,f=a,m=l-d,y=u-f;if(m!==0||y!==0){const g=((r-d)*m+(n-f)*y)/(m*m+y*y);g>1?(d=l,f=u):g>0&&(d+=m*g,f+=y*g)}return m=r-d,y=n-f,m*m+y*y}function WS(e,t,i,s,r,n,o){let a,l=s,u=0;for(let d=n+i;dl&&(u=d,l=a);l>s&&(u-n>i&&WS(e,t,i,s,r,n,u),r(e,t,e.length,u,t[u],t[u+1]),o-u>i&&WS(e,t,i,s,r,u,o))}function x_e(e,t,i,s){if(N(t)||!t.coords||!t.coords.length)return null;const r=fi(i,s);let n=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;if(t&&t.coords){const u=t.coords;for(let d=0;d0&&this.where==null&&(t.definitionExpression="1=1")}clone(){return new HS(R({cacheHint:this.cacheHint,dynamicDataSource:this.dynamicDataSource,gdbVersion:this.gdbVersion,geometryPrecision:this.geometryPrecision,historicMoment:this.historicMoment&&new Date(this.historicMoment.getTime()),maxAllowableOffset:this.maxAllowableOffset,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,relationshipId:this.relationshipId,start:this.start,num:this.num,returnGeometry:this.returnGeometry,where:this.where,returnZ:this.returnZ,returnM:this.returnM}))}};c([h({type:Boolean,json:{write:!0}})],dt.prototype,"cacheHint",void 0),c([h({type:Er,json:{write:!0}})],dt.prototype,"dynamicDataSource",void 0),c([h({type:String,json:{write:!0}})],dt.prototype,"gdbVersion",void 0),c([h({type:Number,json:{write:!0}})],dt.prototype,"geometryPrecision",void 0),c([h({type:Date})],dt.prototype,"historicMoment",void 0),c([ie("historicMoment")],dt.prototype,"_writeHistoricMoment",null),c([h({type:Number,json:{write:!0}})],dt.prototype,"maxAllowableOffset",void 0),c([h({type:[Number],json:{write:!0}})],dt.prototype,"objectIds",void 0),c([h({type:[String],json:{write:!0}})],dt.prototype,"orderByFields",void 0),c([h({type:[String],json:{write:!0}})],dt.prototype,"outFields",void 0),c([h({type:xe,json:{read:{source:"outSR"},write:{target:"outSR"}}})],dt.prototype,"outSpatialReference",void 0),c([h({json:{write:!0}})],dt.prototype,"relationshipId",void 0),c([h({type:Number,json:{read:{source:"resultOffset"}}})],dt.prototype,"start",void 0),c([ie("start"),ie("num")],dt.prototype,"writeStart",null),c([h({type:Number,json:{read:{source:"resultRecordCount"}}})],dt.prototype,"num",void 0),c([h({json:{write:!0}})],dt.prototype,"returnGeometry",void 0),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],dt.prototype,"returnM",void 0),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],dt.prototype,"returnZ",void 0),c([h({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],dt.prototype,"where",void 0),dt=HS=c([S("esri.rest.support.RelationshipQuery")],dt),dt.from=Dt(dt);const am=dt;var YS;let Wu=YS=class extends W{constructor(e){super(e),this.groupByFields=void 0,this.topCount=void 0,this.orderByFields=void 0}clone(){return new YS({groupByFields:this.groupByFields,topCount:this.topCount,orderByFields:this.orderByFields})}};c([h({type:[String],json:{write:!0}})],Wu.prototype,"groupByFields",void 0),c([h({type:Number,json:{write:!0}})],Wu.prototype,"topCount",void 0),c([h({type:[String],json:{write:!0}})],Wu.prototype,"orderByFields",void 0),Wu=YS=c([S("esri.rest.support.TopFilter")],Wu);const Ste=Wu;var JS;const IC=new Ie({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),EC=new Ie({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let et=JS=class extends W{constructor(e){super(e),this.cacheHint=void 0,this.distance=void 0,this.geometry=null,this.geometryPrecision=void 0,this.maxAllowableOffset=void 0,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.resultType=null,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.start=void 0,this.spatialRelationship="intersects",this.timeExtent=null,this.topFilter=void 0,this.units=null,this.where="1=1"}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10}clone(){return new JS(R({cacheHint:this.cacheHint,distance:this.distance,geometry:this.geometry,geometryPrecision:this.geometryPrecision,maxAllowableOffset:this.maxAllowableOffset,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,resultType:this.resultType,returnGeometry:this.returnGeometry,returnZ:this.returnZ,returnM:this.returnM,start:this.start,spatialRelationship:this.spatialRelationship,timeExtent:this.timeExtent,topFilter:this.topFilter,units:this.units,where:this.where}))}};c([h({type:Boolean,json:{write:!0}})],et.prototype,"cacheHint",void 0),c([h({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],et.prototype,"distance",void 0),c([h({types:fu,json:{read:ll,write:!0}})],et.prototype,"geometry",void 0),c([h({type:Number,json:{write:!0}})],et.prototype,"geometryPrecision",void 0),c([h({type:Number,json:{write:!0}})],et.prototype,"maxAllowableOffset",void 0),c([h({type:Number,json:{read:{source:"resultRecordCount"}}})],et.prototype,"num",void 0),c([h({json:{write:!0}})],et.prototype,"objectIds",void 0),c([h({type:[String],json:{write:!0}})],et.prototype,"orderByFields",void 0),c([h({type:[String],json:{write:!0}})],et.prototype,"outFields",void 0),c([h({type:xe,json:{read:{source:"outSR"},write:{target:"outSR"}}})],et.prototype,"outSpatialReference",void 0),c([h({type:String,json:{write:!0}})],et.prototype,"resultType",void 0),c([h({json:{write:!0}})],et.prototype,"returnGeometry",void 0),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],et.prototype,"returnM",void 0),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],et.prototype,"returnZ",void 0),c([h({type:Number,json:{read:{source:"resultOffset"}}})],et.prototype,"start",void 0),c([ie("start"),ie("num")],et.prototype,"writeStart",null),c([h({type:String,json:{read:{source:"spatialRel",reader:IC.read},write:{target:"spatialRel",writer:IC.write}}})],et.prototype,"spatialRelationship",void 0),c([h({type:Ln,json:{write:!0}})],et.prototype,"timeExtent",void 0),c([h({type:Ste,json:{write:!0}})],et.prototype,"topFilter",void 0),c([h({type:String,json:{read:EC.read,write:{writer:EC.write,overridePolicy(e){return{enabled:M(e)&&M(this.distance)&&this.distance>0}}}}})],et.prototype,"units",void 0),c([h({type:String,json:{write:!0}})],et.prototype,"where",void 0),et=JS=c([S("esri.rest.support.TopFeaturesQuery")],et),et.from=Dt(et);const ky=et,Mte="esri.widgets.Feature.support.relatedFeatureUtils",kC=q.getLogger(Mte),CC=new Map;function XS(e){if(!xo(e))return null;const[t,i]=e.split("/").slice(1);return{layerId:t,fieldName:i}}function $te(e,t){if(!t.relationships)return null;let i=null;const{relationships:s}=t;return s.some(r=>r.id===parseInt(e,10)&&(i=r,!0)),i}function Tte({originRelationship:e,relationships:t,layerId:i}){let s;return t&&t.some(r=>(`${r.relatedTableId}`===i&&r.id===e.id&&(s=r),!!s)),s}function Ite(e,t){const i=t.toLowerCase();for(const s in e)if(s.toLowerCase()===i)return e[s];return null}function Ete(e,t){const i=$te(e,t);if(!!i)return{url:`${t.url}/${i.relatedTableId}`,sourceSpatialReference:t.spatialReference,relation:i,relatedFields:[],outStatistics:[]}}function kte(e,t){if(!t||!e)return;const{features:i,statsFeatures:s}=e,r=i&&i.value;t.relatedFeatures=r?r.features:[];const n=s&&s.value;t.relatedStatsFeatures=n?n.features:[]}function Cte(e,t,i,s){const r=new am;return r.outFields=["*"],r.relationshipId=typeof t.id=="number"?t.id:parseInt(t.id,10),r.objectIds=[e.attributes[i.objectIdField]],i.queryRelatedFeatures(r,s)}function Pte(e,t,i){let s=0;const r=[];for(;sv.attributes[n.objectIdField]);if((l==null?void 0:l.length)>0&&n.supportsStatistics){const v=new $n;v.where=Pte(n.objectIdField,g,1e3),v.outFields=a,v.outStatistics=l,v.sourceSpatialReference=d;const b={features:Promise.resolve(y),statsFeatures:rw(u,v)};return as(b)}}const m=f==null?void 0:f.keyField;if(m){const y=Y$(Dte(n.fields,m)),g=Ite(e.attributes,o.keyField),v=y?`${m}=${g}`:`${m}='${g}'`,b=rw(u,new $n({where:v,outFields:t.relatedFields,sourceSpatialReference:d}),s),_=t.outStatistics&&t.outStatistics.length>0&&n.supportsStatistics?rw(u,new $n({where:v,outFields:t.relatedFields,outStatistics:t.outStatistics,sourceSpatialReference:d}),s):null,x={features:b};return _&&(x.statsFeatures=_),as(x)}return null}function Ote(e,t){return kt(e,{query:{f:"json"},signal:t&&t.signal})}function Rte({relatedInfos:e,layer:t},i){const s={};return e.forEach((r,n)=>{const{relation:o}=r;if(!o){const f=new L("relation-required","A relation is required on a layer to retrieve related records.");throw kC.error(f),f}const{relatedTableId:a}=o;if(typeof a!="number"){const f=new L("A related table ID is required on a layer to retrieve related records.");throw kC.error(f),f}const l=`${t.url}/${a}`,u=CC.get(l),d=u||Ote(l,i);u||CC.set(l,d),s[n]=d}),as(s)}function Lte({graphic:e,relatedInfos:t,layer:i},s){const r={};return t.forEach((n,o)=>{n.layerInfo&&(r[o]=Ate(e,n,i,s))}),as(r)}function Fte({relatedInfo:e,fieldName:t,fieldInfo:i}){if(e.relatedFields.push(t),i.statisticType){const s=new y5({statisticType:i.statisticType,onStatisticField:t,outStatisticFieldName:t});e.outStatistics.push(s)}}function Dte(e,t){if(e!=null){t=t.toLowerCase();for(const i of e)if(i&&i.name.toLowerCase()===t)return i}return null}const PC={chartAnimation:!0};let Yt=class extends oe{constructor(e){super(e),this.abilities={...PC},this.activeMediaInfoIndex=0,this.attributes=null,this.description=null,this.fieldInfoMap=null,this.formattedAttributes=null,this.expressionAttributes=null,this.layer=null,this.mediaInfos=null,this.popupTemplate=null,this.relatedInfos=null,this.title=null}castAbilities(e){return{...PC,...e}}get activeMediaInfo(){return this.formattedMediaInfos[this.activeMediaInfoIndex]||null}get formattedMediaInfos(){return this._formatMediaInfos()||[]}get formattedMediaInfoCount(){return this.formattedMediaInfos.length}setActiveMedia(e){this._setContentElementMedia(e)}next(){this._pageContentElementMedia(1)}previous(){this._pageContentElementMedia(-1)}_setContentElementMedia(e){const{formattedMediaInfoCount:t}=this,i=(e+t)%t;this.activeMediaInfoIndex=i}_pageContentElementMedia(e){const{activeMediaInfoIndex:t}=this,i=t+e;this._setContentElementMedia(i)}_formatMediaInfos(){const{attributes:e,mediaInfos:t,formattedAttributes:i,expressionAttributes:s,fieldInfoMap:r,layer:n}=this;return t==null?void 0:t.map(o=>{const a=o==null?void 0:o.clone();if(!a)return null;if(a.title=Rc({attributes:e,fieldInfoMap:r,globalAttributes:i,expressionAttributes:s,layer:n,text:a.title}),a.caption=Rc({attributes:e,fieldInfoMap:r,globalAttributes:i,expressionAttributes:s,layer:n,text:a.caption}),a.altText=Rc({attributes:e,fieldInfoMap:r,globalAttributes:i,expressionAttributes:s,layer:n,text:a.altText}),a.type==="image"){const{value:l}=a;return this._setImageValue({value:l,formattedAttributes:i,layer:n}),a.value.sourceURL?a:void 0}if(a.type==="pie-chart"||a.type==="line-chart"||a.type==="column-chart"||a.type==="bar-chart"){const{value:l}=a;return this._setChartValue({value:l,chartType:a.type,attributes:e,formattedAttributes:i,layer:n,expressionAttributes:s}),a}return null}).filter(Boolean)}_setImageValue(e){const{fieldInfoMap:t}=this,{value:i,formattedAttributes:s,layer:r}=e,{linkURL:n,sourceURL:o}=i;if(o){const a=TS(o,r);i.sourceURL=$S({formattedAttributes:s,template:a,fieldInfoMap:t})}if(n){const a=TS(n,r);i.linkURL=$S({formattedAttributes:s,template:a,fieldInfoMap:t})}}_setChartValue(e){const{value:t,attributes:i,formattedAttributes:s,chartType:r,layer:n,expressionAttributes:o}=e,{popupTemplate:a,relatedInfos:l}=this,{fields:u,normalizeField:d}=t;if(t.fields=sK(u,n),d&&(t.normalizeField=nm(d,n)),!u.some(m=>!!(s[m]!=null||xo(m)&&l.size)))return;const f=a==null?void 0:a.fieldInfos;u.forEach(m=>{if(xo(m))return void(t.series=[...t.series,...this._getRelatedChartInfos({fieldInfos:f,fieldName:m,formattedAttributes:s,chartType:r,value:t})]);const y=this._getChartOption({value:t,attributes:i,chartType:r,formattedAttributes:s,expressionAttributes:o,fieldName:m,fieldInfos:f});t.series.push(y)})}_getRelatedChartInfos(e){var g;const{fieldInfos:t,fieldName:i,formattedAttributes:s,chartType:r,value:n}=e,o=[],a=XS(i),{layerId:l,fieldName:u}=a,d=(g=this.relatedInfos)==null?void 0:g.get(l.toString());if(!d)return o;const{relatedFeatures:f,relation:m}=d;if(!m||!f)return o;const{cardinality:y}=m;return f.forEach(v=>{const{attributes:b}=v;b&&Object.keys(b).forEach(_=>{_===u&&o.push(this._getChartOption({value:n,attributes:b,formattedAttributes:s,fieldName:i,chartType:r,relatedFieldName:_,fieldInfos:t}))})}),y==="one-to-many"||y==="many-to-many"?o:[o[0]]}_getTooltip({label:e,value:t,chartType:i}){return i==="pie-chart"?`${e}`:`${e}: ${t}`}_getChartOption(e){var I,T,k,A,F,G;const{value:t,attributes:i,formattedAttributes:s,expressionAttributes:r,fieldName:n,relatedFieldName:o,fieldInfos:a,chartType:l}=e,{layer:u,fieldInfoMap:d}=this,{normalizeField:f,tooltipField:m}=t,y=f?xo(f)?i[XS(f).fieldName]:i[f]:null,g=pT(n)&&r&&r[n]!==void 0?r[n]:o&&i[o]!==void 0?i[o]:i[n]!==void 0?i[n]:s[n],v=new zD({fieldName:n,value:g===void 0?null:g&&y?g/y:g});if(xo(n)){const U=d.get(n.toLowerCase()),J=d.get(m.toLowerCase()),H=(I=U==null?void 0:U.fieldName)!=null?I:n,te=(F=(A=(k=s[(T=J==null?void 0:J.fieldName)!=null?T:m])!=null?k:U==null?void 0:U.label)!=null?A:U==null?void 0:U.fieldName)!=null?F:o,se=s[H];return v.tooltip=this._getTooltip({label:te,value:se,chartType:l}),v}const b=GN(a,n),_=nm(n,u),x=m&&s[m]!==void 0?s[m]:UN(b||new Fm({fieldName:_}),(G=this.popupTemplate)==null?void 0:G.expressionInfos),$=s[_];return v.tooltip=this._getTooltip({label:x,value:$,chartType:l}),v}};c([h()],Yt.prototype,"abilities",void 0),c([Oe("abilities")],Yt.prototype,"castAbilities",null),c([h()],Yt.prototype,"activeMediaInfoIndex",void 0),c([h({readOnly:!0})],Yt.prototype,"activeMediaInfo",null),c([h()],Yt.prototype,"attributes",void 0),c([h()],Yt.prototype,"description",void 0),c([h()],Yt.prototype,"fieldInfoMap",void 0),c([h()],Yt.prototype,"formattedAttributes",void 0),c([h()],Yt.prototype,"expressionAttributes",void 0),c([h({readOnly:!0})],Yt.prototype,"formattedMediaInfos",null),c([h()],Yt.prototype,"layer",void 0),c([h({readOnly:!0})],Yt.prototype,"formattedMediaInfoCount",null),c([h()],Yt.prototype,"mediaInfos",void 0),c([h()],Yt.prototype,"popupTemplate",void 0),c([h()],Yt.prototype,"relatedInfos",void 0),c([h()],Yt.prototype,"title",void 0),Yt=c([S("esri.widgets.Feature.FeatureMedia.FeatureMediaViewModel")],Yt);const Fc=Yt;var AC=["#ffffff","#858585","#ffbebe","#ffebbe","#ffebaf","#ffffbe","#e9ffbe","#d3ffbe","#beffe8","#bee8ff","#bed2ff","#e8beff","#ffbee8","#ebebeb","#707070","#ff7f7f","#ffa77f","#ffd37f","#ffff73","#d1ff73","#a3ff73","#73ffdf","#73dfff","#73b2ff","#df73ff","#ff73df","#d6d6d6","#5c5c5c","#ff0000","#ff5500","#ffaa00","#ffff00","#aaff00","#55ff00","#00ffc5","#00c5ff","#0070ff","#c500ff","#ff00c5","#c2c2c2","#474747","#e60000","#e64c00","#e69800","#e6e600","#98e600","#4ce600","#00e6a9","#00a9e6","#005ce6","#a900e6","#e600a9","#adadad","#242424","#a80000","#a83800","#a87000","#a8a800","#70a800","#38a800","#00a884","#0084a8","#004da8","#8400a8","#a80084","#999999","#1a1a1a","#730000","#732600","#734c00","#737300","#4c7300","#267300","#00734c","#004c73","#002673","#4c0073","#73004"],Nte=[].concat(AC.slice(30,39),AC.slice(28,30).reverse()),jte=[{name:"default",colors:Nte},{name:"cat-dark",colors:["#ed5151","#149ece","#a7c636","#9e559c","#fc921f","#ffde3e","#f789d8","#b7814a","#3caf99","#6b6bd6","#b54779","#7f7f7f"]},{name:"tropical-bliss",colors:["#fce138","#ff9399","#fcd27e","#f1983c","#a553b7","#b1a9d0","#6ecffc","#4c81cd","#fc6f84","#fc3e5a","#6af689","#48885c"]},{name:"desert-blooms",colors:["#102432","#144d59","#ffc730","#ed9310","#a64f1b","#661510","#d9351a","#b31515","#4a0932","#8c213f","#18382e","#2c6954"]},{name:"under-the-sea",colors:["#bf9727","#607100","#00734c","#704489","#01acca","#024e76","#f09100","#ea311f","#c6004b","#7570b3","#666666","#333333"]},{name:"vibrant-rainbow",colors:["#fffb00","#f5cb11","#9fd40c","#46e39c","#32b8a6","#7ff2fa","#ac08cc","#dd33ff","#eb7200","#e8a784","#bf2e2e","#6c7000"]},{name:"ocean-bay",colors:["#191921","#11495c","#78b1c2","#454f4b","#8f8f82","#9be0c0","#87b051","#f7ec88","#ebdcc1","#dbb658","#c43541","#75351e"]},{name:"prairie-summer",colors:["#332424","#751555","#d47013","#d68989","#211173","#82aad6","#7bfaeb","#6ec9a8","#6b6408","#eada40","#ccc54a","#1fc235"]},{name:"pastel-chalk",colors:["#fffd99","#f5e6a4","#c1d48c","#b8e3d0","#a0b8b5","#cbf7fa","#d791f2","#dfc1eb","#f2b983","#e8c4b2","#bf8e8e","#94995c"]},{name:"seq-yellow-orange-red-bright",colors:["#910000","#b1260b","#c0370f","#e05919","#ef6a1d","#ff7b22","#ffa143","#ffb454","#ffda74","#ffed85"]},{name:"seq-reds-bright",colors:["#57453b","#7b4238","#9f4036","#c23d33","#d7483c","#ec5244","#f3696c","#f9816c","#ffc4ae","#fff0dc"]},{name:"seq-purples-bright",colors:["#4e465c","#5a4a78","#695291","#775baa","#8663c3","#946bdc","#aa89e8","#c1a6f3","#d7c4ff","#e6e1ff"]},{name:"seq-blues-bright",colors:["#404d54","#435c6c","#48799d","#4b88b6","#4d96ce","#50a5e7","#74bbed","#98d0f3","#bce6f9","#e6faff"]},{name:"seq-greens-bright",colors:["#39544c","#386757","#368165","#359b73","#33b581","#4bc392","#64d2a2","#7ce0b3","#cbf6d9","#f4ffea"]},{name:"seq-browns-bright",colors:["#524834","#715b38","#8f6e3c","#ae8140","#cc9444","#eba748","#eeb664","#f0c47f","#f9e0b7","#fff8eb"]}];const OC="en-us",TT=new Map([["ar",()=>z(()=>import("./ar.86cc1692.js"),["assets/ar.86cc1692.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.a)],["bg-bg",()=>z(()=>import("./bg_BG.b736e920.js"),["assets/bg_BG.b736e920.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.b)],["bs-ba",()=>z(()=>import("./bs_BA.a323ad66.js"),["assets/bs_BA.a323ad66.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.b)],["ca-es",()=>z(()=>import("./ca_ES.ef58828b.js"),["assets/ca_ES.ef58828b.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.c)],["cs-cz",()=>z(()=>import("./cs_CZ.b2d386a1.js"),["assets/cs_CZ.b2d386a1.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.c)],["da-dk",()=>z(()=>import("./da_DK.16566135.js"),["assets/da_DK.16566135.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.d)],["de-de",()=>z(()=>import("./de_DE.ce6610cd.js"),["assets/de_DE.ce6610cd.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.d)],["de-ch",()=>z(()=>import("./de_CH.60578987.js"),["assets/de_CH.60578987.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.d)],["el-gr",()=>z(()=>import("./el_GR.d4c6a4ee.js"),["assets/el_GR.d4c6a4ee.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.e)],["en-us",()=>z(()=>import("./en_US.71a65555.js"),["assets/en_US.71a65555.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.e)],["en-ca",()=>z(()=>import("./en_CA.ec6c2b7c.js"),["assets/en_CA.ec6c2b7c.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.e)],["es-es",()=>z(()=>import("./es_ES.ef1b40e9.js"),["assets/es_ES.ef1b40e9.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.e)],["et-ee",()=>z(()=>import("./et_EE.b9efffde.js"),["assets/et_EE.b9efffde.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.e)],["fi-fi",()=>z(()=>import("./fi_FI.6b2b8640.js"),["assets/fi_FI.6b2b8640.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.f)],["fr-fr",()=>z(()=>import("./fr_FR.0d0aa4b2.js"),["assets/fr_FR.0d0aa4b2.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.f)],["he-il",()=>z(()=>import("./he_IL.cefd7375.js"),["assets/he_IL.cefd7375.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.h)],["hr-hr",()=>z(()=>import("./hr_HR.f054665f.js"),["assets/hr_HR.f054665f.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.h)],["hu-hu",()=>z(()=>import("./hu_HU.6eb2e3c1.js"),["assets/hu_HU.6eb2e3c1.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.h)],["id-id",()=>z(()=>import("./id_ID.2f4d1d20.js"),["assets/id_ID.2f4d1d20.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.i)],["it-it",()=>z(()=>import("./it_IT.d99d283a.js"),["assets/it_IT.d99d283a.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.i)],["ja-jp",()=>z(()=>import("./ja_JP.02630a59.js"),["assets/ja_JP.02630a59.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.j)],["ko-kr",()=>z(()=>import("./ko_KR.494abdb6.js"),["assets/ko_KR.494abdb6.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.k)],["lt-lt",()=>z(()=>import("./lt_LT.e5dc3b07.js"),["assets/lt_LT.e5dc3b07.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.l)],["lv-lv",()=>z(()=>import("./lv_LV.006fe0d6.js"),["assets/lv_LV.006fe0d6.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.l)],["nb-no",()=>z(()=>import("./nb_NO.17aa1247.js"),["assets/nb_NO.17aa1247.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.n)],["nl-nl",()=>z(()=>import("./nl_NL.bb55a4a7.js"),["assets/nl_NL.bb55a4a7.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.n)],["pl-pl",()=>z(()=>import("./pl_PL.ca3d90a7.js"),["assets/pl_PL.ca3d90a7.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.p)],["pt-br",()=>z(()=>import("./pt_BR.07fbb84b.js"),["assets/pt_BR.07fbb84b.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.p)],["pt-pt",()=>z(()=>import("./pt_PT.e82fce8e.js"),["assets/pt_PT.e82fce8e.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.p)],["ro-ro",()=>z(()=>import("./ro_RO.08a11e64.js"),["assets/ro_RO.08a11e64.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.r)],["ru-ru",()=>z(()=>import("./ru_RU.4b08b8da.js"),["assets/ru_RU.4b08b8da.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.r)],["sk-sk",()=>z(()=>import("./sk_SK.c9cf24d2.js"),["assets/sk_SK.c9cf24d2.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.s)],["sl-sl",()=>z(()=>import("./sl_SL.7bddc01e.js"),["assets/sl_SL.7bddc01e.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.s)],["sr-rs",()=>z(()=>import("./sr_RS.9d484aca.js"),["assets/sr_RS.9d484aca.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.s)],["sv-se",()=>z(()=>import("./sv_SE.122bb1e9.js"),["assets/sv_SE.122bb1e9.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.s)],["th-th",()=>z(()=>import("./th_TH.50530bc1.js"),["assets/th_TH.50530bc1.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.t)],["tr-tr",()=>z(()=>import("./tr_TR.027c89bc.js"),["assets/tr_TR.027c89bc.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.t)],["uk-ua",()=>z(()=>import("./uk_UA.831b2f6d.js"),["assets/uk_UA.831b2f6d.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.u)],["vi-vn",()=>z(()=>import("./vi_VN.f6625b5d.js"),["assets/vi_VN.f6625b5d.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.v)],["zh-cn",()=>z(()=>import("./zh_Hans.38cb8157.js"),["assets/zh_Hans.38cb8157.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.z)],["zh-hk",()=>z(()=>import("./zh_Hant.e4eb7b89.js"),["assets/zh_Hant.e4eb7b89.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.z)],["zh-tw",()=>z(()=>import("./zh_Hant.e4eb7b89.js"),["assets/zh_Hant.e4eb7b89.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.z)]]);function Vte(e){const t=e.split("-")[0].toLowerCase();let i=null;for(const s of TT.keys())if(s.startsWith(t)){i=s;break}return i}function zte(e){return e?TT.has(e.toLowerCase())?e.toLowerCase():Vte(e)||OC:OC}let bu,jd;async function Bte(e=Rr()){if(e=zte(e),bu&&e===jd)return bu;bu=z(()=>import("./index.f6f524c6.js"),["assets/index.f6f524c6.js","assets/_commonjsHelpers.773c2c82.js"]).then(t=>t.i),jd=e;try{const[t,i]=await Promise.all([bu,TT.get(jd)()]);jd===e&&(t.am4core.options.defaultLocale=i.default),t.am4core.options.suppressWarnings=!0,t.am4core.options.autoDispose=!0}catch{return bu=null,jd=null,null}return bu}function Ute(e,t="default"){const i=jte.find(s=>s.name===t);return i?i.colors.map(s=>e.color(s)):null}const yt={base:"esri-feature-media",mediaContainer:"esri-feature-media__container",mediaItemContainer:"esri-feature-media__item-container",mediaItem:"esri-feature-media__item",mediaItemTitle:"esri-feature-media__item-title",mediaItemCaption:"esri-feature-media__item-caption",mediaPrevious:"esri-feature-media__previous",mediaPreviousIconLTR:"esri-feature-media__previous-icon",mediaPreviousIconRTL:"esri-feature-media__previous-icon--rtl",mediaNext:"esri-feature-media__next",mediaNextIconLTR:"esri-feature-media__next-icon",mediaNextIconRTL:"esri-feature-media__next-icon--rtl",mediaChart:"esri-feature-media__chart",mediaButton:"esri-feature-media__button",mediaIcon:"esri-feature-media__icon",iconLeftTriangleArrow:"esri-icon-left-triangle-arrow",iconRightTriangleArrow:"esri-icon-right-triangle-arrow"},lw=.05,cw=.95,uw=15,zn="color",Zo="tooltip",Vd="value",RC="default-line-value";let Xi=class extends yi{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this.viewModel=new Fc,this.messages=null,this._getChartDependencies=async i=>{const s=await Bte(),{destroyed:r,viewModel:n}=this;if(r||!n||!i)return;const{activeMediaInfo:o}=n,a=await this._getRendererColors(s);this._renderChart({chartDiv:i,mediaInfo:o,chartsModule:s,colorMap:a})}}initialize(){this._featureElementInfo=new Bb,this.addHandles([Z(()=>{var e,t;return[(e=this.viewModel)==null?void 0:e.activeMediaInfo,(t=this.viewModel)==null?void 0:t.activeMediaInfoIndex]},()=>this._setupMediaRefreshTimer(),Le),Z(()=>{var e,t;return[(e=this.viewModel)==null?void 0:e.description,(t=this.viewModel)==null?void 0:t.title]},()=>this._setupFeatureElementInfo(),Le)])}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){var e;return P("div",{bind:this,class:yt.base,onkeyup:this._handleMediaKeyup},(e=this._featureElementInfo)==null?void 0:e.render(),this.renderMedia())}renderMedia(){const{formattedMediaInfoCount:e}=this.viewModel;return e?P("div",{key:"media-element-container",class:yt.mediaContainer},this.renderMediaPageButton("previous"),this.renderMediaInfo(),this.renderMediaPageButton("next")):null}renderImageMediaInfo(e){const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:s}=this.viewModel,{value:r,refreshInterval:n,altText:o,title:a,type:l}=e,{sourceURL:u,linkURL:d}=r,f=BN(d)?"_blank":"_self",m=f==="_blank"?"noreferrer":"",y=n?t:null,g=y?y.timestamp:0,v=y?y.sourceURL:u,b=P("img",{alt:o||a,key:`media-${l}-${i}-${s}-${g}`,src:v});return(d?P("a",{title:a,href:d,rel:m,target:f},b):null)||b}renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return P("div",{key:`media-${e.type}-${t}-${i}`,bind:this,class:yt.mediaChart,afterCreate:this._getChartDependencies})}renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?e.type==="image"?this.renderImageMediaInfo(e):e.type.includes("chart")?this.renderChartMediaInfo(e):null:null}renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e.title?P("div",{key:"media-title",class:yt.mediaItemTitle,innerHTML:e.title}):null,i=e.caption?P("div",{key:"media-caption",class:yt.mediaItemCaption,innerHTML:e.caption}):null;return P("div",{key:"media-container",class:yt.mediaItemContainer},P("div",{key:"media-item-container",class:yt.mediaItem},this.renderMediaInfoType()),t,i)}renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t=e==="previous",i=t?this.messages.previous:this.messages.next,s=t?this.classes(yt.mediaButton,yt.mediaPrevious):this.classes(yt.mediaButton,yt.mediaNext),r=t?this.classes(yt.mediaIcon,yt.mediaPreviousIconLTR,yt.iconLeftTriangleArrow):this.classes(yt.mediaIcon,yt.mediaNextIconLTR,yt.iconRightTriangleArrow),n=t?this.classes(yt.mediaIcon,yt.mediaPreviousIconRTL,yt.iconRightTriangleArrow):this.classes(yt.mediaIcon,yt.mediaNextIconRTL,yt.iconLeftTriangleArrow),o=t?"media-previous":"media-next",a=t?this._previous:this._next;return P("button",{type:"button",key:o,title:i,"aria-label":i,tabIndex:0,class:s,bind:this,onclick:a},P("span",{"aria-hidden":"true",class:r}),P("span",{"aria-hidden":"true",class:n}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}async _getRendererColors(e){var o,a;const{am4core:t}=e,i=new Map,s=(a=(o=this.viewModel)==null?void 0:o.layer)==null?void 0:a.renderer,r="default";if(!s)return i;const n=await pee(s);return n.delete(r),Array.from(n.values()).every(l=>(l==null?void 0:l.length)===1)&&(i.set(RC,t.color({r:50,g:50,b:50,a:1})),Array.from(n.keys()).forEach(l=>{l&&i.set(l,t.color(n.get(l)[0].toCss(!0)))})),i}_handleMediaKeyup(e){const t=yc(e);t==="ArrowLeft"&&(e.stopPropagation(),this.viewModel.previous()),t==="ArrowRight"&&(e.stopPropagation(),this.viewModel.next())}_renderChart(e){const{abilities:t}=this.viewModel,{chartsModule:i,chartDiv:s,mediaInfo:r,colorMap:n}=e,{value:o,type:a}=r,{am4core:l}=i,u=Ute(l);function d(y){y instanceof l.ColorSet&&u&&(y.list=u)}Tv()&&l.useTheme(i.am4themes_dark);const f=window.matchMedia("(prefers-reduced-motion: reduce)");t.chartAnimation&&!f.matches?l.useTheme(i.am4themes_animated):l.unuseTheme(i.am4themes_animated),l.useTheme(d);const m=a==="pie-chart"?this._createPieChart(e):this._createXYChart(e);s.setAttribute("aria-label",r.altText||r.title),m.data=o.series.map(y=>({[Zo]:y.tooltip,[Vd]:y.value,[zn]:n.get(y.fieldName)})).filter(y=>a!=="pie-chart"||y.value>0)}_customizeChartTooltip(e,t){e.label.wrap=!0,e.label.maxWidth=200,e.autoTextColor=!1,e.getFillFromObject=!1,e.label.fill=t.color("#ffffff"),e.background.fill=t.color({r:0,g:0,b:0,a:.7})}_createPieChart(e){const{chartDiv:t,chartsModule:i}=e,{am4core:s,am4charts:r}=i,n=s.create(t,r.PieChart);n.rtl=xn(this.container);const o=n.series.push(new r.PieSeries);return o.labels.template.disabled=!0,o.ticks.template.disabled=!0,o.dataFields.value=Vd,o.dataFields.category=Zo,this._customizeChartTooltip(o.tooltip,s),o.slices.template.propertyFields.fill=zn,o.slices.template.propertyFields.stroke=zn,n}_getMinSeriesValue(e){let t=0;return e.forEach(i=>t=Math.min(i.value,t)),t}_createColumnChart(e,t){const{chartsModule:i,mediaInfo:s}=t,{value:r}=s,{am4core:n,am4charts:o}=i,a=e.xAxes.push(new o.CategoryAxis);a.dataFields.category=Zo,a.renderer.labels.template.disabled=!0,this._customizeChartTooltip(a.tooltip,n),a.tooltip.events.on("sizechanged",()=>{a.tooltip.dy=-a.tooltip.contentHeight});const l=e.yAxes.push(new o.ValueAxis),u=l.renderer.labels.template;l.renderer.minLabelPosition=lw,l.renderer.maxLabelPosition=cw,l.min=this._getMinSeriesValue(r.series),this._customizeChartTooltip(l.tooltip,n),u.wrap=!0;const d=e.series.push(new o.ColumnSeries);d.dataFields.valueY=Vd,d.dataFields.categoryX=Zo,d.columns.template.propertyFields.fill=zn,d.columns.template.propertyFields.stroke=zn,e.cursor=new o.XYCursor,r.series.length>uw&&(e.scrollbarX=new n.Scrollbar)}_createBarChart(e,t){const{chartsModule:i,mediaInfo:s}=t,{value:r}=s,{am4core:n,am4charts:o}=i,a=e.yAxes.push(new o.CategoryAxis);a.dataFields.category=Zo,a.renderer.inversed=!0,a.renderer.labels.template.disabled=!0,this._customizeChartTooltip(a.tooltip,n),a.tooltip.events.on("sizechanged",()=>{a.tooltip.dx=a.tooltip.contentWidth});const l=e.xAxes.push(new o.ValueAxis),u=l.renderer.labels.template;l.renderer.minLabelPosition=lw,l.renderer.maxLabelPosition=cw,l.min=this._getMinSeriesValue(r.series),this._customizeChartTooltip(l.tooltip,n),u.wrap=!0;const d=e.series.push(new o.ColumnSeries);d.dataFields.valueX=Vd,d.dataFields.categoryY=Zo,d.columns.template.propertyFields.fill=zn,d.columns.template.propertyFields.stroke=zn,e.cursor=new o.XYCursor,r.series.length>uw&&(e.scrollbarY=new n.Scrollbar)}_createLineChart(e,t){const{chartsModule:i,mediaInfo:s,colorMap:r}=t,{value:n}=s,{am4core:o,am4charts:a}=i,l=e.xAxes.push(new a.CategoryAxis);l.dataFields.category=Zo,l.renderer.labels.template.disabled=!0,this._customizeChartTooltip(l.tooltip,o),l.tooltip.events.on("sizechanged",()=>{l.tooltip.dy=-l.tooltip.contentHeight});const u=e.yAxes.push(new a.ValueAxis),d=u.renderer.labels.template;u.renderer.minLabelPosition=lw,u.renderer.maxLabelPosition=cw,u.min=this._getMinSeriesValue(n.series),this._customizeChartTooltip(u.tooltip,o),d.wrap=!0;const f=e.series.push(new a.LineSeries);f.dataFields.categoryX=Zo,f.dataFields.valueY=Vd,f.strokeWidth=1;const m=r.get(RC);m&&(f.stroke=m);const y=f.bullets.push(new a.CircleBullet);y.propertyFields.fill=zn,y.propertyFields.stroke=zn,e.cursor=new a.XYCursor,n.series.length>uw&&(e.scrollbarX=new o.Scrollbar)}_createXYChart(e){const{chartDiv:t,chartsModule:i,mediaInfo:s}=e,{type:r}=s,{am4core:n,am4charts:o}=i,a=n.create(t,o.XYChart);return a.rtl=xn(this.container),r==="column-chart"&&this._createColumnChart(a,e),r==="bar-chart"&&this._createBarChart(a,e),r==="line-chart"&&this._createLineChart(a,e),a}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:this._getImageSource(e,t)},this.scheduleRender()}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e&&e.type==="image"&&e.refreshInterval&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e;if(!t)return;const s=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const r=setInterval(()=>{this._updateMediaInfoTimestamp(i.sourceURL)},s);this._refreshTimer=r}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[s,r=""]=e.split("#");return`${s}${i}timestamp=${t}${r?"#":""}${r}`}};c([h()],Xi.prototype,"attributes",null),c([h()],Xi.prototype,"activeMediaInfoIndex",null),c([h()],Xi.prototype,"description",null),c([h()],Xi.prototype,"fieldInfoMap",null),c([h()],Xi.prototype,"layer",null),c([h()],Xi.prototype,"mediaInfos",null),c([h()],Xi.prototype,"popupTemplate",null),c([h()],Xi.prototype,"relatedInfos",null),c([h()],Xi.prototype,"title",null),c([h({type:Fc})],Xi.prototype,"viewModel",void 0),c([h(),di("esri/widgets/Feature/t9n/Feature")],Xi.prototype,"messages",void 0),Xi=c([S("esri.widgets.Feature.FeatureMedia")],Xi);const P5=Xi;var ZS;let Lp=ZS=class extends W{constructor(e){super(e),this.minValue=0,this.maxValue=0}clone(){return new ZS({minValue:this.minValue,maxValue:this.maxValue})}};c([h({type:Number,json:{write:!0}})],Lp.prototype,"minValue",void 0),c([h({type:Number,json:{write:!0}})],Lp.prototype,"maxValue",void 0),Lp=ZS=c([S("esri.renderer.support.AuthoringInfoClassBreakInfo")],Lp);var QS;let La=QS=class extends W{constructor(e){super(e),this.field="",this.normalizationField="",this.label="",this.classBreakInfos=[]}clone(){return new QS({field:this.field,normalizationField:this.normalizationField,label:this.label,classBreakInfos:R(this.classBreakInfos)})}};c([h({type:String,json:{write:!0}})],La.prototype,"field",void 0),c([h({type:String,json:{write:!0}})],La.prototype,"normalizationField",void 0),c([h({type:String,json:{write:!0}})],La.prototype,"label",void 0),c([h({type:[Lp],json:{write:!0}})],La.prototype,"classBreakInfos",void 0),La=QS=c([S("esri.renderers.support.AuthoringInfoFieldInfo")],La);var KS;const Cy=new Ie({percentTotal:"percent-of-total",ratio:"ratio",percent:"percent"}),Py=new Ie({sizeInfo:"size",colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation"}),LC={key:e=>typeof e=="number"?"number":"string",typeMap:{number:Number,string:String},base:null},FC=["high-to-low","above-and-below","centered-on","extremes"],DC=[...new Set(["high-to-low","above-and-below","centered-on","extremes","90-10","above","below","high-to-low","above-and-below","90-10","above","below"])],NC=["seconds","minutes","hours","days","months","years"];let Zi=KS=class extends W{constructor(e){super(e),this.endTime=null,this.field=null,this.maxSliderValue=null,this.minSliderValue=null,this.startTime=null,this.type=null,this.units=null}castEndTime(e){return typeof e=="string"||typeof e=="number"?e:null}castStartTime(e){return typeof e=="string"||typeof e=="number"?e:null}get style(){return this.type==="color"?this._get("style"):null}set style(e){this._set("style",e)}get theme(){return this.type==="color"||this.type==="size"?this._get("theme")||"high-to-low":null}set theme(e){this._set("theme",e)}clone(){return new KS({endTime:this.endTime,field:this.field,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,startTime:this.startTime,style:this.style,theme:this.theme,type:this.type,units:this.units})}};c([h({types:LC,json:{write:!0}})],Zi.prototype,"endTime",void 0),c([Oe("endTime")],Zi.prototype,"castEndTime",null),c([h({type:String,json:{write:!0}})],Zi.prototype,"field",void 0),c([h({type:Number,json:{write:!0}})],Zi.prototype,"maxSliderValue",void 0),c([h({type:Number,json:{write:!0}})],Zi.prototype,"minSliderValue",void 0),c([h({types:LC,json:{write:!0}})],Zi.prototype,"startTime",void 0),c([Oe("startTime")],Zi.prototype,"castStartTime",null),c([h({type:Cy.apiValues,value:null,json:{type:Cy.jsonValues,read:Cy.read,write:Cy.write}})],Zi.prototype,"style",null),c([h({type:DC,value:null,json:{type:DC,origins:{"web-scene":{type:FC,write:{writer:(e,t)=>{FC.includes(e)&&(t.theme=e)}}}},write:!0}})],Zi.prototype,"theme",null),c([h({type:Py.apiValues,json:{type:Py.jsonValues,read:Py.read,write:Py.write}})],Zi.prototype,"type",void 0),c([h({type:NC,json:{type:NC,write:!0}})],Zi.prototype,"units",void 0),Zi=KS=c([S("esri.renderers.support.AuthoringInfoVisualVariable")],Zi);const qte=Zi;let Wg=class extends W{constructor(e){super(e),this.type=null}};c([h({readOnly:!0,json:{read:!1,write:!0}})],Wg.prototype,"type",void 0),Wg=c([S("esri.rest.support.ColorRamp")],Wg);const IT=Wg;var e2;let Ql=e2=class extends IT{constructor(e){super(e),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new e2({fromColor:R(this.fromColor),toColor:R(this.toColor),algorithm:this.algorithm})}};c([ue({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],Ql.prototype,"algorithm",void 0),c([h({type:pe,json:{type:[Ge],write:!0}})],Ql.prototype,"fromColor",void 0),c([h({type:pe,json:{type:[Ge],write:!0}})],Ql.prototype,"toColor",void 0),c([h({type:["algorithmic"]})],Ql.prototype,"type",void 0),Ql=e2=c([S("esri.rest.support.AlgorithmicColorRamp")],Ql);const ET=Ql;var t2;let Fp=t2=class extends IT{constructor(e){super(e),this.colorRamps=null,this.type="multipart"}clone(){return new t2({colorRamps:R(this.colorRamps)})}};c([h({type:[ET],json:{write:!0}})],Fp.prototype,"colorRamps",void 0),c([h({type:["multipart"]})],Fp.prototype,"type",void 0),Fp=t2=c([S("esri.rest.support.MultipartColorRamp")],Fp);const A5=Fp,Gte={key:"type",base:IT,typeMap:{algorithmic:ET,multipart:A5}};function Wte(e){return e&&e.type?e.type==="algorithmic"?ET.fromJSON(e):e.type==="multipart"?A5.fromJSON(e):null:null}var i2;const wl=new Ie({esriClassifyDefinedInterval:"defined-interval",esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation"}),Ay=new Ie({pieChart:"pie-chart",classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density",flow:"flow"}),jC=new Ie({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density"}),VC=["inches","feet","yards","miles","nautical-miles","millimeters","centimeters","decimeters","meters","kilometers","decimal-degrees"],Hte=["high-to-low","above-and-below","above","below","90-10"],Yte=["flow-line","wave-front"],Jte=["caret","circle-caret","arrow","circle-arrow","plus-minus","circle-plus-minus","square","circle","triangle","happy-sad","thumb","custom"];let gt=i2=class extends W{constructor(e){super(e),this.colorRamp=null,this.fadeRatio=null,this.isAutoGenerated=!1,this.lengthUnit=null,this.maxSliderValue=null,this.minSliderValue=null,this.visualVariables=null}get classificationMethod(){const e=this._get("classificationMethod"),t=this.type;return t&&t!=="relationship"?t==="class-breaks-size"||t==="class-breaks-color"?e||"manual":null:e}set classificationMethod(e){this._set("classificationMethod",e)}readColorRamp(e){return e?Wte(e):void 0}get fields(){return this.type&&this.type!=="predominance"?null:this._get("fields")}set fields(e){this._set("fields",e)}get field1(){return this.type&&this.type!=="relationship"?null:this._get("field1")}set field1(e){this._set("field1",e)}get field2(){return this.type&&this.type!=="relationship"?null:this._get("field2")}set field2(e){this._set("field2",e)}get flowTheme(){return this.type==="flow"?this._get("flowTheme"):null}set flowTheme(e){this._set("flowTheme",e)}get focus(){return this.type&&this.type!=="relationship"?null:this._get("focus")}set focus(e){this._set("focus",e)}get numClasses(){return this.type&&this.type!=="relationship"?null:this._get("numClasses")}set numClasses(e){this._set("numClasses",e)}get statistics(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("statistics"):null}set statistics(e){this._set("statistics",e)}get standardDeviationInterval(){const e=this.type;return e&&e!=="relationship"&&e!=="class-breaks-size"&&e!=="class-breaks-color"||this.classificationMethod&&this.classificationMethod!=="standard-deviation"?null:this._get("standardDeviationInterval")}set standardDeviationInterval(e){this._set("standardDeviationInterval",e)}get type(){return this._get("type")}set type(e){let t=e;e==="classed-size"?t="class-breaks-size":e==="classed-color"&&(t="class-breaks-color"),this._set("type",t)}get univariateSymbolStyle(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("univariateSymbolStyle"):null}set univariateSymbolStyle(e){this._set("univariateSymbolStyle",e)}get univariateTheme(){return this.type==="univariate-color-size"?this._get("univariateTheme"):null}set univariateTheme(e){this._set("univariateTheme",e)}clone(){return new i2({classificationMethod:this.classificationMethod,colorRamp:R(this.colorRamp),fadeRatio:R(this.fadeRatio),fields:this.fields&&this.fields.slice(0),field1:R(this.field1),field2:R(this.field2),isAutoGenerated:this.isAutoGenerated,focus:this.focus,numClasses:this.numClasses,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,lengthUnit:this.lengthUnit,statistics:this.statistics,standardDeviationInterval:this.standardDeviationInterval,type:this.type,visualVariables:this.visualVariables&&this.visualVariables.map(e=>e.clone()),univariateSymbolStyle:this.univariateSymbolStyle,univariateTheme:this.univariateTheme,flowTheme:this.flowTheme})}};c([h({type:wl.apiValues,value:null,json:{type:wl.jsonValues,read:wl.read,write:wl.write,origins:{"web-document":{default:"manual",type:wl.jsonValues,read:wl.read,write:wl.write}}}})],gt.prototype,"classificationMethod",null),c([h({types:Gte,json:{write:!0}})],gt.prototype,"colorRamp",void 0),c([Q("colorRamp")],gt.prototype,"readColorRamp",null),c([h({json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],gt.prototype,"fadeRatio",void 0),c([h({type:[String],value:null,json:{write:!0}})],gt.prototype,"fields",null),c([h({type:La,value:null,json:{write:!0}})],gt.prototype,"field1",null),c([h({type:La,value:null,json:{write:!0}})],gt.prototype,"field2",null),c([h({type:Yte,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],gt.prototype,"flowTheme",null),c([h({type:["HH","HL","LH","LL"],value:null,json:{write:!0}})],gt.prototype,"focus",null),c([h({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],gt.prototype,"isAutoGenerated",void 0),c([h({type:Number,value:null,json:{type:Ge,write:!0}})],gt.prototype,"numClasses",null),c([h({type:VC,json:{type:VC,read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],gt.prototype,"lengthUnit",void 0),c([h({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],gt.prototype,"maxSliderValue",void 0),c([h({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],gt.prototype,"minSliderValue",void 0),c([h({type:Object,value:null,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],gt.prototype,"statistics",null),c([h({type:[.25,.33,.5,1],value:null,json:{type:[.25,.33,.5,1],write:!0}})],gt.prototype,"standardDeviationInterval",null),c([h({type:Ay.apiValues,value:null,json:{type:Ay.jsonValues,read:Ay.read,write:Ay.write,origins:{"web-scene":{type:jC.jsonValues,write:{writer:jC.write,overridePolicy:e=>({enabled:e!=="flow"})}}}}})],gt.prototype,"type",null),c([h({type:[qte],json:{write:!0}})],gt.prototype,"visualVariables",void 0),c([h({type:Jte,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],gt.prototype,"univariateSymbolStyle",null),c([h({type:Hte,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],gt.prototype,"univariateTheme",null),gt=i2=c([S("esri.renderers.support.AuthoringInfo")],gt);const kT=gt,hw=new Ie({simple:"simple",uniqueValue:"unique-value",classBreaks:"class-breaks",heatmap:"heatmap",dotDensity:"dot-density",dictionary:"dictionary",pieChart:"pie-chart"},{ignoreUnknown:!0});let Dp=class extends W{constructor(e){super(e),this.authoringInfo=null,this.type=null}async getRequiredFields(e){if(!this.collectRequiredFields)return[];const t=new Set;return await this.collectRequiredFields(t,e),Array.from(t).sort()}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getAttributeHash(){return JSON.stringify(this)}getMeshHash(){return JSON.stringify(this)}};c([h({type:kT,json:{write:!0}})],Dp.prototype,"authoringInfo",void 0),c([h({type:hw.apiValues,readOnly:!0,json:{type:hw.jsonValues,read:!1,write:{writer:hw.write,ignoreOrigin:!0}}})],Dp.prototype,"type",void 0),Dp=c([S("esri.renderers.Renderer")],Dp);const zo=Dp;function Xte(e){var t,i,s;return(s=(i=(t=e.match(Zte))==null?void 0:t[1])==null?void 0:i.replace(/\\'/g,"'"))!=null?s:null}const Zte=/^hash\(\$feature\['((\\'|[^'])+)'\]\) \* 8\.381e-8$/;var s2;let Oh=s2=class extends W{constructor(){super(...arguments),this.title=null}clone(){return new s2({title:this.title})}};c([h({type:String,json:{write:!0}})],Oh.prototype,"title",void 0),Oh=s2=c([S("esri.renderers.support.LegendOptions")],Oh);var r2;let Hg=r2=class extends Oh{constructor(){super(...arguments),this.showLegend=null}clone(){return new r2({title:this.title,showLegend:this.showLegend})}};c([h({type:Boolean,json:{write:!0}})],Hg.prototype,"showLegend",void 0),Hg=r2=c([S("esri.renderers.visualVariables.support.VisualVariableLegendOptions")],Hg);const O5=Hg,dw=new Ie({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"});let br=class extends W{constructor(e){super(e),this.index=null,this.type=null,this.field=null,this.valueExpression=null,this.valueExpressionTitle=null,this.legendOptions=null}castField(e){return e==null?e:typeof e=="function"?(q.getLogger(this.declaredClass).error(".field: field must be a string value"),null):Mm(e)}get arcadeRequired(){return!!this.valueExpression}clone(){}getAttributeHash(){return`${this.type}-${this.field}-${this.valueExpression}`}};c([h()],br.prototype,"index",void 0),c([h({type:dw.apiValues,readOnly:!0,json:{read:dw.read,write:dw.write}})],br.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],br.prototype,"field",void 0),c([Oe("field")],br.prototype,"castField",null),c([h({type:String,json:{write:!0}})],br.prototype,"valueExpression",void 0),c([h({type:String,json:{write:!0}})],br.prototype,"valueExpressionTitle",void 0),c([h({readOnly:!0})],br.prototype,"arcadeRequired",null),c([h({type:O5,json:{write:!0}})],br.prototype,"legendOptions",void 0),br=c([S("esri.renderers.visualVariables.VisualVariable")],br);const qm=br;var n2;let Kl=n2=class extends qm{constructor(e){super(e),this.type="color",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(e){e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,i)=>t.value-i.value),this._set("stops",e)}clone(){return new n2({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(e=>e.clone()),legendOptions:this.legendOptions&&this.legendOptions.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};c([h({readOnly:!0})],Kl.prototype,"cache",null),c([h({type:["color"],json:{type:["colorInfo"]}})],Kl.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],Kl.prototype,"normalizationField",void 0),c([h({type:[BK],json:{write:!0}})],Kl.prototype,"stops",null),Kl=n2=c([S("esri.renderers.visualVariables.ColorVariable")],Kl);const R5=Kl;var o2;let ba=o2=class extends W{constructor(e){super(e),this.label=null,this.opacity=null,this.value=null}readOpacity(e,t){return em(t.transparency)}writeOpacity(e,t,i){t[i]=Rb(e)}clone(){return new o2({label:this.label,opacity:this.opacity,value:this.value})}};c([h({type:String,json:{write:!0}})],ba.prototype,"label",void 0),c([h({type:Number,json:{type:Ge,write:{target:"transparency"}}})],ba.prototype,"opacity",void 0),c([Q("opacity",["transparency"])],ba.prototype,"readOpacity",null),c([ie("opacity")],ba.prototype,"writeOpacity",null),c([h({type:Number,json:{write:!0}})],ba.prototype,"value",void 0),ba=o2=c([S("esri.renderers.visualVariables.support.OpacityStop")],ba);const Qte=ba;var a2;let ec=a2=class extends qm{constructor(e){super(e),this.type="opacity",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(e){e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,i)=>t.value-i.value),this._set("stops",e)}clone(){return new a2({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(e=>e.clone()),legendOptions:this.legendOptions&&this.legendOptions.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};c([h({readOnly:!0})],ec.prototype,"cache",null),c([h({type:["opacity"],json:{type:["transparencyInfo"]}})],ec.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],ec.prototype,"normalizationField",void 0),c([h({type:[Qte],json:{write:!0}})],ec.prototype,"stops",null),ec=a2=c([S("esri.renderers.visualVariables.OpacityVariable")],ec);const L5=ec;var l2;let io=l2=class extends qm{constructor(e){super(e),this.axis=null,this.type="rotation",this.rotationType="geographic",this.valueExpressionTitle=null}get cache(){return{hasExpression:!!this.valueExpression,compiledFunc:null}}writeValueExpressionTitleWebScene(e,t,i,s){if(s&&s.messages){const r=`visualVariables[${this.index}]`;s.messages.push(new L("property:unsupported",this.type+"VisualVariable.valueExpressionTitle is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:r+".valueExpressionTitle",context:s}))}}clone(){return new l2({axis:this.axis,rotationType:this.rotationType,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,legendOptions:this.legendOptions&&this.legendOptions.clone()})}};c([h({readOnly:!0})],io.prototype,"cache",null),c([h({type:["heading","tilt","roll"],json:{origins:{"web-scene":{default:"heading",write:!0}}}})],io.prototype,"axis",void 0),c([h({type:["rotation"],json:{type:["rotationInfo"]}})],io.prototype,"type",void 0),c([h({type:["geographic","arithmetic"],json:{write:!0,origins:{"web-document":{write:!0,default:"geographic"}}}})],io.prototype,"rotationType",void 0),c([h({type:String,json:{write:!0}})],io.prototype,"valueExpressionTitle",void 0),c([ie("web-scene","valueExpressionTitle")],io.prototype,"writeValueExpressionTitleWebScene",null),io=l2=c([S("esri.renderers.visualVariables.RotationVariable")],io);const F5=io;var c2;let Hu=c2=class extends W{constructor(e){super(e),this.label=null,this.size=null,this.value=null}clone(){return new c2({label:this.label,size:this.size,value:this.value})}};c([h({type:String,json:{write:!0}})],Hu.prototype,"label",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],Hu.prototype,"size",void 0),c([h({type:Number,json:{write:!0}})],Hu.prototype,"value",void 0),Hu=c2=c([S("esri.renderers.visualVariables.support.SizeStop")],Hu);const Yu=Hu;var u2;let Yg=u2=class extends O5{constructor(){super(...arguments),this.customValues=null}clone(){return new u2({title:this.title,showLegend:this.showLegend,customValues:this.customValues&&this.customValues.slice(0)})}};c([h({type:[Number],json:{write:!0}})],Yg.prototype,"customValues",void 0),Yg=u2=c([S("esri.renderers.visualVariables.support.SizeVariableLegendOptions")],Yg);const Kte=Yg;var ko,Zt;function Ga(e){return e&&e.declaredClass==="esri.renderers.visualVariables.SizeVariable"}function lm(e){return e!=null&&!isNaN(e)&&isFinite(e)}function D5(e){return e.valueExpression?ko.Expression:e.field&&typeof e.field=="string"?ko.Field:ko.Unknown}function eie(e,t){const i=t||D5(e),s=e.valueUnit||"unknown";return i===ko.Unknown?Zt.Constant:e.stops?Zt.Stops:e.minSize!=null&&e.maxSize!=null&&e.minDataValue!=null&&e.maxDataValue!=null?Zt.ClampedLinear:s==="unknown"?e.minSize!=null&&e.minDataValue!=null?e.minSize&&e.minDataValue?Zt.Proportional:Zt.Additive:Zt.Identity:Zt.RealWorldSize}(function(e){e.Unknown="unknown",e.Expression="expression",e.Field="field"})(ko||(ko={})),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"}(Zt||(Zt={}));const cl=q.getLogger("esri.renderers.visualVariables.support.visualVariableUtils"),zC=new Ci,Jg=Math.PI,N5=/^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i;function j5(e,t,i){const s="visualVariables"in e&&e.visualVariables?e.visualVariables.find(g=>g.type==="color"):e;if(!s)return;if(s.declaredClass!=="esri.renderers.visualVariables.ColorVariable")return void cl.warn("The visualVariable should be an instance of esri.renderers.visualVariables.ColorVariable");const r=typeof t=="number",n=r?null:t,o=n&&n.attributes;let a=r?t:null;const l=s.field,{ipData:u,hasExpression:d}=s.cache;let f=s.cache.compiledFunc;if(!l&&!d){const g=s.stops;return g&&g[0]&&g[0].color}if(typeof a!="number")if(d){if(N(i)||N(i.arcade))return void cl.error("Use of arcade expressions requires an arcade context");const g={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},v=i.arcade.arcadeUtils,b=v.getViewInfo(g),_=v.createExecContext(n,b);if(!f){const x=v.createSyntaxTree(s.valueExpression);f=v.createFunction(x),s.cache.compiledFunc=f}a=v.executeFunction(f,_)}else o&&(a=o[l]);const m=s.normalizationField,y=o!=null&&m!=null?parseFloat(o[m]):void 0;if(a!=null&&(!m||r||!isNaN(y)&&y!==0)){isNaN(y)||r||(a/=y);const g=CT(a,u);if(g){const v=g[0],b=g[1],_=v===b?s.stops[v].color:pe.blendColors(s.stops[v].color,s.stops[b].color,g[2],M(i)?i.color:void 0);return new pe(_)}}}function V5(e,t,i){const s="visualVariables"in e&&e.visualVariables?e.visualVariables.find(g=>g.type==="opacity"):e;if(!s)return;if(s.declaredClass!=="esri.renderers.visualVariables.OpacityVariable")return void cl.warn("The visualVariable should be an instance of esri.renderers.visualVariables.OpacityVariable");const r=typeof t=="number",n=r?null:t,o=n&&n.attributes;let a=r?t:null;const l=s.field,{ipData:u,hasExpression:d}=s.cache;let f=s.cache.compiledFunc;if(!l&&!d){const g=s.stops;return g&&g[0]&&g[0].opacity}if(typeof a!="number")if(d){if(N(i)||N(i.arcade))return void cl.error("Use of arcade expressions requires an arcade context");const g={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},v=i.arcade.arcadeUtils,b=v.getViewInfo(g),_=v.createExecContext(n,b);if(!f){const x=v.createSyntaxTree(s.valueExpression);f=v.createFunction(x),s.cache.compiledFunc=f}a=v.executeFunction(f,_)}else o&&(a=o[l]);const m=s.normalizationField,y=o!=null&&m!=null?parseFloat(o[m]):void 0;if(a!=null&&(!m||r||!isNaN(y)&&y!==0)){isNaN(y)||r||(a/=y);const g=CT(a,u);if(g){const v=g[0],b=g[1];if(v===b)return s.stops[v].opacity;{const _=s.stops[v].opacity;return _+(s.stops[b].opacity-_)*g[2]}}}}function z5(e,t,i){const s="visualVariables"in e&&e.visualVariables?e.visualVariables.find(y=>y.type==="rotation"):e;if(!s)return;if(s.declaredClass!=="esri.renderers.visualVariables.RotationVariable")return void cl.warn("The visualVariable should be an instance of esri.renderers.visualVariables.RotationVariable");const r=s.axis||"heading",n=r==="heading"&&s.rotationType==="arithmetic"?90:0,o=r==="heading"&&s.rotationType==="arithmetic"?-1:1,a=typeof t=="number"?null:t,l=a&&a.attributes,u=s.field,{hasExpression:d}=s.cache;let f=s.cache.compiledFunc,m=0;if(!u&&!d)return m;if(d){if(N(i)||N(i.arcade))return void cl.error("Use of arcade expressions requires an arcade context");const y={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},g=i.arcade.arcadeUtils,v=g.getViewInfo(y),b=g.createExecContext(a,v);if(!f){const _=g.createSyntaxTree(s.valueExpression);f=g.createFunction(_),s.cache.compiledFunc=f}m=g.executeFunction(f,b)}else l&&(m=l[u]||0);return m=typeof m!="number"||isNaN(m)?null:n+o*m,m}function tie(e,t,i){const s=typeof t=="number",r=s?null:t,n=r&&r.attributes;let o=s?t:null;const{isScaleDriven:a}=e.cache;let l=e.cache.compiledFunc;if(a){const d=M(i)?i.scale:void 0,f=M(i)?i.view:void 0;o=d==null||f==="3d"?iie(e):d}else if(!s)switch(e.inputValueType){case ko.Expression:{if(N(i)||N(i.arcade))return void cl.error("Use of arcade expressions requires an arcade context");const d={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},f=i.arcade.arcadeUtils,m=f.getViewInfo(d),y=f.createExecContext(r,m);if(!l){const g=f.createSyntaxTree(e.valueExpression);l=f.createFunction(g),e.cache.compiledFunc=l}o=f.executeFunction(l,y);break}case ko.Field:n&&(o=n[e.field]);break;case ko.Unknown:o=null}if(!lm(o))return null;if(s||!e.normalizationField)return o;const u=n?parseFloat(n[e.normalizationField]):null;return lm(u)&&u!==0?o/u:null}function iie(e){let t=null,i=null;const s=e.stops;return s?(t=s[0].value,i=s[s.length-1].value):(t=e.minDataValue||0,i=e.maxDataValue||0),(t+i)/2}function Yb(e,t,i){const s="visualVariables"in e&&e.visualVariables?e.visualVariables.find(n=>n.type==="size"):e;if(!s)return;if(s.declaredClass!=="esri.renderers.visualVariables.SizeVariable")return void cl.warn("The visualVariable should be an instance of esri.renderers.visualVariables.SizeVariable");const r=U5(tie(s,t,i),s,t,i,s.cache.ipData);return r==null||isNaN(r)?0:r}function os(e,t,i){return e==null?null:Ga(e)?Yb(e,t,i):lm(e)?e:null}function B5(e,t,i){return lm(i)&&e>i?i:lm(t)&&e=t.maxDataValue)return o;if(n==null||o==null)return null;if(t.scaleBy==="area"&&a){const l=a==="circle",u=l?Jg*(n/2)**2:n*n,d=u+r*((l?Jg*(o/2)**2:o*o)-u);return l?2*Math.sqrt(d/Jg):Math.sqrt(d)}return n+r*(o-n)}function oie(e,t,i,s){const r=M(s)?s.shape:void 0,n=e/t.minDataValue,o=os(t.minSize,i,s),a=os(t.maxSize,i,s);let l=null;return l=r==="circle"?2*Math.sqrt(n*(o/2)**2):r==="square"||r==="diamond"||r==="image"?Math.sqrt(n*o**2):n*o,B5(l,o,a)}function aie(e,t,i,s,r){var l,u,d;const[n,o,a]=CT(e,r);if(n===o)return os((l=t.stops)==null?void 0:l[n].size,i,s);{const f=os((u=t.stops)==null?void 0:u[n].size,i,s);return f+(os((d=t.stops)==null?void 0:d[o].size,i,s)-f)*a}}function lie(e,t,i,s){const r=(M(s)&&s.resolution?s.resolution:1)*aT[t.valueUnit],n=os(t.minSize,i,s),o=os(t.maxSize,i,s),{valueRepresentation:a}=t;let l=null;return l=a==="area"?2*Math.sqrt(e/Jg)/r:a==="radius"||a==="distance"?2*e/r:e/r,B5(l,n,o)}function U5(e,t,i,s,r){switch(t.transformationType){case Zt.Additive:return sie(e,t,i,s);case Zt.Constant:return rie(t,i,s);case Zt.ClampedLinear:return nie(e,t,i,s);case Zt.Proportional:return oie(e,t,i,s);case Zt.Stops:return aie(e,t,i,s,r);case Zt.RealWorldSize:return lie(e,t,i,s);case Zt.Identity:return e;case Zt.Unknown:return null}}function cie(e,t,i){const{isScaleDriven:s}=e.cache;if(!(s&&i==="3d"||t))return null;const r={scale:t,view:i};let n=os(e.minSize,zC,r),o=os(e.maxSize,zC,r);if(n!=null||o!=null){if(n>o){const a=o;o=n,n=a}return{minSize:n,maxSize:o}}}function uie(e,t,i){if(!e.visualVariables)return;const s=[],r=[],n=[],o=[],a=[];for(const l of e.visualVariables)switch(l.type){case"color":r.push(l);break;case"opacity":n.push(l);break;case"rotation":a.push(l);break;case"size":o.push(l)}return r.forEach(l=>{const u=j5(l,t,i);s.push({variable:l,value:u})}),n.forEach(l=>{const u=V5(l,t,i);s.push({variable:l,value:u})}),a.forEach(l=>{const u=z5(l,t,i);s.push({variable:l,value:u})}),o.forEach(l=>{const u=Yb(l,t,i);s.push({variable:l,value:u})}),s.filter(l=>l.value!=null)}function CT(e,t){if(!t)return;let i=0,s=t.length-1;return t.some((r,n)=>e!!t)).sort((t,i)=>t.value-i.value):e&&(q.getLogger(this.declaredClass).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),e=null),this._set("stops",e)}get transformationType(){return eie(this,this.inputValueType)}readValueExpression(e,t){return e||t.expression&&"$view.scale"}writeValueExpressionWebScene(e,t,i,s){if(e==="$view.scale"){if(s&&s.messages){const r=this.index,n=typeof r=="string"?r:`visualVariables[${r}]`;s.messages.push(new L("property:unsupported",this.type+"VisualVariable.valueExpression = '$view.scale' is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:n+".valueExpression",context:s}))}}else t[i]=e}readValueUnit(e){return e?d2.read(e):null}clone(){return new h2({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:Ga(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:Ga(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()})}flipSizes(){if(this.transformationType===Zt.ClampedLinear){const{minSize:e,maxSize:t}=this;return this.minSize=t,this.maxSize=e,this}if(this.transformationType===Zt.Stops){const e=this.stops;if(!e)return this;const t=e.map(s=>s.size).reverse(),i=e.length;for(let s=0;se.value||0)}};c([h({readOnly:!0})],De.prototype,"cache",null),c([h({type:Oy.apiValues,json:{type:Oy.jsonValues,origins:{"web-map":{read:!1}},read:Oy.read,write:Oy.write}})],De.prototype,"axis",void 0),c([h({type:String,value:null,json:{read:!1}})],De.prototype,"expression",null),c([h()],De.prototype,"index",null),c([h({type:String,readOnly:!0})],De.prototype,"inputValueType",null),c([h({type:Kte,json:{write:!0}})],De.prototype,"legendOptions",void 0),c([h({type:Number,value:null,json:{write:!0}})],De.prototype,"maxDataValue",null),c([h({type:Number,value:null,json:{write:!0}})],De.prototype,"maxSize",null),c([Oe("maxSize")],De.prototype,"castMaxSize",null),c([Q("maxSize")],De.prototype,"readMaxSize",null),c([h({type:Number,value:null,json:{write:!0}})],De.prototype,"minDataValue",null),c([h({type:Number,value:null,json:{write:!0}})],De.prototype,"minSize",null),c([Oe("minSize")],De.prototype,"castMinSize",null),c([Q("minSize")],De.prototype,"readMinSize",null),c([h({type:String,json:{write:!0}})],De.prototype,"normalizationField",void 0),c([h({readOnly:!0})],De.prototype,"arcadeRequired",null),c([h({type:String})],De.prototype,"scaleBy",void 0),c([h({type:[Yu],value:null,json:{write:!0}})],De.prototype,"stops",null),c([h({type:["outline"],json:{write:!0}})],De.prototype,"target",void 0),c([h({type:String,readOnly:!0})],De.prototype,"transformationType",null),c([h({type:["size"],json:{type:["sizeInfo"]}})],De.prototype,"type",void 0),c([h({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],De.prototype,"useSymbolValue",void 0),c([h({type:String,json:{write:!0}})],De.prototype,"valueExpression",void 0),c([Q("valueExpression",["valueExpression","expression"])],De.prototype,"readValueExpression",null),c([ie("web-scene","valueExpression")],De.prototype,"writeValueExpressionWebScene",null),c([h({type:["radius","diameter","area","width","distance"],json:{write:!0}})],De.prototype,"valueRepresentation",void 0),c([h({type:d2.apiValues,json:{write:d2.write,origins:{"web-map":{read:!1},"web-scene":{write:!0}}}})],De.prototype,"valueUnit",void 0),c([Q("valueUnit")],De.prototype,"readValueUnit",null),De=h2=c([S("esri.renderers.visualVariables.SizeVariable")],De);const Jb=De,die={color:R5,size:Jb,opacity:L5,rotation:F5},pie=new Ie({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"}),fie=/^\[([^\]]+)\]$/i;let Xg=class extends oe{constructor(){super(...arguments),this.colorVariables=null,this.opacityVariables=null,this.rotationVariables=null,this.sizeVariables=null}set visualVariables(e){if(this._resetVariables(),(e=e&&e.filter(t=>!!t))&&e.length){for(const t of e)switch(t.type){case"color":this.colorVariables.push(t);break;case"opacity":this.opacityVariables.push(t);break;case"rotation":this.rotationVariables.push(t);break;case"size":this.sizeVariables.push(t)}this.sizeVariables.length&&this.sizeVariables.some(t=>!!t.target)&&e.sort((t,i)=>{let s=null;return s=t.target===i.target?0:t.target?1:-1,s});for(let t=0;t{const l=pie.read(a.type),u=die[l];u||(q.getLogger(this.declaredClass).warn(`Unknown variable type: ${l}`),i&&i.messages&&i.messages.push(new Bi("visual-variable:unsupported",`visualVariable of type '${l}' is not supported`,{definition:a,context:i})));const d=new u;return d.read(a,i),d})}writeVariables(e,t){const i=[];for(const s of e){const r=s.toJSON(t);r&&i.push(r)}return i}_resetVariables(){this.colorVariables=[],this.opacityVariables=[],this.rotationVariables=[],this.sizeVariables=[]}};c([h()],Xg.prototype,"visualVariables",null),Xg=c([S("esri.renderers.visualVariables.VisualVariableFactory")],Xg);const mie=Xg,yie={base:qm,key:"type",typeMap:{opacity:L5,color:R5,rotation:F5,size:Jb}},_d=e=>{let t=class extends e{constructor(){super(...arguments),this._vvFactory=new mie}set visualVariables(i){this._vvFactory.visualVariables=i,this._set("visualVariables",this._vvFactory.visualVariables)}readVisualVariables(i,s,r){return this._vvFactory.readVariables(i,s,r)}writeVisualVariables(i,s,r,n){s[r]=this._vvFactory.writeVariables(i,n)}get arcadeRequiredForVisualVariables(){if(!this.visualVariables)return!1;for(const i of this.visualVariables)if(i.arcadeRequired)return!0;return!1}hasVisualVariables(i,s){return i?this.getVisualVariablesForType(i,s).length>0:this.getVisualVariablesForType("size",s).length>0||this.getVisualVariablesForType("color",s).length>0||this.getVisualVariablesForType("opacity",s).length>0||this.getVisualVariablesForType("rotation",s).length>0}getVisualVariablesForType(i,s){const r=this.visualVariables;return r?r.filter(n=>n.type===i&&(typeof s=="string"?n.target===s:s!==!1||!n.target)):[]}async collectVVRequiredFields(i,s){let r=[];this.visualVariables&&(r=r.concat(this.visualVariables));for(const n of r)n&&(n.field&&$s(i,s,n.field),n.normalizationField&&$s(i,s,n.normalizationField),n.valueExpression&&(gie(n.valueExpression,i,s)||await Ui(i,s,n.valueExpression)))}};return c([h({types:[yie],value:null,json:{write:!0}})],t.prototype,"visualVariables",null),c([Q("visualVariables",["visualVariables","rotationType","rotationExpression"])],t.prototype,"readVisualVariables",null),c([ie("visualVariables")],t.prototype,"writeVisualVariables",null),t=c([S("esri.renderers.mixins.VisualVariablesMixin")],t),t};function gie(e,t,i){const s=Xte(e);return!!M(s)&&($s(t,i,s),!0)}const zd={retainId:!1,ignoreDrivers:!1,hasLabelingContext:!0};function vie(e,t=zd){var a,l;if(!e)return{symbol:null};const{retainId:i=zd.retainId,ignoreDrivers:s=zd.ignoreDrivers,hasLabelingContext:r=zd.hasLabelingContext,retainCIM:n=zd.retainCIM}=t;let o=null;if(Jh(e)||e instanceof mu)o=e.clone();else if(e.type==="cim"){const u=(l=(a=e.data)==null?void 0:a.symbol)==null?void 0:l.type;if(u!=="CIMPointSymbol")return{error:new L("symbol-conversion:unsupported-cim-symbol",`CIM symbol of type '${u||"unknown"}' is unsupported in 3D`,{symbol:e})};o=n?e.clone():Ac.fromCIMSymbol(e)}else if(e instanceof tr)o=Db.fromSimpleLineSymbol(e);else if(e instanceof vl)o=Ac.fromSimpleMarkerSymbol(e);else if(e instanceof jb)o=Ac.fromPictureMarkerSymbol(e);else if(e instanceof gl)o=t.geometryType&&t.geometryType==="mesh"?Nb.fromSimpleFillSymbol(e):Bm.fromSimpleFillSymbol(e);else{if(!(e instanceof gd))return{error:new L("symbol-conversion:unsupported-2d-symbol",`2D symbol of type '${e.type||e.declaredClass}' is unsupported in 3D`,{symbol:e})};o=r?Fb.fromTextSymbol(e):Ac.fromTextSymbol(e)}if(i&&o&&o.type!=="cim"&&(o.id=e.id),s&&Jh(o))for(let u=0;ue==null||typeof e=="string"||typeof e=="number"?e:`${e}`,json:{type:String,write:{writer:(e,t)=>{t.value=e==null?void 0:e.toString()}}}};var p2;let _a=p2=class extends W{constructor(e){super(e),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}clone(){return new p2({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const e=JSON.stringify(this.symbol);return`${this.minValue}.${this.maxValue}.${e}`}};c([h({type:String,json:{write:!0}})],_a.prototype,"description",void 0),c([h({type:String,json:{write:!0}})],_a.prototype,"label",void 0),c([h({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],_a.prototype,"minValue",void 0),c([h({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],_a.prototype,"maxValue",void 0),c([h(wd)],_a.prototype,"symbol",void 0),_a=p2=c([S("esri.renderers.support.ClassBreakInfo")],_a);const Ev=_a;var f2;const W5="log",Qg="percent-of-total",Kg="field",Ry=new Ie({esriNormalizeByLog:W5,esriNormalizeByPercentOfTotal:Qg,esriNormalizeByField:Kg}),_ie=Dt(Ev);let jt=f2=class extends _d(zo){constructor(e){super(e),this._compiledValueExpression={valueExpression:null,compiledFunction:null},this.backgroundFillSymbol=null,this.classBreakInfos=null,this.defaultLabel=null,this.defaultSymbol=null,this.field=null,this.isMaxInclusive=!0,this.legendOptions=null,this.normalizationField=null,this.normalizationTotal=null,this.type="class-breaks",this.valueExpression=null,this.valueExpressionTitle=null,this._set("classBreakInfos",[])}readClassBreakInfos(e,t,i){if(!Array.isArray(e))return;let s=t.minValue;return e.map(r=>{const n=new Ev;return n.read(r,i),n.minValue==null&&(n.minValue=s),n.maxValue==null&&(n.maxValue=n.minValue),s=n.maxValue,n})}writeClassBreakInfos(e,t,i,s){const r=e.map(n=>n.write({},s));this._areClassBreaksConsecutive()&&r.forEach(n=>delete n.classMinValue),t[i]=r}castField(e){return e==null?e:typeof e=="function"?(q.getLogger(this.declaredClass).error(".field: field must be a string value"),null):Mm(e)}get minValue(){return this.classBreakInfos&&this.classBreakInfos[0]&&this.classBreakInfos[0].minValue||0}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,i=this.normalizationTotal!=null;return t||i?(e=t&&Kg||i&&Qg||null,t&&i&&q.getLogger(this.declaredClass).warn("warning: both normalizationField and normalizationTotal are set!")):e!==Kg&&e!==Qg||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}addClassBreakInfo(e,t,i){let s=null;s=typeof e=="number"?new Ev({minValue:e,maxValue:t,symbol:EN(i)}):_ie(R(e)),this.classBreakInfos.push(s),this.classBreakInfos.length===1&&this.notifyChange("minValue")}removeClassBreakInfo(e,t){const i=this.classBreakInfos.length;for(let s=0;s-1?this.classBreakInfos[i].symbol:this.defaultSymbol}async getSymbolAsync(e,t){let i=t;if(this.valueExpression&&(N(t)||N(t.arcade))){const r=await Do(),{arcadeUtils:n}=r;n.hasGeometryOperations(this.valueExpression)&&await n.enableGeometryOperations(),i={...i,arcade:r}}const s=this.getBreakIndex(e,i);return s>-1?this.classBreakInfos[s].symbol:this.defaultSymbol}getSymbols(){const e=[];return this.classBreakInfos.forEach(t=>{t.symbol&&e.push(t.symbol)}),this.defaultSymbol&&e.push(this.defaultSymbol),e}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((e,t)=>e+t.getAttributeHash(),"")}getMeshHash(){const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),i=`${this.normalizationField}.${this.normalizationType}.${this.normalizationTotal}`;return`${e}.${t}.${this.classBreakInfos.reduce((s,r)=>s+r.getMeshHash(),"")}.${i}.${this.field}.${this.valueExpression}`}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){return new f2({field:this.field,backgroundFillSymbol:this.backgroundFillSymbol&&this.backgroundFillSymbol.clone(),defaultLabel:this.defaultLabel,defaultSymbol:this.defaultSymbol&&this.defaultSymbol.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:R(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:R(this.visualVariables),legendOptions:R(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}async collectRequiredFields(e,t){const i=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(i)}async collectSymbolFields(e,t){const i=[...this.getSymbols().map(s=>s.collectRequiredFields(e,t)),Ui(e,t,this.valueExpression)];$s(e,t,this.field),$s(e,t,this.normalizationField),await Promise.all(i)}_getBreakIndexForExpression(e,t){const{viewingMode:i,scale:s,spatialReference:r,arcade:n}=FM(t,{}),{valueExpression:o}=this;let a=this._compiledValueExpression.valueExpression===o?this._compiledValueExpression.compiledFunction:null;const l=n.arcadeUtils;if(!a){const d=l.createSyntaxTree(o);a=l.createFunction(d),this._compiledValueExpression.compiledFunction=a}this._compiledValueExpression.valueExpression=o;const u=l.executeFunction(a,l.createExecContext(e,l.getViewInfo({viewingMode:i,scale:s,spatialReference:r})));return this._getBreakIndexfromInfos(u)}_getBreakIndexForField(e){const t=this.field,i=e.attributes,s=this.normalizationType;let r=parseFloat(i[t]);if(s){const n=this.normalizationTotal,o=parseFloat(this.normalizationField?i[this.normalizationField]:void 0);if(s===W5)r=Math.log(r)*Math.LOG10E;else if(s!==Qg||n==null||isNaN(n)){if(s===Kg&&!isNaN(o)){if(isNaN(r)||isNaN(o))return-1;r/=o}}else r=r/n*100}return this._getBreakIndexfromInfos(r)}_getBreakIndexfromInfos(e){const t=this.isMaxInclusive;if(e!=null&&typeof e=="number"&&!isNaN(e))for(let i=0;iYs(e),json:{write:!0}})],jt.prototype,"normalizationTotal",void 0),c([h({type:Ry.apiValues,value:null,json:{type:Ry.jsonValues,read:Ry.read,write:Ry.write}})],jt.prototype,"normalizationType",null),c([ue({classBreaks:"class-breaks"})],jt.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],jt.prototype,"valueExpression",void 0),c([h({type:String,json:{write:!0}})],jt.prototype,"valueExpressionTitle",void 0),jt=f2=c([S("esri.renderers.ClassBreaksRenderer")],jt);const H5=jt;class wie{constructor(t,i){this._storage=new QN,this._storage.maxSize=t,i&&this._storage.registerRemoveFunc("",i)}put(t,i,s){this._storage.put(t,i,s,1)}pop(t){return this._storage.pop(t)}get(t){return this._storage.get(t)}clear(){this._storage.clearAll()}destroy(){this._storage.destroy()}get maxSize(){return this._storage.maxSize}set maxSize(t){this._storage.maxSize=t}}const WC="esri.renderers.support.DictionaryLoader",xie={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};class AT{constructor(t,i,s){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new wie(100),this._dictionaryPromise=null,this.url=t,this.config=i,this.fieldMap=s}getSymbolFields(){return this._symbolFields}async getSymbolAsync(t,i){let s;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(i));try{s=await this._dictionaryPromise}catch(y){if(Ks(y))return this._dictionaryPromise=null,null}const r={};if(this.fieldMap)for(const y of this._symbolFields){const g=this.fieldMap[y];if(g&&t.attributes[g]!=null){const v=""+t.attributes[g];r[y]=v}else r[y]=""}const n=s==null?void 0:s(r,i);if(!n||typeof n!="string")return null;const o=NM(n).toString(),a=this._symbolCache.get(o);if(a)return a.catch(()=>{this._symbolCache.pop(o)}),a;const l=n.split(";"),u=[],d=[];for(const y of l)if(y)if(y.includes("po:")){const g=y.substr(3).split("|");if(g.length===3){const v=g[0],b=g[1];let _=g[2];if(b==="DashTemplate")_=_.split(" ").map(x=>Number(x));else if(b==="Color"){const x=new pe(_).toRgba();_=[x[0],x[1],x[2],255*x[3]]}else _=Number(_);d.push({primitiveName:v,propertyName:b,value:_})}}else if(y.includes("|")){for(const g of y.split("|"))if(this._itemNames.has(g)){u.push(g);break}}else this._itemNames.has(y)&&u.push(y);const f=!M(t.geometry)||!t.geometry.hasZ&&t.geometry.type==="point",m=this._cimPartsToCIMSymbol(u,d,f,i);return this._symbolCache.put(o,m,1),m}async fetchResources(t){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void q.getLogger(WC).error("no valid URL!");const i=kt(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:M(t)?t.signal:null}),[{data:s}]=await Promise.all([i,Do()]);if(!s)throw this._dictionaryPromise=null,new L("esri.renderers.DictionaryRenderer","Bad dictionary data!");const r=s.expression,n=s.authoringInfo;this._refSymbolUrlTemplate=this.url+"/"+s.cimRefTemplateUrl,this._itemNames=new Set(s.itemsNames),this._symbolFields=n.symbol;const o={};if(this.config){const u=this.config;for(const d in u)o[d]=u[d]}if(n.configuration)for(const u of n.configuration)o.hasOwnProperty(u.name)||(o[u.name]=u.value);const a=[];if(M(t)&&t.fields&&this.fieldMap)for(const u of this._symbolFields){const d=this.fieldMap[u],f=t.fields.filter(m=>m.name===d);f.length>0&&a.push({...f[0],name:u})}const l=xX(r,M(t)?t.spatialReference:null,a,o).then(u=>{const d={scale:0};return(f,m)=>{if(N(u))return null;const y=u.repurposeFeature({geometry:null,attributes:f});return d.scale=M(m)?m.scale:void 0,u.evaluate({$feature:y,$view:d})}}).catch(u=>(q.getLogger(WC).error("Creating dictinoary expression failed:",u),null));return this._dictionaryPromise=l,l}async _cimPartsToCIMSymbol(t,i,s,r){const n=new Array(t.length);for(let l=0;ln.data);const s=this._refSymbolUrlTemplate.replace(/\{itemName\}/gi,t),r=kt(s,{responseType:"json",query:{f:"json"},...i});this._ongoingRequests.set(t,r);try{return(await r).data}catch(n){throw this._ongoingRequests.delete(t),n}}_combineSymbolParts(t,i,s){if(!t||t.length===0)return null;const r={...t[0]};if(t.length>1){r.symbolLayers=[];for(const n of t){const o=n;r.symbolLayers.unshift(...o.symbolLayers)}}return s&&(r.callout=xie),{type:"CIMSymbolReference",symbol:r,primitiveOverrides:i}}}function Y5(e,t){if(!e)return;const i=e.symbolLayers;if(!i)return;let s=i.length;for(;s--;){const r=i[s];r&&r.enable!==!1&&r.type==="CIMVectorMarker"&&Sie(r,t)}}function Sie(e,t){const i=e.markerGraphics;if(i)for(const s of i){if(!s)continue;const r=s.symbol;if(r)switch(r.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":Y5(r,t);break;case"CIMTextSymbol":r.fieldMap=t}}}var I_e=Object.freeze(Object.defineProperty({__proto__:null,DictionaryLoader:AT},Symbol.toStringTag,{value:"Module"})),m2;let _r=m2=class extends _d(zo){constructor(e){super(e),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this.type="dictionary"}get _loader(){return new AT(this.url,this.config,this.fieldMap)}writeData(e,t){e&&(t.scalingExpressionInfo={expression:e,returnType:"number"})}writeVisualVariables(e,t,i,s){s!=null&&s.origin||super.writeVisualVariables(e,t,i,s)}clone(){return new m2({config:R(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:R(this.fieldMap),url:R(this.url),visualVariables:R(this.visualVariables)})}async getSymbolAsync(e,t){return this._loader.getSymbolAsync(e,t)}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t),this.scaleExpression&&await Ui(e,t,this.scaleExpression);for(const i in this.fieldMap){const s=this.fieldMap[i];t.has(s)&&e.add(s)}}get arcadeRequired(){return!0}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._loader.getSymbolFields()}};c([h({type:AT})],_r.prototype,"_loader",null),c([h({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],_r.prototype,"config",void 0),c([h({type:Object,json:{write:!0}})],_r.prototype,"fieldMap",void 0),c([h({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],_r.prototype,"scaleExpression",void 0),c([ie("scaleExpression")],_r.prototype,"writeData",null),c([h({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(e){return{enabled:!!e&&!!this.scaleExpression}}}}})],_r.prototype,"scaleExpressionTitle",void 0),c([h({type:String,json:{write:!0}})],_r.prototype,"url",void 0),c([ie("visualVariables")],_r.prototype,"writeVisualVariables",null),_r=m2=c([S("esri.renderers.DictionaryRenderer")],_r);const Mie=_r;var y2;let so=y2=class extends W{constructor(e){super(e),this.color=null,this.field=null,this.label=null,this.valueExpression=null,this.valueExpressionTitle=null}castField(e){return e==null?e:typeof e=="function"?(q.getLogger(this.declaredClass).error(".field: field must be a string value"),null):Mm(e)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){return new y2({color:this.color&&this.color.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};c([h({type:pe,json:{type:[Number],write:!0}})],so.prototype,"color",void 0),c([h({type:String,json:{write:!0}})],so.prototype,"field",void 0),c([Oe("field")],so.prototype,"castField",null),c([h({type:String,json:{write:!0}})],so.prototype,"label",void 0),c([h({type:String,json:{write:!0}})],so.prototype,"valueExpression",void 0),c([h({type:String,json:{write:!0}})],so.prototype,"valueExpressionTitle",void 0),so=y2=c([S("esri.renderers.support.AttributeColorInfo")],so);const J5=so;var g2;let e0=g2=class extends W{constructor(){super(...arguments),this.unit=null}clone(){return new g2({unit:this.unit})}};c([h({type:String,json:{write:!0}})],e0.prototype,"unit",void 0),e0=g2=c([S("esri.renderers.support.DotDensityLegendOptions")],e0);const $ie=e0;var v2;let Qi=v2=class extends _d(zo){constructor(e){super(e),this.attributes=null,this.backgroundColor=new pe([0,0,0,0]),this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new tr,this.dotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(e){if(this.referenceScale==null)return this.dotValue;const t=e/this.referenceScale*this.dotValue;return t<1?1:t}getSymbol(){return new gl({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){var e,t;return(t=(e=this.attributes)==null?void 0:e.reduce((i,s)=>i+s.getAttributeHash(),""))!=null?t:""}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new v2({attributes:R(this.attributes),backgroundColor:R(this.backgroundColor),dotBlendingEnabled:R(this.dotBlendingEnabled),dotShape:R(this.dotShape),dotSize:R(this.dotSize),dotValue:R(this.dotValue),legendOptions:R(this.legendOptions),outline:R(this.outline),referenceScale:R(this.referenceScale),visualVariables:R(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}getControllerHash(){var t;return`${(t=this.attributes)==null?void 0:t.map(i=>i.field||i.valueExpression||"")}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(e,t){var i;await this.collectVVRequiredFields(e,t);for(const s of(i=this.attributes)!=null?i:[])s.valueExpression&&await Ui(e,t,s.valueExpression),s.field&&e.add(s.field)}};c([h({type:[J5],json:{write:!0}})],Qi.prototype,"attributes",void 0),c([h({type:pe,json:{write:!0}})],Qi.prototype,"backgroundColor",void 0),c([h({type:Boolean,json:{write:!0}})],Qi.prototype,"dotBlendingEnabled",void 0),c([h({type:String,json:{write:!1}})],Qi.prototype,"dotShape",void 0),c([h({type:Number,json:{write:!0}})],Qi.prototype,"dotSize",void 0),c([h({type:$ie,json:{write:!0}})],Qi.prototype,"legendOptions",void 0),c([h({type:tr,json:{default:null,write:!0}})],Qi.prototype,"outline",void 0),c([h({type:Number,json:{write:!0}})],Qi.prototype,"dotValue",void 0),c([h({type:Number,json:{write:!0}})],Qi.prototype,"referenceScale",void 0),c([h({type:Number,json:{write:!0}})],Qi.prototype,"seed",void 0),c([ue({dotDensity:"dot-density"})],Qi.prototype,"type",void 0),Qi=v2=c([S("esri.renderers.DotDensityRenderer")],Qi);const Tie=Qi;let Ju=class extends xt(W){constructor(){super(...arguments),this.minLabel=null,this.maxLabel=null,this.title=null}};c([h({type:String,json:{write:!0}})],Ju.prototype,"minLabel",void 0),c([h({type:String,json:{write:!0}})],Ju.prototype,"maxLabel",void 0),c([h({type:String,json:{write:!0}})],Ju.prototype,"title",void 0),Ju=c([S("esri.renderers.support.HeatmapLegendOptions")],Ju);function Xb(){return[0,0,0,0]}function Iie(e){return[e[0],e[1],e[2],e[3]]}function xd(e,t,i,s){return[e,t,i,s]}function Eie(e){const t=Xb(),i=Math.min(4,e.length);for(let s=0;sa>=0&&a<=1).sort((a,l)=>a.ratio-l.ratio).map(({color:a,ratio:l})=>({color:a,ratio:Math.max(l,.001)})),e.length<1)return i;let s=e[0],r=e[0],n=1;const o=Xb();for(let a=0;a<512;a++){const l=(a+.5)/512;for(;l>r.ratio&&n=i+_||b.y<-_||b.y>s+_)continue;const x=+f(g),$=Math.max(0,Math.round(b.x)-a),I=Math.max(0,Math.round(b.y)-a),T=Math.min(s,Math.round(b.y)+a),k=Math.min(i,Math.round(b.x)+a);for(let A=I;Ad&&(d=u)}}}return{matrix:l.buffer,max:d}}function C_e(e,t,i,s,r,n){e.canvas.width=e.canvas.height=t,e.clearRect(0,0,t,t);const o=e.getImageData(0,0,t,t);i&&s&&o.data.set(new Uint8ClampedArray(jie(t,i,s,r,n))),e.putImageData(o,0,0)}function jie(e,t,i,s,r){const n=new Uint32Array(e*e),o="buffer"in t?t:new Float64Array(t),a="buffer"in i?new Uint32Array(i.buffer):new Uint32Array(new Uint8Array(i).buffer),l=a.length/(r-s);for(let u=0;u1?0:3/(Math.PI*i**2)*(1-s**2)**2}function P_e(e,t){return typeof e=="function"?e:e?typeof t=="string"?i=>-1*+i[e]:i=>+i[e]+t:()=>1}function zie(e,t){return e!=null?typeof t=="string"?i=>-1*+i.readAttribute(e):i=>+i.readAttribute(e)+t:i=>1}var b2;const i4="esri.renderers.HeatmapRenderer",Bie=q.getLogger(i4);function HC(e){if(e!=null){const{maxDensity:t,minDensity:i,radius:s}=e;if(t!=null||i!=null||s!=null){const{blurRadius:r,maxPixelIntensity:n,minPixelIntensity:o,...a}=e;return a}}return e}let Jt=b2=class extends zo{constructor(e){super(e),this.authoringInfo=null,this.colorStops=[new _f({ratio:0,color:new pe("rgba(255, 140, 0, 0)")}),new _f({ratio:.75,color:new pe("rgba(255, 140, 0, 1)")}),new _f({ratio:.9,color:new pe("rgba(255, 0, 0, 1)")})],this.field=null,this.fieldOffset=0,this.legendOptions=null,this.maxDensity=.04,this.minDensity=0,this.radius=18,this.referenceScale=0,this.type="heatmap",this.valueExpression=null,this.valueExpressionTitle=null,this._warnedProps={blurRadius:!1,maxPixelIntensity:!1,minPixelIntensity:!1}}normalizeCtorArgs(e){return HC(e)}get blurRadius(){return Die(this.radius)}set blurRadius(e){const t=this.maxPixelIntensity,i=this.minPixelIntensity;this._set("radius",Fie(e)),this._warnAboutDeprecatedGaussianBlurProp("blurRadius","radius"),this._set("maxDensity",t*this._pixelIntensityToDensity),this._set("minDensity",i*this._pixelIntensityToDensity)}get maxPixelIntensity(){return this.maxDensity/this._pixelIntensityToDensity}set maxPixelIntensity(e){this._set("maxDensity",e*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("maxPixelIntensity","maxDensity")}get minPixelIntensity(){return this.minDensity/this._pixelIntensityToDensity}set minPixelIntensity(e){this._set("minDensity",e*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("minPixelIntensity","minDensity")}get _pixelIntensityToDensity(){return 24/(OT**2*this.blurRadius**4)}_warnAboutDeprecatedGaussianBlurProp(e,t){this._warnedProps[e]||ki(this).getDefaultOrigin()==="user"&&(this._warnedProps[e]=!0,ad(()=>{dz(Bie,e,{replacement:`${String(t)} (suggested value: ${this._get(t)})`,version:"4.24"})}))}read(e,t){e=HC(e),super.read(e,t)}getSymbol(){return new vl}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}async collectRequiredFields(e,t){const i=this.field,s=this.valueExpression;i&&typeof i=="string"&&await $s(e,t,i),s&&typeof s=="string"&&await Ui(e,t,s)}getAttributeHash(){return null}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new b2({authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),colorStops:R(this.colorStops),field:this.field,legendOptions:R(this.legendOptions),maxDensity:this.maxDensity,minDensity:this.minDensity,radius:this.radius,referenceScale:this.referenceScale,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};c([h({type:kT,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],Jt.prototype,"authoringInfo",void 0),c([h({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],Jt.prototype,"blurRadius",null),c([h({type:[_f],json:{write:!0}})],Jt.prototype,"colorStops",void 0),c([h({type:String,json:{write:!0}})],Jt.prototype,"field",void 0),c([h({type:Number,json:{write:{overridePolicy:(e,t,i)=>({enabled:i==null})},origins:{"web-scene":{write:!1}}}})],Jt.prototype,"fieldOffset",void 0),c([h({type:Ju,json:{write:!0}})],Jt.prototype,"legendOptions",void 0),c([h({type:Number,json:{write:!0}})],Jt.prototype,"maxDensity",void 0),c([h({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],Jt.prototype,"maxPixelIntensity",null),c([h({type:Number,json:{write:!0}})],Jt.prototype,"minDensity",void 0),c([h({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],Jt.prototype,"minPixelIntensity",null),c([h({type:Number,cast:Fe,json:{write:!0}})],Jt.prototype,"radius",void 0),c([h({type:Number,range:{min:0},json:{default:0,write:!0}})],Jt.prototype,"referenceScale",void 0),c([ue({heatmap:"heatmap"})],Jt.prototype,"type",void 0),c([h({type:String,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],Jt.prototype,"valueExpression",void 0),c([h({type:String})],Jt.prototype,"valueExpressionTitle",void 0),c([h({readOnly:!0})],Jt.prototype,"_pixelIntensityToDensity",null),Jt=b2=c([S(i4)],Jt);const s4=Jt;let wc=class extends xt(W){constructor(){super(...arguments),this.color=new pe([0,0,0,0]),this.label=null,this.threshold=0}};c([h({type:pe,json:{write:!0}})],wc.prototype,"color",void 0),c([h({type:String,json:{write:!0}})],wc.prototype,"label",void 0),c([h({type:Number,range:{min:0,max:1},json:{write:!0}})],wc.prototype,"threshold",void 0),wc=c([S("esri.renderers.support.OthersCategory")],wc);let t0=class extends xt(W){constructor(){super(...arguments),this.title=null}};c([h({type:String,json:{write:!0}})],t0.prototype,"title",void 0),t0=c([S("esri.renderers.support.PieChartLegendOptions")],t0);let ms=class extends _d(xt(zo)){constructor(e){super(e),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new pe([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new wc,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart"}getSymbol(){var e;return new vl({size:this.size?this.size/2+(((e=this.outline)==null?void 0:e.width)||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(M)}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((e,t)=>e+t.getAttributeHash(),"")}getMeshHash(){return this.getSymbols().reduce((e,t)=>e+JSON.stringify(t),"")}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t);for(const i of this.attributes)i.valueExpression&&await Ui(e,t,i.valueExpression),i.field&&e.add(i.field)}};c([h({type:[J5],json:{write:!0}})],ms.prototype,"attributes",void 0),c([h({type:gl,json:{default:null,write:!0}})],ms.prototype,"backgroundFillSymbol",void 0),c([h({type:pe,json:{write:!0}})],ms.prototype,"defaultColor",void 0),c([h({type:String,json:{write:!0}})],ms.prototype,"defaultLabel",void 0),c([h({type:Number,range:{min:0,max:1},json:{write:!0}})],ms.prototype,"holePercentage",void 0),c([h({type:wc,json:{write:!0}})],ms.prototype,"othersCategory",void 0),c([h({type:t0,json:{write:!0}})],ms.prototype,"legendOptions",void 0),c([h({type:tr,json:{default:null,write:!0}})],ms.prototype,"outline",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],ms.prototype,"size",void 0),c([ue({pieChart:"pie-chart"})],ms.prototype,"type",void 0),ms=c([S("esri.renderers.PieChartRenderer")],ms);const Uie=ms;var _2;let tc=_2=class extends _d(zo){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 _2({description:this.description,label:this.label,symbol:this.symbol&&this.symbol.clone(),visualVariables:R(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}};c([h({type:String,json:{write:!0}})],tc.prototype,"description",void 0),c([h({type:String,json:{write:!0}})],tc.prototype,"label",void 0),c([h(wd)],tc.prototype,"symbol",void 0),c([ue({simple:"simple"})],tc.prototype,"type",void 0),tc=_2=c([S("esri.renderers.SimpleRenderer")],tc);const Xh=tc,qie=["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"];function w2(e){return e instanceof oe}function YC(e){return e instanceof he?Object.keys(e.items):w2(e)?ki(e).keys():e?Object.keys(e):[]}function Ly(e,t){return e instanceof he?e.items[t]:e[t]}function Gie(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}function Sf(e){return e?e.declaredClass:null}function r4(e,t){const i=e.diff;if(i&&typeof i=="function")return i(e,t);const s=YC(e),r=YC(t);if(s.length===0&&r.length===0)return;if(!s.length||!r.length||Gie(e,t))return{type:"complete",oldValue:e,newValue:t};const n=r.filter(f=>!s.includes(f)),o=s.filter(f=>!r.includes(f)),a=s.filter(f=>r.includes(f)&&Ly(e,f)!==Ly(t,f)).concat(n,o).sort(),l=Sf(e);if(l&&qie.includes(l)&&a.length)return{type:"complete",oldValue:e,newValue:t};let u;const d=w2(e)&&w2(t);for(const f of a){const m=Ly(e,f),y=Ly(t,f);let g;if((d||typeof m!="function"&&typeof y!="function")&&m!==y&&(m!=null||y!=null)){if(i&&i[f]&&typeof i[f]=="function")g=i[f](m,y);else if(m instanceof Date&&y instanceof Date){if(m.getTime()===y.getTime())continue;g={type:"complete",oldValue:m,newValue:y}}else g=typeof m=="object"&&typeof y=="object"&&Sf(m)===Sf(y)?r4(m,y):{type:"complete",oldValue:m,newValue:y};M(g)&&(M(u)?u.diff[f]=g:u={type:"partial",diff:{[f]:g}})}}return u}function Wie(e,t){if(N(e))return!1;const i=t.split(".");let s=e;for(const r of i){if(s.type==="complete")return!0;if(s.type!=="partial")return!1;{const n=s.diff[r];if(!n)return!1;s=n}}return!0}function A_e(e,t){for(const i of t)if(Wie(e,i))return!0;return!1}function Hie(e,t){if(!(typeof e=="function"||typeof t=="function"||N(e)&&N(t)))return N(e)||N(t)||typeof e=="object"&&typeof t=="object"&&Sf(e)!==Sf(t)?{type:"complete",oldValue:e,newValue:t}:r4(e,t)}let Xu=class extends xt(W){constructor(e){super(e),this.value=null,this.value2=null,this.value3=null}};c([h(Zg)],Xu.prototype,"value",void 0),c([h(Zg)],Xu.prototype,"value2",void 0),c([h(Zg)],Xu.prototype,"value3",void 0),Xu=c([S("esri.renderers.support.UniqueValue")],Xu);const Rh=Xu;let wa=class extends xt(W){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.values=null}castValues(e){if(e==null)return null;const t=typeof(e=Array.isArray(e)?e:[e])[0];return t==="string"||t==="number"?e.map(i=>new Rh({value:i})):t==="object"?e[0]instanceof Rh?e:e.map(i=>new Rh(i)):null}};c([h({type:String,json:{write:!0}})],wa.prototype,"description",void 0),c([h({type:String,json:{write:!0}})],wa.prototype,"label",void 0),c([h(wd)],wa.prototype,"symbol",void 0),c([h({type:[Rh],json:{type:[[String]],read:{reader:e=>e?e.map(t=>new Rh({value:t[0],value2:t[1],value3:t[2]})):null},write:{writer:(e,t)=>{const i=[];for(const s of e){const r=[s.value,s.value2,s.value3].filter(M).map(n=>n.toString());i.push(r)}t.values=i}}}})],wa.prototype,"values",void 0),c([Oe("values")],wa.prototype,"castValues",null),wa=c([S("esri.renderers.support.UniqueValueClass")],wa);const n4=wa;let Np=class extends xt(W){constructor(e){super(e),this.heading=null,this.classes=null}};c([h({type:String,json:{write:!0}})],Np.prototype,"heading",void 0),c([h({type:[n4],json:{write:!0}})],Np.prototype,"classes",void 0),Np=c([S("esri.renderers.support.UniqueValueGroup")],Np);const x2=Np;var S2;let ic=S2=class extends W{constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.value=null}clone(){return new S2({value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const e=JSON.stringify(this.symbol&&this.symbol.toJSON());return`${this.value}.${e}`}};c([h({type:String,json:{write:!0}})],ic.prototype,"description",void 0),c([h({type:String,json:{write:!0}})],ic.prototype,"label",void 0),c([h(wd)],ic.prototype,"symbol",void 0),c([h(Zg)],ic.prototype,"value",void 0),ic=S2=c([S("esri.renderers.support.UniqueValueInfo")],ic);const Mf=ic,Yie=()=>!!V("enable-feature:force-wosr"),O_e=()=>!!V("enable-feature:SceneLayer-editing"),pw={};async function Jie(e,t){try{return{data:(await Kie(e,t)).data,baseUrl:Uz(e),styleUrl:e}}catch(i){return Em(i),null}}function Xie(e,t,i){const s=M(t.portal)?t.portal:cs.getDefault();let r;const n=`${s.url} - ${s.user&&s.user.username} - ${e}`;return pw[n]||(pw[n]=Zie(e,s,i).then(o=>(r=o,o.fetchData())).then(o=>{var a;return{data:o,baseUrl:(a=r.itemUrl)!=null?a:"",styleName:e}})),pw[n]}function Zie(e,t,i){return t.load(i).then(()=>{const s=new wo({disableExtraQuery:!0,query:`owner:${JC} AND type:${XC} AND typekeywords:"${e}"`});return t.queryItems(s,i)}).then(({results:s})=>{var o;let r=null;const n=e.toLowerCase();if(s&&Array.isArray(s)){for(const a of s)if(((o=a.typeKeywords)==null?void 0:o.some(u=>u.toLowerCase()===n))&&a.type===XC&&a.owner===JC){r=a;break}}if(!r)throw new L("symbolstyleutils:style-not-found",`The style '${e}' could not be found`,{styleName:e});return r.load(i)})}function Qie(e,t,i){return e&&M(e.styleUrl)?Jie(e.styleUrl,i):e&&M(e.styleName)?Xie(e.styleName,t,i):Promise.reject(new L("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function R_e(e){return e===null||e.type==="CIMSymbolReference"?e:{type:"CIMSymbolReference",symbol:e}}function L_e(e,t){if(t==="cimRef")return e.cimRef;if(e.formatInfos&&!Yie()){for(const i of e.formatInfos)if(i.type==="gltf")return i.href}return e.webRef}function Kie(e,t){const i={responseType:"json",query:{f:"json"},...t};return kt(Zs(e),i)}const JC="esri_en",XC="Style",F_e="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json";var jp;const o4="esri.renderers.UniqueValueRenderer",Qo=q.getLogger(o4),ZC="uvInfos-watcher",QC="uvGroups-watcher",ese=",",tse=Dt(Mf);function ise(e){const{field1:t,field2:i,field3:s,fieldDelimiter:r,uniqueValueInfos:n,valueExpression:o}=e,a=!(!t||!i);return[{classes:(n!=null?n:[]).map(l=>{var _;const{symbol:u,label:d,value:f,description:m}=l,[y,g,v]=a?((_=f==null?void 0:f.toString())==null?void 0:_.split(r||""))||[]:[f],b=[];return(t||o)&&b.push(y),i&&b.push(g),s&&b.push(v),{symbol:u,label:d,values:[b],description:m}})}]}let pt=jp=class extends _d(zo){constructor(e){super(e),this._valueInfoMap={},this._isDefaultSymbolDerived=!1,this._isInfosSource=null,this.type="unique-value",this.backgroundFillSymbol=null,this.valueExpressionTitle=null,this.legendOptions=null,this.defaultLabel=null,this.portal=null,this.styleOrigin=null,this.diff={uniqueValueInfos(t,i){if(!t&&!i)return;if(!t||!i)return{type:"complete",oldValue:t,newValue:i};let s=!1;const r={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let n=0;na.value===i[n].value);o?Hie(o,i[n])?(r.changed.push({type:"complete",oldValue:o,newValue:i[n]}),s=!0):r.unchanged.push({oldValue:o,newValue:i[n]}):(r.added.push(i[n]),s=!0)}for(let n=0;no.value===t[n].value)||(r.removed.push(t[n]),s=!0);return s?r:void 0}},this._set("uniqueValueInfos",[]),this._set("uniqueValueGroups",[])}get _cache(){return{compiledFunc:null}}set field(e){this._set("field",e),this._updateFieldDelimiter(),this._updateUniqueValues()}castField(e){return e==null||typeof e=="function"?e:Mm(e)}writeField(e,t,i,s){typeof e=="string"?t[i]=e:s&&s.messages?s.messages.push(new L("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):Qo.error(".field: cannot write field to JSON since it's not a string value")}set field2(e){this._set("field2",e),this._updateFieldDelimiter(),this._updateUniqueValues()}set field3(e){this._set("field3",e),this._updateUniqueValues()}set valueExpression(e){this._set("valueExpression",e),this._updateUniqueValues()}set defaultSymbol(e){this._isDefaultSymbolDerived=!1,this._set("defaultSymbol",e)}set fieldDelimiter(e){this._set("fieldDelimiter",e),this._updateUniqueValues()}readPortal(e,t,i){return i.portal||cs.getDefault()}readStyleOrigin(e,t,i){if(t.styleName)return Object.freeze({styleName:t.styleName});if(t.styleUrl){const s=fd(t.styleUrl,i);return Object.freeze({styleUrl:s})}}writeStyleOrigin(e,t,i,s){e.styleName?t.styleName=e.styleName:e.styleUrl&&(t.styleUrl=Vm(e.styleUrl,s))}set uniqueValueGroups(e){this.styleOrigin?Qo.error("#uniqueValueGroups=","Cannot modify unique value groups of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueGroups",e),this._updateInfosFromGroups(),this._isInfosSource=!1,this._watchUniqueValueGroups())}set uniqueValueInfos(e){this.styleOrigin?Qo.error("#uniqueValueInfos=","Cannot modify unique value infos of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos())}addUniqueValueInfo(e,t){var s;if(this.styleOrigin)return void Qo.error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let i;i=typeof e=="object"?tse(e):new Mf({value:e,symbol:EN(t)}),(s=this.uniqueValueInfos)==null||s.push(i),this._valueInfoMap[i.value]=i,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(e){if(this.styleOrigin)return void Qo.error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const t=this.uniqueValueInfos;if(t){for(let i=0;ie+t.getAttributeHash(),"")}getMeshHash(){var s;const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),i=(s=this.uniqueValueInfos)==null?void 0:s.reduce((r,n)=>r+n.getMeshHash(),"");return`${e}.${t}.${i}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`}clone(){const e=new jp({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:R(this.defaultSymbol),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:R(this.visualVariables),legendOptions:R(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),backgroundFillSymbol:R(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(e._isDefaultSymbolDerived=!0),e._set("portal",this.portal);const t=R(this.uniqueValueInfos),i=R(this.uniqueValueGroups);return this.styleOrigin&&(e._set("styleOrigin",Object.freeze(R(this.styleOrigin))),Object.freeze(t),Object.freeze(i)),e._set("uniqueValueInfos",t),e._updateValueInfoMap(),e._set("uniqueValueGroups",i),e._isInfosSource=this._isInfosSource,e._watchUniqueValueInfosAndGroups(),e}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}async collectRequiredFields(e,t){const i=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(i)}async collectSymbolFields(e,t){const i=[...this.getSymbols().map(s=>s.collectRequiredFields(e,t)),Ui(e,t,this.valueExpression)];$s(e,t,this.field),$s(e,t,this.field2),$s(e,t,this.field3),await Promise.all(i)}populateFromStyle(){return Qie(this.styleOrigin,{portal:this.portal}).then(e=>{var i;const t=[];return this._valueInfoMap={},e&&e.data&&Array.isArray(e.data.items)&&e.data.items.forEach(s=>{const r=new mu({styleUrl:e.styleUrl,styleName:e.styleName,portal:this.portal,name:s.name});this.defaultSymbol||s.name!==e.data.defaultItem||(this.defaultSymbol=r,this._isDefaultSymbolDerived=!0);const n=new Mf({value:s.name,symbol:r});t.push(n),this._valueInfoMap[s.name]=n}),this._set("uniqueValueInfos",Object.freeze(t)),this._updateGroupsFromInfos(!0),this._isInfosSource=null,this._watchUniqueValueInfos(),!this.defaultSymbol&&((i=this.uniqueValueInfos)==null?void 0:i.length)&&(this.defaultSymbol=this.uniqueValueInfos[0].symbol,this._isDefaultSymbolDerived=!0),this})}_updateFieldDelimiter(){this.field&&this.field2&&!this.fieldDelimiter&&this._set("fieldDelimiter",ese)}_updateUniqueValues(){this._isInfosSource!=null&&(this._isInfosSource?this._updateGroupsFromInfos():this._updateInfosFromGroups())}_updateValueInfoMap(){this._valueInfoMap={};const{uniqueValueInfos:e}=this;if(e)for(const t of e)this._valueInfoMap[t.value+""]=t}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(ZC);const{uniqueValueInfos:e}=this;if(e){const t=[];for(const i of e)t.push(Z(()=>({symbol:i.symbol,value:i.value,label:i.label,description:i.description}),(s,r)=>{s!==r&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)},{sync:!0}));this.addHandles(t,ZC)}}_watchUniqueValueGroups(){this.removeHandles(QC);const{uniqueValueGroups:e}=this;if(e){const t=[];for(const i of e){t.push(Z(()=>({classes:i.classes}),(s,r)=>{s!==r&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}));for(const s of i.classes)t.push(Z(()=>({symbol:s.symbol,values:s.values,label:s.label,description:s.description}),(r,n)=>{r!==n&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}))}this.addHandles(t,QC)}}_updateInfosFromGroups(){var l;if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const e=[],{field:t,field2:i,field3:s,fieldDelimiter:r,uniqueValueGroups:n,valueExpression:o}=this;if(!t&&!o)return this._set("uniqueValueInfos",e),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const a=!(!t||!i);for(const u of n)for(const d of(l=u.classes)!=null?l:[]){const{symbol:f,label:m,values:y,description:g}=d;for(const v of y!=null?y:[]){const{value:b,value2:_,value3:x}=v,$=[b];i&&$.push(_),s&&$.push(x);const I=a?$.join(r||""):$[0];e.push(new Mf({symbol:f,label:m,value:I,description:g}))}}this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._watchUniqueValueInfos()}_updateGroupsFromInfos(e=!1){if(!this.uniqueValueInfos)return this._set("uniqueValueGroups",null),void this._watchUniqueValueGroups();const{field:t,field2:i,valueExpression:s,fieldDelimiter:r,uniqueValueInfos:n}=this;if(!t&&!s||!n.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const o=!(!t||!i),a=n.map(u=>{var _;const{symbol:d,label:f,value:m,description:y}=u,[g,v,b]=o?((_=m==null?void 0:m.toString())==null?void 0:_.split(r||""))||[]:[m];return new n4({symbol:d,label:f,description:y,values:[new Rh({value:g,value2:v,value3:b})]})}),l=[new x2({classes:a})];e&&Object.freeze(l),this._set("uniqueValueGroups",l),this._watchUniqueValueGroups()}_getUniqueValueInfo(e,t){return this.valueExpression?this._getUnqiueValueInfoForExpression(e,t):this._getUnqiueValueInfoForFields(e)}_getUnqiueValueInfoForExpression(e,t){const{viewingMode:i,scale:s,spatialReference:r,arcade:n}=FM(t,{});let o=this._cache.compiledFunc;const a=n.arcadeUtils;if(!o){const u=a.createSyntaxTree(this.valueExpression);o=a.createFunction(u),this._cache.compiledFunc=o}const l=a.executeFunction(o,a.createExecContext(e,a.getViewInfo({viewingMode:i,scale:s,spatialReference:r})));return this._valueInfoMap[l+""]}_getUnqiueValueInfoForFields(e){const t=this.field,i=e.attributes;let s;if(typeof t!="function"&&this.field2){const r=this.field2,n=this.field3,o=[];t&&o.push(i[t]),r&&o.push(i[r]),n&&o.push(i[n]),s=o.join(this.fieldDelimiter||"")}else typeof t=="function"?s=t(e):t&&(s=i[t]);return this._valueInfoMap[s+""]}static fromPortalStyle(e,t){const i=new jp(t&&t.properties);i._set("styleOrigin",Object.freeze({styleName:e})),i._set("portal",t&&t.portal||cs.getDefault());const s=i.populateFromStyle();return s.catch(r=>{Qo.error(`#fromPortalStyle('${e}'[, ...])`,"Failed to create unique value renderer from style name",r)}),s}static fromStyleUrl(e,t){const i=new jp(t&&t.properties);i._set("styleOrigin",Object.freeze({styleUrl:e}));const s=i.populateFromStyle();return s.catch(r=>{Qo.error(`#fromStyleUrl('${e}'[, ...])`,"Failed to create unique value renderer from style URL",r)}),s}};c([h({readOnly:!0})],pt.prototype,"_cache",null),c([ue({uniqueValue:"unique-value"})],pt.prototype,"type",void 0),c([h(G5)],pt.prototype,"backgroundFillSymbol",void 0),c([h({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],pt.prototype,"field",null),c([Oe("field")],pt.prototype,"castField",null),c([ie("field")],pt.prototype,"writeField",null),c([h({type:String,value:null,json:{write:!0}})],pt.prototype,"field2",null),c([h({type:String,value:null,json:{write:!0}})],pt.prototype,"field3",null),c([h({type:String,value:null,json:{write:!0}})],pt.prototype,"valueExpression",null),c([h({type:String,json:{write:!0}})],pt.prototype,"valueExpressionTitle",void 0),c([h({type:Oh,json:{write:!0}})],pt.prototype,"legendOptions",void 0),c([h({type:String,json:{write:!0}})],pt.prototype,"defaultLabel",void 0),c([h(k3({...wd},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],pt.prototype,"defaultSymbol",null),c([h({type:String,value:null,json:{write:!0}})],pt.prototype,"fieldDelimiter",null),c([h({type:cs,readOnly:!0})],pt.prototype,"portal",void 0),c([Q("portal",["styleName"])],pt.prototype,"readPortal",null),c([h({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],pt.prototype,"styleOrigin",void 0),c([Q("styleOrigin",["styleName","styleUrl"])],pt.prototype,"readStyleOrigin",null),c([ie("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],pt.prototype,"writeStyleOrigin",null),c([h({type:[x2],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(e,t,i)=>(t.uniqueValueGroups||ise(t)).map(s=>x2.fromJSON(s,i))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],pt.prototype,"uniqueValueGroups",null),c([h({type:[Mf],json:{read:!1,write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],pt.prototype,"uniqueValueInfos",null),pt=jp=c([S(o4)],pt);const Gm=pt,Zb={key:"type",base:zo,typeMap:{heatmap:s4,simple:Xh,"unique-value":Gm,"class-breaks":H5,"dot-density":Tie,dictionary:Mie,"pie-chart":Uie},errorContext:"renderer"},sse={key:"type",base:zo,typeMap:{simple:Xh,"unique-value":Gm,"class-breaks":H5,heatmap:s4},errorContext:"renderer"};function D_e(e,t){return cm(e,null,t)}const rse=dl({types:Zb});function cm(e,t,i){return e?e&&(e.styleName||e.styleUrl)&&e.type!=="uniqueValue"?(i&&i.messages&&i.messages.push(new Bi("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:i})),null):rse(e,t,i):null}class RT{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(I1),this._values=new Map,this.multipleOriginsSupported=!0}clone(t){const i=new RT,s=this._originStores[Pe.DEFAULTS];s&&s.forEach((r,n)=>{i.set(n,R(r),Pe.DEFAULTS)});for(let r=Pe.SERVICE;r{t&&t.has(a)||i.set(a,R(o),r)})}return i}get(t,i){const s=i===void 0?this._values:this._originStores[i];return s?s.get(t):void 0}keys(t){const i=t==null?this._values:this._originStores[t];return i?[...i.keys()]:[]}set(t,i,s=Pe.USER){let r=this._originStores[s];if(r||(r=new Map,this._originStores[s]=r),r.set(t,i),!this._values.has(t)||this._propertyOriginMap.get(t)<=s){const n=this._values.get(t);return this._values.set(t,i),this._propertyOriginMap.set(t,s),n!==i}return!1}delete(t,i=Pe.USER){const s=this._originStores[i];if(!s)return;const r=s.get(t);if(s.delete(t),this._values.has(t)&&this._propertyOriginMap.get(t)===i){this._values.delete(t);for(let n=i-1;n>=0;n--){const o=this._originStores[n];if(o&&o.has(t)){this._values.set(t,o.get(t)),this._propertyOriginMap.set(t,n);break}}}return r}has(t,i){const s=i===void 0?this._values:this._originStores[i];return!!s&&s.has(t)}revert(t,i){for(;i>0&&!this.has(t,i);)--i;const s=this._originStores[i],r=s&&s.get(t),n=this._values.get(t);return this._values.set(t,r),this._propertyOriginMap.set(t,i),n!==r}originOf(t){return this._propertyOriginMap.get(t)||Pe.DEFAULTS}forEach(t){this._values.forEach(t)}}const a4=e=>{let t=class extends e{constructor(...i){super(...i);const s=ki(this),r=s.store,n=new RT;s.store=n,dF(s,r,n)}read(i,s){fF(this,i,s)}getAtOrigin(i,s){const r=fw(this),n=Va(s);if(typeof i=="string")return r.get(i,n);const o={};return i.forEach(a=>{o[a]=r.get(a,n)}),o}originOf(i){return B0(this.originIdOf(i))}originIdOf(i){return fw(this).originOf(i)}revert(i,s){const r=fw(this),n=Va(s),o=ki(this);let a;a=typeof i=="string"?i==="*"?r.keys(n):[i]:i,a.forEach(l=>{o.invalidate(l),r.revert(l,n),o.commit(l)})}};return t=c([S("esri.core.ReadOnlyMultiOriginJSONSupport")],t),t};function fw(e){return ki(e).store}let KC=class extends a4(oe){};KC=c([S("esri.core.ReadOnlyMultiOriginJSONSupport")],KC);const nse=e=>{let t=class extends e{constructor(...i){super(...i)}clear(i,s="user"){return mw(this).delete(i,Va(s))}write(i={},s){return yF(this,i=i||{},s),i}setAtOrigin(i,s,r){ki(this).setAtOrigin(i,s,Va(r))}removeOrigin(i){const s=mw(this),r=Va(i),n=s.keys(r);for(const o of n)s.originOf(o)===r&&s.set(o,s.get(o,r),Pe.USER)}updateOrigin(i,s){const r=mw(this),n=Va(s),o=this.get(i);for(let a=n+1;a{let t=class extends nse(a4(e)){constructor(...i){super(...i)}};return t=c([S("esri.core.MultiOriginJSONSupport")],t),t};let eP=class extends l4(oe){};eP=c([S("esri.core.MultiOriginJSONSupport")],eP);async function ose(e,t){const{WhereClause:i}=await z(()=>import("./WhereClause.253310fe.js"),[]);return i.create(e,t)}function ase(e,t){return M(e)?M(t)?`(${e}) AND (${t})`:e:t}var M2;let sc=M2=class extends W{constructor(e){super(e),this.expression=null,this.name=null,this.returnType="boolean",this.title=null}clone(){return new M2({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};c([h({type:String,json:{write:!0}})],sc.prototype,"expression",void 0),c([h({type:String,json:{write:!0}})],sc.prototype,"name",void 0),c([h({type:["boolean","date","number","string"],json:{write:!0}})],sc.prototype,"returnType",void 0),c([h({type:String,json:{write:!0}})],sc.prototype,"title",void 0),sc=M2=c([S("esri.form.ExpressionInfo")],sc);const lse=sc;let rc=class extends W{constructor(e){super(e),this.description=null,this.label=null,this.type=null,this.visibilityExpression=null}};c([h({type:String,json:{write:!0}})],rc.prototype,"description",void 0),c([h({type:String,json:{write:!0}})],rc.prototype,"label",void 0),c([h()],rc.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],rc.prototype,"visibilityExpression",void 0),rc=c([S("esri.form.elements.Element")],rc);const Zh=rc;var $2;let i0=$2=class extends W{constructor(e){super(e),this.type=null}clone(){return new $2({type:this.type})}};c([h({type:["attachment","audio","document","image","signature","video"],json:{write:!0}})],i0.prototype,"type",void 0),i0=$2=c([S("esri.form.elements.inputs.AttachmentInput")],i0);const cse=i0;var T2;let nc=T2=class extends Zh{constructor(e){super(e),this.attachmentKeyword=null,this.editable=!0,this.input=null,this.type="attachment"}clone(){return new T2({attachmentKeyword:this.attachmentKeyword,description:this.description,editable:this.editable,input:this.input,label:this.label,visibilityExpression:this.visibilityExpression})}};c([h({type:String,json:{write:!0}})],nc.prototype,"attachmentKeyword",void 0),c([h({type:Boolean,json:{write:!0}})],nc.prototype,"editable",void 0),c([h({type:cse,json:{read:{source:"inputType"},write:{target:"inputType"}}})],nc.prototype,"input",void 0),c([h({type:["attachment"],json:{read:!1,write:!0}})],nc.prototype,"type",void 0),nc=T2=c([S("esri.form.elements.AttachmentElement")],nc);const tP=nc;let s0=class extends W{constructor(e){super(e),this.type=null}};c([h()],s0.prototype,"type",void 0),s0=c([S("esri.form.elements.inputs.Input")],s0);const Sd=s0;let Vp=class extends Sd{constructor(e){super(e),this.maxLength=null,this.minLength=0}};c([h({type:Number,json:{write:!0}})],Vp.prototype,"maxLength",void 0),c([h({type:Number,json:{write:!0}})],Vp.prototype,"minLength",void 0),Vp=c([S("esri.form.elements.inputs.TextInput")],Vp);const LT=Vp;var I2;let r0=I2=class extends LT{constructor(e){super(e),this.type="barcode-scanner"}clone(){return new I2({maxLength:this.maxLength,minLength:this.minLength})}};c([h({type:["barcode-scanner"],json:{read:!1,write:!0}})],r0.prototype,"type",void 0),r0=I2=c([S("esri.form.elements.inputs.BarcodeScannerInput")],r0);const use=r0;var E2;let Zu=E2=class extends Sd{constructor(e){super(e),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="combo-box"}clone(){return new E2({showNoValueOption:this.showNoValueOption,noValueOptionLabel:this.noValueOptionLabel})}};c([h({type:String,json:{write:!0}})],Zu.prototype,"noValueOptionLabel",void 0),c([h({type:Boolean,json:{write:!0}})],Zu.prototype,"showNoValueOption",void 0),c([h({type:["combo-box"],json:{read:!1,write:!0}})],Zu.prototype,"type",void 0),Zu=E2=c([S("esri.form.elements.inputs.ComboBoxInput")],Zu);const hse=Zu;var k2;function iP(e){return e!=null?new Date(e):null}function sP(e){return e?e.getTime():null}let wr=k2=class extends Sd{constructor(e){super(e),this.includeTime=!1,this.max=null,this.min=null,this.type="datetime-picker"}readMax(e,t){return iP(t.max)}writeMax(e,t){t.max=sP(e)}readMin(e,t){return iP(t.min)}writeMin(e,t){t.min=sP(e)}clone(){return new k2({includeTime:this.includeTime,max:this.max,min:this.min,type:this.type})}};c([h({type:Boolean,json:{write:!0}})],wr.prototype,"includeTime",void 0),c([h({type:Date,json:{type:Number,write:!0}})],wr.prototype,"max",void 0),c([Q("max")],wr.prototype,"readMax",null),c([ie("max")],wr.prototype,"writeMax",null),c([h({type:Date,json:{type:Number,write:!0}})],wr.prototype,"min",void 0),c([Q("min")],wr.prototype,"readMin",null),c([ie("min")],wr.prototype,"writeMin",null),c([h({type:["datetime-picker"],json:{read:!1,write:!0}})],wr.prototype,"type",void 0),wr=k2=c([S("esri.form.elements.inputs.DateTimePickerInput")],wr);const dse=wr;var C2;let Qu=C2=class extends Sd{constructor(e){super(e),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="radio-buttons"}clone(){return new C2({noValueOptionLabel:this.noValueOptionLabel,showNoValueOption:this.showNoValueOption})}};c([h({type:String,json:{write:!0}})],Qu.prototype,"noValueOptionLabel",void 0),c([h({type:Boolean,json:{write:!0}})],Qu.prototype,"showNoValueOption",void 0),c([h({type:["radio-buttons"],json:{read:!1,write:!0}})],Qu.prototype,"type",void 0),Qu=C2=c([S("esri.form.elements.inputs.RadioButtonsInput")],Qu);const pse=Qu;var P2;let Ku=P2=class extends Sd{constructor(e){super(e),this.offValue=null,this.onValue=null,this.type="switch"}clone(){return new P2({offValue:this.offValue,onValue:this.onValue})}};c([h({type:[String,Number],json:{write:!0}})],Ku.prototype,"offValue",void 0),c([h({type:[String,Number],json:{write:!0}})],Ku.prototype,"onValue",void 0),c([h({type:["switch"],json:{read:!1,write:!0}})],Ku.prototype,"type",void 0),Ku=P2=c([S("esri.form.elements.inputs.SwitchInput")],Ku);const fse=Ku;var A2;let n0=A2=class extends LT{constructor(e){super(e),this.type="text-area"}clone(){return new A2({maxLength:this.maxLength,minLength:this.minLength})}};c([h({type:["text-area"],json:{read:!1,write:!0}})],n0.prototype,"type",void 0),n0=A2=c([S("esri.form.elements.inputs.TextAreaInput")],n0);const mse=n0;var O2;let o0=O2=class extends LT{constructor(e){super(e),this.type="text-box"}clone(){return new O2({maxLength:this.maxLength,minLength:this.minLength})}};c([h({type:["text-box"],json:{read:!1,write:!0}})],o0.prototype,"type",void 0),o0=O2=c([S("esri.form.elements.inputs.TextBoxInput")],o0);const yse=o0,gse={base:Sd,key:"type",typeMap:{"barcode-scanner":use,"combo-box":hse,"datetime-picker":dse,"radio-buttons":pse,switch:fse,"text-area":mse,"text-box":yse}};var R2;let Us=R2=class extends Zh{constructor(e){super(e),this.domain=null,this.editable=!0,this.editableExpression=null,this.fieldName=null,this.hint=null,this.input=null,this.requiredExpression=null,this.type="field",this.valueExpression=null}clone(){return new R2({description:this.description,domain:this.domain,editable:this.editable,editableExpression:this.editableExpression,fieldName:this.fieldName,hint:this.hint,input:this.input,label:this.label,requiredExpression:this.requiredExpression,valueExpression:this.valueExpression,visibilityExpression:this.visibilityExpression})}};c([h({types:r5,json:{read:{reader:bT},write:!0}})],Us.prototype,"domain",void 0),c([h({type:Boolean,json:{write:!0}})],Us.prototype,"editable",void 0),c([h({type:String,json:{write:!0}})],Us.prototype,"editableExpression",void 0),c([h({type:String,json:{write:!0}})],Us.prototype,"fieldName",void 0),c([h({type:String,json:{write:!0}})],Us.prototype,"hint",void 0),c([h({types:gse,json:{read:{source:"inputType"},write:{target:"inputType"}}})],Us.prototype,"input",void 0),c([h({type:String,json:{write:!0}})],Us.prototype,"requiredExpression",void 0),c([h({type:String,json:{read:!1,write:!0}})],Us.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],Us.prototype,"valueExpression",void 0),Us=R2=c([S("esri.form.elements.FieldElement")],Us);const rP=Us;var L2;let ro=L2=class extends Zh{constructor(e){super(e),this.displayCount=null,this.displayType="list",this.editable=!0,this.orderByFields=null,this.relationshipId=null,this.type="relationship"}clone(){return new L2({description:this.description,displayCount:this.displayCount,displayType:this.displayType,editable:this.editable,label:this.label,orderByFields:R(this.orderByFields),relationshipId:this.relationshipId,visibilityExpression:this.visibilityExpression})}};c([h({type:Number,json:{write:!0}})],ro.prototype,"displayCount",void 0),c([h({type:["list"],json:{write:!0}})],ro.prototype,"displayType",void 0),c([h({type:Boolean,json:{write:!0}})],ro.prototype,"editable",void 0),c([h({type:[Z$],json:{write:!0}})],ro.prototype,"orderByFields",void 0),c([h({type:Number,json:{write:!0}})],ro.prototype,"relationshipId",void 0),c([h({type:["relationship"],json:{read:!1,write:!0}})],ro.prototype,"type",void 0),ro=L2=c([S("esri.form.elements.RelationshipElement")],ro);const nP=ro;function c4(e){return{typesWithGroup:{base:Zh,key:"type",typeMap:{attachment:tP,field:rP,group:e,relationship:nP}},typesWithoutGroup:{base:Zh,key:"type",typeMap:{attachment:tP,field:rP,relationship:nP}}}}function u4(e,t,i=!0){if(!e)return null;const s=i?t.typesWithGroup.typeMap:t.typesWithoutGroup.typeMap;return e.filter(r=>s[r.type]).map(r=>s[r.type].fromJSON(r))}function h4(e,t,i=!0){if(!e)return null;const s=i?t.typesWithGroup.typeMap:t.typesWithoutGroup.typeMap;return e.filter(r=>s[r.type]).map(r=>r.toJSON())}function d4(e,t,i=!0){return e?e.map(s=>En(i?t.typesWithGroup:t.typesWithoutGroup,s)):null}var F2;let mn=F2=class extends Zh{constructor(e){super(e),this.elements=null,this.initialState="expanded",this.type="group"}castElements(e){return d4(e,yw,!1)}readElements(e,t){return u4(t.formElements,yw,!1)}writeElements(e,t){t.formElements=h4(e,yw,!1)}clone(){return new F2({description:this.description,elements:R(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};c([h({json:{write:!0}})],mn.prototype,"elements",void 0),c([Oe("elements")],mn.prototype,"castElements",null),c([Q("elements",["formElements"])],mn.prototype,"readElements",null),c([ie("elements")],mn.prototype,"writeElements",null),c([h({type:["collapsed","expanded"],json:{write:!0}})],mn.prototype,"initialState",void 0),c([h({type:String,json:{read:!1,write:!0}})],mn.prototype,"type",void 0),mn=F2=c([S("esri.form.elements.GroupElement")],mn);const yw=c4(mn),vse=mn;var D2;const gw=c4(vse);let xr=D2=class extends W{constructor(e){super(e),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(e){return d4(e,gw)}readElements(e,t){return u4(t.formElements,gw)}writeElements(e,t){t.formElements=h4(e,gw)}clone(){return new D2({description:this.description,expressionInfos:R(this.expressionInfos),elements:R(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}};c([h({type:String,json:{write:!0}})],xr.prototype,"description",void 0),c([h({json:{write:!0}})],xr.prototype,"elements",void 0),c([Oe("elements")],xr.prototype,"castElements",null),c([Q("elements",["formElements"])],xr.prototype,"readElements",null),c([ie("elements")],xr.prototype,"writeElements",null),c([h({type:[lse],json:{write:!0}})],xr.prototype,"expressionInfos",void 0),c([h({type:Boolean,json:{default:!1,write:!0}})],xr.prototype,"preserveFieldValuesWhenHidden",void 0),c([h({type:String,json:{write:!0}})],xr.prototype,"title",void 0),xr=D2=c([S("esri.form.FormTemplate")],xr);const bse=xr;function oP(e,t,i){if(e.hasM==null||e.hasZ)for(const s of t)for(const r of s)r.length>2&&(r[2]*=i)}function _se(e,t,i){if(!e&&!t||!i)return;const s=Vh(i);aP(e,i,s),aP(t,i,s)}function aP(e,t,i){if(e)for(const s of e)wse(s.geometry,t,i)}function wse(e,t,i){if(N(e)||!e.spatialReference||Kt(e.spatialReference,t))return;const s=Vh(e.spatialReference)/i;if(s!==1){if("x"in e)e.z!=null&&(e.z*=s);else if("rings"in e)oP(e,e.rings,s);else if("paths"in e)oP(e,e.paths,s);else if("points"in e&&(e.hasM==null||e.hasZ))for(const r of e.points)r.length>2&&(r[2]*=s)}}let xse=0;const p4="esri.layers.graphics.sources.MemorySource",vw=q.getLogger(p4);let mo=class extends Lo.LoadableMixin(cb(pu(he))){constructor(e){super(e),this._idToClientGraphic=null,this.type="memory"}load(e){const t=M(e)?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}get _workerGeometryType(){var t;const e=(t=this.layer)==null?void 0:t.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?"polygon":e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){await this.load(t);const i=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);zS(e,this.layer.spatialReference,i);const s=Wb.fromJSON(i);if(!this._requiresClientGraphicMapping())return s;const r=this.layer.objectIdField;for(const n of s.features){const o=n.attributes[r],a=this._idToClientGraphic.get(o);a&&(n.geometry=a.geometry)}return s.geometryType=this.layer.geometryType,s}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new L("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const i=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return zS(e,this.layer.spatialReference,i),i}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(i=>({count:i.count,extent:Ze.fromJSON(i.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async _applyEdits(e){if(!this._connection)throw new L("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField;let i=null;const s=[],r=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const n=u=>"objectId"in u&&u.objectId!=null?u.objectId:"attributes"in u&&u.attributes[t]!=null?u.attributes[t]:null;if(e.addFeatures&&(i=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const u of e.deleteFeatures){const d=n(u);d!=null&&s.push(d)}const o=e.updateFeatures&&this._idToClientGraphic?new Map:null;if(e.updateFeatures){for(const u of e.updateFeatures)if(r.push(this._serializeFeature(u)),o){const d=n(u);d!=null&&o.set(d,u)}}_se(i?i.features:null,r,this.layer.spatialReference);const{fullExtent:a,featureEditResults:l}=await this._connection.invoke("applyEdits",{adds:i?i.features:[],updates:r,deletes:s});return this.fullExtent=a,i&&i.finish(l.uidToObjectId),this._updateClientGraphicIds(o,l),this._createEditsResult(l)}async _prepareClientMapping(e,t){if(this._layerOrSourceGeometryType!=="mesh"||N(e))return;const i=[];for(const{geometry:s}of e)!M(s)||s.type!=="mesh"||s.hasExtent||s.loaded||i.push(s.load({signal:t}));i.length&&await Promise.all(i)}_updateClientGraphicIds(e,t){if(this._idToClientGraphic){if(e)for(const i of t.updateResults){if(!i.success)continue;const s=e.get(i.objectId);s!=null&&this._addIdToClientGraphic(s)}for(const i of t.deleteResults)i.success&&this._idToClientGraphic.delete(i.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new L("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,i=new Array(e.length);let s=null;for(let n=0;n{vw.error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),m.preventDefault()}));const u={features:l.features,fields:t&&t.map(m=>m.toJSON()),geometryType:bk.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!=="mesh"&&r,hasZ:this._layerOrSourceGeometryType==="mesh"||n,objectIdField:s,spatialReference:a?null:i&&i.toJSON(),timeInfo:o?o.toJSON():null},d=await this._connection.invoke("load",u,{signal:e});for(const m of d.warnings)vw.warn(m.message,{layer:this.layer,warning:m});d.featureErrors.length&&vw.warn(`Encountered ${d.featureErrors.length} validation errors while loading features`,d.featureErrors);const f=d.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(l.inferredGeometryType)&&(f.geometryType=bk.toJSON(l.inferredGeometryType)),this.sourceJSON=f,this._requiresClientGraphicMapping()&&(this._idToClientGraphic=new Map),l.finish(d.assignedObjectIds)}};c([P$({Type:Ci,ensureType:Dt(Ci)})],mo.prototype,"itemType",void 0),c([h()],mo.prototype,"type",void 0),c([h({constructOnly:!0})],mo.prototype,"layer",void 0),c([h({readOnly:!0})],mo.prototype,"_workerGeometryType",null),c([h()],mo.prototype,"sourceJSON",void 0),mo=c([S(p4)],mo);function Sse(e){return"portalItem"in e}const Mse=e=>{let t=class extends e{get apiKey(){var i;return this._isOverridden("apiKey")?this._get("apiKey"):Sse(this)?(i=this.portalItem)==null?void 0:i.apiKey:null}set apiKey(i){i!=null?this._override("apiKey",i):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return c([h({type:String})],t.prototype,"apiKey",null),t=c([S("esri.layers.mixins.APIKeyMixin")],t),t},f4={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},m4=Object.values(f4),y4=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${m4.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),$se=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${m4.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),Tse=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function N_e(e){return!!y4.test(e)}function Md(e){if(N(e))return null;const t=Ai(e),i=t.path.match(y4)||t.path.match($se);if(!i)return null;const[,s,r,n,o]=i,a=r.indexOf("/");return{title:FT(a!==-1?r.slice(a+1):r),serverType:f4[n.toLowerCase()],sublayer:o!=null&&o!==""?parseInt(o,10):null,url:{path:s}}}function Ise(e){const t=Ai(e).path.match(Tse);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function FT(e){return(e=e.replace(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function Ese(e,t){const i=[];if(e){const s=Md(e);M(s)&&s.title&&i.push(s.title)}if(t){const s=FT(t);i.push(s)}if(i.length===2){if(i[0].toLowerCase().includes(i[1].toLowerCase()))return i[0];if(i[1].toLowerCase().includes(i[0].toLowerCase()))return i[1]}return i.join(" - ")}function g4(e){if(!e)return!1;const t=".arcgis.com/",i="//services",s="//tiles",r="//features",n=(e=e.toLowerCase()).includes(t),o=e.includes(i)||e.includes(s)||e.includes(r);return n&&o}function kse(e,t){return e&&_R(wR(e,t))}function Cse(e){let{url:t}=e;if(!t)return{url:t};t=wR(t,e.logger);const i=Ai(t),s=Md(i.path);let r;if(M(s))s.sublayer!=null&&e.layer.layerId==null&&(r=s.sublayer),t=s.url.path;else if(e.nonStandardUrlAllowed){const n=Ise(i.path);M(n)&&(t=n.serviceUrl,r=n.sublayerId)}return{url:_R(t),layerId:r}}function Pse(e,t,i,s,r){au(t,s,"url",r),s.url&&e.layerId!=null&&(s.url=Xc(s.url,i,e.layerId.toString()))}function j_e(e){if(!e)return!1;const t=e.toLowerCase(),i=t.includes("/services/"),s=t.includes("/mapserver/wmsserver"),r=t.includes("/imageserver/wmsserver"),n=t.includes("/wmsserver");return i&&(s||r||n)}const Ase=e=>{let t=class extends e{get title(){if(this._get("title")&&this.originOf("title")!=="defaults")return this._get("title");if(this.url){const i=Md(this.url);if(M(i)&&i.title)return i.title}return this._get("title")||""}set title(i){this._set("title",i)}set url(i){this._set("url",kse(i,q.getLogger(this.declaredClass)))}};return c([h()],t.prototype,"title",null),c([h({type:String})],t.prototype,"url",null),t=c([S("esri.layers.mixins.ArcGISService")],t),t},Ose=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return c([h({type:Object,json:{write:{overridePolicy:i=>({enabled:!!(i&&Object.keys(i).length>0)})}}})],t.prototype,"customParameters",void 0),t=c([S("esri.layers.mixins.CustomParametersMixin")],t),t},Rse=new jo.EventEmitter,v4="esri.layers.mixins.EditBusLayer",b4=Symbol(v4);function V_e(e){return e!=null&&typeof e=="object"&&b4 in e}const Lse=e=>{var t;let i=class extends e{constructor(...s){super(...s),this[t]=!0,this.when().then(()=>{this.own([Rse.on("edits",r=>{var d,f,m;const n="layer"in r?r.layer:null,o="layer"in r?(d=r.layer)==null?void 0:d.url:r.serviceUrl,a="layer"in r?(f=r.layer)==null?void 0:f.layerId:r.layerId,l=r.event;if(n===this||o!==this.url)return;if(a!=null&&this.layerId!=null&&a===this.layerId)return void this.emit("edits",R(l));const u=(m=l.editedFeatures)==null?void 0:m.find(({layerId:y})=>y===this.layerId);if(u){const{adds:y,updates:g,deletes:v}=u.editedFeatures,b={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:y?y.map(({attributes:_})=>({objectId:this.objectIdField&&_[this.objectIdField],globalId:this.globalIdField&&_[this.globalIdField]})):[],deletedFeatures:v?v.map(({attributes:_})=>({objectId:this.objectIdField&&_[this.objectIdField],globalId:this.globalIdField&&_[this.globalIdField]})):[],updatedFeatures:g?g.map(({current:{attributes:_}})=>({objectId:this.objectIdField&&_[this.objectIdField],globalId:this.globalIdField&&_[this.globalIdField]})):[],editedFeatures:R(l.editedFeatures)};this.emit("edits",b)}})])},()=>{})}};return t=b4,i=c([S(v4)],i),i};var N2;const bw=new Ie({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),_w=new Ie({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let ln=N2=class extends W{constructor(e){super(e),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null}createQuery(e={}){const{where:t,geometry:i,spatialRelationship:s,timeExtent:r,objectIds:n,units:o,distance:a}=this;return new $n({geometry:R(i),objectIds:R(n),spatialRelationship:s,timeExtent:R(r),where:t,units:o,distance:a,...e})}clone(){const{where:e,geometry:t,spatialRelationship:i,timeExtent:s,objectIds:r,units:n,distance:o}=this;return new N2({geometry:R(t),objectIds:R(r),spatialRelationship:i,timeExtent:R(s),where:e,units:n,distance:o})}};c([h({type:String,json:{write:!0}})],ln.prototype,"where",void 0),c([h({types:fu,json:{write:!0}})],ln.prototype,"geometry",void 0),c([h({type:bw.apiValues,json:{name:"spatialRel",read:{reader:bw.read},write:{allowNull:!1,writer:bw.write,overridePolicy(){return{enabled:M(this.geometry)}}}}})],ln.prototype,"spatialRelationship",void 0),c([h({type:Number,json:{write:{overridePolicy(e){return{enabled:e!=null&&this.geometry!=null}}}}})],ln.prototype,"distance",void 0),c([h({type:[Number],json:{write:!0}})],ln.prototype,"objectIds",void 0),c([h({type:_w.apiValues,json:{read:_w.read,write:{writer:_w.write,overridePolicy(e){return{enabled:e!=null&&this.geometry!=null}}}}})],ln.prototype,"units",void 0),c([h({type:Ln,json:{write:!0}})],ln.prototype,"timeExtent",void 0),ln=N2=c([S("esri.layers.support.FeatureFilter")],ln);const Fse=ln;var j2;const lP={read:{reader:G$},write:{writer:W$,overridePolicy(){return{allowNull:this.excludedEffect!=null,isRequired:this.excludedEffect==null}}}},cP={read:{reader:G$},write:{writer:W$,overridePolicy(){return{allowNull:this.includedEffect!=null,isRequired:this.includedEffect==null}}}},uP={name:"showExcludedLabels",default:!0};let oc=j2=class extends W{constructor(e){super(e),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(e,t){var s,r;const i=super.write(e,t);if(t!=null&&t.origin){if(i.filter){const n=Object.keys(i.filter);if(n.length>1||n[0]!=="where")return(s=t.messages)==null||s.push(new L("web-document-write:unsupported-feature-effect","Invalid feature effect 'filter'. A filter can only contain a 'where' property",{layer:t.layer,effect:this})),null}if("showExcludedLabels"in i)return(r=t.messages)==null||r.push(new L("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:t.layer,effect:this})),null}return i}clone(){return new j2({filter:M(this.filter)?this.filter.clone():null,includedEffect:this.includedEffect,excludedEffect:this.excludedEffect,excludedLabelsVisible:this.excludedLabelsVisible})}};c([h({type:Fse,json:{write:{allowNull:!0,writer(e,t,i,s){const r=e==null?void 0:e.write({},s);r&&Object.keys(r).length!==0?Ei(i,r,t):Ei(i,null,t)}}}})],oc.prototype,"filter",void 0),c([h({json:{write:!0,origins:{"web-map":lP,"portal-item":lP}}})],oc.prototype,"includedEffect",void 0),c([h({json:{write:!0,origins:{"web-map":cP,"portal-item":cP}}})],oc.prototype,"excludedEffect",void 0),c([h({type:Boolean,json:{write:!0,name:"showExcludedLabels",origins:{"web-map":uP,"portal-item":uP}}})],oc.prototype,"excludedLabelsVisible",void 0),oc=j2=c([S("esri.layers.support.FeatureEffect")],oc);const Dse=oc,hP={write:{allowNull:!0}},Nse=e=>{let t=class extends e{constructor(){super(...arguments),this.featureEffect=null}};return c([h({type:Dse,json:{origins:{"web-map":hP,"portal-item":hP}}})],t.prototype,"featureEffect",void 0),t=c([S("esri.layers.mixins.FeatureEffectLayer")],t),t};var zp;const kv=mi()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),_4=kv.jsonValues.slice();H6(_4,"orthometric");const $f=mi()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let Sr=zp=class extends W{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,i){return kv.write(e,t,i)}readHeightModel(e,t,i){return kv.read(e)||(i&&i.messages&&i.messages.push(jse(e,{context:i})),null)}readHeightUnit(e,t,i){return $f.read(e)||(i&&i.messages&&i.messages.push(dP(e,{context:i})),null)}readHeightUnitService(e,t,i){return xF(e)||$f.read(e)||(i&&i.messages&&i.messages.push(dP(e,{context:i})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new zp({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const i=SW(t);return new zp({heightModel:e.heightModel,heightUnit:i,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new zp;return t.read(e,{origin:"web-scene"}),t}};function dP(e,t){return new Bi("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}function jse(e,t){return new Bi("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}c([h({type:kv.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:_4,default:"ellipsoidal"}}}})],Sr.prototype,"heightModel",void 0),c([ie("web-scene","heightModel")],Sr.prototype,"writeHeightModel",null),c([Q(["web-scene","service"],"heightModel")],Sr.prototype,"readHeightModel",null),c([h({type:$f.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:$f.jsonValues,write:$f.write}}}})],Sr.prototype,"heightUnit",void 0),c([Q("web-scene","heightUnit")],Sr.prototype,"readHeightUnit",null),c([Q("service","heightUnit")],Sr.prototype,"readHeightUnitService",null),c([h({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],Sr.prototype,"vertCRS",void 0),c([Q("service","vertCRS",["vertCRS","ellipsoid","geoid"])],Sr.prototype,"readVertCRS",null),Sr=zp=c([S("esri.geometry.HeightModelInfo")],Sr);const Qb=Sr;function Vse(e){if(!e)return e;const{start:t,end:i}=e;return new Ln({start:M(t)?Wc(t,-t.getTimezoneOffset(),"minutes"):t,end:M(i)?Wc(i,-i.getTimezoneOffset(),"minutes"):i})}function zse(e){if(!e)return e;const{start:t,end:i}=e;return new Ln({start:M(t)?Wc(t,t.getTimezoneOffset(),"minutes"):t,end:M(i)?Wc(i,i.getTimezoneOffset(),"minutes"):i})}const Bse={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:!0}},DT={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(e,t)=>!t.disablePopup},write:{enabled:!0,writer(e,t,i){t[i]=!e}}}},NT={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:!0}},Use={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:au}}},qse={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:!0}},Gse={value:null,type:kN,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:!0}};function z_e(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const a0={type:Number,json:{origins:{"web-document":{write:!0,read:!0},"portal-item":{write:!0}}}},Wse={...a0,json:{...a0.json,origins:{"web-document":{...a0.json.origins["web-document"],write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(e,t,i)=>i&&i.origin!=="service"||!t.drawingInfo||t.drawingInfo.transparency===void 0?t.layerDefinition&&t.layerDefinition.drawingInfo&&t.layerDefinition.drawingInfo.transparency!==void 0?em(t.layerDefinition.drawingInfo.transparency):void 0:em(t.drawingInfo.transparency)}}},B_e={type:Ln,readOnly:!0,get(){var a,l;if(!((a=this.layer)!=null&&a.timeInfo))return null;const{datesInUnknownTimezone:e,timeOffset:t,useViewTime:i}=this.layer,s=(l=this.view)==null?void 0:l.timeExtent;let r=this.layer.timeExtent;e&&(r=zse(r));let n=i?s&&r?s.intersection(r):s||r:r;if(!n||n.isEmpty||n.isAllTime)return n;t&&(n=n.offset(-t.value,t.unit)),e&&(n=Vse(n));const o=this._get("timeExtent");return n.equals(o)?o:n}},U_e={type:Ze,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(e,t)=>{const i=Ze.fromJSON(e);return t.spatialReference!=null&&typeof t.spatialReference=="object"&&(i.spatialReference=xe.fromJSON(t.spatialReference)),i}}}},read:!1}},Hse={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},Yse={type:Number,json:{origins:{service:{write:{enabled:!1}}},read:{source:"layerDefinition.minScale"},write:{target:"layerDefinition.minScale"}}},Jse={type:Number,json:{origins:{service:{write:{enabled:!1}}},read:{source:"layerDefinition.maxScale"},write:{target:"layerDefinition.maxScale"}}},w4={json:{write:{ignoreOrigin:!0},origins:{"web-map":{read:!1,write:!1}}}};let yn=class extends xt(W){constructor(e){super(e)}};c([h({constructOnly:!0,json:{write:!0}})],yn.prototype,"name",void 0),c([h({constructOnly:!0,json:{write:!0}})],yn.prototype,"fields",void 0),c([h({constructOnly:!0,json:{write:!0}})],yn.prototype,"isAscending",void 0),c([h({constructOnly:!0,json:{write:!0}})],yn.prototype,"indexType",void 0),c([h({constructOnly:!0,json:{write:!0}})],yn.prototype,"isUnique",void 0),c([h({constructOnly:!0,json:{write:!0}})],yn.prototype,"description",void 0),yn=c([S("esri.layers.support.FeatureIndex")],yn);const V2=new Ie({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"}),Xse={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function ye(e,t,i){return!!(e&&e.hasOwnProperty(t)?e[t]:i)}function Fy(e,t,i){return e&&e.hasOwnProperty(t)?e[t]:i}function Zse(e){var i;const t=(i=e==null?void 0:e.supportedSpatialAggregationStatistics)==null?void 0:i.map(s=>s.toLowerCase());return{envelope:!!(t!=null&&t.includes("envelopeaggregate")),centroid:!!(t!=null&&t.includes("centroidaggregate")),convexHull:!!(t!=null&&t.includes("convexhullaggregate"))}}function Wm(e,t){var s;const i=(s=e==null?void 0:e.supportedOperationsWithCacheHint)==null?void 0:s.map(r=>r.toLowerCase());return!!(i!=null&&i.includes(t.toLowerCase()))}function x4(e,t,i){return{analytics:Qse(t),attachment:Kse(t),data:ere(t),metadata:tre(t),operations:ire(t.capabilities||e,t,i),query:sre(t,i),queryRelated:rre(t),queryTopFeatures:nre(t),editing:ore(t)}}function Qse(e){return{supportsCacheHint:Wm(e.advancedQueryCapabilities,"queryAnalytics")}}function Kse(e){const t=e.attachmentProperties,i={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:Wm(e.advancedQueryCapabilities,"queryAttachments"),supportsResize:ye(e,"supportsAttachmentsResizing",!1)};return t&&Array.isArray(t)&&t.forEach(s=>{const r=Xse[s.name];r&&(i[r]=!!s.isEnabled)}),i}function ere(e){return{isVersioned:ye(e,"isDataVersioned",!1),supportsAttachment:ye(e,"hasAttachments",!1),supportsM:ye(e,"hasM",!1),supportsZ:ye(e,"hasZ",!1)}}function tre(e){return{supportsAdvancedFieldProperties:ye(e,"supportsFieldDescriptionProperty",!1)}}function ire(e,t,i){const s=e?e.toLowerCase().split(",").map(m=>m.trim()):[],r=i?Md(i):null,n=s.includes(M(r)&&r.serverType==="MapServer"?"data":"query"),o=s.includes("editing")&&!t.datesInUnknownTimezone;let a=o&&s.includes("create"),l=o&&s.includes("delete"),u=o&&s.includes("update");const d=s.includes("changetracking"),f=t.advancedQueryCapabilities;return o&&!(a||l||u)&&(a=l=u=!0),{supportsCalculate:ye(t,"supportsCalculate",!1),supportsTruncate:ye(t,"supportsTruncate",!1),supportsValidateSql:ye(t,"supportsValidateSql",!1),supportsAdd:a,supportsDelete:l,supportsEditing:o,supportsChangeTracking:d,supportsQuery:n,supportsQueryAnalytics:ye(f,"supportsQueryAnalytic",!1),supportsQueryAttachments:ye(f,"supportsQueryAttachments",!1),supportsQueryTopFeatures:ye(f,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:ye(t,"supportsAttachmentsResizing",!1),supportsSync:s.includes("sync"),supportsUpdate:u,supportsExceedsLimitStatistics:ye(t,"supportsExceedsLimitStatistics",!1)}}function sre(e,t){const i=e.advancedQueryCapabilities,s=e.ownershipBasedAccessControlForFeatures,r=e.archivingInfo,n=$4(e),o=t==null?void 0:t.includes("MapServer"),a=!V("mapserver-pbf-enabled")&&o&&(n!=null?n:0)<10.81,l=g4(t),u=(e.supportedQueryFormats||"").split(",").reduce((d,f)=>{const m=f.toLowerCase().trim();return m&&d.add(m),d},new Set);return{supportsStatistics:ye(i,"supportsStatistics",e.supportsStatistics),supportsPercentileStatistics:ye(i,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:ye(i,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:Zse(i),supportsCentroid:ye(i,"supportsReturningGeometryCentroid",!1),supportsDistance:ye(i,"supportsQueryWithDistance",!1),supportsDistinct:ye(i,"supportsDistinct",e.supportsAdvancedQueries),supportsExtent:ye(i,"supportsReturningQueryExtent",!1),supportsGeometryProperties:ye(i,"supportsReturningGeometryProperties",!1),supportsHavingClause:ye(i,"supportsHavingClause",!1),supportsOrderBy:ye(i,"supportsOrderBy",e.supportsAdvancedQueries),supportsPagination:ye(i,"supportsPagination",!1),supportsQuantization:ye(e,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:ye(e,"supportsQuantizationEditMode",!1),supportsQueryGeometry:ye(e,"supportsReturningQueryGeometry",!1),supportsResultType:ye(i,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:ye(i,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:ye(i,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:ye(e,"useStandardizedQueries",!1),supportsTopFeaturesQuery:ye(i,"supportsTopFeaturesQuery",!1),supportsQueryByOthers:ye(s,"allowOthersToQuery",!0),supportsHistoricMoment:ye(r,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:!a&&u.has("pbf"),supportsDisjointSpatialRelationship:ye(i,"supportsDisjointSpatialRel",!1),supportsCacheHint:ye(i,"supportsQueryWithCacheHint",!1)||Wm(i,"query"),supportsDefaultSpatialReference:ye(i,"supportsDefaultSR",!1),supportsCompactGeometry:l,supportsFullTextSearch:ye(i,"supportsFullTextSearch",!1),maxRecordCountFactor:Fy(e,"maxRecordCountFactor",void 0),maxRecordCount:Fy(e,"maxRecordCount",void 0),standardMaxRecordCount:Fy(e,"standardMaxRecordCount",void 0),tileMaxRecordCount:Fy(e,"tileMaxRecordCount",void 0)}}function rre(e){const t=e.advancedQueryCapabilities,i=ye(t,"supportsAdvancedQueryRelated",!1);return{supportsPagination:ye(t,"supportsQueryRelatedPagination",!1),supportsCount:i,supportsOrderBy:i,supportsCacheHint:Wm(t,"queryRelated")}}function nre(e){return{supportsCacheHint:Wm(e.advancedQueryCapabilities,"queryTopFilter")}}function ore(e){const t=e.ownershipBasedAccessControlForFeatures;return{supportsGeometryUpdate:ye(e,"allowGeometryUpdates",!0),supportsGlobalId:ye(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:ye(e,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:ye(e,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:ye(e,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:ye(e,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:ye(t,"allowAnonymousToDelete",!0),supportsDeleteByOthers:ye(t,"allowOthersToDelete",!0),supportsUpdateByAnonymous:ye(t,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:ye(t,"allowOthersToUpdate",!0)}}async function are(e,t,i,s){const{source:r}=await e.load();if(await jT(e,t,s),!r.addAttachment)throw new L(s,"Layer source does not support addAttachment capability");return r.addAttachment(t,i)}function jT(e,t,i){const{attributes:s}=t,{objectIdField:r}=e;return e.get("capabilities.data.supportsAttachment")?t?s?r&&s[r]?Promise.resolve():Promise.reject(new L(i,`feature is missing the identifying attribute ${r}`)):Promise.reject(new L(i,"'attributes' are required on a feature to query attachments")):Promise.reject(new L(i,"A feature is required to add/delete/update attachments")):Promise.reject(new L(i,"this layer doesn't support attachments"))}async function lre(e,t,i,s,r){const{source:n}=await e.load();if(await jT(e,t,r),!n.updateAttachment)throw new L(r,"Layer source does not support updateAttachment capability");return n.updateAttachment(t,i,s)}async function cre(e,t,i){const s=await z(()=>import("./editingSupport.b066c126.js"),[]),r=await e.load();return s.applyEdits(r,r.source,t,i)}async function ure(e,t,i,s){const{source:r}=await e.load();if(await jT(e,t,s),!r.deleteAttachments)throw new L(s,"Layer source does not support deleteAttachments capability");return r.deleteAttachments(t,i)}async function hre(e,t,i){const{source:s}=await e.load({signal:t==null?void 0:t.signal});if(!s.fetchRecomputedExtents)throw new L(i,"Layer source does not support fetchUpdates capability");return s.fetchRecomputedExtents(t)}async function dre(e,t,i,s){var y,g;t=SS.from(t);const{source:r,capabilities:n}=await e.load();if(!((y=n==null?void 0:n.data)!=null&&y.supportsAttachment))throw new L(s,"this layer doesn't support attachments");const{attachmentTypes:o,objectIds:a,globalIds:l,num:u,size:d,start:f,where:m}=t;if(!((g=n==null?void 0:n.operations)!=null&&g.supportsQueryAttachments)){const v=a&&a.length>1,b=o&&o.length,_=l&&l.length,x=d&&d.length;if(v||b||_||x||u||f||m)throw new L(s,"when 'supportsQueryAttachments' is false, only objectIds of length 1 are supported",t)}if(!(a!=null&&a.length)&&!m)throw new L(s,"'objectIds' or 'where' are required to perform attachment query",t);if(!r.queryAttachments)throw new L(s,"Layer source does not support queryAttachments capability",t);return r.queryAttachments(t)}async function pre(e,t,i,s){var n;const{source:r}=await e.load();if(!r.queryObjectIds)throw new L(s,"Layer source does not support queryObjectIds capability");return r.queryObjectIds((n=$n.from(t))!=null?n:e.createQuery(),i)}async function fre(e,t,i,s){var n;const{source:r}=await e.load();if(!r.queryFeatureCount)throw new L(s,"Layer source does not support queryFeatureCount capability");return r.queryFeatureCount((n=$n.from(t))!=null?n:e.createQuery(),i)}async function mre(e,t,i,s){var n;const{source:r}=await e.load();if(!r.queryExtent)throw new L(s,"Layer source does not support queryExtent capability");return r.queryExtent((n=$n.from(t))!=null?n:e.createQuery(),i)}async function yre(e,t,i,s){const{source:r}=await e.load();if(!r.queryRelatedFeatures)throw new L(s,"Layer source does not support queryRelatedFeatures capability");return r.queryRelatedFeatures(am.from(t),i)}async function gre(e,t,i,s){const{source:r}=await e.load();if(!r.queryRelatedFeaturesCount)throw new L(s,"Layer source does not support queryRelatedFeaturesCount capability");return r.queryRelatedFeaturesCount(am.from(t),i)}async function vre(e){const t=e.source;if(t!=null&&t.refresh)try{const{dataChanged:i,updates:s}=await t.refresh();if(M(s)&&(e.sourceJSON={...e.sourceJSON,...s},e.read(s,{origin:"service",url:e.parsedUrl})),i)return!0}catch{}if(e.definitionExpression)try{return(await ose(e.definitionExpression,e.fieldsIndex)).hasDateFunctions}catch{}return!1}function bre(e){const t=new $n,i=e.get("capabilities.data"),s=e.get("capabilities.query");t.historicMoment=e.historicMoment,t.gdbVersion=e.gdbVersion,t.returnGeometry=!0,s&&(t.compactGeometryEnabled=s.supportsCompactGeometry,t.defaultSpatialReferenceEnabled=s.supportsDefaultSpatialReference),i&&(i.supportsZ&&e.returnZ!=null&&(t.returnZ=e.returnZ),i.supportsM&&e.returnM!=null&&(t.returnM=e.returnM)),t.outFields=["*"];const{timeOffset:r,timeExtent:n}=e;return t.timeExtent=r!=null&&n!=null?n.offset(-r.value,r.unit):n||null,t.multipatchOption=e.geometryType==="multipatch"?"xyFootprint":null,t}function S4(e){const{globalIdField:t,fields:i}=e;if(t)return t;if(i){for(const s of i)if(s.type==="esriFieldTypeGlobalID")return s.name}}function M4(e){const{objectIdField:t,fields:i}=e;if(t)return t;if(i){for(const s of i)if(s.type==="esriFieldTypeOID")return s.name}}function $4(e){return e.currentVersion?e.currentVersion:e.hasOwnProperty("capabilities")||e.hasOwnProperty("drawingInfo")||e.hasOwnProperty("hasAttachments")||e.hasOwnProperty("htmlPopupType")||e.hasOwnProperty("relationships")||e.hasOwnProperty("timeInfo")||e.hasOwnProperty("typeIdField")||e.hasOwnProperty("types")?10:9.3}let eh=class extends xt(W){constructor(e){super(e),this.shapeAreaField=null,this.shapeLengthField=null,this.units=null}};c([h({type:String,json:{read:{source:"shapeAreaFieldName"}}})],eh.prototype,"shapeAreaField",void 0),c([h({type:String,json:{read:{source:"shapeLengthFieldName"}}})],eh.prototype,"shapeLengthField",void 0),c([h({type:String,json:{read:e=>EW.read(e)||kW.read(e)}})],eh.prototype,"units",void 0),eh=c([S("esri.layers.support.GeometryFieldsInfo")],eh);const _re=eh;var z2;let th=z2=class extends W{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new he}clone(){return new z2({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};c([h({type:String,json:{write:!0}})],th.prototype,"floorField",void 0),c([h({json:{read:!1,write:!1}})],th.prototype,"viewAllMode",void 0),c([h({json:{read:!1,write:!1}})],th.prototype,"viewAllLevelIds",void 0),th=z2=c([S("esri.layers.support.LayerFloorInfo")],th);const wre=th,pP=new Ie({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),fP=new Ie({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let qs=class extends xt(W){constructor(e){super(e),this.cardinality=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};c([h({json:{read:pP.read,write:pP.write}})],qs.prototype,"cardinality",void 0),c([h({json:{read:!0,write:!0}})],qs.prototype,"composite",void 0),c([h({json:{read:!0,write:!0}})],qs.prototype,"id",void 0),c([h({json:{read:!0,write:!0}})],qs.prototype,"keyField",void 0),c([h({json:{read:!0,write:!0}})],qs.prototype,"keyFieldInRelationshipTable",void 0),c([h({json:{read:!0,write:!0}})],qs.prototype,"name",void 0),c([h({json:{read:!0,write:!0}})],qs.prototype,"relatedTableId",void 0),c([h({json:{read:!0,write:!0}})],qs.prototype,"relationshipTableId",void 0),c([h({json:{read:fP.read,write:fP.write}})],qs.prototype,"role",void 0),qs=c([S("esri.layers.support.Relationship")],qs);const xre=qs,Sre=e=>{let t=class extends e{constructor(){super(...arguments),this.capabilities=null,this.copyright=null,this.datesInUnknownTimezone=!1,this.displayField=null,this.definitionExpression=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.isTable=!1,this.layerId=void 0,this.minScale=0,this.maxScale=0,this.globalIdField=null,this.objectIdField=null,this.relationships=null,this.sourceJSON=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.spatialReference=xe.WGS84,this.subtypeField=null,this.trackIdField=null,this.indexes=new(he.ofType(yn)),this.userIsAdmin=!1,this.version=void 0}readCapabilitiesFromService(i,s){return x4(i,s,this.url)}readEditingInfo(i,s){const{editingInfo:r}=s;return r?{lastEditDate:r.lastEditDate!=null?new Date(r.lastEditDate):null}:null}readIsTableFromService(i,s){return s.type==="Table"}readMinScale(i,s){return s.effectiveMinScale||i||0}readMaxScale(i,s){return s.effectiveMaxScale||i||0}readGlobalIdFieldFromService(i,s){return S4(s)}readObjectIdFieldFromService(i,s){return M4(s)}readServiceDefinitionExpression(i,s){return s.definitionQuery||s.definitionExpression}set url(i){const s=Cse({layer:this,url:i,nonStandardUrlAllowed:!0,logger:q.getLogger(this.declaredClass)});this._set("url",s.url),s.layerId!=null&&this._set("layerId",s.layerId)}writeUrl(i,s,r,n){Pse(this,i,null,s,n)}readVersion(i,s){return $4(s)}};return c([h({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],t.prototype,"capabilities",void 0),c([Q("service","capabilities")],t.prototype,"readCapabilitiesFromService",null),c([h({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),c([h({type:Boolean})],t.prototype,"datesInUnknownTimezone",void 0),c([h({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],t.prototype,"displayField",void 0),c([h({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],t.prototype,"definitionExpression",void 0),c([h({readOnly:!0})],t.prototype,"editFieldsInfo",void 0),c([h({readOnly:!0})],t.prototype,"editingInfo",void 0),c([Q("editingInfo")],t.prototype,"readEditingInfo",null),c([h((()=>{const i=R(Gse),s=i.json.origins;return s["web-map"]={read:!1,write:!1},s["portal-item"]={read:!1,write:!1},i})())],t.prototype,"elevationInfo",void 0),c([h({type:wre,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],t.prototype,"floorInfo",void 0),c([h({type:Ze,json:{origins:{service:{read:{source:"extent"}}}}})],t.prototype,"fullExtent",void 0),c([h()],t.prototype,"gdbVersion",void 0),c([h({readOnly:!0,type:_re,json:{read:{source:"geometryProperties"}}})],t.prototype,"geometryFieldsInfo",void 0),c([h({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:V2.read}}}})],t.prototype,"geometryType",void 0),c([h({type:Boolean,json:{origins:{service:{read:!0}}}})],t.prototype,"hasM",void 0),c([h({type:Boolean,json:{origins:{service:{read:!0}}}})],t.prototype,"hasZ",void 0),c([h({readOnly:!0,type:Qb})],t.prototype,"heightModelInfo",void 0),c([h({type:Date})],t.prototype,"historicMoment",void 0),c([h({readOnly:!0})],t.prototype,"isTable",void 0),c([Q("service","isTable",["type"])],t.prototype,"readIsTableFromService",null),c([h({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],t.prototype,"layerId",void 0),c([h(Yse)],t.prototype,"minScale",void 0),c([Q("service","minScale",["minScale","effectiveMinScale"])],t.prototype,"readMinScale",null),c([h(Jse)],t.prototype,"maxScale",void 0),c([Q("service","maxScale",["maxScale","effectiveMaxScale"])],t.prototype,"readMaxScale",null),c([h({type:String})],t.prototype,"globalIdField",void 0),c([Q("service","globalIdField",["globalIdField","fields"])],t.prototype,"readGlobalIdFieldFromService",null),c([h({type:String})],t.prototype,"objectIdField",void 0),c([Q("service","objectIdField",["objectIdField","fields"])],t.prototype,"readObjectIdFieldFromService",null),c([h({type:[xre],readOnly:!0})],t.prototype,"relationships",void 0),c([h()],t.prototype,"sourceJSON",void 0),c([h({type:Boolean})],t.prototype,"returnM",void 0),c([h({type:Boolean})],t.prototype,"returnZ",void 0),c([h({readOnly:!0})],t.prototype,"serviceDefinitionExpression",void 0),c([Q("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],t.prototype,"readServiceDefinitionExpression",null),c([h({type:xe,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],t.prototype,"spatialReference",void 0),c([h({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],t.prototype,"subtypeField",void 0),c([h({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],t.prototype,"trackIdField",void 0),c([h({readOnly:!0,json:{write:!1}})],t.prototype,"serverGens",void 0),c([h({type:he.ofType(yn),readOnly:!0})],t.prototype,"indexes",void 0),c([h(Use)],t.prototype,"url",null),c([ie("url")],t.prototype,"writeUrl",null),c([h({readOnly:!0})],t.prototype,"userIsAdmin",void 0),c([h({json:{origins:{service:{read:!0}},read:!1}})],t.prototype,"version",void 0),c([Q("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],t.prototype,"readVersion",null),t=c([S("esri.layers.mixins.FeatureLayerBase")],t),t};let ih=class extends xt(W){constructor(e){super(e),this.expression=null,this.title=null,this.returnType=null}};c([h({type:String,json:{write:!0}})],ih.prototype,"expression",void 0),c([h({type:String,json:{write:!0}})],ih.prototype,"title",void 0),c([h({type:String,json:{write:!0}})],ih.prototype,"returnType",void 0),ih=c([S("esri.layers.support.ExpressionInfo")],ih);const VT=ih;var B2;let no=B2=class extends W{constructor(e){super(e),this.isAutoGenerated=!1,this.name=null,this.alias=null,this.onStatisticField=null,this.onStatisticExpression=null,this.statisticType=null}clone(){return new B2({name:this.name,alias:this.alias,isAutoGenerated:this.isAutoGenerated,onStatisticExpression:R(this.onStatisticExpression),onStatisticField:this.onStatisticField,statisticType:this.statisticType})}};c([h({type:Boolean,json:{write:!0}})],no.prototype,"isAutoGenerated",void 0),c([h({type:String,json:{write:!0}})],no.prototype,"name",void 0),c([h({type:String,json:{write:!0}})],no.prototype,"alias",void 0),c([h({type:String,json:{write:!0}})],no.prototype,"onStatisticField",void 0),c([h({type:VT,json:{write:!0}})],no.prototype,"onStatisticExpression",void 0),c([h({type:String,json:{write:!0}})],no.prototype,"statisticType",void 0),no=B2=c([S("esri.layers.support.AggregateField")],no);const lu=no;let Ka=class extends W{constructor(){super(...arguments),this.type=null}};c([h({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],Ka.prototype,"type",void 0),Ka=c([S("esri.layers.support.FeatureReduction")],Ka);const zT="__begin__",BT="__end__",Mre=new RegExp(zT,"ig"),$re=new RegExp(BT,"ig"),mP=new RegExp("^"+zT,"i"),yP=new RegExp(BT+"$","i"),Cv='"',Tre=Cv+" + ",Ire=" + "+Cv;function Ere(e){return e.replace(new RegExp("\\[","g"),"{").replace(new RegExp("\\]","g"),"}")}function kre(e){return e.replace(new RegExp("\\{","g"),"[").replace(new RegExp("\\}","g"),"]")}function UT(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):e.labelExpression!=null&&(t.expression=Ere(e.labelExpression),t.type="conventional"),t}function Cre(e){const t=UT(e);if(!t)return null;switch(t.type){case"conventional":return U2(t.expression);case"arcade":return t.expression}return null}function Pre(e){const t=UT(e);if(!t)return null;switch(t.type){case"conventional":return Ore(t.expression);case"arcade":return T4(t.expression)}return null}function U2(e){let t;return e?(t=In(e,i=>zT+'$feature["'+i+'"]'+BT),t=mP.test(t)?t.replace(mP,""):Cv+t,t=yP.test(t)?t.replace(yP,""):t+Cv,t=t.replace(Mre,Tre).replace($re,Ire)):t='""',t}const Are=/^\s*\{([^}]+)\}\s*$/i;function Ore(e){const t=e.match(Are);return t&&t[1].trim()||null}const Rre=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*$/i,Lre=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,Fre=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])([\w\s]+)(\1)\s*\));?\s*$/i;function T4(e){if(!e)return null;let t=Rre.exec(e)||Lre.exec(e);return t?t[1]||t[3]:(t=Fre.exec(e),t?t[2]:null)}var q2;let xa=q2=class extends W{constructor(){super(...arguments),this.expression=null,this.title=null,this.value=null}readExpression(e,t){return t.value?U2(t.value):e}writeExpression(e,t,i){this.value!=null&&(e=U2(this.value)),e!=null&&(t[i]=e)}clone(){return new q2({expression:this.expression,title:this.title,value:this.value})}};c([h({type:String,json:{write:{writerEnsuresNonNull:!0}}})],xa.prototype,"expression",void 0),c([Q("expression",["expression","value"])],xa.prototype,"readExpression",null),c([ie("expression")],xa.prototype,"writeExpression",null),c([h({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],xa.prototype,"title",void 0),c([h({json:{read:!1,write:!1}})],xa.prototype,"value",void 0),xa=q2=c([S("esri.layers.support.LabelExpressionInfo")],xa);const I4=xa,E4=[252,146,31,255],Dre={type:"esriSMS",style:"esriSMSCircle",size:6,color:E4,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},Nre={type:"esriSLS",style:"esriSLSSolid",width:.75,color:E4},jre={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},Vre={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},zre={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},Bre={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},Ure={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null},q_e=vl.fromJSON(Dre),G_e=tr.fromJSON(Nre),W_e=gl.fromJSON(jre),qre=gd.fromJSON(Vre),H_e=vl.fromJSON(zre),Y_e=tr.fromJSON(Bre),J_e=gl.fromJSON(Ure);var G2;const Dy=new Ie({esriServerPointLabelPlacementAboveCenter:"above-center",esriServerPointLabelPlacementAboveLeft:"above-left",esriServerPointLabelPlacementAboveRight:"above-right",esriServerPointLabelPlacementBelowCenter:"below-center",esriServerPointLabelPlacementBelowLeft:"below-left",esriServerPointLabelPlacementBelowRight:"below-right",esriServerPointLabelPlacementCenterCenter:"center-center",esriServerPointLabelPlacementCenterLeft:"center-left",esriServerPointLabelPlacementCenterRight:"center-right",esriServerLinePlacementAboveAfter:"above-after",esriServerLinePlacementAboveAlong:"above-along",esriServerLinePlacementAboveBefore:"above-before",esriServerLinePlacementAboveStart:"above-start",esriServerLinePlacementAboveEnd:"above-end",esriServerLinePlacementBelowAfter:"below-after",esriServerLinePlacementBelowAlong:"below-along",esriServerLinePlacementBelowBefore:"below-before",esriServerLinePlacementBelowStart:"below-start",esriServerLinePlacementBelowEnd:"below-end",esriServerLinePlacementCenterAfter:"center-after",esriServerLinePlacementCenterAlong:"center-along",esriServerLinePlacementCenterBefore:"center-before",esriServerLinePlacementCenterStart:"center-start",esriServerLinePlacementCenterEnd:"center-end",esriServerPolygonPlacementAlwaysHorizontal:"always-horizontal"},{ignoreUnknown:!0});function k4(e){var t;return!e||e.origin!=="service"&&((t=e.layer)==null?void 0:t.type)!=="map-image"}function Gre(e){return(e==null?void 0:e.type)==="map-image"}function C4(e){var t,i;return!!Gre(e)&&!!((i=(t=e.capabilities)==null?void 0:t.exportMap)!=null&&i.supportsArcadeExpressionForLabeling)}function Wre(e){return k4(e)||C4(e.layer)}let St=G2=class extends W{constructor(e){super(e),this.type="label",this.name=null,this.allowOverrun=!1,this.deconflictionStrategy="static",this.labelExpression=null,this.labelExpressionInfo=null,this.labelPlacement=null,this.labelPosition="curved",this.maxScale=0,this.minScale=0,this.repeatLabel=!0,this.repeatLabelDistance=null,this.symbol=qre,this.useCodedValues=void 0,this.where=null}static evaluateWhere(e,t){const i=(s,r,n)=>{switch(r){case"=":return s==n;case"<>":return s!=n;case">":return s>n;case">=":return s>=n;case"<":return sWre(i)?{allowNull:!0}:{enabled:!1}}}})],St.prototype,"labelExpressionInfo",void 0),c([ie("labelExpressionInfo")],St.prototype,"writeLabelExpressionInfo",null),c([h({type:Dy.apiValues,json:{type:Dy.jsonValues,read:Dy.read,write:Dy.write}})],St.prototype,"labelPlacement",void 0),c([h({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],St.prototype,"labelPosition",void 0),c([h({type:Number})],St.prototype,"maxScale",void 0),c([ie("maxScale")],St.prototype,"writeMaxScale",null),c([h({type:Number})],St.prototype,"minScale",void 0),c([ie("minScale")],St.prototype,"writeMinScale",null),c([h({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:!1}}}})],St.prototype,"repeatLabel",void 0),c([h({type:Number,cast:Fe,json:{write:!0,origins:{"web-scene":{write:!1}}}})],St.prototype,"repeatLabelDistance",void 0),c([h({types:KZ,json:{origins:{"web-scene":{types:eQ,write:qC,default:null}},write:qC,default:null}})],St.prototype,"symbol",void 0),c([h({type:Boolean,json:{write:!0}})],St.prototype,"useCodedValues",void 0),c([h({type:String,json:{write:!0}})],St.prototype,"where",void 0),St=G2=c([S("esri.layers.support.LabelClass")],St);const Kb=St;var W2;const ww=dl({types:zb}),Hre="esri.layers.support.FeatureReductionBinning";let Ki=W2=class extends Ka{constructor(e){super(e),this.type="binning",this.binType="geohash",this.fixedBinLevel=3,this.labelingInfo=null,this.labelsVisible=!0,this.popupEnabled=!0,this.popupTemplate=null,this.fields=[],this.renderer=null}writeFields(e,t,i){const s=e.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());Ei(i,s,t)}readRenderer(e,t,i){var r,n;const s=(r=t.drawingInfo)==null?void 0:r.renderer;return s?(n=cm(s,t,i))!=null?n:void 0:t.defaultSymbol?t.types&&t.types.length?new Gm({defaultSymbol:ww(t.defaultSymbol,t,i),field:t.typeIdField,uniqueValueInfos:t.types.map(o=>({id:o.id,symbol:ww(o.symbol,o,i)}))}):new Xh({symbol:ww(t.defaultSymbol,t,i)}):null}clone(){return new W2({fields:R(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:R(this.labelingInfo),labelsVisible:this.labelsVisible,popupEnabled:this.popupEnabled,popupTemplate:R(this.popupTemplate),renderer:R(this.renderer)})}};c([ue({binning:"binning"})],Ki.prototype,"type",void 0),c([ue({geohash:"geohash"})],Ki.prototype,"binType",void 0),c([h({type:Number,range:{min:1,max:9},json:{write:!0}})],Ki.prototype,"fixedBinLevel",void 0),c([h({type:[Kb],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],Ki.prototype,"labelingInfo",void 0),c([h(NT)],Ki.prototype,"labelsVisible",void 0),c([h(DT)],Ki.prototype,"popupEnabled",void 0),c([h({type:Dm,json:{name:"popupInfo",write:!0}})],Ki.prototype,"popupTemplate",void 0),c([h({type:[lu],json:{write:!0}})],Ki.prototype,"fields",void 0),c([ie("fields")],Ki.prototype,"writeFields",null),c([h({types:Zb,json:{write:{target:"drawingInfo.renderer"}}})],Ki.prototype,"renderer",void 0),c([Q("renderer",["drawingInfo.renderer"])],Ki.prototype,"readRenderer",null),Ki=W2=c([S(Hre)],Ki);const P4=Ki;var H2;const xw=dl({types:zb}),Yre="esri.layers.support.FeatureReductionCluster";function gP(e){var t;return e.type==="simple"&&!((t=e.visualVariables)!=null&&t.length)}let Xt=H2=class extends W{constructor(e){super(e),this.type="cluster",this.clusterRadius=Fe("80px"),this.clusterMinSize=Fe("12px"),this.clusterMaxSize=Fe("50px"),this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=null}readRenderer(e,t,i){var r,n,o;const s=(r=t.drawingInfo)==null?void 0:r.renderer;return(n=s==null?void 0:s.authoringInfo)!=null&&n.isAutoGenerated?null:s?gP(s)?null:(o=cm(s,t,i))!=null?o:void 0:t.defaultSymbol?t.types&&t.types.length?new Gm({defaultSymbol:xw(t.defaultSymbol,t,i),field:t.typeIdField,uniqueValueInfos:t.types.map(a=>({id:a.id,symbol:xw(a.symbol,a,i)}))}):new Xh({symbol:xw(t.defaultSymbol,t,i)}):null}readSymbol(e,t,i){var r,n,o;const s=(r=t.drawingInfo)==null?void 0:r.renderer;return(n=s==null?void 0:s.authoringInfo)!=null&&n.isAutoGenerated?null:s&&gP(s)?(o=cm(s,t,i))==null?void 0:o.symbol:null}writeSymbol(e,t,i,s){var n,o;const r=(o=(n=this.renderer)==null?void 0:n.authoringInfo)==null?void 0:o.isAutoGenerated;if(!this.renderer||r){const a=new Xh({symbol:e});t.drawingInfo={renderer:a.write({},s)}}}writeFields(e,t,i){const s=e.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());Ei(i,s,t)}readFields(e,t,i){return e.filter(s=>!s.isAutoGenerated).map(s=>lu.fromJSON(s))}clone(){return new H2({clusterRadius:this.clusterRadius,clusterMinSize:this.clusterMinSize,clusterMaxSize:this.clusterMaxSize,labelingInfo:R(this.labelingInfo),labelsVisible:this.labelsVisible,fields:R(this.fields),renderer:R(this.renderer),symbol:R(this.symbol),popupEnabled:this.popupEnabled,popupTemplate:R(this.popupTemplate)})}};c([h({type:["cluster"],readOnly:!0,json:{write:!0}})],Xt.prototype,"type",void 0),c([h({type:Number,cast:e=>e==="auto"?e:Fe(e),json:{write:!0}})],Xt.prototype,"clusterRadius",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],Xt.prototype,"clusterMinSize",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],Xt.prototype,"clusterMaxSize",void 0),c([h(DT)],Xt.prototype,"popupEnabled",void 0),c([h({type:Dm,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],Xt.prototype,"popupTemplate",void 0),c([h({types:Zb,json:{write:{target:"drawingInfo.renderer"}}})],Xt.prototype,"renderer",void 0),c([Q("renderer",["drawingInfo.renderer"])],Xt.prototype,"readRenderer",null),c([h({types:ZZ})],Xt.prototype,"symbol",void 0),c([Q("symbol",["drawingInfo.renderer"])],Xt.prototype,"readSymbol",null),c([ie("symbol")],Xt.prototype,"writeSymbol",null),c([h({type:[Kb],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],Xt.prototype,"labelingInfo",void 0),c([h(NT)],Xt.prototype,"labelsVisible",void 0),c([h({type:[lu],json:{write:!0}})],Xt.prototype,"fields",void 0),c([ie("fields")],Xt.prototype,"writeFields",null),c([Q("fields")],Xt.prototype,"readFields",null),Xt=H2=c([S(Yre)],Xt);const A4=Xt;var Y2;let l0=Y2=class extends Ka{constructor(e){super(e),this.type="selection"}clone(){return new Y2}};c([h({type:["selection"]})],l0.prototype,"type",void 0),l0=Y2=c([S("esri.layers.support.FeatureReductionSelection")],l0);const vP=l0,bP={key:"type",base:Ka,typeMap:{cluster:A4,binning:P4}},Jre={types:{key:"type",base:Ka,typeMap:{selection:vP,cluster:A4,binning:P4}},json:{name:"layerDefinition.featureReduction",write:{allowNull:!0},origins:{"web-map":{types:bP},"portal-item":{types:bP},"web-scene":{types:{key:"type",base:Ka,typeMap:{selection:vP}}}}}},_u={Base64:0,Hex:1,String:2,Raw:3},Lh=8,O4=(1<>16)+(t>>16)+(i>>16)<<16|65535&i}function Xre(e){const t=[];for(let i=0,s=e.length*Lh;i>5]|=(e.charCodeAt(i/Lh)&O4)<>5]>>>i%32&O4));return t.join("")}function Qre(e){const t="0123456789abcdef",i=[];for(let s=0,r=4*e.length;s>2]>>s%4*8+4&15)+t.charAt(e[s>>2]>>s%4*8&15));return i.join("")}function Kre(e){const t="=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=[];for(let r=0,n=4*e.length;r>2]>>r%4*8&255)<<16|(e[r+1>>2]>>(r+1)%4*8&255)<<8|e[r+2>>2]>>(r+2)%4*8&255;for(let a=0;a<4;a++)8*r+6*a>32*e.length?s.push(t):s.push(i.charAt(o>>6*(3-a)&63))}return s.join("")}function ene(e,t){return e<>>32-t}function e_(e,t,i,s,r,n){return Wa(ene(Wa(Wa(t,e),Wa(s,n)),r),i)}function gi(e,t,i,s,r,n,o){return e_(t&i|~t&s,e,t,r,n,o)}function vi(e,t,i,s,r,n,o){return e_(t&s|i&~s,e,t,r,n,o)}function bi(e,t,i,s,r,n,o){return e_(t^i^s,e,t,r,n,o)}function _i(e,t,i,s,r,n,o){return e_(i^(t|~s),e,t,r,n,o)}function tne(e,t){e[t>>5]|=128<>>9<<4)]=t;let i=1732584193,s=-271733879,r=-1732584194,n=271733878;for(let o=0;oe.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions&&this.legendOptions.clone(),levels:R(this.levels)})}};c([h()],Bp.prototype,"levels",void 0),c([ie("levels")],Bp.prototype,"writeLevels",null),Bp=J2=c([S("esri.views.2d.engine.LevelDependentSizeVariable")],Bp);const ine=q.getLogger("esri.views.2d.layers.support.clusterUtils");V.add("esri-cluster-arcade-enabled",!0);const sne=V("esri-cluster-arcade-enabled"),rne=(e,t,i,s,r)=>{const n=t.clone();if(!one(n))return n;if(n.authoringInfo||(n.authoringInfo=new kT),n.authoringInfo.isAutoGenerated=!0,"visualVariables"in n){const o=(n.visualVariables||[]).filter(l=>l.valueExpression!=="$view.scale"),a=L4(o);o.forEach(l=>{l.type==="rotation"?l.field?l.field=xl(e,l.field,"avg_angle","number"):l.valueExpression&&(l.field=Bd(e,l.valueExpression,"avg_angle","number"),l.valueExpression=null):l.normalizationField?(l.field=xl(e,l.field,"avg_norm","number",l.normalizationField),l.normalizationField=null):l.field?l.field=xl(e,l.field,"avg","number"):l.valueExpression&&(l.field=Bd(e,l.valueExpression,"avg","number"),l.valueExpression=null)}),N(a)&&!nne(o)&&r&&(o.push(F4(i,s)),n.dynamicClusterSize=!0),n.visualVariables=o}switch(n.type){case"simple":break;case"pie-chart":for(const o of n.attributes)o.field?o.field=xl(e,o.field,"sum","number"):o.valueExpression&&(o.field=Bd(e,o.valueExpression,"sum","number"),o.valueExpression=null);break;case"unique-value":n.field?n.field=xl(e,n.field,"mode","string"):n.valueExpression&&(n.field=Bd(e,n.valueExpression,"mode","string"),n.valueExpression=null);break;case"class-breaks":n.normalizationField?(n.field=xl(e,n.field,"avg_norm","number",n.normalizationField),n.normalizationField=null):n.field?n.field=xl(e,n.field,"avg","number"):n.valueExpression&&(n.field=Bd(e,n.valueExpression,"avg","number"),n.valueExpression=null)}return n},L4=e=>{for(const t of e)if(t.type==="size")return t;return null};function X_e(e,t,i){const s=e.clone();let r=!1;if("visualVariables"in s){const n=(s.visualVariables||[]).filter(a=>a.valueExpression!=="$view.scale"),o=L4(n);N(o)&&(s.visualVariables||(s.visualVariables=[]),s.visualVariables.push(F4(t,i)),s.dynamicClusterSize=!0,r=!0)}return{renderer:s,didInject:r}}const nne=e=>{for(const t of e)if(t.field==="cluster_count")return!0;return!1},F4=(e,t)=>{const i=[new Yu({value:0,size:0}),new Yu({value:1})];if(N(t))return new Jb({field:"cluster_count",stops:[...i,new Yu({value:2,size:0})]});const s=Object.keys(t).reduce((r,n)=>({...r,[n]:[...i,new Yu({value:Math.max(2,t[n].minValue),size:e.clusterMinSize}),new Yu({value:Math.max(3,t[n].maxValue),size:e.clusterMaxSize})]}),{});return new Bp({field:"cluster_count",levels:s})},one=e=>{const t=i=>ine.error(new L("Unsupported-renderer",i,{renderer:e}));switch(e.type){case"unique-value":if(e.field2||e.field3)return t("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1;break;case"class-breaks":if(e.normalizationField){const i=e.normalizationType;if(i!=="field")return t(`FeatureReductionCluster does not support a normalizationType of ${i}`),!1;break}case"simple":case"pie-chart":break;default:return t(`FeatureReductionCluster does not support renderers of type ${e.type}`),!1}if(!sne){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(i=>!(!("valueExpression"in i)||!i.valueExpression)))return t("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0};function ane(e,t,i){switch(e){case"sum":return`cluster_sum_${t}`;case"avg":case"avg_angle":return`cluster_avg_${t}`;case"mode":return`cluster_type_${t}`;case"avg_norm":{const s=i,r="field",n=t.toLowerCase()+",norm:"+r+","+s.toLowerCase();return"cluster_avg_"+R4(n)}}}function Bd(e,t,i,s){const r=R4(t),n=i==="mode"?`cluster_type_${r}`:i==="sum"?`cluster_sum_${r}`:`cluster_avg_${r}`;return e.some(o=>o.name===n)||e.push(new lu({name:n,isAutoGenerated:!0,onStatisticExpression:new VT({expression:t,returnType:s}),statisticType:i})),n}function xl(e,t,i,s,r){if(t==="cluster_count"||e.some(o=>o.name===t))return t;const n=ane(i,t,r);return e.some(o=>o.name===n)||(i==="avg_norm"?e.push(new lu({name:n,isAutoGenerated:!0,onStatisticExpression:new VT({expression:`$feature.${t} / $feature.${r}`,returnType:s}),statisticType:"avg"})):e.push(new lu({name:n,isAutoGenerated:!0,onStatisticField:t,statisticType:i}))),n}const lne=e=>{let t=class extends e{constructor(...i){super(...i),this.own(this.watch("renderer",()=>{if(this.featureReduction){const s=this._normalizeFeatureReduction(this.featureReduction);this._set("featureReduction",s)}},!0))}set featureReduction(i){const s=this._normalizeFeatureReduction(i);this._set("featureReduction",s)}set renderer(i){}_normalizeFeatureReduction(i){var a,l;if((i==null?void 0:i.type)!=="cluster")return i;const s=i.clone(),r=[new lu({name:"cluster_count",isAutoGenerated:!0,statisticType:"count"})],n=((a=s.fields)!=null?a:[]).filter(u=>!u.isAutoGenerated);if(i.renderer&&!((l=i.renderer.authoringInfo)!=null&&l.isAutoGenerated))return s.fields=[...r,...n],s;if(i.symbol)return s.fields=[...r,...n],s.renderer=null,s;if(!this.renderer)return i;const o=rne(r,this.renderer,i,null,!1);return s.fields=[...r,...n],s.renderer=o,s}};return c([h(Jre)],t.prototype,"featureReduction",null),t=c([S("esri.layers.mixins.FeatureReductionLayer")],t),t},cne={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,GroupLayer:!0,IntegratedMeshLayer:!0,OGCFeatureLayer:!0,PointCloudLayer:!0,WebTiledLayer:!0,CSV:!0,GeoJSON:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,KML:!0,RasterDataLayer:!0,Voxel:!0,LineOfSightLayer:!0},"web-scene/basemap":{ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,WebTiledLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,ArcGISImageServiceLayer:!0,WMS:!0,ArcGISMapServiceLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-map/operational-layers":{ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CSV:!0,GeoRSS:!0,GeoJSON:!0,GroupLayer:!0,KML:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},"web-map/basemap":{ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0,BingMapsAerial:!0,BingMapsRoad:!0,BingMapsHybrid:!0},"web-map/tables":{ArcGISFeatureLayer:!0},"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISSceneServiceLayer:!0,PointCloudLayer:!0,BuildingSceneLayer:!0,IntegratedMeshLayer:!0,OrientedImageryLayer:!0}},une=e=>{let t=class extends e{constructor(){super(...arguments),this.title=null}writeListMode(i,s,r,n){(n&&n.layerContainerType==="ground"||i&&rW(this,r,{},n))&&(s[r]=i)}writeOperationalLayerType(i,s,r,n){!i||n&&n.layerContainerType==="tables"||(s.layerType=i)}writeTitle(i,s){s.title=i!=null?i:"Layer"}read(i,s){s&&(s.layer=this),tW(this,i,r=>super.read(i,r),s)}write(i,s){var o,a;if(s!=null&&s.origin){const l=`${s.origin}/${s.layerContainerType||"operational-layers"}`,u=cne[l];let d=u&&u[this.operationalLayerType];if(this.operationalLayerType==="ArcGISTiledElevationServiceLayer"&&l==="web-scene/operational-layers"&&(d=!1),this.operationalLayerType==="ArcGISDimensionLayer"&&l==="web-map/operational-layers"&&(d=!1),!d)return(o=s.messages)==null||o.push(new L("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${l}'`,{layer:this})),null}const r=super.write(i,{...s,layer:this}),n=!!s&&!!s.messages&&!!s.messages.filter(l=>l instanceof L&&l.name==="web-document-write:property-required").length;return ab(r==null?void 0:r.url)?((a=s==null?void 0:s.messages)==null||a.push(new L("layer:invalid-url",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Blob URL cannot be written to web scenes and web maps`,{layer:this})),null):!this.url&&n?null:r}beforeSave(){}};return c([h({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],t.prototype,"id",void 0),c([h(w4)],t.prototype,"listMode",void 0),c([ie("listMode")],t.prototype,"writeListMode",null),c([h({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1}}}})],t.prototype,"operationalLayerType",void 0),c([ie("operationalLayerType")],t.prototype,"writeOperationalLayerType",null),c([h(a0)],t.prototype,"opacity",void 0),c([h({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],t.prototype,"title",void 0),c([ie("title"),ie(["web-scene"],"title")],t.prototype,"writeTitle",null),c([h({type:Boolean,json:{name:"visibility"}})],t.prototype,"visible",void 0),t=c([S("esri.layers.mixins.OperationalLayer")],t),t};var X2;const Sw=new Ie({asc:"ascending",desc:"descending"});let sh=X2=class extends W{constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new X2({field:this.field,valueExpression:this.valueExpression,order:this.order})}};c([h({type:String,json:{write:!0}})],sh.prototype,"field",void 0),c([h({type:String,json:{write:!0}})],sh.prototype,"valueExpression",void 0),c([h({type:Sw.apiValues,json:{read:Sw.read,write:Sw.write}})],sh.prototype,"order",void 0),sh=X2=c([S("esri.layers.support.OrderByInfo")],sh);const D4=sh;function hne(e,t,i){if(!e)return null;const s=e.find(n=>!!n.field);if(!s)return null;const r=new D4;return r.read(s,i),[r]}function dne(e,t,i,s){const r=e.find(n=>!!n.field);r&&Ei(i,[r.toJSON()],t)}const pne=e=>{let t=class extends e{constructor(){super(...arguments),this.orderBy=null}};return c([h({type:[D4],json:{origins:{"web-scene":{write:!1,read:!1}},read:{source:"layerDefinition.orderBy",reader:hne},write:{target:"layerDefinition.orderBy",writer:dne}}})],t.prototype,"orderBy",void 0),t=c([S("esri.layers.mixins.OrderedLayer")],t),t},fne=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){this.portalItem=$t(this.portalItem)}set portalItem(i){i!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",i))}readPortalItem(i,s,r){if(s.itemId)return new fv({id:s.itemId,portal:r&&r.portal})}writePortalItem(i,s){i&&i.id&&(s.itemId=i.id)}async loadFromPortal(i,s){if(this.portalItem&&this.portalItem.id)try{const r=await z(()=>import("./layersLoader.67118e89.js").then(function(n){return n.l}),["assets/layersLoader.67118e89.js","assets/jsonContext.3176ed6f.js","assets/portalItemUtils.57ded807.js"]);return Ft(s),await r.load({instance:this,supportedTypes:i.supportedTypes,validateItem:i.validateItem,supportsData:i.supportsData,layerModuleTypeMap:i.layerModuleTypeMap},s)}catch(r){throw Ks(r)||q.getLogger(this.declaredClass).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id}) - ${r}`),r}}async finishLoadEditablePortalLayer(i){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(i).catch(s=>(Em(s),!0)))}async _fetchUserHasEditingPrivileges(i){const s=this.url?bt==null?void 0:bt.findCredential(this.url):null;if(!s)return!0;const r=Ny.credential===s?Ny.user:await this._fetchEditingUser(i);return Ny.credential=s,Ny.user=r,N(r)||r.privileges==null||r.privileges.includes("features:user:edit")}async _fetchEditingUser(i){var d,f,m;const s=(f=(d=this.portalItem)==null?void 0:d.portal)==null?void 0:f.user;if(s)return s;const r=bt.findServerInfo((m=this.url)!=null?m:"");if(!(r!=null&&r.owningSystemUrl))return null;const n=`${r.owningSystemUrl}/sharing/rest`,o=cs.getDefault();if(o&&o.loaded&&Zs(o.restUrl)===Zs(n))return o.user;const a=`${n}/community/self`,l=M(i)?i.signal:null,u=await xb(kt(a,{authMode:"no-prompt",query:{f:"json"},signal:l}));return u.ok?R$.fromJSON(u.value.data):null}read(i,s){s&&(s.layer=this),super.read(i,s)}write(i,s){const r=s&&s.portal,n=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||cs.getDefault());return r&&n&&!yR(n.restUrl,r.restUrl)?(s.messages&&s.messages.push(new L("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(i,{...s,layer:this})}};return c([h({type:fv})],t.prototype,"portalItem",null),c([Q("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),c([ie("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),c([h({clonable:!1})],t.prototype,"resourceReferences",void 0),c([h({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=c([S("esri.layers.mixins.PortalLayer")],t),t},Ny={credential:null,user:null};let Up=class extends oe{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};c([h()],Up.prototype,"updating",void 0),c([h()],Up.prototype,"status",void 0),Up=c([S("esri.layers.support.PublishingInfo")],Up);const mne=Up,yne="esri.layers.mixins.PublishableLayer",gne=e=>{let t=class extends e{get publishingInfo(){if(this.destroyed)return null;const i=this._get("publishingInfo");if(i)return i;const s=new mne;return this._checkPublishingStatus(s),s}_checkPublishingStatus(i){let n=0;const o=async l=>{let u;i.updating=!0;try{u=await this.fetchPublishingStatus()}catch{u="unavailable"}u!=="published"&&u!=="unavailable"||(i.status==="publishing"&&this.refresh(),a.remove()),i.status=u,i.updating=!1,a.removed||(n=setTimeout(o,l,l+125))},a={removed:!1,remove(){this.removed=!0,clearTimeout(n)}};this.when().catch(()=>a.remove()),o(250),this.own(a)}};return c([h({readOnly:!0,clonable:!1})],t.prototype,"publishingInfo",null),t=c([S(yne)],t),t},um=new he,Tf=new WeakMap;function vne(e){N4(e)&&um.push(e)}function bne(e){N4(e)&&um.includes(e)&&um.remove(e)}function N4(e){return e!=null&&typeof e=="object"&&"refreshInterval"in e&&"refresh"in e}function j4(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:j4(t,e%t):0}let Mw=0,jy=0;function _ne(){var t;const e=Date.now();for(const i of um)i.refreshInterval&&e-((t=Tf.get(i))!=null?t:0)+5>=6e4*i.refreshInterval&&(Tf.set(i,e),i.refresh(e))}NR(()=>{const e=Date.now();let t=0;for(const i of um)t=j4(Math.round(6e4*i.refreshInterval),t),i.refreshInterval?Tf.get(i)||Tf.set(i,e):Tf.delete(i);if(t!==jy){if(jy=t,clearInterval(Mw),jy===0)return void(Mw=0);Mw=setInterval(_ne,jy)}});const wne=e=>{let t=class extends e{constructor(...i){super(...i),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=cR(()=>this.hasDataChanged()),this.when().then(()=>{vne(this)},()=>{})}destroy(){bne(this)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(i=Date.now()){wh(this._debounceHasDataChanged()).then(s=>{s&&this._set("refreshTimestamp",i),this.emit("refresh",{dataChanged:s})},s=>{q.getLogger(this.declaredClass).error(s),this.emit("refresh",{dataChanged:!1,error:s})})}async hasDataChanged(){return!0}};return c([h({type:Number,cast:i=>i>=.1?i:i<=0?0:.1,json:{write:!0}})],t.prototype,"refreshInterval",void 0),c([h({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),c([h()],t.prototype,"refreshParameters",null),t=c([S("esri.layers.mixins.RefreshableLayer")],t),t},Dc=mi()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0});var Z2;let qp=Z2=class extends W{constructor(e){super(e),this.value=0,this.unit="milliseconds"}toMilliseconds(){return tte(this.value,this.unit,"milliseconds")}clone(){return new Z2({value:this.value,unit:this.unit})}};c([h({type:Number,json:{write:!0},nonNullable:!0})],qp.prototype,"value",void 0),c([h({type:Dc.apiValues,json:{type:Dc.jsonValues,read:Dc.read,write:Dc.write},nonNullable:!0})],qp.prototype,"unit",void 0),qp=Z2=c([S("esri.TimeInterval")],qp);const hm=qp;var Q2;let rh=Q2=class extends W{constructor(e){super(e),this.respectsDaylightSaving=!1,this.timezone=null}readRespectsDaylightSaving(e,t){return t.respectsDaylightSaving!==void 0?t.respectsDaylightSaving:t.respectDaylightSaving!==void 0&&t.respectDaylightSaving}clone(){const{respectsDaylightSaving:e,timezone:t}=this;return new Q2({respectsDaylightSaving:e,timezone:t})}};c([h({type:Boolean,json:{write:!0}})],rh.prototype,"respectsDaylightSaving",void 0),c([Q("respectsDaylightSaving",["respectsDaylightSaving","respectDaylightSaving"])],rh.prototype,"readRespectsDaylightSaving",null),c([h({type:String,json:{read:{source:"timeZone"},write:{target:"timeZone"}}})],rh.prototype,"timezone",void 0),rh=Q2=c([S("esri.layers.support.TimeReference")],rh);const xne=rh;var K2;let Mi=K2=class extends W{constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeReference=null,this.trackIdField=null,this.useTime=!0}readFullTimeExtent(e,t){if(!t.timeExtent||!Array.isArray(t.timeExtent)||t.timeExtent.length!==2)return null;const i=new Date(t.timeExtent[0]),s=new Date(t.timeExtent[1]);return new Ln({start:i,end:s})}writeFullTimeExtent(e,t){e&&M(e.start)&&M(e.end)?t.timeExtent=[e.start.getTime(),e.end.getTime()]:t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?new hm({value:t.timeInterval,unit:Dc.fromJSON(t.timeIntervalUnits)}):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?new hm({value:t.defaultTimeInterval,unit:Dc.fromJSON(t.defaultTimeIntervalUnits)}):null}writeInterval(e,t){if(e){const i=e.toJSON();t.timeInterval=i.value,t.timeIntervalUnits=i.unit}else t.timeInterval=null,t.timeIntervalUnits=null}clone(){const{cumulative:e,endField:t,hasLiveData:i,interval:s,startField:r,timeReference:n,fullTimeExtent:o,trackIdField:a,useTime:l}=this;return new K2({cumulative:e,endField:t,hasLiveData:i,interval:s,startField:r,timeReference:R(n),fullTimeExtent:R(o),trackIdField:a,useTime:l})}};c([h({type:Boolean,json:{read:{source:"exportOptions.timeDataCumulative"},write:{target:"exportOptions.timeDataCumulative"}}})],Mi.prototype,"cumulative",void 0),c([h({type:String,json:{read:{source:"endTimeField"},write:{target:"endTimeField",allowNull:!0}}})],Mi.prototype,"endField",void 0),c([h({type:Ln,json:{write:{enabled:!0,allowNull:!0}}})],Mi.prototype,"fullTimeExtent",void 0),c([Q("fullTimeExtent",["timeExtent"])],Mi.prototype,"readFullTimeExtent",null),c([ie("fullTimeExtent")],Mi.prototype,"writeFullTimeExtent",null),c([h({type:Boolean,json:{write:!0}})],Mi.prototype,"hasLiveData",void 0),c([h({type:hm,json:{write:{enabled:!0,allowNull:!0}}})],Mi.prototype,"interval",void 0),c([Q("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],Mi.prototype,"readInterval",null),c([ie("interval")],Mi.prototype,"writeInterval",null),c([h({type:String,json:{read:{source:"startTimeField"},write:{target:"startTimeField",allowNull:!0}}})],Mi.prototype,"startField",void 0),c([h({type:xne,json:{write:{enabled:!0,allowNull:!0}}})],Mi.prototype,"timeReference",void 0),c([h({type:String,json:{write:{enabled:!0,allowNull:!0}}})],Mi.prototype,"trackIdField",void 0),c([h({type:Boolean,json:{read:{source:"exportOptions.useTime"},write:{target:"exportOptions.useTime"}}})],Mi.prototype,"useTime",void 0),Mi=K2=c([S("esri.layers.support.TimeInfo")],Mi);const V4=Mi,Sne=e=>{let t=class extends e{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(i,s){const r=s.timeInfo.exportOptions;if(!r)return null;const n=r.timeOffset,o=Dc.fromJSON(r.timeOffsetUnits);return n&&o?new hm({value:n,unit:o}):null}set timeInfo(i){AD(i,this.fieldsIndex),this._set("timeInfo",i)}};return c([h({type:Ln,json:{write:!1}})],t.prototype,"timeExtent",void 0),c([h({type:hm})],t.prototype,"timeOffset",void 0),c([Q("service","timeOffset",["timeInfo.exportOptions"])],t.prototype,"readOffset",null),c([h({value:null,type:V4,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],t.prototype,"timeInfo",null),c([h({type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation"},origins:{"web-scene":{read:!1,write:!1}}}})],t.prototype,"useViewTime",void 0),t=c([S("esri.layers.mixins.TemporalLayer")],t),t},_P=new Ie({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let Sa=class extends xt(W){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};c([h({json:{write:!0}})],Sa.prototype,"name",void 0),c([h({json:{write:!0}})],Sa.prototype,"description",void 0),c([h({json:{read:_P.read,write:_P.write}})],Sa.prototype,"drawingTool",void 0),c([h({json:{write:!0}})],Sa.prototype,"prototype",void 0),c([h({json:{write:!0}})],Sa.prototype,"thumbnail",void 0),Sa=c([S("esri.layers.support.FeatureTemplate")],Sa);const qT=Sa;let oo=class extends xt(W){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const i of Object.keys(e))t[i]=bT(e[i]);return t}writeDomains(e,t){var s;const i={};for(const r of Object.keys(e))e[r]&&(i[r]=(s=e[r])==null?void 0:s.toJSON());t.domains=i}};c([h({json:{write:!0}})],oo.prototype,"id",void 0),c([h({json:{write:!0}})],oo.prototype,"name",void 0),c([h({json:{write:!0}})],oo.prototype,"domains",void 0),c([Q("domains")],oo.prototype,"readDomains",null),c([ie("domains")],oo.prototype,"writeDomains",null),c([h({type:[qT],json:{write:!0}})],oo.prototype,"templates",void 0),oo=c([S("esri.layers.support.FeatureType")],oo);const z4=oo;function Mne(e){return e.type==="date"||e.type==="esriFieldTypeDate"}function wP(e){return e.type==="oid"||e.type==="esriFieldTypeOID"}function xP(e){return e.type==="global-id"||e.type==="esriFieldTypeGlobalID"}class $ne{constructor(t=[]){if(this.fields=[],this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this.dateFields=[],this.numericFields=[],this._requiredFields=null,!t)return;this.fields=t;const i=[];for(const s of t){const r=s&&s.name;if(r){const n=SP(r),o=MP(r);this._fieldsMap.set(r,s),this._fieldsMap.set(n,s),this._normalizedFieldsMap.set(o,s),i.push(n),Mne(s)?(this.dateFields.push(s),this._dateFieldsSet.add(s)):Y$(s)&&(this._numericFieldsSet.add(s),this.numericFields.push(s)),wP(s)||xP(s)||(s.editable=s.editable==null||!!s.editable,s.nullable=s.nullable==null||!!s.nullable)}}i.sort(),this.uid=i.join(",")}destroy(){this._fieldsMap.clear()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const t of this.fields)wP(t)||xP(t)||t.nullable||DX(t)!==void 0||this._requiredFields.push(t)}return this._requiredFields}has(t){return this.get(t)!=null}get(t){var s;if(!t)return;let i=this._fieldsMap.get(t);return i||(i=(s=this._fieldsMap.get(SP(t)))!=null?s:this._normalizedFieldsMap.get(MP(t)),i&&this._fieldsMap.set(t,i),i)}isDateField(t){return this._dateFieldsSet.has(this.get(t))}isNumericField(t){return this._numericFieldsSet.has(this.get(t))}normalizeFieldName(t){var s;const i=this.get(t);if(i)return(s=i.name)!=null?s:void 0}}function SP(e){return e.trim().toLowerCase()}function MP(e){return EX(e).toLowerCase()}function Tne(){return{fields:{type:[_T],value:null},fieldsIndex:{readOnly:!0,get(){return new $ne(this.fields||[])}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){var t;const e=this._userOutFields;if(!e||!e.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const i of e)((t=this.fieldsIndex)==null?void 0:t.has(i))||q.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${i} found in outFields`,{layer:this,outFields:e});return OD(this.fieldsIndex,e)}}}}const $w=q.getLogger("esri.layers.support.labelingInfo"),Ine=/\[([^\[\]]+)\]/gi;function $P(e,t,i){return e?e.map(s=>{const r=new Kb;if(r.read(s,i),r.labelExpression){const n=t.fields||t.layerDefinition&&t.layerDefinition.fields||this.fields;r.labelExpression=r.labelExpression.replace(Ine,(o,a)=>`[${Ene(a,n)}]`)}return r}):null}function Ene(e,t){if(!t)return e;const i=e.toLowerCase();for(let s=0;sCne(s,t))?[]:i}function Cne(e,t){const i=e.labelPlacement,s=kne[t];if(!e.symbol)return $w.warn("No ILabelClass symbol specified."),!0;if(!s)return $w.error(new L("labeling:unsupported-geometry-type",`Unable to create labels for layer, geometry type '${t}' is not supported`)),!0;if(!s.includes(i)){const r=s[0];i&&$w.warn(`Found invalid label placement type ${i} for ${t}. Defaulting to ${r}`),e.labelPlacement=r}return!1}const Mr=[];function Pne(e,t){var s,r;if(g4((s=e.url)!=null?s:""))return!0;const{wkid:i}=t;for(const n of Mr){if(((r=e.version)!=null?r:0)>=n[0])return!0;if(typeof n[1]=="function"&&(n[1]=n[1]()),n[1].has(i))return!1}return!0}Mr.push([10.91,()=>{const e=new Set([9709,9716,9741,9761,9766]);for(let t=9712;t<=9713;t++)e.add(t);for(let t=9748;t<=9749;t++)e.add(t);for(let t=20904;t<=20932;t++)e.add(t);for(let t=21004;t<=21032;t++)e.add(t);for(let t=21207;t<=21264;t++)e.add(t);for(let t=21307;t<=21364;t++)e.add(t);for(let t=102759;t<=102760;t++)e.add(t);for(let t=102901;t<=102955;t++)e.add(t);return e}]),Mr.push([10.9,()=>{const e=new Set([9300,9354,9364,9367,9373,9377,9387,9456,9473,9498,9678,9680,29874,103599,103872,104028]);for(let t=9356;t<=9360;t++)e.add(t);for(let t=9404;t<=9407;t++)e.add(t);for(let t=9476;t<=9482;t++)e.add(t);for(let t=9487;t<=9494;t++)e.add(t);for(let t=9697;t<=9699;t++)e.add(t);return e}]),Mr.push([10.81,()=>{const e=new Set([9265,9333,103598,103699]);for(let t=9248;t<=9254;t++)e.add(t);for(let t=9271;t<=9273;t++)e.add(t);for(let t=9284;t<=9285;t++)e.add(t);for(let t=21453;t<=21463;t++)e.add(t);return e}]),Mr.push([10.8,()=>{const e=new Set([8088,8395,8428,8433,8531,8687,8692,8694,8699,8900,9003,9006,9009,9012,9017,9191]);for(let t=8035;t<=8036;t++)e.add(t);for(let t=8455;t<=8456;t++)e.add(t);for(let t=8518;t<=8529;t++)e.add(t);for(let t=8533;t<=8536;t++)e.add(t);for(let t=8538;t<=8540;t++)e.add(t);for(let t=8677;t<=8679;t++)e.add(t);for(let t=8902;t<=8903;t++)e.add(t);for(let t=8907;t<=8910;t++)e.add(t);for(let t=8949;t<=8951;t++)e.add(t);for(let t=8972;t<=8987;t++)e.add(t);for(let t=9039;t<=9040;t++)e.add(t);for(let t=9068;t<=9069;t++)e.add(t);for(let t=9140;t<=9141;t++)e.add(t);for(let t=9148;t<=9150;t++)e.add(t);for(let t=9153;t<=9159;t++)e.add(t);for(let t=9205;t<=9218;t++)e.add(t);for(let t=9221;t<=9222;t++)e.add(t);for(let t=54098;t<=54101;t++)e.add(t);return e}]),Mr.push([10.71,()=>{const e=new Set([6316]);for(let t=8351;t<=8353;t++)e.add(t);for(let t=9294;t<=9297;t++)e.add(t);for(let t=103586;t<=103594;t++)e.add(t);for(let t=103696;t<=103698;t++)e.add(t);return e}]),Mr.push([10.7,()=>{const e=new Set([8387,8391,8427,8545,8682,8685,8818,31370,104022,104024,104975]);for(let t=8065;t<=8068;t++)e.add(t);for(let t=8082;t<=8083;t++)e.add(t);for(let t=8379;t<=8385;t++)e.add(t);for(let t=8836;t<=8840;t++)e.add(t);for(let t=8857;t<=8860;t++)e.add(t);for(let t=53035;t<=53037;t++)e.add(t);for(let t=54090;t<=54091;t++)e.add(t);for(let t=102498;t<=102499;t++)e.add(t);return e}]),Mr.push([10.61,()=>new Set([102497])]),Mr.push([10.6,()=>{const e=new Set([7803,7805,7887,8086,8232,8237,8240,8246,8249,8252,8255,9019,9391]);for(let t=7755;t<=7787;t++)e.add(t);for(let t=7791;t<=7795;t++)e.add(t);for(let t=7799;t<=7801;t++)e.add(t);for(let t=7825;t<=7831;t++)e.add(t);for(let t=7877;t<=7878;t++)e.add(t);for(let t=7882;t<=7883;t++)e.add(t);for(let t=7991;t<=7992;t++)e.add(t);for(let t=8042;t<=8043;t++)e.add(t);for(let t=8058;t<=8059;t++)e.add(t);for(let t=8311;t<=8348;t++)e.add(t);for(let t=9060;t<=9067;t++)e.add(t);for(let t=102562;t<=102568;t++)e.add(t);for(let t=102799;t<=102900;t++)e.add(t);return e}]),Mr.push([10.51,()=>{const e=new Set([7683,7881,7886,7899,8888,9e3]);for(let t=8013;t<=8032;t++)e.add(t);for(let t=9053;t<=9057;t++)e.add(t);for(let t=104017;t<=104018;t++)e.add(t);for(let t=104971;t<=104974;t++)e.add(t);return e}]),Mr.push([10.5,()=>{const e=new Set([6962,7035,7037,7039,7041,7084,7086,7133,7798,102399]);for(let t=4087;t<=4088;t++)e.add(t);for(let t=5896;t<=5899;t++)e.add(t);for(let t=7005;t<=7007;t++)e.add(t);for(let t=7057;t<=7070;t++)e.add(t);for(let t=7073;t<=7082;t++)e.add(t);for(let t=7109;t<=7128;t++)e.add(t);for(let t=7844;t<=7859;t++)e.add(t);return e}]);async function Ane(e,t,i){const s=e&&e.getAtOrigin&&e.getAtOrigin("renderer",t.origin);if(s&&s.type==="unique-value"&&s.styleOrigin){const r=await xb(s.populateFromStyle());if(Ft(i),r.ok===!1){const n=r.error;t&&t.messages&&t.messages.push(new Bi("renderer:style-reference",`Failed to create unique value renderer from style reference: ${n.message}`,{error:n,context:t})),e.clear("renderer",t==null?void 0:t.origin)}}}const One=["oid","global-id"],Rne=["oid","global-id","guid"];function Lne({displayField:e,editFieldsInfo:t,fields:i,objectIdField:s,title:r},n){if(!i)return null;const o=zne({editFieldsInfo:t,fields:i,objectIdField:s},n);if(!o.length)return null;const a=qne({titleBase:r,fields:i,displayField:e}),l=Une();return new Dm({title:a,content:l,fieldInfos:o})}const Fne=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/shape/i,/perimeter/i,/objectid/i,/_i$/i],Dne=(e,{editFieldsInfo:t,objectIdField:i,visibleFieldNames:s})=>s?s.has(e.name):!B4(e.name,t)&&(!i||e.name!==i)&&!One.includes(e.type)&&!Fne.some(r=>r.test(e.name));function Nne(e,t){const i=e;return t&&(e=e.filter(s=>!t.includes(s.type))),e===i&&(e=e.slice()),e.sort(jne),e}function jne(e,t){return e.type==="oid"?-1:t.type==="oid"?1:TP(e)?-1:TP(t)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((t.alias||t.name).toLocaleLowerCase())}function B4(e,t){if(!e||!t)return!1;const{creationDateField:i,creatorField:s,editDateField:r,editorField:n}=t;return[i&&i.toLowerCase(),s&&s.toLowerCase(),r&&r.toLowerCase(),n&&n.toLowerCase()].includes(e.toLowerCase())}function Vne(e,t){return e.editable&&!Rne.includes(e.type)&&!B4(e.name,t)}function zne({editFieldsInfo:e,fields:t,objectIdField:i},s){return Nne(t!=null?t:[],(s==null?void 0:s.ignoreFieldTypes)||Gne).map(r=>new Fm({fieldName:r.name,isEditable:Vne(r,e),label:r.alias,format:Bne(r),visible:Dne(r,{editFieldsInfo:e,objectIdField:i,visibleFieldNames:s==null?void 0:s.visibleFieldNames})}))}function Bne(e){switch(e.type){case"small-integer":case"integer":case"single":return new fh({digitSeparator:!0,places:0});case"double":return new fh({digitSeparator:!0,places:2});case"date":return new fh({dateFormat:"long-month-day-year"});default:return e.type==="string"&&jD(e.name)?new fh({digitSeparator:!0,places:0}):null}}function Une(){return[new Hh,new Zf]}function qne(e){const t=PX(e),{titleBase:i}=e;return t?`${i}: {${t.trim()}}`:i!=null?i:""}function TP(e){return(e.name&&e.name.toLowerCase())==="name"?!0:(e.alias&&e.alias.toLowerCase())==="name"}const Gne=["geometry","blob","raster","guid","xml"],Oi="FeatureLayer",U4="esri.layers.FeatureLayer",Wne=q.getLogger(U4);function Vy(e,t){return new L("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function IP(e){return e&&e instanceof he}const Tw=Tne();function Iw(e,t,i){const s=!!(i!=null&&i.writeLayerSchema);return{enabled:s,ignoreOrigin:s}}let ae=class extends Sre(lne(Nse(gne(Lse(CD(pne(Sne(PD(wne(Ase(une(fne(l4(Ose(Mse(xt(Yf))))))))))))))))){constructor(...e){super(...e),this._handles=new qi,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=xe.WGS84,this.subtypeCode=null,this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0}destroy(){var e;(e=this.source)==null||e.destroy(),this._handles=$t(this._handles)}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){var s;const t=M(e)?e.signal:null;if(((s=this.portalItem)==null?void 0:s.loaded)&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(r=>this.initLayerProperties(r))),Promise.resolve(this);const i=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection"]},e).catch(Em).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){const r=await this._fetchFirstLayerId(t);r!=null&&(this.layerId=r)}if(!this.url&&!this._hasMemorySource())throw new L("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>this.finishLoadEditablePortalLayer(e));return this.addResolvingPromise(i),Promise.resolve(this)}readCapabilities(e,t){return t=t.layerDefinition||t,x4(e,t,this.url)}get createQueryVersion(){var e;return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),((e=this._get("createQueryVersion"))!=null?e:0)+1}get editingEnabled(){var e;return!(this.loaded&&!((e=this.capabilities)!=null&&e.operations.supportsEditing))&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,i){return this._readEditingEnabled(t,!0,i)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,i,s){this._writeEditingEnabled(e,t,!0,s)}readIsTable(e,t){var i;return(t=(i=t==null?void 0:t.layerDefinition)!=null?i:t).type==="Table"||!t.geometryType}writeIsTable(e,t,i,s){s!=null&&s.writeLayerSchema&&Ei(i,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return S4(t.layerDefinition||t)}readObjectIdField(e,t){return M4(t.layerDefinition||t)}get parsedUrl(){const e=Ai(this.url);return e!=null&&(this.dynamicDataSource!=null?e.path=Xc(e.path,"dynamicLayer"):this.layerId!=null&&(e.path=Xc(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){Ik(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,i){var r,n;const s=(r=(t=t.layerDefinition||t).drawingInfo)==null?void 0:r.renderer;if(s){const o=(n=cm(s,t,i))!=null?n:void 0;return o||Wne.error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:i}),o}if(t.defaultSymbol)return t.types&&t.types.length?new Gm({defaultSymbol:Ew(t.defaultSymbol,t,i),field:t.typeIdField,uniqueValueInfos:t.types.map(o=>({id:o.id,symbol:Ew(o.symbol,o,i)}))}):new Xh({symbol:Ew(t.defaultSymbol,t,i)})}set source(e){const t=this._get("source");t!==e&&(IP(t)&&this._resetMemorySource(t),IP(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof he?new mo({layer:this,items:e}):e:null}readSource(e,t){var s;const i=Wb.fromJSON(t.featureSet);return new mo({layer:this,items:(s=i==null?void 0:i.features)!=null?s:[]})}readTemplates(e,t){const i=t.editFieldsInfo,s=i&&i.creatorField,r=i&&i.editorField;return e=e&&e.map(n=>qT.fromJSON(n)),this._fixTemplates(e,s),this._fixTemplates(e,r),e}readTitle(e,t){var r,n;const i=(n=(r=t.layerDefinition)==null?void 0:r.name)!=null?n:t.name,s=t.title||t.layerDefinition&&t.layerDefinition.title;if(i){const o=this.portalItem&&this.portalItem.title;if(this.sublayerTitleMode==="item-title")return this.url?Ese(this.url,i):i;let a=i;if(!a&&this.url){const l=Md(this.url);M(l)&&(a=l.title)}return a?(this.sublayerTitleMode==="item-title-and-service-name"&&o&&o!==a&&(a=o+" - "+a),FT(a)):void 0}if(this.sublayerTitleMode==="item-title"&&s)return s}readTitleFromWebMap(e,t){return t.title||t.layerDefinition&&t.layerDefinition.name}readTypeIdField(e,t){let i=(t=t.layerDefinition||t).typeIdField;if(i&&t.fields){i=i.toLowerCase();const s=t.fields.find(r=>r.name.toLowerCase()===i);s&&(i=s.name)}return i}readTypes(e,t){e=(t=t.layerDefinition||t).types;const i=t.editFieldsInfo,s=i&&i.creatorField,r=i&&i.editorField;return e&&e.map(n=>(n=z4.fromJSON(n),this._fixTemplates(n.templates,s),this._fixTemplates(n.templates,r),n))}readVisible(e,t){return t.layerDefinition&&t.layerDefinition.defaultVisibility!=null?!!t.layerDefinition.defaultVisibility:t.visibility!=null?!!t.visibility:void 0}async addAttachment(e,t){return are(this,e,t,Oi)}async updateAttachment(e,t,i){return lre(this,e,t,i,Oi)}async applyEdits(e,t){return cre(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return Lne(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await fz(z(()=>import("./FeatureLayerSource.99e97c87.js"),["assets/FeatureLayerSource.99e97c87.js","assets/clientSideDefaults.f5f7bfa0.js","assets/QueryEngineCapabilities.78217f95.js","assets/executeForIds.bade5c1b.js"]),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=bre(this);e.dynamicDataSource=this.dynamicDataSource;const t=M(this.subtypeCode)?`${this.subtypeField} = ${this.subtypeCode}`:null,i=ase(this.definitionExpression,t);return e.where=i||"1=1",e}async deleteAttachments(e,t){return ure(this,e,t,Oi)}async fetchRecomputedExtents(e){return hre(this,e,Oi)}getFeatureType(e){const{typeIdField:t,types:i}=this;if(!t||!e)return null;const s=e.attributes?e.attributes[t]:void 0;if(s==null)return null;let r=null;return i==null||i.some(n=>{const{id:o}=n;return o!=null&&(o.toString()===s.toString()&&(r=n),!!r)}),r}getFieldDomain(e,t){const i=t&&t.feature,s=this.getFeatureType(i);if(s){const r=s.domains&&s.domains[e];if(r&&r.type!=="inherited")return r}return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}async queryAttachments(e,t){return dre(this,e,t,Oi)}async queryFeatures(e,t){var r;const i=await this.load(),s=await i.source.queryFeatures((r=$n.from(e))!=null?r:i.createQuery(),t);if(s!=null&&s.features)for(const n of s.features)n.layer=n.sourceLayer=i;return s}async queryObjectIds(e,t){return pre(this,e,t,Oi)}async queryFeatureCount(e,t){return fre(this,e,t,Oi)}async queryExtent(e,t){return mre(this,e,t,Oi)}async queryRelatedFeatures(e,t){return yre(this,e,t,Oi)}async queryRelatedFeaturesCount(e,t){return gre(this,e,t,Oi)}async queryTopFeatures(e,t){var n;const{source:i,capabilities:s}=await this.load();if(!i.queryTopFeatures||!((n=s==null?void 0:s.query)!=null&&n.supportsTopFeaturesQuery))throw new L(Oi,"Layer source does not support queryTopFeatures capability");const r=await i.queryTopFeatures(ky.from(e),t);if(r!=null&&r.features)for(const o of r.features)o.layer=o.sourceLayer=this;return r}async queryTopObjectIds(e,t){const{source:i,capabilities:s}=await this.load();if(!i.queryTopObjectIds||!(s!=null&&s.query.supportsTopFeaturesQuery))throw new L(Oi,"Layer source does not support queryTopObjectIds capability");return i.queryTopObjectIds(ky.from(e),t)}async queryTopFeaturesExtent(e,t){var r;const{source:i,capabilities:s}=await this.load();if(!i.queryTopExtents||!((r=s==null?void 0:s.query)!=null&&r.supportsTopFeaturesQuery))throw new L(Oi,"Layer source does not support queryTopExtents capability");return i.queryTopExtents(ky.from(e),t)}async queryTopFeatureCount(e,t){var r;const{source:i,capabilities:s}=await this.load();if(!i.queryTopCount||!((r=s==null?void 0:s.query)!=null&&r.supportsTopFeaturesQuery))throw new L(Oi,"Layer source does not support queryFeatureCount capability");return i.queryTopCount(ky.from(e),t)}read(e,t){const i=e.featureCollection;if(i){const s=i.layers;s&&s.length===1&&(super.read(s[0],t),i.showLegend!=null&&super.read({showLegend:i.showLegend},t))}super.read(e,t),t&&t.origin==="service"&&this.revert(["objectIdField","fields","timeInfo","spatialReference"],"service")}write(e,t){var n,o;t={...t,origin:(n=t==null?void 0:t.origin)!=null?n:void 0,writeLayerSchema:(o=t==null?void 0:t.writeLayerSchema)!=null?o:this._hasMemorySource()};const{origin:i,layerContainerType:s,messages:r}=t;if(this.dynamicDataSource)return r==null||r.push(Vy(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if(i==="web-scene"||i==="web-map"&&s!=="tables")return r==null||r.push(Vy(this,"using a table source cannot be written to web scenes and web maps")),null;if(this._hasMemorySource())return r==null||r.push(Vy(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&i==="web-map"&&s==="tables")return r==null||r.push(Vy(this,"using a non-table source cannot be written to tables in web maps")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new L(Oi,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){var t;return!!this.loaded&&(((t=this.source)==null?void 0:t.type)==="memory"||Pne(this,e))}async save(e){return(await z(()=>import("./featureLayerUtils.37a0188b.js"),["assets/featureLayerUtils.37a0188b.js","assets/originUtils.2d0aad75.js","assets/multiOriginJSONSupportUtils.38b69b9c.js","assets/fetchService.36bd4782.js","assets/jsonContext.3176ed6f.js","assets/portalItemUtils.57ded807.js"])).save(this,e)}async saveAs(e,t){return(await z(()=>import("./featureLayerUtils.37a0188b.js"),["assets/featureLayerUtils.37a0188b.js","assets/originUtils.2d0aad75.js","assets/multiOriginJSONSupportUtils.38b69b9c.js","assets/fetchService.36bd4782.js","assets/jsonContext.3176ed6f.js","assets/portalItemUtils.57ded807.js"])).saveAs(this,e,t)}_readEditingEnabled(e,t,i){var r;let s=(r=e.layerDefinition)==null?void 0:r.capabilities;return s?this._hasEditingCapability(s):(s=e.capabilities,t&&(i==null?void 0:i.origin)==="web-map"&&!this._hasMemorySource()&&s?this._hasEditingCapability(s):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(t=>t.trim()).includes("editing")}_writeEditingEnabled(e,t,i,s){var r,n;if(!e){const o=(n=(r=this.capabilities)==null?void 0:r.operations)!=null&&n.supportsSync?"Query,Sync":"Query";Ei("layerDefinition.capabilities",o,t),i&&!(s!=null&&s.writeLayerSchema)&&(t.capabilities=o)}}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstLayerId(e){return kt(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t=>{const i=t.data;if(i)return Array.isArray(i.layers)&&i.layers.length>0?i.layers[0].id:Array.isArray(i.tables)&&i.tables.length>0?i.tables[0].id:void 0})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",url:this.parsedUrl})),this._verifySource(),this._verifyFields(),Ik(this.renderer,this.fieldsIndex),AD(this.timeInfo,this.fieldsIndex),Ane(this,{origin:"service"})}async hasDataChanged(){return vre(this)}async fetchPublishingStatus(){const e=this.source;return e!=null&&e.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){var t,i,s;const e=(i=(t=this.parsedUrl)==null?void 0:t.path)!=null?i:"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||e.search(/\/FeatureServer\//i)!==-1||((s=this.fields)==null?void 0:s.some(r=>r.type==="geometry"))||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(i=>{const s=i.prototype&&i.prototype.attributes;s&&t&&delete s[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new L("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new L("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(t=>{t.layer=this,t.sourceLayer=this}),this._handles.add([e.on("after-add",t=>{t.item.layer=this,t.item.sourceLayer=this}),e.on("after-remove",t=>{t.item.layer=null,t.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(t=>{t.layer=null,t.sourceLayer=null}),this._handles.remove("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}};c([Q("service","capabilities")],ae.prototype,"readCapabilities",null),c([h({json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],ae.prototype,"charts",void 0),c([h({readOnly:!0})],ae.prototype,"createQueryVersion",null),c([h({json:{read:{source:"layerDefinition.copyrightText"}}})],ae.prototype,"copyright",void 0),c([h({json:{read:{source:"layerDefinition.displayField"}}})],ae.prototype,"displayField",void 0),c([h({types:Uc,readOnly:!0})],ae.prototype,"defaultSymbol",void 0),c([h({type:Er})],ae.prototype,"dynamicDataSource",void 0),c([h({type:Boolean})],ae.prototype,"editingEnabled",null),c([Q(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],ae.prototype,"readEditingEnabled",null),c([Q("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],ae.prototype,"readEditingEnabledFromWebMap",null),c([ie(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],ae.prototype,"writeEditingEnabled",null),c([ie("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],ae.prototype,"writeEditingEnabledToWebMap",null),c([h({...Tw.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:Iw}}}}})],ae.prototype,"fields",void 0),c([h(Tw.fieldsIndex)],ae.prototype,"fieldsIndex",void 0),c([h({type:bse,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],ae.prototype,"formTemplate",void 0),c([h({json:{read:{source:"layerDefinition.extent"}}})],ae.prototype,"fullExtent",void 0),c([h({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:Iw,writer(e,t,i){const s=e?V2.toJSON(e):null;s&&Ei(i,s,t)}}}},read:{source:"layerDefinition.geometryType",reader:V2.read}}})],ae.prototype,"geometryType",void 0),c([h({json:{read:{source:"layerDefinition.hasM"}}})],ae.prototype,"hasM",void 0),c([h({json:{read:{source:"layerDefinition.hasZ"}}})],ae.prototype,"hasZ",void 0),c([h(Hse)],ae.prototype,"id",void 0),c([h({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],ae.prototype,"infoFor3D",void 0),c([h({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],ae.prototype,"isTable",void 0),c([Q("service","isTable",["type","geometryType"]),Q("isTable",["layerDefinition.type","layerDefinition.geometryType"])],ae.prototype,"readIsTable",null),c([ie("web-map","isTable")],ae.prototype,"writeIsTable",null),c([h(NT)],ae.prototype,"labelsVisible",void 0),c([h({type:[Kb],json:{origins:{service:{read:{source:"drawingInfo.labelingInfo",reader:$P},write:{target:"drawingInfo.labelingInfo",enabled:!1}}},read:{source:"layerDefinition.drawingInfo.labelingInfo",reader:$P},write:{target:"layerDefinition.drawingInfo.labelingInfo"}}})],ae.prototype,"labelingInfo",void 0),c([h((()=>{const e=R(Wse);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(t,i,s){Ei(s,Rb(t),i)}}},e})())],ae.prototype,"opacity",void 0),c([h(qse)],ae.prototype,"legendEnabled",void 0),c([h({type:["show","hide"],json:(()=>{const e=R(w4.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],ae.prototype,"listMode",void 0),c([Q("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],ae.prototype,"readGlobalIdField",null),c([h({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:Iw}}}}})],ae.prototype,"objectIdField",void 0),c([Q("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],ae.prototype,"readObjectIdField",null),c([h({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],ae.prototype,"operationalLayerType",void 0),c([h(Tw.outFields)],ae.prototype,"outFields",void 0),c([h({readOnly:!0})],ae.prototype,"parsedUrl",null),c([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],ae.prototype,"path",void 0),c([h(DT)],ae.prototype,"popupEnabled",void 0),c([h({type:Dm,json:{name:"popupInfo",write:!0}})],ae.prototype,"popupTemplate",void 0),c([h({readOnly:!0})],ae.prototype,"defaultPopupTemplate",null),c([h({types:Zb,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:sse,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:(e,t,i)=>({ignoreOrigin:i==null?void 0:i.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,i)=>({ignoreOrigin:i==null?void 0:i.writeLayerSchema})}}})],ae.prototype,"renderer",null),c([Q("service","renderer",["drawingInfo.renderer","defaultSymbol"]),Q("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],ae.prototype,"readRenderer",null),c([h((()=>{const e=R(Bse);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],ae.prototype,"screenSizePerspectiveEnabled",void 0),c([h({clonable:!1})],ae.prototype,"source",null),c([Oe("source")],ae.prototype,"castSource",null),c([Q("portal-item","source",["featureSet"]),Q("web-map","source",["featureSet"])],ae.prototype,"readSource",null),c([h({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],ae.prototype,"spatialReference",void 0),c([h({type:Number})],ae.prototype,"subtypeCode",void 0),c([h({type:[qT]})],ae.prototype,"templates",void 0),c([Q("templates",["editFieldsInfo","creatorField","editorField","templates"])],ae.prototype,"readTemplates",null),c([h({type:V4})],ae.prototype,"timeInfo",void 0),c([h()],ae.prototype,"title",void 0),c([Q("service","title",["name"]),Q("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],ae.prototype,"readTitle",null),c([Q("web-map","title",["layerDefinition.name","title"])],ae.prototype,"readTitleFromWebMap",null),c([h({type:String})],ae.prototype,"sublayerTitleMode",void 0),c([h({json:{read:!1}})],ae.prototype,"type",void 0),c([h({type:String})],ae.prototype,"typeIdField",void 0),c([Q("service","typeIdField"),Q("typeIdField",["layerDefinition.typeIdField"])],ae.prototype,"readTypeIdField",null),c([h({type:[z4]})],ae.prototype,"types",void 0),c([Q("service","types",["types"]),Q("types",["layerDefinition.types"])],ae.prototype,"readTypes",null),c([h({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],ae.prototype,"visible",void 0),c([Q("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],ae.prototype,"readVisible",null),ae=c([S(U4)],ae);const Ew=dl({types:zb}),q4=ae;var Q_e=Object.freeze(Object.defineProperty({__proto__:null,default:q4},Symbol.toStringTag,{value:"Module"}));const Hne=["$datastore","$map","$layer","$aggregatedfeatures"],Yne="esri.widgets.Feature.support.arcadeFeatureUtils",Jne=q.getLogger(Yne);function Xne(e){return typeof e=="string"?Um(mT(e)):Array.isArray(e)?Zne(e):(e==null?void 0:e.declaredClass)==="esri.arcade.Dictionary"?Qne(e):e}function Zne(e){return`
    ${e.map(t=>`
  • ${typeof t=="string"?Um(mT(t)):t}
  • `).join("")}
`}function Qne(e){return`${e.keys().map(t=>{const i=e.field(t);return``}).join("")}
${t}${typeof i=="string"?Um(mT(i)):i}
`}function Kne({aggregatedFeatures:e,arcadeUtils:t,featureSetVars:i,context:s,viewInfo:r,map:n,graphic:o,interceptor:a}){i.forEach(l=>{const u=l.toLowerCase(),d={map:n,spatialReference:r.sr,interceptor:a};if(u==="$map"&&(s.vars[u]=t.convertMapToFeatureSetCollection(d)),u==="$layer"&&(s.vars[u]=t.convertFeatureLayerToFeatureSet({layer:o.sourceLayer,spatialReference:r.sr,interceptor:a})),u==="$datastore"&&(s.vars[u]=t.convertServiceUrlToWorkspace({url:o.sourceLayer.url,spatialReference:r.sr,interceptor:a})),u==="$aggregatedfeatures"){const f=o.layer,{fields:m,objectIdField:y,geometryType:g,spatialReference:v,displayField:b}=f,_=new q4({fields:m,objectIdField:y,geometryType:g,spatialReference:v,displayField:b,...f.type==="feature"?{templates:f.templates,typeIdField:f.typeIdField,types:f.types}:null,source:e});s.vars[u]=t.convertFeatureLayerToFeatureSet({layer:_,spatialReference:r.sr,interceptor:a})}})}function G4(){return z(()=>import("./arcadeUtils.9e078218.js").then(function(e){return e.ay}),["assets/arcadeUtils.9e078218.js","assets/number.8c2c26f3.js"])}function eoe(e){return"createQuery"in e&&"queryFeatures"in e}async function toe({graphic:e,view:t}){const{isAggregate:i,layer:s}=e;if(!i||!s||(t==null?void 0:t.type)!=="2d")return[];const r=await t.whenLayerView(s);if(!eoe(r))return[];const n=r.createQuery();n.aggregateIds=[e.getObjectId()];const{features:o}=await r.queryFeatures(n);return o}async function W4({expressionInfo:e,arcadeUtils:t,interceptor:i,spatialReference:s,map:r,graphic:n,view:o}){if(!e||!e.expression)return null;const a=t.createSyntaxTree(e.expression),l=Hne.filter(y=>t.hasVariable(a,y)),[u]=await Promise.all([toe({graphic:n,view:o}),t.loadScriptDependencies(a,!0,l)]),d=t.getViewInfo({spatialReference:s}),f=t.createExecContext(n,d);f.interceptor=i,f.useAsync=!0,Kne({aggregatedFeatures:u,arcadeUtils:t,featureSetVars:l,context:f,viewInfo:d,map:r,graphic:n,interceptor:i});const m=t.createFunction(a,f);return t.executeAsyncFunction(m,f).catch(y=>Jne.error("arcade-execution-error",{error:y,graphic:n,expressionInfo:e}))}async function ioe({expressionInfos:e,spatialReference:t,graphic:i,interceptor:s,map:r,view:n}){if(!e||!e.length)return{};const o=await G4(),a={};for(const d of e)a[`expression/${d.name}`]=W4({expressionInfo:d,arcadeUtils:o,interceptor:s,spatialReference:t,map:r,graphic:i,view:n});const l=await as(a),u={};for(const d in l)u[d]=Xne(l[d].value);return u}const soe=1;let ys=class extends pu(oe){constructor(e){super(e),this._abortController=null,this.expressionInfo=null,this.graphic=null,this.contentElement=null,this.contentElementViewModel=null,this.interceptor=null,this.view=null,this._cancelQuery=()=>{const{_abortController:t}=this;t&&t.abort(),this._abortController=null},this._createVM=()=>{var s,r;const t=(s=this.contentElement)==null?void 0:s.type;(r=this.contentElementViewModel)==null||r.destroy();const i=t==="fields"?new Ub:t==="media"?new Fc:t==="text"?new $v:null;this._set("contentElementViewModel",i)},this._compile=async()=>{this._cancelQuery();const t=new AbortController;this._abortController=t,await this._compileExpression(),this._abortController===t&&(this._abortController=null)},this._compileThrottled=Ch(this._compile,soe,this),this._compileExpression=async()=>{const{expressionInfo:t,graphic:i,interceptor:s,spatialReference:r,map:n,view:o,_abortController:a}=this;if(!(t&&i&&r&&n))return void this._set("contentElement",null);const l=await G4();if(a!==this._abortController)return;const u=await W4({arcadeUtils:l,expressionInfo:t,graphic:i,interceptor:s,map:n,spatialReference:r,view:o});if(!u||u.declaredClass!=="esri.arcade.Dictionary")return void this._set("contentElement",null);const d=await u.castAsJsonAsync(a.signal),f=d==null?void 0:d.type,m=f==="media"?Kf.fromJSON(d):f==="text"?Yh.fromJSON(d):f==="fields"?Hh.fromJSON(d):null;this._set("contentElement",m)},this.handles.add([Z(()=>[this.expressionInfo,this.graphic,this.map,this.spatialReference,this.view],()=>this._compileThrottled(),Le),Z(()=>[this.contentElement],()=>this._createVM(),Le)])}destroy(){var e;this._cancelQuery(),(e=this.contentElementViewModel)==null||e.destroy(),this._set("contentElementViewModel",null),this._set("contentElement",null)}get spatialReference(){var e,t;return(t=(e=this.view)==null?void 0:e.spatialReference)!=null?t:null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{_abortController:e,contentElement:t,contentElementViewModel:i}=this;return e?"loading":t||i?"ready":"disabled"}get map(){var e,t;return(t=(e=this.view)==null?void 0:e.map)!=null?t:null}set map(e){this._override("map",e)}};c([h()],ys.prototype,"_abortController",void 0),c([h({type:VD})],ys.prototype,"expressionInfo",void 0),c([h({type:Ci})],ys.prototype,"graphic",void 0),c([h({readOnly:!0})],ys.prototype,"contentElement",void 0),c([h({readOnly:!0})],ys.prototype,"contentElementViewModel",void 0),c([h()],ys.prototype,"interceptor",void 0),c([h()],ys.prototype,"spatialReference",null),c([h({readOnly:!0})],ys.prototype,"state",null),c([h()],ys.prototype,"map",null),c([h()],ys.prototype,"view",void 0),ys=c([S("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],ys);const GT=ys,zy={iconLoading:"esri-icon-loading-indicator esri-rotating",base:"esri-feature-expression",loadingSpinnerContainer:"esri-feature__loading-container",spinner:"esri-feature__loading-spinner"};let c0=class extends yi{constructor(e,t){super(e,t),this.viewModel=new GT}initialize(){this.addHandles(Z(()=>{var e;return(e=this.viewModel)==null?void 0:e.contentElementViewModel},()=>this._setupExpressionWidget(),Le))}destroy(){this._destroyContentWidget()}renderLoading(){return P("div",{key:"loading-container",class:zy.loadingSpinnerContainer},P("span",{class:this.classes(zy.iconLoading,zy.spinner)}))}render(){var t;const{state:e}=this.viewModel;return P("div",{class:zy.base},e==="loading"?this.renderLoading():e==="disabled"?null:(t=this._contentWidget)==null?void 0:t.render())}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,i=t==null?void 0:t.type;this._destroyContentWidget();const s=e?i==="fields"?new ZN({viewModel:e}):i==="media"?new P5({viewModel:e}):i==="text"?new qg({viewModel:e}):null:null;this._contentWidget=s,this.scheduleRender()}};c([h({type:GT})],c0.prototype,"viewModel",void 0),c0=c([S("esri.widgets.Feature.FeatureExpression")],c0);const roe=c0,kw=100;let Xe=class extends xt(Om(pu(oe))){constructor(e){super(e),this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=10,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.orderByFields=null,this.featureCount=0,this.relationshipId=null,this.showAllEnabled=!1,this.title=null,this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:t}=this;t&&t.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const t=new AbortController;this._queryAbortController=t,await wh(this._query()),this._queryAbortController===t&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await wh(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null)},this._queryPageController=async()=>{const t=new AbortController;this._queryPageAbortController=t,await wh(this._queryPage()),this._queryPageAbortController===t&&(this._queryPageAbortController=null)},this._queryThrottled=Ch(this._queryController,kw,this),this._queryFeatureCountThrottled=Ch(this._queryFeatureCountController,kw,this),this._queryPageThrottled=Ch(this._queryPageController,kw,this),this._query=async()=>{const{_queryAbortController:t,relatedFeatures:i}=this;this._destroyRelatedFeatureViewModels(),this.featurePage=1,i.removeAll(),i.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:t==null?void 0:t.signal})))},this.handles.add([Z(()=>[this.displayCount,this.graphic,this.layer,this.map,this.orderByFieldsFixedCasing,this.relationshipId,this.featuresPerPage,this.showAllEnabled],()=>this._queryThrottled(),Le),Z(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageThrottled()),Z(()=>[this.layer,this.relationshipId,this.objectId],()=>this._queryFeatureCountThrottled())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.removeAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:t,featureCount:i}=this,s=1,r=Math.ceil(i/t)||1;this._set("featurePage",Math.min(Math.max(e,s),r))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:t}=this;return e&&(t==null?void 0:t.loaded)?e.map(i=>{const s=i.clone(),r=nm(i.field,t);return s.field=r,s}):e}get itemDescriptionFieldName(){var e,t;return((t=(e=this.orderByFieldsFixedCasing)==null?void 0:e[0])==null?void 0:t.field)||null}set displayCount(e){this._set("displayCount",Math.min(Math.max(e,0),10))}get displayCount(){return this._get("displayCount")}get objectId(){var e,t,i;return(i=(t=(e=this.graphic)==null?void 0:e.attributes)==null?void 0:t[this.objectIdField])!=null?i:null}get objectIdField(){var e;return((e=this.layer)==null?void 0:e.objectIdField)||null}get relatedFeatures(){return this._get("relatedFeatures")||new he}get relatedLayer(){const{layer:e,map:t,relationship:i}=this;return e!=null&&e.loaded?SK(t,e,i):null}get relationship(){var i,s;const{relationshipId:e,layer:t}=this;return typeof e=="number"&&(s=(i=t==null?void 0:t.relationships)==null?void 0:i.find(({id:r})=>r===e))!=null?s:null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new he}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:i,graphic:s,relatedLayer:r}=this;return t?"loading":e||i?"querying":s&&r?"ready":"disabled"}_destroyRelatedFeatureViewModels(){var e;(e=this.relatedFeatureViewModels)==null||e.forEach(t=>!t.destroyed&&t.destroy()),this.relatedFeatureViewModels.removeAll()}async _queryFeatureCount(){var u,d,f,m,y;const{layer:e,relatedLayer:t,relationshipId:i,objectId:s,_queryFeatureCountAbortController:r}=this;if(await(e==null?void 0:e.load()),!t||typeof s!="number"||!((d=(u=e==null?void 0:e.capabilities)==null?void 0:u.queryRelated)!=null&&d.supportsCount))return void this._set("featureCount",0);await t.load();const n=t.createQuery(),o=(y=(m=(f=e.capabilities)==null?void 0:f.queryRelated)==null?void 0:m.supportsCacheHint)!=null?y:!1,a=new am({cacheHint:o,relationshipId:i,returnGeometry:!1,objectIds:[s],where:n.where}),l=await e.queryRelatedFeaturesCount(a,{signal:r==null?void 0:r.signal});this._set("featureCount",l[s]||0)}_sliceFeatures(e){const{showAllEnabled:t,displayCount:i}=this;return t?e:i?e.slice(0,i):[]}async _queryPage(){const{relatedFeatures:e,featurePage:t,showAllEnabled:i,_queryPageAbortController:s}=this;!i||t<2||e.addMany(await this._queryRelatedFeatures({signal:s==null?void 0:s.signal}))}async _queryRelatedFeatures(e){var T,k,A,F,G;const{orderByFieldsFixedCasing:t,showAllEnabled:i,featuresPerPage:s,displayCount:r,layer:n,relationshipId:o,featurePage:a,featureCount:l,relatedLayer:u}=this;await(n==null?void 0:n.load());const{relationship:d,objectId:f}=this;if(!d||typeof f!="number"||!((k=(T=n==null?void 0:n.capabilities)==null?void 0:T.queryRelated)!=null&&k.supportsPagination))return[];const m=i?((a-1)*s+l)%l:0,y=i?s:r;if(!u)return[];await u.load();const g=u.objectIdField,v=[...t==null?void 0:t.map(U=>U.field),g],b=t==null?void 0:t.map(U=>`${U.field} ${U.order}`),_=((F=(A=n.capabilities)==null?void 0:A.queryRelated)==null?void 0:F.supportsCacheHint)||!1,x=u.createQuery(),$=new am({orderByFields:b,start:m,num:y,outFields:v,cacheHint:_,relationshipId:o,returnGeometry:!1,objectIds:[f],where:x.where}),I=((G=(await n.queryRelatedFeatures($,{signal:e==null?void 0:e.signal}))[f])==null?void 0:G.features)||[];return I.forEach(U=>U.sourceLayer=u),I}};c([h()],Xe.prototype,"_queryAbortController",void 0),c([h()],Xe.prototype,"_queryPageAbortController",void 0),c([h()],Xe.prototype,"_queryFeatureCountAbortController",void 0),c([h({value:1})],Xe.prototype,"featurePage",null),c([h()],Xe.prototype,"featuresPerPage",void 0),c([h({readOnly:!0})],Xe.prototype,"orderByFieldsFixedCasing",null),c([h()],Xe.prototype,"description",void 0),c([h({readOnly:!0})],Xe.prototype,"itemDescriptionFieldName",null),c([h({value:3})],Xe.prototype,"displayCount",null),c([h({type:Ci})],Xe.prototype,"graphic",void 0),c([h()],Xe.prototype,"layer",void 0),c([h()],Xe.prototype,"map",void 0),c([h({readOnly:!0})],Xe.prototype,"objectId",null),c([h({readOnly:!0})],Xe.prototype,"objectIdField",null),c([h()],Xe.prototype,"orderByFields",void 0),c([h({readOnly:!0})],Xe.prototype,"relatedFeatures",null),c([h({readOnly:!0})],Xe.prototype,"relatedLayer",null),c([h({readOnly:!0})],Xe.prototype,"relationship",null),c([h({readOnly:!0})],Xe.prototype,"featureCount",void 0),c([h({readOnly:!0})],Xe.prototype,"relatedFeatureViewModels",null),c([h()],Xe.prototype,"relationshipId",void 0),c([h()],Xe.prototype,"showAllEnabled",void 0),c([h({readOnly:!0})],Xe.prototype,"state",null),c([h()],Xe.prototype,"title",void 0),Xe=c([S("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],Xe);const WT=Xe,Bn={base:"esri-feature-relationship",esriWidget:"esri-widget",listContainer:"esri-feature-relationship__list",listContainerQuerying:"esri-feature-relationship__list--querying",featureObserver:"esri-feature__feature-observer",stickySpinnerContainer:"esri-feature__sticky-loading-container",loadingSpinnerContainer:"esri-feature__loading-container",spinner:"esri-feature__loading-spinner",iconLoading:"esri-icon-loading-indicator esri-rotating"},EP={title:!0,description:!0};let Di=class extends yi{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([i])=>{i!=null&&i.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.headingLevel=2,this.viewModel=new WT,this.messages=null,this.messagesCommon=null,this.visibleElements={...EP},this._increaseFeaturePage=()=>{const{state:i,showAllEnabled:s,relatedFeatures:r,featuresPerPage:n,featurePage:o}=this.viewModel;i==="ready"&&s&&r.length>=n*o&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new Bb,this.addHandles([Z(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),Le),Z(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),Is(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return Promise.all([z(()=>import("./calcite-list.8f1cbf55.js"),["assets/calcite-list.8f1cbf55.js","assets/interactive.d71a7a54.js"]),z(()=>import("./calcite-list-item.bd111fd1.js"),["assets/calcite-list-item.bd111fd1.js","assets/conditionalSlot.39f4bfa2.js","assets/observers.11f150c2.js","assets/interactive.d71a7a54.js"]),z(()=>import("./calcite-icon.8f7a3cfc.js"),["assets/calcite-icon.8f7a3cfc.js","assets/icon.8e346cc3.js","assets/observers.11f150c2.js"]),z(()=>import("./calcite-notice.49afa2e1.js"),["assets/calcite-notice.49afa2e1.js","assets/conditionalSlot.39f4bfa2.js","assets/observers.11f150c2.js","assets/icon.8e346cc3.js"])])}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=$t(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:i}=this.viewModel;return!e&&(t>i||i===0)}get displayListItems(){return this.displayShowAllButton||this.viewModel.relatedFeatureViewModels.length>0}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get featureCountDescription(){const{messages:e}=this,{featureCount:t}=this.viewModel;return fn(t===1?e==null?void 0:e.numberRecord:e==null?void 0:e.numberRecords,{number:t})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...EP,...e}}renderStickyLoading(){return this.viewModel.state==="querying"?P("div",{key:"sticky-loader",class:Bn.stickySpinnerContainer},this.renderLoadingIcon()):null}renderLoadingIcon(){return P("span",{class:this.classes(Bn.iconLoading,Bn.spinner)})}renderLoading(){return P("div",{key:"loading-container",class:Bn.loadingSpinnerContainer},this.renderLoadingIcon())}renderShowAllIconNode(){return P("calcite-icon",{scale:"s",icon:"list",slot:"content-end"})}renderChevronIconNode(){const e=xn(this.container)?"chevron-left":"chevron-right";return P("calcite-icon",{scale:"s",icon:e,slot:"content-end"})}renderRelatedFeature(e){var r,n;const{itemDescriptionFieldName:t}=this.viewModel,i=e.title;e.description=t&&((r=e.formattedAttributes)==null?void 0:r.global[t]);const s=e.state==="loading";return P("calcite-list-item",{key:e.uid,label:s?`${(n=this.messagesCommon)==null?void 0:n.loading}\u2026`:i,description:s?"\u2026":e.description,onclick:()=>this.emit("select-record",{featureViewModel:e})},this.renderChevronIconNode())}renderShowAllListItem(){var e;return this.displayShowAllButton?P("calcite-list-item",{key:"show-all-item",label:(e=this.messages)==null?void 0:e.showAll,description:this.featureCountDescription,onclick:()=>this.emit("show-all-records")},this.renderShowAllIconNode()):null}renderNoRelatedFeaturesMessage(){var e;return P("calcite-notice",{key:"no-related-features-message",icon:"information",open:!0,color:"blue",scale:"s",width:"full"},P("div",{slot:"message"},(e=this.messages)==null?void 0:e.noRelatedFeatures))}renderFeatureObserver(){return P("div",{key:"feature-observer",class:Bn.featureObserver,bind:this,afterCreate:this._relatedFeatureIntersectionObserverCreated})}renderList(){const{relatedFeatureViewModels:e}=this.viewModel;return P("calcite-list",null,e.toArray().map(t=>this.renderRelatedFeature(t)),this.renderShowAllListItem())}renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return P("div",{key:"list-container",class:this.classes(Bn.listContainer,{[Bn.listContainerQuerying]:t==="querying"})},e?this.renderList():t==="ready"?this.renderNoRelatedFeaturesMessage():null,this.renderStickyLoading(),this.renderFeatureObserver())}renderRelationshipNotFound(){var e;return P("calcite-notice",{key:"relationship-not-found",icon:"exclamation-mark-triangle",open:!0,color:"red",scale:"s",width:"full"},P("div",{slot:"message"},(e=this.messages)==null?void 0:e.relationshipNotFound))}render(){var t;const{state:e}=this.viewModel;return P("div",{class:this.classes(Bn.base,Bn.esriWidget)},(t=this._featureElementInfo)==null?void 0:t.render(),e==="loading"?this.renderLoading():e==="disabled"?this.renderRelationshipNotFound():this.renderRelatedFeatures())}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e==null||e.forEach(i=>{this.addHandles(Z(()=>[i.title,i.state],()=>this.scheduleRender(),Le),t)}),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,s=t.title&&this.title;this._featureElementInfo.set({description:i,title:s,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await nb(0),this._relatedFeatureIntersectionObserverNode&&e==="ready"&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};c([h()],Di.prototype,"_relatedFeatureIntersectionObserverNode",void 0),c([h({readOnly:!0})],Di.prototype,"displayShowAllButton",null),c([h({readOnly:!0})],Di.prototype,"displayListItems",null),c([h()],Di.prototype,"description",null),c([h({readOnly:!0})],Di.prototype,"featureCountDescription",null),c([h()],Di.prototype,"headingLevel",void 0),c([h()],Di.prototype,"title",null),c([h({type:WT})],Di.prototype,"viewModel",void 0),c([h(),di("esri/widgets/Feature/t9n/Feature")],Di.prototype,"messages",void 0),c([h(),di("esri/t9n/common")],Di.prototype,"messagesCommon",void 0),c([h()],Di.prototype,"visibleElements",void 0),c([Oe("visibleElements")],Di.prototype,"castVisibleElements",null),Di=c([S("esri.widgets.Feature.FeatureRelationship")],Di);const kP=Di;class noe{constructor(t,i){this.preLayerQueryCallback=t,this.preRequestCallback=i,this.preLayerQueryCallback||(this.preLayerQueryCallback=s=>{}),this.preRequestCallback||(this.preLayerQueryCallback=s=>{})}}var Gp;const ooe=1,CP="content-view-models",PP="relationship-view-models",AP={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0};let nt=Gp=class extends Om(oe){constructor(e){super(e),this._handles=new qi,this._error=null,this._featureAbortController=null,this._graphicChangedThrottled=Ch(this._graphicChanged,ooe,this),this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...AP},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.relatedInfos=new Map,this.title="",this.view=null,this._isAllowedContentType=t=>{const{abilities:i}=this;return t.type==="attachments"&&i.attachmentsContent||t.type==="custom"&&i.customContent||t.type==="fields"&&i.fieldsContent||t.type==="media"&&i.mediaContent||t.type==="text"&&i.textContent||t.type==="expression"&&i.expressionContent||t.type==="relationship"&&i.relationshipContent},this._handles.add(Z(()=>[this.graphic,this._effectivePopupTemplate,this.abilities],()=>this._graphicChangedThrottled(),Le))}destroy(){this._clear(),this._cancelFeatureQuery(),this._error=null,this._handles.destroy(),this._handles=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}get _effectivePopupTemplate(){return M(this.graphic)?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return mK(tC(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return zN(this.graphic)}castAbilities(e){return{...AP,...e}}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(e){this._set("graphic",e?e.clone():null)}get spatialReference(){var e,t;return(t=(e=this.view)==null?void 0:e.spatialReference)!=null?t:null}set spatialReference(e){this._override("spatialReference",e)}get map(){var e;return((e=this.view)==null?void 0:e.map)||null}set map(e){this._override("map",e)}get waitingForContent(){return!!this._featureAbortController}setActiveMedia(e,t){const i=this.contentViewModels[e];i instanceof Fc&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof Fc&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof Fc&&t.previous()}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}async _graphicChanged(){this._cancelFeatureQuery(),this._error=null,this._clear();const{graphic:e}=this;if(!e)return;const t=new AbortController;this._featureAbortController=t;try{await this._queryFeature({signal:t.signal})}catch(i){Ks(i)||(this._error=i,q.getLogger(this.declaredClass).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:e,popupTemplate:this._effectivePopupTemplate}))}this._featureAbortController===t&&(this._featureAbortController=null)}_cancelFeatureQuery(){const{_featureAbortController:e}=this;e&&e.abort(),this._featureAbortController=null}_compileContentElement(e,t){return e.type==="attachments"?this._compileAttachments(e,t):e.type==="custom"?this._compileCustom(e,t):e.type==="fields"?this._compileFields(e,t):e.type==="media"?this._compileMedia(e,t):e.type==="text"?this._compileText(e,t):e.type==="expression"?this._compileExpression(e,t):e.type==="relationship"?this._compileRelationship(e,t):void 0}_compileContent(e){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map((t,i)=>this._compileContentElement(t,i)):typeof e=="string"?this._compileText(new Yh({text:e}),0).text:e}_destroyContentViewModels(){var e,t;(e=this._handles)==null||e.remove(PP),(t=this._handles)==null||t.remove(CP),this.contentViewModels.forEach(i=>i&&!i.destroyed&&i.destroy()),this._set("contentViewModels",[])}_matchesFeature(e,t){var r;const i=(r=e==null?void 0:e.graphic)==null?void 0:r.getObjectId(),s=t==null?void 0:t.getObjectId();return M(i)&&M(s)&&i===s}_setRelatedFeaturesViewModels({relatedFeatureViewModels:e,relatedFeatures:t,map:i}){t==null||t.filter(Boolean).forEach(s=>{e.find(r=>this._matchesFeature(r,s))||e.add(new Gp({abilities:{relationshipContent:!1},map:i,graphic:s}))}),e.forEach(s=>{(t==null?void 0:t.find(n=>this._matchesFeature(s,n)))||e.remove(s)})}_setExpressionContentVM(e,t){const{formattedAttributes:i}=this,{contentElement:s,contentElementViewModel:r}=e,n=s==null?void 0:s.type;r&&n&&(n==="fields"&&(this._createFieldsFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),r.set(this._createFieldsVMParams(s,t))),n==="media"&&(this._createMediaFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),r.set(this._createMediaVMParams(s,t))),n==="text"&&r.set(this._createTextVMParams(s)))}_compileRelationship(e,t){const{displayCount:i,orderByFields:s,relationshipId:r,title:n,description:o}=e,{_sourceLayer:a,graphic:l,map:u}=this,d=new WT({displayCount:i,graphic:l,orderByFields:s,relationshipId:r,layer:a,map:u,...this._compileTitleAndDesc({title:n,description:o})});return this.contentViewModels[t]=d,this._handles.add(Is(()=>d.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(d)),PP),e}_compileExpression(e,t){const{expressionInfo:i}=e,{graphic:s,map:r,spatialReference:n,view:o}=this,a=new GT({expressionInfo:i,graphic:s,interceptor:Gp.interceptor,map:r,spatialReference:n,view:o});return this.contentViewModels[t]=a,this._handles.add(Z(()=>a.contentElementViewModel,()=>this._setExpressionContentVM(a,t),Le),CP),e}_compileAttachments(e,t){const{graphic:i}=this,{description:s,title:r}=e;return this.contentViewModels[t]=new gT({graphic:i,...this._compileTitleAndDesc({title:r,description:s})}),e}_compileCustom(e,t){const{graphic:i}=this,{creator:s,destroyer:r}=e;return this.contentViewModels[t]=new $v({graphic:i,creator:s,destroyer:r}),e}_compileTitleAndDesc({title:e,description:t}){const{_fieldInfoMap:i,_sourceLayer:s,graphic:r,formattedAttributes:n,_expressionAttributes:o}=this,{attributes:a}=r,l=n.global;return{title:Rc({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:o,layer:s,text:e}),description:Rc({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:o,layer:s,text:t})}}_createFieldsVMParams(e,t){var u;const{_effectivePopupTemplate:i,formattedAttributes:s}=this,r={...s.global,...s.content[t]},n=(u=(e==null?void 0:e.fieldInfos)||(i==null?void 0:i.fieldInfos))==null?void 0:u.filter(({fieldName:d})=>pT(d)||xo(d)||r.hasOwnProperty(d)),o=i==null?void 0:i.expressionInfos,{description:a,title:l}=e;return{attributes:r,expressionInfos:o,fieldInfos:n,...this._compileTitleAndDesc({title:l,description:a})}}_compileFields(e,t){const i=e.clone(),s=new Ub(this._createFieldsVMParams(e,t));return this.contentViewModels[t]=s,i.fieldInfos=s.formattedFieldInfos.slice(0),i}_createMediaVMParams(e,t){const{abilities:i,graphic:s,_fieldInfoMap:r,formattedAttributes:n,_effectivePopupTemplate:o,relatedInfos:a,_sourceLayer:l,_expressionAttributes:u}=this,{attributes:d}=s,{description:f,mediaInfos:m,title:y}=e;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:e.activeMediaInfoIndex||0,attributes:d,layer:l,fieldInfoMap:r,formattedAttributes:{...n.global,...n.content[t]},expressionAttributes:u,mediaInfos:m,popupTemplate:o,relatedInfos:a,...this._compileTitleAndDesc({title:y,description:f})}}_compileMedia(e,t){const i=e.clone(),s=new Fc(this._createMediaVMParams(e,t));return i.mediaInfos=s.formattedMediaInfos.slice(0),this.contentViewModels[t]=s,i}_createTextVMParams(e){const{graphic:t,_fieldInfoMap:i,_sourceLayer:s,_expressionAttributes:r}=this;if(e&&e.text){const{attributes:n}=t,o=this.formattedAttributes.global;e.text=Rc({attributes:n,fieldInfoMap:i,globalAttributes:o,expressionAttributes:r,layer:s,text:e.text})}return{graphic:t,creator:e.text}}_compileText(e,t){const i=e.clone();return this.contentViewModels[t]=new $v(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:e,_sourceLayer:t,graphic:i}=this;if(!e)return;const{lastEditInfoEnabled:s}=e,r=t==null?void 0:t.editFieldsInfo;return s&&r?fK(r,i.attributes):void 0}_compileTitle(e){const{_fieldInfoMap:t,_sourceLayer:i,graphic:s,_expressionAttributes:r}=this,{attributes:n}=s,o=this.formattedAttributes.global;return Rc({attributes:n,fieldInfoMap:t,globalAttributes:o,expressionAttributes:r,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this,i=e==null?void 0:e.title;return Mv(i,{graphic:t})}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this,i=e==null?void 0:e.content;return Mv(i,{graphic:t})}async _queryFeature(e){const{_featureAbortController:t,_sourceLayer:i,graphic:s,_effectivePopupTemplate:r,spatialReference:n,map:o,view:a}=this;if(t!==this._featureAbortController||!s)return;await vK({graphic:s,popupTemplate:r,layer:i,spatialReference:n},e);const{content:{value:l},title:{value:u}}=await as({content:this._getContent(),title:this._getTitle()}),{expressionAttributes:{value:d}}=await as({checkForRelatedFeatures:this._checkForRelatedFeatures(e),expressionAttributes:ioe({expressionInfos:r==null?void 0:r.expressionInfos,spatialReference:n,graphic:s,map:o,interceptor:Gp.interceptor,view:a})});t===this._featureAbortController&&s&&(this._expressionAttributes=d,this._graphicExpressionAttributes={...s.attributes,...d},this._set("formattedAttributes",this._createFormattedAttributes(l)),this._set("title",this._compileTitle(u)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(l)||null))}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){const{_effectivePopupTemplate:s,graphic:r,relatedInfos:n,_sourceLayer:o,_fieldInfoMap:a,_graphicExpressionAttributes:l}=this;i.content[t]=X_({fieldInfos:s==null?void 0:s.fieldInfos,graphic:r,attributes:{...l,...e.attributes},layer:o,fieldInfoMap:a,relatedInfos:n})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){if(e.fieldInfos){const{graphic:s,relatedInfos:r,_sourceLayer:n,_fieldInfoMap:o,_graphicExpressionAttributes:a}=this;i.content[t]=X_({fieldInfos:e.fieldInfos,graphic:s,attributes:{...a,...e.attributes},layer:n,fieldInfoMap:o,relatedInfos:r})}}_createFormattedAttributes(e){const{_effectivePopupTemplate:t,graphic:i,relatedInfos:s,_sourceLayer:r,_fieldInfoMap:n,_graphicExpressionAttributes:o}=this,a=t==null?void 0:t.fieldInfos,l={global:X_({fieldInfos:a,graphic:i,attributes:o,layer:r,fieldInfoMap:n,relatedInfos:s}),content:[]};return Array.isArray(e)&&e.forEach((u,d)=>{u.type==="fields"&&this._createFieldsFormattedAttributes({contentElement:u,contentElementIndex:d,formattedAttributes:l}),u.type==="media"&&this._createMediaFormattedAttributes({contentElement:u,contentElementIndex:d,formattedAttributes:l})}),l}_checkForRelatedFeatures(e){const{graphic:t,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(t,tC(i),e)}async _queryRelatedInfos(e,t,i){const{relatedInfos:s,_sourceLayer:r}=this;s.clear();const n=M(r.associatedLayer)?await r.associatedLayer.load(i):r;if(!n)return;const o=t.filter(u=>u&&xo(u.fieldName));if(!o||!o.length)return;t.forEach(u=>this._configureRelatedInfo(u,n));const a=await Rte({relatedInfos:s,layer:n},i);Object.keys(a).forEach(u=>{var m;const d=s.get(u.toString()),f=(m=a[u])==null?void 0:m.value;d&&f&&(d.layerInfo=f.data)});const l=await Lte({graphic:e,relatedInfos:s,layer:n},i);Object.keys(l).forEach(u=>{var d;kte((d=l[u])==null?void 0:d.value,s.get(u.toString()))})}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,s=XS(e.fieldName);if(!s)return;const{layerId:r,fieldName:n}=s;if(!r)return;const o=i.get(r.toString())||Ete(r,t);o&&(Fte({relatedInfo:o,fieldName:n,fieldInfo:e}),this.relatedInfos.set(r,o))}};nt.interceptor=new noe(wK,xK),c([h()],nt.prototype,"_error",void 0),c([h()],nt.prototype,"_featureAbortController",void 0),c([h({readOnly:!0})],nt.prototype,"_effectivePopupTemplate",null),c([h({readOnly:!0})],nt.prototype,"_fieldInfoMap",null),c([h({readOnly:!0})],nt.prototype,"_sourceLayer",null),c([h()],nt.prototype,"abilities",void 0),c([Oe("abilities")],nt.prototype,"castAbilities",null),c([h({readOnly:!0})],nt.prototype,"content",void 0),c([h({readOnly:!0})],nt.prototype,"contentViewModels",void 0),c([h()],nt.prototype,"description",void 0),c([h({type:Boolean})],nt.prototype,"defaultPopupTemplateEnabled",void 0),c([h({readOnly:!0})],nt.prototype,"state",null),c([h({readOnly:!0})],nt.prototype,"formattedAttributes",void 0),c([h({type:Ci,value:null})],nt.prototype,"graphic",null),c([h({readOnly:!0})],nt.prototype,"lastEditInfo",void 0),c([h({readOnly:!0})],nt.prototype,"relatedInfos",void 0),c([h()],nt.prototype,"spatialReference",null),c([h({readOnly:!0})],nt.prototype,"title",void 0),c([h()],nt.prototype,"map",null),c([h({readOnly:!0})],nt.prototype,"waitingForContent",null),c([h()],nt.prototype,"view",void 0),nt=Gp=c([S("esri.widgets.FeatureViewModel")],nt);const HT=nt,ft={iconText:"esri-icon-font-fallback-text",iconLoading:"esri-icon-loading-indicator esri-rotating",esriTable:"esri-widget__table",esriWidget:"esri-widget",base:"esri-feature",container:"esri-feature__size-container",title:"esri-feature__title",main:"esri-feature__main-container",btn:"esri-feature__button",icon:"esri-feature__icon",content:"esri-feature__content",contentNode:"esri-feature__content-node",contentElement:"esri-feature__content-element",text:"esri-feature__text",lastEditedInfo:"esri-feature__last-edited-info",fields:"esri-feature__fields",fieldHeader:"esri-feature__field-header",fieldData:"esri-feature__field-data",fieldDataDate:"esri-feature__field-data--date",loadingSpinnerContainer:"esri-feature__loading-container",spinner:"esri-feature__loading-spinner"},H4=e=>{let t=class extends e{constructor(){super(...arguments),this.renderNodeContent=i=>XN(i)&&!i.destroyed?P("div",{class:ft.contentNode,key:i},i.render()):i instanceof HTMLElement?P("div",{class:ft.contentNode,key:i,bind:i,afterCreate:this._attachToNode}):FK(i)?P("div",{class:ft.contentNode,key:i,bind:i.domNode,afterCreate:this._attachToNode}):null}_attachToNode(i){const s=this;i.appendChild(s)}};return t=c([S("esri.widgets.Feature.ContentMixin")],t),t};var eM;const OP={title:!0,content:!0,lastEditedInfo:!0},RP="relationship-handles";let oi=eM=class extends H4(yi){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesURIUtils=null,this.visibleElements={...OP},this.viewModel=new HT}initialize(){this.addHandles(Z(()=>{var e;return(e=this.viewModel)==null?void 0:e.contentViewModels},()=>this._setupContentWidgets(),Le))}loadDependencies(){return z(()=>import("./calcite-notice.49afa2e1.js"),["assets/calcite-notice.49afa2e1.js","assets/conditionalSlot.39f4bfa2.js","assets/observers.11f150c2.js","assets/icon.8e346cc3.js"])}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get label(){var e,t;return(t=(e=this.messages)==null?void 0:e.widgetLabel)!=null?t:""}set label(e){this._overrideIfSome("label",e)}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...OP,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{state:e}=this.viewModel,t=P("div",{class:ft.container,key:"container"},this.renderTitle(),e==="error"?this.renderError():e==="loading"?this.renderLoading():this.renderContentContainer());return P("div",{class:this.classes(ft.base,ft.esriWidget)},t)}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}renderError(){const{messagesCommon:e,messages:t,visibleElements:i}=this;return P("calcite-notice",{active:!0,color:"red",icon:"exclamation-mark-circle",scale:"s"},i.title?P("div",{key:"error-title",slot:"title"},e.errorMessage):null,P("div",{key:"error-message",slot:"message"},t.loadingError))}renderLoading(){return P("div",{key:"loading-container",class:ft.loadingSpinnerContainer},P("span",{class:this.classes(ft.iconLoading,ft.spinner)}))}renderContentContainer(){const{visibleElements:e}=this;return e.content?P("div",{class:ft.main},[this.renderContent(),this.renderLastEditInfo()]):null}renderTitle(){const{visibleElements:e,title:t}=this;return e.title?P(vT,{level:this.headingLevel,class:ft.title,innerHTML:t}):null}renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?P("div",{class:ft.contentNode,key:`${t}-content-elements`},e.map(this.renderContentElement,this)):null;if(typeof e=="string"){const i=this._contentWidgets[0];return!i||i.destroyed?null:P("div",{class:ft.contentNode,key:`${t}-content`},i.render())}return this.renderNodeContent(e)}renderContentElement(e,t){const{visibleElements:i}=this;if(typeof i.content!="boolean"&&!i.content[e.type])return null;switch(e.type){case"attachments":return this.renderAttachments(t);case"custom":return this.renderCustom(e,t);case"fields":return this.renderFields(t);case"media":return this.renderMedia(t);case"text":return this.renderText(e,t);case"expression":return this.renderExpression(t);case"relationship":return this.renderRelationship(t);default:return null}}renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:i,attachmentInfos:s}=t.viewModel;return i==="loading"||s.length>0?P("div",{key:this._buildKey("attachments-element",e),class:this.classes(ft.contentElement)},t.render()):null}renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?P("div",{key:this._buildKey("relationship-element",e),class:ft.contentElement},t.render()):null}renderExpression(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:P("div",{key:this._buildKey("expression-element",e),class:ft.contentElement},t.render())}renderCustom(e,t){const{creator:i}=e,s=this._contentWidgets[t];return!s||s.destroyed?null:i?P("div",{key:this._buildKey("custom-element",t),class:ft.contentElement},s.render()):null}renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:P("div",{key:this._buildKey("fields-element",e),class:ft.contentElement},t.render())}renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:P("div",{key:this._buildKey("media-element",e),class:ft.contentElement},t.render())}renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:i}=this.viewModel;if(!i||!e.lastEditedInfo)return null;const{date:s,user:r}=i,n=i.type==="edit"?r?t.lastEditedByUser:t.lastEdited:r?t.lastCreatedByUser:t.lastCreated,o=fn(n,{date:s,user:r});return P("div",{key:"edit-info-element",class:this.classes(ft.lastEditedInfo,ft.contentElement)},o)}renderText(e,t){const i=e.text,s=this._contentWidgets[t];return!s||s.destroyed?null:i?P("div",{key:this._buildKey("text-element",t),class:this.classes(ft.contentElement,ft.text)},s.render()):null}_buildKey(e,...t){return`${e}__${this.get("viewModel.graphic.uid")||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this.removeHandles(RP),this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_addFeatureRelationshipHandles(e){const{flowItems:t,visibleElements:i}=this;this.addHandles([Is(()=>e,"select-record",({featureViewModel:s})=>{t&&(s.abilities={relationshipContent:!0},t.push(new eM({flowItems:t,viewModel:s,visibleElements:i})))}),Is(()=>e,"show-all-records",()=>{if(!t)return;const{viewModel:s}=e;s.showAllEnabled=!0;const r=new kP({visibleElements:{title:!1,description:!1},viewModel:s});this._addFeatureRelationshipHandles(r),t.push(r)})],RP)}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t}=this,i=this.get("viewModel.content"),{contentViewModels:s}=this.viewModel;if(Array.isArray(i))i.forEach((r,n)=>{if(r.type==="attachments"&&(this._contentWidgets[n]=new kK({displayType:r.displayType,headingLevel:t.title?e+1:e,viewModel:s[n]})),r.type==="fields"&&(this._contentWidgets[n]=new ZN({viewModel:s[n]})),r.type==="media"&&(this._contentWidgets[n]=new P5({viewModel:s[n]})),r.type==="text"&&(this._contentWidgets[n]=new qg({viewModel:s[n]})),r.type==="custom"&&(this._contentWidgets[n]=new qg({viewModel:s[n]})),r.type==="expression"&&(this._contentWidgets[n]=new roe({viewModel:s[n]})),r.type==="relationship"){const o=new kP({viewModel:s[n]});this._addFeatureRelationshipHandles(o),this._contentWidgets[n]=o}},this);else{const r=s[0];r&&!r.destroyed&&(this._contentWidgets[0]=new qg({viewModel:r}))}this.scheduleRender()}};c([h()],oi.prototype,"graphic",null),c([h()],oi.prototype,"defaultPopupTemplateEnabled",null),c([h()],oi.prototype,"flowItems",void 0),c([h()],oi.prototype,"headingLevel",void 0),c([h()],oi.prototype,"label",null),c([h(),di("esri/widgets/Feature/t9n/Feature")],oi.prototype,"messages",void 0),c([h(),di("esri/t9n/common")],oi.prototype,"messagesCommon",void 0),c([h(),di("esri/widgets/support/t9n/uriUtils")],oi.prototype,"messagesURIUtils",void 0),c([h()],oi.prototype,"spatialReference",null),c([h({readOnly:!0})],oi.prototype,"title",null),c([h()],oi.prototype,"visibleElements",void 0),c([Oe("visibleElements")],oi.prototype,"castVisibleElements",null),c([h()],oi.prototype,"map",null),c([h()],oi.prototype,"view",null),c([h({type:HT})],oi.prototype,"viewModel",void 0),oi=eM=c([S("esri.widgets.Feature")],oi);const aoe=oi;var Y4;const u0=Symbol("anchorHandles");let ac=class extends jo.EventedAccessor{constructor(e){super(e),this[Y4]=new qi,this.location=null,this.screenLocationEnabled=!1,this.view=null,this[u0].add([Qs(()=>ja(this.screenLocationEnabled?this.view:null,t=>[t.size,t.type==="3d"?t.camera:t.viewpoint]),()=>this.notifyChange("screenLocation")),Z(()=>this.screenLocation,(t,i)=>{M(t)&&M(i)&&this.emit("view-change")})])}destroy(){this.view=null,this[u0]=$t(this[u0])}get screenLocation(){const{location:e,view:t,screenLocationEnabled:i}=this;return i&&M(e)&&M(t)&&t.ready?t.toScreen(e):null}};Y4=u0,c([h()],ac.prototype,"location",void 0),c([h()],ac.prototype,"screenLocation",null),c([h()],ac.prototype,"screenLocationEnabled",void 0),c([h()],ac.prototype,"view",void 0),ac=c([S("esri.widgets.support.AnchorElementViewModel")],ac);const J4=ac,loe="esri.widgets.CompassViewModel";let h0=class extends J4{constructor(e){super(e),this.visible=!1}};c([h()],h0.prototype,"visible",void 0),h0=c([S(loe)],h0);const X4=h0,Cw={base:"esri-spinner",spinnerStart:"esri-spinner--start",spinnerFinish:"esri-spinner--finish"};let lc=class extends yi{constructor(e,t){super(e,t),this._animationDelay=500,this._animationPromise=null,this.viewModel=new X4}initialize(){this.addHandles(Z(()=>this.visible,e=>this._visibleChange(e)))}destroy(){this._animationPromise=null}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}show(e){const{location:t,promise:i}=e;t&&(this.viewModel.location=t),this.visible=!0;const s=()=>this.hide();i&&i.catch(()=>{}).then(s)}hide(){this.visible=!1}render(){const{visible:e}=this,{screenLocation:t}=this.viewModel,i=!!t,s=e&&i,r=!e&&i,n={[Cw.spinnerStart]:s,[Cw.spinnerFinish]:r},o=this._getPositionStyles();return P("div",{class:this.classes(Cw.base,n),styles:o})}_visibleChange(e){if(e)return void(this.viewModel.screenLocationEnabled=!0);const t=nb(this._animationDelay);this._animationPromise=t,t.catch(()=>{}).then(()=>{this._animationPromise===t&&(this.viewModel.screenLocationEnabled=!1,this._animationPromise=null)})}_getPositionStyles(){const{screenLocation:e,view:t}=this.viewModel;if(N(t)||N(e))return{};const{padding:i}=t;return{left:e.x-i.left+"px",top:e.y-i.top+"px"}}};c([h()],lc.prototype,"location",null),c([h()],lc.prototype,"view",null),c([h({type:X4})],lc.prototype,"viewModel",void 0),c([h()],lc.prototype,"visible",null),lc=c([S("esri.widgets.Spinner")],lc);const coe=lc,uoe="OBJECTID";var LP;(function(e){e[e.size=22]="size",e[e.lineWidth=50]="lineWidth",e[e.maxSize=120]="maxSize",e[e.maxOutlineSize=80]="maxOutlineSize",e[e.tallSymbolWidth=20]="tallSymbolWidth"})(LP||(LP={}));function Z4(){const e=new Float32Array(6);return e[0]=1,e[3]=1,e}function hoe(e){const t=new Float32Array(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function doe(e,t,i,s,r,n){const o=new Float32Array(6);return o[0]=e,o[1]=t,o[2]=i,o[3]=s,o[4]=r,o[5]=n,o}function poe(e,t){return new Float32Array(e,t,6)}function Q4(e,t,i,s){const r=t[s],n=t[s+1];e[s]=i[0]*r+i[2]*n+i[4],e[s+1]=i[1]*r+i[3]*n+i[5]}function foe(e,t,i,s=0,r=0,n=2){const o=r||t.length/n;for(let a=s;a=4;D1();function sj(e){return e&&"opacity"in e?e.opacity*sj(e.parent):1}async function Eoe(e,t){var b,_;if(!e)return;const i=e.sourceLayer,s=(b=M(t)&&t.useSourceLayer?i:e.layer)!=null?b:i,r=sj(s);if(M(e.symbol)&&(!M(t)||t.ignoreGraphicSymbol!==!0)){const x=e.symbol.type==="web-style"?await e.symbol.fetchSymbol({...t,cache:M(t)?t.webStyleCache:null}):e.symbol.clone();return tw(x,null,r),x}const n=(_=M(t)?t.renderer:null)!=null?_:s&&"renderer"in s?s.renderer:null;let o=n&&"getSymbolAsync"in n?await n.getSymbolAsync(e,t):null;if(!o)return;if(o=o.type==="web-style"?await o.fetchSymbol({...t,cache:M(t)?t.webStyleCache:null}):o.clone(),!(n&&"visualVariables"in n&&n.visualVariables&&n.visualVariables.length))return tw(o,null,r),o;if("arcadeRequiredForVisualVariables"in n&&n.arcadeRequiredForVisualVariables&&(N(t)||N(t.arcade))){const x={...t};x.arcade=await Do(),t=x}const a=await z(()=>Promise.resolve().then(function(){return PT}),void 0),l=[],u=[],d=[],f=[];for(const x of n.visualVariables)switch(x.type){case"color":l.push(x);break;case"opacity":u.push(x);break;case"rotation":f.push(x);break;case"size":x.target||d.push(x)}const m=!!l.length&&l[l.length-1],y=m?a.getColor(m,e,t):null,g=!!u.length&&u[u.length-1];let v=g?a.getOpacity(g,e,t):null;if(r!=null&&(v=v!=null?v*r:r),tw(o,y,v),d.length){const x=a.getAllSizes(d,e,t);await iee(o,x)}for(const x of f)see(o,a.getRotationAngle(x,e,t),x.axis);return o}class koe{constructor(t,i){this._owner=i,this._properties={},this._afterDispatchHandle=null;for(const s in t){const r=t[s],n=new AR(r,void 0,void 0,2,2);this._properties[s]={pool:n,acquired:[]}}this._afterDispatchHandle=U7(()=>this._release())}destroy(){this._afterDispatchHandle&&(this._afterDispatchHandle.remove(),this._afterDispatchHandle=null);for(const t in this._properties){const i=this._properties[t];for(const s of i.acquired)vE(s)||i.pool.release(s);i.pool.destroy(),i.pool=null,i.acquired=null}this._properties=null,this._owner=null}get(t){const i=this._owner._get(t),s=this._properties[t];let r=s.pool.acquire();for(s.acquired.push(r);r===i;)s.acquired.push(r),r=s.pool.acquire();return r}_release(){for(const t in this._properties){const i=this._properties[t];let s=0;for(const r of i.acquired)vE(r)?i.acquired[s++]=r:i.pool.release(r);i.acquired.length=s}}}const Coe=V("mac")?"Meta":"Ctrl",i_={8:"Backspace",9:"Tab",13:"Enter",27:"Escape",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete"};for(let e=48;e<58;e++)i_[e]=String.fromCharCode(e);for(let e=1;e<25;e++)i_[111+e]=`F${e}`;for(let e=65;e<91;e++)i_[e]=[String.fromCharCode(e+32),String.fromCharCode(e)];function Poe(e){if(e.key!==void 0)return yc(e);const t=i_[e.keyCode];return Array.isArray(t)?e.shiftKey?t[1]:t[0]:t}function Aoe(e){switch(e){case"Ctrl":case"Alt":case"Shift":case"Meta":case"Primary":return!0}return!1}class Ooe{constructor(t,i=[]){this.eventType=t,this.keyModifiers=i}matches(t){if(t.type!==this.eventType)return!1;if(this.keyModifiers.length===0)return!0;const i=t.modifiers;for(const s of this.keyModifiers)if(!i.has(s))return!1;return!0}}const DP=q.getLogger("esri.views.input.InputHandler");class ei{constructor(t){this._manager=null,this._incoming={},this._outgoing={},this._incomingEventMatches=null,this._incomingEventTypes=null,this._outgoingEventTypes=null,this._hasSideEffects=t}get incomingEventMatches(){if(!this._incomingEventMatches){this._incomingEventMatches=[];for(const t in this._incoming){const i=this._incoming[t];for(const s of i)this._incomingEventMatches.push(s.match)}}return this._incomingEventMatches}get incomingEventTypes(){return this._incomingEventTypes||(this._incomingEventTypes=this.incomingEventMatches.map(t=>t.eventType)),this._incomingEventTypes}get outgoingEventTypes(){return this._outgoingEventTypes||(this._outgoingEventTypes=Object.keys(this._outgoing)),this._outgoingEventTypes}get hasSideEffects(){return this._hasSideEffects}get hasPendingInputs(){return!1}onInstall(t){this._manager?DP.error("This InputHandler has already been registered with an InputManager"):(t.setEventCallback(i=>this._handleEvent(i)),t.setUninstallCallback(()=>this._onUninstall()),this._manager=t)}onUninstall(){}registerIncoming(t,i,s){let r;typeof i=="function"?(s=i,r=[]):r=i||[];const n=typeof t=="string"?new Ooe(t,r):t,o=()=>{this._incomingEventTypes=null,this._incomingEventMatches=null},a=d=>{const f=this._incoming[d.match.eventType];if(f){const m=f.indexOf(d);f.splice(m,1),o(),this._manager&&this._manager.updateDependencies()}},l=new Roe(n,s,{onPause:a,onRemove:a,onResume:d=>{const f=this._incoming[d.match.eventType];f&&!f.includes(d)&&(f.push(d),o(),this._manager&&this._manager.updateDependencies())}});let u=this._incoming[n.eventType];return u||(u=[],this._incoming[n.eventType]=u),u.push(l),o(),this._manager&&this._manager.updateDependencies(),l}registerOutgoing(t){if(this._outgoing[t])throw new Error("There is already a callback registered for this outgoing InputEvent: "+t);const i=new Loe(t,{onEmit:(s,r,n,o)=>{var a;(a=this._manager)==null||a.emit(s.eventType,r,n,o)},onRemove:s=>{var r;delete this._outgoing[s.eventType],(r=this._manager)==null||r.updateDependencies()}});return this._outgoing[t]=i,this._outgoingEventTypes=null,this._manager&&this._manager.updateDependencies(),i}startCapturingPointer(t){var i;(i=this._manager)==null||i.setPointerCapture(t,!0)}stopCapturingPointer(t){var i;(i=this._manager)==null||i.setPointerCapture(t,!1)}refreshHasPendingInputs(){var t;(t=this._manager)==null||t.refreshHasPendingInputs()}_onUninstall(){this._manager?(this.onUninstall(),this._manager=null):DP.error("This InputHandler is not registered with an InputManager")}_handleEvent(t){var s;const i=this._incoming[t.type];if(i){for(const r of i)if(r.match.matches(t)&&((s=r.callback)==null||s.call(r,t),t.shouldStopPropagation()))break}}}class Roe{constructor(t,i,s){this.match=t,this._callback=i,this._handler=s}pause(){this._handler.onPause(this)}resume(){this._handler.onResume(this)}remove(){this._handler.onRemove(this)}get callback(){return this._callback}}class Loe{constructor(t,i){this.eventType=t,this._removed=!1,this._handler=i}emit(t,i,s){this._removed||this._handler.onEmit(this,t,i,s)}remove(){this._removed=!0,this._handler.onRemove(this)}}class Foe extends ei{constructor(t){super(!0),this._onChange=t,this._value="mouse",this._x=null,this._y=null,this.registerIncoming("pointer-move",i=>{this._update(i.data)})}_update(t){const i=t.native.pointerType==="touch"?"touch":"mouse",{x:s,y:r}=t;i===this._value&&this._x===s&&this._y===r||(this._value=i,this._x=s,this._y=r,this._onChange(i,s,r))}}class Pv{constructor(t){this._observable=new S$,this._value=t}get(){return _e(this._observable),this._value}set(t){t!==this._value&&(this._value=t,this._observable.notify())}}class Doe extends ei{constructor(){super(!0),this._activeTouchPointerIds=new Set,this._multiTouchActive=new Pv(!1),this._onPointerAdd=({data:t})=>{t.pointerType==="touch"&&(this._activeTouchPointerIds.add(t.native.pointerId),this._update())},this._onPointerRemove=({data:t})=>{t.pointerType==="touch"&&(this._activeTouchPointerIds.delete(t.native.pointerId),this._update())},this.registerIncoming("pointer-down",this._onPointerAdd),this.registerIncoming("pointer-up",this._onPointerRemove),this.registerIncoming("pointer-capture-lost",this._onPointerRemove),this.registerIncoming("pointer-cancel",this._onPointerRemove)}get multiTouchActive(){return this._multiTouchActive.get()}_update(){this._multiTouchActive.set(this._activeTouchPointerIds.size>1)}}let cn=class extends oe{constructor(e){super(e),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=Coe,this._latestPointerType="mouse",this._propertiesPool=new koe({latestPointerLocation:joe},this),this.latestPointerLocation=null,this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const e=Object.keys(this._nameToGroup);for(const t of e)this.uninstallHandlers(t);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(e=>e.handler.hasPendingInputs)}get latestPointerType(){return this._latestPointerType}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}installHandlers(e,t,i=el.INTERNAL){if(this._nameToGroup[e])return void q.getLogger(this.declaredClass).error("There is already an InputHandler group registered under the name `"+e+"`");if(t.length===0)return void q.getLogger(this.declaredClass).error("Can't register a group of zero handlers");const s={name:e,handlers:t.map(r=>({handler:r,active:!0,removed:!1,priorityIndex:0,groupPriority:i,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[e]=s;for(let r=s.handlers.length-1;r>=0;r--){const n=s.handlers[r];this._handlers.push(n),n.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(o,a,l,u,d)=>{this._emitInputEvent(n.priorityIndex+1,o,a,l,d,u)},setPointerCapture:(o,a)=>{this._setPointerCapture(s,n,o,a)},setEventCallback:o=>{n.eventCallback=o},setUninstallCallback:o=>{n.uninstallCallback=o},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(e){const t=this._nameToGroup[e];t?(t.handlers.forEach(i=>{var s;i.removed=!0,(s=i.uninstallCallback)==null||s.call(i)}),delete this._nameToGroup[e],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):q.getLogger(this.declaredClass).error("There is no InputHandler group registered under the name `"+e+"`")}hasHandlers(e){return this._nameToGroup[e]!==void 0}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const e=new Set,t=new Set;this._handlersPriority=[];for(let i=this._handlers.length-1;i>=0;i--){const s=this._handlers[i];s.priorityIndex=i,this._handlersPriority.push(s)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let i=this._handlersPriority.length-1;i>=0;i--){const s=this._handlersPriority[i];s.priorityIndex=i;let r=s.handler.hasSideEffects;if(!r){for(const n of s.handler.outgoingEventTypes)if(e.has(n)){r=!0;break}}if(r)for(const n of s.handler.incomingEventMatches){e.add(n.eventType);for(const o of n.keyModifiers)Aoe(o)||t.add(o)}s.active=r}this._sourceEvents=e,this._keyModifiers=t,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(e,t,i){this._latestPointerType=e;const s=this._get("latestPointerLocation");if(N(s)||s.x!==t||s.y!==i){const r=this._propertiesPool.get("latestPointerLocation");r.x=t,r.y=i,this._set("latestPointerLocation",r)}}_onEventReceived(e,t){if(e==="pointer-capture-lost"){const r=t;this._pointerCaptures.delete(r.native.pointerId)}this._updateKeyModifiers(e,t);const i=this.test.timestamp!=null?this.test.timestamp:t.native?t.native.timestamp:void 0,s=t.native?t.native.cancelable:void 0;this._emitInputEventFromSource(e,t,i,s)}_updateKeyModifiers(e,t){if(!t)return;let i=!1;const s=()=>{if(!i){const o=new Set;this._activeKeyModifiers.forEach(a=>{o.add(a)}),this._activeKeyModifiers=o,i=!0}},r=(o,a)=>{a&&!this._activeKeyModifiers.has(o)?(s(),this._activeKeyModifiers.add(o)):!a&&this._activeKeyModifiers.has(o)&&(s(),this._activeKeyModifiers.delete(o))};if(e==="key-down"||e==="key-up"){const o=t.key;this._keyModifiers.has(o)&&r(o,e==="key-down")}const n=t.native;r("Alt",!(!n||!n.altKey)),r("Ctrl",!(!n||!n.ctrlKey)),r("Shift",!(!n||!n.shiftKey)),r("Meta",!(!n||!n.metaKey)),r("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new Foe((e,t,i)=>this._setLatestPointer(e,t,i)),this._multiTouchHandler=new Doe,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],el.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,el.INTERNAL)}_setPointerCapture(e,t,i,s){const r=e.name+"-"+t.priorityIndex,n=this._pointerCaptures.get(i.pointerId)||new Set;this._pointerCaptures.set(i.pointerId,n),s?(n.add(r),n.size===1&&this.eventSource&&this.eventSource.setPointerCapture(i,!0)):n.has(r)&&(n.delete(r),n.size===0&&(this._pointerCaptures.delete(i.pointerId),this.eventSource&&this.eventSource.setPointerCapture(i,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(e=>!e.removed),this.updateDependencies()}_emitInputEventFromSource(e,t,i,s){this._emitInputEvent(0,e,t,i,s)}_emitInputEvent(e,t,i,s,r,n){const o=s!==void 0?s:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),a=r!==void 0&&r,l={event:new Noe(t,i,o,n||this._activeKeyModifiers,a),priorityIndex:e};this._currentPropagation?this._currentPropagation.events.push(l):this._doNewPropagation(l)}_doNewPropagation(e){this._currentPropagation={events:new xv,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:e.event.timestamp},this._currentPropagation.events.push(e),this._continuePropagation()}_continuePropagation(){var t,i;const e=Hs(this._currentPropagation);for(;e.events.length>0;){const{event:s,priorityIndex:r}=e.events.pop(),n=s.data&&s.data.eventId;if(!(n!=null&&this._stoppedPropagationEventIds.has(n)))for(e.currentHandler=this._handlersPriority[r];e.currentHandler;){if(e.currentHandler.removed)e.needsHandlerGarbageCollect=!0;else{if(e.currentHandler.active&&!s.shouldStopPropagation()&&((i=(t=e.currentHandler).eventCallback)==null||i.call(t,s)),s.shouldStopPropagation()){n!=null&&this._stoppedPropagationEventIds.add(n);break}if(s.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:s,priorityIndex:e.currentHandler.priorityIndex+1})}e.currentHandler=this._handlersPriority[e.currentHandler.priorityIndex+1]}}e.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}_pausePropagation(e){const t=new xv;t.push(e);const i=this._currentPropagation;if(i){for(;i.events.length;)t.push(i.events.pop());i.events=t,i.currentHandler=null}}_compareHandlerPriority(e,t){if(e.handler.hasSideEffects!==t.handler.hasSideEffects)return e.handler.hasSideEffects?1:-1;if(e.groupPriority!==t.groupPriority)return e.groupPriority>t.groupPriority?-1:1;for(const i of e.handler.incomingEventMatches)for(const s of t.handler.incomingEventMatches){if(i.eventType!==s.eventType)continue;const r=i.keyModifiers.filter(n=>s.keyModifiers.includes(n));if(r.length===i.keyModifiers.length!=(r.length===s.keyModifiers.length))return i.keyModifiers.length>s.keyModifiers.length?-1:1}return e.priorityIndex>t.priorityIndex?-1:1}_sortHandlersPriority(e){const t=[];for(const i of e){let s=0;for(;s=0;)s++;t.splice(s,0,i)}return t}get debug(){const e=t=>{const i=this._setPointerCapture;this._setPointerCapture=()=>{},t(),this._setPointerCapture=i};return{injectEvent:(t,i)=>{e(()=>{this._onEventReceived(t,i)})},disablePointerCapture:e}}};c([h({readOnly:!0})],cn.prototype,"hasPendingInputs",null),c([h({constructOnly:!0})],cn.prototype,"eventSource",void 0),c([h({constructOnly:!0})],cn.prototype,"recognizers",void 0),c([h()],cn.prototype,"_latestPointerType",void 0),c([h()],cn.prototype,"latestPointerType",null),c([h()],cn.prototype,"multiTouchActive",null),c([h({readOnly:!0})],cn.prototype,"latestPointerLocation",void 0),cn=c([S("esri.views.input.InputManager")],cn);class Noe{constructor(t,i,s,r,n){this.type=t,this.data=i,this.timestamp=s,this.modifiers=r,this.cancelable=n,this._propagationState=Fa.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=Fa.STOPPED}shouldStopPropagation(){return(this._propagationState&Fa.STOPPED)!=0}async(t){this._propagationState|=Fa.PAUSED;const i=(s,r)=>{this._propagationState&=~Fa.PAUSED;const n=this._resumeCallback;if(this._resumeCallback=null,n&&n(),r)throw s;return s};return(typeof t=="function"?t():t).then(s=>i(s,!1),s=>i(s,!0))}shouldPausePropagation(t){return!!(this._propagationState&Fa.PAUSED)&&(this._resumeCallback=t,!0)}preventDefault(){this.data.native.preventDefault()}}var Fa;(function(e){e[e.NONE=0]="NONE",e[e.STOPPED=1]="STOPPED",e[e.PAUSED=2]="PAUSED"})(Fa||(Fa={}));const el={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};class joe{}function NP(e){return e&&typeof e.highlight=="function"}const s_={iconZoom:"esri-icon-zoom-in-magnifying-glass",iconTrash:"esri-icon-trash",iconBrowseClusteredFeatures:"esri-icon-table"},Nc=new pd({id:"zoom-to-feature",title:"{messages.zoom}",className:s_.iconZoom}),jP=new pd({id:"remove-selected-feature",title:"{messages.remove}",className:s_.iconTrash}),gh=new pd({id:"zoom-to-clustered-features",title:"{messages.zoom}",className:s_.iconZoom}),vh=new pd({id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:s_.iconBrowseClusteredFeatures}),Voe="esri.widgets.Popup.PopupViewModel",Av=q.getLogger(Voe),zoe=e=>{const{event:t,view:i}=e,{action:s}=t,r=i&&i.popup;if(!s)return Promise.reject(new L("trigger-action:missing-arguments","Event has no action"));if(!r)return Promise.reject(new L("trigger-action:missing-arguments","view.popup is missing"));const{disabled:n,id:o}=s;if(!o)return Promise.reject(new L("trigger-action:invalid-action","action.id is missing"));if(n)return Promise.reject(new L("trigger-action:invalid-action","Action is disabled"));if(o===Nc.id)return Uoe(r.viewModel).catch(w1);if(o===gh.id)return qoe(r.viewModel);if(o===vh.id)return r.featureMenuOpen=!r.featureMenuOpen,r.viewModel.browseClusterEnabled=!r.viewModel.browseClusterEnabled,Promise.resolve();if(r.viewModel.browseClusterEnabled=!1,o===jP.id){r.close();const{selectedFeature:a}=r;if(!a)return Promise.reject(new L(`trigger-action:${jP.id}`,"selectedFeature is required",{selectedFeature:a}));const{sourceLayer:l}=a;return l?l.remove(a):i.graphics.remove(a),Promise.resolve()}return Promise.resolve()};function rj(e){const{selectedFeature:t,location:i,view:s}=e;return s?s.type==="3d"?t||i:e.get("selectedFeature.geometry")||i:null}function xc(e){var t,i;return(e==null?void 0:e.isAggregate)&&((i=(t=e==null?void 0:e.sourceLayer)==null?void 0:t.featureReduction)==null?void 0:i.type)==="cluster"}async function Boe(e,t){if((t==null?void 0:t.type)!=="3d"||!e||e.declaredClass!=="esri.Graphic")return!0;const i=t.getViewForGraphic(e);if(i&&"whenGraphicBounds"in i){let s;try{s=await i.whenGraphicBounds(e,{useViewElevation:!0})}catch{}return!s||!s.boundingBox||s.boundingBox[0]===s.boundingBox[3]&&s.boundingBox[1]===s.boundingBox[4]&&s.boundingBox[2]===s.boundingBox[5]}return!0}async function Uoe(e){const{location:t,selectedFeature:i,view:s,zoomFactor:r}=e,n=rj(e);if(!n){const u=new L("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:n,view:s});throw Av.error(u),u}const o=s.scale/r,a=e.get("selectedFeature.geometry")||t,l=a&&a.type==="point"&&await Boe(i,s);Nc.active=!0,Nc.disabled=!0;try{await e.zoomTo({target:{target:n,scale:l?o:void 0}})}catch{const d=new L("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:i});Av.error(d)}finally{Nc.active=!1,Nc.disabled=!1,e.zoomToLocation=null,l&&(e.location=a)}}async function qoe(e){const{selectedFeature:t,view:i}=e;if((i==null?void 0:i.type)!=="2d"){const a=new L("zoomToCluster:invalid-view","View must be 2d MapView.",{view:i});throw Av.error(a),a}if(!xc(t)){const a=new L("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:t});throw Av.error(a),a}const s=t.sourceLayer,r=await i.whenLayerView(s),n=r.createQuery();n.aggregateIds=[t.getObjectId()],gh.active=!0,gh.disabled=!0;const{extent:o}=await r.queryExtent(n);await e.zoomTo({target:o}),gh.active=!1,gh.disabled=!1}async function Goe(e){const{selectedFeature:t,view:i}=e,s=t.sourceLayer,r=await i.whenLayerView(s),n=r.createQuery();n.aggregateIds=[t.getObjectId()];const{extent:o}=await r.queryExtent(n);e.selectedClusterBoundaryFeature.geometry=o,i.graphics.add(e.selectedClusterBoundaryFeature)}async function Woe(e){const{selectedFeature:t,view:i}=e,s=t.sourceLayer,r=await i.whenLayerView(s),n=r.createQuery();n.aggregateIds=[t.getObjectId()],vh.active=!0,vh.disabled=!0;const{features:o}=await r.queryFeatures(n);vh.active=!1,vh.disabled=!1,i.popup.open({features:[t].concat(o),featureMenuOpen:!0})}function Hoe(e){const t=e.features.filter(i=>xc(i));t.length&&(e.features=t)}const nj=e=>{let t=class extends e{constructor(...i){super(...i),this.goToOverride=null,this.view=null}callGoTo(i){const{view:s}=this;return this.goToOverride?this.goToOverride(s,i):s.goTo(i.target,i.options)}};return c([h()],t.prototype,"goToOverride",void 0),c([h()],t.prototype,"view",void 0),t=c([S("esri.widgets.support.GoTo")],t),t},If=he.ofType({key:"type",defaultKeyValue:"button",base:Ob,typeMap:{button:pd,toggle:JD}}),Yoe=()=>[Nc.clone()],Joe=()=>[gh.clone(),vh.clone()];let Ce=class extends nj(J4){constructor(e){super(e),this._handles=new qi,this._pendingPromises=new Set,this._fetchFeaturesController=null,this._selectedClusterFeature=null,this.featurePage=null,this.actions=new If,this.activeFeature=null,this.defaultPopupTemplateEnabled=!1,this.autoCloseEnabled=!1,this.autoOpenEnabled=!0,this.browseClusterEnabled=!1,this.content=null,this.featuresPerPage=20,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new Ci({symbol:new gl({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null}get isLoadingFeature(){return this.featureViewModels.some(e=>e.waitingForContent)}initialize(){this._handles.add([Z(()=>[this.autoOpenEnabled,this.view],()=>this._autoOpenEnabledChange()),this.on("view-change",()=>this._autoClose()),Z(()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view],()=>this._highlightSelectedFeature()),Z(()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view],()=>this._highlightActiveFeature()),Z(()=>{var e,t;return(t=(e=this.view)==null?void 0:e.animation)==null?void 0:t.state},e=>this._animationStateChange(e)),Z(()=>this.location,e=>this._locationChange(e)),Z(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),Z(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),Z(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels],()=>this._setGraphicOnFeatureViewModels()),Z(()=>this.featureViewModels,()=>this._featureViewModelsChange()),this.on("trigger-action",e=>zoe({event:e,view:this.view})),Qs(()=>!this.waitingForResult,()=>this._waitingForResultChange(),Nh),Z(()=>{var e,t;return[this.features,(e=this.view)==null?void 0:e.map,(t=this.view)==null?void 0:t.spatialReference]},()=>this._updateFeatureVMs()),Z(()=>{var e;return(e=this.view)==null?void 0:e.scale},()=>this._viewScaleChange()),Qs(()=>!this.visible,()=>this.browseClusterEnabled=!1),Z(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelFetchingFeatures(),this._handles.destroy(),this._handles=null,this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new If;e.removeAll();const{actions:t,defaultActions:i,defaultPopupTemplateEnabled:s,includeDefaultActions:r,selectedFeature:n}=this,o=r?i.concat(t):t,a=n&&(typeof n.getEffectivePopupTemplate=="function"&&n.getEffectivePopupTemplate(s)||n.popupTemplate),l=a&&a.actions,u=a&&a.overwriteActions?l:l?l.concat(o):o;return u&&u.filter(Boolean).forEach(d=>e.add(d)),e}get defaultActions(){const e=this._get("defaultActions")||new If;return e.removeAll(),e.addMany(xc(this.selectedFeature)?Joe():Yoe()),e}get featureCount(){return this.features.length}get features(){return this._get("features")||[]}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:i,promiseCount:s,selectedFeatureIndex:r}=this,n=s&&t.length;n&&i&&r===-1?this.selectedFeatureIndex=0:n&&r!==-1||(this.selectedFeatureIndex=t.length?0:-1)}get location(){return this._get("location")||null}set location(e){const t=this.get("view.spatialReference.isWebMercator");e&&e.get("spatialReference.isWGS84")&&t&&(e=Za(e)),this._set("location",e)}get pendingPromisesCount(){return this._pendingPromises.size}get waitingForResult(){return!(!(!!this._fetchFeaturesController||this.pendingPromisesCount>0)||this.featureCount!==0)}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){if(this._pendingPromises.clear(),this.features=[],!Array.isArray(e)||!e.length)return this._set("promises",[]),void this.notifyChange("pendingPromisesCount");this._set("promises",e),(e=e.slice(0)).forEach(t=>{this._pendingPromises.add(t);const i=r=>{this._pendingPromises.has(t)&&this._updateFeatures(r),this._updatePendingPromises(t)},s=()=>this._updatePendingPromises(t);t.then(i,s)}),this.notifyChange("pendingPromisesCount")}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;return t===-1?null:e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return typeof e=="number"?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;e=isNaN(e)||e<-1||!t?-1:(e+t)%t,this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get state(){return this.get("view.ready")?"ready":"disabled"}centerAtLocation(){const{view:e}=this,t=rj(this);return t?this.callGoTo({target:{target:t,scale:e.scale}}):Promise.reject(new L("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new L("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return i.fetchPopupFeatures(e,{event:t&&t.event,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t&&t.signal})}open(e){const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:i}=t;delete t.fetchFeatures,i&&this._setFetchFeaturesPromises(t.location);const s=["actionsMenuOpen","collapsed","featureMenuOpen"];for(const r of s)delete t[r];this.set(t)}triggerAction(e){const t=this.allActions.getItemAt(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex=this.selectedFeatureIndex+1,this}previous(){return this.selectedFeatureIndex=this.selectedFeatureIndex-1,this}disableClusterBrowsing(){Hoe(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;(e==null?void 0:e.type)==="2d"?xc(t)?(await Goe(this),await Woe(this)):q.getLogger(this.declaredClass).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):q.getLogger(this.declaredClass).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}_animationStateChange(e){this.zoomToLocation||(Nc.disabled=e==="waiting-for-target")}_clearBrowsedClusterGraphics(){var t;const e=(t=this.view)==null?void 0:t.graphics;e&&(e.remove(this.selectedClusterBoundaryFeature),e.remove(this._selectedClusterFeature)),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(xc(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=[this.selectedFeature])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i}=this;i&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>1?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>1?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:s,featureViewModels:r}=this;if(i===null)return;const n=((i-1)*s+t)%t,o=n+s;r.slice(n,o).forEach((a,l)=>{a&&!a.graphic&&(a.graphic=e[n+l])})}async _selectedFeatureChange(e){if(!e)return;const{location:t,updateLocationEnabled:i,view:s}=this;if(this.browseClusterEnabled)return this._selectedClusterFeature&&(s.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),xc(e)?void 0:(e.symbol=await Eoe(e),this._selectedClusterFeature=e,void s.graphics.add(this._selectedClusterFeature));!i&&t||!e.geometry?i&&!e.geometry&&this.centerAtLocation().then(()=>{this.location=s.center.clone()}):this.location=this._getPointFromGeometry(e.geometry)}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}_setFetchFeaturesPromises(e){return this._fetchFeaturesWithController(this._getScreenPoint(e||this.location)).then(t=>{const{clientOnlyGraphics:i,promisesPerLayerView:s}=t,r=Promise.resolve(i),n=s.map(o=>o.promise);this.promises=[r,...n]})}_destroyFeatureVMs(){this.featureViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:i}=this;if(xc(e)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t||!t.length)return;const s=i.slice(0),r=[];t.forEach((n,o)=>{var l,u;if(!n)return;let a=null;if(s.some((d,f)=>(d&&d.graphic===n&&(a=d,s.splice(f,1)),!!a)),a)r[o]=a;else{const d=new HT({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:(l=this.view)==null?void 0:l.spatialReference,graphic:n===e?n:null,map:(u=this.view)==null?void 0:u.map,view:this.view});r[o]=d}}),s.forEach(n=>n&&!n.destroyed&&n.destroy()),this._set("featureViewModels",r)}_getScreenPoint(e){const{view:t}=this;return t&&e&&typeof t.toScreen=="function"?t.toScreen(e):null}_autoOpenEnabledChange(){const e="auto-fetch-features",{_handles:t,autoOpenEnabled:i}=this;if(t.remove(e),i&&this.view){const s=this.view.on("click",r=>{r.pointerType==="mouse"&&r.button!==0||this._fetchFeaturesAndOpen(r)},el.WIDGET);t.add(s,e)}}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null,this.notifyChange("waitingForResult")}_fetchFeaturesWithController(e,t){this._cancelFetchingFeatures();const i=new AbortController,{signal:s}=i;this._fetchFeaturesController=i,this.notifyChange("waitingForResult");const r=this.fetchFeatures(e,{signal:s,event:t});return r.catch(()=>{}).then(()=>{this._fetchFeaturesController=null,this.notifyChange("waitingForResult")}),r}_fetchFeaturesAndOpen(e){const{screenPoint:t,mapPoint:i}=e,{view:s}=this;this._fetchFeaturesWithController(t,e).then(r=>{const{clientOnlyGraphics:n,promisesPerLayerView:o,location:a}=r,l=[Promise.resolve(n),...o.map(u=>u.promise)];return s.popup.open({location:a||i,promises:l}),r})}_updatePendingPromises(e){e&&this._pendingPromises.has(e)&&(this._pendingPromises.delete(e),this.notifyChange("pendingPromisesCount"))}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}_getPointFromGeometry(e){var t;return N(e)?null:e.type==="point"?e:e.type==="extent"?e.center:e.type==="polygon"?e.centroid:e.type==="multipoint"||e.type==="polyline"?(t=e.extent)==null?void 0:t.center:null}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const{layer:t,sourceLayer:i}=e;return i&&"layer"in i&&i.layer?i.layer:(i==null?void 0:i.type)==="map-notes"||(i==null?void 0:i.type)==="subtype-group"?i:t}_getHighlightTarget(e,t){const i=t.type==="imagery"?void 0:"objectIdField"in t?t.objectIdField||uoe:null,s=e.attributes;return s&&i&&s[i]||e}async _highlightActiveFeature(){const e="highlight-active-feature";this._handles.remove(e);const{highlightEnabled:t,view:i,activeFeature:s,visible:r}=this;if(!(s&&i&&t&&r))return;const n=this._getHighlightLayer(s);if(!(n&&n instanceof Yf))return;const o=this._getLayerView(i,n);this._highlightActiveFeaturePromise=o;const a=await o;if(!(a&&NP(a)&&this._highlightActiveFeaturePromise===o&&this.activeFeature&&this.highlightEnabled))return;const l=a.highlight(this._getHighlightTarget(s,n));this._handles.add(l,e)}async _highlightSelectedFeature(){const e="highlight-selected-feature";this._handles.remove(e);const{selectedFeature:t,highlightEnabled:i,view:s,visible:r}=this;if(!(t&&s&&i&&r))return;const n=this._getHighlightLayer(t);if(!(n&&n instanceof Yf))return;const o=this._getLayerView(s,n);this._highlightSelectedFeaturePromise=o;const a=await o;if(!(a&&NP(a)&&this._highlightSelectedFeaturePromise===o&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const l=a.highlight(this._getHighlightTarget(t,n));this._handles.add(l,e)}_updateFeatures(e){const{features:t}=this;if(!e||!e.length)return;if(!t.length)return void(this.features=e);const i=e.filter(s=>!t.includes(s));this.features=t.concat(i)}};c([h()],Ce.prototype,"featurePage",void 0),c([h()],Ce.prototype,"isLoadingFeature",null),c([h({type:If})],Ce.prototype,"actions",void 0),c([h({readOnly:!0})],Ce.prototype,"active",null),c([h()],Ce.prototype,"activeFeature",void 0),c([h({readOnly:!0})],Ce.prototype,"allActions",null),c([h({type:Boolean})],Ce.prototype,"defaultPopupTemplateEnabled",void 0),c([h()],Ce.prototype,"autoCloseEnabled",void 0),c([h()],Ce.prototype,"autoOpenEnabled",void 0),c([h()],Ce.prototype,"browseClusterEnabled",void 0),c([h()],Ce.prototype,"content",void 0),c([h({type:If,readOnly:!0})],Ce.prototype,"defaultActions",null),c([h({readOnly:!0})],Ce.prototype,"featureCount",null),c([h()],Ce.prototype,"features",null),c([h()],Ce.prototype,"featuresPerPage",void 0),c([h()],Ce.prototype,"featureViewModelAbilities",void 0),c([h({readOnly:!0})],Ce.prototype,"featureViewModels",void 0),c([h()],Ce.prototype,"highlightEnabled",void 0),c([h()],Ce.prototype,"includeDefaultActions",void 0),c([h({type:be})],Ce.prototype,"location",null),c([h({readOnly:!0})],Ce.prototype,"pendingPromisesCount",null),c([h({readOnly:!0})],Ce.prototype,"selectedClusterBoundaryFeature",void 0),c([h({readOnly:!0})],Ce.prototype,"waitingForResult",null),c([h({readOnly:!0})],Ce.prototype,"promiseCount",null),c([h()],Ce.prototype,"promises",null),c([h({value:null,readOnly:!0})],Ce.prototype,"selectedFeature",null),c([h({value:-1})],Ce.prototype,"selectedFeatureIndex",null),c([h({readOnly:!0})],Ce.prototype,"selectedFeatureViewModel",null),c([h({readOnly:!0})],Ce.prototype,"state",null),c([h()],Ce.prototype,"title",void 0),c([h()],Ce.prototype,"updateLocationEnabled",void 0),c([h()],Ce.prototype,"view",void 0),c([h()],Ce.prototype,"visible",void 0),c([h()],Ce.prototype,"zoomFactor",void 0),c([h()],Ce.prototype,"zoomToLocation",void 0),c([h()],Ce.prototype,"centerAtLocation",null),Ce=c([S("esri.widgets.Popup.PopupViewModel")],Ce);const oj=Ce,VP="selected-index",Xoe=0,zP="popup-spinner",Y={calciteThemeLight:"calcite-theme-light",calciteThemeDark:"calcite-theme-dark",iconLeftTriangleArrow:"esri-icon-left-triangle-arrow",iconRightTriangleArrow:"esri-icon-right-triangle-arrow",iconDockToTop:"esri-icon-maximize",iconDockToBottom:"esri-icon-dock-bottom",iconDockToLeft:"esri-icon-dock-left",iconDockToRight:"esri-icon-dock-right",iconClose:"esri-icon-close",iconUndock:"esri-icon-minimize",iconCheckMark:"esri-icon-check-mark",iconLoading:"esri-icon-loading-indicator",iconDefaultAction:"esri-icon-default-action",iconActionsMenu:"esri-icon-handle-horizontal",rotating:"esri-rotating",base:"esri-popup",widget:"esri-widget",main:"esri-popup__main-container",loadingContainer:"esri-popup__loading-container",isCollapsible:"esri-popup--is-collapsible",isCollapsed:"esri-popup--is-collapsed",shadow:"esri-popup--shadow",isDocked:"esri-popup--is-docked",isDockedTopLeft:"esri-popup--is-docked-top-left",isDockedTopCenter:"esri-popup--is-docked-top-center",isDockedTopRight:"esri-popup--is-docked-top-right",isDockedBottomLeft:"esri-popup--is-docked-bottom-left",isDockedBottomCenter:"esri-popup--is-docked-bottom-center",isDockedBottomRight:"esri-popup--is-docked-bottom-right",alignTopCenter:"esri-popup--aligned-top-center",alignBottomCenter:"esri-popup--aligned-bottom-center",alignTopLeft:"esri-popup--aligned-top-left",alignBottomLeft:"esri-popup--aligned-bottom-left",alignTopRight:"esri-popup--aligned-top-right",alignBottomRight:"esri-popup--aligned-bottom-right",isFeatureMenuOpen:"esri-popup--feature-menu-open",isActionsMenuOpen:"esri-popup--actions-menu-open",hasFeatureUpdated:"esri-popup--feature-updated",header:"esri-popup__header",headerButtons:"esri-popup__header-buttons",headerContainer:"esri-popup__header-container",headerContainerButton:"esri-popup__header-container--button",headerTitle:"esri-popup__header-title",content:"esri-popup__content",contentHasFlows:"esri-content--has-flows",contentFlowItem:"esri-content__flow-item",footer:"esri-popup__footer",footerHasPagination:"esri-popup__footer--has-pagination",footerHasActions:"esri-popup__footer--has-actions",footerHasActionsMenu:"esri-popup__footer--has-actions-menu",button:"esri-popup__button",buttonDisabled:"esri-popup__button--disabled",buttonDock:"esri-popup__button--dock",icon:"esri-popup__icon",iconDock:"esri-popup__icon--dock-icon",inlineActionsContainer:"esri-popup__inline-actions-container",actionsMenuButton:"esri-popup__actions-menu-button",actions:"esri-popup__actions",action:"esri-popup__action",actionImage:"esri-popup__action-image",actionText:"esri-popup__action-text",actionToggle:"esri-popup__action-toggle",actionToggleOn:"esri-popup__action-toggle--on",actionExit:"esri-popup__action--exit",pointer:"esri-popup__pointer",pointerDirection:"esri-popup__pointer-direction",navigation:"esri-popup__navigation",paginationPrevious:"esri-popup__pagination-previous",paginationNext:"esri-popup__pagination-next",paginationPreviousIconLTR:"esri-popup__pagination-previous-icon",paginationPreviousIconRTL:"esri-popup__pagination-previous-icon--rtl",paginationNextIconLTR:"esri-popup__pagination-next-icon",paginationNextIconRTL:"esri-popup__pagination-next-icon--rtl",featureMenu:"esri-popup__feature-menu",featureMenuList:"esri-popup__feature-menu-list",featureMenuItem:"esri-popup__feature-menu-item",featureMenuViewport:"esri-popup__feature-menu-viewport",featureMenuHeader:"esri-popup__feature-menu-header",featureMenuNote:"esri-popup__feature-menu-note",featureMenuSelected:"esri-popup__feature-menu-item--selected",featureMenuButton:"esri-popup__feature-menu-button",featureMenuTitle:"esri-popup__feature-menu-title",featureMenuObserver:"esri-popup__feature-menu-observer",featureMenuLoader:"esri-popup__feature-menu-loader",collapseButton:"esri-popup__collapse-button",collapseIcon:"esri-popup__collapse-icon"},BP={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},UP="esri-popup";function Un(e,t){return t===void 0?`${UP}__${e}`:`${UP}__${e}-${t}`}const qP={closeButton:!0,featureNavigation:!0};let ce=class extends H4(yi){constructor(e,t){super(e,t),this._blurClose=!1,this._blurContainer=!1,this._containerNode=null,this._mainContainerNode=null,this._featureMenuNode=null,this._actionsMenuNode=null,this._focusClose=!1,this._focusContainer=!1,this._focusDockButton=!1,this._focusFeatureMenuButton=!1,this._focusActionsMenuButton=!1,this._focusFirstFeature=!1,this._focusFirstAction=!1,this._handles=new qi,this._pointerOffsetInPx=16,this._spinner=null,this._feature=null,this._featureMenuIntersectionObserverCallback=([i])=>{i!=null&&i.isIntersecting&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._displaySpinnerThrottled=Ch(()=>this._displaySpinner(),Xoe),this._exitRelatedRecordsActions=new WeakMap,this._flowItems=new he,this.alignment="auto",this.collapsed=!1,this.collapseEnabled=!0,this.dockEnabled=!1,this.featureMenuOpen=!1,this.headingLevel=2,this.maxInlineActions=3,this.messages=null,this.messagesCommon=null,this.spinnerEnabled=!0,this.viewModel=new oj,this.visibleElements={...qP},this._addSelectedFeatureIndexHandle(),this.addHandles([Z(()=>{var i;return(i=this.viewModel)==null?void 0:i.screenLocation},()=>this._positionContainer()),Z(()=>{var i;return[(i=this.viewModel)==null?void 0:i.active,this.dockEnabled]},()=>this._toggleScreenLocationEnabled()),Z(()=>{var i;return(i=this.viewModel)==null?void 0:i.screenLocation},(i,s)=>{!!i!=!!s&&this.reposition()}),Z(()=>{var i,s,r,n,o,a;return[(s=(i=this.viewModel)==null?void 0:i.view)==null?void 0:s.padding,(n=(r=this.viewModel)==null?void 0:r.view)==null?void 0:n.size,(o=this.viewModel)==null?void 0:o.active,(a=this.viewModel)==null?void 0:a.location,this.alignment]},()=>this.reposition()),Z(()=>this.spinnerEnabled,i=>this._spinnerEnabledChange(i)),Z(()=>{var i,s;return(s=(i=this.viewModel)==null?void 0:i.view)==null?void 0:s.size},(i,s)=>this._updateDockEnabledForViewSize(i,s)),Z(()=>{var i;return(i=this.viewModel)==null?void 0:i.view},(i,s)=>this._viewChange(i,s)),Z(()=>{var i,s;return(s=(i=this.viewModel)==null?void 0:i.view)==null?void 0:s.ready},(i,s)=>this._viewReadyChange(i,s)),Z(()=>{var i,s;return[(i=this.viewModel)==null?void 0:i.waitingForResult,(s=this.viewModel)==null?void 0:s.location]},()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),Z(()=>this.selectedFeatureWidget,()=>this._destroyFlowItemWidgets()),Z(()=>{var i,s,r,n;return[(s=(i=this.selectedFeatureWidget)==null?void 0:i.viewModel)==null?void 0:s.title,(n=(r=this.selectedFeatureWidget)==null?void 0:r.viewModel)==null?void 0:n.state]},()=>this._setTitleFromFeatureWidget()),Z(()=>{var i,s,r,n;return[(s=(i=this.selectedFeatureWidget)==null?void 0:i.viewModel)==null?void 0:s.content,(n=(r=this.selectedFeatureWidget)==null?void 0:r.viewModel)==null?void 0:n.state]},()=>this._setContentFromFeatureWidget()),Qs(()=>!this.collapsed,()=>{var i,s;((s=(i=this.viewModel)==null?void 0:i.view)==null?void 0:s.widthBreakpoint)==="xsmall"&&this.viewModel.active&&this.collapseEnabled&&this.viewModel.centerAtLocation()}),Is(()=>{var i;return(i=this.viewModel)==null?void 0:i.allActions},"change",()=>this._watchActions()),Z(()=>{var i;return(i=this.viewModel)==null?void 0:i.allActions},()=>this._watchActions(),Le),Z(()=>{var i;return(i=this.viewModel)==null?void 0:i.featureViewModels},()=>this._featureMenuViewportScrollTop()),Is(()=>this._flowItems,"change",()=>{this.notifyChange("_activeFlowItemWidget"),this.scheduleRender()}),Z(()=>{var i,s,r,n;return[(s=(i=this._activeFlowItemWidget)==null?void 0:i.viewModel)==null?void 0:s.state,(n=(r=this._activeFlowItemWidget)==null?void 0:r.viewModel)==null?void 0:n.title]},()=>this.scheduleRender())])}loadDependencies(){return Promise.all([z(()=>import("./calcite-flow.ddd9f745.js"),["assets/calcite-flow.ddd9f745.js","assets/observers.11f150c2.js"]),z(()=>import("./calcite-flow-item.4a278560.js"),["assets/calcite-flow-item.4a278560.js","assets/guid.ae96513b.js","assets/action.a0f1f825.js","assets/observers.11f150c2.js","assets/interactive.d71a7a54.js","assets/icon.8e346cc3.js","assets/loader.3df23557.js","assets/tooltip.e0637362.js","assets/scrim.5d8801d4.js"]),z(()=>import("./calcite-action.6526d132.js"),["assets/calcite-action.6526d132.js","assets/action.a0f1f825.js","assets/observers.11f150c2.js","assets/interactive.d71a7a54.js","assets/icon.8e346cc3.js","assets/loader.3df23557.js","assets/guid.ae96513b.js"]),z(()=>import("./calcite-tooltip.583e6f48.js"),["assets/calcite-tooltip.583e6f48.js","assets/tooltip.e0637362.js","assets/guid.ae96513b.js"]),z(()=>import("./calcite-icon.8f7a3cfc.js"),["assets/calcite-icon.8f7a3cfc.js","assets/icon.8e346cc3.js","assets/observers.11f150c2.js"])])}destroy(){var e,t;this._destroyFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),(e=this._handles)==null||e.destroy(),this._unobserveFeatureMenuObserver(),(t=this._featureMenuIntersectionObserver)==null||t.disconnect(),this._handles=null}get actionsMenuId(){return`${this.id}-actions-menu`}get actionsMenuButtonId(){return`${this.id}-actions-menu-button`}get featureMenuId(){return`${this.id}-feature-menu`}get titleId(){return`${this.id}-popup-title`}get contentId(){return`${this.id}-popup-content`}get hasContent(){const{selectedFeatureWidget:e,viewModel:t}=this;if(!e)return!!(t!=null&&t.content);const i=e.viewModel;if((i==null?void 0:i.waitingForContent)||(i==null?void 0:i.state)==="error")return!0;const s=i==null?void 0:i.content;return Array.isArray(s)?!!s.length:!!s}get featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get collapsible(){return!!(this.collapseEnabled&&this.viewModel.title&&this.hasContent)}get featureMenuVisible(){return this.featureNavigationVisible&&this.featureMenuOpen}get contentCollapsed(){return this.collapsible&&!this.featureMenuVisible&&this.collapsed}get dividedActions(){return this._divideActions()}get _activeFlowItemWidget(){const{_flowItems:e}=this;return e.getItemAt(e.length-1)||null}get actions(){return this.viewModel.actions}set actions(e){this.viewModel.actions=e}set actionsMenuOpen(e){this._set("actionsMenuOpen",!!e)}get actionsMenuOpen(){return!!this.viewModel.active&&this._get("actionsMenuOpen")}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(e){this.viewModel.autoCloseEnabled=e}get autoOpenEnabled(){return this.viewModel.autoOpenEnabled}set autoOpenEnabled(e){this.viewModel.autoOpenEnabled=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||BP}set dockOptions(e){const t={...BP},i=this.get("viewModel.view.breakpoints"),s={};i&&(s.width=i.xsmall,s.height=i.xsmall);const r={...t,...e},n={...t.breakpoint,...s},{breakpoint:o}=r;o===!0?r.breakpoint=n:typeof o=="object"&&(r.breakpoint={...n,...o}),this._set("dockOptions",r),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){var e,t;return(t=(e=this.messages)==null?void 0:e.widgetLabel)!=null?t:""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,visibleElements:t,headingLevel:i,_flowItems:s}=this,{selectedFeatureViewModel:r}=this.viewModel,n={...t,title:!1};return r?(e?(e.viewModel=r,e.visibleElements=n):this._feature=new aoe({flowItems:s,headingLevel:i+1,viewModel:r,visibleElements:n}),this._feature):null}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}castVisibleElements(e){return{...qP,...e}}blur(){const{active:e}=this.viewModel;e||q.getLogger(this.declaredClass).warn("Popup can only be blurred when currently active."),this.visibleElements.closeButton?this._blurClose=!0:this._blurContainer=!0,this.scheduleRender()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e||q.getLogger(this.declaredClass).warn("Popup can only be focused when currently active."),this.visibleElements.closeButton?this._focusClose=!0:this._focusContainer=!0,this.scheduleRender()}next(){return this.viewModel.next()}open(e){var r,n;this._handles.remove(VP);const t=!!e&&!!e.featureMenuOpen,i=!!e&&!!e.actionsMenuOpen,s={collapsed:!!e&&!!e.collapsed,actionsMenuOpen:i,featureMenuOpen:t};((n=(r=this.viewModel)==null?void 0:r.view)==null?void 0:n.widthBreakpoint)==="xsmall"&&(s.collapsed=!0),this.set(s),this.viewModel.open(e),this._shouldFocus(e),this._addSelectedFeatureIndexHandle()}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){var g,v,b,_;const{actionsMenuOpen:e,dockEnabled:t,featureMenuVisible:i,dividedActions:s,currentAlignment:r,currentDockPosition:n}=this,{active:o}=this.viewModel,{menuActions:a}=s,l=o&&a.length>1&&e,u=o&&t,d=o&&!t,f=(v=(g=this.selectedFeature)==null?void 0:g.layer)==null?void 0:v.title,m=(_=(b=this.selectedFeature)==null?void 0:b.layer)==null?void 0:_.id,y={[Y.alignTopCenter]:r==="top-center",[Y.alignBottomCenter]:r==="bottom-center",[Y.alignTopLeft]:r==="top-left",[Y.alignBottomLeft]:r==="bottom-left",[Y.alignTopRight]:r==="top-right",[Y.alignBottomRight]:r==="bottom-right",[Y.isDocked]:u,[Y.shadow]:d,[Y.isDockedTopLeft]:n==="top-left",[Y.isDockedTopCenter]:n==="top-center",[Y.isDockedTopRight]:n==="top-right",[Y.isDockedBottomLeft]:n==="bottom-left",[Y.isDockedBottomCenter]:n==="bottom-center",[Y.isDockedBottomRight]:n==="bottom-right",[Y.isFeatureMenuOpen]:i,[Y.isActionsMenuOpen]:l};return P("div",{class:this.classes(Y.base,y),role:"presentation","data-layer-title":f,"data-layer-id":m,bind:this,afterCreate:this._positionContainer,afterUpdate:this._positionContainer},o?[this.renderMainContainer(),this.renderPointer()]:null)}renderLoadingIcon(){return P("span",{"aria-hidden":"true",class:this.classes(Y.icon,Y.iconLoading,Y.rotating)})}renderNavigationLoading(){const{messagesCommon:e}=this;return this.viewModel.pendingPromisesCount?P("div",{key:Un("loading-container"),role:"presentation",class:Y.loadingContainer,"aria-label":e.loading,title:e.loading},this.renderLoadingIcon()):null}renderPreviousIcon(){const e=xn(this.container),t={[Y.iconRightTriangleArrow]:e,[Y.paginationPreviousIconRTL]:e,[Y.iconLeftTriangleArrow]:!e,[Y.paginationPreviousIconLTR]:!e};return P("span",{"aria-hidden":"true",class:this.classes(Y.icon,t)})}renderPreviousButton(){const{messages:e}=this;return P("div",{role:"button",tabIndex:0,bind:this,onclick:this._previous,onkeydown:this._previous,class:this.classes(Y.button,Y.paginationPrevious),"aria-label":e.previous,title:e.previous},this.renderPreviousIcon())}renderNextIcon(){const e=xn(this.container),t={[Y.iconLeftTriangleArrow]:e,[Y.paginationNextIconRTL]:e,[Y.iconRightTriangleArrow]:!e,[Y.paginationNextIconLTR]:!e};return P("span",{"aria-hidden":"true",class:this.classes(Y.icon,t)})}renderNextButton(){const{messages:e}=this;return P("div",{role:"button",tabIndex:0,bind:this,onclick:this._next,onkeydown:this._next,class:this.classes(Y.button,Y.paginationNext),"aria-label":e.next,title:e.next},this.renderNextIcon())}renderFeatureMenuButton(){const{featureMenuOpen:e,featureMenuId:t,messagesCommon:i}=this,{featureCount:s,selectedFeatureIndex:r}=this.viewModel;return P("div",{role:"button",tabIndex:0,bind:this,onclick:this._toggleFeatureMenu,onkeydown:this._toggleFeatureMenu,afterCreate:this._focusFeatureMenuButtonNode,afterUpdate:this._focusFeatureMenuButtonNode,class:this.classes(Y.button,Y.featureMenuButton),"aria-haspopup":"true","aria-controls":t,"aria-expanded":e.toString(),"aria-label":i.menu,title:i.menu},this._getPageText(s,r))}renderNavigationButtons(){return this.featureNavigationVisible?[this.renderPreviousButton(),this.renderNavigationLoading()||this.renderFeatureMenuButton(),this.renderNextButton()]:null}renderDockIcon(){const{dockEnabled:e}=this,t=this._wouldDockTo(),i={[Y.iconUndock]:e,[Y.iconDock]:!e,[Y.iconDockToRight]:!e&&(t==="top-right"||t==="bottom-right"),[Y.iconDockToLeft]:!e&&(t==="top-left"||t==="bottom-left"),[Y.iconDockToTop]:!e&&t==="top-center",[Y.iconDockToBottom]:!e&&t==="bottom-center"};return P("span",{"aria-hidden":"true",class:this.classes(i,Y.icon)})}renderDockButton(){var r,n,o;const{dockEnabled:e,messages:t}=this,i=(n=(r=this.viewModel)==null?void 0:r.view)==null?void 0:n.widthBreakpoint,s=e?t.undock:t.dock;return i!=="xsmall"&&((o=this.dockOptions)==null?void 0:o.buttonEnabled)?P("div",{role:"button","aria-label":s,title:s,tabIndex:0,bind:this,onclick:this._toggleDockEnabled,onkeydown:this._toggleDockEnabled,afterCreate:this._focusDockButtonNode,afterUpdate:this._focusDockButtonNode,class:this.classes(Y.button,Y.buttonDock)},this.renderDockIcon()):null}renderTitle(){const{title:e}=this.viewModel,{titleId:t,collapsible:i,contentCollapsed:s,messagesCommon:r}=this,n={[Y.headerContainerButton]:i},o=P(vT,{level:this.headingLevel,class:Y.headerTitle,innerHTML:e}),a=i?P("button",{key:`${e}--collapsible`,id:t,title:s?r.expand:r.collapse,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(Y.headerContainer,n),"aria-expanded":s?"false":"true",onclick:this._toggleCollapsed,type:"button"},o,P("calcite-icon",{class:Y.collapseIcon,key:"collapse-icon",icon:s?"chevron-down":"chevron-up",scale:"m"})):P("div",{key:e,id:t,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(Y.headerContainer,n)},o);return e?a:null}renderCloseIcon(){return P("span",{"aria-hidden":"true",class:this.classes(Y.icon,Y.iconClose)})}renderCloseButton(){const{visibleElements:e,messagesCommon:t}=this;return e.closeButton?P("div",{role:"button",tabIndex:0,bind:this,onclick:this._close,onkeydown:this._close,class:Y.button,"aria-label":t.close,title:t.close,afterCreate:this._closeButtonNodeUpdated,afterUpdate:this._closeButtonNodeUpdated},this.renderCloseIcon()):null}renderHeader(){return P("header",{class:Y.header},this.renderTitle(),P("div",{class:Y.headerButtons},this.renderDockButton(),this.renderCloseButton()))}renderContentContainer(){const{contentId:e,hasContent:t,contentCollapsed:i,_flowItems:s,messagesCommon:r}=this,{content:n}=this.viewModel,o=s.toArray(),a={[Y.contentHasFlows]:!!o.length};return t&&!i?P("div",{key:n,enterAnimation:this._createFeatureUpdatedAnimation(),id:e,class:this.classes(Y.content,a)},P("calcite-flow",{bind:this,onCalciteFlowItemBack:this._handleBackClick},P("calcite-flow-item",{bind:this,"data-node-ref":"_rootFlowItemNode","intl-back":r.back,afterCreate:Z0,key:"root-flow-item"},this.renderContent()),o.map(l=>this.renderFlowItem(l))),o.map(l=>this.renderFlowItemTooltip(l))):null}renderFlowItem(e){const{messages:t,messagesCommon:i}=this,s=Tv();return P("calcite-flow-item",{class:this.classes({[Y.calciteThemeDark]:!s,[Y.calciteThemeLight]:s}),heading:e.title,"intl-back":i.back,description:this._getFlowItemDescription(e),key:`flow-item-${e.viewModel.uid}`},P("calcite-action",{class:Y.actionExit,icon:"move-up",label:t==null?void 0:t.exitRelatedRecords,text:t==null?void 0:t.exitRelatedRecords,slot:"header-actions-start",bind:this,afterCreate:r=>this._storeExitRelatedRecordsAction(e,r),onclick:this._destroyFlowItemWidgets}),P("div",{class:this.classes(Y.contentFlowItem,{[Y.calciteThemeDark]:s,[Y.calciteThemeLight]:!s})},e.render()))}renderFlowItemTooltip(e){const{messages:t,_exitRelatedRecordsActions:i}=this,s=Tv();return P("calcite-tooltip",{class:this.classes({[Y.calciteThemeDark]:!s,[Y.calciteThemeLight]:s}),key:`exit-related-records-tooltip-${e.viewModel.uid}`,label:t==null?void 0:t.exitRelatedRecords,overlayPositioning:"fixed",referenceElement:i.get(e),placement:"top"},t==null?void 0:t.exitRelatedRecords)}renderActionsMenuButton(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:s,messagesCommon:r}=this,n=i?r.close:r.open,{menuActions:o}=s;return o.length?P("div",{key:Un("actions-menu-button"),class:this.classes(Y.button,Y.actionsMenuButton),role:"button",id:t,"aria-haspopup":"true","aria-controls":i?e:null,tabIndex:0,bind:this,onclick:this._toggleActionsMenu,onkeydown:this._toggleActionsMenu,afterCreate:this._focusActionsMenuButtonNode,afterUpdate:this._focusActionsMenuButtonNode,"aria-label":n,title:n},P("span",{"aria-hidden":"true",class:Y.iconActionsMenu})):null}renderMenuActions(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:s}=this,{menuActions:r}=s;return r.length&&i?P("ul",{id:e,role:"menu","aria-labelledby":t,key:Un("actions"),class:Y.actions,bind:this,onkeyup:this._handleActionMenuKeyup,afterCreate:this._actionsMenuNodeUpdated,afterUpdate:this._actionsMenuNodeUpdated},r.toArray().map(n=>this.renderAction({action:n,type:"menu-item"}))):null}renderInlineActions(){const{inlineActions:e}=this.dividedActions;return!!e.length&&e.toArray().map(t=>this.renderAction({action:t,type:"inline"}))}renderInlineActionsContainer(){const{inlineActions:e,menuActions:t}=this.dividedActions,i=!!e.length,s=!!t.length;return i||s?P("div",{key:"inline-actions-container","data-inline-actions":i.toString(),"data-menu-actions":s.toString(),class:Y.inlineActionsContainer},this.renderInlineActions(),this.renderActionsMenuButton(),this.renderMenuActions()):null}renderNavigation(){return this.featureNavigationVisible?P("section",{key:Un("navigation"),class:this.classes(Y.navigation)},this.renderNavigationButtons()):null}renderFooter(){const{featureNavigationVisible:e,dividedActions:t}=this,{inlineActions:i,menuActions:s}=t,r=!!i.length,n=!!s.length,o={[Y.footerHasPagination]:e,[Y.footerHasActions]:r,[Y.footerHasActionsMenu]:n};return e||r?P("div",{key:Un("feature-buttons"),class:this.classes(Y.footer,o)},this.renderInlineActionsContainer(),this.renderNavigation()):null}renderFeatureMenuContainer(){const{messages:e}=this,{featureViewModels:t,isLoadingFeature:i}=this.viewModel,s=fn(e.selectedFeatures,{total:t.length});return P("section",{key:Un("menu"),class:Y.featureMenu},P("strong",{class:Y.featureMenuHeader},s),P("nav",{bind:this,class:Y.featureMenuViewport,"data-node-ref":"_featureMenuViewportNode",afterCreate:Z0},this.renderFeatureMenu(),P("div",{class:Y.featureMenuObserver,bind:this,afterCreate:this._featureMenuIntersectionObserverCreated}),i?P("div",{class:Y.featureMenuLoader},this.renderLoadingIcon()):null))}renderPointer(){return this.dockEnabled?null:P("div",{key:Un("pointer"),class:Y.pointer,role:"presentation"},P("div",{class:this.classes(Y.pointerDirection,Y.shadow)}))}renderMainContainer(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:i,titleId:s,contentId:r,collapsible:n,hasContent:o,contentCollapsed:a,visibleElements:l}=this,{title:u}=this.viewModel,d=t==="bottom-left"||t==="bottom-center"||t==="bottom-right"||i==="top-left"||i==="top-center"||i==="top-right",f=t==="top-left"||t==="top-center"||t==="top-right"||i==="bottom-left"||i==="bottom-center"||i==="bottom-right",m={[Y.shadow]:e,[Y.isCollapsible]:n,[Y.isCollapsed]:a};return P("div",{class:this.classes(Y.main,Y.widget,m),tabIndex:l.closeButton?null:-1,role:"dialog","aria-labelledby":u?s:"","aria-describedby":o&&!a?r:"",bind:this,onkeyup:this._handleMainKeyup,afterCreate:this._mainContainerNodeUpdated,afterUpdate:this._mainContainerNodeUpdated},d?this.renderFooter():null,d?this.renderFeatureMenuContainer():null,this.renderHeader(),this.renderContentContainer(),f?this.renderFooter():null,f?this.renderFeatureMenuContainer():null)}renderContent(){var t;const e=(t=this.viewModel)==null?void 0:t.content;return e?typeof e=="string"?P("div",{class:ft.contentNode,key:e,innerHTML:e}):this.renderNodeContent(e):null}renderActionText(e){return P("span",{key:"text",class:Y.actionText},e)}renderActionIcon(e){const t=this._getActionClass(e),i=this._getActionImage(e),s={[Y.iconLoading]:e.active,[Y.rotating]:e.active,[Y.icon]:!!t,[Y.actionImage]:!e.active&&!!i};return t&&(s[t]=!e.active),P("span",{key:"icon","aria-hidden":"true",class:this.classes(Y.icon,s),styles:this._getIconStyles(i)})}renderAction(e){const{action:t,type:i}=e,s=this._getActionTitle(t),r={[Y.action]:t.type!=="toggle",[Y.actionToggle]:t.type==="toggle",[Y.actionToggleOn]:t.type==="toggle"&&t.value,[Y.buttonDisabled]:t.disabled},n=[this.renderActionIcon(t),this.renderActionText(s)],o=i==="menu-item"?P("li",{key:t.uid,role:"menuitem",tabIndex:0,title:s,"aria-label":s,class:this.classes(Y.button,r),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},n):P("div",{key:t.uid,role:"button",tabIndex:0,title:s,"aria-label":s,class:this.classes(Y.button,r),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},n);return t.visible?o:null}renderFeatureMenuItem(e,t){const{messages:i,messagesCommon:s}=this,{selectedFeatureIndex:r,selectedFeatureViewModel:n}=this.viewModel,o=e===n,a={[Y.featureMenuSelected]:o},l=o?P("span",{key:Un(`feature-menu-selected-feature-${r}`),title:i.selectedFeature,"aria-label":i.selectedFeature,class:Y.iconCheckMark}):null,u=P("span",{innerHTML:e.title||s.untitled});return P("li",{role:"menuitem",tabIndex:-1,key:Un(`feature-menu-feature-${r}`),class:this.classes(a,Y.featureMenuItem),bind:this,"data-feature-index":t,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onkeyup:this._handleFeatureMenuItemKeyup,onclick:this._selectFeature,onkeydown:this._selectFeature,onmouseover:this._setActiveFeature,onmouseleave:this._removeActiveFeature},P("span",{class:Y.featureMenuTitle},u,l))}renderFeatureMenu(){const{featureMenuId:e}=this,{featureViewModels:t}=this.viewModel;return t.length>1?P("ol",{class:Y.featureMenuList,id:e,bind:this,afterCreate:this._featureMenuNodeUpdated,afterUpdate:this._featureMenuNodeUpdated,onkeyup:this._handleFeatureMenuKeyup,role:"menu"},t.filter(i=>!!i.graphic).map((i,s)=>this.renderFeatureMenuItem(i,s))):null}_storeExitRelatedRecordsAction(e,t){this._exitRelatedRecordsActions.set(e,t),this.scheduleRender()}_getFlowItemDescription(e){return"featureCountDescription"in e?e.featureCountDescription:e.viewModel.description}_destroyFlowItemWidgets(){this._flowItems.removeAll().forEach(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()})}_handleBackClick(){const e=this._flowItems.pop();this._exitRelatedRecordsActions.delete(e),"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy())}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:s}=this,{id:r}=e,n=i==null?void 0:i.attributes,o=r==="zoom-to-feature"?fn(e.title,{messages:t}):r==="remove-selected-feature"?fn(e.title,{messages:s}):r==="zoom-to-clustered-features"||r==="browse-clustered-features"?fn(e.title,{messages:t}):e.title;return o&&n?fn(o,n):o}_getActionClass(e){const{selectedFeature:t}=this,i=t==null?void 0:t.attributes,{className:s,image:r}=e,n=r||s?s:Y.iconDefaultAction;return n&&i?fn(n,i):n}_getActionImage(e){const{selectedFeature:t}=this,i=t==null?void 0:t.attributes,{image:s}=e;return s&&i?fn(s,i):s}_createFeatureUpdatedAnimation(){return KB("enter",Y.hasFeatureUpdated)}_getInlineActionCount(){const{maxInlineActions:e,featureNavigationVisible:t}=this;if(typeof e!="number")return null;const i=Math.round(e);return Math.max(t?i-1:i,0)}_watchActions(){const{allActions:e}=this.viewModel;this.notifyChange("dividedActions");const t="actions";this._handles.remove(t),e&&e.forEach(i=>{this._handles.add(Z(()=>[i.uid,i.active,i.className,i.disabled,i.id,i.title,i.image,i.visible],()=>this.scheduleRender()),t)})}_divideActions(){const{allActions:e}=this.viewModel,t=e.filter(n=>n.visible),i=this._getInlineActionCount(),s=i===null,r=i===0;return{inlineActions:s?t.slice(0):r?new he:t.slice(0,i),menuActions:s?new he:r?t.slice(0):t.slice(i)}}_featureMenuOpenChanged(e){e?this._focusFirstFeature=!0:this._focusFeatureMenuButton=!0}_actionsMenuOpenChanged(e){e?this._focusFirstAction=!0:this._focusActionsMenuButton=!0}_setTitleFromFeatureWidget(){var i,s;const{selectedFeatureWidget:e,messagesCommon:t}=this;e&&(this.viewModel.title=((i=e.viewModel)==null?void 0:i.state)==="error"?t.errorMessage:((s=e.viewModel)==null?void 0:s.title)||"")}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_handleFeatureMenuKeyup(e){yc(e)==="Escape"&&(e.stopPropagation(),this._focusFeatureMenuButton=!0,this.featureMenuOpen=!1,this.scheduleRender())}_handleActionMenuKeyup(e){yc(e)==="Escape"&&(e.stopPropagation(),this._focusActionsMenuButton=!0,this.actionsMenuOpen=!1,this.scheduleRender())}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_handleFeatureMenuItemKeyup(e){const t=yc(e),{_featureMenuNode:i}=this,s=e.currentTarget["data-feature-index"];if(!i)return;const r=i.querySelectorAll("li"),n=r.length;t!=="ArrowUp"?t!=="ArrowDown"?t!=="Home"?t!=="End"||(e.stopPropagation(),r[r.length-1].focus()):(e.stopPropagation(),r[0].focus()):(e.stopPropagation(),r[(s+1+n)%n].focus()):(e.stopPropagation(),r[(s-1+n)%n].focus())}_handleActionMenuItemKeyup(e){const t=yc(e),{_actionsMenuNode:i}=this,s=e.currentTarget.dataset.actionUid,{menuActions:r}=this.dividedActions,n=r.findIndex(l=>l.uid===s);if(!i)return;const o=i.querySelectorAll("li"),a=o.length;t!=="ArrowUp"?t!=="ArrowDown"?t!=="Home"?t!=="End"||(e.stopPropagation(),o[o.length-1].focus()):(e.stopPropagation(),o[0].focus()):(e.stopPropagation(),o[(n+1+a)%a].focus()):(e.stopPropagation(),o[(n-1+a)%a].focus())}_handleMainKeyup(e){const t=yc(e);t==="ArrowLeft"&&(e.stopPropagation(),this.previous()),t==="ArrowRight"&&(e.stopPropagation(),this.next())}_spinnerEnabledChange(e){if(this._destroySpinner(),!e)return;const t=this.get("viewModel.view");this._createSpinner(t)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i?e.show({location:t}):e.hide()}_getIconStyles(e){return{"background-image":e?`url(${e})`:""}}async _shouldFocus(e){e.shouldFocus&&(await ub(()=>{var t;return((t=this.viewModel)==null?void 0:t.active)===!0}),this.focus())}_addSelectedFeatureIndexHandle(){const e=Z(()=>{var t;return(t=this.viewModel)==null?void 0:t.selectedFeatureIndex},(t,i)=>this._selectedFeatureIndexUpdated(t,i));this._handles.add(e,VP)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this;i&&e!==t&&e!==-1&&(this._destroyFlowItemWidgets(),this.actionsMenuOpen=!1,this.featureMenuOpen=!1,this._mainContainerNode&&(this._mainContainerNode.scrollTop=0),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,e&&!e.destroyed&&e.destroy()),this._feature=null}_isScreenLocationWithinView(e,t){return e.x>-1&&e.y>-1&&e.x<=t.width&&e.y<=t.height}_isOutsideView(e){const{popupHeight:t,popupWidth:i,screenLocation:s,side:r,view:n}=e;if(isNaN(i)||isNaN(t)||!n||!s)return!1;const o=n.padding;return r==="right"&&s.x+i/2>n.width-o.right||r==="left"&&s.x-i/2n.height-o.bottom}_calculateAutoAlignment(e){if(e!=="auto")return e;const{_pointerOffsetInPx:t,_containerNode:i,_mainContainerNode:s,viewModel:r}=this,{screenLocation:n,view:o}=r;if(N(n)||!o||!i)return"top-center";if(!this._isScreenLocationWithinView(n,o))return this._get("currentAlignment")||"top-center";function a($){return parseInt($.replace(/[^-\d\.]/g,""),10)}const l=s?window.getComputedStyle(s,null):null,u=l?a(l.getPropertyValue("max-height")):0,d=l?a(l.getPropertyValue("height")):0,{height:f,width:m}=i.getBoundingClientRect(),y=m+t,g=Math.max(f,u,d)+t,v=this._isOutsideView({popupHeight:g,popupWidth:y,screenLocation:n,side:"right",view:o}),b=this._isOutsideView({popupHeight:g,popupWidth:y,screenLocation:n,side:"left",view:o}),_=this._isOutsideView({popupHeight:g,popupWidth:y,screenLocation:n,side:"top",view:o}),x=this._isOutsideView({popupHeight:g,popupWidth:y,screenLocation:n,side:"bottom",view:o});return b?_?"bottom-right":"top-right":v?_?"bottom-left":"top-left":_?x?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(e){return typeof e=="function"?e.call(this):e}_getCurrentAlignment(){const{alignment:e,dockEnabled:t}=this;return t||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(e)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(e){const t=["left","right"];return xn(this.container)&&t.reverse(),e.replace(/leading/gi,t[0]).replace(/trailing/gi,t[1])}_callDockPosition(e){return typeof e=="function"?e.call(this):e}_getDockPosition(){var e;return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition((e=this.dockOptions)==null?void 0:e.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_wouldDockTo(){return this.dockEnabled?null:this._getDockPosition()}_calculateAutoDockPosition(e){var o;if(e!=="auto")return e;const t=(o=this.viewModel)==null?void 0:o.view,i=xn(this.container)?"top-left":"top-right";if(!t)return i;const s=t.padding||{left:0,right:0,top:0,bottom:0},r=t.width-s.left-s.right,{breakpoints:n}=t;return n&&r<=n.xsmall?"bottom-center":i}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!e)return;const{screenLocation:t}=this.viewModel,{width:i}=e.getBoundingClientRect(),s=this._calculatePositionStyle(t,i);s&&(e.style.top=s.top,e.style.left=s.left,e.style.bottom=s.bottom,e.style.right=s.right)}_calculateFullWidth(e){const{currentAlignment:t,_pointerOffsetInPx:i}=this;return t==="top-left"||t==="bottom-left"||t==="top-right"||t==="bottom-right"?e+i:e}_calculateAlignmentPosition(e,t,i,s){const{currentAlignment:r,_pointerOffsetInPx:n}=this,o=s/2,a=i.height-t,l=i.width-e,{padding:u}=this.view;return r==="bottom-center"?{top:t+n-u.top,left:e-o-u.left}:r==="top-left"?{bottom:a+n-u.bottom,right:l+n-u.right}:r==="bottom-left"?{top:t+n-u.top,right:l+n-u.right}:r==="top-right"?{bottom:a+n-u.bottom,left:e+n-u.left}:r==="bottom-right"?{top:t+n-u.top,left:e+n-u.left}:r==="top-center"?{bottom:a+n-u.bottom,left:e-o-u.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:i,view:s}=this;if(!s)return;if(i)return{left:"",top:"",right:"",bottom:""};if(N(e)||!t)return;const r=this._calculateFullWidth(t),n=this._calculateAlignmentPosition(e.x,e.y,s,r);return n?{top:n.top!==void 0?`${n.top}px`:"auto",left:n.left!==void 0?`${n.left}px`:"auto",bottom:n.bottom!==void 0?`${n.bottom}px`:"auto",right:n.right!==void 0?`${n.right}px`:"auto"}:void 0}_viewChange(e,t){e&&t&&(this.close(),this.clear())}_viewReadyChange(e,t){if(e){const i=this.get("viewModel.view");this._wireUpView(i)}else t&&(this.close(),this.clear())}_wireUpView(e){if(this._destroySpinner(),!e)return;const{spinnerEnabled:t}=this;t&&this._createSpinner(e),this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,t,i){const[s,r]=e,[n,o]=t,{width:a,height:l}=i;return s<=a&&n>a||s>a&&n<=a||r<=l&&o>l||r>l&&o<=l}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const i=this.get("viewModel.view.padding")||{left:0,right:0,top:0,bottom:0},s=i.left+i.right,r=i.top+i.bottom,n=[],o=[];n[0]=e[0]-s,n[1]=e[1]-r,o[0]=t[0]-s,o[1]=t[1]-r;const{dockOptions:a}=this,l=a.breakpoint;this._dockingThresholdCrossed(n,o,l)&&this._setDockEnabledForViewSize(a),this._setCurrentDockPosition()}_focusDockButtonNode(e){this._focusDockButton&&(this._focusDockButton=!1,e.focus())}_closeButtonNodeUpdated(e){return this._focusClose?(this._focusClose=!1,void e.focus()):this._blurClose?(this._blurClose=!1,void e.blur()):void 0}_mainContainerNodeUpdated(e){return this._mainContainerNode=e,this._focusContainer?(this._focusContainer=!1,void e.focus()):this._blurContainer?(this._blurContainer=!1,void e.blur()):void 0}_featureMenuNodeUpdated(e){if(this._featureMenuNode=e,!e||!this._focusFirstFeature)return;this._focusFirstFeature=!1;const t=e.querySelectorAll("li");t.length&&t[0].focus()}_actionsMenuNodeUpdated(e){if(this._actionsMenuNode=e,!e||!this._focusFirstAction)return;this._focusFirstAction=!1;const t=e.querySelectorAll("li");t.length&&t[0].focus()}_focusFeatureMenuButtonNode(e){this._focusFeatureMenuButton&&(this._focusFeatureMenuButton=!1,e.focus())}_focusActionsMenuButtonNode(e){this._focusActionsMenuButton&&(this._focusActionsMenuButton=!1,e.focus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&(this._featureMenuViewportNode.scrollTop=0)}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:t}=this;if(!t)return;const i=t.active&&!e;t.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(e){var a,l;const t=e.breakpoint,i=(l=(a=this.viewModel)==null?void 0:a.view)==null?void 0:l.ui;if(!i)return!1;const{width:s,height:r}=i;if(isNaN(s)||isNaN(r))return!1;const n=t.hasOwnProperty("width")&&s<=t.width,o=t.hasOwnProperty("height")&&r<=t.height;return n||o}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}_getPageText(e,t){return this.featureNavigationVisible?fn(this.messages.pageText,{index:t+1,total:e}):null}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t&&t.ui&&t.ui.remove(this._spinner,zP),e.destroy(),this._spinner=null)}_createSpinner(e){e&&(this._spinner=new coe({view:e}),e.ui.add(this._spinner,{key:zP,position:"manual"}))}_toggleCollapsed(){this.collapsed=!this.collapsed}_close(){this.close(),this.view&&this.view.focus()}_toggleDockEnabled(){this.dockEnabled=!this.dockEnabled,this._focusDockButton=!0,this.scheduleRender()}_toggleFeatureMenu(){const e=!this.featureMenuOpen;this._featureMenuOpenChanged(e),this.actionsMenuOpen=!1,this.featureMenuOpen=e}_toggleActionsMenu(){const e=!this.actionsMenuOpen;this._actionsMenuOpenChanged(e),this.featureMenuOpen=!1,this.actionsMenuOpen=e}_triggerAction(e){const t=e.currentTarget.dataset.actionUid,{allActions:i}=this.viewModel,s=i.findIndex(n=>n.uid===t),r=i.getItemAt(s);r&&r.type==="toggle"&&(r.value=!r.value),this.actionsMenuOpen=!1,this.viewModel.triggerAction(s)}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.featureMenuOpen=!1,this._focusFeatureMenuButton=!0,this.scheduleRender()}_next(){this.next()}_previous(){this.previous()}};c([h({readOnly:!0})],ce.prototype,"actionsMenuId",null),c([h({readOnly:!0})],ce.prototype,"actionsMenuButtonId",null),c([h({readOnly:!0})],ce.prototype,"featureMenuId",null),c([h({readOnly:!0})],ce.prototype,"titleId",null),c([h({readOnly:!0})],ce.prototype,"contentId",null),c([h({readOnly:!0})],ce.prototype,"hasContent",null),c([h({readOnly:!0})],ce.prototype,"featureNavigationVisible",null),c([h({readOnly:!0})],ce.prototype,"collapsible",null),c([h({readOnly:!0})],ce.prototype,"featureMenuVisible",null),c([h({readOnly:!0})],ce.prototype,"contentCollapsed",null),c([h({readOnly:!0})],ce.prototype,"dividedActions",null),c([h({readOnly:!0,dependsOn:["_flowItems.length"]})],ce.prototype,"_activeFlowItemWidget",null),c([h()],ce.prototype,"actions",null),c([h()],ce.prototype,"actionsMenuOpen",null),c([h()],ce.prototype,"alignment",void 0),c([h()],ce.prototype,"autoCloseEnabled",null),c([h()],ce.prototype,"autoOpenEnabled",null),c([h()],ce.prototype,"defaultPopupTemplateEnabled",null),c([h()],ce.prototype,"content",null),c([h()],ce.prototype,"collapsed",void 0),c([h()],ce.prototype,"collapseEnabled",void 0),c([h({readOnly:!0})],ce.prototype,"currentAlignment",null),c([h({readOnly:!0})],ce.prototype,"currentDockPosition",null),c([h()],ce.prototype,"dockOptions",null),c([h()],ce.prototype,"dockEnabled",void 0),c([h({readOnly:!0})],ce.prototype,"featureCount",null),c([h()],ce.prototype,"featureMenuOpen",void 0),c([h()],ce.prototype,"features",null),c([h()],ce.prototype,"goToOverride",null),c([h()],ce.prototype,"headingLevel",void 0),c([h()],ce.prototype,"highlightEnabled",null),c([h()],ce.prototype,"location",null),c([h()],ce.prototype,"label",null),c([h()],ce.prototype,"maxInlineActions",void 0),c([h(),di("esri/widgets/Popup/t9n/Popup")],ce.prototype,"messages",void 0),c([h(),di("esri/t9n/common")],ce.prototype,"messagesCommon",void 0),c([h()],ce.prototype,"promises",null),c([h({readOnly:!0})],ce.prototype,"selectedFeature",null),c([h()],ce.prototype,"selectedFeatureIndex",null),c([h({readOnly:!0})],ce.prototype,"selectedFeatureWidget",null),c([h()],ce.prototype,"spinnerEnabled",void 0),c([h()],ce.prototype,"title",null),c([h()],ce.prototype,"updateLocationEnabled",null),c([h()],ce.prototype,"view",null),c([h({type:oj}),CK(["triggerAction","trigger-action"])],ce.prototype,"viewModel",void 0),c([h()],ce.prototype,"visible",null),c([h()],ce.prototype,"visibleElements",void 0),c([Oe("visibleElements")],ce.prototype,"castVisibleElements",null),c([xs()],ce.prototype,"_close",null),c([xs()],ce.prototype,"_toggleDockEnabled",null),c([xs()],ce.prototype,"_toggleFeatureMenu",null),c([xs()],ce.prototype,"_toggleActionsMenu",null),c([xs()],ce.prototype,"_triggerAction",null),c([xs()],ce.prototype,"_selectFeature",null),c([xs()],ce.prototype,"_next",null),c([xs()],ce.prototype,"_previous",null),ce=c([S("esri.widgets.Popup")],ce);const GP=ce,Pw=[0,0];function Zoe(e){var s,r;const t=(e.ownerDocument||window.document).defaultView,i=e.getBoundingClientRect();return Pw[0]=i.left+((s=t==null?void 0:t.pageXOffset)!=null?s:0),Pw[1]=i.top+((r=t==null?void 0:t.pageYOffset)!=null?r:0),Pw}function WP(e){e&&(CR(e),e.parentNode&&e.parentNode.removeChild(e))}function Qoe(e){const t=document.createElement("div");return e.appendChild(t),t}const Ud=16,By=750,Koe=512,eae=2,tae=e=>{let t=class extends e{constructor(...i){var s;super(...i),this._freqInfo={freq:Ud,time:By},this._overlayRenderTaskHandle=null,this.height=0,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.ui=null,this.userContent=null,this.width=0,this.widthBreakpoint=null,i.length!==0&&((s=i[0])==null?void 0:s.popup)!==void 0||(this.popup=new GP({view:this})),this.handles.add([Z(()=>this.cursor,r=>{const{surface:n}=this;n&&n.setAttribute("data-cursor",r)}),Z(()=>this.interacting,r=>{const{surface:n}=this;n&&n.setAttribute("data-interacting",r.toString())})])}initialize(){this.handles.add(Z(()=>this.ui,(i,s)=>this._handleUIChange(i,s))),this._wireUI(this.ui),this.handles.add([this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui=$t(this.ui),this.popup&&!this.popup.destroyed&&this.popup.destroy(),this.container=null)}get container(){var i;return(i=this._get("container"))!=null?i:null}set container(i){const s=this._get("container"),r=r$(i),n=r instanceof HTMLDivElement?r:null;if(n||typeof i!="string"||q.getLogger(this.declaredClass).error("#container",`element with id '${i}' not found`),s===n)return;const o="dom-size";if(this.handles.remove(o),this._stopMeasuring(),s&&(s.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(WP(this.root),this._set("root",null)),this.userContent&&(pE(this.userContent,s),WP(this.userContent),this._set("userContent",null))),!n)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);n.classList.add("esri-view");const a=document.createElement("div");a.className="esri-view-user-storage",pE(n,a),n.appendChild(a),this._set("userContent",a);const l=document.createElement("div");l.className="esri-view-root",n.insertBefore(l,n.firstChild),this._set("root",l);const u=document.createElement("div");u.className="esri-view-surface",u.setAttribute("role","application"),u.tabIndex=0,l.appendChild(u),this._set("surface",u);const d=new Zk;l.appendChild(d.surface),this._set("overlay",d),Z(()=>d.needsRender,f=>{f&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=Dh({render:()=>{var m;return(m=this.overlay)==null?void 0:m.render()}}):this._overlayRenderTaskHandle=Bt(this._overlayRenderTaskHandle)}),this.forceDOMReadyCycle(),this.handles.add(Z(()=>this.size,f=>{const[m,y]=f,g="esri-view-surface--inset-outline";m>=document.body.clientWidth||y>=document.body.clientHeight?u.classList.add(g):u.classList.remove(g)},Le),o),this._set("container",n),this._startMeasuring()}get focused(){const i=document.activeElement===this.surface;return document.hasFocus()&&i}set popup(i){const s=this._get("popup");s&&s!==i&&s.destroy(),this._set("popup",i)}get size(){return[this.width,this.height]}blur(){this.surface&&this.surface.blur()}focus(){this.surface&&this.surface.focus()}pageToContainer(i,s,r){const n=this.position;return i-=n?n[0]:0,s-=n?n[1]:0,r?(r[0]=i,r[1]=s):r=[i,s],r}containerToPage(i,s,r){const n=this.position;return i+=n?n[0]:0,s+=n?n[1]:0,r?(r[0]=i,r[1]=s):r=[i,s],r}_handleUIChange(i,s){s&&(this.handles.remove("ui"),s.destroy()),i&&this._wireUI(i),this._set("ui",i)}_wireUI(i){this.handles.remove("ui"),i&&(i.view=this,this.handles.add([Z(()=>this.root,s=>{i.container=s?Qoe(s):null},Le),Z(()=>this.popup,(s,r)=>{const n="popup",o="manual";r&&i.remove(r,n),s&&(s.view=i.view,i.add(s,{key:n,position:o}))},Le)],"ui"))}_stopMeasuring(){this.handles.remove("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const i=this._freqInfo;i.freq=Ud,i.time=By,this.handles.add([(()=>{const s=()=>{i.freq=Ud,i.time=By};return window.addEventListener("resize",s),{remove(){window.removeEventListener("resize",s)}}})(),Dh({prepare:s=>{const r=this._measure(),n=this._freqInfo;if(n.time+=s.deltaTime,r&&(n.freq=Ud,this._get("resizing")||this._set("resizing",!0)),n.time=Koe&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const i=this.container,s=i?i.clientWidth:0,r=i?i.clientHeight:0;if(s===0||r===0)return this.suspended||this._set("suspended",!0),!1;const n=this.width,o=this.height;return s===n&&r===o?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",s),this._set("height",r),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:n,oldHeight:o,width:s,height:r}),!0)}_position(){const i=this.container,s=this.position,r=i&&Zoe(i);return!!r&&(!s||r[0]!==s[0]||r[1]!==s[1])&&(this._set("position",[r[0],r[1]]),!0)}forceDOMReadyCycle(){}};return c([h()],t.prototype,"container",null),c([h({readOnly:!0})],t.prototype,"focused",null),c([h({readOnly:!0})],t.prototype,"height",void 0),c([h({type:GP})],t.prototype,"popup",null),c([h({type:Zk})],t.prototype,"overlay",void 0),c([h({readOnly:!0})],t.prototype,"position",void 0),c([h({readOnly:!0})],t.prototype,"resizing",void 0),c([h({readOnly:!0})],t.prototype,"root",void 0),c([h({value:null,readOnly:!0})],t.prototype,"size",null),c([h({readOnly:!0})],t.prototype,"surface",void 0),c([h({readOnly:!0})],t.prototype,"suspended",void 0),c([h()],t.prototype,"ui",void 0),c([h({readOnly:!0})],t.prototype,"userContent",void 0),c([h({readOnly:!0})],t.prototype,"width",void 0),c([h()],t.prototype,"widthBreakpoint",void 0),t=c([S("esri.views.DOMContainer")],t),t},iae=e=>{let t=class extends e{async fetchPopupFeatures(i,s){await this.when();const{location:r,queryArea:n,layerViewsAndGraphics:o,clientOnlyGraphics:a}=await this._prepareFetchPopupFeatures(i,s),l=Promise.resolve(a),u=this._queryLayerPopupFeatures(n,o,s),d=u.map(f=>f.promise);return{location:r,clientOnlyGraphics:a,allGraphicsPromise:mz([l,...d]).then(f=>Array.from(new Set(f.flat()))),promisesPerLayerView:u}}_queryLayerPopupFeatures(i,s,r){return s.map(({layerView:n,graphics:o})=>{const a={clientGraphics:o,event:M(r)?r.event:null,signal:M(r)?r.signal:null,defaultPopupTemplateEnabled:!!M(r)&&!!r.defaultPopupTemplateEnabled},l=n.fetchPopupFeatures(i,a);return{layerView:n,promise:l}})}_isValidPopupGraphic(i,s){return i&&!!i.getEffectivePopupTemplate(M(s)&&s.defaultPopupTemplateEnabled)}async _prepareFetchPopupFeatures(i,s){const{clientGraphics:r,queryArea:n,location:o}=await this._popupHitTestGraphics(i,s),a=this._getFetchPopupLayerViews(),{layerViewsAndGraphics:l,clientOnlyGraphics:u}=this._graphicsPerFetchPopupLayerView(r,a);return{clientOnlyGraphics:u,layerViewsAndGraphics:l,queryArea:n,location:o}}async _popupHitTestGraphics(i,s){const{results:r,mapPoint:n}=await this.popupHitTest(i),o=r.filter(l=>l.type==="graphic"&&this._isValidPopupGraphic(l.graphic,s)),a=o.length?o[0].mapPoint:null;return{clientGraphics:o.map(l=>l.graphic),queryArea:n,location:n||a}}_getFetchPopupLayerViews(){const i=[];return this.allLayerViews.forEach(s=>{this._isValidPopupLayerView(s)&&i.push(s)}),M(this.graphicsView)&&this._isValidPopupLayerView(this.graphicsView)&&i.push(this.graphicsView),i.reverse()}_isValidPopupLayerView(i){return M(i)&&(!("layer"in i)||!i.suspended)&&"fetchPopupFeatures"in i}_graphicsPerFetchPopupLayerView(i,s){const r=[],n=new Map,o=s.map(a=>{const l=[];return"layer"in a?n.set(a.layer,l):n.set(a.graphics,l),{layerView:a,graphics:l}});for(const a of i){const l=n.get(a.layer)||n.get(a.sourceLayer)||null;l?l.push(a):r.push(a)}return{layerViewsAndGraphics:o,clientOnlyGraphics:r}}};return t=c([S("esri.views.PopupView")],t),t};let Ov=class extends pf{constructor(e){super(e),this.handles.add(this.on("before-add",t=>{N(t.item)||t.item.parent===this.owner&&(q.getLogger(this.declaredClass).warn("Analysis inside the collection must be unique. Not adding this element again."),t.preventDefault())}))}_own(e){e.parent=this.owner}_release(e){e.parent=null}};Ov=c([S("esri.support.AnalysesCollection")],Ov);let Ma=class extends oe{constructor(e){super(e),this.view=null,this.baseLayerViews=new he,this.referenceLayerViews=new he,this._loadingHandle=Z(()=>{var t,i;return(i=(t=this.view)==null?void 0:t.map)==null?void 0:i.basemap},t=>{t&&t.load().catch(()=>{})},Le)}destroy(){this._set("view",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null)}get suspended(){return!this.view||this.view.suspended}get updating(){var t,i;if(this.view&&this.view.suspended)return!1;const e=(i=(t=this.view)==null?void 0:t.map)==null?void 0:i.basemap;return!!e&&!!e.loaded&&(this.baseLayerViews.some(s=>s.updating)||this.referenceLayerViews.some(s=>s.updating))}};c([h({constructOnly:!0})],Ma.prototype,"view",void 0),c([h({readOnly:!0})],Ma.prototype,"baseLayerViews",void 0),c([h({readOnly:!0})],Ma.prototype,"referenceLayerViews",void 0),c([h({readOnly:!0})],Ma.prototype,"suspended",null),c([h({type:Boolean,readOnly:!0})],Ma.prototype,"updating",null),Ma=c([S("esri.views.BasemapView")],Ma);class sae{constructor(t,i,s){this.layer=t,this.view=i,this.layerViewImporter=s,this._controller=new AbortController,this._deferred=Ao(),this._started=!1,this.done=!1,Vr(this._controller.signal,()=>{const r=new L("cancelled:layerview-create","layerview creation cancelled",{layer:t});this._deferred.reject(r)})}get promise(){return this._deferred.promise}destroy(){this._controller.abort();const{layerView:t}=this;if(!t)return;const{layer:i,view:s}=this;i.emit("layerview-destroy",{view:s,layerView:t}),s.emit("layerview-destroy",{layer:i,layerView:t}),this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null}async start(){var r,n;if(this._started)return;this._started=!0;const{_controller:{signal:t},layer:i,view:s}=this;this._map=s.map;try{let o,a;if(await i.load({signal:t}),"prefetchResources"in i&&await i.prefetchResources({signal:t}),i.createLayerView)o=await i.createLayerView(s,{signal:t});else{if(!this.layerViewImporter.hasLayerViewModule(i))throw new L("layer:view-not-supported","No layerview implementation was found");const d=await this.layerViewImporter.importLayerView(i);Ft(t),o="default"in d?new d.default({layer:i,view:s}):new d({layer:i,view:s})}const l=()=>{a=Bt(a),o.destroyed||o.destroy(),o.layer=null,o.parent=null,o.view=null,this.done=!0};a=Vr(t,l),Ft(t);try{await o.when()}catch(d){throw l(),d}if(!((n=(r=this._map)==null?void 0:r.allLayers)==null?void 0:n.includes(i)))return l(),void this._deferred.reject(new L("view:no-layerview-for-layer","The layer has been removed from the map",{layer:i}));this.layerView=o,i.emit("layerview-create",{view:s,layerView:o}),s.emit("layerview-create",{layer:i,layerView:o}),this.done=!0,this._deferred.resolve(o)}catch(o){i.emit("layerview-create-error",{view:s,error:o}),s.emit("layerview-create-error",{layer:i,error:o}),this.done=!0,this._deferred.reject(new L("layerview:create-error","layerview creation failed",{layer:i,error:o}))}}}let Gs=class extends oe{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._watchUpdatingTracking=new kh,this.supportsGround=!0,this._preloadLayerViewModules=()=>{var i;const t=(i=this.view.map)==null?void 0:i.allLayers;if(t)for(const s of t)this.layerViewImporter.hasLayerViewModule(s)&&this.layerViewImporter.importLayerView(s)},this._reschedule=()=>(N(this._workPromise)&&(this._workPromise=Ao(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(ad(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{var o,a,l;const t=this.view.map;if(this._map!==t&&(this.clear(),this._map=t),N(this._workPromise))return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const i=[],s=u=>{if(!N(u))for(const d of u)d&&(i.push(d),this._createLayerView(d),"layers"in d&&d.layers&&s(d.layers))};for(const u of this._rootCollectionNames)s(this.get(u));this._refreshCollections();for(const[u,d]of this._layerLayerViewInfoMap)i.includes(u)||(this._layerLayerViewInfoMap.delete(d.layer),d.destroy());const r=i.filter(u=>u.type==="group").map(u=>u.layers),n=[(o=t==null?void 0:t.ground)==null?void 0:o.layers,(a=t==null?void 0:t.basemap)==null?void 0:a.baseLayers,(l=t==null?void 0:t.basemap)==null?void 0:l.referenceLayers,t==null?void 0:t.layers,...r].filter(u=>!!u);this.addHandles(n.map(u=>this._watchUpdatingTracking.addOnCollectionChange(()=>u,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.own([Is(()=>{var e,t;return(t=(e=this.view)==null?void 0:e.map)==null?void 0:t.allLayers},"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),Z(()=>{const e=this.view,t=e==null?void 0:e.map;return[t==null?void 0:t.basemap,t==null?void 0:t.ground,t==null?void 0:t.layers,e==null?void 0:e.ready]},()=>this._reschedule(),Al)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),this._watchUpdatingTracking.destroy(),this._map=null,M(this._workPromise)&&(this._workPromise.reject(_t()),this._workPromise=null)}get _layersToLayerViews(){const e=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&e.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(e)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return M(this._workPromise)||this._watchUpdatingTracking.updating||Zv(this._layerLayerViewInfoMap,e=>!e.done)}get updatingRemaining(){let e=0;for(const t of this._layerLayerViewInfoMap.values())t.done||++e;return e}clear(){if(!this.destroyed){for(const e of this._layerLayerViewInfoMap.values())e.destroy();this._layerLayerViewInfoMap.clear(),this._refreshCollections()}}async whenLayerView(e){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(e))throw new L("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e});return this._layerLayerViewInfoMap.get(e).promise}_refreshCollections(){for(const[e,t]of this._layersToLayerViews)this._populateLayerViewsOwners(this.get(e),this.get(t),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(e,t,i){if(!e||!t)return void(t&&t.removeAll());let s=0;for(const r of e){const n=this._layerLayerViewInfoMap.get(r);if(!n||!n.layerView)continue;const o=n.layerView;o.layer=r,o.parent=i,t.getItemAt(s)!==o&&t.splice(s,0,o),r.layers&&this._populateLayerViewsOwners(r.layers,o.layerViews,o),s+=1}s{}),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const t=new sae(e,this.view,this.layerViewImporter);t.promise.then(()=>this._refreshCollections(),i=>{var s,r;i&&(Ks(i)||i.name==="cancelled:layerview-create")||q.getLogger(this.declaredClass).error(`Failed to create layerview for layer title:'${(s=e.title)!=null?s:"no title"}', id:'${(r=e.id)!=null?r:"no id"}' of type '${e.type}'.`,{layer:e,error:i}),this._refreshCollections()}),this._layerLayerViewInfoMap.set(e,t),this.view.ready&&t.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};c([h()],Gs.prototype,"_workPromise",void 0),c([h({readOnly:!0})],Gs.prototype,"_watchUpdatingTracking",void 0),c([h({readOnly:!0})],Gs.prototype,"_layersToLayerViews",null),c([h({readOnly:!0})],Gs.prototype,"_rootCollectionNames",null),c([h()],Gs.prototype,"layerViewImporter",void 0),c([h()],Gs.prototype,"supportsGround",void 0),c([h({readOnly:!0})],Gs.prototype,"updating",null),c([h({readOnly:!0})],Gs.prototype,"updatingRemaining",null),c([h({constructOnly:!0})],Gs.prototype,"view",void 0),Gs=c([S("esri.views.LayerViewManager")],Gs);const rae=Gs;let gs=class extends oe{constructor(e){super(e),this.factor=1.5,this.offset=ns(0,0),this.position=null,this.size=120,this.maskUrl=null,this.maskEnabled=!0,this.overlayUrl=null,this.overlayEnabled=!0,this.visible=!0}get version(){return this.commitProperty("factor"),this.commitProperty("offset"),this.commitProperty("position"),this.commitProperty("visible"),this.commitProperty("size"),this.commitProperty("maskUrl"),this.commitProperty("maskEnabled"),this.commitProperty("overlayUrl"),this.commitProperty("overlayEnabled"),(this._get("version")||0)+1}};c([h({type:Number})],gs.prototype,"factor",void 0),c([h({nonNullable:!0})],gs.prototype,"offset",void 0),c([h()],gs.prototype,"position",void 0),c([h({type:Number,range:{min:0}})],gs.prototype,"size",void 0),c([h()],gs.prototype,"maskUrl",void 0),c([h()],gs.prototype,"maskEnabled",void 0),c([h()],gs.prototype,"overlayUrl",void 0),c([h()],gs.prototype,"overlayEnabled",void 0),c([h({readOnly:!0})],gs.prototype,"version",null),c([h({type:Boolean})],gs.prototype,"visible",void 0),gs=c([S("esri.views.Magnifier")],gs);const aj=gs;class nae{constructor(){this._tasks=new Array,this._running=new Pv(!1)}get length(){return this._tasks.length}get running(){return this._running.get()}destroy(){this.cancelAll()}runTask(t){for(;!t.done&&this._process(t);)t.madeProgress()}push(t,i,s){return this._running.set(!0),new Promise((r,n)=>this._tasks.push(new HP(r,n,t,i,s)))}unshift(t,i,s){return this._running.set(!0),new Promise((r,n)=>this._tasks.unshift(new HP(r,n,t,i,s)))}_process(t){var s;if(this._tasks.length===0)return!1;const i=this._tasks.shift();try{const r=jr(i.signal);if(r&&!i.abortCallback)i.reject(_t());else{const n=r?(s=i.abortCallback)==null?void 0:s.call(i,_t()):i.callback(t);No(n)?n.then(i.resolve,i.reject):i.resolve(n)}}catch(r){i.reject(r)}return this._running.set(this._tasks.length>0),!0}cancelAll(){const t=_t();for(const i of this._tasks)if(i.abortCallback){const s=i.abortCallback(t);i.resolve(s)}else i.reject(t);this._tasks.length=0,this._running.set(!1)}}class HP{constructor(t,i,s,r,n){this.resolve=t,this.reject=i,this.callback=s,this.signal=r,this.abortCallback=n}}let Wp=class extends oe{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};c([h()],Wp.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),c([h()],Wp.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),Wp=c([S("esri.views.support.DebugFlags")],Wp);const oae=new Wp;var vs;(function(e){e[e.ANIMATING=0]="ANIMATING",e[e.INTERACTING=1]="INTERACTING",e[e.IDLE=2]="IDLE"})(vs||(vs={}));var Ae;(function(e){e.RESOURCE_CONTROLLER="schedule",e.SLIDE="slide",e.STREAM_DATA_LOADER="stream loader",e.ELEVATION_QUERY="elevation query",e.TERRAIN_SURFACE="terrain",e.SURFACE_GEOMETRY_UPDATES="surface geometry updates",e.GRAPHICS_CORE="Graphics3D",e.I3S_CONTROLLER="I3S",e.POINT_CLOUD_LAYER="point cloud",e.FEATURE_TILE_FETCHER="feature fetcher",e.OVERLAY="overlay",e.STAGE="stage",e.GRAPHICS_DECONFLICTOR="graphics deconflictor",e.FILTER_VISIBILITY="Graphics3D filter visibility",e.SCALE_VISIBILITY="Graphics3D scale visibility",e.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",e.POINT_OF_INTEREST_FREQUENT="POI frequent",e.POINT_OF_INTEREST_INFREQUENT="POI infrequent",e.LABELER="labeler",e.FEATURE_QUERY_ENGINE="feature query",e.FEATURE_TILE_TREE="feature tile tree",e.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",e.ELEVATION_ALIGNMENT="elevation alignment",e.TEXT_TEXTURE_ATLAS="text texture atlas",e.TEXTURE_UNLOAD="texture unload",e.LINE_OF_SIGHT_TOOL="line of sight tool",e.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",e.ELEVATION_PROFILE="elevation profile",e.SNAPPING="snapping",e.SHADOW_ACCUMULATOR="shadow accumulator",e.CLOUDS_GENERATOR="cloud generator",e[e.TEST_PRIO=1]="TEST_PRIO"})(Ae||(Ae={}));const vn=0,YP=new Map([[Ae.RESOURCE_CONTROLLER,vn],[Ae.SLIDE,vn],[Ae.STREAM_DATA_LOADER,vn],[Ae.ELEVATION_QUERY,vn],[Ae.TERRAIN_SURFACE,1],[Ae.SURFACE_GEOMETRY_UPDATES,1],[Ae.GRAPHICS_CORE,2],[Ae.I3S_CONTROLLER,2],[Ae.POINT_CLOUD_LAYER,2],[Ae.FEATURE_TILE_FETCHER,2],[Ae.OVERLAY,4],[Ae.STAGE,4],[Ae.GRAPHICS_DECONFLICTOR,4],[Ae.FILTER_VISIBILITY,4],[Ae.SCALE_VISIBILITY,4],[Ae.FRUSTUM_VISIBILITY,4],[Ae.CLOUDS_GENERATOR,4],[Ae.POINT_OF_INTEREST_FREQUENT,6],[Ae.POINT_OF_INTEREST_INFREQUENT,30],[Ae.LABELER,8],[Ae.FEATURE_QUERY_ENGINE,8],[Ae.FEATURE_TILE_TREE,16],[Ae.FEATURE_TILE_TREE_ACTIVE,vn],[Ae.ELEVATION_ALIGNMENT,12],[Ae.TEXT_TEXTURE_ATLAS,12],[Ae.TEXTURE_UNLOAD,12],[Ae.LINE_OF_SIGHT_TOOL,16],[Ae.LINE_OF_SIGHT_TOOL_INTERACTIVE,vn],[Ae.SNAPPING,vn],[Ae.SHADOW_ACCUMULATOR,30]]),Aw=32;function JP(e){return YP.has(e)?YP.get(e):typeof e=="number"?e:1}const XP=6.5,ZP=1,aae=30,QP=1e3/30,KP=100,eA=.9;var tM,Sl;(function(e){class t{constructor(){this._updating=new Pv(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new cf("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new s,this._state=vs.INTERACTING,this._tasks=new Vc,this._runQueue=new Vc,this._load=0,this._idleStateCallbacks=new Vc,this._idleUpdatesStartFired=!1,this._maxReschedule=Aw,this._forceTask=!1,this._debug=!1,this._debugHandle=Z(()=>oae.SCHEDULER_LOG_SLOW_TASKS,o=>this._debug=o,Le);for(const o of Object.keys(Ae))this.performanceInfo.tasks.set(Ae[o],new cf(Ae[o]));const n=this;this._test={FRAME_SAFETY_BUDGET:XP,INTERACTING_BUDGET:QP,IDLE_BUDGET:KP,get availableBudget(){return n._budget.budget},usedBudget:0,getBudget:()=>n._budget,setBudget:o=>n._budget=o,updateTask:o=>this._updateTask(o),getState:o=>this._getState(o),getRuntime:o=>this._getRuntime(o),frameTaskTimes:this._frameTaskTimes,resetRuntimes:()=>this._resetRuntimes(),getRunning:()=>this._getRunning()}}get updating(){return this._updating.get()}set updating(n){this._updating.set(n)}destroy(){this._tasks.toArray().forEach(n=>n.remove()),this._tasks.clear(),Bt(this._debugHandle),this._microTaskQueued=!1,this._updating.set(!1)}activate(){this._budget.done||this._microTaskQueued||(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.done||(this._maxReschedule=Aw,this._schedule(),this.frame()))}))}registerTask(n,o){const a=JP(n),l=new i(this,n,o,a);return this._tasks.push(l),this.performanceInfo.tasks.has(n)||this.performanceInfo.tasks.set(n,new cf(n)),l}registerIdleStateCallbacks(n,o){const a={idleBegin:n,idleEnd:o};this._idleStateCallbacks.push(a),this.state===vs.IDLE&&this._idleUpdatesStartFired&&a.idleBegin();const l=this;return{remove:()=>this._removeIdleStateCallbacks(a),set idleBegin(u){l._idleUpdatesStartFired&&(a.idleEnd(),l._state===vs.IDLE&&u()),a.idleBegin=u},set idleEnd(u){a.idleEnd=u}}}get load(){return this._load}set state(n){this._state!==n&&(this._state=n,this.state!==vs.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(o=>o.idleEnd())))}get state(){return this._state}updateBudget(n){this._test.usedBudget=0,++this._frameNumber;let o=XP,a=n.frameDuration,l=ZP;switch(this.state){case vs.IDLE:o=0,a=Math.max(KP,n.frameDuration),l=aae;break;case vs.INTERACTING:a=Math.max(QP,n.frameDuration);case vs.ANIMATING:}return a=a-n.elapsedFrameTime-o,this.state!==vs.IDLE&&an.idleBegin())),this._runIdle();break;case vs.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test.usedBudget=this._budget.elapsed}stopFrame(){this._budget.reset(0,this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(n){this._idleUpdatesStartFired&&n.idleEnd(),this._idleStateCallbacks.removeUnordered(n)}removeTask(n){this._tasks.removeUnordered(n),this._runQueue.removeUnordered(n)}_updateTask(n){this._tasks.forAll(o=>{o.name===n&&o.setPriority(n)})}_getState(n){if(this._runQueue.some(a=>a.name===n))return Sl.SCHEDULED;let o=Sl.IDLE;return this._tasks.forAll(a=>{a.name===n&&a.needsUpdate&&(a.schedulePriority<=1?o=Sl.READY:o!==Sl.READY&&(o=Sl.WAITING))}),o}_getRuntime(n){let o=0;return this._tasks.forAll(a=>{a.name===n&&(o+=a.runtime)}),o}_resetRuntimes(){this._tasks.forAll(n=>n.runtime=0)}_getRunning(){const n=new Map;if(this._tasks.forAll(a=>{a.needsUpdate&&n.set(a.name,(n.get(a.name)||0)+1)}),n.size===0)return null;let o="";return n.forEach((a,l)=>{o+=a>1?` ${a}x ${l}`:` ${l}`}),o}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const n=this._tasks.reduce((o,a)=>a.needsUpdate?++o:o,0);this._load=this._load*eA+n*(1-eA)}_schedule(){if(this._maxReschedule<=0)return!1;for(this._runQueue.filterInPlace(n=>!!n.needsUpdate||(n.schedulePriority=n.basePriority,!1)),this._tasks.forAll(n=>{n.basePriority===vn&&n.needsUpdate&&!this._runQueue.includes(n)&&this._runQueue.unshift(n)});this._runQueue.length===0;){let n=!1,o=0;if(this._tasks.forAll(a=>{a.needsUpdate&&a.schedulePriority!==0&&a.basePriority!==vn&&(!a.task.runOncePerFrame||a.lastFrameRun!==this._frameNumber)&&(n=!0,o=Math.max(o,a.basePriority),a.schedulePriority===1?(a.schedulePriority=0,this._runQueue.push(a)):--a.schedulePriority)}),!n)return this._updating.set(!1),!1;--this._maxReschedule}return this._updating.set(!0),!0}_run(){const n=this._budget.now();this._startFrameTaskTimes();do for(;this._runQueue.length>0;){const o=this._budget.now(),a=this._runQueue.pop();this._budget.resetProgress();try{a.task.runTask(this._budget)}catch(u){q.getLogger("esri.views.support.Scheduler").error(`Exception in task "${a.name}"`,u)}a.schedulePriority=a.basePriority,a.lastFrameRun=this._frameNumber;const l=this._budget.now()-o;if(a.runtime+=l,this._frameTaskTimes.set(a.priority,this._frameTaskTimes.get(a.priority)+l),this._debug&&this._budget.elapsed>2*this._budget.budget&&console.log("Task",a.name,"used",this._budget.elapsed,"of max",this._budget.budget,"ms"),this._budget.remaining<=0)return this._updating.set(this._tasks.some(u=>u.needsUpdate)),void this._recordFrameTaskTimes(this._budget.now()-n)}while(this._schedule());this._updating.set(this._tasks.some(o=>o.needsUpdate)),this._recordFrameTaskTimes(this._budget.now()-n)}_startFrameTaskTimes(){for(const n of Object.keys(Ae))this._frameTaskTimes.set(Ae[n],0)}_recordFrameTaskTimes(n){this._frameTaskTimes.forEach((o,a)=>this.performanceInfo.tasks.get(a).record(o)),this.performanceInfo.total.record(n)}get test(){return this._test}}e.Scheduler=t;class i{constructor(n,o,a,l){this._scheduler=n,this.name=o,this._basePriority=l,this.lastFrameRun=0,this.runtime=0,this._queue=new nae,this._handles=new qi,this.schedulePriority=this._basePriority,this._task=new Pv(M(a)?a:this._queue),this._handles.add(Qs(()=>this.task.running,()=>n.activate()))}get task(){return this._task.get()}get updating(){return this._queue.running}remove(){this.processQueue(lj),this._scheduler.removeTask(this),this.schedule=iM.schedule,this.reschedule=iM.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(n){this.name=n;const o=JP(n);this._basePriority!==vn&&this.schedulePriority===0||(this.schedulePriority=o),this._basePriority=o}get priority(){return this.name}set priority(n){this.setPriority(n)}get needsUpdate(){return this.updating||this.task.running}schedule(n,o,a){return this._queue.push(n,o,a)}reschedule(n,o,a){return this._queue.unshift(n,o,a)}processQueue(n){this._queue.runTask(n)}}class s{constructor(){this._begin=typeof performance!="undefined"?performance.now():0,this._budget=0,this._state=vs.IDLE,this._done=!1,this._enabled=!0}run(n){return!this.done&&(n()===!0&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){this._done=this.elapsed>=this._budget&&this._enabled}get state(){return this._state}get enabled(){return this._enabled}set enabled(n){this._enabled=n}reset(n,o){this._begin=this.now(),this._budget=n,this._state=o,this._done=!1}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return performance.now()-this._begin}resetProgress(){this._done=!1}get hasProgressed(){return this._done}}e.Budget=s})(tM||(tM={})),function(e){e.SCHEDULED="s",e.READY="r",e.WAITING="w",e.IDLE="i"}(Sl||(Sl={}));const lj=(()=>{const e=new tM.Budget;return e.enabled=!1,e})();class lae{remove(){}processQueue(){}schedule(t,i,s){try{if(jr(i)){const r=_t();return s?Promise.resolve(s(r)):Promise.reject(r)}return x1(t(lj))}catch(r){return Promise.reject(r)}}reschedule(t,i,s){return this.schedule(t,i,s)}}const iM=new lae;let Hp=class extends oe{constructor(e,t){var i;super({}),this._stage=e,this._textureRequests=new Map,this._frameTask=(i=t==null?void 0:t.registerTask(Ae.TEXTURE_UNLOAD))!=null?i:iM}normalizeCtorArgs(){return{}}destroy(){super.destroy(),this._frameTask.remove(),this._textureRequests.forEach(e=>this._releaseTextureRequest(e)),this._textureRequests.clear()}get updating(){return this._frameTask.updating}fromData(e,t,i){const s=this.makeUid(e);let r=this._textureRequests.get(s);return r||(r={referenceCount:0,texture:t(),textureAsync:null,abortController:null,onRemove:i},this._stage&&(this._stage.add(r.texture),this._stage.loadImmediate(r.texture)),this._textureRequests.set(s,r)),r.referenceCount++,{uid:s,texture:r.texture,release:()=>this._release(s)}}_release(e){const t=this._textureRequests.get(e);t?(t.referenceCount<1&&console.warn("TextureCollection: reference count is < 1 for "+e),t.referenceCount--,t.referenceCount<1&&this._frameTask.schedule(()=>this._releaseNow(e))):console.warn(`TextureCollection: texture doesn't exist: '${e}'`)}get test(){return{textureRequests:this._textureRequests}}_releaseNow(e){if(!this._textureRequests)return;const t=this._textureRequests.get(e);!t||t.referenceCount>0||(this._releaseTextureRequest(t),this._textureRequests.delete(e))}_releaseTextureRequest(e){var t;e.onRemove&&e.onRemove(),e.texture?(t=this._stage)==null||t.remove(e.texture):e.abortController&&(e.abortController.abort(),e.abortController=null)}makeUid(e,t=null){return M(t)?`${e}.${t}px`:e}};c([h()],Hp.prototype,"_frameTask",void 0),c([h()],Hp.prototype,"updating",null),Hp=c([S("esri.views.3d.support.TextureCollection")],Hp);var tA;(function(e){e[e.Left=0]="Left",e[e.Middle=1]="Middle",e[e.Right=2]="Right"})(tA||(tA={}));const cj=["click","double-click","immediate-click","immediate-double-click","hold","drag","key-down","key-up","pointer-down","pointer-move","pointer-up","pointer-drag","mouse-wheel","pointer-enter","pointer-leave","gamepad","focus","blur"],uj={};function hj(e){return!!uj[e]}function cae(e){for(const t of e)if(!hj(t))return!1;return!0}cj.forEach(e=>{uj[e]=!0});class uae{constructor(t){this._handlers=new Map,this._counter=0,this._handlerCounts=new Map,this.view=t,this.inputManager=null}connect(t){t&&this.disconnect(),this.inputManager=t,this._handlers.forEach(({handler:i,priority:s},r)=>this.inputManager.installHandlers(r,[i],s))}disconnect(){this.inputManager&&this._handlers.forEach((t,i)=>this.inputManager.uninstallHandlers(i)),this.inputManager=null}destroy(){this.disconnect(),this._handlers.clear(),this.view=null}on(t,i,s,r){const n=Array.isArray(t)?t:t.split(",");if(!cae(n))return n.some(hj)&&console.error("Error: registering input events and other events on the view at the same time is not supported."),null;let o,a;Array.isArray(i)?a=i:(o=i,a=[]),typeof s=="function"?o=s:r=s,r=r!=null?r:el.DEFAULT;const l=this._createUniqueGroupName(),u=new hae(this.view,n,a,o);this._handlers.set(l,{handler:u,priority:r});for(const d of n){const f=this._handlerCounts.get(d)||0;this._handlerCounts.set(d,f+1)}return this.inputManager&&this.inputManager.installHandlers(l,[u],r),{remove:()=>this._removeHandler(l,n)}}hasHandler(t){return!!this._handlerCounts.get(t)}_removeHandler(t,i){if(this._handlers.has(t)){this._handlers.delete(t);for(const s of i){const r=this._handlerCounts.get(s);r===void 0?console.error("Trying to remove handler for event that has no handlers registered: ",s):r===1?this._handlerCounts.delete(s):this._handlerCounts.set(s,r-1)}}this.inputManager&&this.inputManager.uninstallHandlers(t)}_createUniqueGroupName(){return this._counter+=1,`viewEvents_${this._counter}`}}class hae extends ei{constructor(t,i,s,r){super(!0),this.view=t;for(const n of i)switch(n){case"click":this.registerIncoming("click",s,o=>r(this._wrapClick(o)));break;case"double-click":this.registerIncoming("double-click",s,o=>r(this._wrapDoubleClick(o)));break;case"immediate-click":this.registerIncoming("immediate-click",s,o=>r(this._wrapImmediateClick(o)));break;case"immediate-double-click":this.registerIncoming("immediate-double-click",s,o=>r(this._wrapImmediateDoubleClick(o)));break;case"hold":this.registerIncoming("hold",s,o=>r(this._wrapHold(o)));break;case"drag":this.registerIncoming("drag",s,o=>{const a=this._wrapDrag(o);a&&r(a)});break;case"key-down":this.registerIncoming("key-down",s,o=>r(this._wrapKeyDown(o)));break;case"key-up":this.registerIncoming("key-up",s,o=>r(this._wrapKeyUp(o)));break;case"pointer-down":this.registerIncoming("pointer-down",s,o=>r(this._wrapPointer(o,"pointer-down")));break;case"pointer-move":this.registerIncoming("pointer-move",s,o=>r(this._wrapPointer(o,"pointer-move")));break;case"pointer-up":this.registerIncoming("pointer-up",s,o=>r(this._wrapPointer(o,"pointer-up")));break;case"pointer-drag":this.registerIncoming("pointer-drag",s,o=>r(this._wrapPointerDrag(o)));break;case"mouse-wheel":this.registerIncoming("mouse-wheel",s,o=>r(this._wrapMouseWheel(o)));break;case"pointer-enter":this.registerIncoming("pointer-enter",s,o=>r(this._wrapPointer(o,"pointer-enter")));break;case"pointer-leave":this.registerIncoming("pointer-leave",s,o=>r(this._wrapPointer(o,"pointer-leave")));break;case"gamepad":this.registerIncoming("gamepad",s,o=>{r(this._wrapGamepad(o))});break;case"focus":this.registerIncoming("focus",s,o=>{r(this._wrapFocus(o))});break;case"blur":this.registerIncoming("blur",s,o=>{r(this._wrapBlur(o))})}}_wrapFocus(t){return{type:"focus",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:i=>t.async(i),preventDefault:()=>t.preventDefault()}}_wrapBlur(t){return{type:"blur",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:i=>t.async(i),preventDefault:()=>t.preventDefault()}}_wrapClick(t){const{pointerType:i,button:s,buttons:r,x:n,y:o,native:a,eventId:l}=t.data,{cancelable:u,timestamp:d}=t;return{type:"click",pointerType:i,button:s,buttons:r,x:n,y:o,native:a,timestamp:d,screenPoint:ns(n,o),mapPoint:this._getMapPoint(n,o),eventId:l,cancelable:u,stopPropagation:()=>t.stopPropagation(),async:f=>t.async(f),preventDefault:()=>t.preventDefault()}}_wrapDoubleClick(t){const{pointerType:i,button:s,buttons:r,x:n,y:o,native:a,eventId:l}=t.data,{cancelable:u,timestamp:d}=t;return{type:"double-click",pointerType:i,button:s,buttons:r,x:n,y:o,native:a,timestamp:d,mapPoint:this._getMapPoint(n,o),eventId:l,cancelable:u,stopPropagation:()=>t.stopPropagation(),async:f=>t.async(f),preventDefault:()=>t.preventDefault()}}_wrapImmediateClick(t){const{pointerType:i,button:s,buttons:r,x:n,y:o,native:a,eventId:l}=t.data,u=a.pointerId,{cancelable:d,timestamp:f}=t;return{type:"immediate-click",pointerId:u,pointerType:i,button:s,buttons:r,x:n,y:o,native:a,timestamp:f,mapPoint:this._getMapPoint(n,o),eventId:l,cancelable:d,stopPropagation:()=>t.stopPropagation(),async:m=>t.async(m),preventDefault:()=>t.preventDefault()}}_wrapImmediateDoubleClick(t){const{pointerType:i,button:s,buttons:r,x:n,y:o,native:a,eventId:l}=t.data,u=a.pointerId,{cancelable:d,timestamp:f}=t;return{type:"immediate-double-click",pointerId:u,pointerType:i,button:s,buttons:r,x:n,y:o,native:a,timestamp:f,mapPoint:this._getMapPoint(n,o),eventId:l,cancelable:d,stopPropagation:()=>t.stopPropagation(),async:m=>t.async(m),preventDefault:()=>t.preventDefault()}}_wrapHold(t){const{pointerType:i,button:s,buttons:r,x:n,y:o,native:a}=t.data,{cancelable:l,timestamp:u}=t;return{type:"hold",pointerType:i,button:s,buttons:r,x:n,y:o,native:a,timestamp:u,mapPoint:this._getMapPoint(n,o),cancelable:l,stopPropagation:()=>t.stopPropagation(),async:d=>t.async(d),preventDefault:()=>t.preventDefault()}}_getMapPoint(t,i){return this.view.toMap(ns(t,i),{exclude:[]})}_wrapDrag(t){const i=t.data,{x:s,y:r}=i.center,{action:n,pointerType:o,button:a}=i;if(n==="start"&&(this._latestDragStart=i),!this._latestDragStart)return;const l=i.pointer.native,u=i.buttons,{cancelable:d,timestamp:f}=t,m={x:this._latestDragStart.center.x,y:this._latestDragStart.center.y};return n==="end"&&(this._latestDragStart=void 0),{type:"drag",action:n,x:s,y:r,origin:m,pointerType:o,button:a,buttons:u,radius:i.radius,angle:cF(i.angle),native:l,timestamp:f,cancelable:d,stopPropagation:()=>t.stopPropagation(),async:y=>t.async(y),preventDefault:()=>t.preventDefault()}}_wrapKeyDown(t){const{key:i,repeat:s,native:r}=t.data,{cancelable:n,timestamp:o}=t;return{type:"key-down",key:i,repeat:s,native:r,timestamp:o,cancelable:n,stopPropagation:()=>t.stopPropagation(),async:a=>t.async(a),preventDefault:()=>t.preventDefault()}}_wrapKeyUp(t){const{key:i,native:s}=t.data,{cancelable:r,timestamp:n}=t;return{type:"key-up",key:i,native:s,timestamp:n,cancelable:r,stopPropagation:()=>t.stopPropagation(),async:o=>t.async(o),preventDefault:()=>t.preventDefault()}}_wrapPointer(t,i){const{x:s,y:r,button:n,buttons:o,native:a,eventId:l}=t.data,u=a.pointerId,d=a.pointerType,{cancelable:f,timestamp:m}=t;return{type:i,x:s,y:r,pointerId:u,pointerType:d,button:n,buttons:o,native:a,timestamp:m,eventId:l,cancelable:f,stopPropagation:()=>t.stopPropagation(),async:y=>t.async(y),preventDefault:()=>t.preventDefault()}}_wrapPointerDrag(t){const{x:i,y:s,buttons:r,native:n,eventId:o}=t.data.currentEvent,{button:a}=t.data.startEvent,l=t.data.startEvent.native.pointerId,u=t.data.startEvent.native.pointerType,d=t.data.action,f={x:t.data.startEvent.x,y:t.data.startEvent.y},{cancelable:m,timestamp:y}=t;return{type:"pointer-drag",x:i,y:s,pointerId:l,pointerType:u,button:a,buttons:r,action:d,origin:f,native:n,timestamp:y,eventId:o,cancelable:m,stopPropagation:()=>t.stopPropagation(),async:g=>t.async(g),preventDefault:()=>t.preventDefault()}}_wrapMouseWheel(t){const{cancelable:i,data:s,timestamp:r}=t,{x:n,y:o,deltaY:a,native:l}=s;return{type:"mouse-wheel",x:n,y:o,deltaY:a,native:l,timestamp:r,cancelable:i,stopPropagation:()=>t.stopPropagation(),async:u=>t.async(u),preventDefault:()=>t.preventDefault()}}_wrapGamepad(t){const{action:i,state:s,device:r}=t.data,{cancelable:n,timestamp:o}=t,{buttons:a,axes:l}=s;return{type:"gamepad",device:r,timestamp:o,action:i,buttons:a,axes:l,cancelable:n,stopPropagation:()=>t.stopPropagation(),async:u=>t.async(u),preventDefault:()=>t.preventDefault()}}}var pm,iA,sA;(function(e){e[e.USER=0]="USER",e[e.MANAGER=1]="MANAGER"})(pm||(pm={})),function(e){e[e.None=0]="None",e[e.Unfocused=1]="Unfocused",e[e.Focused=2]="Focused",e[e.Unselected=4]="Unselected",e[e.Selected=8]="Selected",e[e.All=15]="All"}(iA||(iA={})),function(e){e[e.None=0]="None",e[e.Custom1=16]="Custom1",e[e.Custom2=32]="Custom2",e[e.Custom3=64]="Custom3",e[e.Custom4=128]="Custom4",e[e.Custom5=256]="Custom5",e[e.Custom6=512]="Custom6",e[e.Custom7=1024]="Custom7",e[e.Custom8=2048]="Custom8",e[e.Custom9=4096]="Custom9",e[e.Custom10=8192]="Custom10",e[e.Custom11=16384]="Custom11",e[e.Custom12=32768]="Custom12",e[e.All=65520]="All"}(sA||(sA={}));function dae(e){return[e.on("before-add",t=>{const i=t.item;if(i==null||e.includes(i))return q.getLogger("esri.views.interactive.interactiveToolUtils").warn("Tool is either already in the list of tools or tool is `null`. Not adding tool."),void t.preventDefault();i.onAdd()}),e.on("after-remove",t=>{const i=t.item;i.active&&(i.view.activeTool=null),i.destroy()})]}function sM(e){return e.visible&&e.getEditableFlag(pm.USER)&&e.getEditableFlag(pm.MANAGER)}function un(e){return ns(e.x,e.y)}function dj(e,t){const i=(e instanceof HTMLElement?e:e.surface).getBoundingClientRect();return ns(t.clientX-i.left,t.clientY-i.top)}function rA(e,t){return t instanceof Event?dj(e,t):un(t)}function nA(e){if(e instanceof Event)return!0;if(typeof e=="object"&&"type"in e)switch(e.type){case"click":case"double-click":case"pointer-down":case"pointer-drag":case"pointer-enter":case"pointer-leave":case"pointer-up":case"pointer-move":case"immediate-click":case"immediate-double-click":case"hold":case"drag":case"mouse-wheel":return!0;default:return!1}return!1}class pae{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._revertToNullActiveTool=!1,this._cursor=null}get cursor(){return this._cursor}handleInputEvent(t,i){const s=()=>t.stopPropagation();switch(t.type){case"pointer-move":oA(t.pointerType)&&this._pointerLocations.set(t.pointerId,{x:t.x,y:t.y,pointerType:t.pointerType});break;case"drag":this._grabbedManipulators.size>0&&(this._stopDrag=!0),this._stopDrag&&(s(),t.action==="end"&&(this._stopDrag=!1));break;case"pointer-down":{if(!aA(t))break;const r=un(t),n=this._intersect(r,t.pointerType,i.forEachTool);if(N(n))break;const o=n.manipulator,a=n.tool;!(M(o)&&M(a)&&o.interactive)||o.grabbable&&o.grabbableForEvent(t)||!o.grabbing||o.dragging||this._ungrabManipulatorBeforeDragging(o,t,i),M(o)&&M(a)&&o.interactive&&o.grabbable&&o.grabbableForEvent(t)&&!o.grabbing&&(this._grabbedManipulators.set(t.pointerId,{manipulator:o,tool:a,start:r,pointerType:t.pointerType}),this._grabbedManipulators.size===1&&N(i.activeTool)&&(this._revertToNullActiveTool=!0,i.setActiveTool(n.tool)),o.grabbing=!0,o.events.emit("grab-changed",{action:"start",pointerType:t.pointerType,screenPoint:r}),s());break}case"pointer-up":this._draggedManipulators.has(t.pointerId)||this._handlePointerEnd(t,i);break;case"pointer-drag":{if(!aA(t))break;const r=this._grabbedManipulators.get(t.pointerId),n=ja(r,({manipulator:d})=>d),o=ja(r,({tool:d})=>d);if(N(n)||N(o))break;const a=un(t);a.x=ls(a.x,0,i.view.width),a.y=ls(a.y,0,i.view.height);const l=r.start,u=this._draggedManipulators.get(t.pointerId);switch(t.action){case"start":case"update":t.action!=="update"&&this._grabbedManipulators.size!==1||(n.dragging=!0,u?n.events.emit("drag",{action:"update",start:l,screenPoint:a}):n.events.emit("drag",{action:"start",start:l,screenPoint:a,pointerType:t.pointerType}),this._draggedManipulators.set(t.pointerId,{tool:o,manipulator:n,start:l}));break;case"end":n.dragging=!1,u&&n.events.emit("drag",{action:"end",start:l,screenPoint:a}),this._draggedManipulators.delete(t.pointerId),this._handlePointerEnd(t,i)}s();break}case"immediate-click":{const r=un(t),n=this._intersect(r,t.pointerType,i.forEachTool);if(fae(t)||i.forEachTool(u=>{if((!M(n)||n.tool!==u||u.automaticManipulatorSelection)&&u.manipulators){let d=!1;u.manipulators.forEach(({manipulator:f})=>{f.selected&&(f.selected=!1,d=!0)}),d&&u.onManipulatorSelectionChanged&&u.onManipulatorSelectionChanged()}}),N(n))break;const{manipulator:o,tool:a}=n;if(!o.interactive)break;o.selectable&&a.automaticManipulatorSelection&&(o.selected=!o.selected,a.onManipulatorSelectionChanged&&a.onManipulatorSelectionChanged());const l=t.native.shiftKey;o.events.emit("immediate-click",{screenPoint:r,button:t.button,pointerType:t.pointerType,shiftKey:l,stopPropagation:s});break}case"click":{const r=un(t),n=this._intersect(r,t.pointerType,i.forEachTool),o=M(n)?n.manipulator:null;if(N(o)||!o.interactive)break;const a=t.native.shiftKey;o.events.emit(t.type,{screenPoint:r,button:t.button,pointerType:t.pointerType,shiftKey:a}),s();break}case"double-click":{const r=un(t),n=this._intersect(r,t.pointerType,i.forEachTool),o=M(n)?n.manipulator:null;if(N(o)||!o.interactive)break;const a=t.native.shiftKey;o.events.emit("double-click",{screenPoint:r,button:t.button,pointerType:t.pointerType,shiftKey:a,stopPropagation:s});break}case"immediate-double-click":{const r=un(t),n=this._intersect(r,t.pointerType,i.forEachTool),o=M(n)?n.manipulator:null;if(N(o)||!o.interactive)break;const a=t.native.shiftKey;o.events.emit("immediate-double-click",{screenPoint:r,button:t.button,pointerType:t.pointerType,shiftKey:a,stopPropagation:s});break}}this._onFocusChange(i.forEachTool)}_ungrabManipulatorBeforeDragging(t,i,s){t.grabbing=!1,t.events.emit("grab-changed",{action:"end",pointerType:i.pointerType,screenPoint:un(i)}),this._grabbedManipulators.forEach(({manipulator:r},n)=>{r===t&&this._grabbedManipulators.delete(n)}),this._afterManipulatorUngrab(s.setActiveTool)}_handlePointerEnd(t,i){const s=ja(this._grabbedManipulators.get(t.pointerId),({manipulator:r})=>r);N(s)||s.grabbing&&(s.grabbing=!1,s.events.emit("grab-changed",{action:"end",pointerType:t.pointerType,screenPoint:un(t)}),this._grabbedManipulators.delete(t.pointerId),this._afterManipulatorUngrab(i.setActiveTool))}_cursorFromMap(t){let i=null;return Zv(t,({manipulator:s})=>!(N(s)||!s.interactive)&&(s.grabbing&&s.grabCursor?(i=s.grabCursor,!0):!!s.cursor&&(i=s.cursor,!0))),i}_onFocusChange(t){this._updateCursor(),this._updateFocusedManipulatorTools(t)}_updateCursor(){this._grabbedManipulators.size>0?this._cursor=this._cursorFromMap(this._grabbedManipulators)||"grabbing":this._hoveredManipulators.size>0?this._cursor=this._cursorFromMap(this._hoveredManipulators)||"pointer":this._cursor=null}_updateFocusedManipulatorTools(t){const i=new Set,s=new Set;this._grabbedManipulators.forEach(({tool:r})=>{i.add(r)}),this._hoveredManipulators.forEach(({tool:r})=>{s.add(r)}),t(r=>{r.hasGrabbedManipulators=i.has(r),r.hasHoveredManipulators=s.has(r);const n=this._grabbedManipulators.values(),o=_7(n,({tool:a})=>a===r);r.firstGrabbedManipulator=M(o)?o.manipulator:null})}clearPointers(t,{forEachTool:i,setActiveTool:s},r=!0,n){const o=(a,l)=>a===t&&(N(n)||n===l);this._grabbedManipulators.forEach(({tool:a,manipulator:l,pointerType:u},d)=>{o(a,l)&&(this._grabbedManipulators.delete(d),l.grabbing=!1,l.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:u}))}),this._draggedManipulators.forEach(({tool:a,manipulator:l},u)=>{o(a,l)&&(this._draggedManipulators.delete(u),l.dragging=!1,l.events.emit("drag",{action:"cancel"}))}),r&&this._hoveredManipulators.forEach(({tool:a,manipulator:l},u)=>{o(a,l)&&(this._hoveredManipulators.delete(u),l.hovering=!1)}),this._afterManipulatorUngrab(s),this._onFocusChange(i)}_intersect(t,i,s){let r=null;return s(n=>{if(n.manipulators==null||!sM(n))return!1;const o=n.manipulators.intersect(t,i);return!N(o)&&(r={tool:n,manipulator:o},!0)}),r}updateHoveredStateFromKnownPointers(t){this._pointerLocations.forEach((i,s)=>{this._updateHoveredStateForPointerAtScreenPosition(ns(i.x,i.y),s,i.pointerType,t)})}handleHoverEvent(t,i){t.type!=="pointer-up"&&t.type!=="immediate-click"&&t.type!=="pointer-move"||!oA(t.pointerType)||this._updateHoveredStateForPointerAtScreenPosition(un(t),t.pointerId,t.pointerType,i)}_updateHoveredStateForPointerAtScreenPosition(t,i,s,r){let n=this._intersect(t,s,r);const o=ja(this._hoveredManipulators.get(i),({manipulator:a})=>a);M(n)&&!n.manipulator.interactive&&(n=null),M(n)&&o===n.manipulator||(M(o)&&(o.hovering=!1),M(n)?(n.manipulator.hovering=!0,this._hoveredManipulators.set(i,n)):this._hoveredManipulators.delete(i),this._onFocusChange(r))}_afterManipulatorUngrab(t){this._grabbedManipulators.size===0&&this._revertToNullActiveTool&&(t(null),this._revertToNullActiveTool=!1)}}function oA(e){return e==="mouse"}function aA(e){return e.pointerType!=="mouse"||e.button===0}function fae(e){return!!e.native.shiftKey}const lA="attached",Ow="tools";let ao=class extends yv{constructor(e){super(e),this._manipulatorState=new pae,this.tools=new he,this.cursor=null,this._forEachTool=t=>{for(const i of this.tools.items)if(t(i))return}}initialize(){this.handles.add([this.view.on(cj,e=>{this._handleInputEvent(e)},el.TOOL),...dae(this.tools),this.tools.on("before-add",({item:e})=>{this._updateToolEditableFlag(e)}),this.tools.on("before-remove",({item:e})=>{this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs),this._updateCursor()}),this.tools.on("change",()=>{this._refreshToolWatchers()})])}destroy(){this.detach(),this.handles.removeAll()}get _manipulatorStateEventArgs(){return{forEachTool:this._forEachTool,activeTool:this.activeTool,setActiveTool:e=>{this.activeTool=e},view:this.view}}set activeTool(e){if(M(e)&&!this.view.ready)return void q.getLogger(this.declaredClass).error("Cannot set active tool while view is not ready.");if(e===this.activeTool)return;const t=this.activeTool;this._set("activeTool",e),M(t)&&t.deactivate(),M(e)&&e.activate(),this._removeIncompleteTools(e);for(const i of this.tools){this._updateToolEditableFlag(i);const s=sM(i);!N(this.activeTool)&&s||this._manipulatorState.clearPointers(i,this._manipulatorStateEventArgs,!s)}this._updateCursor()}get updating(){var e,t;return this.updatingHandles.updating||this.tools.some(i=>i.updating)||((t=(e=this.textures)==null?void 0:e.updating)!=null?t:!1)}attach(){this.view.type==="3d"?(this._set("textures",new Hp(this.view._stage,this.view.resourceController.scheduler)),this.handles.add([Z(()=>{const{state:e}=this.view;return"camera"in e&&e.camera},()=>{this._forEachManipulator(e=>{e.onViewChange!=null&&e.onViewChange()})}),this.view.elevationProvider.on("elevation-change",e=>{this._forEachManipulator(t=>{t.onElevationChange!=null&&t.onElevationChange(e)})}),nd(()=>this._set("textures",$t(this.textures)))],lA)):this.handles.add(Z(()=>this.view.extent,()=>{this._forEachManipulator(e=>{e.onViewChange!=null&&e.onViewChange()})}))}detach(){M(this.activeTool)&&(this.activeTool=null),this.tools.removeAll(),this.handles.remove(lA)}_forEachManipulator(e){this._forEachTool(t=>{t.manipulators&&t.manipulators.forEach(({manipulator:i})=>e(i,t))})}_handleInputEvent(e){let t=!1;const i={...e,stopPropagation:()=>{t=!0,e.stopPropagation()}};M(this.activeTool)?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(i):this._forEachTool(s=>{!t&&s.visible&&s.handleInputEvent(i)}),!t&&e.type==="key-down"&&e.key==="Escape"&&this.activeTool&&(e.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(i,this._manipulatorStateEventArgs),!t&&M(this.activeTool)&&this.activeTool.handleInputEventAfter(i),this._manipulatorState.handleHoverEvent(i,this._forEachTool),this._updateCursor()}_refreshToolWatchers(){this.handles.remove(Ow),this._forEachTool(e=>{if(e instanceof oe){const t=Z(()=>[e.cursor,e.visible,e.editable],()=>{sM(e)||this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs),this._updateCursor()});this.handles.add(t,Ow)}e.manipulators&&this.handles.add([e.manipulators.on("after-remove",t=>{this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs,!0,t.item.manipulator)}),e.manipulators.on("change",()=>{this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()})],Ow)}),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateToolEditableFlag(e){e.setEditableFlag(pm.MANAGER,N(this.activeTool)||e===this.activeTool)}_updateCursor(){let e=this._manipulatorState.cursor;N(e)&&this._forEachTool(t=>!(!M(t.cursor)||!t.visible)&&(e=t.cursor,!0)),this._get("cursor")!==e&&this._set("cursor",e)}_removeIncompleteTools(e){this.tools.filter(t=>(N(e)||t!==e)&&!t.created&&t.removeIncompleteOnCancel).forEach(t=>{this.tools.remove(t)})}};c([h({constructOnly:!0,nonNullable:!0})],ao.prototype,"view",void 0),c([h({readOnly:!0,nonNullable:!0})],ao.prototype,"textures",void 0),c([h({value:null})],ao.prototype,"activeTool",null),c([h({readOnly:!0,type:he})],ao.prototype,"tools",void 0),c([h({readOnly:!0})],ao.prototype,"cursor",void 0),c([h({readOnly:!0})],ao.prototype,"updating",null),ao=c([S("esri.views.ToolViewManager")],ao);const mae=ao;let nh=class extends oe{constructor(e){super(),this.nativeIndex=null,this._detectedDeviceType="unknown",e.mapping==="standard"?this._detectedDeviceType="standard":yae.test(e.id)?this._detectedDeviceType="spacemouse":this._detectedDeviceType="unknown",this.nativeIndex=e.index}get native(){const e=navigator.getGamepads?navigator.getGamepads():[];return this.nativeIndex!=null&&this.nativeIndeximport("./geometryServiceUtils.88d2a7a3.js"),[]).then(t=>rM=t)),await Rw,Ft(e)}async function vj(e,t,i,s){if(!e)return null;const r=e.spatialReference;return ol()||Ro(r,t)?hd(e,t):rM?rM.projectGeometry(e,t,i,s):(await Promise.race([Mae(s),al(s)]),vj(e,t,i,s))}let We=class extends oe{constructor(e){super(e),this.required={tileInfo:!1,heightModelInfo:!1,extent:!1},this.defaultSpatialReference=null,this.userSpatialReference=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.suspended=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=k0(this._projectExtentTask.task)),this._set("map",null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return M(this.userSpatialReference)?this.userSpatialReference:this._spatialReferenceTask.spatialReference}get extent(){return this._extentTask.extent}get heightModelInfo(){return this._heightModelInfoTask.heightModelInfo}get vcsWkid(){return this._heightModelInfoTask.vcsWkid}get latestVcsWkid(){return this._heightModelInfoTask.latestVcsWkid}get viewingMode(){return N(this.userSpatialReference)||this.userSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){var i,s,r,n;const e=(i=this.map)==null?void 0:i.call(this),t=[];return M(this.priorityCollection)&&t.push(this.priorityCollection),t.push({parent:e==null?void 0:e.basemap,layers:(s=e==null?void 0:e.basemap)==null?void 0:s.baseLayers},{layers:e==null?void 0:e.layers},{parent:e==null?void 0:e.ground,layers:(r=e==null?void 0:e.ground)==null?void 0:r.layers},{parent:e==null?void 0:e.basemap,layers:(n=e==null?void 0:e.basemap)==null?void 0:n.referenceLayers}),t}get _allLayers(){return this._collectLayers(this.mapCollections)}get _spatialReferenceTask(){var r;if(this.suspended)return(r=this._get("_spatialReferenceTask"))!=null?r:{updating:!1};const{layers:e,updating:t}=this._allLayers;let i=null;for(const n of e){const o=this._getSupportedSpatialReferences(n);if(o.length>0){const a=this._narrowDownSpatialReferenceCandidates(i,o);M(a)&&(i=a)}if(M(i)&&i.length===1)break}if(t&&(N(i)||i.length!==1))return{updating:!0};const s=this._pickSpatialReferenceCandidate(i);return{spatialReference:M(s)?s.spatialReference:null,viewingMode:M(s)?s.viewingMode:null,updating:!1}}get _tileInfoTask(){var i,s,r,n,o,a,l,u;if(!this.required.tileInfo)return(i=this._get("_tileInfoTask"))!=null?i:{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const{layers:e,updating:t}=this._collectLayers([{parent:(r=(s=this.map)==null?void 0:s.call(this))==null?void 0:r.basemap,layers:(a=(o=(n=this.map)==null?void 0:n.call(this))==null?void 0:o.basemap)==null?void 0:a.baseLayers},{layers:(u=(l=this.map)==null?void 0:l.call(this))==null?void 0:u.layers}]);if(e&&e.length>0&&"tileInfo"in e[0]){const d=e[0].tileInfo;return{tileInfo:d&&d.spatialReference.equals(this.spatialReference)?d:null,updating:!1}}return{updating:t}}get _heightModelInfoTask(){var i,s,r,n;if(!this.required.heightModelInfo||this.suspended&&((i=this._get("_heightModelInfoTask"))==null?void 0:i.heightModelInfo))return(s=this._get("_heightModelInfoTask"))!=null?s:{updating:!1};const{layers:e,updating:t}=this._allLayers;for(const o of e)if(xae(o)){const a=_ae(o);if(a)return{heightModelInfo:a,vcsWkid:(r=o.spatialReference)==null?void 0:r.vcsWkid,latestVcsWkid:(n=o.spatialReference)==null?void 0:n.latestVcsWkid,updating:!1}}return{updating:t}}get _extentCandidatesTask(){var s,r;if(this.suspended||!this.required.extent)return(s=this._get("_extentCandidatesTask"))!=null?s:{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const e=this._allLayers,t=e.updating,i=[];for(const n of e.layers){const o="fullExtents"in n&&n.fullExtents||(M(n.fullExtent)?[n.fullExtent]:[]),a=this.requiresExtentInSpatialReference?null:o[0],l=(r=o.find(u=>u.spatialReference.equals(this.spatialReference)))!=null?r:a;if(l)return{candidates:[{extent:l,layer:n}],updating:!1};if(this._getSupportedSpatialReferences(n).length>0)for(const u of o)i.push({extent:u,layer:n})}return{candidates:i,updating:t}}get _extentTask(){const{candidates:e,updating:t}=this._extentCandidatesTask;if(t)return{updating:t};if(N(e)||e.length===0)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const i=this._pickExtentCandidate(e),s=this.spatialReference;return i.extent.equals(this._projectExtentTask.input)&&s.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:M(this._projectExtentTask.task)&&!this._projectExtentTask.task.finished}:(M(this._projectExtentTask.task)&&(this._projectExtentTask.task=k0(this._projectExtentTask.task)),this._projectExtentTask={input:i.extent.clone(),output:null,spatialReference:s.clone(),task:pD(async r=>{try{const n=await vj(i.extent,s,i.layer.portalItem,r);this._projectExtentTask={...this._projectExtentTask,task:null,output:n}}catch{if(jr(r))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(e,t){if(N(e))return t;const i=[],s=(r,n)=>M(r)?M(n)?r===n&&r:r:n;for(const r of e)for(const n of t){if(!r.spatialReference.equals(n.spatialReference))continue;const o=s(r.viewingMode,n.viewingMode);if(o!==!1){i.push({spatialReference:r.spatialReference,viewingMode:o});break}}return i.length>0?i:null}_pickSpatialReferenceCandidate(e){const t=this.defaultSpatialReference;return N(e)||e.length<1?M(t)?{spatialReference:t,viewingMode:null}:null:(M(t)&&e.length>1&&e.some(({spatialReference:i})=>i.equals(t))&&(e=e.filter(({spatialReference:i})=>i.equals(t))),e.length>1&&e.some(({viewingMode:i})=>i!==Rv.Local)&&(e=e.filter(({viewingMode:i})=>i!==Rv.Local)),e[0])}_getSupportedSpatialReferences(e){const t="supportedSpatialReferences"in e&&e.supportedSpatialReferences||(e.spatialReference?[e.spatialReference]:[]);if(t.length===0)return[];const i=[];for(const s of t){const r=this.getSpatialReferenceSupport({spatialReference:s,layer:e});if(M(r)){const n=M(r.constraints)?r.constraints:[{spatialReference:s,viewingMode:null}];for(const{spatialReference:o,viewingMode:a}of n)(!this.requiresExtentInSpatialReference||N(this.userSpatialReference)||o.equals(this.userSpatialReference))&&i.push({spatialReference:o,viewingMode:a})}}return i}_pickExtentCandidate(e){const t=this.spatialReference;return e.find(({extent:i})=>t.equals(i.spatialReference))||e[0]}_collectLayers(e){var i;if(this._loadMaybe((i=this.map)==null?void 0:i.call(this))!=="loaded")return{layers:[],updating:!0};const t={layers:[],preloading:-1,updating:!1};for(const s of e)if(this._collectCollection(s,t),t.preloading===this.sourcePreloadCount)break;return{layers:t.layers,updating:t.updating}}_collectCollection(e,t){if(e.layers){switch(this._loadMaybe(e.parent)){case"loading":return t.updating=!0,void++t.preloading;case"failed":return}for(const i of e.layers){switch(this._loadMaybe(i)){case"failed":continue;case"loading":t.updating=!0,++t.preloading;break;case"loaded":t.updating||t.layers.push(i),"layers"in i&&this._collectCollection({layers:i.layers},t)}if(t.preloading===this.sourcePreloadCount)break}}}_loadMaybe(e){return e&&"loadStatus"in e?e.loadStatus==="not-loaded"?(e.load().catch(()=>{}),"loading"):e.loadStatus:"loaded"}};c([h()],We.prototype,"required",void 0),c([h({constructOnly:!0})],We.prototype,"map",void 0),c([h({constructOnly:!0})],We.prototype,"getSpatialReferenceSupport",void 0),c([h()],We.prototype,"defaultSpatialReference",void 0),c([h()],We.prototype,"userSpatialReference",void 0),c([h()],We.prototype,"sourcePreloadCount",void 0),c([h()],We.prototype,"priorityCollection",void 0),c([h()],We.prototype,"requiresExtentInSpatialReference",void 0),c([h()],We.prototype,"suspended",void 0),c([h({readOnly:!0})],We.prototype,"ready",null),c([h({readOnly:!0})],We.prototype,"heightModelInfoReady",null),c([h({readOnly:!0})],We.prototype,"spatialReference",null),c([h({readOnly:!0})],We.prototype,"extent",null),c([h({readOnly:!0})],We.prototype,"heightModelInfo",null),c([h({readOnly:!0})],We.prototype,"vcsWkid",null),c([h({readOnly:!0})],We.prototype,"latestVcsWkid",null),c([h({readOnly:!0})],We.prototype,"viewingMode",null),c([h({readOnly:!0})],We.prototype,"tileInfo",null),c([h({readOnly:!0})],We.prototype,"mapCollections",null),c([h({readOnly:!0})],We.prototype,"_allLayers",null),c([h({readOnly:!0})],We.prototype,"_spatialReferenceTask",null),c([h({readOnly:!0})],We.prototype,"_tileInfoTask",null),c([h({readOnly:!0})],We.prototype,"_heightModelInfoTask",null),c([h({readOnly:!0})],We.prototype,"_extentCandidatesTask",null),c([h()],We.prototype,"_extentTask",null),c([h()],We.prototype,"_projectExtentTask",void 0),We=c([S("esri.views.support.DefaultsFromMap")],We);var p0;let fe=p0=class extends pu(jo.EventedMixin(cb(oe))){constructor(e){super(e),this._userSpatialReference=null,this._cursor=null,this.allLayerViews=new im({getCollections:()=>{var t,i,s;return[(t=this.basemapView)==null?void 0:t.baseLayerViews,(i=this.groundView)==null?void 0:i.layerViews,this.layerViews,(s=this.basemapView)==null?void 0:s.referenceLayerViews]},getChildrenFunction:t=>t.layerViews}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new qc,this.analyses=new Ov,this.typeSpecificPreconditionsReady=!0,this.layerViews=new he,this.magnifier=new aj,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new bae,this.navigation=new fj,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new uae(this),this.persistableViewModels=new he,this._isValid=!1,this._readyCycleForced=!1,this.handles.add(Z(()=>this.preconditionsReady,t=>{var i,s;t?(this._currentSpatialReference=this.spatialReference,p0.views.add(this)):(this._currentSpatialReference=null,p0.views.remove(this)),this.notifyChange("spatialReference"),!t&&this.ready?((i=this.toolViewManager)==null||i.detach(),M(this.analysisViewManager)&&this.analysisViewManager.detach(),(s=this.layerViewManager)==null||s.clear(),this._teardown()):t&&!this.ready&&(this._startup(),M(this.analysisViewManager)&&this.analysisViewManager.attach(),this.toolViewManager.attach())},Nh))}initialize(){this.addResolvingPromise(this.validate().then(()=>(this._isValid=!0,ub(()=>this.ready)))),this.basemapView=new Ma({view:this}),this.layerViewManager=new rae({view:this,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new mae({view:this}),this._setupSpatialReferenceLogger(),this.handles.add([Z(()=>this.initialExtentRequired,e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e},{sync:!0,initial:!0}),Z(()=>this.ready,e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)},{sync:!0}),Z(()=>this._userSpatialReference,e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)},{sync:!0,initial:!0})])}_setupSpatialReferenceLogger(){let e=null;this.handles.add([Z(()=>{var t;return(t=this.defaultsFromMap)==null?void 0:t.ready},t=>{var s;const i=((s=this.map)==null?void 0:s.allLayers.length)>0;if(t&&!this.spatialReference&&i){if(M(e))return;const r=nd(()=>e=k0(e));e=pD(async n=>{try{await nb(this.spatialReferenceWarningDelay,null,n)}catch{return}finally{e=null}q.getLogger(this.declaredClass).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),this.handles.add(r,"spatial-reference-logger-task")}else this.handles.remove("spatial-reference-logger-task")},{sync:!0})])}destroy(){if(this.destroyed)return;this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=$t(this.graphics),this.analyses=$t(this.analyses),this.handles.remove("defaultsFromMap"),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),$t(this.analysisViewManager),this.toolViewManager=$t(this.toolViewManager),this.layerViewManager=$t(this.layerViewManager),this.basemapView=$t(this.basemapView),this.invalidate(),this._emitter.clear(),this.handles.removeAll();const e=this.map;this.map=null,e==null||e.destroy()}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return q.getLogger(this.declaredClass).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){var e;return(e=this.toolViewManager)==null?void 0:e.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get _defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new We({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:e=>this.getSpatialReferenceSupport(e),...this._defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){var e;return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||Lo.isLoadable(this.map)&&!this.map.loaded||this.width===0||this.height===0||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._currentSpatialReference&&!((e=this.defaultsFromMap)!=null&&e.ready)||!this.typeSpecificPreconditionsReady)}set map(e){e!==this._get("map")&&(e!=null&&e.destroyed&&(q.getLogger(this.declaredClass).warn("#map","The provided map is already destroyed",{map:e}),e=null),Lo.isLoadable(e)&&e.load().catch(()=>{}),this.constructed&&(this.forceReadyCycle(),this._currentSpatialReference=null),this._set("map",e))}get spatialReference(){var t,i;let e=this._userSpatialReference||this._currentSpatialReference||this.getDefaultSpatialReference()||null;return e&&((i=(t=this.defaultsFromMap)==null?void 0:t.required)==null?void 0:i.heightModelInfo)&&(e=e.clone(),e.vcsWkid=this.defaultsFromMap.vcsWkid,e.latestVcsWkid=this.defaultsFromMap.latestVcsWkid),e}set spatialReference(e){const t=!Kt(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get tools(){var e;return(e=this.toolViewManager)==null?void 0:e.tools}get initialExtent(){var e;return(e=this.defaultsFromMap)==null?void 0:e.extent}get cursor(){const e=this.toolViewManager?this.toolViewManager.cursor:null;return M(e)?e:this._cursor||"default"}set cursor(e){this._cursor=e,this.notifyChange("cursor")}get size(){return[this.width,this.height]}whenLayerView(e){return this.layerViewManager.whenLayerView(e)}getDefaultSpatialReference(){var e;return(e=this.defaultsFromMap)==null?void 0:e.spatialReference}getDefaultHeightModelInfo(){var e,t,i;return(i=(t=this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)!=null?t:(e=this.defaultsFromMap)==null?void 0:e.heightModelInfo)!=null?i:null}importLayerView(e){throw new L("importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return M(this.getSpatialReferenceSupport({spatialReference:e}))}when(e,t){return this.isResolved()&&!this.ready&&q.getLogger(this.declaredClass).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(Qs(()=>this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}};fe.views=new he,c([h()],fe.prototype,"_userSpatialReference",void 0),c([h()],fe.prototype,"activeTool",null),c([h({readOnly:!0})],fe.prototype,"allLayerViews",void 0),c([h()],fe.prototype,"groundView",void 0),c([h()],fe.prototype,"animation",null),c([h()],fe.prototype,"basemapView",void 0),c([h({readOnly:!0})],fe.prototype,"_defaultsFromMapSettings",null),c([h()],fe.prototype,"defaultsFromMap",null),c([h()],fe.prototype,"fatalError",void 0),c([h({type:Ze})],fe.prototype,"extent",null),c([h(nx(qc,"graphics"))],fe.prototype,"graphics",void 0),c([h(nx(Ov,"analyses"))],fe.prototype,"analyses",void 0),c([h({readOnly:!0,type:Qb})],fe.prototype,"heightModelInfo",null),c([h({readOnly:!0})],fe.prototype,"interacting",null),c([h({readOnly:!0})],fe.prototype,"navigating",null),c([h({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_currentSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],fe.prototype,"preconditionsReady",null),c([h({readOnly:!0})],fe.prototype,"typeSpecificPreconditionsReady",void 0),c([h({type:he,readOnly:!0})],fe.prototype,"layerViews",void 0),c([h({type:aj})],fe.prototype,"magnifier",void 0),c([h({value:null,type:PN})],fe.prototype,"map",null),c([h()],fe.prototype,"padding",void 0),c([h({readOnly:!0})],fe.prototype,"ready",void 0),c([h({type:xe})],fe.prototype,"spatialReference",null),c([h()],fe.prototype,"spatialReferenceWarningDelay",void 0),c([h()],fe.prototype,"stationary",null),c([h({readOnly:!0})],fe.prototype,"supportsGround",void 0),c([h({type:Ln})],fe.prototype,"timeExtent",void 0),c([h()],fe.prototype,"tools",null),c([h()],fe.prototype,"toolViewManager",void 0),c([h({readOnly:!0})],fe.prototype,"type",void 0),c([h({type:Number})],fe.prototype,"scale",void 0),c([h({readOnly:!0})],fe.prototype,"updating",void 0),c([h({readOnly:!0})],fe.prototype,"initialExtentRequired",void 0),c([h({readOnly:!0})],fe.prototype,"initialExtent",null),c([h()],fe.prototype,"cursor",null),c([h({readOnly:!0})],fe.prototype,"input",void 0),c([h({type:fj,nonNullable:!0})],fe.prototype,"navigation",void 0),c([h()],fe.prototype,"layerViewManager",void 0),c([h()],fe.prototype,"analysisViewManager",void 0),c([h()],fe.prototype,"width",void 0),c([h()],fe.prototype,"height",void 0),c([h({readOnly:!0})],fe.prototype,"resizing",void 0),c([h({value:null,readOnly:!0})],fe.prototype,"size",null),c([h({readOnly:!0})],fe.prototype,"suspended",void 0),c([h({readOnly:!0})],fe.prototype,"viewEvents",void 0),c([h({readOnly:!0})],fe.prototype,"persistableViewModels",void 0),c([h()],fe.prototype,"_isValid",void 0),c([h()],fe.prototype,"_readyCycleForced",void 0),c([h()],fe.prototype,"_currentSpatialReference",void 0),fe=p0=c([S("esri.views.View")],fe);const $ae=fe;let Ta=class extends J0{constructor(e){super(e),this.state="running",this.target=null,this._dfd=null}initialize(){this.addResolvingPromise(new Promise((e,t)=>this._dfd={resolve:e,reject:t}))}get done(){return this.state==="finished"||this.state==="stopped"}stop(){var e;this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","stopped"),(e=this._dfd)==null||e.reject(new L("ViewAnimation stopped")))}finish(){var e;this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","finished"),(e=this._dfd)==null||e.resolve())}update(e,t){t||(t=No(e)?"waiting-for-target":"running"),this._set("target",e),this._set("state",t)}};c([h({readOnly:!0})],Ta.prototype,"done",null),c([h({readOnly:!0,type:String})],Ta.prototype,"state",void 0),c([h()],Ta.prototype,"target",void 0),Ta=c([S("esri.views.ViewAnimation")],Ta),function(e){e.State={RUNNING:"running",STOPPED:"stopped",FINISHED:"finished",WAITING_FOR_TARGET:"waiting-for-target"}}(Ta||(Ta={}));const nM=Ta;function Sc(e,t,i,s){const r=3*e,n=3*(i-e)-r,o=1-r-n,a=3*t,l=3*(s-t)-a,u=1-a-l;function d(g){return((o*g+n)*g+r)*g}function f(g){return((u*g+l)*g+a)*g}function m(g){return(3*o*g+2*n)*g+r}function y(g,v){let b,_,x,$,I,T;for(x=g,T=0;T<8;T++){if($=d(x)-g,Math.abs($)_)return _;for(;b<_;){if($=d(x),Math.abs($-g)$?b=x:_=x,x=.5*(_-b)+b}return x}return function(g,v=1e-6){return f(y(g,v))}}const Tae=/^cubic-bezier\((.*)\)/,Ws={};function Iae(e){let t=Ws[e]||null;if(!t){const i=Tae.exec(e);if(i){const s=i[1].split(",").map(r=>parseFloat(r.trim()));s.length!==4||s.some(r=>isNaN(r))||(t=Sc.apply(Sc,s))}}return t}Ws.ease=Sc(.25,.1,.25,1),Ws.linear=Sc(0,0,1,1),Ws.easeIn=Ws["ease-in"]=Sc(.42,0,1,1),Ws.easeOut=Ws["ease-out"]=Sc(0,0,.58,1),Ws.easeInOut=Ws["ease-in-out"]=Sc(.42,0,.58,1);function tl(){return[1,0,0,1,0,0]}function Eae(e){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function kae(e,t,i,s,r,n){return[e,t,i,s,r,n]}function Cae(e,t){return new Float64Array(e,t,6)}Object.freeze(Object.defineProperty({__proto__:null,create:tl,clone:Eae,fromValues:kae,createView:Cae},Symbol.toStringTag,{value:"Module"}));function fm(e,t){return e[0]=t[0],e[1]=t[1],e}function ai(e,t,i){return e[0]=t,e[1]=i,e}function bj(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e}function mm(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e}function _j(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e}function wj(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e}function Pae(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}function Aae(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}function Oae(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e}function Rae(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e}function Lae(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}function Hm(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e}function Fae(e,t,i,s){return e[0]=t[0]+i[0]*s,e[1]=t[1]+i[1]*s,e}function Ym(e,t){const i=t[0]-e[0],s=t[1]-e[1];return Math.sqrt(i*i+s*s)}function Lv(e,t){const i=t[0]-e[0],s=t[1]-e[1];return i*i+s*s}function Fv(e){const t=e[0],i=e[1];return Math.sqrt(t*t+i*i)}function xj(e){const t=e[0],i=e[1];return t*t+i*i}function Sj(e,t){return e[0]=-t[0],e[1]=-t[1],e}function Dae(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}function oM(e,t){const i=t[0],s=t[1];let r=i*i+s*s;return r>0&&(r=1/Math.sqrt(r),e[0]=t[0]*r,e[1]=t[1]*r),e}function Mj(e,t){return e[0]*t[0]+e[1]*t[1]}function $j(e,t,i){const s=t[0]*i[1]-t[1]*i[0];return e[0]=e[1]=0,e[2]=s,e}function Nae(e,t,i,s){const r=t[0],n=t[1];return e[0]=r+s*(i[0]-r),e[1]=n+s*(i[1]-n),e}function jae(e,t){t=t||1;const i=2*mb()*Math.PI;return e[0]=Math.cos(i)*t,e[1]=Math.sin(i)*t,e}function Vae(e,t,i){const s=t[0],r=t[1];return e[0]=i[0]*s+i[2]*r,e[1]=i[1]*s+i[3]*r,e}function bn(e,t,i){const s=t[0],r=t[1];return e[0]=i[0]*s+i[2]*r+i[4],e[1]=i[1]*s+i[3]*r+i[5],e}function zae(e,t,i){const s=t[0],r=t[1];return e[0]=i[0]*s+i[3]*r+i[6],e[1]=i[1]*s+i[4]*r+i[7],e}function Bae(e,t,i){const s=t[0],r=t[1];return e[0]=i[0]*s+i[4]*r+i[12],e[1]=i[1]*s+i[5]*r+i[13],e}function Uae(e,t,i,s){const r=t[0]-i[0],n=t[1]-i[1],o=Math.sin(s),a=Math.cos(s);return e[0]=r*a-n*o+i[0],e[1]=r*o+n*a+i[1],e}function qae(e,t){const i=e[0],s=e[1],r=t[0],n=t[1];let o=i*i+s*s;o>0&&(o=1/Math.sqrt(o));let a=r*r+n*n;a>0&&(a=1/Math.sqrt(a));const l=(i*r+s*n)*o*a;return l>1?0:l<-1?Math.PI:Math.acos(l)}function Gae(e){return"vec2("+e[0]+", "+e[1]+")"}function Wae(e,t){return e[0]===t[0]&&e[1]===t[1]}function Hae(e,t){const i=e[0],s=e[1],r=t[0],n=t[1],o=er();return Math.abs(i-r)<=o*Math.max(1,Math.abs(i),Math.abs(r))&&Math.abs(s-n)<=o*Math.max(1,Math.abs(s),Math.abs(n))}function Yae(e,t,i,s,r){let n=t[0]-i[0],o=t[1]-i[1];const a=(s[0]*n+s[1]*o)*(r-1);return n=s[0]*a,o=s[1]*a,e[0]=t[0]+n,e[1]=t[1]+o,e}const Jae=Fv,QT=mm,Xae=_j,Zae=wj,Qae=Ym,Kae=Lv,ele=xj;Object.freeze(Object.defineProperty({__proto__:null,copy:fm,set:ai,add:bj,subtract:mm,multiply:_j,divide:wj,ceil:Pae,floor:Aae,min:Oae,max:Rae,round:Lae,scale:Hm,scaleAndAdd:Fae,distance:Ym,squaredDistance:Lv,length:Fv,squaredLength:xj,negate:Sj,inverse:Dae,normalize:oM,dot:Mj,cross:$j,lerp:Nae,random:jae,transformMat2:Vae,transformMat2d:bn,transformMat3:zae,transformMat4:Bae,rotate:Uae,angle:qae,str:Gae,exactEquals:Wae,equals:Hae,projectAndScale:Yae,len:Jae,sub:QT,mul:Xae,div:Zae,dist:Qae,sqrDist:Kae,sqrLen:ele},Symbol.toStringTag,{value:"Module"}));function Et(){return[0,0]}function tle(e){return[e[0],e[1]]}function Jm(e,t){return[e,t]}function ile(e){const t=Et(),i=Math.min(2,e.length);for(let s=0;s"attributes"in d),l=e.some(d=>!d.geometry);let u=e;if(a&&l&&t&&t.allLayerViews){const d=new Map;for(const g of e){const v=g.layer,b=d.get(v)||[],_=g.attributes[v.objectIdField];_!=null&&b.push(_),d.set(v,b)}const f=[];d.forEach((g,v)=>{const b=t.allLayerViews.find(_=>_.layer.id===v.id);if("queryFeatures"in b){const _=v.createQuery();_.objectIds=g,_.returnGeometry=!0,f.push(b.queryFeatures(_))}});const m=await Promise.all(f),y=[];for(const g of m)if(g&&g.features&&g.features.length)for(const v of g.features)M(v.geometry)&&y.push(v.geometry);u=y}for(const d of u)s=await Jp(d,t,i,s);return s}if(Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number")r=new be(e);else if(e instanceof fl)r=e;else if("geometry"in e){if(e.geometry)r=e.geometry;else if(e.layer){const a=e.layer,l=t.allLayerViews.find(u=>u.layer.id===a.id);if("queryFeatures"in l){const u=a.createQuery();u.objectIds=[e.attributes[a.objectIdField]],u.returnGeometry=!0;const d=await l.queryFeatures(u);r=w3(d,"features",0,"geometry")}}}if(N(r)||(n=r.type==="point"?new Ze({xmin:r.x,ymin:r.y,xmax:r.x,ymax:r.y,spatialReference:r.spatialReference}):r.extent,!n))return null;ol()||Ro(n.spatialReference,i)||await al();const o=hd(n,i);return o?s=s?s.union(o):o:null}function cle(e){if(e&&(!Array.isArray(e)||typeof e[0]!="number")&&(typeof e=="object"||Array.isArray(e)&&typeof e[0]=="object")){if("layer"in e&&e.layer&&e.layer.minScale&&e.layer.maxScale){const t=e.layer;return{min:t.minScale,max:t.maxScale}}if(Array.isArray(e)&&e.length&&e.every(t=>"layer"in t)){let t=0,i=0;for(const s of e){const r=s.layer;r&&r.minScale&&r.maxScale&&(t=r.minScalei?r.maxScale:i)}return t&&i?{min:t,max:i}:null}}}function Lw(e,t){return Kt(Aj(e),t)?e:hd(e,t)}async function ule(e,t){if(!e||!t)return new Mn({targetGeometry:new be,scale:0,rotation:0});let i=t.spatialReference;const{constraints:s,padding:r,viewpoint:n,size:o}=t,a=[r?o[0]-r.left-r.right:o[0],r?o[1]-r.top-r.bottom:o[1]];let l=null;e instanceof Mn?l=e:e.viewpoint?l=e.viewpoint:e.target&&e.target.declaredClass==="esri.Viewpoint"&&(l=e.target);let u=null;l&&l.targetGeometry?u=l.targetGeometry:e instanceof Ze?u=e:(e||e&&("center"in e||"extent"in e||"target"in e))&&(u=await Jp(e.center,t,i)||await Jp(e.extent,t,i)||await Jp(e.target,t,i)||await Jp(e,t,i)),!u&&n&&n.targetGeometry?u=n.targetGeometry:!u&&t.extent&&(u=t.extent),i||(i=Aj(t.spatialReference||t.extent||u)),ol()||Kt(u.spatialReference,i)||Ro(u,i)||await al();const d=Lw(u.center?u.center:u,i);let f=null;if(l&&M(l.targetGeometry)&&l.targetGeometry.type==="point")f=l.scale;else if("scale"in e&&e.scale)f=e.scale;else if("zoom"in e&&e.zoom!==-1&&s&&s.effectiveLODs)f=s.zoomToScale(e.zoom);else if(Array.isArray(u)||u.type==="point"||u.type==="extent"&&u.width===0&&u.height===0){const v=Lw(t.extent,i);f=M(v)?Ef(v,a):t.extent?Ef(t.extent,a):n.scale}else f=Ef(Lw(u.extent,i),a);const m=cle(e);m&&(m.min&&m.min>f?f=m.min:m.max&&m.max180?this.dRotation-=360:this.dRotation<-180&&(this.dRotation+=360)}applyRatio(t,i){const s=this.easing(i);let r,n,o,a;i>=1?(r=this.tCenterX,n=this.tCenterY,o=this.tRotation,a=this.tScale):(r=this.sCenterX+s*this.dCenterX,n=this.sCenterY+s*this.dCenterY,o=this.sRotation+s*this.dRotation,a=this.sScale+s*this.dScale),t.targetGeometry.x=r,t.targetGeometry.y=n,t.scale=a,t.rotation=o}}let lo=class extends oe{constructor(e){super(e),this.duration=200,this.transition=null,this.easing=Ws.ease,this.view=null,this.viewpoint=null,this.viewpoint=new Mn({targetGeometry:new be,scale:0,rotation:0}),this._updateTask=Dh({postRender:this._postRender.bind(this)}),this._updateTask.pause()}destroy(){this._updateTask.remove(),this._updateTask=null}animate(e,t,i){this.stop();const s=this.viewpoint;qr(s,t),this.transition=new Ile(this.viewpoint,e.target,i&&i.duration||this.duration,i&&i.easing||this.easing);const r=()=>{this.animation===e&&this._updateTask&&(e.state==="finished"&&(this.transition.applyRatio(this.viewpoint,1),this.view.state&&(this.view.state.viewpoint=this.viewpoint.clone())),this.animation=null,this.updateFunction=null)};return e.when(r,r),this._startTime=performance.now(),this._updateTask.resume(),this.animation=e,e}animateContinous(e,t){this.stop(),this.updateFunction=t,this.viewpoint=e;const i=new nM({target:e.clone()}),s=()=>{this.animation===i&&this._updateTask&&(this.animation=null,this.updateFunction=null)};return i.when(s,s),this._startTime=performance.now(),this._updateTask.resume(),this.animation=i,i}stop(){this.animation&&(this.animation.stop(),this.animation=null,this.updateFunction=null)}_postRender(e){const t=this.animation;if(t&&t.state!==nM.State.STOPPED){if(this.updateFunction)this.updateFunction(this.viewpoint,e.deltaTime);else{const i=(performance.now()-this._startTime)/this.transition.duration,s=i>=1;this.transition.applyRatio(this.viewpoint,i),s&&this.animation.finish()}this.view.state&&(this.view.state.viewpoint=this.viewpoint.clone())}else this._updateTask.pause()}};c([h()],lo.prototype,"animation",void 0),c([h()],lo.prototype,"duration",void 0),c([h()],lo.prototype,"transition",void 0),c([h()],lo.prototype,"easing",void 0),c([h()],lo.prototype,"view",void 0),c([h()],lo.prototype,"viewpoint",void 0),lo=c([S("esri.views.2d.AnimationManager")],lo);const Ele=lo;class kle{constructor(t){this.view=t,this._frameTaskHandle=null,this._updateRequested=!1,this.stationary=!0,this.animationInProgress=!1,this.prepare=()=>{this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions},this.update=()=>{this._updateRequested=!1;const{basemapView:i,graphicsView:s,labelManager:r,layerViews:n,state:{id:o}}=this.view;i.baseLayerViews.forEach(this._updateLayerView,this),n.forEach(this._updateLayerView,this),i.referenceLayerViews.forEach(this._updateLayerView,this),M(r)&&(r.lastUpdateId!==o&&(r.viewChange(),r.lastUpdateId=o),r.updateRequested&&r.processUpdate(this._updateParameters)),M(s)&&(s.lastUpdateId!==o&&(s.viewChange(),s.lastUpdateId=o),s.updateRequested&&s.processUpdate(this._updateParameters)),this.view.graphicsTileStore.setViewState(this._updateParameters.state),this.animationInProgress||this._updateRequested||this._frameTaskHandle.pause()}}destroy(){this.stop()}start(){if(this._frameTaskHandle)return;const t=this.view;this.stationary=t.stationary,this._updateParameters={state:t.state,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:t.renderingOptions},this._stationaryHandle=Z(()=>t.stationary,i=>{this.stationary=i,this.requestFrame()}),this._frameTaskHandle=Dh(this),this.requestUpdate()}stop(){this._frameTaskHandle&&(this._updateRequested=!1,this._stationaryHandle.remove(),this._frameTaskHandle.remove(),this._updateParameters=this._stationaryHandle=this._frameTaskHandle=null,this.stationary=!0,this.animationInProgress=!1)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(t){const i=this.view.state,s=t.lastUpdateId;s!=null&&(this.stationary||t.moving)||(t.moving=!0,t.moveStart()),s!==i.id&&t.viewChange(),this.stationary&&t.moving&&(t.moving=!1,t.moveEnd()),t.lastUpdateId=i.id,t.updateRequested&&t.processUpdate(this._updateParameters),"layerViews"in t&&t.layerViews.forEach(this._updateLayerView,this)}}function Vt(){return Promise.all([z(()=>import("./webglDeps.a00b541b.js"),["assets/webglDeps.a00b541b.js","assets/VertexArrayObject.a4c1d809.js","assets/Texture.4c97bad5.js","assets/enums.2d9e6f64.js","assets/ProgramTemplate.e9a5aa54.js","assets/programUtils.956e69db.js"]),z(()=>import("./mapViewDeps.ae59dec6.js"),["assets/mapViewDeps.ae59dec6.js","assets/_commonjsHelpers.773c2c82.js","assets/imageutils.9dde1c66.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/BufferPool.ff53b3f4.js","assets/WGLContainer.1850619d.js","assets/pixelUtils.82950e1a.js","assets/VertexArrayObject.a4c1d809.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/enums.54326430.js","assets/programUtils.956e69db.js","assets/RenderingContext.6e624525.js","assets/OrderIndependentTransparency.4d1575c0.js","assets/floatRGBA.df11258c.js","assets/ExpandedCIM.f0b7f36d.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.0d428d19.js","assets/GeometryUtils.4f19e772.js","assets/rasterizingUtils.4baad29a.js","assets/Matcher.fe0c3dcf.js","assets/visualVariablesUtils.32e27706.js","assets/visualVariablesUtils.aff73e6d.js","assets/tileUtils.44921ab9.js","assets/TileClipper.8c399a8a.js","assets/Geometry.d049a63c.js","assets/devEnvironmentUtils.d8d0484c.js","assets/CircularArray.a4d7e1c2.js","assets/imageUtils.753f41b1.js","assets/ComputedAttributeStorage.c1cb22b3.js","assets/centroid.cc817cc5.js","assets/BaseGraphicContainer.6b1c597d.js","assets/normalizeUtilsSync.757b5fd1.js","assets/projectionSupport.0542c13b.js","assets/json.879c9adc.js","assets/FeatureContainer.4ca52b51.js","assets/TileContainer.8b7fafe2.js","assets/schemaUtils.69ad92d2.js","assets/createSymbolSchema.e54d2060.js","assets/util.ab699fea.js","assets/vec3f32.1121a836.js","assets/GraphicContainer.618d10e5.js","assets/requestImageUtils.7b09b5e8.js"])])}const qd=()=>Vt().then(()=>z(()=>import("./TileLayerView2D.98b348c2.js"),["assets/TileLayerView2D.98b348c2.js","assets/imageUtils.b93c1581.js","assets/BitmapTileContainer.3a622161.js","assets/Bitmap.43defcb1.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/TileContainer.8b7fafe2.js","assets/WGLContainer.1850619d.js","assets/pixelUtils.82950e1a.js","assets/VertexArrayObject.a4c1d809.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.42d17220.js","assets/RefreshableLayerView.28a00159.js","assets/drapedUtils.e64c9295.js"])),Gd=()=>Vt().then(()=>z(()=>import("./FeatureLayerView2D.c0de0a56.js"),["assets/FeatureLayerView2D.c0de0a56.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/LayerView.42d17220.js","assets/schemaUtils.69ad92d2.js","assets/visualVariablesUtils.aff73e6d.js","assets/createSymbolSchema.e54d2060.js","assets/ExpandedCIM.f0b7f36d.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.0d428d19.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.df11258c.js","assets/util.ab699fea.js","assets/floorFilterUtils.05eb8c6a.js","assets/popupUtils.4abb3ffd.js","assets/RefreshableLayerView.28a00159.js"])),hA={"base-dynamic":()=>Vt().then(()=>z(()=>import("./BaseDynamicLayerView2D.af78936a.js"),["assets/BaseDynamicLayerView2D.af78936a.js","assets/BitmapContainer.3274be0c.js","assets/WGLContainer.1850619d.js","assets/enums.2d9e6f64.js","assets/pixelUtils.82950e1a.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/VertexArrayObject.a4c1d809.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.42d17220.js","assets/ExportStrategy.e65233e4.js","assets/Bitmap.43defcb1.js","assets/RefreshableLayerView.28a00159.js"])),"base-tile":qd,"bing-maps":qd,csv:Gd,"geo-rss":()=>Vt().then(()=>z(()=>import("./GeoRSSLayerView2D.e15a9a7b.js"),["assets/GeoRSSLayerView2D.e15a9a7b.js","assets/LayerView.42d17220.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/GraphicContainer.618d10e5.js","assets/BaseGraphicContainer.6b1c597d.js","assets/ExpandedCIM.f0b7f36d.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.0d428d19.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.df11258c.js","assets/normalizeUtilsSync.757b5fd1.js","assets/projectionSupport.0542c13b.js","assets/json.879c9adc.js","assets/VertexArrayObject.a4c1d809.js","assets/FeatureContainer.4ca52b51.js","assets/TileContainer.8b7fafe2.js","assets/WGLContainer.1850619d.js","assets/pixelUtils.82950e1a.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/visualVariablesUtils.32e27706.js","assets/visualVariablesUtils.aff73e6d.js","assets/Matcher.fe0c3dcf.js","assets/tileUtils.44921ab9.js","assets/TileClipper.8c399a8a.js","assets/Geometry.d049a63c.js","assets/devEnvironmentUtils.d8d0484c.js","assets/schemaUtils.69ad92d2.js","assets/createSymbolSchema.e54d2060.js","assets/util.ab699fea.js","assets/ComputedAttributeStorage.c1cb22b3.js","assets/centroid.cc817cc5.js","assets/vec3f32.1121a836.js"])),feature:Gd,geojson:Gd,graphics:()=>Vt().then(()=>z(()=>import("./GraphicsLayerView2D.3b31f4c0.js"),["assets/GraphicsLayerView2D.3b31f4c0.js","assets/LayerView.42d17220.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/GraphicContainer.618d10e5.js","assets/BaseGraphicContainer.6b1c597d.js","assets/ExpandedCIM.f0b7f36d.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.0d428d19.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.df11258c.js","assets/normalizeUtilsSync.757b5fd1.js","assets/projectionSupport.0542c13b.js","assets/json.879c9adc.js","assets/VertexArrayObject.a4c1d809.js","assets/FeatureContainer.4ca52b51.js","assets/TileContainer.8b7fafe2.js","assets/WGLContainer.1850619d.js","assets/pixelUtils.82950e1a.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/visualVariablesUtils.32e27706.js","assets/visualVariablesUtils.aff73e6d.js","assets/Matcher.fe0c3dcf.js","assets/tileUtils.44921ab9.js","assets/TileClipper.8c399a8a.js","assets/Geometry.d049a63c.js","assets/devEnvironmentUtils.d8d0484c.js","assets/schemaUtils.69ad92d2.js","assets/createSymbolSchema.e54d2060.js","assets/util.ab699fea.js","assets/ComputedAttributeStorage.c1cb22b3.js","assets/centroid.cc817cc5.js","assets/vec3f32.1121a836.js"])),group:()=>Vt().then(()=>z(()=>import("./GroupLayerView2D.4f483153.js"),["assets/GroupLayerView2D.4f483153.js","assets/GroupContainer.b2a77ceb.js","assets/WGLContainer.1850619d.js","assets/enums.2d9e6f64.js","assets/pixelUtils.82950e1a.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/VertexArrayObject.a4c1d809.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.42d17220.js"])),imagery:()=>Vt().then(()=>z(()=>import("./ImageryLayerView2D.52654f54.js"),["assets/ImageryLayerView2D.52654f54.js","assets/RasterVFDisplayObject.3d75d94d.js","assets/VertexArrayObject.a4c1d809.js","assets/Texture.4c97bad5.js","assets/enums.2d9e6f64.js","assets/VertexElementDescriptor.1fdca6da.js","assets/dataUtils.0f9b810f.js","assets/pixelUtils.82950e1a.js","assets/WGLContainer.1850619d.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/MaterialKey.229b1dd6.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.42d17220.js","assets/BaseGraphicContainer.6b1c597d.js","assets/ExpandedCIM.f0b7f36d.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.0d428d19.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.df11258c.js","assets/normalizeUtilsSync.757b5fd1.js","assets/projectionSupport.0542c13b.js","assets/json.879c9adc.js","assets/FeatureContainer.4ca52b51.js","assets/TileContainer.8b7fafe2.js","assets/visualVariablesUtils.32e27706.js","assets/visualVariablesUtils.aff73e6d.js","assets/Matcher.fe0c3dcf.js","assets/tileUtils.44921ab9.js","assets/TileClipper.8c399a8a.js","assets/Geometry.d049a63c.js","assets/devEnvironmentUtils.d8d0484c.js","assets/schemaUtils.69ad92d2.js","assets/createSymbolSchema.e54d2060.js","assets/util.ab699fea.js","assets/ComputedAttributeStorage.c1cb22b3.js","assets/centroid.cc817cc5.js","assets/vec3f32.1121a836.js","assets/HighlightGraphicContainer.9bc65ba9.js","assets/BitmapContainer.3274be0c.js","assets/Bitmap.43defcb1.js","assets/ExportStrategy.e65233e4.js","assets/rasterProjectionHelper.0a540f3d.js","assets/popupUtils.4abb3ffd.js","assets/RefreshableLayerView.28a00159.js"])),"imagery-tile":()=>Vt().then(()=>z(()=>import("./ImageryTileLayerView2D.687f9a67.js"),["assets/ImageryTileLayerView2D.687f9a67.js","assets/multidimensionalUtils.4f713da1.js","assets/RasterVFDisplayObject.3d75d94d.js","assets/VertexArrayObject.a4c1d809.js","assets/Texture.4c97bad5.js","assets/enums.2d9e6f64.js","assets/VertexElementDescriptor.1fdca6da.js","assets/dataUtils.0f9b810f.js","assets/pixelUtils.82950e1a.js","assets/WGLContainer.1850619d.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/MaterialKey.229b1dd6.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.42d17220.js","assets/TileContainer.8b7fafe2.js","assets/RawBlockCache.73929591.js","assets/rasterProjectionHelper.0a540f3d.js","assets/util.ab699fea.js","assets/popupUtils.4abb3ffd.js","assets/RefreshableLayerView.28a00159.js"])),kml:()=>Vt().then(()=>z(()=>import("./KMLLayerView2D.bb939d29.js"),["assets/KMLLayerView2D.bb939d29.js","assets/kmlUtils.abf45fa2.js","assets/Bitmap.43defcb1.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/BitmapContainer.3274be0c.js","assets/WGLContainer.1850619d.js","assets/pixelUtils.82950e1a.js","assets/VertexArrayObject.a4c1d809.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.42d17220.js","assets/GraphicContainer.618d10e5.js","assets/BaseGraphicContainer.6b1c597d.js","assets/ExpandedCIM.f0b7f36d.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.0d428d19.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.df11258c.js","assets/normalizeUtilsSync.757b5fd1.js","assets/projectionSupport.0542c13b.js","assets/json.879c9adc.js","assets/FeatureContainer.4ca52b51.js","assets/TileContainer.8b7fafe2.js","assets/visualVariablesUtils.32e27706.js","assets/visualVariablesUtils.aff73e6d.js","assets/Matcher.fe0c3dcf.js","assets/tileUtils.44921ab9.js","assets/TileClipper.8c399a8a.js","assets/Geometry.d049a63c.js","assets/devEnvironmentUtils.d8d0484c.js","assets/schemaUtils.69ad92d2.js","assets/createSymbolSchema.e54d2060.js","assets/util.ab699fea.js","assets/ComputedAttributeStorage.c1cb22b3.js","assets/centroid.cc817cc5.js","assets/vec3f32.1121a836.js","assets/rasterProjectionHelper.0a540f3d.js","assets/RenderingContext.6e624525.js","assets/programUtils.956e69db.js","assets/OrderIndependentTransparency.4d1575c0.js"])),"map-image":()=>Vt().then(()=>z(()=>import("./MapImageLayerView2D.af3159c8.js"),["assets/MapImageLayerView2D.af3159c8.js","assets/BitmapContainer.3274be0c.js","assets/WGLContainer.1850619d.js","assets/enums.2d9e6f64.js","assets/pixelUtils.82950e1a.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/VertexArrayObject.a4c1d809.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.42d17220.js","assets/BaseGraphicContainer.6b1c597d.js","assets/ExpandedCIM.f0b7f36d.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.0d428d19.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.df11258c.js","assets/normalizeUtilsSync.757b5fd1.js","assets/projectionSupport.0542c13b.js","assets/json.879c9adc.js","assets/FeatureContainer.4ca52b51.js","assets/TileContainer.8b7fafe2.js","assets/visualVariablesUtils.32e27706.js","assets/visualVariablesUtils.aff73e6d.js","assets/Matcher.fe0c3dcf.js","assets/tileUtils.44921ab9.js","assets/TileClipper.8c399a8a.js","assets/Geometry.d049a63c.js","assets/devEnvironmentUtils.d8d0484c.js","assets/schemaUtils.69ad92d2.js","assets/createSymbolSchema.e54d2060.js","assets/util.ab699fea.js","assets/ComputedAttributeStorage.c1cb22b3.js","assets/centroid.cc817cc5.js","assets/vec3f32.1121a836.js","assets/HighlightGraphicContainer.9bc65ba9.js","assets/ExportStrategy.e65233e4.js","assets/Bitmap.43defcb1.js","assets/scaleUtils.467c71f9.js","assets/ExportImageParameters.0ebe2d44.js","assets/floorFilterUtils.05eb8c6a.js","assets/sublayerUtils.9d6cbcc3.js","assets/drapedUtils.e64c9295.js","assets/popupUtils.4abb3ffd.js","assets/RefreshableLayerView.28a00159.js"])),"map-notes":()=>Vt().then(()=>z(()=>import("./MapNotesLayerView2D.8d6b9dc0.js"),["assets/MapNotesLayerView2D.8d6b9dc0.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/GroupContainer.b2a77ceb.js","assets/WGLContainer.1850619d.js","assets/pixelUtils.82950e1a.js","assets/VertexArrayObject.a4c1d809.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.42d17220.js","assets/GraphicContainer.618d10e5.js","assets/BaseGraphicContainer.6b1c597d.js","assets/ExpandedCIM.f0b7f36d.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.0d428d19.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.df11258c.js","assets/normalizeUtilsSync.757b5fd1.js","assets/projectionSupport.0542c13b.js","assets/json.879c9adc.js","assets/FeatureContainer.4ca52b51.js","assets/TileContainer.8b7fafe2.js","assets/visualVariablesUtils.32e27706.js","assets/visualVariablesUtils.aff73e6d.js","assets/Matcher.fe0c3dcf.js","assets/tileUtils.44921ab9.js","assets/TileClipper.8c399a8a.js","assets/Geometry.d049a63c.js","assets/devEnvironmentUtils.d8d0484c.js","assets/schemaUtils.69ad92d2.js","assets/createSymbolSchema.e54d2060.js","assets/util.ab699fea.js","assets/ComputedAttributeStorage.c1cb22b3.js","assets/centroid.cc817cc5.js","assets/vec3f32.1121a836.js"])),media:()=>Vt().then(()=>z(()=>import("./MediaLayerView2D.09f1bca2.js"),["assets/MediaLayerView2D.09f1bca2.js","assets/normalizeUtilsSync.757b5fd1.js","assets/mat3f64.6d32a1d7.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/VertexArrayObject.a4c1d809.js","assets/vec3f32.1121a836.js","assets/WGLContainer.1850619d.js","assets/pixelUtils.82950e1a.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.42d17220.js"])),"ogc-feature":()=>Vt().then(()=>z(()=>import("./OGCFeatureLayerView2D.f2b5dde2.js"),["assets/OGCFeatureLayerView2D.f2b5dde2.js","assets/FeatureLayerView2D.c0de0a56.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/LayerView.42d17220.js","assets/schemaUtils.69ad92d2.js","assets/visualVariablesUtils.aff73e6d.js","assets/createSymbolSchema.e54d2060.js","assets/ExpandedCIM.f0b7f36d.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.0d428d19.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.df11258c.js","assets/util.ab699fea.js","assets/floorFilterUtils.05eb8c6a.js","assets/popupUtils.4abb3ffd.js","assets/RefreshableLayerView.28a00159.js"])),"open-street-map":qd,"oriented-imagery":Gd,route:()=>Vt().then(()=>z(()=>import("./RouteLayerView2D.4c625030.js"),["assets/RouteLayerView2D.4c625030.js","assets/Stop.a3532add.js","assets/LayerView.42d17220.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/GraphicContainer.618d10e5.js","assets/BaseGraphicContainer.6b1c597d.js","assets/ExpandedCIM.f0b7f36d.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.0d428d19.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.df11258c.js","assets/normalizeUtilsSync.757b5fd1.js","assets/projectionSupport.0542c13b.js","assets/json.879c9adc.js","assets/VertexArrayObject.a4c1d809.js","assets/FeatureContainer.4ca52b51.js","assets/TileContainer.8b7fafe2.js","assets/WGLContainer.1850619d.js","assets/pixelUtils.82950e1a.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/visualVariablesUtils.32e27706.js","assets/visualVariablesUtils.aff73e6d.js","assets/Matcher.fe0c3dcf.js","assets/tileUtils.44921ab9.js","assets/TileClipper.8c399a8a.js","assets/Geometry.d049a63c.js","assets/devEnvironmentUtils.d8d0484c.js","assets/schemaUtils.69ad92d2.js","assets/createSymbolSchema.e54d2060.js","assets/util.ab699fea.js","assets/ComputedAttributeStorage.c1cb22b3.js","assets/centroid.cc817cc5.js","assets/vec3f32.1121a836.js"])),stream:()=>Vt().then(()=>z(()=>import("./StreamLayerView2D.999b4965.js"),["assets/StreamLayerView2D.999b4965.js","assets/FeatureLayerView2D.c0de0a56.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/LayerView.42d17220.js","assets/schemaUtils.69ad92d2.js","assets/visualVariablesUtils.aff73e6d.js","assets/createSymbolSchema.e54d2060.js","assets/ExpandedCIM.f0b7f36d.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.0d428d19.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.df11258c.js","assets/util.ab699fea.js","assets/floorFilterUtils.05eb8c6a.js","assets/popupUtils.4abb3ffd.js","assets/RefreshableLayerView.28a00159.js"])),"subtype-group":()=>Vt().then(()=>z(()=>import("./SubtypeGroupLayerView2D.e026c935.js"),["assets/SubtypeGroupLayerView2D.e026c935.js","assets/FeatureLayerView2D.c0de0a56.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/LayerView.42d17220.js","assets/schemaUtils.69ad92d2.js","assets/visualVariablesUtils.aff73e6d.js","assets/createSymbolSchema.e54d2060.js","assets/ExpandedCIM.f0b7f36d.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.0d428d19.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.df11258c.js","assets/util.ab699fea.js","assets/floorFilterUtils.05eb8c6a.js","assets/popupUtils.4abb3ffd.js","assets/RefreshableLayerView.28a00159.js"])),tile:qd,"vector-tile":()=>Vt().then(()=>z(()=>import("./VectorTileLayerView2D.fd81c1b1.js"),["assets/VectorTileLayerView2D.fd81c1b1.js","assets/enums.54326430.js","assets/Rect.95b0fd2e.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/rasterizingUtils.4baad29a.js","assets/floatRGBA.df11258c.js","assets/VertexArrayObject.a4c1d809.js","assets/config.82550349.js","assets/TileContainer.8b7fafe2.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/WGLContainer.1850619d.js","assets/pixelUtils.82950e1a.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/StyleRepository.a1fecb1f.js","assets/colorUtils.bb6424b7.js","assets/GeometryUtils.4f19e772.js","assets/Geometry.d049a63c.js","assets/LayerView.42d17220.js"])),wcs:()=>Vt().then(()=>z(()=>import("./ImageryTileLayerView2D.687f9a67.js"),["assets/ImageryTileLayerView2D.687f9a67.js","assets/multidimensionalUtils.4f713da1.js","assets/RasterVFDisplayObject.3d75d94d.js","assets/VertexArrayObject.a4c1d809.js","assets/Texture.4c97bad5.js","assets/enums.2d9e6f64.js","assets/VertexElementDescriptor.1fdca6da.js","assets/dataUtils.0f9b810f.js","assets/pixelUtils.82950e1a.js","assets/WGLContainer.1850619d.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/MaterialKey.229b1dd6.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.42d17220.js","assets/TileContainer.8b7fafe2.js","assets/RawBlockCache.73929591.js","assets/rasterProjectionHelper.0a540f3d.js","assets/util.ab699fea.js","assets/popupUtils.4abb3ffd.js","assets/RefreshableLayerView.28a00159.js"])),"web-tile":qd,wfs:Gd,wms:()=>Vt().then(()=>z(()=>import("./WMSLayerView2D.1b7f0c8d.js"),["assets/WMSLayerView2D.1b7f0c8d.js","assets/BitmapContainer.3274be0c.js","assets/WGLContainer.1850619d.js","assets/enums.2d9e6f64.js","assets/pixelUtils.82950e1a.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/VertexArrayObject.a4c1d809.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.42d17220.js","assets/ExportStrategy.e65233e4.js","assets/Bitmap.43defcb1.js","assets/RefreshableLayerView.28a00159.js","assets/ExportWMSImageParameters.bc1ac1a0.js"])),wmts:()=>Vt().then(()=>z(()=>import("./WMTSLayerView2D.430450ca.js"),["assets/WMTSLayerView2D.430450ca.js","assets/imageUtils.b93c1581.js","assets/BitmapTileContainer.3a622161.js","assets/Bitmap.43defcb1.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/TileContainer.8b7fafe2.js","assets/WGLContainer.1850619d.js","assets/pixelUtils.82950e1a.js","assets/VertexArrayObject.a4c1d809.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.42d17220.js","assets/RefreshableLayerView.28a00159.js"])),"line-of-sight":null,"base-elevation":null,"building-scene":null,dimension:null,elevation:null,"integrated-mesh":null,"point-cloud":null,voxel:null,scene:null,unknown:null,unsupported:null};function Cle(e){const t=e.declaredClass?e.declaredClass.slice(e.declaredClass.lastIndexOf(".")+1):"Unknown",i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new L(`${i}:view-not-supported`,`${t} is not supported in 2D`)}const dA={hasLayerViewModule:e=>M(hA[e.type]),importLayerView:e=>{const t=hA[e.type];if(N(t))throw Cle(e);return t(e)}};function Ple(e,t){const{spatialReference:i}=t,s=[t.x,t.y];let r=Number.POSITIVE_INFINITY,n=0,o=0;const a=[0,0],l=e.type==="extent"?[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]:e.rings;for(const u of l)for(let d=0;dd.clone()),t.sort((d,f)=>f.scale-d.scale),t.forEach((d,f)=>d.level=f);for(const d of t)!l&&i>0&&i>=d.scale&&(o=d.level,l=!0),!u&&s>0&&s>=d.scale&&(a=e?e.level:-1,u=!0),e=d;r===-1&&(r=i===0?0:o),n===-1&&(n=s===0?t.length-1:a),r=Math.max(r,0),r=Math.min(r,t.length-1),n=Math.max(n,0),n=Math.min(n,t.length-1),r>n&&([r,n]=[n,r]),i=t[r].scale,s=t[n].scale,t.splice(0,r),t.splice(n-r+1,t.length),t.forEach((d,f)=>{this._lodByScale[d.scale]=d,this._scales[f]=d.scale}),this._set("effectiveLODs",t),this._set("effectiveMinZoom",r),this._set("effectiveMaxZoom",n),this._set("effectiveMinScale",i),this._set("effectiveMaxScale",s)}constrain(e,t){if(t&&e.scale===t.scale)return e;const i=this.effectiveMinScale,s=this.effectiveMaxScale,r=e.targetGeometry,n=t&&t.targetGeometry,o=s!==0&&e.scalei;if(o||a){const l=a?i:s;if(t&&n){const u=(l-t.scale)/(e.scale-t.scale);r.x=n.x+(r.x-n.x)*u,r.y=n.y+(r.y-n.y)*u}e.scale=l}return this.snapToZoom&&this.effectiveLODs&&(e.scale=this._getClosestScale(e.scale)),e}fit(e){if(!this.effectiveLODs||!this.snapToZoom)return this.constrain(e,null);const t=this.scaleToZoom(e.scale),i=Math.abs(t-Math.floor(t));return e.scale=this.zoomToScale(i>.99?Math.round(t):Math.floor(t)),e}zoomToScale(e){if(!this.effectiveLODs)return 0;e-=this.effectiveMinZoom,e=Math.max(0,e);const t=this._scales;if(e<=0)return t[0];if(e>=t.length)return t[t.length-1];const i=Math.round(e-.5),s=Math.round(e);return t[s]+(s-e)*(t[i]-t[s])}scaleToZoom(e){if(!this.effectiveLODs)return-1;const t=this._scales;let i,s;if(e>=t[0])return this.effectiveMinZoom;if(e<=t[t.length-1])return this.effectiveMaxZoom;for(let r=0;re&&sMath.abs(i-e)<=Math.abs(t-e)?i:t,this._scales[0])),this._lodByScale[e].scale}};c([h({readOnly:!0})],es.prototype,"effectiveLODs",void 0),c([h({readOnly:!0})],es.prototype,"effectiveMinZoom",void 0),c([h({readOnly:!0})],es.prototype,"effectiveMaxZoom",void 0),c([h({readOnly:!0})],es.prototype,"effectiveMinScale",void 0),c([h({readOnly:!0})],es.prototype,"effectiveMaxScale",void 0),c([h()],es.prototype,"lods",void 0),c([h()],es.prototype,"minZoom",void 0),c([h()],es.prototype,"maxZoom",void 0),c([h()],es.prototype,"minScale",void 0),c([h()],es.prototype,"maxScale",void 0),c([h()],es.prototype,"snapToZoom",void 0),es=uM=c([S("esri.views.2d.constraints.ZoomConstraint")],es);const jj=es,Ale={base:null,key:"type",typeMap:{extent:Ze,polygon:Oo}};let Mt=class extends oe{constructor(e){super(e),this.lods=null,this.minScale=0,this.maxScale=0,this.minZoom=-1,this.maxZoom=-1,this.rotationEnabled=!0,this.snapToZoom=!0}destroy(){this.view=null}get effectiveLODs(){return this._zoom.effectiveLODs}get effectiveMinScale(){return this._zoom.effectiveMinScale}get effectiveMaxScale(){return this._zoom.effectiveMaxScale}get effectiveMinZoom(){return this._zoom.effectiveMinZoom}get effectiveMaxZoom(){return this._zoom.effectiveMaxZoom}set geometry(e){e?this._set("geometry",e):this._set("geometry",null)}get version(){var e,t,i;return`${(e=this._zoom)==null?void 0:e.uid}/${(t=this._rotation)==null?void 0:t.uid}/${(i=this._geometry)==null?void 0:i.uid}`}get _defaultLODs(){var i,s,r;const e=(s=(i=this.view)==null?void 0:i.defaultsFromMap)==null?void 0:s.tileInfo,t=(r=this.view)==null?void 0:r.spatialReference;return e&&t&&e.spatialReference.equals(t)?e.lods:null}get _geometry(){var e;return new Mc({geometry:this.geometry,spatialReference:(e=this.view)==null?void 0:e.spatialReference})}get _rotation(){return new Nj({rotationEnabled:this.rotationEnabled})}get _zoom(){const e=this._get("_zoom"),t=this.lods||this._defaultLODs,i=this.minZoom,s=this.maxZoom,r=this.minScale,n=this.maxScale,o=this.snapToZoom;return e&&e.lods===t&&e.minZoom===i&&e.maxZoom===s&&e.minScale===r&&e.maxScale===n&&e.snapToZoom===o?e:new jj({lods:t,minZoom:i,maxZoom:s,minScale:r,maxScale:n,snapToZoom:o})}canZoomInTo(e){const t=this.effectiveMaxScale;return t===0||e>=t}canZoomOutTo(e){const t=this.effectiveMinScale;return t===0||e<=t}constrain(e,t){return this._zoom.constrain(e,t),this._rotation.constrain(e,t),this._geometry.constrain(e,t),e}constrainByGeometry(e){return this._geometry.constrain(e)}fit(e){return this._zoom.fit(e)}zoomToScale(e){return this._zoom.zoomToScale(e)}scaleToZoom(e){return this._zoom.scaleToZoom(e)}snapScale(e){return this._zoom.snapToClosestScale(e)}snapToNextScale(e){return this._zoom.snapToNextScale(e)}snapToPreviousScale(e){return this._zoom.snapToPreviousScale(e)}};c([h({readOnly:!0})],Mt.prototype,"effectiveLODs",null),c([h({readOnly:!0})],Mt.prototype,"effectiveMinScale",null),c([h({readOnly:!0})],Mt.prototype,"effectiveMaxScale",null),c([h({readOnly:!0})],Mt.prototype,"effectiveMinZoom",null),c([h({readOnly:!0})],Mt.prototype,"effectiveMaxZoom",null),c([h({types:Ale,value:null})],Mt.prototype,"geometry",null),c([h({type:[dT]})],Mt.prototype,"lods",void 0),c([h()],Mt.prototype,"minScale",void 0),c([h()],Mt.prototype,"maxScale",void 0),c([h()],Mt.prototype,"minZoom",void 0),c([h()],Mt.prototype,"maxZoom",void 0),c([h()],Mt.prototype,"rotationEnabled",void 0),c([h()],Mt.prototype,"snapToZoom",void 0),c([h()],Mt.prototype,"view",void 0),c([h({readOnly:!0})],Mt.prototype,"version",null),c([h()],Mt.prototype,"_defaultLODs",null),c([h({type:Mc})],Mt.prototype,"_geometry",null),c([h({type:Nj})],Mt.prototype,"_rotation",null),c([h({readOnly:!0,type:jj})],Mt.prototype,"_zoom",null),Mt=c([S("esri.views.2d.MapViewConstraints")],Mt);const Vj=Mt;function Ole(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function Rle(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function zj(e,t,i,s,r,n,o,a,l,u){return e[0]=t,e[1]=i,e[2]=s,e[3]=r,e[4]=n,e[5]=o,e[6]=a,e[7]=l,e[8]=u,e}function Bj(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Lle(e,t){if(e===t){const i=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=i,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function Fle(e,t){const i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],a=t[5],l=t[6],u=t[7],d=t[8],f=d*o-a*u,m=-d*n+a*l,y=u*n-o*l;let g=i*f+s*m+r*y;return g?(g=1/g,e[0]=f*g,e[1]=(-d*s+r*u)*g,e[2]=(a*s-r*o)*g,e[3]=m*g,e[4]=(d*i-r*l)*g,e[5]=(-a*i+r*n)*g,e[6]=y*g,e[7]=(-u*i+s*l)*g,e[8]=(o*i-s*n)*g,e):null}function Dle(e,t){const i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],a=t[5],l=t[6],u=t[7],d=t[8];return e[0]=o*d-a*u,e[1]=r*u-s*d,e[2]=s*a-r*o,e[3]=a*l-n*d,e[4]=i*d-r*l,e[5]=r*n-i*a,e[6]=n*u-o*l,e[7]=s*l-i*u,e[8]=i*o-s*n,e}function Nle(e){const t=e[0],i=e[1],s=e[2],r=e[3],n=e[4],o=e[5],a=e[6],l=e[7],u=e[8];return t*(u*n-o*l)+i*(-u*r+o*a)+s*(l*r-n*a)}function sI(e,t,i){const s=t[0],r=t[1],n=t[2],o=t[3],a=t[4],l=t[5],u=t[6],d=t[7],f=t[8],m=i[0],y=i[1],g=i[2],v=i[3],b=i[4],_=i[5],x=i[6],$=i[7],I=i[8];return e[0]=m*s+y*o+g*u,e[1]=m*r+y*a+g*d,e[2]=m*n+y*l+g*f,e[3]=v*s+b*o+_*u,e[4]=v*r+b*a+_*d,e[5]=v*n+b*l+_*f,e[6]=x*s+$*o+I*u,e[7]=x*r+$*a+I*d,e[8]=x*n+$*l+I*f,e}function hM(e,t,i){const s=t[0],r=t[1],n=t[2],o=t[3],a=t[4],l=t[5],u=t[6],d=t[7],f=t[8],m=i[0],y=i[1];return e[0]=s,e[1]=r,e[2]=n,e[3]=o,e[4]=a,e[5]=l,e[6]=m*s+y*o+u,e[7]=m*r+y*a+d,e[8]=m*n+y*l+f,e}function Uj(e,t,i){const s=t[0],r=t[1],n=t[2],o=t[3],a=t[4],l=t[5],u=t[6],d=t[7],f=t[8],m=Math.sin(i),y=Math.cos(i);return e[0]=y*s+m*o,e[1]=y*r+m*a,e[2]=y*n+m*l,e[3]=y*o-m*s,e[4]=y*a-m*r,e[5]=y*l-m*n,e[6]=u,e[7]=d,e[8]=f,e}function jle(e,t,i){const s=i[0],r=i[1],n=i[2];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=n*t[6],e[7]=n*t[7],e[8]=n*t[8],e}function Vle(e,t,i){const s=i[0],r=i[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e}function zle(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}function Ble(e,t){const i=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=i,e[2]=0,e[3]=-i,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Ule(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function qle(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}function Gle(e,t){const i=t[0],s=t[1],r=t[2],n=t[3],o=i+i,a=s+s,l=r+r,u=i*o,d=s*o,f=s*a,m=r*o,y=r*a,g=r*l,v=n*o,b=n*a,_=n*l;return e[0]=1-f-g,e[3]=d-_,e[6]=m+b,e[1]=d+_,e[4]=1-u-g,e[7]=y-v,e[2]=m-b,e[5]=y+v,e[8]=1-u-f,e}function Wle(e,t){const i=t[0],s=t[1],r=t[2],n=t[4],o=t[5],a=t[6],l=t[8],u=t[9],d=t[10],f=d*o-a*u,m=-d*n+a*l,y=u*n-o*l,g=i*f+s*m+r*y;if(!g)return null;const v=1/g;return e[0]=f*v,e[1]=(-d*s+r*u)*v,e[2]=(a*s-r*o)*v,e[3]=m*v,e[4]=(d*i-r*l)*v,e[5]=(-a*i+r*n)*v,e[6]=y*v,e[7]=(-u*i+s*l)*v,e[8]=(o*i-s*n)*v,e}function Hle(e,t){const i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],a=t[5],l=t[6],u=t[7],d=t[8],f=t[9],m=t[10],y=t[11],g=t[12],v=t[13],b=t[14],_=t[15],x=i*a-s*o,$=i*l-r*o,I=i*u-n*o,T=s*l-r*a,k=s*u-n*a,A=r*u-n*l,F=d*v-f*g,G=d*b-m*g,U=d*_-y*g,J=f*b-m*v,H=f*_-y*v,te=m*_-y*b;let se=x*te-$*H+I*J+T*U-k*G+A*F;return se?(se=1/se,e[0]=(a*te-l*H+u*J)*se,e[1]=(l*U-o*te-u*G)*se,e[2]=(o*H-a*U+u*F)*se,e[3]=(r*H-s*te-n*J)*se,e[4]=(i*te-r*U+n*G)*se,e[5]=(s*U-i*H-n*F)*se,e[6]=(v*A-b*k+_*T)*se,e[7]=(b*I-g*A-_*$)*se,e[8]=(g*k-v*I+_*x)*se,e):null}function Yle(e,t,i){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/i,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function Jle(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function Xle(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2)}function Zle(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e[6]=t[6]+i[6],e[7]=t[7]+i[7],e[8]=t[8]+i[8],e}function qj(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e[6]=t[6]-i[6],e[7]=t[7]-i[7],e[8]=t[8]-i[8],e}function Qle(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e}function Kle(e,t,i,s){return e[0]=t[0]+i[0]*s,e[1]=t[1]+i[1]*s,e[2]=t[2]+i[2]*s,e[3]=t[3]+i[3]*s,e[4]=t[4]+i[4]*s,e[5]=t[5]+i[5]*s,e[6]=t[6]+i[6]*s,e[7]=t[7]+i[7]*s,e[8]=t[8]+i[8]*s,e}function ece(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}function tce(e,t){const i=e[0],s=e[1],r=e[2],n=e[3],o=e[4],a=e[5],l=e[6],u=e[7],d=e[8],f=t[0],m=t[1],y=t[2],g=t[3],v=t[4],b=t[5],_=t[6],x=t[7],$=t[8],I=er();return Math.abs(i-f)<=I*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-m)<=I*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(r-y)<=I*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-g)<=I*Math.max(1,Math.abs(n),Math.abs(g))&&Math.abs(o-v)<=I*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(a-b)<=I*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(l-_)<=I*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(u-x)<=I*Math.max(1,Math.abs(u),Math.abs(x))&&Math.abs(d-$)<=I*Math.max(1,Math.abs(d),Math.abs($))}function ice(e){const t=er(),i=e[0],s=e[1],r=e[2],n=e[3],o=e[4],a=e[5],l=e[6],u=e[7],d=e[8];return Math.abs(1-(i*i+n*n+l*l))<=t&&Math.abs(1-(s*s+o*o+u*u))<=t&&Math.abs(1-(r*r+a*a+d*d))<=t}const sce=sI,rce=qj;Object.freeze(Object.defineProperty({__proto__:null,fromMat4:Ole,copy:Rle,set:zj,identity:Bj,transpose:Lle,invert:Fle,adjoint:Dle,determinant:Nle,multiply:sI,translate:hM,rotate:Uj,scale:jle,scaleByVec2:Vle,fromTranslation:zle,fromRotation:Ble,fromScaling:Ule,fromMat2d:qle,fromQuat:Gle,normalFromMat4Legacy:Wle,normalFromMat4:Hle,projection:Yle,str:Jle,frob:Xle,add:Zle,subtract:qj,multiplyScalar:Qle,multiplyScalarAndAdd:Kle,exactEquals:ece,equals:tce,isOrthoNormal:ice,mul:sce,sub:rce},Symbol.toStringTag,{value:"Module"}));function f0(){const e=new Float32Array(9);return e[0]=1,e[4]=1,e[8]=1,e}function nce(e){const t=new Float32Array(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function oce(e,t,i,s,r,n,o,a,l){const u=new Float32Array(9);return u[0]=e,u[1]=t,u[2]=i,u[3]=s,u[4]=r,u[5]=n,u[6]=o,u[7]=a,u[8]=l,u}function ace(e,t){return new Float32Array(e,t,9)}Object.freeze(Object.defineProperty({__proto__:null,create:f0,clone:nce,fromValues:oce,createView:ace},Symbol.toStringTag,{value:"Module"}));function Gj(){return new Float32Array(2)}function lce(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t}function Qh(e,t){const i=new Float32Array(2);return i[0]=e,i[1]=t,i}function cce(e,t){return new Float32Array(e,t,2)}function Wj(){return Gj()}function Hj(){return Qh(1,1)}function Yj(){return Qh(1,0)}function Jj(){return Qh(0,1)}const uce=Wj(),hce=Hj(),dce=Yj(),pce=Jj();Object.freeze(Object.defineProperty({__proto__:null,create:Gj,clone:lce,fromValues:Qh,createView:cce,zeros:Wj,ones:Hj,unitX:Yj,unitY:Jj,ZEROS:uce,ONES:hce,UNIT_X:dce,UNIT_Y:pce},Symbol.toStringTag,{value:"Module"}));function fce(e){return e instanceof Float32Array&&e.length>=2}function mce(e){return Array.isArray(e)&&e.length>=2}function Fw(e){return fce(e)||mce(e)}var dM;const qn=[0,0];let Ia=dM=class extends W{constructor(e){super(e),this._viewpoint2D={center:Et(),rotation:0,scale:0,spatialReference:null},this.center=[0,0],this.extent=new Ze,this.id=0,this.inverseTransform=tl(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=tl(),this.transformNoRotation=tl(),this.displayMat3=f0(),this.displayViewMat3=f0(),this.viewMat3=f0(),this.viewMat2d=Z4(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(e){this._set("pixelRatio",e),this._update()}set size(e){this._set("size",e),this._update()}set viewpoint(e){if(e){const t=this._viewpoint2D,i=e.targetGeometry;t.center[0]=i.x,t.center[1]=i.y,t.rotation=e.rotation,t.scale=e.scale,t.spatialReference=i.spatialReference}this._update()}copy(e){const t=this.size,i=this.viewpoint;return i&&t?(this.viewpoint=qr(i,e.viewpoint),this._set("size",fm(t,e.size))):(this.viewpoint=e.viewpoint.clone(),this._set("size",[e.size[0],e.size[1]])),this._set("pixelRatio",e.pixelRatio),this}clone(){return new dM({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(e,t,i){return Fw(t)?bn(e,t,this.inverseTransform):(qn[0]=t,qn[1]=i,bn(e,qn,this.inverseTransform))}toScreen(e,t,i){return Fw(t)?bn(e,t,this.transform):(qn[0]=t,qn[1]=i,bn(e,qn,this.transform))}toScreenNoRotation(e,t,i){return Fw(t)?bn(e,t,this.transformNoRotation):(qn[0]=t,qn[1]=i,bn(e,qn,this.transformNoRotation))}getScreenTransform(e,t){const{center:i}=this._viewpoint2D,s=this._get("pixelRatio")||1,r=this._get("size");return tI(e,i,r,t,0,s),e}_update(){const{center:e,spatialReference:t,scale:i,rotation:s}=this._viewpoint2D,r=this._get("pixelRatio")||1,n=this._get("size"),o=new Mn({targetGeometry:new be(e[0],e[1],t),scale:i,rotation:s});if(this._set("viewpoint",o),!n||!t||!i)return;this.resolution=$d(o),this.rotation=s,this.scale=i,this.spatialReference=t,fm(this.center,e);const a=n[0]!==0?2/n[0]:0,l=n[1]!==0?-2/n[1]:0;zj(this.displayMat3,a,0,0,0,l,0,-1,1,1);const u=Bj(this.viewMat3),d=Qh(n[0]/2,n[1]/2),f=Qh(-n[0]/2,-n[1]/2),m=y$(s);hM(u,u,d),Uj(u,u,m),hM(u,u,f),sI(this.displayViewMat3,this.displayMat3,u);const y=XT(this.viewMat2d,d);return t_(y,y,m),dm(y,y,f),dle(this.extent,o,n),iI(this.transform,o,n,r),YT(this.inverseTransform,this.transform),ble(this.transformNoRotation,o,n,r),this.worldScreenWidth=wle(this.spatialReference,this.resolution),this._set("id",this.id+1),this}};c([h({readOnly:!0})],Ia.prototype,"id",void 0),c([h({value:1,json:{write:!0}})],Ia.prototype,"pixelRatio",null),c([h({json:{write:!0}})],Ia.prototype,"size",null),c([h()],Ia.prototype,"spatialReference",void 0),c([h({type:Mn,json:{write:!0}})],Ia.prototype,"viewpoint",null),Ia=dM=c([S("esri.views.2d.ViewState")],Ia);const pA=Ia;var pM,fM;let go=pM=class extends oe{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new pM({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};c([h()],go.prototype,"left",void 0),c([h()],go.prototype,"top",void 0),c([h()],go.prototype,"right",void 0),c([h()],go.prototype,"bottom",void 0),go=pM=c([S("esri.views.2d.PaddedViewState.Padding")],go);let oh=fM=class extends pA{constructor(...e){super(...e),this.paddedViewState=new pA,this._updateContent=(()=>{const t=Et();return()=>{const i=this._get("size"),s=this._get("padding");if(!i||!s)return;const r=this.paddedViewState;ai(t,s.left+s.right,s.top+s.bottom),mm(t,i,t),fm(r.size,t);const n=r.viewpoint;n&&(this.viewpoint=n)}})(),this.addHandles(Z(()=>[this.size,this.padding],()=>this._updateContent(),Nh)),this.padding=new go,this.size=[0,0]}set padding(e){this._set("padding",e||new go)}set viewpoint(e){if(e){const t=e.clone();this.paddedViewState.viewpoint=e,Sle(t,e,this._get("size"),this._get("padding"));const i=this._viewpoint2D,s=t.targetGeometry;i.center[0]=s.x,i.center[1]=s.y,i.rotation=t.rotation,i.scale=t.scale,i.spatialReference=s.spatialReference,this._update()}}clone(){return new fM({padding:this.padding.clone(),size:this.size.slice(),viewpoint:this.paddedViewState.viewpoint.clone(),pixelRatio:this.pixelRatio})}};c([h()],oh.prototype,"paddedViewState",void 0),c([h({type:go})],oh.prototype,"padding",null),c([h()],oh.prototype,"viewpoint",null),oh=fM=c([S("esri.views.2d.PaddedViewState")],oh);const yce=oh;class gce{constructor(t,i){this.item=t,this.controller=i,this.promise=null}}class Xj{constructor(t){this._deferreds=new Map,this._controllers=new Map,this._processingItems=new Map,this._isPaused=!1,this._schedule=null,this._task=null,this.concurrency=1,t.concurrency&&(this.concurrency=t.concurrency),this._queue=new xv(t.peeker),this.process=t.process;const i=t.scheduler;t.priority&&M(i)&&(this._task=i.registerTask(t.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(t){const i=this._controllers.get(t);i&&i.abort()}clear(){this._queue.clear();const t=[];this._controllers.forEach(i=>t.push(i)),this._controllers.clear(),t.forEach(i=>i.abort()),this._processingItems.clear(),this._cancelNext()}forEach(t){this._deferreds.forEach((i,s)=>t(s))}get(t){const i=this._deferreds.get(t);return i?i.promise:void 0}isOngoing(t){return this._processingItems.has(t)}has(t){return this._deferreds.has(t)}pause(){this._isPaused||(this._isPaused=!0,this._cancelNext())}push(t,i){const s=this.get(t);if(s)return s;const r=new AbortController;let n=null;i&&(n=Vr(i,()=>r.abort()));const o=()=>{const d=this._processingItems.get(t);d&&d.controller.abort(),a(),u.reject(_t())},a=()=>{l.remove(),M(n)&&n.remove(),this._deferreds.delete(t),this._controllers.delete(t),this._queue.remove(t),this._processingItems.delete(t),this._scheduleNext()},l=JM(r.signal,o),u=Ao();return this._deferreds.set(t,u),this._controllers.set(t,r),u.promise.then(a,a),this._queue.push(t),this._scheduleNext(),u.promise}last(){return this._queue.last()}peek(){return this._queue.peek()}popLast(){return this._queue.popLast()}reset(){const t=[];this._processingItems.forEach(i=>t.push(i)),this._processingItems.clear();for(const i of t)this._queue.push(i.item),i.controller.abort();this._scheduleNext()}resume(){this._isPaused&&(this._isPaused=!1,this._scheduleNext())}takeAll(){const t=[];for(;this._queue.length;)t.push(this._queue.pop());return this.clear(),t}get running(){return!this._isPaused&&this._queue.length>0&&this._processingItems.size0&&this._processingItems.size{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.sizethis._processResult(r,n),n=>this._processError(r,n))):this._processResult(r,i)}get test(){return{update:t=>this.runTask(t)}}}function vce(e,t){return e.length=0,t.forEach(i=>e.push(i)),e}const Dw=new Set,Uy=[],wu=new Map,fA=[0,0];let Ko=class extends oe{constructor(e){super(e),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:e,process:t}=this;this._queue=new Xj({concurrency:e,process:(i,s)=>{const r=this._keyToItem.get(i);return t(r,{signal:s})},peeker:i=>i.values().next().value})}destroy(){this.clear(),this._queue=$t(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}get updating(){return this.length>0||this.onGoingCount>0}abort(e){const t=typeof e=="string"?e:e.id;this._queue.abort(t)}clear(){this._queue.clear(),this._keyToItem.clear(),this.notifyChange("updating")}has(e){return typeof e=="string"?this._keyToItem.has(e):this._keyToItem.has(e.id)}isOngoing(e){const t=typeof e=="string"?e:e.id;return this.has(t)&&this._queue.isOngoing(t)}pause(){this._queue.pause()}push(e,t){const i=e.key.id+"-"+t;if(this.has(i))return this.get(i);const s=this._queue.push(i),r=()=>{this._keyToItem.delete(i),this.notifyChange("updating")};return this._keyToItem.set(i,e),s.then(r,r),this.notifyChange("updating"),s}reset(){this._queue.reset(),this.notifyChange("updating")}resume(){this._queue.resume()}_peekByScaleFirst(e){if(!this.state)return e.values().next().value;const t=this.tileInfoView;let i=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;e.forEach(u=>{const d=this._keyToItem.get(u),f=this.tileInfoView.getTileScale(d.key);wu.has(f)||(wu.set(f,[]),i=Math.max(f,i),s=Math.min(f,s)),wu.get(f).push(d.key),Dw.add(f)});let r=this.state.scale;wu.has(r)||(vce(Uy,Dw),Uy.sort((u,d)=>u-d),r=Uy.reduce((u,d)=>Math.abs(d-r){const f=o.denormalizeCol(u.col,u.world),m=o.denormalizeCol(d.col,d.world);return Math.sqrt((a-f)*(a-f)+(l-u.row)*(l-u.row))-Math.sqrt((a-m)*(a-m)+(l-d.row)*(l-d.row))}),Dw.clear(),wu.clear(),n[0].id}_peekByCenterFirst(e){if(!this.state)return e.values().next().value;const t=this.tileInfoView,i=this.state.center;let s,r=Number.POSITIVE_INFINITY;return e.forEach(n=>{const o=this._keyToItem.get(n);t.getTileCoords(fA,o.key);const a=Ym(fA,i);a=0&&this.row===t.row>>i&&this.col===t.col>>i&&this.world===t.world}equals(t){return this.level===t.level&&this.row===t.row&&this.col===t.col&&this.world===t.world}clone(){return new is(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(t,i,s,r){if(t==null)this.level=0,this.row=0,this.col=0,this.world=0;else if(typeof t=="object")this.level=t.level||0,this.row=t.row||0,this.col=t.col||0,this.world=t.world||0;else if(typeof t=="string"){const[n,o,a,l]=t.split("/");this.level=parseFloat(n),this.row=parseFloat(o),this.col=parseFloat(a),this.world=parseFloat(l)}else this.level=+t,this.row=+i,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 is(this.level-1,this.row>>1,this.col>>1,this.world)}getChildKeys(){const t=this.level+1,i=this.row<<1,s=this.col<<1,r=this.world;return[new is(t,i,s,r),new is(t,i,s+1,r),new is(t,i+1,s,r),new is(t,i+1,s+1,r)]}compareRowMajor(t){return this.rowt.row?1:this.colt.col?1:0}}is.pool=new zr(is,null,null,25,50);function ea(e,t){return[e,t]}function Ml(e,t,i){return e[0]=t,e[1]=i,e}function bce(e,t,i,s,r){return e[0]=t,e[1]=i,e[2]=s,e[3]=r,e}const cr=new is("0/0/0/0");class rI{constructor(t,i,s,r,n,o,a,l,u,d,f,m){this.level=t,this.resolution=i,this.scale=s,this.origin=r,this.first=n,this.last=o,this.size=a,this.norm=l,this.worldStart=u,this.worldEnd=d,this.worldSize=f,this.wrap=m}static create(t,i,s=null){const r=Dr(t.spatialReference),n=i.origin||ea(t.origin.x,t.origin.y),o=ea(t.size[0]*i.resolution,t.size[1]*i.resolution),a=ea(-1/0,-1/0),l=ea(1/0,1/0),u=ea(1/0,1/0);M(s)&&(Ml(a,Math.max(0,Math.floor((s.xmin-n[0])/o[0])),Math.max(0,Math.floor((n[1]-s.ymax)/o[1]))),Ml(l,Math.max(0,Math.floor((s.xmax-n[0])/o[0])),Math.max(0,Math.floor((n[1]-s.ymin)/o[1]))),Ml(u,l[0]-a[0]+1,l[1]-a[1]+1));const{cols:d,rows:f}=i;let m,y,g,v;return!s&&d&&f&&(Ml(a,d[0],f[0]),Ml(l,d[1],f[1]),Ml(u,d[1]-d[0]+1,f[1]-f[0]+1)),t.isWrappable?(m=ea(Math.ceil(Math.round((r.valid[1]-r.valid[0])/i.resolution)/t.size[0]),u[1]),y=ea(Math.floor((r.origin[0]-n[0])/o[0]),a[1]),g=ea(m[0]+y[0]-1,l[1]),v=!0):(y=a,g=l,m=u,v=!1),new rI(i.level,i.resolution,i.scale,n,a,l,u,o,y,g,m,v)}normalizeCol(t){if(!this.wrap)return t;const i=this.worldSize[0];return t<0?i-1-Math.abs((t+1)%i):t%i}denormalizeCol(t,i){return this.wrap?this.worldSize[0]*i+t:t}getWorldForColumn(t){return this.wrap?Math.floor(t/this.worldSize[0]):0}getFirstColumnForWorld(t){return t*this.worldSize[0]+this.first[0]}getLastColumnForWorld(t){return t*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(t){return(t-this.origin[0])/this.norm[0]}getXForColumn(t){return this.origin[0]+t*this.norm[0]}getRowForY(t){return(this.origin[1]-t)/this.norm[1]}getYForRow(t){return this.origin[1]-t*this.norm[1]}getTileBounds(t,i,s=!1){cr.set(i);const r=s?cr.col:this.denormalizeCol(cr.col,cr.world),n=cr.row;return bce(t,this.getXForColumn(r),this.getYForRow(n+1),this.getXForColumn(r+1),this.getYForRow(n)),t}getTileCoords(t,i,s=!1){cr.set(i);const r=s?cr.col:this.denormalizeCol(cr.col,cr.world);return Array.isArray(t)?Ml(t,this.getXForColumn(r),this.getYForRow(cr.row)):(t.x=this.getXForColumn(r),t.y=this.getYForRow(cr.row)),t}}class Kh{constructor(){this.spans=[]}acquire(t){this.lodInfo=t}release(){this.lodInfo=null,this.spans.length=0}forEach(t,i){const{spans:s,lodInfo:r}=this,{level:n}=r;if(s.length!==0)for(const{row:o,colFrom:a,colTo:l}of s)for(let u=a;u<=l;u++)t.call(i,n,o,r.normalizeCol(u),r.getWorldForColumn(u))}}Kh.pool=new zr(Kh);class Nw{constructor(t,i,s){this.row=t,this.colFrom=i,this.colTo=s}}const st=new is("0/0/0/0");class nI{constructor(t,i,s,r,n,o,a,l){this.x=t,this.ymin=i,this.ymax=s,this.invM=r,this.leftAdjust=n,this.rightAdjust=o,this.leftBound=a,this.rightBound=l}static create(t,i){t[1]>i[1]&&([t,i]=[i,t]);const[s,r]=t,[n,o]=i,a=n-s,l=o-r,u=l!==0?a/l:0,d=(Math.ceil(r)-r)*u,f=(Math.floor(r)-r)*u;return new nI(s,Math.floor(r),Math.ceil(o),u,a<0?d:f,a<0?f:d,a<0?n:s,a<0?s:n)}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 ds=[[0,0],[0,0],[0,0],[0,0]],_ce=1e-6;class wce{constructor(t,i=null){this.tileInfo=t,this.fullExtent=i,this.scales=[],this._infoByScale={},this._infoByLevel={};const s=t.lods.slice();s.sort((n,o)=>o.scale-n.scale);const r=this._lodInfos=s.map(n=>rI.create(t,n,i));s.forEach((n,o)=>{this._infoByLevel[n.level]=r[o],this._infoByScale[n.scale]=r[o],this.scales[o]=n.scale},this),this._wrap=t.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(t){return this._infoByLevel[typeof t=="number"?t:t.level]}getTileBounds(t,i,s=!1){st.set(i);const r=this._infoByLevel[st.level];return r?r.getTileBounds(t,st,s):t}getTileCoords(t,i,s=!1){st.set(i);const r=this._infoByLevel[st.level];return r?r.getTileCoords(t,st,s):t}getTileCoverage(t,i=192,s="closest"){const r=s==="closest"?this.getClosestInfoForScale(t.scale):this.getSmallestInfoForScale(t.scale),n=Kh.pool.acquire(r),o=this._wrap;let a,l,u,d=1/0,f=-1/0;const m=n.spans;ds[0][0]=ds[0][1]=ds[1][1]=ds[3][0]=-i,ds[1][0]=ds[2][0]=t.size[0]+i,ds[2][1]=ds[3][1]=t.size[1]+i;for(const b of ds)t.toMap(b,b),b[0]=r.getColumnForX(b[0]),b[1]=r.getRowForY(b[1]);const y=[];let g=3;for(let b=0;b<4;b++){if(ds[b][1]===ds[g][1]){g=b;continue}const _=nI.create(ds[b],ds[g]);d=Math.min(_.ymin,d),f=Math.max(_.ymax,f),y[_.ymin]===void 0&&(y[_.ymin]=[]),y[_.ymin].push(_),g=b}if(d==null||f==null||f-d>100)return null;let v=[];for(a=d;a=0;b--){const _=v[b];l=Math.min(l,_.getLeftCol()),u=Math.max(u,_.getRightCol())}if(l=Math.floor(l),u=Math.floor(u),a>=r.first[1]&&a<=r.last[1])if(o)if(r.size[0]r.last[0]||u=0;b--){const _=v[b];_.ymax>=a?_.incrRow():v.splice(b,1)}}return n}getTileParentId(t){st.set(t);const i=this._infoByLevel[st.level],s=this._lodInfos.indexOf(i)-1;return s<0?null:(this._getTileIdAtLOD(st,this._lodInfos[s],st),st.id)}getTileResolution(t){const i=this._infoByLevel[typeof t=="object"?t.level:t];return i?i.resolution:-1}getTileScale(t){const i=this._infoByLevel[t.level];return i?i.scale:-1}intersects(t,i){st.set(i);const s=this._infoByLevel[st.level],r=t.lodInfo;if(r.resolution>s.resolution){this._getTileIdAtLOD(st,r,st);const o=r.denormalizeCol(st.col,st.world);for(const a of t.spans)if(a.row===st.row&&a.colFrom<=o&&a.colTo>=o)return!0}if(r.resolution(v[0]=Math.min(v[0],b.row),v[1]=Math.max(v[1],b.row),v[2]=Math.min(v[2],b.colFrom),v[3]=Math.max(v[3],b.colTo),v),[1/0,-1/0,1/0,-1/0]),d=s.denormalizeCol(st.col,st.world),f=r.getColumnForX(s.getXForColumn(d)),m=r.getRowForY(s.getYForRow(st.row)),y=r.getColumnForX(s.getXForColumn(d+1))-1,g=r.getRowForY(s.getYForRow(st.row+1))-1;return!(f>u||ya||go.row===st.row&&o.colFrom<=n&&o.colTo>=n)}normalizeBounds(t,i,s){if(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],this._wrap){const r=Dr(this.tileInfo.spatialReference),n=-s*(r.valid[1]-r.valid[0]);t[0]+=n,t[2]+=n}return t}getSmallestInfoForScale(t){const i=this.scales;if(this._infoByScale[t])return this._infoByScale[t];if(t>i[0])return this._infoByScale[i[0]];for(let s=1;si[s]+_ce)return this._infoByScale[i[s-1]];return this._infoByScale[i[i.length-1]]}getClosestInfoForScale(t){const i=this.scales;return this._infoByScale[t]||(t=i.reduce((s,r)=>Math.abs(r-t)=0;s--)if(te.push(i)),e}const jw=new Set,qy=[],xu=new Map,mA=[0,0];let co=class extends oe{constructor(e){super(e),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:e,process:t,strategy:i}=this;this._queue=new Xj({concurrency:e,process:(s,r)=>{const n=this._keyToItem.get(s);return t(n,{signal:r})},peeker:i==="scale-first"?s=>this._peekByScaleFirst(s):s=>this._peekByCenterFirst(s)})}destroy(){this.clear(),this._queue=$t(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}get updating(){return this.length>0||this.onGoingCount>0}abort(e){const t=typeof e=="string"?e:e.id;this._queue.abort(t)}clear(){this._queue.clear(),this._keyToItem.clear(),this.notifyChange("updating")}has(e){return typeof e=="string"?this._keyToItem.has(e):this._keyToItem.has(e.id)}isOngoing(e){const t=typeof e=="string"?e:e.id;return this.has(t)&&this._queue.isOngoing(t)}pause(){this._queue.pause()}push(e){const t=e.key.id;if(this._queue.has(t))return this._queue.get(t);const i=this._queue.push(t),s=()=>{this._keyToItem.delete(t),this.notifyChange("updating")};return this._keyToItem.set(t,e),i.then(s,s),this.notifyChange("updating"),i}reset(){this._queue.reset()}resume(){this._queue.resume()}_peekByScaleFirst(e){if(!this.state)return e.values().next().value;const t=this.tileInfoView;let i=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;e.forEach(u=>{const d=this._keyToItem.get(u),f=this.tileInfoView.getTileScale(d.key);xu.has(f)||(xu.set(f,[]),i=Math.max(f,i),s=Math.min(f,s)),xu.get(f).push(d.key),jw.add(f)});let r=this.state.scale;xu.has(r)||(xce(qy,jw),qy.sort((u,d)=>u-d),r=qy.reduce((u,d)=>Math.abs(d-r){const f=o.denormalizeCol(u.col,u.world),m=o.denormalizeCol(d.col,d.world);return Math.sqrt((a-f)*(a-f)+(l-u.row)*(l-u.row))-Math.sqrt((a-m)*(a-m)+(l-d.row)*(l-d.row))}),jw.clear(),xu.clear(),n[0].id}_peekByCenterFirst(e){if(!this.state)return e.values().next().value;const t=this.tileInfoView,i=this.state.center;let s,r=Number.POSITIVE_INFINITY;return e.forEach(n=>{const o=this._keyToItem.get(n);t.getTileCoords(mA,o.key);const a=Ym(mA,i);athis.maxSize&&n>=0;)n!==t&&(r=this._pruneAroundCenterTile(r,i,s,n)),n--;r>this.maxSize&&(r=this._pruneAroundCenterTile(r,i,s,t))}_pruneAroundCenterTile(t,i,s,r){const n=this._tileKeysPerLevel[r];if(!n||n.length===0)return t;const{size:o,origin:a}=this._tileInfoView.tileInfo,l=s*o[0],u=s*o[1],d=[0,0],f=[0,0];for(n.sort((m,y)=>(d[0]=a.x+l*(m.col+.5),d[1]=a.y-u*(m.row+.5),f[0]=a.x+l*(y.col+.5),f[1]=a.y-u*(y.row+.5),Lv(d,i)-Lv(f,i)));n.length>0;){const m=n.pop();if(this._removeTile(m.id),--t===this.maxSize)break}return t}_removeTile(t){const i=this._tilePerId.get(t);this._removedFunc&&i&&this._removedFunc(i),yA(this._tilePerId,t)}}function yA(e,t){e.delete(t)}const $l=new is(0,0,0,0),As=new Map,Su=[],Gy=[];class iwe{constructor(t){this._previousScale=Number.POSITIVE_INFINITY,this.cachePolicy="keep",this.coveragePolicy="closest",this.resampling=!0,this.tileIndex=new Map,this.tiles=[],this.buffer=192,this.acquireTile=t.acquireTile,this.releaseTile=t.releaseTile,this.tileInfoView=t.tileInfoView,this.resampling=t.resampling==null||!!t.resampling,t.cachePolicy&&(this.cachePolicy=t.cachePolicy),t.coveragePolicy&&(this.coveragePolicy=t.coveragePolicy),t.buffer!=null&&(this.buffer=t.buffer),t.cacheSize&&(this._tileCache=new Sce(t.cacheSize,this.tileInfoView,i=>{this.releaseTile(i)}))}destroy(){this.tileIndex.clear()}update(t){const{resampling:i,tileIndex:s}=this,r=this.tileInfoView.getTileCoverage(t.state,this.buffer,this.coveragePolicy);if(Gy.length=0,Su.length=0,As.clear(),!r)return;const{minScale:n,maxScale:o}=this.tileInfoView.tileInfo,{spans:a,lodInfo:l}=r,{level:u}=l,{scale:d,center:f,resolution:m}=t.state,y=!t.stationary&&d>this._previousScale;if(this._previousScale=d,this.tiles.length=0,!i&&(d>n||d{this.releaseTile(_)}),s.clear(),Gy.length=0,Su.length=0,As.clear(),Kh.pool.release(r),!0;s.forEach(_=>_.visible=!0);let g=0,v=0;if(a.length>0)for(const{row:_,colFrom:x,colTo:$}of a)for(let I=x;I<=$;I++){g++;const T=$l.set(u,_,l.normalizeCol(I),l.getWorldForColumn(I)).id;if(s.has(T)){const k=s.get(T);k.isReady?(As.set(T,k),v++):y||this._addParentTile(T,As)}else{let k;if(this._tileCache&&this._tileCache.has(T)){if(k=this._tileCache.pop(T),this.tileIndex.set(T,k),k.isReady){As.set(T,k),v++;continue}}else k=this.acquireTile($l),this.tileIndex.set(T,k);y||this._addParentTile(T,As)}}const b=v===g;s.forEach((_,x)=>{if($l.set(x),As.has(x))return;const $=this.tileInfoView.intersects(r,$l),I=this.cachePolicy==="purge"?$l.level!==u:$l.level>u;!$||!y&&b?!I&&$||Su.push(x):_.isReady?I&&this.cachePolicy==="purge"&&this._hasReadyAncestor($l,u)?Su.push(x):Gy.push(x):I&&Su.push(x)});for(const _ of Gy){const x=s.get(_);x&&x.isReady&&As.set(_,x)}for(const _ of Su){const x=s.get(_);this._tileCache?this._tileCache.add(x):this.releaseTile(x),s.delete(_)}return As.forEach(_=>this.tiles.push(_)),s.forEach(_=>{As.has(_.key.id)||(_.visible=!1)}),this._tileCache&&this._tileCache.prune(u,f,m),Kh.pool.release(r),As.clear(),b}clear(t=!0){const{tileIndex:i}=this;t&&i.forEach(s=>{this.releaseTile(s)}),i.clear()}updateCacheSize(t){this._tileCache&&(this._tileCache.maxSize=t)}_addParentTile(t,i){let s=t,r=null;for(;s=this.tileInfoView.getTileParentId(s),s;)if(this.tileIndex.has(s)){if(r=this.tileIndex.get(s),r&&r.isReady){i.has(r.key.id)||i.set(r.key.id,r);break}}else if(this._tileCache&&this._tileCache.has(s)&&(r=this._tileCache.pop(s),this.tileIndex.set(s,r),r&&r.isReady)){i.has(r.key.id)||i.set(r.key.id,r);break}}_hasReadyAncestor(t,i){const s=nl();this.tileInfoView.getTileBounds(s,t,!0);for(const r of this.tileIndex.values())if(r.isReady&&r.key.level>=i&&r.key.levelthis._handleDoubleClick(s,i))}_handleDoubleClick(t,i){oI(t.data,"primary")&&(t.stopPropagation(),i?this._view.mapViewNavigation.zoomOut([t.data.x,t.data.y]):this._view.mapViewNavigation.zoomIn([t.data.x,t.data.y]))}}class Mce extends ei{constructor(t,i,s){super(!0),this.view=t,this.pointerType=i,this.registerIncoming("double-tap-drag",s,r=>this._handleDoubleTapDrag(r))}_handleDoubleTapDrag(t){const{data:i}=t,{pointerType:s}=i;if(s!==this.pointerType)return;t.stopPropagation();const{action:r,delta:n}=i,{view:o}=this,{mapViewNavigation:a}=o;switch(r){case"begin":{const{scale:l}=o;this._startScale=l,this._currentScale=l,this._previousDelta=n,a.begin();break}case"update":{if(this._previousDelta.y===n.y)return;this._previousDelta=n;const l=1.015**n.y,u=this._startScale*l,d=u/this._currentScale;a.setViewpointImmediate(d),this._currentScale=u;break}case"end":{const{constraints:l}=o,{effectiveLODs:u,snapToZoom:d}=l;if(!d||!u)return void a.end();const f=l.snapScale(this._currentScale),m=(n.y>0?Math.max(f,l.snapToPreviousScale(this._startScale)):Math.min(f,l.snapToNextScale(this._startScale)))/this._currentScale;a.zoom(m);break}}}}class n_{constructor(t){this._callbacks=t,this._currentCount=0,this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(t){const i=t.data,s=i.pointers.size;switch(i.action){case"start":this._currentCount=s,this._emitStart(t);break;case"added":this._emitEnd(this._previousEvent),this._currentCount=s,this._emitStart(t);break;case"update":this._emitUpdate(t);break;case"removed":this._startEvent&&this._emitEnd(this._previousEvent),this._currentCount=s,this._emitStart(t);break;case"end":this._emitEnd(t),this._currentCount=0}this._previousEvent=t}_emitStart(t){var i,s;this._startEvent=t,(s=(i=this._callbacks).condition)!=null&&s.call(i,this._currentCount,t)&&this._callbacks.start(this._currentCount,t,this._startEvent)}_emitUpdate(t){var i,s;(s=(i=this._callbacks).condition)!=null&&s.call(i,this._currentCount,t)&&this._callbacks.update(this._currentCount,t,this._startEvent)}_emitEnd(t){var i,s;(s=(i=this._callbacks).condition)!=null&&s.call(i,this._currentCount,t)&&this._callbacks.end(this._currentCount,t,this._startEvent),this._startEvent=null}}class $ce extends ei{constructor(t,i,s){super(!0),this.view=t,this.pointerAction=i,this.registerIncoming("drag",s,r=>this._handleDrag(r)),this.registerIncoming("pointer-down",()=>this.stopMomentumNavigation())}onInstall(t){super.onInstall(t),this._dragEventSeparator=new n_({start:(i,s)=>{this.view.mapViewNavigation.pan.begin(this.view,s.data),s.stopPropagation()},update:(i,s)=>{this.view.mapViewNavigation.pan.update(this.view,s.data),s.stopPropagation()},end:(i,s)=>{this.view.mapViewNavigation.pan.end(this.view,s.data),s.stopPropagation()},condition:(i,s)=>i===1&&oI(s.data,this.pointerAction)})}_handleDrag(t){const i=this.view.mapViewNavigation;i.pinch.zoomMomentum||i.pinch.rotateMomentum?this.stopMomentumNavigation():this._dragEventSeparator.handle(t)}stopMomentumNavigation(){this.view.mapViewNavigation.pan.stopMomentumNavigation()}}class Tce extends ei{constructor(t,i,s){super(!0),this._view=t,this.pointerAction=i;const r=this._view.mapViewNavigation;this._dragEventSeparator=new n_({start:(n,o)=>{r.rotate.begin(this._view,o.data),o.stopPropagation()},update:(n,o)=>{r.rotate.update(this._view,o.data),o.stopPropagation()},end:(n,o)=>{r.rotate.end(),o.stopPropagation()},condition:(n,o)=>n===1&&oI(o.data,this.pointerAction)}),this.registerIncoming("drag",s,n=>this._dragEventSeparator.handle(n))}}function ur(e){let t=e*e;return e<0&&(t*=-1),t}function Ice(e){return e.translation[0]=0,e.translation[1]=0,e.translation[2]=0,e.heading=0,e.tilt=0,e}function Ece(e,t,i){const s=i,r=e.state,n=e.device,o=t.tiltDirection==="forward-down"?1:-1,a=1;return n.deviceType==="standard"?(s.translation[0]=ur(r.axes[0]),s.translation[1]=ur(r.axes[1]),s.translation[2]=ur(r.buttons[7])-ur(r.buttons[6]),s.heading=ur(r.axes[2]),s.tilt=ur(r.axes[3])):n.deviceType==="spacemouse"&&(s.translation[0]=1.2*ur(r.axes[0]),s.translation[1]=1.2*ur(r.axes[1]),s.translation[2]=2*-ur(r.axes[2]),s.heading=1.2*ur(r.axes[5]),s.tilt=1.2*ur(r.axes[3])),s.tilt*=o,XL(s.translation,s.translation,a),s}function kce(e){return e.translation[0]===0&&e.translation[1]===0&&e.translation[2]===0&&e.heading===0&&e.tilt===0&&e.zoom===0}class Cce extends ei{constructor(t){super(!0),this._view=t,this._frameTask=null,this._watchHandles=new qi,this._currentDevice=null,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._handle=this.registerIncoming("gamepad",i=>this._handleGamePadEvent(i)),this._handle.pause()}onInstall(t){super.onInstall(t),this._watchHandles.add([Z(()=>{var i;return(i=this._view.navigation.gamepad)==null?void 0:i.enabled},i=>{i?(this._handle.resume(),this._frameTask||(this._frameTask=Dh({update:s=>this._frameUpdate(s.deltaTime)}))):(this._handle.pause(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null))},Le)])}onUninstall(){this._watchHandles.removeAll(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null),super.onUninstall()}_handleGamePadEvent(t){const i=this._view.navigation.gamepad.device;i&&t.data.device!==i||this._currentDevice&&this._currentDevice!==t.data.device||(t.data.action==="end"?(this._currentDevice=null,Ice(this._transformation)):(this._currentDevice=t.data.device,Ece(t.data,this._view.navigation.gamepad,this._transformation)))}_frameUpdate(t){const i=this._transformation;if(kce(i))return;const s=this._view.viewpoint.clone(),r=this._view.navigation.gamepad.velocityFactor,n=Ace*r*t;r_(s,s,[i.translation[0]*n,-i.translation[1]*n]);const o=1+i.translation[2]*Oce*t,a=this._view.constraints.rotationEnabled?-i.heading*Pce*t:0,l=this._view.size,u=[l[0]/2,l[1]];Lj(s,s,o,a,u,l);const d=this._view.constraints.constrain(s,this._view.viewpoint);this._view.viewpoint=d}}const Pce=.06,Ace=.7,Oce=6e-4;class Rce extends ei{constructor(t,i,s){super(!0),this.view=t,this.keys=i,this._pressed=!1,this._keyMap={[i.left]:"left",[i.right]:"right",[i.up]:"up",[i.down]:"down"},this.registerIncoming("key-down",s,r=>this._handleKeyDown(r)),this.registerIncoming("key-up",s,r=>this._handleKeyUp(r)),this.registerIncoming("blur",s,()=>this._handleBlur())}_handleKeyDown(t){t.data.repeat||this._handleKey(t,!0)}_handleKeyUp(t){this._handleKey(t,!1)}_handleBlur(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(t,i){const s=this._keyMap[t.data.key];if(this._pressed=s!=null,this._pressed){if(i)switch(this.view.mapViewNavigation.begin(),s){case"left":this.view.mapViewNavigation.continousPanLeft();break;case"right":this.view.mapViewNavigation.continousPanRight();break;case"up":this.view.mapViewNavigation.continousPanUp();break;case"down":this.view.mapViewNavigation.continousPanDown()}else this._pressed=!1,this.view.mapViewNavigation.stop();t.stopPropagation()}}}class Lce extends ei{constructor(t,i,s){super(!0),this.view=t,this.keys=i,this._pressed=!1,this._keyToDirection={[i.clockwiseOption1]:"clockwise",[i.clockwiseOption2]:"clockwise",[i.counterClockwiseOption1]:"counterClockwise",[i.counterClockwiseOption2]:"counterClockwise",[i.resetOption1]:"reset",[i.resetOption2]:"reset"},this.registerIncoming("key-down",s,r=>this._handleKeyDown(r)),this.registerIncoming("key-up",s,r=>this._handleKeyUp(r)),this.registerIncoming("blur",s,()=>this._handleBlur())}_handleKeyDown(t){t.data.repeat||this._handleKey(t,!0)}_handleKeyUp(t){this._handleKey(t,!1)}_handleBlur(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(t,i){const s=t.modifiers;if(s.size>0&&!s.has("Shift")||!this.view.constraints.rotationEnabled)return;const r=this._keyToDirection[t.data.key];if(this._pressed=r!=null,this._pressed){if(i)switch(this.view.mapViewNavigation.begin(),r){case"clockwise":this.view.mapViewNavigation.continousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();t.stopPropagation()}}}var bh;(function(e){e[e.IN=0]="IN",e[e.OUT=1]="OUT"})(bh||(bh={}));class Fce extends ei{constructor(t,i,s){super(!0),this.view=t,this.keys=i,this._keysToZoomAction={},this.registerIncoming("key-down",s,r=>this._handleKeyDown(r)),i.zoomIn.forEach(r=>this._keysToZoomAction[r]=bh.IN),i.zoomOut.forEach(r=>this._keysToZoomAction[r]=bh.OUT)}_handleKeyDown(t){this._handleKey(t)}_handleKey(t){const i=t.modifiers;if(i.size>0&&!i.has("Shift"))return;const{key:s}=t.data;if(!(s in this._keysToZoomAction))return;const r=this._keysToZoomAction[s],{mapViewNavigation:n}=this.view;let o=null;switch(r){case bh.IN:o=n.zoomIn();break;case bh.OUT:o=n.zoomOut();break;default:return}n.begin(),o.then(()=>n.end()),t.stopPropagation()}}const Dce=.6;class Nce extends ei{constructor(t,i){super(!0),this._view=t,this._canZoom=!0,this.registerIncoming("mouse-wheel",i,s=>this._handleMouseWheel(s))}_handleMouseWheel(t){if(!this._view.navigation.mouseWheelZoomEnabled||(t.preventDefault(),t.stopPropagation(),!this._canZoom))return;const i=this._view.mapViewNavigation,{x:s,y:r,deltaY:n}=t.data,o=1/Dce**(1/60*n),a=i.zoom(o,[s,r]);a&&(this._canZoom=!1,a.catch(()=>{}).then(()=>{this._canZoom=!0,i.end()}))}}class jce extends ei{constructor(t){super(!0),this.view=t,this.registerIncoming("drag",s=>this._handleDrag(s)),this.registerIncoming("pointer-down",()=>this._stopMomentumNavigation());const i=this.view.mapViewNavigation;this._dragEventSeparator=new n_({start:(s,r)=>{i.pinch.begin(this.view,r.data),r.stopPropagation()},update:(s,r)=>{i.pinch.update(this.view,r.data),r.stopPropagation()},end:(s,r)=>{i.pinch.end(this.view),r.stopPropagation()},condition:s=>s>=2})}_handleDrag(t){this._dragEventSeparator.handle(t)}_stopMomentumNavigation(){this.view.mapViewNavigation.pinch.stopMomentumNavigation()}}function vA(e){const t=e.native;return t?{buttons:t.buttons.map(i=>i.pressed?i.value?i.value:1:0),axes:t.axes.map(i=>Bce(i,e.axisThreshold))}:{buttons:[],axes:[]}}function Vce(e,t){if(e.axes.length!==t.axes.length||e.buttons.length!==t.buttons.length)return!1;for(let i=0;i{this._connectGamepad(n.gamepad)},this._onDisconnectGamepad=n=>{const o=n.gamepad,a=o.index,l=this._inputDevices[a];l&&(this._emitGamepadEvent(o,vA(l),!1),this._inputDevices.splice(a,1),this._latestUpdate.splice(a,1),this._input.gamepad.devices.remove(l),this.ensurePollingState())},this._frameTask=null,this._latestUpdate=new Array,this._inputDevices=new Array,this._callback=null;const s="getGamepads"in window.navigator,r=window.isSecureContext;this.supported=s&&r,this.supported&&(this._forEachGamepad(n=>this._connectGamepad(n)),window.addEventListener("gamepadconnected",this._onConnectGamepad),window.addEventListener("gamepaddisconnected",this._onDisconnectGamepad),this.ensurePollingState())}destroy(){this.hasEventListeners=!1,this.supported&&(window.removeEventListener("gamepadconnected",this._onConnectGamepad),window.removeEventListener("gamepaddisconnected",this._onDisconnectGamepad))}set hasEventListeners(t){this._hasEventListeners!==t&&(this._hasEventListeners=t,this.ensurePollingState())}get _eventsEnabled(){return this.supported&&this._inputDevices.length>0&&this._hasEventListeners}set onEvent(t){this._callback=t}_connectGamepad(t){const i=new ZT(t);i.deviceType!=="unknown"&&(this._inputDevices[t.index]=i,this._input.gamepad.devices.add(i)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){this._frameTask==null&&(this._frameTask=Dh({update:()=>this._readGamepadState()}))}_stopPolling(){this._frameTask!=null&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const t=document.hasFocus(),i=this._element.contains(document.activeElement),s=this._input.gamepad.enabledFocusMode==="document"&&!t||this._input.gamepad.enabledFocusMode==="view"&&!i;this._forEachGamepad(r=>{const n=this._inputDevices[r.index];if(!n)return;const o=this._latestUpdate[r.index],a=vA(n),l=s||zce(a);o&&(o.timestamp===r.timestamp||!o.active&&l||Vce(o.state,a))||this._emitGamepadEvent(r,a,!l)})}_forEachGamepad(t){const i=window.navigator.getGamepads();for(let s=0;sthis._callback("gamepad",s)}destroy(){this._callback=null,this.activeEvents=null,this._activePointerCaptures.forEach(t=>{this._releasePointerCaptureSafe(t)}),this._gamepadSource=$t(this._gamepadSource),this._activePointerCaptures=null,this._removeTouchAction(),this._element.removeEventListener("keydown",this._preventAltKeyDefault)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(t){this._browserTouchPanningEnabled=t,this._updateTouchAction(),this._updateTouchEventHandling()}set onEventReceived(t){this._callback=t}set activeEvents(t){for(const i in this._active)if(!t||!t.has(i)){const s=this._active[i];this._element.removeEventListener(Vw[i],s),delete this._active[i]}t&&t.forEach(i=>{if(!this._active[i]&&Vw[i]){const s=(this._eventHandlers[i]||this._handleDefault).bind(this,i);this._element.addEventListener(Vw[i],s),this._active[i]=s}}),this._gamepadSource.hasEventListeners=t&&t.has("gamepad")}setPointerCapture(t,i){i?(this._element.setPointerCapture(t.pointerId),this._activePointerCaptures.add(t.pointerId)):(this._releasePointerCaptureSafe(t.pointerId),this._activePointerCaptures.delete(t.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?Mu.touchNone:Mu.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?Mu.touchPan:Mu.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(Mu.touchNone),this._element.classList.remove(Mu.touchPan),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_releasePointerCaptureSafe(t){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(t))return;this._element.releasePointerCapture(t)}catch{}}_updateNormalizedPointerLikeEvent(t,i){const s=dj(this._element,t);return o_.test.disableSubpixelCoordinates&&(s.x=Math.round(s.x),s.y=Math.round(s.y)),i.x=s.x,i.y=s.y,i}_handleKey(t,i){const s=Poe(i);s&&t==="key-up"&&this._keyDownState.delete(s);const r={native:i,key:s,repeat:s&&this._keyDownState.has(s)};s&&t==="key-down"&&this._keyDownState.add(r.key),this._callback(t,r)}_handlePointer(t,i){const s=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});this._callback(t,s)}_handlePointerPreventDefault(t,i){const s=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});i.preventDefault(),this._callback(t,s)}_handleMouseWheel(t,i){let s=i.deltaY;switch(i.deltaMode){case 0:(bA||_A)&&(s=s/document.documentElement.clientHeight*600);break;case 1:s*=30;break;case 2:s*=900}bA||_A?s*=.7:qce||Wce?s*=.6:Gce&&(s*=1.375);const r=100,n=Math.abs(s);n>r&&(s=s/n*200/(1+Math.exp(-.02*(n-r))));const o=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,deltaY:s});this._callback(t,o)}_handlePointerCaptureLost(t,i){this._activePointerCaptures.delete(i.pointerId),this._handleDefault(t,i)}_handleDefault(t,i){const s={native:i};i.preventDefault(),this._callback(t,s)}_preventAltKeyDefault(t){t.key==="Alt"&&t.preventDefault()}_preventMultiTouchPanning(t){t.touches.length>1&&t.preventDefault()}}o_.test={disableSubpixelCoordinates:!1};const Vw={"key-down":"keydown","key-up":"keyup","pointer-down":"pointerdown","pointer-up":"pointerup","pointer-move":"pointermove","mouse-wheel":"wheel","pointer-capture-got":"gotpointercapture","pointer-capture-lost":"lostpointercapture","context-menu":"contextmenu","pointer-enter":"pointerenter","pointer-leave":"pointerleave","pointer-cancel":"pointercancel",focus:"focus",blur:"blur"};class Hce extends ei{constructor(){super(!0),this.registerIncoming("context-menu",t=>{t.data.native.preventDefault()})}}function aI(e,t){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)}function Yce(e,t){const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}function Jce(e,t){if(t?(t.radius=0,t.center.x=0,t.center.y=0):t={radius:0,center:ns()},e.length===0)return t;if(e.length===1)return t.center.x=e[0].x,t.center.y=e[0].y,t;if(e.length===2){const[$,I]=e,[T,k]=[I.x-$.x,I.y-$.y];return t.radius=Math.sqrt(T*T+k*k)/2,t.center.x=($.x+I.x)/2,t.center.y=($.y+I.y)/2,t}let i=0,s=0;for(let $=0;$$.x-i),n=e.map($=>$.y-s);let o=0,a=0,l=0,u=0,d=0,f=0,m=0;for(let $=0;$t.doubleClickTimer=Bt(t.doubleClickTimer))}get hasPendingInputs(){return Zv(this._pointerState,t=>t.doubleClickTimer!=null)}_clearDoubleClickTimer(t,i){const s=this._pointerState.get(t);s&&(s.doubleClickTimer=Bt(s.doubleClickTimer),i&&this._click.emit(s.event.data,void 0,s.event.modifiers),this._pointerState.delete(t),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(t){const i=this._pointerState.get(t);i.pointerDownCount===1&&this._click.emit(i.event.data,void 0,i.event.modifiers),i.doubleClickTimer=null,this._pointerState.delete(t),this.refreshHasPendingInputs()}_getPointerId(t){const{pointerId:i,pointerType:s,button:r}=t.native;return s==="mouse"?`${i}:${r}`:`${s}`}_handleImmediateClick(t){const i=t.data,{pointerType:s}=i.native,r=this._getPointerId(i);if(!this._pointerState.has(r))return void this._startClick(t);const n=this._pointerState.get(r),{data:o,modifiers:a}=n.event,l=s==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;aI(o,i)>l?(this._clearDoubleClickTimer(r,!0),this._startClick(t)):(this._clearDoubleClickTimer(r,!1),n.pointerDownCount===2&&this._doubleClick.emit(o,void 0,a))}_handlePointerDown(t){const i=Hc(t.data),s=this._pointerState.get(i);s&&(s.pointerDownCount+=1)}_startClick(t){const{data:i}=t,{native:{pointerType:s}}=i,r=Hc(i),n=s==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._doubleClickTimeoutExceeded(r),n),a=1;this._pointerState.set(r,{event:t,doubleClickTimer:o,pointerDownCount:a}),this.refreshHasPendingInputs()}}class Zce extends ei{constructor(t=Xs.maximumDoubleClickDelay,i=Xs.maximumDoubleClickDistance,s=Xs.maximumDoubleTouchDelay,r=Xs.maximumDoubleTouchDistance,n=Im){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=i,this._maximumDoubleTouchDelay=s,this._maximumDoubleTouchDistance=r,this._clock=n,this._doubleTapDragReady=!1,this._doubleTapDragActive=!1,this._dragStartCenter=ns(0,0),this._pointerState=new Map,this._doubleTapDrag=this.registerOutgoing("double-tap-drag"),this._dragEventSeparator=new n_({start:(o,a)=>this._dragStart(o,a),update:(o,a)=>this._dragUpdate(a),end:(o,a)=>this._dragEnd(a)}),this.registerIncoming("drag",o=>this._dragEventSeparator.handle(o)),this.registerIncoming("pointer-down",o=>this._handlePointerDown(o)),this.registerIncoming("pointer-up",()=>this._handlePointerUp())}onUninstall(){this._pointerState.forEach(t=>{t.doubleTapTimeout=Bt(t.doubleTapTimeout)})}get hasPendingInputs(){return Zv(this._pointerState,t=>t.doubleTapTimeout!=null)}_clearPointerDown(t){const i=this._pointerState.get(t);i&&(i.doubleTapTimeout=Bt(i.doubleTapTimeout),this._pointerState.delete(t),this.refreshHasPendingInputs())}_createDoubleTapDragData(t,i,s){const{button:r,buttons:n,pointer:o,pointers:a,pointerType:l,timestamp:u}=s;return{action:t,delta:i,button:r,buttons:n,pointer:o,pointers:a,pointerType:l,timestamp:u}}_dragStart(t,i){if(!this._doubleTapDragReady||t!==1)return;this._doubleTapDragReady=!1,this._doubleTapDragActive=!0;const{data:s,modifiers:r}=i,{center:n}=s;this._dragStartCenter=n;const o=this._createDoubleTapDragData("begin",ns(0,0),s);this._doubleTapDrag.emit(o,void 0,r),i.stopPropagation()}_dragUpdate(t){if(!this._doubleTapDragActive)return;const{data:i,modifiers:s}=t,{center:r}=i,n=ns(r.x-this._dragStartCenter.x,r.y-this._dragStartCenter.y),o=this._createDoubleTapDragData("update",n,i);this._doubleTapDrag.emit(o,void 0,s),t.stopPropagation()}_dragEnd(t){if(!this._doubleTapDragActive)return;const{data:i,modifiers:s}=t,{center:r}=i,n=ns(r.x-this._dragStartCenter.x,r.y-this._dragStartCenter.y),o=this._createDoubleTapDragData("end",n,i);this._doubleTapDrag.emit(o,void 0,s),this._doubleTapDragActive=!1,t.stopPropagation()}_handlePointerDown(t){const{data:i}=t,s=Hc(i),r=this._pointerState.get(s),{pointerType:n}=i.native;if(r){const o=n==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;this._clearPointerDown(s),aI(r.event.data,i)>o?this._storePointerDown(t):this._doubleTapDragReady=!0}else this._storePointerDown(t)}_handlePointerUp(){this._doubleTapDragReady=!1}_storePointerDown(t){const{data:i}=t,{pointerType:s}=i.native,r=Hc(i),n=s==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._clearPointerDown(r),n);this._pointerState.set(r,{event:t,doubleTapTimeout:o}),this.refreshHasPendingInputs()}}class Qce extends ei{constructor(t){super(!1),this._navigationTouch=t,this._startStateModifiers=new Set,this._activePointerMap=new Map,this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._drag=this.registerOutgoing("drag"),this.registerIncoming("pointer-drag",this._handlePointerDrag.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-capture-lost",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-cancel",this._handlePointerUpAndPointerLost.bind(this))}_createPayload(t,i,s,r){return{action:t,pointerType:this._pointerType,button:this._mouseButton,buttons:i.buttons,timestamp:r,pointers:Kce(this._activePointerMap),pointer:i,angle:s.angle,radius:s.radius,center:s.center}}_addPointer(t){const i=t.native.pointerId,s=Wy(this._activePointerMap).angle,r={event:t,initialAngle:0,lastAngle:0};this._activePointerMap.set(i,r);const n=m0(r,Zj(this._activePointerMap));r.initialAngle=n,r.lastAngle=n,this._updatePointerAngles(s)}_updatePointer(t){if(t&&t.x==null&&t.y==null)return;const i=t.native.pointerId,s=this._activePointerMap.get(i);s?s.event=t:this._addPointer(t)}_removePointer(t){const i=Wy(this._activePointerMap).angle;this._activePointerMap.delete(t),this._updatePointerAngles(i)}_updatePointerAngles(t){const i=Wy(this._activePointerMap);this._activePointerMap.forEach(s=>{s.initialAngle=m0(s,i)-t,s.lastAngle=m0(s,i)-t})}_emitEvent(t,i,s){const r=Wy(this._activePointerMap);this._drag.emit(this._createPayload(t,i,r,s),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(t){const i=t.data.native.pointerId,s=t.timestamp;this._activePointerMap.get(i)&&(this._activePointerMap.size===1?(this._updatePointer(t.data),!this._isCurrentDragSuppressed&&this._emitEvent("end",t.data,s),this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._removePointer(i)):(this._removePointer(i),this._emitEvent("removed",t.data,t.timestamp)))}_handlePointerDrag(t){const i=t.data,s=i.currentEvent,r=t.timestamp;switch(i.action){case"start":case"update":this._isDragging?this._activePointerMap.has(s.native.pointerId)?(this._updatePointer(s),!this._isCurrentDragSuppressed&&this._emitEvent("update",s,r)):(this._addPointer(s),this._emitEvent("added",s,r),this._isCurrentDragSuppressed=this._isSuppressed):(this._updatePointer(s),this._pointerType=t.data.startEvent.pointerType,this._mouseButton=t.data.startEvent.button,this._startStateModifiers=t.modifiers,this._isDragging=!0,this._isCurrentDragSuppressed=this._isSuppressed,!this._isCurrentDragSuppressed&&this._emitEvent("start",s,r))}}get _isSuppressed(){return!!this._navigationTouch&&!this._navigationTouch.browserTouchPanEnabled&&this._pointerType==="touch"&&this._activePointerMap.size===1}}function Zj(e){const t=[];return e.forEach(i=>{t.push(ns(i.event.x,i.event.y))}),Jce(t)}function Wy(e){const t=Zj(e);let i=0;return e.forEach(s=>{let r=m0(s,t),n=r-s.lastAngle;for(;n>Math.PI;)n-=2*Math.PI;for(;n<-Math.PI;)n+=2*Math.PI;r=s.lastAngle+n,s.lastAngle=r,i+=r-s.initialAngle}),i/=e.size||1,{angle:i,radius:t.radius,center:t.center}}function Kce(e){const t=new Map;return e.forEach((i,s)=>t.set(s,i.event)),t}function m0(e,t){const i=e.event,s=i.x-t.center.x,r=i.y-t.center.y;return Math.atan2(r,s)}var wA;(function(e){e[e.Left=0]="Left",e[e.Middle=1]="Middle",e[e.Right=2]="Right",e[e.Back=3]="Back",e[e.Forward=4]="Forward",e[e.Undefined=-1]="Undefined"})(wA||(wA={}));class eue extends ei{constructor(t=Xs.maximumDoubleClickDelay,i=Xs.maximumDoubleClickDistance,s=Xs.maximumDoubleTouchDelay,r=Xs.maximumDoubleTouchDistance,n=Im){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=i,this._maximumDoubleTouchDelay=s,this._maximumDoubleTouchDistance=r,this._clock=n,this._pointerState=new Map,this._immediateDoubleClick=this.registerOutgoing("immediate-double-click"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUp.bind(this))}onUninstall(){this._pointerState.forEach(t=>{t.immediateDoubleClick&&t.immediateDoubleClick.timeoutHandle.remove()}),super.onUninstall()}_handlePointerDown(t){const i=t.data,s=Hc(i);if(!this._pointerState.has(s)){const r={downButton:i.native.button,immediateDoubleClick:null};this._pointerState.set(s,r),this.startCapturingPointer(i.native)}}_handlePointerUp(t){const i=t.data,s=Hc(i),r=this._pointerState.get(s);if(r&&r.downButton===i.native.button){const n=r.immediateDoubleClick;if(n){n.timeoutHandle.remove();const o=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;aI(n,t.data)>o?this._startImmediateDoubleClick(t,r):(this._immediateDoubleClick.emit(t.data,void 0,n.modifiers),this._removeState(i))}else this._startImmediateDoubleClick(t,r)}}_startImmediateDoubleClick(t,i){const s=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay;i.immediateDoubleClick={x:t.data.x,y:t.data.y,modifiers:t.modifiers,timeoutHandle:this._clock.setTimeout(()=>this._removeState(t.data),s)}}_removeState(t){const i=Hc(t);this._pointerState.delete(i),this.stopCapturingPointer(t.native),this.refreshHasPendingInputs()}}const Wd={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500};class tue extends ei{constructor(t=Wd.maximumClickDelay,i=Wd.movementUntilMouseDrag,s=Wd.movementUntilPenDrag,r=Wd.movementUntilTouchDrag,n=Wd.holdDelay,o=Im){super(!1),this._maximumClickDelay=t,this._movementUntilMouseDrag=i,this._movementUntilPenDrag=s,this._movementUntilTouchDrag=r,this._holdDelay=n,this._clock=o,this._pointerState=new Map,this._pointerDrag=this.registerOutgoing("pointer-drag"),this._immediateClick=this.registerOutgoing("immediate-click"),this._pointerHold=this.registerOutgoing("hold"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",a=>{this._handlePointerLoss(a,"pointer-up")}),this.registerIncoming("pointer-capture-lost",a=>{this._handlePointerLoss(a,"pointer-capture-lost")}),this.registerIncoming("pointer-cancel",a=>{this._handlePointerLoss(a,"pointer-cancel")}),this._moveHandle=this.registerIncoming("pointer-move",this._handlePointerMove.bind(this)),this._moveHandle.pause()}onUninstall(){this._pointerState.forEach(t=>{t.holdTimeout=Bt(t.holdTimeout)}),super.onUninstall()}_handlePointerDown(t){const i=t.data,s=i.native.pointerId;let r=null;this._pointerState.size===0&&(r=this._clock.setTimeout(()=>{const o=this._pointerState.get(s);if(o){if(!o.isDragging){const a=o.previousEvent;this._pointerHold.emit(a,void 0,t.modifiers),o.holdEmitted=!0}o.holdTimeout=null}},this._holdDelay));const n={startEvent:i,previousEvent:i,startTimestamp:t.timestamp,isDragging:!1,downButton:i.native.button,holdTimeout:r,modifiers:new Set};this._pointerState.set(s,n),this.startCapturingPointer(i.native),this._moveHandle.resume(),this._pointerState.size>1&&this._startDragging(t)}_createPointerDragData(t,i,s){return{action:t,startEvent:i.startEvent,previousEvent:i.previousEvent,currentEvent:s}}_handlePointerMove(t){const i=t.data,s=i.native.pointerId,r=this._pointerState.get(s);r&&(r.isDragging?this._pointerDrag.emit(this._createPointerDragData("update",r,i),void 0,r.modifiers):Yce(i,r.startEvent)>this._getDragThreshold(i.native.pointerType)&&this._startDragging(t),r.previousEvent=i)}_getDragThreshold(t){switch(t){case"touch":return this._movementUntilTouchDrag;case"pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(t){const i=t.data,s=i.native.pointerId;this._pointerState.forEach(r=>{r.holdTimeout!=null&&(r.holdTimeout.remove(),r.holdTimeout=null),r.isDragging||(r.modifiers=t.modifiers,r.isDragging=!0,s===r.startEvent.native.pointerId?this._pointerDrag.emit(this._createPointerDragData("start",r,i)):this._pointerDrag.emit(this._createPointerDragData("start",r,r.previousEvent),t.timestamp))})}_handlePointerLoss(t,i){const s=t.data,r=s.native.pointerId,n=this._pointerState.get(r);n&&(n.holdTimeout!=null&&(n.holdTimeout.remove(),n.holdTimeout=null),n.isDragging?this._pointerDrag.emit(this._createPointerDragData("end",n,i==="pointer-up"?s:n.previousEvent),void 0,n.modifiers):i==="pointer-up"&&n.downButton===s.native.button&&t.timestamp-n.startTimestamp<=this._maximumClickDelay&&!n.holdEmitted&&this._immediateClick.emit(s),this._pointerState.delete(r),this.stopCapturingPointer(s.native),this._pointerState.size===0&&this._moveHandle.pause())}}const Hy={counter:"Ctrl",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwiseOption1:"a",clockwiseOption2:"A",counterClockwiseOption1:"d",counterClockwiseOption2:"D",resetOption1:"n",resetOption2:"N"}};let uc=class extends oe{constructor(){super(...arguments),this._handles=new qi}initialize(){const e=()=>{var t;return(t=this.view)==null?void 0:t.ready};this._handles.add([Qs(()=>!e(),()=>this._disconnect()),Qs(e,()=>this._connect())])}destroy(){this._handles&&(this._handles.removeAll(),this._handles=null),this._disconnect()}get latestPointerType(){var e;return(e=this._inputManager)==null?void 0:e.latestPointerType}get latestPointerLocation(){var e;return(e=this._inputManager)==null?void 0:e.latestPointerLocation}get multiTouchActive(){var e,t;return(t=(e=this._inputManager)==null?void 0:e.multiTouchActive)!=null?t:!1}_disconnect(){this.view.viewEvents.disconnect(),this._inputManager=$t(this._inputManager)}_connect(){const e=this.view.surface,t=new o_(e,this.view.input),i=[new eue,new tue,new Xce,new Qce(this.view.navigation),new Zce],s=new cn({eventSource:t,recognizers:i});s.installHandlers("prevent-context-menu",[new Hce],el.INTERNAL),s.installHandlers("navigation",[new jce(this.view),new Cce(this.view),new Nce(this.view),new gA(this.view),new gA(this.view,[Hy.counter]),new $ce(this.view,"primary"),new Rce(this.view,Hy.pan),new Fce(this.view,Hy.zoom),new Lce(this.view,Hy.rotate),new Tce(this.view,"secondary"),new Mce(this.view,"touch")],el.INTERNAL),this.view.viewEvents.connect(s),this._source=t,this._inputManager=s,Z(()=>{var r,n;return(n=(r=this.view)==null?void 0:r.navigation)==null?void 0:n.browserTouchPanEnabled},r=>{this._source&&(this._source.browserTouchPanningEnabled=!r)},Le)}get test(){return{inputManager:this._inputManager}}};c([h()],uc.prototype,"view",void 0),c([h()],uc.prototype,"latestPointerType",null),c([h()],uc.prototype,"latestPointerLocation",null),c([h()],uc.prototype,"multiTouchActive",null),uc=c([S("esri.views.2d.input.MapViewInputManager")],uc);const iue=uc;var xA,SA,MA,Qj={exports:{}};xA=Qj,SA=function(){function e(r,n,o,a,l){t(r,n,o||0,a||r.length-1,l||s)}function t(r,n,o,a,l){for(;a>o;){if(a-o>600){var u=a-o+1,d=n-o+1,f=Math.log(u),m=.5*Math.exp(2*f/3),y=.5*Math.sqrt(f*m*(u-m)/u)*(d-u/2<0?-1:1);t(r,n,Math.max(o,Math.floor(n-d*m/u+y)),Math.min(a,Math.floor(n+(u-d)*m/u+y)),l)}var g=r[n],v=o,b=a;for(i(r,o,n),l(r[a],g)>0&&i(r,o,a);v0;)b--}l(r[o],g)===0?i(r,o,b):i(r,++b,a),b<=n&&(o=b+1),n<=b&&(a=b-1)}}function i(r,n,o){var a=r[n];r[n]=r[o],r[o]=a}function s(r,n){return rn?1:0}return e},(MA=SA())!==void 0&&(xA.exports=MA);const sue=Qj.exports;function Dv(e,t){if(!(this instanceof Dv))return new Dv(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&(typeof t=="function"?this.toBBox=t:this._initFormat(t)),this.clear()}function rue(e,t,i){if(!i)return t.indexOf(e);for(var s=0;s=e.minX&&t.maxY>=e.minY}function ah(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function IA(e,t,i,s,r){for(var n,o=[t,i];o.length;)(i=o.pop())-(t=o.pop())<=s||(n=t+Math.ceil((i-t)/s/2)*s,sue(e,n,t,i,r),o.push(t,n,n,i))}Dv.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],s=this.toBBox;if(!Jy(e,t))return i;for(var r,n,o,a,l=[];t;){for(r=0,n=t.children.length;r=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(r,n,t)},_split:function(e,t){var i=e[t],s=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,s);var n=this._chooseSplitIndex(i,r,s),o=ah(i.children.splice(n,i.children.length-n));o.height=i.height,o.leaf=i.leaf,$u(i,this.toBBox),$u(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(e,t){this.data=ah([e,t]),this.data.height=e.height+1,this.data.leaf=!1,$u(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var s,r,n,o,a,l,u,d;for(l=u=1/0,s=t;s<=i-t;s++)o=oue(r=Zp(e,0,s,this.toBBox),n=Zp(e,s,i,this.toBBox)),a=zw(r)+zw(n),o=t;r--)n=e.children[r],Qp(l,e.leaf?o(n):n),u+=Yy(l);return u},_adjustParentBBoxes:function(e,t,i){for(var s=i;s>=0;s--)Qp(t[s],e)},_condense:function(e){for(var t,i=e.length-1;i>=0;i--)e[i].children.length===0?i>0?(t=e[i-1].children).splice(t.indexOf(e[i]),1):this.clear():$u(e[i],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]+"};")}};class Nv{constructor(t,i){this.key=new is(0,0,0,0),this.bounds=nl(),this.objectIds=new Set,this.key.set(i);const s=t.getLODInfoAt(this.key);this.tileInfoView=t,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 Ze.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 t=this.key.getChildKeys(),i=Vi.acquire();for(let s=0;s({minX:i.bounds[0],minY:i.bounds[1],maxX:i.bounds[2],maxY:i.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=t}destroy(){this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(t){return this._tiles.has(t)}get(t){return this._tiles.get(t)}boundsIntersections(t){return this._index.search({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]})}updateTiles(t){const i={added:[],removed:[]};for(const s of t.added)if(!this.has(s)){const r=new Nv(this.tileScheme,s);this._tiles.set(s,r),this._index.insert(r),i.added.push(r)}for(const s of t.removed)if(this.has(s)){const r=this.get(s);this._tiles.delete(s),this._index.remove(r),i.removed.push(r)}this.tiles.length=0,this._tiles.forEach(s=>this.tiles.push(s)),(i.added.length||i.removed.length)&&this.emit("update",i)}setViewState(t){const i=this.tileScheme.getTileCoverage(t,0);if(!i)return;const{spans:s,lodInfo:r}=i,{level:n}=r;if(s.length>0)for(const{row:o,colFrom:a,colTo:l}of s)for(let u=a;u<=l;u++){const d=aue.set(n,o,r.normalizeCol(u),r.getWorldForColumn(u)).id;if(Uw.add(d),!this.has(d)){const f=new Nv(this.tileScheme,d);this._tiles.set(d,f),this._index.insert(f),this.tiles.push(f),Tl.added.push(f)}}for(let o=this.tiles.length-1;o>=0;o--){const a=this.tiles[o];Uw.has(a.id)||(this._tiles.delete(a.id),this.tiles.splice(o,1),this._index.remove(a),Tl.removed.push(a))}(Tl.added.length||Tl.removed.length)&&this.emit("update",Tl),Kh.pool.release(i),Uw.clear(),Tl.added.length=0,Tl.removed.length=0}}let cue=0,Ea=class extends oe{constructor(){super(...arguments),this.color=new pe([0,255,255]),this.haloOpacity=1,this.fillOpacity=.25}get version(){return cue++}};c([h({readOnly:!0})],Ea.prototype,"version",null),c([h({type:pe})],Ea.prototype,"color",void 0),c([h({type:pe})],Ea.prototype,"haloColor",void 0),c([h()],Ea.prototype,"haloOpacity",void 0),c([h()],Ea.prototype,"fillOpacity",void 0),Ea=c([S("esri.views.2d.support.HighlightOptions")],Ea);const Kj=Ea,uue=e=>e.includes("Brush");class e8{constructor(){this._names=new Map}begin(t){this._names.has(t)||(this._names.set(t,!1),uue(t)&&this.record("Esri.FirstDraw"),performance.mark(`Esri.${t}.Start`))}end(t){this._names.has(t)&&!this._names.get(t)&&(this._names.set(t,!0),performance.mark(`Esri.${t}.End`))}record(t){this._names.has(t)||(this._names.set(t,!0),performance.mark(`Esri.${t}`))}}function hue(e,t,i,s,r,n,o,a){let l;e.ignorePadding&&(s={left:0,right:0,top:0,bottom:0}),e.width!=null&&e.height!=null?l=[e.width,e.height]:e.width==null&&e.height!=null?l=[e.height,e.height]:e.width!=null&&e.height==null?l=[e.width,e.width]:e.width==null&&e.height==null&&(l=null);const u=i[0]-(s.left+s.right),d=i[1]-(s.top+s.bottom);let f,m,y=e.area||{x:0,y:0,width:u,height:d};if(l){const g=u/d,v=l[0]/l[1];if(v>g){const b=y.width/v;y={x:y.x,y:Math.round(y.y+(y.height-b)/2),width:y.width,height:Math.round(b)}}else{const b=y.height*v;y={x:Math.round(y.x+(y.width-b)/2),y:y.y,width:Math.round(b),height:y.height}}}else l=[y.width,y.height];return l[0]>y.width?(f=Math.min(l[0]/y.width,t),m=l[0]/y.width/f):(f=1,m=l[0]/y.width),{resolutionScale:f,cropArea:{x:Math.round((y.x+s.left)*f),y:Math.round((y.y+s.top)*f),width:Math.round(y.width*f),height:Math.round(y.height*f)},outputScale:m,format:r,quality:n,children:o,rotation:a}}function due(e,t,i){const{ctx:s,canvas:r}=t8(e,i),n=s.getImageData(0,0,e.width,e.height),o=mue(r,t);return i8(r),{dataUrl:o,data:n}}function pue(e,t){const{ctx:i,canvas:s}=t8(e,t),r=i.getImageData(0,0,e.width,e.height);return i8(s),r}function t8(e,t){const i=fue();t.premultipliedAlpha&&_ue(e),i.width=e.width,i.height=e.height;const s=i.getContext("2d");return s.putImageData(e,0,0),t.flipY&&bue(s),{ctx:s,canvas:i}}function i8(e){e.width=0,e.height=0}function fue(){return N(qw)&&(qw=document.createElement("canvas")),qw}let qw=null;function mue(e,t){const i=wue[t.format],s=t.quality/100;return e.toDataURL(i,s)}function yue(e,t){const i=vue(e),s=Sue[i];return{format:i,quality:ls(t!=null?t:s,0,100)}}function gue(e,t){return t/Math.max(e[0],e[1])}function swe(e,t,i,s=0,r=0,n=e.width-s,o=e.height-r,a=!1){const{data:l}=e,{width:u,height:d,data:f}=t,m=n/u,y=o/d,g=Math.ceil(m/2),v=Math.ceil(y/2),b=e.width;for(let _=0;_=1)continue;let ne=2*re*re*re-3*re*re+1;const ke=4*(s+me+(r+J)*b);G+=ne*l[ke+3],T+=ne,!i&&l[ke+3]<255&&(ne=ne*l[ke+3]/255),k+=ne*l[ke],A+=ne*l[ke+1],F+=ne*l[ke+2],I+=ne}}f[$]=k/I,f[$+1]=A/I,f[$+2]=F/I,f[$+3]=G/T}return t}function vue(e){switch(e){case"png":case"jpg":case"jpeg":return e;default:return xue}}function bue(e){e.save(),e.globalCompositeOperation="copy",e.scale(1,-1),e.translate(0,-e.canvas.height),e.drawImage(e.canvas,0,0),e.restore()}function _ue(e){const t=e.data,i=t.length;for(let s=0;s0){const n=255/r;t[s+0]=t[s+0]*n,t[s+1]=t[s+1]*n,t[s+2]=t[s+2]*n}}}const wue={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},EA=98,xue="png",Sue={png:100,jpg:EA,jpeg:EA};var At;function rwe(e,t,i={}){const s=s8(e);for(;s.length>1;){const r=jv(t,s.shift(),i);if(M(r))return r}return Mue(t,s.shift(),i)}function s8(e){const t=V("esri-force-webgl");if(t===At.WEBGL1||t===At.WEBGL2)return[t];switch(e){case"2d":return V("mac")&&V("chrome")?[At.WEBGL1,At.WEBGL2]:[At.WEBGL2,At.WEBGL1];case"3d":return[At.WEBGL2,At.WEBGL1]}}function Mue(e,t,i={}){if(!window.WebGLRenderingContext)return kA(e,$ue),null;const s=jv(e,t,i);return N(s)&&kA(e,Tue),s}function jv(e,t,i={}){const s=t===At.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let r=null;for(const n of s){try{r=e.getContext(n,i)}catch{}if(r)break}return r}function kA(e,t){const i=e.parentNode;i&&(i.innerHTML='
'+t+"
")}(function(e){e[e.WEBGL1=1]="WEBGL1",e[e.WEBGL2=2]="WEBGL2"})(At||(At={}));const $ue='This page requires a browser that supports WebGL.
Click here to upgrade your browser.',Tue=`It doesn't appear your computer can support WebGL.
Click here for more information.`;let Gw,Ww;function Iue(e){const t=s8(e);for(;t.length>1;){const i=CA(t.shift());if(i.available)return i}return CA(t.shift())}function CA(e){switch(e){case At.WEBGL1:return Eue();case At.WEBGL2:return kue()}}function Eue(){return Gw||(Gw=Aue()),Gw}function kue(){return Ww||(Ww=Oue()),Ww}class r8{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsElementIndexUint=!1,this.supportsStandardDerivatives=!1,this.supportsInstancedArrays=!1,this.supportsTextureFloat=!1,this.supportsTextureHalfFloat=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1}}class Cue extends r8{constructor(){super(...arguments),this.type=At.WEBGL1}}class Pue extends r8{constructor(){super(...arguments),this.type=At.WEBGL2,this.supportsElementIndexUint=!0,this.supportsStandardDerivatives=!0,this.supportsInstancedArrays=!0,this.supportsTextureFloat=!0,this.supportsTextureHalfFloat=!0}}function n8(e,t){var n;if(e===At.WEBGL1&&typeof WebGLRenderingContext=="undefined"||e===At.WEBGL2&&typeof WebGL2RenderingContext=="undefined")return null;const i=document.createElement("canvas");if(!i)return null;let s=jv(i,e,{failIfMajorPerformanceCaveat:!0});if(N(s)&&(s=jv(i,e),M(s)&&(t.majorPerformanceCaveat=!0)),N(s))return s;if(e===At.WEBGL1){const o=(n=s.getParameter(s.VERSION))==null?void 0:n.match(/^WebGL\s+([\d.]*)/);if(o){const a=parseFloat(o[1]);t.available=a>=.94}}else t.available=!0;t.maxTextureSize=s.getParameter(s.MAX_TEXTURE_SIZE),t.supportsVertexShaderSamplers=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const r=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT);return r&&(t.supportsHighPrecisionFragment=r.precision>0),s}function Aue(){const e=new Cue,t=n8(At.WEBGL1,e);return N(t)||(e.supportsElementIndexUint=t.getExtension("OES_element_index_uint")!==null,e.supportsStandardDerivatives=t.getExtension("OES_standard_derivatives")!==null,e.supportsInstancedArrays=t.getExtension("ANGLE_instanced_arrays")!==null,e.supportsTextureFloat=t.getExtension("OES_texture_float")!==null,e.supportsTextureHalfFloat=t.getExtension("OES_texture_half_float")!==null,e.supportsColorBufferFloat=t.getExtension("WEBGL_color_buffer_float")!==null,e.supportsColorBufferFloatBlend=t.getExtension("EXT_float_blend")!==null,e.supportsColorBufferHalfFloat=t.getExtension("EXT_color_buffer_half_float")!==null),e}function Oue(){const e=new Pue,t=n8(At.WEBGL2,e);return N(t)||(e.supportsColorBufferFloat=t.getExtension("EXT_color_buffer_float")!==null,e.supportsColorBufferFloatBlend=t.getExtension("EXT_float_blend")!==null,e.supportsColorBufferHalfFloat=e.supportsColorBufferFloat||t.getExtension("EXT_color_buffer_half_float")!==null),e}function Rue(e){const t=Iue(e);if(!t.available)return new L("webgl:required","WebGL is required but not supported.");if(e==="3d"&&t.majorPerformanceCaveat)return new L("webgl:major-performance-caveat-detected","Your WebGL implementation doesn't seem to support hardware accelerated rendering. Check your browser settings or if your GPU is in a blocklist.");if(!t.supportsHighPrecisionFragment)return new L("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported.");if(!t.supportsVertexShaderSamplers)return new L("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported.");if(t.type===At.WEBGL1){if(!t.supportsElementIndexUint)return new L("webgl:element-index-uint-required","WebGL support for uint vertex indices is required but not supported.");if(!t.supportsStandardDerivatives)return new L("webgl:standard-derivatives-required","WebGL support for standard derivatives is required but not supported.");if(!t.supportsInstancedArrays)return new L("webgl:instanced-arrays-required","WebGL support for instanced rendering is required but not supported.")}return null}function Lue(e){return e&&"nodeType"in e}function Fue(e){return e&&typeof e.render=="function"}const PA={component:"esri-component"};let hc=class extends oe{constructor(){super(...arguments),this.widget=null}destroy(){this.widget&&this.widget.destroy(),this.node=null}get id(){return this.get("widget.id")||this.get("node.id")}set node(e){const t=this._get("node");e!==t&&(e&&e.classList.add(PA.component),t&&t.classList.remove(PA.component),this._set("node",e))}castNode(e){return e?typeof e=="string"||Lue(e)?(this._set("widget",null),r$(e)):(Fue(e)&&!e.domNode&&(e.domNode=document.createElement("div")),this._set("widget",e),e.domNode):(this._set("widget",null),null)}};c([h({dependsOn:[]})],hc.prototype,"id",null),c([h()],hc.prototype,"node",null),c([Oe("node")],hc.prototype,"castNode",null),c([h({readOnly:!0})],hc.prototype,"widget",void 0),hc=c([S("esri.views.ui.Component")],hc);const y0=hc,Due={left:0,top:0,bottom:0,right:0},o8={bottom:30,top:15,right:15,left:15},Hw="manual",Ri={ui:"esri-ui",corner:"esri-ui-corner",innerContainer:"esri-ui-inner-container",manualContainer:"esri-ui-manual-container",cornerContainer:"esri-ui-corner-container",topLeft:"esri-ui-top-left",topRight:"esri-ui-top-right",bottomLeft:"esri-ui-bottom-left",bottomRight:"esri-ui-bottom-right"};function Nue(e){return e&&!e._started&&typeof e.postMixInProperties=="function"&&typeof e.buildRendering=="function"&&typeof e.postCreate=="function"&&typeof e.startup=="function"}function Yw(e){const t=e,i=typeof t=="object"&&t!==null&&Object.getPrototypeOf(t);return(i===null||i===Object.prototype)&&("component"in t||"index"in t||"position"in t)?e:null}function Jw(e,{top:t,bottom:i,left:s,right:r}){e.style.top=t,e.style.bottom=i,e.style.left=s,e.style.right=r}let uo=class extends jo.EventedAccessor{constructor(e){super(e),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentToKey=new Map,this._handles=new qi,this.view=null,this._applyViewPadding=()=>{const t=this.container;t&&Jw(t,this._toPxPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const t=this._innerContainer;t&&Jw(t,this._toPxPosition(this.padding))},this._initContainers()}initialize(){this._handles.add([Z(()=>{var e;return[(e=this.view)==null?void 0:e.padding,this.container]},this._applyViewPadding,Le),Z(()=>this.padding,this._applyUIPadding,Le)])}destroy(){this.container=null;for(const e of this._components)e.destroy();this._components.length=0,this._handles.destroy(),this._componentToKey.clear()}set container(e){const t=this._get("container");e!==t&&(e&&(e.classList.add(Ri.ui),RK(e),this._attachContainers(e)),t&&(t.classList.remove(Ri.ui),Jw(t,{top:"",bottom:"",left:"",right:""}),CR(t)),this._set("container",e))}get height(){const e=this.get("view.height")||0;if(e===0)return e;const t=this._getViewPadding(),i=t.top+t.bottom;return Math.max(e-i,0)}get padding(){return this._get("padding")}set padding(e){this._overrideIfSome("padding",e)}castPadding(e){return typeof e=="number"?{bottom:e,top:e,right:e,left:e}:{...o8,...e}}get width(){const e=this.get("view.width")||0;if(e===0)return e;const t=this._getViewPadding(),i=t.left+t.right;return Math.max(e-i,0)}add(e,t){let i,s;if(Array.isArray(e))return void e.forEach(n=>this.add(n,t));const r=Yw(e);r&&({index:i,position:t,component:e,key:s}=r),t&&typeof t=="object"&&({index:i,key:s,position:t}=t),!e||t&&!this._isValidPosition(t)||this._add(e,t,i,s)}remove(e,t){if(!e)return;if(Array.isArray(e))return e.map(s=>this.remove(s,t));const i=this._find(e);if(i){const s=this._componentToKey;if(s.has(e)&&s.get(e)!==t)return;const r=this._components.indexOf(i);return i.node.parentNode&&i.node.parentNode.removeChild(i.node),this._componentToKey.delete(e),this._components.splice(r,1)[0]}}empty(e){return Array.isArray(e)?e.map(t=>this.empty(t)).reduce((t,i)=>t.concat(i)):(e=e||Hw)===Hw?Array.prototype.slice.call(this._manualContainer.children).filter(t=>!t.classList.contains(Ri.corner)).map(t=>this.remove(t)):this._isValidPosition(e)?Array.prototype.slice.call(this._cornerNameToContainerLookup[e].children).map(this.remove,this):null}move(e,t){if(Array.isArray(e)&&e.forEach(n=>this.move(n,t)),!e)return;let i;const s=Yw(e)||Yw(t);if(s&&(i=s.index,t=s.position,e=s.component||e),t&&!this._isValidPosition(t))return;const r=this.remove(e);r&&this.add(r,{position:t,index:i})}find(e){if(!e)return null;const t=this._findById(e);return t&&(t.widget||t.node)}getPosition(e){for(const t in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[t].contains(e))return t;return null}_add(e,t,i,s){e instanceof y0||(e=new y0({node:e})),this._place({component:e,position:t,index:i}),this._components.push(e),s&&this._componentToKey.set(e,s)}_find(e){return e?e instanceof y0?this._findByComponent(e):typeof e=="string"?this._findById(e):this._findByNode(e.domNode||e):null}_getViewPadding(){return this.get("view.padding")||Due}_attachContainers(e){e.appendChild(this._innerContainer),e.appendChild(this._manualContainer)}_initContainers(){const e=document.createElement("div");e.classList.add(Ri.innerContainer),e.classList.add(Ri.cornerContainer);const t=document.createElement("div");t.classList.add(Ri.innerContainer),t.classList.add(Ri.manualContainer);const i=document.createElement("div");i.classList.add(Ri.topLeft),i.classList.add(Ri.corner),e.appendChild(i);const s=document.createElement("div");s.classList.add(Ri.topRight),s.classList.add(Ri.corner),e.appendChild(s);const r=document.createElement("div");r.classList.add(Ri.bottomLeft),r.classList.add(Ri.corner),e.appendChild(r);const n=document.createElement("div");n.classList.add(Ri.bottomRight),n.classList.add(Ri.corner),e.appendChild(n),this._innerContainer=e,this._manualContainer=t;const o=xn();this._cornerNameToContainerLookup={"top-left":i,"top-right":s,"bottom-left":r,"bottom-right":n,"top-leading":o?s:i,"top-trailing":o?i:s,"bottom-leading":o?n:r,"bottom-trailing":o?r:n},this._positionNameToContainerLookup={manual:t,...this._cornerNameToContainerLookup}}_isValidPosition(e){return!!this._positionNameToContainerLookup[e]}_place(e){const t=e.component,i=e.position||Hw,s=e.index,r=this._positionNameToContainerLookup[i],n=s>-1;if(Nue(t.widget)&&t.widget.startup(),!n)return void r.appendChild(t.node);const o=Array.prototype.slice.call(r.children);if(s===0)return void(r.firstChild?dE(t.node,r.firstChild):r.appendChild(t.node));s>=o.length?r.appendChild(t.node):dE(t.node,o[s])}_toPxPosition(e){return{top:this._toPxUnit(e.top),left:this._toPxUnit(e.left),right:this._toPxUnit(e.right),bottom:this._toPxUnit(e.bottom)}}_toPxUnit(e){return e===0?"0":e+"px"}_findByComponent(e){let t,i=null;return this._components.some(s=>(t=s===e,t&&(i=s),t)),i}_findById(e){let t,i=null;return this._components.some(s=>(t=s.id===e,t&&(i=s),t)),i}_findByNode(e){let t,i=null;return this._components.some(s=>(t=s.node===e,t&&(i=s),t)),i}};c([h()],uo.prototype,"container",null),c([h()],uo.prototype,"height",null),c([h({value:o8})],uo.prototype,"padding",null),c([Oe("padding")],uo.prototype,"castPadding",null),c([h()],uo.prototype,"view",void 0),c([h()],uo.prototype,"width",null),uo=c([S("esri.views.ui.UI")],uo);const jue=uo;function AA(e,t){return e&&"copyright"in e&&(!t||typeof e.originOf=="function"&&e.originOf("copyright")==="user")}function Vue(e,t){return e.length!==t.length||e.some((i,s)=>i.text!==t[s].text)}function Xy(e,t,i){!i||!t||e.find(s=>s.layerView===t&&s.text===i)||e.push({text:i,layerView:t})}function zue(e){return e.type==="bing-maps"}const ta=[];let lh=class extends yv{constructor(e){super(e),this._clear=()=>{this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.handles.remove("suspension"),this.notifyChange("state")},this._pendingAttributions=new Set,this._fetchedAttributionData=new Map,this.items=new he,this.view=null,this._allLayerViewsChange=t=>{this.handles.remove("suspension");const i=this.get("view.allLayerViews");i&&this.handles.add(i.map(s=>Z(()=>{var r;return[s.suspended,(r=s.layer)==null?void 0:r.attributionVisible]},()=>this._updateAttributionItems())),"suspension"),t&&t.removed&&t.removed.forEach(s=>{this._pendingAttributions.delete(s),this._fetchedAttributionData.delete(s)}),this._updateAttributionItems()},this.handles.add([Is(()=>{var t;return(t=this.view)==null?void 0:t.allLayerViews},"change",t=>this._allLayerViewsChange(t),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),Qs(()=>{var t;return((t=this.view)==null?void 0:t.stationary)===!0},()=>this._updateAttributionItems())])}destroy(){this.view=null,this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.items.removeAll()}get state(){return this.get("view.ready")?this._pendingAttributions.size>0?"loading":"ready":"disabled"}_updateAttributionItems(){const e=this.get("view.allLayerViews");ta.length=0,e?(e.forEach(t=>{var r;if(t.suspended||!((r=t.layer)!=null&&r.attributionVisible))return;const i=t.layer;if(AA(i,"user"))return void Xy(ta,t,i.copyright);if(i.hasAttributionData){if(this._fetchedAttributionData.has(t)){const n=this._fetchedAttributionData.get(t);return void(n?Xy(ta,t,this._getDynamicAttribution(n,this.view,i)):AA(i)&&Xy(ta,t,i.copyright))}return void this._fetchAttributionData(t)}const s=i.get("portalItem.accessInformation");Xy(ta,t,s||i.copyright)}),Vue(this.items,ta)&&(this.items.removeAll(),this.items.addMany(ta)),ta.length=0,this.notifyChange("state")):this._clear()}async _fetchAttributionData(e){if(this._pendingAttributions.has(e))return;this._pendingAttributions.add(e);const t=await xb(e.layer.fetchAttributionData());if(this._pendingAttributions.has(e)){const i=t.ok?this._createContributionIndex(t.value,zue(e.layer)):null;this._pendingAttributions.delete(e),this._fetchedAttributionData.set(e,i)}this._updateAttributionItems()}_createContributionIndex(e,t){const i=e.contributors,s={};if(!i)return s;for(let r=0;r{const d=!l[u.id]&&a&&_b(u.extent,a);return d&&(l[u.id]=!0),d}).sort((u,d)=>d.score-u.score||u.objectId-d.objectId).map(u=>u.attribution).join(", "):""}};c([h({readOnly:!0,type:he})],lh.prototype,"items",void 0),c([h({readOnly:!0})],lh.prototype,"state",null),c([h()],lh.prototype,"view",void 0),lh=c([S("esri.widgets.Attribution.AttributionViewModel")],lh);const a8=lh,ia={base:"esri-attribution esri-widget",poweredBy:"esri-attribution__powered-by",sources:"esri-attribution__sources",open:"esri-attribution--open",sourcesOpen:"esri-attribution__sources--open",link:"esri-attribution__link",widgetIcon:"esri-icon-description",interactive:"esri-interactive"};let Ni=class extends yi{constructor(e,t){super(e,t),this._isOpen=!1,this._attributionTextOverflowed=!1,this._prevSourceNodeHeight=0,this._resizeObserver=new ResizeObserver(i=>i.forEach(({target:s})=>this._checkSourceTextOverflow(s))),this.iconClass=ia.widgetIcon,this.itemDelimiter=" | ",this.messages=null,this.viewModel=new a8}initialize(){this.addHandles(Is(()=>{var e;return(e=this.viewModel)==null?void 0:e.items},"change",()=>this.scheduleRender()))}destroy(){var e;(e=this._resizeObserver)==null||e.disconnect()}get _isInteractive(){return this._isOpen||this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce((e,t)=>(e.includes(t.text)||e.push(t.text),e),[]).join(this.itemDelimiter)}get label(){var e,t;return(t=(e=this.messages)==null?void 0:e.widgetLabel)!=null?t:""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e={[ia.open]:this._isOpen};return P("div",{bind:this,class:this.classes(ia.base,e),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this.renderSourcesNode(),this.renderPoweredBy())}renderPoweredBy(){return P("div",{class:ia.poweredBy},"Powered by"," ",P("a",{class:ia.link,href:"http://www.esri.com/",target:"_blank",rel:"noreferrer"},"Esri"))}renderSourcesNode(){const e=this._isOpen,t=this._isInteractive,i=t?"0":"",{attributionText:s}=this,r={[ia.sourcesOpen]:e,[ia.interactive]:t};return P("div",{afterCreate:this._afterSourcesNodeCreate,bind:this,class:this.classes(ia.sources,r),innerHTML:s,tabindex:i})}_afterSourcesNodeCreate(e){this._prevSourceNodeHeight=e.clientWidth,this._resizeObserver.observe(e)}_checkSourceTextOverflow(e){let t=!1;const{clientHeight:i,clientWidth:s,scrollWidth:r}=e,n=r>s,o=this._attributionTextOverflowed!==n;if(this._attributionTextOverflowed=n,o&&(t=!0),this._isOpen){const a=ithis.view,this._updateRotationWatcher,Le))}destroy(){this._handles=Bt(this._handles),this.view=null}get canShowNorth(){const e=this.get("view.spatialReference");return!(!e||!e.isWebMercator&&!e.isGeographic)}get state(){return this.get("view.ready")?this.canShowNorth?"compass":"rotation":"disabled"}reset(){if(!this.get("view.ready"))return;const e={};this.view.type==="2d"?e.rotation=0:e.heading=0,this.callGoTo({target:e})}_updateForRotation(e){e!=null&&(this.orientation={z:e})}_updateForCamera(e){if(!e)return;const t=-e.heading;this.orientation={x:0,y:0,z:t}}_updateRotationWatcher(e){this._handles.removeAll(),e&&this._handles.add(e.type==="2d"?Z(()=>e==null?void 0:e.rotation,this._updateForRotation,Le):Z(()=>e==null?void 0:e.camera,this._updateForCamera,Le))}};c([h({readOnly:!0})],dc.prototype,"canShowNorth",null),c([h()],dc.prototype,"orientation",void 0),c([h({readOnly:!0})],dc.prototype,"state",null),c([h()],dc.prototype,"view",void 0),dc=c([S(Uue)],dc);const l8=dc,sa={base:"esri-compass esri-widget--button esri-widget",text:"esri-icon-font-fallback-text",icon:"esri-compass__icon",rotationIcon:"esri-icon-dial",northIcon:"esri-icon-compass",widgetIcon:"esri-icon-locate-circled",interactive:"esri-interactive",disabled:"esri-disabled"};let hn=class extends yi{constructor(e,t){super(e,t),this.iconClass=sa.widgetIcon,this.messages=null,this.viewModel=new l8}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get label(){var e,t;return(t=(e=this.messages)==null?void 0:e.widgetLabel)!=null?t:""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}reset(){return this.viewModel.reset()}render(){const{orientation:e,state:t}=this.viewModel,i=t==="disabled",s=(t==="rotation"?"rotation":"compass")=="compass",r=i?-1:0,n={[sa.disabled]:i,[sa.interactive]:!i},o={[sa.northIcon]:s,[sa.rotationIcon]:!s},{messages:a}=this;return P("div",{bind:this,class:this.classes(sa.base,n),onclick:this._reset,onkeydown:this._reset,role:"button",tabIndex:r,"aria-label":a.reset,title:a.reset},P("span",{"aria-hidden":"true",class:this.classes(sa.icon,o),styles:this._toRotationTransform(e)}),P("span",{class:sa.text},a.reset))}_reset(){this.viewModel.reset()}_toRotationTransform(e){return{transform:`rotateZ(${e.z}deg)`}}};c([h()],hn.prototype,"goToOverride",null),c([h()],hn.prototype,"iconClass",void 0),c([h()],hn.prototype,"label",null),c([h(),di("esri/widgets/Compass/t9n/Compass")],hn.prototype,"messages",void 0),c([h()],hn.prototype,"view",null),c([h({type:l8})],hn.prototype,"viewModel",void 0),c([xs()],hn.prototype,"_reset",null),hn=c([S("esri.widgets.Compass")],hn);const que=hn;let ch=class extends oe{constructor(e){super(e),this.navigationMode="pan",this.view=null}initialize(){this.own(Qs(()=>{var e;return(e=this.view)==null?void 0:e.inputManager},()=>this._setNavigationMode()))}destroy(){this.view=null}get state(){return this.get("view.ready")&&this.view.type==="3d"?"ready":"disabled"}toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate",this._setNavigationMode())}_setNavigationMode(){this.get("view.inputManager").primaryDragAction=this.navigationMode==="pan"?"pan":"rotate"}};c([h({readOnly:!0})],ch.prototype,"state",null),c([h()],ch.prototype,"navigationMode",void 0),c([h()],ch.prototype,"view",void 0),ch=c([S("esri.widgets.NavigationToggleViewModel")],ch);const c8=ch,Os={base:"esri-navigation-toggle esri-widget",button:"esri-navigation-toggle__button esri-widget--button",activeButton:"esri-navigation-toggle__button--active",panButton:"esri-navigation-toggle__button--pan",rotateButton:"esri-navigation-toggle__button--rotate",isLayoutHorizontal:"esri-navigation-toggle--horizontal",rotationIcon:"esri-icon-rotate",panIcon:"esri-icon-pan",widgetIcon:"esri-icon-pan2",disabled:"esri-disabled"};let dn=class extends yi{constructor(e,t){super(e,t),this.iconClass=Os.widgetIcon,this.messages=null,this.viewModel=new c8}get label(){var e,t;return(t=(e=this.messages)==null?void 0:e.widgetLabel)!=null?t:""}set label(e){this._overrideIfSome("label",e)}set layout(e){e!=="horizontal"&&(e="vertical"),this._set("layout",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}toggle(){return this.viewModel.toggle()}render(){const e=this.get("viewModel.state")==="disabled",t=this.get("viewModel.navigationMode")==="pan",i={[Os.disabled]:e,[Os.isLayoutHorizontal]:this.layout==="horizontal"},s={[Os.activeButton]:t},r={[Os.activeButton]:!t},n=e?-1:0,o=this.messages.toggle;return P("div",{bind:this,class:this.classes(Os.base,i),onclick:this._toggle,onkeydown:this._toggle,tabIndex:n,"aria-label":o,title:o},P("div",{class:this.classes(Os.button,Os.panButton,s)},P("span",{class:Os.panIcon})),P("div",{class:this.classes(Os.button,Os.rotateButton,r)},P("span",{class:Os.rotationIcon})))}_toggle(){this.toggle()}};c([h()],dn.prototype,"iconClass",void 0),c([h()],dn.prototype,"label",null),c([h({value:"vertical"})],dn.prototype,"layout",null),c([h(),di("esri/widgets/NavigationToggle/t9n/NavigationToggle")],dn.prototype,"messages",void 0),c([h()],dn.prototype,"view",null),c([h({type:c8})],dn.prototype,"viewModel",void 0),c([xs()],dn.prototype,"_toggle",null),dn=c([S("esri.widgets.NavigationToggle")],dn);const Gue=dn,Hd={button:"esri-widget--button esri-widget",disabled:"esri-disabled",interactive:"esri-interactive",iconText:"esri-icon-font-fallback-text",icon:"esri-icon"};let ka=class extends yi{constructor(){super(...arguments),this.enabled=!0,this.iconClass="",this.title=""}render(){const e=this.enabled?0:-1,t={[Hd.disabled]:!this.enabled,[Hd.interactive]:this.enabled},i={[this.iconClass]:!!this.iconClass};return P("div",{bind:this,class:this.classes(Hd.button,t),onclick:this._triggerAction,onkeydown:this._triggerAction,role:"button",tabIndex:e,title:this.title},P("span",{"aria-hidden":"true",role:"presentation",class:this.classes(Hd.icon,i)}),P("span",{class:Hd.iconText},this.title))}_triggerAction(){this.action.call(this)}};c([h()],ka.prototype,"action",void 0),c([h()],ka.prototype,"enabled",void 0),c([h()],ka.prototype,"iconClass",void 0),c([h()],ka.prototype,"title",void 0),c([xs()],ka.prototype,"_triggerAction",null),ka=c([S("esri.widgets.IconButton")],ka);const OA=ka;let uh=class extends oe{get canZoomIn(){if(!this.get("view.ready"))return!1;const e=this.get("view.animation.target.scale")||this.get("view.scale"),t=this.get("view.constraints.effectiveMaxScale");return t===0||e>t}get canZoomOut(){if(!this.get("view.ready"))return!1;const e=this.get("view.animation.target.scale")||this.get("view.scale"),t=this.get("view.constraints.effectiveMinScale");return t===0||ethis.components,this._componentsWatcher.bind(this),Le),Z(()=>this.view,this._updateViewAwareWidgets.bind(this),Le)])}_add(e,t,i,s){if(typeof e=="string"&&this._defaultPositionLookup[e]){if(this._find(e))return;e=this._createComponent(e)}super._add(e,t,i,s)}_removeComponents(e){e.forEach(t=>{const i=this._find(t);i&&(this.remove(i),i.destroy())})}_updateViewAwareWidgets(e){this.components.forEach(t=>{const i=this._find(t),s=i&&i.widget;Jue(s)&&(s.view=e)})}_componentsWatcher(e,t){this._removeComponents(t),this._addComponents(e),this._adjustPadding(e)}_adjustPadding(e){if(!e.includes("attribution")&&!this._isOverridden("padding")){const{top:t}=this.padding;this.padding=t}}_addComponents(e){this.constructed&&e.forEach(t=>this.add(this._createComponent(t),this._defaultPositionLookup[t]))}_createComponent(e){const t=this._createWidget(e);if(t)return new y0({id:e,node:t})}_createWidget(e){return e==="attribution"?this._createAttribution():e==="compass"?this._createCompass():e==="navigation-toggle"?this._createNavigationToggle():e==="zoom"?this._createZoom():void 0}_createAttribution(){return new Bue({view:this.view})}_createCompass(){return new que({view:this.view})}_createNavigationToggle(){return new Gue({view:this.view})}_createZoom(){return new Yue({view:this.view})}};c([h()],g0.prototype,"components",void 0),g0=c([S("esri.views.ui.DefaultUI")],g0);const Xue=g0;let v0=class extends Xue{constructor(e){super(e),this.components=["attribution","zoom"]}};c([h()],v0.prototype,"components",void 0),v0=c([S("esri.views.ui.2d.DefaultUI2D")],v0);const h8=v0;var mM;let b0=mM=class extends W{constructor(e){super(e),this.color=new pe([0,0,0,1])}clone(){return new mM(R({color:this.color}))}};c([h({type:pe,json:{write:!0}})],b0.prototype,"color",void 0),b0=mM=c([S("esri.webmap.background.ColorBackground")],b0);const Zue=b0;let d8,p8,f8,m8,y8,g8;async function Que(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:s,MagnifierView2D:r,Stage:n}]=await Promise.all([z(()=>import("./webglDeps.a00b541b.js"),["assets/webglDeps.a00b541b.js","assets/VertexArrayObject.a4c1d809.js","assets/Texture.4c97bad5.js","assets/enums.2d9e6f64.js","assets/ProgramTemplate.e9a5aa54.js","assets/programUtils.956e69db.js"]),z(()=>import("./mapViewDeps.ae59dec6.js"),["assets/mapViewDeps.ae59dec6.js","assets/_commonjsHelpers.773c2c82.js","assets/imageutils.9dde1c66.js","assets/utils.4b023c9d.js","assets/Utils.7f6f3a6b.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.4c97bad5.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.229b1dd6.js","assets/BufferPool.ff53b3f4.js","assets/WGLContainer.1850619d.js","assets/pixelUtils.82950e1a.js","assets/VertexArrayObject.a4c1d809.js","assets/ProgramTemplate.e9a5aa54.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/enums.54326430.js","assets/programUtils.956e69db.js","assets/RenderingContext.6e624525.js","assets/OrderIndependentTransparency.4d1575c0.js","assets/floatRGBA.df11258c.js","assets/ExpandedCIM.f0b7f36d.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.0d428d19.js","assets/GeometryUtils.4f19e772.js","assets/rasterizingUtils.4baad29a.js","assets/Matcher.fe0c3dcf.js","assets/visualVariablesUtils.32e27706.js","assets/visualVariablesUtils.aff73e6d.js","assets/tileUtils.44921ab9.js","assets/TileClipper.8c399a8a.js","assets/Geometry.d049a63c.js","assets/devEnvironmentUtils.d8d0484c.js","assets/CircularArray.a4d7e1c2.js","assets/imageUtils.753f41b1.js","assets/ComputedAttributeStorage.c1cb22b3.js","assets/centroid.cc817cc5.js","assets/BaseGraphicContainer.6b1c597d.js","assets/normalizeUtilsSync.757b5fd1.js","assets/projectionSupport.0542c13b.js","assets/json.879c9adc.js","assets/FeatureContainer.4ca52b51.js","assets/TileContainer.8b7fafe2.js","assets/schemaUtils.69ad92d2.js","assets/createSymbolSchema.e54d2060.js","assets/util.ab699fea.js","assets/vec3f32.1121a836.js","assets/GraphicContainer.618d10e5.js","assets/requestImageUtils.7b09b5e8.js"])]);p8=e,f8=t,m8=i,y8=s,g8=r,d8=n}const RA=160;function Kue(e){return e&&e.declaredClass==="esri.Viewpoint"}let ve=class extends NQ(tae(iae($ae))){constructor(e){super(e),this._magnifierView=null,this._stage=null,this._resolveWhenReady=[],this.rootLayerViews=new im({getCollections:()=>{var t,i;return[(t=this.basemapView)==null?void 0:t.baseLayerViews,this.layerViews,(i=this.basemapView)==null?void 0:i.referenceLayerViews]},getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.graphicsView=null,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.rendering=!1,this.supersampleScreenshotsEnabled=!1,this.supportsGround=!1,this._stationaryTimer=null,this.frameTask=new kle(this),this._pePromise=null,this.floors=new he,this.highlightOptions=new Kj,this.inputManager=new iue({view:this}),this.map=null,this.resizeAlign="center",this.spatialReferenceLocked=!1,this.timeline=new e8,this.type="2d",this.ui=new h8,this._pixelFormat={flipY:!0,premultipliedAlpha:!0},this.constraints=new Vj,this.padding={top:0,right:0,bottom:0,left:0},this.handles.add([Z(()=>this.viewpoint,()=>{this._lastStationaryEventTimestamp=performance.now(),this._flipStationary(RA)},Nh),this.on("resize",t=>this._resizeHandler(t)),Z(()=>{var t;return(t=this.animationManager)==null?void 0:t.animation},t=>{this.animation=t})]),OQ()}destroy(){this._set("preconditionsReady",!1),this._gotoTask=this.frameTask=null,this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new lue(this.featuresTilingScheme)}get initialExtentRequired(){var o;const{scale:e,constraints:t,center:i,viewpoint:s,extent:r}=this;let n=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&((o=this.map.initialViewProperties)==null?void 0:o.viewpoint))&&!r&&(t!=null&&t.effectiveLODs||(n=-1),(!i||e===0&&n===-1)&&(!s||!M(s.targetGeometry)||s.targetGeometry.type!=="extent"&&!s.scale))}get resourceManager(){return this._stage.resourceManager}get textureManager(){return this._stage.painter.textureManager}get _defaultsFromMapSettings(){return{required:{tileInfo:!0,heightModelInfo:!1,extent:!1},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get _projectionEngineLoaded(){return!!ol()||(this._pePromise||(this._pePromise=al().finally(()=>{this._pePromise=null})),!1)}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=this.spatialReference,i=e.targetGeometry;return!!Ro(i.spatialReference,t)||this._projectionEngineLoaded}set animation(e){const t=this._get("animation");if(e===t)return;if(t&&t.stop(),!e||e.isFulfilled())return void this._set("animation",null);this._set("animation",e),this.frameTask.animationInProgress=!0;const i=()=>{var s;e===this._get("animation")&&(this._set("animation",null),(s=this.frameTask)==null||s.requestFrame()),this.frameTask&&(this.frameTask.animationInProgress=!1)};e.when(i,i)}get background(){return the(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){if(!this.ready)return this._get("center");const{center:e,spatialReference:t}=this.state.paddedViewState;return new be({x:e[0],y:e[1],spatialReference:t})}set center(e){if(e==null)return;if(!this.ready)return this._set("center",e),void this.notifyChange("initialExtentRequired");let t;try{t=this._project(e,this.spatialReference)}catch(s){return void q.getLogger(this.declaredClass).error(new L("mapview:invalid-center","could not project the value in the view's spatial reference",{input:e,error:s}))}const i=this.viewpoint;aM(i,i,t),this.viewpoint=i}set constraints(e){const t=this._get("constraints");t&&(this.handles.remove("map-view-constraints"),t.destroy()),this._set("constraints",e),e&&(e.view=this,this.ready&&(this.state.viewpoint=e.fit(this.state.paddedViewState.viewpoint)),this.handles.add(Z(()=>e.version,()=>{this.ready&&this.state&&(this.state.viewpoint=e.fit(this.state.paddedViewState.viewpoint))},Nh),"map-view-constraints"))}get extent(){return this.ready?this.state.paddedViewState.extent.clone():this._get("extent")}set extent(e){if(e==null)return;if(!e.width||!e.height)return void q.getLogger(this.declaredClass).error(new L("mapview:invalid-extent","invalid extent size"));if(!this.ready)return this._set("extent",e),this._set("center",null),this._set("viewpoint",null),this._set("scale",0),this._set("zoom",-1),void this.notifyChange("initialExtentRequired");let t;try{t=this._project(e,this.spatialReference)}catch(s){return void q.getLogger(this.declaredClass).error(new L("mapview:invalid-extent","could not project the value in the view's spatial reference",{error:s}))}const i=this.viewpoint;ple(i,i,t,this.size,{constraints:this.constraints}),this.viewpoint=i}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(e){this.ready?(this.state.padding=e,this._set("padding",this.state.padding)):this._set("padding",e)}get resolution(){return this.state?this.state.resolution:0}get rotation(){return this.ready?this.state.rotation:this._get("rotation")}set rotation(e){if(isNaN(e))return;if(!this.ready)return void this._set("rotation",e);const t=this.viewpoint;$le(t,t,e),this.viewpoint=t}get scale(){return this.ready?this.state.scale:this._get("scale")}set scale(e){if(!e||isNaN(e))return;if(!this.ready){this._set("scale",e),this._set("zoom",-1);const i=this._get("extent");return i&&(this._set("extent",null),this._set("center",i.center)),void this.notifyChange("initialExtentRequired")}const t=this.viewpoint;uA(t,t,e),this.viewpoint=t}get stationary(){return!(this.animation||this.navigating||this.resizing||this._stationaryTimer)}get updating(){var t,i,s;const e=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||this.layerViewManager.updating===!0||this.labelManager.updating===!0||this.graphicsView.updating===!0||this.allLayerViews.some(r=>!r.destroyed&&!("layerViews"in r)&&r.updating===!0));if(V("esri-2d-log-updating")){const r=this.allLayerViews.reduce((n,o)=>({...n,[o.layer.id]:!o.destroyed&&!("layerViews"in o)&&o.updating}),{});console.log(`Updating MapView: ${e} + at `+u}return n},t.buildMessage=function(r,n){var o={literal:function(y){return'"'+l(y.text)+'"'},class:function(y){var g=y.parts.map(function(v){return Array.isArray(v)?u(v[0])+"-"+u(v[1]):u(v)});return"["+(y.inverted?"^":"")+g.join("")+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(y){return y.description}};function a(y){return y.charCodeAt(0).toString(16).toUpperCase()}function l(y){return y.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(g){return"\\x0"+a(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+a(g)})}function u(y){return y.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(g){return"\\x0"+a(g)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(g){return"\\x"+a(g)})}function d(y){return o[y.type](y)}function f(y){var g,v,b=y.map(d);if(b.sort(),b.length>0){for(g=1,v=1;g, Actual: ${Cb(e)}`,{term:e})}const U$={px:1,cm:96/2.54,mm:96/2.54/10,in:96,pc:16,pt:96/72};function lX(e){if(e.type!=="quantity"||!(e.value===0&&e.unit===null||e.unit&&U$[e.unit]!=null))throw new L("effect:type-error",`Expected , Actual: ${Cb(e)}`,{term:e})}function Ir(e){oX(e);const t=e.value;return Rm(t,e),e.unit==="%"?.01*t:t}function cX(e){return nX(e),Rm(e.value,e),e.value}function uX(e){return aX(e),e.value*B$[e.unit]||0}function q$(e){return lX(e),e.value*U$[e.unit]||0}function hX(e){switch(e.colorType){case"hex":return RJ(e.value);case"named":return kD(e.value);case"function":return fX(e.value)}}function kD(e){if(!SD(e))throw new L("effect:unknown-color",`color '${e}' isn't valid`,{namedColor:e});return OJ(e)}const dX=/^rgba?/i,pX=/^hsla?/i;function fX(e){if(dd(e.parameters,4),dX.test(e.name))return[Ir(e.parameters[0]),Ir(e.parameters[1]),Ir(e.parameters[2]),e.parameters[3]?Ir(e.parameters[3]):1];if(pX.test(e.name))return MD(cX(e.parameters[0]),Ir(e.parameters[1]),Ir(e.parameters[2]),e.parameters[3]?Ir(e.parameters[3]):1);throw new L("effect:syntax-error",`Invalid color function '${e.name}'`,{colorFunction:e})}function G$(e,t,i){var s;try{return yX(e)}catch(r){(s=i==null?void 0:i.messages)==null||s.push(r)}return null}function W$(e,t,i,s){try{const r=mX(e);Ei(i,r,t)}catch(r){s.messages&&s.messages.push(r)}}function mX(e){const t=ED(e);return t?ZJ(t)?t.map(i=>i.toJSON()):t.map(({scale:i,effects:s})=>({scale:i,value:s.map(r=>r.toJSON())})):null}function yX(e){if(!e||e.length===0)return null;if(gX(e)){const t=[];for(const i of e)t.push({scale:i.scale,value:Mk(i.value)});return t}return Mk(e)}function gX(e){const t=e[0];return!!t&&"scale"in t}function Mk(e){if(!e||!e.length)return"";const t=[];for(const i of e){let s=[];switch(i.type){case"grayscale":case"sepia":case"saturate":case"invert":case"brightness":case"contrast":case"opacity":s=[Vn(i,"amount")];break;case"blur":s=[Vn(i,"radius","pt")];break;case"hue-rotate":s=[Vn(i,"angle","deg")];break;case"drop-shadow":s=[Vn(i,"xoffset","pt"),Vn(i,"yoffset","pt"),Vn(i,"blurRadius","pt"),vX(i,"color")];break;case"bloom":s=[Vn(i,"strength"),Vn(i,"radius","pt"),Vn(i,"threshold")]}const r=`${i.type}(${s.filter(Boolean).join(" ")})`;ED(r),t.push(r)}return t.join(" ")}function Vn(e,t,i){if(e[t]==null)throw new L("effect:missing-parameter",`Missing parameter '${t}' in ${e.type} effect`,{effect:e});return i?e[t]+i:""+e[t]}function vX(e,t){if(e[t]==null)throw new L("effect:missing-parameter",`Missing parameter '${t}' in ${e.type} effect`,{effect:e});const i=e[t];return`rgba(${i[0]||0}, ${i[1]||0}, ${i[2]||0}, ${i[3]/255||0})`}const $k={read:{reader:G$},write:{allowNull:!0,writer:W$}},CD=e=>{let t=class extends e{constructor(){super(...arguments),this.blendMode="normal",this.effect=null}};return c([h({type:["average","color-burn","color-dodge","color","darken","destination-atop","destination-in","destination-out","destination-over","difference","exclusion","hard-light","hue","invert","lighten","lighter","luminosity","minus","multiply","normal","overlay","plus","reflect","saturation","screen","soft-light","source-atop","source-in","source-out","vivid-light","xor"],nonNullable:!0,json:{read:!1,write:!1,origins:{"web-map":{read:!0,write:!0},"portal-item":{read:!0,write:!0}}}})],t.prototype,"blendMode",void 0),c([h({json:{read:!1,write:!1,origins:{"web-map":$k,"portal-item":$k}}})],t.prototype,"effect",void 0),t=c([S("esri.layers.mixins.BlendLayer")],t),t},PD=e=>{let t=class extends e{constructor(){super(...arguments),this.minScale=0,this.maxScale=0}get effectiveScaleRange(){const i={minScale:this.minScale,maxScale:this.maxScale},s=this.parent;s&&"effectiveScaleRange"in s&&bX(i,s.effectiveScaleRange);const r=this._get("effectiveScaleRange");return r&&r.minScale===i.minScale&&r.maxScale===i.maxScale?r:i}};return c([h({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"minScale",void 0),c([h({type:Number,nonNullable:!0,json:{write:!0}})],t.prototype,"maxScale",void 0),c([h({readOnly:!0})],t.prototype,"effectiveScaleRange",null),t=c([S("esri.layers.mixins.ScaleRangeLayer")],t),t};function bX(e,t){return e.minScale=e.minScale>0?t.minScale>0?Math.min(e.minScale,t.minScale):e.minScale:t.minScale,e.maxScale=e.maxScale>0?t.maxScale>0?Math.max(e.maxScale,t.maxScale):e.maxScale:t.maxScale,e}const xt=e=>{let t=class extends e{clone(){var l;const i=Hs(ki(this),"unable to clone instance of non-accessor class"),s=i.metadatas,r=i.store,n={},o=new Map;for(const u in s){const d=s[u],f=r==null?void 0:r.originOf(u),m=d.clonable;if(d.readOnly||m===!1||f!==Pe.USER&&f!==Pe.DEFAULTS&&f!==Pe.WEB_MAP&&f!==Pe.WEB_SCENE)continue;const y=this[u];let g=null;g=typeof m=="function"?m(y):m==="reference"?y:h1(y),y!=null&&g==null||(f===Pe.DEFAULTS?o.set(u,g):n[u]=g)}const a=new(Object.getPrototypeOf(this)).constructor(n);if(o.size){const u=(l=ki(a))==null?void 0:l.store;if(u)for(const[d,f]of o)u.set(d,f,Pe.DEFAULTS)}return a}};return t=c([S("esri.core.Clonable")],t),t};let Tk=class extends xt(oe){};Tk=c([S("esri.core.Clonable")],Tk);var Wh;function _X(e,t){switch(e.type){case"range":{const i="range"in e?e.range[0]:e.minValue,s="range"in e?e.range[1]:e.maxValue;if(i!=null&&+ts)return Wh.VALUE_OUT_OF_RANGE;break}case"coded-value":case"codedValue":if(e.codedValues==null||e.codedValues.every(i=>i==null||i.code!==t))return Wh.INVALID_CODED_VALUE}return null}(function(e){e.VALUE_OUT_OF_RANGE="domain-validation-error::value-out-of-range",e.INVALID_CODED_VALUE="domain-validation-error::invalid-coded-value"})(Wh||(Wh={}));const wX=q.getLogger("esri.support.arcadeOnDemand");let z_;function Do(){return z_||(z_=(async()=>{const e=await z(()=>import("./arcadeUtils.09abf965.js").then(function(t){return t.ay}),["assets/arcadeUtils.09abf965.js","assets/number.9e690eda.js"]);return{arcade:e.arcade,arcadeUtils:e,Dictionary:e.Dictionary,Feature:e.arcadeFeature}})()),z_}const Cbe=(e,t,i)=>Lm.create(e,t,i,null,["$feature"]),Pbe=(e,t,i)=>Lm.create(e,t,i,null,["$feature","$view"]),xX=(e,t,i,s)=>Lm.create(e,t,i,s,["$feature","$view"]);class Lm{constructor(t,i,s,r,n,o,a,l){this.script=t,this.evaluate=n;const u=Array.isArray(a)?a:a.fields;this.fields=u,this._syntaxTree=r,this._arcade=i,this._arcadeDictionary=s,this._arcadeFeature=o,this._spatialReference=l,this._referencesGeometry=i.scriptTouchesGeometry(this._syntaxTree),this._referencesScale=this._arcade.referencesMember(this._syntaxTree,"scale")}static async create(t,i,s,r,n,o){const{arcade:a,Feature:l,Dictionary:u}=await Do(),d=xe.fromJSON(i);let f=null;try{f=a.parseScript(t,o)}catch(F){return wX.error(new L("arcade-bad-expression","Failed to parse arcade script",{script:t,error:F})),null}const m=n.reduce((F,G)=>({...F,[G]:null}),{});let y=null;M(r)&&(y=new u(r),y.immutable=!0,m.$config=null);const g=a.scriptUsesGeometryEngine(f),v=g&&a.enableGeometrySupport(),b=a.scriptUsesFeatureSet(f)&&a.enableFeatureSetSupport(),_=a.scriptIsAsync(f),x=_&&a.enableAsyncSupport(),$={vars:m,spatialReference:d,useAsync:!!x};await Promise.all([v,b,x]);const I=new Set;await a.loadDependentModules(I,f,null,_,g);const T=new u;T.immutable=!1,T.setField("scale",0);const k=a.compileScript(f,$),A=F=>("$view"in F&&F.$view&&(T.setField("scale",F.$view.scale),F.$view=T),y&&(F.$config=y),k({vars:F,spatialReference:d}));return new Lm(t,a,u,f,A,new l,s,d)}repurposeFeature(t){return t.geometry&&!t.geometry.spatialReference&&(t.geometry.spatialReference=this._spatialReference),this._arcadeFeature.repurposeFromGraphicLikeObject(t.geometry,t.attributes,{fields:this.fields}),this._arcadeFeature}createDictionary(){return new this._arcadeDictionary}referencesMember(t){return this._arcade.referencesMember(this._syntaxTree,t)}referencesFunction(t){return this._arcade.referencesFunction(this._syntaxTree,t)}referencesGeometry(){return this._referencesGeometry}referencesScale(){return this._referencesScale}extractFieldLiterals(){return this._arcade.extractExpectedFieldLiterals(this._syntaxTree)}}const SX=/^([0-9])/,MX=/[^A-Za-z0-9_\u0080-\uffff]/g,$X=/_{2,}/g,TX=/^_/,IX=/_$/;function EX(e){return e?e.trim().replace(MX,"_").replace($X,"_").replace(TX,"").replace(IX,"").replace(SX,"F$1"):null}const kX=["field","field2","field3","normalizationField","rotationInfo.field","proportionalSymbolInfo.field","proportionalSymbolInfo.normalizationField","colorInfo.field","colorInfo.normalizationField"],CX=["field","normalizationField"];function Ik(e,t){if(e!=null&&t!=null){for(const i of Array.isArray(e)?e:[e])if(Ek(kX,i,t),"visualVariables"in i&&i.visualVariables)for(const s of i.visualVariables)Ek(CX,s,t)}}function Ek(e,t,i){if(e)for(const s of e){const r=rd(s,t),n=r&&typeof r!="function"&&i.get(r);n&&Ei(s,n.name,t)}}function AD(e,t){var i,s,r,n,o;if(e!=null&&((i=t==null?void 0:t.fields)==null?void 0:i.length))if("startField"in e){const a=t.get(e.startField),l=t.get(e.endField);e.startField=(s=a==null?void 0:a.name)!=null?s:null,e.endField=(r=l==null?void 0:l.name)!=null?r:null}else{const a=t.get(e.startTimeField),l=t.get(e.endTimeField);e.startTimeField=(n=a==null?void 0:a.name)!=null?n:null,e.endTimeField=(o=l==null?void 0:l.name)!=null?o:null}}const B_=new Set;function OD(e,t){return e&&t?(B_.clear(),Xf(B_,e,t),Array.from(B_).sort()):[]}function Xf(e,t,i){var s;if(i)if((s=t==null?void 0:t.fields)!=null&&s.length)if(i.includes("*"))for(const{name:r}of t.fields)e.add(r);else for(const r of i)$s(e,t,r);else{if(i.includes("*"))return e.clear(),void e.add("*");for(const r of i)r!=null&&e.add(r)}}function $s(e,t,i){if(typeof i=="string")if(t){const s=t.get(i);s&&e.add(s.name)}else e.add(i)}function Abe(e,t){var i;return N(t)||N(e)?[]:t.includes("*")?((i=e.fields)!=null?i:[]).map(s=>s.name):t}async function Ui(e,t,i){var n;if(!i)return;const{arcadeUtils:s}=await Do(),r=s.extractFieldNames(i,(n=t==null?void 0:t.fields)==null?void 0:n.map(o=>o.name));for(const o of r)$s(e,t,o)}async function RD(e,t,i){if(i&&i!=="1=1"){const s=(await z(()=>import("./WhereClause.5b749615.js"),[])).WhereClause.create(i,t);if(!s.isStandardized)throw new L("fieldUtils:collectFilterFields","Where clause is not standardized",{where:i});Xf(e,t,s.fieldNames)}}function PX({displayField:e,fields:t}){return e||(t&&t.length?U_(t,"name-or-title")||U_(t,"unique-identifier")||U_(t,"type-or-category")||AX(t):null)}function AX(e){for(const t of e){if(!t||!t.name)continue;const i=t.name.toLowerCase();if(i.includes("name")||i.includes("title"))return t.name}return null}function U_(e,t){for(const i of e)if(i&&i.valueType&&i.valueType===t)return i.name;return null}async function Obe(e,t){if(!t)return;const i=rd("elevationInfo.featureExpressionInfo",t);return i?i.collectRequiredFields(e,t.fieldsIndex):void 0}function OX(e,t,i){i.onStatisticExpression?Ui(e,t,i.onStatisticExpression.expression):e.add(i.onStatisticField)}async function Rbe(e,t,i){if(!t||!i||!("fields"in i))return;const s=[],r=i.popupTemplate;s.push(RX(e,t,r)),i.fields&&s.push(...i.fields.map(async n=>OX(e,t.fieldsIndex,n))),await Promise.all(s)}async function RX(e,t,i){const s=[];i!=null&&i.expressionInfos&&s.push(...i.expressionInfos.map(n=>Ui(e,t.fieldsIndex,n.expression)));const r=i==null?void 0:i.content;if(Array.isArray(r))for(const n of r)n.type==="expression"&&n.expressionInfo&&s.push(Ui(e,t.fieldsIndex,n.expressionInfo.expression));await Promise.all(s)}async function Lbe(e,t,i){t&&(t.timeInfo&&M(i)&&i.timeExtent&&Xf(e,t.fieldsIndex,[t.timeInfo.startField,t.timeInfo.endField]),t.floorInfo&&Xf(e,t.fieldsIndex,[t.floorInfo.floorField]),M(i)&&M(i.where)&&await RD(e,t.fieldsIndex,i.where))}async function Fbe(e,t,i){t&&i&&await Promise.all(i.map(s=>LX(e,t,s)))}async function LX(e,t,i){t&&i&&(i.valueExpression?await Ui(e,t.fieldsIndex,i.valueExpression):i.field&&$s(e,t.fieldsIndex,i.field))}function Dbe(e){if(!e)return[];const t="editFieldsInfo"in e&&e.editFieldsInfo;return t?OD(e.fieldsIndex,[t&&t.creatorField,t&&t.creationDateField,t&&t.editorField,t&&t.editDateField]):[]}async function Nbe(e,t){const{labelingInfo:i,fieldsIndex:s}=t;i&&i.length&&await Promise.all(i.map(r=>FX(e,s,r)))}async function FX(e,t,i){if(!i)return;const s=i.getLabelExpression(),r=i.where;if(s.type==="arcade")await Ui(e,t,s.expression);else{const n=s.expression.match(/{[^}]*}/g);n&&n.forEach(o=>{$s(e,t,o.slice(1,-1))})}await RD(e,t,r)}function DX(e){const t=e.defaultValue;return t!==void 0&&DD(e,t)?t:e.nullable?null:void 0}function LD(e){return typeof e=="number"&&!isNaN(e)&&isFinite(e)}function NX(e){return e===null||LD(e)}const H$="isInteger"in Number?Number.isInteger:e=>typeof e=="number"&&isFinite(e)&&Math.floor(e)===e;function jX(e){return e===null||H$(e)}function FD(e){return e!=null&&typeof e=="string"}function VX(e){return e===null||FD(e)}function zX(){return!0}function DD(e,t){let i;switch(e.type){case"date":case"integer":case"long":case"small-integer":case"esriFieldTypeDate":case"esriFieldTypeInteger":case"esriFieldTypeLong":case"esriFieldTypeSmallInteger":i=e.nullable?jX:H$;break;case"double":case"single":case"esriFieldTypeSingle":case"esriFieldTypeDouble":i=e.nullable?NX:LD;break;case"string":case"esriFieldTypeString":i=e.nullable?VX:FD;break;default:i=zX}return arguments.length===1?i:i(t)}const BX=["integer","small-integer","single","double"],UX=new Set([...BX,"esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSingle","esriFieldTypeDouble"]);function Y$(e){return e!=null&&UX.has(e.type)}function jbe(e){return e!=null&&(e.type==="string"||e.type==="esriFieldTypeString")}var vv,bv;function Vbe(e){return e==null||typeof e=="number"&&isNaN(e)?null:e}function zbe(e,t){return e.nullable&&t===null?null:Y$(e)&&!qX(e.type,Number(t))?vv.OUT_OF_RANGE:DD(e,t)?e.domain?_X(e.domain,t):null:bv.INVALID_TYPE}function qX(e,t){const i=typeof e=="string"?ND(e):e;if(!i)return!1;const s=i.min,r=i.max;return i.isInteger?H$(t)&&t>=s&&t<=r:t>=s&&t<=r}function ND(e){switch(e){case"esriFieldTypeSmallInteger":case"small-integer":return GX;case"esriFieldTypeInteger":case"integer":return WX;case"esriFieldTypeSingle":case"single":return HX;case"esriFieldTypeDouble":case"double":return YX}}(function(e){e.OUT_OF_RANGE="numeric-range-validation-error::out-of-range"})(vv||(vv={})),function(e){e.INVALID_TYPE="type-validation-error::invalid-type"}(bv||(bv={}));const GX={min:-32768,max:32767,isInteger:!0},WX={min:-2147483648,max:2147483647,isInteger:!0},HX={min:-34e37,max:12e37,isInteger:!1},YX={min:-Number.MAX_VALUE,max:Number.MAX_VALUE,isInteger:!1};function Bbe(e,t,i){switch(e){case Wh.INVALID_CODED_VALUE:return`Value ${i} is not in the coded domain - field: ${t.name}, domain: ${JSON.stringify(t.domain)}`;case Wh.VALUE_OUT_OF_RANGE:return`Value ${i} is out of the range of valid values - field: ${t.name}, domain: ${JSON.stringify(t.domain)}`;case bv.INVALID_TYPE:return`Value ${i} is not a valid value for the field type - field: ${t.name}, type: ${t.type}, nullable: ${t.nullable}`;case vv.OUT_OF_RANGE:{const{min:s,max:r}=ND(t.type);return`Value ${i} is out of range for the number type - field: ${t.name}, type: ${t.type}, value range is ${s} to ${r}`}}}function JX(e,t){return!XX(e,t,null)}function XX(e,t,i){if(!t||!t.attributes||!e){if(M(i))for(const n of e!=null?e:[])i.add(n);return!0}const s=t.attributes;let r=!1;for(const n of e)if(!(n in s)){if(r=!0,!M(i))break;i.add(n)}return r}function jD(e){return["raster.itempixelvalue","raster.servicepixelvalue"].some(t=>e.toLowerCase().startsWith(t))}let Sg=class extends W{constructor(e){super(e),this.type=null}};c([h({type:["attachments","custom","fields","media","text","expression","relationship"],readOnly:!0,json:{read:!1,write:!0}})],Sg.prototype,"type",void 0),Sg=c([S("esri.popup.content.Content")],Sg);const ml=Sg;var ox;let Rl=ox=class extends ml{constructor(e){super(e),this.description=null,this.displayType="auto",this.title=null,this.type="attachments"}clone(){return new ox({description:this.description,displayType:this.displayType,title:this.title})}};c([h({type:String,json:{write:!0}})],Rl.prototype,"description",void 0),c([h({type:["auto","preview","list"],json:{write:!0}})],Rl.prototype,"displayType",void 0),c([h({type:String,json:{write:!0}})],Rl.prototype,"title",void 0),c([h({type:["attachments"],readOnly:!0,json:{read:!1,write:!0}})],Rl.prototype,"type",void 0),Rl=ox=c([S("esri.popup.content.AttachmentsContent")],Rl);const Zf=Rl;var ax;let Ll=ax=class extends ml{constructor(e){super(e),this.creator=null,this.destroyer=null,this.outFields=null,this.type="custom"}clone(){return new ax({creator:this.creator,destroyer:this.destroyer,outFields:Array.isArray(this.outFields)?R(this.outFields):null})}};c([h()],Ll.prototype,"creator",void 0),c([h()],Ll.prototype,"destroyer",void 0),c([h()],Ll.prototype,"outFields",void 0),c([h({type:["custom"],readOnly:!0})],Ll.prototype,"type",void 0),Ll=ax=c([S("esri.popup.content.CustomContent")],Ll);const ZX=Ll;var lx;let Ou=lx=class extends W{constructor(e){super(e),this.title=null,this.expression=null,this.returnType="dictionary"}clone(){return new lx({title:this.title,expression:this.expression})}};c([h({type:String,json:{write:!0}})],Ou.prototype,"title",void 0),c([h({type:String,json:{write:!0}})],Ou.prototype,"expression",void 0),c([h({type:["dictionary"],readOnly:!0,json:{read:!1,write:!0}})],Ou.prototype,"returnType",void 0),Ou=lx=c([S("esri.popup.ElementExpressionInfo")],Ou);const VD=Ou;var cx;let up=cx=class extends ml{constructor(e){super(e),this.expressionInfo=null,this.type="expression"}clone(){var e;return new cx({expressionInfo:(e=this.expressionInfo)==null?void 0:e.clone()})}};c([h({type:VD,json:{write:!0}})],up.prototype,"expressionInfo",void 0),c([h({type:["expression"],readOnly:!0,json:{read:!1,write:!0}})],up.prototype,"type",void 0),up=cx=c([S("esri.popup.content.ExpressionContent")],up);const J$=up;function ue(e,t={}){var r;const i=e instanceof Ie?e:new Ie(e,t),s={type:(r=t==null?void 0:t.ignoreUnknown)==null||r?i.apiValues:String,json:{type:i.jsonValues,read:!(t!=null&&t.readOnly)&&{reader:i.read},write:{writer:i.write}}};return(t==null?void 0:t.readOnly)!==void 0&&(s.readOnly=!!t.readOnly),(t==null?void 0:t.default)!==void 0&&(s.json.default=t.default),(t==null?void 0:t.name)!==void 0&&(s.json.name=t.name),h(s)}const Qf=mi()({shortDate:"short-date",shortDateShortTime:"short-date-short-time",shortDateShortTime24:"short-date-short-time-24",shortDateLongTime:"short-date-long-time",shortDateLongTime24:"short-date-long-time-24",shortDateLE:"short-date-le",shortDateLEShortTime:"short-date-le-short-time",shortDateLEShortTime24:"short-date-le-short-time-24",shortDateLELongTime:"short-date-le-long-time",shortDateLELongTime24:"short-date-le-long-time-24",longMonthDayYear:"long-month-day-year",longMonthDayYearShortTime:"long-month-day-year-short-time",longMonthDayYearShortTime24:"long-month-day-year-short-time-24",longMonthDayYearLongTime:"long-month-day-year-long-time",longMonthDayYearLongTime24:"long-month-day-year-long-time-24",dayShortMonthYear:"day-short-month-year",dayShortMonthYearShortTime:"day-short-month-year-short-time",dayShortMonthYearShortTime24:"day-short-month-year-short-time-24",dayShortMonthYearLongTime:"day-short-month-year-long-time",dayShortMonthYearLongTime24:"day-short-month-year-long-time-24",longDate:"long-date",longDateShortTime:"long-date-short-time",longDateShortTime24:"long-date-short-time-24",longDateLongTime:"long-date-long-time",longDateLongTime24:"long-date-long-time-24",longMonthYear:"long-month-year",shortMonthYear:"short-month-year",year:"year"});Qf.toJSON.bind(Qf);Qf.fromJSON.bind(Qf);var ux;let Fl=ux=class extends W{constructor(e){super(e),this.dateFormat=null,this.dateTimeFormatOptions=null,this.digitSeparator=!1,this.places=null}clone(){return new ux({dateFormat:this.dateFormat,digitSeparator:this.digitSeparator,places:this.places})}format(e){return this.dateFormat?Po(e,{...HM(this.dateFormat),...this.dateTimeFormatOptions}):sl(e,nR(this))}formatRasterPixelValue(e){if(e.includes("-"))return e;let t,i;return e.trim().includes(",")?(t=",",i=t+" ",this._formatDelimitedString(e,t,i,this)):e.trim().includes(";")?(t=";",i=t+" ",this._formatDelimitedString(e,t,i,this)):e.trim().includes(" ")?(t=i=" ",this._formatDelimitedString(e,t,i,this)):this.format(Number(e))}_formatDelimitedString(e,t,i,s){return e&&t&&i&&s?e.trim().split(t).map(r=>this.format(Number(r))).join(i):e}};c([ue(Qf)],Fl.prototype,"dateFormat",void 0),c([h({type:Object,json:{read:!1}})],Fl.prototype,"dateTimeFormatOptions",void 0),c([h({type:Boolean,json:{write:!0}})],Fl.prototype,"digitSeparator",void 0),c([h({type:Ge,json:{write:!0}})],Fl.prototype,"places",void 0),Fl=ux=c([S("esri.popup.support.FieldInfoFormat")],Fl);const fh=Fl;var hx;let hr=hx=class extends W{constructor(e){super(e),this.fieldName=null,this.format=null,this.isEditable=!1,this.label=null,this.stringFieldOption="text-box",this.statisticType=null,this.tooltip=null,this.visible=!0}clone(){return new hx({fieldName:this.fieldName,format:this.format?R(this.format):null,isEditable:this.isEditable,label:this.label,stringFieldOption:this.stringFieldOption,statisticType:this.statisticType,tooltip:this.tooltip,visible:this.visible})}};c([h({type:String,json:{write:!0}})],hr.prototype,"fieldName",void 0),c([h({type:fh,json:{write:!0}})],hr.prototype,"format",void 0),c([h({type:Boolean,json:{write:!0,default:!1}})],hr.prototype,"isEditable",void 0),c([h({type:String,json:{write:!0}})],hr.prototype,"label",void 0),c([ue(new Ie({richtext:"rich-text",textarea:"text-area",textbox:"text-box"}),{default:"text-box"})],hr.prototype,"stringFieldOption",void 0),c([h({type:["count","sum","min","max","avg","stddev","var"],json:{write:!0}})],hr.prototype,"statisticType",void 0),c([h({type:String,json:{write:!0}})],hr.prototype,"tooltip",void 0),c([h({type:Boolean,json:{write:!0}})],hr.prototype,"visible",void 0),hr=hx=c([S("esri.popup.FieldInfo")],hr);const Fm=hr;var dx;let Hn=dx=class extends ml{constructor(e){super(e),this.attributes=null,this.description=null,this.fieldInfos=null,this.title=null,this.type="fields"}writeFieldInfos(e,t){t.fieldInfos=e&&e.map(i=>i.toJSON())}clone(){return new dx(R({attributes:this.attributes,description:this.description,fieldInfos:this.fieldInfos,title:this.title}))}};c([h({type:Object,json:{write:!0}})],Hn.prototype,"attributes",void 0),c([h({type:String,json:{write:!0}})],Hn.prototype,"description",void 0),c([h({type:[Fm]})],Hn.prototype,"fieldInfos",void 0),c([ie("fieldInfos")],Hn.prototype,"writeFieldInfos",null),c([h({type:String,json:{write:!0}})],Hn.prototype,"title",void 0),c([h({type:["fields"],readOnly:!0,json:{read:!1,write:!0}})],Hn.prototype,"type",void 0),Hn=dx=c([S("esri.popup.content.FieldsContent")],Hn);const Hh=Hn;let Dl=class extends W{constructor(e){super(e),this.altText=null,this.caption="",this.title="",this.type=null}};c([h({type:String,json:{write:!0}})],Dl.prototype,"altText",void 0),c([h({type:String,json:{write:!0}})],Dl.prototype,"caption",void 0),c([h({type:String,json:{write:!0}})],Dl.prototype,"title",void 0),c([h({type:["image","bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],Dl.prototype,"type",void 0),Dl=c([S("esri.popup.content.mixins.MediaInfo")],Dl);const X$=Dl;var px;let Ru=px=class extends oe{constructor(e){super(e),this.fieldName=null,this.tooltip=null,this.value=null}clone(){return new px({fieldName:this.fieldName,tooltip:this.tooltip,value:this.value})}};c([h()],Ru.prototype,"fieldName",void 0),c([h()],Ru.prototype,"tooltip",void 0),c([h()],Ru.prototype,"value",void 0),Ru=px=c([S("esri.popup.content.support.ChartMediaInfoValueSeries")],Ru);const zD=Ru;var fx;let Nl=fx=class extends W{constructor(e){super(e),this.fields=[],this.normalizeField=null,this.series=[],this.tooltipField=null}clone(){return new fx({fields:R(this.fields),normalizeField:this.normalizeField,tooltipField:this.tooltipField})}};c([h({type:[String],json:{write:!0}})],Nl.prototype,"fields",void 0),c([h({type:String,json:{write:!0}})],Nl.prototype,"normalizeField",void 0),c([h({type:[zD],json:{read:!1}})],Nl.prototype,"series",void 0),c([h({type:String,json:{write:!0}})],Nl.prototype,"tooltipField",void 0),Nl=fx=c([S("esri.popup.content.support.ChartMediaInfoValue")],Nl);const QX=Nl;let hp=class extends X${constructor(e){super(e),this.type=null,this.value=null}};c([h({type:["bar-chart","column-chart","line-chart","pie-chart"],readOnly:!0,json:{read:!1,write:!0}})],hp.prototype,"type",void 0),c([h({type:QX,json:{write:!0}})],hp.prototype,"value",void 0),hp=c([S("esri.popup.content.mixins.ChartMediaInfo")],hp);const Pb=hp,Ab=mi()({barchart:"bar-chart",columnchart:"column-chart",linechart:"line-chart",piechart:"pie-chart"});var mx;let Mg=mx=class extends Pb{constructor(e){super(e),this.type="bar-chart"}clone(){return new mx({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};c([h({type:["bar-chart"],readOnly:!0,json:{type:["barchart"],read:!1,write:Ab.write}})],Mg.prototype,"type",void 0),Mg=mx=c([S("esri.popup.content.BarChartMediaInfo")],Mg);const BD=Mg;var yx;let $g=yx=class extends Pb{constructor(e){super(e),this.type="column-chart"}clone(){return new yx({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};c([h({type:["column-chart"],readOnly:!0,json:{type:["columnchart"],read:!1,write:Ab.write}})],$g.prototype,"type",void 0),$g=yx=c([S("esri.popup.content.ColumnChartMediaInfo")],$g);const UD=$g;var gx;let dp=gx=class extends W{constructor(e){super(e),this.linkURL=null,this.sourceURL=null}clone(){return new gx({linkURL:this.linkURL,sourceURL:this.sourceURL})}};c([h({type:String,json:{write:!0}})],dp.prototype,"linkURL",void 0),c([h({type:String,json:{write:!0}})],dp.prototype,"sourceURL",void 0),dp=gx=c([S("esri.popup.content.support.ImageMediaInfoValue")],dp);const KX=dp;var vx;let Lu=vx=class extends X${constructor(e){super(e),this.refreshInterval=null,this.type="image",this.value=null}clone(){return new vx({altText:this.altText,title:this.title,caption:this.caption,refreshInterval:this.refreshInterval,value:this.value?this.value.clone():null})}};c([h({type:Number,json:{write:!0}})],Lu.prototype,"refreshInterval",void 0),c([h({type:["image"],readOnly:!0,json:{read:!1,write:!0}})],Lu.prototype,"type",void 0),c([h({type:KX,json:{write:!0}})],Lu.prototype,"value",void 0),Lu=vx=c([S("esri.popup.content.ImageMediaInfo")],Lu);const qD=Lu;var bx;let Tg=bx=class extends Pb{constructor(e){super(e),this.type="line-chart"}clone(){return new bx({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};c([h({type:["line-chart"],readOnly:!0,json:{type:["linechart"],read:!1,write:Ab.write}})],Tg.prototype,"type",void 0),Tg=bx=c([S("esri.popup.content.LineChartMediaInfo")],Tg);const GD=Tg;var _x;let Ig=_x=class extends Pb{constructor(e){super(e),this.type="pie-chart"}clone(){return new _x({altText:this.altText,title:this.title,caption:this.caption,value:this.value?this.value.clone():null})}};c([h({type:["pie-chart"],readOnly:!0,json:{type:["piechart"],read:!1,write:Ab.write}})],Ig.prototype,"type",void 0),Ig=_x=c([S("esri.popup.content.PieChartMediaInfo")],Ig);const WD=Ig,HD={base:X$,key:"type",defaultKeyValue:"image",typeMap:{"bar-chart":BD,"column-chart":UD,"line-chart":GD,"pie-chart":WD,image:qD}};var wx;let dr=wx=class extends ml{constructor(e){super(e),this.activeMediaInfoIndex=null,this.attributes=null,this.description=null,this.mediaInfos=null,this.title=null,this.type="media"}readMediaInfos(e){return e&&e.map(t=>t.type==="image"?qD.fromJSON(t):t.type==="barchart"?BD.fromJSON(t):t.type==="columnchart"?UD.fromJSON(t):t.type==="linechart"?GD.fromJSON(t):t.type==="piechart"?WD.fromJSON(t):void 0).filter(Boolean)}writeMediaInfos(e,t){t.mediaInfos=e&&e.map(i=>i.toJSON())}clone(){return new wx(R({activeMediaInfoIndex:this.activeMediaInfoIndex,attributes:this.attributes,description:this.description,mediaInfos:this.mediaInfos,title:this.title}))}};c([h()],dr.prototype,"activeMediaInfoIndex",void 0),c([h({type:Object,json:{write:!0}})],dr.prototype,"attributes",void 0),c([h({type:String,json:{write:!0}})],dr.prototype,"description",void 0),c([h({types:[HD]})],dr.prototype,"mediaInfos",void 0),c([Q("mediaInfos")],dr.prototype,"readMediaInfos",null),c([ie("mediaInfos")],dr.prototype,"writeMediaInfos",null),c([h({type:String,json:{write:!0}})],dr.prototype,"title",void 0),c([h({type:["media"],readOnly:!0,json:{read:!1,write:!0}})],dr.prototype,"type",void 0),dr=wx=c([S("esri.popup.content.MediaContent")],dr);const Kf=dr;var xx;let pp=xx=class extends W{constructor(e){super(e),this.field=null,this.order=null}clone(){return new xx({field:this.field,order:this.order})}};c([h({type:String,json:{write:!0}})],pp.prototype,"field",void 0),c([h({type:["asc","desc"],json:{write:!0}})],pp.prototype,"order",void 0),pp=xx=c([S("esri.popup.support.RelatedRecordsInfoFieldOrder")],pp);const Z$=pp;let Zr=class extends xt(ml){constructor(e){super(e),this.description=null,this.displayCount=null,this.displayType="list",this.orderByFields=null,this.relationshipId=null,this.title=null,this.type="relationship"}};c([h({type:String,json:{write:!0}})],Zr.prototype,"description",void 0),c([h({type:Number,json:{type:Ge,write:!0}})],Zr.prototype,"displayCount",void 0),c([h({type:["list"],json:{write:!0}})],Zr.prototype,"displayType",void 0),c([h({type:[Z$],json:{write:!0}})],Zr.prototype,"orderByFields",void 0),c([h({type:Number,json:{type:Ge,write:!0}})],Zr.prototype,"relationshipId",void 0),c([h({type:String,json:{write:!0}})],Zr.prototype,"title",void 0),c([h({type:["relationship"],readOnly:!0,json:{read:!1,write:!0}})],Zr.prototype,"type",void 0),Zr=c([S("esri.popup.content.RelationshipContent")],Zr);const _v=Zr;var Sx;let fp=Sx=class extends ml{constructor(e){super(e),this.text=null,this.type="text"}clone(){return new Sx({text:this.text})}};c([h({type:String,json:{write:!0}})],fp.prototype,"text",void 0),c([h({type:["text"],readOnly:!0,json:{read:!1,write:!0}})],fp.prototype,"type",void 0),fp=Sx=c([S("esri.popup.content.TextContent")],fp);const Yh=fp,eZ={base:null,key:"type",typeMap:{attachment:Zf,media:Kf,text:Yh,expression:J$,field:Hh,relationship:_v}};var Mx;let jl=Mx=class extends W{constructor(e){super(e),this.name=null,this.title=null,this.expression=null,this.returnType=null}clone(){return new Mx({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};c([h({type:String,json:{write:!0}})],jl.prototype,"name",void 0),c([h({type:String,json:{write:!0}})],jl.prototype,"title",void 0),c([h({type:String,json:{write:!0}})],jl.prototype,"expression",void 0),c([h({type:["string","number"],json:{write:!0}})],jl.prototype,"returnType",void 0),jl=Mx=c([S("esri.popup.ExpressionInfo")],jl);const YD=jl;var $x;let mp=$x=class extends W{constructor(e){super(e),this.returnTopmostRaster=null,this.showNoDataRecords=null}clone(){return new $x({showNoDataRecords:this.showNoDataRecords,returnTopmostRaster:this.returnTopmostRaster})}};c([h({type:Boolean,json:{write:!0}})],mp.prototype,"returnTopmostRaster",void 0),c([h({type:Boolean,json:{write:!0}})],mp.prototype,"showNoDataRecords",void 0),mp=$x=c([S("esri.popup.LayerOptions")],mp);const tZ=mp;var Tx;let yp=Tx=class extends W{constructor(e){super(e),this.showRelatedRecords=null,this.orderByFields=null}clone(){return new Tx({showRelatedRecords:this.showRelatedRecords,orderByFields:this.orderByFields?R(this.orderByFields):null})}};c([h({type:Boolean,json:{write:!0}})],yp.prototype,"showRelatedRecords",void 0),c([h({type:[Z$],json:{write:!0}})],yp.prototype,"orderByFields",void 0),yp=Tx=c([S("esri.popup.RelatedRecordsInfo")],yp);const iZ=yp;var Ix;let pr=Ix=class extends Om(oe){constructor(e){super(e),this.active=!1,this.className=null,this.disabled=!1,this.id=null,this.indicator=!1,this.title=null,this.type=null,this.visible=!0}clone(){return new Ix({active:this.active,className:this.className,disabled:this.disabled,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible})}};c([h()],pr.prototype,"active",void 0),c([h()],pr.prototype,"className",void 0),c([h()],pr.prototype,"disabled",void 0),c([h()],pr.prototype,"id",void 0),c([h()],pr.prototype,"indicator",void 0),c([h()],pr.prototype,"title",void 0),c([h()],pr.prototype,"type",void 0),c([h()],pr.prototype,"visible",void 0),pr=Ix=c([S("esri.support.actions.ActionBase")],pr);const Ob=pr;var Ex;let Eg=Ex=class extends Ob{constructor(e){super(e),this.image=null,this.type="button"}clone(){return new Ex({active:this.active,className:this.className,disabled:this.disabled,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image})}};c([h()],Eg.prototype,"image",void 0),Eg=Ex=c([S("esri.support.Action.ActionButton")],Eg);const pd=Eg;var kx;let gp=kx=class extends Ob{constructor(e){super(e),this.image=null,this.type="toggle",this.value=!1}clone(){return new kx({active:this.active,className:this.className,disabled:this.disabled,id:this.id,indicator:this.indicator,title:this.title,visible:this.visible,image:this.image,value:this.value})}};c([h()],gp.prototype,"image",void 0),c([h()],gp.prototype,"value",void 0),gp=kx=c([S("esri.support.Action.ActionToggle")],gp);const JD=gp,sZ="esri.PopupTemplate",rZ=q.getLogger(sZ),Ld="relationships/",kk="expression/",nZ=he.ofType({key:"type",defaultKeyValue:"button",base:Ob,typeMap:{button:pd,toggle:JD}}),oZ={base:ml,key:"type",typeMap:{media:Kf,custom:ZX,text:Yh,attachments:Zf,fields:Hh,expression:J$,relationship:_v}},aZ=["attachments","fields","media","text","expression","relationship"];let Wt=class extends xt(W){constructor(){super(...arguments),this.actions=null,this.content="",this.expressionInfos=null,this.fieldInfos=null,this.layerOptions=null,this.lastEditInfoEnabled=!0,this.outFields=null,this.overwriteActions=!1,this.returnGeometry=!1,this.title=""}castContent(e){return Array.isArray(e)?e.map(t=>En(oZ,t)):typeof e=="string"||typeof e=="function"||e instanceof HTMLElement||No(e)?e:(rZ.error("content error","unsupported content value",{value:e}),null)}readContent(e,t){const{popupElements:i}=t;return Array.isArray(i)&&i.length>0?this._readPopupInfoElements(t.description,t.mediaInfos,i):this._readPopupInfo(t)}writeContent(e,t,i,s){typeof e!="string"?Array.isArray(e)&&(t.popupElements=e.filter(r=>aZ.includes(r.type)).map(r=>r&&r.toJSON(s)),t.popupElements.forEach(r=>{r.type==="attachments"?this._writeAttachmentContent(t):r.type==="media"?this._writeMediaContent(r,t):r.type==="text"?this._writeTextContent(r,t):r.type==="relationship"&&this._writeRelationshipContent(r,t)})):t.description=e}writeFieldInfos(e,t,i,s){const{content:r}=this,n=Array.isArray(r)?r:null;if(e){const o=n?n.filter(l=>l.type==="fields"):[],a=o.length&&o.every(l=>{var u;return(u=l.fieldInfos)==null?void 0:u.length});t.fieldInfos=e.filter(Boolean).map(l=>{const u=l.toJSON(s);return a&&(u.visible=!1),u})}if(n)for(const o of n)o.type==="fields"&&this._writeFieldsContent(o,t)}writeLayerOptions(e,t,i,s){t[i]=!e||e.showNoDataRecords===null&&e.returnTopmostRaster===null?null:e.toJSON(s)}writeTitle(e,t){t.title=e||""}async collectRequiredFields(e,t){const i=this.expressionInfos||[];await this._collectExpressionInfoFields(e,t,[...i,...this._getContentExpressionInfos(this.content,i)]),Xf(e,t,[...this.outFields||[],...this._getActionsFields(this.actions),...this._getTitleFields(this.title),...this._getContentFields(this.content)])}async getRequiredFields(e){const t=new Set;return await this.collectRequiredFields(t,e),[...t].sort()}_writeFieldsContent(e,t){if(!Array.isArray(e.fieldInfos)||!e.fieldInfos.length)return;const i=R(e.fieldInfos);Array.isArray(t.fieldInfos)?i.forEach(s=>{const r=t.fieldInfos.find(n=>n.fieldName.toLowerCase()===s.fieldName.toLowerCase());r?r.visible=!0:t.fieldInfos.push(s)}):t.fieldInfos=i}_writeAttachmentContent(e){e.showAttachments||(e.showAttachments=!0)}_writeRelationshipContent(e,t){var r,n;const i=((r=e.orderByFields)==null?void 0:r.map(o=>this._toFieldOrderJSON(o,e.relationshipId)))||[],s=[...((n=t.relatedRecordsInfo)==null?void 0:n.orderByFields)||[],...i];t.relatedRecordsInfo={showRelatedRecords:!0,...(s==null?void 0:s.length)&&{orderByFields:s}}}_writeTextContent(e,t){!t.description&&e.text&&(t.description=e.text)}_writeMediaContent(e,t){if(!Array.isArray(e.mediaInfos)||!e.mediaInfos.length)return;const i=R(e.mediaInfos);Array.isArray(t.mediaInfos)?t.mediaInfos=[...t.mediaInfos,...i]:t.mediaInfos=i}_readPopupInfoElements(e,t,i){const s={description:!1,mediaInfos:!1};return i.map(r=>r.type==="media"?(r.mediaInfos||!t||s.mediaInfos||(r.mediaInfos=t,s.mediaInfos=!0),Kf.fromJSON(r)):r.type==="text"?(r.text||!e||s.description||(r.text=e,s.description=!0),Yh.fromJSON(r)):r.type==="attachments"?Zf.fromJSON(r):r.type==="fields"?Hh.fromJSON(r):r.type==="expression"?J$.fromJSON(r):r.type==="relationship"?_v.fromJSON(r):void 0).filter(Boolean)}_toRelationshipContent(e){const{field:t,order:i}=e;if(!(t!=null&&t.startsWith(Ld)))return null;const s=t.replace(Ld,"").split("/");if(s.length!==2)return null;const r=parseInt(s[0],10),n=s[1];return typeof r=="number"&&n?_v.fromJSON({relationshipId:r,orderByFields:[{field:n,order:i}]}):null}_toFieldOrderJSON(e,t){const{order:i,field:s}=e;return{field:`${Ld}${t}/${s}`,order:i}}_readPopupInfo({description:e,mediaInfos:t,showAttachments:i,relatedRecordsInfo:s={showRelatedRecords:!1}}){const r=[];e?r.push(new Yh({text:e})):r.push(new Hh),Array.isArray(t)&&t.length&&r.push(Kf.fromJSON({mediaInfos:t})),i&&r.push(Zf.fromJSON({displayType:"auto"}));const{showRelatedRecords:n,orderByFields:o}=s;return n&&(o==null?void 0:o.length)&&o.forEach(a=>{const l=this._toRelationshipContent(a);l&&r.push(l)}),r.length?r:e}_getContentElementFields(e){var i;const t=e==null?void 0:e.type;if(t==="attachments")return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description)];if(t==="custom")return e.outFields||[];if(t==="fields")return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description),...this._getFieldInfoFields((i=e.fieldInfos)!=null?i:this.fieldInfos)];if(t==="media"){const s=e.mediaInfos||[];return[...this._extractFieldNames(e.title),...this._extractFieldNames(e.description),...s.reduce((r,n)=>[...r,...this._getMediaInfoFields(n)],[])]}return t==="text"?this._extractFieldNames(e.text):[]}_getMediaInfoFields(e){const{caption:t,title:i,value:s}=e,r=s||{},{fields:n,normalizeField:o,tooltipField:a,sourceURL:l,linkURL:u}=r,d=[...this._extractFieldNames(i),...this._extractFieldNames(t),...this._extractFieldNames(l),...this._extractFieldNames(u),...n!=null?n:[]];return o&&d.push(o),a&&d.push(a),d}_getContentExpressionInfos(e,t){return Array.isArray(e)?e.reduce((i,s)=>[...i,...s.type==="expression"&&s.expressionInfo?[s.expressionInfo]:[]],t):[]}_getContentFields(e){return typeof e=="string"?this._extractFieldNames(e):Array.isArray(e)?e.reduce((t,i)=>[...t,...this._getContentElementFields(i)],[]):[]}async _collectExpressionInfoFields(e,t,i){i&&await Promise.all(i.map(s=>Ui(e,t,s.expression)))}_getFieldInfoFields(e){return e?e.filter(t=>t.visible===void 0||!!t.visible).map(t=>t.fieldName).filter(t=>!t.startsWith(Ld)&&!t.startsWith(kk)):[]}_getActionsFields(e){return e?e.toArray().reduce((t,i)=>[...t,...this._getActionFields(i)],[]):[]}_getActionFields(e){const{className:t,title:i,type:s}=e,r=s==="button"||s==="toggle"?e.image:"";return[...this._extractFieldNames(i),...this._extractFieldNames(t),...this._extractFieldNames(r)]}_getTitleFields(e){return typeof e=="string"?this._extractFieldNames(e):[]}_extractFieldNames(e){if(!e||typeof e!="string")return[];const t=/{[^}]*}/g,i=e.match(t);if(!i)return[];const s=/\{(\w+):.+\}/,r=i.filter(n=>!(n.indexOf(`{${Ld}`)===0||n.indexOf(`{${kk}`)===0)).map(n=>n.replace(s,"{$1}"));return r?r.map(n=>n.slice(1,-1)):[]}};c([h({type:nZ})],Wt.prototype,"actions",void 0),c([h()],Wt.prototype,"content",void 0),c([Oe("content")],Wt.prototype,"castContent",null),c([Q("content",["description","fieldInfos","popupElements","mediaInfos","showAttachments","relatedRecordsInfo"])],Wt.prototype,"readContent",null),c([ie("content",{popupElements:{type:he.ofType(eZ)},showAttachments:{type:Boolean},mediaInfos:{type:he.ofType(HD)},description:{type:String},relatedRecordsInfo:{type:iZ}})],Wt.prototype,"writeContent",null),c([h({type:[YD],json:{write:!0}})],Wt.prototype,"expressionInfos",void 0),c([h({type:[Fm]})],Wt.prototype,"fieldInfos",void 0),c([ie("fieldInfos")],Wt.prototype,"writeFieldInfos",null),c([h({type:tZ})],Wt.prototype,"layerOptions",void 0),c([ie("layerOptions")],Wt.prototype,"writeLayerOptions",null),c([h({type:Boolean,json:{read:{source:"showLastEditInfo"},write:{target:"showLastEditInfo"},default:!0}})],Wt.prototype,"lastEditInfoEnabled",void 0),c([h()],Wt.prototype,"outFields",void 0),c([h()],Wt.prototype,"overwriteActions",void 0),c([h()],Wt.prototype,"returnGeometry",void 0),c([h({json:{type:String}})],Wt.prototype,"title",void 0),c([ie("title")],Wt.prototype,"writeTitle",null),Wt=c([S("esri.PopupTemplate")],Wt);const Dm=Wt;function wy(e){return ls(jM(e),0,255)}function xy(e,t,i){return e=Number(e),isNaN(e)?i:ei?i:e}class Pt{constructor(t){this.r=255,this.g=255,this.b=255,this.a=1,t&&this.setColor(t)}static blendColors(t,i,s,r=new Pt){return r.r=Math.round(t.r+(i.r-t.r)*s),r.g=Math.round(t.g+(i.g-t.g)*s),r.b=Math.round(t.b+(i.b-t.b)*s),r.a=t.a+(i.a-t.a)*s,r._sanitize()}static fromRgb(t,i){const s=t.toLowerCase().match(/^(rgba?|hsla?)\(([\s\.\-,%0-9]+)\)/);if(s){const r=s[2].split(/\s*,\s*/),n=s[1];if(n==="rgb"&&r.length===3||n==="rgba"&&r.length===4){const o=r[0];if(o.charAt(o.length-1)==="%"){const a=r.map(l=>2.56*parseFloat(l));return r.length===4&&(a[3]=parseFloat(r[3])),Pt.fromArray(a,i)}return Pt.fromArray(r.map(a=>parseFloat(a)),i)}if(n==="hsl"&&r.length===3||n==="hsla"&&r.length===4)return Pt.fromArray(MD(parseFloat(r[0]),parseFloat(r[1])/100,parseFloat(r[2])/100,parseFloat(r[3])),i)}return null}static fromHex(t,i=new Pt){if(t.length!==4&&t.length!==7||t[0]!=="#")return null;const s=t.length===4?4:8,r=(1<{const a=n&r;n>>=s,i[o]=s===4?17*a:a}),i.a=1,i)}static fromArray(t,i=new Pt){return i._set(Number(t[0]),Number(t[1]),Number(t[2]),Number(t[3])),isNaN(i.a)&&(i.a=1),i._sanitize()}static fromString(t,i){const s=SD(t)?z$(t):null;return s&&Pt.fromArray(s,i)||Pt.fromRgb(t,i)||Pt.fromHex(t,i)}static fromJSON(t){return t&&new Pt([t[0],t[1],t[2],t[3]/255])}static toUnitRGB(t){return M(t)?[t.r/255,t.g/255,t.b/255]:null}static toUnitRGBA(t){return M(t)?[t.r/255,t.g/255,t.b/255,t.a!=null?t.a:1]:null}get isBright(){return .299*this.r+.587*this.g+.114*this.b>=127}setColor(t){var i,s,r,n;return typeof t=="string"?Pt.fromString(t,this):Array.isArray(t)?Pt.fromArray(t,this):(this._set((i=t.r)!=null?i:0,(s=t.g)!=null?s:0,(r=t.b)!=null?r:0,(n=t.a)!=null?n:1),t instanceof Pt||this._sanitize()),this}toRgb(){return[this.r,this.g,this.b]}toRgba(){return[this.r,this.g,this.b,this.a]}toHex(){const t=this.r.toString(16),i=this.g.toString(16),s=this.b.toString(16);return`#${t.length<2?"0"+t:t}${i.length<2?"0"+i:i}${s.length<2?"0"+s:s}`}toCss(t=!1){const i=this.r+", "+this.g+", "+this.b;return t?`rgba(${i}, ${this.a})`:`rgb(${i})`}toString(){return this.toCss(!0)}toJSON(){return this.toArray()}toArray(t=Pt.AlphaMode.ALWAYS){const i=wy(this.r),s=wy(this.g),r=wy(this.b);return t===Pt.AlphaMode.ALWAYS||this.a!==1?[i,s,r,wy(255*this.a)]:[i,s,r]}clone(){return new Pt(this.toRgba())}hash(){return this.r<<24|this.g<<16|this.b<<8|255*this.a}equals(t){return M(t)&&t.r===this.r&&t.g===this.g&&t.b===this.b&&t.a===this.a}_sanitize(){return this.r=Math.round(xy(this.r,0,255)),this.g=Math.round(xy(this.g,0,255)),this.b=Math.round(xy(this.b,0,255)),this.a=xy(this.a,0,1),this}_set(t,i,s,r){this.r=t,this.g=i,this.b=s,this.a=r}}Pt.prototype.declaredClass="esri.Color",function(e){var t;(t=e.AlphaMode||(e.AlphaMode={}))[t.ALWAYS=0]="ALWAYS",t[t.UNLESS_OPAQUE=1]="UNLESS_OPAQUE"}(Pt||(Pt={}));const pe=Pt,Ck=new Ie({esriSMS:"simple-marker",esriPMS:"picture-marker",esriSLS:"simple-line",esriSFS:"simple-fill",esriPFS:"picture-fill",esriTS:"text",esriSHD:"shield-label-symbol",PointSymbol3D:"point-3d",LineSymbol3D:"line-3d",PolygonSymbol3D:"polygon-3d",WebStyleSymbol:"web-style",MeshSymbol3D:"mesh-3d",LabelSymbol3D:"label-3d",CIMSymbolReference:"cim"});let lZ=0,Fu=class extends W{constructor(e){super(e),this.id="sym"+lZ++,this.type=null,this.color=new pe([0,0,0,1])}readColor(e){return e&&e[0]!=null?[e[0],e[1],e[2],e[3]/255]:e}async collectRequiredFields(e,t){}hash(){return JSON.stringify(this.toJSON())}clone(){}};c([h({type:Ck.apiValues,readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0,writer:Ck.write}}})],Fu.prototype,"type",void 0),c([h({type:pe,json:{write:{allowNull:!0}}})],Fu.prototype,"color",void 0),c([Q("color")],Fu.prototype,"readColor",null),Fu=c([S("esri.symbols.Symbol")],Fu);const us=Fu;var Cx;let ca=Cx=class extends us{constructor(e){super(e),this.data=null,this.type="cim"}readData(e,t){return t}writeData(e,t){if(e)for(const i in e)t[i]=e[i]}async collectRequiredFields(e,t){var i;if(((i=this.data)==null?void 0:i.type)==="CIMSymbolReference"){const s=this.data.primitiveOverrides;if(s){const r=s.map(n=>{const o=n.valueExpressionInfo;return Ui(e,t,o.expression)});await Promise.all(r)}}}clone(){return new Cx({data:R(this.data)})}hash(){return NM(JSON.stringify(this.data)).toString()}};c([h({json:{write:!1}})],ca.prototype,"color",void 0),c([h({json:{write:!0}})],ca.prototype,"data",void 0),c([Q("data",["symbol"])],ca.prototype,"readData",null),c([ie("data",{})],ca.prototype,"writeData",null),c([ue({CIMSymbolReference:"cim"},{readOnly:!0})],ca.prototype,"type",void 0),ca=Cx=c([S("esri.symbols.CIMSymbol")],ca);const Nm=ca;let Du=class extends W{constructor(e){super(e),this.enabled=!0,this.type=null}writeEnabled(e,t,i){e||(t[i]=e)}};c([h({type:Boolean,json:{read:{source:"enable"},write:{target:"enable"}}})],Du.prototype,"enabled",void 0),c([ie("enabled")],Du.prototype,"writeEnabled",null),c([h({type:["icon","object","line","path","fill","water","extrude","text"],readOnly:!0})],Du.prototype,"type",void 0),Du=c([S("esri.symbols.Symbol3DLayer")],Du);const Rn=Du;function Rb(e){const t=jM(100*(1-e));return Math.max(0,Math.min(t,100))}function em(e){const t=1-e/100;return Math.max(0,Math.min(t,1))}function cZ(e,t){const i=t.transparency!=null?em(t.transparency):1,s=t.color;return s&&Array.isArray(s)?new pe([s[0]||0,s[1]||0,s[2]||0,i]):null}function uZ(e,t){t.color=e.toJSON().slice(0,3);const i=Rb(e.a);i!==0&&(t.transparency=i)}const yl={type:pe,json:{type:[Ge],default:null,read:{source:["color","transparency"],reader:cZ},write:{target:{color:{type:[Ge]},transparency:{type:Ge}},writer:uZ}}},Cn={type:Number,cast:Fe,json:{write:!0}};let Vl=class extends W{constructor(e){super(e),this.color=new pe([0,0,0,1]),this.extensionLength=0,this.size=Fo(1)}clone(){}cloneProperties(){return{color:R(this.color),size:this.size,extensionLength:this.extensionLength}}};c([h({type:["solid","sketch"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],Vl.prototype,"type",void 0),c([h(yl)],Vl.prototype,"color",void 0),c([h({...Cn,json:{write:{overridePolicy:e=>({enabled:!!e})}}})],Vl.prototype,"extensionLength",void 0),c([h(Cn)],Vl.prototype,"size",void 0),Vl=c([S("esri.symbols.edges.Edges3D")],Vl);const Q$=Vl;var Px;let kg=Px=class extends Q${constructor(e){super(e),this.type="sketch"}clone(){return new Px(this.cloneProperties())}};c([ue({sketch:"sketch"},{readOnly:!0})],kg.prototype,"type",void 0),kg=Px=c([S("esri.symbols.edges.SketchEdges3D")],kg);const hZ=kg;var Ax;let Cg=Ax=class extends Q${constructor(e){super(e),this.type="solid"}clone(){return new Ax(this.cloneProperties())}};c([ue({solid:"solid"},{readOnly:!0})],Cg.prototype,"type",void 0),Cg=Ax=c([S("esri.symbols.support.SolidEdges3D")],Cg);const dZ=Cg,XD={types:{key:"type",base:Q$,typeMap:{solid:dZ,sketch:hZ}},json:{write:!0}};var Ox;let Ts=Ox=class extends W{constructor(e){super(e),this.color=null}clone(){const e={color:M(this.color)?this.color.clone():null};return new Ox(e)}};c([h(yl)],Ts.prototype,"color",void 0),Ts=Ox=c([S("esri.symbols.support.Symbol3DMaterial")],Ts);var Rx;let ua=Rx=class extends Rn{constructor(e){super(e),this.type="extrude",this.size=1,this.material=null,this.castShadows=!0,this.edges=null}clone(){return new Rx({edges:this.edges&&this.edges.clone(),enabled:this.enabled,material:M(this.material)?this.material.clone():null,castShadows:this.castShadows,size:this.size})}};c([ue({Extrude:"extrude"},{readOnly:!0})],ua.prototype,"type",void 0),c([h({type:Number,json:{write:{enabled:!0,isRequired:!0}},nonNullable:!0})],ua.prototype,"size",void 0),c([h({type:Ts,json:{write:!0}})],ua.prototype,"material",void 0),c([h({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],ua.prototype,"castShadows",void 0),c([h(XD)],ua.prototype,"edges",void 0),ua=Rx=c([S("esri.symbols.ExtrudeSymbol3DLayer")],ua);const ZD=ua;let vp=class extends us{constructor(e){super(e),this.type="simple-line",this.width=.75}hash(){return`${this.type}.${this.width}`}};c([ue({esriSLS:"simple-line"},{readOnly:!0})],vp.prototype,"type",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],vp.prototype,"width",void 0),vp=c([S("esri.symbols.LineSymbol")],vp);const pZ=vp,fZ=["begin","end","begin-end"],QD=["arrow","circle","square","diamond","cross","x"];var Lx;let Qr=Lx=class extends W{constructor(e){super(e),this.placement="begin-end",this.type="line-marker",this.style="arrow"}writeStyle(e,t,i,s){t[i]=(s==null?void 0:s.origin)==="web-map"?"arrow":e}set color(e){this._set("color",e)}readColor(e){return e&&e[0]!=null?[e[0],e[1],e[2],e[3]/255]:e}writeColor(e,t,i,s){(s==null?void 0:s.origin)==="web-map"||(t[i]=e)}clone(){return new Lx({color:R(this.color),placement:this.placement,style:this.style})}hash(){var e;return`${this.placement}.${(e=this.color)==null?void 0:e.hash()}.${this.style}`}};c([h({type:["begin","end","begin-end"],json:{write:!0}})],Qr.prototype,"placement",void 0),c([ue({"line-marker":"line-marker"},{readOnly:!0}),h({json:{origins:{"web-map":{write:!1}}}})],Qr.prototype,"type",void 0),c([h({type:QD})],Qr.prototype,"style",void 0),c([ie("style")],Qr.prototype,"writeStyle",null),c([h({type:pe,value:null,json:{write:{allowNull:!0}}})],Qr.prototype,"color",null),c([Q("color")],Qr.prototype,"readColor",null),c([ie("color")],Qr.prototype,"writeColor",null),Qr=Lx=c([S("esri.symbols.LineSymbolMarker")],Qr);const mZ=Qr;var Fx;const q_=new Ie({esriSLSSolid:"solid",esriSLSDash:"dash",esriSLSDot:"dot",esriSLSDashDot:"dash-dot",esriSLSDashDotDot:"long-dash-dot-dot",esriSLSNull:"none",esriSLSInsideFrame:"inside-frame",esriSLSShortDash:"short-dash",esriSLSShortDot:"short-dot",esriSLSShortDashDot:"short-dash-dot",esriSLSShortDashDotDot:"short-dash-dot-dot",esriSLSLongDash:"long-dash",esriSLSLongDashDot:"long-dash-dot"});let Yn=Fx=class extends pZ{constructor(...e){super(...e),this.type="simple-line",this.style="solid",this.cap="round",this.join="round",this.marker=null,this.miterLimit=2}normalizeCtorArgs(e,t,i,s,r,n){if(e&&typeof e!="string")return e;const o={};return e!=null&&(o.style=e),t!=null&&(o.color=t),i!=null&&(o.width=Fe(i)),s!=null&&(o.cap=s),r!=null&&(o.join=r),n!=null&&(o.miterLimit=Fe(n)),o}clone(){var e;return new Fx({color:R(this.color),style:this.style,width:this.width,cap:this.cap,join:this.join,miterLimit:this.miterLimit,marker:(e=this.marker)==null?void 0:e.clone()})}hash(){var e,t;return`${super.hash()}.${(e=this.color)==null?void 0:e.hash()}.${this.style}.${this.cap}.${this.join}.${this.miterLimit}.${(t=this.marker)==null?void 0:t.hash()}`}};c([ue({esriSLS:"simple-line"},{readOnly:!0})],Yn.prototype,"type",void 0),c([h({type:q_.apiValues,json:{read:q_.read,write:q_.write}})],Yn.prototype,"style",void 0),c([h({type:["butt","round","square"],json:{write:{overridePolicy:(e,t,i)=>({enabled:e!=="round"&&(i==null||i.origin==null)})}}})],Yn.prototype,"cap",void 0),c([h({type:["miter","round","bevel"],json:{write:{overridePolicy:(e,t,i)=>({enabled:e!=="round"&&(i==null||i.origin==null)})}}})],Yn.prototype,"join",void 0),c([h({types:{key:"type",base:null,defaultKeyValue:"line-marker",typeMap:{"line-marker":mZ}},json:{write:!0,origins:{"web-scene":{write:!1}}}})],Yn.prototype,"marker",void 0),c([h({type:Number,json:{read:!1,write:!1}})],Yn.prototype,"miterLimit",void 0),Yn=Fx=c([S("esri.symbols.SimpleLineSymbol")],Yn);const tr=Yn;let bp=class extends us{constructor(e){super(e),this.outline=null,this.type=null}hash(){return`${this.type}.${this.outline&&this.outline.hash()}`}};c([h({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":tr}},json:{default:null,write:!0}})],bp.prototype,"outline",void 0),c([h({type:["simple-fill","picture-fill"],readOnly:!0})],bp.prototype,"type",void 0),bp=c([S("esri.symbols.FillSymbol")],bp);const KD=bp;let Pg=class extends W{constructor(e){super(e)}clone(){}};c([h({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],Pg.prototype,"type",void 0),Pg=c([S("esri.symbols.patterns.LinePattern3D")],Pg);const eN=Pg,yZ=["dash","dash-dot","dot","long-dash","long-dash-dot","long-dash-dot-dot","none","short-dash","short-dash-dot","short-dash-dot-dot","short-dot","solid"];var Dx;const gZ=mi()({dash:"dash","dash-dot":"dash-dot","dash-dot-dot":"long-dash-dot-dot",dot:"dot","long-dash":"long-dash","long-dash-dot":"long-dash-dot",null:"none","short-dash":"short-dash","short-dash-dot":"short-dash-dot","short-dash-dot-dot":"short-dash-dot-dot","short-dot":"short-dot",solid:"solid"});let _p=Dx=class extends eN{constructor(e){super(e),this.type="style",this.style="solid"}clone(){const e={style:this.style};return new Dx(e)}};c([h({type:["style"]})],_p.prototype,"type",void 0),c([ue(gZ),h({type:yZ})],_p.prototype,"style",void 0),_p=Dx=c([S("esri.symbols.patterns.LineStylePattern3D")],_p);const K$=_p;let Ag=class extends W{constructor(e){super(e)}clone(){}};c([h({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],Ag.prototype,"type",void 0),Ag=c([S("esri.symbols.patterns.Pattern3D")],Ag);const tN=Ag,vZ=["backward-diagonal","cross","diagonal-cross","forward-diagonal","horizontal","none","solid","vertical"];var Nx;let wp=Nx=class extends tN{constructor(e){super(e),this.type="style",this.style="solid"}clone(){const e={style:this.style};return new Nx(e)}};c([h({type:["style"]})],wp.prototype,"type",void 0),c([h({type:vZ,json:{read:!0,write:!0}})],wp.prototype,"style",void 0),wp=Nx=c([S("esri.symbols.patterns.StylePattern3D")],wp);const iN=wp,bZ={types:{key:"type",base:tN,typeMap:{style:iN}},json:{write:!0}},sN={types:{key:"type",base:eN,typeMap:{style:K$}},json:{write:!0}},mf=new pe("white");new pe("black");const _Z=new pe([255,255,255,0]);function wZ(e){return e.r===0&&e.g===0&&e.b===0}var jx;let yf=jx=class extends Ts{constructor(e){super(e),this.colorMixMode=null}clone(){const e={color:M(this.color)?this.color.clone():null,colorMixMode:this.colorMixMode};return new jx(e)}};c([ue({multiply:"multiply",replace:"replace",tint:"tint"})],yf.prototype,"colorMixMode",void 0),yf=jx=c([S("esri.symbols.support.Symbol3DFillMaterial")],yf);function eT(e=TZ){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function tT(e,t,i,s,r,n,o=eT()){return o[0]=e,o[1]=t,o[2]=i,o[3]=s,o[4]=r,o[5]=n,o}function Ube(e,t){const i=isFinite(e[2])||isFinite(e[5]);return new Ze(i?{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],zmin:e[2],zmax:e[5],spatialReference:t}:{xmin:e[0],xmax:e[3],ymin:e[1],ymax:e[4],spatialReference:t})}function qbe(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[3]),e[4]=Math.max(e[4],t[4]),e[5]=Math.max(e[5],t[5])}function Gbe(e,t){e[0]=Math.min(e[0],t[0]),e[1]=Math.min(e[1],t[1]),e[2]=Math.min(e[2],t[2]),e[3]=Math.max(e[3],t[0]),e[4]=Math.max(e[4],t[1]),e[5]=Math.max(e[5],t[2])}function xZ(e){return e[0]>=e[3]?0:e[3]-e[0]}function SZ(e){return e[1]>=e[4]?0:e[4]-e[1]}function MZ(e){return e[2]>=e[5]?0:e[5]-e[2]}function Wbe(e,t=[0,0,0]){return t[0]=xZ(e),t[1]=SZ(e),t[2]=MZ(e),t}function Hbe(e,t,i=e){return i[0]=t[0],i[1]=t[1],i[2]=t[2],i!==e&&(i[3]=e[3],i[4]=e[4],i[5]=e[5]),i}function Ybe(e,t,i=e){return i[3]=t[0],i[4]=t[1],i[5]=t[2],i!==e&&(i[0]=e[0],i[1]=e[1],i[2]=e[2]),e}function $Z(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Jbe(e){return e?$Z(e,Ak):eT(Ak)}function Xbe(e,t){return e[0]=t[0],e[1]=t[1],e[2]=Number.NEGATIVE_INFINITY,e[3]=t[2],e[4]=t[3],e[5]=Number.POSITIVE_INFINITY,e}function Pk(e){return e.length===6}function Zbe(e,t,i){if(N(e)||N(t))return e===t;if(!Pk(e)||!Pk(t))return!1;if(i){for(let s=0;s{const t=Ys(e);return t===0?1:ls(t,.1,4)},nonNullable:!0},RZ=["left","right","center"],LZ=["baseline","top","middle","bottom"],oN={type:RZ,nonNullable:!0},aN={type:LZ,nonNullable:!0};var zx;let Xn=zx=class extends W{constructor(e){super(e),this.decoration="none",this.family="sans-serif",this.size=9,this.style="normal",this.weight="normal"}castSize(e){return Fe(e)}clone(){return new zx({decoration:this.decoration,family:this.family,size:this.size,style:this.style,weight:this.weight})}hash(){return`${this.decoration}.${this.family}.${this.size}.${this.style}.${this.weight}`}};c([h({type:PZ,json:{default:"none",write:!0}})],Xn.prototype,"decoration",void 0),c([h({type:String,json:{write:!0}})],Xn.prototype,"family",void 0),c([h({type:Number,json:{write:{overridePolicy:(e,t,i)=>({enabled:!i||!i.textSymbol3D})}}})],Xn.prototype,"size",void 0),c([Oe("size")],Xn.prototype,"castSize",null),c([h({type:AZ,json:{default:"normal",write:!0}})],Xn.prototype,"style",void 0),c([h({type:OZ,json:{default:"normal",write:!0}})],Xn.prototype,"weight",void 0),Xn=zx=c([S("esri.symbols.Font")],Xn);const Lb=Xn;function fd(e,t){const i=t&&t.url&&t.url.path;if(e&&i&&(e=Js(e,i,{preserveProtocolRelative:!0}),t.portalItem&&t.readResourcePaths)){const s=e$(e,t.portalItem.itemUrl);s!=null&&FZ.test(s)&&t.readResourcePaths.push(t.portalItem.resourceFromPath(s).path)}return Bx(e,t&&t.portal)}function Vm(e,t,i=tm.YES){if(e==null)return e;!Ms(e)&&t&&t.blockedRelativeUrls&&t.blockedRelativeUrls.push(e);let s=Js(e);if(t){const r=t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.rootPath||t.url&&t.url.path;if(r){const n=Bx(r,t.portal);s=e$(Bx(s,t.portal),n,n),s!=null&&s!==e&&t.verifyItemRelativeUrls&&t.verifyItemRelativeUrls.writtenUrls.push(s)}}return s=cN(s,t==null?void 0:t.portal),Ms(s)&&(s=Zs(s)),(t==null?void 0:t.resources)&&(t==null?void 0:t.portalItem)&&!Ms(s)&&!hu(s)&&i===tm.YES&&t.resources.toKeep.push({resource:t.portalItem.resourceFromPath(s),compress:!1}),s}function sT(e,t,i){return fd(e,i)}function au(e,t,i,s){const r=Vm(e,s);r!==void 0&&(t[i]=r)}const lN=/\/items\/([^\/]+)\/resources\/(.*)/,FZ=/^\.\/resources\//;function DZ(e){var t,i,s;return(s=(i=(t=e==null?void 0:e.match(lN))!=null?t:null)==null?void 0:i[1])!=null?s:null}function NZ(e){var o;const t=(o=e==null?void 0:e.match(lN))!=null?o:null;if(t==null)return null;const i=t[2],s=i.lastIndexOf("/");if(s===-1){const{path:a,extension:l}=nE(i);return{prefix:null,filename:a,extension:l}}const{path:r,extension:n}=nE(i.slice(s+1));return{prefix:i.slice(0,s),filename:r,extension:n}}function cN(e,t){return t&&!t.isPortal&&t.urlKey&&t.customBaseUrl?M1(e,`${t.urlKey}.${t.customBaseUrl}`,t.portalHostname):e}function Bx(e,t){if(!t||t.isPortal||!t.urlKey||!t.customBaseUrl)return e;const i=`${t.urlKey}.${t.customBaseUrl}`,s=ZM();return jf(s,`${s.scheme}://${i}`)?M1(e,t.portalHostname,i):M1(e,i,t.portalHostname)}var tm;(function(e){e[e.YES=0]="YES",e[e.NO=1]="NO"})(tm||(tm={}));const e_e=Object.freeze(Object.defineProperty({__proto__:null,fromJSON:fd,toJSON:Vm,read:sT,write:au,itemIdFromResourceUrl:DZ,prefixAndFilenameFromResourceUrl:NZ,ensureMainOnlineDomain:cN,get MarkKeep(){return tm}},Symbol.toStringTag,{value:"Module"}));var Ux;const jZ=mi()({circle:"circle",square:"square",cross:"cross",x:"x",kite:"kite",triangle:"triangle"});let Bl=Ux=class extends W{constructor(e){super(e)}readHref(e,t,i){return e?fd(e,i):t.dataURI}writeHref(e,t,i,s){e&&(hu(e)?t.dataURI=e:(t.href=Vm(e,s),Ms(t.href)&&(t.href=Zs(t.href))))}clone(){return new Ux({href:this.href,primitive:this.primitive})}};c([h({type:String,json:{write:!0,read:{source:["href","dataURI"]}}})],Bl.prototype,"href",void 0),c([Q("href")],Bl.prototype,"readHref",null),c([ie("href",{href:{type:String},dataURI:{type:String}})],Bl.prototype,"writeHref",null),c([ue(jZ)],Bl.prototype,"primitive",void 0),Bl=Ux=c([S("esri.symbols.support.IconSymbol3DLayerResource")],Bl);var qx;let mh=qx=class extends oe{constructor(){super(...arguments),this.x=0,this.y=0}clone(){return new qx({x:this.x,y:this.y})}};c([h({type:Number})],mh.prototype,"x",void 0),c([h({type:Number})],mh.prototype,"y",void 0),mh=qx=c([S("esri.symbols.support.Symbol3DAnchorPosition2D")],mh);var Gx;let xp=Gx=class extends W{constructor(e){super(e),this.color=new pe([0,0,0,1]),this.size=Fo(1)}clone(){const e={color:M(this.color)?this.color.clone():null,size:this.size};return new Gx(e)}};c([h(yl)],xp.prototype,"color",void 0),c([h(Cn)],xp.prototype,"size",void 0),xp=Gx=c([S("esri.symbols.support.Symbol3DIconOutline")],xp);var Nu;const uN="esri.symbols.IconSymbol3DLayer";let Kr=Nu=class extends Rn{constructor(e){super(e),this.material=null,this.resource=null,this.type="icon",this.size=12,this.anchor="center",this.anchorPosition=null,this.outline=null}clone(){return new Nu({anchor:this.anchor,anchorPosition:this.anchorPosition&&this.anchorPosition.clone(),enabled:this.enabled,material:M(this.material)?this.material.clone():null,outline:M(this.outline)?this.outline.clone():null,resource:this.resource&&this.resource.clone(),size:this.size})}static fromSimpleMarkerSymbol(e){const t=e.color||mf,i=Ok(e),s=e.outline&&e.outline.width>0?{size:e.outline.width,color:(e.outline.color||mf).clone()}:null;return new Nu({size:e.size,resource:{primitive:zZ(e.style)},material:{color:t},outline:s,anchor:i?"relative":void 0,anchorPosition:i})}static fromPictureMarkerSymbol(e){const t=!e.color||wZ(e.color)?mf:e.color,i=Ok(e);return new Nu({size:e.width<=e.height?e.height:e.width,resource:{href:e.url},material:{color:t.clone()},anchor:i?"relative":void 0,anchorPosition:i})}static fromCIMSymbol(e){return new Nu({resource:{href:bR({mediaType:"application/json",data:JSON.stringify(e.data)})}})}};function Ok(e){const t="width"in e?e.width:e.size,i="height"in e?e.height:e.size,s=Rk(e.xoffset),r=Rk(e.yoffset);return(s||r)&&t&&i?{x:-s/t,y:r/i}:null}function Rk(e){return isFinite(e)?e:0}c([h({type:Ts,json:{write:!0}})],Kr.prototype,"material",void 0),c([h({type:Bl,json:{write:!0}})],Kr.prototype,"resource",void 0),c([ue({Icon:"icon"},{readOnly:!0})],Kr.prototype,"type",void 0),c([h(Cn)],Kr.prototype,"size",void 0),c([ue({center:"center",left:"left",right:"right",top:"top",bottom:"bottom",topLeft:"top-left",topRight:"top-right",bottomLeft:"bottom-left",bottomRight:"bottom-right",relative:"relative"}),h({json:{default:"center"}})],Kr.prototype,"anchor",void 0),c([h({type:mh,json:{type:[Number],read:{reader:e=>new mh({x:e[0],y:e[1]})},write:{writer:(e,t)=>{t.anchorPosition=[e.x,e.y]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],Kr.prototype,"anchorPosition",void 0),c([h({type:xp,json:{write:!0}})],Kr.prototype,"outline",void 0),Kr=Nu=c([S(uN)],Kr);const VZ={circle:"circle",cross:"cross",diamond:"kite",square:"square",x:"x",triangle:"triangle",path:null};function zZ(e){return VZ[e]||(q.getLogger(uN).warn(`${e} cannot be mapped to Icon symbol. Fallback to "circle"`),"circle")}const Pc=Kr;let Ul=class extends xt(W){constructor(e){super(e),this.type="style",this.placement="begin-end",this.style="arrow",this.color=null}equals(e){return M(e)&&e.placement===this.placement&&e.style===this.style&&(N(this.color)&&N(e.color)||M(this.color)&&M(e.color)&&this.color.toJSON()===e.color.toJSON())}};c([h({type:["style"],readOnly:!0,json:{read:!0,write:{ignoreOrigin:!0}}})],Ul.prototype,"type",void 0),c([h({type:fZ,json:{default:"begin-end",write:!0}})],Ul.prototype,"placement",void 0),c([h({type:QD,json:{default:"arrow",write:!0}})],Ul.prototype,"style",void 0),c([h({type:pe,json:{type:[Ge],default:null,write:!0}})],Ul.prototype,"color",void 0),Ul=c([S("esri.symbols.LineStyleMarker3D")],Ul);const Wx=Ul;var Rg;let en=Rg=class extends Rn{constructor(e){super(e),this.material=null,this.type="line",this.join="miter",this.cap="butt",this.size=Fo(1),this.pattern=null,this.marker=null}clone(){const e={enabled:this.enabled,material:M(this.material)?this.material.clone():null,size:this.size,join:this.join,cap:this.cap,pattern:M(this.pattern)?this.pattern.clone():null,marker:M(this.marker)?this.marker.clone():null};return new Rg(e)}static fromSimpleLineSymbol(e){var i,s,r;const t={enabled:!0,size:(i=e.width)!=null?i:Fo(1),cap:e.cap||"butt",join:e.join||"miter",pattern:e.style&&e.style!=="inside-frame"?new K$({style:e.style}):null,material:new Ts({color:(e.color||mf).clone()}),marker:e.marker?new Wx({placement:e.marker.placement,style:e.marker.style,color:(r=(s=e.marker.color)==null?void 0:s.clone())!=null?r:null}):null};return new Rg(t)}};c([h({type:Ts,json:{write:!0}})],en.prototype,"material",void 0),c([ue({Line:"line"},{readOnly:!0})],en.prototype,"type",void 0),c([h({type:rN,json:{write:!0,default:"miter"}})],en.prototype,"join",void 0),c([h({type:iT,json:{write:!0,default:"butt"}})],en.prototype,"cap",void 0),c([h(Cn)],en.prototype,"size",void 0),c([h(sN)],en.prototype,"pattern",void 0),c([h({types:{key:"type",base:Wx,typeMap:{style:Wx}},json:{write:!0}})],en.prototype,"marker",void 0),en=Rg=c([S("esri.symbols.LineSymbol3DLayer")],en);const zm=en;var Hx;const BZ=mi()({sphere:"sphere",cylinder:"cylinder",cube:"cube",cone:"cone",diamond:"diamond",tetrahedron:"tetrahedron",invertedCone:"inverted-cone"});let Sp=Hx=class extends W{clone(){return new Hx({href:this.href,primitive:this.primitive})}};c([h({type:String,json:{read:sT,write:au}})],Sp.prototype,"href",void 0),c([ue(BZ)],Sp.prototype,"primitive",void 0),Sp=Hx=c([S("esri.symbols.support.ObjectSymbol3DLayerResource")],Sp);var Yx;let _c=Yx=class extends oe{constructor(){super(...arguments),this.x=0,this.y=0,this.z=0}clone(){return new Yx({x:this.x,y:this.y,z:this.z})}};c([h({type:Number})],_c.prototype,"x",void 0),c([h({type:Number})],_c.prototype,"y",void 0),c([h({type:Number})],_c.prototype,"z",void 0),_c=Yx=c([S("esri.symbols.support.Symbol3DAnchorPosition3D")],_c);var Jx;let wi=Jx=class extends Rn{constructor(e){super(e),this.material=null,this.castShadows=!0,this.resource=null,this.type="object",this.width=void 0,this.height=void 0,this.depth=void 0,this.anchor=void 0,this.anchorPosition=void 0,this.heading=void 0,this.tilt=void 0,this.roll=void 0}clone(){return new Jx({heading:this.heading,tilt:this.tilt,roll:this.roll,anchor:this.anchor,anchorPosition:this.anchorPosition&&this.anchorPosition.clone(),depth:this.depth,enabled:this.enabled,height:this.height,material:M(this.material)?this.material.clone():null,castShadows:this.castShadows,resource:this.resource&&this.resource.clone(),width:this.width})}get isPrimitive(){return!this.resource||typeof this.resource.href!="string"}};c([h({type:Ts,json:{write:!0}})],wi.prototype,"material",void 0),c([h({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],wi.prototype,"castShadows",void 0),c([h({type:Sp,json:{write:!0}})],wi.prototype,"resource",void 0),c([ue({Object:"object"},{readOnly:!0})],wi.prototype,"type",void 0),c([h({type:Number,json:{write:!0}})],wi.prototype,"width",void 0),c([h({type:Number,json:{write:!0}})],wi.prototype,"height",void 0),c([h({type:Number,json:{write:!0}})],wi.prototype,"depth",void 0),c([ue({center:"center",top:"top",bottom:"bottom",origin:"origin",relative:"relative"}),h({json:{default:"origin"}})],wi.prototype,"anchor",void 0),c([h({type:_c,json:{type:[Number],read:{reader:e=>new _c({x:e[0],y:e[1],z:e[2]})},write:{writer:(e,t)=>{t.anchorPosition=[e.x,e.y,e.z]},overridePolicy(){return{enabled:this.anchor==="relative"}}}}})],wi.prototype,"anchorPosition",void 0),c([h({type:Number,json:{write:!0}})],wi.prototype,"heading",void 0),c([h({type:Number,json:{write:!0}})],wi.prototype,"tilt",void 0),c([h({type:Number,json:{write:!0}})],wi.prototype,"roll",void 0),c([h({readOnly:!0})],wi.prototype,"isPrimitive",null),wi=Jx=c([S("esri.symbols.ObjectSymbol3DLayer")],wi);const rT=wi;var Xx;let Fi=Xx=class extends Rn{constructor(e){super(e),this.material=null,this.castShadows=!0,this.type="path",this.profile="circle",this.join="miter",this.cap="butt",this.width=void 0,this.height=void 0,this.anchor="center",this.profileRotation="all"}readWidth(e,t){return e!=null?e:t.height==null&&t.size!=null?t.size:void 0}readHeight(e,t){return e!=null?e:t.width==null&&t.size!=null?t.size:void 0}clone(){return new Xx({enabled:this.enabled,material:M(this.material)?this.material.clone():null,castShadows:this.castShadows,profile:this.profile,join:this.join,cap:this.cap,width:this.width,height:this.height,profileRotation:this.profileRotation,anchor:this.anchor})}};c([h({type:Ts,json:{write:!0}})],Fi.prototype,"material",void 0),c([h({type:Boolean,nonNullable:!0,json:{write:!0,default:!0}})],Fi.prototype,"castShadows",void 0),c([ue({Path:"path"},{readOnly:!0})],Fi.prototype,"type",void 0),c([h({type:["circle","quad"],json:{write:!0,default:"circle"}})],Fi.prototype,"profile",void 0),c([h({type:rN,json:{write:!0,default:"miter"}})],Fi.prototype,"join",void 0),c([h({type:CZ,json:{write:!0,default:"butt"}})],Fi.prototype,"cap",void 0),c([h({type:Number,json:{write:{enabled:!0,target:{width:{type:Number},size:{type:Number}}}}})],Fi.prototype,"width",void 0),c([Q("width",["width","size","height"])],Fi.prototype,"readWidth",null),c([h({type:Number,json:{write:!0}})],Fi.prototype,"height",void 0),c([Q("height",["height","size","width"])],Fi.prototype,"readHeight",null),c([h({type:["center","bottom","top"],json:{write:!0,default:"center"}})],Fi.prototype,"anchor",void 0),c([h({type:["heading","all"],json:{write:!0,default:"all"}})],Fi.prototype,"profileRotation",void 0),Fi=Xx=c([S("esri.symbols.PathSymbol3DLayer")],Fi);const nT=Fi;var Zx;let yh=Zx=class extends W{constructor(){super(...arguments),this.color=new pe([0,0,0,1]),this.size=0}clone(){const e={color:R(this.color),size:this.size};return new Zx(e)}};c([h(yl)],yh.prototype,"color",void 0),c([h(Cn)],yh.prototype,"size",void 0),yh=Zx=c([S("esri.symbols.support.Symbol3DHalo")],yh);let gf=class extends xt(W){constructor(e){super(e),this.color=null}};c([h(yl)],gf.prototype,"color",void 0),gf=c([S("esri.symbols.support.Symbol3DTextBackground")],gf);var Lg;let Wi=Lg=class extends Rn{constructor(e){super(e),this._userSize=void 0,this.halo=null,this.horizontalAlignment="center",this.lineHeight=1,this.material=null,this.background=null,this.text=null,this.type="text",this.verticalAlignment="baseline"}get font(){return this._get("font")||null}set font(e){M(e)&&M(this._userSize)&&(e.size=this._userSize),this._set("font",e)}writeFont(e,t,i,s){const r={...s,textSymbol3D:!0};t.font=e.write({},r),delete t.font.size}get size(){return M(this._userSize)?this._userSize:M(this.font)&&this.font.size!=null?this.font.size:9}set size(e){this._userSize=e,M(this.font)&&(this.font.size=this._userSize),this.notifyChange("size")}clone(){const e=new Lg({enabled:this.enabled,font:this.font&&R(this.font),halo:this.halo&&R(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:M(this.material)?this.material.clone():null,text:this.text,verticalAlignment:this.verticalAlignment,background:R(this.background)});return e._userSize=this._userSize,e}static fromTextSymbol(e){return new Lg({font:M(e.font)?e.font.clone():new Lb,halo:UZ(e.haloColor,e.haloSize),horizontalAlignment:e.horizontalAlignment,lineHeight:e.lineHeight,material:e.color?new Ts({color:e.color.clone()}):null,text:e.text,verticalAlignment:e.verticalAlignment,background:e.backgroundColor?new gf({color:e.backgroundColor.clone()}):null})}};function UZ(e,t){return e&&t!=null&&t>0?new yh({color:R(e),size:t}):null}c([h({type:Lb,json:{write:!0}})],Wi.prototype,"font",null),c([ie("font")],Wi.prototype,"writeFont",null),c([h({type:yh,json:{write:!0}})],Wi.prototype,"halo",void 0),c([h({...oN,json:{default:"center",write:!0}})],Wi.prototype,"horizontalAlignment",void 0),c([h({...nN,json:{default:1,write:!0}})],Wi.prototype,"lineHeight",void 0),c([h({type:Ts,json:{write:!0}})],Wi.prototype,"material",void 0),c([h({type:gf,json:{write:!0}})],Wi.prototype,"background",void 0),c([h(Cn)],Wi.prototype,"size",null),c([h({type:String,json:{write:!0}})],Wi.prototype,"text",void 0),c([ue({Text:"text"},{readOnly:!0})],Wi.prototype,"type",void 0),c([h({...aN,json:{default:"baseline",write:!0}})],Wi.prototype,"verticalAlignment",void 0),Wi=Lg=c([S("esri.symbols.TextSymbol3DLayer")],Wi);const md=Wi;var Qx;let ha=Qx=class extends Rn{constructor(e){super(e),this.color=Kx.clone(),this.type="water",this.waterbodySize="medium",this.waveDirection=null,this.waveStrength="moderate"}clone(){return new Qx({color:R(this.color),waterbodySize:this.waterbodySize,waveDirection:this.waveDirection,waveStrength:this.waveStrength})}};c([h({type:pe,nonNullable:!0,json:{type:[Ge],write:(e,t,i)=>t[i]=e.toArray(pe.AlphaMode.UNLESS_OPAQUE),default:()=>Kx.clone(),defaultEquals:e=>e.toCss(!0)===Kx.toCss(!0)}})],ha.prototype,"color",void 0),c([ue({Water:"water"},{readOnly:!0})],ha.prototype,"type",void 0),c([h({type:["small","medium","large"],json:{write:!0,default:"medium"}})],ha.prototype,"waterbodySize",void 0),c([h({type:Number,json:{write:!0,default:null}})],ha.prototype,"waveDirection",void 0),c([h({type:["calm","rippled","slight","moderate"],json:{write:!0,default:"moderate"}})],ha.prototype,"waveStrength",void 0),ha=Qx=c([S("esri.symbols.WaterSymbol3DLayer")],ha);const Kx=new pe([0,119,190]),hN=ha;var eS;let ql=eS=class extends oe{constructor(e){super(e),this.name=null,this.styleUrl=null,this.styleName=null,this.portal=null}clone(){return new eS({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}};c([h({type:String})],ql.prototype,"name",void 0),c([h({type:String})],ql.prototype,"styleUrl",void 0),c([h({type:String})],ql.prototype,"styleName",void 0),c([h({type:cs})],ql.prototype,"portal",void 0),ql=eS=c([S("esri.symbols.support.StyleOrigin")],ql);const tS=ql;var iS;let vf=iS=class extends oe{constructor(){super(...arguments),this.url=""}clone(){return new iS({url:this.url})}};c([h({type:String})],vf.prototype,"url",void 0),vf=iS=c([S("esri.symbols.support.Thumbnail")],vf);const dN={icon:Pc,object:rT,line:zm,path:nT,fill:jm,extrude:ZD,text:md,water:hN},qZ=he.ofType({base:Rn,key:"type",typeMap:dN,errorContext:"symbol-layer"});let tn=class extends us{constructor(e){super(e),this.styleOrigin=null,this.thumbnail=null,this.type=null;const t=this.__accessor__&&this.__accessor__.metadatas&&this.__accessor__.metadatas.symbolLayers,i=t&&t.type||he;this._set("symbolLayers",new i)}get color(){return null}set color(e){this.constructed&&q.getLogger(this.declaredClass).error("Symbol3D does not support colors on the symbol level. Colors may be set on individual symbol layer materials instead.")}set symbolLayers(e){ou(e,this._get("symbolLayers"))}readStyleOrigin(e,t,i){if(e.styleUrl&&e.name){const s=fd(e.styleUrl,i);return new tS({styleUrl:s,name:e.name})}if(e.styleName&&e.name)return new tS({portal:i&&i.portal||cs.getDefault(),styleName:e.styleName,name:e.name});i&&i.messages&&i.messages.push(new Bi("symbol3d:incomplete-style-origin","Style origin requires either a 'styleUrl' or 'styleName' and a 'name' property",{context:i,definition:e}))}writeStyleOrigin(e,t,i,s){if(e.styleUrl&&e.name){let r=Vm(e.styleUrl,s);Ms(r)&&(r=Zs(r)),t.styleOrigin={styleUrl:r,name:e.name}}else e.styleName&&e.name&&(e.portal&&s&&s.portal&&!yR(e.portal.restUrl,s.portal.restUrl)?s&&s.messages&&s.messages.push(new Bi("symbol:cross-portal","The symbol style origin cannot be persisted because it refers to an item on a different portal than the one being saved to.",{symbol:this})):t.styleOrigin={styleName:e.styleName,name:e.name})}normalizeCtorArgs(e){return e instanceof Rn||e&&dN[e.type]?{symbolLayers:[e]}:Array.isArray(e)?{symbolLayers:e}:e}};c([h({json:{read:!1,write:!1}})],tn.prototype,"color",null),c([h({type:qZ,nonNullable:!0,json:{write:!0}}),Oe(hD)],tn.prototype,"symbolLayers",null),c([h({type:tS})],tn.prototype,"styleOrigin",void 0),c([Q("styleOrigin")],tn.prototype,"readStyleOrigin",null),c([ie("styleOrigin",{"styleOrigin.styleUrl":{type:String},"styleOrigin.styleName":{type:String},"styleOrigin.name":{type:String}})],tn.prototype,"writeStyleOrigin",null),c([h({type:vf,json:{read:!1}})],tn.prototype,"thumbnail",void 0),c([h({type:["point-3d","line-3d","polygon-3d","mesh-3d","label-3d"],readOnly:!0})],tn.prototype,"type",void 0),tn=c([S("esri.symbols.Symbol3D")],tn);const yd=tn;let Mp=class extends W{constructor(e){super(e),this.visible=!0}clone(){}};c([h({type:["line"],readOnly:!0,json:{read:!1,write:{ignoreOrigin:!0}}})],Mp.prototype,"type",void 0),c([h({readOnly:!0})],Mp.prototype,"visible",void 0),Mp=c([S("esri.symbols.callouts.Callout3D")],Mp);const pN=Mp;var sS;let Fg=sS=class extends W{constructor(){super(...arguments),this.color=new pe("white")}clone(){return new sS({color:R(this.color)})}};c([h(yl)],Fg.prototype,"color",void 0),Fg=sS=c([S("esri.symbols.callouts.LineCallout3DBorder")],Fg);const fN=Fg;Object.freeze(Object.defineProperty({__proto__:null,default:fN},Symbol.toStringTag,{value:"Module"}));var rS;let da=rS=class extends pN{constructor(e){super(e),this.type="line",this.color=new pe([0,0,0,1]),this.size=Fo(1),this.border=null}get visible(){return this.size>0&&M(this.color)&&this.color.a>0}clone(){return new rS({color:R(this.color),size:this.size,border:R(this.border)})}};c([ue({line:"line"},{readOnly:!0})],da.prototype,"type",void 0),c([h(yl)],da.prototype,"color",void 0),c([h(Cn)],da.prototype,"size",void 0),c([h({type:fN,json:{write:!0}})],da.prototype,"border",void 0),c([h({readOnly:!0})],da.prototype,"visible",null),da=rS=c([S("esri.symbols.callouts.LineCallout3D")],da);const GZ=da;function oT(e){if(!e)return!1;const t=e.verticalOffset;return!!t&&!(t.screenLength<=0||M(t.maxWorldLength)&&t.maxWorldLength<=0)}function mN(e){if(!e||!e.supportsCallout||!e.supportsCallout())return!1;const t=e.callout;return!!t&&!!t.visible&&!!oT(e)}const yN={types:{key:"type",base:pN,typeMap:{line:GZ}},json:{write:!0}};var nS;let ju=nS=class extends W{constructor(e){super(e),this.screenLength=0,this.minWorldLength=0,this.maxWorldLength=null}clone(){return new nS({screenLength:this.screenLength,minWorldLength:this.minWorldLength,maxWorldLength:this.maxWorldLength})}};c([h(Cn)],ju.prototype,"screenLength",void 0),c([h({type:Number,nonNullable:!0,json:{write:!0,default:0}})],ju.prototype,"minWorldLength",void 0),c([h({type:Number,json:{write:!0}})],ju.prototype,"maxWorldLength",void 0),ju=nS=c([S("esri.symbols.support.Symbol3DVerticalOffset")],ju);const gN=ju;var Dg;const vN=he.ofType({base:null,key:"type",typeMap:{text:md}});let pa=Dg=class extends yd{constructor(e){super(e),this.verticalOffset=null,this.callout=null,this.styleOrigin=null,this.symbolLayers=new vN,this.type="label-3d"}supportsCallout(){return!0}hasVisibleCallout(){return mN(this)}hasVisibleVerticalOffset(){return oT(this)}clone(){return new Dg({styleOrigin:R(this.styleOrigin),symbolLayers:R(this.symbolLayers),thumbnail:R(this.thumbnail),callout:R(this.callout),verticalOffset:R(this.verticalOffset)})}static fromTextSymbol(e){return new Dg({symbolLayers:[md.fromTextSymbol(e)]})}};c([h({type:gN,json:{write:!0}})],pa.prototype,"verticalOffset",void 0),c([h(yN)],pa.prototype,"callout",void 0),c([h({json:{read:!1,write:!1}})],pa.prototype,"styleOrigin",void 0),c([h({type:vN})],pa.prototype,"symbolLayers",void 0),c([ue({LabelSymbol3D:"label-3d"},{readOnly:!0})],pa.prototype,"type",void 0),pa=Dg=c([S("esri.symbols.LabelSymbol3D")],pa);const Fb=pa;var Ng;const bN=he.ofType({base:null,key:"type",typeMap:{line:zm,path:nT}}),WZ=he.ofType({base:null,key:"type",typeMap:{line:zm,path:nT}});let $p=Ng=class extends yd{constructor(e){super(e),this.symbolLayers=new bN,this.type="line-3d"}clone(){return new Ng({styleOrigin:R(this.styleOrigin),symbolLayers:R(this.symbolLayers),thumbnail:R(this.thumbnail)})}static fromSimpleLineSymbol(e){return new Ng({symbolLayers:[zm.fromSimpleLineSymbol(e)]})}};c([h({type:bN,json:{type:WZ}})],$p.prototype,"symbolLayers",void 0),c([ue({LineSymbol3D:"line-3d"},{readOnly:!0})],$p.prototype,"type",void 0),$p=Ng=c([S("esri.symbols.LineSymbol3D")],$p);const Db=$p;let fa=class extends us{constructor(e){super(e),this.angle=0,this.type=null,this.xoffset=0,this.yoffset=0,this.size=9}hash(){return`${this.type}.${this.angle}.${this.size}.${this.xoffset}.${this.yoffset}`}};c([h({type:Number,json:{read:e=>e&&-1*e,write:(e,t)=>t.angle=e&&-1*e}})],fa.prototype,"angle",void 0),c([h({type:["simple-marker","picture-marker"],readOnly:!0})],fa.prototype,"type",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],fa.prototype,"xoffset",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],fa.prototype,"yoffset",void 0),c([h({type:Number,cast:e=>e==="auto"?e:Fe(e),json:{write:!0}})],fa.prototype,"size",void 0),fa=c([S("esri.symbols.MarkerSymbol")],fa);const _N=fa;var jg;const wN=he.ofType({base:null,key:"type",typeMap:{fill:jm}});let Tp=jg=class extends yd{constructor(e){super(e),this.symbolLayers=new wN,this.type="mesh-3d"}clone(){return new jg({styleOrigin:R(this.styleOrigin),symbolLayers:R(this.symbolLayers),thumbnail:R(this.thumbnail)})}static fromSimpleFillSymbol(e){return new jg({symbolLayers:[jm.fromSimpleFillSymbol(e)]})}};c([h({type:wN})],Tp.prototype,"symbolLayers",void 0),c([ue({MeshSymbol3D:"mesh-3d"},{readOnly:!0})],Tp.prototype,"type",void 0),Tp=jg=c([S("esri.symbols.MeshSymbol3D")],Tp);const Nb=Tp;function HZ(e,t,i){return t.imageData?bR({mediaType:t.contentType||"image/png",isBase64:!0,data:t.imageData}):xN(t.url,i)}function xN(e,t){var i;return JZ(t)&&!Ms(e)&&((i=t==null?void 0:t.layer)==null?void 0:i.parsedUrl)?Xc(t.layer.parsedUrl.path,"images",e):fd(e,t)}function YZ(e,t,i,s){if(hu(e)){const r=vR(e);if(!r)return;t.contentType=r.mediaType,t.imageData=r.data,i&&i.imageData===t.imageData&&i.url&&au(i.url,t,"url",s)}else au(e,t,"url",s)}const SN={json:{read:{source:["imageData","url"],reader:HZ},write:{writer(e,t,i,s){YZ(e,t,this.source,s)}}}},MN={readOnly:!0,json:{read:{source:["imageData","url"],reader(e,t,i){const s={};return t.imageData&&(s.imageData=t.imageData),t.contentType&&(s.contentType=t.contentType),t.url&&(s.url=xN(t.url,i)),s}}}};function JZ(e){var t,i;return!(e==null||e.origin!=="service"&&e.origin!=="portal-item"||((t=e.layer)==null?void 0:t.type)!=="feature"&&((i=e.layer)==null?void 0:i.type)!=="stream")}var oS;let Bs=oS=class extends KD{constructor(...e){super(...e),this.type="picture-fill",this.url=null,this.xscale=1,this.yscale=1,this.width=12,this.height=12,this.xoffset=0,this.yoffset=0,this.source=null}normalizeCtorArgs(e,t,i,s){if(e&&typeof e!="string"&&e.imageData==null)return e;const r={};return e&&(r.url=e),t&&(r.outline=t),i!=null&&(r.width=Fe(i)),s!=null&&(r.height=Fe(s)),r}clone(){const e=new oS({color:R(this.color),height:this.height,outline:this.outline&&this.outline.clone(),url:this.url,width:this.width,xoffset:this.xoffset,xscale:this.xscale,yoffset:this.yoffset,yscale:this.yscale});return e._set("source",R(this.source)),e}hash(){var e;return`${super.hash()}.${(e=this.color)==null?void 0:e.hash()}.${this.height}.${this.url}.${this.width}.${this.xoffset}.${this.xscale}.${this.yoffset}.${this.yscale}`}};c([ue({esriPFS:"picture-fill"},{readOnly:!0})],Bs.prototype,"type",void 0),c([h(SN)],Bs.prototype,"url",void 0),c([h({type:Number,json:{write:!0}})],Bs.prototype,"xscale",void 0),c([h({type:Number,json:{write:!0}})],Bs.prototype,"yscale",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],Bs.prototype,"width",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],Bs.prototype,"height",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],Bs.prototype,"xoffset",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],Bs.prototype,"yoffset",void 0),c([h(MN)],Bs.prototype,"source",void 0),Bs=oS=c([S("esri.symbols.PictureFillSymbol")],Bs);const $N=Bs;var aS;let fr=aS=class extends _N{constructor(...e){super(...e),this.color=null,this.type="picture-marker",this.url=null,this.source=null,this.height=12,this.width=12,this.size=null}normalizeCtorArgs(e,t,i){if(e&&typeof e!="string"&&e.imageData==null)return e;const s={};return e&&(s.url=e),t!=null&&(s.width=Fe(t)),i!=null&&(s.height=Fe(i)),s}readHeight(e,t){return t.size||e}readWidth(e,t){return t.size||e}clone(){const e=new aS({angle:this.angle,height:this.height,url:this.url,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset});return e._set("source",R(this.source)),e}hash(){return`${super.hash()}.${this.height}.${this.url}.${this.width}`}};c([h({json:{write:!1}})],fr.prototype,"color",void 0),c([ue({esriPMS:"picture-marker"},{readOnly:!0})],fr.prototype,"type",void 0),c([h(SN)],fr.prototype,"url",void 0),c([h(MN)],fr.prototype,"source",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],fr.prototype,"height",void 0),c([Q("height",["height","size"])],fr.prototype,"readHeight",null),c([h({type:Number,cast:Fe,json:{write:!0}})],fr.prototype,"width",void 0),c([h({json:{write:!1}})],fr.prototype,"size",void 0),fr=aS=c([S("esri.symbols.PictureMarkerSymbol")],fr);const jb=fr;var Gl;const TN=he.ofType({base:null,key:"type",typeMap:{icon:Pc,object:rT,text:md}});let Wl=Gl=class extends yd{constructor(e){super(e),this.verticalOffset=null,this.callout=null,this.symbolLayers=new TN,this.type="point-3d"}supportsCallout(){if((this.symbolLayers?this.symbolLayers.length:0)<1)return!1;for(const e of this.symbolLayers.items)switch(e.type){case"icon":case"text":case"object":continue;default:return!1}return!0}hasVisibleCallout(){return mN(this)}hasVisibleVerticalOffset(){return oT(this)}clone(){return new Gl({verticalOffset:R(this.verticalOffset),callout:R(this.callout),styleOrigin:R(this.styleOrigin),symbolLayers:R(this.symbolLayers),thumbnail:R(this.thumbnail)})}static fromSimpleMarkerSymbol(e){return new Gl({symbolLayers:[Pc.fromSimpleMarkerSymbol(e)]})}static fromPictureMarkerSymbol(e){return new Gl({symbolLayers:[Pc.fromPictureMarkerSymbol(e)]})}static fromCIMSymbol(e){var s,r;if(((r=(s=e.data)==null?void 0:s.symbol)==null?void 0:r.type)!=="CIMPointSymbol")return null;const i=e.data.symbol;return new Gl(i!=null&&i.callout?{symbolLayers:[Pc.fromCIMSymbol(e)],callout:{type:"line",size:.5,color:[0,0,0]},verticalOffset:{screenLength:40}}:{symbolLayers:[Pc.fromCIMSymbol(e)]})}static fromTextSymbol(e){return new Gl({symbolLayers:[md.fromTextSymbol(e)]})}};c([h({type:gN,json:{write:!0}})],Wl.prototype,"verticalOffset",void 0),c([h(yN)],Wl.prototype,"callout",void 0),c([h({type:TN,json:{origins:{"web-scene":{write:!0}}}})],Wl.prototype,"symbolLayers",void 0),c([ue({PointSymbol3D:"point-3d"},{readOnly:!0})],Wl.prototype,"type",void 0),Wl=Gl=c([S("esri.symbols.PointSymbol3D")],Wl);const Ac=Wl;var Ip;const IN=he.ofType({base:null,key:"type",typeMap:{extrude:ZD,fill:jm,icon:Pc,line:zm,object:rT,text:md,water:hN}});let Ep=Ip=class extends yd{constructor(e){super(e),this.symbolLayers=new IN,this.type="polygon-3d"}clone(){return new Ip({styleOrigin:R(this.styleOrigin),symbolLayers:R(this.symbolLayers),thumbnail:R(this.thumbnail)})}static fromJSON(e){const t=new Ip;if(t.read(e),t.symbolLayers.length===2&&t.symbolLayers.getItemAt(0).type==="fill"&&t.symbolLayers.getItemAt(1).type==="line"){const i=t.symbolLayers.getItemAt(0),s=t.symbolLayers.getItemAt(1);!s.enabled||e.symbolLayers&&e.symbolLayers[1]&&e.symbolLayers[1].enable===!1||(i.outline={size:s.size,color:M(s.material)?s.material.color:null}),t.symbolLayers.removeAt(1)}return t}static fromSimpleFillSymbol(e){return new Ip({symbolLayers:[jm.fromSimpleFillSymbol(e)]})}};c([h({type:IN,json:{write:!0}})],Ep.prototype,"symbolLayers",void 0),c([ue({PolygonSymbol3D:"polygon-3d"},{readOnly:!0})],Ep.prototype,"type",void 0),Ep=Ip=c([S("esri.symbols.PolygonSymbol3D")],Ep);const Bm=Ep;var lS;const G_=new Ie({esriSFSSolid:"solid",esriSFSNull:"none",esriSFSHorizontal:"horizontal",esriSFSVertical:"vertical",esriSFSForwardDiagonal:"forward-diagonal",esriSFSBackwardDiagonal:"backward-diagonal",esriSFSCross:"cross",esriSFSDiagonalCross:"diagonal-cross"});let Hl=lS=class extends KD{constructor(...e){super(...e),this.color=new pe([0,0,0,.25]),this.outline=new tr,this.type="simple-fill",this.style="solid"}normalizeCtorArgs(e,t,i){if(e&&typeof e!="string")return e;const s={};return e&&(s.style=e),t&&(s.outline=t),i&&(s.color=i),s}clone(){return new lS({color:R(this.color),outline:this.outline&&this.outline.clone(),style:this.style})}hash(){return`${super.hash()}${this.style}.${this.color&&this.color.hash()}`}};c([h()],Hl.prototype,"color",void 0),c([h()],Hl.prototype,"outline",void 0),c([ue({esriSFS:"simple-fill"},{readOnly:!0})],Hl.prototype,"type",void 0),c([h({type:G_.apiValues,json:{read:G_.read,write:G_.write}})],Hl.prototype,"style",void 0),Hl=lS=c([S("esri.symbols.SimpleFillSymbol")],Hl);const gl=Hl;var cS;const W_=new Ie({esriSMSCircle:"circle",esriSMSSquare:"square",esriSMSCross:"cross",esriSMSX:"x",esriSMSDiamond:"diamond",esriSMSTriangle:"triangle",esriSMSPath:"path"});let sn=cS=class extends _N{constructor(...e){super(...e),this.color=new pe([255,255,255,.25]),this.type="simple-marker",this.size=12,this.style="circle",this.outline=new tr}normalizeCtorArgs(e,t,i,s){if(e&&typeof e!="string")return e;const r={};return e&&(r.style=e),t!=null&&(r.size=Fe(t)),i&&(r.outline=i),s&&(r.color=s),r}writeColor(e,t){e&&this.style!=="x"&&this.style!=="cross"&&(t.color=e.toJSON()),e===null&&(t.color=null)}set path(e){this.style="path",this._set("path",e)}clone(){return new cS({angle:this.angle,color:R(this.color),outline:this.outline&&this.outline.clone(),path:this.path,size:this.size,style:this.style,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){var e;return`${super.hash()}.${this.color&&this.color.hash()}.${this.path}.${this.style}.${(e=this.outline)==null?void 0:e.hash()}`}};c([h()],sn.prototype,"color",void 0),c([ie("color")],sn.prototype,"writeColor",null),c([ue({esriSMS:"simple-marker"},{readOnly:!0})],sn.prototype,"type",void 0),c([h()],sn.prototype,"size",void 0),c([h({type:W_.apiValues,json:{read:W_.read,write:W_.write}})],sn.prototype,"style",void 0),c([h({type:String,json:{write:!0}})],sn.prototype,"path",null),c([h({types:{key:"type",base:null,defaultKeyValue:"simple-line",typeMap:{"simple-line":tr}},json:{default:null,write:!0}})],sn.prototype,"outline",void 0),sn=cS=c([S("esri.symbols.SimpleMarkerSymbol")],sn);const vl=sn;var uS;let rt=uS=class extends us{constructor(...e){super(...e),this.backgroundColor=null,this.borderLineColor=null,this.borderLineSize=null,this.font=new Lb,this.horizontalAlignment="center",this.kerning=!0,this.haloColor=null,this.haloSize=null,this.rightToLeft=null,this.rotated=!1,this.text="",this.type="text",this.verticalAlignment="baseline",this.xoffset=0,this.yoffset=0,this.angle=0,this.width=null,this.lineWidth=192,this.lineHeight=1}normalizeCtorArgs(e,t,i){if(e&&typeof e!="string")return e;const s={};return e&&(s.text=e),t&&(s.font=t),i&&(s.color=i),s}writeLineWidth(e,t,i,s){s&&typeof s!="string"?s.origin:t[i]=e}castLineWidth(e){return Fe(e)}writeLineHeight(e,t,i,s){s&&typeof s!="string"?s.origin:t[i]=e}clone(){return new uS({angle:this.angle,backgroundColor:R(this.backgroundColor),borderLineColor:R(this.borderLineColor),borderLineSize:this.borderLineSize,color:R(this.color),font:this.font&&this.font.clone(),haloColor:R(this.haloColor),haloSize:this.haloSize,horizontalAlignment:this.horizontalAlignment,kerning:this.kerning,lineHeight:this.lineHeight,lineWidth:this.lineWidth,rightToLeft:this.rightToLeft,rotated:this.rotated,text:this.text,verticalAlignment:this.verticalAlignment,width:this.width,xoffset:this.xoffset,yoffset:this.yoffset})}hash(){var e;return`${this.backgroundColor&&this.backgroundColor.hash()}.${this.borderLineColor}.${this.borderLineSize}.${(e=this.color)==null?void 0:e.hash()}.${this.font&&this.font.hash()}.${this.haloColor&&this.haloColor.hash()}.${this.haloSize}.${this.horizontalAlignment}.${this.kerning}.${this.rightToLeft}.${this.rotated}.${this.text}.${this.verticalAlignment}.${this.width}.${this.xoffset}.${this.yoffset}.${this.lineHeight}.${this.lineWidth}.${this.angle}`}};c([h({type:pe,json:{write:!0}})],rt.prototype,"backgroundColor",void 0),c([h({type:pe,json:{write:!0}})],rt.prototype,"borderLineColor",void 0),c([h({type:Number,json:{write:!0}})],rt.prototype,"borderLineSize",void 0),c([h({type:Lb,json:{write:!0}})],rt.prototype,"font",void 0),c([h({...oN,json:{write:!0}})],rt.prototype,"horizontalAlignment",void 0),c([h({type:Boolean,json:{write:!0}})],rt.prototype,"kerning",void 0),c([h({type:pe,json:{write:!0}})],rt.prototype,"haloColor",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],rt.prototype,"haloSize",void 0),c([h({type:Boolean,json:{write:!0}})],rt.prototype,"rightToLeft",void 0),c([h({type:Boolean,json:{write:!0}})],rt.prototype,"rotated",void 0),c([h({type:String,json:{write:!0}})],rt.prototype,"text",void 0),c([ue({esriTS:"text"},{readOnly:!0})],rt.prototype,"type",void 0),c([h({...aN,json:{write:!0}})],rt.prototype,"verticalAlignment",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],rt.prototype,"xoffset",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],rt.prototype,"yoffset",void 0),c([h({type:Number,json:{read:e=>e&&-1*e,write:(e,t)=>t.angle=e&&-1*e}})],rt.prototype,"angle",void 0),c([h({type:Number,json:{write:!0}})],rt.prototype,"width",void 0),c([h({type:Number})],rt.prototype,"lineWidth",void 0),c([ie("lineWidth")],rt.prototype,"writeLineWidth",null),c([Oe("lineWidth")],rt.prototype,"castLineWidth",null),c([h(nN)],rt.prototype,"lineHeight",void 0),c([ie("lineHeight")],rt.prototype,"writeLineHeight",null),rt=uS=c([S("esri.symbols.TextSymbol")],rt);const gd=rt;var hS;let mr=hS=class extends us{constructor(e){super(e),this.styleName=null,this.portal=null,this.styleUrl=null,this.thumbnail=null,this.name=null,this.type="web-style"}get _fetchCacheKey(){const e=M(this.portal)?this.portal:cs.getDefault(),t=e.user?e.user.username:null;return`${this.styleName}:${this.styleUrl}:${this.name}:${t}:${e.url}`}read(e,t){this.portal=t?t.portal:void 0,super.read(e,t)}clone(){return new hS({name:this.name,styleUrl:this.styleUrl,styleName:this.styleName,portal:this.portal})}fetchSymbol(e){return this._fetchSymbol("webRef",e)}fetchCIMSymbol(e){return this._fetchSymbol("cimRef",e)}async _fetchSymbol(e,t){const i=M(t)?t.cache:null,s=i?this._fetchCacheKey:null;if(M(i)){const a=s&&i.get(s);if(a)return a.clone()}const r=await XZ();Ft(t);const n=r.resolveWebStyleSymbol(this,{portal:this.portal},e,t);n.catch(a=>{q.getLogger(this.declaredClass).error("#fetchSymbol()","Failed to create symbol from style",a)});const o=await n;return e==="webRef"&&o.type==="point-3d"||e==="cimRef"&&o.type==="cim"?(M(i)&&i.set(s,o.clone()),o):null}};function XZ(){return z(()=>import("./webStyleSymbolUtils.20098551.js"),["assets/webStyleSymbolUtils.20098551.js","assets/devEnvironmentUtils.d8d0484c.js"])}c([h({json:{write:!1}})],mr.prototype,"color",void 0),c([h({type:String,json:{write:!0}})],mr.prototype,"styleName",void 0),c([h({type:cs,json:{write:!1}})],mr.prototype,"portal",void 0),c([h({type:String,json:{read:sT,write:au}})],mr.prototype,"styleUrl",void 0),c([h({type:vf,json:{read:!1}})],mr.prototype,"thumbnail",void 0),c([h({type:String,json:{write:!0}})],mr.prototype,"name",void 0),c([ue({styleSymbolReference:"web-style"},{readOnly:!0})],mr.prototype,"type",void 0),c([h()],mr.prototype,"_fetchCacheKey",null),mr=hS=c([S("esri.symbols.WebStyleSymbol")],mr);const mu=mr;function Vb(e){if(!e)return!1;switch(e.type){case"picture-fill":case"picture-marker":case"simple-fill":case"simple-line":case"simple-marker":case"text":case"cim":return!0;default:return!1}}function Jh(e){if(!e)return!1;switch(e.type){case"label-3d":case"line-3d":case"mesh-3d":case"point-3d":case"polygon-3d":return!0;default:return!1}}const Uc={base:us,key:"type",typeMap:{"simple-fill":gl,"picture-fill":$N,"picture-marker":jb,"simple-line":tr,"simple-marker":vl,text:gd,"label-3d":Fb,"line-3d":Db,"mesh-3d":Nb,"point-3d":Ac,"polygon-3d":Bm,"web-style":mu,cim:Nm},errorContext:"symbol"},ZZ={base:us,key:"type",typeMap:{"picture-marker":jb,"simple-marker":vl,text:gd,"web-style":mu,cim:Nm},errorContext:"symbol"},QZ=dl({types:Uc}),zb={base:us,key:"type",typeMap:{"simple-fill":gl,"picture-fill":$N,"picture-marker":jb,"simple-line":tr,"simple-marker":vl,text:gd,"line-3d":Db,"mesh-3d":Nb,"point-3d":Ac,"polygon-3d":Bm,"web-style":mu,cim:Nm},errorContext:"symbol"},KZ={base:us,key:"type",typeMap:{text:gd,"label-3d":Fb},errorContext:"symbol"},Lk={base:us,key:"type",typeMap:{"line-3d":Db,"mesh-3d":Nb,"point-3d":Ac,"polygon-3d":Bm,"web-style":mu,cim:Nm},errorContext:"symbol"},eQ={base:us,key:"type",typeMap:{"label-3d":Fb},errorContext:"symbol"},EN=En(Uc);function tQ(e){if(!e)return null;const t={};for(const i in e){const s=ll(e[i]);s&&(t[i]=s)}return Object.keys(t).length!==0?t:null}function iQ(e){if(!M(e))return null;const t={};for(const i in e){const s=e[i];s&&(t[i]=s.toJSON())}return Object.keys(t).length!==0?t:null}let Hi=class extends xt(W){constructor(...e){super(...e),this.isAggregate=!1,this.layer=null,this.popupTemplate=null,this.sourceLayer=null,Object.defineProperty(this,"uid",{value:uf(),configurable:!0})}normalizeCtorArgs(e,t,i,s){return e&&!e.declaredClass?e:{geometry:e,symbol:t,attributes:i,popupTemplate:s}}set aggregateGeometries(e){const t=this._get("aggregateGeometries");JSON.stringify(t)!==JSON.stringify(e)&&this._set("aggregateGeometries",e)}set attributes(e){const t=this._get("attributes");t!==e&&(this._set("attributes",e),this._notifyLayer("attributes",t,e))}set geometry(e){const t=this._get("geometry");t!==e&&(this._set("geometry",e),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&&M(t.defaultPopupTemplate))return t.defaultPopupTemplate}return null}getAttribute(e){var t;return(t=this.attributes)==null?void 0:t[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{aggregateGeometries:iQ(this.aggregateGeometries),geometry:M(this.geometry)?this.geometry.toJSON():null,symbol:M(this.symbol)?this.symbol.toJSON():null,attributes:{...this.attributes},popupTemplate:this.popupTemplate&&this.popupTemplate.toJSON()}}notifyGeometryChanged(){this._notifyLayer("geometry",this.geometry,this.geometry)}notifyMeshTransformChanged(){M(this.geometry)&&this.geometry.type==="mesh"&&this._notifyLayer("transform",this.geometry.transform,this.geometry.transform)}_notifyLayer(e,t,i,s){if(!this.layer||!("graphicChanged"in this.layer))return;const r={graphic:this,property:e,oldValue:t,newValue:i};e==="attributes"&&(r.attributeName=s),this.layer.graphicChanged(r)}};c([h({value:null,json:{read:tQ}})],Hi.prototype,"aggregateGeometries",null),c([h({value:null})],Hi.prototype,"attributes",null),c([h({value:null,types:fu,json:{read:ll}})],Hi.prototype,"geometry",null),c([h({type:Boolean})],Hi.prototype,"isAggregate",void 0),c([h({clonable:"reference"})],Hi.prototype,"layer",void 0),c([h({type:Dm})],Hi.prototype,"popupTemplate",void 0),c([h({clonable:"reference"})],Hi.prototype,"sourceLayer",void 0),c([h({value:null,types:Uc})],Hi.prototype,"symbol",null),c([h({type:Boolean,value:!0})],Hi.prototype,"visible",null),Hi=c([S("esri.Graphic")],Hi),function(e){e.generateUID=uf}(Hi||(Hi={}));const Ci=Hi;let qc=class extends pf{_own(e){e.layer&&"remove"in e.layer&&e.layer!==this.owner&&e.layer.remove(e),e.layer=this.owner}_release(e){e.layer===this.owner&&(e.layer=null)}};c([P$({Type:Ci,ensureType:Dt(Ci)})],qc.prototype,"itemType",void 0),qc=c([S("esri.support.GraphicsCollection")],qc);var dS;let kp=dS=class extends W{constructor(e){super(e)}async collectRequiredFields(e,t){return Ui(e,t,this.expression)}clone(){return new dS({expression:this.expression,title:this.title})}equals(e){return this.expression===e.expression&&this.title===e.title}};c([h({type:String,json:{write:!0}})],kp.prototype,"expression",void 0),c([h({type:String,json:{write:!0}})],kp.prototype,"title",void 0),kp=dS=c([S("esri.layers.support.FeatureExpressionInfo")],kp);const Fk=kp,aT={inches:Fs(1,"meters","inches"),feet:Fs(1,"meters","feet"),"us-feet":Fs(1,"meters","us-feet"),yards:Fs(1,"meters","yards"),miles:Fs(1,"meters","miles"),"nautical-miles":Fs(1,"meters","nautical-miles"),millimeters:Fs(1,"meters","millimeters"),centimeters:Fs(1,"meters","centimeters"),decimeters:Fs(1,"meters","decimeters"),meters:Fs(1,"meters","meters"),kilometers:Fs(1,"meters","kilometers"),"decimal-degrees":1/xW(1,"meters",it.radius)};function t_e(e){return 1/(aT[e]||1)}function sQ(){const e=Object.keys(aT);return e.sort(),e}const rQ=sQ();var pS;const Sy=mi()({onTheGround:"on-the-ground",relativeToGround:"relative-to-ground",relativeToScene:"relative-to-scene",absoluteHeight:"absolute-height"}),Dk=new Ie({foot:"feet",kilometer:"kilometers",meter:"meters",mile:"miles","us-foot":"us-feet",yard:"yards"});let Zn=pS=class extends W{constructor(e){super(e),this.offset=null}readFeatureExpressionInfo(e,t){return e!=null?e:t.featureExpression&&t.featureExpression.value===0?{expression:"0"}:void 0}writeFeatureExpressionInfo(e,t,i,s){t[i]=e.write({},s),e.expression==="0"&&(t.featureExpression={value:0})}get mode(){const{offset:e,featureExpressionInfo:t}=this;return this._isOverridden("mode")?this._get("mode"):M(e)||t?"relative-to-ground":"on-the-ground"}set mode(e){this._override("mode",e)}set unit(e){this._set("unit",e)}write(e,t){return this.offset||this.mode||this.featureExpressionInfo||this.unit?super.write(e,t):null}clone(){return new pS({mode:this.mode,offset:this.offset,featureExpressionInfo:this.featureExpressionInfo?this.featureExpressionInfo.clone():void 0,unit:this.unit})}equals(e){return this.mode===e.mode&&this.offset===e.offset&&this.unit===e.unit&&U6(this.featureExpressionInfo,e.featureExpressionInfo)}};c([h({type:Fk,json:{write:!0}})],Zn.prototype,"featureExpressionInfo",void 0),c([Q("featureExpressionInfo",["featureExpressionInfo","featureExpression"])],Zn.prototype,"readFeatureExpressionInfo",null),c([ie("featureExpressionInfo",{featureExpressionInfo:{type:Fk},"featureExpression.value":{type:[0]}})],Zn.prototype,"writeFeatureExpressionInfo",null),c([h({type:Sy.apiValues,nonNullable:!0,json:{type:Sy.jsonValues,read:Sy.read,write:{writer:Sy.write,isRequired:!0}}})],Zn.prototype,"mode",null),c([h({type:Number,json:{write:!0}})],Zn.prototype,"offset",void 0),c([h({type:rQ,json:{type:String,read:Dk.read,write:Dk.write}})],Zn.prototype,"unit",null),Zn=pS=c([S("esri.layers.support.ElevationInfo")],Zn);const kN=Zn;let Qn=class extends CD(PD(Yf)){constructor(e){super(e),this.elevationInfo=null,this.graphics=new qc,this.screenSizePerspectiveEnabled=!0,this.type="graphics",this.internal=!1}destroy(){this.removeAll(),this.graphics.destroy()}add(e){return this.graphics.add(e),this}addMany(e){return this.graphics.addMany(e),this}removeAll(){return this.graphics.removeAll(),this}remove(e){this.graphics.remove(e)}removeMany(e){this.graphics.removeMany(e)}on(e,t){return super.on(e,t)}graphicChanged(e){this.emit("graphic-update",e)}};c([h({type:kN})],Qn.prototype,"elevationInfo",void 0),c([h(nx(qc,"graphics"))],Qn.prototype,"graphics",void 0),c([h({type:["show","hide"]})],Qn.prototype,"listMode",void 0),c([h()],Qn.prototype,"screenSizePerspectiveEnabled",void 0),c([h({readOnly:!0})],Qn.prototype,"type",void 0),c([h({constructOnly:!0})],Qn.prototype,"internal",void 0),Qn=c([S("esri.layers.GraphicsLayer")],Qn);const CN=Qn;var fS;let Vg=fS=class extends W{constructor(e){super(e),this.type="none"}clone(){return new fS({type:this.type})}};c([ue({none:"none",stayAbove:"stay-above"})],Vg.prototype,"type",void 0),Vg=fS=c([S("esri.ground.NavigationConstraint")],Vg);let Ke=class extends oe{constructor(){super(...arguments),this.SCENEVIEW_HITTEST_RETURN_INTERSECTOR=!1,this.DECONFLICTOR_SHOW_VISIBLE=!1,this.DECONFLICTOR_SHOW_INVISIBLE=!1,this.DECONFLICTOR_SHOW_GRID=!1,this.LABELS_SHOW_BORDER=!1,this.TEXT_SHOW_BASELINE=!1,this.TEXT_SHOW_BORDER=!1,this.OVERLAY_DRAW_DEBUG_TEXTURE=!1,this.OVERLAY_SHOW_CENTER=!1,this.SHOW_POI=!1,this.TESTS_DISABLE_OPTIMIZATIONS=!1,this.TESTS_DISABLE_FAST_UPDATES=!1,this.DRAW_MESH_GEOMETRY_NORMALS=!1,this.FEATURE_TILE_FETCH_SHOW_TILES=!1,this.FEATURE_TILE_TREE_SHOW_TILES=!1,this.TERRAIN_TILE_TREE_SHOW_TILES=!1,this.I3S_TREE_SHOW_TILES=!1,this.I3S_SHOW_MODIFICATIONS=!1,this.LOD_INSTANCE_RENDERER_DISABLE_UPDATES=!1,this.LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL=!1,this.EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES=!1,this.LINE_WIREFRAMES=!1,this.TERRAIN_USE_LEGACY_SHADING=!1}};c([h()],Ke.prototype,"SCENEVIEW_HITTEST_RETURN_INTERSECTOR",void 0),c([h()],Ke.prototype,"DECONFLICTOR_SHOW_VISIBLE",void 0),c([h()],Ke.prototype,"DECONFLICTOR_SHOW_INVISIBLE",void 0),c([h()],Ke.prototype,"DECONFLICTOR_SHOW_GRID",void 0),c([h()],Ke.prototype,"LABELS_SHOW_BORDER",void 0),c([h()],Ke.prototype,"TEXT_SHOW_BASELINE",void 0),c([h()],Ke.prototype,"TEXT_SHOW_BORDER",void 0),c([h()],Ke.prototype,"OVERLAY_DRAW_DEBUG_TEXTURE",void 0),c([h()],Ke.prototype,"OVERLAY_SHOW_CENTER",void 0),c([h()],Ke.prototype,"SHOW_POI",void 0),c([h()],Ke.prototype,"TESTS_DISABLE_OPTIMIZATIONS",void 0),c([h()],Ke.prototype,"TESTS_DISABLE_FAST_UPDATES",void 0),c([h()],Ke.prototype,"DRAW_MESH_GEOMETRY_NORMALS",void 0),c([h()],Ke.prototype,"FEATURE_TILE_FETCH_SHOW_TILES",void 0),c([h()],Ke.prototype,"FEATURE_TILE_TREE_SHOW_TILES",void 0),c([h()],Ke.prototype,"TERRAIN_TILE_TREE_SHOW_TILES",void 0),c([h()],Ke.prototype,"I3S_TREE_SHOW_TILES",void 0),c([h()],Ke.prototype,"I3S_SHOW_MODIFICATIONS",void 0),c([h()],Ke.prototype,"LOD_INSTANCE_RENDERER_DISABLE_UPDATES",void 0),c([h()],Ke.prototype,"LOD_INSTANCE_RENDERER_COLORIZE_BY_LEVEL",void 0),c([h()],Ke.prototype,"EDGES_SHOW_HIDDEN_TRANSPARENT_EDGES",void 0),c([h()],Ke.prototype,"LINE_WIREFRAMES",void 0),c([h()],Ke.prototype,"TERRAIN_USE_LEGACY_SHADING",void 0),Ke=c([S("esri.views.3d.support.DebugFlags")],Ke);const nQ=new Ke;var mS;let rn=mS=class extends Cm(Lo){constructor(e){super(e),this.opacity=1,this.shading=!nQ.TERRAIN_USE_LEGACY_SHADING,this.surfaceColor=null,this.navigationConstraint=null,this.layers=new he;const t=s=>{s.parent&&s.parent!==this&&"remove"in s.parent&&s.parent.remove(s),s.parent=this,s.type!=="elevation"&&s.type!=="base-elevation"&&q.getLogger(this.declaredClass).error(`Layer '${s.title}, id:${s.id}' of type '${s.type}' is not supported as a ground layer and will therefore be ignored. Only layers of type 'elevation' are supported.`)},i=s=>{s.parent=null};this.layers.on("after-add",s=>t(s.item)),this.layers.on("after-remove",s=>i(s.item))}initialize(){this.when().catch(e=>{q.getLogger(this.declaredClass).error("#load()","Failed to load ground",e)}),this.resourceInfo&&this.read(this.resourceInfo.data,this.resourceInfo.context)}destroy(){const e=this.layers.removeAll();for(const t of e)t.destroy();this.layers.destroy()}normalizeCtorArgs(e){return e&&"resourceInfo"in e&&(this._set("resourceInfo",e.resourceInfo),delete(e={...e}).resourceInfo),e}set layers(e){this._set("layers",ou(e,this._get("layers")))}writeLayers(e,t,i,s){const r=[];e&&(s={...s,layerContainerType:"ground"},e.forEach(n=>{if("write"in n){const o={};V1(n)().write(o,s)&&r.push(o)}else s&&s.messages&&s.messages.push(new L("layer:unsupported",`Layers (${n.title}, ${n.id}) of type '${n.declaredClass}' cannot be persisted in the ground`,{layer:n}))})),t.layers=r}load(e){return this.addResolvingPromise(this._loadFromSource(e)),Promise.resolve(this)}loadAll(){return fD(this,e=>{e(this.layers)})}async queryElevation(e,t){await this.load({signal:t==null?void 0:t.signal});const{ElevationQuery:i}=await z(()=>import("./ElevationQuery.dec612cd.js"),[]);Ft(t);const s=new i,r=this.layers.filter(Nk).toArray();return s.queryAll(r,e,t)}async createElevationSampler(e,t){await this.load({signal:t==null?void 0:t.signal});const{ElevationQuery:i}=await z(()=>import("./ElevationQuery.dec612cd.js"),[]);Ft(t);const s=new i,r=this.layers.filter(Nk).toArray();return s.createSamplerAll(r,e,t)}clone(){const e={opacity:this.opacity,surfaceColor:R(this.surfaceColor),navigationConstraint:R(this.navigationConstraint),layers:this.layers.slice()};return this.loaded&&(e.loadStatus="loaded"),new mS({resourceInfo:this.resourceInfo}).set(e)}read(e,t){this.resourceInfo||this._set("resourceInfo",{data:e,context:t}),super.read(e,t)}_loadFromSource(e){const t=this.resourceInfo;return t?this._loadLayersFromJSON(t.data,t.context,e):Promise.resolve()}_loadLayersFromJSON(e,t,i){const s=t&&t.origin||"web-scene",r=t&&t.portal||null,n=t&&t.url||null;return z(()=>import("./layersCreator.67b651fa.js"),["assets/layersCreator.67b651fa.js","assets/lazyLayerLoader.4d2df2af.js","assets/portalLayers.72750f56.js","assets/layersLoader.afdddce2.js","assets/jsonContext.fe51f9bd.js","assets/portalItemUtils.92eef7f6.js"]).then(({populateOperationalLayers:o})=>{Ft(i);const a=[];if(e.layers&&Array.isArray(e.layers)){const l={context:{origin:s,url:n,portal:r,layerContainerType:"ground"},defaultLayerType:"ArcGISTiledElevationServiceLayer"};a.push(o(this.layers,e.layers,l))}return as(a)}).then(()=>{})}};function oQ(e){return e&&"createElevationSampler"in e}function Nk(e){return e.type==="elevation"||oQ(e)}c([h({json:{read:!1}})],rn.prototype,"layers",null),c([ie("layers")],rn.prototype,"writeLayers",null),c([h({readOnly:!0})],rn.prototype,"resourceInfo",void 0),c([h({type:Number,nonNullable:!0,range:{min:0,max:1},json:{type:Ge,read:{reader:em,source:"transparency"},write:{writer:(e,t)=>{t.transparency=Rb(e)},target:"transparency"}}})],rn.prototype,"opacity",void 0),c([h({type:Boolean,nonNullable:!0,json:{read:!1}})],rn.prototype,"shading",void 0),c([h({type:pe,json:{type:[Ge],write:(e,t)=>{t.surfaceColor=e.toJSON().slice(0,3)}}})],rn.prototype,"surfaceColor",void 0),c([h({type:Vg,json:{write:!0}})],rn.prototype,"navigationConstraint",void 0),rn=mS=c([S("esri.Ground")],rn);const wv=rn;let Vu=class extends he{constructor(e){super(e),this.getCollections=null}initialize(){this.own(NR(()=>this._refresh()))}destroy(){this.getCollections=null}_refresh(){const e=M(this.getCollections)?this.getCollections():null;if(N(e))return void this.removeAll();let t=0;for(const i of e)M(i)&&(t=this._processCollection(t,i));this.splice(t,this.length)}_createNewInstance(e){return new he(e)}_processCollection(e,t){if(!t)return e;const i=this.itemFilterFunction?this.itemFilterFunction:s=>!!s;for(const s of t)if(s){if(i(s)){const r=this.indexOf(s,e);r>=0?r!==e&&this.reorder(s,e):this.add(s,e),++e}if(this.getChildrenFunction){const r=this.getChildrenFunction(s);if(Array.isArray(r))for(const n of r)e=this._processCollection(e,n);else e=this._processCollection(e,r)}}return e}};c([h()],Vu.prototype,"getCollections",void 0),c([h()],Vu.prototype,"getChildrenFunction",void 0),c([h()],Vu.prototype,"itemFilterFunction",void 0),Vu=c([S("esri.core.CollectionFlattener")],Vu);const im=Vu;function aQ(e){var t;return!!(e&&e.loaded&&"capabilities"in e&&((t=e==null?void 0:e.capabilities)==null?void 0:t.operations)&&"supportsEditing"in e.capabilities.operations&&e.capabilities.operations.supportsEditing===!0)&&!("editingEnabled"in e&&!e.editingEnabled)}function lQ(e){return new im({getCollections:()=>[e.tables,e.layers],getChildrenFunction:t=>{const i=[];return"tables"in t&&i.push(t.tables),"layers"in t&&i.push(t.layers),i},itemFilterFunction:t=>{const i=t.parent;return i&&"tables"in i&&i.tables.includes(t)}})}const jk={"world-elevation":{id:"worldElevation",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/Terrain3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"},"world-topobathymetry":{id:"worldTopoBathymetry",url:"//elevation3d.arcgis.com/arcgis/rest/services/WorldElevation3D/TopoBathy3D/ImageServer",layerType:"ArcGISTiledElevationServiceLayer"}};function cQ(e){let t=null;if(typeof e=="string")if(e in jk){const i=jk[e];t=new wv({resourceInfo:{data:{layers:[i]}}})}else q.getLogger("esri.support.groundUtils").warn(`Unable to find ground definition for: ${e}. Try "world-elevation"`);else t=Dt(wv,e);return t}function yS(e,t,i){let s,r;if(e)for(let n=0,o=e.length;n{let t=class extends e{constructor(...i){super(...i),this.layers=new he;const s=o=>{o.parent&&"remove"in o.parent&&o.parent.remove(o)},r=o=>{o.parent=this,this.layerAdded(o),o.type!=="elevation"&&o.type!=="base-elevation"||q.getLogger(this.declaredClass).error(`Layer 'title:${o.title}, id:${o.id}' of type '${o.type}' is not supported as an operational layer and will therefore be ignored.`)},n=o=>{o.parent=null,this.layerRemoved(o)};this.layers.on("before-add",o=>s(o.item)),this.layers.on("after-add",o=>r(o.item)),this.layers.on("after-remove",o=>n(o.item))}destroy(){const i=this.layers.removeAll();for(const s of i)this.layerRemoved(s),s.destroy();this.layers.destroy()}set layers(i){this._set("layers",ou(i,this._get("layers")))}add(i,s){const r=this.layers;if(s=r.getNextIndex(s),i instanceof Yf){const n=i;n.parent===this?this.reorder(n,s):r.add(n,s)}else No(i)?i.then(n=>{this.destroyed||this.add(n,s)}):q.getLogger(this.declaredClass).error("#add()","The item being added is not a Layer or a Promise that resolves to a Layer.")}addMany(i,s){const r=this.layers;s=r.getNextIndex(s),i.slice().forEach(n=>{n.parent!==this?(r.add(n,s),s+=1):this.reorder(n,s)})}findLayerById(i){return yS(this.layers,"id",i)}findLayerByUid(i){return yS(this.layers,"uid",i)}remove(i){return this.layers.remove(i)}removeMany(i){return this.layers.removeMany(i)}removeAll(){return this.layers.removeAll()}reorder(i,s){return this.layers.reorder(i,s)}layerAdded(i){}layerRemoved(i){}};return c([h()],t.prototype,"layers",null),t=c([S("esri.support.LayersMixin")],t),t};function gS(e,t,i){if(e)for(let s=0,r=e.length;s{let t=class extends e{constructor(...i){super(...i),this.tables=new he,this.tables.on("after-add",s=>{const r=s.item;r.parent&&r.parent!==this&&"tables"in r.parent&&r.parent.tables.remove(r),r.parent=this,r.type!=="feature"&&q.getLogger(this.declaredClass).error(`Layer 'title:${r.title}, id:${r.id}' of type '${r.type}' is not supported as a table and will therefore be ignored.`)}),this.tables.on("after-remove",s=>{s.item.parent=null})}destroy(){const i=this.tables.removeAll();for(const s of i)s.destroy();this.tables.destroy()}set tables(i){this._set("tables",ou(i,this._get("tables")))}findTableById(i){return gS(this.tables,"id",i)}findTableByUid(i){return gS(this.tables,"uid",i)}};return c([h()],t.prototype,"tables",null),t=c([S("esri.support.TablesMixin")],t),t};let nn=class extends hQ(uQ(jo.EventedMixin(oe))){constructor(e){super(e),this.allLayers=new im({getCollections:()=>{var t,i,s;return[(t=this.basemap)==null?void 0:t.baseLayers,(i=this.ground)==null?void 0:i.layers,this.layers,(s=this.basemap)==null?void 0:s.referenceLayers]},getChildrenFunction:t=>"layers"in t?t.layers:null}),this.allTables=lQ(this),this.basemap=null,this.editableLayers=new im({getCollections:()=>[this.allLayers],itemFilterFunction:aQ}),this.ground=new wv,this._basemapCache=mJ()}destroy(){var e,t;this.allLayers.destroy(),this.allTables.destroy(),this.editableLayers.destroy(),(e=this.ground)==null||e.destroy(),(t=this.basemap)==null||t.destroy(),gD(this._basemapCache),this._basemapCache=null}castBasemap(e){return xg(e,this._basemapCache)}castGround(e){const t=cQ(e);return N(t)?this._get("ground"):t}findLayerById(e){return this.allLayers.find(t=>t.id===e)}findTableById(e){return this.allTables.find(t=>t.id===e)}};c([h({readOnly:!0,dependsOn:[]})],nn.prototype,"allLayers",void 0),c([h({readOnly:!0})],nn.prototype,"allTables",void 0),c([h({type:mv})],nn.prototype,"basemap",void 0),c([Oe("basemap")],nn.prototype,"castBasemap",null),c([h({readOnly:!0})],nn.prototype,"editableLayers",void 0),c([h({type:wv,nonNullable:!0})],nn.prototype,"ground",void 0),c([Oe("ground")],nn.prototype,"castGround",null),nn=c([S("esri.Map")],nn);const PN=nn;class lT{constructor(t,i){this.min=t,this.max=i,this.range=i-t}ndiff(t,i=0){return Math.ceil((t-i)/this.range)*this.range+i}_normalize(t,i,s,r=0,n=!1){return(s-=r)i&&(s-=this.ndiff(s-i)),n&&s===i&&(s=t),s+r}normalize(t,i=0,s=!1){return this._normalize(this.min,this.max,t,i,s)}clamp(t,i=0){return ls(t-i,this.min,this.max)+i}monotonic(t,i,s){return tt&&sdQ.normalize(Ys(e)))],Kn.prototype,"heading",void 0),c([h({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),Oe(e=>ls(Ys(e),-180,180))],Kn.prototype,"tilt",void 0),c([h({type:Number,nonNullable:!0,json:{read:!1,write:!1}})],Kn.prototype,"fov",void 0),Kn=c([S("esri.Camera")],Kn);const pQ=Kn;var vS;let ma=vS=class extends W{constructor(e){super(e),this.rotation=0,this.scale=0,this.targetGeometry=null,this.camera=null}castRotation(e){return(e%=360)<0&&(e+=360),e}clone(){return new vS({rotation:this.rotation,scale:this.scale,targetGeometry:M(this.targetGeometry)?this.targetGeometry.clone():null,camera:M(this.camera)?this.camera.clone():null})}};function H_(){return{enabled:!this.camera}}c([h({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:H_}}}}})],ma.prototype,"rotation",void 0),c([Oe("rotation")],ma.prototype,"castRotation",null),c([h({type:Number,json:{write:!0,origins:{"web-map":{default:0,write:!0},"web-scene":{write:{overridePolicy:H_}}}}})],ma.prototype,"scale",void 0),c([h({types:fu,json:{read:ll,write:!0,origins:{"web-scene":{read:ll,write:{overridePolicy:H_}}}}})],ma.prototype,"targetGeometry",void 0),c([h({type:pQ,json:{write:!0}})],ma.prototype,"camera",void 0),ma=vS=c([S("esri.Viewpoint")],ma);const Mn=ma;class xv{constructor(t=i=>i.values().next().value){this._peeker=t,this._items=new Set}get length(){return this._items.size}clear(){this._items.clear()}last(){if(this._items.size===0)return;let t;for(t of this._items);return t}peek(){if(this._items.size!==0)return this._peeker(this._items)}push(t){this.contains(t)||this._items.add(t)}contains(t){return this._items.has(t)}pop(){if(this.length===0)return;const t=this.peek();return this._items.delete(t),t}popLast(){if(this.length===0)return;const t=this.last();return this._items.delete(t),t}remove(t){this._items.delete(t)}filter(t){return this._items.forEach(i=>{t(i)||this._items.delete(i)}),this}}var li;(function(e){e[e.HANDSHAKE=0]="HANDSHAKE",e[e.OPEN=1]="OPEN",e[e.OPENED=2]="OPENED",e[e.RESPONSE=3]="RESPONSE",e[e.INVOKE=4]="INVOKE",e[e.ABORT=5]="ABORT",e[e.CLOSE=6]="CLOSE",e[e.OPEN_PORT=7]="OPEN_PORT",e[e.ON=8]="ON"})(li||(li={}));let fQ=0;function AN(){return fQ++}function mQ(e){return e&&typeof e=="object"&&("result"in e||"transferList"in e)}function sm(e){return e?typeof e=="string"?JSON.stringify({name:"message",message:e}):e.toJSON?JSON.stringify(e):JSON.stringify({name:e.name,message:e.message,details:e.details||{stack:e.stack}}):null}function uT(e,t,i,s){if(t.type===li.OPEN_PORT)return void e.postMessage(t,[t.port]);if(t.type!==li.INVOKE&&t.type!==li.RESPONSE)return void e.postMessage(t);let r;if(mQ(i)?(r=Vk(i.transferList),t.data=i.result):(r=Vk(s),t.data=i),r){if(V("ff")){for(const n of r)if("byteLength"in n&&n.byteLength>267386880){const o="Worker call with large ArrayBuffer would crash Firefox";switch(t.type){case li.INVOKE:throw o;case li.RESPONSE:return void uT(e,{type:li.RESPONSE,jobId:t.jobId,error:sm(o)})}}}e.postMessage(t,r)}else e.postMessage(t)}function rm(e){if(!e)return null;const t=e.data;return t?typeof t=="string"?JSON.parse(t):t:null}function Vk(e){if(!e||!e.length)return null;if(V("esri-workers-arraybuffer-transfer"))return e;const t=e.filter(i=>!yQ(i));return t.length?t:null}function yQ(e){return e instanceof ArrayBuffer||e&&e.constructor&&e.constructor.name==="ArrayBuffer"}const gQ={statsWorker:()=>z(()=>import("./statsWorker.181932ee.js"),["assets/statsWorker.181932ee.js","assets/quantizationUtils.7ff797cc.js","assets/utils.83e0b804.js","assets/generateRendererUtils.5c972fdb.js"]),geometryEngineWorker:()=>z(()=>import("./geometryEngineWorker.c4184d57.js"),["assets/geometryEngineWorker.c4184d57.js","assets/geometryEngineJSON.f9e9a36f.js","assets/geometryEngineBase.82b25ca5.js","assets/json.879c9adc.js"]),CSVSourceWorker:()=>z(()=>import("./CSVSourceWorker.20514f1e.js"),["assets/CSVSourceWorker.20514f1e.js","assets/json.879c9adc.js","assets/FeatureStore.99d80f36.js","assets/PooledRBush.e6a31ee9.js","assets/centroid.06db4b74.js","assets/projectionSupport.4f5da4af.js","assets/QueryEngine.ac81c46d.js","assets/QueryEngineResult.2fc58178.js","assets/quantizationUtils.7ff797cc.js","assets/WhereClause.5b749615.js","assets/utils.83e0b804.js","assets/generateRendererUtils.5c972fdb.js","assets/utils.e42485ea.js","assets/QueryEngineCapabilities.78217f95.js","assets/timeSupport.968e62fc.js","assets/number.9e690eda.js","assets/clientSideDefaults.d40b9315.js"]),EdgeProcessingWorker:()=>z(()=>import("./EdgeProcessingWorker.f1d5e58e.js"),["assets/EdgeProcessingWorker.f1d5e58e.js","assets/BufferView.6eee27cd.js","assets/edgeProcessing.a9e4d72e.js","assets/deduplicate.ef93b18a.js","assets/InterleavedLayout.30cdc193.js","assets/types.44c7402c.js","assets/VertexAttribute.42396f25.js","assets/enums.2d9e6f64.js","assets/VertexElementDescriptor.1fdca6da.js"]),ElevationSamplerWorker:()=>z(()=>import("./ElevationSamplerWorker.28a172f3.js"),["assets/ElevationSamplerWorker.28a172f3.js","assets/PooledRBush.e6a31ee9.js","assets/georeference.1d7480c1.js","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/quat.d9562009.js","assets/quatf64.4ae3e6f1.js","assets/BufferView.6eee27cd.js","assets/vec33.46fc6802.js"]),FeatureServiceSnappingSourceWorker:()=>z(()=>import("./FeatureServiceSnappingSourceWorker.1a7b44d8.js"),["assets/FeatureServiceSnappingSourceWorker.1a7b44d8.js","assets/FeatureStore.99d80f36.js","assets/PooledRBush.e6a31ee9.js","assets/centroid.06db4b74.js","assets/QueryEngine.ac81c46d.js","assets/QueryEngineResult.2fc58178.js","assets/quantizationUtils.7ff797cc.js","assets/WhereClause.5b749615.js","assets/utils.83e0b804.js","assets/generateRendererUtils.5c972fdb.js","assets/projectionSupport.4f5da4af.js","assets/json.879c9adc.js","assets/utils.e42485ea.js","assets/QueryEngineCapabilities.78217f95.js","assets/timeSupport.968e62fc.js"]),GeoJSONSourceWorker:()=>z(()=>import("./GeoJSONSourceWorker.5dfffbc8.js"),["assets/GeoJSONSourceWorker.5dfffbc8.js","assets/FeatureStore.99d80f36.js","assets/PooledRBush.e6a31ee9.js","assets/centroid.06db4b74.js","assets/projectionSupport.4f5da4af.js","assets/json.879c9adc.js","assets/QueryEngine.ac81c46d.js","assets/QueryEngineResult.2fc58178.js","assets/quantizationUtils.7ff797cc.js","assets/WhereClause.5b749615.js","assets/utils.83e0b804.js","assets/generateRendererUtils.5c972fdb.js","assets/utils.e42485ea.js","assets/QueryEngineCapabilities.78217f95.js","assets/timeSupport.968e62fc.js","assets/geojson.7d18026b.js","assets/clientSideDefaults.d40b9315.js","assets/sourceUtils.ed369a2c.js"]),LercWorker:()=>z(()=>import("./LercWorker.089f2d60.js"),[]),MemorySourceWorker:()=>z(()=>import("./MemorySourceWorker.8d1364ce.js"),["assets/MemorySourceWorker.8d1364ce.js","assets/objectIdUtils.83ac3f67.js","assets/FeatureStore.99d80f36.js","assets/PooledRBush.e6a31ee9.js","assets/centroid.06db4b74.js","assets/projectionSupport.4f5da4af.js","assets/json.879c9adc.js","assets/QueryEngine.ac81c46d.js","assets/QueryEngineResult.2fc58178.js","assets/quantizationUtils.7ff797cc.js","assets/WhereClause.5b749615.js","assets/utils.83e0b804.js","assets/generateRendererUtils.5c972fdb.js","assets/utils.e42485ea.js","assets/QueryEngineCapabilities.78217f95.js","assets/timeSupport.968e62fc.js","assets/clientSideDefaults.d40b9315.js","assets/sourceUtils.ed369a2c.js"]),PBFDecoderWorker:()=>z(()=>import("./PBFDecoderWorker.47cbd979.js"),[]),Pipeline:()=>z(()=>import("./Pipeline.e5f0f177.js"),["assets/Pipeline.e5f0f177.js","assets/QueryEngine.ac81c46d.js","assets/QueryEngineResult.2fc58178.js","assets/quantizationUtils.7ff797cc.js","assets/WhereClause.5b749615.js","assets/utils.83e0b804.js","assets/generateRendererUtils.5c972fdb.js","assets/projectionSupport.4f5da4af.js","assets/json.879c9adc.js","assets/utils.e42485ea.js","assets/QueryEngineCapabilities.78217f95.js","assets/timeSupport.968e62fc.js","assets/FeatureStore2D.3fea35f0.js","assets/CircularArray.62f75f43.js","assets/ComputedAttributeStorage.29767acd.js","assets/centroid.06db4b74.js","assets/enums.0295eb81.js","assets/visualVariablesUtils.061b7a4e.js","assets/Utils.2136650a.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/visualVariablesUtils.62efda9d.js","assets/ogcFeatureUtils.61a937b0.js","assets/geojson.7d18026b.js","assets/clientSideDefaults.d40b9315.js","assets/createConnection.0e3796d4.js"]),PointCloudWorker:()=>z(()=>import("./PointCloudWorker.ac192dad.js"),["assets/PointCloudWorker.ac192dad.js","assets/quat.d9562009.js","assets/mat3f64.6d32a1d7.js","assets/quatf64.4ae3e6f1.js","assets/I3SBinaryReader.2f855706.js","assets/VertexAttribute.42396f25.js","assets/vec3f32.1121a836.js","assets/PointCloudUniqueValueRenderer.32cfad84.js"]),RasterWorker:()=>z(()=>import("./RasterWorker.bd4ba3a5.js"),["assets/RasterWorker.bd4ba3a5.js","assets/pixelUtils.9c6f8dae.js","assets/RasterSymbolizer.093b1748.js","assets/colorUtils.bb6424b7.js","assets/utils.bc3381b3.js","assets/rasterProjectionHelper.f3c10be2.js","assets/dataUtils.e7623e56.js"]),SceneLayerSnappingSourceWorker:()=>z(()=>import("./SceneLayerSnappingSourceWorker.b99c81d4.js"),["assets/SceneLayerSnappingSourceWorker.b99c81d4.js","assets/Util.f17667f9.js","assets/sphere.f99ddb50.js","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/quatf64.4ae3e6f1.js","assets/QueryEngineResult.2fc58178.js","assets/quantizationUtils.7ff797cc.js","assets/WhereClause.5b749615.js","assets/utils.83e0b804.js","assets/generateRendererUtils.5c972fdb.js","assets/projectionSupport.4f5da4af.js","assets/json.879c9adc.js","assets/utils.e42485ea.js","assets/plane.444b53ce.js","assets/edgeProcessing.a9e4d72e.js","assets/deduplicate.ef93b18a.js","assets/InterleavedLayout.30cdc193.js","assets/BufferView.6eee27cd.js","assets/types.44c7402c.js","assets/VertexAttribute.42396f25.js","assets/enums.2d9e6f64.js","assets/VertexElementDescriptor.1fdca6da.js"]),SceneLayerWorker:()=>z(()=>import("./SceneLayerWorker.b2729abd.js"),["assets/SceneLayerWorker.b2729abd.js","assets/sphere.f99ddb50.js","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/quatf64.4ae3e6f1.js"]),WFSSourceWorker:()=>z(()=>import("./WFSSourceWorker.b32c1de1.js"),["assets/WFSSourceWorker.b32c1de1.js","assets/FeatureStore.99d80f36.js","assets/PooledRBush.e6a31ee9.js","assets/centroid.06db4b74.js","assets/projectionSupport.4f5da4af.js","assets/json.879c9adc.js","assets/QueryEngine.ac81c46d.js","assets/QueryEngineResult.2fc58178.js","assets/quantizationUtils.7ff797cc.js","assets/WhereClause.5b749615.js","assets/utils.83e0b804.js","assets/generateRendererUtils.5c972fdb.js","assets/utils.e42485ea.js","assets/QueryEngineCapabilities.78217f95.js","assets/timeSupport.968e62fc.js","assets/geojson.7d18026b.js","assets/sourceUtils.ed369a2c.js","assets/wfsUtils.6ba3d875.js","assets/xmlUtils.56e603f6.js"]),WorkerTileHandler:()=>z(()=>import("./WorkerTileHandler.de9f3c4a.js"),["assets/WorkerTileHandler.de9f3c4a.js","assets/enums.54326430.js","assets/GeometryUtils.4f19e772.js","assets/Rect.95b0fd2e.js","assets/config.82550349.js","assets/StyleDefinition.d56936e4.js","assets/enums.0295eb81.js","assets/Geometry.d049a63c.js","assets/TileClipper.77103a2e.js","assets/GeometryUtils.51c4032a.js","assets/StyleRepository.e426e44d.js","assets/enums.2d9e6f64.js","assets/VertexElementDescriptor.1fdca6da.js","assets/colorUtils.bb6424b7.js","assets/earcut.afc1d357.js","assets/BidiEngine.d8bba3fc.js"])},{CLOSE:zk,ABORT:Bk,INVOKE:Uk,RESPONSE:Fd,OPEN_PORT:qk,ON:vQ}=li,bQ=2;class _Q{constructor(t){this._timer=null,this._cancelledJobIds=new Set,this._invokeMessages=[],this._invoke=t,this._timer=null,this._process=this._process.bind(this)}push(t){t.type===li.ABORT?this._cancelledJobIds.add(t.jobId):(this._invokeMessages.push(t),this._timer===null&&(this._timer=setTimeout(this._process,0)))}clear(){this._invokeMessages.length=0,this._cancelledJobIds.clear(),this._timer=null}_process(){this._timer=null;for(const t of this._invokeMessages)this._cancelledJobIds.has(t.jobId)||this._invoke(t);this._cancelledJobIds.clear(),this._invokeMessages.length=0}}class ss{constructor(t,i,s){this._port=t,this._getNextJob=s,this._outJobs=new Map,this._inJobs=new Map,this._invokeQueue=new _Q(r=>this._onInvokeMessage(r)),this._client=i.client,this._onMessage=this._onMessage.bind(this),this._channel=i.channel,this._schedule=i.schedule,this._port.addEventListener("message",this._onMessage),this._port.start()}static connect(t){const i=new MessageChannel;let s;s=typeof t=="function"?new t:"default"in t&&typeof t.default=="function"?new t.default:t;const r=new ss(i.port1,{channel:i,client:s},()=>null);return typeof s=="object"&&"remoteClient"in s&&(s.remoteClient=r),ss.clients.set(r,s),i.port2}static loadWorker(t){const i=gQ[t];return i?i():Promise.resolve(null)}close(){this._post({type:zk}),this._close()}isBusy(){return this._outJobs.size>0}invoke(t,i,s){const r=s&&s.signal,n=s&&s.transferList;if(!this._port)return Promise.reject(new L("worker:port-closed",`Cannot call invoke('${t}'), port is closed`,{methodName:t,data:i}));const o=AN();return new Promise((a,l)=>{if(jr(r))return this._processWork(),void l(_t());const u=Vr(r,()=>{const f=this._outJobs.get(o);f&&(this._outJobs.delete(o),this._processWork(),Bt(f.abortHandle),this._post({type:Bk,jobId:o}),l(_t()))}),d={resolve:a,reject:l,abortHandle:u,debugInfo:t};this._outJobs.set(o,d),this._post({type:Uk,jobId:o,methodName:t,abortable:r!=null},i,n)})}on(t,i){const s=new MessageChannel;function r(n){i(n.data)}return this._port.postMessage({type:li.ON,eventType:t,port:s.port2},[s.port2]),s.port1.addEventListener("message",r),s.port1.start(),{remove(){s.port1.postMessage({type:li.CLOSE}),s.port1.close(),s.port1.removeEventListener("message",r)}}}jobAdded(){this._processWork()}openPort(){const t=new MessageChannel;return this._post({type:qk,port:t.port2}),t.port1}_processWork(){if(this._outJobs.size>=bQ)return;const t=this._getNextJob();if(!t)return;const{methodName:i,data:s,invokeOptions:r,deferred:n}=t;this.invoke(i,s,r).then(o=>n.resolve(o)).catch(o=>n.reject(o))}_close(){this._channel&&(this._channel=void 0),this._port.removeEventListener("message",this._onMessage),this._port.close(),this._outJobs.forEach(t=>{Bt(t.abortHandle),t.reject(_t(`Worker closing, aborting job calling '${t.debugInfo}'`))}),this._inJobs.clear(),this._outJobs.clear(),this._invokeQueue.clear(),this._port=this._client=this._schedule=null}_onMessage(t){M(this._schedule)?this._schedule(()=>this._processMessage(t)):this._processMessage(t)}_processMessage(t){const i=rm(t);if(i)switch(i.type){case Fd:this._onResponseMessage(i);break;case Uk:this._invokeQueue.push(i);break;case Bk:this._onAbortMessage(i);break;case zk:this._onCloseMessage();break;case qk:this._onOpenPortMessage(i);break;case vQ:this._onOnMessage(i)}}_onAbortMessage(t){const i=this._inJobs,s=t.jobId,r=i.get(s);this._invokeQueue.push(t),r&&(r.controller&&r.controller.abort(),i.delete(s))}_onCloseMessage(){const t=this._client;this._close(),t&&"destroy"in t&&ss.clients.get(this)===t&&t.destroy(),ss.clients.delete(this),t&&t.remoteClient&&(t.remoteClient=null)}_onInvokeMessage(t){const{methodName:i,jobId:s,data:r,abortable:n}=t,o=n?new AbortController:null,a=this._inJobs;let l,u=this._client,d=u[i];try{if(!d&&i&&i.includes(".")){const f=i.split(".");for(let m=0;m{a.has(s)&&(a.delete(s),this._post({type:Fd,jobId:s},f))},f=>{a.has(s)&&(a.delete(s),Ks(f)||this._post({type:Fd,jobId:s,error:sm(f||{message:`Error encountered at method ${i}`})}))})):this._post({type:Fd,jobId:s},l)}_onOpenPortMessage(t){new ss(t.port,{client:this._client},()=>null)}_onOnMessage(t){const{port:i}=t,s=this._client.on(t.eventType,n=>{i.postMessage(n)}),r=sb(t.port,"message",n=>{var o;((o=rm(n))==null?void 0:o.type)===li.CLOSE&&(r.remove(),s.remove(),i.close())})}_onResponseMessage(t){const{jobId:i,error:s,data:r}=t,n=this._outJobs;if(!n.has(i))return;const o=n.get(i);n.delete(i),this._processWork(),Bt(o.abortHandle),s?o.reject(L.fromJSON(JSON.parse(s))):o.resolve(r)}_post(t,i,s){return uT(this._port,t,i,s)}}ss.kernelInfo={revision:$R,version:TR,buildDate:MR},ss.clients=new Map;class wQ{constructor(){this._inUseClients=new Array,this._clients=new Array,this._clientPromises=new Array,this._ongoingJobsQueue=new xv}destroy(){this.close()}get closed(){return!this._clients||!this._clients.length}open(t,i){return new Promise((s,r)=>{let n=!0;const o=a=>{Ft(i.signal),n&&(n=!1,a())};this._clients.length=t.length,this._clientPromises.length=t.length,this._inUseClients.length=t.length;for(let a=0;a(this._clients[a]=new ss(u,i,()=>{var d;return(d=this._ongoingJobsQueue.pop())!=null?d:null}),o(s),this._clients[a]),()=>(o(r),null)):(this._clients[a]=new ss(l,i,()=>{var u;return(u=this._ongoingJobsQueue.pop())!=null?u:null}),this._clientPromises[a]=Promise.resolve(this._clients[a]),o(s))}})}broadcast(t,i,s){const r=new Array(this._clientPromises.length);for(let n=0;na==null?void 0:a.invoke(t,i,s))}return r}close(){let t;for(;t=this._ongoingJobsQueue.pop();)t.deferred.reject(_t(`Worker closing, aborting job calling '${t.methodName}'`));for(const i of this._clientPromises)i.then(s=>s==null?void 0:s.close());this._clients.length=0,this._clientPromises.length=0}invoke(t,i,s){let r;Array.isArray(s)?(q.getLogger("esri.core.workers.Connection").warn("invoke()","The transferList parameter is deprecated, use the options object instead"),r={transferList:s}):r=s;const n=Ao();this._ongoingJobsQueue.push({methodName:t,data:i,invokeOptions:r,deferred:n});for(let o=0;ol==null?void 0:l.jobAdded())}return n.promise}on(t,i){return Promise.all(this._clientPromises).then(()=>Kv(this._clients.map(s=>s.on(t,i))))}openPorts(){return new Promise(t=>{const i=new Array(this._clientPromises.length);let s=i.length;for(let r=0;r{n&&(i[r]=n.openPort()),--s==0&&t(i)})})}get test(){return{numClients:this._clients.length}}}const Gk={};function xQ(e,t){for(const i of e)if(i.name===t.name)return;e.push(t)}function SQ(e){var i;const t={async:e.async,isDebug:e.isDebug,locale:e.locale,baseUrl:e.baseUrl,has:{...e.has},map:{...e.map},packages:e.packages&&e.packages.concat()||[],paths:{...e.paths}};return e.hasOwnProperty("async")||(t.async=!0),e.hasOwnProperty("isDebug")||(t.isDebug=!1),e.baseUrl||(t.baseUrl=Gk.baseUrl),(i=Gk.packages)==null||i.forEach(s=>{var r;xQ((r=t.packages)!=null?r:[],s)}),t}class MQ{constructor(){const t=document.createDocumentFragment();["addEventListener","dispatchEvent","removeEventListener"].forEach(i=>{this[i]=(...s)=>t[i](...s)})}}class zg{constructor(){this._dispatcher=new MQ,this._workerPostMessage({type:li.HANDSHAKE})}terminate(){}get onmessage(){return this._onmessageHandler}set onmessage(t){this._onmessageHandler&&this.removeEventListener("message",this._onmessageHandler),this._onmessageHandler=t,t&&this.addEventListener("message",t)}get onmessageerror(){return this._onmessageerrorHandler}set onmessageerror(t){this._onmessageerrorHandler&&this.removeEventListener("messageerror",this._onmessageerrorHandler),this._onmessageerrorHandler=t,t&&this.addEventListener("messageerror",t)}get onerror(){return this._onerrorHandler}set onerror(t){this._onerrorHandler&&this.removeEventListener("error",this._onerrorHandler),this._onerrorHandler=t,t&&this.addEventListener("error",t)}postMessage(t){U0(()=>{this._workerMessageHandler(new MessageEvent("message",{data:t}))})}dispatchEvent(t){return this._dispatcher.dispatchEvent(t)}addEventListener(t,i,s){this._dispatcher.addEventListener(t,i,s)}removeEventListener(t,i,s){this._dispatcher.removeEventListener(t,i,s)}_workerPostMessage(t){U0(()=>{this.dispatchEvent(new MessageEvent("message",{data:t}))})}async _workerMessageHandler(t){const i=rm(t);if(i&&i.type===li.OPEN){const{modulePath:s,jobId:r}=i;let n=await ss.loadWorker(s);n||(n=await z(()=>import(s),[]));const o=ss.connect(n);this._workerPostMessage({type:li.OPENED,jobId:r,data:o})}}}const bS=q.getLogger("esri.core.workers.workerFactory"),{HANDSHAKE:$Q}=li,TQ='let globalId=0;const outgoing=new Map,configuration=JSON.parse("{CONFIGURATION}");self.esriConfig=configuration.esriConfig;const workerPath=self.esriConfig.workers.workerPath,HANDSHAKE=0,OPEN=1,OPENED=2,RESPONSE=3,INVOKE=4,ABORT=5;function createAbortError(){const e=new Error("Aborted");return e.name="AbortError",e}function receiveMessage(e){return e&&e.data?"string"==typeof e.data?JSON.parse(e.data):e.data:null}function invokeStaticMessage(e,o,r){const t=r&&r.signal,n=globalId++;return new Promise(((r,i)=>{if(t){if(t.aborted)return i(createAbortError());t.addEventListener("abort",(()=>{outgoing.get(n)&&(outgoing.delete(n),self.postMessage({type:5,jobId:n}),i(createAbortError()))}))}outgoing.set(n,{resolve:r,reject:i}),self.postMessage({type:4,jobId:n,methodName:e,abortable:null!=t,data:o})}))}let workerRevisionChecked=!1;function checkWorkerRevision(e){if(!workerRevisionChecked&&e.kernelInfo){workerRevisionChecked=!0;const{revision:o,version:r}=configuration.kernelInfo,{revision:t,version:n}=e.kernelInfo;esriConfig.assetsPath!==esriConfig.defaultAssetsPath&&o!==t&&console.warn(`Version mismatch detected between ArcGIS API for JavaScript modules and assets. For more information visit https://bit.ly/3QnsuSo.\\nModules version: ${r}\\nAssets version: ${n}`)}}function messageHandler(e){const o=receiveMessage(e);if(!o)return;const r=o.jobId;switch(o.type){case 1:let n;function t(e){const o=n.connect(e);self.postMessage({type:2,jobId:r,data:o},[o])}"function"==typeof define&&define.amd?require([workerPath],(e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||new Promise((e=>{require([o.modulePath],e)})))).then(t)})):"System"in self&&"function"==typeof System.import?System.import(workerPath).then((e=>(n=e.default,checkWorkerRevision(n),n.loadWorker(o.modulePath)))).then((e=>e||System.import(o.modulePath))).then(t):esriConfig.workers.useDynamicImport?import(workerPath).then((e=>{n=e.default||e,checkWorkerRevision(n),n.loadWorker(o.modulePath).then((e=>e||import(o.modulePath))).then(t)})):(self.RemoteClient||importScripts(workerPath),n=self.RemoteClient.default||self.RemoteClient,checkWorkerRevision(n),n.loadWorker(o.modulePath).then(t));break;case 3:if(outgoing.has(r)){const i=outgoing.get(r);outgoing.delete(r),o.error?i.reject(JSON.parse(o.error)):i.resolve(o.data)}}}self.dojoConfig=configuration.loaderConfig,esriConfig.workers.loaderUrl&&(self.importScripts(esriConfig.workers.loaderUrl),"function"==typeof require&&"function"==typeof require.config&&require.config(configuration.loaderConfig)),self.addEventListener("message",messageHandler),self.postMessage({type:0});';let My,$y;const Wk="Failed to create Worker. Fallback to execute module in main thread";async function IQ(){if(!V("esri-workers")||(V("mozilla"),0))return Hk(new zg);if(!My&&!$y)try{const t=TQ.split('"{CONFIGURATION}"').join(`'${EQ()}'`);My=URL.createObjectURL(new Blob([t],{type:"text/javascript"}))}catch(t){$y=t||{}}let e;if(My)try{e=new Worker(My,{name:"esri-worker-"+kQ++})}catch{bS.warn(Wk,$y),e=new zg}else bS.warn(Wk,$y),e=new zg;return Hk(e)}async function Hk(e){return new Promise(t=>{function i(r){const n=rm(r);n&&n.type===$Q&&(e.removeEventListener("message",i),e.removeEventListener("error",s),t(e))}function s(r){r.preventDefault(),e.removeEventListener("message",i),e.removeEventListener("error",s),bS.warn("Failed to create Worker. Fallback to execute module in main thread",r),(e=new zg).addEventListener("message",i),e.addEventListener("error",s)}e.addEventListener("message",i),e.addEventListener("error",s)})}function EQ(){let e;if(je.default!=null){const r={...je};delete r.default,e=JSON.parse(JSON.stringify(r))}else e=JSON.parse(JSON.stringify(je));e.assetsPath=Js(e.assetsPath),e.defaultAssetsPath=e.defaultAssetsPath?Js(e.defaultAssetsPath):void 0,e.request.interceptors=[],e.log.interceptors=[],e.locale=Rr(),e.has={"esri-csp-restrictions":V("esri-csp-restrictions"),"esri-2d-debug":!1,"esri-2d-update-debug":V("esri-2d-update-debug"),"featurelayer-pbf":V("featurelayer-pbf"),"featurelayer-simplify-thresholds":V("featurelayer-simplify-thresholds"),"featurelayer-simplify-payload-size-factors":V("featurelayer-simplify-payload-size-factors"),"featurelayer-simplify-mobile-factor":V("featurelayer-simplify-mobile-factor"),"esri-atomics":V("esri-atomics"),"esri-shared-array-buffer":V("esri-shared-array-buffer"),"esri-tiles-debug":V("esri-tiles-debug"),"esri-workers-arraybuffer-transfer":V("esri-workers-arraybuffer-transfer"),"feature-polyline-generalization-factor":V("feature-polyline-generalization-factor"),"host-webworker":1,"polylabel-placement-enabled":V("polylabel-placement-enabled")},e.workers.loaderUrl&&(e.workers.loaderUrl=Js(e.workers.loaderUrl)),e.workers.workerPath?e.workers.workerPath=Js(e.workers.workerPath):e.workers.workerPath=Js(Ne("esri/core/workers/RemoteClient.js")),e.workers.useDynamicImport=!1;const t=je.workers.loaderConfig,i=SQ({baseUrl:t==null?void 0:t.baseUrl,locale:Rr(),has:{"csp-restrictions":1,"dojo-test-sniff":0,"host-webworker":1,...t==null?void 0:t.has},map:{...t==null?void 0:t.map},paths:{...t==null?void 0:t.paths},packages:(t==null?void 0:t.packages)||[]}),s={version:TR,buildDate:MR,revision:$R};return JSON.stringify({esriConfig:e,loaderConfig:i,kernelInfo:s})}let kQ=0;const{ABORT:Yk,INVOKE:CQ,OPEN:PQ,OPENED:AQ,RESPONSE:Dd}=li;class hT{constructor(t,i){this._outJobs=new Map,this._inJobs=new Map,this.worker=t,this.id=i,t.addEventListener("message",this._onMessage.bind(this)),t.addEventListener("error",s=>{s.preventDefault(),q.getLogger("esri.core.workers.WorkerOwner").error(s)})}static async create(t){const i=await IQ();return new hT(i,t)}terminate(){this.worker.terminate()}async open(t,i={}){const{signal:s}=i,r=AN();return new Promise((n,o)=>{const a={resolve:n,reject:o,abortHandle:JM(s,()=>{this._outJobs.delete(r),this._post({type:Yk,jobId:r})})};this._outJobs.set(r,a),this._post({type:PQ,jobId:r,modulePath:t})})}_onMessage(t){const i=rm(t);if(i)switch(i.type){case AQ:this._onOpenedMessage(i);break;case Dd:this._onResponseMessage(i);break;case Yk:this._onAbortMessage(i);break;case CQ:this._onInvokeMessage(i)}}_onAbortMessage(t){const i=this._inJobs,s=t.jobId,r=i.get(s);r&&(r.controller&&r.controller.abort(),i.delete(s))}_onInvokeMessage(t){const{methodName:i,jobId:s,data:r,abortable:n}=t,o=n?new AbortController:null,a=this._inJobs,l=Jz[i];let u;try{if(typeof l!="function")throw new TypeError(`${i} is not a function`);u=l.call(null,r,{signal:o?o.signal:null})}catch(d){return void this._post({type:Dd,jobId:s,error:sm(d)})}No(u)?(a.set(s,{controller:o,promise:u}),u.then(d=>{a.has(s)&&(a.delete(s),this._post({type:Dd,jobId:s},d))},d=>{a.has(s)&&(a.delete(s),d||(d={message:"Error encountered at method"+i}),Ks(d)||this._post({type:Dd,jobId:s,error:sm(d||{message:`Error encountered at method ${i}`})}))})):this._post({type:Dd,jobId:s},u)}_onOpenedMessage(t){const{jobId:i,data:s}=t,r=this._outJobs.get(i);r&&(this._outJobs.delete(i),Bt(r.abortHandle),r.resolve(s))}_onResponseMessage(t){const{jobId:i,error:s,data:r}=t,n=this._outJobs.get(i);n&&(this._outJobs.delete(i),Bt(n.abortHandle),s?n.reject(L.fromJSON(JSON.parse(s))):n.resolve(r))}_post(t,i,s){return uT(this.worker,t,i,s)}}let Oc=V("esri-workers-debug")?1:V("esri-mobile")?Math.min(navigator.hardwareConcurrency-1,3):V("host-browser")?navigator.hardwareConcurrency-1:0;Oc||(Oc=V("safari")&&V("mac")||V("trident")?7:2);let Jk=0;const Bg=[];function OQ(){ON()}async function Ty(e,t){const i=new wQ;return await i.open(e,t),i}async function RQ(e,t={}){if(typeof e!="string")throw new L("workers:undefined-module","modulePath is missing");let i=t.strategy||"distributed";if(V("host-webworker")&&!V("esri-workers")&&(i="local"),i==="local"){let s=await ss.loadWorker(e);s||(s=await z(()=>import(e),[])),Ft(t.signal);const r=t.client||s;return Ty([ss.connect(s)],{...t,client:r})}if(await ON(),Ft(t.signal),i==="dedicated"){const s=Jk++%Oc;return Ty([await Bg[s].open(e,t)],t)}if(t.maxNumWorkers&&t.maxNumWorkers>0){const s=Math.min(t.maxNumWorkers,Oc);if(ss.open(e,t)),t)}let Iy=null;async function ON(){if(Iy)return Iy;new AbortController;const e=[];for(let t=0;t(Bg[t]=s,s));e.push(i)}return Iy=Promise.all(e),Iy}var _S;let on=_S=class extends W{constructor(e){super(e),this.cols=null,this.level=0,this.levelValue=null,this.origin=null,this.resolution=0,this.rows=null,this.scale=0}clone(){return new _S({cols:this.cols,level:this.level,levelValue:this.levelValue,resolution:this.resolution,rows:this.rows,scale:this.scale})}};c([h({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],on.prototype,"cols",void 0),c([h({type:Ge,json:{write:!0}})],on.prototype,"level",void 0),c([h({type:String,json:{write:!0}})],on.prototype,"levelValue",void 0),c([h({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],on.prototype,"origin",void 0),c([h({type:Number,json:{write:!0}})],on.prototype,"resolution",void 0),c([h({json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],on.prototype,"rows",void 0),c([h({type:Number,json:{write:!0}})],on.prototype,"scale",void 0),on=_S=c([S("esri.layers.support.LOD")],on);const dT=on;class LQ{constructor(t,i,s,r,n){this.id=t,this.level=i,this.row=s,this.col=r,this.extent=n}}var ya;const Xk=new Ie({PNG:"png",PNG8:"png8",PNG24:"png24",PNG32:"png32",JPEG:"jpg",JPG:"jpg",DIB:"dib",TIFF:"tiff",EMF:"emf",PS:"ps",PDF:"pdf",GIF:"gif",SVG:"svg",SVGZ:"svgz",Mixed:"mixed",MIXED:"mixed",LERC:"lerc",LERC2D:"lerc2d",RAW:"raw",pbf:"pbf"});let Ht=ya=class extends W{constructor(e){super(e),this.dpi=96,this.format=null,this.origin=null,this.minScale=0,this.maxScale=0,this.size=null,this.spatialReference=null}static create(e={}){const{resolutionFactor:t=1,scales:i,size:s=256,spatialReference:r=xe.WebMercator,numLODs:n=24}=e;if(!ci(r)){const f=[];if(i)for(let m=0;m=0;y--)f.unshift({level:y,scale:m,resolution:m}),m*=2}return new ya({dpi:96,lods:f,origin:new be(0,0,r),size:[s,s],spatialReference:r})}const o=Dr(r),a=e.origin?new be({x:e.origin.x,y:e.origin.y,spatialReference:r}):new be(o?{x:o.origin[0],y:o.origin[1],spatialReference:r}:{x:0,y:0,spatialReference:r}),l=96,u=1/(Pm(r)*39.37*l),d=[];if(i)for(let f=0;f{s.push(n.scale),t=n.scale>t?n.scale:t,i=n.scale=t.length-1)return t[t.length-1];const i=Math.floor(e),s=i+1;return t[i]/(t[i]/t[s])**(e-i)}scaleToZoom(e){const t=this.scales,i=t.length-1;let s=0;for(;se&&n=t?this.zoomToScale(Math.ceil(i)):this.zoomToScale(Math.floor(i))}tileAt(e,t,i,s){const r=this.lodAt(e);if(!r)return null;let n,o;if(typeof t=="number")n=t,o=i;else if(Kt(t.spatialReference,this.spatialReference))n=t.x,o=t.y,s=i;else{const u=bb(t,this.spatialReference);if(N(u))return null;n=u.x,o=u.y,s=i}const a=r.resolution*this.size[0],l=r.resolution*this.size[1];return s||(s=new LQ(null,0,0,0,nl())),s.level=e,s.row=Math.floor((this.origin.y-o)/l+.001),s.col=Math.floor((n-this.origin.x)/a+.001),this.updateTileInfo(s),s}updateTileInfo(e,t=ya.ExtrapolateOptions.NONE){let i=this.lodAt(e.level);if(!i&&t===ya.ExtrapolateOptions.POWER_OF_TWO){const o=this.lods[this.lods.length-1];o.levelArray.isArray(e)?e:typeof e=="number"?[e,e]:[256,256]})],Ht.prototype,"size",void 0),c([Q("size",["rows","cols"])],Ht.prototype,"readSize",null),c([ie("size",{cols:{type:Ge},rows:{type:Ge}})],Ht.prototype,"writeSize",null),c([h({type:xe,json:{write:!0}})],Ht.prototype,"spatialReference",void 0),Ht=ya=c([S("esri.layers.support.TileInfo")],Ht),function(e){var t;(t=e.ExtrapolateOptions||(e.ExtrapolateOptions={}))[t.NONE=0]="NONE",t[t.POWER_OF_TWO=1]="POWER_OF_TWO"}(Ht||(Ht={}));const FQ=Ht,Ug={widthBreakpoint:{getValue(e){const t=e.viewSize[0],i=e.breakpoints,s=this.values;return t<=i.xsmall?s.xsmall:t<=i.small?s.small:t<=i.medium?s.medium:t<=i.large?s.large:s.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-width-xsmall esri-view-width-less-than-small esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",small:"esri-view-width-small esri-view-width-greater-than-xsmall esri-view-width-less-than-medium esri-view-width-less-than-large esri-view-width-less-than-xlarge",medium:"esri-view-width-medium esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-less-than-large esri-view-width-less-than-xlarge",large:"esri-view-width-large esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-less-than-xlarge",xlarge:"esri-view-width-xlarge esri-view-width-greater-than-xsmall esri-view-width-greater-than-small esri-view-width-greater-than-medium esri-view-width-greater-than-large"}},heightBreakpoint:{getValue(e){const t=e.viewSize[1],i=e.breakpoints,s=this.values;return t<=i.xsmall?s.xsmall:t<=i.small?s.small:t<=i.medium?s.medium:t<=i.large?s.large:s.xlarge},values:{xsmall:"xsmall",small:"small",medium:"medium",large:"large",xlarge:"xlarge"},valueToClassName:{xsmall:"esri-view-height-xsmall esri-view-height-less-than-small esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",small:"esri-view-height-small esri-view-height-greater-than-xsmall esri-view-height-less-than-medium esri-view-height-less-than-large esri-view-height-less-than-xlarge",medium:"esri-view-height-medium esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-less-than-large esri-view-height-less-than-xlarge",large:"esri-view-height-large esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-less-than-xlarge",xlarge:"esri-view-height-xlarge esri-view-height-greater-than-xsmall esri-view-height-greater-than-small esri-view-height-greater-than-medium esri-view-height-greater-than-large"}},orientation:{getValue(e){const t=e.viewSize,i=t[0],s=t[1],r=this.values;return s>=i?r.portrait:r.landscape},values:{portrait:"portrait",landscape:"landscape"},valueToClassName:{portrait:"esri-view-orientation-portrait",landscape:"esri-view-orientation-landscape"}}},Y_={xsmall:544,small:768,medium:992,large:1200};function DQ(e){const t=e;return t&&t.xsmall{let t=class extends e{constructor(...i){super(...i),this._breakpointsHandles=new qi,this.orientation=null,this.widthBreakpoint=null,this.heightBreakpoint=null,this.breakpoints=Y_}initialize(){this._breakpointsHandles.add(Z(()=>[this.breakpoints,this.size],()=>this._updateClassNames(),Le))}destroy(){this.destroyed||(this._removeActiveClassNames(),this._breakpointsHandles=$t(this._breakpointsHandles))}set breakpoints(i){if(i===this._get("breakpoints"))return;const s=DQ(i);if(!s){const r=JSON.stringify(Y_,null,2);console.warn("provided breakpoints are not valid, using defaults:"+r)}i=s?i:Y_,this._set("breakpoints",{...i})}_updateClassNames(){if(!this.container)return;const i=Vi.acquire(),s=Vi.acquire();let r,n=!1;for(r in Ug){const o=this[r],a=Ug[r].getValue({viewSize:this.size,breakpoints:this.breakpoints});o!==a&&(n=!0,this[r]=a,J_(r,o).forEach(l=>s.push(l)),J_(r,a).forEach(l=>i.push(l)))}n&&(this._applyClassNameChanges(i,s),Vi.release(i),Vi.release(s))}_applyClassNameChanges(i,s){const r=this.container;r&&(s.forEach(n=>r.classList.remove(n)),i.forEach(n=>r.classList.add(n)))}_removeActiveClassNames(){const i=this.container;if(!i)return;let s;for(s in Ug)J_(s,this[s]).forEach(r=>i.classList.remove(r))}};return c([h()],t.prototype,"breakpoints",null),c([h()],t.prototype,"orientation",void 0),c([h()],t.prototype,"widthBreakpoint",void 0),c([h()],t.prototype,"heightBreakpoint",void 0),t=c([S("esri.views.BreakpointsOwner")],t),t};let ga=class extends oe{constructor(){super(...arguments),this.items=new he,this._watchUpdatingTracking=new kh,this._callbacks=new Map,this._projector=D1(),this._hiddenProjector=D1()}get needsRender(){return this.items.length>0}get updating(){var e,t;return(t=(e=this._watchUpdatingTracking)==null?void 0:e.updating)!=null?t:!1}initialize(){const e=document.createElement("div");e.className="esri-overlay-surface",this._set("surface",e),this._hiddenSurface=document.createElement("div"),this._hiddenSurface.setAttribute("style","visibility: hidden;"),e.appendChild(this._hiddenSurface),this._watchUpdatingTracking.addOnCollectionChange(()=>this.items,t=>{for(const i of t.added){const s=()=>i.render();this._callbacks.set(i,s),this._projector.append(this.surface,s)}for(const i of t.removed){const s=this._projector.detach(this._callbacks.get(i));this.surface.removeChild(s.domNode),this._callbacks.delete(i)}})}addItem(e){this.items.add(e)}removeItem(e){this.items.remove(e)}destroy(){this.items.removeAll(),this._callbacks.forEach(e=>this._projector.detach(e)),this._callbacks=null,this._projector=null,this._watchUpdatingTracking.destroy()}render(){this._projector.renderNow()}computeBoundingRect(e){const t=this._hiddenSurface,i=this._hiddenProjector;let s=null;const r=()=>(s=e.render(),s);i.append(t,r),i.renderNow();const n={left:0,top:0,right:0,bottom:0};if(s&&s.domNode){const o=s.domNode.getBoundingClientRect();n.left=o.left,n.top=o.top,n.right=o.right,n.bottom=o.bottom}for(i.detach(r);t.firstChild;)t.removeChild(t.firstChild);return n}overlaps(e,t){const i=this.computeBoundingRect(e),s=this.computeBoundingRect(t);return Math.max(i.left,s.left)<=Math.min(i.right,s.right)&&Math.max(i.top,s.top)<=Math.min(i.bottom,s.bottom)}get hasVisibleItems(){return this.items.some(e=>e.visible)}async prepare(){await document.fonts.load(this._fontString()).catch(()=>{})}renderCanvas(e){if(!this.items.some(i=>i.visible))return;const t=e.getContext("2d");t.save(),t.font=this._fontString(),this.items.forEach(i=>{t.save(),i.renderCanvas(t),t.restore()}),t.restore()}_fontString(){return`10px ${getComputedStyle(this.surface).fontFamily}`}};c([h({readOnly:!0})],ga.prototype,"surface",void 0),c([h({readOnly:!0})],ga.prototype,"items",void 0),c([h({readOnly:!0})],ga.prototype,"needsRender",null),c([h({readOnly:!0})],ga.prototype,"_watchUpdatingTracking",void 0),c([h({readOnly:!0})],ga.prototype,"updating",null),ga=c([S("esri.views.overlay.ViewOverlay")],ga);const Zk=ga;function Ch(e,t,i,s){let r=null,n=1e3;typeof t=="number"?(n=t,s=i):(r=t!=null?t:null,n=i);let o,a=0;const l=()=>{a=0,e.apply(s,o)},u=(...d)=>{r&&r.apply(s,d),o=d,n?a||(a=setTimeout(l,n)):l()};return u.remove=()=>{a&&(clearTimeout(a),a=0)},u.forceUpdate=()=>{a&&(clearTimeout(a),l())},u.hasPendingUpdates=()=>!!a,u}function RN(e){return 32+e.length}function LN(e){return 16}function i_e(e){if(!e)return 0;let t=DN;for(const i in e)if(e.hasOwnProperty(i)){const s=e[i];switch(typeof s){case"string":t+=RN(s);break;case"number":t+=LN();break;case"boolean":t+=4}}return t}function jQ(e){if(!e)return 0;if(Array.isArray(e))return VQ(e);let t=DN;for(const i in e)e.hasOwnProperty(i)&&(t+=FN(e[i]));return t}function VQ(e){const t=e.length;if(t===0||typeof e[0]=="number")return 32+8*t;let i=NN;for(let s=0;sn.name===i);return r?UQ({tagName:s,tags:r.tags}):null}function UQ(e){const{tagName:t,tags:i}=e;if(!i||!t)return null;const s=i.find(r=>r.name===t);return s&&s.value||null}var wS;const qQ={1:{id:1,rotation:0,mirrored:!1},2:{id:2,rotation:0,mirrored:!0},3:{id:3,rotation:180,mirrored:!1},4:{id:4,rotation:180,mirrored:!0},5:{id:5,rotation:-90,mirrored:!0},6:{id:6,rotation:90,mirrored:!1},7:{id:7,rotation:90,mirrored:!0},8:{id:8,rotation:-90,mirrored:!1}};let Yi=wS=class extends W{constructor(e){super(e),this.contentType=null,this.exifInfo=null,this.id=null,this.globalId=null,this.keywords=null,this.name=null,this.parentGlobalId=null,this.parentObjectId=null,this.size=null,this.url=null}get orientationInfo(){const{exifInfo:e}=this,t=BQ({exifName:"Exif IFD0",tagName:"Orientation",exifInfo:e});return qQ[t]||null}clone(){return new wS({contentType:this.contentType,exifInfo:this.exifInfo,id:this.id,globalId:this.globalId,keywords:this.keywords,name:this.name,parentGlobalId:this.parentGlobalId,parentObjectId:this.parentObjectId,size:this.size,url:this.url})}};c([h({type:String})],Yi.prototype,"contentType",void 0),c([h()],Yi.prototype,"exifInfo",void 0),c([h({readOnly:!0})],Yi.prototype,"orientationInfo",null),c([h({type:Ge})],Yi.prototype,"id",void 0),c([h({type:String})],Yi.prototype,"globalId",void 0),c([h({type:String})],Yi.prototype,"keywords",void 0),c([h({type:String})],Yi.prototype,"name",void 0),c([h({json:{read:!1}})],Yi.prototype,"parentGlobalId",void 0),c([h({json:{read:!1}})],Yi.prototype,"parentObjectId",void 0),c([h({type:Ge})],Yi.prototype,"size",void 0),c([h({json:{read:!1}})],Yi.prototype,"url",void 0),Yi=wS=c([S("esri.layers.support.AttachmentInfo")],Yi);const GQ=Yi;var xS;let ri=xS=class extends W{constructor(e){super(e),this.attachmentTypes=null,this.attachmentsWhere=null,this.cacheHint=void 0,this.keywords=null,this.globalIds=null,this.name=null,this.num=null,this.objectIds=null,this.returnMetadata=!1,this.size=null,this.start=null,this.where=null}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10}clone(){return new xS(R({attachmentTypes:this.attachmentTypes,attachmentsWhere:this.attachmentsWhere,cacheHint:this.cacheHint,keywords:this.keywords,where:this.where,globalIds:this.globalIds,name:this.name,num:this.num,objectIds:this.objectIds,returnMetadata:this.returnMetadata,size:this.size,start:this.start}))}};c([h({type:[String],json:{write:!0}})],ri.prototype,"attachmentTypes",void 0),c([h({type:String,json:{read:{source:"attachmentsDefinitionExpression"},write:{target:"attachmentsDefinitionExpression"}}})],ri.prototype,"attachmentsWhere",void 0),c([h({type:Boolean,json:{write:!0}})],ri.prototype,"cacheHint",void 0),c([h({type:[String],json:{write:!0}})],ri.prototype,"keywords",void 0),c([h({type:[Number],json:{write:!0}})],ri.prototype,"globalIds",void 0),c([h({json:{write:!0}})],ri.prototype,"name",void 0),c([h({type:Number,json:{read:{source:"resultRecordCount"}}})],ri.prototype,"num",void 0),c([h({type:[Number],json:{write:!0}})],ri.prototype,"objectIds",void 0),c([h({type:Boolean,json:{default:!1,write:!0}})],ri.prototype,"returnMetadata",void 0),c([h({type:[Number],json:{write:!0}})],ri.prototype,"size",void 0),c([h({type:Number,json:{read:{source:"resultOffset"}}})],ri.prototype,"start",void 0),c([ie("start"),ie("num")],ri.prototype,"writeStart",null),c([h({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],ri.prototype,"where",void 0),ri=xS=c([S("esri.rest.support.AttachmentQuery")],ri),ri.from=Dt(ri);const SS=ri,WQ="esri.widgets.Feature.support.featureUtils",Kk=q.getLogger(WQ),HQ=/href=(""|'')/gi,YQ=/(\{([^\{\r\n]+)\})/g,JQ=/\'/g,jN=/^\s*expression\//i,XQ=/(\n)/gi,ZQ=/[\u00A0-\u9999<>\&]/gim,QQ=/href\s*=\s*(?:\"([^\"]+)\"|\'([^\']+)\')/gi,KQ=/^(?:mailto:|tel:)/,VN="relationships/",MS=HM("short-date-short-time");function zN(e){if(!N(e))return e.get("sourceLayer")||e.get("layer")}async function Mv(e,t){return typeof e=="function"?e.call(null,t):e}function BN(e=""){if(e)return!KQ.test(e.trim().toLowerCase())}function pT(e){return!!e&&jN.test(e)}function eK(e,t){if(!pT(t)||!e)return null;const i=t.replace(jN,"").toLowerCase();let s;return e.some(r=>r.name.toLowerCase()===i&&(s=r,!0)),s}function UN(e,t){const i=eK(t,e==null?void 0:e.fieldName);return i?i.title||null:e?e.label||e.fieldName:null}function tK(e,t){const i=t.get(e.toLowerCase());return`{${i&&i.fieldName||e}}`}function iK(e){return e.replace(HQ,"")}function nm(e,t){const i=fT(t,e);return i?i.name:e}function sK(e,t){return e&&e.map(i=>nm(i,t))}function fT(e,t){return e&&typeof e.getField=="function"?e.getField(t):null}function qN(e){return`${e}`.trim()}function Rc({attributes:e,globalAttributes:t,layer:i,text:s,expressionAttributes:r,fieldInfoMap:n}){return s?$S({formattedAttributes:t,template:aK(s,{...t,...r,...e},i),fieldInfoMap:n}):""}function $S({formattedAttributes:e,template:t,fieldInfoMap:i}){return qN(iK(In(In(t,s=>tK(s,i)),e)))}function rK(e,t,i=!1){const s=t[e];if(typeof s=="string"){const r="%27",n=(i?encodeURIComponent(s):s).replace(JQ,r);t[e]=n}}function nK(e,t=!1){const i={...e};return Object.keys(i).forEach(s=>rK(s,i,t)),i}function oK(e,t,i){const s=(t=qN(t))&&t[0]!=="{";return In(e,nK(i,s))}function TS(e,t){return e.replace(YQ,(i,s,r)=>{const n=fT(t,r);return n?`{${n.name}}`:s})}function aK(e,t,i){const s=TS(e,i);return s&&s.replace(QQ,(r,n,o)=>oK(r,n||o,t))}function lK(e,t){if(typeof e=="string"&&t&&t.dateFormat==null&&(t.places!=null||t.digitSeparator!=null)){const i=Number(e);if(!isNaN(i))return i}return e}function cK(e){return(e==null?void 0:e.type)==="feature"}function eC(e){return!!(e!=null&&e.layer)}function uK(e){return(e==null?void 0:e.type)==="map-image"}function hK(e,t){var u;const i=t.fieldInfos,s=t.fieldName,r=(u=GN(i,s))==null?void 0:u.clone(),n=t.preventPlacesFormatting,o=t.layer,a=fT(o,s);if(r&&(a==null?void 0:a.type)==="date"){const d=r.format||new fh;d.dateFormat=d.dateFormat||"short-date-short-time",d.dateTimeFormatOptions=!eC(o)&&cK(o)&&o.datesInUnknownTimezone||eC(o)&&uK(o.layer)&&o.layer.datesInUnknownTimezone?{timeZone:"UTC"}:null,r.format=d}const l=r&&r.format;return typeof e=="string"&&jD(s)&&l?l.formatRasterPixelValue(e):typeof(e=lK(e,l))=="string"||e==null||l==null?Um(e):n?sl(e,{...nR(l),minimumFractionDigits:0,maximumFractionDigits:20}):l.format(e)}function GN(e,t){if(!e||!e.length||!t)return;const i=t.toLowerCase();let s;return e.some(r=>!(!r.fieldName||r.fieldName.toLowerCase()!==i)&&(s=r,!0)),s}function dK({fieldName:e,graphic:t,layer:i}){if(xo(e)||!i||typeof i.getFeatureType!="function")return null;const{typeIdField:s}=i;if(!s||e!==s)return null;const r=i.getFeatureType(t);return r?r.name:null}function pK({fieldName:e,value:t,graphic:i,layer:s}){if(xo(e)||!s||typeof s.getFieldDomain!="function")return null;const r=s.getFieldDomain(e,{feature:i});return r&&r.type==="coded-value"?r.getName(t):null}function fK(e,t){const{creatorField:i,creationDateField:s,editorField:r,editDateField:n}=e;if(!t)return;const o=t[n];if(typeof o=="number"){const l=t[r];return{type:"edit",date:Po(o,MS),user:l}}const a=t[s];if(typeof a=="number"){const l=t[i];return{type:"create",date:Po(a,MS),user:l}}return null}function mK(e,t){const i=new Map;return e&&e.forEach(s=>{const r=nm(s.fieldName,t);s.fieldName=r,i.set(r.toLowerCase(),s)}),i}function tC(e){const t=[];if(!e)return t;const{fieldInfos:i,content:s}=e;return i&&t.push(...i),s&&Array.isArray(s)&&s.forEach(r=>{if(r.type==="fields"){const n=r&&r.fieldInfos;n&&t.push(...n)}}),t}function mT(e){return e.replace(ZQ,t=>`&#${t.charCodeAt(0)};`)}function Um(e){return typeof e=="string"?e.replace(XQ,'
'):e}function WN(e){const{value:t,fieldName:i,fieldInfos:s,fieldInfoMap:r,layer:n,graphic:o}=e;if(t==null)return"";const a=pK({fieldName:i,value:t,graphic:o,layer:n});if(a)return a;const l=dK({fieldName:i,graphic:o,layer:n});if(l)return l;if(r.get(i.toLowerCase()))return hK(t,{fieldInfos:s||Array.from(r.values()),fieldName:i,layer:n});const u=n&&n.fieldsIndex;return u&&u.isDateField(i)?Po(t,MS):Um(t)}function X_({fieldInfos:e,attributes:t,layer:i,graphic:s,fieldInfoMap:r,relatedInfos:n}){const o={};return n==null||n.forEach(a=>_K({attributes:o,relatedInfo:a,fieldInfoMap:r,fieldInfos:e,layer:i})),Object.keys(t).forEach(a=>{const l=t[a];o[a]=WN({fieldName:a,fieldInfos:e,fieldInfoMap:r,layer:i,value:l,graphic:s})}),o}async function yK(e,t){var d,f;const{layer:i,graphic:s,outFields:r,objectIds:n,returnGeometry:o,spatialReference:a}=e,l=n[0];if(typeof l!="number"&&typeof l!="string"){const m="Could not query required fields for the specified feature. The feature's ID is invalid.",y={layer:i,graphic:s,objectId:l,requiredFields:r};return Kk.warn(m,y),null}if(!((f=(d=i.capabilities)==null?void 0:d.operations)!=null&&f.supportsQuery)){const m="The specified layer cannot be queried. The following fields will not be available.",y={layer:i,graphic:s,requiredFields:r,returnGeometry:o};return Kk.warn(m,y),null}const u=i.createQuery();return u.objectIds=n,u.outFields=r!=null&&r.length?r:[i.objectIdField],u.returnGeometry=!!o,u.returnZ=!!o,u.returnM=!!o,u.outSpatialReference=a,(await i.queryFeatures(u,t)).features[0]}async function gK(e){var s;if(!((s=e.expressionInfos)!=null&&s.length))return!1;const t=await Do(),{arcadeUtils:{hasGeometryFunctions:i}}=t;return i(e)}async function vK({graphic:e,popupTemplate:t,layer:i,spatialReference:s},r){if(!i||!t||(typeof i.load=="function"&&await i.load(r),!e.attributes))return;const n=e.attributes[i.objectIdField];if(n==null)return;const o=[n],a=await t.getRequiredFields(i.fieldsIndex),l=JX(a,e),u=l?[]:a,d=t.returnGeometry||await gK(t);if(l&&!d)return;const f=await yK({layer:i,graphic:e,outFields:u,objectIds:o,returnGeometry:d,spatialReference:s},r);f&&(f.geometry&&(e.geometry=f.geometry),f.attributes&&(e.attributes={...e.attributes,...f.attributes}))}function xo(e=""){return!!e&&e.includes(VN)}function bK(e){return e?`${VN}${e.layerId}/${e.fieldName}`:""}function iC({attributes:e,graphic:t,relatedInfo:i,fieldInfos:s,fieldInfoMap:r,layer:n}){e&&t&&i&&Object.keys(t.attributes).forEach(o=>{const a=bK({layerId:i.relation.id.toString(),fieldName:o}),l=t.attributes[o];e[a]=WN({fieldName:a,fieldInfos:s,fieldInfoMap:r,layer:n,value:l,graphic:t})})}function _K({attributes:e,relatedInfo:t,fieldInfoMap:i,fieldInfos:s,layer:r}){e&&t&&(t.relatedFeatures&&t.relatedFeatures&&t.relatedFeatures.forEach(n=>iC({attributes:e,graphic:n,relatedInfo:t,fieldInfoMap:i,fieldInfos:s,layer:r})),t.relatedStatsFeatures&&t.relatedStatsFeatures&&t.relatedStatsFeatures.forEach(n=>iC({attributes:e,graphic:n,relatedInfo:t,fieldInfoMap:i,fieldInfos:s,layer:r})))}const sC=e=>{if(!e)return!1;const t=e.toUpperCase();return t.includes("CURRENT_TIMESTAMP")||t.includes("CURRENT_DATE")||t.includes("CURRENT_TIME")},HN=({layer:e,method:t,query:i,definitionExpression:s})=>{var o,a;if(!((a=(o=e.capabilities)==null?void 0:o.query)!=null&&a.supportsCacheHint)||t==="attachments")return;const r=M(i.where)&&i.where,n=M(i.geometry)&&i.geometry;sC(s)||sC(r)||(n==null?void 0:n.type)==="extent"||i.resultType==="tile"||(i.cacheHint=!0)},wK=({query:e,layer:t,method:i})=>{HN({layer:t,method:i,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression}`})},xK=({queryPayload:e,layer:t,method:i})=>{HN({layer:t,method:i,query:e,definitionExpression:`${t.definitionExpression} ${t.serviceDefinitionExpression}`})};function SK(e,t,i){return e&&t&&i?rC(e.allLayers,t,i)||rC(e.allTables,t,i):null}function rC(e,t,i){return e.find(s=>s!==t&&s.type==="feature"&&s.url===t.url&&s.layerId===i.relatedTableId)}const nC={editing:!1,operations:{add:!0,update:!0,delete:!0}},YN=he.ofType(GQ);let Ji=class extends oe{constructor(e){super(e),this._getAttachmentsPromise=null,this._attachmentLayer=null,this.abilities={...nC},this.activeAttachmentInfo=null,this.activeFileInfo=null,this.attachmentInfos=new YN,this.fileInfos=new he,this.graphic=null,this.mode="view",this.filesEnabled=!1,this.addHandles(Z(()=>this.graphic,()=>this._graphicChanged(),Le))}destroy(){this._attachmentLayer=null,this.graphic=null}castAbilities(e){return{...nC,...e}}get state(){return this._getAttachmentsPromise?"loading":this.graphic?"ready":"disabled"}get supportsResizeAttachments(){const{graphic:e}=this;if(!e)return!1;const t=e.layer||e.sourceLayer;return(t==null?void 0:t.loaded)&&"capabilities"in t&&"operations"in t.capabilities&&"supportsResizeAttachments"in t.capabilities.operations&&t.capabilities.operations.supportsResizeAttachments||!1}async getAttachments(){const{_attachmentLayer:e,attachmentInfos:t}=this;if(!e||typeof e.queryAttachments!="function")throw new L("invalid-layer","getAttachments(): A valid layer is required.");const i=this._getObjectId(),s=new SS({objectIds:[i],returnMetadata:!0}),r=[],n=e.queryAttachments(s).then(a=>a[i]||r).catch(()=>r);this._getAttachmentsPromise=n,this.notifyChange("state");const o=await n;return t.removeAll(),o.length&&t.addMany(o),this._getAttachmentsPromise=null,this.notifyChange("state"),o}async addAttachment(e,t=this.graphic){const{_attachmentLayer:i,attachmentInfos:s,abilities:r}=this;if(!t)throw new L("invalid-graphic","addAttachment(): A valid graphic is required.",{graphic:t});if(!e)throw new L("invalid-attachment","addAttachment(): An attachment is required.",{attachment:e});if(!r.operations.add)throw new L("invalid-abilities","addAttachment(): add abilities are required.");if(!i||typeof i.addAttachment!="function")throw new L("invalid-layer","addAttachment(): A valid layer is required.");const n=i.addAttachment(t,e).then(a=>this._queryAttachment(a.objectId,t)),o=await n;return s.add(o),o}async deleteAttachment(e){const{_attachmentLayer:t,attachmentInfos:i,graphic:s,abilities:r}=this;if(!e)throw new L("invalid-attachment-info","deleteAttachment(): An attachmentInfo is required.",{attachmentInfo:e});if(!r.operations.delete)throw new L("invalid-abilities","deleteAttachment(): delete abilities are required.");if(!t||typeof t.deleteAttachments!="function")throw new L("invalid-layer","deleteAttachment(): A valid layer is required.");const n=t.deleteAttachments(s,[e.id]).then(()=>e),o=await n;return i.remove(o),o}async updateAttachment(e,t=this.activeAttachmentInfo){const{_attachmentLayer:i,attachmentInfos:s,graphic:r,abilities:n}=this;if(!e)throw new L("invalid-attachment","updateAttachment(): An attachment is required.",{attachment:e});if(!t)throw new L("invalid-attachment-info","updateAttachment(): An attachmentInfo is required.",{attachmentInfo:t});if(!n.operations.update)throw new L("invalid-abilities","updateAttachment(): Update abilities are required.");const o=s.findIndex(u=>u===t);if(!i||typeof i.updateAttachment!="function")throw new L("invalid-layer","updateAttachment(): A valid layer is required.");const a=i.updateAttachment(r,t.id,e).then(u=>this._queryAttachment(u.objectId)),l=await a;return s.splice(o,1,l),l}async commitFiles(){return await Promise.all(this.fileInfos.items.map(e=>this.addAttachment(e.form))),this.fileInfos.removeAll(),this.getAttachments()}addFile(e,t){if(!e||!t)return null;const i={file:e,form:t};return this.fileInfos.add(i),i}updateFile(e,t,i=this.activeFileInfo){if(!e||!t||!i)return null;const s=this.fileInfos.findIndex(r=>i===r);return s>-1&&this.fileInfos.splice(s,1,{file:e,form:t}),this.fileInfos.items[s]}deleteFile(e){var i;const t=this.fileInfos.find(s=>s.file===e);return(i=this.fileInfos.remove(t))!=null?i:null}async _queryAttachment(e,t){if(!e)throw new L("invalid-attachment-id","Could not query attachment.");const{_attachmentLayer:i}=this,s=this._getObjectId(t),r=new SS({objectIds:[s],attachmentsWhere:`AttachmentId=${e}`,returnMetadata:!0});return i.queryAttachments(r).then(n=>n[s][0])}_getObjectId(e=this.graphic){var t;return(t=e==null?void 0:e.getObjectId())!=null?t:null}_graphicChanged(){this.graphic&&(this._setAttachmentLayer(),this.getAttachments().catch(()=>{}))}_setAttachmentLayer(){const{graphic:e}=this,t=zN(e);this._attachmentLayer=t?t.type==="scene"&&M(t.associatedLayer)?t.associatedLayer:t:null}};c([h()],Ji.prototype,"abilities",void 0),c([Oe("abilities")],Ji.prototype,"castAbilities",null),c([h()],Ji.prototype,"activeAttachmentInfo",void 0),c([h()],Ji.prototype,"activeFileInfo",void 0),c([h({readOnly:!0,type:YN})],Ji.prototype,"attachmentInfos",void 0),c([h()],Ji.prototype,"fileInfos",void 0),c([h({type:Ci})],Ji.prototype,"graphic",void 0),c([h()],Ji.prototype,"mode",void 0),c([h({readOnly:!0})],Ji.prototype,"state",null),c([h()],Ji.prototype,"filesEnabled",void 0),c([h({readOnly:!0})],Ji.prototype,"supportsResizeAttachments",null),Ji=c([S("esri.widgets.Attachments.AttachmentsViewModel")],Ji);const yT=Ji;function oC(e){const t=e.toLowerCase();return t==="image/bmp"||t==="image/emf"||t==="image/exif"||t==="image/gif"||t==="image/x-icon"||t==="image/jpeg"||t==="image/png"||t==="image/tiff"||t==="image/x-wmf"}function MK(e){const t=Ne("esri/themes/base/images/files/");return e?e==="text/plain"?`${t}text-32.svg`:e==="application/pdf"?`${t}pdf-32.svg`:e==="text/csv"?`${t}csv-32.svg`:e==="application/gpx+xml"?`${t}gpx-32.svg`:e==="application/x-dwf"?`${t}cad-32.svg`:e==="application/postscript"||e==="application/json"||e==="text/xml"||e==="model/vrml"?`${t}code-32.svg`:e==="application/x-zip-compressed"||e==="application/x-7z-compressed"||e==="application/x-gzip"||e==="application/x-tar"||e==="application/x-gtar"||e==="application/x-bzip2"||e==="application/gzip"||e==="application/x-compress"||e==="application/x-apple-diskimage"||e==="application/x-rar-compressed"||e==="application/zip"?`${t}zip-32.svg`:e.includes("image/")?`${t}image-32.svg`:e.includes("audio/")?`${t}sound-32.svg`:e.includes("video/")?`${t}video-32.svg`:e.includes("msexcel")||e.includes("ms-excel")||e.includes("spreadsheetml")?`${t}excel-32.svg`:e.includes("msword")||e.includes("ms-word")||e.includes("wordprocessingml")?`${t}word-32.svg`:e.includes("powerpoint")||e.includes("presentationml")?`${t}report-32.svg`:`${t}generic-32.svg`:`${t}generic-32.svg`}const aC={addButton:!0,addSubmitButton:!0,cancelAddButton:!0,cancelUpdateButton:!0,deleteButton:!0,errorMessage:!0,progressBar:!0,updateButton:!0},ee={base:"esri-attachments",loaderContainer:"esri-attachments__loader-container",loader:"esri-attachments__loader",fadeIn:"esri-attachments--fade-in",container:"esri-attachments__container",containerList:"esri-attachments__container--list",containerPreview:"esri-attachments__container--preview",actions:"esri-attachments__actions",deleteButton:"esri-attachments__delete-button",addAttachmentButton:"esri-attachments__add-attachment-button",errorMessage:"esri-attachments__error-message",items:"esri-attachments__items",item:"esri-attachments__item",itemButton:"esri-attachments__item-button",itemMask:"esri-attachments__item-mask",itemMaskIcon:"esri-attachments__item-mask--icon",itemImage:"esri-attachments__image",itemImageResizable:"esri-attachments__image--resizable",itemLabel:"esri-attachments__label",itemFilename:"esri-attachments__filename",itemChevronIcon:"esri-attachments__item-chevron-icon",itemLink:"esri-attachments__item-link",itemLinkOverlay:"esri-attachments__item-link-overlay",itemLinkOverlayIcon:"esri-attachments__item-link-overlay-icon",itemEditIcon:"esri-attachments__item-edit-icon",itemAddIcon:"esri-attachments__item-add-icon",itemAddButton:"esri-attachments__item-add-button",formNode:"esri-attachments__form-node",fileFieldset:"esri-attachments__file-fieldset",fileLabel:"esri-attachments__file-label",fileName:"esri-attachments__file-name",fileInput:"esri-attachments__file-input",metadata:"esri-attachments__metadata",metadataFieldset:"esri-attachments__metadata-fieldset",progressBar:"esri-attachments__progress-bar",esriWidget:"esri-widget",esriButton:"esri-button",buttonDisabled:"esri-button--disabled",esriButtonSecondary:"esri-button--secondary",esriButtonTertiary:"esri-button--tertiary",esriButtonThird:"esri-button--third",esriButtonSmall:"esri-button--small",esriButtonHalf:"esri-button--half",empty:"esri-widget__content--empty",iconExternalLink:"esri-icon-link-external",iconEdit:"esri-icon-edit",iconRight:"esri-icon-right",iconLeft:"esri-icon-left",iconPlus:"esri-icon-plus"},Z_=window.CSS;let xi=class extends yi{constructor(e,t){super(e,t),this.displayType="auto",this.messages=null,this.messagesUnits=null,this.selectedFile=null,this.submitting=!1,this.viewModel=new yT,this.visibleElements={...aC},this._supportsImageOrientation=Z_&&Z_.supports&&Z_.supports("image-orientation","from-image"),this._addAttachmentForm=null,this._updateAttachmentForm=null}initialize(){this.addHandles([Is(()=>{var e;return(e=this.viewModel)==null?void 0:e.attachmentInfos},"change",()=>this.scheduleRender()),Is(()=>{var e;return(e=this.viewModel)==null?void 0:e.fileInfos},"change",()=>this.scheduleRender()),Z(()=>{var e;return(e=this.viewModel)==null?void 0:e.mode},()=>this._modeChanged(),Le)])}loadDependencies(){return Promise.all([z(()=>import("./calcite-icon.8b0ddff6.js"),["assets/calcite-icon.8b0ddff6.js","assets/icon.781cca93.js","assets/observers.440ad120.js"])])}get abilities(){return this.viewModel.abilities}set abilities(e){this.viewModel.abilities=e}get effectiveDisplayType(){const{displayType:e}=this;return e&&e!=="auto"?e:this.viewModel.supportsResizeAttachments?"preview":"list"}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get label(){var e,t;return(t=(e=this.messages)==null?void 0:e.widgetLabel)!=null?t:""}set label(e){this._overrideIfSome("label",e)}castVisibleElements(e){return{...aC,...e}}addAttachment(){const{_addAttachmentForm:e,viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.addAttachment(e).then(i=>(this._set("submitting",!1),this._set("error",null),t.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new L("attachments:add-attachment",this.messages.addErrorMessage,i)),i})}deleteAttachment(e){const{viewModel:t}=this;return this._set("submitting",!0),this._set("error",null),t.deleteAttachment(e).then(i=>(this._set("submitting",!1),this._set("error",null),t.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new L("attachments:delete-attachment",this.messages.deleteErrorMessage,i)),i})}updateAttachment(){const{viewModel:e}=this,{_updateAttachmentForm:t}=this;return this._set("submitting",!0),this._set("error",null),e.updateAttachment(t).then(i=>(this._set("submitting",!1),this._set("error",null),e.mode="view",i)).catch(i=>{throw this._set("submitting",!1),this._set("error",new L("attachments:update-attachment",this.messages.updateErrorMessage,i)),i})}addFile(){const e=this.viewModel.addFile(this.selectedFile,this._addAttachmentForm);return this.viewModel.mode="view",e}updateFile(){const{viewModel:e}=this,t=e.updateFile(this.selectedFile,this._updateAttachmentForm,e.activeFileInfo);return e.mode="view",t}deleteFile(e){const t=this.viewModel.deleteFile(e||this.viewModel.activeFileInfo.file);return this.viewModel.mode="view",t}render(){const{submitting:e,viewModel:t}=this,{state:i}=t;return P("div",{class:this.classes(ee.base,ee.esriWidget)},e?this.renderProgressBar():null,i==="loading"?this.renderLoading():this.renderAttachments(),this.renderErrorMessage())}renderErrorMessage(){const{error:e,visibleElements:t}=this;return e&&t.errorMessage?P("div",{key:"error-message",class:ee.errorMessage},e.message):null}renderAttachments(){const{activeFileInfo:e,mode:t,activeAttachmentInfo:i}=this.viewModel;return t==="add"?this.renderAddForm():t==="edit"?this.renderDetailsForm(i||e):this.renderAttachmentContainer()}renderLoading(){return P("div",{class:ee.loaderContainer,key:"loader"},P("div",{class:ee.loader}))}renderProgressBar(){return this.visibleElements.progressBar?P("div",{class:ee.progressBar,key:"progress-bar"}):null}renderAddForm(){const{submitting:e,selectedFile:t}=this,i=e||!t,s=this.visibleElements.cancelAddButton?P("button",{type:"button",bind:this,disabled:e,onclick:this._cancelForm,class:this.classes(ee.esriButton,ee.esriButtonTertiary,ee.esriButtonSmall,ee.esriButtonHalf,e&&ee.buttonDisabled)},this.messages.cancel):null,r=this.visibleElements.addSubmitButton?P("button",{type:"submit",disabled:i,class:this.classes(ee.esriButton,ee.esriButtonSecondary,ee.esriButtonSmall,ee.esriButtonHalf,{[ee.buttonDisabled]:i})},this.messages.add):null,n=t?P("span",{key:"file-name",class:ee.fileName},t.name):null,o=P("form",{bind:this,afterCreate:Z0,afterRemoved:SE,"data-node-ref":"_addAttachmentForm",onsubmit:this._submitAddAttachment},P("fieldset",{class:ee.fileFieldset},n,P("label",{class:this.classes(ee.fileLabel,ee.esriButton,ee.esriButtonSecondary)},t?this.messages.changeFile:this.messages.selectFile,P("input",{class:ee.fileInput,type:"file",name:"attachment",bind:this,onchange:this._handleFileInputChange}))),r,s);return P("div",{key:"add-form-container",class:ee.formNode},o)}renderDetailsForm(e){const{visibleElements:t,viewModel:i,selectedFile:s,submitting:r}=this,{abilities:n}=i,o=r||!s;let a,l,u,d;s?(a=s.type,l=s.name,u=s.size):"file"in e?(a=e.file.type,l=e.file.name,u=e.file.size):(a=e.contentType,l=e.name,u=e.size,d=e.url);const f=n.editing&&n.operations.delete&&t.deleteButton?P("button",{key:"delete-button",type:"button",disabled:r,bind:this,onclick:$=>this._submitDeleteAttachment($,e),class:this.classes(ee.esriButton,ee.esriButtonSmall,ee.esriButtonTertiary,ee.deleteButton,{[ee.buttonDisabled]:r})},this.messages.delete):void 0,m=n.editing&&n.operations.update&&t.updateButton?P("button",{disabled:o,key:"update-button",type:"submit",class:this.classes(ee.esriButton,ee.esriButtonSmall,ee.esriButtonThird,{[ee.buttonDisabled]:o})},this.messages.update):void 0,y=this.visibleElements.cancelUpdateButton?P("button",{disabled:r,key:"cancel-button",type:"button",bind:this,onclick:this._cancelForm,class:this.classes(ee.esriButton,ee.esriButtonSmall,ee.esriButtonTertiary,ee.esriButtonThird,{[ee.buttonDisabled]:r})},this.messages.cancel):void 0,g=n.editing&&n.operations.update?P("fieldset",{key:"file",class:ee.fileFieldset},P("span",{key:"file-name",class:ee.fileName},l),P("label",{class:this.classes(ee.fileLabel,ee.esriButton,ee.esriButtonSecondary)},this.messages.changeFile,P("input",{class:ee.fileInput,type:"file",name:"attachment",bind:this,onchange:this._handleFileInputChange}))):void 0,v=P("fieldset",{key:"size",class:ee.metadataFieldset},P("label",null,zQ(this.messagesUnits,u))),b=P("fieldset",{key:"content-type",class:ee.metadataFieldset},P("label",null,a)),_=M(d)?P("a",{class:ee.itemLink,href:d,rel:"noreferrer",target:"_blank"},this.renderImageMask(e,400),P("div",{class:ee.itemLinkOverlay},P("span",{class:ee.itemLinkOverlayIcon},P("calcite-icon",{icon:"launch"})))):this.renderImageMask(e,400),x=P("form",{bind:this,afterCreate:Z0,afterRemoved:SE,"data-node-ref":"_updateAttachmentForm",onsubmit:$=>this._submitUpdateAttachment($,e)},P("div",{class:ee.metadata},v,b),g,P("div",{class:ee.actions},f,y,m));return P("div",{key:"edit-form-container",class:ee.formNode},_,x)}renderImageMask(e,t){return"file"in e?this.renderGenericImageMask(e.file.name,e.file.type):this.renderImageMaskForAttachment(e,t)}renderGenericImageMask(e,t){const{supportsResizeAttachments:i}=this.viewModel,s=MK(t),r={[ee.itemImageResizable]:i};return P("div",{class:this.classes(ee.itemMaskIcon,ee.itemMask)},P("img",{title:e,alt:e,src:s,class:this.classes(r,ee.itemImage)}))}renderImageMaskForAttachment(e,t){const{supportsResizeAttachments:i}=this.viewModel,{contentType:s,name:r,url:n}=e;if(!i||!oC(s))return this.renderGenericImageMask(r,s);const o=this._getCSSTransform(e),a=o?{transform:o,"image-orientation":"none"}:{},l=`${n}${n.includes("?")?"&":"?"}w=${t}`,u={[ee.itemImageResizable]:i};return P("div",{class:this.classes(ee.itemMask)},P("img",{styles:a,alt:r,title:r,src:l,class:this.classes(u,ee.itemImage)}))}renderFile(e){const{file:t}=e;return P("li",{class:ee.item,key:t},P("button",{key:"details-button",bind:this,class:ee.itemButton,title:this.messages.attachmentDetails,"aria-label":this.messages.attachmentDetails,onclick:()=>this._startEditFile(e),type:"button"},this.renderImageMask(e),P("label",{class:ee.itemLabel},P("span",{class:ee.itemFilename},t.name||this.messages.noTitle),P("span",{"aria-hidden":"true",class:this.classes(ee.itemChevronIcon,xn(this.container)?ee.iconLeft:ee.iconRight)}))))}renderAttachmentInfo({attachmentInfo:e,displayType:t}){const{viewModel:i,effectiveDisplayType:s}=this,{abilities:r,supportsResizeAttachments:n}=i,{contentType:o,name:a,url:l}=e,u=this.renderImageMask(e,t==="list"?48:400),d=r.editing?P("span",{"aria-hidden":"true",class:this.classes(ee.itemChevronIcon,xn(this.container)?ee.iconLeft:ee.iconRight)}):null,f=[u,s==="preview"&&n&&oC(o)?null:P("label",{class:ee.itemLabel},P("span",{class:ee.itemFilename},a||this.messages.noTitle),d)],m=r.editing?P("button",{key:"details-button",bind:this,class:ee.itemButton,title:this.messages.attachmentDetails,"aria-label":this.messages.attachmentDetails,"data-attachment-info-id":e.id,onclick:()=>this._startEditAttachment(e),type:"button"},f):P("a",{key:"details-link",class:ee.itemButton,href:l,target:"_blank"},f);return P("li",{class:ee.item,key:e},m)}renderAttachmentContainer(){const{effectiveDisplayType:e,viewModel:t,visibleElements:i}=this,{attachmentInfos:s,abilities:r,fileInfos:n}=t,o=!!(s!=null&&s.length),a=!!(n!=null&&n.length),l={[ee.containerList]:e!=="preview",[ee.containerPreview]:e==="preview"},u=r.editing&&r.operations.add&&i.addButton?P("button",{bind:this,onclick:()=>this._startAddAttachment(),class:this.classes(ee.esriButton,ee.esriButtonTertiary,ee.addAttachmentButton),type:"button"},P("span",{"aria-hidden":"true",class:this.classes(ee.itemAddIcon,ee.iconPlus)}),this.messages.add):void 0,d=o?P("ul",{key:"attachments-list",class:ee.items},s.toArray().map(y=>this.renderAttachmentInfo({attachmentInfo:y,displayType:e}))):void 0,f=a?P("ul",{key:"file-list",class:ee.items},n.toArray().map(y=>this.renderFile(y))):void 0,m=a||o?void 0:P("div",{class:ee.empty},this.messages.noAttachments);return P("div",{key:"attachments-container",class:this.classes(ee.container,l)},d,f,m,u)}_modeChanged(){this._set("error",null),this._set("selectedFile",null)}_handleFileInputChange(e){const t=e.target,i=t&&t.files&&t.files.item(0);this._set("selectedFile",i)}_submitDeleteAttachment(e,t){e.preventDefault(),"file"in t?this.deleteFile(t.file):this.deleteAttachment(t)}_submitAddAttachment(e){e.preventDefault(),this.viewModel.filesEnabled?this.addFile():this.addAttachment()}_submitUpdateAttachment(e,t){e.preventDefault(),"file"in t?this.updateFile():this.updateAttachment()}_startEditAttachment(e){const{viewModel:t}=this;t.activeFileInfo=null,t.activeAttachmentInfo=e,t.mode="edit"}_startEditFile(e){const{viewModel:t}=this;t.activeAttachmentInfo=null,t.activeFileInfo=e,t.mode="edit"}_startAddAttachment(){this.viewModel.mode="add"}_cancelForm(e){e.preventDefault(),this.viewModel.mode="view"}_getCSSTransform(e){const{orientationInfo:t}=e;return!this._supportsImageOrientation&&t?[t.rotation?`rotate(${t.rotation}deg)`:"",t.mirrored?"scaleX(-1)":""].join(" "):""}};c([h()],xi.prototype,"abilities",null),c([h()],xi.prototype,"displayType",void 0),c([h({readOnly:!0})],xi.prototype,"effectiveDisplayType",null),c([h()],xi.prototype,"graphic",null),c([h()],xi.prototype,"label",null),c([h(),di("esri/widgets/Attachments/t9n/Attachments")],xi.prototype,"messages",void 0),c([h(),di("esri/core/t9n/Units")],xi.prototype,"messagesUnits",void 0),c([h({readOnly:!0})],xi.prototype,"selectedFile",void 0),c([h({readOnly:!0})],xi.prototype,"submitting",void 0),c([h({readOnly:!0})],xi.prototype,"error",void 0),c([h({type:yT})],xi.prototype,"viewModel",void 0),c([h()],xi.prototype,"visibleElements",void 0),c([Oe("visibleElements")],xi.prototype,"castVisibleElements",null),xi=c([S("esri.widgets.Attachments")],xi);const $K=xi;let Cp=class extends yT{constructor(e){super(e),this.description=null,this.title=null}};c([h()],Cp.prototype,"description",void 0),c([h()],Cp.prototype,"title",void 0),Cp=c([S("esri.widgets.Feature.FeatureAttachments.FeatureAttachmentsViewModel")],Cp);const gT=Cp,TK={heading:"esri-widget__heading"};function vT(e,t){const i=IK(e.level),s=`h${i}`;return delete e.level,P(s,{...e,class:aL(TK.heading,e.class),role:"heading","aria-level":String(i)},t)}function IK(e){return ls(Math.ceil(e),1,6)}const Q_={base:"esri-feature-element-info",title:"esri-feature-element-info__title",description:"esri-feature-element-info__description"};let zu=class extends yi{constructor(e,t){super(e,t),this.description=null,this.headingLevel=2,this.title=null}render(){return P("div",{class:Q_.base},this.renderTitle(),this.renderDescription())}renderTitle(){const{title:e}=this;return e?P(vT,{level:this.headingLevel,class:Q_.title},e):null}renderDescription(){const{description:e}=this;return e?P("div",{key:"description",class:Q_.description},e):null}};c([h()],zu.prototype,"description",void 0),c([h()],zu.prototype,"headingLevel",void 0),c([h()],zu.prototype,"title",void 0),zu=c([S("esri.widgets.Feature.support.FeatureElementInfo")],zu);const Bb=zu,EK={base:"esri-feature-attachments"};let an=class extends yi{constructor(e,t){super(e,t),this._featureElementInfo=null,this.attachmentsWidget=new $K,this.headingLevel=2,this.viewModel=new gT}initialize(){this._featureElementInfo=new Bb,this.addHandles([Z(()=>{var e,t;return[(e=this.viewModel)==null?void 0:e.description,(t=this.viewModel)==null?void 0:t.title,this.headingLevel]},()=>this._setupFeatureElementInfo(),Le),Z(()=>{var e;return(e=this.viewModel)==null?void 0:e.graphic},e=>this.attachmentsWidget.graphic=e,Le)])}destroy(){this.attachmentsWidget.destroy(),this._featureElementInfo.destroy()}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get displayType(){return this.attachmentsWidget.displayType}set displayType(e){this.attachmentsWidget.displayType=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){var t;const{attachmentsWidget:e}=this;return P("div",{class:EK.base},(t=this._featureElementInfo)==null?void 0:t.render(),e==null?void 0:e.render())}_setupFeatureElementInfo(){const{description:e,title:t,headingLevel:i}=this;this._featureElementInfo.set({description:e,title:t,headingLevel:i})}};c([h({readOnly:!0})],an.prototype,"attachmentsWidget",void 0),c([h()],an.prototype,"description",null),c([h()],an.prototype,"displayType",null),c([h()],an.prototype,"graphic",null),c([h()],an.prototype,"headingLevel",void 0),c([h()],an.prototype,"title",null),c([h({type:gT})],an.prototype,"viewModel",void 0),an=c([S("esri.widgets.Feature.FeatureAttachments")],an);const kK=an;let va=class extends pu(oe){constructor(e){super(e),this._loadingPromise=null,this.created=null,this.creator=null,this.destroyer=null,this.graphic=null,this.handles.add(Z(()=>this.creator,t=>{this._destroyContent(),this._createContent(t)},Le))}destroy(){this._destroyContent()}get state(){return this._loadingPromise?"loading":"ready"}_destroyContent(){const{created:e,graphic:t,destroyer:i}=this;e&&(Mv(i,{graphic:t}).catch(()=>null),this._set("created",null))}async _createContent(e){const{graphic:t}=this,i=Mv(e,{graphic:t}).catch(()=>null);this._loadingPromise=i,this.notifyChange("state");const s=await i;i===this._loadingPromise&&(this._loadingPromise=null,this.notifyChange("state"),this._set("created",s))}};c([h({readOnly:!0})],va.prototype,"created",void 0),c([h()],va.prototype,"creator",void 0),c([h()],va.prototype,"destroyer",void 0),c([h({type:Ci})],va.prototype,"graphic",void 0),c([h({readOnly:!0})],va.prototype,"state",null),va=c([S("esri.widgets.Feature.FeatureContent.FeatureContentViewModel")],va);const $v=va;function CK(e){return t=>{t.hasOwnProperty("_delegatedEventNames")||(t._delegatedEventNames=t._delegatedEventNames?t._delegatedEventNames.slice():[]);const i=t._delegatedEventNames,s=Array.isArray(e)?e:PK(e);i.push(...s)}}function PK(e){return e.split(",").map(t=>t.trim())}const JN="calcite-theme-";function AK(){return getComputedStyle(document.body).getPropertyValue("--esri-calcite-theme-name").replace(/\s|'|"/g,"")}function Tv(){return AK().startsWith("dark")}function OK(){return`${JN}${Tv()?"dark":"light"}`}function RK(e){LK(e),e.classList.add(OK())}function LK(e){Array.from(e.classList).forEach(t=>{t.startsWith(JN)&&e.classList.remove(t)})}function XN(e){return e&&typeof e.render=="function"}function FK(e){return e&&typeof e.postMixInProperties=="function"&&typeof e.buildRendering=="function"&&typeof e.postCreate=="function"&&typeof e.startup=="function"}const K_={base:"esri-feature-content",loaderContainer:"esri-feature-content__loader-container",loader:"esri-feature-content__loader"};let Bu=class extends yi{constructor(e,t){super(e,t),this.viewModel=null,this._addTargetToAnchors=i=>{Array.from(i.querySelectorAll("a")).forEach(s=>{BN(s.href)&&!s.hasAttribute("target")&&s.setAttribute("target","_blank")})}}get creator(){return this.viewModel.creator}set creator(e){this.viewModel.creator=e}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}renderLoading(){return P("div",{class:K_.loaderContainer,key:"loader"},P("div",{class:K_.loader}))}renderCreated(){var t;const e=(t=this.viewModel)==null?void 0:t.created;return e?e instanceof HTMLElement?P("div",{key:e,bind:e,afterCreate:this._attachToNode}):XN(e)?P("div",{key:e},!e.destroyed&&e.render()):P("div",{key:e,innerHTML:e,afterCreate:this._addTargetToAnchors}):null}render(){var t;const e=(t=this.viewModel)==null?void 0:t.state;return P("div",{class:K_.base},e==="loading"?this.renderLoading():this.renderCreated())}_attachToNode(e){const t=this;e.appendChild(t)}};c([h()],Bu.prototype,"creator",null),c([h()],Bu.prototype,"graphic",null),c([h({type:$v})],Bu.prototype,"viewModel",void 0),Bu=c([S("esri.widgets.Feature.FeatureContent")],Bu);const qg=Bu;let eo=class extends oe{constructor(e){super(e),this.attributes=null,this.expressionInfos=null,this.description=null,this.fieldInfos=null,this.title=null}get formattedFieldInfos(){const{expressionInfos:e,fieldInfos:t}=this,i=[];return t==null||t.forEach(s=>{if(!(!s.hasOwnProperty("visible")||s.visible))return;const r=s.clone();r.label=UN(r,e),i.push(r)}),i}};c([h()],eo.prototype,"attributes",void 0),c([h({type:[YD]})],eo.prototype,"expressionInfos",void 0),c([h()],eo.prototype,"description",void 0),c([h({type:[Fm]})],eo.prototype,"fieldInfos",void 0),c([h({readOnly:!0})],eo.prototype,"formattedFieldInfos",null),c([h()],eo.prototype,"title",void 0),eo=c([S("esri.widgets.Feature.FeatureFields.FeatureFieldsViewModel")],eo);const Ub=eo,DK=[{pattern:/^\s*(https?:\/\/([^\s]+))\s*$/i,target:"_blank",label:"{messages.view}"},{pattern:/^\s*(tel:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(mailto:([^\s]+))\s*$/i,label:"{hierPart}"},{pattern:/^\s*(arcgis-appstudio-player:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"App Studio Player"},{pattern:/^\s*(arcgis-collector:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Collector"},{pattern:/^\s*(arcgis-explorer:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Explorer"},{pattern:/^\s*(arcgis-navigator:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Navigator"},{pattern:/^\s*(arcgis-survey123:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Survey123"},{pattern:/^\s*(arcgis-trek2there:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Trek2There"},{pattern:/^\s*(arcgis-workforce:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Workforce"},{pattern:/^\s*(iform:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"iForm"},{pattern:/^\s*(flow:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"FlowFinity"},{pattern:/^\s*(lfmobile:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Laserfische"},{pattern:/^\s*(mspbi:\/\/([^\s]+))\s*$/i,label:"{messages.openInApp}",appName:"Microsoft Power Bi"}];function NK(e){let t=null;return DK.some(i=>(i.pattern.test(e)&&(t=i),!!t)),t}function jK(e,t){if(typeof t!="string"||!t)return t;const i=NK(t);if(!i)return t;const s=t.match(i.pattern),r=s&&s[2],n=In(In(i.label,{messages:e,hierPart:r}),{appName:i.appName}),o=i.target?` target="${i.target}"`:"",a=i.target==="_blank"?' rel="noreferrer"':"";return t.replace(i.pattern,`${n}`)}const Nd={base:"esri-feature-fields",fieldHeader:"esri-feature-fields__field-header",fieldData:"esri-feature-fields__field-data",fieldDataDate:"esri-feature-fields__field-data--date",esriTable:"esri-widget__table"};let yr=class extends yi{constructor(e,t){super(e,t),this._featureElementInfo=null,this.viewModel=new Ub,this.messages=null,this.messagesURIUtils=null}initialize(){this._featureElementInfo=new Bb,this.addHandles(Z(()=>{var e,t;return[(e=this.viewModel)==null?void 0:e.description,(t=this.viewModel)==null?void 0:t.title]},()=>this._setupFeatureElementInfo(),Le))}destroy(){this._featureElementInfo.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get expressionInfos(){return this.viewModel.expressionInfos}set expressionInfos(e){this.viewModel.expressionInfos=e}get fieldInfos(){return this.viewModel.fieldInfos}set fieldInfos(e){this.viewModel.fieldInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}renderFieldInfo(e,t){const{attributes:i}=this.viewModel,s=e.fieldName,r=e.label||s,n=i?i[s]==null?"":i[s]:"",o=!(!e.format||!e.format.dateFormat),a=typeof n=="number"&&!o?this._forceLTR(n):jK(this.messagesURIUtils,n),l={[Nd.fieldDataDate]:o};return P("tr",{key:`fields-element-info-row-${s}-${t}`},P("th",{key:`fields-element-info-row-header-${s}-${t}`,class:Nd.fieldHeader,innerHTML:r}),P("td",{key:`fields-element-info-row-data-${s}-${t}`,class:this.classes(Nd.fieldData,l),innerHTML:a}))}renderFields(){const{formattedFieldInfos:e}=this.viewModel;return e!=null&&e.length?P("table",{class:Nd.esriTable,summary:this.messages.fieldsSummary},P("tbody",null,e.map((t,i)=>this.renderFieldInfo(t,i)))):null}render(){var e;return P("div",{class:Nd.base},(e=this._featureElementInfo)==null?void 0:e.render(),this.renderFields())}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo.set({description:e,title:t})}_forceLTR(e){return`‎${e}`}};c([h()],yr.prototype,"attributes",null),c([h()],yr.prototype,"description",null),c([h()],yr.prototype,"expressionInfos",null),c([h()],yr.prototype,"fieldInfos",null),c([h()],yr.prototype,"title",null),c([h({type:Ub,nonNullable:!0})],yr.prototype,"viewModel",void 0),c([h(),di("esri/widgets/Feature/t9n/Feature")],yr.prototype,"messages",void 0),c([h(),di("esri/widgets/support/t9n/uriUtils")],yr.prototype,"messagesURIUtils",void 0),yr=c([S("esri.widgets.Feature.FeatureFields")],yr);const ZN=yr,VK={maximumFractionDigits:20};function zK(e){return sl(e,VK)}var IS;let Yl=IS=class extends W{constructor(e){super(e),this.color=null,this.label=null,this.value=null}writeValue(e,t,i){t[i]=e!=null?e:0}clone(){return new IS({color:this.color&&this.color.clone(),label:this.label,value:this.value})}};c([h({type:pe,json:{type:[Ge],write:!0}})],Yl.prototype,"color",void 0),c([h({type:String,json:{write:!0}})],Yl.prototype,"label",void 0),c([h({type:Number,json:{write:{writerEnsuresNonNull:!0}}})],Yl.prototype,"value",void 0),c([ie("value")],Yl.prototype,"writeValue",null),Yl=IS=c([S("esri.renderers.visualVariables.support.ColorStop")],Yl);const BK=Yl,ew=-3;var Oa;(function(e){e[e.ALL=0]="ALL",e[e.SOME=1]="SOME"})(Oa||(Oa={}));class r_e{constructor(t,i,s){this._namespace=t,this._storage=i,this._removeFunc=!1,this._hit=0,this._miss=0,this._storage.register(this),this._namespace+=":",s&&(this._storage.registerRemoveFunc(this._namespace,s),this._removeFunc=!0)}destroy(){this._storage.clear(this._namespace),this._removeFunc&&this._storage.deregisterRemoveFunc(this._namespace),this._storage.deregister(this),this._storage=null}get namespace(){return this._namespace.slice(0,-1)}get hitRate(){return this._hit/(this._hit+this._miss)}get size(){return this._storage.size}get maxSize(){return this._storage.maxSize}resetHitRate(){this._hit=this._miss=0}put(t,i,s,r=0){this._storage.put(this._namespace+t,i,s,r)}get(t){const i=this._storage.get(this._namespace+t);return i===void 0?++this._miss:++this._hit,i}pop(t){const i=this._storage.pop(this._namespace+t);return i===void 0?++this._miss:++this._hit,i}updateSize(t,i,s){this._storage.updateSize(this._namespace+t,i,s)}clear(){this._storage.clear(this._namespace)}clearAll(){this._storage.clearAll()}getStats(){return this._storage.getStats()}resetStats(){this._storage.resetStats()}}class QN{constructor(t=10485760){this._maxSize=t,this._db=new Map,this._size=0,this._hit=0,this._miss=0,this._removeFuncs=new Vc,this._users=new Vc}destroy(){this.clearAll(),this._removeFuncs.clear(),this._users.clear(),this._db=null}register(t){this._users.push(t)}deregister(t){this._users.removeUnordered(t)}registerRemoveFunc(t,i){this._removeFuncs.push([t,i])}deregisterRemoveFunc(t){this._removeFuncs.filterInPlace(i=>i[0]!==t)}get size(){return this._size}get maxSize(){return this._maxSize}set maxSize(t){this._maxSize=Math.max(t,0),this._checkSizeLimit()}put(t,i,s,r){const n=this._db.get(t);if(n&&(this._size-=n.size,this._db.delete(t),n.entry!==i&&this._notifyRemove(t,n.entry,Oa.ALL)),s>this._maxSize)return void this._notifyRemove(t,i,Oa.ALL);if(i===void 0)return void console.warn("Refusing to cache undefined entry ");if(!s||s<0)return void console.warn("Refusing to cache entry with invalid size "+s);const o=1+Math.max(r,ew)-ew;this._db.set(t,{entry:i,size:s,lifetime:o,lives:o}),this._size+=s,this._checkSizeLimit()}updateSize(t,i,s){const r=this._db.get(t);if(r&&r.entry===i){for(this._size-=r.size;s>this._maxSize;){const n=this._notifyRemove(t,i,Oa.SOME);if(!(M(n)&&n>0))return void this._db.delete(t);s=n}r.size=s,this._size+=s,this._checkSizeLimit()}}pop(t){const i=this._db.get(t);if(i)return this._size-=i.size,this._db.delete(t),++this._hit,i.entry;++this._miss}get(t){const i=this._db.get(t);if(i!==void 0)return this._db.delete(t),i.lives=i.lifetime,this._db.set(t,i),++this._hit,i.entry;++this._miss}getStats(){const t={Size:Math.round(this._size/1048576)+"/"+Math.round(this._maxSize/1048576)+"MB","Hit rate":Math.round(100*this._getHitRate())+"%",Entries:this._db.size.toString()},i={},s=new Array;this._db.forEach((o,a)=>{const l=o.lifetime;s[l]=(s[l]||0)+o.size,this._users.forAll(u=>{const d=u.namespace;if(a.startsWith(d)){const f=i[d]||0;i[d]=f+o.size}})});const r={};this._users.forAll(o=>{const a=o.namespace;if(!isNaN(o.hitRate)&&o.hitRate>0){const l=i[a]||0;i[a]=l,r[a]=Math.round(100*o.hitRate)+"%"}else r[a]="0%"});const n=Object.keys(i);n.sort((o,a)=>i[a]-i[o]),n.forEach(o=>t[o]=Math.round(i[o]/2**20)+"MB / "+r[o]);for(let o=s.length-1;o>=0;--o){const a=s[o];a&&(t["Priority "+(o+ew-1)]=Math.round(a/this.size*100)+"%")}return t}resetStats(){this._hit=this._miss=0,this._users.forAll(t=>t.resetHitRate())}clear(t){this._db.forEach((i,s)=>{s.startsWith(t)&&(this._size-=i.size,this._db.delete(s),this._notifyRemove(s,i.entry,Oa.ALL))})}clearAll(){this._db.forEach((t,i)=>this._notifyRemove(i,t.entry,Oa.ALL)),this._size=0,this._db.clear()}_getHitRate(){return this._hit/(this._hit+this._miss)}_notifyRemove(t,i,s){let r;return this._removeFuncs.some(n=>{if(t.startsWith(n[0])){const o=n[1](i,s);return typeof o=="number"&&(r=o),!0}return!1}),r}_checkSizeLimit(){if(!(this._size<=this._maxSize))for(const[t,i]of this._db){if(this._db.delete(t),i.lives<=1){this._size-=i.size;const s=this._notifyRemove(t,i.entry,Oa.SOME);M(s)&&s>0&&(this._size+=s,i.lives=i.lifetime,i.size=s,this._db.set(t,i))}else--i.lives,this._db.set(t,i);if(this._size<=.9*this.maxSize)return}}}class UK{constructor(t,i){this._storage=new QN,this._storage.maxSize=t,i&&this._storage.registerRemoveFunc("",i)}put(t,i){this._storage.put(t,i,1,1)}pop(t){return this._storage.pop(t)}get(t){return this._storage.get(t)}clear(){this._storage.clearAll()}destroy(){this._storage.destroy()}}new UK(1e3);new pe([128,128,128]);const qK=new pe("white");function vu(e,t){if(!e)return null;let i=null;return Jh(e)?i=GK(e):Vb(e)&&(i=e.color?new pe(e.color):null),i?om(i,t):null}function GK(e){const t=e.symbolLayers;if(!t)return null;let i=null;return t.forEach(s=>{var r;s.type==="object"&&((r=s.resource)==null?void 0:r.href)!=null||(i=s.type==="water"?s.color:M(s.material)?s.material.color:null)}),i?new pe(i):null}function om(e,t){if(t==null||e==null)return e;const i=e.toRgba();return i[3]=i[3]*t,new pe(i)}function WK(e,t,i){const s=e.symbolLayers;if(!s)return;const r=n=>{var a;const o=M(n)?n:null;return om(t=(a=t!=null?t:o)!=null?a:i!=null?qK:null,i)};s.forEach(n=>{var o;if(n.type!=="object"||((o=n.resource)==null?void 0:o.href)==null||t)if(n.type==="water")n.color=r(n.color);else{const a=M(n.material)?n.material.color:null,l=r(a);N(n.material)?n.material=new Ts({color:l}):n.material.color=l,i!=null&&"outline"in n&&M(n.outline)&&M(n.outline.color)&&(n.outline.color=om(n.outline.color,i))}})}function HK(e,t,i){(t=t!=null?t:e.color)&&(e.color=om(t,i)),i!=null&&"outline"in e&&e.outline&&e.outline.color&&(e.outline.color=om(e.outline.color,i))}function tw(e,t,i){e&&(t||i!=null)&&(t&&(t=new pe(t)),Jh(e)?WK(e,t,i):Vb(e)&&HK(e,t,i))}async function YK(e,t){const i=e.symbolLayers;i&&await HY(i,async s=>JK(s,t))}async function JK(e,t){switch(e.type){case"extrude":ZK(e,t);break;case"icon":case"line":case"text":XK(e,t);break;case"path":KK(e,t);break;case"object":await QK(e,t)}}function XK(e,t){const i=KN(t);M(i)&&(e.size=i)}function KN(e){for(const t of e)if(typeof t=="number")return t;return null}function ZK(e,t){e.size=typeof t[2]=="number"?t[2]:0}async function QK(e,t){const{resourceSize:i,symbolSize:s}=await eee(e),r=e5(t,i,s);e.width=bf(t[0],s[0],i[0],r),e.depth=bf(t[1],s[1],i[1],r),e.height=bf(t[2],s[2],i[2],r)}function KK(e,t){const i=e5(t,GL,[e.width,void 0,e.height]);e.width=bf(t[0],e.width,1,i),e.height=bf(t[2],e.height,1,i)}function e5(e,t,i){for(let s=0;s<3;s++){const r=e[s];switch(r){case"symbol-value":{const n=i[s];return n!=null?n/t[s]:1}case"proportional":break;default:if(r&&t[s])return r/t[s]}}return 1}async function eee(e){const t=await z(()=>import("./symbolLayerUtils.5e2d5733.js"),[]),i=await t.computeObjectLayerResourceSize(e,10),{width:s,height:r,depth:n}=e,o=[s,n,r];let a=1;for(let l=0;l<3;l++){const u=o[l];if(u!=null){a=u/i[l];break}}for(let l=0;l<3;l++)o[l]==null&&(o[l]=i[l]*a);return{resourceSize:i,symbolSize:o}}function bf(e,t,i,s){switch(e){case"proportional":return i*s;case"symbol-value":return t!=null?t:i;default:return e}}function tee(e,t){const i=KN(t);if(!N(i))switch(e.type){case"simple-marker":e.size=i;break;case"picture-marker":{const s=e.width/e.height;s>1?(e.width=i,e.height=i*s):(e.width=i*s,e.height=i);break}case"simple-line":e.width=i;break;case"text":e.font.size=i}}async function iee(e,t){if(e&&t)return Jh(e)?YK(e,t):void(Vb(e)&&tee(e,t))}function see(e,t,i){if(e&&t!=null)if(Jh(e)){const s=e.symbolLayers;s&&s.forEach(r=>{if(r&&r.type==="object")switch(i){case"tilt":r.tilt=t;break;case"roll":r.roll=t;break;default:r.heading=t}})}else Vb(e)&&(e.type!=="simple-marker"&&e.type!=="picture-marker"&&e.type!=="text"||(e.angle=t))}const ree="<",nee=">",oee=HM("short-date");function aee(e,t,i,s){let r="";t===0?r=`${ree} `:t===i&&(r=`${nee} `);let n=null;return n=s?Po(e,oee):zK(e),r+n}const lee=new pe([64,64,64]);function cee(e,t){const i=[],s=e.length-1;return e.length===5?i.push(0,2,4):i.push(0,s),e.map((r,n)=>i.includes(n)?aee(r,n,s,t):null)}async function uee(e,t,i){let s=!1,r=[],n=[];if(e.stops){const u=e.stops;r=u.map(d=>d.value),s=u.some(d=>!!d.label),s&&(n=u.map(d=>d.label))}const o=r[0],a=r[r.length-1];if(o==null&&a==null)return null;const l=s?null:cee(r,i);return(await Promise.all(r.map(async(u,d)=>({value:u,color:e.type==="opacity"?await hee(u,e,t):(await z(()=>Promise.resolve().then(function(){return PT}),void 0)).getColor(e,u),label:s?n[d]:l[d]})))).reverse()}async function hee(e,t,i=lee){const s=new pe(i),r=(await z(()=>Promise.resolve().then(function(){return PT}),void 0)).getOpacity(t,e);return r!=null&&(s.a=r),s}var ES;let Pp=ES=class extends W{constructor(e){super(e),this.color=null,this.ratio=null}clone(){return new ES({color:this.color,ratio:this.ratio})}};c([h({type:pe,json:{type:[Ge],default:null,write:!0}})],Pp.prototype,"color",void 0),c([h({type:Number,json:{write:!0}})],Pp.prototype,"ratio",void 0),Pp=ES=c([S("esri.renderers.support.HeatmapColorStop")],Pp);const _f=Pp;function dee(e){if(!e.colorStops)return[];const t=[...e.colorStops].filter(s=>{var r;return((r=s.color)==null?void 0:r.a)>0});let i=t.length-1;if(t&&t[0]){const s=t[i];s&&s.ratio!==1&&(t.push(new _f({ratio:1,color:s.color})),i++)}return t.map((s,r)=>{var o,a;let n="";return r===0?n=((o=e.legendOptions)==null?void 0:o.minLabel)||"low":r===i&&(n=((a=e.legendOptions)==null?void 0:a.maxLabel)||"high"),{color:s.color,label:n,ratio:s.ratio}}).reverse()}q.getLogger("esri.renderers.support.utils");async function hs(e,t,i){A3(e,t,()=>[]).push(...i)}async function pee(e){var i,s,r,n;const t=new Map;if(!e)return t;if("visualVariables"in e&&e.visualVariables){const o=e.visualVariables.filter(a=>a.type==="color");for(const a of o){const l=(await uee(a)).map(u=>u.color);await hs(t,a.field||a.valueExpression,l)}}if(e.type==="heatmap"){const o=dee(e).map(a=>a.color);await hs(t,e.field||e.valueExpression,o)}else if(e.type==="pie-chart"){for(const o of e.attributes)await hs(t,o.field||o.valueExpression,[o.color]);await hs(t,"default",[(i=e==null?void 0:e.othersCategory)==null?void 0:i.color,vu(e.backgroundFillSymbol,null)])}else if(e.type==="dot-density"){for(const o of e.attributes)await hs(t,o.field||o.valueExpression,[o.color]);await hs(t,"default",[e.backgroundColor])}else if(e.type==="unique-value")if(((s=e.authoringInfo)==null?void 0:s.type)==="predominance")for(const o of(r=e.uniqueValueInfos)!=null?r:[])await hs(t,o.value.toString(),[vu(o.symbol,null)]);else{const o=((n=e.uniqueValueInfos)!=null?n:[]).map(f=>vu(f.symbol,null)),{field:a,field2:l,field3:u,valueExpression:d}=e;(a||d)&&await hs(t,a||d,o),l&&await hs(t,l,o),u&&await hs(t,u,o)}else if(e.type==="class-breaks"){const o=e.classBreakInfos.map(u=>vu(u.symbol,null)),{field:a,valueExpression:l}=e;await hs(t,a!=null?a:l,o)}else e.type==="simple"&&await hs(t,"default",[vu(e.symbol,null)]);return"defaultSymbol"in e&&e.defaultSymbol&&await hs(t,"default",[vu(e.defaultSymbol,null)]),t.forEach((o,a)=>{const l=G6(o.filter(Boolean),(u,d)=>JSON.stringify(u)===JSON.stringify(d));t.set(a,l)}),t}var kS;let Ap=kS=class extends W{constructor(e){super(e),this.name=null,this.code=null}clone(){return new kS({name:this.name,code:this.code})}};c([h({type:String,json:{write:!0}})],Ap.prototype,"name",void 0),c([h({type:[String,Number],json:{write:!0}})],Ap.prototype,"code",void 0),Ap=kS=c([S("esri.layers.support.CodedValue")],Ap);const fee=new Ie({inherited:"inherited",codedValue:"coded-value",range:"range"});let Op=class extends W{constructor(e){super(e),this.name=null,this.type=null}};c([h({type:String,json:{write:!0}})],Op.prototype,"name",void 0),c([ue(fee)],Op.prototype,"type",void 0),Op=c([S("esri.layers.support.Domain")],Op);const qb=Op;var CS;let Rp=CS=class extends qb{constructor(e){super(e),this.codedValues=null,this.type="coded-value"}getName(e){let t=null;if(this.codedValues){const i=String(e);this.codedValues.some(s=>(String(s.code)===i&&(t=s.name),!!t))}return t}clone(){return new CS({codedValues:R(this.codedValues),name:this.name})}};c([h({type:[Ap],json:{write:!0}})],Rp.prototype,"codedValues",void 0),c([ue({codedValue:"coded-value"})],Rp.prototype,"type",void 0),Rp=CS=c([S("esri.layers.support.CodedValueDomain")],Rp);const t5=Rp;var PS;let Gg=PS=class extends qb{constructor(e){super(e),this.type="inherited"}clone(){return new PS}};c([ue({inherited:"inherited"})],Gg.prototype,"type",void 0),Gg=PS=c([S("esri.layers.support.InheritedDomain")],Gg);const i5=Gg;var AS;let Uu=AS=class extends qb{constructor(e){super(e),this.maxValue=null,this.minValue=null,this.type="range"}clone(){return new AS({maxValue:this.maxValue,minValue:this.minValue,name:this.name})}};c([h({type:Number,json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range&&t.range[1]},write:{enabled:!1,overridePolicy(){return{enabled:this.maxValue!=null&&this.minValue==null}},target:"range",writer(e,t,i){t[i]=[this.minValue||0,e]}}}})],Uu.prototype,"maxValue",void 0),c([h({type:Number,json:{type:[Number],read:{source:"range",reader:(e,t)=>t.range&&t.range[0]},write:{target:"range",writer(e,t,i){t[i]=[e,this.maxValue||0]}}}})],Uu.prototype,"minValue",void 0),c([ue({range:"range"})],Uu.prototype,"type",void 0),Uu=AS=c([S("esri.layers.support.RangeDomain")],Uu);const s5=Uu,r5={key:"type",base:qb,typeMap:{range:s5,"coded-value":t5,inherited:i5}};function bT(e){if(!e||!e.type)return null;switch(e.type){case"range":return s5.fromJSON(e);case"codedValue":return t5.fromJSON(e);case"inherited":return i5.fromJSON(e)}return null}const mee=new Ie({esriFieldTypeSmallInteger:"small-integer",esriFieldTypeInteger:"integer",esriFieldTypeSingle:"single",esriFieldTypeDouble:"double",esriFieldTypeLong:"long",esriFieldTypeString:"string",esriFieldTypeDate:"date",esriFieldTypeOID:"oid",esriFieldTypeGeometry:"geometry",esriFieldTypeBlob:"blob",esriFieldTypeRaster:"raster",esriFieldTypeGUID:"guid",esriFieldTypeGlobalID:"global-id",esriFieldTypeXML:"xml"});var OS;const yee=new Ie({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let Si=OS=class extends W{constructor(e){super(e),this.alias=null,this.defaultValue=void 0,this.description=null,this.domain=null,this.editable=!0,this.length=-1,this.name=null,this.nullable=!0,this.type=null,this.valueType=null,this.visible=!0}readDescription(e,{description:t}){var s;let i=null;try{i=t?JSON.parse(t):null}catch{}return(s=i==null?void 0:i.value)!=null?s:null}readValueType(e,{description:t}){let i=null;try{i=t?JSON.parse(t):null}catch{}return i?yee.fromJSON(i.fieldValueType):null}clone(){return new OS({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain&&this.domain.clone()||null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType,visible:this.visible})}};c([h({type:String,json:{write:!0}})],Si.prototype,"alias",void 0),c([h({type:[String,Number],json:{write:{allowNull:!0}}})],Si.prototype,"defaultValue",void 0),c([h()],Si.prototype,"description",void 0),c([Q("description")],Si.prototype,"readDescription",null),c([h({types:r5,json:{read:{reader:bT},write:!0}})],Si.prototype,"domain",void 0),c([h({type:Boolean,json:{write:!0}})],Si.prototype,"editable",void 0),c([h({type:Ge,json:{write:!0}})],Si.prototype,"length",void 0),c([h({type:String,json:{write:!0}})],Si.prototype,"name",void 0),c([h({type:Boolean,json:{write:!0}})],Si.prototype,"nullable",void 0),c([ue(mee)],Si.prototype,"type",void 0),c([h()],Si.prototype,"valueType",void 0),c([Q("valueType",["description"])],Si.prototype,"readValueType",null),c([h({type:Boolean,json:{read:!1}})],Si.prototype,"visible",void 0),Si=OS=c([S("esri.layers.support.Field")],Si);const _T=Si;var RS;let qu=RS=class extends W{constructor(e){super(e),this.type="map-layer"}clone(){const{mapLayerId:e,gdbVersion:t}=this;return new RS({mapLayerId:e,gdbVersion:t})}};c([ue({mapLayer:"map-layer"})],qu.prototype,"type",void 0),c([h({type:Ge,json:{write:!0}})],qu.prototype,"mapLayerId",void 0),c([h({type:String,json:{write:!0}})],qu.prototype,"gdbVersion",void 0),qu=RS=c([S("esri.layers.support.source.MapLayerSource")],qu);var LS;let to=LS=class extends W{constructor(e){super(e),this.type="query-table"}clone(){var o;const{workspaceId:e,query:t,oidFields:i,spatialReference:s,geometryType:r}=this,n={workspaceId:e,query:t,oidFields:i,spatialReference:(o=s==null?void 0:s.clone())!=null?o:void 0,geometryType:r};return new LS(n)}};c([ue({queryTable:"query-table"})],to.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],to.prototype,"workspaceId",void 0),c([h({type:String,json:{write:!0}})],to.prototype,"query",void 0),c([h({type:String,json:{write:!0}})],to.prototype,"oidFields",void 0),c([h({type:xe,json:{write:!0}})],to.prototype,"spatialReference",void 0),c([ue(EJ)],to.prototype,"geometryType",void 0),to=LS=c([S("esri.layers.support.source.QueryTableDataSource")],to);var FS;let Gu=FS=class extends W{constructor(e){super(e),this.type="raster"}clone(){const{workspaceId:e,dataSourceName:t}=this;return new FS({workspaceId:e,dataSourceName:t})}};c([ue({raster:"raster"})],Gu.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],Gu.prototype,"dataSourceName",void 0),c([h({type:String,json:{write:!0}})],Gu.prototype,"workspaceId",void 0),Gu=FS=c([S("esri.layers.support.source.RasterDataSource")],Gu);var DS;let Jl=DS=class extends W{constructor(e){super(e),this.type="table"}clone(){const{workspaceId:e,gdbVersion:t,dataSourceName:i}=this;return new DS({workspaceId:e,gdbVersion:t,dataSourceName:i})}};c([ue({table:"table"})],Jl.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],Jl.prototype,"workspaceId",void 0),c([h({type:String,json:{write:!0}})],Jl.prototype,"gdbVersion",void 0),c([h({type:String,json:{write:!0}})],Jl.prototype,"dataSourceName",void 0),Jl=DS=c([S("esri.layers.support.source.TableDataSource")],Jl);var NS,jS;const gee=mi()({esriLeftInnerJoin:"left-inner-join",esriLeftOuterJoin:"left-outer-join"});let fs=NS=class extends W{constructor(e){super(e),this.type="join-table"}readLeftTableSource(e,t,i){return lC()(e,t,i)}castLeftTableSource(e){return En(VS(),e)}readRightTableSource(e,t,i){return lC()(e,t,i)}castRightTableSource(e){return En(VS(),e)}clone(){var o,a;const{leftTableKey:e,rightTableKey:t,leftTableSource:i,rightTableSource:s,joinType:r}=this,n={leftTableKey:e,rightTableKey:t,leftTableSource:(o=i==null?void 0:i.clone())!=null?o:void 0,rightTableSource:(a=s==null?void 0:s.clone())!=null?a:void 0,joinType:r};return new NS(n)}};c([ue({joinTable:"join-table"})],fs.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],fs.prototype,"leftTableKey",void 0),c([h({type:String,json:{write:!0}})],fs.prototype,"rightTableKey",void 0),c([h({json:{write:!0}})],fs.prototype,"leftTableSource",void 0),c([Q("leftTableSource")],fs.prototype,"readLeftTableSource",null),c([Oe("leftTableSource")],fs.prototype,"castLeftTableSource",null),c([h({json:{write:!0}})],fs.prototype,"rightTableSource",void 0),c([Q("rightTableSource")],fs.prototype,"readRightTableSource",null),c([Oe("rightTableSource")],fs.prototype,"castRightTableSource",null),c([ue(gee)],fs.prototype,"joinType",void 0),fs=NS=c([S("esri.layers.support.source.JoinTableDataSource")],fs);let iw=null;function lC(){return iw||(iw=dl({types:VS()})),iw}let sw=null;function VS(){return sw||(sw={key:"type",base:null,typeMap:{"data-layer":Er,"map-layer":qu}}),sw}const vee={key:"type",base:null,typeMap:{"join-table":fs,"query-table":to,raster:Gu,table:Jl}};let Er=jS=class extends W{constructor(e){super(e),this.type="data-layer"}clone(){const{fields:e,dataSource:t}=this;return new jS({fields:e,dataSource:t})}};c([ue({dataLayer:"data-layer"})],Er.prototype,"type",void 0),c([h({type:[_T],json:{write:!0}})],Er.prototype,"fields",void 0),c([h({types:vee,json:{write:!0}})],Er.prototype,"dataSource",void 0),Er=jS=c([S("esri.layers.support.source.DataLayerSource")],Er),Er.from=Dt(Er);function n_e(e,t){return t?{...t,query:{...e,...t.query}}:{query:e}}function n5(e){return typeof e=="string"?Ai(e):R(e)}function bee(e,t,i){const s={};for(const r in e){if(r==="declaredClass")continue;const n=e[r];if(n!=null&&typeof n!="function")if(Array.isArray(n)){s[r]=[];for(let o=0;o{const f=ll(d);return f.spatialReference=n,f})}}function wee(e){return{geometryType:Sb(e[0]),geometries:e.map(t=>t.toJSON())}}function xee(e,t,i){const s=CJ(t);return e.map(r=>{const n=s.fromJSON(r);return n.spatialReference=i,n})}async function See(e,t,i){const s=typeof e=="string"?Ai(e):e,r=t[0].spatialReference,n=Sb(t[0]),o={...i,query:{...s.query,f:"json",sr:r.wkid?r.wkid:JSON.stringify(r),geometries:JSON.stringify(wee(t))}},{data:a}=await kt(s.path+"/simplify",o);return xee(a.geometries,n,r)}const a5=q.getLogger("esri.geometry.support.normalizeUtils");function Mee(e){return e.type==="polygon"}function $ee(e){return e[0].type==="polygon"}function Tee(e){return e[0].type==="polyline"}function Iee(e,t){if(!(e instanceof Ar||e instanceof Oo)){const r="straightLineDensify: the input geometry is neither polyline nor polygon";throw a5.error(r),new L(r)}const i=wf(e),s=[];for(const r of i){const n=[];s.push(n),n.push([r[0][0],r[0][1]]);for(let o=0;o1){for(let x=1;x<=g-1;x++){const $=x*t,I=y*$+a,T=m*$+l;n.push([I,T])}const v=(f+Math.floor(g-1)*t)/2,b=y*v+a,_=m*v+l;n.push([b,_])}n.push([u,d])}}return Mee(e)?new Oo({rings:s,spatialReference:e.spatialReference}):new Ar({paths:s,spatialReference:e.spatialReference})}function cC(e,t,i){if(t){const s=Iee(e,1e6);e=op(s,!0)}return i&&(e=o5(e,i)),e}function uC(e,t,i){if(Array.isArray(e)){const s=e[0];if(s>t){const r=Lc(s,t);e[0]=s+r*(-2*t)}else if(st){const r=Lc(s,t);e=e.clone().offset(r*(-2*t),0)}else if(s{if(u[0]<180)return!0;{let d=0;for(let m=0;md?y:d}d=Number(d.toFixed(9));const f=-360*Lc(d,180);for(let m=0;muC(A,a,l)),g.push(k)}else if(T.type==="extent"){const k=T.clone()._normalize(!1,!1,n);g.push(k.rings?new Oo(k):k)}else if(T.extent){const k=T.extent,A=Lc(k.xmin,l)*(2*a);let F=A===0?T.clone():o5(T.clone(),A);k.offset(A,0),k.intersects(d)&&k.xmax!==a?(m=k.xmax>m?k.xmax:m,F=cC(F,o),y.push(F),g.push("cut")):k.intersects(f)&&k.xmin!==l?(m=k.xmax*(2*a)>m?k.xmax*(2*a):m,F=cC(F,o,360),y.push(F),g.push("cut")):g.push(F)}else g.push(T.clone());else g.push(T);let v=Lc(m,a),b=-90;const _=v,x=new Ar;for(;v>0;){const T=360*v-180;x.addPath([[T,b],[T,-1*b]]),b*=-1,v--}if(y.length>0&&_>0){const T=Eee(y,await _ee(s,y,x,i)),k=[],A=[];for(let U=0;U1&&H.rings.length>=te.rings.length?(k.push(H),A.push("simplify")):A.push(o?Za(H):H)}}if(!k.length)return A;const F=await See(s,k,i),G=[];for(let U=0;Ur)for(;e>r;)e-=n}return e}function c5(e){const t={};for(const i in e){if(i==="declaredClass")continue;const s=e[i];if(s!=null&&typeof s!="function")if(Array.isArray(s)){t[i]=[];for(let r=0;r>3,this._dataType=7&i,!t||t===this._tag)break;this.skip()}return!0}next(){if(this._pos===this._end)return!1;const t=this._decodeVarint();return this._tag=t>>3,this._dataType=7&t,!0}empty(){return this._pos>=this._end}tag(){return this._tag}getInt32(){return this._decodeVarint()}getInt64(){return this._decodeVarint()}getUInt32(){let t=4294967295;return t=(127&this._data[this._pos])>>>0,this._data[this._pos++]<128?t:(t=(t|(127&this._data[this._pos])<<7)>>>0,this._data[this._pos++]<128?t:(t=(t|(127&this._data[this._pos])<<14)>>>0,this._data[this._pos++]<128?t:(t=(t|(127&this._data[this._pos])<<21)>>>0,this._data[this._pos++]<128?t:(t=(t|(15&this._data[this._pos])<<28)>>>0,this._data[this._pos++]<128?t:void 0))))}getUInt64(){return this._decodeVarint()}getSInt32(){const t=this.getUInt32();if(t!==void 0)return t>>>1^-(1&t)|0}getSInt64(){return this._decodeSVarint()}getBool(){const t=this._data[this._pos]!==0;return this._skip(1),t}getEnum(){return this._decodeVarint()}getFixed64(){const t=this._dataView,i=this._pos,s=t.getUint32(i,!0)+t.getUint32(i+4,!0)*hC;return this._skip(8),s}getSFixed64(){const t=this._dataView,i=this._pos,s=t.getUint32(i,!0)+t.getInt32(i+4,!0)*hC;return this._skip(8),s}getDouble(){const t=this._dataView.getFloat64(this._pos,!0);return this._skip(8),t}getFixed32(){const t=this._dataView.getUint32(this._pos,!0);return this._skip(4),t}getSFixed32(){const t=this._dataView.getInt32(this._pos,!0);return this._skip(4),t}getFloat(){const t=this._dataView.getFloat32(this._pos,!0);return this._skip(4),t}getString(){const t=this._getLength(),i=this._pos,s=this._toString(this._data,i,i+t);return this._skip(t),s}getBytes(){const t=this._getLength(),i=this._pos,s=this._toBytes(this._data,i,i+t);return this._skip(t),s}getLength(){return this._getLengthUnsafe()}processMessageWithArgs(t,i,s,r){const n=this.getMessage(),o=t(n,i,s,r);return n.release(),o}processMessage(t){const i=this.getMessage(),s=t(i);return i.release(),s}getMessage(){const t=this._getLength(),i=Gc.pool.acquire();return i._init(this._data,this._dataView,this._pos,this._pos+t),this._skip(t),i}release(){Gc.pool.release(this)}dataType(){return this._dataType}skip(){switch(this._dataType){case Ra.varint:this._decodeVarint();break;case Ra.fixed64:this._skip(8);break;case Ra.delimited:this._skip(this._getLength());break;case Ra.fixed32:this._skip(4);break;default:throw new Error("Invalid data type!")}}skipLen(t){this._skip(t)}_skip(t){if(this._pos+t>this._end)throw new Error("Attempt to skip past the end of buffer!");this._pos+=t}_decodeVarint(){const t=this._data;let i=this._pos,s=0,r=0;if(this._end-i>=10)do{if(r=t[i++],s|=127&r,(128&r)==0||(r=t[i++],s|=(127&r)<<7,(128&r)==0)||(r=t[i++],s|=(127&r)<<14,(128&r)==0)||(r=t[i++],s|=(127&r)<<21,(128&r)==0)||(r=t[i++],s+=268435456*(127&r),(128&r)==0)||(r=t[i++],s+=34359738368*(127&r),(128&r)==0)||(r=t[i++],s+=4398046511104*(127&r),(128&r)==0)||(r=t[i++],s+=562949953421312*(127&r),(128&r)==0)||(r=t[i++],s+=72057594037927940*(127&r),(128&r)==0)||(r=t[i++],s+=9223372036854776e3*(127&r),(128&r)==0))break;throw new Error("Varint too long!")}while(0);else{let n=1;for(;i!==this._end&&(r=t[i],(128&r)!=0);)++i,s+=(127&r)*n,n*=128;if(i===this._end)throw new Error("Varint overrun!");++i,s+=r*n}return this._pos=i,s}_decodeSVarint(){const t=this._data;let i=this._pos,s=0,r=0;const n=1&t[i];if(this._end-i>=10)do{if(r=t[i++],s|=127&r,(128&r)==0||(r=t[i++],s|=(127&r)<<7,(128&r)==0)||(r=t[i++],s|=(127&r)<<14,(128&r)==0)||(r=t[i++],s|=(127&r)<<21,(128&r)==0)||(r=t[i++],s+=268435456*(127&r),(128&r)==0)||(r=t[i++],s+=34359738368*(127&r),(128&r)==0)||(r=t[i++],s+=4398046511104*(127&r),(128&r)==0)||(r=t[i++],s+=562949953421312*(127&r),(128&r)==0)||(r=t[i++],s+=72057594037927940*(127&r),(128&r)==0)||(r=t[i++],s+=9223372036854776e3*(127&r),(128&r)==0))break;throw new Error("Varint too long!")}while(0);else{let o=1;for(;i!==this._end&&(r=t[i],(128&r)!=0);)++i,s+=(127&r)*o,o*=128;if(i===this._end)throw new Error("Varint overrun!");++i,s+=r*o}return this._pos=i,n?-(s+1)/2:s/2}_getLength(){if(this._dataType!==Ra.delimited)throw new Error("Not a delimited data type!");return this._decodeVarint()}_getLengthUnsafe(){return this.getUInt32()}_toString(t,i,s){if((s=Math.min(this._end,s))-i>Cee){const o=t.subarray(i,s);return kee.decode(o)}let r="",n="";for(let o=i;o{e._data=null,e._dataView=null});class zi{constructor(t=[],i=[],s=!1){this.lengths=t!=null?t:[],this.coords=i!=null?i:[],this.hasIndeterminateRingOrder=s}static fromRect(t){const[i,s,r,n]=t,o=r-i,a=n-s;return new zi([5],[i,s,o,0,0,a,-o,0,0,-a])}get isPoint(){return this.lengths.length===0}get maxLength(){return Math.max(...this.lengths)}get size(){return this.lengths.reduce((t,i)=>t+i)}forEachVertex(t){let i=0;this.lengths.length||t(this.coords[0],this.coords[1]);for(let s=0;si+s,0)*this._vertexDimension,this._coordinatePtr=0}addCoordinate(t,i){t.coords[this._coordinatePtr++]=i}addCoordinatePoint(t,i){t.coords.push(i)}addLength(t,i){t.lengths.push(i)}addQueryGeometry(t,i){t.queryGeometry=i.queryGeometry,t.queryGeometryType=i.queryGeometryType}createPointGeometry(){return new zi}}const dC=["esriFieldTypeSmallInteger","esriFieldTypeInteger","esriFieldTypeSingle","esriFieldTypeDouble","esriFieldTypeString","esriFieldTypeDate","esriFieldTypeOID","esriFieldTypeGeometry","esriFieldTypeBlob","esriFieldTypeRaster","esriFieldTypeGUID","esriFieldTypeGlobalID","esriFieldTypeXML"],pC=["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"],fC=["upperLeft","lowerLeft"];function mC(e){return e>=dC.length?null:dC[e]}function Aee(e){return e>=pC.length?null:pC[e]}function yC(e){return e>=fC.length?null:fC[e]}function gC(e,t){return t>=e.geometryTypes.length?null:e.geometryTypes[t]}function Oee(e,t,i){const r=e.asUnsafe(),n=t.createPointGeometry(i);for(;r.next();)switch(r.tag()){case 3:{const o=r.getUInt32(),a=r.pos()+o;let l=0;for(;r.pos(){const r=s.data;if(r.hasOwnProperty("extent"))return s;if(r.features)throw new Error(vC);if(r.hasOwnProperty("count"))throw new Error(vC);return s})}function vd(e,t,i,s={},r={}){const n=typeof e=="string"?Ai(e):e,o=t.geometry?[t.geometry]:[];return s.responseType=i==="pbf"?"array-buffer":"json",l5(o,null,s).then(a=>{const l=a&&a[0];M(l)&&((t=t.clone()).geometry=l);const u=c5({...n.query,f:i,...r,...d5(t,r)});return kt(Xc(n.path,"query"),{...s,query:{...u,...s.query}})})}var c_e=Object.freeze(Object.defineProperty({__proto__:null,encodeGeometry:h5,executeQuery:p5,executeQueryForCount:Zee,executeQueryForExtent:Qee,executeQueryForIds:Xee,executeQueryPBF:Jee,executeQueryPBFBuffer:f5,queryToQueryStringParameters:d5,runQuery:vd},Symbol.toStringTag,{value:"Module"})),BS;const US=new Ie({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryEnvelope:"extent",mesh:"mesh","":null});let ni=BS=class extends W{constructor(e){super(e),this.displayFieldName=null,this.exceededTransferLimit=!1,this.features=[],this.fields=null,this.geometryType=null,this.hasM=!1,this.hasZ=!1,this.queryGeometry=null,this.spatialReference=null}readFeatures(e,t){var r;const i=xe.fromJSON(t.spatialReference),s=[];for(let n=0;n0)for(let i=0;iMath.round((u-s)/t),o=u=>Math.round((r-u)/i),a=this.features,l=this._getQuantizationFunction(this.geometryType,n,o);for(let u=0,d=a.length;ud*n+s,l=d=>r-d*o,u=this._getHydrationFunction(e,a,l);for(const{geometry:d}of t)M(d)&&u&&u(d);return this.transform=null,this}_quantizePoints(e,t,i){let s,r;const n=[];for(let o=0,a=e.length;o0){const u=t(l[0]),d=i(l[1]);u===s&&d===r||(n.push([u-s,d-r]),s=u,r=d)}else s=t(l[0]),r=i(l[1]),n.push([s,r])}return n.length>0?n:null}_getQuantizationFunction(e,t,i){return e==="point"?s=>(s.x=t(s.x),s.y=i(s.y),s):e==="polyline"||e==="polygon"?s=>{const r=Bc(s)?s.rings:s.paths,n=[];for(let o=0,a=r.length;o0?(Bc(s)?s.rings=n:s.paths=n,s):null}:e==="multipoint"?s=>{const r=this._quantizePoints(s.points,t,i);return r&&r.length>0?(s.points=r,s):null}:e==="extent"?s=>s:null}_getHydrationFunction(e,t,i){return e==="point"?s=>{s.x=t(s.x),s.y=i(s.y)}:e==="polyline"||e==="polygon"?s=>{const r=Bc(s)?s.rings:s.paths;let n,o;for(let a=0,l=r.length;a0?(n+=m[0],o+=m[1]):(n=m[0],o=m[1]),m[0]=t(n),m[1]=i(o)}}}:e==="extent"?s=>{s.xmin=t(s.xmin),s.ymin=i(s.ymin),s.xmax=t(s.xmax),s.ymax=i(s.ymax)}:e==="multipoint"?s=>{const r=s.points;let n,o;for(let a=0,l=r.length;a0?(n+=u[0],o+=u[1]):(n=u[0],o=u[1]),u[0]=t(n),u[1]=i(o)}}:null}};c([h({type:String,json:{write:!0}})],ni.prototype,"displayFieldName",void 0),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],ni.prototype,"exceededTransferLimit",void 0),c([h({type:[Ci],json:{write:!0}})],ni.prototype,"features",void 0),c([Q("features")],ni.prototype,"readFeatures",null),c([h({type:[_T],json:{write:!0}})],ni.prototype,"fields",void 0),c([h({type:["point","multipoint","polyline","polygon","extent","mesh"],json:{read:{reader:US.read}}})],ni.prototype,"geometryType",void 0),c([ie("geometryType")],ni.prototype,"writeGeometryType",null),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],ni.prototype,"hasM",void 0),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],ni.prototype,"hasZ",void 0),c([h({types:fu,json:{write:!0}})],ni.prototype,"queryGeometry",void 0),c([Q("queryGeometry")],ni.prototype,"readQueryGeometry",null),c([h({type:xe,json:{write:!0}})],ni.prototype,"spatialReference",void 0),c([ie("spatialReference")],ni.prototype,"writeSpatialReference",null),c([h({json:{write:!0}})],ni.prototype,"transform",void 0),ni=BS=c([S("esri.rest.support.FeatureSet")],ni),ni.prototype.toJSON.isDefaultToJSON=!0;const Wb=ni;var u_e=Object.freeze(Object.defineProperty({__proto__:null,default:Wb},Symbol.toStringTag,{value:"Module"}));const bC={milliseconds:1,seconds:1e3,minutes:6e4,hours:36e5,days:864e5,weeks:6048e5,months:26784e5,years:31536e6,decades:31536e7,centuries:31536e8},Kee={milliseconds:{getter:"getMilliseconds",setter:"setMilliseconds",multiplier:1},seconds:{getter:"getSeconds",setter:"setSeconds",multiplier:1},minutes:{getter:"getMinutes",setter:"setMinutes",multiplier:1},hours:{getter:"getHours",setter:"setHours",multiplier:1},days:{getter:"getDate",setter:"setDate",multiplier:1},weeks:{getter:"getDate",setter:"setDate",multiplier:7},months:{getter:"getMonth",setter:"setMonth",multiplier:1},years:{getter:"getFullYear",setter:"setFullYear",multiplier:1},decades:{getter:"getFullYear",setter:"setFullYear",multiplier:10},centuries:{getter:"getFullYear",setter:"setFullYear",multiplier:100}};function ete(e,t){const i=new Date(e,t+1,1);return i.setDate(0),i.getDate()}function Wc(e,t,i){const s=new Date(e.getTime());if(t&&i){const r=Kee[i],{getter:n,setter:o,multiplier:a}=r;if(i==="months"){const l=ete(s.getFullYear(),s.getMonth()+t);s.getDate()>l&&s.setDate(l)}s[o](s[n]()+t*a)}return s}function _C(e,t){switch(t){case"milliseconds":return new Date(e.getTime());case"seconds":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds());case"minutes":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes());case"hours":return new Date(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours());case"days":return new Date(e.getFullYear(),e.getMonth(),e.getDate());case"weeks":return new Date(e.getFullYear(),e.getMonth(),e.getDate()-e.getDay());case"months":return new Date(e.getFullYear(),e.getMonth(),1);case"years":return new Date(e.getFullYear(),0,1);case"decades":return new Date(e.getFullYear()-e.getFullYear()%10,0,1);case"centuries":return new Date(e.getFullYear()-e.getFullYear()%100,0,1);default:return new Date}}function tte(e,t,i){return e===0?0:e*bC[t]/bC[i]}var gr;let bs=gr=class extends W{constructor(e){super(e),this.end=null,this.start=null}static get allTime(){return wC}static get empty(){return ite}readEnd(e,t){return t.end!=null?new Date(t.end):null}writeEnd(e,t){t.end=e?e.getTime():null}get isAllTime(){return this.equals(gr.allTime)}get isEmpty(){return this.equals(gr.empty)}readStart(e,t){return t.start!=null?new Date(t.start):null}writeStart(e,t){t.start=e?e.getTime():null}clone(){return new gr({end:this.end,start:this.start})}equals(e){if(!e)return!1;const t=M(this.start)?this.start.getTime():this.start,i=M(this.end)?this.end.getTime():this.end,s=M(e.start)?e.start.getTime():e.start,r=M(e.end)?e.end.getTime():e.end;return t===s&&i===r}expandTo(e){if(this.isEmpty||this.isAllTime)return this.clone();const t=ja(this.start,s=>_C(s,e)),i=ja(this.end,s=>{const r=_C(s,e);return s.getTime()===r.getTime()?r:Wc(r,1,e)});return new gr({start:t,end:i})}intersection(e){if(!e)return this.clone();if(this.isEmpty||e.isEmpty)return gr.empty;if(this.isAllTime)return e.clone();if(e.isAllTime)return this.clone();const t=sp(this.start,-1/0,a=>a.getTime()),i=sp(this.end,1/0,a=>a.getTime()),s=sp(e.start,-1/0,a=>a.getTime()),r=sp(e.end,1/0,a=>a.getTime());let n,o;if(s>=t&&s<=i?n=s:t>=s&&t<=r&&(n=t),i>=s&&i<=r?o=i:r>=t&&r<=i&&(o=r),n!=null&&o!=null&&!isNaN(n)&&!isNaN(o)){const a=new gr;return a.start=n===-1/0?null:new Date(n),a.end=o===1/0?null:new Date(o),a}return gr.empty}offset(e,t){if(this.isEmpty||this.isAllTime)return this.clone();const i=new gr,{start:s,end:r}=this;return M(s)&&(i.start=Wc(s,e,t)),M(r)&&(i.end=Wc(r,e,t)),i}union(e){if(!e||e.isEmpty)return this.clone();if(this.isEmpty)return e.clone();if(this.isAllTime||e.isAllTime)return wC.clone();const t=M(this.start)&&M(e.start)?new Date(Math.min(this.start.getTime(),e.start.getTime())):null,i=M(this.end)&&M(e.end)?new Date(Math.max(this.end.getTime(),e.end.getTime())):null;return new gr({start:t,end:i})}};c([h({type:Date,json:{write:{allowNull:!0}}})],bs.prototype,"end",void 0),c([Q("end")],bs.prototype,"readEnd",null),c([ie("end")],bs.prototype,"writeEnd",null),c([h({readOnly:!0,json:{read:!1}})],bs.prototype,"isAllTime",null),c([h({readOnly:!0,json:{read:!1}})],bs.prototype,"isEmpty",null),c([h({type:Date,json:{write:{allowNull:!0}}})],bs.prototype,"start",void 0),c([Q("start")],bs.prototype,"readStart",null),c([ie("start")],bs.prototype,"writeStart",null),bs=gr=c([S("esri.TimeExtent")],bs);const wC=new bs,ite=new bs({start:void 0,end:void 0}),Ln=bs;let Xl=class extends xt(W){constructor(e){super(e),this.onFields=null,this.operator=null,this.searchTerm=null,this.searchType=null}};c([h({type:[String],json:{write:{enabled:!0,overridePolicy(){return{enabled:M(this.onFields)&&this.onFields.length>0}}}}})],Xl.prototype,"onFields",void 0),c([h({type:String,json:{write:!0}})],Xl.prototype,"operator",void 0),c([h({type:String,json:{write:!0}})],Xl.prototype,"searchTerm",void 0),c([h({type:String,json:{write:!0}})],Xl.prototype,"searchType",void 0),Xl=c([S("esri.rest.support.FullTextSearch")],Xl);const ste=Xl;var qS;const xC=new Ie({upperLeft:"upper-left",lowerLeft:"lower-left"});let Zl=qS=class extends W{constructor(e){super(e),this.extent=null,this.mode="view",this.originPosition="upper-left",this.tolerance=1}clone(){return new qS(R({extent:this.extent,mode:this.mode,originPosition:this.originPosition,tolerance:this.tolerance}))}};c([h({type:Ze,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],Zl.prototype,"extent",void 0),c([h({type:["view","edit"],json:{write:!0}})],Zl.prototype,"mode",void 0),c([h({type:String,json:{read:xC.read,write:xC.write}})],Zl.prototype,"originPosition",void 0),c([h({type:Number,json:{write:{overridePolicy(){return{enabled:this.mode==="view"}}}}})],Zl.prototype,"tolerance",void 0),Zl=qS=c([S("esri.rest.support.QuantizationParameters")],Zl);const m5=Zl;var GS;const SC=new Ie({count:"count",sum:"sum",min:"min",max:"max",avg:"avg",stddev:"stddev",var:"var",exceedslimit:"exceedslimit",percentile_cont:"percentile-continuous",percentile_disc:"percentile-discrete",EnvelopeAggregate:"envelope-aggregate",CentroidAggregate:"centroid-aggregate",ConvexHullAggregate:"convex-hull-aggregate"});let vr=GS=class extends W{constructor(e){super(e),this.maxPointCount=void 0,this.maxRecordCount=void 0,this.maxVertexCount=void 0,this.onStatisticField=null,this.outStatisticFieldName=null,this.statisticType=null,this.statisticParameters=null}writeStatisticParameters(e,t){this.statisticType!=="percentile-continuous"&&this.statisticType!=="percentile-discrete"||(t.statisticParameters=R(e))}clone(){return new GS({maxPointCount:this.maxPointCount,maxRecordCount:this.maxRecordCount,maxVertexCount:this.maxVertexCount,onStatisticField:this.onStatisticField,outStatisticFieldName:this.outStatisticFieldName,statisticType:this.statisticType,statisticParameters:R(this.statisticParameters)})}};c([h({type:Number,json:{write:!0}})],vr.prototype,"maxPointCount",void 0),c([h({type:Number,json:{write:!0}})],vr.prototype,"maxRecordCount",void 0),c([h({type:Number,json:{write:!0}})],vr.prototype,"maxVertexCount",void 0),c([h({type:String,json:{write:!0}})],vr.prototype,"onStatisticField",void 0),c([h({type:String,json:{write:!0}})],vr.prototype,"outStatisticFieldName",void 0),c([h({type:String,json:{read:{source:"statisticType",reader:SC.read},write:{target:"statisticType",writer:SC.write}}})],vr.prototype,"statisticType",void 0),c([h({type:Object})],vr.prototype,"statisticParameters",void 0),c([ie("statisticParameters")],vr.prototype,"writeStatisticParameters",null),vr=GS=c([S("esri.rest.support.StatisticDefinition")],vr);const y5=vr;var Ph;const rte=new Ie({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),nte=new Ie({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let de=Ph=class extends W{constructor(e){super(e),this.aggregateIds=null,this.cacheHint=void 0,this.compactGeometryEnabled=!1,this.datumTransformation=null,this.defaultSpatialReferenceEnabled=!1,this.distance=void 0,this.dynamicDataSource=void 0,this.formatOf3DObjects=null,this.fullText=null,this.gdbVersion=null,this.geometry=null,this.geometryPrecision=void 0,this.groupByFieldsForStatistics=null,this.having=null,this.historicMoment=null,this.maxAllowableOffset=void 0,this.maxRecordCountFactor=1,this.multipatchOption=null,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.outStatistics=null,this.parameterValues=null,this.pixelSize=null,this.quantizationParameters=null,this.rangeValues=null,this.relationParameter=null,this.resultType=null,this.returnCentroid=!1,this.returnDistinctValues=!1,this.returnExceededLimitFeatures=!0,this.returnGeometry=!1,this.returnQueryGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.sourceSpatialReference=null,this.spatialRelationship="intersects",this.start=void 0,this.sqlFormat=null,this.text=null,this.timeExtent=null,this.timeReferenceUnknownClient=!1,this.units=null,this.where=null}static from(e){return VM(Ph,e)}castDatumTransformation(e){return typeof e=="number"||typeof e=="object"?e:null}writeHistoricMoment(e,t){t.historicMoment=e&&e.getTime()}writeParameterValues(e,t){if(e){const i={};for(const s in e){const r=e[s];Array.isArray(r)?i[s]=r.map(n=>n instanceof Date?n.getTime():n):r instanceof Date?i[s]=r.getTime():i[s]=r}t.parameterValues=i}}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10,t.where="1=1"}writeWhere(e,t){t.where=e||"1=1"}clone(){return new Ph(R({aggregateIds:this.aggregateIds,cacheHint:this.cacheHint,compactGeometryEnabled:this.compactGeometryEnabled,datumTransformation:this.datumTransformation,defaultSpatialReferenceEnabled:this.defaultSpatialReferenceEnabled,distance:this.distance,fullText:this.fullText,gdbVersion:this.gdbVersion,geometry:this.geometry,geometryPrecision:this.geometryPrecision,groupByFieldsForStatistics:this.groupByFieldsForStatistics,having:this.having,historicMoment:M(this.historicMoment)?new Date(this.historicMoment.getTime()):null,maxAllowableOffset:this.maxAllowableOffset,maxRecordCountFactor:this.maxRecordCountFactor,multipatchOption:this.multipatchOption,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,outStatistics:this.outStatistics,parameterValues:this.parameterValues,pixelSize:this.pixelSize,quantizationParameters:this.quantizationParameters,rangeValues:this.rangeValues,relationParameter:this.relationParameter,resultType:this.resultType,returnDistinctValues:this.returnDistinctValues,returnGeometry:this.returnGeometry,returnCentroid:this.returnCentroid,returnExceededLimitFeatures:this.returnExceededLimitFeatures,returnQueryGeometry:this.returnQueryGeometry,returnM:this.returnM,returnZ:this.returnZ,dynamicDataSource:this.dynamicDataSource,sourceSpatialReference:this.sourceSpatialReference,spatialRelationship:this.spatialRelationship,start:this.start,sqlFormat:this.sqlFormat,text:this.text,timeExtent:this.timeExtent,timeReferenceUnknownClient:this.timeReferenceUnknownClient,units:this.units,where:this.where}))}};de.MAX_MAX_RECORD_COUNT_FACTOR=5,c([h({json:{write:!0}})],de.prototype,"aggregateIds",void 0),c([h({type:Boolean,json:{write:!0}})],de.prototype,"cacheHint",void 0),c([h({type:Boolean,json:{default:!1,write:!0}})],de.prototype,"compactGeometryEnabled",void 0),c([h({json:{write:!0}})],de.prototype,"datumTransformation",void 0),c([Oe("datumTransformation")],de.prototype,"castDatumTransformation",null),c([h({type:Boolean,json:{default:!1,write:!0}})],de.prototype,"defaultSpatialReferenceEnabled",void 0),c([h({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],de.prototype,"distance",void 0),c([h({type:Er,json:{write:!0}})],de.prototype,"dynamicDataSource",void 0),c([h({type:String,json:{write:!0}})],de.prototype,"formatOf3DObjects",void 0),c([h({type:[ste],json:{write:{enabled:!0,overridePolicy(){return{enabled:M(this.fullText)&&this.fullText.length>0}}}}})],de.prototype,"fullText",void 0),c([h({type:String,json:{write:!0}})],de.prototype,"gdbVersion",void 0),c([h({types:fu,json:{read:ll,write:!0}})],de.prototype,"geometry",void 0),c([h({type:Number,json:{write:!0}})],de.prototype,"geometryPrecision",void 0),c([h({type:[String],json:{write:!0}})],de.prototype,"groupByFieldsForStatistics",void 0),c([h({type:String,json:{write:!0}})],de.prototype,"having",void 0),c([h({type:Date})],de.prototype,"historicMoment",void 0),c([ie("historicMoment")],de.prototype,"writeHistoricMoment",null),c([h({type:Number,json:{write:!0}})],de.prototype,"maxAllowableOffset",void 0),c([h({type:Number,cast:e=>e<1?1:e>Ph.MAX_MAX_RECORD_COUNT_FACTOR?Ph.MAX_MAX_RECORD_COUNT_FACTOR:e,json:{write:{overridePolicy:e=>({enabled:e>1})}}})],de.prototype,"maxRecordCountFactor",void 0),c([h({type:["xyFootprint"],json:{write:!0}})],de.prototype,"multipatchOption",void 0),c([h({type:Number,json:{read:{source:"resultRecordCount"}}})],de.prototype,"num",void 0),c([h({json:{write:!0}})],de.prototype,"objectIds",void 0),c([h({type:[String],json:{write:!0}})],de.prototype,"orderByFields",void 0),c([h({type:[String],json:{write:!0}})],de.prototype,"outFields",void 0),c([h({type:xe,json:{name:"outSR",write:!0}})],de.prototype,"outSpatialReference",void 0),c([h({type:[y5],json:{write:{enabled:!0,overridePolicy(){return{enabled:M(this.outStatistics)&&this.outStatistics.length>0}}}}})],de.prototype,"outStatistics",void 0),c([h({json:{write:!0}})],de.prototype,"parameterValues",void 0),c([ie("parameterValues")],de.prototype,"writeParameterValues",null),c([h({type:be,json:{write:!0}})],de.prototype,"pixelSize",void 0),c([h({type:m5,json:{write:!0}})],de.prototype,"quantizationParameters",void 0),c([h({type:[Object],json:{write:!0}})],de.prototype,"rangeValues",void 0),c([h({type:String,json:{read:{source:"relationParam"},write:{target:"relationParam",overridePolicy(){return{enabled:this.spatialRelationship==="relation"}}}}})],de.prototype,"relationParameter",void 0),c([h({type:String,json:{write:!0}})],de.prototype,"resultType",void 0),c([h({type:Boolean,json:{default:!1,write:!0}})],de.prototype,"returnCentroid",void 0),c([h({type:Boolean,json:{default:!1,write:!0}})],de.prototype,"returnDistinctValues",void 0),c([h({type:Boolean,json:{default:!0,write:!0}})],de.prototype,"returnExceededLimitFeatures",void 0),c([h({type:Boolean,json:{write:!0}})],de.prototype,"returnGeometry",void 0),c([h({type:Boolean,json:{default:!1,write:!0}})],de.prototype,"returnQueryGeometry",void 0),c([h({type:Boolean,json:{default:!1,write:!0}})],de.prototype,"returnM",void 0),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],de.prototype,"returnZ",void 0),c([h({type:xe,json:{write:!0}})],de.prototype,"sourceSpatialReference",void 0),c([ue(rte,{ignoreUnknown:!1,name:"spatialRel"})],de.prototype,"spatialRelationship",void 0),c([h({type:Number,json:{read:{source:"resultOffset"}}})],de.prototype,"start",void 0),c([ie("start"),ie("num")],de.prototype,"writeStart",null),c([h({type:String,json:{write:!0}})],de.prototype,"sqlFormat",void 0),c([h({type:String,json:{write:!0}})],de.prototype,"text",void 0),c([h({type:Ln,json:{write:!0}})],de.prototype,"timeExtent",void 0),c([h({type:Boolean,json:{default:!1,write:!0}})],de.prototype,"timeReferenceUnknownClient",void 0),c([ue(nte,{ignoreUnknown:!1}),h({json:{write:{overridePolicy(e){return{enabled:!!e&&this.distance!=null&&this.distance>0}}}}})],de.prototype,"units",void 0),c([h({type:String,json:{write:{overridePolicy(e){return{enabled:e!=null||this.start!=null&&this.start>0}}}}})],de.prototype,"where",void 0),c([ie("where")],de.prototype,"writeWhere",null),de=Ph=c([S("esri.rest.support.Query")],de);const $n=de;async function rw(e,t,i){const s=await ote(e,t,i);return Wb.fromJSON(s)}async function ote(e,t,i){const s=n5(e),r={...i},n=$n.from(t),{data:o}=await p5(s,n,n.sourceSpatialReference,r);return o}function fi(e,t){return e?t?4:3:t?3:2}const bd=q.getLogger("esri.layers.graphics.featureConversionUtils"),g5={esriGeometryPoint:0,esriGeometryPolyline:2,esriGeometryPolygon:3,esriGeometryMultipoint:0},ate=(e,t,i,s,r,n)=>{e[i]=r,e[i+1]=n},MC=(e,t,i,s,r,n)=>{e[i]=r,e[i+1]=n,e[i+2]=t[s+2]},lte=(e,t,i,s,r,n)=>{e[i]=r,e[i+1]=n,e[i+2]=t[s+3]},cte=(e,t,i,s,r,n)=>{e[i]=r,e[i+1]=n,e[i+2]=t[s+2],e[i+3]=t[s+3]};function wT(e,t,i,s){if(e){if(i)return t&&s?cte:MC;if(t&&s)return lte}else if(t&&s)return MC;return ate}function nw({scale:e,translate:t},i){return Math.round((i-t[0])/e[0])}function ow({scale:e,translate:t},i){return Math.round((t[1]-i)/e[1])}function aw({scale:e,translate:t},i,s){return i*e[s]+t[s]}function h_e(e,t,i){return e?t?i?MT(e):xT(e):i?ST(e):Hb(e):null}function Hb(e){const t=e.coords;return{x:t[0],y:t[1]}}function v5(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e}function xT(e){const t=e.coords;return{x:t[0],y:t[1],z:t[2]}}function ute(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.z,e}function ST(e){const t=e.coords;return{x:t[0],y:t[1],m:t[2]}}function hte(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.m,e}function MT(e){const t=e.coords;return{x:t[0],y:t[1],z:t[2],m:t[3]}}function dte(e,t){return e.coords[0]=t.x,e.coords[1]=t.y,e.coords[2]=t.z,e.coords[3]=t.m,e}function pte(e,t,i,s){let r=Hb;i&&s?r=MT:i?r=xT:s&&(r=ST);for(const n of t){const{geometry:o,attributes:a}=n,l=M(o)?r(o):null;e.push({attributes:a,geometry:l})}return e}function $T(e,t){return e&&t?dte:e?ute:t?hte:v5}function b5(e,t,i,s,r){const n=$T(i,s);for(const{geometry:o,attributes:a}of t){const l=M(o)?n(new zi,o):null;e.push(new Pn(l,a,null,r?a[r]:void 0))}return e}function d_e(e,t,i=$T(t.z!=null,t.m!=null)){return i(e,t)}function fte(e,t,i,s){for(const{geometry:r,attributes:n}of t)e.push({attributes:n,geometry:M(r)?_5(r,i,s):null});return e}function _5(e,t,i){if(N(e))return null;const s=fi(t,i),r=[];for(let n=0;n=l&&(e.lengths.push(k),I=$)}return Br(e.coords,I),e.coords.length?e:null}function w_e(e,t,i,s,r,n,o=i,a=s){if(Eo(e),!t||!t.coords.length)return null;const l=g5[r],{coords:u,lengths:d}=t,f=fi(i,s),m=fi(i&&o,s&&a),y=wT(i,s,o,a);if(!d.length)return y(e.coords,u,0,0,u[0],u[1]),Eo(e,f,0),e;let g=0;const v=n*n;for(const b of d){if(b=l?e.lengths.push(I):Br(e.coords,_*m),g+=b*f}return e.coords.length?e:null}function _te(e,t,i,s){const r=e[t],n=e[t+1],o=e[i],a=e[i+1],l=e[s],u=e[s+1];let d=o,f=a,m=l-d,y=u-f;if(m!==0||y!==0){const g=((r-d)*m+(n-f)*y)/(m*m+y*y);g>1?(d=l,f=u):g>0&&(d+=m*g,f+=y*g)}return m=r-d,y=n-f,m*m+y*y}function WS(e,t,i,s,r,n,o){let a,l=s,u=0;for(let d=n+i;dl&&(u=d,l=a);l>s&&(u-n>i&&WS(e,t,i,s,r,n,u),r(e,t,e.length,u,t[u],t[u+1]),o-u>i&&WS(e,t,i,s,r,u,o))}function x_e(e,t,i,s){if(N(t)||!t.coords||!t.coords.length)return null;const r=fi(i,s);let n=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY,a=Number.NEGATIVE_INFINITY,l=Number.NEGATIVE_INFINITY;if(t&&t.coords){const u=t.coords;for(let d=0;d0&&this.where==null&&(t.definitionExpression="1=1")}clone(){return new HS(R({cacheHint:this.cacheHint,dynamicDataSource:this.dynamicDataSource,gdbVersion:this.gdbVersion,geometryPrecision:this.geometryPrecision,historicMoment:this.historicMoment&&new Date(this.historicMoment.getTime()),maxAllowableOffset:this.maxAllowableOffset,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,relationshipId:this.relationshipId,start:this.start,num:this.num,returnGeometry:this.returnGeometry,where:this.where,returnZ:this.returnZ,returnM:this.returnM}))}};c([h({type:Boolean,json:{write:!0}})],dt.prototype,"cacheHint",void 0),c([h({type:Er,json:{write:!0}})],dt.prototype,"dynamicDataSource",void 0),c([h({type:String,json:{write:!0}})],dt.prototype,"gdbVersion",void 0),c([h({type:Number,json:{write:!0}})],dt.prototype,"geometryPrecision",void 0),c([h({type:Date})],dt.prototype,"historicMoment",void 0),c([ie("historicMoment")],dt.prototype,"_writeHistoricMoment",null),c([h({type:Number,json:{write:!0}})],dt.prototype,"maxAllowableOffset",void 0),c([h({type:[Number],json:{write:!0}})],dt.prototype,"objectIds",void 0),c([h({type:[String],json:{write:!0}})],dt.prototype,"orderByFields",void 0),c([h({type:[String],json:{write:!0}})],dt.prototype,"outFields",void 0),c([h({type:xe,json:{read:{source:"outSR"},write:{target:"outSR"}}})],dt.prototype,"outSpatialReference",void 0),c([h({json:{write:!0}})],dt.prototype,"relationshipId",void 0),c([h({type:Number,json:{read:{source:"resultOffset"}}})],dt.prototype,"start",void 0),c([ie("start"),ie("num")],dt.prototype,"writeStart",null),c([h({type:Number,json:{read:{source:"resultRecordCount"}}})],dt.prototype,"num",void 0),c([h({json:{write:!0}})],dt.prototype,"returnGeometry",void 0),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],dt.prototype,"returnM",void 0),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],dt.prototype,"returnZ",void 0),c([h({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],dt.prototype,"where",void 0),dt=HS=c([S("esri.rest.support.RelationshipQuery")],dt),dt.from=Dt(dt);const am=dt;var YS;let Wu=YS=class extends W{constructor(e){super(e),this.groupByFields=void 0,this.topCount=void 0,this.orderByFields=void 0}clone(){return new YS({groupByFields:this.groupByFields,topCount:this.topCount,orderByFields:this.orderByFields})}};c([h({type:[String],json:{write:!0}})],Wu.prototype,"groupByFields",void 0),c([h({type:Number,json:{write:!0}})],Wu.prototype,"topCount",void 0),c([h({type:[String],json:{write:!0}})],Wu.prototype,"orderByFields",void 0),Wu=YS=c([S("esri.rest.support.TopFilter")],Wu);const Ste=Wu;var JS;const IC=new Ie({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),EC=new Ie({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let et=JS=class extends W{constructor(e){super(e),this.cacheHint=void 0,this.distance=void 0,this.geometry=null,this.geometryPrecision=void 0,this.maxAllowableOffset=void 0,this.num=void 0,this.objectIds=null,this.orderByFields=null,this.outFields=null,this.outSpatialReference=null,this.resultType=null,this.returnGeometry=!1,this.returnM=void 0,this.returnZ=void 0,this.start=void 0,this.spatialRelationship="intersects",this.timeExtent=null,this.topFilter=void 0,this.units=null,this.where="1=1"}writeStart(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10}clone(){return new JS(R({cacheHint:this.cacheHint,distance:this.distance,geometry:this.geometry,geometryPrecision:this.geometryPrecision,maxAllowableOffset:this.maxAllowableOffset,num:this.num,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,resultType:this.resultType,returnGeometry:this.returnGeometry,returnZ:this.returnZ,returnM:this.returnM,start:this.start,spatialRelationship:this.spatialRelationship,timeExtent:this.timeExtent,topFilter:this.topFilter,units:this.units,where:this.where}))}};c([h({type:Boolean,json:{write:!0}})],et.prototype,"cacheHint",void 0),c([h({type:Number,json:{write:{overridePolicy:e=>({enabled:e>0})}}})],et.prototype,"distance",void 0),c([h({types:fu,json:{read:ll,write:!0}})],et.prototype,"geometry",void 0),c([h({type:Number,json:{write:!0}})],et.prototype,"geometryPrecision",void 0),c([h({type:Number,json:{write:!0}})],et.prototype,"maxAllowableOffset",void 0),c([h({type:Number,json:{read:{source:"resultRecordCount"}}})],et.prototype,"num",void 0),c([h({json:{write:!0}})],et.prototype,"objectIds",void 0),c([h({type:[String],json:{write:!0}})],et.prototype,"orderByFields",void 0),c([h({type:[String],json:{write:!0}})],et.prototype,"outFields",void 0),c([h({type:xe,json:{read:{source:"outSR"},write:{target:"outSR"}}})],et.prototype,"outSpatialReference",void 0),c([h({type:String,json:{write:!0}})],et.prototype,"resultType",void 0),c([h({json:{write:!0}})],et.prototype,"returnGeometry",void 0),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],et.prototype,"returnM",void 0),c([h({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],et.prototype,"returnZ",void 0),c([h({type:Number,json:{read:{source:"resultOffset"}}})],et.prototype,"start",void 0),c([ie("start"),ie("num")],et.prototype,"writeStart",null),c([h({type:String,json:{read:{source:"spatialRel",reader:IC.read},write:{target:"spatialRel",writer:IC.write}}})],et.prototype,"spatialRelationship",void 0),c([h({type:Ln,json:{write:!0}})],et.prototype,"timeExtent",void 0),c([h({type:Ste,json:{write:!0}})],et.prototype,"topFilter",void 0),c([h({type:String,json:{read:EC.read,write:{writer:EC.write,overridePolicy(e){return{enabled:M(e)&&M(this.distance)&&this.distance>0}}}}})],et.prototype,"units",void 0),c([h({type:String,json:{write:!0}})],et.prototype,"where",void 0),et=JS=c([S("esri.rest.support.TopFeaturesQuery")],et),et.from=Dt(et);const ky=et,Mte="esri.widgets.Feature.support.relatedFeatureUtils",kC=q.getLogger(Mte),CC=new Map;function XS(e){if(!xo(e))return null;const[t,i]=e.split("/").slice(1);return{layerId:t,fieldName:i}}function $te(e,t){if(!t.relationships)return null;let i=null;const{relationships:s}=t;return s.some(r=>r.id===parseInt(e,10)&&(i=r,!0)),i}function Tte({originRelationship:e,relationships:t,layerId:i}){let s;return t&&t.some(r=>(`${r.relatedTableId}`===i&&r.id===e.id&&(s=r),!!s)),s}function Ite(e,t){const i=t.toLowerCase();for(const s in e)if(s.toLowerCase()===i)return e[s];return null}function Ete(e,t){const i=$te(e,t);if(!!i)return{url:`${t.url}/${i.relatedTableId}`,sourceSpatialReference:t.spatialReference,relation:i,relatedFields:[],outStatistics:[]}}function kte(e,t){if(!t||!e)return;const{features:i,statsFeatures:s}=e,r=i&&i.value;t.relatedFeatures=r?r.features:[];const n=s&&s.value;t.relatedStatsFeatures=n?n.features:[]}function Cte(e,t,i,s){const r=new am;return r.outFields=["*"],r.relationshipId=typeof t.id=="number"?t.id:parseInt(t.id,10),r.objectIds=[e.attributes[i.objectIdField]],i.queryRelatedFeatures(r,s)}function Pte(e,t,i){let s=0;const r=[];for(;sv.attributes[n.objectIdField]);if((l==null?void 0:l.length)>0&&n.supportsStatistics){const v=new $n;v.where=Pte(n.objectIdField,g,1e3),v.outFields=a,v.outStatistics=l,v.sourceSpatialReference=d;const b={features:Promise.resolve(y),statsFeatures:rw(u,v)};return as(b)}}const m=f==null?void 0:f.keyField;if(m){const y=Y$(Dte(n.fields,m)),g=Ite(e.attributes,o.keyField),v=y?`${m}=${g}`:`${m}='${g}'`,b=rw(u,new $n({where:v,outFields:t.relatedFields,sourceSpatialReference:d}),s),_=t.outStatistics&&t.outStatistics.length>0&&n.supportsStatistics?rw(u,new $n({where:v,outFields:t.relatedFields,outStatistics:t.outStatistics,sourceSpatialReference:d}),s):null,x={features:b};return _&&(x.statsFeatures=_),as(x)}return null}function Ote(e,t){return kt(e,{query:{f:"json"},signal:t&&t.signal})}function Rte({relatedInfos:e,layer:t},i){const s={};return e.forEach((r,n)=>{const{relation:o}=r;if(!o){const f=new L("relation-required","A relation is required on a layer to retrieve related records.");throw kC.error(f),f}const{relatedTableId:a}=o;if(typeof a!="number"){const f=new L("A related table ID is required on a layer to retrieve related records.");throw kC.error(f),f}const l=`${t.url}/${a}`,u=CC.get(l),d=u||Ote(l,i);u||CC.set(l,d),s[n]=d}),as(s)}function Lte({graphic:e,relatedInfos:t,layer:i},s){const r={};return t.forEach((n,o)=>{n.layerInfo&&(r[o]=Ate(e,n,i,s))}),as(r)}function Fte({relatedInfo:e,fieldName:t,fieldInfo:i}){if(e.relatedFields.push(t),i.statisticType){const s=new y5({statisticType:i.statisticType,onStatisticField:t,outStatisticFieldName:t});e.outStatistics.push(s)}}function Dte(e,t){if(e!=null){t=t.toLowerCase();for(const i of e)if(i&&i.name.toLowerCase()===t)return i}return null}const PC={chartAnimation:!0};let Yt=class extends oe{constructor(e){super(e),this.abilities={...PC},this.activeMediaInfoIndex=0,this.attributes=null,this.description=null,this.fieldInfoMap=null,this.formattedAttributes=null,this.expressionAttributes=null,this.layer=null,this.mediaInfos=null,this.popupTemplate=null,this.relatedInfos=null,this.title=null}castAbilities(e){return{...PC,...e}}get activeMediaInfo(){return this.formattedMediaInfos[this.activeMediaInfoIndex]||null}get formattedMediaInfos(){return this._formatMediaInfos()||[]}get formattedMediaInfoCount(){return this.formattedMediaInfos.length}setActiveMedia(e){this._setContentElementMedia(e)}next(){this._pageContentElementMedia(1)}previous(){this._pageContentElementMedia(-1)}_setContentElementMedia(e){const{formattedMediaInfoCount:t}=this,i=(e+t)%t;this.activeMediaInfoIndex=i}_pageContentElementMedia(e){const{activeMediaInfoIndex:t}=this,i=t+e;this._setContentElementMedia(i)}_formatMediaInfos(){const{attributes:e,mediaInfos:t,formattedAttributes:i,expressionAttributes:s,fieldInfoMap:r,layer:n}=this;return t==null?void 0:t.map(o=>{const a=o==null?void 0:o.clone();if(!a)return null;if(a.title=Rc({attributes:e,fieldInfoMap:r,globalAttributes:i,expressionAttributes:s,layer:n,text:a.title}),a.caption=Rc({attributes:e,fieldInfoMap:r,globalAttributes:i,expressionAttributes:s,layer:n,text:a.caption}),a.altText=Rc({attributes:e,fieldInfoMap:r,globalAttributes:i,expressionAttributes:s,layer:n,text:a.altText}),a.type==="image"){const{value:l}=a;return this._setImageValue({value:l,formattedAttributes:i,layer:n}),a.value.sourceURL?a:void 0}if(a.type==="pie-chart"||a.type==="line-chart"||a.type==="column-chart"||a.type==="bar-chart"){const{value:l}=a;return this._setChartValue({value:l,chartType:a.type,attributes:e,formattedAttributes:i,layer:n,expressionAttributes:s}),a}return null}).filter(Boolean)}_setImageValue(e){const{fieldInfoMap:t}=this,{value:i,formattedAttributes:s,layer:r}=e,{linkURL:n,sourceURL:o}=i;if(o){const a=TS(o,r);i.sourceURL=$S({formattedAttributes:s,template:a,fieldInfoMap:t})}if(n){const a=TS(n,r);i.linkURL=$S({formattedAttributes:s,template:a,fieldInfoMap:t})}}_setChartValue(e){const{value:t,attributes:i,formattedAttributes:s,chartType:r,layer:n,expressionAttributes:o}=e,{popupTemplate:a,relatedInfos:l}=this,{fields:u,normalizeField:d}=t;if(t.fields=sK(u,n),d&&(t.normalizeField=nm(d,n)),!u.some(m=>!!(s[m]!=null||xo(m)&&l.size)))return;const f=a==null?void 0:a.fieldInfos;u.forEach(m=>{if(xo(m))return void(t.series=[...t.series,...this._getRelatedChartInfos({fieldInfos:f,fieldName:m,formattedAttributes:s,chartType:r,value:t})]);const y=this._getChartOption({value:t,attributes:i,chartType:r,formattedAttributes:s,expressionAttributes:o,fieldName:m,fieldInfos:f});t.series.push(y)})}_getRelatedChartInfos(e){var g;const{fieldInfos:t,fieldName:i,formattedAttributes:s,chartType:r,value:n}=e,o=[],a=XS(i),{layerId:l,fieldName:u}=a,d=(g=this.relatedInfos)==null?void 0:g.get(l.toString());if(!d)return o;const{relatedFeatures:f,relation:m}=d;if(!m||!f)return o;const{cardinality:y}=m;return f.forEach(v=>{const{attributes:b}=v;b&&Object.keys(b).forEach(_=>{_===u&&o.push(this._getChartOption({value:n,attributes:b,formattedAttributes:s,fieldName:i,chartType:r,relatedFieldName:_,fieldInfos:t}))})}),y==="one-to-many"||y==="many-to-many"?o:[o[0]]}_getTooltip({label:e,value:t,chartType:i}){return i==="pie-chart"?`${e}`:`${e}: ${t}`}_getChartOption(e){var I,T,k,A,F,G;const{value:t,attributes:i,formattedAttributes:s,expressionAttributes:r,fieldName:n,relatedFieldName:o,fieldInfos:a,chartType:l}=e,{layer:u,fieldInfoMap:d}=this,{normalizeField:f,tooltipField:m}=t,y=f?xo(f)?i[XS(f).fieldName]:i[f]:null,g=pT(n)&&r&&r[n]!==void 0?r[n]:o&&i[o]!==void 0?i[o]:i[n]!==void 0?i[n]:s[n],v=new zD({fieldName:n,value:g===void 0?null:g&&y?g/y:g});if(xo(n)){const U=d.get(n.toLowerCase()),J=d.get(m.toLowerCase()),H=(I=U==null?void 0:U.fieldName)!=null?I:n,te=(F=(A=(k=s[(T=J==null?void 0:J.fieldName)!=null?T:m])!=null?k:U==null?void 0:U.label)!=null?A:U==null?void 0:U.fieldName)!=null?F:o,se=s[H];return v.tooltip=this._getTooltip({label:te,value:se,chartType:l}),v}const b=GN(a,n),_=nm(n,u),x=m&&s[m]!==void 0?s[m]:UN(b||new Fm({fieldName:_}),(G=this.popupTemplate)==null?void 0:G.expressionInfos),$=s[_];return v.tooltip=this._getTooltip({label:x,value:$,chartType:l}),v}};c([h()],Yt.prototype,"abilities",void 0),c([Oe("abilities")],Yt.prototype,"castAbilities",null),c([h()],Yt.prototype,"activeMediaInfoIndex",void 0),c([h({readOnly:!0})],Yt.prototype,"activeMediaInfo",null),c([h()],Yt.prototype,"attributes",void 0),c([h()],Yt.prototype,"description",void 0),c([h()],Yt.prototype,"fieldInfoMap",void 0),c([h()],Yt.prototype,"formattedAttributes",void 0),c([h()],Yt.prototype,"expressionAttributes",void 0),c([h({readOnly:!0})],Yt.prototype,"formattedMediaInfos",null),c([h()],Yt.prototype,"layer",void 0),c([h({readOnly:!0})],Yt.prototype,"formattedMediaInfoCount",null),c([h()],Yt.prototype,"mediaInfos",void 0),c([h()],Yt.prototype,"popupTemplate",void 0),c([h()],Yt.prototype,"relatedInfos",void 0),c([h()],Yt.prototype,"title",void 0),Yt=c([S("esri.widgets.Feature.FeatureMedia.FeatureMediaViewModel")],Yt);const Fc=Yt;var AC=["#ffffff","#858585","#ffbebe","#ffebbe","#ffebaf","#ffffbe","#e9ffbe","#d3ffbe","#beffe8","#bee8ff","#bed2ff","#e8beff","#ffbee8","#ebebeb","#707070","#ff7f7f","#ffa77f","#ffd37f","#ffff73","#d1ff73","#a3ff73","#73ffdf","#73dfff","#73b2ff","#df73ff","#ff73df","#d6d6d6","#5c5c5c","#ff0000","#ff5500","#ffaa00","#ffff00","#aaff00","#55ff00","#00ffc5","#00c5ff","#0070ff","#c500ff","#ff00c5","#c2c2c2","#474747","#e60000","#e64c00","#e69800","#e6e600","#98e600","#4ce600","#00e6a9","#00a9e6","#005ce6","#a900e6","#e600a9","#adadad","#242424","#a80000","#a83800","#a87000","#a8a800","#70a800","#38a800","#00a884","#0084a8","#004da8","#8400a8","#a80084","#999999","#1a1a1a","#730000","#732600","#734c00","#737300","#4c7300","#267300","#00734c","#004c73","#002673","#4c0073","#73004"],Nte=[].concat(AC.slice(30,39),AC.slice(28,30).reverse()),jte=[{name:"default",colors:Nte},{name:"cat-dark",colors:["#ed5151","#149ece","#a7c636","#9e559c","#fc921f","#ffde3e","#f789d8","#b7814a","#3caf99","#6b6bd6","#b54779","#7f7f7f"]},{name:"tropical-bliss",colors:["#fce138","#ff9399","#fcd27e","#f1983c","#a553b7","#b1a9d0","#6ecffc","#4c81cd","#fc6f84","#fc3e5a","#6af689","#48885c"]},{name:"desert-blooms",colors:["#102432","#144d59","#ffc730","#ed9310","#a64f1b","#661510","#d9351a","#b31515","#4a0932","#8c213f","#18382e","#2c6954"]},{name:"under-the-sea",colors:["#bf9727","#607100","#00734c","#704489","#01acca","#024e76","#f09100","#ea311f","#c6004b","#7570b3","#666666","#333333"]},{name:"vibrant-rainbow",colors:["#fffb00","#f5cb11","#9fd40c","#46e39c","#32b8a6","#7ff2fa","#ac08cc","#dd33ff","#eb7200","#e8a784","#bf2e2e","#6c7000"]},{name:"ocean-bay",colors:["#191921","#11495c","#78b1c2","#454f4b","#8f8f82","#9be0c0","#87b051","#f7ec88","#ebdcc1","#dbb658","#c43541","#75351e"]},{name:"prairie-summer",colors:["#332424","#751555","#d47013","#d68989","#211173","#82aad6","#7bfaeb","#6ec9a8","#6b6408","#eada40","#ccc54a","#1fc235"]},{name:"pastel-chalk",colors:["#fffd99","#f5e6a4","#c1d48c","#b8e3d0","#a0b8b5","#cbf7fa","#d791f2","#dfc1eb","#f2b983","#e8c4b2","#bf8e8e","#94995c"]},{name:"seq-yellow-orange-red-bright",colors:["#910000","#b1260b","#c0370f","#e05919","#ef6a1d","#ff7b22","#ffa143","#ffb454","#ffda74","#ffed85"]},{name:"seq-reds-bright",colors:["#57453b","#7b4238","#9f4036","#c23d33","#d7483c","#ec5244","#f3696c","#f9816c","#ffc4ae","#fff0dc"]},{name:"seq-purples-bright",colors:["#4e465c","#5a4a78","#695291","#775baa","#8663c3","#946bdc","#aa89e8","#c1a6f3","#d7c4ff","#e6e1ff"]},{name:"seq-blues-bright",colors:["#404d54","#435c6c","#48799d","#4b88b6","#4d96ce","#50a5e7","#74bbed","#98d0f3","#bce6f9","#e6faff"]},{name:"seq-greens-bright",colors:["#39544c","#386757","#368165","#359b73","#33b581","#4bc392","#64d2a2","#7ce0b3","#cbf6d9","#f4ffea"]},{name:"seq-browns-bright",colors:["#524834","#715b38","#8f6e3c","#ae8140","#cc9444","#eba748","#eeb664","#f0c47f","#f9e0b7","#fff8eb"]}];const OC="en-us",TT=new Map([["ar",()=>z(()=>import("./ar.86cc1692.js"),["assets/ar.86cc1692.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.a)],["bg-bg",()=>z(()=>import("./bg_BG.b736e920.js"),["assets/bg_BG.b736e920.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.b)],["bs-ba",()=>z(()=>import("./bs_BA.a323ad66.js"),["assets/bs_BA.a323ad66.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.b)],["ca-es",()=>z(()=>import("./ca_ES.ef58828b.js"),["assets/ca_ES.ef58828b.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.c)],["cs-cz",()=>z(()=>import("./cs_CZ.b2d386a1.js"),["assets/cs_CZ.b2d386a1.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.c)],["da-dk",()=>z(()=>import("./da_DK.16566135.js"),["assets/da_DK.16566135.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.d)],["de-de",()=>z(()=>import("./de_DE.ce6610cd.js"),["assets/de_DE.ce6610cd.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.d)],["de-ch",()=>z(()=>import("./de_CH.60578987.js"),["assets/de_CH.60578987.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.d)],["el-gr",()=>z(()=>import("./el_GR.d4c6a4ee.js"),["assets/el_GR.d4c6a4ee.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.e)],["en-us",()=>z(()=>import("./en_US.71a65555.js"),["assets/en_US.71a65555.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.e)],["en-ca",()=>z(()=>import("./en_CA.ec6c2b7c.js"),["assets/en_CA.ec6c2b7c.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.e)],["es-es",()=>z(()=>import("./es_ES.ef1b40e9.js"),["assets/es_ES.ef1b40e9.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.e)],["et-ee",()=>z(()=>import("./et_EE.b9efffde.js"),["assets/et_EE.b9efffde.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.e)],["fi-fi",()=>z(()=>import("./fi_FI.6b2b8640.js"),["assets/fi_FI.6b2b8640.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.f)],["fr-fr",()=>z(()=>import("./fr_FR.0d0aa4b2.js"),["assets/fr_FR.0d0aa4b2.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.f)],["he-il",()=>z(()=>import("./he_IL.cefd7375.js"),["assets/he_IL.cefd7375.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.h)],["hr-hr",()=>z(()=>import("./hr_HR.f054665f.js"),["assets/hr_HR.f054665f.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.h)],["hu-hu",()=>z(()=>import("./hu_HU.6eb2e3c1.js"),["assets/hu_HU.6eb2e3c1.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.h)],["id-id",()=>z(()=>import("./id_ID.2f4d1d20.js"),["assets/id_ID.2f4d1d20.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.i)],["it-it",()=>z(()=>import("./it_IT.d99d283a.js"),["assets/it_IT.d99d283a.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.i)],["ja-jp",()=>z(()=>import("./ja_JP.02630a59.js"),["assets/ja_JP.02630a59.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.j)],["ko-kr",()=>z(()=>import("./ko_KR.494abdb6.js"),["assets/ko_KR.494abdb6.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.k)],["lt-lt",()=>z(()=>import("./lt_LT.e5dc3b07.js"),["assets/lt_LT.e5dc3b07.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.l)],["lv-lv",()=>z(()=>import("./lv_LV.006fe0d6.js"),["assets/lv_LV.006fe0d6.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.l)],["nb-no",()=>z(()=>import("./nb_NO.17aa1247.js"),["assets/nb_NO.17aa1247.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.n)],["nl-nl",()=>z(()=>import("./nl_NL.bb55a4a7.js"),["assets/nl_NL.bb55a4a7.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.n)],["pl-pl",()=>z(()=>import("./pl_PL.ca3d90a7.js"),["assets/pl_PL.ca3d90a7.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.p)],["pt-br",()=>z(()=>import("./pt_BR.07fbb84b.js"),["assets/pt_BR.07fbb84b.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.p)],["pt-pt",()=>z(()=>import("./pt_PT.e82fce8e.js"),["assets/pt_PT.e82fce8e.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.p)],["ro-ro",()=>z(()=>import("./ro_RO.08a11e64.js"),["assets/ro_RO.08a11e64.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.r)],["ru-ru",()=>z(()=>import("./ru_RU.4b08b8da.js"),["assets/ru_RU.4b08b8da.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.r)],["sk-sk",()=>z(()=>import("./sk_SK.c9cf24d2.js"),["assets/sk_SK.c9cf24d2.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.s)],["sl-sl",()=>z(()=>import("./sl_SL.7bddc01e.js"),["assets/sl_SL.7bddc01e.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.s)],["sr-rs",()=>z(()=>import("./sr_RS.9d484aca.js"),["assets/sr_RS.9d484aca.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.s)],["sv-se",()=>z(()=>import("./sv_SE.122bb1e9.js"),["assets/sv_SE.122bb1e9.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.s)],["th-th",()=>z(()=>import("./th_TH.50530bc1.js"),["assets/th_TH.50530bc1.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.t)],["tr-tr",()=>z(()=>import("./tr_TR.027c89bc.js"),["assets/tr_TR.027c89bc.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.t)],["uk-ua",()=>z(()=>import("./uk_UA.831b2f6d.js"),["assets/uk_UA.831b2f6d.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.u)],["vi-vn",()=>z(()=>import("./vi_VN.f6625b5d.js"),["assets/vi_VN.f6625b5d.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.v)],["zh-cn",()=>z(()=>import("./zh_Hans.38cb8157.js"),["assets/zh_Hans.38cb8157.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.z)],["zh-hk",()=>z(()=>import("./zh_Hant.e4eb7b89.js"),["assets/zh_Hant.e4eb7b89.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.z)],["zh-tw",()=>z(()=>import("./zh_Hant.e4eb7b89.js"),["assets/zh_Hant.e4eb7b89.js","assets/_commonjsHelpers.773c2c82.js"]).then(e=>e.z)]]);function Vte(e){const t=e.split("-")[0].toLowerCase();let i=null;for(const s of TT.keys())if(s.startsWith(t)){i=s;break}return i}function zte(e){return e?TT.has(e.toLowerCase())?e.toLowerCase():Vte(e)||OC:OC}let bu,jd;async function Bte(e=Rr()){if(e=zte(e),bu&&e===jd)return bu;bu=z(()=>import("./index.f6f524c6.js"),["assets/index.f6f524c6.js","assets/_commonjsHelpers.773c2c82.js"]).then(t=>t.i),jd=e;try{const[t,i]=await Promise.all([bu,TT.get(jd)()]);jd===e&&(t.am4core.options.defaultLocale=i.default),t.am4core.options.suppressWarnings=!0,t.am4core.options.autoDispose=!0}catch{return bu=null,jd=null,null}return bu}function Ute(e,t="default"){const i=jte.find(s=>s.name===t);return i?i.colors.map(s=>e.color(s)):null}const yt={base:"esri-feature-media",mediaContainer:"esri-feature-media__container",mediaItemContainer:"esri-feature-media__item-container",mediaItem:"esri-feature-media__item",mediaItemTitle:"esri-feature-media__item-title",mediaItemCaption:"esri-feature-media__item-caption",mediaPrevious:"esri-feature-media__previous",mediaPreviousIconLTR:"esri-feature-media__previous-icon",mediaPreviousIconRTL:"esri-feature-media__previous-icon--rtl",mediaNext:"esri-feature-media__next",mediaNextIconLTR:"esri-feature-media__next-icon",mediaNextIconRTL:"esri-feature-media__next-icon--rtl",mediaChart:"esri-feature-media__chart",mediaButton:"esri-feature-media__button",mediaIcon:"esri-feature-media__icon",iconLeftTriangleArrow:"esri-icon-left-triangle-arrow",iconRightTriangleArrow:"esri-icon-right-triangle-arrow"},lw=.05,cw=.95,uw=15,zn="color",Zo="tooltip",Vd="value",RC="default-line-value";let Xi=class extends yi{constructor(e,t){super(e,t),this._refreshTimer=null,this._refreshIntervalInfo=null,this._featureElementInfo=null,this.viewModel=new Fc,this.messages=null,this._getChartDependencies=async i=>{const s=await Bte(),{destroyed:r,viewModel:n}=this;if(r||!n||!i)return;const{activeMediaInfo:o}=n,a=await this._getRendererColors(s);this._renderChart({chartDiv:i,mediaInfo:o,chartsModule:s,colorMap:a})}}initialize(){this._featureElementInfo=new Bb,this.addHandles([Z(()=>{var e,t;return[(e=this.viewModel)==null?void 0:e.activeMediaInfo,(t=this.viewModel)==null?void 0:t.activeMediaInfoIndex]},()=>this._setupMediaRefreshTimer(),Le),Z(()=>{var e,t;return[(e=this.viewModel)==null?void 0:e.description,(t=this.viewModel)==null?void 0:t.title]},()=>this._setupFeatureElementInfo(),Le)])}destroy(){this._clearMediaRefreshTimer(),this._featureElementInfo.destroy()}get attributes(){return this.viewModel.attributes}set attributes(e){this.viewModel.attributes=e}get activeMediaInfoIndex(){return this.viewModel.activeMediaInfoIndex}set activeMediaInfoIndex(e){this.viewModel.activeMediaInfoIndex=e}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get fieldInfoMap(){return this.viewModel.fieldInfoMap}set fieldInfoMap(e){this.viewModel.fieldInfoMap=e}get layer(){return this.viewModel.layer}set layer(e){this.viewModel.layer=e}get mediaInfos(){return this.viewModel.mediaInfos}set mediaInfos(e){this.viewModel.mediaInfos=e}get popupTemplate(){return this.viewModel.popupTemplate}set popupTemplate(e){this.viewModel.popupTemplate=e}get relatedInfos(){return this.viewModel.relatedInfos}set relatedInfos(e){this.viewModel.relatedInfos=e}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}render(){var e;return P("div",{bind:this,class:yt.base,onkeyup:this._handleMediaKeyup},(e=this._featureElementInfo)==null?void 0:e.render(),this.renderMedia())}renderMedia(){const{formattedMediaInfoCount:e}=this.viewModel;return e?P("div",{key:"media-element-container",class:yt.mediaContainer},this.renderMediaPageButton("previous"),this.renderMediaInfo(),this.renderMediaPageButton("next")):null}renderImageMediaInfo(e){const{_refreshIntervalInfo:t}=this,{activeMediaInfoIndex:i,formattedMediaInfoCount:s}=this.viewModel,{value:r,refreshInterval:n,altText:o,title:a,type:l}=e,{sourceURL:u,linkURL:d}=r,f=BN(d)?"_blank":"_self",m=f==="_blank"?"noreferrer":"",y=n?t:null,g=y?y.timestamp:0,v=y?y.sourceURL:u,b=P("img",{alt:o||a,key:`media-${l}-${i}-${s}-${g}`,src:v});return(d?P("a",{title:a,href:d,rel:m,target:f},b):null)||b}renderChartMediaInfo(e){const{activeMediaInfoIndex:t,formattedMediaInfoCount:i}=this.viewModel;return P("div",{key:`media-${e.type}-${t}-${i}`,bind:this,class:yt.mediaChart,afterCreate:this._getChartDependencies})}renderMediaInfoType(){const{activeMediaInfo:e}=this.viewModel;return e?e.type==="image"?this.renderImageMediaInfo(e):e.type.includes("chart")?this.renderChartMediaInfo(e):null:null}renderMediaInfo(){const{activeMediaInfo:e}=this.viewModel;if(!e)return null;const t=e.title?P("div",{key:"media-title",class:yt.mediaItemTitle,innerHTML:e.title}):null,i=e.caption?P("div",{key:"media-caption",class:yt.mediaItemCaption,innerHTML:e.caption}):null;return P("div",{key:"media-container",class:yt.mediaItemContainer},P("div",{key:"media-item-container",class:yt.mediaItem},this.renderMediaInfoType()),t,i)}renderMediaPageButton(e){if(this.viewModel.formattedMediaInfoCount<2)return null;const t=e==="previous",i=t?this.messages.previous:this.messages.next,s=t?this.classes(yt.mediaButton,yt.mediaPrevious):this.classes(yt.mediaButton,yt.mediaNext),r=t?this.classes(yt.mediaIcon,yt.mediaPreviousIconLTR,yt.iconLeftTriangleArrow):this.classes(yt.mediaIcon,yt.mediaNextIconLTR,yt.iconRightTriangleArrow),n=t?this.classes(yt.mediaIcon,yt.mediaPreviousIconRTL,yt.iconRightTriangleArrow):this.classes(yt.mediaIcon,yt.mediaNextIconRTL,yt.iconLeftTriangleArrow),o=t?"media-previous":"media-next",a=t?this._previous:this._next;return P("button",{type:"button",key:o,title:i,"aria-label":i,tabIndex:0,class:s,bind:this,onclick:a},P("span",{"aria-hidden":"true",class:r}),P("span",{"aria-hidden":"true",class:n}))}_setupFeatureElementInfo(){const{description:e,title:t}=this;this._featureElementInfo.set({description:e,title:t})}_next(){this.viewModel.next()}_previous(){this.viewModel.previous()}async _getRendererColors(e){var o,a;const{am4core:t}=e,i=new Map,s=(a=(o=this.viewModel)==null?void 0:o.layer)==null?void 0:a.renderer,r="default";if(!s)return i;const n=await pee(s);return n.delete(r),Array.from(n.values()).every(l=>(l==null?void 0:l.length)===1)&&(i.set(RC,t.color({r:50,g:50,b:50,a:1})),Array.from(n.keys()).forEach(l=>{l&&i.set(l,t.color(n.get(l)[0].toCss(!0)))})),i}_handleMediaKeyup(e){const t=yc(e);t==="ArrowLeft"&&(e.stopPropagation(),this.viewModel.previous()),t==="ArrowRight"&&(e.stopPropagation(),this.viewModel.next())}_renderChart(e){const{abilities:t}=this.viewModel,{chartsModule:i,chartDiv:s,mediaInfo:r,colorMap:n}=e,{value:o,type:a}=r,{am4core:l}=i,u=Ute(l);function d(y){y instanceof l.ColorSet&&u&&(y.list=u)}Tv()&&l.useTheme(i.am4themes_dark);const f=window.matchMedia("(prefers-reduced-motion: reduce)");t.chartAnimation&&!f.matches?l.useTheme(i.am4themes_animated):l.unuseTheme(i.am4themes_animated),l.useTheme(d);const m=a==="pie-chart"?this._createPieChart(e):this._createXYChart(e);s.setAttribute("aria-label",r.altText||r.title),m.data=o.series.map(y=>({[Zo]:y.tooltip,[Vd]:y.value,[zn]:n.get(y.fieldName)})).filter(y=>a!=="pie-chart"||y.value>0)}_customizeChartTooltip(e,t){e.label.wrap=!0,e.label.maxWidth=200,e.autoTextColor=!1,e.getFillFromObject=!1,e.label.fill=t.color("#ffffff"),e.background.fill=t.color({r:0,g:0,b:0,a:.7})}_createPieChart(e){const{chartDiv:t,chartsModule:i}=e,{am4core:s,am4charts:r}=i,n=s.create(t,r.PieChart);n.rtl=xn(this.container);const o=n.series.push(new r.PieSeries);return o.labels.template.disabled=!0,o.ticks.template.disabled=!0,o.dataFields.value=Vd,o.dataFields.category=Zo,this._customizeChartTooltip(o.tooltip,s),o.slices.template.propertyFields.fill=zn,o.slices.template.propertyFields.stroke=zn,n}_getMinSeriesValue(e){let t=0;return e.forEach(i=>t=Math.min(i.value,t)),t}_createColumnChart(e,t){const{chartsModule:i,mediaInfo:s}=t,{value:r}=s,{am4core:n,am4charts:o}=i,a=e.xAxes.push(new o.CategoryAxis);a.dataFields.category=Zo,a.renderer.labels.template.disabled=!0,this._customizeChartTooltip(a.tooltip,n),a.tooltip.events.on("sizechanged",()=>{a.tooltip.dy=-a.tooltip.contentHeight});const l=e.yAxes.push(new o.ValueAxis),u=l.renderer.labels.template;l.renderer.minLabelPosition=lw,l.renderer.maxLabelPosition=cw,l.min=this._getMinSeriesValue(r.series),this._customizeChartTooltip(l.tooltip,n),u.wrap=!0;const d=e.series.push(new o.ColumnSeries);d.dataFields.valueY=Vd,d.dataFields.categoryX=Zo,d.columns.template.propertyFields.fill=zn,d.columns.template.propertyFields.stroke=zn,e.cursor=new o.XYCursor,r.series.length>uw&&(e.scrollbarX=new n.Scrollbar)}_createBarChart(e,t){const{chartsModule:i,mediaInfo:s}=t,{value:r}=s,{am4core:n,am4charts:o}=i,a=e.yAxes.push(new o.CategoryAxis);a.dataFields.category=Zo,a.renderer.inversed=!0,a.renderer.labels.template.disabled=!0,this._customizeChartTooltip(a.tooltip,n),a.tooltip.events.on("sizechanged",()=>{a.tooltip.dx=a.tooltip.contentWidth});const l=e.xAxes.push(new o.ValueAxis),u=l.renderer.labels.template;l.renderer.minLabelPosition=lw,l.renderer.maxLabelPosition=cw,l.min=this._getMinSeriesValue(r.series),this._customizeChartTooltip(l.tooltip,n),u.wrap=!0;const d=e.series.push(new o.ColumnSeries);d.dataFields.valueX=Vd,d.dataFields.categoryY=Zo,d.columns.template.propertyFields.fill=zn,d.columns.template.propertyFields.stroke=zn,e.cursor=new o.XYCursor,r.series.length>uw&&(e.scrollbarY=new n.Scrollbar)}_createLineChart(e,t){const{chartsModule:i,mediaInfo:s,colorMap:r}=t,{value:n}=s,{am4core:o,am4charts:a}=i,l=e.xAxes.push(new a.CategoryAxis);l.dataFields.category=Zo,l.renderer.labels.template.disabled=!0,this._customizeChartTooltip(l.tooltip,o),l.tooltip.events.on("sizechanged",()=>{l.tooltip.dy=-l.tooltip.contentHeight});const u=e.yAxes.push(new a.ValueAxis),d=u.renderer.labels.template;u.renderer.minLabelPosition=lw,u.renderer.maxLabelPosition=cw,u.min=this._getMinSeriesValue(n.series),this._customizeChartTooltip(u.tooltip,o),d.wrap=!0;const f=e.series.push(new a.LineSeries);f.dataFields.categoryX=Zo,f.dataFields.valueY=Vd,f.strokeWidth=1;const m=r.get(RC);m&&(f.stroke=m);const y=f.bullets.push(new a.CircleBullet);y.propertyFields.fill=zn,y.propertyFields.stroke=zn,e.cursor=new a.XYCursor,n.series.length>uw&&(e.scrollbarX=new o.Scrollbar)}_createXYChart(e){const{chartDiv:t,chartsModule:i,mediaInfo:s}=e,{type:r}=s,{am4core:n,am4charts:o}=i,a=n.create(t,o.XYChart);return a.rtl=xn(this.container),r==="column-chart"&&this._createColumnChart(a,e),r==="bar-chart"&&this._createBarChart(a,e),r==="line-chart"&&this._createLineChart(a,e),a}_clearMediaRefreshTimer(){const{_refreshTimer:e}=this;e&&(clearTimeout(e),this._refreshTimer=null)}_updateMediaInfoTimestamp(e){const t=Date.now();this._refreshIntervalInfo={timestamp:t,sourceURL:this._getImageSource(e,t)},this.scheduleRender()}_setupMediaRefreshTimer(){this._clearMediaRefreshTimer();const{activeMediaInfo:e}=this.viewModel;e&&e.type==="image"&&e.refreshInterval&&this._setRefreshTimeout(e)}_setRefreshTimeout(e){const{refreshInterval:t,value:i}=e;if(!t)return;const s=6e4*t;this._updateMediaInfoTimestamp(i.sourceURL);const r=setInterval(()=>{this._updateMediaInfoTimestamp(i.sourceURL)},s);this._refreshTimer=r}_getImageSource(e,t){const i=e.includes("?")?"&":"?",[s,r=""]=e.split("#");return`${s}${i}timestamp=${t}${r?"#":""}${r}`}};c([h()],Xi.prototype,"attributes",null),c([h()],Xi.prototype,"activeMediaInfoIndex",null),c([h()],Xi.prototype,"description",null),c([h()],Xi.prototype,"fieldInfoMap",null),c([h()],Xi.prototype,"layer",null),c([h()],Xi.prototype,"mediaInfos",null),c([h()],Xi.prototype,"popupTemplate",null),c([h()],Xi.prototype,"relatedInfos",null),c([h()],Xi.prototype,"title",null),c([h({type:Fc})],Xi.prototype,"viewModel",void 0),c([h(),di("esri/widgets/Feature/t9n/Feature")],Xi.prototype,"messages",void 0),Xi=c([S("esri.widgets.Feature.FeatureMedia")],Xi);const P5=Xi;var ZS;let Lp=ZS=class extends W{constructor(e){super(e),this.minValue=0,this.maxValue=0}clone(){return new ZS({minValue:this.minValue,maxValue:this.maxValue})}};c([h({type:Number,json:{write:!0}})],Lp.prototype,"minValue",void 0),c([h({type:Number,json:{write:!0}})],Lp.prototype,"maxValue",void 0),Lp=ZS=c([S("esri.renderer.support.AuthoringInfoClassBreakInfo")],Lp);var QS;let La=QS=class extends W{constructor(e){super(e),this.field="",this.normalizationField="",this.label="",this.classBreakInfos=[]}clone(){return new QS({field:this.field,normalizationField:this.normalizationField,label:this.label,classBreakInfos:R(this.classBreakInfos)})}};c([h({type:String,json:{write:!0}})],La.prototype,"field",void 0),c([h({type:String,json:{write:!0}})],La.prototype,"normalizationField",void 0),c([h({type:String,json:{write:!0}})],La.prototype,"label",void 0),c([h({type:[Lp],json:{write:!0}})],La.prototype,"classBreakInfos",void 0),La=QS=c([S("esri.renderers.support.AuthoringInfoFieldInfo")],La);var KS;const Cy=new Ie({percentTotal:"percent-of-total",ratio:"ratio",percent:"percent"}),Py=new Ie({sizeInfo:"size",colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation"}),LC={key:e=>typeof e=="number"?"number":"string",typeMap:{number:Number,string:String},base:null},FC=["high-to-low","above-and-below","centered-on","extremes"],DC=[...new Set(["high-to-low","above-and-below","centered-on","extremes","90-10","above","below","high-to-low","above-and-below","90-10","above","below"])],NC=["seconds","minutes","hours","days","months","years"];let Zi=KS=class extends W{constructor(e){super(e),this.endTime=null,this.field=null,this.maxSliderValue=null,this.minSliderValue=null,this.startTime=null,this.type=null,this.units=null}castEndTime(e){return typeof e=="string"||typeof e=="number"?e:null}castStartTime(e){return typeof e=="string"||typeof e=="number"?e:null}get style(){return this.type==="color"?this._get("style"):null}set style(e){this._set("style",e)}get theme(){return this.type==="color"||this.type==="size"?this._get("theme")||"high-to-low":null}set theme(e){this._set("theme",e)}clone(){return new KS({endTime:this.endTime,field:this.field,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,startTime:this.startTime,style:this.style,theme:this.theme,type:this.type,units:this.units})}};c([h({types:LC,json:{write:!0}})],Zi.prototype,"endTime",void 0),c([Oe("endTime")],Zi.prototype,"castEndTime",null),c([h({type:String,json:{write:!0}})],Zi.prototype,"field",void 0),c([h({type:Number,json:{write:!0}})],Zi.prototype,"maxSliderValue",void 0),c([h({type:Number,json:{write:!0}})],Zi.prototype,"minSliderValue",void 0),c([h({types:LC,json:{write:!0}})],Zi.prototype,"startTime",void 0),c([Oe("startTime")],Zi.prototype,"castStartTime",null),c([h({type:Cy.apiValues,value:null,json:{type:Cy.jsonValues,read:Cy.read,write:Cy.write}})],Zi.prototype,"style",null),c([h({type:DC,value:null,json:{type:DC,origins:{"web-scene":{type:FC,write:{writer:(e,t)=>{FC.includes(e)&&(t.theme=e)}}}},write:!0}})],Zi.prototype,"theme",null),c([h({type:Py.apiValues,json:{type:Py.jsonValues,read:Py.read,write:Py.write}})],Zi.prototype,"type",void 0),c([h({type:NC,json:{type:NC,write:!0}})],Zi.prototype,"units",void 0),Zi=KS=c([S("esri.renderers.support.AuthoringInfoVisualVariable")],Zi);const qte=Zi;let Wg=class extends W{constructor(e){super(e),this.type=null}};c([h({readOnly:!0,json:{read:!1,write:!0}})],Wg.prototype,"type",void 0),Wg=c([S("esri.rest.support.ColorRamp")],Wg);const IT=Wg;var e2;let Ql=e2=class extends IT{constructor(e){super(e),this.algorithm=null,this.fromColor=null,this.toColor=null,this.type="algorithmic"}clone(){return new e2({fromColor:R(this.fromColor),toColor:R(this.toColor),algorithm:this.algorithm})}};c([ue({esriCIELabAlgorithm:"cie-lab",esriHSVAlgorithm:"hsv",esriLabLChAlgorithm:"lab-lch"})],Ql.prototype,"algorithm",void 0),c([h({type:pe,json:{type:[Ge],write:!0}})],Ql.prototype,"fromColor",void 0),c([h({type:pe,json:{type:[Ge],write:!0}})],Ql.prototype,"toColor",void 0),c([h({type:["algorithmic"]})],Ql.prototype,"type",void 0),Ql=e2=c([S("esri.rest.support.AlgorithmicColorRamp")],Ql);const ET=Ql;var t2;let Fp=t2=class extends IT{constructor(e){super(e),this.colorRamps=null,this.type="multipart"}clone(){return new t2({colorRamps:R(this.colorRamps)})}};c([h({type:[ET],json:{write:!0}})],Fp.prototype,"colorRamps",void 0),c([h({type:["multipart"]})],Fp.prototype,"type",void 0),Fp=t2=c([S("esri.rest.support.MultipartColorRamp")],Fp);const A5=Fp,Gte={key:"type",base:IT,typeMap:{algorithmic:ET,multipart:A5}};function Wte(e){return e&&e.type?e.type==="algorithmic"?ET.fromJSON(e):e.type==="multipart"?A5.fromJSON(e):null:null}var i2;const wl=new Ie({esriClassifyDefinedInterval:"defined-interval",esriClassifyEqualInterval:"equal-interval",esriClassifyManual:"manual",esriClassifyNaturalBreaks:"natural-breaks",esriClassifyQuantile:"quantile",esriClassifyStandardDeviation:"standard-deviation"}),Ay=new Ie({pieChart:"pie-chart",classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density",flow:"flow"}),jC=new Ie({classedSize:"class-breaks-size",classedColor:"class-breaks-color",univariateColorSize:"univariate-color-size",relationship:"relationship",predominance:"predominance",dotDensity:"dot-density"}),VC=["inches","feet","yards","miles","nautical-miles","millimeters","centimeters","decimeters","meters","kilometers","decimal-degrees"],Hte=["high-to-low","above-and-below","above","below","90-10"],Yte=["flow-line","wave-front"],Jte=["caret","circle-caret","arrow","circle-arrow","plus-minus","circle-plus-minus","square","circle","triangle","happy-sad","thumb","custom"];let gt=i2=class extends W{constructor(e){super(e),this.colorRamp=null,this.fadeRatio=null,this.isAutoGenerated=!1,this.lengthUnit=null,this.maxSliderValue=null,this.minSliderValue=null,this.visualVariables=null}get classificationMethod(){const e=this._get("classificationMethod"),t=this.type;return t&&t!=="relationship"?t==="class-breaks-size"||t==="class-breaks-color"?e||"manual":null:e}set classificationMethod(e){this._set("classificationMethod",e)}readColorRamp(e){return e?Wte(e):void 0}get fields(){return this.type&&this.type!=="predominance"?null:this._get("fields")}set fields(e){this._set("fields",e)}get field1(){return this.type&&this.type!=="relationship"?null:this._get("field1")}set field1(e){this._set("field1",e)}get field2(){return this.type&&this.type!=="relationship"?null:this._get("field2")}set field2(e){this._set("field2",e)}get flowTheme(){return this.type==="flow"?this._get("flowTheme"):null}set flowTheme(e){this._set("flowTheme",e)}get focus(){return this.type&&this.type!=="relationship"?null:this._get("focus")}set focus(e){this._set("focus",e)}get numClasses(){return this.type&&this.type!=="relationship"?null:this._get("numClasses")}set numClasses(e){this._set("numClasses",e)}get statistics(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("statistics"):null}set statistics(e){this._set("statistics",e)}get standardDeviationInterval(){const e=this.type;return e&&e!=="relationship"&&e!=="class-breaks-size"&&e!=="class-breaks-color"||this.classificationMethod&&this.classificationMethod!=="standard-deviation"?null:this._get("standardDeviationInterval")}set standardDeviationInterval(e){this._set("standardDeviationInterval",e)}get type(){return this._get("type")}set type(e){let t=e;e==="classed-size"?t="class-breaks-size":e==="classed-color"&&(t="class-breaks-color"),this._set("type",t)}get univariateSymbolStyle(){return this.type==="univariate-color-size"&&this.univariateTheme==="above-and-below"?this._get("univariateSymbolStyle"):null}set univariateSymbolStyle(e){this._set("univariateSymbolStyle",e)}get univariateTheme(){return this.type==="univariate-color-size"?this._get("univariateTheme"):null}set univariateTheme(e){this._set("univariateTheme",e)}clone(){return new i2({classificationMethod:this.classificationMethod,colorRamp:R(this.colorRamp),fadeRatio:R(this.fadeRatio),fields:this.fields&&this.fields.slice(0),field1:R(this.field1),field2:R(this.field2),isAutoGenerated:this.isAutoGenerated,focus:this.focus,numClasses:this.numClasses,maxSliderValue:this.maxSliderValue,minSliderValue:this.minSliderValue,lengthUnit:this.lengthUnit,statistics:this.statistics,standardDeviationInterval:this.standardDeviationInterval,type:this.type,visualVariables:this.visualVariables&&this.visualVariables.map(e=>e.clone()),univariateSymbolStyle:this.univariateSymbolStyle,univariateTheme:this.univariateTheme,flowTheme:this.flowTheme})}};c([h({type:wl.apiValues,value:null,json:{type:wl.jsonValues,read:wl.read,write:wl.write,origins:{"web-document":{default:"manual",type:wl.jsonValues,read:wl.read,write:wl.write}}}})],gt.prototype,"classificationMethod",null),c([h({types:Gte,json:{write:!0}})],gt.prototype,"colorRamp",void 0),c([Q("colorRamp")],gt.prototype,"readColorRamp",null),c([h({json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],gt.prototype,"fadeRatio",void 0),c([h({type:[String],value:null,json:{write:!0}})],gt.prototype,"fields",null),c([h({type:La,value:null,json:{write:!0}})],gt.prototype,"field1",null),c([h({type:La,value:null,json:{write:!0}})],gt.prototype,"field2",null),c([h({type:Yte,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],gt.prototype,"flowTheme",null),c([h({type:["HH","HL","LH","LL"],value:null,json:{write:!0}})],gt.prototype,"focus",null),c([h({type:Boolean,json:{write:!0,default:!1,origins:{"web-scene":{write:!1}}}})],gt.prototype,"isAutoGenerated",void 0),c([h({type:Number,value:null,json:{type:Ge,write:!0}})],gt.prototype,"numClasses",null),c([h({type:VC,json:{type:VC,read:!1,write:!1,origins:{"web-scene":{read:!0,write:!0}}}})],gt.prototype,"lengthUnit",void 0),c([h({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],gt.prototype,"maxSliderValue",void 0),c([h({type:Number,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],gt.prototype,"minSliderValue",void 0),c([h({type:Object,value:null,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],gt.prototype,"statistics",null),c([h({type:[.25,.33,.5,1],value:null,json:{type:[.25,.33,.5,1],write:!0}})],gt.prototype,"standardDeviationInterval",null),c([h({type:Ay.apiValues,value:null,json:{type:Ay.jsonValues,read:Ay.read,write:Ay.write,origins:{"web-scene":{type:jC.jsonValues,write:{writer:jC.write,overridePolicy:e=>({enabled:e!=="flow"})}}}}})],gt.prototype,"type",null),c([h({type:[qte],json:{write:!0}})],gt.prototype,"visualVariables",void 0),c([h({type:Jte,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],gt.prototype,"univariateSymbolStyle",null),c([h({type:Hte,value:null,json:{write:!0,origins:{"web-scene":{write:!1}}}})],gt.prototype,"univariateTheme",null),gt=i2=c([S("esri.renderers.support.AuthoringInfo")],gt);const kT=gt,hw=new Ie({simple:"simple",uniqueValue:"unique-value",classBreaks:"class-breaks",heatmap:"heatmap",dotDensity:"dot-density",dictionary:"dictionary",pieChart:"pie-chart"},{ignoreUnknown:!0});let Dp=class extends W{constructor(e){super(e),this.authoringInfo=null,this.type=null}async getRequiredFields(e){if(!this.collectRequiredFields)return[];const t=new Set;return await this.collectRequiredFields(t,e),Array.from(t).sort()}getSymbol(e,t){}async getSymbolAsync(e,t){}getSymbols(){return[]}getAttributeHash(){return JSON.stringify(this)}getMeshHash(){return JSON.stringify(this)}};c([h({type:kT,json:{write:!0}})],Dp.prototype,"authoringInfo",void 0),c([h({type:hw.apiValues,readOnly:!0,json:{type:hw.jsonValues,read:!1,write:{writer:hw.write,ignoreOrigin:!0}}})],Dp.prototype,"type",void 0),Dp=c([S("esri.renderers.Renderer")],Dp);const zo=Dp;function Xte(e){var t,i,s;return(s=(i=(t=e.match(Zte))==null?void 0:t[1])==null?void 0:i.replace(/\\'/g,"'"))!=null?s:null}const Zte=/^hash\(\$feature\['((\\'|[^'])+)'\]\) \* 8\.381e-8$/;var s2;let Oh=s2=class extends W{constructor(){super(...arguments),this.title=null}clone(){return new s2({title:this.title})}};c([h({type:String,json:{write:!0}})],Oh.prototype,"title",void 0),Oh=s2=c([S("esri.renderers.support.LegendOptions")],Oh);var r2;let Hg=r2=class extends Oh{constructor(){super(...arguments),this.showLegend=null}clone(){return new r2({title:this.title,showLegend:this.showLegend})}};c([h({type:Boolean,json:{write:!0}})],Hg.prototype,"showLegend",void 0),Hg=r2=c([S("esri.renderers.visualVariables.support.VisualVariableLegendOptions")],Hg);const O5=Hg,dw=new Ie({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"});let br=class extends W{constructor(e){super(e),this.index=null,this.type=null,this.field=null,this.valueExpression=null,this.valueExpressionTitle=null,this.legendOptions=null}castField(e){return e==null?e:typeof e=="function"?(q.getLogger(this.declaredClass).error(".field: field must be a string value"),null):Mm(e)}get arcadeRequired(){return!!this.valueExpression}clone(){}getAttributeHash(){return`${this.type}-${this.field}-${this.valueExpression}`}};c([h()],br.prototype,"index",void 0),c([h({type:dw.apiValues,readOnly:!0,json:{read:dw.read,write:dw.write}})],br.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],br.prototype,"field",void 0),c([Oe("field")],br.prototype,"castField",null),c([h({type:String,json:{write:!0}})],br.prototype,"valueExpression",void 0),c([h({type:String,json:{write:!0}})],br.prototype,"valueExpressionTitle",void 0),c([h({readOnly:!0})],br.prototype,"arcadeRequired",null),c([h({type:O5,json:{write:!0}})],br.prototype,"legendOptions",void 0),br=c([S("esri.renderers.visualVariables.VisualVariable")],br);const qm=br;var n2;let Kl=n2=class extends qm{constructor(e){super(e),this.type="color",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(e){e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,i)=>t.value-i.value),this._set("stops",e)}clone(){return new n2({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(e=>e.clone()),legendOptions:this.legendOptions&&this.legendOptions.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};c([h({readOnly:!0})],Kl.prototype,"cache",null),c([h({type:["color"],json:{type:["colorInfo"]}})],Kl.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],Kl.prototype,"normalizationField",void 0),c([h({type:[BK],json:{write:!0}})],Kl.prototype,"stops",null),Kl=n2=c([S("esri.renderers.visualVariables.ColorVariable")],Kl);const R5=Kl;var o2;let ba=o2=class extends W{constructor(e){super(e),this.label=null,this.opacity=null,this.value=null}readOpacity(e,t){return em(t.transparency)}writeOpacity(e,t,i){t[i]=Rb(e)}clone(){return new o2({label:this.label,opacity:this.opacity,value:this.value})}};c([h({type:String,json:{write:!0}})],ba.prototype,"label",void 0),c([h({type:Number,json:{type:Ge,write:{target:"transparency"}}})],ba.prototype,"opacity",void 0),c([Q("opacity",["transparency"])],ba.prototype,"readOpacity",null),c([ie("opacity")],ba.prototype,"writeOpacity",null),c([h({type:Number,json:{write:!0}})],ba.prototype,"value",void 0),ba=o2=c([S("esri.renderers.visualVariables.support.OpacityStop")],ba);const Qte=ba;var a2;let ec=a2=class extends qm{constructor(e){super(e),this.type="opacity",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(e){e&&Array.isArray(e)&&(e=e.filter(t=>!!t)).sort((t,i)=>t.value-i.value),this._set("stops",e)}clone(){return new a2({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(e=>e.clone()),legendOptions:this.legendOptions&&this.legendOptions.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(e=>e.value||0)}};c([h({readOnly:!0})],ec.prototype,"cache",null),c([h({type:["opacity"],json:{type:["transparencyInfo"]}})],ec.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],ec.prototype,"normalizationField",void 0),c([h({type:[Qte],json:{write:!0}})],ec.prototype,"stops",null),ec=a2=c([S("esri.renderers.visualVariables.OpacityVariable")],ec);const L5=ec;var l2;let io=l2=class extends qm{constructor(e){super(e),this.axis=null,this.type="rotation",this.rotationType="geographic",this.valueExpressionTitle=null}get cache(){return{hasExpression:!!this.valueExpression,compiledFunc:null}}writeValueExpressionTitleWebScene(e,t,i,s){if(s&&s.messages){const r=`visualVariables[${this.index}]`;s.messages.push(new L("property:unsupported",this.type+"VisualVariable.valueExpressionTitle is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:r+".valueExpressionTitle",context:s}))}}clone(){return new l2({axis:this.axis,rotationType:this.rotationType,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,legendOptions:this.legendOptions&&this.legendOptions.clone()})}};c([h({readOnly:!0})],io.prototype,"cache",null),c([h({type:["heading","tilt","roll"],json:{origins:{"web-scene":{default:"heading",write:!0}}}})],io.prototype,"axis",void 0),c([h({type:["rotation"],json:{type:["rotationInfo"]}})],io.prototype,"type",void 0),c([h({type:["geographic","arithmetic"],json:{write:!0,origins:{"web-document":{write:!0,default:"geographic"}}}})],io.prototype,"rotationType",void 0),c([h({type:String,json:{write:!0}})],io.prototype,"valueExpressionTitle",void 0),c([ie("web-scene","valueExpressionTitle")],io.prototype,"writeValueExpressionTitleWebScene",null),io=l2=c([S("esri.renderers.visualVariables.RotationVariable")],io);const F5=io;var c2;let Hu=c2=class extends W{constructor(e){super(e),this.label=null,this.size=null,this.value=null}clone(){return new c2({label:this.label,size:this.size,value:this.value})}};c([h({type:String,json:{write:!0}})],Hu.prototype,"label",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],Hu.prototype,"size",void 0),c([h({type:Number,json:{write:!0}})],Hu.prototype,"value",void 0),Hu=c2=c([S("esri.renderers.visualVariables.support.SizeStop")],Hu);const Yu=Hu;var u2;let Yg=u2=class extends O5{constructor(){super(...arguments),this.customValues=null}clone(){return new u2({title:this.title,showLegend:this.showLegend,customValues:this.customValues&&this.customValues.slice(0)})}};c([h({type:[Number],json:{write:!0}})],Yg.prototype,"customValues",void 0),Yg=u2=c([S("esri.renderers.visualVariables.support.SizeVariableLegendOptions")],Yg);const Kte=Yg;var ko,Zt;function Ga(e){return e&&e.declaredClass==="esri.renderers.visualVariables.SizeVariable"}function lm(e){return e!=null&&!isNaN(e)&&isFinite(e)}function D5(e){return e.valueExpression?ko.Expression:e.field&&typeof e.field=="string"?ko.Field:ko.Unknown}function eie(e,t){const i=t||D5(e),s=e.valueUnit||"unknown";return i===ko.Unknown?Zt.Constant:e.stops?Zt.Stops:e.minSize!=null&&e.maxSize!=null&&e.minDataValue!=null&&e.maxDataValue!=null?Zt.ClampedLinear:s==="unknown"?e.minSize!=null&&e.minDataValue!=null?e.minSize&&e.minDataValue?Zt.Proportional:Zt.Additive:Zt.Identity:Zt.RealWorldSize}(function(e){e.Unknown="unknown",e.Expression="expression",e.Field="field"})(ko||(ko={})),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"}(Zt||(Zt={}));const cl=q.getLogger("esri.renderers.visualVariables.support.visualVariableUtils"),zC=new Ci,Jg=Math.PI,N5=/^\s*(return\s+)?\$view\.scale\s*(;)?\s*$/i;function j5(e,t,i){const s="visualVariables"in e&&e.visualVariables?e.visualVariables.find(g=>g.type==="color"):e;if(!s)return;if(s.declaredClass!=="esri.renderers.visualVariables.ColorVariable")return void cl.warn("The visualVariable should be an instance of esri.renderers.visualVariables.ColorVariable");const r=typeof t=="number",n=r?null:t,o=n&&n.attributes;let a=r?t:null;const l=s.field,{ipData:u,hasExpression:d}=s.cache;let f=s.cache.compiledFunc;if(!l&&!d){const g=s.stops;return g&&g[0]&&g[0].color}if(typeof a!="number")if(d){if(N(i)||N(i.arcade))return void cl.error("Use of arcade expressions requires an arcade context");const g={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},v=i.arcade.arcadeUtils,b=v.getViewInfo(g),_=v.createExecContext(n,b);if(!f){const x=v.createSyntaxTree(s.valueExpression);f=v.createFunction(x),s.cache.compiledFunc=f}a=v.executeFunction(f,_)}else o&&(a=o[l]);const m=s.normalizationField,y=o!=null&&m!=null?parseFloat(o[m]):void 0;if(a!=null&&(!m||r||!isNaN(y)&&y!==0)){isNaN(y)||r||(a/=y);const g=CT(a,u);if(g){const v=g[0],b=g[1],_=v===b?s.stops[v].color:pe.blendColors(s.stops[v].color,s.stops[b].color,g[2],M(i)?i.color:void 0);return new pe(_)}}}function V5(e,t,i){const s="visualVariables"in e&&e.visualVariables?e.visualVariables.find(g=>g.type==="opacity"):e;if(!s)return;if(s.declaredClass!=="esri.renderers.visualVariables.OpacityVariable")return void cl.warn("The visualVariable should be an instance of esri.renderers.visualVariables.OpacityVariable");const r=typeof t=="number",n=r?null:t,o=n&&n.attributes;let a=r?t:null;const l=s.field,{ipData:u,hasExpression:d}=s.cache;let f=s.cache.compiledFunc;if(!l&&!d){const g=s.stops;return g&&g[0]&&g[0].opacity}if(typeof a!="number")if(d){if(N(i)||N(i.arcade))return void cl.error("Use of arcade expressions requires an arcade context");const g={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},v=i.arcade.arcadeUtils,b=v.getViewInfo(g),_=v.createExecContext(n,b);if(!f){const x=v.createSyntaxTree(s.valueExpression);f=v.createFunction(x),s.cache.compiledFunc=f}a=v.executeFunction(f,_)}else o&&(a=o[l]);const m=s.normalizationField,y=o!=null&&m!=null?parseFloat(o[m]):void 0;if(a!=null&&(!m||r||!isNaN(y)&&y!==0)){isNaN(y)||r||(a/=y);const g=CT(a,u);if(g){const v=g[0],b=g[1];if(v===b)return s.stops[v].opacity;{const _=s.stops[v].opacity;return _+(s.stops[b].opacity-_)*g[2]}}}}function z5(e,t,i){const s="visualVariables"in e&&e.visualVariables?e.visualVariables.find(y=>y.type==="rotation"):e;if(!s)return;if(s.declaredClass!=="esri.renderers.visualVariables.RotationVariable")return void cl.warn("The visualVariable should be an instance of esri.renderers.visualVariables.RotationVariable");const r=s.axis||"heading",n=r==="heading"&&s.rotationType==="arithmetic"?90:0,o=r==="heading"&&s.rotationType==="arithmetic"?-1:1,a=typeof t=="number"?null:t,l=a&&a.attributes,u=s.field,{hasExpression:d}=s.cache;let f=s.cache.compiledFunc,m=0;if(!u&&!d)return m;if(d){if(N(i)||N(i.arcade))return void cl.error("Use of arcade expressions requires an arcade context");const y={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},g=i.arcade.arcadeUtils,v=g.getViewInfo(y),b=g.createExecContext(a,v);if(!f){const _=g.createSyntaxTree(s.valueExpression);f=g.createFunction(_),s.cache.compiledFunc=f}m=g.executeFunction(f,b)}else l&&(m=l[u]||0);return m=typeof m!="number"||isNaN(m)?null:n+o*m,m}function tie(e,t,i){const s=typeof t=="number",r=s?null:t,n=r&&r.attributes;let o=s?t:null;const{isScaleDriven:a}=e.cache;let l=e.cache.compiledFunc;if(a){const d=M(i)?i.scale:void 0,f=M(i)?i.view:void 0;o=d==null||f==="3d"?iie(e):d}else if(!s)switch(e.inputValueType){case ko.Expression:{if(N(i)||N(i.arcade))return void cl.error("Use of arcade expressions requires an arcade context");const d={viewingMode:i.viewingMode,scale:i.scale,spatialReference:i.spatialReference},f=i.arcade.arcadeUtils,m=f.getViewInfo(d),y=f.createExecContext(r,m);if(!l){const g=f.createSyntaxTree(e.valueExpression);l=f.createFunction(g),e.cache.compiledFunc=l}o=f.executeFunction(l,y);break}case ko.Field:n&&(o=n[e.field]);break;case ko.Unknown:o=null}if(!lm(o))return null;if(s||!e.normalizationField)return o;const u=n?parseFloat(n[e.normalizationField]):null;return lm(u)&&u!==0?o/u:null}function iie(e){let t=null,i=null;const s=e.stops;return s?(t=s[0].value,i=s[s.length-1].value):(t=e.minDataValue||0,i=e.maxDataValue||0),(t+i)/2}function Yb(e,t,i){const s="visualVariables"in e&&e.visualVariables?e.visualVariables.find(n=>n.type==="size"):e;if(!s)return;if(s.declaredClass!=="esri.renderers.visualVariables.SizeVariable")return void cl.warn("The visualVariable should be an instance of esri.renderers.visualVariables.SizeVariable");const r=U5(tie(s,t,i),s,t,i,s.cache.ipData);return r==null||isNaN(r)?0:r}function os(e,t,i){return e==null?null:Ga(e)?Yb(e,t,i):lm(e)?e:null}function B5(e,t,i){return lm(i)&&e>i?i:lm(t)&&e=t.maxDataValue)return o;if(n==null||o==null)return null;if(t.scaleBy==="area"&&a){const l=a==="circle",u=l?Jg*(n/2)**2:n*n,d=u+r*((l?Jg*(o/2)**2:o*o)-u);return l?2*Math.sqrt(d/Jg):Math.sqrt(d)}return n+r*(o-n)}function oie(e,t,i,s){const r=M(s)?s.shape:void 0,n=e/t.minDataValue,o=os(t.minSize,i,s),a=os(t.maxSize,i,s);let l=null;return l=r==="circle"?2*Math.sqrt(n*(o/2)**2):r==="square"||r==="diamond"||r==="image"?Math.sqrt(n*o**2):n*o,B5(l,o,a)}function aie(e,t,i,s,r){var l,u,d;const[n,o,a]=CT(e,r);if(n===o)return os((l=t.stops)==null?void 0:l[n].size,i,s);{const f=os((u=t.stops)==null?void 0:u[n].size,i,s);return f+(os((d=t.stops)==null?void 0:d[o].size,i,s)-f)*a}}function lie(e,t,i,s){const r=(M(s)&&s.resolution?s.resolution:1)*aT[t.valueUnit],n=os(t.minSize,i,s),o=os(t.maxSize,i,s),{valueRepresentation:a}=t;let l=null;return l=a==="area"?2*Math.sqrt(e/Jg)/r:a==="radius"||a==="distance"?2*e/r:e/r,B5(l,n,o)}function U5(e,t,i,s,r){switch(t.transformationType){case Zt.Additive:return sie(e,t,i,s);case Zt.Constant:return rie(t,i,s);case Zt.ClampedLinear:return nie(e,t,i,s);case Zt.Proportional:return oie(e,t,i,s);case Zt.Stops:return aie(e,t,i,s,r);case Zt.RealWorldSize:return lie(e,t,i,s);case Zt.Identity:return e;case Zt.Unknown:return null}}function cie(e,t,i){const{isScaleDriven:s}=e.cache;if(!(s&&i==="3d"||t))return null;const r={scale:t,view:i};let n=os(e.minSize,zC,r),o=os(e.maxSize,zC,r);if(n!=null||o!=null){if(n>o){const a=o;o=n,n=a}return{minSize:n,maxSize:o}}}function uie(e,t,i){if(!e.visualVariables)return;const s=[],r=[],n=[],o=[],a=[];for(const l of e.visualVariables)switch(l.type){case"color":r.push(l);break;case"opacity":n.push(l);break;case"rotation":a.push(l);break;case"size":o.push(l)}return r.forEach(l=>{const u=j5(l,t,i);s.push({variable:l,value:u})}),n.forEach(l=>{const u=V5(l,t,i);s.push({variable:l,value:u})}),a.forEach(l=>{const u=z5(l,t,i);s.push({variable:l,value:u})}),o.forEach(l=>{const u=Yb(l,t,i);s.push({variable:l,value:u})}),s.filter(l=>l.value!=null)}function CT(e,t){if(!t)return;let i=0,s=t.length-1;return t.some((r,n)=>e!!t)).sort((t,i)=>t.value-i.value):e&&(q.getLogger(this.declaredClass).warn("cannot set stops when one of minDataValue, maxDataValue, minSize or maxSize is not null."),e=null),this._set("stops",e)}get transformationType(){return eie(this,this.inputValueType)}readValueExpression(e,t){return e||t.expression&&"$view.scale"}writeValueExpressionWebScene(e,t,i,s){if(e==="$view.scale"){if(s&&s.messages){const r=this.index,n=typeof r=="string"?r:`visualVariables[${r}]`;s.messages.push(new L("property:unsupported",this.type+"VisualVariable.valueExpression = '$view.scale' is not supported in Web Scene. Please remove this property to save the Web Scene.",{instance:this,propertyName:n+".valueExpression",context:s}))}}else t[i]=e}readValueUnit(e){return e?d2.read(e):null}clone(){return new h2({axis:this.axis,field:this.field,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,maxDataValue:this.maxDataValue,maxSize:Ga(this.maxSize)?this.maxSize.clone():this.maxSize,minDataValue:this.minDataValue,minSize:Ga(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()})}flipSizes(){if(this.transformationType===Zt.ClampedLinear){const{minSize:e,maxSize:t}=this;return this.minSize=t,this.maxSize=e,this}if(this.transformationType===Zt.Stops){const e=this.stops;if(!e)return this;const t=e.map(s=>s.size).reverse(),i=e.length;for(let s=0;se.value||0)}};c([h({readOnly:!0})],De.prototype,"cache",null),c([h({type:Oy.apiValues,json:{type:Oy.jsonValues,origins:{"web-map":{read:!1}},read:Oy.read,write:Oy.write}})],De.prototype,"axis",void 0),c([h({type:String,value:null,json:{read:!1}})],De.prototype,"expression",null),c([h()],De.prototype,"index",null),c([h({type:String,readOnly:!0})],De.prototype,"inputValueType",null),c([h({type:Kte,json:{write:!0}})],De.prototype,"legendOptions",void 0),c([h({type:Number,value:null,json:{write:!0}})],De.prototype,"maxDataValue",null),c([h({type:Number,value:null,json:{write:!0}})],De.prototype,"maxSize",null),c([Oe("maxSize")],De.prototype,"castMaxSize",null),c([Q("maxSize")],De.prototype,"readMaxSize",null),c([h({type:Number,value:null,json:{write:!0}})],De.prototype,"minDataValue",null),c([h({type:Number,value:null,json:{write:!0}})],De.prototype,"minSize",null),c([Oe("minSize")],De.prototype,"castMinSize",null),c([Q("minSize")],De.prototype,"readMinSize",null),c([h({type:String,json:{write:!0}})],De.prototype,"normalizationField",void 0),c([h({readOnly:!0})],De.prototype,"arcadeRequired",null),c([h({type:String})],De.prototype,"scaleBy",void 0),c([h({type:[Yu],value:null,json:{write:!0}})],De.prototype,"stops",null),c([h({type:["outline"],json:{write:!0}})],De.prototype,"target",void 0),c([h({type:String,readOnly:!0})],De.prototype,"transformationType",null),c([h({type:["size"],json:{type:["sizeInfo"]}})],De.prototype,"type",void 0),c([h({type:Boolean,json:{write:!0,origins:{"web-map":{read:!1}}}})],De.prototype,"useSymbolValue",void 0),c([h({type:String,json:{write:!0}})],De.prototype,"valueExpression",void 0),c([Q("valueExpression",["valueExpression","expression"])],De.prototype,"readValueExpression",null),c([ie("web-scene","valueExpression")],De.prototype,"writeValueExpressionWebScene",null),c([h({type:["radius","diameter","area","width","distance"],json:{write:!0}})],De.prototype,"valueRepresentation",void 0),c([h({type:d2.apiValues,json:{write:d2.write,origins:{"web-map":{read:!1},"web-scene":{write:!0}}}})],De.prototype,"valueUnit",void 0),c([Q("valueUnit")],De.prototype,"readValueUnit",null),De=h2=c([S("esri.renderers.visualVariables.SizeVariable")],De);const Jb=De,die={color:R5,size:Jb,opacity:L5,rotation:F5},pie=new Ie({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"}),fie=/^\[([^\]]+)\]$/i;let Xg=class extends oe{constructor(){super(...arguments),this.colorVariables=null,this.opacityVariables=null,this.rotationVariables=null,this.sizeVariables=null}set visualVariables(e){if(this._resetVariables(),(e=e&&e.filter(t=>!!t))&&e.length){for(const t of e)switch(t.type){case"color":this.colorVariables.push(t);break;case"opacity":this.opacityVariables.push(t);break;case"rotation":this.rotationVariables.push(t);break;case"size":this.sizeVariables.push(t)}this.sizeVariables.length&&this.sizeVariables.some(t=>!!t.target)&&e.sort((t,i)=>{let s=null;return s=t.target===i.target?0:t.target?1:-1,s});for(let t=0;t{const l=pie.read(a.type),u=die[l];u||(q.getLogger(this.declaredClass).warn(`Unknown variable type: ${l}`),i&&i.messages&&i.messages.push(new Bi("visual-variable:unsupported",`visualVariable of type '${l}' is not supported`,{definition:a,context:i})));const d=new u;return d.read(a,i),d})}writeVariables(e,t){const i=[];for(const s of e){const r=s.toJSON(t);r&&i.push(r)}return i}_resetVariables(){this.colorVariables=[],this.opacityVariables=[],this.rotationVariables=[],this.sizeVariables=[]}};c([h()],Xg.prototype,"visualVariables",null),Xg=c([S("esri.renderers.visualVariables.VisualVariableFactory")],Xg);const mie=Xg,yie={base:qm,key:"type",typeMap:{opacity:L5,color:R5,rotation:F5,size:Jb}},_d=e=>{let t=class extends e{constructor(){super(...arguments),this._vvFactory=new mie}set visualVariables(i){this._vvFactory.visualVariables=i,this._set("visualVariables",this._vvFactory.visualVariables)}readVisualVariables(i,s,r){return this._vvFactory.readVariables(i,s,r)}writeVisualVariables(i,s,r,n){s[r]=this._vvFactory.writeVariables(i,n)}get arcadeRequiredForVisualVariables(){if(!this.visualVariables)return!1;for(const i of this.visualVariables)if(i.arcadeRequired)return!0;return!1}hasVisualVariables(i,s){return i?this.getVisualVariablesForType(i,s).length>0:this.getVisualVariablesForType("size",s).length>0||this.getVisualVariablesForType("color",s).length>0||this.getVisualVariablesForType("opacity",s).length>0||this.getVisualVariablesForType("rotation",s).length>0}getVisualVariablesForType(i,s){const r=this.visualVariables;return r?r.filter(n=>n.type===i&&(typeof s=="string"?n.target===s:s!==!1||!n.target)):[]}async collectVVRequiredFields(i,s){let r=[];this.visualVariables&&(r=r.concat(this.visualVariables));for(const n of r)n&&(n.field&&$s(i,s,n.field),n.normalizationField&&$s(i,s,n.normalizationField),n.valueExpression&&(gie(n.valueExpression,i,s)||await Ui(i,s,n.valueExpression)))}};return c([h({types:[yie],value:null,json:{write:!0}})],t.prototype,"visualVariables",null),c([Q("visualVariables",["visualVariables","rotationType","rotationExpression"])],t.prototype,"readVisualVariables",null),c([ie("visualVariables")],t.prototype,"writeVisualVariables",null),t=c([S("esri.renderers.mixins.VisualVariablesMixin")],t),t};function gie(e,t,i){const s=Xte(e);return!!M(s)&&($s(t,i,s),!0)}const zd={retainId:!1,ignoreDrivers:!1,hasLabelingContext:!0};function vie(e,t=zd){var a,l;if(!e)return{symbol:null};const{retainId:i=zd.retainId,ignoreDrivers:s=zd.ignoreDrivers,hasLabelingContext:r=zd.hasLabelingContext,retainCIM:n=zd.retainCIM}=t;let o=null;if(Jh(e)||e instanceof mu)o=e.clone();else if(e.type==="cim"){const u=(l=(a=e.data)==null?void 0:a.symbol)==null?void 0:l.type;if(u!=="CIMPointSymbol")return{error:new L("symbol-conversion:unsupported-cim-symbol",`CIM symbol of type '${u||"unknown"}' is unsupported in 3D`,{symbol:e})};o=n?e.clone():Ac.fromCIMSymbol(e)}else if(e instanceof tr)o=Db.fromSimpleLineSymbol(e);else if(e instanceof vl)o=Ac.fromSimpleMarkerSymbol(e);else if(e instanceof jb)o=Ac.fromPictureMarkerSymbol(e);else if(e instanceof gl)o=t.geometryType&&t.geometryType==="mesh"?Nb.fromSimpleFillSymbol(e):Bm.fromSimpleFillSymbol(e);else{if(!(e instanceof gd))return{error:new L("symbol-conversion:unsupported-2d-symbol",`2D symbol of type '${e.type||e.declaredClass}' is unsupported in 3D`,{symbol:e})};o=r?Fb.fromTextSymbol(e):Ac.fromTextSymbol(e)}if(i&&o&&o.type!=="cim"&&(o.id=e.id),s&&Jh(o))for(let u=0;ue==null||typeof e=="string"||typeof e=="number"?e:`${e}`,json:{type:String,write:{writer:(e,t)=>{t.value=e==null?void 0:e.toString()}}}};var p2;let _a=p2=class extends W{constructor(e){super(e),this.description=null,this.label=null,this.minValue=null,this.maxValue=0,this.symbol=null}clone(){return new p2({description:this.description,label:this.label,minValue:this.minValue,maxValue:this.maxValue,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const e=JSON.stringify(this.symbol);return`${this.minValue}.${this.maxValue}.${e}`}};c([h({type:String,json:{write:!0}})],_a.prototype,"description",void 0),c([h({type:String,json:{write:!0}})],_a.prototype,"label",void 0),c([h({type:Number,json:{read:{source:"classMinValue"},write:{target:"classMinValue"}}})],_a.prototype,"minValue",void 0),c([h({type:Number,json:{read:{source:"classMaxValue"},write:{target:"classMaxValue"}}})],_a.prototype,"maxValue",void 0),c([h(wd)],_a.prototype,"symbol",void 0),_a=p2=c([S("esri.renderers.support.ClassBreakInfo")],_a);const Ev=_a;var f2;const W5="log",Qg="percent-of-total",Kg="field",Ry=new Ie({esriNormalizeByLog:W5,esriNormalizeByPercentOfTotal:Qg,esriNormalizeByField:Kg}),_ie=Dt(Ev);let jt=f2=class extends _d(zo){constructor(e){super(e),this._compiledValueExpression={valueExpression:null,compiledFunction:null},this.backgroundFillSymbol=null,this.classBreakInfos=null,this.defaultLabel=null,this.defaultSymbol=null,this.field=null,this.isMaxInclusive=!0,this.legendOptions=null,this.normalizationField=null,this.normalizationTotal=null,this.type="class-breaks",this.valueExpression=null,this.valueExpressionTitle=null,this._set("classBreakInfos",[])}readClassBreakInfos(e,t,i){if(!Array.isArray(e))return;let s=t.minValue;return e.map(r=>{const n=new Ev;return n.read(r,i),n.minValue==null&&(n.minValue=s),n.maxValue==null&&(n.maxValue=n.minValue),s=n.maxValue,n})}writeClassBreakInfos(e,t,i,s){const r=e.map(n=>n.write({},s));this._areClassBreaksConsecutive()&&r.forEach(n=>delete n.classMinValue),t[i]=r}castField(e){return e==null?e:typeof e=="function"?(q.getLogger(this.declaredClass).error(".field: field must be a string value"),null):Mm(e)}get minValue(){return this.classBreakInfos&&this.classBreakInfos[0]&&this.classBreakInfos[0].minValue||0}get normalizationType(){let e=this._get("normalizationType");const t=!!this.normalizationField,i=this.normalizationTotal!=null;return t||i?(e=t&&Kg||i&&Qg||null,t&&i&&q.getLogger(this.declaredClass).warn("warning: both normalizationField and normalizationTotal are set!")):e!==Kg&&e!==Qg||(e=null),e}set normalizationType(e){this._set("normalizationType",e)}addClassBreakInfo(e,t,i){let s=null;s=typeof e=="number"?new Ev({minValue:e,maxValue:t,symbol:EN(i)}):_ie(R(e)),this.classBreakInfos.push(s),this.classBreakInfos.length===1&&this.notifyChange("minValue")}removeClassBreakInfo(e,t){const i=this.classBreakInfos.length;for(let s=0;s-1?this.classBreakInfos[i].symbol:this.defaultSymbol}async getSymbolAsync(e,t){let i=t;if(this.valueExpression&&(N(t)||N(t.arcade))){const r=await Do(),{arcadeUtils:n}=r;n.hasGeometryOperations(this.valueExpression)&&await n.enableGeometryOperations(),i={...i,arcade:r}}const s=this.getBreakIndex(e,i);return s>-1?this.classBreakInfos[s].symbol:this.defaultSymbol}getSymbols(){const e=[];return this.classBreakInfos.forEach(t=>{t.symbol&&e.push(t.symbol)}),this.defaultSymbol&&e.push(this.defaultSymbol),e}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((e,t)=>e+t.getAttributeHash(),"")}getMeshHash(){const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),i=`${this.normalizationField}.${this.normalizationType}.${this.normalizationTotal}`;return`${e}.${t}.${this.classBreakInfos.reduce((s,r)=>s+r.getMeshHash(),"")}.${i}.${this.field}.${this.valueExpression}`}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}clone(){return new f2({field:this.field,backgroundFillSymbol:this.backgroundFillSymbol&&this.backgroundFillSymbol.clone(),defaultLabel:this.defaultLabel,defaultSymbol:this.defaultSymbol&&this.defaultSymbol.clone(),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,classBreakInfos:R(this.classBreakInfos),isMaxInclusive:this.isMaxInclusive,normalizationField:this.normalizationField,normalizationTotal:this.normalizationTotal,normalizationType:this.normalizationType,visualVariables:R(this.visualVariables),legendOptions:R(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}async collectRequiredFields(e,t){const i=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(i)}async collectSymbolFields(e,t){const i=[...this.getSymbols().map(s=>s.collectRequiredFields(e,t)),Ui(e,t,this.valueExpression)];$s(e,t,this.field),$s(e,t,this.normalizationField),await Promise.all(i)}_getBreakIndexForExpression(e,t){const{viewingMode:i,scale:s,spatialReference:r,arcade:n}=FM(t,{}),{valueExpression:o}=this;let a=this._compiledValueExpression.valueExpression===o?this._compiledValueExpression.compiledFunction:null;const l=n.arcadeUtils;if(!a){const d=l.createSyntaxTree(o);a=l.createFunction(d),this._compiledValueExpression.compiledFunction=a}this._compiledValueExpression.valueExpression=o;const u=l.executeFunction(a,l.createExecContext(e,l.getViewInfo({viewingMode:i,scale:s,spatialReference:r})));return this._getBreakIndexfromInfos(u)}_getBreakIndexForField(e){const t=this.field,i=e.attributes,s=this.normalizationType;let r=parseFloat(i[t]);if(s){const n=this.normalizationTotal,o=parseFloat(this.normalizationField?i[this.normalizationField]:void 0);if(s===W5)r=Math.log(r)*Math.LOG10E;else if(s!==Qg||n==null||isNaN(n)){if(s===Kg&&!isNaN(o)){if(isNaN(r)||isNaN(o))return-1;r/=o}}else r=r/n*100}return this._getBreakIndexfromInfos(r)}_getBreakIndexfromInfos(e){const t=this.isMaxInclusive;if(e!=null&&typeof e=="number"&&!isNaN(e))for(let i=0;iYs(e),json:{write:!0}})],jt.prototype,"normalizationTotal",void 0),c([h({type:Ry.apiValues,value:null,json:{type:Ry.jsonValues,read:Ry.read,write:Ry.write}})],jt.prototype,"normalizationType",null),c([ue({classBreaks:"class-breaks"})],jt.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],jt.prototype,"valueExpression",void 0),c([h({type:String,json:{write:!0}})],jt.prototype,"valueExpressionTitle",void 0),jt=f2=c([S("esri.renderers.ClassBreaksRenderer")],jt);const H5=jt;class wie{constructor(t,i){this._storage=new QN,this._storage.maxSize=t,i&&this._storage.registerRemoveFunc("",i)}put(t,i,s){this._storage.put(t,i,s,1)}pop(t){return this._storage.pop(t)}get(t){return this._storage.get(t)}clear(){this._storage.clearAll()}destroy(){this._storage.destroy()}get maxSize(){return this._storage.maxSize}set maxSize(t){this._storage.maxSize=t}}const WC="esri.renderers.support.DictionaryLoader",xie={type:"CIMSimpleLineCallout",lineSymbol:{type:"CIMLineSymbol",symbolLayers:[{type:"CIMSolidStroke",width:.5,color:[0,0,0,255]}]}};class AT{constructor(t,i,s){this.config=null,this.fieldMap=null,this.url=null,this._ongoingRequests=new Map,this._symbolCache=new wie(100),this._dictionaryPromise=null,this.url=t,this.config=i,this.fieldMap=s}getSymbolFields(){return this._symbolFields}async getSymbolAsync(t,i){let s;this._dictionaryPromise||(this._dictionaryPromise=this.fetchResources(i));try{s=await this._dictionaryPromise}catch(y){if(Ks(y))return this._dictionaryPromise=null,null}const r={};if(this.fieldMap)for(const y of this._symbolFields){const g=this.fieldMap[y];if(g&&t.attributes[g]!=null){const v=""+t.attributes[g];r[y]=v}else r[y]=""}const n=s==null?void 0:s(r,i);if(!n||typeof n!="string")return null;const o=NM(n).toString(),a=this._symbolCache.get(o);if(a)return a.catch(()=>{this._symbolCache.pop(o)}),a;const l=n.split(";"),u=[],d=[];for(const y of l)if(y)if(y.includes("po:")){const g=y.substr(3).split("|");if(g.length===3){const v=g[0],b=g[1];let _=g[2];if(b==="DashTemplate")_=_.split(" ").map(x=>Number(x));else if(b==="Color"){const x=new pe(_).toRgba();_=[x[0],x[1],x[2],255*x[3]]}else _=Number(_);d.push({primitiveName:v,propertyName:b,value:_})}}else if(y.includes("|")){for(const g of y.split("|"))if(this._itemNames.has(g)){u.push(g);break}}else this._itemNames.has(y)&&u.push(y);const f=!M(t.geometry)||!t.geometry.hasZ&&t.geometry.type==="point",m=this._cimPartsToCIMSymbol(u,d,f,i);return this._symbolCache.put(o,m,1),m}async fetchResources(t){if(this._dictionaryPromise)return this._dictionaryPromise;if(!this.url)return void q.getLogger(WC).error("no valid URL!");const i=kt(this.url+"/resources/styles/dictionary-info.json",{responseType:"json",query:{f:"json"},signal:M(t)?t.signal:null}),[{data:s}]=await Promise.all([i,Do()]);if(!s)throw this._dictionaryPromise=null,new L("esri.renderers.DictionaryRenderer","Bad dictionary data!");const r=s.expression,n=s.authoringInfo;this._refSymbolUrlTemplate=this.url+"/"+s.cimRefTemplateUrl,this._itemNames=new Set(s.itemsNames),this._symbolFields=n.symbol;const o={};if(this.config){const u=this.config;for(const d in u)o[d]=u[d]}if(n.configuration)for(const u of n.configuration)o.hasOwnProperty(u.name)||(o[u.name]=u.value);const a=[];if(M(t)&&t.fields&&this.fieldMap)for(const u of this._symbolFields){const d=this.fieldMap[u],f=t.fields.filter(m=>m.name===d);f.length>0&&a.push({...f[0],name:u})}const l=xX(r,M(t)?t.spatialReference:null,a,o).then(u=>{const d={scale:0};return(f,m)=>{if(N(u))return null;const y=u.repurposeFeature({geometry:null,attributes:f});return d.scale=M(m)?m.scale:void 0,u.evaluate({$feature:y,$view:d})}}).catch(u=>(q.getLogger(WC).error("Creating dictinoary expression failed:",u),null));return this._dictionaryPromise=l,l}async _cimPartsToCIMSymbol(t,i,s,r){const n=new Array(t.length);for(let l=0;ln.data);const s=this._refSymbolUrlTemplate.replace(/\{itemName\}/gi,t),r=kt(s,{responseType:"json",query:{f:"json"},...i});this._ongoingRequests.set(t,r);try{return(await r).data}catch(n){throw this._ongoingRequests.delete(t),n}}_combineSymbolParts(t,i,s){if(!t||t.length===0)return null;const r={...t[0]};if(t.length>1){r.symbolLayers=[];for(const n of t){const o=n;r.symbolLayers.unshift(...o.symbolLayers)}}return s&&(r.callout=xie),{type:"CIMSymbolReference",symbol:r,primitiveOverrides:i}}}function Y5(e,t){if(!e)return;const i=e.symbolLayers;if(!i)return;let s=i.length;for(;s--;){const r=i[s];r&&r.enable!==!1&&r.type==="CIMVectorMarker"&&Sie(r,t)}}function Sie(e,t){const i=e.markerGraphics;if(i)for(const s of i){if(!s)continue;const r=s.symbol;if(r)switch(r.type){case"CIMPointSymbol":case"CIMLineSymbol":case"CIMPolygonSymbol":Y5(r,t);break;case"CIMTextSymbol":r.fieldMap=t}}}var I_e=Object.freeze(Object.defineProperty({__proto__:null,DictionaryLoader:AT},Symbol.toStringTag,{value:"Module"})),m2;let _r=m2=class extends _d(zo){constructor(e){super(e),this.config=null,this.fieldMap=null,this.scaleExpression=null,this.scaleExpressionTitle=null,this.url=null,this.type="dictionary"}get _loader(){return new AT(this.url,this.config,this.fieldMap)}writeData(e,t){e&&(t.scalingExpressionInfo={expression:e,returnType:"number"})}writeVisualVariables(e,t,i,s){s!=null&&s.origin||super.writeVisualVariables(e,t,i,s)}clone(){return new m2({config:R(this.config),scaleExpression:this.scaleExpression,scaleExpressionTitle:this.scaleExpressionTitle,fieldMap:R(this.fieldMap),url:R(this.url),visualVariables:R(this.visualVariables)})}async getSymbolAsync(e,t){return this._loader.getSymbolAsync(e,t)}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t),this.scaleExpression&&await Ui(e,t,this.scaleExpression);for(const i in this.fieldMap){const s=this.fieldMap[i];t.has(s)&&e.add(s)}}get arcadeRequired(){return!0}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._loader.getSymbolFields()}};c([h({type:AT})],_r.prototype,"_loader",null),c([h({type:Object,json:{read:{source:"configuration"},write:{target:"configuration"}}})],_r.prototype,"config",void 0),c([h({type:Object,json:{write:!0}})],_r.prototype,"fieldMap",void 0),c([h({type:String,json:{read:{source:"scalingExpressionInfo.expression"},write:!0}})],_r.prototype,"scaleExpression",void 0),c([ie("scaleExpression")],_r.prototype,"writeData",null),c([h({type:String,json:{read:{source:"scalingExpressionInfo.title"},write:{target:"scalingExpressionInfo.title",overridePolicy(e){return{enabled:!!e&&!!this.scaleExpression}}}}})],_r.prototype,"scaleExpressionTitle",void 0),c([h({type:String,json:{write:!0}})],_r.prototype,"url",void 0),c([ie("visualVariables")],_r.prototype,"writeVisualVariables",null),_r=m2=c([S("esri.renderers.DictionaryRenderer")],_r);const Mie=_r;var y2;let so=y2=class extends W{constructor(e){super(e),this.color=null,this.field=null,this.label=null,this.valueExpression=null,this.valueExpressionTitle=null}castField(e){return e==null?e:typeof e=="function"?(q.getLogger(this.declaredClass).error(".field: field must be a string value"),null):Mm(e)}getAttributeHash(){return`${this.field}-${this.valueExpression}`}clone(){return new y2({color:this.color&&this.color.clone(),field:this.field,label:this.label,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};c([h({type:pe,json:{type:[Number],write:!0}})],so.prototype,"color",void 0),c([h({type:String,json:{write:!0}})],so.prototype,"field",void 0),c([Oe("field")],so.prototype,"castField",null),c([h({type:String,json:{write:!0}})],so.prototype,"label",void 0),c([h({type:String,json:{write:!0}})],so.prototype,"valueExpression",void 0),c([h({type:String,json:{write:!0}})],so.prototype,"valueExpressionTitle",void 0),so=y2=c([S("esri.renderers.support.AttributeColorInfo")],so);const J5=so;var g2;let e0=g2=class extends W{constructor(){super(...arguments),this.unit=null}clone(){return new g2({unit:this.unit})}};c([h({type:String,json:{write:!0}})],e0.prototype,"unit",void 0),e0=g2=c([S("esri.renderers.support.DotDensityLegendOptions")],e0);const $ie=e0;var v2;let Qi=v2=class extends _d(zo){constructor(e){super(e),this.attributes=null,this.backgroundColor=new pe([0,0,0,0]),this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new tr,this.dotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(e){if(this.referenceScale==null)return this.dotValue;const t=e/this.referenceScale*this.dotValue;return t<1?1:t}getSymbol(){return new gl({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){var e,t;return(t=(e=this.attributes)==null?void 0:e.reduce((i,s)=>i+s.getAttributeHash(),""))!=null?t:""}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new v2({attributes:R(this.attributes),backgroundColor:R(this.backgroundColor),dotBlendingEnabled:R(this.dotBlendingEnabled),dotShape:R(this.dotShape),dotSize:R(this.dotSize),dotValue:R(this.dotValue),legendOptions:R(this.legendOptions),outline:R(this.outline),referenceScale:R(this.referenceScale),visualVariables:R(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}getControllerHash(){var t;return`${(t=this.attributes)==null?void 0:t.map(i=>i.field||i.valueExpression||"")}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(e,t){var i;await this.collectVVRequiredFields(e,t);for(const s of(i=this.attributes)!=null?i:[])s.valueExpression&&await Ui(e,t,s.valueExpression),s.field&&e.add(s.field)}};c([h({type:[J5],json:{write:!0}})],Qi.prototype,"attributes",void 0),c([h({type:pe,json:{write:!0}})],Qi.prototype,"backgroundColor",void 0),c([h({type:Boolean,json:{write:!0}})],Qi.prototype,"dotBlendingEnabled",void 0),c([h({type:String,json:{write:!1}})],Qi.prototype,"dotShape",void 0),c([h({type:Number,json:{write:!0}})],Qi.prototype,"dotSize",void 0),c([h({type:$ie,json:{write:!0}})],Qi.prototype,"legendOptions",void 0),c([h({type:tr,json:{default:null,write:!0}})],Qi.prototype,"outline",void 0),c([h({type:Number,json:{write:!0}})],Qi.prototype,"dotValue",void 0),c([h({type:Number,json:{write:!0}})],Qi.prototype,"referenceScale",void 0),c([h({type:Number,json:{write:!0}})],Qi.prototype,"seed",void 0),c([ue({dotDensity:"dot-density"})],Qi.prototype,"type",void 0),Qi=v2=c([S("esri.renderers.DotDensityRenderer")],Qi);const Tie=Qi;let Ju=class extends xt(W){constructor(){super(...arguments),this.minLabel=null,this.maxLabel=null,this.title=null}};c([h({type:String,json:{write:!0}})],Ju.prototype,"minLabel",void 0),c([h({type:String,json:{write:!0}})],Ju.prototype,"maxLabel",void 0),c([h({type:String,json:{write:!0}})],Ju.prototype,"title",void 0),Ju=c([S("esri.renderers.support.HeatmapLegendOptions")],Ju);function Xb(){return[0,0,0,0]}function Iie(e){return[e[0],e[1],e[2],e[3]]}function xd(e,t,i,s){return[e,t,i,s]}function Eie(e){const t=Xb(),i=Math.min(4,e.length);for(let s=0;sa>=0&&a<=1).sort((a,l)=>a.ratio-l.ratio).map(({color:a,ratio:l})=>({color:a,ratio:Math.max(l,.001)})),e.length<1)return i;let s=e[0],r=e[0],n=1;const o=Xb();for(let a=0;a<512;a++){const l=(a+.5)/512;for(;l>r.ratio&&n=i+_||b.y<-_||b.y>s+_)continue;const x=+f(g),$=Math.max(0,Math.round(b.x)-a),I=Math.max(0,Math.round(b.y)-a),T=Math.min(s,Math.round(b.y)+a),k=Math.min(i,Math.round(b.x)+a);for(let A=I;Ad&&(d=u)}}}return{matrix:l.buffer,max:d}}function C_e(e,t,i,s,r,n){e.canvas.width=e.canvas.height=t,e.clearRect(0,0,t,t);const o=e.getImageData(0,0,t,t);i&&s&&o.data.set(new Uint8ClampedArray(jie(t,i,s,r,n))),e.putImageData(o,0,0)}function jie(e,t,i,s,r){const n=new Uint32Array(e*e),o="buffer"in t?t:new Float64Array(t),a="buffer"in i?new Uint32Array(i.buffer):new Uint32Array(new Uint8Array(i).buffer),l=a.length/(r-s);for(let u=0;u1?0:3/(Math.PI*i**2)*(1-s**2)**2}function P_e(e,t){return typeof e=="function"?e:e?typeof t=="string"?i=>-1*+i[e]:i=>+i[e]+t:()=>1}function zie(e,t){return e!=null?typeof t=="string"?i=>-1*+i.readAttribute(e):i=>+i.readAttribute(e)+t:i=>1}var b2;const i4="esri.renderers.HeatmapRenderer",Bie=q.getLogger(i4);function HC(e){if(e!=null){const{maxDensity:t,minDensity:i,radius:s}=e;if(t!=null||i!=null||s!=null){const{blurRadius:r,maxPixelIntensity:n,minPixelIntensity:o,...a}=e;return a}}return e}let Jt=b2=class extends zo{constructor(e){super(e),this.authoringInfo=null,this.colorStops=[new _f({ratio:0,color:new pe("rgba(255, 140, 0, 0)")}),new _f({ratio:.75,color:new pe("rgba(255, 140, 0, 1)")}),new _f({ratio:.9,color:new pe("rgba(255, 0, 0, 1)")})],this.field=null,this.fieldOffset=0,this.legendOptions=null,this.maxDensity=.04,this.minDensity=0,this.radius=18,this.referenceScale=0,this.type="heatmap",this.valueExpression=null,this.valueExpressionTitle=null,this._warnedProps={blurRadius:!1,maxPixelIntensity:!1,minPixelIntensity:!1}}normalizeCtorArgs(e){return HC(e)}get blurRadius(){return Die(this.radius)}set blurRadius(e){const t=this.maxPixelIntensity,i=this.minPixelIntensity;this._set("radius",Fie(e)),this._warnAboutDeprecatedGaussianBlurProp("blurRadius","radius"),this._set("maxDensity",t*this._pixelIntensityToDensity),this._set("minDensity",i*this._pixelIntensityToDensity)}get maxPixelIntensity(){return this.maxDensity/this._pixelIntensityToDensity}set maxPixelIntensity(e){this._set("maxDensity",e*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("maxPixelIntensity","maxDensity")}get minPixelIntensity(){return this.minDensity/this._pixelIntensityToDensity}set minPixelIntensity(e){this._set("minDensity",e*this._pixelIntensityToDensity),this._warnAboutDeprecatedGaussianBlurProp("minPixelIntensity","minDensity")}get _pixelIntensityToDensity(){return 24/(OT**2*this.blurRadius**4)}_warnAboutDeprecatedGaussianBlurProp(e,t){this._warnedProps[e]||ki(this).getDefaultOrigin()==="user"&&(this._warnedProps[e]=!0,ad(()=>{dz(Bie,e,{replacement:`${String(t)} (suggested value: ${this._get(t)})`,version:"4.24"})}))}read(e,t){e=HC(e),super.read(e,t)}getSymbol(){return new vl}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}async collectRequiredFields(e,t){const i=this.field,s=this.valueExpression;i&&typeof i=="string"&&await $s(e,t,i),s&&typeof s=="string"&&await Ui(e,t,s)}getAttributeHash(){return null}getMeshHash(){return`${JSON.stringify(this.colorStops)}.${this.blurRadius}.${this.field}`}clone(){return new b2({authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),colorStops:R(this.colorStops),field:this.field,legendOptions:R(this.legendOptions),maxDensity:this.maxDensity,minDensity:this.minDensity,radius:this.radius,referenceScale:this.referenceScale,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle})}};c([h({type:kT,json:{write:!0,origins:{"web-scene":{write:!1,read:!1}}}})],Jt.prototype,"authoringInfo",void 0),c([h({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],Jt.prototype,"blurRadius",null),c([h({type:[_f],json:{write:!0}})],Jt.prototype,"colorStops",void 0),c([h({type:String,json:{write:!0}})],Jt.prototype,"field",void 0),c([h({type:Number,json:{write:{overridePolicy:(e,t,i)=>({enabled:i==null})},origins:{"web-scene":{write:!1}}}})],Jt.prototype,"fieldOffset",void 0),c([h({type:Ju,json:{write:!0}})],Jt.prototype,"legendOptions",void 0),c([h({type:Number,json:{write:!0}})],Jt.prototype,"maxDensity",void 0),c([h({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],Jt.prototype,"maxPixelIntensity",null),c([h({type:Number,json:{write:!0}})],Jt.prototype,"minDensity",void 0),c([h({type:Number,json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],Jt.prototype,"minPixelIntensity",null),c([h({type:Number,cast:Fe,json:{write:!0}})],Jt.prototype,"radius",void 0),c([h({type:Number,range:{min:0},json:{default:0,write:!0}})],Jt.prototype,"referenceScale",void 0),c([ue({heatmap:"heatmap"})],Jt.prototype,"type",void 0),c([h({type:String,json:{write:!0,origins:{"web-document":{write:!1},"portal-item":{write:!1}}}})],Jt.prototype,"valueExpression",void 0),c([h({type:String})],Jt.prototype,"valueExpressionTitle",void 0),c([h({readOnly:!0})],Jt.prototype,"_pixelIntensityToDensity",null),Jt=b2=c([S(i4)],Jt);const s4=Jt;let wc=class extends xt(W){constructor(){super(...arguments),this.color=new pe([0,0,0,0]),this.label=null,this.threshold=0}};c([h({type:pe,json:{write:!0}})],wc.prototype,"color",void 0),c([h({type:String,json:{write:!0}})],wc.prototype,"label",void 0),c([h({type:Number,range:{min:0,max:1},json:{write:!0}})],wc.prototype,"threshold",void 0),wc=c([S("esri.renderers.support.OthersCategory")],wc);let t0=class extends xt(W){constructor(){super(...arguments),this.title=null}};c([h({type:String,json:{write:!0}})],t0.prototype,"title",void 0),t0=c([S("esri.renderers.support.PieChartLegendOptions")],t0);let ms=class extends _d(xt(zo)){constructor(e){super(e),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new pe([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new wc,this.legendOptions=null,this.outline=null,this.size=12,this.type="pie-chart"}getSymbol(){var e;return new vl({size:this.size?this.size/2+(((e=this.outline)==null?void 0:e.width)||0):0})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(M)}getAttributeHash(){return this.visualVariables&&this.visualVariables.reduce((e,t)=>e+t.getAttributeHash(),"")}getMeshHash(){return this.getSymbols().reduce((e,t)=>e+JSON.stringify(t),"")}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t);for(const i of this.attributes)i.valueExpression&&await Ui(e,t,i.valueExpression),i.field&&e.add(i.field)}};c([h({type:[J5],json:{write:!0}})],ms.prototype,"attributes",void 0),c([h({type:gl,json:{default:null,write:!0}})],ms.prototype,"backgroundFillSymbol",void 0),c([h({type:pe,json:{write:!0}})],ms.prototype,"defaultColor",void 0),c([h({type:String,json:{write:!0}})],ms.prototype,"defaultLabel",void 0),c([h({type:Number,range:{min:0,max:1},json:{write:!0}})],ms.prototype,"holePercentage",void 0),c([h({type:wc,json:{write:!0}})],ms.prototype,"othersCategory",void 0),c([h({type:t0,json:{write:!0}})],ms.prototype,"legendOptions",void 0),c([h({type:tr,json:{default:null,write:!0}})],ms.prototype,"outline",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],ms.prototype,"size",void 0),c([ue({pieChart:"pie-chart"})],ms.prototype,"type",void 0),ms=c([S("esri.renderers.PieChartRenderer")],ms);const Uie=ms;var _2;let tc=_2=class extends _d(zo){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 _2({description:this.description,label:this.label,symbol:this.symbol&&this.symbol.clone(),visualVariables:R(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}};c([h({type:String,json:{write:!0}})],tc.prototype,"description",void 0),c([h({type:String,json:{write:!0}})],tc.prototype,"label",void 0),c([h(wd)],tc.prototype,"symbol",void 0),c([ue({simple:"simple"})],tc.prototype,"type",void 0),tc=_2=c([S("esri.renderers.SimpleRenderer")],tc);const Xh=tc,qie=["esri.Color","esri.portal.Portal","esri.symbols.support.Symbol3DAnchorPosition2D","esri.symbols.support.Symbol3DAnchorPosition3D"];function w2(e){return e instanceof oe}function YC(e){return e instanceof he?Object.keys(e.items):w2(e)?ki(e).keys():e?Object.keys(e):[]}function Ly(e,t){return e instanceof he?e.items[t]:e[t]}function Gie(e,t){return!(!Array.isArray(e)||!Array.isArray(t))&&e.length!==t.length}function Sf(e){return e?e.declaredClass:null}function r4(e,t){const i=e.diff;if(i&&typeof i=="function")return i(e,t);const s=YC(e),r=YC(t);if(s.length===0&&r.length===0)return;if(!s.length||!r.length||Gie(e,t))return{type:"complete",oldValue:e,newValue:t};const n=r.filter(f=>!s.includes(f)),o=s.filter(f=>!r.includes(f)),a=s.filter(f=>r.includes(f)&&Ly(e,f)!==Ly(t,f)).concat(n,o).sort(),l=Sf(e);if(l&&qie.includes(l)&&a.length)return{type:"complete",oldValue:e,newValue:t};let u;const d=w2(e)&&w2(t);for(const f of a){const m=Ly(e,f),y=Ly(t,f);let g;if((d||typeof m!="function"&&typeof y!="function")&&m!==y&&(m!=null||y!=null)){if(i&&i[f]&&typeof i[f]=="function")g=i[f](m,y);else if(m instanceof Date&&y instanceof Date){if(m.getTime()===y.getTime())continue;g={type:"complete",oldValue:m,newValue:y}}else g=typeof m=="object"&&typeof y=="object"&&Sf(m)===Sf(y)?r4(m,y):{type:"complete",oldValue:m,newValue:y};M(g)&&(M(u)?u.diff[f]=g:u={type:"partial",diff:{[f]:g}})}}return u}function Wie(e,t){if(N(e))return!1;const i=t.split(".");let s=e;for(const r of i){if(s.type==="complete")return!0;if(s.type!=="partial")return!1;{const n=s.diff[r];if(!n)return!1;s=n}}return!0}function A_e(e,t){for(const i of t)if(Wie(e,i))return!0;return!1}function Hie(e,t){if(!(typeof e=="function"||typeof t=="function"||N(e)&&N(t)))return N(e)||N(t)||typeof e=="object"&&typeof t=="object"&&Sf(e)!==Sf(t)?{type:"complete",oldValue:e,newValue:t}:r4(e,t)}let Xu=class extends xt(W){constructor(e){super(e),this.value=null,this.value2=null,this.value3=null}};c([h(Zg)],Xu.prototype,"value",void 0),c([h(Zg)],Xu.prototype,"value2",void 0),c([h(Zg)],Xu.prototype,"value3",void 0),Xu=c([S("esri.renderers.support.UniqueValue")],Xu);const Rh=Xu;let wa=class extends xt(W){constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.values=null}castValues(e){if(e==null)return null;const t=typeof(e=Array.isArray(e)?e:[e])[0];return t==="string"||t==="number"?e.map(i=>new Rh({value:i})):t==="object"?e[0]instanceof Rh?e:e.map(i=>new Rh(i)):null}};c([h({type:String,json:{write:!0}})],wa.prototype,"description",void 0),c([h({type:String,json:{write:!0}})],wa.prototype,"label",void 0),c([h(wd)],wa.prototype,"symbol",void 0),c([h({type:[Rh],json:{type:[[String]],read:{reader:e=>e?e.map(t=>new Rh({value:t[0],value2:t[1],value3:t[2]})):null},write:{writer:(e,t)=>{const i=[];for(const s of e){const r=[s.value,s.value2,s.value3].filter(M).map(n=>n.toString());i.push(r)}t.values=i}}}})],wa.prototype,"values",void 0),c([Oe("values")],wa.prototype,"castValues",null),wa=c([S("esri.renderers.support.UniqueValueClass")],wa);const n4=wa;let Np=class extends xt(W){constructor(e){super(e),this.heading=null,this.classes=null}};c([h({type:String,json:{write:!0}})],Np.prototype,"heading",void 0),c([h({type:[n4],json:{write:!0}})],Np.prototype,"classes",void 0),Np=c([S("esri.renderers.support.UniqueValueGroup")],Np);const x2=Np;var S2;let ic=S2=class extends W{constructor(e){super(e),this.description=null,this.label=null,this.symbol=null,this.value=null}clone(){return new S2({value:this.value,description:this.description,label:this.label,symbol:this.symbol?this.symbol.clone():null})}getMeshHash(){const e=JSON.stringify(this.symbol&&this.symbol.toJSON());return`${this.value}.${e}`}};c([h({type:String,json:{write:!0}})],ic.prototype,"description",void 0),c([h({type:String,json:{write:!0}})],ic.prototype,"label",void 0),c([h(wd)],ic.prototype,"symbol",void 0),c([h(Zg)],ic.prototype,"value",void 0),ic=S2=c([S("esri.renderers.support.UniqueValueInfo")],ic);const Mf=ic,Yie=()=>!!V("enable-feature:force-wosr"),O_e=()=>!!V("enable-feature:SceneLayer-editing"),pw={};async function Jie(e,t){try{return{data:(await Kie(e,t)).data,baseUrl:Uz(e),styleUrl:e}}catch(i){return Em(i),null}}function Xie(e,t,i){const s=M(t.portal)?t.portal:cs.getDefault();let r;const n=`${s.url} - ${s.user&&s.user.username} - ${e}`;return pw[n]||(pw[n]=Zie(e,s,i).then(o=>(r=o,o.fetchData())).then(o=>{var a;return{data:o,baseUrl:(a=r.itemUrl)!=null?a:"",styleName:e}})),pw[n]}function Zie(e,t,i){return t.load(i).then(()=>{const s=new wo({disableExtraQuery:!0,query:`owner:${JC} AND type:${XC} AND typekeywords:"${e}"`});return t.queryItems(s,i)}).then(({results:s})=>{var o;let r=null;const n=e.toLowerCase();if(s&&Array.isArray(s)){for(const a of s)if(((o=a.typeKeywords)==null?void 0:o.some(u=>u.toLowerCase()===n))&&a.type===XC&&a.owner===JC){r=a;break}}if(!r)throw new L("symbolstyleutils:style-not-found",`The style '${e}' could not be found`,{styleName:e});return r.load(i)})}function Qie(e,t,i){return e&&M(e.styleUrl)?Jie(e.styleUrl,i):e&&M(e.styleName)?Xie(e.styleName,t,i):Promise.reject(new L("symbolstyleutils:style-url-and-name-missing","Either styleUrl or styleName is required to resolve a style"))}function R_e(e){return e===null||e.type==="CIMSymbolReference"?e:{type:"CIMSymbolReference",symbol:e}}function L_e(e,t){if(t==="cimRef")return e.cimRef;if(e.formatInfos&&!Yie()){for(const i of e.formatInfos)if(i.type==="gltf")return i.href}return e.webRef}function Kie(e,t){const i={responseType:"json",query:{f:"json"},...t};return kt(Zs(e),i)}const JC="esri_en",XC="Style",F_e="https://cdn.arcgis.com/sharing/rest/content/items/220936cc6ed342c9937abd8f180e7d1e/resources/styles/cim/{SymbolName}.json?f=json";var jp;const o4="esri.renderers.UniqueValueRenderer",Qo=q.getLogger(o4),ZC="uvInfos-watcher",QC="uvGroups-watcher",ese=",",tse=Dt(Mf);function ise(e){const{field1:t,field2:i,field3:s,fieldDelimiter:r,uniqueValueInfos:n,valueExpression:o}=e,a=!(!t||!i);return[{classes:(n!=null?n:[]).map(l=>{var _;const{symbol:u,label:d,value:f,description:m}=l,[y,g,v]=a?((_=f==null?void 0:f.toString())==null?void 0:_.split(r||""))||[]:[f],b=[];return(t||o)&&b.push(y),i&&b.push(g),s&&b.push(v),{symbol:u,label:d,values:[b],description:m}})}]}let pt=jp=class extends _d(zo){constructor(e){super(e),this._valueInfoMap={},this._isDefaultSymbolDerived=!1,this._isInfosSource=null,this.type="unique-value",this.backgroundFillSymbol=null,this.valueExpressionTitle=null,this.legendOptions=null,this.defaultLabel=null,this.portal=null,this.styleOrigin=null,this.diff={uniqueValueInfos(t,i){if(!t&&!i)return;if(!t||!i)return{type:"complete",oldValue:t,newValue:i};let s=!1;const r={type:"collection",added:[],removed:[],changed:[],unchanged:[]};for(let n=0;na.value===i[n].value);o?Hie(o,i[n])?(r.changed.push({type:"complete",oldValue:o,newValue:i[n]}),s=!0):r.unchanged.push({oldValue:o,newValue:i[n]}):(r.added.push(i[n]),s=!0)}for(let n=0;no.value===t[n].value)||(r.removed.push(t[n]),s=!0);return s?r:void 0}},this._set("uniqueValueInfos",[]),this._set("uniqueValueGroups",[])}get _cache(){return{compiledFunc:null}}set field(e){this._set("field",e),this._updateFieldDelimiter(),this._updateUniqueValues()}castField(e){return e==null||typeof e=="function"?e:Mm(e)}writeField(e,t,i,s){typeof e=="string"?t[i]=e:s&&s.messages?s.messages.push(new L("property:unsupported","UniqueValueRenderer.field set to a function cannot be written to JSON")):Qo.error(".field: cannot write field to JSON since it's not a string value")}set field2(e){this._set("field2",e),this._updateFieldDelimiter(),this._updateUniqueValues()}set field3(e){this._set("field3",e),this._updateUniqueValues()}set valueExpression(e){this._set("valueExpression",e),this._updateUniqueValues()}set defaultSymbol(e){this._isDefaultSymbolDerived=!1,this._set("defaultSymbol",e)}set fieldDelimiter(e){this._set("fieldDelimiter",e),this._updateUniqueValues()}readPortal(e,t,i){return i.portal||cs.getDefault()}readStyleOrigin(e,t,i){if(t.styleName)return Object.freeze({styleName:t.styleName});if(t.styleUrl){const s=fd(t.styleUrl,i);return Object.freeze({styleUrl:s})}}writeStyleOrigin(e,t,i,s){e.styleName?t.styleName=e.styleName:e.styleUrl&&(t.styleUrl=Vm(e.styleUrl,s))}set uniqueValueGroups(e){this.styleOrigin?Qo.error("#uniqueValueGroups=","Cannot modify unique value groups of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueGroups",e),this._updateInfosFromGroups(),this._isInfosSource=!1,this._watchUniqueValueGroups())}set uniqueValueInfos(e){this.styleOrigin?Qo.error("#uniqueValueInfos=","Cannot modify unique value infos of a UniqueValueRenderer created from a web style"):(this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos())}addUniqueValueInfo(e,t){var s;if(this.styleOrigin)return void Qo.error("#addUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");let i;i=typeof e=="object"?tse(e):new Mf({value:e,symbol:EN(t)}),(s=this.uniqueValueInfos)==null||s.push(i),this._valueInfoMap[i.value]=i,this._updateGroupsFromInfos(),this._isInfosSource=!0,this._watchUniqueValueInfos()}removeUniqueValueInfo(e){if(this.styleOrigin)return void Qo.error("#removeUniqueValueInfo()","Cannot modify unique value infos of a UniqueValueRenderer created from a web style");const t=this.uniqueValueInfos;if(t){for(let i=0;ie+t.getAttributeHash(),"")}getMeshHash(){var s;const e=JSON.stringify(this.backgroundFillSymbol),t=JSON.stringify(this.defaultSymbol),i=(s=this.uniqueValueInfos)==null?void 0:s.reduce((r,n)=>r+n.getMeshHash(),"");return`${e}.${t}.${i}.${`${this.field}.${this.field2}.${this.field3}.${this.fieldDelimiter}`}.${this.valueExpression}`}clone(){const e=new jp({field:this.field,field2:this.field2,field3:this.field3,defaultLabel:this.defaultLabel,defaultSymbol:R(this.defaultSymbol),valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,fieldDelimiter:this.fieldDelimiter,visualVariables:R(this.visualVariables),legendOptions:R(this.legendOptions),authoringInfo:this.authoringInfo&&this.authoringInfo.clone(),backgroundFillSymbol:R(this.backgroundFillSymbol)});this._isDefaultSymbolDerived&&(e._isDefaultSymbolDerived=!0),e._set("portal",this.portal);const t=R(this.uniqueValueInfos),i=R(this.uniqueValueGroups);return this.styleOrigin&&(e._set("styleOrigin",Object.freeze(R(this.styleOrigin))),Object.freeze(t),Object.freeze(i)),e._set("uniqueValueInfos",t),e._updateValueInfoMap(),e._set("uniqueValueGroups",i),e._isInfosSource=this._isInfosSource,e._watchUniqueValueInfosAndGroups(),e}get arcadeRequired(){return this.arcadeRequiredForVisualVariables||!!this.valueExpression}async collectRequiredFields(e,t){const i=[this.collectVVRequiredFields(e,t),this.collectSymbolFields(e,t)];await Promise.all(i)}async collectSymbolFields(e,t){const i=[...this.getSymbols().map(s=>s.collectRequiredFields(e,t)),Ui(e,t,this.valueExpression)];$s(e,t,this.field),$s(e,t,this.field2),$s(e,t,this.field3),await Promise.all(i)}populateFromStyle(){return Qie(this.styleOrigin,{portal:this.portal}).then(e=>{var i;const t=[];return this._valueInfoMap={},e&&e.data&&Array.isArray(e.data.items)&&e.data.items.forEach(s=>{const r=new mu({styleUrl:e.styleUrl,styleName:e.styleName,portal:this.portal,name:s.name});this.defaultSymbol||s.name!==e.data.defaultItem||(this.defaultSymbol=r,this._isDefaultSymbolDerived=!0);const n=new Mf({value:s.name,symbol:r});t.push(n),this._valueInfoMap[s.name]=n}),this._set("uniqueValueInfos",Object.freeze(t)),this._updateGroupsFromInfos(!0),this._isInfosSource=null,this._watchUniqueValueInfos(),!this.defaultSymbol&&((i=this.uniqueValueInfos)==null?void 0:i.length)&&(this.defaultSymbol=this.uniqueValueInfos[0].symbol,this._isDefaultSymbolDerived=!0),this})}_updateFieldDelimiter(){this.field&&this.field2&&!this.fieldDelimiter&&this._set("fieldDelimiter",ese)}_updateUniqueValues(){this._isInfosSource!=null&&(this._isInfosSource?this._updateGroupsFromInfos():this._updateInfosFromGroups())}_updateValueInfoMap(){this._valueInfoMap={};const{uniqueValueInfos:e}=this;if(e)for(const t of e)this._valueInfoMap[t.value+""]=t}_watchUniqueValueInfosAndGroups(){this._watchUniqueValueInfos(),this._watchUniqueValueGroups()}_watchUniqueValueInfos(){this.removeHandles(ZC);const{uniqueValueInfos:e}=this;if(e){const t=[];for(const i of e)t.push(Z(()=>({symbol:i.symbol,value:i.value,label:i.label,description:i.description}),(s,r)=>{s!==r&&(this._updateGroupsFromInfos(),this._isInfosSource=!0)},{sync:!0}));this.addHandles(t,ZC)}}_watchUniqueValueGroups(){this.removeHandles(QC);const{uniqueValueGroups:e}=this;if(e){const t=[];for(const i of e){t.push(Z(()=>({classes:i.classes}),(s,r)=>{s!==r&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}));for(const s of i.classes)t.push(Z(()=>({symbol:s.symbol,values:s.values,label:s.label,description:s.description}),(r,n)=>{r!==n&&(this._updateInfosFromGroups(),this._isInfosSource=!1)},{sync:!0}))}this.addHandles(t,QC)}}_updateInfosFromGroups(){var l;if(!this.uniqueValueGroups)return this._set("uniqueValueInfos",null),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const e=[],{field:t,field2:i,field3:s,fieldDelimiter:r,uniqueValueGroups:n,valueExpression:o}=this;if(!t&&!o)return this._set("uniqueValueInfos",e),this._updateValueInfoMap(),void this._watchUniqueValueInfos();const a=!(!t||!i);for(const u of n)for(const d of(l=u.classes)!=null?l:[]){const{symbol:f,label:m,values:y,description:g}=d;for(const v of y!=null?y:[]){const{value:b,value2:_,value3:x}=v,$=[b];i&&$.push(_),s&&$.push(x);const I=a?$.join(r||""):$[0];e.push(new Mf({symbol:f,label:m,value:I,description:g}))}}this._set("uniqueValueInfos",e),this._updateValueInfoMap(),this._watchUniqueValueInfos()}_updateGroupsFromInfos(e=!1){if(!this.uniqueValueInfos)return this._set("uniqueValueGroups",null),void this._watchUniqueValueGroups();const{field:t,field2:i,valueExpression:s,fieldDelimiter:r,uniqueValueInfos:n}=this;if(!t&&!s||!n.length)return this._set("uniqueValueGroups",[]),void this._watchUniqueValueGroups();const o=!(!t||!i),a=n.map(u=>{var _;const{symbol:d,label:f,value:m,description:y}=u,[g,v,b]=o?((_=m==null?void 0:m.toString())==null?void 0:_.split(r||""))||[]:[m];return new n4({symbol:d,label:f,description:y,values:[new Rh({value:g,value2:v,value3:b})]})}),l=[new x2({classes:a})];e&&Object.freeze(l),this._set("uniqueValueGroups",l),this._watchUniqueValueGroups()}_getUniqueValueInfo(e,t){return this.valueExpression?this._getUnqiueValueInfoForExpression(e,t):this._getUnqiueValueInfoForFields(e)}_getUnqiueValueInfoForExpression(e,t){const{viewingMode:i,scale:s,spatialReference:r,arcade:n}=FM(t,{});let o=this._cache.compiledFunc;const a=n.arcadeUtils;if(!o){const u=a.createSyntaxTree(this.valueExpression);o=a.createFunction(u),this._cache.compiledFunc=o}const l=a.executeFunction(o,a.createExecContext(e,a.getViewInfo({viewingMode:i,scale:s,spatialReference:r})));return this._valueInfoMap[l+""]}_getUnqiueValueInfoForFields(e){const t=this.field,i=e.attributes;let s;if(typeof t!="function"&&this.field2){const r=this.field2,n=this.field3,o=[];t&&o.push(i[t]),r&&o.push(i[r]),n&&o.push(i[n]),s=o.join(this.fieldDelimiter||"")}else typeof t=="function"?s=t(e):t&&(s=i[t]);return this._valueInfoMap[s+""]}static fromPortalStyle(e,t){const i=new jp(t&&t.properties);i._set("styleOrigin",Object.freeze({styleName:e})),i._set("portal",t&&t.portal||cs.getDefault());const s=i.populateFromStyle();return s.catch(r=>{Qo.error(`#fromPortalStyle('${e}'[, ...])`,"Failed to create unique value renderer from style name",r)}),s}static fromStyleUrl(e,t){const i=new jp(t&&t.properties);i._set("styleOrigin",Object.freeze({styleUrl:e}));const s=i.populateFromStyle();return s.catch(r=>{Qo.error(`#fromStyleUrl('${e}'[, ...])`,"Failed to create unique value renderer from style URL",r)}),s}};c([h({readOnly:!0})],pt.prototype,"_cache",null),c([ue({uniqueValue:"unique-value"})],pt.prototype,"type",void 0),c([h(G5)],pt.prototype,"backgroundFillSymbol",void 0),c([h({value:null,json:{type:String,read:{source:"field1"},write:{target:"field1"}}})],pt.prototype,"field",null),c([Oe("field")],pt.prototype,"castField",null),c([ie("field")],pt.prototype,"writeField",null),c([h({type:String,value:null,json:{write:!0}})],pt.prototype,"field2",null),c([h({type:String,value:null,json:{write:!0}})],pt.prototype,"field3",null),c([h({type:String,value:null,json:{write:!0}})],pt.prototype,"valueExpression",null),c([h({type:String,json:{write:!0}})],pt.prototype,"valueExpressionTitle",void 0),c([h({type:Oh,json:{write:!0}})],pt.prototype,"legendOptions",void 0),c([h({type:String,json:{write:!0}})],pt.prototype,"defaultLabel",void 0),c([h(k3({...wd},{json:{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}},origins:{"web-scene":{write:{overridePolicy(){return{enabled:!this._isDefaultSymbolDerived}}}}}}}))],pt.prototype,"defaultSymbol",null),c([h({type:String,value:null,json:{write:!0}})],pt.prototype,"fieldDelimiter",null),c([h({type:cs,readOnly:!0})],pt.prototype,"portal",void 0),c([Q("portal",["styleName"])],pt.prototype,"readPortal",null),c([h({readOnly:!0,json:{write:{enabled:!1,overridePolicy:()=>({enabled:!0})}}})],pt.prototype,"styleOrigin",void 0),c([Q("styleOrigin",["styleName","styleUrl"])],pt.prototype,"readStyleOrigin",null),c([ie("styleOrigin",{styleName:{type:String},styleUrl:{type:String}})],pt.prototype,"writeStyleOrigin",null),c([h({type:[x2],json:{read:{source:["uniqueValueGroups","uniqueValueInfos"],reader:(e,t,i)=>(t.uniqueValueGroups||ise(t)).map(s=>x2.fromJSON(s,i))},write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],pt.prototype,"uniqueValueGroups",null),c([h({type:[Mf],json:{read:!1,write:{overridePolicy(){return this.styleOrigin?{enabled:!1}:{enabled:!0}}}}})],pt.prototype,"uniqueValueInfos",null),pt=jp=c([S(o4)],pt);const Gm=pt,Zb={key:"type",base:zo,typeMap:{heatmap:s4,simple:Xh,"unique-value":Gm,"class-breaks":H5,"dot-density":Tie,dictionary:Mie,"pie-chart":Uie},errorContext:"renderer"},sse={key:"type",base:zo,typeMap:{simple:Xh,"unique-value":Gm,"class-breaks":H5,heatmap:s4},errorContext:"renderer"};function D_e(e,t){return cm(e,null,t)}const rse=dl({types:Zb});function cm(e,t,i){return e?e&&(e.styleName||e.styleUrl)&&e.type!=="uniqueValue"?(i&&i.messages&&i.messages.push(new Bi("renderer:unsupported","Only UniqueValueRenderer can be referenced from a web style, but found '"+e.type+"'",{definition:e,context:i})),null):rse(e,t,i):null}class RT{constructor(){this._propertyOriginMap=new Map,this._originStores=new Array(I1),this._values=new Map,this.multipleOriginsSupported=!0}clone(t){const i=new RT,s=this._originStores[Pe.DEFAULTS];s&&s.forEach((r,n)=>{i.set(n,R(r),Pe.DEFAULTS)});for(let r=Pe.SERVICE;r{t&&t.has(a)||i.set(a,R(o),r)})}return i}get(t,i){const s=i===void 0?this._values:this._originStores[i];return s?s.get(t):void 0}keys(t){const i=t==null?this._values:this._originStores[t];return i?[...i.keys()]:[]}set(t,i,s=Pe.USER){let r=this._originStores[s];if(r||(r=new Map,this._originStores[s]=r),r.set(t,i),!this._values.has(t)||this._propertyOriginMap.get(t)<=s){const n=this._values.get(t);return this._values.set(t,i),this._propertyOriginMap.set(t,s),n!==i}return!1}delete(t,i=Pe.USER){const s=this._originStores[i];if(!s)return;const r=s.get(t);if(s.delete(t),this._values.has(t)&&this._propertyOriginMap.get(t)===i){this._values.delete(t);for(let n=i-1;n>=0;n--){const o=this._originStores[n];if(o&&o.has(t)){this._values.set(t,o.get(t)),this._propertyOriginMap.set(t,n);break}}}return r}has(t,i){const s=i===void 0?this._values:this._originStores[i];return!!s&&s.has(t)}revert(t,i){for(;i>0&&!this.has(t,i);)--i;const s=this._originStores[i],r=s&&s.get(t),n=this._values.get(t);return this._values.set(t,r),this._propertyOriginMap.set(t,i),n!==r}originOf(t){return this._propertyOriginMap.get(t)||Pe.DEFAULTS}forEach(t){this._values.forEach(t)}}const a4=e=>{let t=class extends e{constructor(...i){super(...i);const s=ki(this),r=s.store,n=new RT;s.store=n,dF(s,r,n)}read(i,s){fF(this,i,s)}getAtOrigin(i,s){const r=fw(this),n=Va(s);if(typeof i=="string")return r.get(i,n);const o={};return i.forEach(a=>{o[a]=r.get(a,n)}),o}originOf(i){return B0(this.originIdOf(i))}originIdOf(i){return fw(this).originOf(i)}revert(i,s){const r=fw(this),n=Va(s),o=ki(this);let a;a=typeof i=="string"?i==="*"?r.keys(n):[i]:i,a.forEach(l=>{o.invalidate(l),r.revert(l,n),o.commit(l)})}};return t=c([S("esri.core.ReadOnlyMultiOriginJSONSupport")],t),t};function fw(e){return ki(e).store}let KC=class extends a4(oe){};KC=c([S("esri.core.ReadOnlyMultiOriginJSONSupport")],KC);const nse=e=>{let t=class extends e{constructor(...i){super(...i)}clear(i,s="user"){return mw(this).delete(i,Va(s))}write(i={},s){return yF(this,i=i||{},s),i}setAtOrigin(i,s,r){ki(this).setAtOrigin(i,s,Va(r))}removeOrigin(i){const s=mw(this),r=Va(i),n=s.keys(r);for(const o of n)s.originOf(o)===r&&s.set(o,s.get(o,r),Pe.USER)}updateOrigin(i,s){const r=mw(this),n=Va(s),o=this.get(i);for(let a=n+1;a{let t=class extends nse(a4(e)){constructor(...i){super(...i)}};return t=c([S("esri.core.MultiOriginJSONSupport")],t),t};let eP=class extends l4(oe){};eP=c([S("esri.core.MultiOriginJSONSupport")],eP);async function ose(e,t){const{WhereClause:i}=await z(()=>import("./WhereClause.5b749615.js"),[]);return i.create(e,t)}function ase(e,t){return M(e)?M(t)?`(${e}) AND (${t})`:e:t}var M2;let sc=M2=class extends W{constructor(e){super(e),this.expression=null,this.name=null,this.returnType="boolean",this.title=null}clone(){return new M2({name:this.name,title:this.title,expression:this.expression,returnType:this.returnType})}};c([h({type:String,json:{write:!0}})],sc.prototype,"expression",void 0),c([h({type:String,json:{write:!0}})],sc.prototype,"name",void 0),c([h({type:["boolean","date","number","string"],json:{write:!0}})],sc.prototype,"returnType",void 0),c([h({type:String,json:{write:!0}})],sc.prototype,"title",void 0),sc=M2=c([S("esri.form.ExpressionInfo")],sc);const lse=sc;let rc=class extends W{constructor(e){super(e),this.description=null,this.label=null,this.type=null,this.visibilityExpression=null}};c([h({type:String,json:{write:!0}})],rc.prototype,"description",void 0),c([h({type:String,json:{write:!0}})],rc.prototype,"label",void 0),c([h()],rc.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],rc.prototype,"visibilityExpression",void 0),rc=c([S("esri.form.elements.Element")],rc);const Zh=rc;var $2;let i0=$2=class extends W{constructor(e){super(e),this.type=null}clone(){return new $2({type:this.type})}};c([h({type:["attachment","audio","document","image","signature","video"],json:{write:!0}})],i0.prototype,"type",void 0),i0=$2=c([S("esri.form.elements.inputs.AttachmentInput")],i0);const cse=i0;var T2;let nc=T2=class extends Zh{constructor(e){super(e),this.attachmentKeyword=null,this.editable=!0,this.input=null,this.type="attachment"}clone(){return new T2({attachmentKeyword:this.attachmentKeyword,description:this.description,editable:this.editable,input:this.input,label:this.label,visibilityExpression:this.visibilityExpression})}};c([h({type:String,json:{write:!0}})],nc.prototype,"attachmentKeyword",void 0),c([h({type:Boolean,json:{write:!0}})],nc.prototype,"editable",void 0),c([h({type:cse,json:{read:{source:"inputType"},write:{target:"inputType"}}})],nc.prototype,"input",void 0),c([h({type:["attachment"],json:{read:!1,write:!0}})],nc.prototype,"type",void 0),nc=T2=c([S("esri.form.elements.AttachmentElement")],nc);const tP=nc;let s0=class extends W{constructor(e){super(e),this.type=null}};c([h()],s0.prototype,"type",void 0),s0=c([S("esri.form.elements.inputs.Input")],s0);const Sd=s0;let Vp=class extends Sd{constructor(e){super(e),this.maxLength=null,this.minLength=0}};c([h({type:Number,json:{write:!0}})],Vp.prototype,"maxLength",void 0),c([h({type:Number,json:{write:!0}})],Vp.prototype,"minLength",void 0),Vp=c([S("esri.form.elements.inputs.TextInput")],Vp);const LT=Vp;var I2;let r0=I2=class extends LT{constructor(e){super(e),this.type="barcode-scanner"}clone(){return new I2({maxLength:this.maxLength,minLength:this.minLength})}};c([h({type:["barcode-scanner"],json:{read:!1,write:!0}})],r0.prototype,"type",void 0),r0=I2=c([S("esri.form.elements.inputs.BarcodeScannerInput")],r0);const use=r0;var E2;let Zu=E2=class extends Sd{constructor(e){super(e),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="combo-box"}clone(){return new E2({showNoValueOption:this.showNoValueOption,noValueOptionLabel:this.noValueOptionLabel})}};c([h({type:String,json:{write:!0}})],Zu.prototype,"noValueOptionLabel",void 0),c([h({type:Boolean,json:{write:!0}})],Zu.prototype,"showNoValueOption",void 0),c([h({type:["combo-box"],json:{read:!1,write:!0}})],Zu.prototype,"type",void 0),Zu=E2=c([S("esri.form.elements.inputs.ComboBoxInput")],Zu);const hse=Zu;var k2;function iP(e){return e!=null?new Date(e):null}function sP(e){return e?e.getTime():null}let wr=k2=class extends Sd{constructor(e){super(e),this.includeTime=!1,this.max=null,this.min=null,this.type="datetime-picker"}readMax(e,t){return iP(t.max)}writeMax(e,t){t.max=sP(e)}readMin(e,t){return iP(t.min)}writeMin(e,t){t.min=sP(e)}clone(){return new k2({includeTime:this.includeTime,max:this.max,min:this.min,type:this.type})}};c([h({type:Boolean,json:{write:!0}})],wr.prototype,"includeTime",void 0),c([h({type:Date,json:{type:Number,write:!0}})],wr.prototype,"max",void 0),c([Q("max")],wr.prototype,"readMax",null),c([ie("max")],wr.prototype,"writeMax",null),c([h({type:Date,json:{type:Number,write:!0}})],wr.prototype,"min",void 0),c([Q("min")],wr.prototype,"readMin",null),c([ie("min")],wr.prototype,"writeMin",null),c([h({type:["datetime-picker"],json:{read:!1,write:!0}})],wr.prototype,"type",void 0),wr=k2=c([S("esri.form.elements.inputs.DateTimePickerInput")],wr);const dse=wr;var C2;let Qu=C2=class extends Sd{constructor(e){super(e),this.noValueOptionLabel=null,this.showNoValueOption=!0,this.type="radio-buttons"}clone(){return new C2({noValueOptionLabel:this.noValueOptionLabel,showNoValueOption:this.showNoValueOption})}};c([h({type:String,json:{write:!0}})],Qu.prototype,"noValueOptionLabel",void 0),c([h({type:Boolean,json:{write:!0}})],Qu.prototype,"showNoValueOption",void 0),c([h({type:["radio-buttons"],json:{read:!1,write:!0}})],Qu.prototype,"type",void 0),Qu=C2=c([S("esri.form.elements.inputs.RadioButtonsInput")],Qu);const pse=Qu;var P2;let Ku=P2=class extends Sd{constructor(e){super(e),this.offValue=null,this.onValue=null,this.type="switch"}clone(){return new P2({offValue:this.offValue,onValue:this.onValue})}};c([h({type:[String,Number],json:{write:!0}})],Ku.prototype,"offValue",void 0),c([h({type:[String,Number],json:{write:!0}})],Ku.prototype,"onValue",void 0),c([h({type:["switch"],json:{read:!1,write:!0}})],Ku.prototype,"type",void 0),Ku=P2=c([S("esri.form.elements.inputs.SwitchInput")],Ku);const fse=Ku;var A2;let n0=A2=class extends LT{constructor(e){super(e),this.type="text-area"}clone(){return new A2({maxLength:this.maxLength,minLength:this.minLength})}};c([h({type:["text-area"],json:{read:!1,write:!0}})],n0.prototype,"type",void 0),n0=A2=c([S("esri.form.elements.inputs.TextAreaInput")],n0);const mse=n0;var O2;let o0=O2=class extends LT{constructor(e){super(e),this.type="text-box"}clone(){return new O2({maxLength:this.maxLength,minLength:this.minLength})}};c([h({type:["text-box"],json:{read:!1,write:!0}})],o0.prototype,"type",void 0),o0=O2=c([S("esri.form.elements.inputs.TextBoxInput")],o0);const yse=o0,gse={base:Sd,key:"type",typeMap:{"barcode-scanner":use,"combo-box":hse,"datetime-picker":dse,"radio-buttons":pse,switch:fse,"text-area":mse,"text-box":yse}};var R2;let Us=R2=class extends Zh{constructor(e){super(e),this.domain=null,this.editable=!0,this.editableExpression=null,this.fieldName=null,this.hint=null,this.input=null,this.requiredExpression=null,this.type="field",this.valueExpression=null}clone(){return new R2({description:this.description,domain:this.domain,editable:this.editable,editableExpression:this.editableExpression,fieldName:this.fieldName,hint:this.hint,input:this.input,label:this.label,requiredExpression:this.requiredExpression,valueExpression:this.valueExpression,visibilityExpression:this.visibilityExpression})}};c([h({types:r5,json:{read:{reader:bT},write:!0}})],Us.prototype,"domain",void 0),c([h({type:Boolean,json:{write:!0}})],Us.prototype,"editable",void 0),c([h({type:String,json:{write:!0}})],Us.prototype,"editableExpression",void 0),c([h({type:String,json:{write:!0}})],Us.prototype,"fieldName",void 0),c([h({type:String,json:{write:!0}})],Us.prototype,"hint",void 0),c([h({types:gse,json:{read:{source:"inputType"},write:{target:"inputType"}}})],Us.prototype,"input",void 0),c([h({type:String,json:{write:!0}})],Us.prototype,"requiredExpression",void 0),c([h({type:String,json:{read:!1,write:!0}})],Us.prototype,"type",void 0),c([h({type:String,json:{write:!0}})],Us.prototype,"valueExpression",void 0),Us=R2=c([S("esri.form.elements.FieldElement")],Us);const rP=Us;var L2;let ro=L2=class extends Zh{constructor(e){super(e),this.displayCount=null,this.displayType="list",this.editable=!0,this.orderByFields=null,this.relationshipId=null,this.type="relationship"}clone(){return new L2({description:this.description,displayCount:this.displayCount,displayType:this.displayType,editable:this.editable,label:this.label,orderByFields:R(this.orderByFields),relationshipId:this.relationshipId,visibilityExpression:this.visibilityExpression})}};c([h({type:Number,json:{write:!0}})],ro.prototype,"displayCount",void 0),c([h({type:["list"],json:{write:!0}})],ro.prototype,"displayType",void 0),c([h({type:Boolean,json:{write:!0}})],ro.prototype,"editable",void 0),c([h({type:[Z$],json:{write:!0}})],ro.prototype,"orderByFields",void 0),c([h({type:Number,json:{write:!0}})],ro.prototype,"relationshipId",void 0),c([h({type:["relationship"],json:{read:!1,write:!0}})],ro.prototype,"type",void 0),ro=L2=c([S("esri.form.elements.RelationshipElement")],ro);const nP=ro;function c4(e){return{typesWithGroup:{base:Zh,key:"type",typeMap:{attachment:tP,field:rP,group:e,relationship:nP}},typesWithoutGroup:{base:Zh,key:"type",typeMap:{attachment:tP,field:rP,relationship:nP}}}}function u4(e,t,i=!0){if(!e)return null;const s=i?t.typesWithGroup.typeMap:t.typesWithoutGroup.typeMap;return e.filter(r=>s[r.type]).map(r=>s[r.type].fromJSON(r))}function h4(e,t,i=!0){if(!e)return null;const s=i?t.typesWithGroup.typeMap:t.typesWithoutGroup.typeMap;return e.filter(r=>s[r.type]).map(r=>r.toJSON())}function d4(e,t,i=!0){return e?e.map(s=>En(i?t.typesWithGroup:t.typesWithoutGroup,s)):null}var F2;let mn=F2=class extends Zh{constructor(e){super(e),this.elements=null,this.initialState="expanded",this.type="group"}castElements(e){return d4(e,yw,!1)}readElements(e,t){return u4(t.formElements,yw,!1)}writeElements(e,t){t.formElements=h4(e,yw,!1)}clone(){return new F2({description:this.description,elements:R(this.elements),initialState:this.initialState,label:this.label,visibilityExpression:this.visibilityExpression})}};c([h({json:{write:!0}})],mn.prototype,"elements",void 0),c([Oe("elements")],mn.prototype,"castElements",null),c([Q("elements",["formElements"])],mn.prototype,"readElements",null),c([ie("elements")],mn.prototype,"writeElements",null),c([h({type:["collapsed","expanded"],json:{write:!0}})],mn.prototype,"initialState",void 0),c([h({type:String,json:{read:!1,write:!0}})],mn.prototype,"type",void 0),mn=F2=c([S("esri.form.elements.GroupElement")],mn);const yw=c4(mn),vse=mn;var D2;const gw=c4(vse);let xr=D2=class extends W{constructor(e){super(e),this.description=null,this.elements=null,this.expressionInfos=null,this.preserveFieldValuesWhenHidden=!1,this.title=null}castElements(e){return d4(e,gw)}readElements(e,t){return u4(t.formElements,gw)}writeElements(e,t){t.formElements=h4(e,gw)}clone(){return new D2({description:this.description,expressionInfos:R(this.expressionInfos),elements:R(this.elements),title:this.title,preserveFieldValuesWhenHidden:this.preserveFieldValuesWhenHidden})}};c([h({type:String,json:{write:!0}})],xr.prototype,"description",void 0),c([h({json:{write:!0}})],xr.prototype,"elements",void 0),c([Oe("elements")],xr.prototype,"castElements",null),c([Q("elements",["formElements"])],xr.prototype,"readElements",null),c([ie("elements")],xr.prototype,"writeElements",null),c([h({type:[lse],json:{write:!0}})],xr.prototype,"expressionInfos",void 0),c([h({type:Boolean,json:{default:!1,write:!0}})],xr.prototype,"preserveFieldValuesWhenHidden",void 0),c([h({type:String,json:{write:!0}})],xr.prototype,"title",void 0),xr=D2=c([S("esri.form.FormTemplate")],xr);const bse=xr;function oP(e,t,i){if(e.hasM==null||e.hasZ)for(const s of t)for(const r of s)r.length>2&&(r[2]*=i)}function _se(e,t,i){if(!e&&!t||!i)return;const s=Vh(i);aP(e,i,s),aP(t,i,s)}function aP(e,t,i){if(e)for(const s of e)wse(s.geometry,t,i)}function wse(e,t,i){if(N(e)||!e.spatialReference||Kt(e.spatialReference,t))return;const s=Vh(e.spatialReference)/i;if(s!==1){if("x"in e)e.z!=null&&(e.z*=s);else if("rings"in e)oP(e,e.rings,s);else if("paths"in e)oP(e,e.paths,s);else if("points"in e&&(e.hasM==null||e.hasZ))for(const r of e.points)r.length>2&&(r[2]*=s)}}let xse=0;const p4="esri.layers.graphics.sources.MemorySource",vw=q.getLogger(p4);let mo=class extends Lo.LoadableMixin(cb(pu(he))){constructor(e){super(e),this._idToClientGraphic=null,this.type="memory"}load(e){const t=M(e)?e.signal:null;return this.addResolvingPromise(this._startWorker(t)),Promise.resolve(this)}destroy(){var e;(e=this._connection)==null||e.close(),this._connection=null}get _workerGeometryType(){var t;const e=(t=this.layer)==null?void 0:t.geometryType;return e?this._geometryTypeRequiresClientGraphicMapping(e)?"polygon":e:null}applyEdits(e){return this.load().then(()=>this._applyEdits(e))}openPorts(){return this.load().then(()=>this._connection.openPorts())}async queryFeatures(e,t={}){await this.load(t);const i=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);zS(e,this.layer.spatialReference,i);const s=Wb.fromJSON(i);if(!this._requiresClientGraphicMapping())return s;const r=this.layer.objectIdField;for(const n of s.features){const o=n.attributes[r],a=this._idToClientGraphic.get(o);a&&(n.geometry=a.geometry)}return s.geometryType=this.layer.geometryType,s}async queryFeaturesJSON(e,t={}){if(this._requiresClientGraphicMapping())throw new L("query-features-json:unsupported","Cannot query in JSON format for client only geometry types (mesh and extent)");await this.load(t);const i=await this._connection.invoke("queryFeatures",e?e.toJSON():null,t);return zS(e,this.layer.spatialReference,i),i}queryFeatureCount(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryFeatureCount",e?e.toJSON():null,t))}queryObjectIds(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryObjectIds",e?e.toJSON():null,t))}queryExtent(e,t={}){return this.load(t).then(()=>this._connection.invoke("queryExtent",e?e.toJSON():null,t)).then(i=>({count:i.count,extent:Ze.fromJSON(i.extent)}))}querySnapping(e,t={}){return this.load(t).then(()=>this._connection.invoke("querySnapping",e,t))}async _applyEdits(e){if(!this._connection)throw new L("feature-layer-source:edit-failure","Memory source not loaded");const t=this.layer.objectIdField;let i=null;const s=[],r=[];await Promise.all([this._prepareClientMapping(e.addFeatures,null),this._prepareClientMapping(e.updateFeatures,null)]);const n=u=>"objectId"in u&&u.objectId!=null?u.objectId:"attributes"in u&&u.attributes[t]!=null?u.attributes[t]:null;if(e.addFeatures&&(i=this._prepareAddFeatures(e.addFeatures)),e.deleteFeatures)for(const u of e.deleteFeatures){const d=n(u);d!=null&&s.push(d)}const o=e.updateFeatures&&this._idToClientGraphic?new Map:null;if(e.updateFeatures){for(const u of e.updateFeatures)if(r.push(this._serializeFeature(u)),o){const d=n(u);d!=null&&o.set(d,u)}}_se(i?i.features:null,r,this.layer.spatialReference);const{fullExtent:a,featureEditResults:l}=await this._connection.invoke("applyEdits",{adds:i?i.features:[],updates:r,deletes:s});return this.fullExtent=a,i&&i.finish(l.uidToObjectId),this._updateClientGraphicIds(o,l),this._createEditsResult(l)}async _prepareClientMapping(e,t){if(this._layerOrSourceGeometryType!=="mesh"||N(e))return;const i=[];for(const{geometry:s}of e)!M(s)||s.type!=="mesh"||s.hasExtent||s.loaded||i.push(s.load({signal:t}));i.length&&await Promise.all(i)}_updateClientGraphicIds(e,t){if(this._idToClientGraphic){if(e)for(const i of t.updateResults){if(!i.success)continue;const s=e.get(i.objectId);s!=null&&this._addIdToClientGraphic(s)}for(const i of t.deleteResults)i.success&&this._idToClientGraphic.delete(i.objectId)}}_createEditsResult(e){return{addFeatureResults:e.addResults?e.addResults.map(this._createFeatureEditResult,this):[],updateFeatureResults:e.updateResults?e.updateResults.map(this._createFeatureEditResult,this):[],deleteFeatureResults:e.deleteResults?e.deleteResults.map(this._createFeatureEditResult,this):[],addAttachmentResults:[],updateAttachmentResults:[],deleteAttachmentResults:[]}}_createFeatureEditResult(e){const t=e.success===!0?null:e.error||{code:void 0,description:void 0};return{objectId:e.objectId,globalId:e.globalId,error:t?new L("feature-layer-source:edit-failure",t.description,{code:t.code}):null}}_prepareAddFeatures(e){const t=new Map,i=new Array(e.length);let s=null;for(let n=0;n{vw.error("Source modifications will not propagate after layer has been loaded. Please use .applyEdits() instead"),m.preventDefault()}));const u={features:l.features,fields:t&&t.map(m=>m.toJSON()),geometryType:bk.toJSON(this._workerGeometryType),hasM:this._layerOrSourceGeometryType!=="mesh"&&r,hasZ:this._layerOrSourceGeometryType==="mesh"||n,objectIdField:s,spatialReference:a?null:i&&i.toJSON(),timeInfo:o?o.toJSON():null},d=await this._connection.invoke("load",u,{signal:e});for(const m of d.warnings)vw.warn(m.message,{layer:this.layer,warning:m});d.featureErrors.length&&vw.warn(`Encountered ${d.featureErrors.length} validation errors while loading features`,d.featureErrors);const f=d.layerDefinition;this._geometryTypeRequiresClientGraphicMapping(l.inferredGeometryType)&&(f.geometryType=bk.toJSON(l.inferredGeometryType)),this.sourceJSON=f,this._requiresClientGraphicMapping()&&(this._idToClientGraphic=new Map),l.finish(d.assignedObjectIds)}};c([P$({Type:Ci,ensureType:Dt(Ci)})],mo.prototype,"itemType",void 0),c([h()],mo.prototype,"type",void 0),c([h({constructOnly:!0})],mo.prototype,"layer",void 0),c([h({readOnly:!0})],mo.prototype,"_workerGeometryType",null),c([h()],mo.prototype,"sourceJSON",void 0),mo=c([S(p4)],mo);function Sse(e){return"portalItem"in e}const Mse=e=>{let t=class extends e{get apiKey(){var i;return this._isOverridden("apiKey")?this._get("apiKey"):Sse(this)?(i=this.portalItem)==null?void 0:i.apiKey:null}set apiKey(i){i!=null?this._override("apiKey",i):(this._clearOverride("apiKey"),this.clear("apiKey","user"))}};return c([h({type:String})],t.prototype,"apiKey",null),t=c([S("esri.layers.mixins.APIKeyMixin")],t),t},f4={mapserver:"MapServer",imageserver:"ImageServer",featureserver:"FeatureServer",sceneserver:"SceneServer",streamserver:"StreamServer",vectortileserver:"VectorTileServer"},m4=Object.values(f4),y4=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/rest\\/services\\/(.+?)\\/(${m4.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),$se=new RegExp(`^((?:https?:)?\\/\\/\\S+?\\/([^\\/\\n]+)\\/(${m4.join("|")}))(?:\\/(?:layers\\/)?(\\d+))?`,"i"),Tse=/(.*?)\/(?:layers\/)?(\d+)\/?$/i;function N_e(e){return!!y4.test(e)}function Md(e){if(N(e))return null;const t=Ai(e),i=t.path.match(y4)||t.path.match($se);if(!i)return null;const[,s,r,n,o]=i,a=r.indexOf("/");return{title:FT(a!==-1?r.slice(a+1):r),serverType:f4[n.toLowerCase()],sublayer:o!=null&&o!==""?parseInt(o,10):null,url:{path:s}}}function Ise(e){const t=Ai(e).path.match(Tse);return t?{serviceUrl:t[1],sublayerId:Number(t[2])}:null}function FT(e){return(e=e.replace(/\s*[/_]+\s*/g," "))[0].toUpperCase()+e.slice(1)}function Ese(e,t){const i=[];if(e){const s=Md(e);M(s)&&s.title&&i.push(s.title)}if(t){const s=FT(t);i.push(s)}if(i.length===2){if(i[0].toLowerCase().includes(i[1].toLowerCase()))return i[0];if(i[1].toLowerCase().includes(i[0].toLowerCase()))return i[1]}return i.join(" - ")}function g4(e){if(!e)return!1;const t=".arcgis.com/",i="//services",s="//tiles",r="//features",n=(e=e.toLowerCase()).includes(t),o=e.includes(i)||e.includes(s)||e.includes(r);return n&&o}function kse(e,t){return e&&_R(wR(e,t))}function Cse(e){let{url:t}=e;if(!t)return{url:t};t=wR(t,e.logger);const i=Ai(t),s=Md(i.path);let r;if(M(s))s.sublayer!=null&&e.layer.layerId==null&&(r=s.sublayer),t=s.url.path;else if(e.nonStandardUrlAllowed){const n=Ise(i.path);M(n)&&(t=n.serviceUrl,r=n.sublayerId)}return{url:_R(t),layerId:r}}function Pse(e,t,i,s,r){au(t,s,"url",r),s.url&&e.layerId!=null&&(s.url=Xc(s.url,i,e.layerId.toString()))}function j_e(e){if(!e)return!1;const t=e.toLowerCase(),i=t.includes("/services/"),s=t.includes("/mapserver/wmsserver"),r=t.includes("/imageserver/wmsserver"),n=t.includes("/wmsserver");return i&&(s||r||n)}const Ase=e=>{let t=class extends e{get title(){if(this._get("title")&&this.originOf("title")!=="defaults")return this._get("title");if(this.url){const i=Md(this.url);if(M(i)&&i.title)return i.title}return this._get("title")||""}set title(i){this._set("title",i)}set url(i){this._set("url",kse(i,q.getLogger(this.declaredClass)))}};return c([h()],t.prototype,"title",null),c([h({type:String})],t.prototype,"url",null),t=c([S("esri.layers.mixins.ArcGISService")],t),t},Ose=e=>{let t=class extends e{constructor(){super(...arguments),this.customParameters=null}};return c([h({type:Object,json:{write:{overridePolicy:i=>({enabled:!!(i&&Object.keys(i).length>0)})}}})],t.prototype,"customParameters",void 0),t=c([S("esri.layers.mixins.CustomParametersMixin")],t),t},Rse=new jo.EventEmitter,v4="esri.layers.mixins.EditBusLayer",b4=Symbol(v4);function V_e(e){return e!=null&&typeof e=="object"&&b4 in e}const Lse=e=>{var t;let i=class extends e{constructor(...s){super(...s),this[t]=!0,this.when().then(()=>{this.own([Rse.on("edits",r=>{var d,f,m;const n="layer"in r?r.layer:null,o="layer"in r?(d=r.layer)==null?void 0:d.url:r.serviceUrl,a="layer"in r?(f=r.layer)==null?void 0:f.layerId:r.layerId,l=r.event;if(n===this||o!==this.url)return;if(a!=null&&this.layerId!=null&&a===this.layerId)return void this.emit("edits",R(l));const u=(m=l.editedFeatures)==null?void 0:m.find(({layerId:y})=>y===this.layerId);if(u){const{adds:y,updates:g,deletes:v}=u.editedFeatures,b={edits:null,addedAttachments:[],deletedAttachments:[],updatedAttachments:[],addedFeatures:y?y.map(({attributes:_})=>({objectId:this.objectIdField&&_[this.objectIdField],globalId:this.globalIdField&&_[this.globalIdField]})):[],deletedFeatures:v?v.map(({attributes:_})=>({objectId:this.objectIdField&&_[this.objectIdField],globalId:this.globalIdField&&_[this.globalIdField]})):[],updatedFeatures:g?g.map(({current:{attributes:_}})=>({objectId:this.objectIdField&&_[this.objectIdField],globalId:this.globalIdField&&_[this.globalIdField]})):[],editedFeatures:R(l.editedFeatures)};this.emit("edits",b)}})])},()=>{})}};return t=b4,i=c([S(v4)],i),i};var N2;const bw=new Ie({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),_w=new Ie({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let ln=N2=class extends W{constructor(e){super(e),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null}createQuery(e={}){const{where:t,geometry:i,spatialRelationship:s,timeExtent:r,objectIds:n,units:o,distance:a}=this;return new $n({geometry:R(i),objectIds:R(n),spatialRelationship:s,timeExtent:R(r),where:t,units:o,distance:a,...e})}clone(){const{where:e,geometry:t,spatialRelationship:i,timeExtent:s,objectIds:r,units:n,distance:o}=this;return new N2({geometry:R(t),objectIds:R(r),spatialRelationship:i,timeExtent:R(s),where:e,units:n,distance:o})}};c([h({type:String,json:{write:!0}})],ln.prototype,"where",void 0),c([h({types:fu,json:{write:!0}})],ln.prototype,"geometry",void 0),c([h({type:bw.apiValues,json:{name:"spatialRel",read:{reader:bw.read},write:{allowNull:!1,writer:bw.write,overridePolicy(){return{enabled:M(this.geometry)}}}}})],ln.prototype,"spatialRelationship",void 0),c([h({type:Number,json:{write:{overridePolicy(e){return{enabled:e!=null&&this.geometry!=null}}}}})],ln.prototype,"distance",void 0),c([h({type:[Number],json:{write:!0}})],ln.prototype,"objectIds",void 0),c([h({type:_w.apiValues,json:{read:_w.read,write:{writer:_w.write,overridePolicy(e){return{enabled:e!=null&&this.geometry!=null}}}}})],ln.prototype,"units",void 0),c([h({type:Ln,json:{write:!0}})],ln.prototype,"timeExtent",void 0),ln=N2=c([S("esri.layers.support.FeatureFilter")],ln);const Fse=ln;var j2;const lP={read:{reader:G$},write:{writer:W$,overridePolicy(){return{allowNull:this.excludedEffect!=null,isRequired:this.excludedEffect==null}}}},cP={read:{reader:G$},write:{writer:W$,overridePolicy(){return{allowNull:this.includedEffect!=null,isRequired:this.includedEffect==null}}}},uP={name:"showExcludedLabels",default:!0};let oc=j2=class extends W{constructor(e){super(e),this.filter=null,this.includedEffect=null,this.excludedEffect=null,this.excludedLabelsVisible=!1}write(e,t){var s,r;const i=super.write(e,t);if(t!=null&&t.origin){if(i.filter){const n=Object.keys(i.filter);if(n.length>1||n[0]!=="where")return(s=t.messages)==null||s.push(new L("web-document-write:unsupported-feature-effect","Invalid feature effect 'filter'. A filter can only contain a 'where' property",{layer:t.layer,effect:this})),null}if("showExcludedLabels"in i)return(r=t.messages)==null||r.push(new L("web-document-write:unsupported-feature-effect","Invalid value for property 'excludedLabelsVisible' which should always be 'true'",{layer:t.layer,effect:this})),null}return i}clone(){return new j2({filter:M(this.filter)?this.filter.clone():null,includedEffect:this.includedEffect,excludedEffect:this.excludedEffect,excludedLabelsVisible:this.excludedLabelsVisible})}};c([h({type:Fse,json:{write:{allowNull:!0,writer(e,t,i,s){const r=e==null?void 0:e.write({},s);r&&Object.keys(r).length!==0?Ei(i,r,t):Ei(i,null,t)}}}})],oc.prototype,"filter",void 0),c([h({json:{write:!0,origins:{"web-map":lP,"portal-item":lP}}})],oc.prototype,"includedEffect",void 0),c([h({json:{write:!0,origins:{"web-map":cP,"portal-item":cP}}})],oc.prototype,"excludedEffect",void 0),c([h({type:Boolean,json:{write:!0,name:"showExcludedLabels",origins:{"web-map":uP,"portal-item":uP}}})],oc.prototype,"excludedLabelsVisible",void 0),oc=j2=c([S("esri.layers.support.FeatureEffect")],oc);const Dse=oc,hP={write:{allowNull:!0}},Nse=e=>{let t=class extends e{constructor(){super(...arguments),this.featureEffect=null}};return c([h({type:Dse,json:{origins:{"web-map":hP,"portal-item":hP}}})],t.prototype,"featureEffect",void 0),t=c([S("esri.layers.mixins.FeatureEffectLayer")],t),t};var zp;const kv=mi()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),_4=kv.jsonValues.slice();H6(_4,"orthometric");const $f=mi()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let Sr=zp=class extends W{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,i){return kv.write(e,t,i)}readHeightModel(e,t,i){return kv.read(e)||(i&&i.messages&&i.messages.push(jse(e,{context:i})),null)}readHeightUnit(e,t,i){return $f.read(e)||(i&&i.messages&&i.messages.push(dP(e,{context:i})),null)}readHeightUnitService(e,t,i){return xF(e)||$f.read(e)||(i&&i.messages&&i.messages.push(dP(e,{context:i})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new zp({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const i=SW(t);return new zp({heightModel:e.heightModel,heightUnit:i,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new zp;return t.read(e,{origin:"web-scene"}),t}};function dP(e,t){return new Bi("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}function jse(e,t){return new Bi("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}c([h({type:kv.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:_4,default:"ellipsoidal"}}}})],Sr.prototype,"heightModel",void 0),c([ie("web-scene","heightModel")],Sr.prototype,"writeHeightModel",null),c([Q(["web-scene","service"],"heightModel")],Sr.prototype,"readHeightModel",null),c([h({type:$f.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:$f.jsonValues,write:$f.write}}}})],Sr.prototype,"heightUnit",void 0),c([Q("web-scene","heightUnit")],Sr.prototype,"readHeightUnit",null),c([Q("service","heightUnit")],Sr.prototype,"readHeightUnitService",null),c([h({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],Sr.prototype,"vertCRS",void 0),c([Q("service","vertCRS",["vertCRS","ellipsoid","geoid"])],Sr.prototype,"readVertCRS",null),Sr=zp=c([S("esri.geometry.HeightModelInfo")],Sr);const Qb=Sr;function Vse(e){if(!e)return e;const{start:t,end:i}=e;return new Ln({start:M(t)?Wc(t,-t.getTimezoneOffset(),"minutes"):t,end:M(i)?Wc(i,-i.getTimezoneOffset(),"minutes"):i})}function zse(e){if(!e)return e;const{start:t,end:i}=e;return new Ln({start:M(t)?Wc(t,t.getTimezoneOffset(),"minutes"):t,end:M(i)?Wc(i,i.getTimezoneOffset(),"minutes"):i})}const Bse={type:Boolean,value:!0,json:{origins:{service:{read:!1,write:!1},"web-map":{read:!1,write:!1}},name:"screenSizePerspective",write:!0}},DT={type:Boolean,value:!0,json:{name:"disablePopup",read:{reader:(e,t)=>!t.disablePopup},write:{enabled:!0,writer(e,t,i){t[i]=!e}}}},NT={type:Boolean,value:!0,nonNullable:!0,json:{name:"showLabels",write:!0}},Use={type:String,json:{origins:{"portal-item":{write:!1}},write:{isRequired:!0,ignoreOrigin:!0,writer:au}}},qse={type:Boolean,value:!0,nonNullable:!0,json:{origins:{service:{read:{enabled:!1}}},name:"showLegend",write:!0}},Gse={value:null,type:kN,json:{origins:{service:{name:"elevationInfo",write:!0}},name:"layerDefinition.elevationInfo",write:!0}};function z_e(e){return{type:e,readOnly:!0,json:{origins:{service:{read:!0}},read:!1}}}const a0={type:Number,json:{origins:{"web-document":{write:!0,read:!0},"portal-item":{write:!0}}}},Wse={...a0,json:{...a0.json,origins:{"web-document":{...a0.json.origins["web-document"],write:{enabled:!0,target:{opacity:{type:Number},"layerDefinition.drawingInfo.transparency":{type:Number}}}}},read:{source:["layerDefinition.drawingInfo.transparency","drawingInfo.transparency"],reader:(e,t,i)=>i&&i.origin!=="service"||!t.drawingInfo||t.drawingInfo.transparency===void 0?t.layerDefinition&&t.layerDefinition.drawingInfo&&t.layerDefinition.drawingInfo.transparency!==void 0?em(t.layerDefinition.drawingInfo.transparency):void 0:em(t.drawingInfo.transparency)}}},B_e={type:Ln,readOnly:!0,get(){var a,l;if(!((a=this.layer)!=null&&a.timeInfo))return null;const{datesInUnknownTimezone:e,timeOffset:t,useViewTime:i}=this.layer,s=(l=this.view)==null?void 0:l.timeExtent;let r=this.layer.timeExtent;e&&(r=zse(r));let n=i?s&&r?s.intersection(r):s||r:r;if(!n||n.isEmpty||n.isAllTime)return n;t&&(n=n.offset(-t.value,t.unit)),e&&(n=Vse(n));const o=this._get("timeExtent");return n.equals(o)?o:n}},U_e={type:Ze,readOnly:!0,json:{origins:{service:{read:{source:["fullExtent","spatialReference"],reader:(e,t)=>{const i=Ze.fromJSON(e);return t.spatialReference!=null&&typeof t.spatialReference=="object"&&(i.spatialReference=xe.fromJSON(t.spatialReference)),i}}}},read:!1}},Hse={type:String,json:{origins:{service:{read:!1},"portal-item":{read:!1}}}},Yse={type:Number,json:{origins:{service:{write:{enabled:!1}}},read:{source:"layerDefinition.minScale"},write:{target:"layerDefinition.minScale"}}},Jse={type:Number,json:{origins:{service:{write:{enabled:!1}}},read:{source:"layerDefinition.maxScale"},write:{target:"layerDefinition.maxScale"}}},w4={json:{write:{ignoreOrigin:!0},origins:{"web-map":{read:!1,write:!1}}}};let yn=class extends xt(W){constructor(e){super(e)}};c([h({constructOnly:!0,json:{write:!0}})],yn.prototype,"name",void 0),c([h({constructOnly:!0,json:{write:!0}})],yn.prototype,"fields",void 0),c([h({constructOnly:!0,json:{write:!0}})],yn.prototype,"isAscending",void 0),c([h({constructOnly:!0,json:{write:!0}})],yn.prototype,"indexType",void 0),c([h({constructOnly:!0,json:{write:!0}})],yn.prototype,"isUnique",void 0),c([h({constructOnly:!0,json:{write:!0}})],yn.prototype,"description",void 0),yn=c([S("esri.layers.support.FeatureIndex")],yn);const V2=new Ie({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch"}),Xse={name:"supportsName",size:"supportsSize",contentType:"supportsContentType",keywords:"supportsKeywords",exifInfo:"supportsExifInfo"};function ye(e,t,i){return!!(e&&e.hasOwnProperty(t)?e[t]:i)}function Fy(e,t,i){return e&&e.hasOwnProperty(t)?e[t]:i}function Zse(e){var i;const t=(i=e==null?void 0:e.supportedSpatialAggregationStatistics)==null?void 0:i.map(s=>s.toLowerCase());return{envelope:!!(t!=null&&t.includes("envelopeaggregate")),centroid:!!(t!=null&&t.includes("centroidaggregate")),convexHull:!!(t!=null&&t.includes("convexhullaggregate"))}}function Wm(e,t){var s;const i=(s=e==null?void 0:e.supportedOperationsWithCacheHint)==null?void 0:s.map(r=>r.toLowerCase());return!!(i!=null&&i.includes(t.toLowerCase()))}function x4(e,t,i){return{analytics:Qse(t),attachment:Kse(t),data:ere(t),metadata:tre(t),operations:ire(t.capabilities||e,t,i),query:sre(t,i),queryRelated:rre(t),queryTopFeatures:nre(t),editing:ore(t)}}function Qse(e){return{supportsCacheHint:Wm(e.advancedQueryCapabilities,"queryAnalytics")}}function Kse(e){const t=e.attachmentProperties,i={supportsName:!1,supportsSize:!1,supportsContentType:!1,supportsKeywords:!1,supportsExifInfo:!1,supportsCacheHint:Wm(e.advancedQueryCapabilities,"queryAttachments"),supportsResize:ye(e,"supportsAttachmentsResizing",!1)};return t&&Array.isArray(t)&&t.forEach(s=>{const r=Xse[s.name];r&&(i[r]=!!s.isEnabled)}),i}function ere(e){return{isVersioned:ye(e,"isDataVersioned",!1),supportsAttachment:ye(e,"hasAttachments",!1),supportsM:ye(e,"hasM",!1),supportsZ:ye(e,"hasZ",!1)}}function tre(e){return{supportsAdvancedFieldProperties:ye(e,"supportsFieldDescriptionProperty",!1)}}function ire(e,t,i){const s=e?e.toLowerCase().split(",").map(m=>m.trim()):[],r=i?Md(i):null,n=s.includes(M(r)&&r.serverType==="MapServer"?"data":"query"),o=s.includes("editing")&&!t.datesInUnknownTimezone;let a=o&&s.includes("create"),l=o&&s.includes("delete"),u=o&&s.includes("update");const d=s.includes("changetracking"),f=t.advancedQueryCapabilities;return o&&!(a||l||u)&&(a=l=u=!0),{supportsCalculate:ye(t,"supportsCalculate",!1),supportsTruncate:ye(t,"supportsTruncate",!1),supportsValidateSql:ye(t,"supportsValidateSql",!1),supportsAdd:a,supportsDelete:l,supportsEditing:o,supportsChangeTracking:d,supportsQuery:n,supportsQueryAnalytics:ye(f,"supportsQueryAnalytic",!1),supportsQueryAttachments:ye(f,"supportsQueryAttachments",!1),supportsQueryTopFeatures:ye(f,"supportsTopFeaturesQuery",!1),supportsResizeAttachments:ye(t,"supportsAttachmentsResizing",!1),supportsSync:s.includes("sync"),supportsUpdate:u,supportsExceedsLimitStatistics:ye(t,"supportsExceedsLimitStatistics",!1)}}function sre(e,t){const i=e.advancedQueryCapabilities,s=e.ownershipBasedAccessControlForFeatures,r=e.archivingInfo,n=$4(e),o=t==null?void 0:t.includes("MapServer"),a=!V("mapserver-pbf-enabled")&&o&&(n!=null?n:0)<10.81,l=g4(t),u=(e.supportedQueryFormats||"").split(",").reduce((d,f)=>{const m=f.toLowerCase().trim();return m&&d.add(m),d},new Set);return{supportsStatistics:ye(i,"supportsStatistics",e.supportsStatistics),supportsPercentileStatistics:ye(i,"supportsPercentileStatistics",!1),supportsSpatialAggregationStatistics:ye(i,"supportsSpatialAggregationStatistics",!1),supportedSpatialAggregationStatistics:Zse(i),supportsCentroid:ye(i,"supportsReturningGeometryCentroid",!1),supportsDistance:ye(i,"supportsQueryWithDistance",!1),supportsDistinct:ye(i,"supportsDistinct",e.supportsAdvancedQueries),supportsExtent:ye(i,"supportsReturningQueryExtent",!1),supportsGeometryProperties:ye(i,"supportsReturningGeometryProperties",!1),supportsHavingClause:ye(i,"supportsHavingClause",!1),supportsOrderBy:ye(i,"supportsOrderBy",e.supportsAdvancedQueries),supportsPagination:ye(i,"supportsPagination",!1),supportsQuantization:ye(e,"supportsCoordinatesQuantization",!1),supportsQuantizationEditMode:ye(e,"supportsQuantizationEditMode",!1),supportsQueryGeometry:ye(e,"supportsReturningQueryGeometry",!1),supportsResultType:ye(i,"supportsQueryWithResultType",!1),supportsMaxRecordCountFactor:ye(i,"supportsMaxRecordCountFactor",!1),supportsSqlExpression:ye(i,"supportsSqlExpression",!1),supportsStandardizedQueriesOnly:ye(e,"useStandardizedQueries",!1),supportsTopFeaturesQuery:ye(i,"supportsTopFeaturesQuery",!1),supportsQueryByOthers:ye(s,"allowOthersToQuery",!0),supportsHistoricMoment:ye(r,"supportsQueryWithHistoricMoment",!1),supportsFormatPBF:!a&&u.has("pbf"),supportsDisjointSpatialRelationship:ye(i,"supportsDisjointSpatialRel",!1),supportsCacheHint:ye(i,"supportsQueryWithCacheHint",!1)||Wm(i,"query"),supportsDefaultSpatialReference:ye(i,"supportsDefaultSR",!1),supportsCompactGeometry:l,supportsFullTextSearch:ye(i,"supportsFullTextSearch",!1),maxRecordCountFactor:Fy(e,"maxRecordCountFactor",void 0),maxRecordCount:Fy(e,"maxRecordCount",void 0),standardMaxRecordCount:Fy(e,"standardMaxRecordCount",void 0),tileMaxRecordCount:Fy(e,"tileMaxRecordCount",void 0)}}function rre(e){const t=e.advancedQueryCapabilities,i=ye(t,"supportsAdvancedQueryRelated",!1);return{supportsPagination:ye(t,"supportsQueryRelatedPagination",!1),supportsCount:i,supportsOrderBy:i,supportsCacheHint:Wm(t,"queryRelated")}}function nre(e){return{supportsCacheHint:Wm(e.advancedQueryCapabilities,"queryTopFilter")}}function ore(e){const t=e.ownershipBasedAccessControlForFeatures;return{supportsGeometryUpdate:ye(e,"allowGeometryUpdates",!0),supportsGlobalId:ye(e,"supportsApplyEditsWithGlobalIds",!1),supportsReturnServiceEditsInSourceSpatialReference:ye(e,"supportsReturnServiceEditsInSourceSR",!1),supportsRollbackOnFailure:ye(e,"supportsRollbackOnFailureParameter",!1),supportsUpdateWithoutM:ye(e,"allowUpdateWithoutMValues",!1),supportsUploadWithItemId:ye(e,"supportsAttachmentsByUploadId",!1),supportsDeleteByAnonymous:ye(t,"allowAnonymousToDelete",!0),supportsDeleteByOthers:ye(t,"allowOthersToDelete",!0),supportsUpdateByAnonymous:ye(t,"allowAnonymousToUpdate",!0),supportsUpdateByOthers:ye(t,"allowOthersToUpdate",!0)}}async function are(e,t,i,s){const{source:r}=await e.load();if(await jT(e,t,s),!r.addAttachment)throw new L(s,"Layer source does not support addAttachment capability");return r.addAttachment(t,i)}function jT(e,t,i){const{attributes:s}=t,{objectIdField:r}=e;return e.get("capabilities.data.supportsAttachment")?t?s?r&&s[r]?Promise.resolve():Promise.reject(new L(i,`feature is missing the identifying attribute ${r}`)):Promise.reject(new L(i,"'attributes' are required on a feature to query attachments")):Promise.reject(new L(i,"A feature is required to add/delete/update attachments")):Promise.reject(new L(i,"this layer doesn't support attachments"))}async function lre(e,t,i,s,r){const{source:n}=await e.load();if(await jT(e,t,r),!n.updateAttachment)throw new L(r,"Layer source does not support updateAttachment capability");return n.updateAttachment(t,i,s)}async function cre(e,t,i){const s=await z(()=>import("./editingSupport.7278fc9c.js"),[]),r=await e.load();return s.applyEdits(r,r.source,t,i)}async function ure(e,t,i,s){const{source:r}=await e.load();if(await jT(e,t,s),!r.deleteAttachments)throw new L(s,"Layer source does not support deleteAttachments capability");return r.deleteAttachments(t,i)}async function hre(e,t,i){const{source:s}=await e.load({signal:t==null?void 0:t.signal});if(!s.fetchRecomputedExtents)throw new L(i,"Layer source does not support fetchUpdates capability");return s.fetchRecomputedExtents(t)}async function dre(e,t,i,s){var y,g;t=SS.from(t);const{source:r,capabilities:n}=await e.load();if(!((y=n==null?void 0:n.data)!=null&&y.supportsAttachment))throw new L(s,"this layer doesn't support attachments");const{attachmentTypes:o,objectIds:a,globalIds:l,num:u,size:d,start:f,where:m}=t;if(!((g=n==null?void 0:n.operations)!=null&&g.supportsQueryAttachments)){const v=a&&a.length>1,b=o&&o.length,_=l&&l.length,x=d&&d.length;if(v||b||_||x||u||f||m)throw new L(s,"when 'supportsQueryAttachments' is false, only objectIds of length 1 are supported",t)}if(!(a!=null&&a.length)&&!m)throw new L(s,"'objectIds' or 'where' are required to perform attachment query",t);if(!r.queryAttachments)throw new L(s,"Layer source does not support queryAttachments capability",t);return r.queryAttachments(t)}async function pre(e,t,i,s){var n;const{source:r}=await e.load();if(!r.queryObjectIds)throw new L(s,"Layer source does not support queryObjectIds capability");return r.queryObjectIds((n=$n.from(t))!=null?n:e.createQuery(),i)}async function fre(e,t,i,s){var n;const{source:r}=await e.load();if(!r.queryFeatureCount)throw new L(s,"Layer source does not support queryFeatureCount capability");return r.queryFeatureCount((n=$n.from(t))!=null?n:e.createQuery(),i)}async function mre(e,t,i,s){var n;const{source:r}=await e.load();if(!r.queryExtent)throw new L(s,"Layer source does not support queryExtent capability");return r.queryExtent((n=$n.from(t))!=null?n:e.createQuery(),i)}async function yre(e,t,i,s){const{source:r}=await e.load();if(!r.queryRelatedFeatures)throw new L(s,"Layer source does not support queryRelatedFeatures capability");return r.queryRelatedFeatures(am.from(t),i)}async function gre(e,t,i,s){const{source:r}=await e.load();if(!r.queryRelatedFeaturesCount)throw new L(s,"Layer source does not support queryRelatedFeaturesCount capability");return r.queryRelatedFeaturesCount(am.from(t),i)}async function vre(e){const t=e.source;if(t!=null&&t.refresh)try{const{dataChanged:i,updates:s}=await t.refresh();if(M(s)&&(e.sourceJSON={...e.sourceJSON,...s},e.read(s,{origin:"service",url:e.parsedUrl})),i)return!0}catch{}if(e.definitionExpression)try{return(await ose(e.definitionExpression,e.fieldsIndex)).hasDateFunctions}catch{}return!1}function bre(e){const t=new $n,i=e.get("capabilities.data"),s=e.get("capabilities.query");t.historicMoment=e.historicMoment,t.gdbVersion=e.gdbVersion,t.returnGeometry=!0,s&&(t.compactGeometryEnabled=s.supportsCompactGeometry,t.defaultSpatialReferenceEnabled=s.supportsDefaultSpatialReference),i&&(i.supportsZ&&e.returnZ!=null&&(t.returnZ=e.returnZ),i.supportsM&&e.returnM!=null&&(t.returnM=e.returnM)),t.outFields=["*"];const{timeOffset:r,timeExtent:n}=e;return t.timeExtent=r!=null&&n!=null?n.offset(-r.value,r.unit):n||null,t.multipatchOption=e.geometryType==="multipatch"?"xyFootprint":null,t}function S4(e){const{globalIdField:t,fields:i}=e;if(t)return t;if(i){for(const s of i)if(s.type==="esriFieldTypeGlobalID")return s.name}}function M4(e){const{objectIdField:t,fields:i}=e;if(t)return t;if(i){for(const s of i)if(s.type==="esriFieldTypeOID")return s.name}}function $4(e){return e.currentVersion?e.currentVersion:e.hasOwnProperty("capabilities")||e.hasOwnProperty("drawingInfo")||e.hasOwnProperty("hasAttachments")||e.hasOwnProperty("htmlPopupType")||e.hasOwnProperty("relationships")||e.hasOwnProperty("timeInfo")||e.hasOwnProperty("typeIdField")||e.hasOwnProperty("types")?10:9.3}let eh=class extends xt(W){constructor(e){super(e),this.shapeAreaField=null,this.shapeLengthField=null,this.units=null}};c([h({type:String,json:{read:{source:"shapeAreaFieldName"}}})],eh.prototype,"shapeAreaField",void 0),c([h({type:String,json:{read:{source:"shapeLengthFieldName"}}})],eh.prototype,"shapeLengthField",void 0),c([h({type:String,json:{read:e=>EW.read(e)||kW.read(e)}})],eh.prototype,"units",void 0),eh=c([S("esri.layers.support.GeometryFieldsInfo")],eh);const _re=eh;var z2;let th=z2=class extends W{constructor(e){super(e),this.floorField=null,this.viewAllMode=!1,this.viewAllLevelIds=new he}clone(){return new z2({floorField:this.floorField,viewAllMode:this.viewAllMode,viewAllLevelIds:this.viewAllLevelIds})}};c([h({type:String,json:{write:!0}})],th.prototype,"floorField",void 0),c([h({json:{read:!1,write:!1}})],th.prototype,"viewAllMode",void 0),c([h({json:{read:!1,write:!1}})],th.prototype,"viewAllLevelIds",void 0),th=z2=c([S("esri.layers.support.LayerFloorInfo")],th);const wre=th,pP=new Ie({esriRelCardinalityOneToOne:"one-to-one",esriRelCardinalityOneToMany:"one-to-many",esriRelCardinalityManyToMany:"many-to-many"}),fP=new Ie({esriRelRoleOrigin:"origin",esriRelRoleDestination:"destination"});let qs=class extends xt(W){constructor(e){super(e),this.cardinality=null,this.composite=null,this.id=null,this.keyField=null,this.keyFieldInRelationshipTable=null,this.name=null,this.relatedTableId=null,this.relationshipTableId=null,this.role=null}};c([h({json:{read:pP.read,write:pP.write}})],qs.prototype,"cardinality",void 0),c([h({json:{read:!0,write:!0}})],qs.prototype,"composite",void 0),c([h({json:{read:!0,write:!0}})],qs.prototype,"id",void 0),c([h({json:{read:!0,write:!0}})],qs.prototype,"keyField",void 0),c([h({json:{read:!0,write:!0}})],qs.prototype,"keyFieldInRelationshipTable",void 0),c([h({json:{read:!0,write:!0}})],qs.prototype,"name",void 0),c([h({json:{read:!0,write:!0}})],qs.prototype,"relatedTableId",void 0),c([h({json:{read:!0,write:!0}})],qs.prototype,"relationshipTableId",void 0),c([h({json:{read:fP.read,write:fP.write}})],qs.prototype,"role",void 0),qs=c([S("esri.layers.support.Relationship")],qs);const xre=qs,Sre=e=>{let t=class extends e{constructor(){super(...arguments),this.capabilities=null,this.copyright=null,this.datesInUnknownTimezone=!1,this.displayField=null,this.definitionExpression=null,this.editFieldsInfo=null,this.editingInfo=null,this.elevationInfo=null,this.floorInfo=null,this.fullExtent=null,this.gdbVersion=null,this.geometryFieldsInfo=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.heightModelInfo=null,this.historicMoment=null,this.isTable=!1,this.layerId=void 0,this.minScale=0,this.maxScale=0,this.globalIdField=null,this.objectIdField=null,this.relationships=null,this.sourceJSON=null,this.returnM=void 0,this.returnZ=void 0,this.serviceDefinitionExpression=null,this.spatialReference=xe.WGS84,this.subtypeField=null,this.trackIdField=null,this.indexes=new(he.ofType(yn)),this.userIsAdmin=!1,this.version=void 0}readCapabilitiesFromService(i,s){return x4(i,s,this.url)}readEditingInfo(i,s){const{editingInfo:r}=s;return r?{lastEditDate:r.lastEditDate!=null?new Date(r.lastEditDate):null}:null}readIsTableFromService(i,s){return s.type==="Table"}readMinScale(i,s){return s.effectiveMinScale||i||0}readMaxScale(i,s){return s.effectiveMaxScale||i||0}readGlobalIdFieldFromService(i,s){return S4(s)}readObjectIdFieldFromService(i,s){return M4(s)}readServiceDefinitionExpression(i,s){return s.definitionQuery||s.definitionExpression}set url(i){const s=Cse({layer:this,url:i,nonStandardUrlAllowed:!0,logger:q.getLogger(this.declaredClass)});this._set("url",s.url),s.layerId!=null&&this._set("layerId",s.layerId)}writeUrl(i,s,r,n){Pse(this,i,null,s,n)}readVersion(i,s){return $4(s)}};return c([h({readOnly:!0,json:{read:!1,origins:{service:{read:{source:["advancedQueryCapabilities","allowGeometryUpdates","allowUpdateWithoutMValues","archivingInfo","capabilities","datesInUnknownTimezone","hasAttachments","hasM","hasZ","maxRecordCount","maxRecordCountFactor","ownershipBasedAccessControlForFeatures","standardMaxRecordCount","supportedQueryFormats","supportsAdvancedQueries","supportsApplyEditsWithGlobalIds","supportsAttachmentsByUploadId","supportsAttachmentsResizing","supportsCalculate","supportsCoordinatesQuantization","supportsExceedsLimitStatistics","supportsFieldDescriptionProperty","supportsQuantizationEditMode","supportsRollbackOnFailureParameter","supportsStatistics","supportsTruncate","supportsValidateSql","tileMaxRecordCount","useStandardizedQueries"]}}}}})],t.prototype,"capabilities",void 0),c([Q("service","capabilities")],t.prototype,"readCapabilitiesFromService",null),c([h({type:String,json:{origins:{service:{read:{source:"copyrightText"}}}}})],t.prototype,"copyright",void 0),c([h({type:Boolean})],t.prototype,"datesInUnknownTimezone",void 0),c([h({type:String,json:{origins:{service:{read:{source:"displayField"}}}}})],t.prototype,"displayField",void 0),c([h({type:String,json:{origins:{service:{read:!1,write:!1}},name:"layerDefinition.definitionExpression",write:{enabled:!0,allowNull:!0}}})],t.prototype,"definitionExpression",void 0),c([h({readOnly:!0})],t.prototype,"editFieldsInfo",void 0),c([h({readOnly:!0})],t.prototype,"editingInfo",void 0),c([Q("editingInfo")],t.prototype,"readEditingInfo",null),c([h((()=>{const i=R(Gse),s=i.json.origins;return s["web-map"]={read:!1,write:!1},s["portal-item"]={read:!1,write:!1},i})())],t.prototype,"elevationInfo",void 0),c([h({type:wre,json:{read:{source:"layerDefinition.floorInfo"},write:{target:"layerDefinition.floorInfo"}}})],t.prototype,"floorInfo",void 0),c([h({type:Ze,json:{origins:{service:{read:{source:"extent"}}}}})],t.prototype,"fullExtent",void 0),c([h()],t.prototype,"gdbVersion",void 0),c([h({readOnly:!0,type:_re,json:{read:{source:"geometryProperties"}}})],t.prototype,"geometryFieldsInfo",void 0),c([h({type:["point","polygon","polyline","multipoint","multipatch","mesh"],json:{origins:{service:{read:V2.read}}}})],t.prototype,"geometryType",void 0),c([h({type:Boolean,json:{origins:{service:{read:!0}}}})],t.prototype,"hasM",void 0),c([h({type:Boolean,json:{origins:{service:{read:!0}}}})],t.prototype,"hasZ",void 0),c([h({readOnly:!0,type:Qb})],t.prototype,"heightModelInfo",void 0),c([h({type:Date})],t.prototype,"historicMoment",void 0),c([h({readOnly:!0})],t.prototype,"isTable",void 0),c([Q("service","isTable",["type"])],t.prototype,"readIsTableFromService",null),c([h({type:Number,json:{origins:{service:{read:{source:"id"}},"portal-item":{read:!1,write:{target:"id"}}},read:!1}})],t.prototype,"layerId",void 0),c([h(Yse)],t.prototype,"minScale",void 0),c([Q("service","minScale",["minScale","effectiveMinScale"])],t.prototype,"readMinScale",null),c([h(Jse)],t.prototype,"maxScale",void 0),c([Q("service","maxScale",["maxScale","effectiveMaxScale"])],t.prototype,"readMaxScale",null),c([h({type:String})],t.prototype,"globalIdField",void 0),c([Q("service","globalIdField",["globalIdField","fields"])],t.prototype,"readGlobalIdFieldFromService",null),c([h({type:String})],t.prototype,"objectIdField",void 0),c([Q("service","objectIdField",["objectIdField","fields"])],t.prototype,"readObjectIdFieldFromService",null),c([h({type:[xre],readOnly:!0})],t.prototype,"relationships",void 0),c([h()],t.prototype,"sourceJSON",void 0),c([h({type:Boolean})],t.prototype,"returnM",void 0),c([h({type:Boolean})],t.prototype,"returnZ",void 0),c([h({readOnly:!0})],t.prototype,"serviceDefinitionExpression",void 0),c([Q("service","serviceDefinitionExpression",["definitionQuery","definitionExpression"])],t.prototype,"readServiceDefinitionExpression",null),c([h({type:xe,json:{origins:{service:{read:{source:"extent.spatialReference"}}}}})],t.prototype,"spatialReference",void 0),c([h({type:String,readOnly:!0,json:{origins:{service:{read:!0}}}})],t.prototype,"subtypeField",void 0),c([h({type:String,json:{read:{source:"timeInfo.trackIdField"}}})],t.prototype,"trackIdField",void 0),c([h({readOnly:!0,json:{write:!1}})],t.prototype,"serverGens",void 0),c([h({type:he.ofType(yn),readOnly:!0})],t.prototype,"indexes",void 0),c([h(Use)],t.prototype,"url",null),c([ie("url")],t.prototype,"writeUrl",null),c([h({readOnly:!0})],t.prototype,"userIsAdmin",void 0),c([h({json:{origins:{service:{read:!0}},read:!1}})],t.prototype,"version",void 0),c([Q("service","version",["currentVersion","capabilities","drawingInfo","hasAttachments","htmlPopupType","relationships","timeInfo","typeIdField","types"])],t.prototype,"readVersion",null),t=c([S("esri.layers.mixins.FeatureLayerBase")],t),t};let ih=class extends xt(W){constructor(e){super(e),this.expression=null,this.title=null,this.returnType=null}};c([h({type:String,json:{write:!0}})],ih.prototype,"expression",void 0),c([h({type:String,json:{write:!0}})],ih.prototype,"title",void 0),c([h({type:String,json:{write:!0}})],ih.prototype,"returnType",void 0),ih=c([S("esri.layers.support.ExpressionInfo")],ih);const VT=ih;var B2;let no=B2=class extends W{constructor(e){super(e),this.isAutoGenerated=!1,this.name=null,this.alias=null,this.onStatisticField=null,this.onStatisticExpression=null,this.statisticType=null}clone(){return new B2({name:this.name,alias:this.alias,isAutoGenerated:this.isAutoGenerated,onStatisticExpression:R(this.onStatisticExpression),onStatisticField:this.onStatisticField,statisticType:this.statisticType})}};c([h({type:Boolean,json:{write:!0}})],no.prototype,"isAutoGenerated",void 0),c([h({type:String,json:{write:!0}})],no.prototype,"name",void 0),c([h({type:String,json:{write:!0}})],no.prototype,"alias",void 0),c([h({type:String,json:{write:!0}})],no.prototype,"onStatisticField",void 0),c([h({type:VT,json:{write:!0}})],no.prototype,"onStatisticExpression",void 0),c([h({type:String,json:{write:!0}})],no.prototype,"statisticType",void 0),no=B2=c([S("esri.layers.support.AggregateField")],no);const lu=no;let Ka=class extends W{constructor(){super(...arguments),this.type=null}};c([h({type:["selection","cluster","binning"],readOnly:!0,json:{read:!1,write:!0}})],Ka.prototype,"type",void 0),Ka=c([S("esri.layers.support.FeatureReduction")],Ka);const zT="__begin__",BT="__end__",Mre=new RegExp(zT,"ig"),$re=new RegExp(BT,"ig"),mP=new RegExp("^"+zT,"i"),yP=new RegExp(BT+"$","i"),Cv='"',Tre=Cv+" + ",Ire=" + "+Cv;function Ere(e){return e.replace(new RegExp("\\[","g"),"{").replace(new RegExp("\\]","g"),"}")}function kre(e){return e.replace(new RegExp("\\{","g"),"[").replace(new RegExp("\\}","g"),"]")}function UT(e){const t={expression:"",type:"none"};return e.labelExpressionInfo?e.labelExpressionInfo.value?(t.expression=e.labelExpressionInfo.value,t.type="conventional"):e.labelExpressionInfo.expression&&(t.expression=e.labelExpressionInfo.expression,t.type="arcade"):e.labelExpression!=null&&(t.expression=Ere(e.labelExpression),t.type="conventional"),t}function Cre(e){const t=UT(e);if(!t)return null;switch(t.type){case"conventional":return U2(t.expression);case"arcade":return t.expression}return null}function Pre(e){const t=UT(e);if(!t)return null;switch(t.type){case"conventional":return Ore(t.expression);case"arcade":return T4(t.expression)}return null}function U2(e){let t;return e?(t=In(e,i=>zT+'$feature["'+i+'"]'+BT),t=mP.test(t)?t.replace(mP,""):Cv+t,t=yP.test(t)?t.replace(yP,""):t+Cv,t=t.replace(Mre,Tre).replace($re,Ire)):t='""',t}const Are=/^\s*\{([^}]+)\}\s*$/i;function Ore(e){const t=e.match(Are);return t&&t[1].trim()||null}const Rre=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*$/i,Lre=/^\s*(?:(?:\$feature\.(\w+))|(?:\$feature\[(["'])([\w\s]+)(\2)\]));?\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])(\1|\3)(\5)\s*\));?\s*$/i,Fre=/^\s*(?:DomainName\(\s*\$feature\s*,\s*(["'])([\w\s]+)(\1)\s*\));?\s*$/i;function T4(e){if(!e)return null;let t=Rre.exec(e)||Lre.exec(e);return t?t[1]||t[3]:(t=Fre.exec(e),t?t[2]:null)}var q2;let xa=q2=class extends W{constructor(){super(...arguments),this.expression=null,this.title=null,this.value=null}readExpression(e,t){return t.value?U2(t.value):e}writeExpression(e,t,i){this.value!=null&&(e=U2(this.value)),e!=null&&(t[i]=e)}clone(){return new q2({expression:this.expression,title:this.title,value:this.value})}};c([h({type:String,json:{write:{writerEnsuresNonNull:!0}}})],xa.prototype,"expression",void 0),c([Q("expression",["expression","value"])],xa.prototype,"readExpression",null),c([ie("expression")],xa.prototype,"writeExpression",null),c([h({type:String,json:{write:!0,origins:{"web-scene":{write:!1}}}})],xa.prototype,"title",void 0),c([h({json:{read:!1,write:!1}})],xa.prototype,"value",void 0),xa=q2=c([S("esri.layers.support.LabelExpressionInfo")],xa);const I4=xa,E4=[252,146,31,255],Dre={type:"esriSMS",style:"esriSMSCircle",size:6,color:E4,outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[153,153,153,255]}},Nre={type:"esriSLS",style:"esriSLSSolid",width:.75,color:E4},jre={type:"esriSFS",style:"esriSFSSolid",color:[252,146,31,196],outline:{type:"esriSLS",style:"esriSLSSolid",width:.75,color:[255,255,255,191]}},Vre={type:"esriTS",color:[255,255,255,255],font:{family:"arial-unicode-ms",size:10,weight:"bold"},horizontalAlignment:"center",kerning:!0,haloColor:[0,0,0,255],haloSize:1,rotated:!1,text:"",xoffset:0,yoffset:0,angle:0},zre={type:"esriSMS",style:"esriSMSCircle",color:[0,0,0,255],outline:null,size:10.5},Bre={type:"esriSLS",style:"esriSLSSolid",color:[0,0,0,255],width:1.5},Ure={type:"esriSFS",style:"esriSFSSolid",color:[0,0,0,255],outline:null},q_e=vl.fromJSON(Dre),G_e=tr.fromJSON(Nre),W_e=gl.fromJSON(jre),qre=gd.fromJSON(Vre),H_e=vl.fromJSON(zre),Y_e=tr.fromJSON(Bre),J_e=gl.fromJSON(Ure);var G2;const Dy=new Ie({esriServerPointLabelPlacementAboveCenter:"above-center",esriServerPointLabelPlacementAboveLeft:"above-left",esriServerPointLabelPlacementAboveRight:"above-right",esriServerPointLabelPlacementBelowCenter:"below-center",esriServerPointLabelPlacementBelowLeft:"below-left",esriServerPointLabelPlacementBelowRight:"below-right",esriServerPointLabelPlacementCenterCenter:"center-center",esriServerPointLabelPlacementCenterLeft:"center-left",esriServerPointLabelPlacementCenterRight:"center-right",esriServerLinePlacementAboveAfter:"above-after",esriServerLinePlacementAboveAlong:"above-along",esriServerLinePlacementAboveBefore:"above-before",esriServerLinePlacementAboveStart:"above-start",esriServerLinePlacementAboveEnd:"above-end",esriServerLinePlacementBelowAfter:"below-after",esriServerLinePlacementBelowAlong:"below-along",esriServerLinePlacementBelowBefore:"below-before",esriServerLinePlacementBelowStart:"below-start",esriServerLinePlacementBelowEnd:"below-end",esriServerLinePlacementCenterAfter:"center-after",esriServerLinePlacementCenterAlong:"center-along",esriServerLinePlacementCenterBefore:"center-before",esriServerLinePlacementCenterStart:"center-start",esriServerLinePlacementCenterEnd:"center-end",esriServerPolygonPlacementAlwaysHorizontal:"always-horizontal"},{ignoreUnknown:!0});function k4(e){var t;return!e||e.origin!=="service"&&((t=e.layer)==null?void 0:t.type)!=="map-image"}function Gre(e){return(e==null?void 0:e.type)==="map-image"}function C4(e){var t,i;return!!Gre(e)&&!!((i=(t=e.capabilities)==null?void 0:t.exportMap)!=null&&i.supportsArcadeExpressionForLabeling)}function Wre(e){return k4(e)||C4(e.layer)}let St=G2=class extends W{constructor(e){super(e),this.type="label",this.name=null,this.allowOverrun=!1,this.deconflictionStrategy="static",this.labelExpression=null,this.labelExpressionInfo=null,this.labelPlacement=null,this.labelPosition="curved",this.maxScale=0,this.minScale=0,this.repeatLabel=!0,this.repeatLabelDistance=null,this.symbol=qre,this.useCodedValues=void 0,this.where=null}static evaluateWhere(e,t){const i=(s,r,n)=>{switch(r){case"=":return s==n;case"<>":return s!=n;case">":return s>n;case">=":return s>=n;case"<":return sWre(i)?{allowNull:!0}:{enabled:!1}}}})],St.prototype,"labelExpressionInfo",void 0),c([ie("labelExpressionInfo")],St.prototype,"writeLabelExpressionInfo",null),c([h({type:Dy.apiValues,json:{type:Dy.jsonValues,read:Dy.read,write:Dy.write}})],St.prototype,"labelPlacement",void 0),c([h({type:["curved","parallel"],json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1},"portal-item":{write:!1}}}})],St.prototype,"labelPosition",void 0),c([h({type:Number})],St.prototype,"maxScale",void 0),c([ie("maxScale")],St.prototype,"writeMaxScale",null),c([h({type:Number})],St.prototype,"minScale",void 0),c([ie("minScale")],St.prototype,"writeMinScale",null),c([h({type:Boolean,json:{write:!0,origins:{"web-scene":{write:!1},"portal-item":{write:!1}}}})],St.prototype,"repeatLabel",void 0),c([h({type:Number,cast:Fe,json:{write:!0,origins:{"web-scene":{write:!1}}}})],St.prototype,"repeatLabelDistance",void 0),c([h({types:KZ,json:{origins:{"web-scene":{types:eQ,write:qC,default:null}},write:qC,default:null}})],St.prototype,"symbol",void 0),c([h({type:Boolean,json:{write:!0}})],St.prototype,"useCodedValues",void 0),c([h({type:String,json:{write:!0}})],St.prototype,"where",void 0),St=G2=c([S("esri.layers.support.LabelClass")],St);const Kb=St;var W2;const ww=dl({types:zb}),Hre="esri.layers.support.FeatureReductionBinning";let Ki=W2=class extends Ka{constructor(e){super(e),this.type="binning",this.binType="geohash",this.fixedBinLevel=3,this.labelingInfo=null,this.labelsVisible=!0,this.popupEnabled=!0,this.popupTemplate=null,this.fields=[],this.renderer=null}writeFields(e,t,i){const s=e.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());Ei(i,s,t)}readRenderer(e,t,i){var r,n;const s=(r=t.drawingInfo)==null?void 0:r.renderer;return s?(n=cm(s,t,i))!=null?n:void 0:t.defaultSymbol?t.types&&t.types.length?new Gm({defaultSymbol:ww(t.defaultSymbol,t,i),field:t.typeIdField,uniqueValueInfos:t.types.map(o=>({id:o.id,symbol:ww(o.symbol,o,i)}))}):new Xh({symbol:ww(t.defaultSymbol,t,i)}):null}clone(){return new W2({fields:R(this.fields),fixedBinLevel:this.fixedBinLevel,labelingInfo:R(this.labelingInfo),labelsVisible:this.labelsVisible,popupEnabled:this.popupEnabled,popupTemplate:R(this.popupTemplate),renderer:R(this.renderer)})}};c([ue({binning:"binning"})],Ki.prototype,"type",void 0),c([ue({geohash:"geohash"})],Ki.prototype,"binType",void 0),c([h({type:Number,range:{min:1,max:9},json:{write:!0}})],Ki.prototype,"fixedBinLevel",void 0),c([h({type:[Kb],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],Ki.prototype,"labelingInfo",void 0),c([h(NT)],Ki.prototype,"labelsVisible",void 0),c([h(DT)],Ki.prototype,"popupEnabled",void 0),c([h({type:Dm,json:{name:"popupInfo",write:!0}})],Ki.prototype,"popupTemplate",void 0),c([h({type:[lu],json:{write:!0}})],Ki.prototype,"fields",void 0),c([ie("fields")],Ki.prototype,"writeFields",null),c([h({types:Zb,json:{write:{target:"drawingInfo.renderer"}}})],Ki.prototype,"renderer",void 0),c([Q("renderer",["drawingInfo.renderer"])],Ki.prototype,"readRenderer",null),Ki=W2=c([S(Hre)],Ki);const P4=Ki;var H2;const xw=dl({types:zb}),Yre="esri.layers.support.FeatureReductionCluster";function gP(e){var t;return e.type==="simple"&&!((t=e.visualVariables)!=null&&t.length)}let Xt=H2=class extends W{constructor(e){super(e),this.type="cluster",this.clusterRadius=Fe("80px"),this.clusterMinSize=Fe("12px"),this.clusterMaxSize=Fe("50px"),this.popupEnabled=!0,this.popupTemplate=null,this.renderer=null,this.symbol=null,this.labelingInfo=null,this.labelsVisible=!0,this.fields=null}readRenderer(e,t,i){var r,n,o;const s=(r=t.drawingInfo)==null?void 0:r.renderer;return(n=s==null?void 0:s.authoringInfo)!=null&&n.isAutoGenerated?null:s?gP(s)?null:(o=cm(s,t,i))!=null?o:void 0:t.defaultSymbol?t.types&&t.types.length?new Gm({defaultSymbol:xw(t.defaultSymbol,t,i),field:t.typeIdField,uniqueValueInfos:t.types.map(a=>({id:a.id,symbol:xw(a.symbol,a,i)}))}):new Xh({symbol:xw(t.defaultSymbol,t,i)}):null}readSymbol(e,t,i){var r,n,o;const s=(r=t.drawingInfo)==null?void 0:r.renderer;return(n=s==null?void 0:s.authoringInfo)!=null&&n.isAutoGenerated?null:s&&gP(s)?(o=cm(s,t,i))==null?void 0:o.symbol:null}writeSymbol(e,t,i,s){var n,o;const r=(o=(n=this.renderer)==null?void 0:n.authoringInfo)==null?void 0:o.isAutoGenerated;if(!this.renderer||r){const a=new Xh({symbol:e});t.drawingInfo={renderer:a.write({},s)}}}writeFields(e,t,i){const s=e.filter(r=>r.statisticType!=="avg_angle").map(r=>r.toJSON());Ei(i,s,t)}readFields(e,t,i){return e.filter(s=>!s.isAutoGenerated).map(s=>lu.fromJSON(s))}clone(){return new H2({clusterRadius:this.clusterRadius,clusterMinSize:this.clusterMinSize,clusterMaxSize:this.clusterMaxSize,labelingInfo:R(this.labelingInfo),labelsVisible:this.labelsVisible,fields:R(this.fields),renderer:R(this.renderer),symbol:R(this.symbol),popupEnabled:this.popupEnabled,popupTemplate:R(this.popupTemplate)})}};c([h({type:["cluster"],readOnly:!0,json:{write:!0}})],Xt.prototype,"type",void 0),c([h({type:Number,cast:e=>e==="auto"?e:Fe(e),json:{write:!0}})],Xt.prototype,"clusterRadius",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],Xt.prototype,"clusterMinSize",void 0),c([h({type:Number,cast:Fe,json:{write:!0}})],Xt.prototype,"clusterMaxSize",void 0),c([h(DT)],Xt.prototype,"popupEnabled",void 0),c([h({type:Dm,json:{read:{source:"popupInfo"},write:{target:"popupInfo"}}})],Xt.prototype,"popupTemplate",void 0),c([h({types:Zb,json:{write:{target:"drawingInfo.renderer"}}})],Xt.prototype,"renderer",void 0),c([Q("renderer",["drawingInfo.renderer"])],Xt.prototype,"readRenderer",null),c([h({types:ZZ})],Xt.prototype,"symbol",void 0),c([Q("symbol",["drawingInfo.renderer"])],Xt.prototype,"readSymbol",null),c([ie("symbol")],Xt.prototype,"writeSymbol",null),c([h({type:[Kb],json:{read:{source:"drawingInfo.labelingInfo"},write:{target:"drawingInfo.labelingInfo"}}})],Xt.prototype,"labelingInfo",void 0),c([h(NT)],Xt.prototype,"labelsVisible",void 0),c([h({type:[lu],json:{write:!0}})],Xt.prototype,"fields",void 0),c([ie("fields")],Xt.prototype,"writeFields",null),c([Q("fields")],Xt.prototype,"readFields",null),Xt=H2=c([S(Yre)],Xt);const A4=Xt;var Y2;let l0=Y2=class extends Ka{constructor(e){super(e),this.type="selection"}clone(){return new Y2}};c([h({type:["selection"]})],l0.prototype,"type",void 0),l0=Y2=c([S("esri.layers.support.FeatureReductionSelection")],l0);const vP=l0,bP={key:"type",base:Ka,typeMap:{cluster:A4,binning:P4}},Jre={types:{key:"type",base:Ka,typeMap:{selection:vP,cluster:A4,binning:P4}},json:{name:"layerDefinition.featureReduction",write:{allowNull:!0},origins:{"web-map":{types:bP},"portal-item":{types:bP},"web-scene":{types:{key:"type",base:Ka,typeMap:{selection:vP}}}}}},_u={Base64:0,Hex:1,String:2,Raw:3},Lh=8,O4=(1<>16)+(t>>16)+(i>>16)<<16|65535&i}function Xre(e){const t=[];for(let i=0,s=e.length*Lh;i>5]|=(e.charCodeAt(i/Lh)&O4)<>5]>>>i%32&O4));return t.join("")}function Qre(e){const t="0123456789abcdef",i=[];for(let s=0,r=4*e.length;s>2]>>s%4*8+4&15)+t.charAt(e[s>>2]>>s%4*8&15));return i.join("")}function Kre(e){const t="=",i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=[];for(let r=0,n=4*e.length;r>2]>>r%4*8&255)<<16|(e[r+1>>2]>>(r+1)%4*8&255)<<8|e[r+2>>2]>>(r+2)%4*8&255;for(let a=0;a<4;a++)8*r+6*a>32*e.length?s.push(t):s.push(i.charAt(o>>6*(3-a)&63))}return s.join("")}function ene(e,t){return e<>>32-t}function e_(e,t,i,s,r,n){return Wa(ene(Wa(Wa(t,e),Wa(s,n)),r),i)}function gi(e,t,i,s,r,n,o){return e_(t&i|~t&s,e,t,r,n,o)}function vi(e,t,i,s,r,n,o){return e_(t&s|i&~s,e,t,r,n,o)}function bi(e,t,i,s,r,n,o){return e_(t^i^s,e,t,r,n,o)}function _i(e,t,i,s,r,n,o){return e_(i^(t|~s),e,t,r,n,o)}function tne(e,t){e[t>>5]|=128<>>9<<4)]=t;let i=1732584193,s=-271733879,r=-1732584194,n=271733878;for(let o=0;oe.clone()),target:this.target,useSymbolValue:this.useSymbolValue,valueRepresentation:this.valueRepresentation,valueUnit:this.valueUnit,legendOptions:this.legendOptions&&this.legendOptions.clone(),levels:R(this.levels)})}};c([h()],Bp.prototype,"levels",void 0),c([ie("levels")],Bp.prototype,"writeLevels",null),Bp=J2=c([S("esri.views.2d.engine.LevelDependentSizeVariable")],Bp);const ine=q.getLogger("esri.views.2d.layers.support.clusterUtils");V.add("esri-cluster-arcade-enabled",!0);const sne=V("esri-cluster-arcade-enabled"),rne=(e,t,i,s,r)=>{const n=t.clone();if(!one(n))return n;if(n.authoringInfo||(n.authoringInfo=new kT),n.authoringInfo.isAutoGenerated=!0,"visualVariables"in n){const o=(n.visualVariables||[]).filter(l=>l.valueExpression!=="$view.scale"),a=L4(o);o.forEach(l=>{l.type==="rotation"?l.field?l.field=xl(e,l.field,"avg_angle","number"):l.valueExpression&&(l.field=Bd(e,l.valueExpression,"avg_angle","number"),l.valueExpression=null):l.normalizationField?(l.field=xl(e,l.field,"avg_norm","number",l.normalizationField),l.normalizationField=null):l.field?l.field=xl(e,l.field,"avg","number"):l.valueExpression&&(l.field=Bd(e,l.valueExpression,"avg","number"),l.valueExpression=null)}),N(a)&&!nne(o)&&r&&(o.push(F4(i,s)),n.dynamicClusterSize=!0),n.visualVariables=o}switch(n.type){case"simple":break;case"pie-chart":for(const o of n.attributes)o.field?o.field=xl(e,o.field,"sum","number"):o.valueExpression&&(o.field=Bd(e,o.valueExpression,"sum","number"),o.valueExpression=null);break;case"unique-value":n.field?n.field=xl(e,n.field,"mode","string"):n.valueExpression&&(n.field=Bd(e,n.valueExpression,"mode","string"),n.valueExpression=null);break;case"class-breaks":n.normalizationField?(n.field=xl(e,n.field,"avg_norm","number",n.normalizationField),n.normalizationField=null):n.field?n.field=xl(e,n.field,"avg","number"):n.valueExpression&&(n.field=Bd(e,n.valueExpression,"avg","number"),n.valueExpression=null)}return n},L4=e=>{for(const t of e)if(t.type==="size")return t;return null};function X_e(e,t,i){const s=e.clone();let r=!1;if("visualVariables"in s){const n=(s.visualVariables||[]).filter(a=>a.valueExpression!=="$view.scale"),o=L4(n);N(o)&&(s.visualVariables||(s.visualVariables=[]),s.visualVariables.push(F4(t,i)),s.dynamicClusterSize=!0,r=!0)}return{renderer:s,didInject:r}}const nne=e=>{for(const t of e)if(t.field==="cluster_count")return!0;return!1},F4=(e,t)=>{const i=[new Yu({value:0,size:0}),new Yu({value:1})];if(N(t))return new Jb({field:"cluster_count",stops:[...i,new Yu({value:2,size:0})]});const s=Object.keys(t).reduce((r,n)=>({...r,[n]:[...i,new Yu({value:Math.max(2,t[n].minValue),size:e.clusterMinSize}),new Yu({value:Math.max(3,t[n].maxValue),size:e.clusterMaxSize})]}),{});return new Bp({field:"cluster_count",levels:s})},one=e=>{const t=i=>ine.error(new L("Unsupported-renderer",i,{renderer:e}));switch(e.type){case"unique-value":if(e.field2||e.field3)return t("FeatureReductionCluster does not support multi-field UniqueValueRenderers"),!1;break;case"class-breaks":if(e.normalizationField){const i=e.normalizationType;if(i!=="field")return t(`FeatureReductionCluster does not support a normalizationType of ${i}`),!1;break}case"simple":case"pie-chart":break;default:return t(`FeatureReductionCluster does not support renderers of type ${e.type}`),!1}if(!sne){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(i=>!(!("valueExpression"in i)||!i.valueExpression)))return t("FeatureReductionCluster does not currently support visualVariables with a valueExpression. Support will be added in a future release"),!1}return!0};function ane(e,t,i){switch(e){case"sum":return`cluster_sum_${t}`;case"avg":case"avg_angle":return`cluster_avg_${t}`;case"mode":return`cluster_type_${t}`;case"avg_norm":{const s=i,r="field",n=t.toLowerCase()+",norm:"+r+","+s.toLowerCase();return"cluster_avg_"+R4(n)}}}function Bd(e,t,i,s){const r=R4(t),n=i==="mode"?`cluster_type_${r}`:i==="sum"?`cluster_sum_${r}`:`cluster_avg_${r}`;return e.some(o=>o.name===n)||e.push(new lu({name:n,isAutoGenerated:!0,onStatisticExpression:new VT({expression:t,returnType:s}),statisticType:i})),n}function xl(e,t,i,s,r){if(t==="cluster_count"||e.some(o=>o.name===t))return t;const n=ane(i,t,r);return e.some(o=>o.name===n)||(i==="avg_norm"?e.push(new lu({name:n,isAutoGenerated:!0,onStatisticExpression:new VT({expression:`$feature.${t} / $feature.${r}`,returnType:s}),statisticType:"avg"})):e.push(new lu({name:n,isAutoGenerated:!0,onStatisticField:t,statisticType:i}))),n}const lne=e=>{let t=class extends e{constructor(...i){super(...i),this.own(this.watch("renderer",()=>{if(this.featureReduction){const s=this._normalizeFeatureReduction(this.featureReduction);this._set("featureReduction",s)}},!0))}set featureReduction(i){const s=this._normalizeFeatureReduction(i);this._set("featureReduction",s)}set renderer(i){}_normalizeFeatureReduction(i){var a,l;if((i==null?void 0:i.type)!=="cluster")return i;const s=i.clone(),r=[new lu({name:"cluster_count",isAutoGenerated:!0,statisticType:"count"})],n=((a=s.fields)!=null?a:[]).filter(u=>!u.isAutoGenerated);if(i.renderer&&!((l=i.renderer.authoringInfo)!=null&&l.isAutoGenerated))return s.fields=[...r,...n],s;if(i.symbol)return s.fields=[...r,...n],s.renderer=null,s;if(!this.renderer)return i;const o=rne(r,this.renderer,i,null,!1);return s.fields=[...r,...n],s.renderer=o,s}};return c([h(Jre)],t.prototype,"featureReduction",null),t=c([S("esri.layers.mixins.FeatureReductionLayer")],t),t},cne={"web-scene/operational-layers":{ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISMapServiceLayer:!0,ArcGISSceneServiceLayer:!0,ArcGISTiledElevationServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BuildingSceneLayer:!0,GroupLayer:!0,IntegratedMeshLayer:!0,OGCFeatureLayer:!0,PointCloudLayer:!0,WebTiledLayer:!0,CSV:!0,GeoJSON:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,KML:!0,RasterDataLayer:!0,Voxel:!0,LineOfSightLayer:!0},"web-scene/basemap":{ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,WebTiledLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,ArcGISImageServiceLayer:!0,WMS:!0,ArcGISMapServiceLayer:!0},"web-scene/ground":{ArcGISTiledElevationServiceLayer:!0,RasterDataElevationLayer:!0},"web-map/operational-layers":{ArcGISAnnotationLayer:!0,ArcGISDimensionLayer:!0,ArcGISFeatureLayer:!0,ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISStreamLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,BingMapsAerial:!0,BingMapsHybrid:!0,BingMapsRoad:!0,CSV:!0,GeoRSS:!0,GeoJSON:!0,GroupLayer:!0,KML:!0,OGCFeatureLayer:!0,OrientedImageryLayer:!0,SubtypeGroupLayer:!0,VectorTileLayer:!0,WFS:!0,WMS:!0,WebTiledLayer:!0},"web-map/basemap":{ArcGISImageServiceLayer:!0,ArcGISImageServiceVectorLayer:!0,ArcGISMapServiceLayer:!0,ArcGISTiledImageServiceLayer:!0,ArcGISTiledMapServiceLayer:!0,OpenStreetMap:!0,VectorTileLayer:!0,WMS:!0,WebTiledLayer:!0,BingMapsAerial:!0,BingMapsRoad:!0,BingMapsHybrid:!0},"web-map/tables":{ArcGISFeatureLayer:!0},"portal-item/operational-layers":{ArcGISFeatureLayer:!0,ArcGISSceneServiceLayer:!0,PointCloudLayer:!0,BuildingSceneLayer:!0,IntegratedMeshLayer:!0,OrientedImageryLayer:!0}},une=e=>{let t=class extends e{constructor(){super(...arguments),this.title=null}writeListMode(i,s,r,n){(n&&n.layerContainerType==="ground"||i&&rW(this,r,{},n))&&(s[r]=i)}writeOperationalLayerType(i,s,r,n){!i||n&&n.layerContainerType==="tables"||(s.layerType=i)}writeTitle(i,s){s.title=i!=null?i:"Layer"}read(i,s){s&&(s.layer=this),tW(this,i,r=>super.read(i,r),s)}write(i,s){var o,a;if(s!=null&&s.origin){const l=`${s.origin}/${s.layerContainerType||"operational-layers"}`,u=cne[l];let d=u&&u[this.operationalLayerType];if(this.operationalLayerType==="ArcGISTiledElevationServiceLayer"&&l==="web-scene/operational-layers"&&(d=!1),this.operationalLayerType==="ArcGISDimensionLayer"&&l==="web-map/operational-layers"&&(d=!1),!d)return(o=s.messages)==null||o.push(new L("layer:unsupported",`Layers (${this.title}, ${this.id}) of type '${this.declaredClass}' are not supported in the context of '${l}'`,{layer:this})),null}const r=super.write(i,{...s,layer:this}),n=!!s&&!!s.messages&&!!s.messages.filter(l=>l instanceof L&&l.name==="web-document-write:property-required").length;return ab(r==null?void 0:r.url)?((a=s==null?void 0:s.messages)==null||a.push(new L("layer:invalid-url",`Layer (${this.title}, ${this.id}) of type '${this.declaredClass}' using a Blob URL cannot be written to web scenes and web maps`,{layer:this})),null):!this.url&&n?null:r}beforeSave(){}};return c([h({type:String,json:{write:{ignoreOrigin:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0}},"portal-item":{write:!1}}}})],t.prototype,"id",void 0),c([h(w4)],t.prototype,"listMode",void 0),c([ie("listMode")],t.prototype,"writeListMode",null),c([h({type:String,readOnly:!0,json:{read:!1,write:{target:"layerType",ignoreOrigin:!0},origins:{"portal-item":{write:!1}}}})],t.prototype,"operationalLayerType",void 0),c([ie("operationalLayerType")],t.prototype,"writeOperationalLayerType",null),c([h(a0)],t.prototype,"opacity",void 0),c([h({type:String,json:{write:{ignoreOrigin:!0,writerEnsuresNonNull:!0},origins:{"web-scene":{write:{isRequired:!0,ignoreOrigin:!0,writerEnsuresNonNull:!0}},"portal-item":{write:!1}}},value:"Layer"})],t.prototype,"title",void 0),c([ie("title"),ie(["web-scene"],"title")],t.prototype,"writeTitle",null),c([h({type:Boolean,json:{name:"visibility"}})],t.prototype,"visible",void 0),t=c([S("esri.layers.mixins.OperationalLayer")],t),t};var X2;const Sw=new Ie({asc:"ascending",desc:"descending"});let sh=X2=class extends W{constructor(e){super(e),this.field=null,this.valueExpression=null,this.order="ascending"}clone(){return new X2({field:this.field,valueExpression:this.valueExpression,order:this.order})}};c([h({type:String,json:{write:!0}})],sh.prototype,"field",void 0),c([h({type:String,json:{write:!0}})],sh.prototype,"valueExpression",void 0),c([h({type:Sw.apiValues,json:{read:Sw.read,write:Sw.write}})],sh.prototype,"order",void 0),sh=X2=c([S("esri.layers.support.OrderByInfo")],sh);const D4=sh;function hne(e,t,i){if(!e)return null;const s=e.find(n=>!!n.field);if(!s)return null;const r=new D4;return r.read(s,i),[r]}function dne(e,t,i,s){const r=e.find(n=>!!n.field);r&&Ei(i,[r.toJSON()],t)}const pne=e=>{let t=class extends e{constructor(){super(...arguments),this.orderBy=null}};return c([h({type:[D4],json:{origins:{"web-scene":{write:!1,read:!1}},read:{source:"layerDefinition.orderBy",reader:hne},write:{target:"layerDefinition.orderBy",writer:dne}}})],t.prototype,"orderBy",void 0),t=c([S("esri.layers.mixins.OrderedLayer")],t),t},fne=e=>{let t=class extends e{constructor(){super(...arguments),this.resourceReferences={portalItem:null,paths:[]},this.userHasEditingPrivileges=!0}destroy(){this.portalItem=$t(this.portalItem)}set portalItem(i){i!==this._get("portalItem")&&(this.removeOrigin("portal-item"),this._set("portalItem",i))}readPortalItem(i,s,r){if(s.itemId)return new fv({id:s.itemId,portal:r&&r.portal})}writePortalItem(i,s){i&&i.id&&(s.itemId=i.id)}async loadFromPortal(i,s){if(this.portalItem&&this.portalItem.id)try{const r=await z(()=>import("./layersLoader.afdddce2.js").then(function(n){return n.l}),["assets/layersLoader.afdddce2.js","assets/jsonContext.fe51f9bd.js","assets/portalItemUtils.92eef7f6.js"]);return Ft(s),await r.load({instance:this,supportedTypes:i.supportedTypes,validateItem:i.validateItem,supportsData:i.supportsData,layerModuleTypeMap:i.layerModuleTypeMap},s)}catch(r){throw Ks(r)||q.getLogger(this.declaredClass).warn(`Failed to load layer (${this.title}, ${this.id}) portal item (${this.portalItem.id}) + ${r}`),r}}async finishLoadEditablePortalLayer(i){this._set("userHasEditingPrivileges",await this._fetchUserHasEditingPrivileges(i).catch(s=>(Em(s),!0)))}async _fetchUserHasEditingPrivileges(i){const s=this.url?bt==null?void 0:bt.findCredential(this.url):null;if(!s)return!0;const r=Ny.credential===s?Ny.user:await this._fetchEditingUser(i);return Ny.credential=s,Ny.user=r,N(r)||r.privileges==null||r.privileges.includes("features:user:edit")}async _fetchEditingUser(i){var d,f,m;const s=(f=(d=this.portalItem)==null?void 0:d.portal)==null?void 0:f.user;if(s)return s;const r=bt.findServerInfo((m=this.url)!=null?m:"");if(!(r!=null&&r.owningSystemUrl))return null;const n=`${r.owningSystemUrl}/sharing/rest`,o=cs.getDefault();if(o&&o.loaded&&Zs(o.restUrl)===Zs(n))return o.user;const a=`${n}/community/self`,l=M(i)?i.signal:null,u=await xb(kt(a,{authMode:"no-prompt",query:{f:"json"},signal:l}));return u.ok?R$.fromJSON(u.value.data):null}read(i,s){s&&(s.layer=this),super.read(i,s)}write(i,s){const r=s&&s.portal,n=this.portalItem&&this.portalItem.id&&(this.portalItem.portal||cs.getDefault());return r&&n&&!yR(n.restUrl,r.restUrl)?(s.messages&&s.messages.push(new L("layer:cross-portal",`The layer '${this.title} (${this.id})' cannot be persisted because it refers to an item on a different portal than the one being saved to. To save, set layer.portalItem to null or save to the same portal as the item associated with the layer`,{layer:this})),null):super.write(i,{...s,layer:this})}};return c([h({type:fv})],t.prototype,"portalItem",null),c([Q("web-document","portalItem",["itemId"])],t.prototype,"readPortalItem",null),c([ie("web-document","portalItem",{itemId:{type:String}})],t.prototype,"writePortalItem",null),c([h({clonable:!1})],t.prototype,"resourceReferences",void 0),c([h({readOnly:!0})],t.prototype,"userHasEditingPrivileges",void 0),t=c([S("esri.layers.mixins.PortalLayer")],t),t},Ny={credential:null,user:null};let Up=class extends oe{constructor(){super(...arguments),this.updating=!1,this.status="unknown"}};c([h()],Up.prototype,"updating",void 0),c([h()],Up.prototype,"status",void 0),Up=c([S("esri.layers.support.PublishingInfo")],Up);const mne=Up,yne="esri.layers.mixins.PublishableLayer",gne=e=>{let t=class extends e{get publishingInfo(){if(this.destroyed)return null;const i=this._get("publishingInfo");if(i)return i;const s=new mne;return this._checkPublishingStatus(s),s}_checkPublishingStatus(i){let n=0;const o=async l=>{let u;i.updating=!0;try{u=await this.fetchPublishingStatus()}catch{u="unavailable"}u!=="published"&&u!=="unavailable"||(i.status==="publishing"&&this.refresh(),a.remove()),i.status=u,i.updating=!1,a.removed||(n=setTimeout(o,l,l+125))},a={removed:!1,remove(){this.removed=!0,clearTimeout(n)}};this.when().catch(()=>a.remove()),o(250),this.own(a)}};return c([h({readOnly:!0,clonable:!1})],t.prototype,"publishingInfo",null),t=c([S(yne)],t),t},um=new he,Tf=new WeakMap;function vne(e){N4(e)&&um.push(e)}function bne(e){N4(e)&&um.includes(e)&&um.remove(e)}function N4(e){return e!=null&&typeof e=="object"&&"refreshInterval"in e&&"refresh"in e}function j4(e,t){return Number.isFinite(e)&&Number.isFinite(t)?t<=0?e:j4(t,e%t):0}let Mw=0,jy=0;function _ne(){var t;const e=Date.now();for(const i of um)i.refreshInterval&&e-((t=Tf.get(i))!=null?t:0)+5>=6e4*i.refreshInterval&&(Tf.set(i,e),i.refresh(e))}NR(()=>{const e=Date.now();let t=0;for(const i of um)t=j4(Math.round(6e4*i.refreshInterval),t),i.refreshInterval?Tf.get(i)||Tf.set(i,e):Tf.delete(i);if(t!==jy){if(jy=t,clearInterval(Mw),jy===0)return void(Mw=0);Mw=setInterval(_ne,jy)}});const wne=e=>{let t=class extends e{constructor(...i){super(...i),this.refreshInterval=0,this.refreshTimestamp=0,this._debounceHasDataChanged=cR(()=>this.hasDataChanged()),this.when().then(()=>{vne(this)},()=>{})}destroy(){bne(this)}get refreshParameters(){return{_ts:this.refreshTimestamp||null}}refresh(i=Date.now()){wh(this._debounceHasDataChanged()).then(s=>{s&&this._set("refreshTimestamp",i),this.emit("refresh",{dataChanged:s})},s=>{q.getLogger(this.declaredClass).error(s),this.emit("refresh",{dataChanged:!1,error:s})})}async hasDataChanged(){return!0}};return c([h({type:Number,cast:i=>i>=.1?i:i<=0?0:.1,json:{write:!0}})],t.prototype,"refreshInterval",void 0),c([h({readOnly:!0})],t.prototype,"refreshTimestamp",void 0),c([h()],t.prototype,"refreshParameters",null),t=c([S("esri.layers.mixins.RefreshableLayer")],t),t},Dc=mi()({esriTimeUnitsMilliseconds:"milliseconds",esriTimeUnitsSeconds:"seconds",esriTimeUnitsMinutes:"minutes",esriTimeUnitsHours:"hours",esriTimeUnitsDays:"days",esriTimeUnitsWeeks:"weeks",esriTimeUnitsMonths:"months",esriTimeUnitsYears:"years",esriTimeUnitsDecades:"decades",esriTimeUnitsCenturies:"centuries",esriTimeUnitsUnknown:void 0});var Z2;let qp=Z2=class extends W{constructor(e){super(e),this.value=0,this.unit="milliseconds"}toMilliseconds(){return tte(this.value,this.unit,"milliseconds")}clone(){return new Z2({value:this.value,unit:this.unit})}};c([h({type:Number,json:{write:!0},nonNullable:!0})],qp.prototype,"value",void 0),c([h({type:Dc.apiValues,json:{type:Dc.jsonValues,read:Dc.read,write:Dc.write},nonNullable:!0})],qp.prototype,"unit",void 0),qp=Z2=c([S("esri.TimeInterval")],qp);const hm=qp;var Q2;let rh=Q2=class extends W{constructor(e){super(e),this.respectsDaylightSaving=!1,this.timezone=null}readRespectsDaylightSaving(e,t){return t.respectsDaylightSaving!==void 0?t.respectsDaylightSaving:t.respectDaylightSaving!==void 0&&t.respectDaylightSaving}clone(){const{respectsDaylightSaving:e,timezone:t}=this;return new Q2({respectsDaylightSaving:e,timezone:t})}};c([h({type:Boolean,json:{write:!0}})],rh.prototype,"respectsDaylightSaving",void 0),c([Q("respectsDaylightSaving",["respectsDaylightSaving","respectDaylightSaving"])],rh.prototype,"readRespectsDaylightSaving",null),c([h({type:String,json:{read:{source:"timeZone"},write:{target:"timeZone"}}})],rh.prototype,"timezone",void 0),rh=Q2=c([S("esri.layers.support.TimeReference")],rh);const xne=rh;var K2;let Mi=K2=class extends W{constructor(e){super(e),this.cumulative=!1,this.endField=null,this.fullTimeExtent=null,this.hasLiveData=!1,this.interval=null,this.startField=null,this.timeReference=null,this.trackIdField=null,this.useTime=!0}readFullTimeExtent(e,t){if(!t.timeExtent||!Array.isArray(t.timeExtent)||t.timeExtent.length!==2)return null;const i=new Date(t.timeExtent[0]),s=new Date(t.timeExtent[1]);return new Ln({start:i,end:s})}writeFullTimeExtent(e,t){e&&M(e.start)&&M(e.end)?t.timeExtent=[e.start.getTime(),e.end.getTime()]:t.timeExtent=null}readInterval(e,t){return t.timeInterval&&t.timeIntervalUnits?new hm({value:t.timeInterval,unit:Dc.fromJSON(t.timeIntervalUnits)}):t.defaultTimeInterval&&t.defaultTimeIntervalUnits?new hm({value:t.defaultTimeInterval,unit:Dc.fromJSON(t.defaultTimeIntervalUnits)}):null}writeInterval(e,t){if(e){const i=e.toJSON();t.timeInterval=i.value,t.timeIntervalUnits=i.unit}else t.timeInterval=null,t.timeIntervalUnits=null}clone(){const{cumulative:e,endField:t,hasLiveData:i,interval:s,startField:r,timeReference:n,fullTimeExtent:o,trackIdField:a,useTime:l}=this;return new K2({cumulative:e,endField:t,hasLiveData:i,interval:s,startField:r,timeReference:R(n),fullTimeExtent:R(o),trackIdField:a,useTime:l})}};c([h({type:Boolean,json:{read:{source:"exportOptions.timeDataCumulative"},write:{target:"exportOptions.timeDataCumulative"}}})],Mi.prototype,"cumulative",void 0),c([h({type:String,json:{read:{source:"endTimeField"},write:{target:"endTimeField",allowNull:!0}}})],Mi.prototype,"endField",void 0),c([h({type:Ln,json:{write:{enabled:!0,allowNull:!0}}})],Mi.prototype,"fullTimeExtent",void 0),c([Q("fullTimeExtent",["timeExtent"])],Mi.prototype,"readFullTimeExtent",null),c([ie("fullTimeExtent")],Mi.prototype,"writeFullTimeExtent",null),c([h({type:Boolean,json:{write:!0}})],Mi.prototype,"hasLiveData",void 0),c([h({type:hm,json:{write:{enabled:!0,allowNull:!0}}})],Mi.prototype,"interval",void 0),c([Q("interval",["timeInterval","timeIntervalUnits","defaultTimeInterval","defaultTimeIntervalUnits"])],Mi.prototype,"readInterval",null),c([ie("interval")],Mi.prototype,"writeInterval",null),c([h({type:String,json:{read:{source:"startTimeField"},write:{target:"startTimeField",allowNull:!0}}})],Mi.prototype,"startField",void 0),c([h({type:xne,json:{write:{enabled:!0,allowNull:!0}}})],Mi.prototype,"timeReference",void 0),c([h({type:String,json:{write:{enabled:!0,allowNull:!0}}})],Mi.prototype,"trackIdField",void 0),c([h({type:Boolean,json:{read:{source:"exportOptions.useTime"},write:{target:"exportOptions.useTime"}}})],Mi.prototype,"useTime",void 0),Mi=K2=c([S("esri.layers.support.TimeInfo")],Mi);const V4=Mi,Sne=e=>{let t=class extends e{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(i,s){const r=s.timeInfo.exportOptions;if(!r)return null;const n=r.timeOffset,o=Dc.fromJSON(r.timeOffsetUnits);return n&&o?new hm({value:n,unit:o}):null}set timeInfo(i){AD(i,this.fieldsIndex),this._set("timeInfo",i)}};return c([h({type:Ln,json:{write:!1}})],t.prototype,"timeExtent",void 0),c([h({type:hm})],t.prototype,"timeOffset",void 0),c([Q("service","timeOffset",["timeInfo.exportOptions"])],t.prototype,"readOffset",null),c([h({value:null,type:V4,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],t.prototype,"timeInfo",null),c([h({type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation"},origins:{"web-scene":{read:!1,write:!1}}}})],t.prototype,"useViewTime",void 0),t=c([S("esri.layers.mixins.TemporalLayer")],t),t},_P=new Ie({esriFeatureEditToolAutoCompletePolygon:"auto-complete-polygon",esriFeatureEditToolCircle:"circle",esriFeatureEditToolEllipse:"ellipse",esriFeatureEditToolFreehand:"freehand",esriFeatureEditToolLine:"line",esriFeatureEditToolNone:"none",esriFeatureEditToolPoint:"point",esriFeatureEditToolPolygon:"polygon",esriFeatureEditToolRectangle:"rectangle",esriFeatureEditToolArrow:"arrow",esriFeatureEditToolTriangle:"triangle",esriFeatureEditToolLeftArrow:"left-arrow",esriFeatureEditToolRightArrow:"right-arrow",esriFeatureEditToolUpArrow:"up-arrow",esriFeatureEditToolDownArrow:"down-arrow"});let Sa=class extends xt(W){constructor(e){super(e),this.name=null,this.description=null,this.drawingTool=null,this.prototype=null,this.thumbnail=null}};c([h({json:{write:!0}})],Sa.prototype,"name",void 0),c([h({json:{write:!0}})],Sa.prototype,"description",void 0),c([h({json:{read:_P.read,write:_P.write}})],Sa.prototype,"drawingTool",void 0),c([h({json:{write:!0}})],Sa.prototype,"prototype",void 0),c([h({json:{write:!0}})],Sa.prototype,"thumbnail",void 0),Sa=c([S("esri.layers.support.FeatureTemplate")],Sa);const qT=Sa;let oo=class extends xt(W){constructor(e){super(e),this.id=null,this.name=null,this.domains=null,this.templates=null}readDomains(e){const t={};for(const i of Object.keys(e))t[i]=bT(e[i]);return t}writeDomains(e,t){var s;const i={};for(const r of Object.keys(e))e[r]&&(i[r]=(s=e[r])==null?void 0:s.toJSON());t.domains=i}};c([h({json:{write:!0}})],oo.prototype,"id",void 0),c([h({json:{write:!0}})],oo.prototype,"name",void 0),c([h({json:{write:!0}})],oo.prototype,"domains",void 0),c([Q("domains")],oo.prototype,"readDomains",null),c([ie("domains")],oo.prototype,"writeDomains",null),c([h({type:[qT],json:{write:!0}})],oo.prototype,"templates",void 0),oo=c([S("esri.layers.support.FeatureType")],oo);const z4=oo;function Mne(e){return e.type==="date"||e.type==="esriFieldTypeDate"}function wP(e){return e.type==="oid"||e.type==="esriFieldTypeOID"}function xP(e){return e.type==="global-id"||e.type==="esriFieldTypeGlobalID"}class $ne{constructor(t=[]){if(this.fields=[],this._fieldsMap=new Map,this._normalizedFieldsMap=new Map,this._dateFieldsSet=new Set,this._numericFieldsSet=new Set,this.dateFields=[],this.numericFields=[],this._requiredFields=null,!t)return;this.fields=t;const i=[];for(const s of t){const r=s&&s.name;if(r){const n=SP(r),o=MP(r);this._fieldsMap.set(r,s),this._fieldsMap.set(n,s),this._normalizedFieldsMap.set(o,s),i.push(n),Mne(s)?(this.dateFields.push(s),this._dateFieldsSet.add(s)):Y$(s)&&(this._numericFieldsSet.add(s),this.numericFields.push(s)),wP(s)||xP(s)||(s.editable=s.editable==null||!!s.editable,s.nullable=s.nullable==null||!!s.nullable)}}i.sort(),this.uid=i.join(",")}destroy(){this._fieldsMap.clear()}get requiredFields(){if(!this._requiredFields){this._requiredFields=[];for(const t of this.fields)wP(t)||xP(t)||t.nullable||DX(t)!==void 0||this._requiredFields.push(t)}return this._requiredFields}has(t){return this.get(t)!=null}get(t){var s;if(!t)return;let i=this._fieldsMap.get(t);return i||(i=(s=this._fieldsMap.get(SP(t)))!=null?s:this._normalizedFieldsMap.get(MP(t)),i&&this._fieldsMap.set(t,i),i)}isDateField(t){return this._dateFieldsSet.has(this.get(t))}isNumericField(t){return this._numericFieldsSet.has(this.get(t))}normalizeFieldName(t){var s;const i=this.get(t);if(i)return(s=i.name)!=null?s:void 0}}function SP(e){return e.trim().toLowerCase()}function MP(e){return EX(e).toLowerCase()}function Tne(){return{fields:{type:[_T],value:null},fieldsIndex:{readOnly:!0,get(){return new $ne(this.fields||[])}},outFields:{type:[String],json:{read:!1},set:function(e){this._userOutFields=e,this.notifyChange("outFields")},get:function(){var t;const e=this._userOutFields;if(!e||!e.length)return null;if(e.includes("*"))return["*"];if(!this.fields)return e;for(const i of e)((t=this.fieldsIndex)==null?void 0:t.has(i))||q.getLogger("esri.layers.support.fieldProperties").error("field-attributes-layer:invalid-field",`Invalid field ${i} found in outFields`,{layer:this,outFields:e});return OD(this.fieldsIndex,e)}}}}const $w=q.getLogger("esri.layers.support.labelingInfo"),Ine=/\[([^\[\]]+)\]/gi;function $P(e,t,i){return e?e.map(s=>{const r=new Kb;if(r.read(s,i),r.labelExpression){const n=t.fields||t.layerDefinition&&t.layerDefinition.fields||this.fields;r.labelExpression=r.labelExpression.replace(Ine,(o,a)=>`[${Ene(a,n)}]`)}return r}):null}function Ene(e,t){if(!t)return e;const i=e.toLowerCase();for(let s=0;sCne(s,t))?[]:i}function Cne(e,t){const i=e.labelPlacement,s=kne[t];if(!e.symbol)return $w.warn("No ILabelClass symbol specified."),!0;if(!s)return $w.error(new L("labeling:unsupported-geometry-type",`Unable to create labels for layer, geometry type '${t}' is not supported`)),!0;if(!s.includes(i)){const r=s[0];i&&$w.warn(`Found invalid label placement type ${i} for ${t}. Defaulting to ${r}`),e.labelPlacement=r}return!1}const Mr=[];function Pne(e,t){var s,r;if(g4((s=e.url)!=null?s:""))return!0;const{wkid:i}=t;for(const n of Mr){if(((r=e.version)!=null?r:0)>=n[0])return!0;if(typeof n[1]=="function"&&(n[1]=n[1]()),n[1].has(i))return!1}return!0}Mr.push([10.91,()=>{const e=new Set([9709,9716,9741,9761,9766]);for(let t=9712;t<=9713;t++)e.add(t);for(let t=9748;t<=9749;t++)e.add(t);for(let t=20904;t<=20932;t++)e.add(t);for(let t=21004;t<=21032;t++)e.add(t);for(let t=21207;t<=21264;t++)e.add(t);for(let t=21307;t<=21364;t++)e.add(t);for(let t=102759;t<=102760;t++)e.add(t);for(let t=102901;t<=102955;t++)e.add(t);return e}]),Mr.push([10.9,()=>{const e=new Set([9300,9354,9364,9367,9373,9377,9387,9456,9473,9498,9678,9680,29874,103599,103872,104028]);for(let t=9356;t<=9360;t++)e.add(t);for(let t=9404;t<=9407;t++)e.add(t);for(let t=9476;t<=9482;t++)e.add(t);for(let t=9487;t<=9494;t++)e.add(t);for(let t=9697;t<=9699;t++)e.add(t);return e}]),Mr.push([10.81,()=>{const e=new Set([9265,9333,103598,103699]);for(let t=9248;t<=9254;t++)e.add(t);for(let t=9271;t<=9273;t++)e.add(t);for(let t=9284;t<=9285;t++)e.add(t);for(let t=21453;t<=21463;t++)e.add(t);return e}]),Mr.push([10.8,()=>{const e=new Set([8088,8395,8428,8433,8531,8687,8692,8694,8699,8900,9003,9006,9009,9012,9017,9191]);for(let t=8035;t<=8036;t++)e.add(t);for(let t=8455;t<=8456;t++)e.add(t);for(let t=8518;t<=8529;t++)e.add(t);for(let t=8533;t<=8536;t++)e.add(t);for(let t=8538;t<=8540;t++)e.add(t);for(let t=8677;t<=8679;t++)e.add(t);for(let t=8902;t<=8903;t++)e.add(t);for(let t=8907;t<=8910;t++)e.add(t);for(let t=8949;t<=8951;t++)e.add(t);for(let t=8972;t<=8987;t++)e.add(t);for(let t=9039;t<=9040;t++)e.add(t);for(let t=9068;t<=9069;t++)e.add(t);for(let t=9140;t<=9141;t++)e.add(t);for(let t=9148;t<=9150;t++)e.add(t);for(let t=9153;t<=9159;t++)e.add(t);for(let t=9205;t<=9218;t++)e.add(t);for(let t=9221;t<=9222;t++)e.add(t);for(let t=54098;t<=54101;t++)e.add(t);return e}]),Mr.push([10.71,()=>{const e=new Set([6316]);for(let t=8351;t<=8353;t++)e.add(t);for(let t=9294;t<=9297;t++)e.add(t);for(let t=103586;t<=103594;t++)e.add(t);for(let t=103696;t<=103698;t++)e.add(t);return e}]),Mr.push([10.7,()=>{const e=new Set([8387,8391,8427,8545,8682,8685,8818,31370,104022,104024,104975]);for(let t=8065;t<=8068;t++)e.add(t);for(let t=8082;t<=8083;t++)e.add(t);for(let t=8379;t<=8385;t++)e.add(t);for(let t=8836;t<=8840;t++)e.add(t);for(let t=8857;t<=8860;t++)e.add(t);for(let t=53035;t<=53037;t++)e.add(t);for(let t=54090;t<=54091;t++)e.add(t);for(let t=102498;t<=102499;t++)e.add(t);return e}]),Mr.push([10.61,()=>new Set([102497])]),Mr.push([10.6,()=>{const e=new Set([7803,7805,7887,8086,8232,8237,8240,8246,8249,8252,8255,9019,9391]);for(let t=7755;t<=7787;t++)e.add(t);for(let t=7791;t<=7795;t++)e.add(t);for(let t=7799;t<=7801;t++)e.add(t);for(let t=7825;t<=7831;t++)e.add(t);for(let t=7877;t<=7878;t++)e.add(t);for(let t=7882;t<=7883;t++)e.add(t);for(let t=7991;t<=7992;t++)e.add(t);for(let t=8042;t<=8043;t++)e.add(t);for(let t=8058;t<=8059;t++)e.add(t);for(let t=8311;t<=8348;t++)e.add(t);for(let t=9060;t<=9067;t++)e.add(t);for(let t=102562;t<=102568;t++)e.add(t);for(let t=102799;t<=102900;t++)e.add(t);return e}]),Mr.push([10.51,()=>{const e=new Set([7683,7881,7886,7899,8888,9e3]);for(let t=8013;t<=8032;t++)e.add(t);for(let t=9053;t<=9057;t++)e.add(t);for(let t=104017;t<=104018;t++)e.add(t);for(let t=104971;t<=104974;t++)e.add(t);return e}]),Mr.push([10.5,()=>{const e=new Set([6962,7035,7037,7039,7041,7084,7086,7133,7798,102399]);for(let t=4087;t<=4088;t++)e.add(t);for(let t=5896;t<=5899;t++)e.add(t);for(let t=7005;t<=7007;t++)e.add(t);for(let t=7057;t<=7070;t++)e.add(t);for(let t=7073;t<=7082;t++)e.add(t);for(let t=7109;t<=7128;t++)e.add(t);for(let t=7844;t<=7859;t++)e.add(t);return e}]);async function Ane(e,t,i){const s=e&&e.getAtOrigin&&e.getAtOrigin("renderer",t.origin);if(s&&s.type==="unique-value"&&s.styleOrigin){const r=await xb(s.populateFromStyle());if(Ft(i),r.ok===!1){const n=r.error;t&&t.messages&&t.messages.push(new Bi("renderer:style-reference",`Failed to create unique value renderer from style reference: ${n.message}`,{error:n,context:t})),e.clear("renderer",t==null?void 0:t.origin)}}}const One=["oid","global-id"],Rne=["oid","global-id","guid"];function Lne({displayField:e,editFieldsInfo:t,fields:i,objectIdField:s,title:r},n){if(!i)return null;const o=zne({editFieldsInfo:t,fields:i,objectIdField:s},n);if(!o.length)return null;const a=qne({titleBase:r,fields:i,displayField:e}),l=Une();return new Dm({title:a,content:l,fieldInfos:o})}const Fne=[/^fnode_$/i,/^tnode_$/i,/^lpoly_$/i,/^rpoly_$/i,/^poly_$/i,/^subclass$/i,/^subclass_$/i,/^rings_ok$/i,/^rings_nok$/i,/shape/i,/perimeter/i,/objectid/i,/_i$/i],Dne=(e,{editFieldsInfo:t,objectIdField:i,visibleFieldNames:s})=>s?s.has(e.name):!B4(e.name,t)&&(!i||e.name!==i)&&!One.includes(e.type)&&!Fne.some(r=>r.test(e.name));function Nne(e,t){const i=e;return t&&(e=e.filter(s=>!t.includes(s.type))),e===i&&(e=e.slice()),e.sort(jne),e}function jne(e,t){return e.type==="oid"?-1:t.type==="oid"?1:TP(e)?-1:TP(t)?1:(e.alias||e.name).toLocaleLowerCase().localeCompare((t.alias||t.name).toLocaleLowerCase())}function B4(e,t){if(!e||!t)return!1;const{creationDateField:i,creatorField:s,editDateField:r,editorField:n}=t;return[i&&i.toLowerCase(),s&&s.toLowerCase(),r&&r.toLowerCase(),n&&n.toLowerCase()].includes(e.toLowerCase())}function Vne(e,t){return e.editable&&!Rne.includes(e.type)&&!B4(e.name,t)}function zne({editFieldsInfo:e,fields:t,objectIdField:i},s){return Nne(t!=null?t:[],(s==null?void 0:s.ignoreFieldTypes)||Gne).map(r=>new Fm({fieldName:r.name,isEditable:Vne(r,e),label:r.alias,format:Bne(r),visible:Dne(r,{editFieldsInfo:e,objectIdField:i,visibleFieldNames:s==null?void 0:s.visibleFieldNames})}))}function Bne(e){switch(e.type){case"small-integer":case"integer":case"single":return new fh({digitSeparator:!0,places:0});case"double":return new fh({digitSeparator:!0,places:2});case"date":return new fh({dateFormat:"long-month-day-year"});default:return e.type==="string"&&jD(e.name)?new fh({digitSeparator:!0,places:0}):null}}function Une(){return[new Hh,new Zf]}function qne(e){const t=PX(e),{titleBase:i}=e;return t?`${i}: {${t.trim()}}`:i!=null?i:""}function TP(e){return(e.name&&e.name.toLowerCase())==="name"?!0:(e.alias&&e.alias.toLowerCase())==="name"}const Gne=["geometry","blob","raster","guid","xml"],Oi="FeatureLayer",U4="esri.layers.FeatureLayer",Wne=q.getLogger(U4);function Vy(e,t){return new L("layer:unsupported",`Layer (${e.title}, ${e.id}) of type '${e.declaredClass}' ${t}`,{layer:e})}function IP(e){return e&&e instanceof he}const Tw=Tne();function Iw(e,t,i){const s=!!(i!=null&&i.writeLayerSchema);return{enabled:s,ignoreOrigin:s}}let ae=class extends Sre(lne(Nse(gne(Lse(CD(pne(Sne(PD(wne(Ase(une(fne(l4(Ose(Mse(xt(Yf))))))))))))))))){constructor(...e){super(...e),this._handles=new qi,this.charts=null,this.copyright=null,this.displayField=null,this.dynamicDataSource=null,this.fields=null,this.fieldsIndex=null,this.formTemplate=null,this.fullExtent=null,this.geometryType=null,this.hasM=void 0,this.hasZ=void 0,this.infoFor3D=null,this.isTable=!1,this.labelsVisible=!0,this.labelingInfo=null,this.legendEnabled=!0,this.objectIdField=null,this.outFields=null,this.path=null,this.popupEnabled=!0,this.popupTemplate=null,this.screenSizePerspectiveEnabled=!0,this.spatialReference=xe.WGS84,this.subtypeCode=null,this.templates=null,this.timeInfo=null,this.title=null,this.sublayerTitleMode="item-title",this.type="feature",this.typeIdField=null,this.types=null,this.visible=!0}destroy(){var e;(e=this.source)==null||e.destroy(),this._handles=$t(this._handles)}normalizeCtorArgs(e,t){return typeof e=="string"?{url:e,...t}:e}load(e){var s;const t=M(e)?e.signal:null;if(((s=this.portalItem)==null?void 0:s.loaded)&&this.source)return this.addResolvingPromise(this.createGraphicsSource(t).then(r=>this.initLayerProperties(r))),Promise.resolve(this);const i=this.loadFromPortal({supportedTypes:["Feature Service","Feature Collection"]},e).catch(Em).then(async()=>{if(this.url&&this.layerId==null&&/FeatureServer|MapServer\/*$/i.test(this.url)){const r=await this._fetchFirstLayerId(t);r!=null&&(this.layerId=r)}if(!this.url&&!this._hasMemorySource())throw new L("feature-layer:missing-url-or-source","Feature layer must be created with either a url or a source");return this.initLayerProperties(await this.createGraphicsSource(t))}).then(()=>this.finishLoadEditablePortalLayer(e));return this.addResolvingPromise(i),Promise.resolve(this)}readCapabilities(e,t){return t=t.layerDefinition||t,x4(e,t,this.url)}get createQueryVersion(){var e;return this.commitProperty("definitionExpression"),this.commitProperty("dynamicDataSource"),this.commitProperty("timeExtent"),this.commitProperty("timeOffset"),this.commitProperty("geometryType"),this.commitProperty("gdbVersion"),this.commitProperty("historicMoment"),this.commitProperty("returnZ"),this.commitProperty("capabilities"),this.commitProperty("returnM"),((e=this._get("createQueryVersion"))!=null?e:0)+1}get editingEnabled(){var e;return!(this.loaded&&!((e=this.capabilities)!=null&&e.operations.supportsEditing))&&(this._isOverridden("editingEnabled")?this._get("editingEnabled"):this._hasMemorySource()||this.userHasEditingPrivileges)}set editingEnabled(e){this._overrideIfSome("editingEnabled",e)}readEditingEnabled(e,t){return this._readEditingEnabled(t,!1)}readEditingEnabledFromWebMap(e,t,i){return this._readEditingEnabled(t,!0,i)}writeEditingEnabled(e,t){this._writeEditingEnabled(e,t,!1)}writeEditingEnabledToWebMap(e,t,i,s){this._writeEditingEnabled(e,t,!0,s)}readIsTable(e,t){var i;return(t=(i=t==null?void 0:t.layerDefinition)!=null?i:t).type==="Table"||!t.geometryType}writeIsTable(e,t,i,s){s!=null&&s.writeLayerSchema&&Ei(i,e?"Table":"Feature Layer",t)}readGlobalIdField(e,t){return S4(t.layerDefinition||t)}readObjectIdField(e,t){return M4(t.layerDefinition||t)}get parsedUrl(){const e=Ai(this.url);return e!=null&&(this.dynamicDataSource!=null?e.path=Xc(e.path,"dynamicLayer"):this.layerId!=null&&(e.path=Xc(e.path,this.layerId.toString()))),e}get defaultPopupTemplate(){return this.createPopupTemplate()}set renderer(e){Ik(e,this.fieldsIndex),this._set("renderer",e)}readRenderer(e,t,i){var r,n;const s=(r=(t=t.layerDefinition||t).drawingInfo)==null?void 0:r.renderer;if(s){const o=(n=cm(s,t,i))!=null?n:void 0;return o||Wne.error("Failed to create renderer",{rendererDefinition:t.drawingInfo.renderer,layer:this,context:i}),o}if(t.defaultSymbol)return t.types&&t.types.length?new Gm({defaultSymbol:Ew(t.defaultSymbol,t,i),field:t.typeIdField,uniqueValueInfos:t.types.map(o=>({id:o.id,symbol:Ew(o.symbol,o,i)}))}):new Xh({symbol:Ew(t.defaultSymbol,t,i)})}set source(e){const t=this._get("source");t!==e&&(IP(t)&&this._resetMemorySource(t),IP(e)&&this._initMemorySource(e),this._set("source",e))}castSource(e){return e?Array.isArray(e)||e instanceof he?new mo({layer:this,items:e}):e:null}readSource(e,t){var s;const i=Wb.fromJSON(t.featureSet);return new mo({layer:this,items:(s=i==null?void 0:i.features)!=null?s:[]})}readTemplates(e,t){const i=t.editFieldsInfo,s=i&&i.creatorField,r=i&&i.editorField;return e=e&&e.map(n=>qT.fromJSON(n)),this._fixTemplates(e,s),this._fixTemplates(e,r),e}readTitle(e,t){var r,n;const i=(n=(r=t.layerDefinition)==null?void 0:r.name)!=null?n:t.name,s=t.title||t.layerDefinition&&t.layerDefinition.title;if(i){const o=this.portalItem&&this.portalItem.title;if(this.sublayerTitleMode==="item-title")return this.url?Ese(this.url,i):i;let a=i;if(!a&&this.url){const l=Md(this.url);M(l)&&(a=l.title)}return a?(this.sublayerTitleMode==="item-title-and-service-name"&&o&&o!==a&&(a=o+" - "+a),FT(a)):void 0}if(this.sublayerTitleMode==="item-title"&&s)return s}readTitleFromWebMap(e,t){return t.title||t.layerDefinition&&t.layerDefinition.name}readTypeIdField(e,t){let i=(t=t.layerDefinition||t).typeIdField;if(i&&t.fields){i=i.toLowerCase();const s=t.fields.find(r=>r.name.toLowerCase()===i);s&&(i=s.name)}return i}readTypes(e,t){e=(t=t.layerDefinition||t).types;const i=t.editFieldsInfo,s=i&&i.creatorField,r=i&&i.editorField;return e&&e.map(n=>(n=z4.fromJSON(n),this._fixTemplates(n.templates,s),this._fixTemplates(n.templates,r),n))}readVisible(e,t){return t.layerDefinition&&t.layerDefinition.defaultVisibility!=null?!!t.layerDefinition.defaultVisibility:t.visibility!=null?!!t.visibility:void 0}async addAttachment(e,t){return are(this,e,t,Oi)}async updateAttachment(e,t,i){return lre(this,e,t,i,Oi)}async applyEdits(e,t){return cre(this,e,t)}on(e,t){return super.on(e,t)}createPopupTemplate(e){return Lne(this,e)}async createGraphicsSource(e){if(this._hasMemorySource()&&this.source)return this.source.load({signal:e});const{default:t}=await fz(z(()=>import("./FeatureLayerSource.98dc2955.js"),["assets/FeatureLayerSource.98dc2955.js","assets/clientSideDefaults.d40b9315.js","assets/QueryEngineCapabilities.78217f95.js","assets/executeForIds.9f78e2a6.js"]),e);return new t({layer:this}).load({signal:e})}createQuery(){const e=bre(this);e.dynamicDataSource=this.dynamicDataSource;const t=M(this.subtypeCode)?`${this.subtypeField} = ${this.subtypeCode}`:null,i=ase(this.definitionExpression,t);return e.where=i||"1=1",e}async deleteAttachments(e,t){return ure(this,e,t,Oi)}async fetchRecomputedExtents(e){return hre(this,e,Oi)}getFeatureType(e){const{typeIdField:t,types:i}=this;if(!t||!e)return null;const s=e.attributes?e.attributes[t]:void 0;if(s==null)return null;let r=null;return i==null||i.some(n=>{const{id:o}=n;return o!=null&&(o.toString()===s.toString()&&(r=n),!!r)}),r}getFieldDomain(e,t){const i=t&&t.feature,s=this.getFeatureType(i);if(s){const r=s.domains&&s.domains[e];if(r&&r.type!=="inherited")return r}return this._getLayerDomain(e)}getField(e){return this.fieldsIndex.get(e)}async queryAttachments(e,t){return dre(this,e,t,Oi)}async queryFeatures(e,t){var r;const i=await this.load(),s=await i.source.queryFeatures((r=$n.from(e))!=null?r:i.createQuery(),t);if(s!=null&&s.features)for(const n of s.features)n.layer=n.sourceLayer=i;return s}async queryObjectIds(e,t){return pre(this,e,t,Oi)}async queryFeatureCount(e,t){return fre(this,e,t,Oi)}async queryExtent(e,t){return mre(this,e,t,Oi)}async queryRelatedFeatures(e,t){return yre(this,e,t,Oi)}async queryRelatedFeaturesCount(e,t){return gre(this,e,t,Oi)}async queryTopFeatures(e,t){var n;const{source:i,capabilities:s}=await this.load();if(!i.queryTopFeatures||!((n=s==null?void 0:s.query)!=null&&n.supportsTopFeaturesQuery))throw new L(Oi,"Layer source does not support queryTopFeatures capability");const r=await i.queryTopFeatures(ky.from(e),t);if(r!=null&&r.features)for(const o of r.features)o.layer=o.sourceLayer=this;return r}async queryTopObjectIds(e,t){const{source:i,capabilities:s}=await this.load();if(!i.queryTopObjectIds||!(s!=null&&s.query.supportsTopFeaturesQuery))throw new L(Oi,"Layer source does not support queryTopObjectIds capability");return i.queryTopObjectIds(ky.from(e),t)}async queryTopFeaturesExtent(e,t){var r;const{source:i,capabilities:s}=await this.load();if(!i.queryTopExtents||!((r=s==null?void 0:s.query)!=null&&r.supportsTopFeaturesQuery))throw new L(Oi,"Layer source does not support queryTopExtents capability");return i.queryTopExtents(ky.from(e),t)}async queryTopFeatureCount(e,t){var r;const{source:i,capabilities:s}=await this.load();if(!i.queryTopCount||!((r=s==null?void 0:s.query)!=null&&r.supportsTopFeaturesQuery))throw new L(Oi,"Layer source does not support queryFeatureCount capability");return i.queryTopCount(ky.from(e),t)}read(e,t){const i=e.featureCollection;if(i){const s=i.layers;s&&s.length===1&&(super.read(s[0],t),i.showLegend!=null&&super.read({showLegend:i.showLegend},t))}super.read(e,t),t&&t.origin==="service"&&this.revert(["objectIdField","fields","timeInfo","spatialReference"],"service")}write(e,t){var n,o;t={...t,origin:(n=t==null?void 0:t.origin)!=null?n:void 0,writeLayerSchema:(o=t==null?void 0:t.writeLayerSchema)!=null?o:this._hasMemorySource()};const{origin:i,layerContainerType:s,messages:r}=t;if(this.dynamicDataSource)return r==null||r.push(Vy(this,"using a dynamic data source cannot be written to web scenes, web maps and feature service items")),null;if(this.isTable){if(i==="web-scene"||i==="web-map"&&s!=="tables")return r==null||r.push(Vy(this,"using a table source cannot be written to web scenes and web maps")),null;if(this._hasMemorySource())return r==null||r.push(Vy(this,"using an in-memory table source cannot be written to web scenes and web maps")),null}else if(this.loaded&&i==="web-map"&&s==="tables")return r==null||r.push(Vy(this,"using a non-table source cannot be written to tables in web maps")),null;return super.write(e,t)}clone(){if(this._hasMemorySource())throw new L(Oi,`FeatureLayer (title: ${this.title}, id: ${this.id}) created using in-memory source cannot be cloned`);return super.clone()}serviceSupportsSpatialReference(e){var t;return!!this.loaded&&(((t=this.source)==null?void 0:t.type)==="memory"||Pne(this,e))}async save(e){return(await z(()=>import("./featureLayerUtils.878164f5.js"),["assets/featureLayerUtils.878164f5.js","assets/originUtils.2d0aad75.js","assets/multiOriginJSONSupportUtils.38b69b9c.js","assets/fetchService.88193309.js","assets/jsonContext.fe51f9bd.js","assets/portalItemUtils.92eef7f6.js"])).save(this,e)}async saveAs(e,t){return(await z(()=>import("./featureLayerUtils.878164f5.js"),["assets/featureLayerUtils.878164f5.js","assets/originUtils.2d0aad75.js","assets/multiOriginJSONSupportUtils.38b69b9c.js","assets/fetchService.88193309.js","assets/jsonContext.fe51f9bd.js","assets/portalItemUtils.92eef7f6.js"])).saveAs(this,e,t)}_readEditingEnabled(e,t,i){var r;let s=(r=e.layerDefinition)==null?void 0:r.capabilities;return s?this._hasEditingCapability(s):(s=e.capabilities,t&&(i==null?void 0:i.origin)==="web-map"&&!this._hasMemorySource()&&s?this._hasEditingCapability(s):void 0)}_hasEditingCapability(e){return e.toLowerCase().split(",").map(t=>t.trim()).includes("editing")}_writeEditingEnabled(e,t,i,s){var r,n;if(!e){const o=(n=(r=this.capabilities)==null?void 0:r.operations)!=null&&n.supportsSync?"Query,Sync":"Query";Ei("layerDefinition.capabilities",o,t),i&&!(s!=null&&s.writeLayerSchema)&&(t.capabilities=o)}}_getLayerDomain(e){const t=this.fieldsIndex.get(e);return t?t.domain:null}_fetchFirstLayerId(e){return kt(this.url,{query:{f:"json",...this.customParameters,token:this.apiKey},responseType:"json",signal:e}).then(t=>{const i=t.data;if(i)return Array.isArray(i.layers)&&i.layers.length>0?i.layers[0].id:Array.isArray(i.tables)&&i.tables.length>0?i.tables[0].id:void 0})}async initLayerProperties(e){return this._set("source",e),e.sourceJSON&&(this.sourceJSON=e.sourceJSON,this.read(e.sourceJSON,{origin:"service",url:this.parsedUrl})),this._verifySource(),this._verifyFields(),Ik(this.renderer,this.fieldsIndex),AD(this.timeInfo,this.fieldsIndex),Ane(this,{origin:"service"})}async hasDataChanged(){return vre(this)}async fetchPublishingStatus(){const e=this.source;return e!=null&&e.fetchPublishingStatus?e.fetchPublishingStatus():"unavailable"}_verifyFields(){var t,i,s;const e=(i=(t=this.parsedUrl)==null?void 0:t.path)!=null?i:"undefined";this.objectIdField||console.log("FeatureLayer: 'objectIdField' property is not defined (url: "+e+")"),this.isTable||this._hasMemorySource()||e.search(/\/FeatureServer\//i)!==-1||((s=this.fields)==null?void 0:s.some(r=>r.type==="geometry"))||console.log("FeatureLayer: unable to find field of type 'geometry' in the layer 'fields' list. If you are using a map service layer, features will not have geometry (url: "+e+")")}_fixTemplates(e,t){e&&e.forEach(i=>{const s=i.prototype&&i.prototype.attributes;s&&t&&delete s[t]})}_verifySource(){if(this._hasMemorySource()){if(this.url)throw new L("feature-layer:mixed-source-and-url","FeatureLayer cannot be created with both an in-memory source and a url")}else if(!this.url)throw new L("feature-layer:source-or-url-required","FeatureLayer requires either a url, a valid portal item or a source")}_initMemorySource(e){e.forEach(t=>{t.layer=this,t.sourceLayer=this}),this._handles.add([e.on("after-add",t=>{t.item.layer=this,t.item.sourceLayer=this}),e.on("after-remove",t=>{t.item.layer=null,t.item.sourceLayer=null})],"fl-source")}_resetMemorySource(e){e.forEach(t=>{t.layer=null,t.sourceLayer=null}),this._handles.remove("fl-source")}_hasMemorySource(){return!(this.url||!this.source)}};c([Q("service","capabilities")],ae.prototype,"readCapabilities",null),c([h({json:{origins:{"portal-item":{write:!0},"web-map":{write:!0}}}})],ae.prototype,"charts",void 0),c([h({readOnly:!0})],ae.prototype,"createQueryVersion",null),c([h({json:{read:{source:"layerDefinition.copyrightText"}}})],ae.prototype,"copyright",void 0),c([h({json:{read:{source:"layerDefinition.displayField"}}})],ae.prototype,"displayField",void 0),c([h({types:Uc,readOnly:!0})],ae.prototype,"defaultSymbol",void 0),c([h({type:Er})],ae.prototype,"dynamicDataSource",void 0),c([h({type:Boolean})],ae.prototype,"editingEnabled",null),c([Q(["portal-item","web-scene"],"editingEnabled",["layerDefinition.capabilities"])],ae.prototype,"readEditingEnabled",null),c([Q("web-map","editingEnabled",["capabilities","layerDefinition.capabilities"])],ae.prototype,"readEditingEnabledFromWebMap",null),c([ie(["portal-item","web-scene"],"editingEnabled",{"layerDefinition.capabilities":{type:String}})],ae.prototype,"writeEditingEnabled",null),c([ie("web-map","editingEnabled",{capabilities:{type:String},"layerDefinition.capabilities":{type:String}})],ae.prototype,"writeEditingEnabledToWebMap",null),c([h({...Tw.fields,json:{read:{source:"layerDefinition.fields"},origins:{service:{name:"fields"},"web-map":{write:{target:"layerDefinition.fields",overridePolicy:Iw}}}}})],ae.prototype,"fields",void 0),c([h(Tw.fieldsIndex)],ae.prototype,"fieldsIndex",void 0),c([h({type:bse,json:{name:"formInfo",write:!0,origins:{"web-scene":{read:!1,write:!1}}}})],ae.prototype,"formTemplate",void 0),c([h({json:{read:{source:"layerDefinition.extent"}}})],ae.prototype,"fullExtent",void 0),c([h({json:{origins:{"web-map":{write:{target:"layerDefinition.geometryType",overridePolicy:Iw,writer(e,t,i){const s=e?V2.toJSON(e):null;s&&Ei(i,s,t)}}}},read:{source:"layerDefinition.geometryType",reader:V2.read}}})],ae.prototype,"geometryType",void 0),c([h({json:{read:{source:"layerDefinition.hasM"}}})],ae.prototype,"hasM",void 0),c([h({json:{read:{source:"layerDefinition.hasZ"}}})],ae.prototype,"hasZ",void 0),c([h(Hse)],ae.prototype,"id",void 0),c([h({readOnly:!0,json:{origins:{service:{read:!0}},read:!1}})],ae.prototype,"infoFor3D",void 0),c([h({json:{origins:{"web-map":{write:{target:"layerDefinition.type"}}}}})],ae.prototype,"isTable",void 0),c([Q("service","isTable",["type","geometryType"]),Q("isTable",["layerDefinition.type","layerDefinition.geometryType"])],ae.prototype,"readIsTable",null),c([ie("web-map","isTable")],ae.prototype,"writeIsTable",null),c([h(NT)],ae.prototype,"labelsVisible",void 0),c([h({type:[Kb],json:{origins:{service:{read:{source:"drawingInfo.labelingInfo",reader:$P},write:{target:"drawingInfo.labelingInfo",enabled:!1}}},read:{source:"layerDefinition.drawingInfo.labelingInfo",reader:$P},write:{target:"layerDefinition.drawingInfo.labelingInfo"}}})],ae.prototype,"labelingInfo",void 0),c([h((()=>{const e=R(Wse);return e.json.origins["portal-item"]={write:{target:"layerDefinition.drawingInfo.transparency",writer(t,i,s){Ei(s,Rb(t),i)}}},e})())],ae.prototype,"opacity",void 0),c([h(qse)],ae.prototype,"legendEnabled",void 0),c([h({type:["show","hide"],json:(()=>{const e=R(w4.json);return e.origins["portal-item"]={read:!1,write:!1},e})()})],ae.prototype,"listMode",void 0),c([Q("globalIdField",["layerDefinition.globalIdField","layerDefinition.fields"])],ae.prototype,"readGlobalIdField",null),c([h({json:{origins:{"web-map":{write:{target:"layerDefinition.objectIdField",overridePolicy:Iw}}}}})],ae.prototype,"objectIdField",void 0),c([Q("objectIdField",["layerDefinition.objectIdField","layerDefinition.fields"])],ae.prototype,"readObjectIdField",null),c([h({value:"ArcGISFeatureLayer",type:["ArcGISFeatureLayer"]})],ae.prototype,"operationalLayerType",void 0),c([h(Tw.outFields)],ae.prototype,"outFields",void 0),c([h({readOnly:!0})],ae.prototype,"parsedUrl",null),c([h({type:String,json:{origins:{"web-scene":{read:!0,write:!0}},read:!1}})],ae.prototype,"path",void 0),c([h(DT)],ae.prototype,"popupEnabled",void 0),c([h({type:Dm,json:{name:"popupInfo",write:!0}})],ae.prototype,"popupTemplate",void 0),c([h({readOnly:!0})],ae.prototype,"defaultPopupTemplate",null),c([h({types:Zb,json:{origins:{service:{write:{target:"drawingInfo.renderer",enabled:!1}},"web-scene":{types:sse,name:"layerDefinition.drawingInfo.renderer",write:{overridePolicy:(e,t,i)=>({ignoreOrigin:i==null?void 0:i.writeLayerSchema})}}},write:{target:"layerDefinition.drawingInfo.renderer",overridePolicy:(e,t,i)=>({ignoreOrigin:i==null?void 0:i.writeLayerSchema})}}})],ae.prototype,"renderer",null),c([Q("service","renderer",["drawingInfo.renderer","defaultSymbol"]),Q("renderer",["layerDefinition.drawingInfo.renderer","layerDefinition.defaultSymbol"])],ae.prototype,"readRenderer",null),c([h((()=>{const e=R(Bse);return e.json.origins["portal-item"]={read:!1,write:!1},e})())],ae.prototype,"screenSizePerspectiveEnabled",void 0),c([h({clonable:!1})],ae.prototype,"source",null),c([Oe("source")],ae.prototype,"castSource",null),c([Q("portal-item","source",["featureSet"]),Q("web-map","source",["featureSet"])],ae.prototype,"readSource",null),c([h({json:{read:{source:"layerDefinition.extent.spatialReference"}}})],ae.prototype,"spatialReference",void 0),c([h({type:Number})],ae.prototype,"subtypeCode",void 0),c([h({type:[qT]})],ae.prototype,"templates",void 0),c([Q("templates",["editFieldsInfo","creatorField","editorField","templates"])],ae.prototype,"readTemplates",null),c([h({type:V4})],ae.prototype,"timeInfo",void 0),c([h()],ae.prototype,"title",void 0),c([Q("service","title",["name"]),Q("portal-item","title",["layerDefinition.title","layerDefinition.name","title"])],ae.prototype,"readTitle",null),c([Q("web-map","title",["layerDefinition.name","title"])],ae.prototype,"readTitleFromWebMap",null),c([h({type:String})],ae.prototype,"sublayerTitleMode",void 0),c([h({json:{read:!1}})],ae.prototype,"type",void 0),c([h({type:String})],ae.prototype,"typeIdField",void 0),c([Q("service","typeIdField"),Q("typeIdField",["layerDefinition.typeIdField"])],ae.prototype,"readTypeIdField",null),c([h({type:[z4]})],ae.prototype,"types",void 0),c([Q("service","types",["types"]),Q("types",["layerDefinition.types"])],ae.prototype,"readTypes",null),c([h({type:Boolean,json:{origins:{"portal-item":{write:{target:"layerDefinition.defaultVisibility"}}}}})],ae.prototype,"visible",void 0),c([Q("portal-item","visible",["visibility","layerDefinition.defaultVisibility"])],ae.prototype,"readVisible",null),ae=c([S(U4)],ae);const Ew=dl({types:zb}),q4=ae;var Q_e=Object.freeze(Object.defineProperty({__proto__:null,default:q4},Symbol.toStringTag,{value:"Module"}));const Hne=["$datastore","$map","$layer","$aggregatedfeatures"],Yne="esri.widgets.Feature.support.arcadeFeatureUtils",Jne=q.getLogger(Yne);function Xne(e){return typeof e=="string"?Um(mT(e)):Array.isArray(e)?Zne(e):(e==null?void 0:e.declaredClass)==="esri.arcade.Dictionary"?Qne(e):e}function Zne(e){return`
    ${e.map(t=>`
  • ${typeof t=="string"?Um(mT(t)):t}
  • `).join("")}
`}function Qne(e){return`${e.keys().map(t=>{const i=e.field(t);return``}).join("")}
${t}${typeof i=="string"?Um(mT(i)):i}
`}function Kne({aggregatedFeatures:e,arcadeUtils:t,featureSetVars:i,context:s,viewInfo:r,map:n,graphic:o,interceptor:a}){i.forEach(l=>{const u=l.toLowerCase(),d={map:n,spatialReference:r.sr,interceptor:a};if(u==="$map"&&(s.vars[u]=t.convertMapToFeatureSetCollection(d)),u==="$layer"&&(s.vars[u]=t.convertFeatureLayerToFeatureSet({layer:o.sourceLayer,spatialReference:r.sr,interceptor:a})),u==="$datastore"&&(s.vars[u]=t.convertServiceUrlToWorkspace({url:o.sourceLayer.url,spatialReference:r.sr,interceptor:a})),u==="$aggregatedfeatures"){const f=o.layer,{fields:m,objectIdField:y,geometryType:g,spatialReference:v,displayField:b}=f,_=new q4({fields:m,objectIdField:y,geometryType:g,spatialReference:v,displayField:b,...f.type==="feature"?{templates:f.templates,typeIdField:f.typeIdField,types:f.types}:null,source:e});s.vars[u]=t.convertFeatureLayerToFeatureSet({layer:_,spatialReference:r.sr,interceptor:a})}})}function G4(){return z(()=>import("./arcadeUtils.09abf965.js").then(function(e){return e.ay}),["assets/arcadeUtils.09abf965.js","assets/number.9e690eda.js"])}function eoe(e){return"createQuery"in e&&"queryFeatures"in e}async function toe({graphic:e,view:t}){const{isAggregate:i,layer:s}=e;if(!i||!s||(t==null?void 0:t.type)!=="2d")return[];const r=await t.whenLayerView(s);if(!eoe(r))return[];const n=r.createQuery();n.aggregateIds=[e.getObjectId()];const{features:o}=await r.queryFeatures(n);return o}async function W4({expressionInfo:e,arcadeUtils:t,interceptor:i,spatialReference:s,map:r,graphic:n,view:o}){if(!e||!e.expression)return null;const a=t.createSyntaxTree(e.expression),l=Hne.filter(y=>t.hasVariable(a,y)),[u]=await Promise.all([toe({graphic:n,view:o}),t.loadScriptDependencies(a,!0,l)]),d=t.getViewInfo({spatialReference:s}),f=t.createExecContext(n,d);f.interceptor=i,f.useAsync=!0,Kne({aggregatedFeatures:u,arcadeUtils:t,featureSetVars:l,context:f,viewInfo:d,map:r,graphic:n,interceptor:i});const m=t.createFunction(a,f);return t.executeAsyncFunction(m,f).catch(y=>Jne.error("arcade-execution-error",{error:y,graphic:n,expressionInfo:e}))}async function ioe({expressionInfos:e,spatialReference:t,graphic:i,interceptor:s,map:r,view:n}){if(!e||!e.length)return{};const o=await G4(),a={};for(const d of e)a[`expression/${d.name}`]=W4({expressionInfo:d,arcadeUtils:o,interceptor:s,spatialReference:t,map:r,graphic:i,view:n});const l=await as(a),u={};for(const d in l)u[d]=Xne(l[d].value);return u}const soe=1;let ys=class extends pu(oe){constructor(e){super(e),this._abortController=null,this.expressionInfo=null,this.graphic=null,this.contentElement=null,this.contentElementViewModel=null,this.interceptor=null,this.view=null,this._cancelQuery=()=>{const{_abortController:t}=this;t&&t.abort(),this._abortController=null},this._createVM=()=>{var s,r;const t=(s=this.contentElement)==null?void 0:s.type;(r=this.contentElementViewModel)==null||r.destroy();const i=t==="fields"?new Ub:t==="media"?new Fc:t==="text"?new $v:null;this._set("contentElementViewModel",i)},this._compile=async()=>{this._cancelQuery();const t=new AbortController;this._abortController=t,await this._compileExpression(),this._abortController===t&&(this._abortController=null)},this._compileThrottled=Ch(this._compile,soe,this),this._compileExpression=async()=>{const{expressionInfo:t,graphic:i,interceptor:s,spatialReference:r,map:n,view:o,_abortController:a}=this;if(!(t&&i&&r&&n))return void this._set("contentElement",null);const l=await G4();if(a!==this._abortController)return;const u=await W4({arcadeUtils:l,expressionInfo:t,graphic:i,interceptor:s,map:n,spatialReference:r,view:o});if(!u||u.declaredClass!=="esri.arcade.Dictionary")return void this._set("contentElement",null);const d=await u.castAsJsonAsync(a.signal),f=d==null?void 0:d.type,m=f==="media"?Kf.fromJSON(d):f==="text"?Yh.fromJSON(d):f==="fields"?Hh.fromJSON(d):null;this._set("contentElement",m)},this.handles.add([Z(()=>[this.expressionInfo,this.graphic,this.map,this.spatialReference,this.view],()=>this._compileThrottled(),Le),Z(()=>[this.contentElement],()=>this._createVM(),Le)])}destroy(){var e;this._cancelQuery(),(e=this.contentElementViewModel)==null||e.destroy(),this._set("contentElementViewModel",null),this._set("contentElement",null)}get spatialReference(){var e,t;return(t=(e=this.view)==null?void 0:e.spatialReference)!=null?t:null}set spatialReference(e){this._override("spatialReference",e)}get state(){const{_abortController:e,contentElement:t,contentElementViewModel:i}=this;return e?"loading":t||i?"ready":"disabled"}get map(){var e,t;return(t=(e=this.view)==null?void 0:e.map)!=null?t:null}set map(e){this._override("map",e)}};c([h()],ys.prototype,"_abortController",void 0),c([h({type:VD})],ys.prototype,"expressionInfo",void 0),c([h({type:Ci})],ys.prototype,"graphic",void 0),c([h({readOnly:!0})],ys.prototype,"contentElement",void 0),c([h({readOnly:!0})],ys.prototype,"contentElementViewModel",void 0),c([h()],ys.prototype,"interceptor",void 0),c([h()],ys.prototype,"spatialReference",null),c([h({readOnly:!0})],ys.prototype,"state",null),c([h()],ys.prototype,"map",null),c([h()],ys.prototype,"view",void 0),ys=c([S("esri.widgets.Feature.FeatureExpression.FeatureExpressionViewModel")],ys);const GT=ys,zy={iconLoading:"esri-icon-loading-indicator esri-rotating",base:"esri-feature-expression",loadingSpinnerContainer:"esri-feature__loading-container",spinner:"esri-feature__loading-spinner"};let c0=class extends yi{constructor(e,t){super(e,t),this.viewModel=new GT}initialize(){this.addHandles(Z(()=>{var e;return(e=this.viewModel)==null?void 0:e.contentElementViewModel},()=>this._setupExpressionWidget(),Le))}destroy(){this._destroyContentWidget()}renderLoading(){return P("div",{key:"loading-container",class:zy.loadingSpinnerContainer},P("span",{class:this.classes(zy.iconLoading,zy.spinner)}))}render(){var t;const{state:e}=this.viewModel;return P("div",{class:zy.base},e==="loading"?this.renderLoading():e==="disabled"?null:(t=this._contentWidget)==null?void 0:t.render())}_destroyContentWidget(){const{_contentWidget:e}=this;e&&(e.viewModel=null,e.destroy()),this._contentWidget=null}_setupExpressionWidget(){const{contentElementViewModel:e,contentElement:t}=this.viewModel,i=t==null?void 0:t.type;this._destroyContentWidget();const s=e?i==="fields"?new ZN({viewModel:e}):i==="media"?new P5({viewModel:e}):i==="text"?new qg({viewModel:e}):null:null;this._contentWidget=s,this.scheduleRender()}};c([h({type:GT})],c0.prototype,"viewModel",void 0),c0=c([S("esri.widgets.Feature.FeatureExpression")],c0);const roe=c0,kw=100;let Xe=class extends xt(Om(pu(oe))){constructor(e){super(e),this._queryAbortController=null,this._queryPageAbortController=null,this._queryFeatureCountAbortController=null,this.featuresPerPage=10,this.description=null,this.graphic=null,this.layer=null,this.map=null,this.orderByFields=null,this.featureCount=0,this.relationshipId=null,this.showAllEnabled=!1,this.title=null,this._cancelQuery=()=>{const{_queryAbortController:t}=this;t&&t.abort(),this._queryAbortController=null},this._cancelQueryFeatureCount=()=>{const{_queryFeatureCountAbortController:t}=this;t&&t.abort(),this._queryFeatureCountAbortController=null},this._cancelQueryPage=()=>{const{_queryPageAbortController:t}=this;t&&t.abort(),this._queryPageAbortController=null},this._queryController=async()=>{this._cancelQuery();const t=new AbortController;this._queryAbortController=t,await wh(this._query()),this._queryAbortController===t&&(this._queryAbortController=null)},this._queryFeatureCountController=async()=>{this._cancelQueryFeatureCount();const t=new AbortController;this._queryFeatureCountAbortController=t,await wh(this._queryFeatureCount()),this._queryFeatureCountAbortController===t&&(this._queryFeatureCountAbortController=null)},this._queryPageController=async()=>{const t=new AbortController;this._queryPageAbortController=t,await wh(this._queryPage()),this._queryPageAbortController===t&&(this._queryPageAbortController=null)},this._queryThrottled=Ch(this._queryController,kw,this),this._queryFeatureCountThrottled=Ch(this._queryFeatureCountController,kw,this),this._queryPageThrottled=Ch(this._queryPageController,kw,this),this._query=async()=>{const{_queryAbortController:t,relatedFeatures:i}=this;this._destroyRelatedFeatureViewModels(),this.featurePage=1,i.removeAll(),i.addMany(this._sliceFeatures(await this._queryRelatedFeatures({signal:t==null?void 0:t.signal})))},this.handles.add([Z(()=>[this.displayCount,this.graphic,this.layer,this.map,this.orderByFieldsFixedCasing,this.relationshipId,this.featuresPerPage,this.showAllEnabled],()=>this._queryThrottled(),Le),Z(()=>[this.featurePage,this.showAllEnabled],()=>this._queryPageThrottled()),Z(()=>[this.layer,this.relationshipId,this.objectId],()=>this._queryFeatureCountThrottled())])}destroy(){this._destroyRelatedFeatureViewModels(),this.relatedFeatures.removeAll(),this._cancelQuery(),this._cancelQueryFeatureCount(),this._cancelQueryPage()}set featurePage(e){const{featuresPerPage:t,featureCount:i}=this,s=1,r=Math.ceil(i/t)||1;this._set("featurePage",Math.min(Math.max(e,s),r))}get featurePage(){return this._get("featurePage")}get orderByFieldsFixedCasing(){const{orderByFields:e,relatedLayer:t}=this;return e&&(t==null?void 0:t.loaded)?e.map(i=>{const s=i.clone(),r=nm(i.field,t);return s.field=r,s}):e}get itemDescriptionFieldName(){var e,t;return((t=(e=this.orderByFieldsFixedCasing)==null?void 0:e[0])==null?void 0:t.field)||null}set displayCount(e){this._set("displayCount",Math.min(Math.max(e,0),10))}get displayCount(){return this._get("displayCount")}get objectId(){var e,t,i;return(i=(t=(e=this.graphic)==null?void 0:e.attributes)==null?void 0:t[this.objectIdField])!=null?i:null}get objectIdField(){var e;return((e=this.layer)==null?void 0:e.objectIdField)||null}get relatedFeatures(){return this._get("relatedFeatures")||new he}get relatedLayer(){const{layer:e,map:t,relationship:i}=this;return e!=null&&e.loaded?SK(t,e,i):null}get relationship(){var i,s;const{relationshipId:e,layer:t}=this;return typeof e=="number"&&(s=(i=t==null?void 0:t.relationships)==null?void 0:i.find(({id:r})=>r===e))!=null?s:null}get relatedFeatureViewModels(){return this._get("relatedFeatureViewModels")||new he}get state(){const{_queryAbortController:e,_queryFeatureCountAbortController:t,_queryPageAbortController:i,graphic:s,relatedLayer:r}=this;return t?"loading":e||i?"querying":s&&r?"ready":"disabled"}_destroyRelatedFeatureViewModels(){var e;(e=this.relatedFeatureViewModels)==null||e.forEach(t=>!t.destroyed&&t.destroy()),this.relatedFeatureViewModels.removeAll()}async _queryFeatureCount(){var u,d,f,m,y;const{layer:e,relatedLayer:t,relationshipId:i,objectId:s,_queryFeatureCountAbortController:r}=this;if(await(e==null?void 0:e.load()),!t||typeof s!="number"||!((d=(u=e==null?void 0:e.capabilities)==null?void 0:u.queryRelated)!=null&&d.supportsCount))return void this._set("featureCount",0);await t.load();const n=t.createQuery(),o=(y=(m=(f=e.capabilities)==null?void 0:f.queryRelated)==null?void 0:m.supportsCacheHint)!=null?y:!1,a=new am({cacheHint:o,relationshipId:i,returnGeometry:!1,objectIds:[s],where:n.where}),l=await e.queryRelatedFeaturesCount(a,{signal:r==null?void 0:r.signal});this._set("featureCount",l[s]||0)}_sliceFeatures(e){const{showAllEnabled:t,displayCount:i}=this;return t?e:i?e.slice(0,i):[]}async _queryPage(){const{relatedFeatures:e,featurePage:t,showAllEnabled:i,_queryPageAbortController:s}=this;!i||t<2||e.addMany(await this._queryRelatedFeatures({signal:s==null?void 0:s.signal}))}async _queryRelatedFeatures(e){var T,k,A,F,G;const{orderByFieldsFixedCasing:t,showAllEnabled:i,featuresPerPage:s,displayCount:r,layer:n,relationshipId:o,featurePage:a,featureCount:l,relatedLayer:u}=this;await(n==null?void 0:n.load());const{relationship:d,objectId:f}=this;if(!d||typeof f!="number"||!((k=(T=n==null?void 0:n.capabilities)==null?void 0:T.queryRelated)!=null&&k.supportsPagination))return[];const m=i?((a-1)*s+l)%l:0,y=i?s:r;if(!u)return[];await u.load();const g=u.objectIdField,v=[...t==null?void 0:t.map(U=>U.field),g],b=t==null?void 0:t.map(U=>`${U.field} ${U.order}`),_=((F=(A=n.capabilities)==null?void 0:A.queryRelated)==null?void 0:F.supportsCacheHint)||!1,x=u.createQuery(),$=new am({orderByFields:b,start:m,num:y,outFields:v,cacheHint:_,relationshipId:o,returnGeometry:!1,objectIds:[f],where:x.where}),I=((G=(await n.queryRelatedFeatures($,{signal:e==null?void 0:e.signal}))[f])==null?void 0:G.features)||[];return I.forEach(U=>U.sourceLayer=u),I}};c([h()],Xe.prototype,"_queryAbortController",void 0),c([h()],Xe.prototype,"_queryPageAbortController",void 0),c([h()],Xe.prototype,"_queryFeatureCountAbortController",void 0),c([h({value:1})],Xe.prototype,"featurePage",null),c([h()],Xe.prototype,"featuresPerPage",void 0),c([h({readOnly:!0})],Xe.prototype,"orderByFieldsFixedCasing",null),c([h()],Xe.prototype,"description",void 0),c([h({readOnly:!0})],Xe.prototype,"itemDescriptionFieldName",null),c([h({value:3})],Xe.prototype,"displayCount",null),c([h({type:Ci})],Xe.prototype,"graphic",void 0),c([h()],Xe.prototype,"layer",void 0),c([h()],Xe.prototype,"map",void 0),c([h({readOnly:!0})],Xe.prototype,"objectId",null),c([h({readOnly:!0})],Xe.prototype,"objectIdField",null),c([h()],Xe.prototype,"orderByFields",void 0),c([h({readOnly:!0})],Xe.prototype,"relatedFeatures",null),c([h({readOnly:!0})],Xe.prototype,"relatedLayer",null),c([h({readOnly:!0})],Xe.prototype,"relationship",null),c([h({readOnly:!0})],Xe.prototype,"featureCount",void 0),c([h({readOnly:!0})],Xe.prototype,"relatedFeatureViewModels",null),c([h()],Xe.prototype,"relationshipId",void 0),c([h()],Xe.prototype,"showAllEnabled",void 0),c([h({readOnly:!0})],Xe.prototype,"state",null),c([h()],Xe.prototype,"title",void 0),Xe=c([S("esri.widgets.Feature.FeatureRelationship.FeatureRelationshipViewModel")],Xe);const WT=Xe,Bn={base:"esri-feature-relationship",esriWidget:"esri-widget",listContainer:"esri-feature-relationship__list",listContainerQuerying:"esri-feature-relationship__list--querying",featureObserver:"esri-feature__feature-observer",stickySpinnerContainer:"esri-feature__sticky-loading-container",loadingSpinnerContainer:"esri-feature__loading-container",spinner:"esri-feature__loading-spinner",iconLoading:"esri-icon-loading-indicator esri-rotating"},EP={title:!0,description:!0};let Di=class extends yi{constructor(e,t){super(e,t),this._featureElementInfo=null,this._relatedFeatureIntersectionObserver=new IntersectionObserver(([i])=>{i!=null&&i.isIntersecting&&this._increaseFeaturePage()},{root:window.document}),this.headingLevel=2,this.viewModel=new WT,this.messages=null,this.messagesCommon=null,this.visibleElements={...EP},this._increaseFeaturePage=()=>{const{state:i,showAllEnabled:s,relatedFeatures:r,featuresPerPage:n,featurePage:o}=this.viewModel;i==="ready"&&s&&r.length>=n*o&&this.viewModel.featurePage++}}initialize(){this._featureElementInfo=new Bb,this.addHandles([Z(()=>[this.viewModel.description,this.viewModel.title,this.headingLevel],()=>this._setupFeatureElementInfo(),Le),Z(()=>[this.viewModel.state,this.viewModel.showAllEnabled,this._relatedFeatureIntersectionObserverNode],()=>this._handleRelatedFeatureObserverChange()),Is(()=>this.viewModel.relatedFeatureViewModels,"change",()=>this._setupRelatedFeatureViewModels())])}loadDependencies(){return Promise.all([z(()=>import("./calcite-list.73c0b6c3.js"),["assets/calcite-list.73c0b6c3.js","assets/interactive.d71a7a54.js"]),z(()=>import("./calcite-list-item.c5e3f8cb.js"),["assets/calcite-list-item.c5e3f8cb.js","assets/conditionalSlot.32d69949.js","assets/observers.440ad120.js","assets/interactive.d71a7a54.js"]),z(()=>import("./calcite-icon.8b0ddff6.js"),["assets/calcite-icon.8b0ddff6.js","assets/icon.781cca93.js","assets/observers.440ad120.js"]),z(()=>import("./calcite-notice.41dd0b76.js"),["assets/calcite-notice.41dd0b76.js","assets/conditionalSlot.32d69949.js","assets/observers.440ad120.js","assets/icon.781cca93.js"])])}destroy(){this._unobserveRelatedFeatureObserver(),this._featureElementInfo=$t(this._featureElementInfo)}get displayShowAllButton(){const{showAllEnabled:e,featureCount:t,displayCount:i}=this.viewModel;return!e&&(t>i||i===0)}get displayListItems(){return this.displayShowAllButton||this.viewModel.relatedFeatureViewModels.length>0}get description(){return this.viewModel.description}set description(e){this.viewModel.description=e}get featureCountDescription(){const{messages:e}=this,{featureCount:t}=this.viewModel;return fn(t===1?e==null?void 0:e.numberRecord:e==null?void 0:e.numberRecords,{number:t})}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}castVisibleElements(e){return{...EP,...e}}renderStickyLoading(){return this.viewModel.state==="querying"?P("div",{key:"sticky-loader",class:Bn.stickySpinnerContainer},this.renderLoadingIcon()):null}renderLoadingIcon(){return P("span",{class:this.classes(Bn.iconLoading,Bn.spinner)})}renderLoading(){return P("div",{key:"loading-container",class:Bn.loadingSpinnerContainer},this.renderLoadingIcon())}renderShowAllIconNode(){return P("calcite-icon",{scale:"s",icon:"list",slot:"content-end"})}renderChevronIconNode(){const e=xn(this.container)?"chevron-left":"chevron-right";return P("calcite-icon",{scale:"s",icon:e,slot:"content-end"})}renderRelatedFeature(e){var r,n;const{itemDescriptionFieldName:t}=this.viewModel,i=e.title;e.description=t&&((r=e.formattedAttributes)==null?void 0:r.global[t]);const s=e.state==="loading";return P("calcite-list-item",{key:e.uid,label:s?`${(n=this.messagesCommon)==null?void 0:n.loading}\u2026`:i,description:s?"\u2026":e.description,onclick:()=>this.emit("select-record",{featureViewModel:e})},this.renderChevronIconNode())}renderShowAllListItem(){var e;return this.displayShowAllButton?P("calcite-list-item",{key:"show-all-item",label:(e=this.messages)==null?void 0:e.showAll,description:this.featureCountDescription,onclick:()=>this.emit("show-all-records")},this.renderShowAllIconNode()):null}renderNoRelatedFeaturesMessage(){var e;return P("calcite-notice",{key:"no-related-features-message",icon:"information",open:!0,color:"blue",scale:"s",width:"full"},P("div",{slot:"message"},(e=this.messages)==null?void 0:e.noRelatedFeatures))}renderFeatureObserver(){return P("div",{key:"feature-observer",class:Bn.featureObserver,bind:this,afterCreate:this._relatedFeatureIntersectionObserverCreated})}renderList(){const{relatedFeatureViewModels:e}=this.viewModel;return P("calcite-list",null,e.toArray().map(t=>this.renderRelatedFeature(t)),this.renderShowAllListItem())}renderRelatedFeatures(){const{displayListItems:e}=this,{state:t}=this.viewModel;return P("div",{key:"list-container",class:this.classes(Bn.listContainer,{[Bn.listContainerQuerying]:t==="querying"})},e?this.renderList():t==="ready"?this.renderNoRelatedFeaturesMessage():null,this.renderStickyLoading(),this.renderFeatureObserver())}renderRelationshipNotFound(){var e;return P("calcite-notice",{key:"relationship-not-found",icon:"exclamation-mark-triangle",open:!0,color:"red",scale:"s",width:"full"},P("div",{slot:"message"},(e=this.messages)==null?void 0:e.relationshipNotFound))}render(){var t;const{state:e}=this.viewModel;return P("div",{class:this.classes(Bn.base,Bn.esriWidget)},(t=this._featureElementInfo)==null?void 0:t.render(),e==="loading"?this.renderLoading():e==="disabled"?this.renderRelationshipNotFound():this.renderRelatedFeatures())}_setupRelatedFeatureViewModels(){const{relatedFeatureViewModels:e}=this.viewModel,t="related-feature-viewmodels";this.removeHandles(t),e==null||e.forEach(i=>{this.addHandles(Z(()=>[i.title,i.state],()=>this.scheduleRender(),Le),t)}),this.scheduleRender()}_setupFeatureElementInfo(){const{headingLevel:e,visibleElements:t}=this,i=t.description&&this.description,s=t.title&&this.title;this._featureElementInfo.set({description:i,title:s,headingLevel:e})}async _handleRelatedFeatureObserverChange(){this._unobserveRelatedFeatureObserver();const{state:e,showAllEnabled:t}=this.viewModel;await nb(0),this._relatedFeatureIntersectionObserverNode&&e==="ready"&&t&&this._relatedFeatureIntersectionObserver.observe(this._relatedFeatureIntersectionObserverNode)}_relatedFeatureIntersectionObserverCreated(e){this._relatedFeatureIntersectionObserverNode=e}_unobserveRelatedFeatureObserver(){this._relatedFeatureIntersectionObserverNode&&this._relatedFeatureIntersectionObserver.unobserve(this._relatedFeatureIntersectionObserverNode)}};c([h()],Di.prototype,"_relatedFeatureIntersectionObserverNode",void 0),c([h({readOnly:!0})],Di.prototype,"displayShowAllButton",null),c([h({readOnly:!0})],Di.prototype,"displayListItems",null),c([h()],Di.prototype,"description",null),c([h({readOnly:!0})],Di.prototype,"featureCountDescription",null),c([h()],Di.prototype,"headingLevel",void 0),c([h()],Di.prototype,"title",null),c([h({type:WT})],Di.prototype,"viewModel",void 0),c([h(),di("esri/widgets/Feature/t9n/Feature")],Di.prototype,"messages",void 0),c([h(),di("esri/t9n/common")],Di.prototype,"messagesCommon",void 0),c([h()],Di.prototype,"visibleElements",void 0),c([Oe("visibleElements")],Di.prototype,"castVisibleElements",null),Di=c([S("esri.widgets.Feature.FeatureRelationship")],Di);const kP=Di;class noe{constructor(t,i){this.preLayerQueryCallback=t,this.preRequestCallback=i,this.preLayerQueryCallback||(this.preLayerQueryCallback=s=>{}),this.preRequestCallback||(this.preLayerQueryCallback=s=>{})}}var Gp;const ooe=1,CP="content-view-models",PP="relationship-view-models",AP={attachmentsContent:!0,chartAnimation:!0,customContent:!0,expressionContent:!0,fieldsContent:!0,mediaContent:!0,textContent:!0,relationshipContent:!0};let nt=Gp=class extends Om(oe){constructor(e){super(e),this._handles=new qi,this._error=null,this._featureAbortController=null,this._graphicChangedThrottled=Ch(this._graphicChanged,ooe,this),this._expressionAttributes=null,this._graphicExpressionAttributes=null,this.abilities={...AP},this.content=null,this.contentViewModels=[],this.description=null,this.defaultPopupTemplateEnabled=!1,this.formattedAttributes=null,this.lastEditInfo=null,this.relatedInfos=new Map,this.title="",this.view=null,this._isAllowedContentType=t=>{const{abilities:i}=this;return t.type==="attachments"&&i.attachmentsContent||t.type==="custom"&&i.customContent||t.type==="fields"&&i.fieldsContent||t.type==="media"&&i.mediaContent||t.type==="text"&&i.textContent||t.type==="expression"&&i.expressionContent||t.type==="relationship"&&i.relationshipContent},this._handles.add(Z(()=>[this.graphic,this._effectivePopupTemplate,this.abilities],()=>this._graphicChangedThrottled(),Le))}destroy(){this._clear(),this._cancelFeatureQuery(),this._error=null,this._handles.destroy(),this._handles=null,this.graphic=null,this._destroyContentViewModels(),this.relatedInfos.clear()}get _effectivePopupTemplate(){return M(this.graphic)?this.graphic.getEffectivePopupTemplate(this.defaultPopupTemplateEnabled):null}get _fieldInfoMap(){return mK(tC(this._effectivePopupTemplate),this._sourceLayer)}get _sourceLayer(){return zN(this.graphic)}castAbilities(e){return{...AP,...e}}get state(){return this.graphic?this._error?"error":this.waitingForContent?"loading":"ready":"disabled"}set graphic(e){this._set("graphic",e?e.clone():null)}get spatialReference(){var e,t;return(t=(e=this.view)==null?void 0:e.spatialReference)!=null?t:null}set spatialReference(e){this._override("spatialReference",e)}get map(){var e;return((e=this.view)==null?void 0:e.map)||null}set map(e){this._override("map",e)}get waitingForContent(){return!!this._featureAbortController}setActiveMedia(e,t){const i=this.contentViewModels[e];i instanceof Fc&&i.setActiveMedia(t)}nextMedia(e){const t=this.contentViewModels[e];t instanceof Fc&&t.next()}previousMedia(e){const t=this.contentViewModels[e];t instanceof Fc&&t.previous()}_clear(){this._set("title",""),this._set("content",null),this._set("formattedAttributes",null)}async _graphicChanged(){this._cancelFeatureQuery(),this._error=null,this._clear();const{graphic:e}=this;if(!e)return;const t=new AbortController;this._featureAbortController=t;try{await this._queryFeature({signal:t.signal})}catch(i){Ks(i)||(this._error=i,q.getLogger(this.declaredClass).error("error","The popupTemplate could not be displayed for this feature.",{error:i,graphic:e,popupTemplate:this._effectivePopupTemplate}))}this._featureAbortController===t&&(this._featureAbortController=null)}_cancelFeatureQuery(){const{_featureAbortController:e}=this;e&&e.abort(),this._featureAbortController=null}_compileContentElement(e,t){return e.type==="attachments"?this._compileAttachments(e,t):e.type==="custom"?this._compileCustom(e,t):e.type==="fields"?this._compileFields(e,t):e.type==="media"?this._compileMedia(e,t):e.type==="text"?this._compileText(e,t):e.type==="expression"?this._compileExpression(e,t):e.type==="relationship"?this._compileRelationship(e,t):void 0}_compileContent(e){if(this._destroyContentViewModels(),this.graphic)return Array.isArray(e)?e.filter(this._isAllowedContentType).map((t,i)=>this._compileContentElement(t,i)):typeof e=="string"?this._compileText(new Yh({text:e}),0).text:e}_destroyContentViewModels(){var e,t;(e=this._handles)==null||e.remove(PP),(t=this._handles)==null||t.remove(CP),this.contentViewModels.forEach(i=>i&&!i.destroyed&&i.destroy()),this._set("contentViewModels",[])}_matchesFeature(e,t){var r;const i=(r=e==null?void 0:e.graphic)==null?void 0:r.getObjectId(),s=t==null?void 0:t.getObjectId();return M(i)&&M(s)&&i===s}_setRelatedFeaturesViewModels({relatedFeatureViewModels:e,relatedFeatures:t,map:i}){t==null||t.filter(Boolean).forEach(s=>{e.find(r=>this._matchesFeature(r,s))||e.add(new Gp({abilities:{relationshipContent:!1},map:i,graphic:s}))}),e.forEach(s=>{(t==null?void 0:t.find(n=>this._matchesFeature(s,n)))||e.remove(s)})}_setExpressionContentVM(e,t){const{formattedAttributes:i}=this,{contentElement:s,contentElementViewModel:r}=e,n=s==null?void 0:s.type;r&&n&&(n==="fields"&&(this._createFieldsFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),r.set(this._createFieldsVMParams(s,t))),n==="media"&&(this._createMediaFormattedAttributes({contentElement:s,contentElementIndex:t,formattedAttributes:i}),r.set(this._createMediaVMParams(s,t))),n==="text"&&r.set(this._createTextVMParams(s)))}_compileRelationship(e,t){const{displayCount:i,orderByFields:s,relationshipId:r,title:n,description:o}=e,{_sourceLayer:a,graphic:l,map:u}=this,d=new WT({displayCount:i,graphic:l,orderByFields:s,relationshipId:r,layer:a,map:u,...this._compileTitleAndDesc({title:n,description:o})});return this.contentViewModels[t]=d,this._handles.add(Is(()=>d.relatedFeatures,"change",()=>this._setRelatedFeaturesViewModels(d)),PP),e}_compileExpression(e,t){const{expressionInfo:i}=e,{graphic:s,map:r,spatialReference:n,view:o}=this,a=new GT({expressionInfo:i,graphic:s,interceptor:Gp.interceptor,map:r,spatialReference:n,view:o});return this.contentViewModels[t]=a,this._handles.add(Z(()=>a.contentElementViewModel,()=>this._setExpressionContentVM(a,t),Le),CP),e}_compileAttachments(e,t){const{graphic:i}=this,{description:s,title:r}=e;return this.contentViewModels[t]=new gT({graphic:i,...this._compileTitleAndDesc({title:r,description:s})}),e}_compileCustom(e,t){const{graphic:i}=this,{creator:s,destroyer:r}=e;return this.contentViewModels[t]=new $v({graphic:i,creator:s,destroyer:r}),e}_compileTitleAndDesc({title:e,description:t}){const{_fieldInfoMap:i,_sourceLayer:s,graphic:r,formattedAttributes:n,_expressionAttributes:o}=this,{attributes:a}=r,l=n.global;return{title:Rc({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:o,layer:s,text:e}),description:Rc({attributes:a,fieldInfoMap:i,globalAttributes:l,expressionAttributes:o,layer:s,text:t})}}_createFieldsVMParams(e,t){var u;const{_effectivePopupTemplate:i,formattedAttributes:s}=this,r={...s.global,...s.content[t]},n=(u=(e==null?void 0:e.fieldInfos)||(i==null?void 0:i.fieldInfos))==null?void 0:u.filter(({fieldName:d})=>pT(d)||xo(d)||r.hasOwnProperty(d)),o=i==null?void 0:i.expressionInfos,{description:a,title:l}=e;return{attributes:r,expressionInfos:o,fieldInfos:n,...this._compileTitleAndDesc({title:l,description:a})}}_compileFields(e,t){const i=e.clone(),s=new Ub(this._createFieldsVMParams(e,t));return this.contentViewModels[t]=s,i.fieldInfos=s.formattedFieldInfos.slice(0),i}_createMediaVMParams(e,t){const{abilities:i,graphic:s,_fieldInfoMap:r,formattedAttributes:n,_effectivePopupTemplate:o,relatedInfos:a,_sourceLayer:l,_expressionAttributes:u}=this,{attributes:d}=s,{description:f,mediaInfos:m,title:y}=e;return{abilities:{chartAnimation:i.chartAnimation},activeMediaInfoIndex:e.activeMediaInfoIndex||0,attributes:d,layer:l,fieldInfoMap:r,formattedAttributes:{...n.global,...n.content[t]},expressionAttributes:u,mediaInfos:m,popupTemplate:o,relatedInfos:a,...this._compileTitleAndDesc({title:y,description:f})}}_compileMedia(e,t){const i=e.clone(),s=new Fc(this._createMediaVMParams(e,t));return i.mediaInfos=s.formattedMediaInfos.slice(0),this.contentViewModels[t]=s,i}_createTextVMParams(e){const{graphic:t,_fieldInfoMap:i,_sourceLayer:s,_expressionAttributes:r}=this;if(e&&e.text){const{attributes:n}=t,o=this.formattedAttributes.global;e.text=Rc({attributes:n,fieldInfoMap:i,globalAttributes:o,expressionAttributes:r,layer:s,text:e.text})}return{graphic:t,creator:e.text}}_compileText(e,t){const i=e.clone();return this.contentViewModels[t]=new $v(this._createTextVMParams(i)),i}_compileLastEditInfo(){const{_effectivePopupTemplate:e,_sourceLayer:t,graphic:i}=this;if(!e)return;const{lastEditInfoEnabled:s}=e,r=t==null?void 0:t.editFieldsInfo;return s&&r?fK(r,i.attributes):void 0}_compileTitle(e){const{_fieldInfoMap:t,_sourceLayer:i,graphic:s,_expressionAttributes:r}=this,{attributes:n}=s,o=this.formattedAttributes.global;return Rc({attributes:n,fieldInfoMap:t,globalAttributes:o,expressionAttributes:r,layer:i,text:e})}async _getTitle(){const{_effectivePopupTemplate:e,graphic:t}=this,i=e==null?void 0:e.title;return Mv(i,{graphic:t})}async _getContent(){const{_effectivePopupTemplate:e,graphic:t}=this,i=e==null?void 0:e.content;return Mv(i,{graphic:t})}async _queryFeature(e){const{_featureAbortController:t,_sourceLayer:i,graphic:s,_effectivePopupTemplate:r,spatialReference:n,map:o,view:a}=this;if(t!==this._featureAbortController||!s)return;await vK({graphic:s,popupTemplate:r,layer:i,spatialReference:n},e);const{content:{value:l},title:{value:u}}=await as({content:this._getContent(),title:this._getTitle()}),{expressionAttributes:{value:d}}=await as({checkForRelatedFeatures:this._checkForRelatedFeatures(e),expressionAttributes:ioe({expressionInfos:r==null?void 0:r.expressionInfos,spatialReference:n,graphic:s,map:o,interceptor:Gp.interceptor,view:a})});t===this._featureAbortController&&s&&(this._expressionAttributes=d,this._graphicExpressionAttributes={...s.attributes,...d},this._set("formattedAttributes",this._createFormattedAttributes(l)),this._set("title",this._compileTitle(u)),this._set("lastEditInfo",this._compileLastEditInfo()||null),this._set("content",this._compileContent(l)||null))}_createMediaFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){const{_effectivePopupTemplate:s,graphic:r,relatedInfos:n,_sourceLayer:o,_fieldInfoMap:a,_graphicExpressionAttributes:l}=this;i.content[t]=X_({fieldInfos:s==null?void 0:s.fieldInfos,graphic:r,attributes:{...l,...e.attributes},layer:o,fieldInfoMap:a,relatedInfos:n})}_createFieldsFormattedAttributes({contentElement:e,contentElementIndex:t,formattedAttributes:i}){if(e.fieldInfos){const{graphic:s,relatedInfos:r,_sourceLayer:n,_fieldInfoMap:o,_graphicExpressionAttributes:a}=this;i.content[t]=X_({fieldInfos:e.fieldInfos,graphic:s,attributes:{...a,...e.attributes},layer:n,fieldInfoMap:o,relatedInfos:r})}}_createFormattedAttributes(e){const{_effectivePopupTemplate:t,graphic:i,relatedInfos:s,_sourceLayer:r,_fieldInfoMap:n,_graphicExpressionAttributes:o}=this,a=t==null?void 0:t.fieldInfos,l={global:X_({fieldInfos:a,graphic:i,attributes:o,layer:r,fieldInfoMap:n,relatedInfos:s}),content:[]};return Array.isArray(e)&&e.forEach((u,d)=>{u.type==="fields"&&this._createFieldsFormattedAttributes({contentElement:u,contentElementIndex:d,formattedAttributes:l}),u.type==="media"&&this._createMediaFormattedAttributes({contentElement:u,contentElementIndex:d,formattedAttributes:l})}),l}_checkForRelatedFeatures(e){const{graphic:t,_effectivePopupTemplate:i}=this;return this._queryRelatedInfos(t,tC(i),e)}async _queryRelatedInfos(e,t,i){const{relatedInfos:s,_sourceLayer:r}=this;s.clear();const n=M(r.associatedLayer)?await r.associatedLayer.load(i):r;if(!n)return;const o=t.filter(u=>u&&xo(u.fieldName));if(!o||!o.length)return;t.forEach(u=>this._configureRelatedInfo(u,n));const a=await Rte({relatedInfos:s,layer:n},i);Object.keys(a).forEach(u=>{var m;const d=s.get(u.toString()),f=(m=a[u])==null?void 0:m.value;d&&f&&(d.layerInfo=f.data)});const l=await Lte({graphic:e,relatedInfos:s,layer:n},i);Object.keys(l).forEach(u=>{var d;kte((d=l[u])==null?void 0:d.value,s.get(u.toString()))})}_configureRelatedInfo(e,t){const{relatedInfos:i}=this,s=XS(e.fieldName);if(!s)return;const{layerId:r,fieldName:n}=s;if(!r)return;const o=i.get(r.toString())||Ete(r,t);o&&(Fte({relatedInfo:o,fieldName:n,fieldInfo:e}),this.relatedInfos.set(r,o))}};nt.interceptor=new noe(wK,xK),c([h()],nt.prototype,"_error",void 0),c([h()],nt.prototype,"_featureAbortController",void 0),c([h({readOnly:!0})],nt.prototype,"_effectivePopupTemplate",null),c([h({readOnly:!0})],nt.prototype,"_fieldInfoMap",null),c([h({readOnly:!0})],nt.prototype,"_sourceLayer",null),c([h()],nt.prototype,"abilities",void 0),c([Oe("abilities")],nt.prototype,"castAbilities",null),c([h({readOnly:!0})],nt.prototype,"content",void 0),c([h({readOnly:!0})],nt.prototype,"contentViewModels",void 0),c([h()],nt.prototype,"description",void 0),c([h({type:Boolean})],nt.prototype,"defaultPopupTemplateEnabled",void 0),c([h({readOnly:!0})],nt.prototype,"state",null),c([h({readOnly:!0})],nt.prototype,"formattedAttributes",void 0),c([h({type:Ci,value:null})],nt.prototype,"graphic",null),c([h({readOnly:!0})],nt.prototype,"lastEditInfo",void 0),c([h({readOnly:!0})],nt.prototype,"relatedInfos",void 0),c([h()],nt.prototype,"spatialReference",null),c([h({readOnly:!0})],nt.prototype,"title",void 0),c([h()],nt.prototype,"map",null),c([h({readOnly:!0})],nt.prototype,"waitingForContent",null),c([h()],nt.prototype,"view",void 0),nt=Gp=c([S("esri.widgets.FeatureViewModel")],nt);const HT=nt,ft={iconText:"esri-icon-font-fallback-text",iconLoading:"esri-icon-loading-indicator esri-rotating",esriTable:"esri-widget__table",esriWidget:"esri-widget",base:"esri-feature",container:"esri-feature__size-container",title:"esri-feature__title",main:"esri-feature__main-container",btn:"esri-feature__button",icon:"esri-feature__icon",content:"esri-feature__content",contentNode:"esri-feature__content-node",contentElement:"esri-feature__content-element",text:"esri-feature__text",lastEditedInfo:"esri-feature__last-edited-info",fields:"esri-feature__fields",fieldHeader:"esri-feature__field-header",fieldData:"esri-feature__field-data",fieldDataDate:"esri-feature__field-data--date",loadingSpinnerContainer:"esri-feature__loading-container",spinner:"esri-feature__loading-spinner"},H4=e=>{let t=class extends e{constructor(){super(...arguments),this.renderNodeContent=i=>XN(i)&&!i.destroyed?P("div",{class:ft.contentNode,key:i},i.render()):i instanceof HTMLElement?P("div",{class:ft.contentNode,key:i,bind:i,afterCreate:this._attachToNode}):FK(i)?P("div",{class:ft.contentNode,key:i,bind:i.domNode,afterCreate:this._attachToNode}):null}_attachToNode(i){const s=this;i.appendChild(s)}};return t=c([S("esri.widgets.Feature.ContentMixin")],t),t};var eM;const OP={title:!0,content:!0,lastEditedInfo:!0},RP="relationship-handles";let oi=eM=class extends H4(yi){constructor(e,t){super(e,t),this._contentWidgets=[],this.flowItems=null,this.headingLevel=2,this.messages=null,this.messagesCommon=null,this.messagesURIUtils=null,this.visibleElements={...OP},this.viewModel=new HT}initialize(){this.addHandles(Z(()=>{var e;return(e=this.viewModel)==null?void 0:e.contentViewModels},()=>this._setupContentWidgets(),Le))}loadDependencies(){return z(()=>import("./calcite-notice.41dd0b76.js"),["assets/calcite-notice.41dd0b76.js","assets/conditionalSlot.32d69949.js","assets/observers.440ad120.js","assets/icon.781cca93.js"])}destroy(){this._destroyContentWidgets()}get graphic(){return this.viewModel.graphic}set graphic(e){this.viewModel.graphic=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get label(){var e,t;return(t=(e=this.messages)==null?void 0:e.widgetLabel)!=null?t:""}set label(e){this._overrideIfSome("label",e)}get spatialReference(){return this.viewModel.spatialReference}set spatialReference(e){this.viewModel.spatialReference=e}get title(){return this.viewModel.title}castVisibleElements(e){return{...OP,...e}}get map(){return this.viewModel.map}set map(e){this.viewModel.map=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const{state:e}=this.viewModel,t=P("div",{class:ft.container,key:"container"},this.renderTitle(),e==="error"?this.renderError():e==="loading"?this.renderLoading():this.renderContentContainer());return P("div",{class:this.classes(ft.base,ft.esriWidget)},t)}setActiveMedia(e,t){return this.viewModel.setActiveMedia(e,t)}nextMedia(e){return this.viewModel.nextMedia(e)}previousMedia(e){return this.viewModel.previousMedia(e)}renderError(){const{messagesCommon:e,messages:t,visibleElements:i}=this;return P("calcite-notice",{active:!0,color:"red",icon:"exclamation-mark-circle",scale:"s"},i.title?P("div",{key:"error-title",slot:"title"},e.errorMessage):null,P("div",{key:"error-message",slot:"message"},t.loadingError))}renderLoading(){return P("div",{key:"loading-container",class:ft.loadingSpinnerContainer},P("span",{class:this.classes(ft.iconLoading,ft.spinner)}))}renderContentContainer(){const{visibleElements:e}=this;return e.content?P("div",{class:ft.main},[this.renderContent(),this.renderLastEditInfo()]):null}renderTitle(){const{visibleElements:e,title:t}=this;return e.title?P(vT,{level:this.headingLevel,class:ft.title,innerHTML:t}):null}renderContent(){const e=this.viewModel.content,t="content";if(!e)return null;if(Array.isArray(e))return e.length?P("div",{class:ft.contentNode,key:`${t}-content-elements`},e.map(this.renderContentElement,this)):null;if(typeof e=="string"){const i=this._contentWidgets[0];return!i||i.destroyed?null:P("div",{class:ft.contentNode,key:`${t}-content`},i.render())}return this.renderNodeContent(e)}renderContentElement(e,t){const{visibleElements:i}=this;if(typeof i.content!="boolean"&&!i.content[e.type])return null;switch(e.type){case"attachments":return this.renderAttachments(t);case"custom":return this.renderCustom(e,t);case"fields":return this.renderFields(t);case"media":return this.renderMedia(t);case"text":return this.renderText(e,t);case"expression":return this.renderExpression(t);case"relationship":return this.renderRelationship(t);default:return null}}renderAttachments(e){const t=this._contentWidgets[e];if(!t||t.destroyed)return null;const{state:i,attachmentInfos:s}=t.viewModel;return i==="loading"||s.length>0?P("div",{key:this._buildKey("attachments-element",e),class:this.classes(ft.contentElement)},t.render()):null}renderRelationship(e){const t=this._contentWidgets[e];return t&&!t.destroyed&&this.flowItems?P("div",{key:this._buildKey("relationship-element",e),class:ft.contentElement},t.render()):null}renderExpression(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:P("div",{key:this._buildKey("expression-element",e),class:ft.contentElement},t.render())}renderCustom(e,t){const{creator:i}=e,s=this._contentWidgets[t];return!s||s.destroyed?null:i?P("div",{key:this._buildKey("custom-element",t),class:ft.contentElement},s.render()):null}renderFields(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:P("div",{key:this._buildKey("fields-element",e),class:ft.contentElement},t.render())}renderMedia(e){const t=this._contentWidgets[e];return!t||t.destroyed?null:P("div",{key:this._buildKey("media-element",e),class:ft.contentElement},t.render())}renderLastEditInfo(){const{visibleElements:e,messages:t}=this,{lastEditInfo:i}=this.viewModel;if(!i||!e.lastEditedInfo)return null;const{date:s,user:r}=i,n=i.type==="edit"?r?t.lastEditedByUser:t.lastEdited:r?t.lastCreatedByUser:t.lastCreated,o=fn(n,{date:s,user:r});return P("div",{key:"edit-info-element",class:this.classes(ft.lastEditedInfo,ft.contentElement)},o)}renderText(e,t){const i=e.text,s=this._contentWidgets[t];return!s||s.destroyed?null:i?P("div",{key:this._buildKey("text-element",t),class:this.classes(ft.contentElement,ft.text)},s.render()):null}_buildKey(e,...t){return`${e}__${this.get("viewModel.graphic.uid")||"0"}-${t.join("-")}`}_destroyContentWidget(e){e&&(e.viewModel=null,!e.destroyed&&e.destroy())}_destroyContentWidgets(){this.removeHandles(RP),this._contentWidgets.forEach(e=>this._destroyContentWidget(e)),this._contentWidgets=[]}_addFeatureRelationshipHandles(e){const{flowItems:t,visibleElements:i}=this;this.addHandles([Is(()=>e,"select-record",({featureViewModel:s})=>{t&&(s.abilities={relationshipContent:!0},t.push(new eM({flowItems:t,viewModel:s,visibleElements:i})))}),Is(()=>e,"show-all-records",()=>{if(!t)return;const{viewModel:s}=e;s.showAllEnabled=!0;const r=new kP({visibleElements:{title:!1,description:!1},viewModel:s});this._addFeatureRelationshipHandles(r),t.push(r)})],RP)}_setupContentWidgets(){this._destroyContentWidgets();const{headingLevel:e,visibleElements:t}=this,i=this.get("viewModel.content"),{contentViewModels:s}=this.viewModel;if(Array.isArray(i))i.forEach((r,n)=>{if(r.type==="attachments"&&(this._contentWidgets[n]=new kK({displayType:r.displayType,headingLevel:t.title?e+1:e,viewModel:s[n]})),r.type==="fields"&&(this._contentWidgets[n]=new ZN({viewModel:s[n]})),r.type==="media"&&(this._contentWidgets[n]=new P5({viewModel:s[n]})),r.type==="text"&&(this._contentWidgets[n]=new qg({viewModel:s[n]})),r.type==="custom"&&(this._contentWidgets[n]=new qg({viewModel:s[n]})),r.type==="expression"&&(this._contentWidgets[n]=new roe({viewModel:s[n]})),r.type==="relationship"){const o=new kP({viewModel:s[n]});this._addFeatureRelationshipHandles(o),this._contentWidgets[n]=o}},this);else{const r=s[0];r&&!r.destroyed&&(this._contentWidgets[0]=new qg({viewModel:r}))}this.scheduleRender()}};c([h()],oi.prototype,"graphic",null),c([h()],oi.prototype,"defaultPopupTemplateEnabled",null),c([h()],oi.prototype,"flowItems",void 0),c([h()],oi.prototype,"headingLevel",void 0),c([h()],oi.prototype,"label",null),c([h(),di("esri/widgets/Feature/t9n/Feature")],oi.prototype,"messages",void 0),c([h(),di("esri/t9n/common")],oi.prototype,"messagesCommon",void 0),c([h(),di("esri/widgets/support/t9n/uriUtils")],oi.prototype,"messagesURIUtils",void 0),c([h()],oi.prototype,"spatialReference",null),c([h({readOnly:!0})],oi.prototype,"title",null),c([h()],oi.prototype,"visibleElements",void 0),c([Oe("visibleElements")],oi.prototype,"castVisibleElements",null),c([h()],oi.prototype,"map",null),c([h()],oi.prototype,"view",null),c([h({type:HT})],oi.prototype,"viewModel",void 0),oi=eM=c([S("esri.widgets.Feature")],oi);const aoe=oi;var Y4;const u0=Symbol("anchorHandles");let ac=class extends jo.EventedAccessor{constructor(e){super(e),this[Y4]=new qi,this.location=null,this.screenLocationEnabled=!1,this.view=null,this[u0].add([Qs(()=>ja(this.screenLocationEnabled?this.view:null,t=>[t.size,t.type==="3d"?t.camera:t.viewpoint]),()=>this.notifyChange("screenLocation")),Z(()=>this.screenLocation,(t,i)=>{M(t)&&M(i)&&this.emit("view-change")})])}destroy(){this.view=null,this[u0]=$t(this[u0])}get screenLocation(){const{location:e,view:t,screenLocationEnabled:i}=this;return i&&M(e)&&M(t)&&t.ready?t.toScreen(e):null}};Y4=u0,c([h()],ac.prototype,"location",void 0),c([h()],ac.prototype,"screenLocation",null),c([h()],ac.prototype,"screenLocationEnabled",void 0),c([h()],ac.prototype,"view",void 0),ac=c([S("esri.widgets.support.AnchorElementViewModel")],ac);const J4=ac,loe="esri.widgets.CompassViewModel";let h0=class extends J4{constructor(e){super(e),this.visible=!1}};c([h()],h0.prototype,"visible",void 0),h0=c([S(loe)],h0);const X4=h0,Cw={base:"esri-spinner",spinnerStart:"esri-spinner--start",spinnerFinish:"esri-spinner--finish"};let lc=class extends yi{constructor(e,t){super(e,t),this._animationDelay=500,this._animationPromise=null,this.viewModel=new X4}initialize(){this.addHandles(Z(()=>this.visible,e=>this._visibleChange(e)))}destroy(){this._animationPromise=null}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}show(e){const{location:t,promise:i}=e;t&&(this.viewModel.location=t),this.visible=!0;const s=()=>this.hide();i&&i.catch(()=>{}).then(s)}hide(){this.visible=!1}render(){const{visible:e}=this,{screenLocation:t}=this.viewModel,i=!!t,s=e&&i,r=!e&&i,n={[Cw.spinnerStart]:s,[Cw.spinnerFinish]:r},o=this._getPositionStyles();return P("div",{class:this.classes(Cw.base,n),styles:o})}_visibleChange(e){if(e)return void(this.viewModel.screenLocationEnabled=!0);const t=nb(this._animationDelay);this._animationPromise=t,t.catch(()=>{}).then(()=>{this._animationPromise===t&&(this.viewModel.screenLocationEnabled=!1,this._animationPromise=null)})}_getPositionStyles(){const{screenLocation:e,view:t}=this.viewModel;if(N(t)||N(e))return{};const{padding:i}=t;return{left:e.x-i.left+"px",top:e.y-i.top+"px"}}};c([h()],lc.prototype,"location",null),c([h()],lc.prototype,"view",null),c([h({type:X4})],lc.prototype,"viewModel",void 0),c([h()],lc.prototype,"visible",null),lc=c([S("esri.widgets.Spinner")],lc);const coe=lc,uoe="OBJECTID";var LP;(function(e){e[e.size=22]="size",e[e.lineWidth=50]="lineWidth",e[e.maxSize=120]="maxSize",e[e.maxOutlineSize=80]="maxOutlineSize",e[e.tallSymbolWidth=20]="tallSymbolWidth"})(LP||(LP={}));function Z4(){const e=new Float32Array(6);return e[0]=1,e[3]=1,e}function hoe(e){const t=new Float32Array(6);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function doe(e,t,i,s,r,n){const o=new Float32Array(6);return o[0]=e,o[1]=t,o[2]=i,o[3]=s,o[4]=r,o[5]=n,o}function poe(e,t){return new Float32Array(e,t,6)}function Q4(e,t,i,s){const r=t[s],n=t[s+1];e[s]=i[0]*r+i[2]*n+i[4],e[s+1]=i[1]*r+i[3]*n+i[5]}function foe(e,t,i,s=0,r=0,n=2){const o=r||t.length/n;for(let a=s;a=4;D1();function sj(e){return e&&"opacity"in e?e.opacity*sj(e.parent):1}async function Eoe(e,t){var b,_;if(!e)return;const i=e.sourceLayer,s=(b=M(t)&&t.useSourceLayer?i:e.layer)!=null?b:i,r=sj(s);if(M(e.symbol)&&(!M(t)||t.ignoreGraphicSymbol!==!0)){const x=e.symbol.type==="web-style"?await e.symbol.fetchSymbol({...t,cache:M(t)?t.webStyleCache:null}):e.symbol.clone();return tw(x,null,r),x}const n=(_=M(t)?t.renderer:null)!=null?_:s&&"renderer"in s?s.renderer:null;let o=n&&"getSymbolAsync"in n?await n.getSymbolAsync(e,t):null;if(!o)return;if(o=o.type==="web-style"?await o.fetchSymbol({...t,cache:M(t)?t.webStyleCache:null}):o.clone(),!(n&&"visualVariables"in n&&n.visualVariables&&n.visualVariables.length))return tw(o,null,r),o;if("arcadeRequiredForVisualVariables"in n&&n.arcadeRequiredForVisualVariables&&(N(t)||N(t.arcade))){const x={...t};x.arcade=await Do(),t=x}const a=await z(()=>Promise.resolve().then(function(){return PT}),void 0),l=[],u=[],d=[],f=[];for(const x of n.visualVariables)switch(x.type){case"color":l.push(x);break;case"opacity":u.push(x);break;case"rotation":f.push(x);break;case"size":x.target||d.push(x)}const m=!!l.length&&l[l.length-1],y=m?a.getColor(m,e,t):null,g=!!u.length&&u[u.length-1];let v=g?a.getOpacity(g,e,t):null;if(r!=null&&(v=v!=null?v*r:r),tw(o,y,v),d.length){const x=a.getAllSizes(d,e,t);await iee(o,x)}for(const x of f)see(o,a.getRotationAngle(x,e,t),x.axis);return o}class koe{constructor(t,i){this._owner=i,this._properties={},this._afterDispatchHandle=null;for(const s in t){const r=t[s],n=new AR(r,void 0,void 0,2,2);this._properties[s]={pool:n,acquired:[]}}this._afterDispatchHandle=U7(()=>this._release())}destroy(){this._afterDispatchHandle&&(this._afterDispatchHandle.remove(),this._afterDispatchHandle=null);for(const t in this._properties){const i=this._properties[t];for(const s of i.acquired)vE(s)||i.pool.release(s);i.pool.destroy(),i.pool=null,i.acquired=null}this._properties=null,this._owner=null}get(t){const i=this._owner._get(t),s=this._properties[t];let r=s.pool.acquire();for(s.acquired.push(r);r===i;)s.acquired.push(r),r=s.pool.acquire();return r}_release(){for(const t in this._properties){const i=this._properties[t];let s=0;for(const r of i.acquired)vE(r)?i.acquired[s++]=r:i.pool.release(r);i.acquired.length=s}}}const Coe=V("mac")?"Meta":"Ctrl",i_={8:"Backspace",9:"Tab",13:"Enter",27:"Escape",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete"};for(let e=48;e<58;e++)i_[e]=String.fromCharCode(e);for(let e=1;e<25;e++)i_[111+e]=`F${e}`;for(let e=65;e<91;e++)i_[e]=[String.fromCharCode(e+32),String.fromCharCode(e)];function Poe(e){if(e.key!==void 0)return yc(e);const t=i_[e.keyCode];return Array.isArray(t)?e.shiftKey?t[1]:t[0]:t}function Aoe(e){switch(e){case"Ctrl":case"Alt":case"Shift":case"Meta":case"Primary":return!0}return!1}class Ooe{constructor(t,i=[]){this.eventType=t,this.keyModifiers=i}matches(t){if(t.type!==this.eventType)return!1;if(this.keyModifiers.length===0)return!0;const i=t.modifiers;for(const s of this.keyModifiers)if(!i.has(s))return!1;return!0}}const DP=q.getLogger("esri.views.input.InputHandler");class ei{constructor(t){this._manager=null,this._incoming={},this._outgoing={},this._incomingEventMatches=null,this._incomingEventTypes=null,this._outgoingEventTypes=null,this._hasSideEffects=t}get incomingEventMatches(){if(!this._incomingEventMatches){this._incomingEventMatches=[];for(const t in this._incoming){const i=this._incoming[t];for(const s of i)this._incomingEventMatches.push(s.match)}}return this._incomingEventMatches}get incomingEventTypes(){return this._incomingEventTypes||(this._incomingEventTypes=this.incomingEventMatches.map(t=>t.eventType)),this._incomingEventTypes}get outgoingEventTypes(){return this._outgoingEventTypes||(this._outgoingEventTypes=Object.keys(this._outgoing)),this._outgoingEventTypes}get hasSideEffects(){return this._hasSideEffects}get hasPendingInputs(){return!1}onInstall(t){this._manager?DP.error("This InputHandler has already been registered with an InputManager"):(t.setEventCallback(i=>this._handleEvent(i)),t.setUninstallCallback(()=>this._onUninstall()),this._manager=t)}onUninstall(){}registerIncoming(t,i,s){let r;typeof i=="function"?(s=i,r=[]):r=i||[];const n=typeof t=="string"?new Ooe(t,r):t,o=()=>{this._incomingEventTypes=null,this._incomingEventMatches=null},a=d=>{const f=this._incoming[d.match.eventType];if(f){const m=f.indexOf(d);f.splice(m,1),o(),this._manager&&this._manager.updateDependencies()}},l=new Roe(n,s,{onPause:a,onRemove:a,onResume:d=>{const f=this._incoming[d.match.eventType];f&&!f.includes(d)&&(f.push(d),o(),this._manager&&this._manager.updateDependencies())}});let u=this._incoming[n.eventType];return u||(u=[],this._incoming[n.eventType]=u),u.push(l),o(),this._manager&&this._manager.updateDependencies(),l}registerOutgoing(t){if(this._outgoing[t])throw new Error("There is already a callback registered for this outgoing InputEvent: "+t);const i=new Loe(t,{onEmit:(s,r,n,o)=>{var a;(a=this._manager)==null||a.emit(s.eventType,r,n,o)},onRemove:s=>{var r;delete this._outgoing[s.eventType],(r=this._manager)==null||r.updateDependencies()}});return this._outgoing[t]=i,this._outgoingEventTypes=null,this._manager&&this._manager.updateDependencies(),i}startCapturingPointer(t){var i;(i=this._manager)==null||i.setPointerCapture(t,!0)}stopCapturingPointer(t){var i;(i=this._manager)==null||i.setPointerCapture(t,!1)}refreshHasPendingInputs(){var t;(t=this._manager)==null||t.refreshHasPendingInputs()}_onUninstall(){this._manager?(this.onUninstall(),this._manager=null):DP.error("This InputHandler is not registered with an InputManager")}_handleEvent(t){var s;const i=this._incoming[t.type];if(i){for(const r of i)if(r.match.matches(t)&&((s=r.callback)==null||s.call(r,t),t.shouldStopPropagation()))break}}}class Roe{constructor(t,i,s){this.match=t,this._callback=i,this._handler=s}pause(){this._handler.onPause(this)}resume(){this._handler.onResume(this)}remove(){this._handler.onRemove(this)}get callback(){return this._callback}}class Loe{constructor(t,i){this.eventType=t,this._removed=!1,this._handler=i}emit(t,i,s){this._removed||this._handler.onEmit(this,t,i,s)}remove(){this._removed=!0,this._handler.onRemove(this)}}class Foe extends ei{constructor(t){super(!0),this._onChange=t,this._value="mouse",this._x=null,this._y=null,this.registerIncoming("pointer-move",i=>{this._update(i.data)})}_update(t){const i=t.native.pointerType==="touch"?"touch":"mouse",{x:s,y:r}=t;i===this._value&&this._x===s&&this._y===r||(this._value=i,this._x=s,this._y=r,this._onChange(i,s,r))}}class Pv{constructor(t){this._observable=new S$,this._value=t}get(){return _e(this._observable),this._value}set(t){t!==this._value&&(this._value=t,this._observable.notify())}}class Doe extends ei{constructor(){super(!0),this._activeTouchPointerIds=new Set,this._multiTouchActive=new Pv(!1),this._onPointerAdd=({data:t})=>{t.pointerType==="touch"&&(this._activeTouchPointerIds.add(t.native.pointerId),this._update())},this._onPointerRemove=({data:t})=>{t.pointerType==="touch"&&(this._activeTouchPointerIds.delete(t.native.pointerId),this._update())},this.registerIncoming("pointer-down",this._onPointerAdd),this.registerIncoming("pointer-up",this._onPointerRemove),this.registerIncoming("pointer-capture-lost",this._onPointerRemove),this.registerIncoming("pointer-cancel",this._onPointerRemove)}get multiTouchActive(){return this._multiTouchActive.get()}_update(){this._multiTouchActive.set(this._activeTouchPointerIds.size>1)}}let cn=class extends oe{constructor(e){super(e),this._pointerCaptures=new Map,this._nameToGroup={},this._handlers=[],this._handlersPriority=[],this._currentPropagation=null,this._updateDependenciesAfterPropagation=!1,this._sourceEvents=new Set,this._keyModifiers=new Set,this._activeKeyModifiers=new Set,this._stoppedPropagationEventIds=new Set,this.primaryKey=Coe,this._latestPointerType="mouse",this._propertiesPool=new koe({latestPointerLocation:joe},this),this.latestPointerLocation=null,this.test={timestamp:void 0,hasCurrentPropagation:()=>!!this._currentPropagation}}initialize(){this.eventSource.onEventReceived=this._onEventReceived.bind(this),this._installRecognizers()}destroy(){const e=Object.keys(this._nameToGroup);for(const t of e)this.uninstallHandlers(t);this.eventSource.destroy(),this._currentPropagation=null,this._propertiesPool.destroy()}get hasPendingInputs(){return this._handlers.some(e=>e.handler.hasPendingInputs)}get latestPointerType(){return this._latestPointerType}get multiTouchActive(){return this._multiTouchHandler.multiTouchActive}installHandlers(e,t,i=el.INTERNAL){if(this._nameToGroup[e])return void q.getLogger(this.declaredClass).error("There is already an InputHandler group registered under the name `"+e+"`");if(t.length===0)return void q.getLogger(this.declaredClass).error("Can't register a group of zero handlers");const s={name:e,handlers:t.map(r=>({handler:r,active:!0,removed:!1,priorityIndex:0,groupPriority:i,eventCallback:null,uninstallCallback:null}))};this._nameToGroup[e]=s;for(let r=s.handlers.length-1;r>=0;r--){const n=s.handlers[r];this._handlers.push(n),n.handler.onInstall({updateDependencies:()=>{this.updateDependencies()},emit:(o,a,l,u,d)=>{this._emitInputEvent(n.priorityIndex+1,o,a,l,d,u)},setPointerCapture:(o,a)=>{this._setPointerCapture(s,n,o,a)},setEventCallback:o=>{n.eventCallback=o},setUninstallCallback:o=>{n.uninstallCallback=o},refreshHasPendingInputs:()=>{this.notifyChange("hasPendingInputs")}})}this.updateDependencies()}uninstallHandlers(e){const t=this._nameToGroup[e];t?(t.handlers.forEach(i=>{var s;i.removed=!0,(s=i.uninstallCallback)==null||s.call(i)}),delete this._nameToGroup[e],this._currentPropagation?this._currentPropagation.needsHandlerGarbageCollect=!0:this._garbageCollectRemovedHandlers()):q.getLogger(this.declaredClass).error("There is no InputHandler group registered under the name `"+e+"`")}hasHandlers(e){return this._nameToGroup[e]!==void 0}updateDependencies(){if(this._currentPropagation)return void(this._updateDependenciesAfterPropagation=!0);this._updateDependenciesAfterPropagation=!1;const e=new Set,t=new Set;this._handlersPriority=[];for(let i=this._handlers.length-1;i>=0;i--){const s=this._handlers[i];s.priorityIndex=i,this._handlersPriority.push(s)}this._handlersPriority=this._sortHandlersPriority(this._handlersPriority);for(let i=this._handlersPriority.length-1;i>=0;i--){const s=this._handlersPriority[i];s.priorityIndex=i;let r=s.handler.hasSideEffects;if(!r){for(const n of s.handler.outgoingEventTypes)if(e.has(n)){r=!0;break}}if(r)for(const n of s.handler.incomingEventMatches){e.add(n.eventType);for(const o of n.keyModifiers)Aoe(o)||t.add(o)}s.active=r}this._sourceEvents=e,this._keyModifiers=t,this._pointerCaptures.size>0&&this._sourceEvents.add("pointer-capture-lost"),this._keyModifiers.size>0&&(this._sourceEvents.add("key-down"),this._sourceEvents.add("key-up")),this.eventSource&&(this.eventSource.activeEvents=this._sourceEvents)}_setLatestPointer(e,t,i){this._latestPointerType=e;const s=this._get("latestPointerLocation");if(N(s)||s.x!==t||s.y!==i){const r=this._propertiesPool.get("latestPointerLocation");r.x=t,r.y=i,this._set("latestPointerLocation",r)}}_onEventReceived(e,t){if(e==="pointer-capture-lost"){const r=t;this._pointerCaptures.delete(r.native.pointerId)}this._updateKeyModifiers(e,t);const i=this.test.timestamp!=null?this.test.timestamp:t.native?t.native.timestamp:void 0,s=t.native?t.native.cancelable:void 0;this._emitInputEventFromSource(e,t,i,s)}_updateKeyModifiers(e,t){if(!t)return;let i=!1;const s=()=>{if(!i){const o=new Set;this._activeKeyModifiers.forEach(a=>{o.add(a)}),this._activeKeyModifiers=o,i=!0}},r=(o,a)=>{a&&!this._activeKeyModifiers.has(o)?(s(),this._activeKeyModifiers.add(o)):!a&&this._activeKeyModifiers.has(o)&&(s(),this._activeKeyModifiers.delete(o))};if(e==="key-down"||e==="key-up"){const o=t.key;this._keyModifiers.has(o)&&r(o,e==="key-down")}const n=t.native;r("Alt",!(!n||!n.altKey)),r("Ctrl",!(!n||!n.ctrlKey)),r("Shift",!(!n||!n.shiftKey)),r("Meta",!(!n||!n.metaKey)),r("Primary",this._activeKeyModifiers.has(this.primaryKey))}_installRecognizers(){this._latestPointerHandler=new Foe((e,t,i)=>this._setLatestPointer(e,t,i)),this._multiTouchHandler=new Doe,this.installHandlers("input-manager-logic",[this._latestPointerHandler,this._multiTouchHandler],el.ALWAYS),this.recognizers.length>0&&this.installHandlers("default",this.recognizers,el.INTERNAL)}_setPointerCapture(e,t,i,s){const r=e.name+"-"+t.priorityIndex,n=this._pointerCaptures.get(i.pointerId)||new Set;this._pointerCaptures.set(i.pointerId,n),s?(n.add(r),n.size===1&&this.eventSource&&this.eventSource.setPointerCapture(i,!0)):n.has(r)&&(n.delete(r),n.size===0&&(this._pointerCaptures.delete(i.pointerId),this.eventSource&&this.eventSource.setPointerCapture(i,!1)))}_garbageCollectRemovedHandlers(){this._handlers=this._handlers.filter(e=>!e.removed),this.updateDependencies()}_emitInputEventFromSource(e,t,i,s){this._emitInputEvent(0,e,t,i,s)}_emitInputEvent(e,t,i,s,r,n){const o=s!==void 0?s:this._currentPropagation?this._currentPropagation.timestamp:performance.now(),a=r!==void 0&&r,l={event:new Noe(t,i,o,n||this._activeKeyModifiers,a),priorityIndex:e};this._currentPropagation?this._currentPropagation.events.push(l):this._doNewPropagation(l)}_doNewPropagation(e){this._currentPropagation={events:new xv,currentHandler:null,needsHandlerGarbageCollect:!1,timestamp:e.event.timestamp},this._currentPropagation.events.push(e),this._continuePropagation()}_continuePropagation(){var t,i;const e=Hs(this._currentPropagation);for(;e.events.length>0;){const{event:s,priorityIndex:r}=e.events.pop(),n=s.data&&s.data.eventId;if(!(n!=null&&this._stoppedPropagationEventIds.has(n)))for(e.currentHandler=this._handlersPriority[r];e.currentHandler;){if(e.currentHandler.removed)e.needsHandlerGarbageCollect=!0;else{if(e.currentHandler.active&&!s.shouldStopPropagation()&&((i=(t=e.currentHandler).eventCallback)==null||i.call(t,s)),s.shouldStopPropagation()){n!=null&&this._stoppedPropagationEventIds.add(n);break}if(s.shouldPausePropagation(()=>this._continuePropagation()))return void this._pausePropagation({event:s,priorityIndex:e.currentHandler.priorityIndex+1})}e.currentHandler=this._handlersPriority[e.currentHandler.priorityIndex+1]}}e.needsHandlerGarbageCollect&&this._garbageCollectRemovedHandlers(),this.hasPendingInputs||this._stoppedPropagationEventIds.clear(),this._currentPropagation=null,this._updateDependenciesAfterPropagation&&this.updateDependencies()}_pausePropagation(e){const t=new xv;t.push(e);const i=this._currentPropagation;if(i){for(;i.events.length;)t.push(i.events.pop());i.events=t,i.currentHandler=null}}_compareHandlerPriority(e,t){if(e.handler.hasSideEffects!==t.handler.hasSideEffects)return e.handler.hasSideEffects?1:-1;if(e.groupPriority!==t.groupPriority)return e.groupPriority>t.groupPriority?-1:1;for(const i of e.handler.incomingEventMatches)for(const s of t.handler.incomingEventMatches){if(i.eventType!==s.eventType)continue;const r=i.keyModifiers.filter(n=>s.keyModifiers.includes(n));if(r.length===i.keyModifiers.length!=(r.length===s.keyModifiers.length))return i.keyModifiers.length>s.keyModifiers.length?-1:1}return e.priorityIndex>t.priorityIndex?-1:1}_sortHandlersPriority(e){const t=[];for(const i of e){let s=0;for(;s=0;)s++;t.splice(s,0,i)}return t}get debug(){const e=t=>{const i=this._setPointerCapture;this._setPointerCapture=()=>{},t(),this._setPointerCapture=i};return{injectEvent:(t,i)=>{e(()=>{this._onEventReceived(t,i)})},disablePointerCapture:e}}};c([h({readOnly:!0})],cn.prototype,"hasPendingInputs",null),c([h({constructOnly:!0})],cn.prototype,"eventSource",void 0),c([h({constructOnly:!0})],cn.prototype,"recognizers",void 0),c([h()],cn.prototype,"_latestPointerType",void 0),c([h()],cn.prototype,"latestPointerType",null),c([h()],cn.prototype,"multiTouchActive",null),c([h({readOnly:!0})],cn.prototype,"latestPointerLocation",void 0),cn=c([S("esri.views.input.InputManager")],cn);class Noe{constructor(t,i,s,r,n){this.type=t,this.data=i,this.timestamp=s,this.modifiers=r,this.cancelable=n,this._propagationState=Fa.NONE,this._resumeCallback=null}stopPropagation(){this._propagationState|=Fa.STOPPED}shouldStopPropagation(){return(this._propagationState&Fa.STOPPED)!=0}async(t){this._propagationState|=Fa.PAUSED;const i=(s,r)=>{this._propagationState&=~Fa.PAUSED;const n=this._resumeCallback;if(this._resumeCallback=null,n&&n(),r)throw s;return s};return(typeof t=="function"?t():t).then(s=>i(s,!1),s=>i(s,!0))}shouldPausePropagation(t){return!!(this._propagationState&Fa.PAUSED)&&(this._resumeCallback=t,!0)}preventDefault(){this.data.native.preventDefault()}}var Fa;(function(e){e[e.NONE=0]="NONE",e[e.STOPPED=1]="STOPPED",e[e.PAUSED=2]="PAUSED"})(Fa||(Fa={}));const el={ALWAYS:1,DEFAULT:0,TOOL:-1,WIDGET:-2,INTERNAL:-3};class joe{}function NP(e){return e&&typeof e.highlight=="function"}const s_={iconZoom:"esri-icon-zoom-in-magnifying-glass",iconTrash:"esri-icon-trash",iconBrowseClusteredFeatures:"esri-icon-table"},Nc=new pd({id:"zoom-to-feature",title:"{messages.zoom}",className:s_.iconZoom}),jP=new pd({id:"remove-selected-feature",title:"{messages.remove}",className:s_.iconTrash}),gh=new pd({id:"zoom-to-clustered-features",title:"{messages.zoom}",className:s_.iconZoom}),vh=new pd({id:"browse-clustered-features",title:"{messages.browseClusteredFeatures}",className:s_.iconBrowseClusteredFeatures}),Voe="esri.widgets.Popup.PopupViewModel",Av=q.getLogger(Voe),zoe=e=>{const{event:t,view:i}=e,{action:s}=t,r=i&&i.popup;if(!s)return Promise.reject(new L("trigger-action:missing-arguments","Event has no action"));if(!r)return Promise.reject(new L("trigger-action:missing-arguments","view.popup is missing"));const{disabled:n,id:o}=s;if(!o)return Promise.reject(new L("trigger-action:invalid-action","action.id is missing"));if(n)return Promise.reject(new L("trigger-action:invalid-action","Action is disabled"));if(o===Nc.id)return Uoe(r.viewModel).catch(w1);if(o===gh.id)return qoe(r.viewModel);if(o===vh.id)return r.featureMenuOpen=!r.featureMenuOpen,r.viewModel.browseClusterEnabled=!r.viewModel.browseClusterEnabled,Promise.resolve();if(r.viewModel.browseClusterEnabled=!1,o===jP.id){r.close();const{selectedFeature:a}=r;if(!a)return Promise.reject(new L(`trigger-action:${jP.id}`,"selectedFeature is required",{selectedFeature:a}));const{sourceLayer:l}=a;return l?l.remove(a):i.graphics.remove(a),Promise.resolve()}return Promise.resolve()};function rj(e){const{selectedFeature:t,location:i,view:s}=e;return s?s.type==="3d"?t||i:e.get("selectedFeature.geometry")||i:null}function xc(e){var t,i;return(e==null?void 0:e.isAggregate)&&((i=(t=e==null?void 0:e.sourceLayer)==null?void 0:t.featureReduction)==null?void 0:i.type)==="cluster"}async function Boe(e,t){if((t==null?void 0:t.type)!=="3d"||!e||e.declaredClass!=="esri.Graphic")return!0;const i=t.getViewForGraphic(e);if(i&&"whenGraphicBounds"in i){let s;try{s=await i.whenGraphicBounds(e,{useViewElevation:!0})}catch{}return!s||!s.boundingBox||s.boundingBox[0]===s.boundingBox[3]&&s.boundingBox[1]===s.boundingBox[4]&&s.boundingBox[2]===s.boundingBox[5]}return!0}async function Uoe(e){const{location:t,selectedFeature:i,view:s,zoomFactor:r}=e,n=rj(e);if(!n){const u=new L("zoom-to:invalid-target-or-view","Cannot zoom to location without a target and view.",{target:n,view:s});throw Av.error(u),u}const o=s.scale/r,a=e.get("selectedFeature.geometry")||t,l=a&&a.type==="point"&&await Boe(i,s);Nc.active=!0,Nc.disabled=!0;try{await e.zoomTo({target:{target:n,scale:l?o:void 0}})}catch{const d=new L("zoom-to:invalid-graphic","Could not zoom to the location of the graphic.",{graphic:i});Av.error(d)}finally{Nc.active=!1,Nc.disabled=!1,e.zoomToLocation=null,l&&(e.location=a)}}async function qoe(e){const{selectedFeature:t,view:i}=e;if((i==null?void 0:i.type)!=="2d"){const a=new L("zoomToCluster:invalid-view","View must be 2d MapView.",{view:i});throw Av.error(a),a}if(!xc(t)){const a=new L("zoomToCluster:invalid-selectedFeature","Selected feature must represent an aggregate/cluster graphic.",{selectedFeature:t});throw Av.error(a),a}const s=t.sourceLayer,r=await i.whenLayerView(s),n=r.createQuery();n.aggregateIds=[t.getObjectId()],gh.active=!0,gh.disabled=!0;const{extent:o}=await r.queryExtent(n);await e.zoomTo({target:o}),gh.active=!1,gh.disabled=!1}async function Goe(e){const{selectedFeature:t,view:i}=e,s=t.sourceLayer,r=await i.whenLayerView(s),n=r.createQuery();n.aggregateIds=[t.getObjectId()];const{extent:o}=await r.queryExtent(n);e.selectedClusterBoundaryFeature.geometry=o,i.graphics.add(e.selectedClusterBoundaryFeature)}async function Woe(e){const{selectedFeature:t,view:i}=e,s=t.sourceLayer,r=await i.whenLayerView(s),n=r.createQuery();n.aggregateIds=[t.getObjectId()],vh.active=!0,vh.disabled=!0;const{features:o}=await r.queryFeatures(n);vh.active=!1,vh.disabled=!1,i.popup.open({features:[t].concat(o),featureMenuOpen:!0})}function Hoe(e){const t=e.features.filter(i=>xc(i));t.length&&(e.features=t)}const nj=e=>{let t=class extends e{constructor(...i){super(...i),this.goToOverride=null,this.view=null}callGoTo(i){const{view:s}=this;return this.goToOverride?this.goToOverride(s,i):s.goTo(i.target,i.options)}};return c([h()],t.prototype,"goToOverride",void 0),c([h()],t.prototype,"view",void 0),t=c([S("esri.widgets.support.GoTo")],t),t},If=he.ofType({key:"type",defaultKeyValue:"button",base:Ob,typeMap:{button:pd,toggle:JD}}),Yoe=()=>[Nc.clone()],Joe=()=>[gh.clone(),vh.clone()];let Ce=class extends nj(J4){constructor(e){super(e),this._handles=new qi,this._pendingPromises=new Set,this._fetchFeaturesController=null,this._selectedClusterFeature=null,this.featurePage=null,this.actions=new If,this.activeFeature=null,this.defaultPopupTemplateEnabled=!1,this.autoCloseEnabled=!1,this.autoOpenEnabled=!0,this.browseClusterEnabled=!1,this.content=null,this.featuresPerPage=20,this.featureViewModelAbilities=null,this.featureViewModels=[],this.highlightEnabled=!0,this.includeDefaultActions=!0,this.selectedClusterBoundaryFeature=new Ci({symbol:new gl({outline:{width:1.5,color:"cyan"},style:"none"})}),this.title=null,this.updateLocationEnabled=!1,this.view=null,this.visible=!1,this.zoomFactor=4,this.zoomToLocation=null}get isLoadingFeature(){return this.featureViewModels.some(e=>e.waitingForContent)}initialize(){this._handles.add([Z(()=>[this.autoOpenEnabled,this.view],()=>this._autoOpenEnabledChange()),this.on("view-change",()=>this._autoClose()),Z(()=>[this.highlightEnabled,this.selectedFeature,this.visible,this.view],()=>this._highlightSelectedFeature()),Z(()=>[this.highlightEnabled,this.activeFeature,this.visible,this.view],()=>this._highlightActiveFeature()),Z(()=>{var e,t;return(t=(e=this.view)==null?void 0:e.animation)==null?void 0:t.state},e=>this._animationStateChange(e)),Z(()=>this.location,e=>this._locationChange(e)),Z(()=>this.selectedFeature,e=>this._selectedFeatureChange(e)),Z(()=>[this.selectedFeatureIndex,this.featureCount,this.featuresPerPage],()=>this._selectedFeatureIndexChange()),Z(()=>[this.featurePage,this.selectedFeatureIndex,this.featureCount,this.featuresPerPage,this.featureViewModels],()=>this._setGraphicOnFeatureViewModels()),Z(()=>this.featureViewModels,()=>this._featureViewModelsChange()),this.on("trigger-action",e=>zoe({event:e,view:this.view})),Qs(()=>!this.waitingForResult,()=>this._waitingForResultChange(),Nh),Z(()=>{var e,t;return[this.features,(e=this.view)==null?void 0:e.map,(t=this.view)==null?void 0:t.spatialReference]},()=>this._updateFeatureVMs()),Z(()=>{var e;return(e=this.view)==null?void 0:e.scale},()=>this._viewScaleChange()),Qs(()=>!this.visible,()=>this.browseClusterEnabled=!1),Z(()=>this.browseClusterEnabled,e=>e?this.enableClusterBrowsing():this.disableClusterBrowsing())])}destroy(){this._cancelFetchingFeatures(),this._handles.destroy(),this._handles=null,this._pendingPromises.clear(),this.browseClusterEnabled=!1,this.view=null}get active(){return!(!this.visible||this.waitingForResult)}get allActions(){const e=this._get("allActions")||new If;e.removeAll();const{actions:t,defaultActions:i,defaultPopupTemplateEnabled:s,includeDefaultActions:r,selectedFeature:n}=this,o=r?i.concat(t):t,a=n&&(typeof n.getEffectivePopupTemplate=="function"&&n.getEffectivePopupTemplate(s)||n.popupTemplate),l=a&&a.actions,u=a&&a.overwriteActions?l:l?l.concat(o):o;return u&&u.filter(Boolean).forEach(d=>e.add(d)),e}get defaultActions(){const e=this._get("defaultActions")||new If;return e.removeAll(),e.addMany(xc(this.selectedFeature)?Joe():Yoe()),e}get featureCount(){return this.features.length}get features(){return this._get("features")||[]}set features(e){const t=e||[];this._set("features",t);const{pendingPromisesCount:i,promiseCount:s,selectedFeatureIndex:r}=this,n=s&&t.length;n&&i&&r===-1?this.selectedFeatureIndex=0:n&&r!==-1||(this.selectedFeatureIndex=t.length?0:-1)}get location(){return this._get("location")||null}set location(e){const t=this.get("view.spatialReference.isWebMercator");e&&e.get("spatialReference.isWGS84")&&t&&(e=Za(e)),this._set("location",e)}get pendingPromisesCount(){return this._pendingPromises.size}get waitingForResult(){return!(!(!!this._fetchFeaturesController||this.pendingPromisesCount>0)||this.featureCount!==0)}get promiseCount(){return this.promises.length}get promises(){return this._get("promises")||[]}set promises(e){if(this._pendingPromises.clear(),this.features=[],!Array.isArray(e)||!e.length)return this._set("promises",[]),void this.notifyChange("pendingPromisesCount");this._set("promises",e),(e=e.slice(0)).forEach(t=>{this._pendingPromises.add(t);const i=r=>{this._pendingPromises.has(t)&&this._updateFeatures(r),this._updatePendingPromises(t)},s=()=>this._updatePendingPromises(t);t.then(i,s)}),this.notifyChange("pendingPromisesCount")}get selectedFeature(){const{features:e,selectedFeatureIndex:t}=this;return t===-1?null:e[t]||null}get selectedFeatureIndex(){const e=this._get("selectedFeatureIndex");return typeof e=="number"?e:-1}set selectedFeatureIndex(e){const{featureCount:t}=this;e=isNaN(e)||e<-1||!t?-1:(e+t)%t,this.activeFeature=null,this._set("selectedFeatureIndex",e)}get selectedFeatureViewModel(){return this.featureViewModels[this.selectedFeatureIndex]||null}get state(){return this.get("view.ready")?"ready":"disabled"}centerAtLocation(){const{view:e}=this,t=rj(this);return t?this.callGoTo({target:{target:t,scale:e.scale}}):Promise.reject(new L("center-at-location:invalid-target-or-view","Cannot center at a location without a target and view.",{target:t,view:e}))}zoomTo(e){return this.callGoTo(e)}clear(){this.set({promises:[],features:[],content:null,title:null,location:null,activeFeature:null})}fetchFeatures(e,t){const{view:i}=this;if(!i||!e)throw new L("fetch-features:invalid-screenpoint-or-view","Cannot fetch features without a screenPoint and view.",{screenPoint:e,view:i});return i.fetchPopupFeatures(e,{event:t&&t.event,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,signal:t&&t.signal})}open(e){const t={updateLocationEnabled:!1,promises:[],fetchFeatures:!1,...e,visible:!0},{fetchFeatures:i}=t;delete t.fetchFeatures,i&&this._setFetchFeaturesPromises(t.location);const s=["actionsMenuOpen","collapsed","featureMenuOpen"];for(const r of s)delete t[r];this.set(t)}triggerAction(e){const t=this.allActions.getItemAt(e);t&&!t.disabled&&this.emit("trigger-action",{action:t})}next(){return this.selectedFeatureIndex=this.selectedFeatureIndex+1,this}previous(){return this.selectedFeatureIndex=this.selectedFeatureIndex-1,this}disableClusterBrowsing(){Hoe(this),this._clearBrowsedClusterGraphics()}async enableClusterBrowsing(){const{view:e,selectedFeature:t}=this;(e==null?void 0:e.type)==="2d"?xc(t)?(await Goe(this),await Woe(this)):q.getLogger(this.declaredClass).warn("enableClusterBrowsing:invalid-selectedFeature: Selected feature must represent an aggregate/cluster graphic.",t):q.getLogger(this.declaredClass).warn("enableClusterBrowsing:invalid-view: View must be 2d MapView.",t)}_animationStateChange(e){this.zoomToLocation||(Nc.disabled=e==="waiting-for-target")}_clearBrowsedClusterGraphics(){var t;const e=(t=this.view)==null?void 0:t.graphics;e&&(e.remove(this.selectedClusterBoundaryFeature),e.remove(this._selectedClusterFeature)),this._selectedClusterFeature=null,this.selectedClusterBoundaryFeature.geometry=null}_viewScaleChange(){if(xc(this.selectedFeature))return this.browseClusterEnabled=!1,this.visible=!1,void this.clear();this.browseClusterEnabled&&(this.features=[this.selectedFeature])}_locationChange(e){const{selectedFeature:t,updateLocationEnabled:i}=this;i&&e&&(!t||t.geometry)&&this.centerAtLocation()}_selectedFeatureIndexChange(){this.featurePage=this.featureCount>1?Math.floor(this.selectedFeatureIndex/this.featuresPerPage)+1:null}_featureViewModelsChange(){this.featurePage=this.featureCount>1?1:null}_setGraphicOnFeatureViewModels(){const{features:e,featureCount:t,featurePage:i,featuresPerPage:s,featureViewModels:r}=this;if(i===null)return;const n=((i-1)*s+t)%t,o=n+s;r.slice(n,o).forEach((a,l)=>{a&&!a.graphic&&(a.graphic=e[n+l])})}async _selectedFeatureChange(e){if(!e)return;const{location:t,updateLocationEnabled:i,view:s}=this;if(this.browseClusterEnabled)return this._selectedClusterFeature&&(s.graphics.remove(this._selectedClusterFeature),this._selectedClusterFeature=null),xc(e)?void 0:(e.symbol=await Eoe(e),this._selectedClusterFeature=e,void s.graphics.add(this._selectedClusterFeature));!i&&t||!e.geometry?i&&!e.geometry&&this.centerAtLocation().then(()=>{this.location=s.center.clone()}):this.location=this._getPointFromGeometry(e.geometry)}_waitingForResultChange(){!this.featureCount&&this.promises&&(this.visible=!1)}_setFetchFeaturesPromises(e){return this._fetchFeaturesWithController(this._getScreenPoint(e||this.location)).then(t=>{const{clientOnlyGraphics:i,promisesPerLayerView:s}=t,r=Promise.resolve(i),n=s.map(o=>o.promise);this.promises=[r,...n]})}_destroyFeatureVMs(){this.featureViewModels.forEach(e=>e&&!e.destroyed&&e.destroy()),this._set("featureViewModels",[])}_updateFeatureVMs(){const{selectedFeature:e,features:t,featureViewModels:i}=this;if(xc(e)||(this.browseClusterEnabled=!1),this._destroyFeatureVMs(),!t||!t.length)return;const s=i.slice(0),r=[];t.forEach((n,o)=>{var l,u;if(!n)return;let a=null;if(s.some((d,f)=>(d&&d.graphic===n&&(a=d,s.splice(f,1)),!!a)),a)r[o]=a;else{const d=new HT({abilities:this.featureViewModelAbilities,defaultPopupTemplateEnabled:this.defaultPopupTemplateEnabled,spatialReference:(l=this.view)==null?void 0:l.spatialReference,graphic:n===e?n:null,map:(u=this.view)==null?void 0:u.map,view:this.view});r[o]=d}}),s.forEach(n=>n&&!n.destroyed&&n.destroy()),this._set("featureViewModels",r)}_getScreenPoint(e){const{view:t}=this;return t&&e&&typeof t.toScreen=="function"?t.toScreen(e):null}_autoOpenEnabledChange(){const e="auto-fetch-features",{_handles:t,autoOpenEnabled:i}=this;if(t.remove(e),i&&this.view){const s=this.view.on("click",r=>{r.pointerType==="mouse"&&r.button!==0||this._fetchFeaturesAndOpen(r)},el.WIDGET);t.add(s,e)}}_cancelFetchingFeatures(){const e=this._fetchFeaturesController;e&&e.abort(),this._fetchFeaturesController=null,this.notifyChange("waitingForResult")}_fetchFeaturesWithController(e,t){this._cancelFetchingFeatures();const i=new AbortController,{signal:s}=i;this._fetchFeaturesController=i,this.notifyChange("waitingForResult");const r=this.fetchFeatures(e,{signal:s,event:t});return r.catch(()=>{}).then(()=>{this._fetchFeaturesController=null,this.notifyChange("waitingForResult")}),r}_fetchFeaturesAndOpen(e){const{screenPoint:t,mapPoint:i}=e,{view:s}=this;this._fetchFeaturesWithController(t,e).then(r=>{const{clientOnlyGraphics:n,promisesPerLayerView:o,location:a}=r,l=[Promise.resolve(n),...o.map(u=>u.promise)];return s.popup.open({location:a||i,promises:l}),r})}_updatePendingPromises(e){e&&this._pendingPromises.has(e)&&(this._pendingPromises.delete(e),this.notifyChange("pendingPromisesCount"))}_autoClose(){this.autoCloseEnabled&&(this.visible=!1)}_getPointFromGeometry(e){var t;return N(e)?null:e.type==="point"?e:e.type==="extent"?e.center:e.type==="polygon"?e.centroid:e.type==="multipoint"||e.type==="polyline"?(t=e.extent)==null?void 0:t.center:null}async _getLayerView(e,t){return await e.when(),e.whenLayerView(t)}_getHighlightLayer(e){const{layer:t,sourceLayer:i}=e;return i&&"layer"in i&&i.layer?i.layer:(i==null?void 0:i.type)==="map-notes"||(i==null?void 0:i.type)==="subtype-group"?i:t}_getHighlightTarget(e,t){const i=t.type==="imagery"?void 0:"objectIdField"in t?t.objectIdField||uoe:null,s=e.attributes;return s&&i&&s[i]||e}async _highlightActiveFeature(){const e="highlight-active-feature";this._handles.remove(e);const{highlightEnabled:t,view:i,activeFeature:s,visible:r}=this;if(!(s&&i&&t&&r))return;const n=this._getHighlightLayer(s);if(!(n&&n instanceof Yf))return;const o=this._getLayerView(i,n);this._highlightActiveFeaturePromise=o;const a=await o;if(!(a&&NP(a)&&this._highlightActiveFeaturePromise===o&&this.activeFeature&&this.highlightEnabled))return;const l=a.highlight(this._getHighlightTarget(s,n));this._handles.add(l,e)}async _highlightSelectedFeature(){const e="highlight-selected-feature";this._handles.remove(e);const{selectedFeature:t,highlightEnabled:i,view:s,visible:r}=this;if(!(t&&s&&i&&r))return;const n=this._getHighlightLayer(t);if(!(n&&n instanceof Yf))return;const o=this._getLayerView(s,n);this._highlightSelectedFeaturePromise=o;const a=await o;if(!(a&&NP(a)&&this._highlightSelectedFeaturePromise===o&&this.selectedFeature&&this.highlightEnabled&&this.visible))return;const l=a.highlight(this._getHighlightTarget(t,n));this._handles.add(l,e)}_updateFeatures(e){const{features:t}=this;if(!e||!e.length)return;if(!t.length)return void(this.features=e);const i=e.filter(s=>!t.includes(s));this.features=t.concat(i)}};c([h()],Ce.prototype,"featurePage",void 0),c([h()],Ce.prototype,"isLoadingFeature",null),c([h({type:If})],Ce.prototype,"actions",void 0),c([h({readOnly:!0})],Ce.prototype,"active",null),c([h()],Ce.prototype,"activeFeature",void 0),c([h({readOnly:!0})],Ce.prototype,"allActions",null),c([h({type:Boolean})],Ce.prototype,"defaultPopupTemplateEnabled",void 0),c([h()],Ce.prototype,"autoCloseEnabled",void 0),c([h()],Ce.prototype,"autoOpenEnabled",void 0),c([h()],Ce.prototype,"browseClusterEnabled",void 0),c([h()],Ce.prototype,"content",void 0),c([h({type:If,readOnly:!0})],Ce.prototype,"defaultActions",null),c([h({readOnly:!0})],Ce.prototype,"featureCount",null),c([h()],Ce.prototype,"features",null),c([h()],Ce.prototype,"featuresPerPage",void 0),c([h()],Ce.prototype,"featureViewModelAbilities",void 0),c([h({readOnly:!0})],Ce.prototype,"featureViewModels",void 0),c([h()],Ce.prototype,"highlightEnabled",void 0),c([h()],Ce.prototype,"includeDefaultActions",void 0),c([h({type:be})],Ce.prototype,"location",null),c([h({readOnly:!0})],Ce.prototype,"pendingPromisesCount",null),c([h({readOnly:!0})],Ce.prototype,"selectedClusterBoundaryFeature",void 0),c([h({readOnly:!0})],Ce.prototype,"waitingForResult",null),c([h({readOnly:!0})],Ce.prototype,"promiseCount",null),c([h()],Ce.prototype,"promises",null),c([h({value:null,readOnly:!0})],Ce.prototype,"selectedFeature",null),c([h({value:-1})],Ce.prototype,"selectedFeatureIndex",null),c([h({readOnly:!0})],Ce.prototype,"selectedFeatureViewModel",null),c([h({readOnly:!0})],Ce.prototype,"state",null),c([h()],Ce.prototype,"title",void 0),c([h()],Ce.prototype,"updateLocationEnabled",void 0),c([h()],Ce.prototype,"view",void 0),c([h()],Ce.prototype,"visible",void 0),c([h()],Ce.prototype,"zoomFactor",void 0),c([h()],Ce.prototype,"zoomToLocation",void 0),c([h()],Ce.prototype,"centerAtLocation",null),Ce=c([S("esri.widgets.Popup.PopupViewModel")],Ce);const oj=Ce,VP="selected-index",Xoe=0,zP="popup-spinner",Y={calciteThemeLight:"calcite-theme-light",calciteThemeDark:"calcite-theme-dark",iconLeftTriangleArrow:"esri-icon-left-triangle-arrow",iconRightTriangleArrow:"esri-icon-right-triangle-arrow",iconDockToTop:"esri-icon-maximize",iconDockToBottom:"esri-icon-dock-bottom",iconDockToLeft:"esri-icon-dock-left",iconDockToRight:"esri-icon-dock-right",iconClose:"esri-icon-close",iconUndock:"esri-icon-minimize",iconCheckMark:"esri-icon-check-mark",iconLoading:"esri-icon-loading-indicator",iconDefaultAction:"esri-icon-default-action",iconActionsMenu:"esri-icon-handle-horizontal",rotating:"esri-rotating",base:"esri-popup",widget:"esri-widget",main:"esri-popup__main-container",loadingContainer:"esri-popup__loading-container",isCollapsible:"esri-popup--is-collapsible",isCollapsed:"esri-popup--is-collapsed",shadow:"esri-popup--shadow",isDocked:"esri-popup--is-docked",isDockedTopLeft:"esri-popup--is-docked-top-left",isDockedTopCenter:"esri-popup--is-docked-top-center",isDockedTopRight:"esri-popup--is-docked-top-right",isDockedBottomLeft:"esri-popup--is-docked-bottom-left",isDockedBottomCenter:"esri-popup--is-docked-bottom-center",isDockedBottomRight:"esri-popup--is-docked-bottom-right",alignTopCenter:"esri-popup--aligned-top-center",alignBottomCenter:"esri-popup--aligned-bottom-center",alignTopLeft:"esri-popup--aligned-top-left",alignBottomLeft:"esri-popup--aligned-bottom-left",alignTopRight:"esri-popup--aligned-top-right",alignBottomRight:"esri-popup--aligned-bottom-right",isFeatureMenuOpen:"esri-popup--feature-menu-open",isActionsMenuOpen:"esri-popup--actions-menu-open",hasFeatureUpdated:"esri-popup--feature-updated",header:"esri-popup__header",headerButtons:"esri-popup__header-buttons",headerContainer:"esri-popup__header-container",headerContainerButton:"esri-popup__header-container--button",headerTitle:"esri-popup__header-title",content:"esri-popup__content",contentHasFlows:"esri-content--has-flows",contentFlowItem:"esri-content__flow-item",footer:"esri-popup__footer",footerHasPagination:"esri-popup__footer--has-pagination",footerHasActions:"esri-popup__footer--has-actions",footerHasActionsMenu:"esri-popup__footer--has-actions-menu",button:"esri-popup__button",buttonDisabled:"esri-popup__button--disabled",buttonDock:"esri-popup__button--dock",icon:"esri-popup__icon",iconDock:"esri-popup__icon--dock-icon",inlineActionsContainer:"esri-popup__inline-actions-container",actionsMenuButton:"esri-popup__actions-menu-button",actions:"esri-popup__actions",action:"esri-popup__action",actionImage:"esri-popup__action-image",actionText:"esri-popup__action-text",actionToggle:"esri-popup__action-toggle",actionToggleOn:"esri-popup__action-toggle--on",actionExit:"esri-popup__action--exit",pointer:"esri-popup__pointer",pointerDirection:"esri-popup__pointer-direction",navigation:"esri-popup__navigation",paginationPrevious:"esri-popup__pagination-previous",paginationNext:"esri-popup__pagination-next",paginationPreviousIconLTR:"esri-popup__pagination-previous-icon",paginationPreviousIconRTL:"esri-popup__pagination-previous-icon--rtl",paginationNextIconLTR:"esri-popup__pagination-next-icon",paginationNextIconRTL:"esri-popup__pagination-next-icon--rtl",featureMenu:"esri-popup__feature-menu",featureMenuList:"esri-popup__feature-menu-list",featureMenuItem:"esri-popup__feature-menu-item",featureMenuViewport:"esri-popup__feature-menu-viewport",featureMenuHeader:"esri-popup__feature-menu-header",featureMenuNote:"esri-popup__feature-menu-note",featureMenuSelected:"esri-popup__feature-menu-item--selected",featureMenuButton:"esri-popup__feature-menu-button",featureMenuTitle:"esri-popup__feature-menu-title",featureMenuObserver:"esri-popup__feature-menu-observer",featureMenuLoader:"esri-popup__feature-menu-loader",collapseButton:"esri-popup__collapse-button",collapseIcon:"esri-popup__collapse-icon"},BP={buttonEnabled:!0,position:"auto",breakpoint:{width:544}},UP="esri-popup";function Un(e,t){return t===void 0?`${UP}__${e}`:`${UP}__${e}-${t}`}const qP={closeButton:!0,featureNavigation:!0};let ce=class extends H4(yi){constructor(e,t){super(e,t),this._blurClose=!1,this._blurContainer=!1,this._containerNode=null,this._mainContainerNode=null,this._featureMenuNode=null,this._actionsMenuNode=null,this._focusClose=!1,this._focusContainer=!1,this._focusDockButton=!1,this._focusFeatureMenuButton=!1,this._focusActionsMenuButton=!1,this._focusFirstFeature=!1,this._focusFirstAction=!1,this._handles=new qi,this._pointerOffsetInPx=16,this._spinner=null,this._feature=null,this._featureMenuIntersectionObserverCallback=([i])=>{i!=null&&i.isIntersecting&&this.viewModel.featurePage++},this._featureMenuIntersectionObserver=new IntersectionObserver(this._featureMenuIntersectionObserverCallback,{root:window.document}),this._displaySpinnerThrottled=Ch(()=>this._displaySpinner(),Xoe),this._exitRelatedRecordsActions=new WeakMap,this._flowItems=new he,this.alignment="auto",this.collapsed=!1,this.collapseEnabled=!0,this.dockEnabled=!1,this.featureMenuOpen=!1,this.headingLevel=2,this.maxInlineActions=3,this.messages=null,this.messagesCommon=null,this.spinnerEnabled=!0,this.viewModel=new oj,this.visibleElements={...qP},this._addSelectedFeatureIndexHandle(),this.addHandles([Z(()=>{var i;return(i=this.viewModel)==null?void 0:i.screenLocation},()=>this._positionContainer()),Z(()=>{var i;return[(i=this.viewModel)==null?void 0:i.active,this.dockEnabled]},()=>this._toggleScreenLocationEnabled()),Z(()=>{var i;return(i=this.viewModel)==null?void 0:i.screenLocation},(i,s)=>{!!i!=!!s&&this.reposition()}),Z(()=>{var i,s,r,n,o,a;return[(s=(i=this.viewModel)==null?void 0:i.view)==null?void 0:s.padding,(n=(r=this.viewModel)==null?void 0:r.view)==null?void 0:n.size,(o=this.viewModel)==null?void 0:o.active,(a=this.viewModel)==null?void 0:a.location,this.alignment]},()=>this.reposition()),Z(()=>this.spinnerEnabled,i=>this._spinnerEnabledChange(i)),Z(()=>{var i,s;return(s=(i=this.viewModel)==null?void 0:i.view)==null?void 0:s.size},(i,s)=>this._updateDockEnabledForViewSize(i,s)),Z(()=>{var i;return(i=this.viewModel)==null?void 0:i.view},(i,s)=>this._viewChange(i,s)),Z(()=>{var i,s;return(s=(i=this.viewModel)==null?void 0:i.view)==null?void 0:s.ready},(i,s)=>this._viewReadyChange(i,s)),Z(()=>{var i,s;return[(i=this.viewModel)==null?void 0:i.waitingForResult,(s=this.viewModel)==null?void 0:s.location]},()=>{this._hideSpinner(),this._displaySpinnerThrottled()}),Z(()=>this.selectedFeatureWidget,()=>this._destroyFlowItemWidgets()),Z(()=>{var i,s,r,n;return[(s=(i=this.selectedFeatureWidget)==null?void 0:i.viewModel)==null?void 0:s.title,(n=(r=this.selectedFeatureWidget)==null?void 0:r.viewModel)==null?void 0:n.state]},()=>this._setTitleFromFeatureWidget()),Z(()=>{var i,s,r,n;return[(s=(i=this.selectedFeatureWidget)==null?void 0:i.viewModel)==null?void 0:s.content,(n=(r=this.selectedFeatureWidget)==null?void 0:r.viewModel)==null?void 0:n.state]},()=>this._setContentFromFeatureWidget()),Qs(()=>!this.collapsed,()=>{var i,s;((s=(i=this.viewModel)==null?void 0:i.view)==null?void 0:s.widthBreakpoint)==="xsmall"&&this.viewModel.active&&this.collapseEnabled&&this.viewModel.centerAtLocation()}),Is(()=>{var i;return(i=this.viewModel)==null?void 0:i.allActions},"change",()=>this._watchActions()),Z(()=>{var i;return(i=this.viewModel)==null?void 0:i.allActions},()=>this._watchActions(),Le),Z(()=>{var i;return(i=this.viewModel)==null?void 0:i.featureViewModels},()=>this._featureMenuViewportScrollTop()),Is(()=>this._flowItems,"change",()=>{this.notifyChange("_activeFlowItemWidget"),this.scheduleRender()}),Z(()=>{var i,s,r,n;return[(s=(i=this._activeFlowItemWidget)==null?void 0:i.viewModel)==null?void 0:s.state,(n=(r=this._activeFlowItemWidget)==null?void 0:r.viewModel)==null?void 0:n.title]},()=>this.scheduleRender())])}loadDependencies(){return Promise.all([z(()=>import("./calcite-flow.45a3e267.js"),["assets/calcite-flow.45a3e267.js","assets/observers.440ad120.js"]),z(()=>import("./calcite-flow-item.62da4be8.js"),["assets/calcite-flow-item.62da4be8.js","assets/guid.ae96513b.js","assets/action.033e9799.js","assets/observers.440ad120.js","assets/interactive.d71a7a54.js","assets/icon.781cca93.js","assets/loader.d1e283c7.js","assets/tooltip.1fb2f0ea.js","assets/scrim.51d512d2.js"]),z(()=>import("./calcite-action.101f7577.js"),["assets/calcite-action.101f7577.js","assets/action.033e9799.js","assets/observers.440ad120.js","assets/interactive.d71a7a54.js","assets/icon.781cca93.js","assets/loader.d1e283c7.js","assets/guid.ae96513b.js"]),z(()=>import("./calcite-tooltip.8ddd4c89.js"),["assets/calcite-tooltip.8ddd4c89.js","assets/tooltip.1fb2f0ea.js","assets/guid.ae96513b.js"]),z(()=>import("./calcite-icon.8b0ddff6.js"),["assets/calcite-icon.8b0ddff6.js","assets/icon.781cca93.js","assets/observers.440ad120.js"])])}destroy(){var e,t;this._destroyFlowItemWidgets(),this._destroySelectedFeatureWidget(),this._destroySpinner(),(e=this._handles)==null||e.destroy(),this._unobserveFeatureMenuObserver(),(t=this._featureMenuIntersectionObserver)==null||t.disconnect(),this._handles=null}get actionsMenuId(){return`${this.id}-actions-menu`}get actionsMenuButtonId(){return`${this.id}-actions-menu-button`}get featureMenuId(){return`${this.id}-feature-menu`}get titleId(){return`${this.id}-popup-title`}get contentId(){return`${this.id}-popup-content`}get hasContent(){const{selectedFeatureWidget:e,viewModel:t}=this;if(!e)return!!(t!=null&&t.content);const i=e.viewModel;if((i==null?void 0:i.waitingForContent)||(i==null?void 0:i.state)==="error")return!0;const s=i==null?void 0:i.content;return Array.isArray(s)?!!s.length:!!s}get featureNavigationVisible(){return this.viewModel.active&&this.viewModel.featureCount>1&&this.visibleElements.featureNavigation}get collapsible(){return!!(this.collapseEnabled&&this.viewModel.title&&this.hasContent)}get featureMenuVisible(){return this.featureNavigationVisible&&this.featureMenuOpen}get contentCollapsed(){return this.collapsible&&!this.featureMenuVisible&&this.collapsed}get dividedActions(){return this._divideActions()}get _activeFlowItemWidget(){const{_flowItems:e}=this;return e.getItemAt(e.length-1)||null}get actions(){return this.viewModel.actions}set actions(e){this.viewModel.actions=e}set actionsMenuOpen(e){this._set("actionsMenuOpen",!!e)}get actionsMenuOpen(){return!!this.viewModel.active&&this._get("actionsMenuOpen")}get autoCloseEnabled(){return this.viewModel.autoCloseEnabled}set autoCloseEnabled(e){this.viewModel.autoCloseEnabled=e}get autoOpenEnabled(){return this.viewModel.autoOpenEnabled}set autoOpenEnabled(e){this.viewModel.autoOpenEnabled=e}get defaultPopupTemplateEnabled(){return this.viewModel.defaultPopupTemplateEnabled}set defaultPopupTemplateEnabled(e){this.viewModel.defaultPopupTemplateEnabled=e}get content(){return this.viewModel.content}set content(e){this.viewModel.content=e}get currentAlignment(){return this._getCurrentAlignment()}get currentDockPosition(){return this._getCurrentDockPosition()}get dockOptions(){return this._get("dockOptions")||BP}set dockOptions(e){const t={...BP},i=this.get("viewModel.view.breakpoints"),s={};i&&(s.width=i.xsmall,s.height=i.xsmall);const r={...t,...e},n={...t.breakpoint,...s},{breakpoint:o}=r;o===!0?r.breakpoint=n:typeof o=="object"&&(r.breakpoint={...n,...o}),this._set("dockOptions",r),this._setCurrentDockPosition(),this.reposition()}get featureCount(){return this.viewModel.featureCount}get features(){return this.viewModel.features}set features(e){this.viewModel.features=e}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get highlightEnabled(){return this.viewModel.highlightEnabled}set highlightEnabled(e){this.viewModel.highlightEnabled=e}get location(){return this.viewModel.location}set location(e){this.viewModel.location=e}get label(){var e,t;return(t=(e=this.messages)==null?void 0:e.widgetLabel)!=null?t:""}set label(e){this._overrideIfSome("label",e)}get promises(){return this.viewModel.promises}set promises(e){this.viewModel.promises=e}get selectedFeature(){return this.viewModel.selectedFeature}get selectedFeatureIndex(){return this.viewModel.selectedFeatureIndex}set selectedFeatureIndex(e){this.viewModel.selectedFeatureIndex=e}get selectedFeatureWidget(){const{_feature:e,visibleElements:t,headingLevel:i,_flowItems:s}=this,{selectedFeatureViewModel:r}=this.viewModel,n={...t,title:!1};return r?(e?(e.viewModel=r,e.visibleElements=n):this._feature=new aoe({flowItems:s,headingLevel:i+1,viewModel:r,visibleElements:n}),this._feature):null}get title(){return this.viewModel.title}set title(e){this.viewModel.title=e}get updateLocationEnabled(){return this.viewModel.updateLocationEnabled}set updateLocationEnabled(e){this.viewModel.updateLocationEnabled=e}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}get visible(){return this.viewModel.visible}set visible(e){this.viewModel.visible=e}castVisibleElements(e){return{...qP,...e}}blur(){const{active:e}=this.viewModel;e||q.getLogger(this.declaredClass).warn("Popup can only be blurred when currently active."),this.visibleElements.closeButton?this._blurClose=!0:this._blurContainer=!0,this.scheduleRender()}clear(){return this.viewModel.clear()}close(){this.visible=!1}fetchFeatures(e,t){return this.viewModel.fetchFeatures(e,t)}focus(){const{active:e}=this.viewModel;e||q.getLogger(this.declaredClass).warn("Popup can only be focused when currently active."),this.visibleElements.closeButton?this._focusClose=!0:this._focusContainer=!0,this.scheduleRender()}next(){return this.viewModel.next()}open(e){var r,n;this._handles.remove(VP);const t=!!e&&!!e.featureMenuOpen,i=!!e&&!!e.actionsMenuOpen,s={collapsed:!!e&&!!e.collapsed,actionsMenuOpen:i,featureMenuOpen:t};((n=(r=this.viewModel)==null?void 0:r.view)==null?void 0:n.widthBreakpoint)==="xsmall"&&(s.collapsed=!0),this.set(s),this.viewModel.open(e),this._shouldFocus(e),this._addSelectedFeatureIndexHandle()}previous(){return this.viewModel.previous()}reposition(){this.renderNow(),this._positionContainer(),this._setCurrentAlignment()}triggerAction(e){return this.viewModel.triggerAction(e)}render(){var g,v,b,_;const{actionsMenuOpen:e,dockEnabled:t,featureMenuVisible:i,dividedActions:s,currentAlignment:r,currentDockPosition:n}=this,{active:o}=this.viewModel,{menuActions:a}=s,l=o&&a.length>1&&e,u=o&&t,d=o&&!t,f=(v=(g=this.selectedFeature)==null?void 0:g.layer)==null?void 0:v.title,m=(_=(b=this.selectedFeature)==null?void 0:b.layer)==null?void 0:_.id,y={[Y.alignTopCenter]:r==="top-center",[Y.alignBottomCenter]:r==="bottom-center",[Y.alignTopLeft]:r==="top-left",[Y.alignBottomLeft]:r==="bottom-left",[Y.alignTopRight]:r==="top-right",[Y.alignBottomRight]:r==="bottom-right",[Y.isDocked]:u,[Y.shadow]:d,[Y.isDockedTopLeft]:n==="top-left",[Y.isDockedTopCenter]:n==="top-center",[Y.isDockedTopRight]:n==="top-right",[Y.isDockedBottomLeft]:n==="bottom-left",[Y.isDockedBottomCenter]:n==="bottom-center",[Y.isDockedBottomRight]:n==="bottom-right",[Y.isFeatureMenuOpen]:i,[Y.isActionsMenuOpen]:l};return P("div",{class:this.classes(Y.base,y),role:"presentation","data-layer-title":f,"data-layer-id":m,bind:this,afterCreate:this._positionContainer,afterUpdate:this._positionContainer},o?[this.renderMainContainer(),this.renderPointer()]:null)}renderLoadingIcon(){return P("span",{"aria-hidden":"true",class:this.classes(Y.icon,Y.iconLoading,Y.rotating)})}renderNavigationLoading(){const{messagesCommon:e}=this;return this.viewModel.pendingPromisesCount?P("div",{key:Un("loading-container"),role:"presentation",class:Y.loadingContainer,"aria-label":e.loading,title:e.loading},this.renderLoadingIcon()):null}renderPreviousIcon(){const e=xn(this.container),t={[Y.iconRightTriangleArrow]:e,[Y.paginationPreviousIconRTL]:e,[Y.iconLeftTriangleArrow]:!e,[Y.paginationPreviousIconLTR]:!e};return P("span",{"aria-hidden":"true",class:this.classes(Y.icon,t)})}renderPreviousButton(){const{messages:e}=this;return P("div",{role:"button",tabIndex:0,bind:this,onclick:this._previous,onkeydown:this._previous,class:this.classes(Y.button,Y.paginationPrevious),"aria-label":e.previous,title:e.previous},this.renderPreviousIcon())}renderNextIcon(){const e=xn(this.container),t={[Y.iconLeftTriangleArrow]:e,[Y.paginationNextIconRTL]:e,[Y.iconRightTriangleArrow]:!e,[Y.paginationNextIconLTR]:!e};return P("span",{"aria-hidden":"true",class:this.classes(Y.icon,t)})}renderNextButton(){const{messages:e}=this;return P("div",{role:"button",tabIndex:0,bind:this,onclick:this._next,onkeydown:this._next,class:this.classes(Y.button,Y.paginationNext),"aria-label":e.next,title:e.next},this.renderNextIcon())}renderFeatureMenuButton(){const{featureMenuOpen:e,featureMenuId:t,messagesCommon:i}=this,{featureCount:s,selectedFeatureIndex:r}=this.viewModel;return P("div",{role:"button",tabIndex:0,bind:this,onclick:this._toggleFeatureMenu,onkeydown:this._toggleFeatureMenu,afterCreate:this._focusFeatureMenuButtonNode,afterUpdate:this._focusFeatureMenuButtonNode,class:this.classes(Y.button,Y.featureMenuButton),"aria-haspopup":"true","aria-controls":t,"aria-expanded":e.toString(),"aria-label":i.menu,title:i.menu},this._getPageText(s,r))}renderNavigationButtons(){return this.featureNavigationVisible?[this.renderPreviousButton(),this.renderNavigationLoading()||this.renderFeatureMenuButton(),this.renderNextButton()]:null}renderDockIcon(){const{dockEnabled:e}=this,t=this._wouldDockTo(),i={[Y.iconUndock]:e,[Y.iconDock]:!e,[Y.iconDockToRight]:!e&&(t==="top-right"||t==="bottom-right"),[Y.iconDockToLeft]:!e&&(t==="top-left"||t==="bottom-left"),[Y.iconDockToTop]:!e&&t==="top-center",[Y.iconDockToBottom]:!e&&t==="bottom-center"};return P("span",{"aria-hidden":"true",class:this.classes(i,Y.icon)})}renderDockButton(){var r,n,o;const{dockEnabled:e,messages:t}=this,i=(n=(r=this.viewModel)==null?void 0:r.view)==null?void 0:n.widthBreakpoint,s=e?t.undock:t.dock;return i!=="xsmall"&&((o=this.dockOptions)==null?void 0:o.buttonEnabled)?P("div",{role:"button","aria-label":s,title:s,tabIndex:0,bind:this,onclick:this._toggleDockEnabled,onkeydown:this._toggleDockEnabled,afterCreate:this._focusDockButtonNode,afterUpdate:this._focusDockButtonNode,class:this.classes(Y.button,Y.buttonDock)},this.renderDockIcon()):null}renderTitle(){const{title:e}=this.viewModel,{titleId:t,collapsible:i,contentCollapsed:s,messagesCommon:r}=this,n={[Y.headerContainerButton]:i},o=P(vT,{level:this.headingLevel,class:Y.headerTitle,innerHTML:e}),a=i?P("button",{key:`${e}--collapsible`,id:t,title:s?r.expand:r.collapse,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(Y.headerContainer,n),"aria-expanded":s?"false":"true",onclick:this._toggleCollapsed,type:"button"},o,P("calcite-icon",{class:Y.collapseIcon,key:"collapse-icon",icon:s?"chevron-down":"chevron-up",scale:"m"})):P("div",{key:e,id:t,bind:this,enterAnimation:this._createFeatureUpdatedAnimation(),class:this.classes(Y.headerContainer,n)},o);return e?a:null}renderCloseIcon(){return P("span",{"aria-hidden":"true",class:this.classes(Y.icon,Y.iconClose)})}renderCloseButton(){const{visibleElements:e,messagesCommon:t}=this;return e.closeButton?P("div",{role:"button",tabIndex:0,bind:this,onclick:this._close,onkeydown:this._close,class:Y.button,"aria-label":t.close,title:t.close,afterCreate:this._closeButtonNodeUpdated,afterUpdate:this._closeButtonNodeUpdated},this.renderCloseIcon()):null}renderHeader(){return P("header",{class:Y.header},this.renderTitle(),P("div",{class:Y.headerButtons},this.renderDockButton(),this.renderCloseButton()))}renderContentContainer(){const{contentId:e,hasContent:t,contentCollapsed:i,_flowItems:s,messagesCommon:r}=this,{content:n}=this.viewModel,o=s.toArray(),a={[Y.contentHasFlows]:!!o.length};return t&&!i?P("div",{key:n,enterAnimation:this._createFeatureUpdatedAnimation(),id:e,class:this.classes(Y.content,a)},P("calcite-flow",{bind:this,onCalciteFlowItemBack:this._handleBackClick},P("calcite-flow-item",{bind:this,"data-node-ref":"_rootFlowItemNode","intl-back":r.back,afterCreate:Z0,key:"root-flow-item"},this.renderContent()),o.map(l=>this.renderFlowItem(l))),o.map(l=>this.renderFlowItemTooltip(l))):null}renderFlowItem(e){const{messages:t,messagesCommon:i}=this,s=Tv();return P("calcite-flow-item",{class:this.classes({[Y.calciteThemeDark]:!s,[Y.calciteThemeLight]:s}),heading:e.title,"intl-back":i.back,description:this._getFlowItemDescription(e),key:`flow-item-${e.viewModel.uid}`},P("calcite-action",{class:Y.actionExit,icon:"move-up",label:t==null?void 0:t.exitRelatedRecords,text:t==null?void 0:t.exitRelatedRecords,slot:"header-actions-start",bind:this,afterCreate:r=>this._storeExitRelatedRecordsAction(e,r),onclick:this._destroyFlowItemWidgets}),P("div",{class:this.classes(Y.contentFlowItem,{[Y.calciteThemeDark]:s,[Y.calciteThemeLight]:!s})},e.render()))}renderFlowItemTooltip(e){const{messages:t,_exitRelatedRecordsActions:i}=this,s=Tv();return P("calcite-tooltip",{class:this.classes({[Y.calciteThemeDark]:!s,[Y.calciteThemeLight]:s}),key:`exit-related-records-tooltip-${e.viewModel.uid}`,label:t==null?void 0:t.exitRelatedRecords,overlayPositioning:"fixed",referenceElement:i.get(e),placement:"top"},t==null?void 0:t.exitRelatedRecords)}renderActionsMenuButton(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:s,messagesCommon:r}=this,n=i?r.close:r.open,{menuActions:o}=s;return o.length?P("div",{key:Un("actions-menu-button"),class:this.classes(Y.button,Y.actionsMenuButton),role:"button",id:t,"aria-haspopup":"true","aria-controls":i?e:null,tabIndex:0,bind:this,onclick:this._toggleActionsMenu,onkeydown:this._toggleActionsMenu,afterCreate:this._focusActionsMenuButtonNode,afterUpdate:this._focusActionsMenuButtonNode,"aria-label":n,title:n},P("span",{"aria-hidden":"true",class:Y.iconActionsMenu})):null}renderMenuActions(){const{actionsMenuId:e,actionsMenuButtonId:t,actionsMenuOpen:i,dividedActions:s}=this,{menuActions:r}=s;return r.length&&i?P("ul",{id:e,role:"menu","aria-labelledby":t,key:Un("actions"),class:Y.actions,bind:this,onkeyup:this._handleActionMenuKeyup,afterCreate:this._actionsMenuNodeUpdated,afterUpdate:this._actionsMenuNodeUpdated},r.toArray().map(n=>this.renderAction({action:n,type:"menu-item"}))):null}renderInlineActions(){const{inlineActions:e}=this.dividedActions;return!!e.length&&e.toArray().map(t=>this.renderAction({action:t,type:"inline"}))}renderInlineActionsContainer(){const{inlineActions:e,menuActions:t}=this.dividedActions,i=!!e.length,s=!!t.length;return i||s?P("div",{key:"inline-actions-container","data-inline-actions":i.toString(),"data-menu-actions":s.toString(),class:Y.inlineActionsContainer},this.renderInlineActions(),this.renderActionsMenuButton(),this.renderMenuActions()):null}renderNavigation(){return this.featureNavigationVisible?P("section",{key:Un("navigation"),class:this.classes(Y.navigation)},this.renderNavigationButtons()):null}renderFooter(){const{featureNavigationVisible:e,dividedActions:t}=this,{inlineActions:i,menuActions:s}=t,r=!!i.length,n=!!s.length,o={[Y.footerHasPagination]:e,[Y.footerHasActions]:r,[Y.footerHasActionsMenu]:n};return e||r?P("div",{key:Un("feature-buttons"),class:this.classes(Y.footer,o)},this.renderInlineActionsContainer(),this.renderNavigation()):null}renderFeatureMenuContainer(){const{messages:e}=this,{featureViewModels:t,isLoadingFeature:i}=this.viewModel,s=fn(e.selectedFeatures,{total:t.length});return P("section",{key:Un("menu"),class:Y.featureMenu},P("strong",{class:Y.featureMenuHeader},s),P("nav",{bind:this,class:Y.featureMenuViewport,"data-node-ref":"_featureMenuViewportNode",afterCreate:Z0},this.renderFeatureMenu(),P("div",{class:Y.featureMenuObserver,bind:this,afterCreate:this._featureMenuIntersectionObserverCreated}),i?P("div",{class:Y.featureMenuLoader},this.renderLoadingIcon()):null))}renderPointer(){return this.dockEnabled?null:P("div",{key:Un("pointer"),class:Y.pointer,role:"presentation"},P("div",{class:this.classes(Y.pointerDirection,Y.shadow)}))}renderMainContainer(){const{dockEnabled:e,currentAlignment:t,currentDockPosition:i,titleId:s,contentId:r,collapsible:n,hasContent:o,contentCollapsed:a,visibleElements:l}=this,{title:u}=this.viewModel,d=t==="bottom-left"||t==="bottom-center"||t==="bottom-right"||i==="top-left"||i==="top-center"||i==="top-right",f=t==="top-left"||t==="top-center"||t==="top-right"||i==="bottom-left"||i==="bottom-center"||i==="bottom-right",m={[Y.shadow]:e,[Y.isCollapsible]:n,[Y.isCollapsed]:a};return P("div",{class:this.classes(Y.main,Y.widget,m),tabIndex:l.closeButton?null:-1,role:"dialog","aria-labelledby":u?s:"","aria-describedby":o&&!a?r:"",bind:this,onkeyup:this._handleMainKeyup,afterCreate:this._mainContainerNodeUpdated,afterUpdate:this._mainContainerNodeUpdated},d?this.renderFooter():null,d?this.renderFeatureMenuContainer():null,this.renderHeader(),this.renderContentContainer(),f?this.renderFooter():null,f?this.renderFeatureMenuContainer():null)}renderContent(){var t;const e=(t=this.viewModel)==null?void 0:t.content;return e?typeof e=="string"?P("div",{class:ft.contentNode,key:e,innerHTML:e}):this.renderNodeContent(e):null}renderActionText(e){return P("span",{key:"text",class:Y.actionText},e)}renderActionIcon(e){const t=this._getActionClass(e),i=this._getActionImage(e),s={[Y.iconLoading]:e.active,[Y.rotating]:e.active,[Y.icon]:!!t,[Y.actionImage]:!e.active&&!!i};return t&&(s[t]=!e.active),P("span",{key:"icon","aria-hidden":"true",class:this.classes(Y.icon,s),styles:this._getIconStyles(i)})}renderAction(e){const{action:t,type:i}=e,s=this._getActionTitle(t),r={[Y.action]:t.type!=="toggle",[Y.actionToggle]:t.type==="toggle",[Y.actionToggleOn]:t.type==="toggle"&&t.value,[Y.buttonDisabled]:t.disabled},n=[this.renderActionIcon(t),this.renderActionText(s)],o=i==="menu-item"?P("li",{key:t.uid,role:"menuitem",tabIndex:0,title:s,"aria-label":s,class:this.classes(Y.button,r),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},n):P("div",{key:t.uid,role:"button",tabIndex:0,title:s,"aria-label":s,class:this.classes(Y.button,r),onkeyup:this._handleActionMenuItemKeyup,bind:this,"data-action-uid":t.uid,onclick:this._triggerAction,onkeydown:this._triggerAction},n);return t.visible?o:null}renderFeatureMenuItem(e,t){const{messages:i,messagesCommon:s}=this,{selectedFeatureIndex:r,selectedFeatureViewModel:n}=this.viewModel,o=e===n,a={[Y.featureMenuSelected]:o},l=o?P("span",{key:Un(`feature-menu-selected-feature-${r}`),title:i.selectedFeature,"aria-label":i.selectedFeature,class:Y.iconCheckMark}):null,u=P("span",{innerHTML:e.title||s.untitled});return P("li",{role:"menuitem",tabIndex:-1,key:Un(`feature-menu-feature-${r}`),class:this.classes(a,Y.featureMenuItem),bind:this,"data-feature-index":t,onblur:this._removeActiveFeature,onfocus:this._setActiveFeature,onkeyup:this._handleFeatureMenuItemKeyup,onclick:this._selectFeature,onkeydown:this._selectFeature,onmouseover:this._setActiveFeature,onmouseleave:this._removeActiveFeature},P("span",{class:Y.featureMenuTitle},u,l))}renderFeatureMenu(){const{featureMenuId:e}=this,{featureViewModels:t}=this.viewModel;return t.length>1?P("ol",{class:Y.featureMenuList,id:e,bind:this,afterCreate:this._featureMenuNodeUpdated,afterUpdate:this._featureMenuNodeUpdated,onkeyup:this._handleFeatureMenuKeyup,role:"menu"},t.filter(i=>!!i.graphic).map((i,s)=>this.renderFeatureMenuItem(i,s))):null}_storeExitRelatedRecordsAction(e,t){this._exitRelatedRecordsActions.set(e,t),this.scheduleRender()}_getFlowItemDescription(e){return"featureCountDescription"in e?e.featureCountDescription:e.viewModel.description}_destroyFlowItemWidgets(){this._flowItems.removeAll().forEach(e=>{"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e.viewModel=null,e.destroy()})}_handleBackClick(){const e=this._flowItems.pop();this._exitRelatedRecordsActions.delete(e),"showAllEnabled"in e.viewModel&&(e.viewModel.showAllEnabled=!1),e&&(e.viewModel=null,e.destroy())}_getActionTitle(e){const{messages:t,selectedFeature:i,messagesCommon:s}=this,{id:r}=e,n=i==null?void 0:i.attributes,o=r==="zoom-to-feature"?fn(e.title,{messages:t}):r==="remove-selected-feature"?fn(e.title,{messages:s}):r==="zoom-to-clustered-features"||r==="browse-clustered-features"?fn(e.title,{messages:t}):e.title;return o&&n?fn(o,n):o}_getActionClass(e){const{selectedFeature:t}=this,i=t==null?void 0:t.attributes,{className:s,image:r}=e,n=r||s?s:Y.iconDefaultAction;return n&&i?fn(n,i):n}_getActionImage(e){const{selectedFeature:t}=this,i=t==null?void 0:t.attributes,{image:s}=e;return s&&i?fn(s,i):s}_createFeatureUpdatedAnimation(){return KB("enter",Y.hasFeatureUpdated)}_getInlineActionCount(){const{maxInlineActions:e,featureNavigationVisible:t}=this;if(typeof e!="number")return null;const i=Math.round(e);return Math.max(t?i-1:i,0)}_watchActions(){const{allActions:e}=this.viewModel;this.notifyChange("dividedActions");const t="actions";this._handles.remove(t),e&&e.forEach(i=>{this._handles.add(Z(()=>[i.uid,i.active,i.className,i.disabled,i.id,i.title,i.image,i.visible],()=>this.scheduleRender()),t)})}_divideActions(){const{allActions:e}=this.viewModel,t=e.filter(n=>n.visible),i=this._getInlineActionCount(),s=i===null,r=i===0;return{inlineActions:s?t.slice(0):r?new he:t.slice(0,i),menuActions:s?new he:r?t.slice(0):t.slice(i)}}_featureMenuOpenChanged(e){e?this._focusFirstFeature=!0:this._focusFeatureMenuButton=!0}_actionsMenuOpenChanged(e){e?this._focusFirstAction=!0:this._focusActionsMenuButton=!0}_setTitleFromFeatureWidget(){var i,s;const{selectedFeatureWidget:e,messagesCommon:t}=this;e&&(this.viewModel.title=((i=e.viewModel)==null?void 0:i.state)==="error"?t.errorMessage:((s=e.viewModel)==null?void 0:s.title)||"")}_setContentFromFeatureWidget(){const{selectedFeatureWidget:e}=this;e&&(this.viewModel.content=e)}_unobserveFeatureMenuObserver(){this._featureMenuIntersectionObserverNode&&this._featureMenuIntersectionObserver.unobserve(this._featureMenuIntersectionObserverNode)}_featureMenuIntersectionObserverCreated(e){this._unobserveFeatureMenuObserver(),this._featureMenuIntersectionObserver.observe(e),this._featureMenuIntersectionObserverNode=e}_handleFeatureMenuKeyup(e){yc(e)==="Escape"&&(e.stopPropagation(),this._focusFeatureMenuButton=!0,this.featureMenuOpen=!1,this.scheduleRender())}_handleActionMenuKeyup(e){yc(e)==="Escape"&&(e.stopPropagation(),this._focusActionsMenuButton=!0,this.actionsMenuOpen=!1,this.scheduleRender())}_setActiveFeature(e){const{viewModel:t}=this,i=e.currentTarget["data-feature-index"];t.activeFeature=t.features[i]||null}_removeActiveFeature(){this.viewModel.activeFeature=null}_handleFeatureMenuItemKeyup(e){const t=yc(e),{_featureMenuNode:i}=this,s=e.currentTarget["data-feature-index"];if(!i)return;const r=i.querySelectorAll("li"),n=r.length;t!=="ArrowUp"?t!=="ArrowDown"?t!=="Home"?t!=="End"||(e.stopPropagation(),r[r.length-1].focus()):(e.stopPropagation(),r[0].focus()):(e.stopPropagation(),r[(s+1+n)%n].focus()):(e.stopPropagation(),r[(s-1+n)%n].focus())}_handleActionMenuItemKeyup(e){const t=yc(e),{_actionsMenuNode:i}=this,s=e.currentTarget.dataset.actionUid,{menuActions:r}=this.dividedActions,n=r.findIndex(l=>l.uid===s);if(!i)return;const o=i.querySelectorAll("li"),a=o.length;t!=="ArrowUp"?t!=="ArrowDown"?t!=="Home"?t!=="End"||(e.stopPropagation(),o[o.length-1].focus()):(e.stopPropagation(),o[0].focus()):(e.stopPropagation(),o[(n+1+a)%a].focus()):(e.stopPropagation(),o[(n-1+a)%a].focus())}_handleMainKeyup(e){const t=yc(e);t==="ArrowLeft"&&(e.stopPropagation(),this.previous()),t==="ArrowRight"&&(e.stopPropagation(),this.next())}_spinnerEnabledChange(e){if(this._destroySpinner(),!e)return;const t=this.get("viewModel.view");this._createSpinner(t)}_hideSpinner(){const{_spinner:e}=this;e&&(e.location=null,e.hide())}_displaySpinner(){const{_spinner:e}=this;if(!e)return;const{location:t,waitingForResult:i}=this.viewModel;i?e.show({location:t}):e.hide()}_getIconStyles(e){return{"background-image":e?`url(${e})`:""}}async _shouldFocus(e){e.shouldFocus&&(await ub(()=>{var t;return((t=this.viewModel)==null?void 0:t.active)===!0}),this.focus())}_addSelectedFeatureIndexHandle(){const e=Z(()=>{var t;return(t=this.viewModel)==null?void 0:t.selectedFeatureIndex},(t,i)=>this._selectedFeatureIndexUpdated(t,i));this._handles.add(e,VP)}_selectedFeatureIndexUpdated(e,t){const{featureCount:i}=this;i&&e!==t&&e!==-1&&(this._destroyFlowItemWidgets(),this.actionsMenuOpen=!1,this.featureMenuOpen=!1,this._mainContainerNode&&(this._mainContainerNode.scrollTop=0),this._rootFlowItemNode&&this._rootFlowItemNode.scrollContentTo({top:0}))}_destroySelectedFeatureWidget(){const{_feature:e}=this;e&&(e.viewModel=null,e&&!e.destroyed&&e.destroy()),this._feature=null}_isScreenLocationWithinView(e,t){return e.x>-1&&e.y>-1&&e.x<=t.width&&e.y<=t.height}_isOutsideView(e){const{popupHeight:t,popupWidth:i,screenLocation:s,side:r,view:n}=e;if(isNaN(i)||isNaN(t)||!n||!s)return!1;const o=n.padding;return r==="right"&&s.x+i/2>n.width-o.right||r==="left"&&s.x-i/2n.height-o.bottom}_calculateAutoAlignment(e){if(e!=="auto")return e;const{_pointerOffsetInPx:t,_containerNode:i,_mainContainerNode:s,viewModel:r}=this,{screenLocation:n,view:o}=r;if(N(n)||!o||!i)return"top-center";if(!this._isScreenLocationWithinView(n,o))return this._get("currentAlignment")||"top-center";function a($){return parseInt($.replace(/[^-\d\.]/g,""),10)}const l=s?window.getComputedStyle(s,null):null,u=l?a(l.getPropertyValue("max-height")):0,d=l?a(l.getPropertyValue("height")):0,{height:f,width:m}=i.getBoundingClientRect(),y=m+t,g=Math.max(f,u,d)+t,v=this._isOutsideView({popupHeight:g,popupWidth:y,screenLocation:n,side:"right",view:o}),b=this._isOutsideView({popupHeight:g,popupWidth:y,screenLocation:n,side:"left",view:o}),_=this._isOutsideView({popupHeight:g,popupWidth:y,screenLocation:n,side:"top",view:o}),x=this._isOutsideView({popupHeight:g,popupWidth:y,screenLocation:n,side:"bottom",view:o});return b?_?"bottom-right":"top-right":v?_?"bottom-left":"top-left":_?x?"top-center":"bottom-center":"top-center"}_callCurrentAlignment(e){return typeof e=="function"?e.call(this):e}_getCurrentAlignment(){const{alignment:e,dockEnabled:t}=this;return t||!this.viewModel.active?null:this._calculatePositionResult(this._calculateAutoAlignment(this._callCurrentAlignment(e)))}_setCurrentAlignment(){this._set("currentAlignment",this._getCurrentAlignment())}_setCurrentDockPosition(){this._set("currentDockPosition",this._getCurrentDockPosition())}_calculatePositionResult(e){const t=["left","right"];return xn(this.container)&&t.reverse(),e.replace(/leading/gi,t[0]).replace(/trailing/gi,t[1])}_callDockPosition(e){return typeof e=="function"?e.call(this):e}_getDockPosition(){var e;return this._calculatePositionResult(this._calculateAutoDockPosition(this._callDockPosition((e=this.dockOptions)==null?void 0:e.position)))}_getCurrentDockPosition(){return this.dockEnabled&&this.viewModel.active?this._getDockPosition():null}_wouldDockTo(){return this.dockEnabled?null:this._getDockPosition()}_calculateAutoDockPosition(e){var o;if(e!=="auto")return e;const t=(o=this.viewModel)==null?void 0:o.view,i=xn(this.container)?"top-left":"top-right";if(!t)return i;const s=t.padding||{left:0,right:0,top:0,bottom:0},r=t.width-s.left-s.right,{breakpoints:n}=t;return n&&r<=n.xsmall?"bottom-center":i}_positionContainer(e=this._containerNode){if(e&&(this._containerNode=e),!e)return;const{screenLocation:t}=this.viewModel,{width:i}=e.getBoundingClientRect(),s=this._calculatePositionStyle(t,i);s&&(e.style.top=s.top,e.style.left=s.left,e.style.bottom=s.bottom,e.style.right=s.right)}_calculateFullWidth(e){const{currentAlignment:t,_pointerOffsetInPx:i}=this;return t==="top-left"||t==="bottom-left"||t==="top-right"||t==="bottom-right"?e+i:e}_calculateAlignmentPosition(e,t,i,s){const{currentAlignment:r,_pointerOffsetInPx:n}=this,o=s/2,a=i.height-t,l=i.width-e,{padding:u}=this.view;return r==="bottom-center"?{top:t+n-u.top,left:e-o-u.left}:r==="top-left"?{bottom:a+n-u.bottom,right:l+n-u.right}:r==="bottom-left"?{top:t+n-u.top,right:l+n-u.right}:r==="top-right"?{bottom:a+n-u.bottom,left:e+n-u.left}:r==="bottom-right"?{top:t+n-u.top,left:e+n-u.left}:r==="top-center"?{bottom:a+n-u.bottom,left:e-o-u.left}:void 0}_calculatePositionStyle(e,t){const{dockEnabled:i,view:s}=this;if(!s)return;if(i)return{left:"",top:"",right:"",bottom:""};if(N(e)||!t)return;const r=this._calculateFullWidth(t),n=this._calculateAlignmentPosition(e.x,e.y,s,r);return n?{top:n.top!==void 0?`${n.top}px`:"auto",left:n.left!==void 0?`${n.left}px`:"auto",bottom:n.bottom!==void 0?`${n.bottom}px`:"auto",right:n.right!==void 0?`${n.right}px`:"auto"}:void 0}_viewChange(e,t){e&&t&&(this.close(),this.clear())}_viewReadyChange(e,t){if(e){const i=this.get("viewModel.view");this._wireUpView(i)}else t&&(this.close(),this.clear())}_wireUpView(e){if(this._destroySpinner(),!e)return;const{spinnerEnabled:t}=this;t&&this._createSpinner(e),this._setDockEnabledForViewSize(this.dockOptions)}_dockingThresholdCrossed(e,t,i){const[s,r]=e,[n,o]=t,{width:a,height:l}=i;return s<=a&&n>a||s>a&&n<=a||r<=l&&o>l||r>l&&o<=l}_updateDockEnabledForViewSize(e,t){if(!e||!t)return;const i=this.get("viewModel.view.padding")||{left:0,right:0,top:0,bottom:0},s=i.left+i.right,r=i.top+i.bottom,n=[],o=[];n[0]=e[0]-s,n[1]=e[1]-r,o[0]=t[0]-s,o[1]=t[1]-r;const{dockOptions:a}=this,l=a.breakpoint;this._dockingThresholdCrossed(n,o,l)&&this._setDockEnabledForViewSize(a),this._setCurrentDockPosition()}_focusDockButtonNode(e){this._focusDockButton&&(this._focusDockButton=!1,e.focus())}_closeButtonNodeUpdated(e){return this._focusClose?(this._focusClose=!1,void e.focus()):this._blurClose?(this._blurClose=!1,void e.blur()):void 0}_mainContainerNodeUpdated(e){return this._mainContainerNode=e,this._focusContainer?(this._focusContainer=!1,void e.focus()):this._blurContainer?(this._blurContainer=!1,void e.blur()):void 0}_featureMenuNodeUpdated(e){if(this._featureMenuNode=e,!e||!this._focusFirstFeature)return;this._focusFirstFeature=!1;const t=e.querySelectorAll("li");t.length&&t[0].focus()}_actionsMenuNodeUpdated(e){if(this._actionsMenuNode=e,!e||!this._focusFirstAction)return;this._focusFirstAction=!1;const t=e.querySelectorAll("li");t.length&&t[0].focus()}_focusFeatureMenuButtonNode(e){this._focusFeatureMenuButton&&(this._focusFeatureMenuButton=!1,e.focus())}_focusActionsMenuButtonNode(e){this._focusActionsMenuButton&&(this._focusActionsMenuButton=!1,e.focus())}_featureMenuViewportScrollTop(){this._featureMenuViewportNode&&(this._featureMenuViewportNode.scrollTop=0)}_toggleScreenLocationEnabled(){const{dockEnabled:e,viewModel:t}=this;if(!t)return;const i=t.active&&!e;t.screenLocationEnabled=i}_shouldDockAtCurrentViewSize(e){var a,l;const t=e.breakpoint,i=(l=(a=this.viewModel)==null?void 0:a.view)==null?void 0:l.ui;if(!i)return!1;const{width:s,height:r}=i;if(isNaN(s)||isNaN(r))return!1;const n=t.hasOwnProperty("width")&&s<=t.width,o=t.hasOwnProperty("height")&&r<=t.height;return n||o}_setDockEnabledForViewSize(e){e.breakpoint&&(this.dockEnabled=this._shouldDockAtCurrentViewSize(e))}_getPageText(e,t){return this.featureNavigationVisible?fn(this.messages.pageText,{index:t+1,total:e}):null}_destroySpinner(){const{_spinner:e,view:t}=this;e&&(t&&t.ui&&t.ui.remove(this._spinner,zP),e.destroy(),this._spinner=null)}_createSpinner(e){e&&(this._spinner=new coe({view:e}),e.ui.add(this._spinner,{key:zP,position:"manual"}))}_toggleCollapsed(){this.collapsed=!this.collapsed}_close(){this.close(),this.view&&this.view.focus()}_toggleDockEnabled(){this.dockEnabled=!this.dockEnabled,this._focusDockButton=!0,this.scheduleRender()}_toggleFeatureMenu(){const e=!this.featureMenuOpen;this._featureMenuOpenChanged(e),this.actionsMenuOpen=!1,this.featureMenuOpen=e}_toggleActionsMenu(){const e=!this.actionsMenuOpen;this._actionsMenuOpenChanged(e),this.featureMenuOpen=!1,this.actionsMenuOpen=e}_triggerAction(e){const t=e.currentTarget.dataset.actionUid,{allActions:i}=this.viewModel,s=i.findIndex(n=>n.uid===t),r=i.getItemAt(s);r&&r.type==="toggle"&&(r.value=!r.value),this.actionsMenuOpen=!1,this.viewModel.triggerAction(s)}_selectFeature(e){const t=e.currentTarget["data-feature-index"];isNaN(t)||(this.viewModel.selectedFeatureIndex=t),this.featureMenuOpen=!1,this._focusFeatureMenuButton=!0,this.scheduleRender()}_next(){this.next()}_previous(){this.previous()}};c([h({readOnly:!0})],ce.prototype,"actionsMenuId",null),c([h({readOnly:!0})],ce.prototype,"actionsMenuButtonId",null),c([h({readOnly:!0})],ce.prototype,"featureMenuId",null),c([h({readOnly:!0})],ce.prototype,"titleId",null),c([h({readOnly:!0})],ce.prototype,"contentId",null),c([h({readOnly:!0})],ce.prototype,"hasContent",null),c([h({readOnly:!0})],ce.prototype,"featureNavigationVisible",null),c([h({readOnly:!0})],ce.prototype,"collapsible",null),c([h({readOnly:!0})],ce.prototype,"featureMenuVisible",null),c([h({readOnly:!0})],ce.prototype,"contentCollapsed",null),c([h({readOnly:!0})],ce.prototype,"dividedActions",null),c([h({readOnly:!0,dependsOn:["_flowItems.length"]})],ce.prototype,"_activeFlowItemWidget",null),c([h()],ce.prototype,"actions",null),c([h()],ce.prototype,"actionsMenuOpen",null),c([h()],ce.prototype,"alignment",void 0),c([h()],ce.prototype,"autoCloseEnabled",null),c([h()],ce.prototype,"autoOpenEnabled",null),c([h()],ce.prototype,"defaultPopupTemplateEnabled",null),c([h()],ce.prototype,"content",null),c([h()],ce.prototype,"collapsed",void 0),c([h()],ce.prototype,"collapseEnabled",void 0),c([h({readOnly:!0})],ce.prototype,"currentAlignment",null),c([h({readOnly:!0})],ce.prototype,"currentDockPosition",null),c([h()],ce.prototype,"dockOptions",null),c([h()],ce.prototype,"dockEnabled",void 0),c([h({readOnly:!0})],ce.prototype,"featureCount",null),c([h()],ce.prototype,"featureMenuOpen",void 0),c([h()],ce.prototype,"features",null),c([h()],ce.prototype,"goToOverride",null),c([h()],ce.prototype,"headingLevel",void 0),c([h()],ce.prototype,"highlightEnabled",null),c([h()],ce.prototype,"location",null),c([h()],ce.prototype,"label",null),c([h()],ce.prototype,"maxInlineActions",void 0),c([h(),di("esri/widgets/Popup/t9n/Popup")],ce.prototype,"messages",void 0),c([h(),di("esri/t9n/common")],ce.prototype,"messagesCommon",void 0),c([h()],ce.prototype,"promises",null),c([h({readOnly:!0})],ce.prototype,"selectedFeature",null),c([h()],ce.prototype,"selectedFeatureIndex",null),c([h({readOnly:!0})],ce.prototype,"selectedFeatureWidget",null),c([h()],ce.prototype,"spinnerEnabled",void 0),c([h()],ce.prototype,"title",null),c([h()],ce.prototype,"updateLocationEnabled",null),c([h()],ce.prototype,"view",null),c([h({type:oj}),CK(["triggerAction","trigger-action"])],ce.prototype,"viewModel",void 0),c([h()],ce.prototype,"visible",null),c([h()],ce.prototype,"visibleElements",void 0),c([Oe("visibleElements")],ce.prototype,"castVisibleElements",null),c([xs()],ce.prototype,"_close",null),c([xs()],ce.prototype,"_toggleDockEnabled",null),c([xs()],ce.prototype,"_toggleFeatureMenu",null),c([xs()],ce.prototype,"_toggleActionsMenu",null),c([xs()],ce.prototype,"_triggerAction",null),c([xs()],ce.prototype,"_selectFeature",null),c([xs()],ce.prototype,"_next",null),c([xs()],ce.prototype,"_previous",null),ce=c([S("esri.widgets.Popup")],ce);const GP=ce,Pw=[0,0];function Zoe(e){var s,r;const t=(e.ownerDocument||window.document).defaultView,i=e.getBoundingClientRect();return Pw[0]=i.left+((s=t==null?void 0:t.pageXOffset)!=null?s:0),Pw[1]=i.top+((r=t==null?void 0:t.pageYOffset)!=null?r:0),Pw}function WP(e){e&&(CR(e),e.parentNode&&e.parentNode.removeChild(e))}function Qoe(e){const t=document.createElement("div");return e.appendChild(t),t}const Ud=16,By=750,Koe=512,eae=2,tae=e=>{let t=class extends e{constructor(...i){var s;super(...i),this._freqInfo={freq:Ud,time:By},this._overlayRenderTaskHandle=null,this.height=0,this.overlay=null,this.position=null,this.resizing=!1,this.root=null,this.surface=null,this.suspended=!0,this.ui=null,this.userContent=null,this.width=0,this.widthBreakpoint=null,i.length!==0&&((s=i[0])==null?void 0:s.popup)!==void 0||(this.popup=new GP({view:this})),this.handles.add([Z(()=>this.cursor,r=>{const{surface:n}=this;n&&n.setAttribute("data-cursor",r)}),Z(()=>this.interacting,r=>{const{surface:n}=this;n&&n.setAttribute("data-interacting",r.toString())})])}initialize(){this.handles.add(Z(()=>this.ui,(i,s)=>this._handleUIChange(i,s))),this._wireUI(this.ui),this.handles.add([this.on("focus",()=>this.notifyChange("focused")),this.on("blur",()=>this.notifyChange("focused"))])}destroy(){this.destroyed||(this.ui=$t(this.ui),this.popup&&!this.popup.destroyed&&this.popup.destroy(),this.container=null)}get container(){var i;return(i=this._get("container"))!=null?i:null}set container(i){const s=this._get("container"),r=r$(i),n=r instanceof HTMLDivElement?r:null;if(n||typeof i!="string"||q.getLogger(this.declaredClass).error("#container",`element with id '${i}' not found`),s===n)return;const o="dom-size";if(this.handles.remove(o),this._stopMeasuring(),s&&(s.classList.remove("esri-view"),this._overlayRenderTaskHandle&&(this._overlayRenderTaskHandle.remove(),this._overlayRenderTaskHandle=null),this.overlay&&(this.overlay.destroy(),this._set("overlay",null)),this.root&&(WP(this.root),this._set("root",null)),this.userContent&&(pE(this.userContent,s),WP(this.userContent),this._set("userContent",null))),!n)return this._set("width",0),this._set("height",0),this._set("position",null),this._set("suspended",!0),this._set("surface",null),void this._set("container",null);n.classList.add("esri-view");const a=document.createElement("div");a.className="esri-view-user-storage",pE(n,a),n.appendChild(a),this._set("userContent",a);const l=document.createElement("div");l.className="esri-view-root",n.insertBefore(l,n.firstChild),this._set("root",l);const u=document.createElement("div");u.className="esri-view-surface",u.setAttribute("role","application"),u.tabIndex=0,l.appendChild(u),this._set("surface",u);const d=new Zk;l.appendChild(d.surface),this._set("overlay",d),Z(()=>d.needsRender,f=>{f&&!this._overlayRenderTaskHandle?this._overlayRenderTaskHandle=Dh({render:()=>{var m;return(m=this.overlay)==null?void 0:m.render()}}):this._overlayRenderTaskHandle=Bt(this._overlayRenderTaskHandle)}),this.forceDOMReadyCycle(),this.handles.add(Z(()=>this.size,f=>{const[m,y]=f,g="esri-view-surface--inset-outline";m>=document.body.clientWidth||y>=document.body.clientHeight?u.classList.add(g):u.classList.remove(g)},Le),o),this._set("container",n),this._startMeasuring()}get focused(){const i=document.activeElement===this.surface;return document.hasFocus()&&i}set popup(i){const s=this._get("popup");s&&s!==i&&s.destroy(),this._set("popup",i)}get size(){return[this.width,this.height]}blur(){this.surface&&this.surface.blur()}focus(){this.surface&&this.surface.focus()}pageToContainer(i,s,r){const n=this.position;return i-=n?n[0]:0,s-=n?n[1]:0,r?(r[0]=i,r[1]=s):r=[i,s],r}containerToPage(i,s,r){const n=this.position;return i+=n?n[0]:0,s+=n?n[1]:0,r?(r[0]=i,r[1]=s):r=[i,s],r}_handleUIChange(i,s){s&&(this.handles.remove("ui"),s.destroy()),i&&this._wireUI(i),this._set("ui",i)}_wireUI(i){this.handles.remove("ui"),i&&(i.view=this,this.handles.add([Z(()=>this.root,s=>{i.container=s?Qoe(s):null},Le),Z(()=>this.popup,(s,r)=>{const n="popup",o="manual";r&&i.remove(r,n),s&&(s.view=i.view,i.add(s,{key:n,position:o}))},Le)],"ui"))}_stopMeasuring(){this.handles.remove("measuring"),this._get("resizing")&&this._set("resizing",!1)}_startMeasuring(){const i=this._freqInfo;i.freq=Ud,i.time=By,this.handles.add([(()=>{const s=()=>{i.freq=Ud,i.time=By};return window.addEventListener("resize",s),{remove(){window.removeEventListener("resize",s)}}})(),Dh({prepare:s=>{const r=this._measure(),n=this._freqInfo;if(n.time+=s.deltaTime,r&&(n.freq=Ud,this._get("resizing")||this._set("resizing",!0)),n.time=Koe&&this._get("resizing")&&this._set("resizing",!1)}})],"measuring"),this._measure(),this._position()}_measure(){const i=this.container,s=i?i.clientWidth:0,r=i?i.clientHeight:0;if(s===0||r===0)return this.suspended||this._set("suspended",!0),!1;const n=this.width,o=this.height;return s===n&&r===o?(this.suspended&&this._set("suspended",!1),!1):(this._set("width",s),this._set("height",r),this.suspended&&this._set("suspended",!1),this.emit("resize",{oldWidth:n,oldHeight:o,width:s,height:r}),!0)}_position(){const i=this.container,s=this.position,r=i&&Zoe(i);return!!r&&(!s||r[0]!==s[0]||r[1]!==s[1])&&(this._set("position",[r[0],r[1]]),!0)}forceDOMReadyCycle(){}};return c([h()],t.prototype,"container",null),c([h({readOnly:!0})],t.prototype,"focused",null),c([h({readOnly:!0})],t.prototype,"height",void 0),c([h({type:GP})],t.prototype,"popup",null),c([h({type:Zk})],t.prototype,"overlay",void 0),c([h({readOnly:!0})],t.prototype,"position",void 0),c([h({readOnly:!0})],t.prototype,"resizing",void 0),c([h({readOnly:!0})],t.prototype,"root",void 0),c([h({value:null,readOnly:!0})],t.prototype,"size",null),c([h({readOnly:!0})],t.prototype,"surface",void 0),c([h({readOnly:!0})],t.prototype,"suspended",void 0),c([h()],t.prototype,"ui",void 0),c([h({readOnly:!0})],t.prototype,"userContent",void 0),c([h({readOnly:!0})],t.prototype,"width",void 0),c([h()],t.prototype,"widthBreakpoint",void 0),t=c([S("esri.views.DOMContainer")],t),t},iae=e=>{let t=class extends e{async fetchPopupFeatures(i,s){await this.when();const{location:r,queryArea:n,layerViewsAndGraphics:o,clientOnlyGraphics:a}=await this._prepareFetchPopupFeatures(i,s),l=Promise.resolve(a),u=this._queryLayerPopupFeatures(n,o,s),d=u.map(f=>f.promise);return{location:r,clientOnlyGraphics:a,allGraphicsPromise:mz([l,...d]).then(f=>Array.from(new Set(f.flat()))),promisesPerLayerView:u}}_queryLayerPopupFeatures(i,s,r){return s.map(({layerView:n,graphics:o})=>{const a={clientGraphics:o,event:M(r)?r.event:null,signal:M(r)?r.signal:null,defaultPopupTemplateEnabled:!!M(r)&&!!r.defaultPopupTemplateEnabled},l=n.fetchPopupFeatures(i,a);return{layerView:n,promise:l}})}_isValidPopupGraphic(i,s){return i&&!!i.getEffectivePopupTemplate(M(s)&&s.defaultPopupTemplateEnabled)}async _prepareFetchPopupFeatures(i,s){const{clientGraphics:r,queryArea:n,location:o}=await this._popupHitTestGraphics(i,s),a=this._getFetchPopupLayerViews(),{layerViewsAndGraphics:l,clientOnlyGraphics:u}=this._graphicsPerFetchPopupLayerView(r,a);return{clientOnlyGraphics:u,layerViewsAndGraphics:l,queryArea:n,location:o}}async _popupHitTestGraphics(i,s){const{results:r,mapPoint:n}=await this.popupHitTest(i),o=r.filter(l=>l.type==="graphic"&&this._isValidPopupGraphic(l.graphic,s)),a=o.length?o[0].mapPoint:null;return{clientGraphics:o.map(l=>l.graphic),queryArea:n,location:n||a}}_getFetchPopupLayerViews(){const i=[];return this.allLayerViews.forEach(s=>{this._isValidPopupLayerView(s)&&i.push(s)}),M(this.graphicsView)&&this._isValidPopupLayerView(this.graphicsView)&&i.push(this.graphicsView),i.reverse()}_isValidPopupLayerView(i){return M(i)&&(!("layer"in i)||!i.suspended)&&"fetchPopupFeatures"in i}_graphicsPerFetchPopupLayerView(i,s){const r=[],n=new Map,o=s.map(a=>{const l=[];return"layer"in a?n.set(a.layer,l):n.set(a.graphics,l),{layerView:a,graphics:l}});for(const a of i){const l=n.get(a.layer)||n.get(a.sourceLayer)||null;l?l.push(a):r.push(a)}return{layerViewsAndGraphics:o,clientOnlyGraphics:r}}};return t=c([S("esri.views.PopupView")],t),t};let Ov=class extends pf{constructor(e){super(e),this.handles.add(this.on("before-add",t=>{N(t.item)||t.item.parent===this.owner&&(q.getLogger(this.declaredClass).warn("Analysis inside the collection must be unique. Not adding this element again."),t.preventDefault())}))}_own(e){e.parent=this.owner}_release(e){e.parent=null}};Ov=c([S("esri.support.AnalysesCollection")],Ov);let Ma=class extends oe{constructor(e){super(e),this.view=null,this.baseLayerViews=new he,this.referenceLayerViews=new he,this._loadingHandle=Z(()=>{var t,i;return(i=(t=this.view)==null?void 0:t.map)==null?void 0:i.basemap},t=>{t&&t.load().catch(()=>{})},Le)}destroy(){this._set("view",null),this._loadingHandle&&(this._loadingHandle.remove(),this._loadingHandle=null)}get suspended(){return!this.view||this.view.suspended}get updating(){var t,i;if(this.view&&this.view.suspended)return!1;const e=(i=(t=this.view)==null?void 0:t.map)==null?void 0:i.basemap;return!!e&&!!e.loaded&&(this.baseLayerViews.some(s=>s.updating)||this.referenceLayerViews.some(s=>s.updating))}};c([h({constructOnly:!0})],Ma.prototype,"view",void 0),c([h({readOnly:!0})],Ma.prototype,"baseLayerViews",void 0),c([h({readOnly:!0})],Ma.prototype,"referenceLayerViews",void 0),c([h({readOnly:!0})],Ma.prototype,"suspended",null),c([h({type:Boolean,readOnly:!0})],Ma.prototype,"updating",null),Ma=c([S("esri.views.BasemapView")],Ma);class sae{constructor(t,i,s){this.layer=t,this.view=i,this.layerViewImporter=s,this._controller=new AbortController,this._deferred=Ao(),this._started=!1,this.done=!1,Vr(this._controller.signal,()=>{const r=new L("cancelled:layerview-create","layerview creation cancelled",{layer:t});this._deferred.reject(r)})}get promise(){return this._deferred.promise}destroy(){this._controller.abort();const{layerView:t}=this;if(!t)return;const{layer:i,view:s}=this;i.emit("layerview-destroy",{view:s,layerView:t}),s.emit("layerview-destroy",{layer:i,layerView:t}),this.done=!0,this.layer=null,this.layerView=null,this.view=null,this.layerViewImporter=null}async start(){var r,n;if(this._started)return;this._started=!0;const{_controller:{signal:t},layer:i,view:s}=this;this._map=s.map;try{let o,a;if(await i.load({signal:t}),"prefetchResources"in i&&await i.prefetchResources({signal:t}),i.createLayerView)o=await i.createLayerView(s,{signal:t});else{if(!this.layerViewImporter.hasLayerViewModule(i))throw new L("layer:view-not-supported","No layerview implementation was found");const d=await this.layerViewImporter.importLayerView(i);Ft(t),o="default"in d?new d.default({layer:i,view:s}):new d({layer:i,view:s})}const l=()=>{a=Bt(a),o.destroyed||o.destroy(),o.layer=null,o.parent=null,o.view=null,this.done=!0};a=Vr(t,l),Ft(t);try{await o.when()}catch(d){throw l(),d}if(!((n=(r=this._map)==null?void 0:r.allLayers)==null?void 0:n.includes(i)))return l(),void this._deferred.reject(new L("view:no-layerview-for-layer","The layer has been removed from the map",{layer:i}));this.layerView=o,i.emit("layerview-create",{view:s,layerView:o}),s.emit("layerview-create",{layer:i,layerView:o}),this.done=!0,this._deferred.resolve(o)}catch(o){i.emit("layerview-create-error",{view:s,error:o}),s.emit("layerview-create-error",{layer:i,error:o}),this.done=!0,this._deferred.reject(new L("layerview:create-error","layerview creation failed",{layer:i,error:o}))}}}let Gs=class extends oe{constructor(e){super(e),this._layerLayerViewInfoMap=new Map,this._watchUpdatingTracking=new kh,this.supportsGround=!0,this._preloadLayerViewModules=()=>{var i;const t=(i=this.view.map)==null?void 0:i.allLayers;if(t)for(const s of t)this.layerViewImporter.hasLayerViewModule(s)&&this.layerViewImporter.importLayerView(s)},this._reschedule=()=>(N(this._workPromise)&&(this._workPromise=Ao(),this._workPromise.promise.catch(()=>{})),this.removeHandles("reschedule"),this.addHandles(ad(this._doWork),"reschedule"),this._workPromise.promise),this._doWork=()=>{var o,a,l;const t=this.view.map;if(this._map!==t&&(this.clear(),this._map=t),N(this._workPromise))return void this.notifyChange("updating");this.removeHandles("reschedule"),this.removeHandles("collection-change");const i=[],s=u=>{if(!N(u))for(const d of u)d&&(i.push(d),this._createLayerView(d),"layers"in d&&d.layers&&s(d.layers))};for(const u of this._rootCollectionNames)s(this.get(u));this._refreshCollections();for(const[u,d]of this._layerLayerViewInfoMap)i.includes(u)||(this._layerLayerViewInfoMap.delete(d.layer),d.destroy());const r=i.filter(u=>u.type==="group").map(u=>u.layers),n=[(o=t==null?void 0:t.ground)==null?void 0:o.layers,(a=t==null?void 0:t.basemap)==null?void 0:a.baseLayers,(l=t==null?void 0:t.basemap)==null?void 0:l.referenceLayers,t==null?void 0:t.layers,...r].filter(u=>!!u);this.addHandles(n.map(u=>this._watchUpdatingTracking.addOnCollectionChange(()=>u,this._reschedule)),"collection-change"),this._workPromise.resolve(),this._workPromise=null}}initialize(){this.own([Is(()=>{var e,t;return(t=(e=this.view)==null?void 0:e.map)==null?void 0:t.allLayers},"change",this._preloadLayerViewModules,{onListenerAdd:this._preloadLayerViewModules}),Z(()=>{const e=this.view,t=e==null?void 0:e.map;return[t==null?void 0:t.basemap,t==null?void 0:t.ground,t==null?void 0:t.layers,e==null?void 0:e.ready]},()=>this._reschedule(),Al)]),this._preloadLayerViewModules(),this._reschedule()}destroy(){this.clear(),this._watchUpdatingTracking.destroy(),this._map=null,M(this._workPromise)&&(this._workPromise.reject(_t()),this._workPromise=null)}get _layersToLayerViews(){const e=[["view.map.basemap.baseLayers","view.basemapView.baseLayerViews"],["view.map.layers","view.layerViews"],["view.map.basemap.referenceLayers","view.basemapView.referenceLayerViews"]];return this.supportsGround&&e.push(["view.map.ground.layers","view.groundView.layerViews"]),new Map(e)}get _rootCollectionNames(){return Array.from(this._layersToLayerViews.keys())}get updating(){return M(this._workPromise)||this._watchUpdatingTracking.updating||Zv(this._layerLayerViewInfoMap,e=>!e.done)}get updatingRemaining(){let e=0;for(const t of this._layerLayerViewInfoMap.values())t.done||++e;return e}clear(){if(!this.destroyed){for(const e of this._layerLayerViewInfoMap.values())e.destroy();this._layerLayerViewInfoMap.clear(),this._refreshCollections()}}async whenLayerView(e){if(await this._reschedule(),!this._layerLayerViewInfoMap.has(e))throw new L("view:no-layerview-for-layer","No layerview has been found for the layer",{layer:e});return this._layerLayerViewInfoMap.get(e).promise}_refreshCollections(){for(const[e,t]of this._layersToLayerViews)this._populateLayerViewsOwners(this.get(e),this.get(t),this.view);this.notifyChange("updating"),this.notifyChange("updatingRemaining")}_populateLayerViewsOwners(e,t,i){if(!e||!t)return void(t&&t.removeAll());let s=0;for(const r of e){const n=this._layerLayerViewInfoMap.get(r);if(!n||!n.layerView)continue;const o=n.layerView;o.layer=r,o.parent=i,t.getItemAt(s)!==o&&t.splice(s,0,o),r.layers&&this._populateLayerViewsOwners(r.layers,o.layerViews,o),s+=1}s{}),this.layerViewImporter.hasLayerViewModule(e)&&this.layerViewImporter.importLayerView(e);const t=new sae(e,this.view,this.layerViewImporter);t.promise.then(()=>this._refreshCollections(),i=>{var s,r;i&&(Ks(i)||i.name==="cancelled:layerview-create")||q.getLogger(this.declaredClass).error(`Failed to create layerview for layer title:'${(s=e.title)!=null?s:"no title"}', id:'${(r=e.id)!=null?r:"no id"}' of type '${e.type}'.`,{layer:e,error:i}),this._refreshCollections()}),this._layerLayerViewInfoMap.set(e,t),this.view.ready&&t.start(),this.notifyChange("updating"),this.notifyChange("updatingRemaining")}};c([h()],Gs.prototype,"_workPromise",void 0),c([h({readOnly:!0})],Gs.prototype,"_watchUpdatingTracking",void 0),c([h({readOnly:!0})],Gs.prototype,"_layersToLayerViews",null),c([h({readOnly:!0})],Gs.prototype,"_rootCollectionNames",null),c([h()],Gs.prototype,"layerViewImporter",void 0),c([h()],Gs.prototype,"supportsGround",void 0),c([h({readOnly:!0})],Gs.prototype,"updating",null),c([h({readOnly:!0})],Gs.prototype,"updatingRemaining",null),c([h({constructOnly:!0})],Gs.prototype,"view",void 0),Gs=c([S("esri.views.LayerViewManager")],Gs);const rae=Gs;let gs=class extends oe{constructor(e){super(e),this.factor=1.5,this.offset=ns(0,0),this.position=null,this.size=120,this.maskUrl=null,this.maskEnabled=!0,this.overlayUrl=null,this.overlayEnabled=!0,this.visible=!0}get version(){return this.commitProperty("factor"),this.commitProperty("offset"),this.commitProperty("position"),this.commitProperty("visible"),this.commitProperty("size"),this.commitProperty("maskUrl"),this.commitProperty("maskEnabled"),this.commitProperty("overlayUrl"),this.commitProperty("overlayEnabled"),(this._get("version")||0)+1}};c([h({type:Number})],gs.prototype,"factor",void 0),c([h({nonNullable:!0})],gs.prototype,"offset",void 0),c([h()],gs.prototype,"position",void 0),c([h({type:Number,range:{min:0}})],gs.prototype,"size",void 0),c([h()],gs.prototype,"maskUrl",void 0),c([h()],gs.prototype,"maskEnabled",void 0),c([h()],gs.prototype,"overlayUrl",void 0),c([h()],gs.prototype,"overlayEnabled",void 0),c([h({readOnly:!0})],gs.prototype,"version",null),c([h({type:Boolean})],gs.prototype,"visible",void 0),gs=c([S("esri.views.Magnifier")],gs);const aj=gs;class nae{constructor(){this._tasks=new Array,this._running=new Pv(!1)}get length(){return this._tasks.length}get running(){return this._running.get()}destroy(){this.cancelAll()}runTask(t){for(;!t.done&&this._process(t);)t.madeProgress()}push(t,i,s){return this._running.set(!0),new Promise((r,n)=>this._tasks.push(new HP(r,n,t,i,s)))}unshift(t,i,s){return this._running.set(!0),new Promise((r,n)=>this._tasks.unshift(new HP(r,n,t,i,s)))}_process(t){var s;if(this._tasks.length===0)return!1;const i=this._tasks.shift();try{const r=jr(i.signal);if(r&&!i.abortCallback)i.reject(_t());else{const n=r?(s=i.abortCallback)==null?void 0:s.call(i,_t()):i.callback(t);No(n)?n.then(i.resolve,i.reject):i.resolve(n)}}catch(r){i.reject(r)}return this._running.set(this._tasks.length>0),!0}cancelAll(){const t=_t();for(const i of this._tasks)if(i.abortCallback){const s=i.abortCallback(t);i.resolve(s)}else i.reject(t);this._tasks.length=0,this._running.set(!1)}}class HP{constructor(t,i,s,r,n){this.resolve=t,this.reject=i,this.callback=s,this.signal=r,this.abortCallback=n}}let Wp=class extends oe{constructor(){super(...arguments),this.SCHEDULER_LOG_SLOW_TASKS=!1,this.FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES=!1}};c([h()],Wp.prototype,"SCHEDULER_LOG_SLOW_TASKS",void 0),c([h()],Wp.prototype,"FEATURE_SERVICE_SNAPPING_SOURCE_TILE_TREE_SHOW_TILES",void 0),Wp=c([S("esri.views.support.DebugFlags")],Wp);const oae=new Wp;var vs;(function(e){e[e.ANIMATING=0]="ANIMATING",e[e.INTERACTING=1]="INTERACTING",e[e.IDLE=2]="IDLE"})(vs||(vs={}));var Ae;(function(e){e.RESOURCE_CONTROLLER="schedule",e.SLIDE="slide",e.STREAM_DATA_LOADER="stream loader",e.ELEVATION_QUERY="elevation query",e.TERRAIN_SURFACE="terrain",e.SURFACE_GEOMETRY_UPDATES="surface geometry updates",e.GRAPHICS_CORE="Graphics3D",e.I3S_CONTROLLER="I3S",e.POINT_CLOUD_LAYER="point cloud",e.FEATURE_TILE_FETCHER="feature fetcher",e.OVERLAY="overlay",e.STAGE="stage",e.GRAPHICS_DECONFLICTOR="graphics deconflictor",e.FILTER_VISIBILITY="Graphics3D filter visibility",e.SCALE_VISIBILITY="Graphics3D scale visibility",e.FRUSTUM_VISIBILITY="Graphics3D frustum visibility",e.POINT_OF_INTEREST_FREQUENT="POI frequent",e.POINT_OF_INTEREST_INFREQUENT="POI infrequent",e.LABELER="labeler",e.FEATURE_QUERY_ENGINE="feature query",e.FEATURE_TILE_TREE="feature tile tree",e.FEATURE_TILE_TREE_ACTIVE="fast feature tile tree",e.ELEVATION_ALIGNMENT="elevation alignment",e.TEXT_TEXTURE_ATLAS="text texture atlas",e.TEXTURE_UNLOAD="texture unload",e.LINE_OF_SIGHT_TOOL="line of sight tool",e.LINE_OF_SIGHT_TOOL_INTERACTIVE="interactive line of sight tool",e.ELEVATION_PROFILE="elevation profile",e.SNAPPING="snapping",e.SHADOW_ACCUMULATOR="shadow accumulator",e.CLOUDS_GENERATOR="cloud generator",e[e.TEST_PRIO=1]="TEST_PRIO"})(Ae||(Ae={}));const vn=0,YP=new Map([[Ae.RESOURCE_CONTROLLER,vn],[Ae.SLIDE,vn],[Ae.STREAM_DATA_LOADER,vn],[Ae.ELEVATION_QUERY,vn],[Ae.TERRAIN_SURFACE,1],[Ae.SURFACE_GEOMETRY_UPDATES,1],[Ae.GRAPHICS_CORE,2],[Ae.I3S_CONTROLLER,2],[Ae.POINT_CLOUD_LAYER,2],[Ae.FEATURE_TILE_FETCHER,2],[Ae.OVERLAY,4],[Ae.STAGE,4],[Ae.GRAPHICS_DECONFLICTOR,4],[Ae.FILTER_VISIBILITY,4],[Ae.SCALE_VISIBILITY,4],[Ae.FRUSTUM_VISIBILITY,4],[Ae.CLOUDS_GENERATOR,4],[Ae.POINT_OF_INTEREST_FREQUENT,6],[Ae.POINT_OF_INTEREST_INFREQUENT,30],[Ae.LABELER,8],[Ae.FEATURE_QUERY_ENGINE,8],[Ae.FEATURE_TILE_TREE,16],[Ae.FEATURE_TILE_TREE_ACTIVE,vn],[Ae.ELEVATION_ALIGNMENT,12],[Ae.TEXT_TEXTURE_ATLAS,12],[Ae.TEXTURE_UNLOAD,12],[Ae.LINE_OF_SIGHT_TOOL,16],[Ae.LINE_OF_SIGHT_TOOL_INTERACTIVE,vn],[Ae.SNAPPING,vn],[Ae.SHADOW_ACCUMULATOR,30]]),Aw=32;function JP(e){return YP.has(e)?YP.get(e):typeof e=="number"?e:1}const XP=6.5,ZP=1,aae=30,QP=1e3/30,KP=100,eA=.9;var tM,Sl;(function(e){class t{constructor(){this._updating=new Pv(!0),this._microTaskQueued=!1,this._frameNumber=0,this.performanceInfo={total:new cf("total"),tasks:new Map},this._frameTaskTimes=new Map,this._budget=new s,this._state=vs.INTERACTING,this._tasks=new Vc,this._runQueue=new Vc,this._load=0,this._idleStateCallbacks=new Vc,this._idleUpdatesStartFired=!1,this._maxReschedule=Aw,this._forceTask=!1,this._debug=!1,this._debugHandle=Z(()=>oae.SCHEDULER_LOG_SLOW_TASKS,o=>this._debug=o,Le);for(const o of Object.keys(Ae))this.performanceInfo.tasks.set(Ae[o],new cf(Ae[o]));const n=this;this._test={FRAME_SAFETY_BUDGET:XP,INTERACTING_BUDGET:QP,IDLE_BUDGET:KP,get availableBudget(){return n._budget.budget},usedBudget:0,getBudget:()=>n._budget,setBudget:o=>n._budget=o,updateTask:o=>this._updateTask(o),getState:o=>this._getState(o),getRuntime:o=>this._getRuntime(o),frameTaskTimes:this._frameTaskTimes,resetRuntimes:()=>this._resetRuntimes(),getRunning:()=>this._getRunning()}}get updating(){return this._updating.get()}set updating(n){this._updating.set(n)}destroy(){this._tasks.toArray().forEach(n=>n.remove()),this._tasks.clear(),Bt(this._debugHandle),this._microTaskQueued=!1,this._updating.set(!1)}activate(){this._budget.done||this._microTaskQueued||(this._microTaskQueued=!0,queueMicrotask(()=>{this._microTaskQueued&&(this._microTaskQueued=!1,this._budget.done||(this._maxReschedule=Aw,this._schedule(),this.frame()))}))}registerTask(n,o){const a=JP(n),l=new i(this,n,o,a);return this._tasks.push(l),this.performanceInfo.tasks.has(n)||this.performanceInfo.tasks.set(n,new cf(n)),l}registerIdleStateCallbacks(n,o){const a={idleBegin:n,idleEnd:o};this._idleStateCallbacks.push(a),this.state===vs.IDLE&&this._idleUpdatesStartFired&&a.idleBegin();const l=this;return{remove:()=>this._removeIdleStateCallbacks(a),set idleBegin(u){l._idleUpdatesStartFired&&(a.idleEnd(),l._state===vs.IDLE&&u()),a.idleBegin=u},set idleEnd(u){a.idleEnd=u}}}get load(){return this._load}set state(n){this._state!==n&&(this._state=n,this.state!==vs.IDLE&&this._idleUpdatesStartFired&&(this._idleUpdatesStartFired=!1,this._idleStateCallbacks.forAll(o=>o.idleEnd())))}get state(){return this._state}updateBudget(n){this._test.usedBudget=0,++this._frameNumber;let o=XP,a=n.frameDuration,l=ZP;switch(this.state){case vs.IDLE:o=0,a=Math.max(KP,n.frameDuration),l=aae;break;case vs.INTERACTING:a=Math.max(QP,n.frameDuration);case vs.ANIMATING:}return a=a-n.elapsedFrameTime-o,this.state!==vs.IDLE&&an.idleBegin())),this._runIdle();break;case vs.INTERACTING:this._runInteracting();break;default:this._runAnimating()}this._test.usedBudget=this._budget.elapsed}stopFrame(){this._budget.reset(0,this._state),this._budget.madeProgress()}_removeIdleStateCallbacks(n){this._idleUpdatesStartFired&&n.idleEnd(),this._idleStateCallbacks.removeUnordered(n)}removeTask(n){this._tasks.removeUnordered(n),this._runQueue.removeUnordered(n)}_updateTask(n){this._tasks.forAll(o=>{o.name===n&&o.setPriority(n)})}_getState(n){if(this._runQueue.some(a=>a.name===n))return Sl.SCHEDULED;let o=Sl.IDLE;return this._tasks.forAll(a=>{a.name===n&&a.needsUpdate&&(a.schedulePriority<=1?o=Sl.READY:o!==Sl.READY&&(o=Sl.WAITING))}),o}_getRuntime(n){let o=0;return this._tasks.forAll(a=>{a.name===n&&(o+=a.runtime)}),o}_resetRuntimes(){this._tasks.forAll(n=>n.runtime=0)}_getRunning(){const n=new Map;if(this._tasks.forAll(a=>{a.needsUpdate&&n.set(a.name,(n.get(a.name)||0)+1)}),n.size===0)return null;let o="";return n.forEach((a,l)=>{o+=a>1?` ${a}x ${l}`:` ${l}`}),o}_runIdle(){this._run()}_runInteracting(){this._run()}_runAnimating(){this._run()}_updateLoad(){const n=this._tasks.reduce((o,a)=>a.needsUpdate?++o:o,0);this._load=this._load*eA+n*(1-eA)}_schedule(){if(this._maxReschedule<=0)return!1;for(this._runQueue.filterInPlace(n=>!!n.needsUpdate||(n.schedulePriority=n.basePriority,!1)),this._tasks.forAll(n=>{n.basePriority===vn&&n.needsUpdate&&!this._runQueue.includes(n)&&this._runQueue.unshift(n)});this._runQueue.length===0;){let n=!1,o=0;if(this._tasks.forAll(a=>{a.needsUpdate&&a.schedulePriority!==0&&a.basePriority!==vn&&(!a.task.runOncePerFrame||a.lastFrameRun!==this._frameNumber)&&(n=!0,o=Math.max(o,a.basePriority),a.schedulePriority===1?(a.schedulePriority=0,this._runQueue.push(a)):--a.schedulePriority)}),!n)return this._updating.set(!1),!1;--this._maxReschedule}return this._updating.set(!0),!0}_run(){const n=this._budget.now();this._startFrameTaskTimes();do for(;this._runQueue.length>0;){const o=this._budget.now(),a=this._runQueue.pop();this._budget.resetProgress();try{a.task.runTask(this._budget)}catch(u){q.getLogger("esri.views.support.Scheduler").error(`Exception in task "${a.name}"`,u)}a.schedulePriority=a.basePriority,a.lastFrameRun=this._frameNumber;const l=this._budget.now()-o;if(a.runtime+=l,this._frameTaskTimes.set(a.priority,this._frameTaskTimes.get(a.priority)+l),this._debug&&this._budget.elapsed>2*this._budget.budget&&console.log("Task",a.name,"used",this._budget.elapsed,"of max",this._budget.budget,"ms"),this._budget.remaining<=0)return this._updating.set(this._tasks.some(u=>u.needsUpdate)),void this._recordFrameTaskTimes(this._budget.now()-n)}while(this._schedule());this._updating.set(this._tasks.some(o=>o.needsUpdate)),this._recordFrameTaskTimes(this._budget.now()-n)}_startFrameTaskTimes(){for(const n of Object.keys(Ae))this._frameTaskTimes.set(Ae[n],0)}_recordFrameTaskTimes(n){this._frameTaskTimes.forEach((o,a)=>this.performanceInfo.tasks.get(a).record(o)),this.performanceInfo.total.record(n)}get test(){return this._test}}e.Scheduler=t;class i{constructor(n,o,a,l){this._scheduler=n,this.name=o,this._basePriority=l,this.lastFrameRun=0,this.runtime=0,this._queue=new nae,this._handles=new qi,this.schedulePriority=this._basePriority,this._task=new Pv(M(a)?a:this._queue),this._handles.add(Qs(()=>this.task.running,()=>n.activate()))}get task(){return this._task.get()}get updating(){return this._queue.running}remove(){this.processQueue(lj),this._scheduler.removeTask(this),this.schedule=iM.schedule,this.reschedule=iM.reschedule,this._handles.destroy()}get basePriority(){return this._basePriority}setPriority(n){this.name=n;const o=JP(n);this._basePriority!==vn&&this.schedulePriority===0||(this.schedulePriority=o),this._basePriority=o}get priority(){return this.name}set priority(n){this.setPriority(n)}get needsUpdate(){return this.updating||this.task.running}schedule(n,o,a){return this._queue.push(n,o,a)}reschedule(n,o,a){return this._queue.unshift(n,o,a)}processQueue(n){this._queue.runTask(n)}}class s{constructor(){this._begin=typeof performance!="undefined"?performance.now():0,this._budget=0,this._state=vs.IDLE,this._done=!1,this._enabled=!0}run(n){return!this.done&&(n()===!0&&this.madeProgress(),!0)}get done(){return this._done}get budget(){return this._budget}madeProgress(){this._done=this.elapsed>=this._budget&&this._enabled}get state(){return this._state}get enabled(){return this._enabled}set enabled(n){this._enabled=n}reset(n,o){this._begin=this.now(),this._budget=n,this._state=o,this._done=!1}get remaining(){return Math.max(this._budget-this.elapsed,0)}now(){return performance.now()}get elapsed(){return performance.now()-this._begin}resetProgress(){this._done=!1}get hasProgressed(){return this._done}}e.Budget=s})(tM||(tM={})),function(e){e.SCHEDULED="s",e.READY="r",e.WAITING="w",e.IDLE="i"}(Sl||(Sl={}));const lj=(()=>{const e=new tM.Budget;return e.enabled=!1,e})();class lae{remove(){}processQueue(){}schedule(t,i,s){try{if(jr(i)){const r=_t();return s?Promise.resolve(s(r)):Promise.reject(r)}return x1(t(lj))}catch(r){return Promise.reject(r)}}reschedule(t,i,s){return this.schedule(t,i,s)}}const iM=new lae;let Hp=class extends oe{constructor(e,t){var i;super({}),this._stage=e,this._textureRequests=new Map,this._frameTask=(i=t==null?void 0:t.registerTask(Ae.TEXTURE_UNLOAD))!=null?i:iM}normalizeCtorArgs(){return{}}destroy(){super.destroy(),this._frameTask.remove(),this._textureRequests.forEach(e=>this._releaseTextureRequest(e)),this._textureRequests.clear()}get updating(){return this._frameTask.updating}fromData(e,t,i){const s=this.makeUid(e);let r=this._textureRequests.get(s);return r||(r={referenceCount:0,texture:t(),textureAsync:null,abortController:null,onRemove:i},this._stage&&(this._stage.add(r.texture),this._stage.loadImmediate(r.texture)),this._textureRequests.set(s,r)),r.referenceCount++,{uid:s,texture:r.texture,release:()=>this._release(s)}}_release(e){const t=this._textureRequests.get(e);t?(t.referenceCount<1&&console.warn("TextureCollection: reference count is < 1 for "+e),t.referenceCount--,t.referenceCount<1&&this._frameTask.schedule(()=>this._releaseNow(e))):console.warn(`TextureCollection: texture doesn't exist: '${e}'`)}get test(){return{textureRequests:this._textureRequests}}_releaseNow(e){if(!this._textureRequests)return;const t=this._textureRequests.get(e);!t||t.referenceCount>0||(this._releaseTextureRequest(t),this._textureRequests.delete(e))}_releaseTextureRequest(e){var t;e.onRemove&&e.onRemove(),e.texture?(t=this._stage)==null||t.remove(e.texture):e.abortController&&(e.abortController.abort(),e.abortController=null)}makeUid(e,t=null){return M(t)?`${e}.${t}px`:e}};c([h()],Hp.prototype,"_frameTask",void 0),c([h()],Hp.prototype,"updating",null),Hp=c([S("esri.views.3d.support.TextureCollection")],Hp);var tA;(function(e){e[e.Left=0]="Left",e[e.Middle=1]="Middle",e[e.Right=2]="Right"})(tA||(tA={}));const cj=["click","double-click","immediate-click","immediate-double-click","hold","drag","key-down","key-up","pointer-down","pointer-move","pointer-up","pointer-drag","mouse-wheel","pointer-enter","pointer-leave","gamepad","focus","blur"],uj={};function hj(e){return!!uj[e]}function cae(e){for(const t of e)if(!hj(t))return!1;return!0}cj.forEach(e=>{uj[e]=!0});class uae{constructor(t){this._handlers=new Map,this._counter=0,this._handlerCounts=new Map,this.view=t,this.inputManager=null}connect(t){t&&this.disconnect(),this.inputManager=t,this._handlers.forEach(({handler:i,priority:s},r)=>this.inputManager.installHandlers(r,[i],s))}disconnect(){this.inputManager&&this._handlers.forEach((t,i)=>this.inputManager.uninstallHandlers(i)),this.inputManager=null}destroy(){this.disconnect(),this._handlers.clear(),this.view=null}on(t,i,s,r){const n=Array.isArray(t)?t:t.split(",");if(!cae(n))return n.some(hj)&&console.error("Error: registering input events and other events on the view at the same time is not supported."),null;let o,a;Array.isArray(i)?a=i:(o=i,a=[]),typeof s=="function"?o=s:r=s,r=r!=null?r:el.DEFAULT;const l=this._createUniqueGroupName(),u=new hae(this.view,n,a,o);this._handlers.set(l,{handler:u,priority:r});for(const d of n){const f=this._handlerCounts.get(d)||0;this._handlerCounts.set(d,f+1)}return this.inputManager&&this.inputManager.installHandlers(l,[u],r),{remove:()=>this._removeHandler(l,n)}}hasHandler(t){return!!this._handlerCounts.get(t)}_removeHandler(t,i){if(this._handlers.has(t)){this._handlers.delete(t);for(const s of i){const r=this._handlerCounts.get(s);r===void 0?console.error("Trying to remove handler for event that has no handlers registered: ",s):r===1?this._handlerCounts.delete(s):this._handlerCounts.set(s,r-1)}}this.inputManager&&this.inputManager.uninstallHandlers(t)}_createUniqueGroupName(){return this._counter+=1,`viewEvents_${this._counter}`}}class hae extends ei{constructor(t,i,s,r){super(!0),this.view=t;for(const n of i)switch(n){case"click":this.registerIncoming("click",s,o=>r(this._wrapClick(o)));break;case"double-click":this.registerIncoming("double-click",s,o=>r(this._wrapDoubleClick(o)));break;case"immediate-click":this.registerIncoming("immediate-click",s,o=>r(this._wrapImmediateClick(o)));break;case"immediate-double-click":this.registerIncoming("immediate-double-click",s,o=>r(this._wrapImmediateDoubleClick(o)));break;case"hold":this.registerIncoming("hold",s,o=>r(this._wrapHold(o)));break;case"drag":this.registerIncoming("drag",s,o=>{const a=this._wrapDrag(o);a&&r(a)});break;case"key-down":this.registerIncoming("key-down",s,o=>r(this._wrapKeyDown(o)));break;case"key-up":this.registerIncoming("key-up",s,o=>r(this._wrapKeyUp(o)));break;case"pointer-down":this.registerIncoming("pointer-down",s,o=>r(this._wrapPointer(o,"pointer-down")));break;case"pointer-move":this.registerIncoming("pointer-move",s,o=>r(this._wrapPointer(o,"pointer-move")));break;case"pointer-up":this.registerIncoming("pointer-up",s,o=>r(this._wrapPointer(o,"pointer-up")));break;case"pointer-drag":this.registerIncoming("pointer-drag",s,o=>r(this._wrapPointerDrag(o)));break;case"mouse-wheel":this.registerIncoming("mouse-wheel",s,o=>r(this._wrapMouseWheel(o)));break;case"pointer-enter":this.registerIncoming("pointer-enter",s,o=>r(this._wrapPointer(o,"pointer-enter")));break;case"pointer-leave":this.registerIncoming("pointer-leave",s,o=>r(this._wrapPointer(o,"pointer-leave")));break;case"gamepad":this.registerIncoming("gamepad",s,o=>{r(this._wrapGamepad(o))});break;case"focus":this.registerIncoming("focus",s,o=>{r(this._wrapFocus(o))});break;case"blur":this.registerIncoming("blur",s,o=>{r(this._wrapBlur(o))})}}_wrapFocus(t){return{type:"focus",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:i=>t.async(i),preventDefault:()=>t.preventDefault()}}_wrapBlur(t){return{type:"blur",timestamp:t.timestamp,native:t.data.native,cancelable:t.cancelable,stopPropagation:()=>t.stopPropagation(),async:i=>t.async(i),preventDefault:()=>t.preventDefault()}}_wrapClick(t){const{pointerType:i,button:s,buttons:r,x:n,y:o,native:a,eventId:l}=t.data,{cancelable:u,timestamp:d}=t;return{type:"click",pointerType:i,button:s,buttons:r,x:n,y:o,native:a,timestamp:d,screenPoint:ns(n,o),mapPoint:this._getMapPoint(n,o),eventId:l,cancelable:u,stopPropagation:()=>t.stopPropagation(),async:f=>t.async(f),preventDefault:()=>t.preventDefault()}}_wrapDoubleClick(t){const{pointerType:i,button:s,buttons:r,x:n,y:o,native:a,eventId:l}=t.data,{cancelable:u,timestamp:d}=t;return{type:"double-click",pointerType:i,button:s,buttons:r,x:n,y:o,native:a,timestamp:d,mapPoint:this._getMapPoint(n,o),eventId:l,cancelable:u,stopPropagation:()=>t.stopPropagation(),async:f=>t.async(f),preventDefault:()=>t.preventDefault()}}_wrapImmediateClick(t){const{pointerType:i,button:s,buttons:r,x:n,y:o,native:a,eventId:l}=t.data,u=a.pointerId,{cancelable:d,timestamp:f}=t;return{type:"immediate-click",pointerId:u,pointerType:i,button:s,buttons:r,x:n,y:o,native:a,timestamp:f,mapPoint:this._getMapPoint(n,o),eventId:l,cancelable:d,stopPropagation:()=>t.stopPropagation(),async:m=>t.async(m),preventDefault:()=>t.preventDefault()}}_wrapImmediateDoubleClick(t){const{pointerType:i,button:s,buttons:r,x:n,y:o,native:a,eventId:l}=t.data,u=a.pointerId,{cancelable:d,timestamp:f}=t;return{type:"immediate-double-click",pointerId:u,pointerType:i,button:s,buttons:r,x:n,y:o,native:a,timestamp:f,mapPoint:this._getMapPoint(n,o),eventId:l,cancelable:d,stopPropagation:()=>t.stopPropagation(),async:m=>t.async(m),preventDefault:()=>t.preventDefault()}}_wrapHold(t){const{pointerType:i,button:s,buttons:r,x:n,y:o,native:a}=t.data,{cancelable:l,timestamp:u}=t;return{type:"hold",pointerType:i,button:s,buttons:r,x:n,y:o,native:a,timestamp:u,mapPoint:this._getMapPoint(n,o),cancelable:l,stopPropagation:()=>t.stopPropagation(),async:d=>t.async(d),preventDefault:()=>t.preventDefault()}}_getMapPoint(t,i){return this.view.toMap(ns(t,i),{exclude:[]})}_wrapDrag(t){const i=t.data,{x:s,y:r}=i.center,{action:n,pointerType:o,button:a}=i;if(n==="start"&&(this._latestDragStart=i),!this._latestDragStart)return;const l=i.pointer.native,u=i.buttons,{cancelable:d,timestamp:f}=t,m={x:this._latestDragStart.center.x,y:this._latestDragStart.center.y};return n==="end"&&(this._latestDragStart=void 0),{type:"drag",action:n,x:s,y:r,origin:m,pointerType:o,button:a,buttons:u,radius:i.radius,angle:cF(i.angle),native:l,timestamp:f,cancelable:d,stopPropagation:()=>t.stopPropagation(),async:y=>t.async(y),preventDefault:()=>t.preventDefault()}}_wrapKeyDown(t){const{key:i,repeat:s,native:r}=t.data,{cancelable:n,timestamp:o}=t;return{type:"key-down",key:i,repeat:s,native:r,timestamp:o,cancelable:n,stopPropagation:()=>t.stopPropagation(),async:a=>t.async(a),preventDefault:()=>t.preventDefault()}}_wrapKeyUp(t){const{key:i,native:s}=t.data,{cancelable:r,timestamp:n}=t;return{type:"key-up",key:i,native:s,timestamp:n,cancelable:r,stopPropagation:()=>t.stopPropagation(),async:o=>t.async(o),preventDefault:()=>t.preventDefault()}}_wrapPointer(t,i){const{x:s,y:r,button:n,buttons:o,native:a,eventId:l}=t.data,u=a.pointerId,d=a.pointerType,{cancelable:f,timestamp:m}=t;return{type:i,x:s,y:r,pointerId:u,pointerType:d,button:n,buttons:o,native:a,timestamp:m,eventId:l,cancelable:f,stopPropagation:()=>t.stopPropagation(),async:y=>t.async(y),preventDefault:()=>t.preventDefault()}}_wrapPointerDrag(t){const{x:i,y:s,buttons:r,native:n,eventId:o}=t.data.currentEvent,{button:a}=t.data.startEvent,l=t.data.startEvent.native.pointerId,u=t.data.startEvent.native.pointerType,d=t.data.action,f={x:t.data.startEvent.x,y:t.data.startEvent.y},{cancelable:m,timestamp:y}=t;return{type:"pointer-drag",x:i,y:s,pointerId:l,pointerType:u,button:a,buttons:r,action:d,origin:f,native:n,timestamp:y,eventId:o,cancelable:m,stopPropagation:()=>t.stopPropagation(),async:g=>t.async(g),preventDefault:()=>t.preventDefault()}}_wrapMouseWheel(t){const{cancelable:i,data:s,timestamp:r}=t,{x:n,y:o,deltaY:a,native:l}=s;return{type:"mouse-wheel",x:n,y:o,deltaY:a,native:l,timestamp:r,cancelable:i,stopPropagation:()=>t.stopPropagation(),async:u=>t.async(u),preventDefault:()=>t.preventDefault()}}_wrapGamepad(t){const{action:i,state:s,device:r}=t.data,{cancelable:n,timestamp:o}=t,{buttons:a,axes:l}=s;return{type:"gamepad",device:r,timestamp:o,action:i,buttons:a,axes:l,cancelable:n,stopPropagation:()=>t.stopPropagation(),async:u=>t.async(u),preventDefault:()=>t.preventDefault()}}}var pm,iA,sA;(function(e){e[e.USER=0]="USER",e[e.MANAGER=1]="MANAGER"})(pm||(pm={})),function(e){e[e.None=0]="None",e[e.Unfocused=1]="Unfocused",e[e.Focused=2]="Focused",e[e.Unselected=4]="Unselected",e[e.Selected=8]="Selected",e[e.All=15]="All"}(iA||(iA={})),function(e){e[e.None=0]="None",e[e.Custom1=16]="Custom1",e[e.Custom2=32]="Custom2",e[e.Custom3=64]="Custom3",e[e.Custom4=128]="Custom4",e[e.Custom5=256]="Custom5",e[e.Custom6=512]="Custom6",e[e.Custom7=1024]="Custom7",e[e.Custom8=2048]="Custom8",e[e.Custom9=4096]="Custom9",e[e.Custom10=8192]="Custom10",e[e.Custom11=16384]="Custom11",e[e.Custom12=32768]="Custom12",e[e.All=65520]="All"}(sA||(sA={}));function dae(e){return[e.on("before-add",t=>{const i=t.item;if(i==null||e.includes(i))return q.getLogger("esri.views.interactive.interactiveToolUtils").warn("Tool is either already in the list of tools or tool is `null`. Not adding tool."),void t.preventDefault();i.onAdd()}),e.on("after-remove",t=>{const i=t.item;i.active&&(i.view.activeTool=null),i.destroy()})]}function sM(e){return e.visible&&e.getEditableFlag(pm.USER)&&e.getEditableFlag(pm.MANAGER)}function un(e){return ns(e.x,e.y)}function dj(e,t){const i=(e instanceof HTMLElement?e:e.surface).getBoundingClientRect();return ns(t.clientX-i.left,t.clientY-i.top)}function rA(e,t){return t instanceof Event?dj(e,t):un(t)}function nA(e){if(e instanceof Event)return!0;if(typeof e=="object"&&"type"in e)switch(e.type){case"click":case"double-click":case"pointer-down":case"pointer-drag":case"pointer-enter":case"pointer-leave":case"pointer-up":case"pointer-move":case"immediate-click":case"immediate-double-click":case"hold":case"drag":case"mouse-wheel":return!0;default:return!1}return!1}class pae{constructor(){this._pointerLocations=new Map,this._hoveredManipulators=new Map,this._grabbedManipulators=new Map,this._draggedManipulators=new Map,this._stopDrag=!1,this._revertToNullActiveTool=!1,this._cursor=null}get cursor(){return this._cursor}handleInputEvent(t,i){const s=()=>t.stopPropagation();switch(t.type){case"pointer-move":oA(t.pointerType)&&this._pointerLocations.set(t.pointerId,{x:t.x,y:t.y,pointerType:t.pointerType});break;case"drag":this._grabbedManipulators.size>0&&(this._stopDrag=!0),this._stopDrag&&(s(),t.action==="end"&&(this._stopDrag=!1));break;case"pointer-down":{if(!aA(t))break;const r=un(t),n=this._intersect(r,t.pointerType,i.forEachTool);if(N(n))break;const o=n.manipulator,a=n.tool;!(M(o)&&M(a)&&o.interactive)||o.grabbable&&o.grabbableForEvent(t)||!o.grabbing||o.dragging||this._ungrabManipulatorBeforeDragging(o,t,i),M(o)&&M(a)&&o.interactive&&o.grabbable&&o.grabbableForEvent(t)&&!o.grabbing&&(this._grabbedManipulators.set(t.pointerId,{manipulator:o,tool:a,start:r,pointerType:t.pointerType}),this._grabbedManipulators.size===1&&N(i.activeTool)&&(this._revertToNullActiveTool=!0,i.setActiveTool(n.tool)),o.grabbing=!0,o.events.emit("grab-changed",{action:"start",pointerType:t.pointerType,screenPoint:r}),s());break}case"pointer-up":this._draggedManipulators.has(t.pointerId)||this._handlePointerEnd(t,i);break;case"pointer-drag":{if(!aA(t))break;const r=this._grabbedManipulators.get(t.pointerId),n=ja(r,({manipulator:d})=>d),o=ja(r,({tool:d})=>d);if(N(n)||N(o))break;const a=un(t);a.x=ls(a.x,0,i.view.width),a.y=ls(a.y,0,i.view.height);const l=r.start,u=this._draggedManipulators.get(t.pointerId);switch(t.action){case"start":case"update":t.action!=="update"&&this._grabbedManipulators.size!==1||(n.dragging=!0,u?n.events.emit("drag",{action:"update",start:l,screenPoint:a}):n.events.emit("drag",{action:"start",start:l,screenPoint:a,pointerType:t.pointerType}),this._draggedManipulators.set(t.pointerId,{tool:o,manipulator:n,start:l}));break;case"end":n.dragging=!1,u&&n.events.emit("drag",{action:"end",start:l,screenPoint:a}),this._draggedManipulators.delete(t.pointerId),this._handlePointerEnd(t,i)}s();break}case"immediate-click":{const r=un(t),n=this._intersect(r,t.pointerType,i.forEachTool);if(fae(t)||i.forEachTool(u=>{if((!M(n)||n.tool!==u||u.automaticManipulatorSelection)&&u.manipulators){let d=!1;u.manipulators.forEach(({manipulator:f})=>{f.selected&&(f.selected=!1,d=!0)}),d&&u.onManipulatorSelectionChanged&&u.onManipulatorSelectionChanged()}}),N(n))break;const{manipulator:o,tool:a}=n;if(!o.interactive)break;o.selectable&&a.automaticManipulatorSelection&&(o.selected=!o.selected,a.onManipulatorSelectionChanged&&a.onManipulatorSelectionChanged());const l=t.native.shiftKey;o.events.emit("immediate-click",{screenPoint:r,button:t.button,pointerType:t.pointerType,shiftKey:l,stopPropagation:s});break}case"click":{const r=un(t),n=this._intersect(r,t.pointerType,i.forEachTool),o=M(n)?n.manipulator:null;if(N(o)||!o.interactive)break;const a=t.native.shiftKey;o.events.emit(t.type,{screenPoint:r,button:t.button,pointerType:t.pointerType,shiftKey:a}),s();break}case"double-click":{const r=un(t),n=this._intersect(r,t.pointerType,i.forEachTool),o=M(n)?n.manipulator:null;if(N(o)||!o.interactive)break;const a=t.native.shiftKey;o.events.emit("double-click",{screenPoint:r,button:t.button,pointerType:t.pointerType,shiftKey:a,stopPropagation:s});break}case"immediate-double-click":{const r=un(t),n=this._intersect(r,t.pointerType,i.forEachTool),o=M(n)?n.manipulator:null;if(N(o)||!o.interactive)break;const a=t.native.shiftKey;o.events.emit("immediate-double-click",{screenPoint:r,button:t.button,pointerType:t.pointerType,shiftKey:a,stopPropagation:s});break}}this._onFocusChange(i.forEachTool)}_ungrabManipulatorBeforeDragging(t,i,s){t.grabbing=!1,t.events.emit("grab-changed",{action:"end",pointerType:i.pointerType,screenPoint:un(i)}),this._grabbedManipulators.forEach(({manipulator:r},n)=>{r===t&&this._grabbedManipulators.delete(n)}),this._afterManipulatorUngrab(s.setActiveTool)}_handlePointerEnd(t,i){const s=ja(this._grabbedManipulators.get(t.pointerId),({manipulator:r})=>r);N(s)||s.grabbing&&(s.grabbing=!1,s.events.emit("grab-changed",{action:"end",pointerType:t.pointerType,screenPoint:un(t)}),this._grabbedManipulators.delete(t.pointerId),this._afterManipulatorUngrab(i.setActiveTool))}_cursorFromMap(t){let i=null;return Zv(t,({manipulator:s})=>!(N(s)||!s.interactive)&&(s.grabbing&&s.grabCursor?(i=s.grabCursor,!0):!!s.cursor&&(i=s.cursor,!0))),i}_onFocusChange(t){this._updateCursor(),this._updateFocusedManipulatorTools(t)}_updateCursor(){this._grabbedManipulators.size>0?this._cursor=this._cursorFromMap(this._grabbedManipulators)||"grabbing":this._hoveredManipulators.size>0?this._cursor=this._cursorFromMap(this._hoveredManipulators)||"pointer":this._cursor=null}_updateFocusedManipulatorTools(t){const i=new Set,s=new Set;this._grabbedManipulators.forEach(({tool:r})=>{i.add(r)}),this._hoveredManipulators.forEach(({tool:r})=>{s.add(r)}),t(r=>{r.hasGrabbedManipulators=i.has(r),r.hasHoveredManipulators=s.has(r);const n=this._grabbedManipulators.values(),o=_7(n,({tool:a})=>a===r);r.firstGrabbedManipulator=M(o)?o.manipulator:null})}clearPointers(t,{forEachTool:i,setActiveTool:s},r=!0,n){const o=(a,l)=>a===t&&(N(n)||n===l);this._grabbedManipulators.forEach(({tool:a,manipulator:l,pointerType:u},d)=>{o(a,l)&&(this._grabbedManipulators.delete(d),l.grabbing=!1,l.events.emit("grab-changed",{action:"end",screenPoint:null,pointerType:u}))}),this._draggedManipulators.forEach(({tool:a,manipulator:l},u)=>{o(a,l)&&(this._draggedManipulators.delete(u),l.dragging=!1,l.events.emit("drag",{action:"cancel"}))}),r&&this._hoveredManipulators.forEach(({tool:a,manipulator:l},u)=>{o(a,l)&&(this._hoveredManipulators.delete(u),l.hovering=!1)}),this._afterManipulatorUngrab(s),this._onFocusChange(i)}_intersect(t,i,s){let r=null;return s(n=>{if(n.manipulators==null||!sM(n))return!1;const o=n.manipulators.intersect(t,i);return!N(o)&&(r={tool:n,manipulator:o},!0)}),r}updateHoveredStateFromKnownPointers(t){this._pointerLocations.forEach((i,s)=>{this._updateHoveredStateForPointerAtScreenPosition(ns(i.x,i.y),s,i.pointerType,t)})}handleHoverEvent(t,i){t.type!=="pointer-up"&&t.type!=="immediate-click"&&t.type!=="pointer-move"||!oA(t.pointerType)||this._updateHoveredStateForPointerAtScreenPosition(un(t),t.pointerId,t.pointerType,i)}_updateHoveredStateForPointerAtScreenPosition(t,i,s,r){let n=this._intersect(t,s,r);const o=ja(this._hoveredManipulators.get(i),({manipulator:a})=>a);M(n)&&!n.manipulator.interactive&&(n=null),M(n)&&o===n.manipulator||(M(o)&&(o.hovering=!1),M(n)?(n.manipulator.hovering=!0,this._hoveredManipulators.set(i,n)):this._hoveredManipulators.delete(i),this._onFocusChange(r))}_afterManipulatorUngrab(t){this._grabbedManipulators.size===0&&this._revertToNullActiveTool&&(t(null),this._revertToNullActiveTool=!1)}}function oA(e){return e==="mouse"}function aA(e){return e.pointerType!=="mouse"||e.button===0}function fae(e){return!!e.native.shiftKey}const lA="attached",Ow="tools";let ao=class extends yv{constructor(e){super(e),this._manipulatorState=new pae,this.tools=new he,this.cursor=null,this._forEachTool=t=>{for(const i of this.tools.items)if(t(i))return}}initialize(){this.handles.add([this.view.on(cj,e=>{this._handleInputEvent(e)},el.TOOL),...dae(this.tools),this.tools.on("before-add",({item:e})=>{this._updateToolEditableFlag(e)}),this.tools.on("before-remove",({item:e})=>{this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs),this._updateCursor()}),this.tools.on("change",()=>{this._refreshToolWatchers()})])}destroy(){this.detach(),this.handles.removeAll()}get _manipulatorStateEventArgs(){return{forEachTool:this._forEachTool,activeTool:this.activeTool,setActiveTool:e=>{this.activeTool=e},view:this.view}}set activeTool(e){if(M(e)&&!this.view.ready)return void q.getLogger(this.declaredClass).error("Cannot set active tool while view is not ready.");if(e===this.activeTool)return;const t=this.activeTool;this._set("activeTool",e),M(t)&&t.deactivate(),M(e)&&e.activate(),this._removeIncompleteTools(e);for(const i of this.tools){this._updateToolEditableFlag(i);const s=sM(i);!N(this.activeTool)&&s||this._manipulatorState.clearPointers(i,this._manipulatorStateEventArgs,!s)}this._updateCursor()}get updating(){var e,t;return this.updatingHandles.updating||this.tools.some(i=>i.updating)||((t=(e=this.textures)==null?void 0:e.updating)!=null?t:!1)}attach(){this.view.type==="3d"?(this._set("textures",new Hp(this.view._stage,this.view.resourceController.scheduler)),this.handles.add([Z(()=>{const{state:e}=this.view;return"camera"in e&&e.camera},()=>{this._forEachManipulator(e=>{e.onViewChange!=null&&e.onViewChange()})}),this.view.elevationProvider.on("elevation-change",e=>{this._forEachManipulator(t=>{t.onElevationChange!=null&&t.onElevationChange(e)})}),nd(()=>this._set("textures",$t(this.textures)))],lA)):this.handles.add(Z(()=>this.view.extent,()=>{this._forEachManipulator(e=>{e.onViewChange!=null&&e.onViewChange()})}))}detach(){M(this.activeTool)&&(this.activeTool=null),this.tools.removeAll(),this.handles.remove(lA)}_forEachManipulator(e){this._forEachTool(t=>{t.manipulators&&t.manipulators.forEach(({manipulator:i})=>e(i,t))})}_handleInputEvent(e){let t=!1;const i={...e,stopPropagation:()=>{t=!0,e.stopPropagation()}};M(this.activeTool)?this.activeTool.handleInputEvent&&this.activeTool.handleInputEvent(i):this._forEachTool(s=>{!t&&s.visible&&s.handleInputEvent(i)}),!t&&e.type==="key-down"&&e.key==="Escape"&&this.activeTool&&(e.stopPropagation(),this.activeTool=null),this._manipulatorState.handleInputEvent(i,this._manipulatorStateEventArgs),!t&&M(this.activeTool)&&this.activeTool.handleInputEventAfter(i),this._manipulatorState.handleHoverEvent(i,this._forEachTool),this._updateCursor()}_refreshToolWatchers(){this.handles.remove(Ow),this._forEachTool(e=>{if(e instanceof oe){const t=Z(()=>[e.cursor,e.visible,e.editable],()=>{sM(e)||this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs),this._updateCursor()});this.handles.add(t,Ow)}e.manipulators&&this.handles.add([e.manipulators.on("after-remove",t=>{this._manipulatorState.clearPointers(e,this._manipulatorStateEventArgs,!0,t.item.manipulator)}),e.manipulators.on("change",()=>{this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()})],Ow)}),this._manipulatorState.updateHoveredStateFromKnownPointers(this._forEachTool),this._updateCursor()}_updateToolEditableFlag(e){e.setEditableFlag(pm.MANAGER,N(this.activeTool)||e===this.activeTool)}_updateCursor(){let e=this._manipulatorState.cursor;N(e)&&this._forEachTool(t=>!(!M(t.cursor)||!t.visible)&&(e=t.cursor,!0)),this._get("cursor")!==e&&this._set("cursor",e)}_removeIncompleteTools(e){this.tools.filter(t=>(N(e)||t!==e)&&!t.created&&t.removeIncompleteOnCancel).forEach(t=>{this.tools.remove(t)})}};c([h({constructOnly:!0,nonNullable:!0})],ao.prototype,"view",void 0),c([h({readOnly:!0,nonNullable:!0})],ao.prototype,"textures",void 0),c([h({value:null})],ao.prototype,"activeTool",null),c([h({readOnly:!0,type:he})],ao.prototype,"tools",void 0),c([h({readOnly:!0})],ao.prototype,"cursor",void 0),c([h({readOnly:!0})],ao.prototype,"updating",null),ao=c([S("esri.views.ToolViewManager")],ao);const mae=ao;let nh=class extends oe{constructor(e){super(),this.nativeIndex=null,this._detectedDeviceType="unknown",e.mapping==="standard"?this._detectedDeviceType="standard":yae.test(e.id)?this._detectedDeviceType="spacemouse":this._detectedDeviceType="unknown",this.nativeIndex=e.index}get native(){const e=navigator.getGamepads?navigator.getGamepads():[];return this.nativeIndex!=null&&this.nativeIndeximport("./geometryServiceUtils.89c8be1f.js"),[]).then(t=>rM=t)),await Rw,Ft(e)}async function vj(e,t,i,s){if(!e)return null;const r=e.spatialReference;return ol()||Ro(r,t)?hd(e,t):rM?rM.projectGeometry(e,t,i,s):(await Promise.race([Mae(s),al(s)]),vj(e,t,i,s))}let We=class extends oe{constructor(e){super(e),this.required={tileInfo:!1,heightModelInfo:!1,extent:!1},this.defaultSpatialReference=null,this.userSpatialReference=null,this.sourcePreloadCount=10,this.priorityCollection=null,this.requiresExtentInSpatialReference=!0,this.suspended=!1,this._projectExtentTask={task:null,input:null,output:null,spatialReference:null}}destroy(){this._projectExtentTask.task&&(this._projectExtentTask.task=k0(this._projectExtentTask.task)),this._set("map",null)}get ready(){return!this._spatialReferenceTask.updating&&!this._tileInfoTask.updating&&!this._extentTask.updating}get heightModelInfoReady(){return!this._heightModelInfoTask.updating}get spatialReference(){return M(this.userSpatialReference)?this.userSpatialReference:this._spatialReferenceTask.spatialReference}get extent(){return this._extentTask.extent}get heightModelInfo(){return this._heightModelInfoTask.heightModelInfo}get vcsWkid(){return this._heightModelInfoTask.vcsWkid}get latestVcsWkid(){return this._heightModelInfoTask.latestVcsWkid}get viewingMode(){return N(this.userSpatialReference)||this.userSpatialReference.equals(this._spatialReferenceTask.spatialReference)?this._spatialReferenceTask.viewingMode:null}get tileInfo(){return this._tileInfoTask.tileInfo}get mapCollections(){var i,s,r,n;const e=(i=this.map)==null?void 0:i.call(this),t=[];return M(this.priorityCollection)&&t.push(this.priorityCollection),t.push({parent:e==null?void 0:e.basemap,layers:(s=e==null?void 0:e.basemap)==null?void 0:s.baseLayers},{layers:e==null?void 0:e.layers},{parent:e==null?void 0:e.ground,layers:(r=e==null?void 0:e.ground)==null?void 0:r.layers},{parent:e==null?void 0:e.basemap,layers:(n=e==null?void 0:e.basemap)==null?void 0:n.referenceLayers}),t}get _allLayers(){return this._collectLayers(this.mapCollections)}get _spatialReferenceTask(){var r;if(this.suspended)return(r=this._get("_spatialReferenceTask"))!=null?r:{updating:!1};const{layers:e,updating:t}=this._allLayers;let i=null;for(const n of e){const o=this._getSupportedSpatialReferences(n);if(o.length>0){const a=this._narrowDownSpatialReferenceCandidates(i,o);M(a)&&(i=a)}if(M(i)&&i.length===1)break}if(t&&(N(i)||i.length!==1))return{updating:!0};const s=this._pickSpatialReferenceCandidate(i);return{spatialReference:M(s)?s.spatialReference:null,viewingMode:M(s)?s.viewingMode:null,updating:!1}}get _tileInfoTask(){var i,s,r,n,o,a,l,u;if(!this.required.tileInfo)return(i=this._get("_tileInfoTask"))!=null?i:{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const{layers:e,updating:t}=this._collectLayers([{parent:(r=(s=this.map)==null?void 0:s.call(this))==null?void 0:r.basemap,layers:(a=(o=(n=this.map)==null?void 0:n.call(this))==null?void 0:o.basemap)==null?void 0:a.baseLayers},{layers:(u=(l=this.map)==null?void 0:l.call(this))==null?void 0:u.layers}]);if(e&&e.length>0&&"tileInfo"in e[0]){const d=e[0].tileInfo;return{tileInfo:d&&d.spatialReference.equals(this.spatialReference)?d:null,updating:!1}}return{updating:t}}get _heightModelInfoTask(){var i,s,r,n;if(!this.required.heightModelInfo||this.suspended&&((i=this._get("_heightModelInfoTask"))==null?void 0:i.heightModelInfo))return(s=this._get("_heightModelInfoTask"))!=null?s:{updating:!1};const{layers:e,updating:t}=this._allLayers;for(const o of e)if(xae(o)){const a=_ae(o);if(a)return{heightModelInfo:a,vcsWkid:(r=o.spatialReference)==null?void 0:r.vcsWkid,latestVcsWkid:(n=o.spatialReference)==null?void 0:n.latestVcsWkid,updating:!1}}return{updating:t}}get _extentCandidatesTask(){var s,r;if(this.suspended||!this.required.extent)return(s=this._get("_extentCandidatesTask"))!=null?s:{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const e=this._allLayers,t=e.updating,i=[];for(const n of e.layers){const o="fullExtents"in n&&n.fullExtents||(M(n.fullExtent)?[n.fullExtent]:[]),a=this.requiresExtentInSpatialReference?null:o[0],l=(r=o.find(u=>u.spatialReference.equals(this.spatialReference)))!=null?r:a;if(l)return{candidates:[{extent:l,layer:n}],updating:!1};if(this._getSupportedSpatialReferences(n).length>0)for(const u of o)i.push({extent:u,layer:n})}return{candidates:i,updating:t}}get _extentTask(){const{candidates:e,updating:t}=this._extentCandidatesTask;if(t)return{updating:t};if(N(e)||e.length===0)return{updating:!1};if(!this.spatialReference)return{updating:this._spatialReferenceTask.updating};const i=this._pickExtentCandidate(e),s=this.spatialReference;return i.extent.equals(this._projectExtentTask.input)&&s.equals(this._projectExtentTask.spatialReference)?{extent:this._projectExtentTask.output,updating:M(this._projectExtentTask.task)&&!this._projectExtentTask.task.finished}:(M(this._projectExtentTask.task)&&(this._projectExtentTask.task=k0(this._projectExtentTask.task)),this._projectExtentTask={input:i.extent.clone(),output:null,spatialReference:s.clone(),task:pD(async r=>{try{const n=await vj(i.extent,s,i.layer.portalItem,r);this._projectExtentTask={...this._projectExtentTask,task:null,output:n}}catch{if(jr(r))return;this._projectExtentTask={...this._projectExtentTask,task:null}}})},{updating:!0})}_narrowDownSpatialReferenceCandidates(e,t){if(N(e))return t;const i=[],s=(r,n)=>M(r)?M(n)?r===n&&r:r:n;for(const r of e)for(const n of t){if(!r.spatialReference.equals(n.spatialReference))continue;const o=s(r.viewingMode,n.viewingMode);if(o!==!1){i.push({spatialReference:r.spatialReference,viewingMode:o});break}}return i.length>0?i:null}_pickSpatialReferenceCandidate(e){const t=this.defaultSpatialReference;return N(e)||e.length<1?M(t)?{spatialReference:t,viewingMode:null}:null:(M(t)&&e.length>1&&e.some(({spatialReference:i})=>i.equals(t))&&(e=e.filter(({spatialReference:i})=>i.equals(t))),e.length>1&&e.some(({viewingMode:i})=>i!==Rv.Local)&&(e=e.filter(({viewingMode:i})=>i!==Rv.Local)),e[0])}_getSupportedSpatialReferences(e){const t="supportedSpatialReferences"in e&&e.supportedSpatialReferences||(e.spatialReference?[e.spatialReference]:[]);if(t.length===0)return[];const i=[];for(const s of t){const r=this.getSpatialReferenceSupport({spatialReference:s,layer:e});if(M(r)){const n=M(r.constraints)?r.constraints:[{spatialReference:s,viewingMode:null}];for(const{spatialReference:o,viewingMode:a}of n)(!this.requiresExtentInSpatialReference||N(this.userSpatialReference)||o.equals(this.userSpatialReference))&&i.push({spatialReference:o,viewingMode:a})}}return i}_pickExtentCandidate(e){const t=this.spatialReference;return e.find(({extent:i})=>t.equals(i.spatialReference))||e[0]}_collectLayers(e){var i;if(this._loadMaybe((i=this.map)==null?void 0:i.call(this))!=="loaded")return{layers:[],updating:!0};const t={layers:[],preloading:-1,updating:!1};for(const s of e)if(this._collectCollection(s,t),t.preloading===this.sourcePreloadCount)break;return{layers:t.layers,updating:t.updating}}_collectCollection(e,t){if(e.layers){switch(this._loadMaybe(e.parent)){case"loading":return t.updating=!0,void++t.preloading;case"failed":return}for(const i of e.layers){switch(this._loadMaybe(i)){case"failed":continue;case"loading":t.updating=!0,++t.preloading;break;case"loaded":t.updating||t.layers.push(i),"layers"in i&&this._collectCollection({layers:i.layers},t)}if(t.preloading===this.sourcePreloadCount)break}}}_loadMaybe(e){return e&&"loadStatus"in e?e.loadStatus==="not-loaded"?(e.load().catch(()=>{}),"loading"):e.loadStatus:"loaded"}};c([h()],We.prototype,"required",void 0),c([h({constructOnly:!0})],We.prototype,"map",void 0),c([h({constructOnly:!0})],We.prototype,"getSpatialReferenceSupport",void 0),c([h()],We.prototype,"defaultSpatialReference",void 0),c([h()],We.prototype,"userSpatialReference",void 0),c([h()],We.prototype,"sourcePreloadCount",void 0),c([h()],We.prototype,"priorityCollection",void 0),c([h()],We.prototype,"requiresExtentInSpatialReference",void 0),c([h()],We.prototype,"suspended",void 0),c([h({readOnly:!0})],We.prototype,"ready",null),c([h({readOnly:!0})],We.prototype,"heightModelInfoReady",null),c([h({readOnly:!0})],We.prototype,"spatialReference",null),c([h({readOnly:!0})],We.prototype,"extent",null),c([h({readOnly:!0})],We.prototype,"heightModelInfo",null),c([h({readOnly:!0})],We.prototype,"vcsWkid",null),c([h({readOnly:!0})],We.prototype,"latestVcsWkid",null),c([h({readOnly:!0})],We.prototype,"viewingMode",null),c([h({readOnly:!0})],We.prototype,"tileInfo",null),c([h({readOnly:!0})],We.prototype,"mapCollections",null),c([h({readOnly:!0})],We.prototype,"_allLayers",null),c([h({readOnly:!0})],We.prototype,"_spatialReferenceTask",null),c([h({readOnly:!0})],We.prototype,"_tileInfoTask",null),c([h({readOnly:!0})],We.prototype,"_heightModelInfoTask",null),c([h({readOnly:!0})],We.prototype,"_extentCandidatesTask",null),c([h()],We.prototype,"_extentTask",null),c([h()],We.prototype,"_projectExtentTask",void 0),We=c([S("esri.views.support.DefaultsFromMap")],We);var p0;let fe=p0=class extends pu(jo.EventedMixin(cb(oe))){constructor(e){super(e),this._userSpatialReference=null,this._cursor=null,this.allLayerViews=new im({getCollections:()=>{var t,i,s;return[(t=this.basemapView)==null?void 0:t.baseLayerViews,(i=this.groundView)==null?void 0:i.layerViews,this.layerViews,(s=this.basemapView)==null?void 0:s.referenceLayerViews]},getChildrenFunction:t=>t.layerViews}),this.groundView=null,this.basemapView=null,this.fatalError=null,this.graphics=new qc,this.analyses=new Ov,this.typeSpecificPreconditionsReady=!0,this.layerViews=new he,this.magnifier=new aj,this.padding={left:0,top:0,right:0,bottom:0},this.ready=!1,this.spatialReferenceWarningDelay=1e3,this.supportsGround=!0,this.timeExtent=null,this.type=null,this.scale=null,this.updating=!1,this.initialExtentRequired=!0,this.input=new bae,this.navigation=new fj,this.layerViewManager=null,this.analysisViewManager=null,this.isHeightModelInfoRequired=!1,this.width=null,this.height=null,this.resizing=!1,this.suspended=!1,this.viewEvents=new uae(this),this.persistableViewModels=new he,this._isValid=!1,this._readyCycleForced=!1,this.handles.add(Z(()=>this.preconditionsReady,t=>{var i,s;t?(this._currentSpatialReference=this.spatialReference,p0.views.add(this)):(this._currentSpatialReference=null,p0.views.remove(this)),this.notifyChange("spatialReference"),!t&&this.ready?((i=this.toolViewManager)==null||i.detach(),M(this.analysisViewManager)&&this.analysisViewManager.detach(),(s=this.layerViewManager)==null||s.clear(),this._teardown()):t&&!this.ready&&(this._startup(),M(this.analysisViewManager)&&this.analysisViewManager.attach(),this.toolViewManager.attach())},Nh))}initialize(){this.addResolvingPromise(this.validate().then(()=>(this._isValid=!0,ub(()=>this.ready)))),this.basemapView=new Ma({view:this}),this.layerViewManager=new rae({view:this,layerViewImporter:{importLayerView:e=>this.importLayerView(e),hasLayerViewModule:e=>this.hasLayerViewModule(e)},supportsGround:this.supportsGround}),this.toolViewManager=new mae({view:this}),this._setupSpatialReferenceLogger(),this.handles.add([Z(()=>this.initialExtentRequired,e=>this.defaultsFromMap.required={...this.defaultsFromMap.required,extent:e},{sync:!0,initial:!0}),Z(()=>this.ready,e=>{this.defaultsFromMap&&(this.defaultsFromMap.suspended=e,this.defaultsFromMap.userSpatialReference=e?this.spatialReference:this._userSpatialReference)},{sync:!0}),Z(()=>this._userSpatialReference,e=>{this.defaultsFromMap&&(this.defaultsFromMap.userSpatialReference=e)},{sync:!0,initial:!0})])}_setupSpatialReferenceLogger(){let e=null;this.handles.add([Z(()=>{var t;return(t=this.defaultsFromMap)==null?void 0:t.ready},t=>{var s;const i=((s=this.map)==null?void 0:s.allLayers.length)>0;if(t&&!this.spatialReference&&i){if(M(e))return;const r=nd(()=>e=k0(e));e=pD(async n=>{try{await nb(this.spatialReferenceWarningDelay,null,n)}catch{return}finally{e=null}q.getLogger(this.declaredClass).warn("#spatialReference","no spatial reference could be derived from the currently added map layers")}),this.handles.add(r,"spatial-reference-logger-task")}else this.handles.remove("spatial-reference-logger-task")},{sync:!0})])}destroy(){if(this.destroyed)return;this.viewEvents.destroy(),this.allLayerViews.destroy(),this.navigation&&(this.navigation.destroy(),this._set("navigation",null)),this.graphics=$t(this.graphics),this.analyses=$t(this.analyses),this.handles.remove("defaultsFromMap"),this.defaultsFromMap.destroy(),this._set("defaultsFromMap",null),$t(this.analysisViewManager),this.toolViewManager=$t(this.toolViewManager),this.layerViewManager=$t(this.layerViewManager),this.basemapView=$t(this.basemapView),this.invalidate(),this._emitter.clear(),this.handles.removeAll();const e=this.map;this.map=null,e==null||e.destroy()}_startup(){this._set("ready",!0)}_teardown(){this._set("ready",!1)}whenReady(){return Promise.resolve(this)}toMap(){return q.getLogger(this.declaredClass).error("#toMap()","Not implemented on this instance of View"),null}get activeTool(){var e;return(e=this.toolViewManager)==null?void 0:e.activeTool}set activeTool(e){this.toolViewManager&&(this.toolViewManager.activeTool=e)}get animation(){return this._get("animation")}set animation(e){this._set("animation",e)}get _defaultsFromMapSettings(){return{}}get defaultsFromMap(){return new We({required:{tileInfo:!1,heightModelInfo:!1,extent:!1},map:()=>this.map,getSpatialReferenceSupport:e=>this.getSpatialReferenceSupport(e),...this._defaultsFromMapSettings})}get extent(){return this._get("extent")}set extent(e){this._set("extent",e)}get heightModelInfo(){return this.getDefaultHeightModelInfo()}get interacting(){return this.navigating}get navigating(){return!1}get preconditionsReady(){var e;return!(this.fatalError||!this._isValid||this._readyCycleForced||!this.map||Lo.isLoadable(this.map)&&!this.map.loaded||this.width===0||this.height===0||!this.spatialReference||!this._validateSpatialReference(this.spatialReference)||!this._currentSpatialReference&&!((e=this.defaultsFromMap)!=null&&e.ready)||!this.typeSpecificPreconditionsReady)}set map(e){e!==this._get("map")&&(e!=null&&e.destroyed&&(q.getLogger(this.declaredClass).warn("#map","The provided map is already destroyed",{map:e}),e=null),Lo.isLoadable(e)&&e.load().catch(()=>{}),this.constructed&&(this.forceReadyCycle(),this._currentSpatialReference=null),this._set("map",e))}get spatialReference(){var t,i;let e=this._userSpatialReference||this._currentSpatialReference||this.getDefaultSpatialReference()||null;return e&&((i=(t=this.defaultsFromMap)==null?void 0:t.required)==null?void 0:i.heightModelInfo)&&(e=e.clone(),e.vcsWkid=this.defaultsFromMap.vcsWkid,e.latestVcsWkid=this.defaultsFromMap.latestVcsWkid),e}set spatialReference(e){const t=!Kt(e,this._get("spatialReference"));this._set("_userSpatialReference",e),t&&(this._set("spatialReference",e),this._spatialReferenceChanged(e))}_spatialReferenceChanged(e){}get stationary(){return!this.animation&&!this.navigating&&!this.resizing}get tools(){var e;return(e=this.toolViewManager)==null?void 0:e.tools}get initialExtent(){var e;return(e=this.defaultsFromMap)==null?void 0:e.extent}get cursor(){const e=this.toolViewManager?this.toolViewManager.cursor:null;return M(e)?e:this._cursor||"default"}set cursor(e){this._cursor=e,this.notifyChange("cursor")}get size(){return[this.width,this.height]}whenLayerView(e){return this.layerViewManager.whenLayerView(e)}getDefaultSpatialReference(){var e;return(e=this.defaultsFromMap)==null?void 0:e.spatialReference}getDefaultHeightModelInfo(){var e,t,i;return(i=(t=this.map&&"heightModelInfo"in this.map?this.map.heightModelInfo:void 0)!=null?t:(e=this.defaultsFromMap)==null?void 0:e.heightModelInfo)!=null?i:null}importLayerView(e){throw new L("importLayerView() not implemented")}hasLayerViewModule(e){return!1}async validate(){}invalidate(){this._isValid=!1}getSpatialReferenceSupport(){return{constraints:null}}_validateSpatialReference(e){return M(this.getSpatialReferenceSupport({spatialReference:e}))}when(e,t){return this.isResolved()&&!this.ready&&q.getLogger(this.declaredClass).warn("#when()","Calling view.when() while the view is no longer ready but was already resolved once will resolve immediately. Use reactiveUtils.whenOnce(() => view.ready).then(...) instead."),super.when(e,t)}forceReadyCycle(){this.ready&&(Qs(()=>this.preconditionsReady===!1,()=>this._readyCycleForced=!1,{once:!0}),this._readyCycleForced=!0)}addAndActivateTool(e){this.toolViewManager.tools.add(e),this.activeTool=e}tryFatalErrorRecovery(){this.fatalError=null}};fe.views=new he,c([h()],fe.prototype,"_userSpatialReference",void 0),c([h()],fe.prototype,"activeTool",null),c([h({readOnly:!0})],fe.prototype,"allLayerViews",void 0),c([h()],fe.prototype,"groundView",void 0),c([h()],fe.prototype,"animation",null),c([h()],fe.prototype,"basemapView",void 0),c([h({readOnly:!0})],fe.prototype,"_defaultsFromMapSettings",null),c([h()],fe.prototype,"defaultsFromMap",null),c([h()],fe.prototype,"fatalError",void 0),c([h({type:Ze})],fe.prototype,"extent",null),c([h(nx(qc,"graphics"))],fe.prototype,"graphics",void 0),c([h(nx(Ov,"analyses"))],fe.prototype,"analyses",void 0),c([h({readOnly:!0,type:Qb})],fe.prototype,"heightModelInfo",null),c([h({readOnly:!0})],fe.prototype,"interacting",null),c([h({readOnly:!0})],fe.prototype,"navigating",null),c([h({readOnly:!0,dependsOn:["fatalError","_isValid","_readyCycleForced","map","map.loaded?","width","height","spatialReference","_currentSpatialReference","defaultsFromMap.ready","typeSpecificPreconditionsReady"]})],fe.prototype,"preconditionsReady",null),c([h({readOnly:!0})],fe.prototype,"typeSpecificPreconditionsReady",void 0),c([h({type:he,readOnly:!0})],fe.prototype,"layerViews",void 0),c([h({type:aj})],fe.prototype,"magnifier",void 0),c([h({value:null,type:PN})],fe.prototype,"map",null),c([h()],fe.prototype,"padding",void 0),c([h({readOnly:!0})],fe.prototype,"ready",void 0),c([h({type:xe})],fe.prototype,"spatialReference",null),c([h()],fe.prototype,"spatialReferenceWarningDelay",void 0),c([h()],fe.prototype,"stationary",null),c([h({readOnly:!0})],fe.prototype,"supportsGround",void 0),c([h({type:Ln})],fe.prototype,"timeExtent",void 0),c([h()],fe.prototype,"tools",null),c([h()],fe.prototype,"toolViewManager",void 0),c([h({readOnly:!0})],fe.prototype,"type",void 0),c([h({type:Number})],fe.prototype,"scale",void 0),c([h({readOnly:!0})],fe.prototype,"updating",void 0),c([h({readOnly:!0})],fe.prototype,"initialExtentRequired",void 0),c([h({readOnly:!0})],fe.prototype,"initialExtent",null),c([h()],fe.prototype,"cursor",null),c([h({readOnly:!0})],fe.prototype,"input",void 0),c([h({type:fj,nonNullable:!0})],fe.prototype,"navigation",void 0),c([h()],fe.prototype,"layerViewManager",void 0),c([h()],fe.prototype,"analysisViewManager",void 0),c([h()],fe.prototype,"width",void 0),c([h()],fe.prototype,"height",void 0),c([h({readOnly:!0})],fe.prototype,"resizing",void 0),c([h({value:null,readOnly:!0})],fe.prototype,"size",null),c([h({readOnly:!0})],fe.prototype,"suspended",void 0),c([h({readOnly:!0})],fe.prototype,"viewEvents",void 0),c([h({readOnly:!0})],fe.prototype,"persistableViewModels",void 0),c([h()],fe.prototype,"_isValid",void 0),c([h()],fe.prototype,"_readyCycleForced",void 0),c([h()],fe.prototype,"_currentSpatialReference",void 0),fe=p0=c([S("esri.views.View")],fe);const $ae=fe;let Ta=class extends J0{constructor(e){super(e),this.state="running",this.target=null,this._dfd=null}initialize(){this.addResolvingPromise(new Promise((e,t)=>this._dfd={resolve:e,reject:t}))}get done(){return this.state==="finished"||this.state==="stopped"}stop(){var e;this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","stopped"),(e=this._dfd)==null||e.reject(new L("ViewAnimation stopped")))}finish(){var e;this.state!=="stopped"&&this.state!=="finished"&&(this._set("state","finished"),(e=this._dfd)==null||e.resolve())}update(e,t){t||(t=No(e)?"waiting-for-target":"running"),this._set("target",e),this._set("state",t)}};c([h({readOnly:!0})],Ta.prototype,"done",null),c([h({readOnly:!0,type:String})],Ta.prototype,"state",void 0),c([h()],Ta.prototype,"target",void 0),Ta=c([S("esri.views.ViewAnimation")],Ta),function(e){e.State={RUNNING:"running",STOPPED:"stopped",FINISHED:"finished",WAITING_FOR_TARGET:"waiting-for-target"}}(Ta||(Ta={}));const nM=Ta;function Sc(e,t,i,s){const r=3*e,n=3*(i-e)-r,o=1-r-n,a=3*t,l=3*(s-t)-a,u=1-a-l;function d(g){return((o*g+n)*g+r)*g}function f(g){return((u*g+l)*g+a)*g}function m(g){return(3*o*g+2*n)*g+r}function y(g,v){let b,_,x,$,I,T;for(x=g,T=0;T<8;T++){if($=d(x)-g,Math.abs($)_)return _;for(;b<_;){if($=d(x),Math.abs($-g)$?b=x:_=x,x=.5*(_-b)+b}return x}return function(g,v=1e-6){return f(y(g,v))}}const Tae=/^cubic-bezier\((.*)\)/,Ws={};function Iae(e){let t=Ws[e]||null;if(!t){const i=Tae.exec(e);if(i){const s=i[1].split(",").map(r=>parseFloat(r.trim()));s.length!==4||s.some(r=>isNaN(r))||(t=Sc.apply(Sc,s))}}return t}Ws.ease=Sc(.25,.1,.25,1),Ws.linear=Sc(0,0,1,1),Ws.easeIn=Ws["ease-in"]=Sc(.42,0,1,1),Ws.easeOut=Ws["ease-out"]=Sc(0,0,.58,1),Ws.easeInOut=Ws["ease-in-out"]=Sc(.42,0,.58,1);function tl(){return[1,0,0,1,0,0]}function Eae(e){return[e[0],e[1],e[2],e[3],e[4],e[5]]}function kae(e,t,i,s,r,n){return[e,t,i,s,r,n]}function Cae(e,t){return new Float64Array(e,t,6)}Object.freeze(Object.defineProperty({__proto__:null,create:tl,clone:Eae,fromValues:kae,createView:Cae},Symbol.toStringTag,{value:"Module"}));function fm(e,t){return e[0]=t[0],e[1]=t[1],e}function ai(e,t,i){return e[0]=t,e[1]=i,e}function bj(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e}function mm(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e}function _j(e,t,i){return e[0]=t[0]*i[0],e[1]=t[1]*i[1],e}function wj(e,t,i){return e[0]=t[0]/i[0],e[1]=t[1]/i[1],e}function Pae(e,t){return e[0]=Math.ceil(t[0]),e[1]=Math.ceil(t[1]),e}function Aae(e,t){return e[0]=Math.floor(t[0]),e[1]=Math.floor(t[1]),e}function Oae(e,t,i){return e[0]=Math.min(t[0],i[0]),e[1]=Math.min(t[1],i[1]),e}function Rae(e,t,i){return e[0]=Math.max(t[0],i[0]),e[1]=Math.max(t[1],i[1]),e}function Lae(e,t){return e[0]=Math.round(t[0]),e[1]=Math.round(t[1]),e}function Hm(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e}function Fae(e,t,i,s){return e[0]=t[0]+i[0]*s,e[1]=t[1]+i[1]*s,e}function Ym(e,t){const i=t[0]-e[0],s=t[1]-e[1];return Math.sqrt(i*i+s*s)}function Lv(e,t){const i=t[0]-e[0],s=t[1]-e[1];return i*i+s*s}function Fv(e){const t=e[0],i=e[1];return Math.sqrt(t*t+i*i)}function xj(e){const t=e[0],i=e[1];return t*t+i*i}function Sj(e,t){return e[0]=-t[0],e[1]=-t[1],e}function Dae(e,t){return e[0]=1/t[0],e[1]=1/t[1],e}function oM(e,t){const i=t[0],s=t[1];let r=i*i+s*s;return r>0&&(r=1/Math.sqrt(r),e[0]=t[0]*r,e[1]=t[1]*r),e}function Mj(e,t){return e[0]*t[0]+e[1]*t[1]}function $j(e,t,i){const s=t[0]*i[1]-t[1]*i[0];return e[0]=e[1]=0,e[2]=s,e}function Nae(e,t,i,s){const r=t[0],n=t[1];return e[0]=r+s*(i[0]-r),e[1]=n+s*(i[1]-n),e}function jae(e,t){t=t||1;const i=2*mb()*Math.PI;return e[0]=Math.cos(i)*t,e[1]=Math.sin(i)*t,e}function Vae(e,t,i){const s=t[0],r=t[1];return e[0]=i[0]*s+i[2]*r,e[1]=i[1]*s+i[3]*r,e}function bn(e,t,i){const s=t[0],r=t[1];return e[0]=i[0]*s+i[2]*r+i[4],e[1]=i[1]*s+i[3]*r+i[5],e}function zae(e,t,i){const s=t[0],r=t[1];return e[0]=i[0]*s+i[3]*r+i[6],e[1]=i[1]*s+i[4]*r+i[7],e}function Bae(e,t,i){const s=t[0],r=t[1];return e[0]=i[0]*s+i[4]*r+i[12],e[1]=i[1]*s+i[5]*r+i[13],e}function Uae(e,t,i,s){const r=t[0]-i[0],n=t[1]-i[1],o=Math.sin(s),a=Math.cos(s);return e[0]=r*a-n*o+i[0],e[1]=r*o+n*a+i[1],e}function qae(e,t){const i=e[0],s=e[1],r=t[0],n=t[1];let o=i*i+s*s;o>0&&(o=1/Math.sqrt(o));let a=r*r+n*n;a>0&&(a=1/Math.sqrt(a));const l=(i*r+s*n)*o*a;return l>1?0:l<-1?Math.PI:Math.acos(l)}function Gae(e){return"vec2("+e[0]+", "+e[1]+")"}function Wae(e,t){return e[0]===t[0]&&e[1]===t[1]}function Hae(e,t){const i=e[0],s=e[1],r=t[0],n=t[1],o=er();return Math.abs(i-r)<=o*Math.max(1,Math.abs(i),Math.abs(r))&&Math.abs(s-n)<=o*Math.max(1,Math.abs(s),Math.abs(n))}function Yae(e,t,i,s,r){let n=t[0]-i[0],o=t[1]-i[1];const a=(s[0]*n+s[1]*o)*(r-1);return n=s[0]*a,o=s[1]*a,e[0]=t[0]+n,e[1]=t[1]+o,e}const Jae=Fv,QT=mm,Xae=_j,Zae=wj,Qae=Ym,Kae=Lv,ele=xj;Object.freeze(Object.defineProperty({__proto__:null,copy:fm,set:ai,add:bj,subtract:mm,multiply:_j,divide:wj,ceil:Pae,floor:Aae,min:Oae,max:Rae,round:Lae,scale:Hm,scaleAndAdd:Fae,distance:Ym,squaredDistance:Lv,length:Fv,squaredLength:xj,negate:Sj,inverse:Dae,normalize:oM,dot:Mj,cross:$j,lerp:Nae,random:jae,transformMat2:Vae,transformMat2d:bn,transformMat3:zae,transformMat4:Bae,rotate:Uae,angle:qae,str:Gae,exactEquals:Wae,equals:Hae,projectAndScale:Yae,len:Jae,sub:QT,mul:Xae,div:Zae,dist:Qae,sqrDist:Kae,sqrLen:ele},Symbol.toStringTag,{value:"Module"}));function Et(){return[0,0]}function tle(e){return[e[0],e[1]]}function Jm(e,t){return[e,t]}function ile(e){const t=Et(),i=Math.min(2,e.length);for(let s=0;s"attributes"in d),l=e.some(d=>!d.geometry);let u=e;if(a&&l&&t&&t.allLayerViews){const d=new Map;for(const g of e){const v=g.layer,b=d.get(v)||[],_=g.attributes[v.objectIdField];_!=null&&b.push(_),d.set(v,b)}const f=[];d.forEach((g,v)=>{const b=t.allLayerViews.find(_=>_.layer.id===v.id);if("queryFeatures"in b){const _=v.createQuery();_.objectIds=g,_.returnGeometry=!0,f.push(b.queryFeatures(_))}});const m=await Promise.all(f),y=[];for(const g of m)if(g&&g.features&&g.features.length)for(const v of g.features)M(v.geometry)&&y.push(v.geometry);u=y}for(const d of u)s=await Jp(d,t,i,s);return s}if(Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number")r=new be(e);else if(e instanceof fl)r=e;else if("geometry"in e){if(e.geometry)r=e.geometry;else if(e.layer){const a=e.layer,l=t.allLayerViews.find(u=>u.layer.id===a.id);if("queryFeatures"in l){const u=a.createQuery();u.objectIds=[e.attributes[a.objectIdField]],u.returnGeometry=!0;const d=await l.queryFeatures(u);r=w3(d,"features",0,"geometry")}}}if(N(r)||(n=r.type==="point"?new Ze({xmin:r.x,ymin:r.y,xmax:r.x,ymax:r.y,spatialReference:r.spatialReference}):r.extent,!n))return null;ol()||Ro(n.spatialReference,i)||await al();const o=hd(n,i);return o?s=s?s.union(o):o:null}function cle(e){if(e&&(!Array.isArray(e)||typeof e[0]!="number")&&(typeof e=="object"||Array.isArray(e)&&typeof e[0]=="object")){if("layer"in e&&e.layer&&e.layer.minScale&&e.layer.maxScale){const t=e.layer;return{min:t.minScale,max:t.maxScale}}if(Array.isArray(e)&&e.length&&e.every(t=>"layer"in t)){let t=0,i=0;for(const s of e){const r=s.layer;r&&r.minScale&&r.maxScale&&(t=r.minScalei?r.maxScale:i)}return t&&i?{min:t,max:i}:null}}}function Lw(e,t){return Kt(Aj(e),t)?e:hd(e,t)}async function ule(e,t){if(!e||!t)return new Mn({targetGeometry:new be,scale:0,rotation:0});let i=t.spatialReference;const{constraints:s,padding:r,viewpoint:n,size:o}=t,a=[r?o[0]-r.left-r.right:o[0],r?o[1]-r.top-r.bottom:o[1]];let l=null;e instanceof Mn?l=e:e.viewpoint?l=e.viewpoint:e.target&&e.target.declaredClass==="esri.Viewpoint"&&(l=e.target);let u=null;l&&l.targetGeometry?u=l.targetGeometry:e instanceof Ze?u=e:(e||e&&("center"in e||"extent"in e||"target"in e))&&(u=await Jp(e.center,t,i)||await Jp(e.extent,t,i)||await Jp(e.target,t,i)||await Jp(e,t,i)),!u&&n&&n.targetGeometry?u=n.targetGeometry:!u&&t.extent&&(u=t.extent),i||(i=Aj(t.spatialReference||t.extent||u)),ol()||Kt(u.spatialReference,i)||Ro(u,i)||await al();const d=Lw(u.center?u.center:u,i);let f=null;if(l&&M(l.targetGeometry)&&l.targetGeometry.type==="point")f=l.scale;else if("scale"in e&&e.scale)f=e.scale;else if("zoom"in e&&e.zoom!==-1&&s&&s.effectiveLODs)f=s.zoomToScale(e.zoom);else if(Array.isArray(u)||u.type==="point"||u.type==="extent"&&u.width===0&&u.height===0){const v=Lw(t.extent,i);f=M(v)?Ef(v,a):t.extent?Ef(t.extent,a):n.scale}else f=Ef(Lw(u.extent,i),a);const m=cle(e);m&&(m.min&&m.min>f?f=m.min:m.max&&m.max180?this.dRotation-=360:this.dRotation<-180&&(this.dRotation+=360)}applyRatio(t,i){const s=this.easing(i);let r,n,o,a;i>=1?(r=this.tCenterX,n=this.tCenterY,o=this.tRotation,a=this.tScale):(r=this.sCenterX+s*this.dCenterX,n=this.sCenterY+s*this.dCenterY,o=this.sRotation+s*this.dRotation,a=this.sScale+s*this.dScale),t.targetGeometry.x=r,t.targetGeometry.y=n,t.scale=a,t.rotation=o}}let lo=class extends oe{constructor(e){super(e),this.duration=200,this.transition=null,this.easing=Ws.ease,this.view=null,this.viewpoint=null,this.viewpoint=new Mn({targetGeometry:new be,scale:0,rotation:0}),this._updateTask=Dh({postRender:this._postRender.bind(this)}),this._updateTask.pause()}destroy(){this._updateTask.remove(),this._updateTask=null}animate(e,t,i){this.stop();const s=this.viewpoint;qr(s,t),this.transition=new Ile(this.viewpoint,e.target,i&&i.duration||this.duration,i&&i.easing||this.easing);const r=()=>{this.animation===e&&this._updateTask&&(e.state==="finished"&&(this.transition.applyRatio(this.viewpoint,1),this.view.state&&(this.view.state.viewpoint=this.viewpoint.clone())),this.animation=null,this.updateFunction=null)};return e.when(r,r),this._startTime=performance.now(),this._updateTask.resume(),this.animation=e,e}animateContinous(e,t){this.stop(),this.updateFunction=t,this.viewpoint=e;const i=new nM({target:e.clone()}),s=()=>{this.animation===i&&this._updateTask&&(this.animation=null,this.updateFunction=null)};return i.when(s,s),this._startTime=performance.now(),this._updateTask.resume(),this.animation=i,i}stop(){this.animation&&(this.animation.stop(),this.animation=null,this.updateFunction=null)}_postRender(e){const t=this.animation;if(t&&t.state!==nM.State.STOPPED){if(this.updateFunction)this.updateFunction(this.viewpoint,e.deltaTime);else{const i=(performance.now()-this._startTime)/this.transition.duration,s=i>=1;this.transition.applyRatio(this.viewpoint,i),s&&this.animation.finish()}this.view.state&&(this.view.state.viewpoint=this.viewpoint.clone())}else this._updateTask.pause()}};c([h()],lo.prototype,"animation",void 0),c([h()],lo.prototype,"duration",void 0),c([h()],lo.prototype,"transition",void 0),c([h()],lo.prototype,"easing",void 0),c([h()],lo.prototype,"view",void 0),c([h()],lo.prototype,"viewpoint",void 0),lo=c([S("esri.views.2d.AnimationManager")],lo);const Ele=lo;class kle{constructor(t){this.view=t,this._frameTaskHandle=null,this._updateRequested=!1,this.stationary=!0,this.animationInProgress=!1,this.prepare=()=>{this._updateParameters.state=this.view.state,this._updateParameters.stationary=this.view.stationary,this._updateParameters.pixelRatio=window.devicePixelRatio,this._updateParameters.renderingOptions=this.view.renderingOptions},this.update=()=>{this._updateRequested=!1;const{basemapView:i,graphicsView:s,labelManager:r,layerViews:n,state:{id:o}}=this.view;i.baseLayerViews.forEach(this._updateLayerView,this),n.forEach(this._updateLayerView,this),i.referenceLayerViews.forEach(this._updateLayerView,this),M(r)&&(r.lastUpdateId!==o&&(r.viewChange(),r.lastUpdateId=o),r.updateRequested&&r.processUpdate(this._updateParameters)),M(s)&&(s.lastUpdateId!==o&&(s.viewChange(),s.lastUpdateId=o),s.updateRequested&&s.processUpdate(this._updateParameters)),this.view.graphicsTileStore.setViewState(this._updateParameters.state),this.animationInProgress||this._updateRequested||this._frameTaskHandle.pause()}}destroy(){this.stop()}start(){if(this._frameTaskHandle)return;const t=this.view;this.stationary=t.stationary,this._updateParameters={state:t.state,pixelRatio:window.devicePixelRatio,stationary:this.stationary,renderingOptions:t.renderingOptions},this._stationaryHandle=Z(()=>t.stationary,i=>{this.stationary=i,this.requestFrame()}),this._frameTaskHandle=Dh(this),this.requestUpdate()}stop(){this._frameTaskHandle&&(this._updateRequested=!1,this._stationaryHandle.remove(),this._frameTaskHandle.remove(),this._updateParameters=this._stationaryHandle=this._frameTaskHandle=null,this.stationary=!0,this.animationInProgress=!1)}requestUpdate(){this._updateRequested||(this._updateRequested=!0,this.requestFrame())}requestFrame(){this._frameTaskHandle&&this._frameTaskHandle.resume()}_updateLayerView(t){const i=this.view.state,s=t.lastUpdateId;s!=null&&(this.stationary||t.moving)||(t.moving=!0,t.moveStart()),s!==i.id&&t.viewChange(),this.stationary&&t.moving&&(t.moving=!1,t.moveEnd()),t.lastUpdateId=i.id,t.updateRequested&&t.processUpdate(this._updateParameters),"layerViews"in t&&t.layerViews.forEach(this._updateLayerView,this)}}function Vt(){return Promise.all([z(()=>import("./webglDeps.e3ffc164.js"),["assets/webglDeps.e3ffc164.js","assets/VertexArrayObject.53cf1857.js","assets/Texture.940076b2.js","assets/enums.2d9e6f64.js","assets/ProgramTemplate.cf9dd4e8.js","assets/programUtils.10ecfb8b.js"]),z(()=>import("./mapViewDeps.692d211f.js"),["assets/mapViewDeps.692d211f.js","assets/_commonjsHelpers.773c2c82.js","assets/imageutils.5e4d6270.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/BufferPool.98277e4b.js","assets/WGLContainer.347cc5cd.js","assets/pixelUtils.9c6f8dae.js","assets/VertexArrayObject.53cf1857.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/enums.54326430.js","assets/programUtils.10ecfb8b.js","assets/RenderingContext.8853f4cd.js","assets/OrderIndependentTransparency.4d1575c0.js","assets/floatRGBA.3f71f8e9.js","assets/ExpandedCIM.a372ce74.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.7ff797cc.js","assets/GeometryUtils.4f19e772.js","assets/rasterizingUtils.ec7fabe7.js","assets/Matcher.6586928a.js","assets/visualVariablesUtils.061b7a4e.js","assets/visualVariablesUtils.62efda9d.js","assets/tileUtils.332711ed.js","assets/TileClipper.77103a2e.js","assets/Geometry.d049a63c.js","assets/devEnvironmentUtils.d8d0484c.js","assets/CircularArray.62f75f43.js","assets/imageUtils.753f41b1.js","assets/ComputedAttributeStorage.29767acd.js","assets/centroid.06db4b74.js","assets/BaseGraphicContainer.7704bbc1.js","assets/normalizeUtilsSync.4d52fbd0.js","assets/projectionSupport.4f5da4af.js","assets/json.879c9adc.js","assets/FeatureContainer.b427dd87.js","assets/TileContainer.5aeb32d6.js","assets/schemaUtils.d20994fa.js","assets/createSymbolSchema.827eb617.js","assets/util.520a352e.js","assets/vec3f32.1121a836.js","assets/GraphicContainer.b0be80ad.js","assets/requestImageUtils.1f5d4b6d.js"])])}const qd=()=>Vt().then(()=>z(()=>import("./TileLayerView2D.18abd98d.js"),["assets/TileLayerView2D.18abd98d.js","assets/imageUtils.215a62b1.js","assets/BitmapTileContainer.f5b20598.js","assets/Bitmap.72a3702e.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/TileContainer.5aeb32d6.js","assets/WGLContainer.347cc5cd.js","assets/pixelUtils.9c6f8dae.js","assets/VertexArrayObject.53cf1857.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.ce6e0535.js","assets/RefreshableLayerView.887ed8c3.js","assets/drapedUtils.0866c85c.js"])),Gd=()=>Vt().then(()=>z(()=>import("./FeatureLayerView2D.7c1a650d.js"),["assets/FeatureLayerView2D.7c1a650d.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/LayerView.ce6e0535.js","assets/schemaUtils.d20994fa.js","assets/visualVariablesUtils.62efda9d.js","assets/createSymbolSchema.827eb617.js","assets/ExpandedCIM.a372ce74.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.7ff797cc.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.3f71f8e9.js","assets/util.520a352e.js","assets/floorFilterUtils.05eb8c6a.js","assets/popupUtils.c6371f3a.js","assets/RefreshableLayerView.887ed8c3.js"])),hA={"base-dynamic":()=>Vt().then(()=>z(()=>import("./BaseDynamicLayerView2D.be251f41.js"),["assets/BaseDynamicLayerView2D.be251f41.js","assets/BitmapContainer.9e943f6d.js","assets/WGLContainer.347cc5cd.js","assets/enums.2d9e6f64.js","assets/pixelUtils.9c6f8dae.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/VertexArrayObject.53cf1857.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.ce6e0535.js","assets/ExportStrategy.fb59ab52.js","assets/Bitmap.72a3702e.js","assets/RefreshableLayerView.887ed8c3.js"])),"base-tile":qd,"bing-maps":qd,csv:Gd,"geo-rss":()=>Vt().then(()=>z(()=>import("./GeoRSSLayerView2D.f2cd7f86.js"),["assets/GeoRSSLayerView2D.f2cd7f86.js","assets/LayerView.ce6e0535.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/GraphicContainer.b0be80ad.js","assets/BaseGraphicContainer.7704bbc1.js","assets/ExpandedCIM.a372ce74.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.7ff797cc.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.3f71f8e9.js","assets/normalizeUtilsSync.4d52fbd0.js","assets/projectionSupport.4f5da4af.js","assets/json.879c9adc.js","assets/VertexArrayObject.53cf1857.js","assets/FeatureContainer.b427dd87.js","assets/TileContainer.5aeb32d6.js","assets/WGLContainer.347cc5cd.js","assets/pixelUtils.9c6f8dae.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/visualVariablesUtils.061b7a4e.js","assets/visualVariablesUtils.62efda9d.js","assets/Matcher.6586928a.js","assets/tileUtils.332711ed.js","assets/TileClipper.77103a2e.js","assets/Geometry.d049a63c.js","assets/devEnvironmentUtils.d8d0484c.js","assets/schemaUtils.d20994fa.js","assets/createSymbolSchema.827eb617.js","assets/util.520a352e.js","assets/ComputedAttributeStorage.29767acd.js","assets/centroid.06db4b74.js","assets/vec3f32.1121a836.js"])),feature:Gd,geojson:Gd,graphics:()=>Vt().then(()=>z(()=>import("./GraphicsLayerView2D.a23860d1.js"),["assets/GraphicsLayerView2D.a23860d1.js","assets/LayerView.ce6e0535.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/GraphicContainer.b0be80ad.js","assets/BaseGraphicContainer.7704bbc1.js","assets/ExpandedCIM.a372ce74.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.7ff797cc.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.3f71f8e9.js","assets/normalizeUtilsSync.4d52fbd0.js","assets/projectionSupport.4f5da4af.js","assets/json.879c9adc.js","assets/VertexArrayObject.53cf1857.js","assets/FeatureContainer.b427dd87.js","assets/TileContainer.5aeb32d6.js","assets/WGLContainer.347cc5cd.js","assets/pixelUtils.9c6f8dae.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/visualVariablesUtils.061b7a4e.js","assets/visualVariablesUtils.62efda9d.js","assets/Matcher.6586928a.js","assets/tileUtils.332711ed.js","assets/TileClipper.77103a2e.js","assets/Geometry.d049a63c.js","assets/devEnvironmentUtils.d8d0484c.js","assets/schemaUtils.d20994fa.js","assets/createSymbolSchema.827eb617.js","assets/util.520a352e.js","assets/ComputedAttributeStorage.29767acd.js","assets/centroid.06db4b74.js","assets/vec3f32.1121a836.js"])),group:()=>Vt().then(()=>z(()=>import("./GroupLayerView2D.f66e97aa.js"),["assets/GroupLayerView2D.f66e97aa.js","assets/GroupContainer.f412d859.js","assets/WGLContainer.347cc5cd.js","assets/enums.2d9e6f64.js","assets/pixelUtils.9c6f8dae.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/VertexArrayObject.53cf1857.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.ce6e0535.js"])),imagery:()=>Vt().then(()=>z(()=>import("./ImageryLayerView2D.f0826692.js"),["assets/ImageryLayerView2D.f0826692.js","assets/RasterVFDisplayObject.da692284.js","assets/VertexArrayObject.53cf1857.js","assets/Texture.940076b2.js","assets/enums.2d9e6f64.js","assets/VertexElementDescriptor.1fdca6da.js","assets/dataUtils.e7623e56.js","assets/pixelUtils.9c6f8dae.js","assets/WGLContainer.347cc5cd.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/MaterialKey.0cadabc1.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.ce6e0535.js","assets/BaseGraphicContainer.7704bbc1.js","assets/ExpandedCIM.a372ce74.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.7ff797cc.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.3f71f8e9.js","assets/normalizeUtilsSync.4d52fbd0.js","assets/projectionSupport.4f5da4af.js","assets/json.879c9adc.js","assets/FeatureContainer.b427dd87.js","assets/TileContainer.5aeb32d6.js","assets/visualVariablesUtils.061b7a4e.js","assets/visualVariablesUtils.62efda9d.js","assets/Matcher.6586928a.js","assets/tileUtils.332711ed.js","assets/TileClipper.77103a2e.js","assets/Geometry.d049a63c.js","assets/devEnvironmentUtils.d8d0484c.js","assets/schemaUtils.d20994fa.js","assets/createSymbolSchema.827eb617.js","assets/util.520a352e.js","assets/ComputedAttributeStorage.29767acd.js","assets/centroid.06db4b74.js","assets/vec3f32.1121a836.js","assets/HighlightGraphicContainer.a4fdc946.js","assets/BitmapContainer.9e943f6d.js","assets/Bitmap.72a3702e.js","assets/ExportStrategy.fb59ab52.js","assets/rasterProjectionHelper.f3c10be2.js","assets/popupUtils.c6371f3a.js","assets/RefreshableLayerView.887ed8c3.js"])),"imagery-tile":()=>Vt().then(()=>z(()=>import("./ImageryTileLayerView2D.14079c8d.js"),["assets/ImageryTileLayerView2D.14079c8d.js","assets/multidimensionalUtils.59c05ac5.js","assets/RasterVFDisplayObject.da692284.js","assets/VertexArrayObject.53cf1857.js","assets/Texture.940076b2.js","assets/enums.2d9e6f64.js","assets/VertexElementDescriptor.1fdca6da.js","assets/dataUtils.e7623e56.js","assets/pixelUtils.9c6f8dae.js","assets/WGLContainer.347cc5cd.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/MaterialKey.0cadabc1.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.ce6e0535.js","assets/TileContainer.5aeb32d6.js","assets/RawBlockCache.e5f26f22.js","assets/rasterProjectionHelper.f3c10be2.js","assets/util.520a352e.js","assets/popupUtils.c6371f3a.js","assets/RefreshableLayerView.887ed8c3.js"])),kml:()=>Vt().then(()=>z(()=>import("./KMLLayerView2D.5351cad6.js"),["assets/KMLLayerView2D.5351cad6.js","assets/kmlUtils.3e458b80.js","assets/Bitmap.72a3702e.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/BitmapContainer.9e943f6d.js","assets/WGLContainer.347cc5cd.js","assets/pixelUtils.9c6f8dae.js","assets/VertexArrayObject.53cf1857.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.ce6e0535.js","assets/GraphicContainer.b0be80ad.js","assets/BaseGraphicContainer.7704bbc1.js","assets/ExpandedCIM.a372ce74.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.7ff797cc.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.3f71f8e9.js","assets/normalizeUtilsSync.4d52fbd0.js","assets/projectionSupport.4f5da4af.js","assets/json.879c9adc.js","assets/FeatureContainer.b427dd87.js","assets/TileContainer.5aeb32d6.js","assets/visualVariablesUtils.061b7a4e.js","assets/visualVariablesUtils.62efda9d.js","assets/Matcher.6586928a.js","assets/tileUtils.332711ed.js","assets/TileClipper.77103a2e.js","assets/Geometry.d049a63c.js","assets/devEnvironmentUtils.d8d0484c.js","assets/schemaUtils.d20994fa.js","assets/createSymbolSchema.827eb617.js","assets/util.520a352e.js","assets/ComputedAttributeStorage.29767acd.js","assets/centroid.06db4b74.js","assets/vec3f32.1121a836.js","assets/rasterProjectionHelper.f3c10be2.js","assets/RenderingContext.8853f4cd.js","assets/programUtils.10ecfb8b.js","assets/OrderIndependentTransparency.4d1575c0.js"])),"map-image":()=>Vt().then(()=>z(()=>import("./MapImageLayerView2D.de2fd653.js"),["assets/MapImageLayerView2D.de2fd653.js","assets/BitmapContainer.9e943f6d.js","assets/WGLContainer.347cc5cd.js","assets/enums.2d9e6f64.js","assets/pixelUtils.9c6f8dae.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/VertexArrayObject.53cf1857.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.ce6e0535.js","assets/BaseGraphicContainer.7704bbc1.js","assets/ExpandedCIM.a372ce74.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.7ff797cc.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.3f71f8e9.js","assets/normalizeUtilsSync.4d52fbd0.js","assets/projectionSupport.4f5da4af.js","assets/json.879c9adc.js","assets/FeatureContainer.b427dd87.js","assets/TileContainer.5aeb32d6.js","assets/visualVariablesUtils.061b7a4e.js","assets/visualVariablesUtils.62efda9d.js","assets/Matcher.6586928a.js","assets/tileUtils.332711ed.js","assets/TileClipper.77103a2e.js","assets/Geometry.d049a63c.js","assets/devEnvironmentUtils.d8d0484c.js","assets/schemaUtils.d20994fa.js","assets/createSymbolSchema.827eb617.js","assets/util.520a352e.js","assets/ComputedAttributeStorage.29767acd.js","assets/centroid.06db4b74.js","assets/vec3f32.1121a836.js","assets/HighlightGraphicContainer.a4fdc946.js","assets/ExportStrategy.fb59ab52.js","assets/Bitmap.72a3702e.js","assets/scaleUtils.de5ad5a6.js","assets/ExportImageParameters.65ee285f.js","assets/floorFilterUtils.05eb8c6a.js","assets/sublayerUtils.59f5d9da.js","assets/drapedUtils.0866c85c.js","assets/popupUtils.c6371f3a.js","assets/RefreshableLayerView.887ed8c3.js"])),"map-notes":()=>Vt().then(()=>z(()=>import("./MapNotesLayerView2D.c9456f55.js"),["assets/MapNotesLayerView2D.c9456f55.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/GroupContainer.f412d859.js","assets/WGLContainer.347cc5cd.js","assets/pixelUtils.9c6f8dae.js","assets/VertexArrayObject.53cf1857.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.ce6e0535.js","assets/GraphicContainer.b0be80ad.js","assets/BaseGraphicContainer.7704bbc1.js","assets/ExpandedCIM.a372ce74.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.7ff797cc.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.3f71f8e9.js","assets/normalizeUtilsSync.4d52fbd0.js","assets/projectionSupport.4f5da4af.js","assets/json.879c9adc.js","assets/FeatureContainer.b427dd87.js","assets/TileContainer.5aeb32d6.js","assets/visualVariablesUtils.061b7a4e.js","assets/visualVariablesUtils.62efda9d.js","assets/Matcher.6586928a.js","assets/tileUtils.332711ed.js","assets/TileClipper.77103a2e.js","assets/Geometry.d049a63c.js","assets/devEnvironmentUtils.d8d0484c.js","assets/schemaUtils.d20994fa.js","assets/createSymbolSchema.827eb617.js","assets/util.520a352e.js","assets/ComputedAttributeStorage.29767acd.js","assets/centroid.06db4b74.js","assets/vec3f32.1121a836.js"])),media:()=>Vt().then(()=>z(()=>import("./MediaLayerView2D.44f0fc2d.js"),["assets/MediaLayerView2D.44f0fc2d.js","assets/normalizeUtilsSync.4d52fbd0.js","assets/mat3f64.6d32a1d7.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/VertexArrayObject.53cf1857.js","assets/vec3f32.1121a836.js","assets/WGLContainer.347cc5cd.js","assets/pixelUtils.9c6f8dae.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.ce6e0535.js"])),"ogc-feature":()=>Vt().then(()=>z(()=>import("./OGCFeatureLayerView2D.5ee46b9c.js"),["assets/OGCFeatureLayerView2D.5ee46b9c.js","assets/FeatureLayerView2D.7c1a650d.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/LayerView.ce6e0535.js","assets/schemaUtils.d20994fa.js","assets/visualVariablesUtils.62efda9d.js","assets/createSymbolSchema.827eb617.js","assets/ExpandedCIM.a372ce74.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.7ff797cc.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.3f71f8e9.js","assets/util.520a352e.js","assets/floorFilterUtils.05eb8c6a.js","assets/popupUtils.c6371f3a.js","assets/RefreshableLayerView.887ed8c3.js"])),"open-street-map":qd,"oriented-imagery":Gd,route:()=>Vt().then(()=>z(()=>import("./RouteLayerView2D.3761d027.js"),["assets/RouteLayerView2D.3761d027.js","assets/Stop.6862dd5a.js","assets/LayerView.ce6e0535.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/GraphicContainer.b0be80ad.js","assets/BaseGraphicContainer.7704bbc1.js","assets/ExpandedCIM.a372ce74.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.7ff797cc.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.3f71f8e9.js","assets/normalizeUtilsSync.4d52fbd0.js","assets/projectionSupport.4f5da4af.js","assets/json.879c9adc.js","assets/VertexArrayObject.53cf1857.js","assets/FeatureContainer.b427dd87.js","assets/TileContainer.5aeb32d6.js","assets/WGLContainer.347cc5cd.js","assets/pixelUtils.9c6f8dae.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/visualVariablesUtils.061b7a4e.js","assets/visualVariablesUtils.62efda9d.js","assets/Matcher.6586928a.js","assets/tileUtils.332711ed.js","assets/TileClipper.77103a2e.js","assets/Geometry.d049a63c.js","assets/devEnvironmentUtils.d8d0484c.js","assets/schemaUtils.d20994fa.js","assets/createSymbolSchema.827eb617.js","assets/util.520a352e.js","assets/ComputedAttributeStorage.29767acd.js","assets/centroid.06db4b74.js","assets/vec3f32.1121a836.js"])),stream:()=>Vt().then(()=>z(()=>import("./StreamLayerView2D.29625b01.js"),["assets/StreamLayerView2D.29625b01.js","assets/FeatureLayerView2D.7c1a650d.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/LayerView.ce6e0535.js","assets/schemaUtils.d20994fa.js","assets/visualVariablesUtils.62efda9d.js","assets/createSymbolSchema.827eb617.js","assets/ExpandedCIM.a372ce74.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.7ff797cc.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.3f71f8e9.js","assets/util.520a352e.js","assets/floorFilterUtils.05eb8c6a.js","assets/popupUtils.c6371f3a.js","assets/RefreshableLayerView.887ed8c3.js"])),"subtype-group":()=>Vt().then(()=>z(()=>import("./SubtypeGroupLayerView2D.e28062ee.js"),["assets/SubtypeGroupLayerView2D.e28062ee.js","assets/FeatureLayerView2D.7c1a650d.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/LayerView.ce6e0535.js","assets/schemaUtils.d20994fa.js","assets/visualVariablesUtils.62efda9d.js","assets/createSymbolSchema.827eb617.js","assets/ExpandedCIM.a372ce74.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.7ff797cc.js","assets/GeometryUtils.4f19e772.js","assets/floatRGBA.3f71f8e9.js","assets/util.520a352e.js","assets/floorFilterUtils.05eb8c6a.js","assets/popupUtils.c6371f3a.js","assets/RefreshableLayerView.887ed8c3.js"])),tile:qd,"vector-tile":()=>Vt().then(()=>z(()=>import("./VectorTileLayerView2D.d09abb15.js"),["assets/VectorTileLayerView2D.d09abb15.js","assets/enums.54326430.js","assets/Rect.95b0fd2e.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/rasterizingUtils.ec7fabe7.js","assets/floatRGBA.3f71f8e9.js","assets/VertexArrayObject.53cf1857.js","assets/config.82550349.js","assets/TileContainer.5aeb32d6.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/WGLContainer.347cc5cd.js","assets/pixelUtils.9c6f8dae.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/StyleRepository.e426e44d.js","assets/colorUtils.bb6424b7.js","assets/GeometryUtils.4f19e772.js","assets/Geometry.d049a63c.js","assets/LayerView.ce6e0535.js"])),wcs:()=>Vt().then(()=>z(()=>import("./ImageryTileLayerView2D.14079c8d.js"),["assets/ImageryTileLayerView2D.14079c8d.js","assets/multidimensionalUtils.59c05ac5.js","assets/RasterVFDisplayObject.da692284.js","assets/VertexArrayObject.53cf1857.js","assets/Texture.940076b2.js","assets/enums.2d9e6f64.js","assets/VertexElementDescriptor.1fdca6da.js","assets/dataUtils.e7623e56.js","assets/pixelUtils.9c6f8dae.js","assets/WGLContainer.347cc5cd.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/MaterialKey.0cadabc1.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.ce6e0535.js","assets/TileContainer.5aeb32d6.js","assets/RawBlockCache.e5f26f22.js","assets/rasterProjectionHelper.f3c10be2.js","assets/util.520a352e.js","assets/popupUtils.c6371f3a.js","assets/RefreshableLayerView.887ed8c3.js"])),"web-tile":qd,wfs:Gd,wms:()=>Vt().then(()=>z(()=>import("./WMSLayerView2D.ed538bb1.js"),["assets/WMSLayerView2D.ed538bb1.js","assets/BitmapContainer.9e943f6d.js","assets/WGLContainer.347cc5cd.js","assets/enums.2d9e6f64.js","assets/pixelUtils.9c6f8dae.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/VertexArrayObject.53cf1857.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.ce6e0535.js","assets/ExportStrategy.fb59ab52.js","assets/Bitmap.72a3702e.js","assets/RefreshableLayerView.887ed8c3.js","assets/ExportWMSImageParameters.013012f9.js"])),wmts:()=>Vt().then(()=>z(()=>import("./WMTSLayerView2D.c5c29679.js"),["assets/WMTSLayerView2D.c5c29679.js","assets/imageUtils.215a62b1.js","assets/BitmapTileContainer.f5b20598.js","assets/Bitmap.72a3702e.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/TileContainer.5aeb32d6.js","assets/WGLContainer.347cc5cd.js","assets/pixelUtils.9c6f8dae.js","assets/VertexArrayObject.53cf1857.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/LayerView.ce6e0535.js","assets/RefreshableLayerView.887ed8c3.js"])),"line-of-sight":null,"base-elevation":null,"building-scene":null,dimension:null,elevation:null,"integrated-mesh":null,"point-cloud":null,voxel:null,scene:null,unknown:null,unsupported:null};function Cle(e){const t=e.declaredClass?e.declaredClass.slice(e.declaredClass.lastIndexOf(".")+1):"Unknown",i=t.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return new L(`${i}:view-not-supported`,`${t} is not supported in 2D`)}const dA={hasLayerViewModule:e=>M(hA[e.type]),importLayerView:e=>{const t=hA[e.type];if(N(t))throw Cle(e);return t(e)}};function Ple(e,t){const{spatialReference:i}=t,s=[t.x,t.y];let r=Number.POSITIVE_INFINITY,n=0,o=0;const a=[0,0],l=e.type==="extent"?[[[e.xmin,e.ymin],[e.xmin,e.ymax],[e.xmax,e.ymax],[e.xmax,e.ymin],[e.xmin,e.ymin]]]:e.rings;for(const u of l)for(let d=0;dd.clone()),t.sort((d,f)=>f.scale-d.scale),t.forEach((d,f)=>d.level=f);for(const d of t)!l&&i>0&&i>=d.scale&&(o=d.level,l=!0),!u&&s>0&&s>=d.scale&&(a=e?e.level:-1,u=!0),e=d;r===-1&&(r=i===0?0:o),n===-1&&(n=s===0?t.length-1:a),r=Math.max(r,0),r=Math.min(r,t.length-1),n=Math.max(n,0),n=Math.min(n,t.length-1),r>n&&([r,n]=[n,r]),i=t[r].scale,s=t[n].scale,t.splice(0,r),t.splice(n-r+1,t.length),t.forEach((d,f)=>{this._lodByScale[d.scale]=d,this._scales[f]=d.scale}),this._set("effectiveLODs",t),this._set("effectiveMinZoom",r),this._set("effectiveMaxZoom",n),this._set("effectiveMinScale",i),this._set("effectiveMaxScale",s)}constrain(e,t){if(t&&e.scale===t.scale)return e;const i=this.effectiveMinScale,s=this.effectiveMaxScale,r=e.targetGeometry,n=t&&t.targetGeometry,o=s!==0&&e.scalei;if(o||a){const l=a?i:s;if(t&&n){const u=(l-t.scale)/(e.scale-t.scale);r.x=n.x+(r.x-n.x)*u,r.y=n.y+(r.y-n.y)*u}e.scale=l}return this.snapToZoom&&this.effectiveLODs&&(e.scale=this._getClosestScale(e.scale)),e}fit(e){if(!this.effectiveLODs||!this.snapToZoom)return this.constrain(e,null);const t=this.scaleToZoom(e.scale),i=Math.abs(t-Math.floor(t));return e.scale=this.zoomToScale(i>.99?Math.round(t):Math.floor(t)),e}zoomToScale(e){if(!this.effectiveLODs)return 0;e-=this.effectiveMinZoom,e=Math.max(0,e);const t=this._scales;if(e<=0)return t[0];if(e>=t.length)return t[t.length-1];const i=Math.round(e-.5),s=Math.round(e);return t[s]+(s-e)*(t[i]-t[s])}scaleToZoom(e){if(!this.effectiveLODs)return-1;const t=this._scales;let i,s;if(e>=t[0])return this.effectiveMinZoom;if(e<=t[t.length-1])return this.effectiveMaxZoom;for(let r=0;re&&sMath.abs(i-e)<=Math.abs(t-e)?i:t,this._scales[0])),this._lodByScale[e].scale}};c([h({readOnly:!0})],es.prototype,"effectiveLODs",void 0),c([h({readOnly:!0})],es.prototype,"effectiveMinZoom",void 0),c([h({readOnly:!0})],es.prototype,"effectiveMaxZoom",void 0),c([h({readOnly:!0})],es.prototype,"effectiveMinScale",void 0),c([h({readOnly:!0})],es.prototype,"effectiveMaxScale",void 0),c([h()],es.prototype,"lods",void 0),c([h()],es.prototype,"minZoom",void 0),c([h()],es.prototype,"maxZoom",void 0),c([h()],es.prototype,"minScale",void 0),c([h()],es.prototype,"maxScale",void 0),c([h()],es.prototype,"snapToZoom",void 0),es=uM=c([S("esri.views.2d.constraints.ZoomConstraint")],es);const jj=es,Ale={base:null,key:"type",typeMap:{extent:Ze,polygon:Oo}};let Mt=class extends oe{constructor(e){super(e),this.lods=null,this.minScale=0,this.maxScale=0,this.minZoom=-1,this.maxZoom=-1,this.rotationEnabled=!0,this.snapToZoom=!0}destroy(){this.view=null}get effectiveLODs(){return this._zoom.effectiveLODs}get effectiveMinScale(){return this._zoom.effectiveMinScale}get effectiveMaxScale(){return this._zoom.effectiveMaxScale}get effectiveMinZoom(){return this._zoom.effectiveMinZoom}get effectiveMaxZoom(){return this._zoom.effectiveMaxZoom}set geometry(e){e?this._set("geometry",e):this._set("geometry",null)}get version(){var e,t,i;return`${(e=this._zoom)==null?void 0:e.uid}/${(t=this._rotation)==null?void 0:t.uid}/${(i=this._geometry)==null?void 0:i.uid}`}get _defaultLODs(){var i,s,r;const e=(s=(i=this.view)==null?void 0:i.defaultsFromMap)==null?void 0:s.tileInfo,t=(r=this.view)==null?void 0:r.spatialReference;return e&&t&&e.spatialReference.equals(t)?e.lods:null}get _geometry(){var e;return new Mc({geometry:this.geometry,spatialReference:(e=this.view)==null?void 0:e.spatialReference})}get _rotation(){return new Nj({rotationEnabled:this.rotationEnabled})}get _zoom(){const e=this._get("_zoom"),t=this.lods||this._defaultLODs,i=this.minZoom,s=this.maxZoom,r=this.minScale,n=this.maxScale,o=this.snapToZoom;return e&&e.lods===t&&e.minZoom===i&&e.maxZoom===s&&e.minScale===r&&e.maxScale===n&&e.snapToZoom===o?e:new jj({lods:t,minZoom:i,maxZoom:s,minScale:r,maxScale:n,snapToZoom:o})}canZoomInTo(e){const t=this.effectiveMaxScale;return t===0||e>=t}canZoomOutTo(e){const t=this.effectiveMinScale;return t===0||e<=t}constrain(e,t){return this._zoom.constrain(e,t),this._rotation.constrain(e,t),this._geometry.constrain(e,t),e}constrainByGeometry(e){return this._geometry.constrain(e)}fit(e){return this._zoom.fit(e)}zoomToScale(e){return this._zoom.zoomToScale(e)}scaleToZoom(e){return this._zoom.scaleToZoom(e)}snapScale(e){return this._zoom.snapToClosestScale(e)}snapToNextScale(e){return this._zoom.snapToNextScale(e)}snapToPreviousScale(e){return this._zoom.snapToPreviousScale(e)}};c([h({readOnly:!0})],Mt.prototype,"effectiveLODs",null),c([h({readOnly:!0})],Mt.prototype,"effectiveMinScale",null),c([h({readOnly:!0})],Mt.prototype,"effectiveMaxScale",null),c([h({readOnly:!0})],Mt.prototype,"effectiveMinZoom",null),c([h({readOnly:!0})],Mt.prototype,"effectiveMaxZoom",null),c([h({types:Ale,value:null})],Mt.prototype,"geometry",null),c([h({type:[dT]})],Mt.prototype,"lods",void 0),c([h()],Mt.prototype,"minScale",void 0),c([h()],Mt.prototype,"maxScale",void 0),c([h()],Mt.prototype,"minZoom",void 0),c([h()],Mt.prototype,"maxZoom",void 0),c([h()],Mt.prototype,"rotationEnabled",void 0),c([h()],Mt.prototype,"snapToZoom",void 0),c([h()],Mt.prototype,"view",void 0),c([h({readOnly:!0})],Mt.prototype,"version",null),c([h()],Mt.prototype,"_defaultLODs",null),c([h({type:Mc})],Mt.prototype,"_geometry",null),c([h({type:Nj})],Mt.prototype,"_rotation",null),c([h({readOnly:!0,type:jj})],Mt.prototype,"_zoom",null),Mt=c([S("esri.views.2d.MapViewConstraints")],Mt);const Vj=Mt;function Ole(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[4],e[4]=t[5],e[5]=t[6],e[6]=t[8],e[7]=t[9],e[8]=t[10],e}function Rle(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e[6]=t[6],e[7]=t[7],e[8]=t[8],e}function zj(e,t,i,s,r,n,o,a,l,u){return e[0]=t,e[1]=i,e[2]=s,e[3]=r,e[4]=n,e[5]=o,e[6]=a,e[7]=l,e[8]=u,e}function Bj(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Lle(e,t){if(e===t){const i=t[1],s=t[2],r=t[5];e[1]=t[3],e[2]=t[6],e[3]=i,e[5]=t[7],e[6]=s,e[7]=r}else e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8];return e}function Fle(e,t){const i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],a=t[5],l=t[6],u=t[7],d=t[8],f=d*o-a*u,m=-d*n+a*l,y=u*n-o*l;let g=i*f+s*m+r*y;return g?(g=1/g,e[0]=f*g,e[1]=(-d*s+r*u)*g,e[2]=(a*s-r*o)*g,e[3]=m*g,e[4]=(d*i-r*l)*g,e[5]=(-a*i+r*n)*g,e[6]=y*g,e[7]=(-u*i+s*l)*g,e[8]=(o*i-s*n)*g,e):null}function Dle(e,t){const i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],a=t[5],l=t[6],u=t[7],d=t[8];return e[0]=o*d-a*u,e[1]=r*u-s*d,e[2]=s*a-r*o,e[3]=a*l-n*d,e[4]=i*d-r*l,e[5]=r*n-i*a,e[6]=n*u-o*l,e[7]=s*l-i*u,e[8]=i*o-s*n,e}function Nle(e){const t=e[0],i=e[1],s=e[2],r=e[3],n=e[4],o=e[5],a=e[6],l=e[7],u=e[8];return t*(u*n-o*l)+i*(-u*r+o*a)+s*(l*r-n*a)}function sI(e,t,i){const s=t[0],r=t[1],n=t[2],o=t[3],a=t[4],l=t[5],u=t[6],d=t[7],f=t[8],m=i[0],y=i[1],g=i[2],v=i[3],b=i[4],_=i[5],x=i[6],$=i[7],I=i[8];return e[0]=m*s+y*o+g*u,e[1]=m*r+y*a+g*d,e[2]=m*n+y*l+g*f,e[3]=v*s+b*o+_*u,e[4]=v*r+b*a+_*d,e[5]=v*n+b*l+_*f,e[6]=x*s+$*o+I*u,e[7]=x*r+$*a+I*d,e[8]=x*n+$*l+I*f,e}function hM(e,t,i){const s=t[0],r=t[1],n=t[2],o=t[3],a=t[4],l=t[5],u=t[6],d=t[7],f=t[8],m=i[0],y=i[1];return e[0]=s,e[1]=r,e[2]=n,e[3]=o,e[4]=a,e[5]=l,e[6]=m*s+y*o+u,e[7]=m*r+y*a+d,e[8]=m*n+y*l+f,e}function Uj(e,t,i){const s=t[0],r=t[1],n=t[2],o=t[3],a=t[4],l=t[5],u=t[6],d=t[7],f=t[8],m=Math.sin(i),y=Math.cos(i);return e[0]=y*s+m*o,e[1]=y*r+m*a,e[2]=y*n+m*l,e[3]=y*o-m*s,e[4]=y*a-m*r,e[5]=y*l-m*n,e[6]=u,e[7]=d,e[8]=f,e}function jle(e,t,i){const s=i[0],r=i[1],n=i[2];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e[6]=n*t[6],e[7]=n*t[7],e[8]=n*t[8],e}function Vle(e,t,i){const s=i[0],r=i[1];return e[0]=s*t[0],e[1]=s*t[1],e[2]=s*t[2],e[3]=r*t[3],e[4]=r*t[4],e[5]=r*t[5],e}function zle(e,t){return e[0]=1,e[1]=0,e[2]=0,e[3]=0,e[4]=1,e[5]=0,e[6]=t[0],e[7]=t[1],e[8]=1,e}function Ble(e,t){const i=Math.sin(t),s=Math.cos(t);return e[0]=s,e[1]=i,e[2]=0,e[3]=-i,e[4]=s,e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function Ule(e,t){return e[0]=t[0],e[1]=0,e[2]=0,e[3]=0,e[4]=t[1],e[5]=0,e[6]=0,e[7]=0,e[8]=1,e}function qle(e,t){return e[0]=t[0],e[1]=t[1],e[2]=0,e[3]=t[2],e[4]=t[3],e[5]=0,e[6]=t[4],e[7]=t[5],e[8]=1,e}function Gle(e,t){const i=t[0],s=t[1],r=t[2],n=t[3],o=i+i,a=s+s,l=r+r,u=i*o,d=s*o,f=s*a,m=r*o,y=r*a,g=r*l,v=n*o,b=n*a,_=n*l;return e[0]=1-f-g,e[3]=d-_,e[6]=m+b,e[1]=d+_,e[4]=1-u-g,e[7]=y-v,e[2]=m-b,e[5]=y+v,e[8]=1-u-f,e}function Wle(e,t){const i=t[0],s=t[1],r=t[2],n=t[4],o=t[5],a=t[6],l=t[8],u=t[9],d=t[10],f=d*o-a*u,m=-d*n+a*l,y=u*n-o*l,g=i*f+s*m+r*y;if(!g)return null;const v=1/g;return e[0]=f*v,e[1]=(-d*s+r*u)*v,e[2]=(a*s-r*o)*v,e[3]=m*v,e[4]=(d*i-r*l)*v,e[5]=(-a*i+r*n)*v,e[6]=y*v,e[7]=(-u*i+s*l)*v,e[8]=(o*i-s*n)*v,e}function Hle(e,t){const i=t[0],s=t[1],r=t[2],n=t[3],o=t[4],a=t[5],l=t[6],u=t[7],d=t[8],f=t[9],m=t[10],y=t[11],g=t[12],v=t[13],b=t[14],_=t[15],x=i*a-s*o,$=i*l-r*o,I=i*u-n*o,T=s*l-r*a,k=s*u-n*a,A=r*u-n*l,F=d*v-f*g,G=d*b-m*g,U=d*_-y*g,J=f*b-m*v,H=f*_-y*v,te=m*_-y*b;let se=x*te-$*H+I*J+T*U-k*G+A*F;return se?(se=1/se,e[0]=(a*te-l*H+u*J)*se,e[1]=(l*U-o*te-u*G)*se,e[2]=(o*H-a*U+u*F)*se,e[3]=(r*H-s*te-n*J)*se,e[4]=(i*te-r*U+n*G)*se,e[5]=(s*U-i*H-n*F)*se,e[6]=(v*A-b*k+_*T)*se,e[7]=(b*I-g*A-_*$)*se,e[8]=(g*k-v*I+_*x)*se,e):null}function Yle(e,t,i){return e[0]=2/t,e[1]=0,e[2]=0,e[3]=0,e[4]=-2/i,e[5]=0,e[6]=-1,e[7]=1,e[8]=1,e}function Jle(e){return"mat3("+e[0]+", "+e[1]+", "+e[2]+", "+e[3]+", "+e[4]+", "+e[5]+", "+e[6]+", "+e[7]+", "+e[8]+")"}function Xle(e){return Math.sqrt(e[0]**2+e[1]**2+e[2]**2+e[3]**2+e[4]**2+e[5]**2+e[6]**2+e[7]**2+e[8]**2)}function Zle(e,t,i){return e[0]=t[0]+i[0],e[1]=t[1]+i[1],e[2]=t[2]+i[2],e[3]=t[3]+i[3],e[4]=t[4]+i[4],e[5]=t[5]+i[5],e[6]=t[6]+i[6],e[7]=t[7]+i[7],e[8]=t[8]+i[8],e}function qj(e,t,i){return e[0]=t[0]-i[0],e[1]=t[1]-i[1],e[2]=t[2]-i[2],e[3]=t[3]-i[3],e[4]=t[4]-i[4],e[5]=t[5]-i[5],e[6]=t[6]-i[6],e[7]=t[7]-i[7],e[8]=t[8]-i[8],e}function Qle(e,t,i){return e[0]=t[0]*i,e[1]=t[1]*i,e[2]=t[2]*i,e[3]=t[3]*i,e[4]=t[4]*i,e[5]=t[5]*i,e[6]=t[6]*i,e[7]=t[7]*i,e[8]=t[8]*i,e}function Kle(e,t,i,s){return e[0]=t[0]+i[0]*s,e[1]=t[1]+i[1]*s,e[2]=t[2]+i[2]*s,e[3]=t[3]+i[3]*s,e[4]=t[4]+i[4]*s,e[5]=t[5]+i[5]*s,e[6]=t[6]+i[6]*s,e[7]=t[7]+i[7]*s,e[8]=t[8]+i[8]*s,e}function ece(e,t){return e[0]===t[0]&&e[1]===t[1]&&e[2]===t[2]&&e[3]===t[3]&&e[4]===t[4]&&e[5]===t[5]&&e[6]===t[6]&&e[7]===t[7]&&e[8]===t[8]}function tce(e,t){const i=e[0],s=e[1],r=e[2],n=e[3],o=e[4],a=e[5],l=e[6],u=e[7],d=e[8],f=t[0],m=t[1],y=t[2],g=t[3],v=t[4],b=t[5],_=t[6],x=t[7],$=t[8],I=er();return Math.abs(i-f)<=I*Math.max(1,Math.abs(i),Math.abs(f))&&Math.abs(s-m)<=I*Math.max(1,Math.abs(s),Math.abs(m))&&Math.abs(r-y)<=I*Math.max(1,Math.abs(r),Math.abs(y))&&Math.abs(n-g)<=I*Math.max(1,Math.abs(n),Math.abs(g))&&Math.abs(o-v)<=I*Math.max(1,Math.abs(o),Math.abs(v))&&Math.abs(a-b)<=I*Math.max(1,Math.abs(a),Math.abs(b))&&Math.abs(l-_)<=I*Math.max(1,Math.abs(l),Math.abs(_))&&Math.abs(u-x)<=I*Math.max(1,Math.abs(u),Math.abs(x))&&Math.abs(d-$)<=I*Math.max(1,Math.abs(d),Math.abs($))}function ice(e){const t=er(),i=e[0],s=e[1],r=e[2],n=e[3],o=e[4],a=e[5],l=e[6],u=e[7],d=e[8];return Math.abs(1-(i*i+n*n+l*l))<=t&&Math.abs(1-(s*s+o*o+u*u))<=t&&Math.abs(1-(r*r+a*a+d*d))<=t}const sce=sI,rce=qj;Object.freeze(Object.defineProperty({__proto__:null,fromMat4:Ole,copy:Rle,set:zj,identity:Bj,transpose:Lle,invert:Fle,adjoint:Dle,determinant:Nle,multiply:sI,translate:hM,rotate:Uj,scale:jle,scaleByVec2:Vle,fromTranslation:zle,fromRotation:Ble,fromScaling:Ule,fromMat2d:qle,fromQuat:Gle,normalFromMat4Legacy:Wle,normalFromMat4:Hle,projection:Yle,str:Jle,frob:Xle,add:Zle,subtract:qj,multiplyScalar:Qle,multiplyScalarAndAdd:Kle,exactEquals:ece,equals:tce,isOrthoNormal:ice,mul:sce,sub:rce},Symbol.toStringTag,{value:"Module"}));function f0(){const e=new Float32Array(9);return e[0]=1,e[4]=1,e[8]=1,e}function nce(e){const t=new Float32Array(9);return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function oce(e,t,i,s,r,n,o,a,l){const u=new Float32Array(9);return u[0]=e,u[1]=t,u[2]=i,u[3]=s,u[4]=r,u[5]=n,u[6]=o,u[7]=a,u[8]=l,u}function ace(e,t){return new Float32Array(e,t,9)}Object.freeze(Object.defineProperty({__proto__:null,create:f0,clone:nce,fromValues:oce,createView:ace},Symbol.toStringTag,{value:"Module"}));function Gj(){return new Float32Array(2)}function lce(e){const t=new Float32Array(2);return t[0]=e[0],t[1]=e[1],t}function Qh(e,t){const i=new Float32Array(2);return i[0]=e,i[1]=t,i}function cce(e,t){return new Float32Array(e,t,2)}function Wj(){return Gj()}function Hj(){return Qh(1,1)}function Yj(){return Qh(1,0)}function Jj(){return Qh(0,1)}const uce=Wj(),hce=Hj(),dce=Yj(),pce=Jj();Object.freeze(Object.defineProperty({__proto__:null,create:Gj,clone:lce,fromValues:Qh,createView:cce,zeros:Wj,ones:Hj,unitX:Yj,unitY:Jj,ZEROS:uce,ONES:hce,UNIT_X:dce,UNIT_Y:pce},Symbol.toStringTag,{value:"Module"}));function fce(e){return e instanceof Float32Array&&e.length>=2}function mce(e){return Array.isArray(e)&&e.length>=2}function Fw(e){return fce(e)||mce(e)}var dM;const qn=[0,0];let Ia=dM=class extends W{constructor(e){super(e),this._viewpoint2D={center:Et(),rotation:0,scale:0,spatialReference:null},this.center=[0,0],this.extent=new Ze,this.id=0,this.inverseTransform=tl(),this.resolution=0,this.rotation=0,this.scale=0,this.transform=tl(),this.transformNoRotation=tl(),this.displayMat3=f0(),this.displayViewMat3=f0(),this.viewMat3=f0(),this.viewMat2d=Z4(),this.worldScreenWidth=0,this.size=[0,0]}set pixelRatio(e){this._set("pixelRatio",e),this._update()}set size(e){this._set("size",e),this._update()}set viewpoint(e){if(e){const t=this._viewpoint2D,i=e.targetGeometry;t.center[0]=i.x,t.center[1]=i.y,t.rotation=e.rotation,t.scale=e.scale,t.spatialReference=i.spatialReference}this._update()}copy(e){const t=this.size,i=this.viewpoint;return i&&t?(this.viewpoint=qr(i,e.viewpoint),this._set("size",fm(t,e.size))):(this.viewpoint=e.viewpoint.clone(),this._set("size",[e.size[0],e.size[1]])),this._set("pixelRatio",e.pixelRatio),this}clone(){return new dM({size:this.size,viewpoint:this.viewpoint.clone(),pixelRatio:this.pixelRatio})}toMap(e,t,i){return Fw(t)?bn(e,t,this.inverseTransform):(qn[0]=t,qn[1]=i,bn(e,qn,this.inverseTransform))}toScreen(e,t,i){return Fw(t)?bn(e,t,this.transform):(qn[0]=t,qn[1]=i,bn(e,qn,this.transform))}toScreenNoRotation(e,t,i){return Fw(t)?bn(e,t,this.transformNoRotation):(qn[0]=t,qn[1]=i,bn(e,qn,this.transformNoRotation))}getScreenTransform(e,t){const{center:i}=this._viewpoint2D,s=this._get("pixelRatio")||1,r=this._get("size");return tI(e,i,r,t,0,s),e}_update(){const{center:e,spatialReference:t,scale:i,rotation:s}=this._viewpoint2D,r=this._get("pixelRatio")||1,n=this._get("size"),o=new Mn({targetGeometry:new be(e[0],e[1],t),scale:i,rotation:s});if(this._set("viewpoint",o),!n||!t||!i)return;this.resolution=$d(o),this.rotation=s,this.scale=i,this.spatialReference=t,fm(this.center,e);const a=n[0]!==0?2/n[0]:0,l=n[1]!==0?-2/n[1]:0;zj(this.displayMat3,a,0,0,0,l,0,-1,1,1);const u=Bj(this.viewMat3),d=Qh(n[0]/2,n[1]/2),f=Qh(-n[0]/2,-n[1]/2),m=y$(s);hM(u,u,d),Uj(u,u,m),hM(u,u,f),sI(this.displayViewMat3,this.displayMat3,u);const y=XT(this.viewMat2d,d);return t_(y,y,m),dm(y,y,f),dle(this.extent,o,n),iI(this.transform,o,n,r),YT(this.inverseTransform,this.transform),ble(this.transformNoRotation,o,n,r),this.worldScreenWidth=wle(this.spatialReference,this.resolution),this._set("id",this.id+1),this}};c([h({readOnly:!0})],Ia.prototype,"id",void 0),c([h({value:1,json:{write:!0}})],Ia.prototype,"pixelRatio",null),c([h({json:{write:!0}})],Ia.prototype,"size",null),c([h()],Ia.prototype,"spatialReference",void 0),c([h({type:Mn,json:{write:!0}})],Ia.prototype,"viewpoint",null),Ia=dM=c([S("esri.views.2d.ViewState")],Ia);const pA=Ia;var pM,fM;let go=pM=class extends oe{constructor(){super(...arguments),this.left=0,this.top=0,this.right=0,this.bottom=0}clone(){return new pM({left:this.left,top:this.top,right:this.right,bottom:this.bottom})}};c([h()],go.prototype,"left",void 0),c([h()],go.prototype,"top",void 0),c([h()],go.prototype,"right",void 0),c([h()],go.prototype,"bottom",void 0),go=pM=c([S("esri.views.2d.PaddedViewState.Padding")],go);let oh=fM=class extends pA{constructor(...e){super(...e),this.paddedViewState=new pA,this._updateContent=(()=>{const t=Et();return()=>{const i=this._get("size"),s=this._get("padding");if(!i||!s)return;const r=this.paddedViewState;ai(t,s.left+s.right,s.top+s.bottom),mm(t,i,t),fm(r.size,t);const n=r.viewpoint;n&&(this.viewpoint=n)}})(),this.addHandles(Z(()=>[this.size,this.padding],()=>this._updateContent(),Nh)),this.padding=new go,this.size=[0,0]}set padding(e){this._set("padding",e||new go)}set viewpoint(e){if(e){const t=e.clone();this.paddedViewState.viewpoint=e,Sle(t,e,this._get("size"),this._get("padding"));const i=this._viewpoint2D,s=t.targetGeometry;i.center[0]=s.x,i.center[1]=s.y,i.rotation=t.rotation,i.scale=t.scale,i.spatialReference=s.spatialReference,this._update()}}clone(){return new fM({padding:this.padding.clone(),size:this.size.slice(),viewpoint:this.paddedViewState.viewpoint.clone(),pixelRatio:this.pixelRatio})}};c([h()],oh.prototype,"paddedViewState",void 0),c([h({type:go})],oh.prototype,"padding",null),c([h()],oh.prototype,"viewpoint",null),oh=fM=c([S("esri.views.2d.PaddedViewState")],oh);const yce=oh;class gce{constructor(t,i){this.item=t,this.controller=i,this.promise=null}}class Xj{constructor(t){this._deferreds=new Map,this._controllers=new Map,this._processingItems=new Map,this._isPaused=!1,this._schedule=null,this._task=null,this.concurrency=1,t.concurrency&&(this.concurrency=t.concurrency),this._queue=new xv(t.peeker),this.process=t.process;const i=t.scheduler;t.priority&&M(i)&&(this._task=i.registerTask(t.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(t){const i=this._controllers.get(t);i&&i.abort()}clear(){this._queue.clear();const t=[];this._controllers.forEach(i=>t.push(i)),this._controllers.clear(),t.forEach(i=>i.abort()),this._processingItems.clear(),this._cancelNext()}forEach(t){this._deferreds.forEach((i,s)=>t(s))}get(t){const i=this._deferreds.get(t);return i?i.promise:void 0}isOngoing(t){return this._processingItems.has(t)}has(t){return this._deferreds.has(t)}pause(){this._isPaused||(this._isPaused=!0,this._cancelNext())}push(t,i){const s=this.get(t);if(s)return s;const r=new AbortController;let n=null;i&&(n=Vr(i,()=>r.abort()));const o=()=>{const d=this._processingItems.get(t);d&&d.controller.abort(),a(),u.reject(_t())},a=()=>{l.remove(),M(n)&&n.remove(),this._deferreds.delete(t),this._controllers.delete(t),this._queue.remove(t),this._processingItems.delete(t),this._scheduleNext()},l=JM(r.signal,o),u=Ao();return this._deferreds.set(t,u),this._controllers.set(t,r),u.promise.then(a,a),this._queue.push(t),this._scheduleNext(),u.promise}last(){return this._queue.last()}peek(){return this._queue.peek()}popLast(){return this._queue.popLast()}reset(){const t=[];this._processingItems.forEach(i=>t.push(i)),this._processingItems.clear();for(const i of t)this._queue.push(i.item),i.controller.abort();this._scheduleNext()}resume(){this._isPaused&&(this._isPaused=!1,this._scheduleNext())}takeAll(){const t=[];for(;this._queue.length;)t.push(this._queue.pop());return this.clear(),t}get running(){return!this._isPaused&&this._queue.length>0&&this._processingItems.size0&&this._processingItems.size{this._schedule=null,this._next()}))}_next(){for(;this._queue.length>0&&this._processingItems.sizethis._processResult(r,n),n=>this._processError(r,n))):this._processResult(r,i)}get test(){return{update:t=>this.runTask(t)}}}function vce(e,t){return e.length=0,t.forEach(i=>e.push(i)),e}const Dw=new Set,Uy=[],wu=new Map,fA=[0,0];let Ko=class extends oe{constructor(e){super(e),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:e,process:t}=this;this._queue=new Xj({concurrency:e,process:(i,s)=>{const r=this._keyToItem.get(i);return t(r,{signal:s})},peeker:i=>i.values().next().value})}destroy(){this.clear(),this._queue=$t(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}get updating(){return this.length>0||this.onGoingCount>0}abort(e){const t=typeof e=="string"?e:e.id;this._queue.abort(t)}clear(){this._queue.clear(),this._keyToItem.clear(),this.notifyChange("updating")}has(e){return typeof e=="string"?this._keyToItem.has(e):this._keyToItem.has(e.id)}isOngoing(e){const t=typeof e=="string"?e:e.id;return this.has(t)&&this._queue.isOngoing(t)}pause(){this._queue.pause()}push(e,t){const i=e.key.id+"-"+t;if(this.has(i))return this.get(i);const s=this._queue.push(i),r=()=>{this._keyToItem.delete(i),this.notifyChange("updating")};return this._keyToItem.set(i,e),s.then(r,r),this.notifyChange("updating"),s}reset(){this._queue.reset(),this.notifyChange("updating")}resume(){this._queue.resume()}_peekByScaleFirst(e){if(!this.state)return e.values().next().value;const t=this.tileInfoView;let i=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;e.forEach(u=>{const d=this._keyToItem.get(u),f=this.tileInfoView.getTileScale(d.key);wu.has(f)||(wu.set(f,[]),i=Math.max(f,i),s=Math.min(f,s)),wu.get(f).push(d.key),Dw.add(f)});let r=this.state.scale;wu.has(r)||(vce(Uy,Dw),Uy.sort((u,d)=>u-d),r=Uy.reduce((u,d)=>Math.abs(d-r){const f=o.denormalizeCol(u.col,u.world),m=o.denormalizeCol(d.col,d.world);return Math.sqrt((a-f)*(a-f)+(l-u.row)*(l-u.row))-Math.sqrt((a-m)*(a-m)+(l-d.row)*(l-d.row))}),Dw.clear(),wu.clear(),n[0].id}_peekByCenterFirst(e){if(!this.state)return e.values().next().value;const t=this.tileInfoView,i=this.state.center;let s,r=Number.POSITIVE_INFINITY;return e.forEach(n=>{const o=this._keyToItem.get(n);t.getTileCoords(fA,o.key);const a=Ym(fA,i);a=0&&this.row===t.row>>i&&this.col===t.col>>i&&this.world===t.world}equals(t){return this.level===t.level&&this.row===t.row&&this.col===t.col&&this.world===t.world}clone(){return new is(this)}release(){this.level=0,this.row=0,this.col=0,this.world=0}set(t,i,s,r){if(t==null)this.level=0,this.row=0,this.col=0,this.world=0;else if(typeof t=="object")this.level=t.level||0,this.row=t.row||0,this.col=t.col||0,this.world=t.world||0;else if(typeof t=="string"){const[n,o,a,l]=t.split("/");this.level=parseFloat(n),this.row=parseFloat(o),this.col=parseFloat(a),this.world=parseFloat(l)}else this.level=+t,this.row=+i,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 is(this.level-1,this.row>>1,this.col>>1,this.world)}getChildKeys(){const t=this.level+1,i=this.row<<1,s=this.col<<1,r=this.world;return[new is(t,i,s,r),new is(t,i,s+1,r),new is(t,i+1,s,r),new is(t,i+1,s+1,r)]}compareRowMajor(t){return this.rowt.row?1:this.colt.col?1:0}}is.pool=new zr(is,null,null,25,50);function ea(e,t){return[e,t]}function Ml(e,t,i){return e[0]=t,e[1]=i,e}function bce(e,t,i,s,r){return e[0]=t,e[1]=i,e[2]=s,e[3]=r,e}const cr=new is("0/0/0/0");class rI{constructor(t,i,s,r,n,o,a,l,u,d,f,m){this.level=t,this.resolution=i,this.scale=s,this.origin=r,this.first=n,this.last=o,this.size=a,this.norm=l,this.worldStart=u,this.worldEnd=d,this.worldSize=f,this.wrap=m}static create(t,i,s=null){const r=Dr(t.spatialReference),n=i.origin||ea(t.origin.x,t.origin.y),o=ea(t.size[0]*i.resolution,t.size[1]*i.resolution),a=ea(-1/0,-1/0),l=ea(1/0,1/0),u=ea(1/0,1/0);M(s)&&(Ml(a,Math.max(0,Math.floor((s.xmin-n[0])/o[0])),Math.max(0,Math.floor((n[1]-s.ymax)/o[1]))),Ml(l,Math.max(0,Math.floor((s.xmax-n[0])/o[0])),Math.max(0,Math.floor((n[1]-s.ymin)/o[1]))),Ml(u,l[0]-a[0]+1,l[1]-a[1]+1));const{cols:d,rows:f}=i;let m,y,g,v;return!s&&d&&f&&(Ml(a,d[0],f[0]),Ml(l,d[1],f[1]),Ml(u,d[1]-d[0]+1,f[1]-f[0]+1)),t.isWrappable?(m=ea(Math.ceil(Math.round((r.valid[1]-r.valid[0])/i.resolution)/t.size[0]),u[1]),y=ea(Math.floor((r.origin[0]-n[0])/o[0]),a[1]),g=ea(m[0]+y[0]-1,l[1]),v=!0):(y=a,g=l,m=u,v=!1),new rI(i.level,i.resolution,i.scale,n,a,l,u,o,y,g,m,v)}normalizeCol(t){if(!this.wrap)return t;const i=this.worldSize[0];return t<0?i-1-Math.abs((t+1)%i):t%i}denormalizeCol(t,i){return this.wrap?this.worldSize[0]*i+t:t}getWorldForColumn(t){return this.wrap?Math.floor(t/this.worldSize[0]):0}getFirstColumnForWorld(t){return t*this.worldSize[0]+this.first[0]}getLastColumnForWorld(t){return t*this.worldSize[0]+this.first[0]+this.size[0]-1}getColumnForX(t){return(t-this.origin[0])/this.norm[0]}getXForColumn(t){return this.origin[0]+t*this.norm[0]}getRowForY(t){return(this.origin[1]-t)/this.norm[1]}getYForRow(t){return this.origin[1]-t*this.norm[1]}getTileBounds(t,i,s=!1){cr.set(i);const r=s?cr.col:this.denormalizeCol(cr.col,cr.world),n=cr.row;return bce(t,this.getXForColumn(r),this.getYForRow(n+1),this.getXForColumn(r+1),this.getYForRow(n)),t}getTileCoords(t,i,s=!1){cr.set(i);const r=s?cr.col:this.denormalizeCol(cr.col,cr.world);return Array.isArray(t)?Ml(t,this.getXForColumn(r),this.getYForRow(cr.row)):(t.x=this.getXForColumn(r),t.y=this.getYForRow(cr.row)),t}}class Kh{constructor(){this.spans=[]}acquire(t){this.lodInfo=t}release(){this.lodInfo=null,this.spans.length=0}forEach(t,i){const{spans:s,lodInfo:r}=this,{level:n}=r;if(s.length!==0)for(const{row:o,colFrom:a,colTo:l}of s)for(let u=a;u<=l;u++)t.call(i,n,o,r.normalizeCol(u),r.getWorldForColumn(u))}}Kh.pool=new zr(Kh);class Nw{constructor(t,i,s){this.row=t,this.colFrom=i,this.colTo=s}}const st=new is("0/0/0/0");class nI{constructor(t,i,s,r,n,o,a,l){this.x=t,this.ymin=i,this.ymax=s,this.invM=r,this.leftAdjust=n,this.rightAdjust=o,this.leftBound=a,this.rightBound=l}static create(t,i){t[1]>i[1]&&([t,i]=[i,t]);const[s,r]=t,[n,o]=i,a=n-s,l=o-r,u=l!==0?a/l:0,d=(Math.ceil(r)-r)*u,f=(Math.floor(r)-r)*u;return new nI(s,Math.floor(r),Math.ceil(o),u,a<0?d:f,a<0?f:d,a<0?n:s,a<0?s:n)}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 ds=[[0,0],[0,0],[0,0],[0,0]],_ce=1e-6;class wce{constructor(t,i=null){this.tileInfo=t,this.fullExtent=i,this.scales=[],this._infoByScale={},this._infoByLevel={};const s=t.lods.slice();s.sort((n,o)=>o.scale-n.scale);const r=this._lodInfos=s.map(n=>rI.create(t,n,i));s.forEach((n,o)=>{this._infoByLevel[n.level]=r[o],this._infoByScale[n.scale]=r[o],this.scales[o]=n.scale},this),this._wrap=t.isWrappable}get spatialReference(){return this.tileInfo.spatialReference}getLODInfoAt(t){return this._infoByLevel[typeof t=="number"?t:t.level]}getTileBounds(t,i,s=!1){st.set(i);const r=this._infoByLevel[st.level];return r?r.getTileBounds(t,st,s):t}getTileCoords(t,i,s=!1){st.set(i);const r=this._infoByLevel[st.level];return r?r.getTileCoords(t,st,s):t}getTileCoverage(t,i=192,s="closest"){const r=s==="closest"?this.getClosestInfoForScale(t.scale):this.getSmallestInfoForScale(t.scale),n=Kh.pool.acquire(r),o=this._wrap;let a,l,u,d=1/0,f=-1/0;const m=n.spans;ds[0][0]=ds[0][1]=ds[1][1]=ds[3][0]=-i,ds[1][0]=ds[2][0]=t.size[0]+i,ds[2][1]=ds[3][1]=t.size[1]+i;for(const b of ds)t.toMap(b,b),b[0]=r.getColumnForX(b[0]),b[1]=r.getRowForY(b[1]);const y=[];let g=3;for(let b=0;b<4;b++){if(ds[b][1]===ds[g][1]){g=b;continue}const _=nI.create(ds[b],ds[g]);d=Math.min(_.ymin,d),f=Math.max(_.ymax,f),y[_.ymin]===void 0&&(y[_.ymin]=[]),y[_.ymin].push(_),g=b}if(d==null||f==null||f-d>100)return null;let v=[];for(a=d;a=0;b--){const _=v[b];l=Math.min(l,_.getLeftCol()),u=Math.max(u,_.getRightCol())}if(l=Math.floor(l),u=Math.floor(u),a>=r.first[1]&&a<=r.last[1])if(o)if(r.size[0]r.last[0]||u=0;b--){const _=v[b];_.ymax>=a?_.incrRow():v.splice(b,1)}}return n}getTileParentId(t){st.set(t);const i=this._infoByLevel[st.level],s=this._lodInfos.indexOf(i)-1;return s<0?null:(this._getTileIdAtLOD(st,this._lodInfos[s],st),st.id)}getTileResolution(t){const i=this._infoByLevel[typeof t=="object"?t.level:t];return i?i.resolution:-1}getTileScale(t){const i=this._infoByLevel[t.level];return i?i.scale:-1}intersects(t,i){st.set(i);const s=this._infoByLevel[st.level],r=t.lodInfo;if(r.resolution>s.resolution){this._getTileIdAtLOD(st,r,st);const o=r.denormalizeCol(st.col,st.world);for(const a of t.spans)if(a.row===st.row&&a.colFrom<=o&&a.colTo>=o)return!0}if(r.resolution(v[0]=Math.min(v[0],b.row),v[1]=Math.max(v[1],b.row),v[2]=Math.min(v[2],b.colFrom),v[3]=Math.max(v[3],b.colTo),v),[1/0,-1/0,1/0,-1/0]),d=s.denormalizeCol(st.col,st.world),f=r.getColumnForX(s.getXForColumn(d)),m=r.getRowForY(s.getYForRow(st.row)),y=r.getColumnForX(s.getXForColumn(d+1))-1,g=r.getRowForY(s.getYForRow(st.row+1))-1;return!(f>u||ya||go.row===st.row&&o.colFrom<=n&&o.colTo>=n)}normalizeBounds(t,i,s){if(t[0]=i[0],t[1]=i[1],t[2]=i[2],t[3]=i[3],this._wrap){const r=Dr(this.tileInfo.spatialReference),n=-s*(r.valid[1]-r.valid[0]);t[0]+=n,t[2]+=n}return t}getSmallestInfoForScale(t){const i=this.scales;if(this._infoByScale[t])return this._infoByScale[t];if(t>i[0])return this._infoByScale[i[0]];for(let s=1;si[s]+_ce)return this._infoByScale[i[s-1]];return this._infoByScale[i[i.length-1]]}getClosestInfoForScale(t){const i=this.scales;return this._infoByScale[t]||(t=i.reduce((s,r)=>Math.abs(r-t)=0;s--)if(te.push(i)),e}const jw=new Set,qy=[],xu=new Map,mA=[0,0];let co=class extends oe{constructor(e){super(e),this._keyToItem=new Map,this.concurrency=6,this.strategy="scale-first",this.tileInfoView=null}initialize(){const{concurrency:e,process:t,strategy:i}=this;this._queue=new Xj({concurrency:e,process:(s,r)=>{const n=this._keyToItem.get(s);return t(n,{signal:r})},peeker:i==="scale-first"?s=>this._peekByScaleFirst(s):s=>this._peekByCenterFirst(s)})}destroy(){this.clear(),this._queue=$t(this._queue)}get length(){return this._queue?this._queue.length:0}get onGoingCount(){return this._keyToItem.size}get updating(){return this.length>0||this.onGoingCount>0}abort(e){const t=typeof e=="string"?e:e.id;this._queue.abort(t)}clear(){this._queue.clear(),this._keyToItem.clear(),this.notifyChange("updating")}has(e){return typeof e=="string"?this._keyToItem.has(e):this._keyToItem.has(e.id)}isOngoing(e){const t=typeof e=="string"?e:e.id;return this.has(t)&&this._queue.isOngoing(t)}pause(){this._queue.pause()}push(e){const t=e.key.id;if(this._queue.has(t))return this._queue.get(t);const i=this._queue.push(t),s=()=>{this._keyToItem.delete(t),this.notifyChange("updating")};return this._keyToItem.set(t,e),i.then(s,s),this.notifyChange("updating"),i}reset(){this._queue.reset()}resume(){this._queue.resume()}_peekByScaleFirst(e){if(!this.state)return e.values().next().value;const t=this.tileInfoView;let i=Number.NEGATIVE_INFINITY,s=Number.POSITIVE_INFINITY;e.forEach(u=>{const d=this._keyToItem.get(u),f=this.tileInfoView.getTileScale(d.key);xu.has(f)||(xu.set(f,[]),i=Math.max(f,i),s=Math.min(f,s)),xu.get(f).push(d.key),jw.add(f)});let r=this.state.scale;xu.has(r)||(xce(qy,jw),qy.sort((u,d)=>u-d),r=qy.reduce((u,d)=>Math.abs(d-r){const f=o.denormalizeCol(u.col,u.world),m=o.denormalizeCol(d.col,d.world);return Math.sqrt((a-f)*(a-f)+(l-u.row)*(l-u.row))-Math.sqrt((a-m)*(a-m)+(l-d.row)*(l-d.row))}),jw.clear(),xu.clear(),n[0].id}_peekByCenterFirst(e){if(!this.state)return e.values().next().value;const t=this.tileInfoView,i=this.state.center;let s,r=Number.POSITIVE_INFINITY;return e.forEach(n=>{const o=this._keyToItem.get(n);t.getTileCoords(mA,o.key);const a=Ym(mA,i);athis.maxSize&&n>=0;)n!==t&&(r=this._pruneAroundCenterTile(r,i,s,n)),n--;r>this.maxSize&&(r=this._pruneAroundCenterTile(r,i,s,t))}_pruneAroundCenterTile(t,i,s,r){const n=this._tileKeysPerLevel[r];if(!n||n.length===0)return t;const{size:o,origin:a}=this._tileInfoView.tileInfo,l=s*o[0],u=s*o[1],d=[0,0],f=[0,0];for(n.sort((m,y)=>(d[0]=a.x+l*(m.col+.5),d[1]=a.y-u*(m.row+.5),f[0]=a.x+l*(y.col+.5),f[1]=a.y-u*(y.row+.5),Lv(d,i)-Lv(f,i)));n.length>0;){const m=n.pop();if(this._removeTile(m.id),--t===this.maxSize)break}return t}_removeTile(t){const i=this._tilePerId.get(t);this._removedFunc&&i&&this._removedFunc(i),yA(this._tilePerId,t)}}function yA(e,t){e.delete(t)}const $l=new is(0,0,0,0),As=new Map,Su=[],Gy=[];class iwe{constructor(t){this._previousScale=Number.POSITIVE_INFINITY,this.cachePolicy="keep",this.coveragePolicy="closest",this.resampling=!0,this.tileIndex=new Map,this.tiles=[],this.buffer=192,this.acquireTile=t.acquireTile,this.releaseTile=t.releaseTile,this.tileInfoView=t.tileInfoView,this.resampling=t.resampling==null||!!t.resampling,t.cachePolicy&&(this.cachePolicy=t.cachePolicy),t.coveragePolicy&&(this.coveragePolicy=t.coveragePolicy),t.buffer!=null&&(this.buffer=t.buffer),t.cacheSize&&(this._tileCache=new Sce(t.cacheSize,this.tileInfoView,i=>{this.releaseTile(i)}))}destroy(){this.tileIndex.clear()}update(t){const{resampling:i,tileIndex:s}=this,r=this.tileInfoView.getTileCoverage(t.state,this.buffer,this.coveragePolicy);if(Gy.length=0,Su.length=0,As.clear(),!r)return;const{minScale:n,maxScale:o}=this.tileInfoView.tileInfo,{spans:a,lodInfo:l}=r,{level:u}=l,{scale:d,center:f,resolution:m}=t.state,y=!t.stationary&&d>this._previousScale;if(this._previousScale=d,this.tiles.length=0,!i&&(d>n||d{this.releaseTile(_)}),s.clear(),Gy.length=0,Su.length=0,As.clear(),Kh.pool.release(r),!0;s.forEach(_=>_.visible=!0);let g=0,v=0;if(a.length>0)for(const{row:_,colFrom:x,colTo:$}of a)for(let I=x;I<=$;I++){g++;const T=$l.set(u,_,l.normalizeCol(I),l.getWorldForColumn(I)).id;if(s.has(T)){const k=s.get(T);k.isReady?(As.set(T,k),v++):y||this._addParentTile(T,As)}else{let k;if(this._tileCache&&this._tileCache.has(T)){if(k=this._tileCache.pop(T),this.tileIndex.set(T,k),k.isReady){As.set(T,k),v++;continue}}else k=this.acquireTile($l),this.tileIndex.set(T,k);y||this._addParentTile(T,As)}}const b=v===g;s.forEach((_,x)=>{if($l.set(x),As.has(x))return;const $=this.tileInfoView.intersects(r,$l),I=this.cachePolicy==="purge"?$l.level!==u:$l.level>u;!$||!y&&b?!I&&$||Su.push(x):_.isReady?I&&this.cachePolicy==="purge"&&this._hasReadyAncestor($l,u)?Su.push(x):Gy.push(x):I&&Su.push(x)});for(const _ of Gy){const x=s.get(_);x&&x.isReady&&As.set(_,x)}for(const _ of Su){const x=s.get(_);this._tileCache?this._tileCache.add(x):this.releaseTile(x),s.delete(_)}return As.forEach(_=>this.tiles.push(_)),s.forEach(_=>{As.has(_.key.id)||(_.visible=!1)}),this._tileCache&&this._tileCache.prune(u,f,m),Kh.pool.release(r),As.clear(),b}clear(t=!0){const{tileIndex:i}=this;t&&i.forEach(s=>{this.releaseTile(s)}),i.clear()}updateCacheSize(t){this._tileCache&&(this._tileCache.maxSize=t)}_addParentTile(t,i){let s=t,r=null;for(;s=this.tileInfoView.getTileParentId(s),s;)if(this.tileIndex.has(s)){if(r=this.tileIndex.get(s),r&&r.isReady){i.has(r.key.id)||i.set(r.key.id,r);break}}else if(this._tileCache&&this._tileCache.has(s)&&(r=this._tileCache.pop(s),this.tileIndex.set(s,r),r&&r.isReady)){i.has(r.key.id)||i.set(r.key.id,r);break}}_hasReadyAncestor(t,i){const s=nl();this.tileInfoView.getTileBounds(s,t,!0);for(const r of this.tileIndex.values())if(r.isReady&&r.key.level>=i&&r.key.levelthis._handleDoubleClick(s,i))}_handleDoubleClick(t,i){oI(t.data,"primary")&&(t.stopPropagation(),i?this._view.mapViewNavigation.zoomOut([t.data.x,t.data.y]):this._view.mapViewNavigation.zoomIn([t.data.x,t.data.y]))}}class Mce extends ei{constructor(t,i,s){super(!0),this.view=t,this.pointerType=i,this.registerIncoming("double-tap-drag",s,r=>this._handleDoubleTapDrag(r))}_handleDoubleTapDrag(t){const{data:i}=t,{pointerType:s}=i;if(s!==this.pointerType)return;t.stopPropagation();const{action:r,delta:n}=i,{view:o}=this,{mapViewNavigation:a}=o;switch(r){case"begin":{const{scale:l}=o;this._startScale=l,this._currentScale=l,this._previousDelta=n,a.begin();break}case"update":{if(this._previousDelta.y===n.y)return;this._previousDelta=n;const l=1.015**n.y,u=this._startScale*l,d=u/this._currentScale;a.setViewpointImmediate(d),this._currentScale=u;break}case"end":{const{constraints:l}=o,{effectiveLODs:u,snapToZoom:d}=l;if(!d||!u)return void a.end();const f=l.snapScale(this._currentScale),m=(n.y>0?Math.max(f,l.snapToPreviousScale(this._startScale)):Math.min(f,l.snapToNextScale(this._startScale)))/this._currentScale;a.zoom(m);break}}}}class n_{constructor(t){this._callbacks=t,this._currentCount=0,this._callbacks.condition||(this._callbacks.condition=()=>!0)}handle(t){const i=t.data,s=i.pointers.size;switch(i.action){case"start":this._currentCount=s,this._emitStart(t);break;case"added":this._emitEnd(this._previousEvent),this._currentCount=s,this._emitStart(t);break;case"update":this._emitUpdate(t);break;case"removed":this._startEvent&&this._emitEnd(this._previousEvent),this._currentCount=s,this._emitStart(t);break;case"end":this._emitEnd(t),this._currentCount=0}this._previousEvent=t}_emitStart(t){var i,s;this._startEvent=t,(s=(i=this._callbacks).condition)!=null&&s.call(i,this._currentCount,t)&&this._callbacks.start(this._currentCount,t,this._startEvent)}_emitUpdate(t){var i,s;(s=(i=this._callbacks).condition)!=null&&s.call(i,this._currentCount,t)&&this._callbacks.update(this._currentCount,t,this._startEvent)}_emitEnd(t){var i,s;(s=(i=this._callbacks).condition)!=null&&s.call(i,this._currentCount,t)&&this._callbacks.end(this._currentCount,t,this._startEvent),this._startEvent=null}}class $ce extends ei{constructor(t,i,s){super(!0),this.view=t,this.pointerAction=i,this.registerIncoming("drag",s,r=>this._handleDrag(r)),this.registerIncoming("pointer-down",()=>this.stopMomentumNavigation())}onInstall(t){super.onInstall(t),this._dragEventSeparator=new n_({start:(i,s)=>{this.view.mapViewNavigation.pan.begin(this.view,s.data),s.stopPropagation()},update:(i,s)=>{this.view.mapViewNavigation.pan.update(this.view,s.data),s.stopPropagation()},end:(i,s)=>{this.view.mapViewNavigation.pan.end(this.view,s.data),s.stopPropagation()},condition:(i,s)=>i===1&&oI(s.data,this.pointerAction)})}_handleDrag(t){const i=this.view.mapViewNavigation;i.pinch.zoomMomentum||i.pinch.rotateMomentum?this.stopMomentumNavigation():this._dragEventSeparator.handle(t)}stopMomentumNavigation(){this.view.mapViewNavigation.pan.stopMomentumNavigation()}}class Tce extends ei{constructor(t,i,s){super(!0),this._view=t,this.pointerAction=i;const r=this._view.mapViewNavigation;this._dragEventSeparator=new n_({start:(n,o)=>{r.rotate.begin(this._view,o.data),o.stopPropagation()},update:(n,o)=>{r.rotate.update(this._view,o.data),o.stopPropagation()},end:(n,o)=>{r.rotate.end(),o.stopPropagation()},condition:(n,o)=>n===1&&oI(o.data,this.pointerAction)}),this.registerIncoming("drag",s,n=>this._dragEventSeparator.handle(n))}}function ur(e){let t=e*e;return e<0&&(t*=-1),t}function Ice(e){return e.translation[0]=0,e.translation[1]=0,e.translation[2]=0,e.heading=0,e.tilt=0,e}function Ece(e,t,i){const s=i,r=e.state,n=e.device,o=t.tiltDirection==="forward-down"?1:-1,a=1;return n.deviceType==="standard"?(s.translation[0]=ur(r.axes[0]),s.translation[1]=ur(r.axes[1]),s.translation[2]=ur(r.buttons[7])-ur(r.buttons[6]),s.heading=ur(r.axes[2]),s.tilt=ur(r.axes[3])):n.deviceType==="spacemouse"&&(s.translation[0]=1.2*ur(r.axes[0]),s.translation[1]=1.2*ur(r.axes[1]),s.translation[2]=2*-ur(r.axes[2]),s.heading=1.2*ur(r.axes[5]),s.tilt=1.2*ur(r.axes[3])),s.tilt*=o,XL(s.translation,s.translation,a),s}function kce(e){return e.translation[0]===0&&e.translation[1]===0&&e.translation[2]===0&&e.heading===0&&e.tilt===0&&e.zoom===0}class Cce extends ei{constructor(t){super(!0),this._view=t,this._frameTask=null,this._watchHandles=new qi,this._currentDevice=null,this._transformation={translation:[0,0,0],heading:0,tilt:0,zoom:0},this._handle=this.registerIncoming("gamepad",i=>this._handleGamePadEvent(i)),this._handle.pause()}onInstall(t){super.onInstall(t),this._watchHandles.add([Z(()=>{var i;return(i=this._view.navigation.gamepad)==null?void 0:i.enabled},i=>{i?(this._handle.resume(),this._frameTask||(this._frameTask=Dh({update:s=>this._frameUpdate(s.deltaTime)}))):(this._handle.pause(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null))},Le)])}onUninstall(){this._watchHandles.removeAll(),this._frameTask&&(this._frameTask.remove(),this._frameTask=null),super.onUninstall()}_handleGamePadEvent(t){const i=this._view.navigation.gamepad.device;i&&t.data.device!==i||this._currentDevice&&this._currentDevice!==t.data.device||(t.data.action==="end"?(this._currentDevice=null,Ice(this._transformation)):(this._currentDevice=t.data.device,Ece(t.data,this._view.navigation.gamepad,this._transformation)))}_frameUpdate(t){const i=this._transformation;if(kce(i))return;const s=this._view.viewpoint.clone(),r=this._view.navigation.gamepad.velocityFactor,n=Ace*r*t;r_(s,s,[i.translation[0]*n,-i.translation[1]*n]);const o=1+i.translation[2]*Oce*t,a=this._view.constraints.rotationEnabled?-i.heading*Pce*t:0,l=this._view.size,u=[l[0]/2,l[1]];Lj(s,s,o,a,u,l);const d=this._view.constraints.constrain(s,this._view.viewpoint);this._view.viewpoint=d}}const Pce=.06,Ace=.7,Oce=6e-4;class Rce extends ei{constructor(t,i,s){super(!0),this.view=t,this.keys=i,this._pressed=!1,this._keyMap={[i.left]:"left",[i.right]:"right",[i.up]:"up",[i.down]:"down"},this.registerIncoming("key-down",s,r=>this._handleKeyDown(r)),this.registerIncoming("key-up",s,r=>this._handleKeyUp(r)),this.registerIncoming("blur",s,()=>this._handleBlur())}_handleKeyDown(t){t.data.repeat||this._handleKey(t,!0)}_handleKeyUp(t){this._handleKey(t,!1)}_handleBlur(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(t,i){const s=this._keyMap[t.data.key];if(this._pressed=s!=null,this._pressed){if(i)switch(this.view.mapViewNavigation.begin(),s){case"left":this.view.mapViewNavigation.continousPanLeft();break;case"right":this.view.mapViewNavigation.continousPanRight();break;case"up":this.view.mapViewNavigation.continousPanUp();break;case"down":this.view.mapViewNavigation.continousPanDown()}else this._pressed=!1,this.view.mapViewNavigation.stop();t.stopPropagation()}}}class Lce extends ei{constructor(t,i,s){super(!0),this.view=t,this.keys=i,this._pressed=!1,this._keyToDirection={[i.clockwiseOption1]:"clockwise",[i.clockwiseOption2]:"clockwise",[i.counterClockwiseOption1]:"counterClockwise",[i.counterClockwiseOption2]:"counterClockwise",[i.resetOption1]:"reset",[i.resetOption2]:"reset"},this.registerIncoming("key-down",s,r=>this._handleKeyDown(r)),this.registerIncoming("key-up",s,r=>this._handleKeyUp(r)),this.registerIncoming("blur",s,()=>this._handleBlur())}_handleKeyDown(t){t.data.repeat||this._handleKey(t,!0)}_handleKeyUp(t){this._handleKey(t,!1)}_handleBlur(){this._pressed&&(this._pressed=!1,this.view.mapViewNavigation.stop())}_handleKey(t,i){const s=t.modifiers;if(s.size>0&&!s.has("Shift")||!this.view.constraints.rotationEnabled)return;const r=this._keyToDirection[t.data.key];if(this._pressed=r!=null,this._pressed){if(i)switch(this.view.mapViewNavigation.begin(),r){case"clockwise":this.view.mapViewNavigation.continousRotateClockwise();break;case"counterClockwise":this.view.mapViewNavigation.continousRotateCounterclockwise();break;case"reset":this.view.mapViewNavigation.resetRotation()}else this._pressed=!1,this.view.mapViewNavigation.stop();t.stopPropagation()}}}var bh;(function(e){e[e.IN=0]="IN",e[e.OUT=1]="OUT"})(bh||(bh={}));class Fce extends ei{constructor(t,i,s){super(!0),this.view=t,this.keys=i,this._keysToZoomAction={},this.registerIncoming("key-down",s,r=>this._handleKeyDown(r)),i.zoomIn.forEach(r=>this._keysToZoomAction[r]=bh.IN),i.zoomOut.forEach(r=>this._keysToZoomAction[r]=bh.OUT)}_handleKeyDown(t){this._handleKey(t)}_handleKey(t){const i=t.modifiers;if(i.size>0&&!i.has("Shift"))return;const{key:s}=t.data;if(!(s in this._keysToZoomAction))return;const r=this._keysToZoomAction[s],{mapViewNavigation:n}=this.view;let o=null;switch(r){case bh.IN:o=n.zoomIn();break;case bh.OUT:o=n.zoomOut();break;default:return}n.begin(),o.then(()=>n.end()),t.stopPropagation()}}const Dce=.6;class Nce extends ei{constructor(t,i){super(!0),this._view=t,this._canZoom=!0,this.registerIncoming("mouse-wheel",i,s=>this._handleMouseWheel(s))}_handleMouseWheel(t){if(!this._view.navigation.mouseWheelZoomEnabled||(t.preventDefault(),t.stopPropagation(),!this._canZoom))return;const i=this._view.mapViewNavigation,{x:s,y:r,deltaY:n}=t.data,o=1/Dce**(1/60*n),a=i.zoom(o,[s,r]);a&&(this._canZoom=!1,a.catch(()=>{}).then(()=>{this._canZoom=!0,i.end()}))}}class jce extends ei{constructor(t){super(!0),this.view=t,this.registerIncoming("drag",s=>this._handleDrag(s)),this.registerIncoming("pointer-down",()=>this._stopMomentumNavigation());const i=this.view.mapViewNavigation;this._dragEventSeparator=new n_({start:(s,r)=>{i.pinch.begin(this.view,r.data),r.stopPropagation()},update:(s,r)=>{i.pinch.update(this.view,r.data),r.stopPropagation()},end:(s,r)=>{i.pinch.end(this.view),r.stopPropagation()},condition:s=>s>=2})}_handleDrag(t){this._dragEventSeparator.handle(t)}_stopMomentumNavigation(){this.view.mapViewNavigation.pinch.stopMomentumNavigation()}}function vA(e){const t=e.native;return t?{buttons:t.buttons.map(i=>i.pressed?i.value?i.value:1:0),axes:t.axes.map(i=>Bce(i,e.axisThreshold))}:{buttons:[],axes:[]}}function Vce(e,t){if(e.axes.length!==t.axes.length||e.buttons.length!==t.buttons.length)return!1;for(let i=0;i{this._connectGamepad(n.gamepad)},this._onDisconnectGamepad=n=>{const o=n.gamepad,a=o.index,l=this._inputDevices[a];l&&(this._emitGamepadEvent(o,vA(l),!1),this._inputDevices.splice(a,1),this._latestUpdate.splice(a,1),this._input.gamepad.devices.remove(l),this.ensurePollingState())},this._frameTask=null,this._latestUpdate=new Array,this._inputDevices=new Array,this._callback=null;const s="getGamepads"in window.navigator,r=window.isSecureContext;this.supported=s&&r,this.supported&&(this._forEachGamepad(n=>this._connectGamepad(n)),window.addEventListener("gamepadconnected",this._onConnectGamepad),window.addEventListener("gamepaddisconnected",this._onDisconnectGamepad),this.ensurePollingState())}destroy(){this.hasEventListeners=!1,this.supported&&(window.removeEventListener("gamepadconnected",this._onConnectGamepad),window.removeEventListener("gamepaddisconnected",this._onDisconnectGamepad))}set hasEventListeners(t){this._hasEventListeners!==t&&(this._hasEventListeners=t,this.ensurePollingState())}get _eventsEnabled(){return this.supported&&this._inputDevices.length>0&&this._hasEventListeners}set onEvent(t){this._callback=t}_connectGamepad(t){const i=new ZT(t);i.deviceType!=="unknown"&&(this._inputDevices[t.index]=i,this._input.gamepad.devices.add(i)),this.ensurePollingState()}ensurePollingState(){this._eventsEnabled?this._startPolling():this._stopPolling()}_startPolling(){this._frameTask==null&&(this._frameTask=Dh({update:()=>this._readGamepadState()}))}_stopPolling(){this._frameTask!=null&&(this._frameTask.remove(),this._frameTask=null,this._latestUpdate=new Array)}_readGamepadState(){const t=document.hasFocus(),i=this._element.contains(document.activeElement),s=this._input.gamepad.enabledFocusMode==="document"&&!t||this._input.gamepad.enabledFocusMode==="view"&&!i;this._forEachGamepad(r=>{const n=this._inputDevices[r.index];if(!n)return;const o=this._latestUpdate[r.index],a=vA(n),l=s||zce(a);o&&(o.timestamp===r.timestamp||!o.active&&l||Vce(o.state,a))||this._emitGamepadEvent(r,a,!l)})}_forEachGamepad(t){const i=window.navigator.getGamepads();for(let s=0;sthis._callback("gamepad",s)}destroy(){this._callback=null,this.activeEvents=null,this._activePointerCaptures.forEach(t=>{this._releasePointerCaptureSafe(t)}),this._gamepadSource=$t(this._gamepadSource),this._activePointerCaptures=null,this._removeTouchAction(),this._element.removeEventListener("keydown",this._preventAltKeyDefault)}get browserTouchPanningEnabled(){return this._browserTouchPanningEnabled}set browserTouchPanningEnabled(t){this._browserTouchPanningEnabled=t,this._updateTouchAction(),this._updateTouchEventHandling()}set onEventReceived(t){this._callback=t}set activeEvents(t){for(const i in this._active)if(!t||!t.has(i)){const s=this._active[i];this._element.removeEventListener(Vw[i],s),delete this._active[i]}t&&t.forEach(i=>{if(!this._active[i]&&Vw[i]){const s=(this._eventHandlers[i]||this._handleDefault).bind(this,i);this._element.addEventListener(Vw[i],s),this._active[i]=s}}),this._gamepadSource.hasEventListeners=t&&t.has("gamepad")}setPointerCapture(t,i){i?(this._element.setPointerCapture(t.pointerId),this._activePointerCaptures.add(t.pointerId)):(this._releasePointerCaptureSafe(t.pointerId),this._activePointerCaptures.delete(t.pointerId))}_updateTouchAction(){this._element.classList.remove(this._browserTouchPanningEnabled?Mu.touchNone:Mu.touchPan),this._element.classList.add(this._browserTouchPanningEnabled?Mu.touchPan:Mu.touchNone)}_updateTouchEventHandling(){this._browserTouchPanningEnabled?this._element.addEventListener("touchmove",this._preventMultiTouchPanning):this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_removeTouchAction(){this._element.classList.remove(Mu.touchNone),this._element.classList.remove(Mu.touchPan),this._element.removeEventListener("touchmove",this._preventMultiTouchPanning)}_releasePointerCaptureSafe(t){try{if(this._element.hasPointerCapture&&!this._element.hasPointerCapture(t))return;this._element.releasePointerCapture(t)}catch{}}_updateNormalizedPointerLikeEvent(t,i){const s=dj(this._element,t);return o_.test.disableSubpixelCoordinates&&(s.x=Math.round(s.x),s.y=Math.round(s.y)),i.x=s.x,i.y=s.y,i}_handleKey(t,i){const s=Poe(i);s&&t==="key-up"&&this._keyDownState.delete(s);const r={native:i,key:s,repeat:s&&this._keyDownState.has(s)};s&&t==="key-down"&&this._keyDownState.add(r.key),this._callback(t,r)}_handlePointer(t,i){const s=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});this._callback(t,s)}_handlePointerPreventDefault(t,i){const s=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,pointerType:i.pointerType,button:i.button,buttons:i.buttons,eventId:this._eventId++});i.preventDefault(),this._callback(t,s)}_handleMouseWheel(t,i){let s=i.deltaY;switch(i.deltaMode){case 0:(bA||_A)&&(s=s/document.documentElement.clientHeight*600);break;case 1:s*=30;break;case 2:s*=900}bA||_A?s*=.7:qce||Wce?s*=.6:Gce&&(s*=1.375);const r=100,n=Math.abs(s);n>r&&(s=s/n*200/(1+Math.exp(-.02*(n-r))));const o=this._updateNormalizedPointerLikeEvent(i,{native:i,x:0,y:0,deltaY:s});this._callback(t,o)}_handlePointerCaptureLost(t,i){this._activePointerCaptures.delete(i.pointerId),this._handleDefault(t,i)}_handleDefault(t,i){const s={native:i};i.preventDefault(),this._callback(t,s)}_preventAltKeyDefault(t){t.key==="Alt"&&t.preventDefault()}_preventMultiTouchPanning(t){t.touches.length>1&&t.preventDefault()}}o_.test={disableSubpixelCoordinates:!1};const Vw={"key-down":"keydown","key-up":"keyup","pointer-down":"pointerdown","pointer-up":"pointerup","pointer-move":"pointermove","mouse-wheel":"wheel","pointer-capture-got":"gotpointercapture","pointer-capture-lost":"lostpointercapture","context-menu":"contextmenu","pointer-enter":"pointerenter","pointer-leave":"pointerleave","pointer-cancel":"pointercancel",focus:"focus",blur:"blur"};class Hce extends ei{constructor(){super(!0),this.registerIncoming("context-menu",t=>{t.data.native.preventDefault()})}}function aI(e,t){return Math.abs(t.x-e.x)+Math.abs(t.y-e.y)}function Yce(e,t){const i=t.x-e.x,s=t.y-e.y;return Math.sqrt(i*i+s*s)}function Jce(e,t){if(t?(t.radius=0,t.center.x=0,t.center.y=0):t={radius:0,center:ns()},e.length===0)return t;if(e.length===1)return t.center.x=e[0].x,t.center.y=e[0].y,t;if(e.length===2){const[$,I]=e,[T,k]=[I.x-$.x,I.y-$.y];return t.radius=Math.sqrt(T*T+k*k)/2,t.center.x=($.x+I.x)/2,t.center.y=($.y+I.y)/2,t}let i=0,s=0;for(let $=0;$$.x-i),n=e.map($=>$.y-s);let o=0,a=0,l=0,u=0,d=0,f=0,m=0;for(let $=0;$t.doubleClickTimer=Bt(t.doubleClickTimer))}get hasPendingInputs(){return Zv(this._pointerState,t=>t.doubleClickTimer!=null)}_clearDoubleClickTimer(t,i){const s=this._pointerState.get(t);s&&(s.doubleClickTimer=Bt(s.doubleClickTimer),i&&this._click.emit(s.event.data,void 0,s.event.modifiers),this._pointerState.delete(t),this.refreshHasPendingInputs())}_doubleClickTimeoutExceeded(t){const i=this._pointerState.get(t);i.pointerDownCount===1&&this._click.emit(i.event.data,void 0,i.event.modifiers),i.doubleClickTimer=null,this._pointerState.delete(t),this.refreshHasPendingInputs()}_getPointerId(t){const{pointerId:i,pointerType:s,button:r}=t.native;return s==="mouse"?`${i}:${r}`:`${s}`}_handleImmediateClick(t){const i=t.data,{pointerType:s}=i.native,r=this._getPointerId(i);if(!this._pointerState.has(r))return void this._startClick(t);const n=this._pointerState.get(r),{data:o,modifiers:a}=n.event,l=s==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;aI(o,i)>l?(this._clearDoubleClickTimer(r,!0),this._startClick(t)):(this._clearDoubleClickTimer(r,!1),n.pointerDownCount===2&&this._doubleClick.emit(o,void 0,a))}_handlePointerDown(t){const i=Hc(t.data),s=this._pointerState.get(i);s&&(s.pointerDownCount+=1)}_startClick(t){const{data:i}=t,{native:{pointerType:s}}=i,r=Hc(i),n=s==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._doubleClickTimeoutExceeded(r),n),a=1;this._pointerState.set(r,{event:t,doubleClickTimer:o,pointerDownCount:a}),this.refreshHasPendingInputs()}}class Zce extends ei{constructor(t=Xs.maximumDoubleClickDelay,i=Xs.maximumDoubleClickDistance,s=Xs.maximumDoubleTouchDelay,r=Xs.maximumDoubleTouchDistance,n=Im){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=i,this._maximumDoubleTouchDelay=s,this._maximumDoubleTouchDistance=r,this._clock=n,this._doubleTapDragReady=!1,this._doubleTapDragActive=!1,this._dragStartCenter=ns(0,0),this._pointerState=new Map,this._doubleTapDrag=this.registerOutgoing("double-tap-drag"),this._dragEventSeparator=new n_({start:(o,a)=>this._dragStart(o,a),update:(o,a)=>this._dragUpdate(a),end:(o,a)=>this._dragEnd(a)}),this.registerIncoming("drag",o=>this._dragEventSeparator.handle(o)),this.registerIncoming("pointer-down",o=>this._handlePointerDown(o)),this.registerIncoming("pointer-up",()=>this._handlePointerUp())}onUninstall(){this._pointerState.forEach(t=>{t.doubleTapTimeout=Bt(t.doubleTapTimeout)})}get hasPendingInputs(){return Zv(this._pointerState,t=>t.doubleTapTimeout!=null)}_clearPointerDown(t){const i=this._pointerState.get(t);i&&(i.doubleTapTimeout=Bt(i.doubleTapTimeout),this._pointerState.delete(t),this.refreshHasPendingInputs())}_createDoubleTapDragData(t,i,s){const{button:r,buttons:n,pointer:o,pointers:a,pointerType:l,timestamp:u}=s;return{action:t,delta:i,button:r,buttons:n,pointer:o,pointers:a,pointerType:l,timestamp:u}}_dragStart(t,i){if(!this._doubleTapDragReady||t!==1)return;this._doubleTapDragReady=!1,this._doubleTapDragActive=!0;const{data:s,modifiers:r}=i,{center:n}=s;this._dragStartCenter=n;const o=this._createDoubleTapDragData("begin",ns(0,0),s);this._doubleTapDrag.emit(o,void 0,r),i.stopPropagation()}_dragUpdate(t){if(!this._doubleTapDragActive)return;const{data:i,modifiers:s}=t,{center:r}=i,n=ns(r.x-this._dragStartCenter.x,r.y-this._dragStartCenter.y),o=this._createDoubleTapDragData("update",n,i);this._doubleTapDrag.emit(o,void 0,s),t.stopPropagation()}_dragEnd(t){if(!this._doubleTapDragActive)return;const{data:i,modifiers:s}=t,{center:r}=i,n=ns(r.x-this._dragStartCenter.x,r.y-this._dragStartCenter.y),o=this._createDoubleTapDragData("end",n,i);this._doubleTapDrag.emit(o,void 0,s),this._doubleTapDragActive=!1,t.stopPropagation()}_handlePointerDown(t){const{data:i}=t,s=Hc(i),r=this._pointerState.get(s),{pointerType:n}=i.native;if(r){const o=n==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;this._clearPointerDown(s),aI(r.event.data,i)>o?this._storePointerDown(t):this._doubleTapDragReady=!0}else this._storePointerDown(t)}_handlePointerUp(){this._doubleTapDragReady=!1}_storePointerDown(t){const{data:i}=t,{pointerType:s}=i.native,r=Hc(i),n=s==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay,o=this._clock.setTimeout(()=>this._clearPointerDown(r),n);this._pointerState.set(r,{event:t,doubleTapTimeout:o}),this.refreshHasPendingInputs()}}class Qce extends ei{constructor(t){super(!1),this._navigationTouch=t,this._startStateModifiers=new Set,this._activePointerMap=new Map,this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._drag=this.registerOutgoing("drag"),this.registerIncoming("pointer-drag",this._handlePointerDrag.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-capture-lost",this._handlePointerUpAndPointerLost.bind(this)),this.registerIncoming("pointer-cancel",this._handlePointerUpAndPointerLost.bind(this))}_createPayload(t,i,s,r){return{action:t,pointerType:this._pointerType,button:this._mouseButton,buttons:i.buttons,timestamp:r,pointers:Kce(this._activePointerMap),pointer:i,angle:s.angle,radius:s.radius,center:s.center}}_addPointer(t){const i=t.native.pointerId,s=Wy(this._activePointerMap).angle,r={event:t,initialAngle:0,lastAngle:0};this._activePointerMap.set(i,r);const n=m0(r,Zj(this._activePointerMap));r.initialAngle=n,r.lastAngle=n,this._updatePointerAngles(s)}_updatePointer(t){if(t&&t.x==null&&t.y==null)return;const i=t.native.pointerId,s=this._activePointerMap.get(i);s?s.event=t:this._addPointer(t)}_removePointer(t){const i=Wy(this._activePointerMap).angle;this._activePointerMap.delete(t),this._updatePointerAngles(i)}_updatePointerAngles(t){const i=Wy(this._activePointerMap);this._activePointerMap.forEach(s=>{s.initialAngle=m0(s,i)-t,s.lastAngle=m0(s,i)-t})}_emitEvent(t,i,s){const r=Wy(this._activePointerMap);this._drag.emit(this._createPayload(t,i,r,s),void 0,this._startStateModifiers)}_handlePointerUpAndPointerLost(t){const i=t.data.native.pointerId,s=t.timestamp;this._activePointerMap.get(i)&&(this._activePointerMap.size===1?(this._updatePointer(t.data),!this._isCurrentDragSuppressed&&this._emitEvent("end",t.data,s),this._isDragging=!1,this._isCurrentDragSuppressed=!1,this._removePointer(i)):(this._removePointer(i),this._emitEvent("removed",t.data,t.timestamp)))}_handlePointerDrag(t){const i=t.data,s=i.currentEvent,r=t.timestamp;switch(i.action){case"start":case"update":this._isDragging?this._activePointerMap.has(s.native.pointerId)?(this._updatePointer(s),!this._isCurrentDragSuppressed&&this._emitEvent("update",s,r)):(this._addPointer(s),this._emitEvent("added",s,r),this._isCurrentDragSuppressed=this._isSuppressed):(this._updatePointer(s),this._pointerType=t.data.startEvent.pointerType,this._mouseButton=t.data.startEvent.button,this._startStateModifiers=t.modifiers,this._isDragging=!0,this._isCurrentDragSuppressed=this._isSuppressed,!this._isCurrentDragSuppressed&&this._emitEvent("start",s,r))}}get _isSuppressed(){return!!this._navigationTouch&&!this._navigationTouch.browserTouchPanEnabled&&this._pointerType==="touch"&&this._activePointerMap.size===1}}function Zj(e){const t=[];return e.forEach(i=>{t.push(ns(i.event.x,i.event.y))}),Jce(t)}function Wy(e){const t=Zj(e);let i=0;return e.forEach(s=>{let r=m0(s,t),n=r-s.lastAngle;for(;n>Math.PI;)n-=2*Math.PI;for(;n<-Math.PI;)n+=2*Math.PI;r=s.lastAngle+n,s.lastAngle=r,i+=r-s.initialAngle}),i/=e.size||1,{angle:i,radius:t.radius,center:t.center}}function Kce(e){const t=new Map;return e.forEach((i,s)=>t.set(s,i.event)),t}function m0(e,t){const i=e.event,s=i.x-t.center.x,r=i.y-t.center.y;return Math.atan2(r,s)}var wA;(function(e){e[e.Left=0]="Left",e[e.Middle=1]="Middle",e[e.Right=2]="Right",e[e.Back=3]="Back",e[e.Forward=4]="Forward",e[e.Undefined=-1]="Undefined"})(wA||(wA={}));class eue extends ei{constructor(t=Xs.maximumDoubleClickDelay,i=Xs.maximumDoubleClickDistance,s=Xs.maximumDoubleTouchDelay,r=Xs.maximumDoubleTouchDistance,n=Im){super(!1),this._maximumDoubleClickDelay=t,this._maximumDoubleClickDistance=i,this._maximumDoubleTouchDelay=s,this._maximumDoubleTouchDistance=r,this._clock=n,this._pointerState=new Map,this._immediateDoubleClick=this.registerOutgoing("immediate-double-click"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",this._handlePointerUp.bind(this))}onUninstall(){this._pointerState.forEach(t=>{t.immediateDoubleClick&&t.immediateDoubleClick.timeoutHandle.remove()}),super.onUninstall()}_handlePointerDown(t){const i=t.data,s=Hc(i);if(!this._pointerState.has(s)){const r={downButton:i.native.button,immediateDoubleClick:null};this._pointerState.set(s,r),this.startCapturingPointer(i.native)}}_handlePointerUp(t){const i=t.data,s=Hc(i),r=this._pointerState.get(s);if(r&&r.downButton===i.native.button){const n=r.immediateDoubleClick;if(n){n.timeoutHandle.remove();const o=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDistance:this._maximumDoubleClickDistance;aI(n,t.data)>o?this._startImmediateDoubleClick(t,r):(this._immediateDoubleClick.emit(t.data,void 0,n.modifiers),this._removeState(i))}else this._startImmediateDoubleClick(t,r)}}_startImmediateDoubleClick(t,i){const s=t.data.native.pointerType==="touch"?this._maximumDoubleTouchDelay:this._maximumDoubleClickDelay;i.immediateDoubleClick={x:t.data.x,y:t.data.y,modifiers:t.modifiers,timeoutHandle:this._clock.setTimeout(()=>this._removeState(t.data),s)}}_removeState(t){const i=Hc(t);this._pointerState.delete(i),this.stopCapturingPointer(t.native),this.refreshHasPendingInputs()}}const Wd={maximumClickDelay:300,movementUntilMouseDrag:1.5,movementUntilPenDrag:6,movementUntilTouchDrag:6,holdDelay:500};class tue extends ei{constructor(t=Wd.maximumClickDelay,i=Wd.movementUntilMouseDrag,s=Wd.movementUntilPenDrag,r=Wd.movementUntilTouchDrag,n=Wd.holdDelay,o=Im){super(!1),this._maximumClickDelay=t,this._movementUntilMouseDrag=i,this._movementUntilPenDrag=s,this._movementUntilTouchDrag=r,this._holdDelay=n,this._clock=o,this._pointerState=new Map,this._pointerDrag=this.registerOutgoing("pointer-drag"),this._immediateClick=this.registerOutgoing("immediate-click"),this._pointerHold=this.registerOutgoing("hold"),this.registerIncoming("pointer-down",this._handlePointerDown.bind(this)),this.registerIncoming("pointer-up",a=>{this._handlePointerLoss(a,"pointer-up")}),this.registerIncoming("pointer-capture-lost",a=>{this._handlePointerLoss(a,"pointer-capture-lost")}),this.registerIncoming("pointer-cancel",a=>{this._handlePointerLoss(a,"pointer-cancel")}),this._moveHandle=this.registerIncoming("pointer-move",this._handlePointerMove.bind(this)),this._moveHandle.pause()}onUninstall(){this._pointerState.forEach(t=>{t.holdTimeout=Bt(t.holdTimeout)}),super.onUninstall()}_handlePointerDown(t){const i=t.data,s=i.native.pointerId;let r=null;this._pointerState.size===0&&(r=this._clock.setTimeout(()=>{const o=this._pointerState.get(s);if(o){if(!o.isDragging){const a=o.previousEvent;this._pointerHold.emit(a,void 0,t.modifiers),o.holdEmitted=!0}o.holdTimeout=null}},this._holdDelay));const n={startEvent:i,previousEvent:i,startTimestamp:t.timestamp,isDragging:!1,downButton:i.native.button,holdTimeout:r,modifiers:new Set};this._pointerState.set(s,n),this.startCapturingPointer(i.native),this._moveHandle.resume(),this._pointerState.size>1&&this._startDragging(t)}_createPointerDragData(t,i,s){return{action:t,startEvent:i.startEvent,previousEvent:i.previousEvent,currentEvent:s}}_handlePointerMove(t){const i=t.data,s=i.native.pointerId,r=this._pointerState.get(s);r&&(r.isDragging?this._pointerDrag.emit(this._createPointerDragData("update",r,i),void 0,r.modifiers):Yce(i,r.startEvent)>this._getDragThreshold(i.native.pointerType)&&this._startDragging(t),r.previousEvent=i)}_getDragThreshold(t){switch(t){case"touch":return this._movementUntilTouchDrag;case"pen":return this._movementUntilPenDrag;default:return this._movementUntilMouseDrag}}_startDragging(t){const i=t.data,s=i.native.pointerId;this._pointerState.forEach(r=>{r.holdTimeout!=null&&(r.holdTimeout.remove(),r.holdTimeout=null),r.isDragging||(r.modifiers=t.modifiers,r.isDragging=!0,s===r.startEvent.native.pointerId?this._pointerDrag.emit(this._createPointerDragData("start",r,i)):this._pointerDrag.emit(this._createPointerDragData("start",r,r.previousEvent),t.timestamp))})}_handlePointerLoss(t,i){const s=t.data,r=s.native.pointerId,n=this._pointerState.get(r);n&&(n.holdTimeout!=null&&(n.holdTimeout.remove(),n.holdTimeout=null),n.isDragging?this._pointerDrag.emit(this._createPointerDragData("end",n,i==="pointer-up"?s:n.previousEvent),void 0,n.modifiers):i==="pointer-up"&&n.downButton===s.native.button&&t.timestamp-n.startTimestamp<=this._maximumClickDelay&&!n.holdEmitted&&this._immediateClick.emit(s),this._pointerState.delete(r),this.stopCapturingPointer(s.native),this._pointerState.size===0&&this._moveHandle.pause())}}const Hy={counter:"Ctrl",pan:{left:"ArrowLeft",right:"ArrowRight",up:"ArrowUp",down:"ArrowDown"},zoom:{zoomIn:["=","+"],zoomOut:["-","_"]},rotate:{clockwiseOption1:"a",clockwiseOption2:"A",counterClockwiseOption1:"d",counterClockwiseOption2:"D",resetOption1:"n",resetOption2:"N"}};let uc=class extends oe{constructor(){super(...arguments),this._handles=new qi}initialize(){const e=()=>{var t;return(t=this.view)==null?void 0:t.ready};this._handles.add([Qs(()=>!e(),()=>this._disconnect()),Qs(e,()=>this._connect())])}destroy(){this._handles&&(this._handles.removeAll(),this._handles=null),this._disconnect()}get latestPointerType(){var e;return(e=this._inputManager)==null?void 0:e.latestPointerType}get latestPointerLocation(){var e;return(e=this._inputManager)==null?void 0:e.latestPointerLocation}get multiTouchActive(){var e,t;return(t=(e=this._inputManager)==null?void 0:e.multiTouchActive)!=null?t:!1}_disconnect(){this.view.viewEvents.disconnect(),this._inputManager=$t(this._inputManager)}_connect(){const e=this.view.surface,t=new o_(e,this.view.input),i=[new eue,new tue,new Xce,new Qce(this.view.navigation),new Zce],s=new cn({eventSource:t,recognizers:i});s.installHandlers("prevent-context-menu",[new Hce],el.INTERNAL),s.installHandlers("navigation",[new jce(this.view),new Cce(this.view),new Nce(this.view),new gA(this.view),new gA(this.view,[Hy.counter]),new $ce(this.view,"primary"),new Rce(this.view,Hy.pan),new Fce(this.view,Hy.zoom),new Lce(this.view,Hy.rotate),new Tce(this.view,"secondary"),new Mce(this.view,"touch")],el.INTERNAL),this.view.viewEvents.connect(s),this._source=t,this._inputManager=s,Z(()=>{var r,n;return(n=(r=this.view)==null?void 0:r.navigation)==null?void 0:n.browserTouchPanEnabled},r=>{this._source&&(this._source.browserTouchPanningEnabled=!r)},Le)}get test(){return{inputManager:this._inputManager}}};c([h()],uc.prototype,"view",void 0),c([h()],uc.prototype,"latestPointerType",null),c([h()],uc.prototype,"latestPointerLocation",null),c([h()],uc.prototype,"multiTouchActive",null),uc=c([S("esri.views.2d.input.MapViewInputManager")],uc);const iue=uc;var xA,SA,MA,Qj={exports:{}};xA=Qj,SA=function(){function e(r,n,o,a,l){t(r,n,o||0,a||r.length-1,l||s)}function t(r,n,o,a,l){for(;a>o;){if(a-o>600){var u=a-o+1,d=n-o+1,f=Math.log(u),m=.5*Math.exp(2*f/3),y=.5*Math.sqrt(f*m*(u-m)/u)*(d-u/2<0?-1:1);t(r,n,Math.max(o,Math.floor(n-d*m/u+y)),Math.min(a,Math.floor(n+(u-d)*m/u+y)),l)}var g=r[n],v=o,b=a;for(i(r,o,n),l(r[a],g)>0&&i(r,o,a);v0;)b--}l(r[o],g)===0?i(r,o,b):i(r,++b,a),b<=n&&(o=b+1),n<=b&&(a=b-1)}}function i(r,n,o){var a=r[n];r[n]=r[o],r[o]=a}function s(r,n){return rn?1:0}return e},(MA=SA())!==void 0&&(xA.exports=MA);const sue=Qj.exports;function Dv(e,t){if(!(this instanceof Dv))return new Dv(e,t);this._maxEntries=Math.max(4,e||9),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),t&&(typeof t=="function"?this.toBBox=t:this._initFormat(t)),this.clear()}function rue(e,t,i){if(!i)return t.indexOf(e);for(var s=0;s=e.minX&&t.maxY>=e.minY}function ah(e){return{children:e,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function IA(e,t,i,s,r){for(var n,o=[t,i];o.length;)(i=o.pop())-(t=o.pop())<=s||(n=t+Math.ceil((i-t)/s/2)*s,sue(e,n,t,i,r),o.push(t,n,n,i))}Dv.prototype={all:function(){return this._all(this.data,[])},search:function(e){var t=this.data,i=[],s=this.toBBox;if(!Jy(e,t))return i;for(var r,n,o,a,l=[];t;){for(r=0,n=t.children.length;r=0&&n[t].children.length>this._maxEntries;)this._split(n,t),t--;this._adjustParentBBoxes(r,n,t)},_split:function(e,t){var i=e[t],s=i.children.length,r=this._minEntries;this._chooseSplitAxis(i,r,s);var n=this._chooseSplitIndex(i,r,s),o=ah(i.children.splice(n,i.children.length-n));o.height=i.height,o.leaf=i.leaf,$u(i,this.toBBox),$u(o,this.toBBox),t?e[t-1].children.push(o):this._splitRoot(i,o)},_splitRoot:function(e,t){this.data=ah([e,t]),this.data.height=e.height+1,this.data.leaf=!1,$u(this.data,this.toBBox)},_chooseSplitIndex:function(e,t,i){var s,r,n,o,a,l,u,d;for(l=u=1/0,s=t;s<=i-t;s++)o=oue(r=Zp(e,0,s,this.toBBox),n=Zp(e,s,i,this.toBBox)),a=zw(r)+zw(n),o=t;r--)n=e.children[r],Qp(l,e.leaf?o(n):n),u+=Yy(l);return u},_adjustParentBBoxes:function(e,t,i){for(var s=i;s>=0;s--)Qp(t[s],e)},_condense:function(e){for(var t,i=e.length-1;i>=0;i--)e[i].children.length===0?i>0?(t=e[i-1].children).splice(t.indexOf(e[i]),1):this.clear():$u(e[i],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]+"};")}};class Nv{constructor(t,i){this.key=new is(0,0,0,0),this.bounds=nl(),this.objectIds=new Set,this.key.set(i);const s=t.getLODInfoAt(this.key);this.tileInfoView=t,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 Ze.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 t=this.key.getChildKeys(),i=Vi.acquire();for(let s=0;s({minX:i.bounds[0],minY:i.bounds[1],maxX:i.bounds[2],maxY:i.bounds[3]}):[".bounds[0]",".bounds[1]",".bounds[2]",".bounds[3]"]),this.tiles=[],this.tileScheme=t}destroy(){this.clear()}clear(){this.tiles.length=0,this._tiles.clear(),this._index.clear()}has(t){return this._tiles.has(t)}get(t){return this._tiles.get(t)}boundsIntersections(t){return this._index.search({minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]})}updateTiles(t){const i={added:[],removed:[]};for(const s of t.added)if(!this.has(s)){const r=new Nv(this.tileScheme,s);this._tiles.set(s,r),this._index.insert(r),i.added.push(r)}for(const s of t.removed)if(this.has(s)){const r=this.get(s);this._tiles.delete(s),this._index.remove(r),i.removed.push(r)}this.tiles.length=0,this._tiles.forEach(s=>this.tiles.push(s)),(i.added.length||i.removed.length)&&this.emit("update",i)}setViewState(t){const i=this.tileScheme.getTileCoverage(t,0);if(!i)return;const{spans:s,lodInfo:r}=i,{level:n}=r;if(s.length>0)for(const{row:o,colFrom:a,colTo:l}of s)for(let u=a;u<=l;u++){const d=aue.set(n,o,r.normalizeCol(u),r.getWorldForColumn(u)).id;if(Uw.add(d),!this.has(d)){const f=new Nv(this.tileScheme,d);this._tiles.set(d,f),this._index.insert(f),this.tiles.push(f),Tl.added.push(f)}}for(let o=this.tiles.length-1;o>=0;o--){const a=this.tiles[o];Uw.has(a.id)||(this._tiles.delete(a.id),this.tiles.splice(o,1),this._index.remove(a),Tl.removed.push(a))}(Tl.added.length||Tl.removed.length)&&this.emit("update",Tl),Kh.pool.release(i),Uw.clear(),Tl.added.length=0,Tl.removed.length=0}}let cue=0,Ea=class extends oe{constructor(){super(...arguments),this.color=new pe([0,255,255]),this.haloOpacity=1,this.fillOpacity=.25}get version(){return cue++}};c([h({readOnly:!0})],Ea.prototype,"version",null),c([h({type:pe})],Ea.prototype,"color",void 0),c([h({type:pe})],Ea.prototype,"haloColor",void 0),c([h()],Ea.prototype,"haloOpacity",void 0),c([h()],Ea.prototype,"fillOpacity",void 0),Ea=c([S("esri.views.2d.support.HighlightOptions")],Ea);const Kj=Ea,uue=e=>e.includes("Brush");class e8{constructor(){this._names=new Map}begin(t){this._names.has(t)||(this._names.set(t,!1),uue(t)&&this.record("Esri.FirstDraw"),performance.mark(`Esri.${t}.Start`))}end(t){this._names.has(t)&&!this._names.get(t)&&(this._names.set(t,!0),performance.mark(`Esri.${t}.End`))}record(t){this._names.has(t)||(this._names.set(t,!0),performance.mark(`Esri.${t}`))}}function hue(e,t,i,s,r,n,o,a){let l;e.ignorePadding&&(s={left:0,right:0,top:0,bottom:0}),e.width!=null&&e.height!=null?l=[e.width,e.height]:e.width==null&&e.height!=null?l=[e.height,e.height]:e.width!=null&&e.height==null?l=[e.width,e.width]:e.width==null&&e.height==null&&(l=null);const u=i[0]-(s.left+s.right),d=i[1]-(s.top+s.bottom);let f,m,y=e.area||{x:0,y:0,width:u,height:d};if(l){const g=u/d,v=l[0]/l[1];if(v>g){const b=y.width/v;y={x:y.x,y:Math.round(y.y+(y.height-b)/2),width:y.width,height:Math.round(b)}}else{const b=y.height*v;y={x:Math.round(y.x+(y.width-b)/2),y:y.y,width:Math.round(b),height:y.height}}}else l=[y.width,y.height];return l[0]>y.width?(f=Math.min(l[0]/y.width,t),m=l[0]/y.width/f):(f=1,m=l[0]/y.width),{resolutionScale:f,cropArea:{x:Math.round((y.x+s.left)*f),y:Math.round((y.y+s.top)*f),width:Math.round(y.width*f),height:Math.round(y.height*f)},outputScale:m,format:r,quality:n,children:o,rotation:a}}function due(e,t,i){const{ctx:s,canvas:r}=t8(e,i),n=s.getImageData(0,0,e.width,e.height),o=mue(r,t);return i8(r),{dataUrl:o,data:n}}function pue(e,t){const{ctx:i,canvas:s}=t8(e,t),r=i.getImageData(0,0,e.width,e.height);return i8(s),r}function t8(e,t){const i=fue();t.premultipliedAlpha&&_ue(e),i.width=e.width,i.height=e.height;const s=i.getContext("2d");return s.putImageData(e,0,0),t.flipY&&bue(s),{ctx:s,canvas:i}}function i8(e){e.width=0,e.height=0}function fue(){return N(qw)&&(qw=document.createElement("canvas")),qw}let qw=null;function mue(e,t){const i=wue[t.format],s=t.quality/100;return e.toDataURL(i,s)}function yue(e,t){const i=vue(e),s=Sue[i];return{format:i,quality:ls(t!=null?t:s,0,100)}}function gue(e,t){return t/Math.max(e[0],e[1])}function swe(e,t,i,s=0,r=0,n=e.width-s,o=e.height-r,a=!1){const{data:l}=e,{width:u,height:d,data:f}=t,m=n/u,y=o/d,g=Math.ceil(m/2),v=Math.ceil(y/2),b=e.width;for(let _=0;_=1)continue;let ne=2*re*re*re-3*re*re+1;const ke=4*(s+me+(r+J)*b);G+=ne*l[ke+3],T+=ne,!i&&l[ke+3]<255&&(ne=ne*l[ke+3]/255),k+=ne*l[ke],A+=ne*l[ke+1],F+=ne*l[ke+2],I+=ne}}f[$]=k/I,f[$+1]=A/I,f[$+2]=F/I,f[$+3]=G/T}return t}function vue(e){switch(e){case"png":case"jpg":case"jpeg":return e;default:return xue}}function bue(e){e.save(),e.globalCompositeOperation="copy",e.scale(1,-1),e.translate(0,-e.canvas.height),e.drawImage(e.canvas,0,0),e.restore()}function _ue(e){const t=e.data,i=t.length;for(let s=0;s0){const n=255/r;t[s+0]=t[s+0]*n,t[s+1]=t[s+1]*n,t[s+2]=t[s+2]*n}}}const wue={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg"},EA=98,xue="png",Sue={png:100,jpg:EA,jpeg:EA};var At;function rwe(e,t,i={}){const s=s8(e);for(;s.length>1;){const r=jv(t,s.shift(),i);if(M(r))return r}return Mue(t,s.shift(),i)}function s8(e){const t=V("esri-force-webgl");if(t===At.WEBGL1||t===At.WEBGL2)return[t];switch(e){case"2d":return V("mac")&&V("chrome")?[At.WEBGL1,At.WEBGL2]:[At.WEBGL2,At.WEBGL1];case"3d":return[At.WEBGL2,At.WEBGL1]}}function Mue(e,t,i={}){if(!window.WebGLRenderingContext)return kA(e,$ue),null;const s=jv(e,t,i);return N(s)&&kA(e,Tue),s}function jv(e,t,i={}){const s=t===At.WEBGL1?["webgl","experimental-webgl","webkit-3d","moz-webgl"]:["webgl2"];let r=null;for(const n of s){try{r=e.getContext(n,i)}catch{}if(r)break}return r}function kA(e,t){const i=e.parentNode;i&&(i.innerHTML='
'+t+"
")}(function(e){e[e.WEBGL1=1]="WEBGL1",e[e.WEBGL2=2]="WEBGL2"})(At||(At={}));const $ue='This page requires a browser that supports WebGL.
Click here to upgrade your browser.',Tue=`It doesn't appear your computer can support WebGL.
Click here for more information.`;let Gw,Ww;function Iue(e){const t=s8(e);for(;t.length>1;){const i=CA(t.shift());if(i.available)return i}return CA(t.shift())}function CA(e){switch(e){case At.WEBGL1:return Eue();case At.WEBGL2:return kue()}}function Eue(){return Gw||(Gw=Aue()),Gw}function kue(){return Ww||(Ww=Oue()),Ww}class r8{constructor(){this.available=!1,this.majorPerformanceCaveat=!1,this.maxTextureSize=0,this.supportsVertexShaderSamplers=!1,this.supportsHighPrecisionFragment=!1,this.supportsElementIndexUint=!1,this.supportsStandardDerivatives=!1,this.supportsInstancedArrays=!1,this.supportsTextureFloat=!1,this.supportsTextureHalfFloat=!1,this.supportsColorBufferFloat=!1,this.supportsColorBufferFloatBlend=!1,this.supportsColorBufferHalfFloat=!1}}class Cue extends r8{constructor(){super(...arguments),this.type=At.WEBGL1}}class Pue extends r8{constructor(){super(...arguments),this.type=At.WEBGL2,this.supportsElementIndexUint=!0,this.supportsStandardDerivatives=!0,this.supportsInstancedArrays=!0,this.supportsTextureFloat=!0,this.supportsTextureHalfFloat=!0}}function n8(e,t){var n;if(e===At.WEBGL1&&typeof WebGLRenderingContext=="undefined"||e===At.WEBGL2&&typeof WebGL2RenderingContext=="undefined")return null;const i=document.createElement("canvas");if(!i)return null;let s=jv(i,e,{failIfMajorPerformanceCaveat:!0});if(N(s)&&(s=jv(i,e),M(s)&&(t.majorPerformanceCaveat=!0)),N(s))return s;if(e===At.WEBGL1){const o=(n=s.getParameter(s.VERSION))==null?void 0:n.match(/^WebGL\s+([\d.]*)/);if(o){const a=parseFloat(o[1]);t.available=a>=.94}}else t.available=!0;t.maxTextureSize=s.getParameter(s.MAX_TEXTURE_SIZE),t.supportsVertexShaderSamplers=s.getParameter(s.MAX_VERTEX_TEXTURE_IMAGE_UNITS)>0;const r=s.getShaderPrecisionFormat(s.FRAGMENT_SHADER,s.HIGH_FLOAT);return r&&(t.supportsHighPrecisionFragment=r.precision>0),s}function Aue(){const e=new Cue,t=n8(At.WEBGL1,e);return N(t)||(e.supportsElementIndexUint=t.getExtension("OES_element_index_uint")!==null,e.supportsStandardDerivatives=t.getExtension("OES_standard_derivatives")!==null,e.supportsInstancedArrays=t.getExtension("ANGLE_instanced_arrays")!==null,e.supportsTextureFloat=t.getExtension("OES_texture_float")!==null,e.supportsTextureHalfFloat=t.getExtension("OES_texture_half_float")!==null,e.supportsColorBufferFloat=t.getExtension("WEBGL_color_buffer_float")!==null,e.supportsColorBufferFloatBlend=t.getExtension("EXT_float_blend")!==null,e.supportsColorBufferHalfFloat=t.getExtension("EXT_color_buffer_half_float")!==null),e}function Oue(){const e=new Pue,t=n8(At.WEBGL2,e);return N(t)||(e.supportsColorBufferFloat=t.getExtension("EXT_color_buffer_float")!==null,e.supportsColorBufferFloatBlend=t.getExtension("EXT_float_blend")!==null,e.supportsColorBufferHalfFloat=e.supportsColorBufferFloat||t.getExtension("EXT_color_buffer_half_float")!==null),e}function Rue(e){const t=Iue(e);if(!t.available)return new L("webgl:required","WebGL is required but not supported.");if(e==="3d"&&t.majorPerformanceCaveat)return new L("webgl:major-performance-caveat-detected","Your WebGL implementation doesn't seem to support hardware accelerated rendering. Check your browser settings or if your GPU is in a blocklist.");if(!t.supportsHighPrecisionFragment)return new L("webgl:high-precision-fragment-required","WebGL support for high precision fragment shaders is required but not supported.");if(!t.supportsVertexShaderSamplers)return new L("webgl:vertex-shader-samplers-required","WebGL support for vertex shader samplers is required but not supported.");if(t.type===At.WEBGL1){if(!t.supportsElementIndexUint)return new L("webgl:element-index-uint-required","WebGL support for uint vertex indices is required but not supported.");if(!t.supportsStandardDerivatives)return new L("webgl:standard-derivatives-required","WebGL support for standard derivatives is required but not supported.");if(!t.supportsInstancedArrays)return new L("webgl:instanced-arrays-required","WebGL support for instanced rendering is required but not supported.")}return null}function Lue(e){return e&&"nodeType"in e}function Fue(e){return e&&typeof e.render=="function"}const PA={component:"esri-component"};let hc=class extends oe{constructor(){super(...arguments),this.widget=null}destroy(){this.widget&&this.widget.destroy(),this.node=null}get id(){return this.get("widget.id")||this.get("node.id")}set node(e){const t=this._get("node");e!==t&&(e&&e.classList.add(PA.component),t&&t.classList.remove(PA.component),this._set("node",e))}castNode(e){return e?typeof e=="string"||Lue(e)?(this._set("widget",null),r$(e)):(Fue(e)&&!e.domNode&&(e.domNode=document.createElement("div")),this._set("widget",e),e.domNode):(this._set("widget",null),null)}};c([h({dependsOn:[]})],hc.prototype,"id",null),c([h()],hc.prototype,"node",null),c([Oe("node")],hc.prototype,"castNode",null),c([h({readOnly:!0})],hc.prototype,"widget",void 0),hc=c([S("esri.views.ui.Component")],hc);const y0=hc,Due={left:0,top:0,bottom:0,right:0},o8={bottom:30,top:15,right:15,left:15},Hw="manual",Ri={ui:"esri-ui",corner:"esri-ui-corner",innerContainer:"esri-ui-inner-container",manualContainer:"esri-ui-manual-container",cornerContainer:"esri-ui-corner-container",topLeft:"esri-ui-top-left",topRight:"esri-ui-top-right",bottomLeft:"esri-ui-bottom-left",bottomRight:"esri-ui-bottom-right"};function Nue(e){return e&&!e._started&&typeof e.postMixInProperties=="function"&&typeof e.buildRendering=="function"&&typeof e.postCreate=="function"&&typeof e.startup=="function"}function Yw(e){const t=e,i=typeof t=="object"&&t!==null&&Object.getPrototypeOf(t);return(i===null||i===Object.prototype)&&("component"in t||"index"in t||"position"in t)?e:null}function Jw(e,{top:t,bottom:i,left:s,right:r}){e.style.top=t,e.style.bottom=i,e.style.left=s,e.style.right=r}let uo=class extends jo.EventedAccessor{constructor(e){super(e),this._cornerNameToContainerLookup={},this._positionNameToContainerLookup={},this._components=new Array,this._componentToKey=new Map,this._handles=new qi,this.view=null,this._applyViewPadding=()=>{const t=this.container;t&&Jw(t,this._toPxPosition(this._getViewPadding()))},this._applyUIPadding=()=>{const t=this._innerContainer;t&&Jw(t,this._toPxPosition(this.padding))},this._initContainers()}initialize(){this._handles.add([Z(()=>{var e;return[(e=this.view)==null?void 0:e.padding,this.container]},this._applyViewPadding,Le),Z(()=>this.padding,this._applyUIPadding,Le)])}destroy(){this.container=null;for(const e of this._components)e.destroy();this._components.length=0,this._handles.destroy(),this._componentToKey.clear()}set container(e){const t=this._get("container");e!==t&&(e&&(e.classList.add(Ri.ui),RK(e),this._attachContainers(e)),t&&(t.classList.remove(Ri.ui),Jw(t,{top:"",bottom:"",left:"",right:""}),CR(t)),this._set("container",e))}get height(){const e=this.get("view.height")||0;if(e===0)return e;const t=this._getViewPadding(),i=t.top+t.bottom;return Math.max(e-i,0)}get padding(){return this._get("padding")}set padding(e){this._overrideIfSome("padding",e)}castPadding(e){return typeof e=="number"?{bottom:e,top:e,right:e,left:e}:{...o8,...e}}get width(){const e=this.get("view.width")||0;if(e===0)return e;const t=this._getViewPadding(),i=t.left+t.right;return Math.max(e-i,0)}add(e,t){let i,s;if(Array.isArray(e))return void e.forEach(n=>this.add(n,t));const r=Yw(e);r&&({index:i,position:t,component:e,key:s}=r),t&&typeof t=="object"&&({index:i,key:s,position:t}=t),!e||t&&!this._isValidPosition(t)||this._add(e,t,i,s)}remove(e,t){if(!e)return;if(Array.isArray(e))return e.map(s=>this.remove(s,t));const i=this._find(e);if(i){const s=this._componentToKey;if(s.has(e)&&s.get(e)!==t)return;const r=this._components.indexOf(i);return i.node.parentNode&&i.node.parentNode.removeChild(i.node),this._componentToKey.delete(e),this._components.splice(r,1)[0]}}empty(e){return Array.isArray(e)?e.map(t=>this.empty(t)).reduce((t,i)=>t.concat(i)):(e=e||Hw)===Hw?Array.prototype.slice.call(this._manualContainer.children).filter(t=>!t.classList.contains(Ri.corner)).map(t=>this.remove(t)):this._isValidPosition(e)?Array.prototype.slice.call(this._cornerNameToContainerLookup[e].children).map(this.remove,this):null}move(e,t){if(Array.isArray(e)&&e.forEach(n=>this.move(n,t)),!e)return;let i;const s=Yw(e)||Yw(t);if(s&&(i=s.index,t=s.position,e=s.component||e),t&&!this._isValidPosition(t))return;const r=this.remove(e);r&&this.add(r,{position:t,index:i})}find(e){if(!e)return null;const t=this._findById(e);return t&&(t.widget||t.node)}getPosition(e){for(const t in this._positionNameToContainerLookup)if(this._positionNameToContainerLookup[t].contains(e))return t;return null}_add(e,t,i,s){e instanceof y0||(e=new y0({node:e})),this._place({component:e,position:t,index:i}),this._components.push(e),s&&this._componentToKey.set(e,s)}_find(e){return e?e instanceof y0?this._findByComponent(e):typeof e=="string"?this._findById(e):this._findByNode(e.domNode||e):null}_getViewPadding(){return this.get("view.padding")||Due}_attachContainers(e){e.appendChild(this._innerContainer),e.appendChild(this._manualContainer)}_initContainers(){const e=document.createElement("div");e.classList.add(Ri.innerContainer),e.classList.add(Ri.cornerContainer);const t=document.createElement("div");t.classList.add(Ri.innerContainer),t.classList.add(Ri.manualContainer);const i=document.createElement("div");i.classList.add(Ri.topLeft),i.classList.add(Ri.corner),e.appendChild(i);const s=document.createElement("div");s.classList.add(Ri.topRight),s.classList.add(Ri.corner),e.appendChild(s);const r=document.createElement("div");r.classList.add(Ri.bottomLeft),r.classList.add(Ri.corner),e.appendChild(r);const n=document.createElement("div");n.classList.add(Ri.bottomRight),n.classList.add(Ri.corner),e.appendChild(n),this._innerContainer=e,this._manualContainer=t;const o=xn();this._cornerNameToContainerLookup={"top-left":i,"top-right":s,"bottom-left":r,"bottom-right":n,"top-leading":o?s:i,"top-trailing":o?i:s,"bottom-leading":o?n:r,"bottom-trailing":o?r:n},this._positionNameToContainerLookup={manual:t,...this._cornerNameToContainerLookup}}_isValidPosition(e){return!!this._positionNameToContainerLookup[e]}_place(e){const t=e.component,i=e.position||Hw,s=e.index,r=this._positionNameToContainerLookup[i],n=s>-1;if(Nue(t.widget)&&t.widget.startup(),!n)return void r.appendChild(t.node);const o=Array.prototype.slice.call(r.children);if(s===0)return void(r.firstChild?dE(t.node,r.firstChild):r.appendChild(t.node));s>=o.length?r.appendChild(t.node):dE(t.node,o[s])}_toPxPosition(e){return{top:this._toPxUnit(e.top),left:this._toPxUnit(e.left),right:this._toPxUnit(e.right),bottom:this._toPxUnit(e.bottom)}}_toPxUnit(e){return e===0?"0":e+"px"}_findByComponent(e){let t,i=null;return this._components.some(s=>(t=s===e,t&&(i=s),t)),i}_findById(e){let t,i=null;return this._components.some(s=>(t=s.id===e,t&&(i=s),t)),i}_findByNode(e){let t,i=null;return this._components.some(s=>(t=s.node===e,t&&(i=s),t)),i}};c([h()],uo.prototype,"container",null),c([h()],uo.prototype,"height",null),c([h({value:o8})],uo.prototype,"padding",null),c([Oe("padding")],uo.prototype,"castPadding",null),c([h()],uo.prototype,"view",void 0),c([h()],uo.prototype,"width",null),uo=c([S("esri.views.ui.UI")],uo);const jue=uo;function AA(e,t){return e&&"copyright"in e&&(!t||typeof e.originOf=="function"&&e.originOf("copyright")==="user")}function Vue(e,t){return e.length!==t.length||e.some((i,s)=>i.text!==t[s].text)}function Xy(e,t,i){!i||!t||e.find(s=>s.layerView===t&&s.text===i)||e.push({text:i,layerView:t})}function zue(e){return e.type==="bing-maps"}const ta=[];let lh=class extends yv{constructor(e){super(e),this._clear=()=>{this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.handles.remove("suspension"),this.notifyChange("state")},this._pendingAttributions=new Set,this._fetchedAttributionData=new Map,this.items=new he,this.view=null,this._allLayerViewsChange=t=>{this.handles.remove("suspension");const i=this.get("view.allLayerViews");i&&this.handles.add(i.map(s=>Z(()=>{var r;return[s.suspended,(r=s.layer)==null?void 0:r.attributionVisible]},()=>this._updateAttributionItems())),"suspension"),t&&t.removed&&t.removed.forEach(s=>{this._pendingAttributions.delete(s),this._fetchedAttributionData.delete(s)}),this._updateAttributionItems()},this.handles.add([Is(()=>{var t;return(t=this.view)==null?void 0:t.allLayerViews},"change",t=>this._allLayerViewsChange(t),{onListenerAdd:()=>this._allLayerViewsChange(),onListenerRemove:this._clear}),Qs(()=>{var t;return((t=this.view)==null?void 0:t.stationary)===!0},()=>this._updateAttributionItems())])}destroy(){this.view=null,this._fetchedAttributionData.clear(),this._pendingAttributions.clear(),this.items.removeAll()}get state(){return this.get("view.ready")?this._pendingAttributions.size>0?"loading":"ready":"disabled"}_updateAttributionItems(){const e=this.get("view.allLayerViews");ta.length=0,e?(e.forEach(t=>{var r;if(t.suspended||!((r=t.layer)!=null&&r.attributionVisible))return;const i=t.layer;if(AA(i,"user"))return void Xy(ta,t,i.copyright);if(i.hasAttributionData){if(this._fetchedAttributionData.has(t)){const n=this._fetchedAttributionData.get(t);return void(n?Xy(ta,t,this._getDynamicAttribution(n,this.view,i)):AA(i)&&Xy(ta,t,i.copyright))}return void this._fetchAttributionData(t)}const s=i.get("portalItem.accessInformation");Xy(ta,t,s||i.copyright)}),Vue(this.items,ta)&&(this.items.removeAll(),this.items.addMany(ta)),ta.length=0,this.notifyChange("state")):this._clear()}async _fetchAttributionData(e){if(this._pendingAttributions.has(e))return;this._pendingAttributions.add(e);const t=await xb(e.layer.fetchAttributionData());if(this._pendingAttributions.has(e)){const i=t.ok?this._createContributionIndex(t.value,zue(e.layer)):null;this._pendingAttributions.delete(e),this._fetchedAttributionData.set(e,i)}this._updateAttributionItems()}_createContributionIndex(e,t){const i=e.contributors,s={};if(!i)return s;for(let r=0;r{const d=!l[u.id]&&a&&_b(u.extent,a);return d&&(l[u.id]=!0),d}).sort((u,d)=>d.score-u.score||u.objectId-d.objectId).map(u=>u.attribution).join(", "):""}};c([h({readOnly:!0,type:he})],lh.prototype,"items",void 0),c([h({readOnly:!0})],lh.prototype,"state",null),c([h()],lh.prototype,"view",void 0),lh=c([S("esri.widgets.Attribution.AttributionViewModel")],lh);const a8=lh,ia={base:"esri-attribution esri-widget",poweredBy:"esri-attribution__powered-by",sources:"esri-attribution__sources",open:"esri-attribution--open",sourcesOpen:"esri-attribution__sources--open",link:"esri-attribution__link",widgetIcon:"esri-icon-description",interactive:"esri-interactive"};let Ni=class extends yi{constructor(e,t){super(e,t),this._isOpen=!1,this._attributionTextOverflowed=!1,this._prevSourceNodeHeight=0,this._resizeObserver=new ResizeObserver(i=>i.forEach(({target:s})=>this._checkSourceTextOverflow(s))),this.iconClass=ia.widgetIcon,this.itemDelimiter=" | ",this.messages=null,this.viewModel=new a8}initialize(){this.addHandles(Is(()=>{var e;return(e=this.viewModel)==null?void 0:e.items},"change",()=>this.scheduleRender()))}destroy(){var e;(e=this._resizeObserver)==null||e.disconnect()}get _isInteractive(){return this._isOpen||this._attributionTextOverflowed}get attributionText(){return this.viewModel.items.reduce((e,t)=>(e.includes(t.text)||e.push(t.text),e),[]).join(this.itemDelimiter)}get label(){var e,t;return(t=(e=this.messages)==null?void 0:e.widgetLabel)!=null?t:""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}render(){const e={[ia.open]:this._isOpen};return P("div",{bind:this,class:this.classes(ia.base,e),dir:"ltr",onclick:this._toggleState,onkeydown:this._toggleState},this.renderSourcesNode(),this.renderPoweredBy())}renderPoweredBy(){return P("div",{class:ia.poweredBy},"Powered by"," ",P("a",{class:ia.link,href:"http://www.esri.com/",target:"_blank",rel:"noreferrer"},"Esri"))}renderSourcesNode(){const e=this._isOpen,t=this._isInteractive,i=t?"0":"",{attributionText:s}=this,r={[ia.sourcesOpen]:e,[ia.interactive]:t};return P("div",{afterCreate:this._afterSourcesNodeCreate,bind:this,class:this.classes(ia.sources,r),innerHTML:s,tabindex:i})}_afterSourcesNodeCreate(e){this._prevSourceNodeHeight=e.clientWidth,this._resizeObserver.observe(e)}_checkSourceTextOverflow(e){let t=!1;const{clientHeight:i,clientWidth:s,scrollWidth:r}=e,n=r>s,o=this._attributionTextOverflowed!==n;if(this._attributionTextOverflowed=n,o&&(t=!0),this._isOpen){const a=ithis.view,this._updateRotationWatcher,Le))}destroy(){this._handles=Bt(this._handles),this.view=null}get canShowNorth(){const e=this.get("view.spatialReference");return!(!e||!e.isWebMercator&&!e.isGeographic)}get state(){return this.get("view.ready")?this.canShowNorth?"compass":"rotation":"disabled"}reset(){if(!this.get("view.ready"))return;const e={};this.view.type==="2d"?e.rotation=0:e.heading=0,this.callGoTo({target:e})}_updateForRotation(e){e!=null&&(this.orientation={z:e})}_updateForCamera(e){if(!e)return;const t=-e.heading;this.orientation={x:0,y:0,z:t}}_updateRotationWatcher(e){this._handles.removeAll(),e&&this._handles.add(e.type==="2d"?Z(()=>e==null?void 0:e.rotation,this._updateForRotation,Le):Z(()=>e==null?void 0:e.camera,this._updateForCamera,Le))}};c([h({readOnly:!0})],dc.prototype,"canShowNorth",null),c([h()],dc.prototype,"orientation",void 0),c([h({readOnly:!0})],dc.prototype,"state",null),c([h()],dc.prototype,"view",void 0),dc=c([S(Uue)],dc);const l8=dc,sa={base:"esri-compass esri-widget--button esri-widget",text:"esri-icon-font-fallback-text",icon:"esri-compass__icon",rotationIcon:"esri-icon-dial",northIcon:"esri-icon-compass",widgetIcon:"esri-icon-locate-circled",interactive:"esri-interactive",disabled:"esri-disabled"};let hn=class extends yi{constructor(e,t){super(e,t),this.iconClass=sa.widgetIcon,this.messages=null,this.viewModel=new l8}get goToOverride(){return this.viewModel.goToOverride}set goToOverride(e){this.viewModel.goToOverride=e}get label(){var e,t;return(t=(e=this.messages)==null?void 0:e.widgetLabel)!=null?t:""}set label(e){this._overrideIfSome("label",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}reset(){return this.viewModel.reset()}render(){const{orientation:e,state:t}=this.viewModel,i=t==="disabled",s=(t==="rotation"?"rotation":"compass")=="compass",r=i?-1:0,n={[sa.disabled]:i,[sa.interactive]:!i},o={[sa.northIcon]:s,[sa.rotationIcon]:!s},{messages:a}=this;return P("div",{bind:this,class:this.classes(sa.base,n),onclick:this._reset,onkeydown:this._reset,role:"button",tabIndex:r,"aria-label":a.reset,title:a.reset},P("span",{"aria-hidden":"true",class:this.classes(sa.icon,o),styles:this._toRotationTransform(e)}),P("span",{class:sa.text},a.reset))}_reset(){this.viewModel.reset()}_toRotationTransform(e){return{transform:`rotateZ(${e.z}deg)`}}};c([h()],hn.prototype,"goToOverride",null),c([h()],hn.prototype,"iconClass",void 0),c([h()],hn.prototype,"label",null),c([h(),di("esri/widgets/Compass/t9n/Compass")],hn.prototype,"messages",void 0),c([h()],hn.prototype,"view",null),c([h({type:l8})],hn.prototype,"viewModel",void 0),c([xs()],hn.prototype,"_reset",null),hn=c([S("esri.widgets.Compass")],hn);const que=hn;let ch=class extends oe{constructor(e){super(e),this.navigationMode="pan",this.view=null}initialize(){this.own(Qs(()=>{var e;return(e=this.view)==null?void 0:e.inputManager},()=>this._setNavigationMode()))}destroy(){this.view=null}get state(){return this.get("view.ready")&&this.view.type==="3d"?"ready":"disabled"}toggle(){this.state!=="disabled"&&(this.navigationMode=this.navigationMode!=="pan"?"pan":"rotate",this._setNavigationMode())}_setNavigationMode(){this.get("view.inputManager").primaryDragAction=this.navigationMode==="pan"?"pan":"rotate"}};c([h({readOnly:!0})],ch.prototype,"state",null),c([h()],ch.prototype,"navigationMode",void 0),c([h()],ch.prototype,"view",void 0),ch=c([S("esri.widgets.NavigationToggleViewModel")],ch);const c8=ch,Os={base:"esri-navigation-toggle esri-widget",button:"esri-navigation-toggle__button esri-widget--button",activeButton:"esri-navigation-toggle__button--active",panButton:"esri-navigation-toggle__button--pan",rotateButton:"esri-navigation-toggle__button--rotate",isLayoutHorizontal:"esri-navigation-toggle--horizontal",rotationIcon:"esri-icon-rotate",panIcon:"esri-icon-pan",widgetIcon:"esri-icon-pan2",disabled:"esri-disabled"};let dn=class extends yi{constructor(e,t){super(e,t),this.iconClass=Os.widgetIcon,this.messages=null,this.viewModel=new c8}get label(){var e,t;return(t=(e=this.messages)==null?void 0:e.widgetLabel)!=null?t:""}set label(e){this._overrideIfSome("label",e)}set layout(e){e!=="horizontal"&&(e="vertical"),this._set("layout",e)}get view(){return this.viewModel.view}set view(e){this.viewModel.view=e}toggle(){return this.viewModel.toggle()}render(){const e=this.get("viewModel.state")==="disabled",t=this.get("viewModel.navigationMode")==="pan",i={[Os.disabled]:e,[Os.isLayoutHorizontal]:this.layout==="horizontal"},s={[Os.activeButton]:t},r={[Os.activeButton]:!t},n=e?-1:0,o=this.messages.toggle;return P("div",{bind:this,class:this.classes(Os.base,i),onclick:this._toggle,onkeydown:this._toggle,tabIndex:n,"aria-label":o,title:o},P("div",{class:this.classes(Os.button,Os.panButton,s)},P("span",{class:Os.panIcon})),P("div",{class:this.classes(Os.button,Os.rotateButton,r)},P("span",{class:Os.rotationIcon})))}_toggle(){this.toggle()}};c([h()],dn.prototype,"iconClass",void 0),c([h()],dn.prototype,"label",null),c([h({value:"vertical"})],dn.prototype,"layout",null),c([h(),di("esri/widgets/NavigationToggle/t9n/NavigationToggle")],dn.prototype,"messages",void 0),c([h()],dn.prototype,"view",null),c([h({type:c8})],dn.prototype,"viewModel",void 0),c([xs()],dn.prototype,"_toggle",null),dn=c([S("esri.widgets.NavigationToggle")],dn);const Gue=dn,Hd={button:"esri-widget--button esri-widget",disabled:"esri-disabled",interactive:"esri-interactive",iconText:"esri-icon-font-fallback-text",icon:"esri-icon"};let ka=class extends yi{constructor(){super(...arguments),this.enabled=!0,this.iconClass="",this.title=""}render(){const e=this.enabled?0:-1,t={[Hd.disabled]:!this.enabled,[Hd.interactive]:this.enabled},i={[this.iconClass]:!!this.iconClass};return P("div",{bind:this,class:this.classes(Hd.button,t),onclick:this._triggerAction,onkeydown:this._triggerAction,role:"button",tabIndex:e,title:this.title},P("span",{"aria-hidden":"true",role:"presentation",class:this.classes(Hd.icon,i)}),P("span",{class:Hd.iconText},this.title))}_triggerAction(){this.action.call(this)}};c([h()],ka.prototype,"action",void 0),c([h()],ka.prototype,"enabled",void 0),c([h()],ka.prototype,"iconClass",void 0),c([h()],ka.prototype,"title",void 0),c([xs()],ka.prototype,"_triggerAction",null),ka=c([S("esri.widgets.IconButton")],ka);const OA=ka;let uh=class extends oe{get canZoomIn(){if(!this.get("view.ready"))return!1;const e=this.get("view.animation.target.scale")||this.get("view.scale"),t=this.get("view.constraints.effectiveMaxScale");return t===0||e>t}get canZoomOut(){if(!this.get("view.ready"))return!1;const e=this.get("view.animation.target.scale")||this.get("view.scale"),t=this.get("view.constraints.effectiveMinScale");return t===0||ethis.components,this._componentsWatcher.bind(this),Le),Z(()=>this.view,this._updateViewAwareWidgets.bind(this),Le)])}_add(e,t,i,s){if(typeof e=="string"&&this._defaultPositionLookup[e]){if(this._find(e))return;e=this._createComponent(e)}super._add(e,t,i,s)}_removeComponents(e){e.forEach(t=>{const i=this._find(t);i&&(this.remove(i),i.destroy())})}_updateViewAwareWidgets(e){this.components.forEach(t=>{const i=this._find(t),s=i&&i.widget;Jue(s)&&(s.view=e)})}_componentsWatcher(e,t){this._removeComponents(t),this._addComponents(e),this._adjustPadding(e)}_adjustPadding(e){if(!e.includes("attribution")&&!this._isOverridden("padding")){const{top:t}=this.padding;this.padding=t}}_addComponents(e){this.constructed&&e.forEach(t=>this.add(this._createComponent(t),this._defaultPositionLookup[t]))}_createComponent(e){const t=this._createWidget(e);if(t)return new y0({id:e,node:t})}_createWidget(e){return e==="attribution"?this._createAttribution():e==="compass"?this._createCompass():e==="navigation-toggle"?this._createNavigationToggle():e==="zoom"?this._createZoom():void 0}_createAttribution(){return new Bue({view:this.view})}_createCompass(){return new que({view:this.view})}_createNavigationToggle(){return new Gue({view:this.view})}_createZoom(){return new Yue({view:this.view})}};c([h()],g0.prototype,"components",void 0),g0=c([S("esri.views.ui.DefaultUI")],g0);const Xue=g0;let v0=class extends Xue{constructor(e){super(e),this.components=["attribution","zoom"]}};c([h()],v0.prototype,"components",void 0),v0=c([S("esri.views.ui.2d.DefaultUI2D")],v0);const h8=v0;var mM;let b0=mM=class extends W{constructor(e){super(e),this.color=new pe([0,0,0,1])}clone(){return new mM(R({color:this.color}))}};c([h({type:pe,json:{write:!0}})],b0.prototype,"color",void 0),b0=mM=c([S("esri.webmap.background.ColorBackground")],b0);const Zue=b0;let d8,p8,f8,m8,y8,g8;async function Que(){const[,{GraphicsView2D:e,GraphicContainer:t,LabelManager:i,MapViewNavigation:s,MagnifierView2D:r,Stage:n}]=await Promise.all([z(()=>import("./webglDeps.e3ffc164.js"),["assets/webglDeps.e3ffc164.js","assets/VertexArrayObject.53cf1857.js","assets/Texture.940076b2.js","assets/enums.2d9e6f64.js","assets/ProgramTemplate.cf9dd4e8.js","assets/programUtils.10ecfb8b.js"]),z(()=>import("./mapViewDeps.692d211f.js"),["assets/mapViewDeps.692d211f.js","assets/_commonjsHelpers.773c2c82.js","assets/imageutils.5e4d6270.js","assets/utils.0160becb.js","assets/Utils.2136650a.js","assets/enums.0295eb81.js","assets/enums.2d9e6f64.js","assets/Texture.940076b2.js","assets/VertexElementDescriptor.1fdca6da.js","assets/MaterialKey.0cadabc1.js","assets/BufferPool.98277e4b.js","assets/WGLContainer.347cc5cd.js","assets/pixelUtils.9c6f8dae.js","assets/VertexArrayObject.53cf1857.js","assets/ProgramTemplate.cf9dd4e8.js","assets/StyleDefinition.d56936e4.js","assets/config.82550349.js","assets/GeometryUtils.51c4032a.js","assets/earcut.afc1d357.js","assets/enums.54326430.js","assets/programUtils.10ecfb8b.js","assets/RenderingContext.8853f4cd.js","assets/OrderIndependentTransparency.4d1575c0.js","assets/floatRGBA.3f71f8e9.js","assets/ExpandedCIM.a372ce74.js","assets/BidiEngine.d8bba3fc.js","assets/Rect.95b0fd2e.js","assets/quantizationUtils.7ff797cc.js","assets/GeometryUtils.4f19e772.js","assets/rasterizingUtils.ec7fabe7.js","assets/Matcher.6586928a.js","assets/visualVariablesUtils.061b7a4e.js","assets/visualVariablesUtils.62efda9d.js","assets/tileUtils.332711ed.js","assets/TileClipper.77103a2e.js","assets/Geometry.d049a63c.js","assets/devEnvironmentUtils.d8d0484c.js","assets/CircularArray.62f75f43.js","assets/imageUtils.753f41b1.js","assets/ComputedAttributeStorage.29767acd.js","assets/centroid.06db4b74.js","assets/BaseGraphicContainer.7704bbc1.js","assets/normalizeUtilsSync.4d52fbd0.js","assets/projectionSupport.4f5da4af.js","assets/json.879c9adc.js","assets/FeatureContainer.b427dd87.js","assets/TileContainer.5aeb32d6.js","assets/schemaUtils.d20994fa.js","assets/createSymbolSchema.827eb617.js","assets/util.520a352e.js","assets/vec3f32.1121a836.js","assets/GraphicContainer.b0be80ad.js","assets/requestImageUtils.1f5d4b6d.js"])]);p8=e,f8=t,m8=i,y8=s,g8=r,d8=n}const RA=160;function Kue(e){return e&&e.declaredClass==="esri.Viewpoint"}let ve=class extends NQ(tae(iae($ae))){constructor(e){super(e),this._magnifierView=null,this._stage=null,this._resolveWhenReady=[],this.rootLayerViews=new im({getCollections:()=>{var t,i;return[(t=this.basemapView)==null?void 0:t.baseLayerViews,this.layerViews,(i=this.basemapView)==null?void 0:i.referenceLayerViews]},getChildrenFunction:()=>null}),this.featuresTilingScheme=null,this.fullOpacity=1,this.graphicsView=null,this.labelManager=null,this.mapViewNavigation=null,this.renderingOptions={samplingMode:"dynamic",edgeLabelsVisible:!0,labelsAnimationTime:125,labelCollisionsEnabled:!0},this.rendering=!1,this.supersampleScreenshotsEnabled=!1,this.supportsGround=!1,this._stationaryTimer=null,this.frameTask=new kle(this),this._pePromise=null,this.floors=new he,this.highlightOptions=new Kj,this.inputManager=new iue({view:this}),this.map=null,this.resizeAlign="center",this.spatialReferenceLocked=!1,this.timeline=new e8,this.type="2d",this.ui=new h8,this._pixelFormat={flipY:!0,premultipliedAlpha:!0},this.constraints=new Vj,this.padding={top:0,right:0,bottom:0,left:0},this.handles.add([Z(()=>this.viewpoint,()=>{this._lastStationaryEventTimestamp=performance.now(),this._flipStationary(RA)},Nh),this.on("resize",t=>this._resizeHandler(t)),Z(()=>{var t;return(t=this.animationManager)==null?void 0:t.animation},t=>{this.animation=t})]),OQ()}destroy(){this._set("preconditionsReady",!1),this._gotoTask=this.frameTask=null,this.rootLayerViews.destroy(),this.inputManager.destroy(),this._set("inputManager",null)}get graphicsTileStore(){return new lue(this.featuresTilingScheme)}get initialExtentRequired(){var o;const{scale:e,constraints:t,center:i,viewpoint:s,extent:r}=this;let n=this.zoom;return!(this.map&&"initialViewProperties"in this.map&&((o=this.map.initialViewProperties)==null?void 0:o.viewpoint))&&!r&&(t!=null&&t.effectiveLODs||(n=-1),(!i||e===0&&n===-1)&&(!s||!M(s.targetGeometry)||s.targetGeometry.type!=="extent"&&!s.scale))}get resourceManager(){return this._stage.resourceManager}get textureManager(){return this._stage.painter.textureManager}get _defaultsFromMapSettings(){return{required:{tileInfo:!0,heightModelInfo:!1,extent:!1},requiresExtentInSpatialReference:this.spatialReferenceLocked}}get _projectionEngineLoaded(){return!!ol()||(this._pePromise||(this._pePromise=al().finally(()=>{this._pePromise=null})),!1)}get typeSpecificPreconditionsReady(){const e=this._getDefaultViewpoint();if(!e)return!1;const t=this.spatialReference,i=e.targetGeometry;return!!Ro(i.spatialReference,t)||this._projectionEngineLoaded}set animation(e){const t=this._get("animation");if(e===t)return;if(t&&t.stop(),!e||e.isFulfilled())return void this._set("animation",null);this._set("animation",e),this.frameTask.animationInProgress=!0;const i=()=>{var s;e===this._get("animation")&&(this._set("animation",null),(s=this.frameTask)==null||s.requestFrame()),this.frameTask&&(this.frameTask.animationInProgress=!1)};e.when(i,i)}get background(){return the(this.map)?this.map.initialViewProperties.background:null}set background(e){this._override("background",e)}get center(){if(!this.ready)return this._get("center");const{center:e,spatialReference:t}=this.state.paddedViewState;return new be({x:e[0],y:e[1],spatialReference:t})}set center(e){if(e==null)return;if(!this.ready)return this._set("center",e),void this.notifyChange("initialExtentRequired");let t;try{t=this._project(e,this.spatialReference)}catch(s){return void q.getLogger(this.declaredClass).error(new L("mapview:invalid-center","could not project the value in the view's spatial reference",{input:e,error:s}))}const i=this.viewpoint;aM(i,i,t),this.viewpoint=i}set constraints(e){const t=this._get("constraints");t&&(this.handles.remove("map-view-constraints"),t.destroy()),this._set("constraints",e),e&&(e.view=this,this.ready&&(this.state.viewpoint=e.fit(this.state.paddedViewState.viewpoint)),this.handles.add(Z(()=>e.version,()=>{this.ready&&this.state&&(this.state.viewpoint=e.fit(this.state.paddedViewState.viewpoint))},Nh),"map-view-constraints"))}get extent(){return this.ready?this.state.paddedViewState.extent.clone():this._get("extent")}set extent(e){if(e==null)return;if(!e.width||!e.height)return void q.getLogger(this.declaredClass).error(new L("mapview:invalid-extent","invalid extent size"));if(!this.ready)return this._set("extent",e),this._set("center",null),this._set("viewpoint",null),this._set("scale",0),this._set("zoom",-1),void this.notifyChange("initialExtentRequired");let t;try{t=this._project(e,this.spatialReference)}catch(s){return void q.getLogger(this.declaredClass).error(new L("mapview:invalid-extent","could not project the value in the view's spatial reference",{error:s}))}const i=this.viewpoint;ple(i,i,t,this.size,{constraints:this.constraints}),this.viewpoint=i}get padding(){return this.ready?this.state.padding:this._get("padding")}set padding(e){this.ready?(this.state.padding=e,this._set("padding",this.state.padding)):this._set("padding",e)}get resolution(){return this.state?this.state.resolution:0}get rotation(){return this.ready?this.state.rotation:this._get("rotation")}set rotation(e){if(isNaN(e))return;if(!this.ready)return void this._set("rotation",e);const t=this.viewpoint;$le(t,t,e),this.viewpoint=t}get scale(){return this.ready?this.state.scale:this._get("scale")}set scale(e){if(!e||isNaN(e))return;if(!this.ready){this._set("scale",e),this._set("zoom",-1);const i=this._get("extent");return i&&(this._set("extent",null),this._set("center",i.center)),void this.notifyChange("initialExtentRequired")}const t=this.viewpoint;uA(t,t,e),this.viewpoint=t}get stationary(){return!(this.animation||this.navigating||this.resizing||this._stationaryTimer)}get updating(){var t,i,s;const e=!this.destroyed&&(!this.layerViewManager||!this.labelManager||!this.graphicsView||this.layerViewManager.updating===!0||this.labelManager.updating===!0||this.graphicsView.updating===!0||this.allLayerViews.some(r=>!r.destroyed&&!("layerViews"in r)&&r.updating===!0));if(V("esri-2d-log-updating")){const r=this.allLayerViews.reduce((n,o)=>({...n,[o.layer.id]:!o.destroyed&&!("layerViews"in o)&&o.updating}),{});console.log(`Updating MapView: ${e} -> Null LayerViewManager: ${!this.layerViewManager} -> Null LabelManager: ${!this.labelManager} -> Null GraphicsView: ${!this.graphicsView} @@ -101,7 +101,7 @@ var D6=Object.defineProperty;var N6=(e,t,i)=>t in e?D6(e,t,{enumerable:!0,config - Name + Data KMs Pace Tempo diff --git a/assets/jsonContext.3176ed6f.js b/assets/jsonContext.fe51f9bd.js similarity index 81% rename from assets/jsonContext.3176ed6f.js rename to assets/jsonContext.fe51f9bd.js index 7bc9412..cfddc46 100644 --- a/assets/jsonContext.3176ed6f.js +++ b/assets/jsonContext.fe51f9bd.js @@ -1 +1 @@ -import{bX as r,bW as e}from"./index.d94abe07.js";function l(t){return{origin:"portal-item",url:r(t.itemUrl),portal:t.portal||e.getDefault(),portalItem:t,readResourcePaths:[]}}function a(t){return{origin:"portal-item",messages:[],writtenProperties:[],url:t.itemUrl?r(t.itemUrl):null,portal:t.portal||e.getDefault(),portalItem:t}}export{l as e,a as o}; +import{bX as r,bW as e}from"./index.221827cd.js";function l(t){return{origin:"portal-item",url:r(t.itemUrl),portal:t.portal||e.getDefault(),portalItem:t,readResourcePaths:[]}}function a(t){return{origin:"portal-item",messages:[],writtenProperties:[],url:t.itemUrl?r(t.itemUrl):null,portal:t.portal||e.getDefault(),portalItem:t}}export{l as e,a as o}; diff --git a/assets/kmlUtils.abf45fa2.js b/assets/kmlUtils.3e458b80.js similarity index 97% rename from assets/kmlUtils.abf45fa2.js rename to assets/kmlUtils.3e458b80.js index ab3610b..0adc287 100644 --- a/assets/kmlUtils.abf45fa2.js +++ b/assets/kmlUtils.3e458b80.js @@ -1 +1 @@ -import{b4 as p,dS as h,dT as I,F as k,U as w,dU as P,dV as S,dW as d,dX as m,dY as x,aT as v,d3 as E,dw as F,dv as O}from"./index.d94abe07.js";const M={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function j(r){const s=r.folders||[],t=s.slice(),e=new Map,n=new Map,i=new Map,f=new Map,c=new Map,l={esriGeometryPoint:n,esriGeometryPolyline:i,esriGeometryPolygon:f};(r.featureCollection&&r.featureCollection.layers||[]).forEach(o=>{const y=p(o);y.featureSet.features=[];const a=o.featureSet.geometryType;e.set(a,y);const g=o.layerDefinition.objectIdField;a==="esriGeometryPoint"?G(n,g,o.featureSet.features):a==="esriGeometryPolyline"?G(i,g,o.featureSet.features):a==="esriGeometryPolygon"&&G(f,g,o.featureSet.features)}),r.groundOverlays&&r.groundOverlays.forEach(o=>{c.set(o.id,o)}),s.forEach(o=>{o.networkLinkIds.forEach(y=>{const a=C(y,o.id,r.networkLinks);a&&t.push(a)})}),t.forEach(o=>{if(o.featureInfos){o.points=p(e.get("esriGeometryPoint")),o.polylines=p(e.get("esriGeometryPolyline")),o.polygons=p(e.get("esriGeometryPolygon")),o.mapImages=[];for(const y of o.featureInfos)switch(y.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const a=l[y.type].get(y.id);a&&o[M[y.type]].featureSet.features.push(a);break}case"GroundOverlay":{const a=c.get(y.id);a&&o.mapImages.push(a);break}}o.fullExtent=b([o])}});const u=b(t);return{folders:s,sublayers:t,extent:u}}function J(r,s,t,e){const n=h&&h.findCredential(r);r=I(r,{token:n&&n.token});const i=k.kmlServiceUrl;return w(i,{query:{url:r,model:"simple",folders:"",refresh:t!==0||void 0,outSR:JSON.stringify(s)},responseType:"json",signal:e})}function L(r,s,t=null,e=[]){const n=[],i={},f=s.sublayers,c=s.folders.map(l=>l.id);return f.forEach(l=>{const u=new r;if(t?u.read(l,t):u.read(l),e.length&&c.includes(u.id)&&(u.visible=e.includes(u.id)),i[l.id]=u,l.parentFolderId!=null&&l.parentFolderId!==-1){const o=i[l.parentFolderId];o.sublayers||(o.sublayers=[]),o.sublayers.unshift(u)}else n.unshift(u)}),n}function G(r,s,t){t.forEach(e=>{r.set(e.attributes[s],e)})}function T(r,s){let t;return s.some(e=>e.id===r&&(t=e,!0)),t}function C(r,s,t){const e=T(r,t);return e&&(e.parentFolderId=s,e.networkLink=e),e}async function N(r){const s=E.fromJSON(r.featureSet).features,t=r.layerDefinition,e=F(t.drawingInfo.renderer),n=O.fromJSON(r.popupInfo),i=[];for(const f of s){const c=await e.getSymbolAsync(f);f.symbol=c,f.popupTemplate=n,f.visible=!0,i.push(f)}return i}function b(r){const s=P(S),t=P(S);for(const e of r){if(e.polygons&&e.polygons.featureSet&&e.polygons.featureSet.features)for(const n of e.polygons.featureSet.features)d(s,n.geometry),m(t,s);if(e.polylines&&e.polylines.featureSet&&e.polylines.featureSet.features)for(const n of e.polylines.featureSet.features)d(s,n.geometry),m(t,s);if(e.points&&e.points.featureSet&&e.points.featureSet.features)for(const n of e.points.featureSet.features)d(s,n.geometry),m(t,s);if(e.mapImages)for(const n of e.mapImages)d(s,n.extent),m(t,s)}return x(t,S)?null:{xmin:t[0],ymin:t[1],zmin:t[2],xmax:t[3],ymax:t[4],zmax:t[5],spatialReference:v.WGS84}}export{L as S,N as b,j as d,J as g,b as j}; +import{b4 as p,dS as h,dT as I,F as k,U as w,dU as P,dV as S,dW as d,dX as m,dY as x,aT as v,d3 as E,dw as F,dv as O}from"./index.221827cd.js";const M={esriGeometryPoint:"points",esriGeometryPolyline:"polylines",esriGeometryPolygon:"polygons"};function j(r){const s=r.folders||[],t=s.slice(),e=new Map,n=new Map,i=new Map,f=new Map,c=new Map,l={esriGeometryPoint:n,esriGeometryPolyline:i,esriGeometryPolygon:f};(r.featureCollection&&r.featureCollection.layers||[]).forEach(o=>{const y=p(o);y.featureSet.features=[];const a=o.featureSet.geometryType;e.set(a,y);const g=o.layerDefinition.objectIdField;a==="esriGeometryPoint"?G(n,g,o.featureSet.features):a==="esriGeometryPolyline"?G(i,g,o.featureSet.features):a==="esriGeometryPolygon"&&G(f,g,o.featureSet.features)}),r.groundOverlays&&r.groundOverlays.forEach(o=>{c.set(o.id,o)}),s.forEach(o=>{o.networkLinkIds.forEach(y=>{const a=C(y,o.id,r.networkLinks);a&&t.push(a)})}),t.forEach(o=>{if(o.featureInfos){o.points=p(e.get("esriGeometryPoint")),o.polylines=p(e.get("esriGeometryPolyline")),o.polygons=p(e.get("esriGeometryPolygon")),o.mapImages=[];for(const y of o.featureInfos)switch(y.type){case"esriGeometryPoint":case"esriGeometryPolyline":case"esriGeometryPolygon":{const a=l[y.type].get(y.id);a&&o[M[y.type]].featureSet.features.push(a);break}case"GroundOverlay":{const a=c.get(y.id);a&&o.mapImages.push(a);break}}o.fullExtent=b([o])}});const u=b(t);return{folders:s,sublayers:t,extent:u}}function J(r,s,t,e){const n=h&&h.findCredential(r);r=I(r,{token:n&&n.token});const i=k.kmlServiceUrl;return w(i,{query:{url:r,model:"simple",folders:"",refresh:t!==0||void 0,outSR:JSON.stringify(s)},responseType:"json",signal:e})}function L(r,s,t=null,e=[]){const n=[],i={},f=s.sublayers,c=s.folders.map(l=>l.id);return f.forEach(l=>{const u=new r;if(t?u.read(l,t):u.read(l),e.length&&c.includes(u.id)&&(u.visible=e.includes(u.id)),i[l.id]=u,l.parentFolderId!=null&&l.parentFolderId!==-1){const o=i[l.parentFolderId];o.sublayers||(o.sublayers=[]),o.sublayers.unshift(u)}else n.unshift(u)}),n}function G(r,s,t){t.forEach(e=>{r.set(e.attributes[s],e)})}function T(r,s){let t;return s.some(e=>e.id===r&&(t=e,!0)),t}function C(r,s,t){const e=T(r,t);return e&&(e.parentFolderId=s,e.networkLink=e),e}async function N(r){const s=E.fromJSON(r.featureSet).features,t=r.layerDefinition,e=F(t.drawingInfo.renderer),n=O.fromJSON(r.popupInfo),i=[];for(const f of s){const c=await e.getSymbolAsync(f);f.symbol=c,f.popupTemplate=n,f.visible=!0,i.push(f)}return i}function b(r){const s=P(S),t=P(S);for(const e of r){if(e.polygons&&e.polygons.featureSet&&e.polygons.featureSet.features)for(const n of e.polygons.featureSet.features)d(s,n.geometry),m(t,s);if(e.polylines&&e.polylines.featureSet&&e.polylines.featureSet.features)for(const n of e.polylines.featureSet.features)d(s,n.geometry),m(t,s);if(e.points&&e.points.featureSet&&e.points.featureSet.features)for(const n of e.points.featureSet.features)d(s,n.geometry),m(t,s);if(e.mapImages)for(const n of e.mapImages)d(s,n.extent),m(t,s)}return x(t,S)?null:{xmin:t[0],ymin:t[1],zmin:t[2],xmax:t[3],ymax:t[4],zmax:t[5],spatialReference:v.WGS84}}export{L as S,N as b,j as d,J as g,b as j}; diff --git a/assets/labelFormatUtils.24133ce3.js b/assets/labelFormatUtils.1d67a85b.js similarity index 90% rename from assets/labelFormatUtils.24133ce3.js rename to assets/labelFormatUtils.1d67a85b.js index 6398bd2..3ce7d4b 100644 --- a/assets/labelFormatUtils.24133ce3.js +++ b/assets/labelFormatUtils.1d67a85b.js @@ -1 +1 @@ -import{s as y,ks as m,at as w,kt as h,j as v,n as d,ku as b,gA as x,kv as _,kw as k,kx as E}from"./index.d94abe07.js";const p=y.getLogger("esri.layers.support.labelFormatUtils"),g={type:"simple",evaluate:()=>null},F={getAttribute:(a,s)=>a.field(s)};async function A(a,s,e){if(!a||!a.symbol)return g;const n=a.where,u=m(a),o=n?await w(()=>import("./WhereClause.253310fe.js"),["assets/WhereClause.253310fe.js","assets/index.d94abe07.js","assets/index.f5419ca5.css"]):null;let i;if(u.type==="arcade"){const r=await h(u.expression,e,s);if(v(r))return g;i={type:"arcade",evaluate(l){try{const t=r.evaluate({$feature:"attributes"in l?r.repurposeFeature(l):l});if(t!=null)return t.toString()}catch{p.error(new d("arcade-expression-error","Encountered an error when evaluating label expression for feature",{feature:l,expression:u}))}return null},needsHydrationToEvaluate:()=>k(u.expression)==null}}else i={type:"simple",evaluate:r=>u.expression.replace(/{[^}]*}/g,l=>{const t=l.slice(1,-1),c=s.get(t);if(!c)return l;let f=null;return"attributes"in r?r&&r.attributes&&(f=r.attributes[c.name]):f=r.field(c.name),f==null?"":V(f,c)})};if(n){let r;try{r=o.WhereClause.create(n,s)}catch(t){return p.error(new d("bad-where-clause","Encountered an error when evaluating where clause, ignoring",{where:n,error:t})),g}const l=i.evaluate;i.evaluate=t=>{const c="attributes"in t?void 0:F;try{if(r.testFeature(t,c))return l(t)}catch(f){p.error(new d("bad-where-clause","Encountered an error when evaluating where clause for feature",{where:n,feature:t,error:f}))}return null}}return i}function V(a,s){if(a==null)return"";const e=s.domain;if(e){if(e.type==="codedValue"||e.type==="coded-value"){const u=a;for(const o of e.codedValues)if(o.code===u)return o.name}else if(e.type==="range"){const u=+a,o="range"in e?e.range[0]:e.minValue,i="range"in e?e.range[1]:e.maxValue;if(o<=u&&u<=i)return e.name}}let n=a;return s.type==="date"||s.type==="esriFieldTypeDate"?n=b(n,E("short-date")):x(s)&&(n=_(+n)),n||""}export{A as createLabelFunction,V as formatField}; +import{s as y,ks as m,at as w,kt as h,j as v,n as d,ku as b,gA as x,kv as _,kw as k,kx as E}from"./index.221827cd.js";const p=y.getLogger("esri.layers.support.labelFormatUtils"),g={type:"simple",evaluate:()=>null},F={getAttribute:(a,s)=>a.field(s)};async function A(a,s,e){if(!a||!a.symbol)return g;const n=a.where,u=m(a),o=n?await w(()=>import("./WhereClause.5b749615.js"),["assets/WhereClause.5b749615.js","assets/index.221827cd.js","assets/index.f5419ca5.css"]):null;let i;if(u.type==="arcade"){const r=await h(u.expression,e,s);if(v(r))return g;i={type:"arcade",evaluate(l){try{const t=r.evaluate({$feature:"attributes"in l?r.repurposeFeature(l):l});if(t!=null)return t.toString()}catch{p.error(new d("arcade-expression-error","Encountered an error when evaluating label expression for feature",{feature:l,expression:u}))}return null},needsHydrationToEvaluate:()=>k(u.expression)==null}}else i={type:"simple",evaluate:r=>u.expression.replace(/{[^}]*}/g,l=>{const t=l.slice(1,-1),c=s.get(t);if(!c)return l;let f=null;return"attributes"in r?r&&r.attributes&&(f=r.attributes[c.name]):f=r.field(c.name),f==null?"":V(f,c)})};if(n){let r;try{r=o.WhereClause.create(n,s)}catch(t){return p.error(new d("bad-where-clause","Encountered an error when evaluating where clause, ignoring",{where:n,error:t})),g}const l=i.evaluate;i.evaluate=t=>{const c="attributes"in t?void 0:F;try{if(r.testFeature(t,c))return l(t)}catch(f){p.error(new d("bad-where-clause","Encountered an error when evaluating where clause for feature",{where:n,feature:t,error:f}))}return null}}return i}function V(a,s){if(a==null)return"";const e=s.domain;if(e){if(e.type==="codedValue"||e.type==="coded-value"){const u=a;for(const o of e.codedValues)if(o.code===u)return o.name}else if(e.type==="range"){const u=+a,o="range"in e?e.range[0]:e.minValue,i="range"in e?e.range[1]:e.maxValue;if(o<=u&&u<=i)return e.name}}let n=a;return s.type==="date"||s.type==="esriFieldTypeDate"?n=b(n,E("short-date")):x(s)&&(n=_(+n)),n||""}export{A as createLabelFunction,V as formatField}; diff --git a/assets/layersCreator.eb921b3a.js b/assets/layersCreator.67b651fa.js similarity index 93% rename from assets/layersCreator.eb921b3a.js rename to assets/layersCreator.67b651fa.js index 6b4ef23..b07042a 100644 --- a/assets/layersCreator.eb921b3a.js +++ b/assets/layersCreator.67b651fa.js @@ -1 +1 @@ -import{cB as g,cC as f,cD as G,cE as m}from"./index.d94abe07.js";import{a as L}from"./lazyLayerLoader.f961f278.js";import{selectLayerClassPath as M}from"./portalLayers.8fee158d.js";import"./layersLoader.67118e89.js";import"./jsonContext.3176ed6f.js";import"./portalItemUtils.57ded807.js";function A(e){return p(e,"notes")}function v(e){return p(e,"markup")}function w(e){return p(e,"route")}function p(e,r){return!(!e.layerType||e.layerType!=="ArcGISFeatureLayer")&&e.featureCollectionType===r}async function b(e,r,a){if(!r)return;const y=[];for(const t of r){const i=h(t,a);t.layerType==="GroupLayer"?y.push(E(i,t,a)):y.push(i)}const n=await g(y);for(const t of n)!t.value||a.filter&&!a.filter(t.value)||e.add(t.value)}const W={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",PointCloudLayer:"PointCloudLayer",ArcGISSceneServiceLayer:"SceneLayer",IntegratedMeshLayer:"IntegratedMeshLayer",OGCFeatureLayer:"OGCFeatureLayer",BuildingSceneLayer:"BuildingSceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",GroupLayer:"GroupLayer",GeoJSON:"GeoJSONLayer",WebTiledLayer:"WebTileLayer",CSV:"CSVLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer",LineOfSightLayer:"LineOfSightLayer"},F={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},C={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",DefaultTileLayer:"TileLayer"},O={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},V={ArcGISFeatureLayer:"FeatureLayer"},B={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WebTiledLayer:"WebTileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer"};async function h(e,r){return D(await U(e,r),e,r)}async function D(e,r,a){const y=new e;return y.read(r,a.context),y.type==="group"&&d(r)&&await k(y,r,a.context),await f(y,a.context),y}async function U(e,r){const a=r.context,y=x(a);let n=e.layerType||e.type;!n&&r&&r.defaultLayerType&&(n=r.defaultLayerType);const t=y[n];let i=t?L[t]:L.UnknownLayer;if(T(e)){const s=a==null?void 0:a.portal;if(e.itemId){const o=new G({id:e.itemId,portal:s});await o.load();const c=(await M(o)).className||"UnknownLayer";i=L[c]}}else n==="ArcGISFeatureLayer"?A(e)||v(e)?i=L.MapNotesLayer:w(e)?i=L.RouteLayer:d(e)&&(i=L.GroupLayer):e.wmtsInfo&&e.wmtsInfo.url&&e.wmtsInfo.layerIdentifier?i=L.WMTSLayer:n==="WFS"&&e.wfsInfo.version!=="2.0.0"&&(i=L.UnsupportedLayer);return i()}function d(e){var r,a,y;return e.layerType!=="ArcGISFeatureLayer"||T(e)?!1:((y=(a=(r=e.featureCollection)==null?void 0:r.layers)==null?void 0:a.length)!=null?y:0)>1}function T(e){return e.type==="Feature Collection"}function x(e){let r;if(e.origin==="web-scene")switch(e.layerContainerType){case"basemap":r=C;break;case"ground":r=F;break;default:r=W}else switch(e.layerContainerType){case"basemap":r=B;break;case"tables":r=V;break;default:r=O}return r}async function E(e,r,a){const y=new m,n=b(y,Array.isArray(r.layers)?r.layers:[],a),t=await e;if(await n,t.type==="group")return t.layers.addMany(y),t}async function k(e,r,a){const y=L.FeatureLayer,n=await y(),t=r.featureCollection,i=t.showLegend,s=t.layers.map((o,c)=>{var S,I;const l=new n;l.read(o,a);const u={...a,ignoreDefaults:!0};return l.read({id:`${e.id}-sublayer-${c}`,visibility:(I=(S=r.visibleLayers)==null?void 0:S.includes(c))!=null?I:!0},u),i!=null&&l.read({showLegend:i},u),l});e.layers.addMany(s)}export{b as populateOperationalLayers}; +import{cB as g,cC as f,cD as G,cE as m}from"./index.221827cd.js";import{a as L}from"./lazyLayerLoader.4d2df2af.js";import{selectLayerClassPath as M}from"./portalLayers.72750f56.js";import"./layersLoader.afdddce2.js";import"./jsonContext.fe51f9bd.js";import"./portalItemUtils.92eef7f6.js";function A(e){return p(e,"notes")}function v(e){return p(e,"markup")}function w(e){return p(e,"route")}function p(e,r){return!(!e.layerType||e.layerType!=="ArcGISFeatureLayer")&&e.featureCollectionType===r}async function b(e,r,a){if(!r)return;const y=[];for(const t of r){const i=h(t,a);t.layerType==="GroupLayer"?y.push(E(i,t,a)):y.push(i)}const n=await g(y);for(const t of n)!t.value||a.filter&&!a.filter(t.value)||e.add(t.value)}const W={ArcGISDimensionLayer:"DimensionLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",PointCloudLayer:"PointCloudLayer",ArcGISSceneServiceLayer:"SceneLayer",IntegratedMeshLayer:"IntegratedMeshLayer",OGCFeatureLayer:"OGCFeatureLayer",BuildingSceneLayer:"BuildingSceneLayer",ArcGISTiledElevationServiceLayer:"ElevationLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",GroupLayer:"GroupLayer",GeoJSON:"GeoJSONLayer",WebTiledLayer:"WebTileLayer",CSV:"CSVLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer",KML:"KMLLayer",RasterDataLayer:"UnsupportedLayer",Voxel:"VoxelLayer",LineOfSightLayer:"LineOfSightLayer"},F={ArcGISTiledElevationServiceLayer:"ElevationLayer",DefaultTileLayer:"ElevationLayer",RasterDataElevationLayer:"UnsupportedLayer"},C={ArcGISTiledMapServiceLayer:"TileLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",OpenStreetMap:"OpenStreetMapLayer",WebTiledLayer:"WebTileLayer",VectorTileLayer:"VectorTileLayer",ArcGISImageServiceLayer:"UnsupportedLayer",WMS:"UnsupportedLayer",ArcGISMapServiceLayer:"UnsupportedLayer",DefaultTileLayer:"TileLayer"},O={ArcGISAnnotationLayer:"UnsupportedLayer",ArcGISDimensionLayer:"UnsupportedLayer",ArcGISFeatureLayer:"FeatureLayer",ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISStreamLayer:"StreamLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",CSV:"CSVLayer",DefaultTileLayer:"TileLayer",GeoRSS:"GeoRSSLayer",GeoJSON:"GeoJSONLayer",GroupLayer:"GroupLayer",KML:"KMLLayer",OGCFeatureLayer:"OGCFeatureLayer",OrientedImageryLayer:"OrientedImageryLayer",SubtypeGroupLayer:"SubtypeGroupLayer",VectorTileLayer:"VectorTileLayer",WFS:"WFSLayer",WMS:"WMSLayer",WebTiledLayer:"WebTileLayer"},V={ArcGISFeatureLayer:"FeatureLayer"},B={ArcGISImageServiceLayer:"ImageryLayer",ArcGISImageServiceVectorLayer:"ImageryLayer",ArcGISMapServiceLayer:"MapImageLayer",ArcGISTiledImageServiceLayer:"ImageryTileLayer",ArcGISTiledMapServiceLayer:"TileLayer",OpenStreetMap:"OpenStreetMapLayer",VectorTileLayer:"VectorTileLayer",WebTiledLayer:"WebTileLayer",BingMapsAerial:"BingMapsLayer",BingMapsRoad:"BingMapsLayer",BingMapsHybrid:"BingMapsLayer",WMS:"WMSLayer",DefaultTileLayer:"TileLayer"};async function h(e,r){return D(await U(e,r),e,r)}async function D(e,r,a){const y=new e;return y.read(r,a.context),y.type==="group"&&d(r)&&await k(y,r,a.context),await f(y,a.context),y}async function U(e,r){const a=r.context,y=x(a);let n=e.layerType||e.type;!n&&r&&r.defaultLayerType&&(n=r.defaultLayerType);const t=y[n];let i=t?L[t]:L.UnknownLayer;if(T(e)){const s=a==null?void 0:a.portal;if(e.itemId){const o=new G({id:e.itemId,portal:s});await o.load();const c=(await M(o)).className||"UnknownLayer";i=L[c]}}else n==="ArcGISFeatureLayer"?A(e)||v(e)?i=L.MapNotesLayer:w(e)?i=L.RouteLayer:d(e)&&(i=L.GroupLayer):e.wmtsInfo&&e.wmtsInfo.url&&e.wmtsInfo.layerIdentifier?i=L.WMTSLayer:n==="WFS"&&e.wfsInfo.version!=="2.0.0"&&(i=L.UnsupportedLayer);return i()}function d(e){var r,a,y;return e.layerType!=="ArcGISFeatureLayer"||T(e)?!1:((y=(a=(r=e.featureCollection)==null?void 0:r.layers)==null?void 0:a.length)!=null?y:0)>1}function T(e){return e.type==="Feature Collection"}function x(e){let r;if(e.origin==="web-scene")switch(e.layerContainerType){case"basemap":r=C;break;case"ground":r=F;break;default:r=W}else switch(e.layerContainerType){case"basemap":r=B;break;case"tables":r=V;break;default:r=O}return r}async function E(e,r,a){const y=new m,n=b(y,Array.isArray(r.layers)?r.layers:[],a),t=await e;if(await n,t.type==="group")return t.layers.addMany(y),t}async function k(e,r,a){const y=L.FeatureLayer,n=await y(),t=r.featureCollection,i=t.showLegend,s=t.layers.map((o,c)=>{var S,I;const l=new n;l.read(o,a);const u={...a,ignoreDefaults:!0};return l.read({id:`${e.id}-sublayer-${c}`,visibility:(I=(S=r.visibleLayers)==null?void 0:S.includes(c))!=null?I:!0},u),i!=null&&l.read({showLegend:i},u),l});e.layers.addMany(s)}export{b as populateOperationalLayers}; diff --git a/assets/layersLoader.67118e89.js b/assets/layersLoader.afdddce2.js similarity index 97% rename from assets/layersLoader.67118e89.js rename to assets/layersLoader.afdddce2.js index 3a76fff..0f4a7db 100644 --- a/assets/layersLoader.67118e89.js +++ b/assets/layersLoader.afdddce2.js @@ -1 +1 @@ -import{U as T,n as c,cC as S,bW as F,cF as f,cD as G,cG as j}from"./index.d94abe07.js";import{e as D}from"./jsonContext.3176ed6f.js";import{s as M}from"./portalItemUtils.57ded807.js";async function b(e){const{data:r}=await T(e,{responseType:"json",query:{f:"json"}});return r}async function P(e,r){const t=e.instance.portalItem;if(t&&t.id)return await t.load(r),x(e),C(e,r)}function x(e){const r=e.instance.portalItem;if(!e.supportedTypes.includes(r.type))throw new c("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:r.type,expectedType:e.supportedTypes.join(", ")})}async function C(e,r){const t=e.instance,a=t.portalItem,{url:n,title:l}=a,o=D(a);if(t.type==="group")return t.read({title:l},o),O(t,e);n&&t.read({url:n},o);const i=await g(e,r);return i&&t.read(i,o),t.resourceReferences={portalItem:a,paths:o.readResourcePaths},t.type!=="subtype-group"&&t.read({title:l},o),S(t,o)}function O(e,r){var i;let t;const a=e.portalItem.type,n=r.layerModuleTypeMap,l=(i=M(e.portalItem,"Oriented Imagery Layer"))!=null?i:!1;switch(a){case"Feature Service":t=l?n.OrientedImageryLayer:n.FeatureLayer;break;case"Stream Service":t=n.StreamLayer;break;case"Scene Service":t=n.SceneLayer;break;case"Feature Collection":t=n.FeatureLayer;break;default:throw new c("portal:unsupported-item-type-as-group",`The item type '${a}' is not supported as a 'IGroupLayer'`)}let o;return t().then(s=>(o=s,g(r))).then(async s=>{let u=()=>o;if(a==="Feature Service"){if(d(s=await h(s,e.portalItem.url)).length){const v=n.SubtypeGroupLayer,w=await v();u=L=>L.layerType==="SubtypeGroupLayer"?w:o}return y(e,u,s)}return p(s)>0?y(e,u,s):$(e,u)})}function $(e,r){return e.portalItem.url?b(e.portalItem.url).then(t=>{var n,l;function a(o){return{id:o.id,name:o.name}}t&&y(e,r,{layers:(n=t.layers)==null?void 0:n.map(a),tables:(l=t.tables)==null?void 0:l.map(a)})}):Promise.resolve()}function y(e,r,t){let a=t.layers||[];const n=t.tables||[];if(e.portalItem.type==="Feature Collection"&&(a.forEach(l=>{var o;((o=l==null?void 0:l.layerDefinition)==null?void 0:o.type)==="Table"&&n.push(l)}),a=a.filter(l=>{var o;return((o=l==null?void 0:l.layerDefinition)==null?void 0:o.type)!=="Table"})),"coverage"in t){const l=_(t);e.add(l)}a.reverse().forEach(l=>{const o=m(e,r(l),t,l);e.add(o)}),n.reverse().forEach(l=>{const o=m(e,r(l),t,l);e.tables.add(o)})}function m(e,r,t,a){const n=new r({portalItem:e.portalItem.clone(),layerId:a.id});if(n.type!=="subtype-group"&&(n.sublayerTitleMode="service-name"),e.portalItem.type==="Feature Collection"){const l={origin:"portal-item",portal:e.portalItem.portal||F.getDefault()};n.read(a,l);const o=t.showLegend;o!=null&&n.read({showLegend:o},l)}return n}function g(e,r){if(e.supportsData===!1)return Promise.resolve(void 0);const t=e.instance;return t.portalItem.fetchData("json",r).catch(()=>null).then(a=>{if(E(t)){let n,l=!0;if(a&&p(a)>0){if(t.layerId==null){const o=d(a);t.layerId=t.type==="subtype-group"?o==null?void 0:o[0]:I(a)}n=k(a,t),n&&(p(a)===1&&(l=!1),a.showLegend!=null&&(n.showLegend=a.showLegend))}return l&&t.sublayerTitleMode!=="service-name"&&(t.sublayerTitleMode="item-title-and-service-name"),n}return a})}async function h(e,r){if((e==null?void 0:e.layers)==null||(e==null?void 0:e.tables)==null){const t=await b(r);(e=e||{}).layers=e.layers||(t==null?void 0:t.layers),e.tables=e.tables||(t==null?void 0:t.tables)}return e}function I(e){const r=e.layers;if(r&&r.length)return r[0].id;const t=e.tables;return t&&t.length?t[0].id:null}function k(e,r){var n,l;const{layerId:t}=r,a=((n=e.layers)==null?void 0:n.find(o=>o.id===t))||((l=e.tables)==null?void 0:l.find(o=>o.id===t));return a&&R(a,r)?a:null}function p(e){var r,t,a,n;return((t=(r=e==null?void 0:e.layers)==null?void 0:r.length)!=null?t:0)+((n=(a=e==null?void 0:e.tables)==null?void 0:a.length)!=null?n:0)}function E(e){return e.type!=="stream"&&e.type!=="oriented-imagery"&&"layerId"in e}function _(e){const{coverage:r}=e;if(!r)return null;const t=new URL(r);if(r.toLowerCase().includes("item.html")){const a=t.searchParams.get("id"),n=t.origin;return f.fromPortalItem({portalItem:new G({id:a,url:n})})}if(j(r))return f.fromArcGISServerUrl({url:r});throw new c("portal:oriented-imagery-layer-coverage","the provided coverage url couldn't be loaded as a layer")}function d(e){var t;const r=[];return(t=e==null?void 0:e.layers)==null||t.forEach(a=>{a.layerType==="SubtypeGroupLayer"&&r.push(a.id)}),r}function R(e,r){return!(r.type==="feature"&&"layerType"in e&&e.layerType==="SubtypeGroupLayer"||r.type==="subtype-group"&&!("layerType"in e))}var z=Object.freeze(Object.defineProperty({__proto__:null,getFirstLayerOrTableId:I,getNumLayersAndTables:p,getSubtypeGroupLayerIds:d,load:P,preprocessFSItemData:h},Symbol.toStringTag,{value:"Module"}));export{d as T,h as b,I as g,z as l,b as n,p as w}; +import{U as T,n as c,cC as S,bW as F,cF as f,cD as G,cG as j}from"./index.221827cd.js";import{e as D}from"./jsonContext.fe51f9bd.js";import{s as M}from"./portalItemUtils.92eef7f6.js";async function b(e){const{data:r}=await T(e,{responseType:"json",query:{f:"json"}});return r}async function P(e,r){const t=e.instance.portalItem;if(t&&t.id)return await t.load(r),x(e),C(e,r)}function x(e){const r=e.instance.portalItem;if(!e.supportedTypes.includes(r.type))throw new c("portal:invalid-layer-item-type","Invalid layer item type '${type}', expected '${expectedType}'",{type:r.type,expectedType:e.supportedTypes.join(", ")})}async function C(e,r){const t=e.instance,a=t.portalItem,{url:n,title:l}=a,o=D(a);if(t.type==="group")return t.read({title:l},o),O(t,e);n&&t.read({url:n},o);const i=await g(e,r);return i&&t.read(i,o),t.resourceReferences={portalItem:a,paths:o.readResourcePaths},t.type!=="subtype-group"&&t.read({title:l},o),S(t,o)}function O(e,r){var i;let t;const a=e.portalItem.type,n=r.layerModuleTypeMap,l=(i=M(e.portalItem,"Oriented Imagery Layer"))!=null?i:!1;switch(a){case"Feature Service":t=l?n.OrientedImageryLayer:n.FeatureLayer;break;case"Stream Service":t=n.StreamLayer;break;case"Scene Service":t=n.SceneLayer;break;case"Feature Collection":t=n.FeatureLayer;break;default:throw new c("portal:unsupported-item-type-as-group",`The item type '${a}' is not supported as a 'IGroupLayer'`)}let o;return t().then(s=>(o=s,g(r))).then(async s=>{let u=()=>o;if(a==="Feature Service"){if(d(s=await h(s,e.portalItem.url)).length){const v=n.SubtypeGroupLayer,w=await v();u=L=>L.layerType==="SubtypeGroupLayer"?w:o}return y(e,u,s)}return p(s)>0?y(e,u,s):$(e,u)})}function $(e,r){return e.portalItem.url?b(e.portalItem.url).then(t=>{var n,l;function a(o){return{id:o.id,name:o.name}}t&&y(e,r,{layers:(n=t.layers)==null?void 0:n.map(a),tables:(l=t.tables)==null?void 0:l.map(a)})}):Promise.resolve()}function y(e,r,t){let a=t.layers||[];const n=t.tables||[];if(e.portalItem.type==="Feature Collection"&&(a.forEach(l=>{var o;((o=l==null?void 0:l.layerDefinition)==null?void 0:o.type)==="Table"&&n.push(l)}),a=a.filter(l=>{var o;return((o=l==null?void 0:l.layerDefinition)==null?void 0:o.type)!=="Table"})),"coverage"in t){const l=_(t);e.add(l)}a.reverse().forEach(l=>{const o=m(e,r(l),t,l);e.add(o)}),n.reverse().forEach(l=>{const o=m(e,r(l),t,l);e.tables.add(o)})}function m(e,r,t,a){const n=new r({portalItem:e.portalItem.clone(),layerId:a.id});if(n.type!=="subtype-group"&&(n.sublayerTitleMode="service-name"),e.portalItem.type==="Feature Collection"){const l={origin:"portal-item",portal:e.portalItem.portal||F.getDefault()};n.read(a,l);const o=t.showLegend;o!=null&&n.read({showLegend:o},l)}return n}function g(e,r){if(e.supportsData===!1)return Promise.resolve(void 0);const t=e.instance;return t.portalItem.fetchData("json",r).catch(()=>null).then(a=>{if(E(t)){let n,l=!0;if(a&&p(a)>0){if(t.layerId==null){const o=d(a);t.layerId=t.type==="subtype-group"?o==null?void 0:o[0]:I(a)}n=k(a,t),n&&(p(a)===1&&(l=!1),a.showLegend!=null&&(n.showLegend=a.showLegend))}return l&&t.sublayerTitleMode!=="service-name"&&(t.sublayerTitleMode="item-title-and-service-name"),n}return a})}async function h(e,r){if((e==null?void 0:e.layers)==null||(e==null?void 0:e.tables)==null){const t=await b(r);(e=e||{}).layers=e.layers||(t==null?void 0:t.layers),e.tables=e.tables||(t==null?void 0:t.tables)}return e}function I(e){const r=e.layers;if(r&&r.length)return r[0].id;const t=e.tables;return t&&t.length?t[0].id:null}function k(e,r){var n,l;const{layerId:t}=r,a=((n=e.layers)==null?void 0:n.find(o=>o.id===t))||((l=e.tables)==null?void 0:l.find(o=>o.id===t));return a&&R(a,r)?a:null}function p(e){var r,t,a,n;return((t=(r=e==null?void 0:e.layers)==null?void 0:r.length)!=null?t:0)+((n=(a=e==null?void 0:e.tables)==null?void 0:a.length)!=null?n:0)}function E(e){return e.type!=="stream"&&e.type!=="oriented-imagery"&&"layerId"in e}function _(e){const{coverage:r}=e;if(!r)return null;const t=new URL(r);if(r.toLowerCase().includes("item.html")){const a=t.searchParams.get("id"),n=t.origin;return f.fromPortalItem({portalItem:new G({id:a,url:n})})}if(j(r))return f.fromArcGISServerUrl({url:r});throw new c("portal:oriented-imagery-layer-coverage","the provided coverage url couldn't be loaded as a layer")}function d(e){var t;const r=[];return(t=e==null?void 0:e.layers)==null||t.forEach(a=>{a.layerType==="SubtypeGroupLayer"&&r.push(a.id)}),r}function R(e,r){return!(r.type==="feature"&&"layerType"in e&&e.layerType==="SubtypeGroupLayer"||r.type==="subtype-group"&&!("layerType"in e))}var z=Object.freeze(Object.defineProperty({__proto__:null,getFirstLayerOrTableId:I,getNumLayersAndTables:p,getSubtypeGroupLayerIds:d,load:P,preprocessFSItemData:h},Symbol.toStringTag,{value:"Module"}));export{d as T,h as b,I as g,z as l,b as n,p as w}; diff --git a/assets/lazyLayerLoader.4d2df2af.js b/assets/lazyLayerLoader.4d2df2af.js new file mode 100644 index 0000000..55a8aaf --- /dev/null +++ b/assets/lazyLayerLoader.4d2df2af.js @@ -0,0 +1 @@ +import{at as a}from"./index.221827cd.js";const e={BingMapsLayer:async()=>(await a(()=>import("./BingMapsLayer.057bb977.js"),["assets/BingMapsLayer.057bb977.js","assets/index.221827cd.js","assets/index.f5419ca5.css"])).default,BuildingSceneLayer:async()=>(await a(()=>import("./BuildingSceneLayer.73877459.js"),["assets/BuildingSceneLayer.73877459.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/FetchAssociatedFeatureLayer.f6cbad39.js","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/quat.d9562009.js","assets/quatf64.4ae3e6f1.js","assets/I3SBinaryReader.2f855706.js","assets/VertexAttribute.42396f25.js","assets/symbolColorUtils.36aaa708.js","assets/vec3f32.1121a836.js","assets/plane.444b53ce.js","assets/sphere.f99ddb50.js","assets/SceneService.9c2e5b40.js","assets/originUtils.2d0aad75.js","assets/multiOriginJSONSupportUtils.38b69b9c.js","assets/resourceUtils.f4b6e42a.js","assets/I3SLayerDefinitions.0127897b.js","assets/popupUtils.c6371f3a.js"])).default,CSVLayer:async()=>(await a(()=>import("./CSVLayer.f7ffeeb7.js"),["assets/CSVLayer.f7ffeeb7.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/clientSideDefaults.d40b9315.js","assets/QueryEngineCapabilities.78217f95.js"])).default,DimensionLayer:async()=>(await a(()=>import("./DimensionLayer.5b17861f.js"),["assets/DimensionLayer.5b17861f.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/Analysis.db10ad10.js"])).default,ElevationLayer:async()=>(await a(()=>import("./ElevationLayer.0f63abe9.js"),["assets/ElevationLayer.0f63abe9.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/ArcGISCachedService.a530cd26.js","assets/TilemapCache.b64a2ea8.js"])).default,FeatureLayer:async()=>(await a(()=>import("./index.221827cd.js").then(function(_){return _.l0}),["assets/index.221827cd.js","assets/index.f5419ca5.css"])).default,GroupLayer:async()=>(await a(()=>import("./GroupLayer.d2d54b11.js"),["assets/GroupLayer.d2d54b11.js","assets/index.221827cd.js","assets/index.f5419ca5.css"])).default,GeoRSSLayer:async()=>(await a(()=>import("./GeoRSSLayer.705a427d.js"),["assets/GeoRSSLayer.705a427d.js","assets/index.221827cd.js","assets/index.f5419ca5.css"])).default,GeoJSONLayer:async()=>(await a(()=>import("./GeoJSONLayer.980a83f3.js"),["assets/GeoJSONLayer.980a83f3.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/clientSideDefaults.d40b9315.js","assets/QueryEngineCapabilities.78217f95.js"])).default,ImageryLayer:async()=>(await a(()=>import("./ImageryLayer.e44f33f4.js"),["assets/ImageryLayer.e44f33f4.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/fetchRasterInfo.3f6af61b.js","assets/multidimensionalUtils.59c05ac5.js","assets/pixelUtils.9c6f8dae.js","assets/RasterSymbolizer.093b1748.js","assets/colorUtils.bb6424b7.js","assets/dataUtils.e7623e56.js","assets/generateRendererUtils.5c972fdb.js","assets/executeForIds.9f78e2a6.js"])).default,ImageryTileLayer:async()=>(await a(()=>import("./ImageryTileLayer.e6833128.js"),["assets/ImageryTileLayer.e6833128.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/fetchRasterInfo.3f6af61b.js","assets/multidimensionalUtils.59c05ac5.js","assets/pixelUtils.9c6f8dae.js","assets/RasterSymbolizer.093b1748.js","assets/colorUtils.bb6424b7.js","assets/dataUtils.e7623e56.js","assets/generateRendererUtils.5c972fdb.js","assets/RawBlockCache.e5f26f22.js","assets/rasterProjectionHelper.f3c10be2.js","assets/utils.bc3381b3.js","assets/TilemapCache.b64a2ea8.js"])).default,IntegratedMeshLayer:async()=>(await a(()=>import("./IntegratedMeshLayer.23dae716.js"),["assets/IntegratedMeshLayer.23dae716.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/persistable.6b292e5e.js","assets/multiOriginJSONSupportUtils.38b69b9c.js","assets/SceneService.9c2e5b40.js","assets/originUtils.2d0aad75.js","assets/resourceUtils.f4b6e42a.js","assets/I3SLayerDefinitions.0127897b.js"])).default,KMLLayer:async()=>(await a(()=>import("./KMLLayer.5fd7c195.js"),["assets/KMLLayer.5fd7c195.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/kmlUtils.3e458b80.js"])).default,LineOfSightLayer:async()=>(await a(()=>import("./LineOfSightLayer.d828be17.js"),["assets/LineOfSightLayer.d828be17.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/Analysis.db10ad10.js","assets/persistable.6b292e5e.js","assets/multiOriginJSONSupportUtils.38b69b9c.js"])).default,MapImageLayer:async()=>(await a(()=>import("./MapImageLayer.09c43a61.js"),["assets/MapImageLayer.09c43a61.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/scaleUtils.de5ad5a6.js","assets/SublayersOwner.fd9e3967.js","assets/Version.433fbe58.js","assets/sublayerUtils.59f5d9da.js","assets/ExportImageParameters.65ee285f.js","assets/floorFilterUtils.05eb8c6a.js"])).default,MapNotesLayer:async()=>(await a(()=>import("./MapNotesLayer.52447f2c.js"),["assets/MapNotesLayer.52447f2c.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/objectIdUtils.83ac3f67.js"])).default,OGCFeatureLayer:async()=>(await a(()=>import("./OGCFeatureLayer.c9b31254.js"),["assets/OGCFeatureLayer.c9b31254.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/ogcFeatureUtils.61a937b0.js","assets/geojson.7d18026b.js","assets/clientSideDefaults.d40b9315.js","assets/QueryEngineCapabilities.78217f95.js"])).default,OpenStreetMapLayer:async()=>(await a(()=>import("./OpenStreetMapLayer.959d4b15.js"),["assets/OpenStreetMapLayer.959d4b15.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/WebTileLayer.b038b70d.js"])).default,OrientedImageryLayer:async()=>(await a(()=>import("./OrientedImageryLayer.adb44f0f.js"),["assets/OrientedImageryLayer.adb44f0f.js","assets/index.221827cd.js","assets/index.f5419ca5.css"])).default,PointCloudLayer:async()=>(await a(()=>import("./PointCloudLayer.454ff7a9.js"),["assets/PointCloudLayer.454ff7a9.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/SceneService.9c2e5b40.js","assets/originUtils.2d0aad75.js","assets/multiOriginJSONSupportUtils.38b69b9c.js","assets/resourceUtils.f4b6e42a.js","assets/PointCloudUniqueValueRenderer.32cfad84.js"])).default,RouteLayer:async()=>(await a(()=>import("./RouteLayer.bee5d382.js"),["assets/RouteLayer.bee5d382.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/originUtils.2d0aad75.js","assets/multiOriginJSONSupportUtils.38b69b9c.js","assets/portalItemUtils.92eef7f6.js","assets/Stop.6862dd5a.js"])).default,SceneLayer:async()=>(await a(()=>import("./SceneLayer.4e29d3af.js"),["assets/SceneLayer.4e29d3af.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/SceneService.9c2e5b40.js","assets/originUtils.2d0aad75.js","assets/multiOriginJSONSupportUtils.38b69b9c.js","assets/resourceUtils.f4b6e42a.js","assets/FetchAssociatedFeatureLayer.f6cbad39.js","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/quat.d9562009.js","assets/quatf64.4ae3e6f1.js","assets/I3SBinaryReader.2f855706.js","assets/VertexAttribute.42396f25.js","assets/symbolColorUtils.36aaa708.js","assets/vec3f32.1121a836.js","assets/plane.444b53ce.js","assets/sphere.f99ddb50.js","assets/I3SLayerDefinitions.0127897b.js","assets/persistable.6b292e5e.js","assets/popupUtils.c6371f3a.js"])).default,StreamLayer:async()=>(await a(()=>import("./StreamLayer.ee7e4471.js"),["assets/StreamLayer.ee7e4471.js","assets/index.221827cd.js","assets/index.f5419ca5.css"])).default,SubtypeGroupLayer:async()=>(await a(()=>import("./SubtypeGroupLayer.76081822.js"),["assets/SubtypeGroupLayer.76081822.js","assets/index.221827cd.js","assets/index.f5419ca5.css"])).default,TileLayer:async()=>(await a(()=>import("./TileLayer.d3072542.js"),["assets/TileLayer.d3072542.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/ArcGISCachedService.a530cd26.js","assets/TilemapCache.b64a2ea8.js","assets/SublayersOwner.fd9e3967.js","assets/Version.433fbe58.js","assets/sublayerUtils.59f5d9da.js"])).default,UnknownLayer:async()=>(await a(()=>import("./UnknownLayer.5555c7bd.js"),["assets/UnknownLayer.5555c7bd.js","assets/index.221827cd.js","assets/index.f5419ca5.css"])).default,UnsupportedLayer:async()=>(await a(()=>import("./UnsupportedLayer.5a5fca4b.js"),["assets/UnsupportedLayer.5a5fca4b.js","assets/index.221827cd.js","assets/index.f5419ca5.css"])).default,VectorTileLayer:async()=>(await a(()=>import("./VectorTileLayer.1b238b34.js"),["assets/VectorTileLayer.1b238b34.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/ArcGISCachedService.a530cd26.js","assets/TilemapCache.b64a2ea8.js","assets/jsonContext.fe51f9bd.js","assets/StyleRepository.e426e44d.js","assets/StyleDefinition.d56936e4.js","assets/enums.0295eb81.js","assets/enums.54326430.js","assets/enums.2d9e6f64.js","assets/VertexElementDescriptor.1fdca6da.js","assets/colorUtils.bb6424b7.js","assets/GeometryUtils.4f19e772.js","assets/Geometry.d049a63c.js"])).default,VoxelLayer:async()=>(await a(()=>import("./VoxelLayer.733738ec.js"),["assets/VoxelLayer.733738ec.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/SceneService.9c2e5b40.js","assets/originUtils.2d0aad75.js","assets/multiOriginJSONSupportUtils.38b69b9c.js","assets/resourceUtils.f4b6e42a.js","assets/persistable.6b292e5e.js","assets/quat.d9562009.js","assets/mat3f64.6d32a1d7.js","assets/quatf64.4ae3e6f1.js"])).default,WebTileLayer:async()=>(await a(()=>import("./WebTileLayer.b038b70d.js").then(function(_){return _.W}),["assets/WebTileLayer.b038b70d.js","assets/index.221827cd.js","assets/index.f5419ca5.css"])).default,WFSLayer:async()=>(await a(()=>import("./WFSLayer.431b960b.js"),["assets/WFSLayer.431b960b.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/clientSideDefaults.d40b9315.js","assets/QueryEngineCapabilities.78217f95.js","assets/wfsUtils.6ba3d875.js","assets/geojson.7d18026b.js","assets/xmlUtils.56e603f6.js"])).default,WMSLayer:async()=>(await a(()=>import("./WMSLayer.5b9ad09d.js"),["assets/WMSLayer.5b9ad09d.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/scaleUtils.de5ad5a6.js","assets/crsUtils.daf46943.js","assets/ExportWMSImageParameters.013012f9.js"])).default,WMTSLayer:async()=>(await a(()=>import("./WMTSLayer.902b88c8.js"),["assets/WMTSLayer.902b88c8.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/WebTileLayer.b038b70d.js","assets/crsUtils.daf46943.js","assets/xmlUtils.56e603f6.js"])).default};export{e as a}; diff --git a/assets/lazyLayerLoader.f961f278.js b/assets/lazyLayerLoader.f961f278.js deleted file mode 100644 index 2164e2c..0000000 --- a/assets/lazyLayerLoader.f961f278.js +++ /dev/null @@ -1 +0,0 @@ -import{at as a}from"./index.d94abe07.js";const e={BingMapsLayer:async()=>(await a(()=>import("./BingMapsLayer.cc96b552.js"),["assets/BingMapsLayer.cc96b552.js","assets/index.d94abe07.js","assets/index.f5419ca5.css"])).default,BuildingSceneLayer:async()=>(await a(()=>import("./BuildingSceneLayer.0da55a35.js"),["assets/BuildingSceneLayer.0da55a35.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/FetchAssociatedFeatureLayer.7dd7fa59.js","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/quat.b3994f2f.js","assets/quatf64.4ae3e6f1.js","assets/I3SBinaryReader.9c0bbe1b.js","assets/VertexAttribute.42396f25.js","assets/symbolColorUtils.d5fe1bd7.js","assets/vec3f32.1121a836.js","assets/plane.86573aee.js","assets/sphere.ec1f4496.js","assets/SceneService.0f3bf01a.js","assets/originUtils.2d0aad75.js","assets/multiOriginJSONSupportUtils.38b69b9c.js","assets/resourceUtils.6d10bf82.js","assets/I3SLayerDefinitions.96f4da60.js","assets/popupUtils.4abb3ffd.js"])).default,CSVLayer:async()=>(await a(()=>import("./CSVLayer.ec8919b4.js"),["assets/CSVLayer.ec8919b4.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/clientSideDefaults.f5f7bfa0.js","assets/QueryEngineCapabilities.78217f95.js"])).default,DimensionLayer:async()=>(await a(()=>import("./DimensionLayer.dcd3110d.js"),["assets/DimensionLayer.dcd3110d.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/Analysis.0f84ef1d.js"])).default,ElevationLayer:async()=>(await a(()=>import("./ElevationLayer.7d5a34eb.js"),["assets/ElevationLayer.7d5a34eb.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/ArcGISCachedService.e7d85534.js","assets/TilemapCache.11964483.js"])).default,FeatureLayer:async()=>(await a(()=>import("./index.d94abe07.js").then(function(_){return _.l0}),["assets/index.d94abe07.js","assets/index.f5419ca5.css"])).default,GroupLayer:async()=>(await a(()=>import("./GroupLayer.04359856.js"),["assets/GroupLayer.04359856.js","assets/index.d94abe07.js","assets/index.f5419ca5.css"])).default,GeoRSSLayer:async()=>(await a(()=>import("./GeoRSSLayer.cfaccd23.js"),["assets/GeoRSSLayer.cfaccd23.js","assets/index.d94abe07.js","assets/index.f5419ca5.css"])).default,GeoJSONLayer:async()=>(await a(()=>import("./GeoJSONLayer.979b524a.js"),["assets/GeoJSONLayer.979b524a.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/clientSideDefaults.f5f7bfa0.js","assets/QueryEngineCapabilities.78217f95.js"])).default,ImageryLayer:async()=>(await a(()=>import("./ImageryLayer.f621acf5.js"),["assets/ImageryLayer.f621acf5.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/fetchRasterInfo.d4fdc8d4.js","assets/multidimensionalUtils.4f713da1.js","assets/pixelUtils.82950e1a.js","assets/RasterSymbolizer.4ee6ff2c.js","assets/colorUtils.bb6424b7.js","assets/dataUtils.0f9b810f.js","assets/generateRendererUtils.ebdde5b7.js","assets/executeForIds.bade5c1b.js"])).default,ImageryTileLayer:async()=>(await a(()=>import("./ImageryTileLayer.f9fb83b4.js"),["assets/ImageryTileLayer.f9fb83b4.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/fetchRasterInfo.d4fdc8d4.js","assets/multidimensionalUtils.4f713da1.js","assets/pixelUtils.82950e1a.js","assets/RasterSymbolizer.4ee6ff2c.js","assets/colorUtils.bb6424b7.js","assets/dataUtils.0f9b810f.js","assets/generateRendererUtils.ebdde5b7.js","assets/RawBlockCache.73929591.js","assets/rasterProjectionHelper.0a540f3d.js","assets/utils.9731fda2.js","assets/TilemapCache.11964483.js"])).default,IntegratedMeshLayer:async()=>(await a(()=>import("./IntegratedMeshLayer.3a48c634.js"),["assets/IntegratedMeshLayer.3a48c634.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/persistable.5f665309.js","assets/multiOriginJSONSupportUtils.38b69b9c.js","assets/SceneService.0f3bf01a.js","assets/originUtils.2d0aad75.js","assets/resourceUtils.6d10bf82.js","assets/I3SLayerDefinitions.96f4da60.js"])).default,KMLLayer:async()=>(await a(()=>import("./KMLLayer.c732c888.js"),["assets/KMLLayer.c732c888.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/kmlUtils.abf45fa2.js"])).default,LineOfSightLayer:async()=>(await a(()=>import("./LineOfSightLayer.a4d98e23.js"),["assets/LineOfSightLayer.a4d98e23.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/Analysis.0f84ef1d.js","assets/persistable.5f665309.js","assets/multiOriginJSONSupportUtils.38b69b9c.js"])).default,MapImageLayer:async()=>(await a(()=>import("./MapImageLayer.817bf3c0.js"),["assets/MapImageLayer.817bf3c0.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/scaleUtils.467c71f9.js","assets/SublayersOwner.8a52d000.js","assets/Version.59f2da65.js","assets/sublayerUtils.9d6cbcc3.js","assets/ExportImageParameters.0ebe2d44.js","assets/floorFilterUtils.05eb8c6a.js"])).default,MapNotesLayer:async()=>(await a(()=>import("./MapNotesLayer.0d53edee.js"),["assets/MapNotesLayer.0d53edee.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/objectIdUtils.83ac3f67.js"])).default,OGCFeatureLayer:async()=>(await a(()=>import("./OGCFeatureLayer.a08e7e0a.js"),["assets/OGCFeatureLayer.a08e7e0a.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/ogcFeatureUtils.ed8217a8.js","assets/geojson.8a0cb9d1.js","assets/clientSideDefaults.f5f7bfa0.js","assets/QueryEngineCapabilities.78217f95.js"])).default,OpenStreetMapLayer:async()=>(await a(()=>import("./OpenStreetMapLayer.0dc3f11e.js"),["assets/OpenStreetMapLayer.0dc3f11e.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/WebTileLayer.ab421225.js"])).default,OrientedImageryLayer:async()=>(await a(()=>import("./OrientedImageryLayer.928bb67a.js"),["assets/OrientedImageryLayer.928bb67a.js","assets/index.d94abe07.js","assets/index.f5419ca5.css"])).default,PointCloudLayer:async()=>(await a(()=>import("./PointCloudLayer.9b3b72ab.js"),["assets/PointCloudLayer.9b3b72ab.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/SceneService.0f3bf01a.js","assets/originUtils.2d0aad75.js","assets/multiOriginJSONSupportUtils.38b69b9c.js","assets/resourceUtils.6d10bf82.js","assets/PointCloudUniqueValueRenderer.345f2613.js"])).default,RouteLayer:async()=>(await a(()=>import("./RouteLayer.ab63e037.js"),["assets/RouteLayer.ab63e037.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/originUtils.2d0aad75.js","assets/multiOriginJSONSupportUtils.38b69b9c.js","assets/portalItemUtils.57ded807.js","assets/Stop.a3532add.js"])).default,SceneLayer:async()=>(await a(()=>import("./SceneLayer.46cfbdf5.js"),["assets/SceneLayer.46cfbdf5.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/SceneService.0f3bf01a.js","assets/originUtils.2d0aad75.js","assets/multiOriginJSONSupportUtils.38b69b9c.js","assets/resourceUtils.6d10bf82.js","assets/FetchAssociatedFeatureLayer.7dd7fa59.js","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/quat.b3994f2f.js","assets/quatf64.4ae3e6f1.js","assets/I3SBinaryReader.9c0bbe1b.js","assets/VertexAttribute.42396f25.js","assets/symbolColorUtils.d5fe1bd7.js","assets/vec3f32.1121a836.js","assets/plane.86573aee.js","assets/sphere.ec1f4496.js","assets/I3SLayerDefinitions.96f4da60.js","assets/persistable.5f665309.js","assets/popupUtils.4abb3ffd.js"])).default,StreamLayer:async()=>(await a(()=>import("./StreamLayer.aded61fe.js"),["assets/StreamLayer.aded61fe.js","assets/index.d94abe07.js","assets/index.f5419ca5.css"])).default,SubtypeGroupLayer:async()=>(await a(()=>import("./SubtypeGroupLayer.8fd2feb6.js"),["assets/SubtypeGroupLayer.8fd2feb6.js","assets/index.d94abe07.js","assets/index.f5419ca5.css"])).default,TileLayer:async()=>(await a(()=>import("./TileLayer.42bba12d.js"),["assets/TileLayer.42bba12d.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/ArcGISCachedService.e7d85534.js","assets/TilemapCache.11964483.js","assets/SublayersOwner.8a52d000.js","assets/Version.59f2da65.js","assets/sublayerUtils.9d6cbcc3.js"])).default,UnknownLayer:async()=>(await a(()=>import("./UnknownLayer.08ed3ee7.js"),["assets/UnknownLayer.08ed3ee7.js","assets/index.d94abe07.js","assets/index.f5419ca5.css"])).default,UnsupportedLayer:async()=>(await a(()=>import("./UnsupportedLayer.518b4e2c.js"),["assets/UnsupportedLayer.518b4e2c.js","assets/index.d94abe07.js","assets/index.f5419ca5.css"])).default,VectorTileLayer:async()=>(await a(()=>import("./VectorTileLayer.f3cc18bb.js"),["assets/VectorTileLayer.f3cc18bb.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/ArcGISCachedService.e7d85534.js","assets/TilemapCache.11964483.js","assets/jsonContext.3176ed6f.js","assets/StyleRepository.a1fecb1f.js","assets/StyleDefinition.d56936e4.js","assets/enums.0295eb81.js","assets/enums.54326430.js","assets/enums.2d9e6f64.js","assets/VertexElementDescriptor.1fdca6da.js","assets/colorUtils.bb6424b7.js","assets/GeometryUtils.4f19e772.js","assets/Geometry.d049a63c.js"])).default,VoxelLayer:async()=>(await a(()=>import("./VoxelLayer.50438218.js"),["assets/VoxelLayer.50438218.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/SceneService.0f3bf01a.js","assets/originUtils.2d0aad75.js","assets/multiOriginJSONSupportUtils.38b69b9c.js","assets/resourceUtils.6d10bf82.js","assets/persistable.5f665309.js","assets/quat.b3994f2f.js","assets/mat3f64.6d32a1d7.js","assets/quatf64.4ae3e6f1.js"])).default,WebTileLayer:async()=>(await a(()=>import("./WebTileLayer.ab421225.js").then(function(_){return _.W}),["assets/WebTileLayer.ab421225.js","assets/index.d94abe07.js","assets/index.f5419ca5.css"])).default,WFSLayer:async()=>(await a(()=>import("./WFSLayer.9b7e311f.js"),["assets/WFSLayer.9b7e311f.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/clientSideDefaults.f5f7bfa0.js","assets/QueryEngineCapabilities.78217f95.js","assets/wfsUtils.f8061e44.js","assets/geojson.8a0cb9d1.js","assets/xmlUtils.56e603f6.js"])).default,WMSLayer:async()=>(await a(()=>import("./WMSLayer.b219bb80.js"),["assets/WMSLayer.b219bb80.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/scaleUtils.467c71f9.js","assets/crsUtils.daf46943.js","assets/ExportWMSImageParameters.bc1ac1a0.js"])).default,WMTSLayer:async()=>(await a(()=>import("./WMTSLayer.2d04341c.js"),["assets/WMTSLayer.2d04341c.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/WebTileLayer.ab421225.js","assets/crsUtils.daf46943.js","assets/xmlUtils.56e603f6.js"])).default};export{e as a}; diff --git a/assets/loadGLTFMesh.fce23b90.js b/assets/loadGLTFMesh.4a319eb1.js similarity index 89% rename from assets/loadGLTFMesh.fce23b90.js rename to assets/loadGLTFMesh.4a319eb1.js index efdd66b..e9311b5 100644 --- a/assets/loadGLTFMesh.fce23b90.js +++ b/assets/loadGLTFMesh.4a319eb1.js @@ -1,4 +1,4 @@ -import{c,U as G,e6 as F,b9 as R,u as T,bc as h,f_ as M,kW as B,hd as P,aj as j,j as D}from"./index.d94abe07.js";import{e as I}from"./mat3f64.6d32a1d7.js";import{p as k,m as q,c as z,g as U}from"./meshFeatureSet.81c1d5a6.js";import{T as V,i as N,c as _,x as O,u as W,L as K,O as L,E as Q}from"./BufferView.89055914.js";import{t as X,r as Y,o as Z,b as H,f as J,e as ee,n as te}from"./vec33.4564cd5b.js";import{a as re,m as oe,r as b,b as ne,h as se,t as E,c as ae,j as ie,d as ce,e as ue,k as le,i as fe,f as me,g as pe,l as de,o as xe}from"./DefaultMaterial_COLOR_GAMMA.bf8213a8.js";import{_ as $e}from"./georeference.c844666d.js";import{E as A,D as C}from"./enums.2d9e6f64.js";import"./imageUtils.753f41b1.js";import"./earcut.afc1d357.js";import"./deduplicate.17ab7923.js";import"./mat4f64.ff2a477c.js";import"./types.44c7402c.js";import"./Version.59f2da65.js";import"./quat.b3994f2f.js";import"./quatf64.4ae3e6f1.js";async function Ve(e,t,n){const s=new re(ge(n)),r=(await oe(s,t,n,!0)).model,m=r.lods.shift(),u=new Map,l=new Map;r.textures.forEach((g,y)=>u.set(y,be(g))),r.materials.forEach((g,y)=>l.set(y,ve(g,u)));const i=he(m);for(const g of i.parts)we(i,g,l);const{position:d,normal:f,tangent:o,color:a,texCoord0:p}=i.vertexAttributes,$={position:d.typedBuffer,normal:c(f)?f.typedBuffer:null,tangent:c(o)?o.typedBuffer:null,uv:c(p)?p.typedBuffer:null,color:c(a)?a.typedBuffer:null},w=$e($,e,n);return{transform:w.transform,components:i.components,spatialReference:e.spatialReference,vertexAttributes:new k({position:w.vertexAttributes.position,normal:w.vertexAttributes.normal,tangent:w.vertexAttributes.tangent,color:$.color,uv:$.uv})}}function ge(e){const t=e==null?void 0:e.resolveFile;return t?{busy:!1,request:async(n,s,r)=>{const m=t(n);return(await G(m,{responseType:s==="image"?"image":s==="binary"?"array-buffer":"json",signal:c(r)?r.signal:null})).data}}:null}function v(e,t){if(D(e))return"-";const n=e.typedBuffer;return`${F(t,n.buffer,()=>t.size)}/${n.byteOffset}/${n.byteLength}`}function Te(e){return c(e)?e.toString():"-"}function he(e){let t=0;const n={color:!1,tangent:!1,normal:!1,texCoord0:!1},s=new Map,r=new Map,m=[];for(const u of e.parts){const{attributes:{position:l,normal:i,color:d,tangent:f,texCoord0:o}}=u,a=` +import{c,U as G,e6 as F,b9 as R,u as T,bc as h,f_ as M,kW as B,hd as P,aj as j,j as D}from"./index.221827cd.js";import{e as I}from"./mat3f64.6d32a1d7.js";import{p as k,m as q,c as z,g as U}from"./meshFeatureSet.eec93388.js";import{T as V,i as N,c as _,x as O,u as W,L as K,O as L,E as Q}from"./BufferView.6eee27cd.js";import{t as X,r as Y,o as Z,b as H,f as J,e as ee,n as te}from"./vec33.46fc6802.js";import{a as re,m as oe,r as b,b as ne,h as se,t as E,c as ae,j as ie,d as ce,e as ue,k as le,i as fe,f as me,g as pe,l as de,o as xe}from"./DefaultMaterial_COLOR_GAMMA.8ee780a2.js";import{_ as $e}from"./georeference.1d7480c1.js";import{E as A,D as C}from"./enums.2d9e6f64.js";import"./imageUtils.753f41b1.js";import"./earcut.afc1d357.js";import"./deduplicate.ef93b18a.js";import"./mat4f64.ff2a477c.js";import"./types.44c7402c.js";import"./Version.433fbe58.js";import"./quat.d9562009.js";import"./quatf64.4ae3e6f1.js";async function Ve(e,t,n){const s=new re(ge(n)),r=(await oe(s,t,n,!0)).model,m=r.lods.shift(),u=new Map,l=new Map;r.textures.forEach((g,y)=>u.set(y,be(g))),r.materials.forEach((g,y)=>l.set(y,ve(g,u)));const i=he(m);for(const g of i.parts)we(i,g,l);const{position:d,normal:f,tangent:o,color:a,texCoord0:p}=i.vertexAttributes,$={position:d.typedBuffer,normal:c(f)?f.typedBuffer:null,tangent:c(o)?o.typedBuffer:null,uv:c(p)?p.typedBuffer:null,color:c(a)?a.typedBuffer:null},w=$e($,e,n);return{transform:w.transform,components:i.components,spatialReference:e.spatialReference,vertexAttributes:new k({position:w.vertexAttributes.position,normal:w.vertexAttributes.normal,tangent:w.vertexAttributes.tangent,color:$.color,uv:$.uv})}}function ge(e){const t=e==null?void 0:e.resolveFile;return t?{busy:!1,request:async(n,s,r)=>{const m=t(n);return(await G(m,{responseType:s==="image"?"image":s==="binary"?"array-buffer":"json",signal:c(r)?r.signal:null})).data}}:null}function v(e,t){if(D(e))return"-";const n=e.typedBuffer;return`${F(t,n.buffer,()=>t.size)}/${n.byteOffset}/${n.byteLength}`}function Te(e){return c(e)?e.toString():"-"}function he(e){let t=0;const n={color:!1,tangent:!1,normal:!1,texCoord0:!1},s=new Map,r=new Map,m=[];for(const u of e.parts){const{attributes:{position:l,normal:i,color:d,tangent:f,texCoord0:o}}=u,a=` ${v(l,s)}/ ${v(i,s)}/ ${v(d,s)}/ diff --git a/assets/loader.3df23557.js b/assets/loader.d1e283c7.js similarity index 99% rename from assets/loader.3df23557.js rename to assets/loader.d1e283c7.js index cce7ed5..e4c7a26 100644 --- a/assets/loader.3df23557.js +++ b/assets/loader.d1e283c7.js @@ -1,4 +1,4 @@ -import{p as z,H as b,h as a,a as x}from"./index.d94abe07.js";import{g as w}from"./guid.ae96513b.js";/*! +import{p as z,H as b,h as a,a as x}from"./index.221827cd.js";import{g as w}from"./guid.ae96513b.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.0-beta.97 diff --git a/assets/mapViewDeps.ae59dec6.js b/assets/mapViewDeps.692d211f.js similarity index 98% rename from assets/mapViewDeps.ae59dec6.js rename to assets/mapViewDeps.692d211f.js index 510abe8..0339d31 100644 --- a/assets/mapViewDeps.ae59dec6.js +++ b/assets/mapViewDeps.692d211f.js @@ -1,4 +1,4 @@ -import{v as rt,w as V,U as xe,x as Je,n as Q,y as Ui,k as U,c as F,m as Ue,z as ki,A as Ni,C as Li,D as Gi,j as N,s as xt,E as Vi,F as Hi,G as ke,I as de,J as qi,K as Wi,r as ji,L as Yi,M as De,N as Tt,O as Ke,P as Xi,Q as St,R as Zi,S as Ki,T as Qi,V as Ji,d as es,f as ts,W as is,o as ss,X as rs,Y as ns,Z as as,_ as Qe,$ as fi,a0 as os,a1 as G,a2 as le,a3 as hs,a4 as ls,a5 as us,a6 as R,a7 as O,a8 as Te,a9 as Ee,aa as Pt,ab as ds,ac as cs,ad as gi,ae as nt,af as at,ag as vi,ah as et,ai as ms,aj as _s,ak as ps,al as fs,am as gs,an as Ne,ao as vs,ap as bt,aq as ys,ar as bs,as as Ot,at as Dt,au as ws,av as xs,aw as Ts}from"./index.d94abe07.js";import{o as Es}from"./_commonjsHelpers.773c2c82.js";import{c as Ms}from"./imageutils.9dde1c66.js";import{i as At,r as Rs}from"./utils.4b023c9d.js";import{n as Fs}from"./BufferPool.ff53b3f4.js";import{I as k,N as Bs,O as Ve,v as Cs,M as Ss,a as zt,T as Ps,B as Os,_ as He,E as $t,U as It,w as Ds,A as As,D as zs,b as Re,S as lt}from"./Utils.7f6f3a6b.js";import{n as j,t as $s,a as ge,b as Ge,c as re,m as Is}from"./WGLContainer.1850619d.js";import{T as I}from"./enums.54326430.js";import{e as Us,a as Le}from"./ProgramTemplate.e9a5aa54.js";import{n as ve}from"./programUtils.956e69db.js";import{a as Et,E as Mt,x as H,s as ks}from"./VertexArrayObject.a4c1d809.js";import{R as M,E as Ae,F as Rt,P as E,G as C,L as B,D,O as ut,I as yi,M as A,C as Ut,Y as J,V as ee,B as Ns}from"./enums.2d9e6f64.js";import{o as kt,T as Ls,y as Gs}from"./RenderingContext.6e624525.js";import{p as Vs,o as qe,r as Nt,t as Lt,a as Hs,b as qs,c as Ws,e as js,i as Ys,n as Xs}from"./ExpandedCIM.f0b7f36d.js";import{r as Zs,e as Ks}from"./rasterizingUtils.4baad29a.js";import{e as ae,d as oe,z as Gt,y as Vt,b as Qs,x as Js,w as er,N as tr,B as ir,C as sr,J as bi,I as Fe,Y as wi,O as Ht,U as rr,V as nr}from"./enums.0295eb81.js";import{t as q}from"./Rect.95b0fd2e.js";import{E as W}from"./Texture.4c97bad5.js";import{o as ar}from"./floatRGBA.df11258c.js";import{P as qt}from"./GeometryUtils.51c4032a.js";import{e as or}from"./Matcher.fe0c3dcf.js";import{t as Wt}from"./VertexElementDescriptor.1fdca6da.js";import{s as hr}from"./CircularArray.a4d7e1c2.js";import{e as lr}from"./imageUtils.753f41b1.js";import{t as ur}from"./ComputedAttributeStorage.c1cb22b3.js";import{o as jo}from"./BaseGraphicContainer.6b1c597d.js";import{i as Xo}from"./GraphicContainer.618d10e5.js";import{t as jt}from"./requestImageUtils.7b09b5e8.js";import"./MaterialKey.229b1dd6.js";import"./pixelUtils.82950e1a.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./earcut.afc1d357.js";import"./OrderIndependentTransparency.4d1575c0.js";import"./BidiEngine.d8bba3fc.js";import"./quantizationUtils.0d428d19.js";import"./GeometryUtils.4f19e772.js";import"./visualVariablesUtils.32e27706.js";import"./visualVariablesUtils.aff73e6d.js";import"./tileUtils.44921ab9.js";import"./TileClipper.8c399a8a.js";import"./Geometry.d049a63c.js";import"./devEnvironmentUtils.d8d0484c.js";import"./centroid.cc817cc5.js";import"./normalizeUtilsSync.757b5fd1.js";import"./projectionSupport.0542c13b.js";import"./json.879c9adc.js";import"./FeatureContainer.4ca52b51.js";import"./TileContainer.8b7fafe2.js";import"./schemaUtils.69ad92d2.js";import"./createSymbolSchema.e54d2060.js";import"./util.ab699fea.js";import"./vec3f32.1121a836.js";var Yt,xi={exports:{}};Yt=function(){return function(n){var e={};function t(i){if(e[i])return e[i].exports;var s=e[i]={exports:{},id:i,loaded:!1};return n[i].call(s.exports,s,s.exports,t),s.loaded=!0,s.exports}return t.m=n,t.c=e,t.p="",t(0)}([function(n,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.isNotPNG=h,e.isNotAPNG=u,e.default=d;var i=a(t(1)),s=t(2);function a(p){return p&&p.__esModule?p:{default:p}}var r=new Error("Not a PNG"),o=new Error("Not an animated PNG");function h(p){return p===r}function u(p){return p===o}var l=new Uint8Array([137,80,78,71,13,10,26,10]);function d(p){var w=new Uint8Array(p);if(Array.prototype.some.call(l,function(X,$){return X!==w[$]}))return r;var y=!1;if(c(w,function(X){return!(y=X==="acTL")}),!y)return o;var b=[],x=[],z=null,T=null,Y=0,ne=new s.APNG;if(c(w,function(X,$,S,Me){var Z=new DataView($.buffer);switch(X){case"IHDR":z=$.subarray(S+8,S+8+Me),ne.width=Z.getUint32(S+8),ne.height=Z.getUint32(S+12);break;case"acTL":ne.numPlays=Z.getUint32(S+8+4);break;case"fcTL":T&&(ne.frames.push(T),Y++),(T=new s.Frame).width=Z.getUint32(S+8+4),T.height=Z.getUint32(S+8+8),T.left=Z.getUint32(S+8+12),T.top=Z.getUint32(S+8+16);var Ii=Z.getUint16(S+8+20),ht=Z.getUint16(S+8+22);ht===0&&(ht=100),T.delay=1e3*Ii/ht,T.delay<=10&&(T.delay=100),ne.playTime+=T.delay,T.disposeOp=Z.getUint8(S+8+24),T.blendOp=Z.getUint8(S+8+25),T.dataParts=[],Y===0&&T.disposeOp===2&&(T.disposeOp=1);break;case"fdAT":T&&T.dataParts.push($.subarray(S+8+4,S+8+Me));break;case"IDAT":T&&T.dataParts.push($.subarray(S+8,S+8+Me));break;case"IEND":x.push(f($,S,12+Me));break;default:b.push(f($,S,12+Me))}}),T&&ne.frames.push(T),ne.frames.length==0)return o;var zi=new Blob(b),$i=new Blob(x);return ne.frames.forEach(function(X){var $=[];$.push(l),z.set(v(X.width),0),z.set(v(X.height),4),$.push(g("IHDR",z)),$.push(zi),X.dataParts.forEach(function(S){return $.push(g("IDAT",S))}),$.push($i),X.imageData=new Blob($,{type:"image/png"}),delete X.dataParts,$=null}),ne}function c(p,w){var y=new DataView(p.buffer),b=8,x=void 0,z=void 0,T=void 0;do z=y.getUint32(b),T=w(x=m(p,b+4,4),p,b,z),b+=12+z;while(T!==!1&&x!="IEND"&&b>>24&255,p>>>16&255,p>>>8&255,255&p])}},function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(r){for(var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,h=-1,u=o,l=o+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.length-o);u>>8^t[255&(h^r[u])];return-1^h};for(var t=new Uint32Array(256),i=0;i<256;i++){for(var s=i,a=0;a<8;a++)s=(1&s)!=0?3988292384^s>>>1:s>>>1;t[i]=s}},function(n,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.Frame=e.APNG=void 0;var i=function(){function o(h,u){for(var l=0;l1&&arguments[1]!==void 0&&arguments[1];return this.createImages().then(function(){return new s.default(u,h,l)})}}]),o}(),e.Frame=function(){function o(){r(this,o),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}return i(o,[{key:"createImage",value:function(){var h=this;return this.imageElement?Promise.resolve():new Promise(function(u,l){var d=URL.createObjectURL(h.imageData);h.imageElement=document.createElement("img"),h.imageElement.onload=function(){URL.revokeObjectURL(d),u()},h.imageElement.onerror=function(){URL.revokeObjectURL(d),h.imageElement=null,l(new Error("Image creation error"))},h.imageElement.src=d})}}]),o}()},function(n,e,t){Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function u(l,d){for(var c=0;c=this._apng.numPlays&&(this._ended=!0,this._paused=!0)),this._prevFrame&&this._prevFrame.disposeOp==1?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&this._prevFrame.disposeOp==2&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var d=this.currentFrame;this._prevFrame=d,this._prevFrameData=null,d.disposeOp==2&&(this._prevFrameData=this.context.getImageData(d.left,d.top,d.width,d.height)),d.blendOp==0&&this.context.clearRect(d.left,d.top,d.width,d.height),this.context.drawImage(d.imageElement,d.left,d.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var d=this;this.emit("play"),this._ended&&this.stop(),this._paused=!1;var c=performance.now()+this.currentFrame.delay/this.playbackRate,m=function _(f){if(!d._ended&&!d._paused){if(f>=c){for(;f-c>=d._apng.playTime/d.playbackRate;)c+=d._apng.playTime/d.playbackRate,d._numPlays++;do d.renderNextFrame(),c+=d.currentFrame.delay/d.playbackRate;while(!d._ended&&f>c)}requestAnimationFrame(_)}};requestAnimationFrame(m)}},{key:"pause",value:function(){this._paused||(this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),l}(s(t(4)).default);e.default=h},function(n,e){function t(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(o){return typeof o=="function"}function s(o){return typeof o=="number"}function a(o){return typeof o=="object"&&o!==null}function r(o){return o===void 0}n.exports=t,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.prototype.setMaxListeners=function(o){if(!s(o)||o<0||isNaN(o))throw TypeError("n must be a positive number");return this._maxListeners=o,this},t.prototype.emit=function(o){var h,u,l,d,c,m;if(this._events||(this._events={}),o==="error"&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((h=arguments[1])instanceof Error)throw h;var _=new Error('Uncaught, unspecified "error" event. ('+h+")");throw _.context=h,_}if(r(u=this._events[o]))return!1;if(i(u))switch(arguments.length){case 1:u.call(this);break;case 2:u.call(this,arguments[1]);break;case 3:u.call(this,arguments[1],arguments[2]);break;default:d=Array.prototype.slice.call(arguments,1),u.apply(this,d)}else if(a(u))for(d=Array.prototype.slice.call(arguments,1),l=(m=u.slice()).length,c=0;c0&&this._events[o].length>u&&(this._events[o].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[o].length),typeof console.trace=="function"&&console.trace()),this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(o,h){if(!i(h))throw TypeError("listener must be a function");var u=!1;function l(){this.removeListener(o,l),u||(u=!0,h.apply(this,arguments))}return l.listener=h,this.on(o,l),this},t.prototype.removeListener=function(o,h){var u,l,d,c;if(!i(h))throw TypeError("listener must be a function");if(!this._events||!this._events[o])return this;if(d=(u=this._events[o]).length,l=-1,u===h||i(u.listener)&&u.listener===h)delete this._events[o],this._events.removeListener&&this.emit("removeListener",o,h);else if(a(u)){for(c=d;c-- >0;)if(u[c]===h||u[c].listener&&u[c].listener===h){l=c;break}if(l<0)return this;u.length===1?(u.length=0,delete this._events[o]):u.splice(l,1),this._events.removeListener&&this.emit("removeListener",o,h)}return this},t.prototype.removeAllListeners=function(o){var h,u;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[o]&&delete this._events[o],this;if(arguments.length===0){for(h in this._events)h!=="removeListener"&&this.removeAllListeners(h);return this.removeAllListeners("removeListener"),this._events={},this}if(i(u=this._events[o]))this.removeListener(o,u);else if(u)for(;u.length;)this.removeListener(o,u[u.length-1]);return delete this._events[o],this},t.prototype.listeners=function(o){return this._events&&this._events[o]?i(this._events[o])?[this._events[o]]:this._events[o].slice():[]},t.prototype.listenerCount=function(o){if(this._events){var h=this._events[o];if(i(h))return 1;if(h)return h.length}return 0},t.listenerCount=function(o,h){return o.listenerCount(h)}}])},xi.exports=Yt();const dr=Es(xi.exports);async function cr(n,e){const t=dr(n);if(t instanceof Error)throw t;await t.createImages(),rt(e);const{frames:i,width:s,height:a}=t,r=document.createElement("canvas");r.width=s,r.height=a;const o=r.getContext("2d"),h=[],u=[];for(const l of i){u.push(V(l.delay||100));const d=l.imageElement;l.blendOp===0?o.globalCompositeOperation="copy":o.globalCompositeOperation="source-over";const c=l.disposeOp===2&&o.getImageData(l.left,l.top,l.width,l.height);o.drawImage(d,l.left,l.top);const m=o.getImageData(0,0,s,a);h.push(m),l.disposeOp===0||(l.disposeOp===1?o.clearRect(l.left,l.top,l.width,l.height):l.disposeOp===2&&o.putImageData(c,l.left,l.top))}return{frameDurations:u,getFrame:l=>h[l],width:s,height:a}}const mr=[137,80,78,71,13,10,26,10];function _r(n){const e=new Uint8Array(n);return!mr.some((t,i)=>t!==e[i])}function pr(n){if(!_r(n))return!1;const e=new DataView(n),t=new Uint8Array(n);let i,s=8;do{const a=e.getUint32(s);if(i=String.fromCharCode.apply(String,Array.prototype.slice.call(t.subarray(s+4,s+8))),i==="acTL")return!0;s+=12+a}while(i!=="IEND"&&s2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:i;if(Array.isArray(t))t.forEach(function(r){return n(e,r,i,s)});else if(typeof t=="function")t(e,i,s,n);else{var a=Object.keys(t)[0];Array.isArray(t[a])?(s[a]={},n(e,t[a],i,s[a])):s[a]=t[a](e,i,s,n)}return i};he.parse=fr;var gr=function(n,e){return function(t,i,s,a){e(t,i,s)&&a(t,n,i,s)}};he.conditional=gr;var vr=function(n,e){return function(t,i,s,a){for(var r=[],o=t.pos;e(t,i,s);){var h={};if(a(t,n,i,h),t.pos===o)break;o=t.pos,r.push(h)}return r}};he.loop=vr;var P={};Object.defineProperty(P,"__esModule",{value:!0}),P.readBits=P.readArray=P.readUnsigned=P.readString=P.peekBytes=P.readBytes=P.peekByte=P.readByte=P.buildStream=void 0;var yr=function(n){return{data:n,pos:0}};P.buildStream=yr;var Ei=function(){return function(n){return n.data[n.pos++]}};P.readByte=Ei;var br=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(e){return e.data[e.pos+n]}};P.peekByte=br;var ot=function(n){return function(e){return e.data.subarray(e.pos,e.pos+=n)}};P.readBytes=ot;var wr=function(n){return function(e){return e.data.subarray(e.pos,e.pos+n)}};P.peekBytes=wr;var xr=function(n){return function(e){return Array.from(ot(n)(e)).map(function(t){return String.fromCharCode(t)}).join("")}};P.readString=xr;var Tr=function(n){return function(e){var t=ot(2)(e);return n?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]}};P.readUnsigned=Tr;var Er=function(n,e){return function(t,i,s){for(var a=typeof e=="function"?e(t,i,s):e,r=ot(n),o=new Array(a),h=0;h=m){var g=m-l.pos;c.push((0,t.readBytes)(g)(l)),_+=g;break}c.push((0,t.readBytes)(f)(l)),_+=f}for(var v=new Uint8Array(_),p=0,w=0;w>=r,_-=r,l>i||l==o)break;if(l==s){a=(1<<(r=c+1))-1,i=s+2,u=y;continue}if(u==y){Y[g++]=T[l],u=l,f=l;continue}for(h=l,l==i&&(Y[g++]=f,l=u);l>s;)Y[g++]=T[l],l=z[l];f=255&T[l],Y[g++]=f,ih[l],width:s,height:a}}Mi=fe.decompressFrames=Ir;const kr=[71,73,70];function Nr(n){const e=new Uint8Array(n);return!kr.some((t,i)=>t!==e[i])}function Lr(n){if(!Nr(n))return!1;const e=new DataView(n),t=e.getUint8(10);let i=13+(128&t?3*2**(1+(7&t)):0),s=0,a=!1;for(;!a;){switch(e.getUint8(i++)){case 33:if(!r())return!1;break;case 44:o();break;case 59:a=!0;break;default:return!1}if(s>1)return!0}function r(){switch(e.getUint8(i++)){case 249:h();break;case 1:u();break;case 254:l();break;case 255:d();break;default:return!1}return!0}function o(){s++,i+=8;const m=e.getUint8(i++);i+=128&m?3*2**(1+(7&m)):0,i++,c()}function h(){i++,i+=4,c()}function u(){s++,i++,i+=12,c()}function l(){c()}function d(){i++,i+=8,i+=3,c()}function c(){let m;for(;m=e.getUint8(i++);)i+=m}return!1}class Gr{constructor(){this._resourceMap=new Map,this._inFlightResourceMap=new Map,this.geometryEngine=null}destroy(){this._inFlightResourceMap.clear(),this._resourceMap.clear()}getResource(e){var t;return(t=this._resourceMap.get(e))!=null?t:null}async fetchResource(e,t){const i=this._resourceMap.get(e);if(i)return{width:i.width,height:i.height};const s=this._inFlightResourceMap.get(e);if(s)return s.then(r=>({width:r.width,height:r.height}));const a=Hr(e,t);return this._inFlightResourceMap.set(e,s),a.then(r=>(this._inFlightResourceMap.delete(e),this._resourceMap.set(e,r),{width:r.width,height:r.height}),()=>({width:0,height:0}))}deleteResource(e){this._inFlightResourceMap.delete(e),this._resourceMap.delete(e)}}async function Vr(n,e){const t=window.URL.createObjectURL(n);try{const{data:i}=await xe(t,{...e,responseType:"image"});return i}catch(i){throw Je(i)?i:new Q("mapview-invalid-resource",`Could not fetch requested resource at ${t}`)}finally{window.URL.revokeObjectURL(t)}}async function Hr(n,e){const{arrayBuffer:t,mediaType:i}=await qr(n,e),s=i==="image/png";return i==="image/gif"&&Lr(t)?Ur(t):s&&pr(t)?cr(t,e):Vr(new Blob([t],{type:i}),e)}async function qr(n,e){let t;const i=";base64,";if(n.includes(i)){const s=n.indexOf(i),a=n.indexOf(i)+i.length,r=n.substring(a),o=atob(r),h=new Uint8Array(o.length);for(let u=0;u=c||d>=c){const m=l/d;m>1?(l=c,d=Math.round(c/m)):(d=c,l=Math.round(c*m)),u=new Uint8Array(4*l*d);const _=new Uint8ClampedArray(u.buffer);Hs(o,e,t,_,l,d,!1)}return{size:[l,d],image:new Uint32Array(u.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0}}}const Yr={background:{"background.frag":`#ifdef PATTERN +import{v as rt,w as V,U as xe,x as Je,n as Q,y as Ui,k as U,c as F,m as Ue,z as ki,A as Ni,C as Li,D as Gi,j as N,s as xt,E as Vi,F as Hi,G as ke,I as de,J as qi,K as Wi,r as ji,L as Yi,M as De,N as Tt,O as Ke,P as Xi,Q as St,R as Zi,S as Ki,T as Qi,V as Ji,d as es,f as ts,W as is,o as ss,X as rs,Y as ns,Z as as,_ as Qe,$ as fi,a0 as os,a1 as G,a2 as le,a3 as hs,a4 as ls,a5 as us,a6 as R,a7 as O,a8 as Te,a9 as Ee,aa as Pt,ab as ds,ac as cs,ad as gi,ae as nt,af as at,ag as vi,ah as et,ai as ms,aj as _s,ak as ps,al as fs,am as gs,an as Ne,ao as vs,ap as bt,aq as ys,ar as bs,as as Ot,at as Dt,au as ws,av as xs,aw as Ts}from"./index.221827cd.js";import{o as Es}from"./_commonjsHelpers.773c2c82.js";import{c as Ms}from"./imageutils.5e4d6270.js";import{i as At,r as Rs}from"./utils.0160becb.js";import{n as Fs}from"./BufferPool.98277e4b.js";import{I as k,N as Bs,O as Ve,v as Cs,M as Ss,a as zt,T as Ps,B as Os,_ as He,E as $t,U as It,w as Ds,A as As,D as zs,b as Re,S as lt}from"./Utils.2136650a.js";import{n as j,t as $s,a as ge,b as Ge,c as re,m as Is}from"./WGLContainer.347cc5cd.js";import{T as I}from"./enums.54326430.js";import{e as Us,a as Le}from"./ProgramTemplate.cf9dd4e8.js";import{n as ve}from"./programUtils.10ecfb8b.js";import{a as Et,E as Mt,x as H,s as ks}from"./VertexArrayObject.53cf1857.js";import{R as M,E as Ae,F as Rt,P as E,G as C,L as B,D,O as ut,I as yi,M as A,C as Ut,Y as J,V as ee,B as Ns}from"./enums.2d9e6f64.js";import{o as kt,T as Ls,y as Gs}from"./RenderingContext.8853f4cd.js";import{p as Vs,o as qe,r as Nt,t as Lt,a as Hs,b as qs,c as Ws,e as js,i as Ys,n as Xs}from"./ExpandedCIM.a372ce74.js";import{r as Zs,e as Ks}from"./rasterizingUtils.ec7fabe7.js";import{e as ae,d as oe,z as Gt,y as Vt,b as Qs,x as Js,w as er,N as tr,B as ir,C as sr,J as bi,I as Fe,Y as wi,O as Ht,U as rr,V as nr}from"./enums.0295eb81.js";import{t as q}from"./Rect.95b0fd2e.js";import{E as W}from"./Texture.940076b2.js";import{o as ar}from"./floatRGBA.3f71f8e9.js";import{P as qt}from"./GeometryUtils.51c4032a.js";import{e as or}from"./Matcher.6586928a.js";import{t as Wt}from"./VertexElementDescriptor.1fdca6da.js";import{s as hr}from"./CircularArray.62f75f43.js";import{e as lr}from"./imageUtils.753f41b1.js";import{t as ur}from"./ComputedAttributeStorage.29767acd.js";import{o as jo}from"./BaseGraphicContainer.7704bbc1.js";import{i as Xo}from"./GraphicContainer.b0be80ad.js";import{t as jt}from"./requestImageUtils.1f5d4b6d.js";import"./MaterialKey.0cadabc1.js";import"./pixelUtils.9c6f8dae.js";import"./StyleDefinition.d56936e4.js";import"./config.82550349.js";import"./earcut.afc1d357.js";import"./OrderIndependentTransparency.4d1575c0.js";import"./BidiEngine.d8bba3fc.js";import"./quantizationUtils.7ff797cc.js";import"./GeometryUtils.4f19e772.js";import"./visualVariablesUtils.061b7a4e.js";import"./visualVariablesUtils.62efda9d.js";import"./tileUtils.332711ed.js";import"./TileClipper.77103a2e.js";import"./Geometry.d049a63c.js";import"./devEnvironmentUtils.d8d0484c.js";import"./centroid.06db4b74.js";import"./normalizeUtilsSync.4d52fbd0.js";import"./projectionSupport.4f5da4af.js";import"./json.879c9adc.js";import"./FeatureContainer.b427dd87.js";import"./TileContainer.5aeb32d6.js";import"./schemaUtils.d20994fa.js";import"./createSymbolSchema.827eb617.js";import"./util.520a352e.js";import"./vec3f32.1121a836.js";var Yt,xi={exports:{}};Yt=function(){return function(n){var e={};function t(i){if(e[i])return e[i].exports;var s=e[i]={exports:{},id:i,loaded:!1};return n[i].call(s.exports,s,s.exports,t),s.loaded=!0,s.exports}return t.m=n,t.c=e,t.p="",t(0)}([function(n,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.isNotPNG=h,e.isNotAPNG=u,e.default=d;var i=a(t(1)),s=t(2);function a(p){return p&&p.__esModule?p:{default:p}}var r=new Error("Not a PNG"),o=new Error("Not an animated PNG");function h(p){return p===r}function u(p){return p===o}var l=new Uint8Array([137,80,78,71,13,10,26,10]);function d(p){var w=new Uint8Array(p);if(Array.prototype.some.call(l,function(X,$){return X!==w[$]}))return r;var y=!1;if(c(w,function(X){return!(y=X==="acTL")}),!y)return o;var b=[],x=[],z=null,T=null,Y=0,ne=new s.APNG;if(c(w,function(X,$,S,Me){var Z=new DataView($.buffer);switch(X){case"IHDR":z=$.subarray(S+8,S+8+Me),ne.width=Z.getUint32(S+8),ne.height=Z.getUint32(S+12);break;case"acTL":ne.numPlays=Z.getUint32(S+8+4);break;case"fcTL":T&&(ne.frames.push(T),Y++),(T=new s.Frame).width=Z.getUint32(S+8+4),T.height=Z.getUint32(S+8+8),T.left=Z.getUint32(S+8+12),T.top=Z.getUint32(S+8+16);var Ii=Z.getUint16(S+8+20),ht=Z.getUint16(S+8+22);ht===0&&(ht=100),T.delay=1e3*Ii/ht,T.delay<=10&&(T.delay=100),ne.playTime+=T.delay,T.disposeOp=Z.getUint8(S+8+24),T.blendOp=Z.getUint8(S+8+25),T.dataParts=[],Y===0&&T.disposeOp===2&&(T.disposeOp=1);break;case"fdAT":T&&T.dataParts.push($.subarray(S+8+4,S+8+Me));break;case"IDAT":T&&T.dataParts.push($.subarray(S+8,S+8+Me));break;case"IEND":x.push(f($,S,12+Me));break;default:b.push(f($,S,12+Me))}}),T&&ne.frames.push(T),ne.frames.length==0)return o;var zi=new Blob(b),$i=new Blob(x);return ne.frames.forEach(function(X){var $=[];$.push(l),z.set(v(X.width),0),z.set(v(X.height),4),$.push(g("IHDR",z)),$.push(zi),X.dataParts.forEach(function(S){return $.push(g("IDAT",S))}),$.push($i),X.imageData=new Blob($,{type:"image/png"}),delete X.dataParts,$=null}),ne}function c(p,w){var y=new DataView(p.buffer),b=8,x=void 0,z=void 0,T=void 0;do z=y.getUint32(b),T=w(x=m(p,b+4,4),p,b,z),b+=12+z;while(T!==!1&&x!="IEND"&&b>>24&255,p>>>16&255,p>>>8&255,255&p])}},function(n,e){Object.defineProperty(e,"__esModule",{value:!0}),e.default=function(r){for(var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,h=-1,u=o,l=o+(arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.length-o);u>>8^t[255&(h^r[u])];return-1^h};for(var t=new Uint32Array(256),i=0;i<256;i++){for(var s=i,a=0;a<8;a++)s=(1&s)!=0?3988292384^s>>>1:s>>>1;t[i]=s}},function(n,e,t){Object.defineProperty(e,"__esModule",{value:!0}),e.Frame=e.APNG=void 0;var i=function(){function o(h,u){for(var l=0;l1&&arguments[1]!==void 0&&arguments[1];return this.createImages().then(function(){return new s.default(u,h,l)})}}]),o}(),e.Frame=function(){function o(){r(this,o),this.left=0,this.top=0,this.width=0,this.height=0,this.delay=0,this.disposeOp=0,this.blendOp=0,this.imageData=null,this.imageElement=null}return i(o,[{key:"createImage",value:function(){var h=this;return this.imageElement?Promise.resolve():new Promise(function(u,l){var d=URL.createObjectURL(h.imageData);h.imageElement=document.createElement("img"),h.imageElement.onload=function(){URL.revokeObjectURL(d),u()},h.imageElement.onerror=function(){URL.revokeObjectURL(d),h.imageElement=null,l(new Error("Image creation error"))},h.imageElement.src=d})}}]),o}()},function(n,e,t){Object.defineProperty(e,"__esModule",{value:!0});var i=function(){function u(l,d){for(var c=0;c=this._apng.numPlays&&(this._ended=!0,this._paused=!0)),this._prevFrame&&this._prevFrame.disposeOp==1?this.context.clearRect(this._prevFrame.left,this._prevFrame.top,this._prevFrame.width,this._prevFrame.height):this._prevFrame&&this._prevFrame.disposeOp==2&&this.context.putImageData(this._prevFrameData,this._prevFrame.left,this._prevFrame.top);var d=this.currentFrame;this._prevFrame=d,this._prevFrameData=null,d.disposeOp==2&&(this._prevFrameData=this.context.getImageData(d.left,d.top,d.width,d.height)),d.blendOp==0&&this.context.clearRect(d.left,d.top,d.width,d.height),this.context.drawImage(d.imageElement,d.left,d.top),this.emit("frame",this._currentFrameNumber),this._ended&&this.emit("end")}},{key:"play",value:function(){var d=this;this.emit("play"),this._ended&&this.stop(),this._paused=!1;var c=performance.now()+this.currentFrame.delay/this.playbackRate,m=function _(f){if(!d._ended&&!d._paused){if(f>=c){for(;f-c>=d._apng.playTime/d.playbackRate;)c+=d._apng.playTime/d.playbackRate,d._numPlays++;do d.renderNextFrame(),c+=d.currentFrame.delay/d.playbackRate;while(!d._ended&&f>c)}requestAnimationFrame(_)}};requestAnimationFrame(m)}},{key:"pause",value:function(){this._paused||(this.emit("pause"),this._paused=!0)}},{key:"stop",value:function(){this.emit("stop"),this._numPlays=0,this._ended=!1,this._paused=!0,this._currentFrameNumber=-1,this.context.clearRect(0,0,this._apng.width,this._apng.height),this.renderNextFrame()}},{key:"currentFrameNumber",get:function(){return this._currentFrameNumber}},{key:"currentFrame",get:function(){return this._apng.frames[this._currentFrameNumber]}},{key:"paused",get:function(){return this._paused}},{key:"ended",get:function(){return this._ended}}]),l}(s(t(4)).default);e.default=h},function(n,e){function t(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function i(o){return typeof o=="function"}function s(o){return typeof o=="number"}function a(o){return typeof o=="object"&&o!==null}function r(o){return o===void 0}n.exports=t,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.prototype.setMaxListeners=function(o){if(!s(o)||o<0||isNaN(o))throw TypeError("n must be a positive number");return this._maxListeners=o,this},t.prototype.emit=function(o){var h,u,l,d,c,m;if(this._events||(this._events={}),o==="error"&&(!this._events.error||a(this._events.error)&&!this._events.error.length)){if((h=arguments[1])instanceof Error)throw h;var _=new Error('Uncaught, unspecified "error" event. ('+h+")");throw _.context=h,_}if(r(u=this._events[o]))return!1;if(i(u))switch(arguments.length){case 1:u.call(this);break;case 2:u.call(this,arguments[1]);break;case 3:u.call(this,arguments[1],arguments[2]);break;default:d=Array.prototype.slice.call(arguments,1),u.apply(this,d)}else if(a(u))for(d=Array.prototype.slice.call(arguments,1),l=(m=u.slice()).length,c=0;c0&&this._events[o].length>u&&(this._events[o].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[o].length),typeof console.trace=="function"&&console.trace()),this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(o,h){if(!i(h))throw TypeError("listener must be a function");var u=!1;function l(){this.removeListener(o,l),u||(u=!0,h.apply(this,arguments))}return l.listener=h,this.on(o,l),this},t.prototype.removeListener=function(o,h){var u,l,d,c;if(!i(h))throw TypeError("listener must be a function");if(!this._events||!this._events[o])return this;if(d=(u=this._events[o]).length,l=-1,u===h||i(u.listener)&&u.listener===h)delete this._events[o],this._events.removeListener&&this.emit("removeListener",o,h);else if(a(u)){for(c=d;c-- >0;)if(u[c]===h||u[c].listener&&u[c].listener===h){l=c;break}if(l<0)return this;u.length===1?(u.length=0,delete this._events[o]):u.splice(l,1),this._events.removeListener&&this.emit("removeListener",o,h)}return this},t.prototype.removeAllListeners=function(o){var h,u;if(!this._events)return this;if(!this._events.removeListener)return arguments.length===0?this._events={}:this._events[o]&&delete this._events[o],this;if(arguments.length===0){for(h in this._events)h!=="removeListener"&&this.removeAllListeners(h);return this.removeAllListeners("removeListener"),this._events={},this}if(i(u=this._events[o]))this.removeListener(o,u);else if(u)for(;u.length;)this.removeListener(o,u[u.length-1]);return delete this._events[o],this},t.prototype.listeners=function(o){return this._events&&this._events[o]?i(this._events[o])?[this._events[o]]:this._events[o].slice():[]},t.prototype.listenerCount=function(o){if(this._events){var h=this._events[o];if(i(h))return 1;if(h)return h.length}return 0},t.listenerCount=function(o,h){return o.listenerCount(h)}}])},xi.exports=Yt();const dr=Es(xi.exports);async function cr(n,e){const t=dr(n);if(t instanceof Error)throw t;await t.createImages(),rt(e);const{frames:i,width:s,height:a}=t,r=document.createElement("canvas");r.width=s,r.height=a;const o=r.getContext("2d"),h=[],u=[];for(const l of i){u.push(V(l.delay||100));const d=l.imageElement;l.blendOp===0?o.globalCompositeOperation="copy":o.globalCompositeOperation="source-over";const c=l.disposeOp===2&&o.getImageData(l.left,l.top,l.width,l.height);o.drawImage(d,l.left,l.top);const m=o.getImageData(0,0,s,a);h.push(m),l.disposeOp===0||(l.disposeOp===1?o.clearRect(l.left,l.top,l.width,l.height):l.disposeOp===2&&o.putImageData(c,l.left,l.top))}return{frameDurations:u,getFrame:l=>h[l],width:s,height:a}}const mr=[137,80,78,71,13,10,26,10];function _r(n){const e=new Uint8Array(n);return!mr.some((t,i)=>t!==e[i])}function pr(n){if(!_r(n))return!1;const e=new DataView(n),t=new Uint8Array(n);let i,s=8;do{const a=e.getUint32(s);if(i=String.fromCharCode.apply(String,Array.prototype.slice.call(t.subarray(s+4,s+8))),i==="acTL")return!0;s+=12+a}while(i!=="IEND"&&s2&&arguments[2]!==void 0?arguments[2]:{},s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:i;if(Array.isArray(t))t.forEach(function(r){return n(e,r,i,s)});else if(typeof t=="function")t(e,i,s,n);else{var a=Object.keys(t)[0];Array.isArray(t[a])?(s[a]={},n(e,t[a],i,s[a])):s[a]=t[a](e,i,s,n)}return i};he.parse=fr;var gr=function(n,e){return function(t,i,s,a){e(t,i,s)&&a(t,n,i,s)}};he.conditional=gr;var vr=function(n,e){return function(t,i,s,a){for(var r=[],o=t.pos;e(t,i,s);){var h={};if(a(t,n,i,h),t.pos===o)break;o=t.pos,r.push(h)}return r}};he.loop=vr;var P={};Object.defineProperty(P,"__esModule",{value:!0}),P.readBits=P.readArray=P.readUnsigned=P.readString=P.peekBytes=P.readBytes=P.peekByte=P.readByte=P.buildStream=void 0;var yr=function(n){return{data:n,pos:0}};P.buildStream=yr;var Ei=function(){return function(n){return n.data[n.pos++]}};P.readByte=Ei;var br=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return function(e){return e.data[e.pos+n]}};P.peekByte=br;var ot=function(n){return function(e){return e.data.subarray(e.pos,e.pos+=n)}};P.readBytes=ot;var wr=function(n){return function(e){return e.data.subarray(e.pos,e.pos+n)}};P.peekBytes=wr;var xr=function(n){return function(e){return Array.from(ot(n)(e)).map(function(t){return String.fromCharCode(t)}).join("")}};P.readString=xr;var Tr=function(n){return function(e){var t=ot(2)(e);return n?(t[1]<<8)+t[0]:(t[0]<<8)+t[1]}};P.readUnsigned=Tr;var Er=function(n,e){return function(t,i,s){for(var a=typeof e=="function"?e(t,i,s):e,r=ot(n),o=new Array(a),h=0;h=m){var g=m-l.pos;c.push((0,t.readBytes)(g)(l)),_+=g;break}c.push((0,t.readBytes)(f)(l)),_+=f}for(var v=new Uint8Array(_),p=0,w=0;w>=r,_-=r,l>i||l==o)break;if(l==s){a=(1<<(r=c+1))-1,i=s+2,u=y;continue}if(u==y){Y[g++]=T[l],u=l,f=l;continue}for(h=l,l==i&&(Y[g++]=f,l=u);l>s;)Y[g++]=T[l],l=z[l];f=255&T[l],Y[g++]=f,ih[l],width:s,height:a}}Mi=fe.decompressFrames=Ir;const kr=[71,73,70];function Nr(n){const e=new Uint8Array(n);return!kr.some((t,i)=>t!==e[i])}function Lr(n){if(!Nr(n))return!1;const e=new DataView(n),t=e.getUint8(10);let i=13+(128&t?3*2**(1+(7&t)):0),s=0,a=!1;for(;!a;){switch(e.getUint8(i++)){case 33:if(!r())return!1;break;case 44:o();break;case 59:a=!0;break;default:return!1}if(s>1)return!0}function r(){switch(e.getUint8(i++)){case 249:h();break;case 1:u();break;case 254:l();break;case 255:d();break;default:return!1}return!0}function o(){s++,i+=8;const m=e.getUint8(i++);i+=128&m?3*2**(1+(7&m)):0,i++,c()}function h(){i++,i+=4,c()}function u(){s++,i++,i+=12,c()}function l(){c()}function d(){i++,i+=8,i+=3,c()}function c(){let m;for(;m=e.getUint8(i++);)i+=m}return!1}class Gr{constructor(){this._resourceMap=new Map,this._inFlightResourceMap=new Map,this.geometryEngine=null}destroy(){this._inFlightResourceMap.clear(),this._resourceMap.clear()}getResource(e){var t;return(t=this._resourceMap.get(e))!=null?t:null}async fetchResource(e,t){const i=this._resourceMap.get(e);if(i)return{width:i.width,height:i.height};const s=this._inFlightResourceMap.get(e);if(s)return s.then(r=>({width:r.width,height:r.height}));const a=Hr(e,t);return this._inFlightResourceMap.set(e,s),a.then(r=>(this._inFlightResourceMap.delete(e),this._resourceMap.set(e,r),{width:r.width,height:r.height}),()=>({width:0,height:0}))}deleteResource(e){this._inFlightResourceMap.delete(e),this._resourceMap.delete(e)}}async function Vr(n,e){const t=window.URL.createObjectURL(n);try{const{data:i}=await xe(t,{...e,responseType:"image"});return i}catch(i){throw Je(i)?i:new Q("mapview-invalid-resource",`Could not fetch requested resource at ${t}`)}finally{window.URL.revokeObjectURL(t)}}async function Hr(n,e){const{arrayBuffer:t,mediaType:i}=await qr(n,e),s=i==="image/png";return i==="image/gif"&&Lr(t)?Ur(t):s&&pr(t)?cr(t,e):Vr(new Blob([t],{type:i}),e)}async function qr(n,e){let t;const i=";base64,";if(n.includes(i)){const s=n.indexOf(i),a=n.indexOf(i)+i.length,r=n.substring(a),o=atob(r),h=new Uint8Array(o.length);for(let u=0;u=c||d>=c){const m=l/d;m>1?(l=c,d=Math.round(c/m)):(d=c,l=Math.round(c*m)),u=new Uint8Array(4*l*d);const _=new Uint8ClampedArray(u.buffer);Hs(o,e,t,_,l,d,!1)}return{size:[l,d],image:new Uint32Array(u.buffer),sdf:!1,simplePattern:!1,anchorX:0,anchorY:0}}}const Yr={background:{"background.frag":`#ifdef PATTERN uniform lowp float u_opacity; uniform lowp sampler2D u_texture; varying mediump vec4 v_tlbr; diff --git a/assets/meshFeatureSet.81c1d5a6.js b/assets/meshFeatureSet.eec93388.js similarity index 95% rename from assets/meshFeatureSet.81c1d5a6.js rename to assets/meshFeatureSet.eec93388.js index 1202aba..3c4c632 100644 --- a/assets/meshFeatureSet.81c1d5a6.js +++ b/assets/meshFeatureSet.eec93388.js @@ -1 +1 @@ -import{a6 as p,a7 as d,ix as mt,e0 as dt,d2 as yt,a8 as ee,cx as xe,jf as He,d$ as Te,b9 as Ke,c,s as $,cw as k,b4 as _,hE as xt,kS as N,M,cO as De,at as he,af as E,hu as wt,kT as vt,gQ as $t,c1 as bt,v as At,j as se,n as Me,fG as Ee,fO as et,fN as Ie,fV as tt,eb as fe,fE as Tt,O as nt,fD as ge,he as Mt,fM as Ft,kJ as rt,ad as ot,a4 as Rt,hT as Lt,d0 as Ct,cY as Ot,_ as _t,cU as Fe,az as Dt,aj as ve,d3 as Et,d1 as It}from"./index.d94abe07.js";import{r as we,b as Pt,x as St,M as Pe,j as Se,a as je,O as Ne,h as ze,L as ke,_ as jt,c as ae,v as Re,g as Le,d as Nt,e as ue,f as me}from"./georeference.c844666d.js";import{r as zt}from"./imageUtils.753f41b1.js";import{x as kt}from"./earcut.afc1d357.js";import{n as Wt}from"./deduplicate.17ab7923.js";import{e as We}from"./mat3f64.6d32a1d7.js";import{e as st}from"./mat4f64.ff2a477c.js";var Z;const $e=new WeakMap;let Ut=0,D=Z=class extends xe{constructor(e){super(e),this.wrap="repeat"}get url(){return this._get("url")||null}set url(e){this._set("url",e),e&&this._set("data",null)}get data(){return this._get("data")||null}set data(e){this._set("data",e),e&&this._set("url",null)}writeData(e,t,n,r){if(e instanceof HTMLImageElement){const o={type:"image-element",src:He(e.src,r),crossOrigin:e.crossOrigin};t[n]=o}else if(e instanceof HTMLCanvasElement){const o=e.getContext("2d").getImageData(0,0,e.width,e.height),a={type:"canvas-element",imageData:this._encodeImageData(o)};t[n]=a}else if(e instanceof HTMLVideoElement){const o={type:"video-element",src:He(e.src,r),autoplay:e.autoplay,loop:e.loop,muted:e.muted,crossOrigin:e.crossOrigin,preload:e.preload};t[n]=o}else{const o={type:"image-data",imageData:this._encodeImageData(e)};t[n]=o}}readData(e){switch(e.type){case"image-element":{const t=new Image;return t.src=e.src,t.crossOrigin=e.crossOrigin,t}case"canvas-element":{const t=this._decodeImageData(e.imageData),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").putImageData(t,0,0),n}case"image-data":return this._decodeImageData(e.imageData);case"video-element":{const t=document.createElement("video");return t.src=e.src,t.crossOrigin=e.crossOrigin,t.autoplay=e.autoplay,t.loop=e.loop,t.muted=e.muted,t.preload=e.preload,t}default:return}}get transparent(){const e=this.data,t=this.url;if(e instanceof HTMLCanvasElement)return this._imageDataContainsTransparent(e.getContext("2d").getImageData(0,0,e.width,e.height));if(e instanceof ImageData)return this._imageDataContainsTransparent(e);if(t){const n=t.substr(t.length-4,4).toLowerCase(),r=t.substr(0,15).toLocaleLowerCase();if(n===".png"||r==="data:image/png;")return!0}return!1}set transparent(e){this._overrideIfSome("transparent",e)}get contentHash(){const e=typeof this.wrap=="string"?this.wrap:typeof this.wrap=="object"?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",t=(n="")=>`d:${n},t:${this.transparent},w:${e}`;return this.url!=null?t(this.url):this.data!=null?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?t(this.data.src):($e.has(this.data)||$e.set(this.data,++Ut),t($e.get(this.data))):t()}clone(){const e={url:this.url,data:this.data,wrap:this._cloneWrap()};return new Z(e)}cloneWithDeduplication(e){const t=e.get(this);if(t)return t;const n=this.clone();return e.set(this,n),n}_cloneWrap(){return typeof this.wrap=="string"?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}_encodeImageData(e){let t="";for(let n=0;ng-u),f=new Uint32Array(kt(h,m,3));n.push({position:h,faces:f}),r+=h.length,o+=f.length}const a=Zt(n,r,o),s=Wt(a.position.buffer,6,{originalIndices:a.faces});return a.position=new Float64Array(s.buffer),a.faces=s.indices,a}function Zt(e,t,n){if(e.length===1)return e[0];const r=new Float64Array(t),o=new Uint32Array(n);let a=0,s=0,i=0;for(const l of e){for(let u=0;u=0;g--){const y=e[g],R=n===de.CCW_IS_HOLE&&Jt(y);if(R&&r!==1)o[i++]=y;else{let v=y.length;for(let x=0;x0&&(s[u++]={index:f,count:y.length}),f=R?ie(y,y.length-1,-1,m,f,y.length,t):ie(y,0,1,m,f,y.length,t);for(let x=0;x0&&(s[u++]={index:f,count:A.length}),f=ie(A,0,1,m,f,A.length,t)}i=0,b.count>0&&(a[l++]=b)}}for(let g=0;g0&&(s[u++]={index:f,count:y.length}),f=ie(y,0,1,m,f,y.length,t)}return a.length=l,s.length=u,{position:m,polygons:a,outlines:s}}function ie(e,t,n,r,o,a,s){o*=3;for(let i=0;iimport("./loadGLTFMesh.fce23b90.js"),["assets/loadGLTFMesh.fce23b90.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/mat3f64.6d32a1d7.js","assets/BufferView.89055914.js","assets/vec33.4564cd5b.js","assets/DefaultMaterial_COLOR_GAMMA.bf8213a8.js","assets/types.44c7402c.js","assets/mat4f64.ff2a477c.js","assets/enums.2d9e6f64.js","assets/Version.59f2da65.js","assets/quat.b3994f2f.js","assets/quatf64.4ae3e6f1.js","assets/georeference.c844666d.js","assets/imageUtils.753f41b1.js","assets/earcut.afc1d357.js","assets/deduplicate.17ab7923.js"]),n),o=await lt(t,n),a=r(new E({x:0,y:0,z:0,spatialReference:e.spatialReference}),o.url,{resolveFile:on(o),useTransform:!0,signal:c(n)?n.signal:null});a.then(()=>o.dispose(),()=>o.dispose());const{vertexAttributes:s,components:i}=await a;e.vertexAttributes=s,e.components=i}function on(e){const t=wt(e.url);return n=>{var a;const r=vt(n,t,t),o=r?r.replace(/^ *\.\//,""):null;return(a=o?e.files.get(o):null)!=null?a:n}}async function lt(e,t){return e instanceof Blob?K.fromBlob(e):typeof e=="string"?new K(e):Array.isArray(e)?sn(e,t):an(e,t)}async function sn(e,t){const n=new Map;let r=null;const o=await $t(e.map(async s=>({name:s.name,source:await lt(s instanceof Blob?s:s.source,t)}))),a=[];for(const s of o)s&&(bt(t)?s.source.dispose():a.push(s));At(t);for(const{name:s,source:i}of a)(se(r)||/\.(gltf|glb)/i.test(s))&&(r=i.url),n.set(s,i.url),i.files&&i.files.forEach((l,u)=>n.set(u,l));if(se(r))throw new Me("mesh-load-external:missing-files","Missing files to load external mesh source");return new K(r,()=>a.forEach(({source:s})=>s.dispose()),n)}async function an(e,t){const{default:n}=await De(he(()=>import("./index.d94abe07.js").then(function(o){return o.kX}),["assets/index.d94abe07.js","assets/index.f5419ca5.css"]),t),r=typeof e.multipart[0]=="string"?await Promise.all(e.multipart.map(async o=>(await n(o,{responseType:"array-buffer"})).data)):e.multipart;return K.fromBlob(new Blob(r))}class K{constructor(t,n=()=>{},r=new Map){this.url=t,this.dispose=n,this.files=r}static fromBlob(t){const n=URL.createObjectURL(t);return new K(n,()=>URL.revokeObjectURL(n))}}function ln(e,t,n){e.vertexAttributes&&e.vertexAttributes.position&&(c(e.transform)?((n==null?void 0:n.geographic)!=null&&n.geographic!==e.transform.geographic&&$.getLogger("esri.geometry.support.meshUtils.offset").warn(`Specifying the 'geographic' parameter (${n.geographic}) different from the Mesh transform setting (${e.transform.geographic}) is not supported`),cn(e.transform,t)):we(e.spatialReference,n)?un(e,t):pn(e,t))}function cn(e,t){const n=e.origin;e.origin=Ee(M(),n,t)}function un(e,t){const n=e.spatialReference,r=e.vertexAttributes.position,o=e.vertexAttributes.normal,a=e.vertexAttributes.tangent,s=new Float64Array(r.length),i=c(o)?new Float32Array(o.length):null,l=c(a)?new Float32Array(a.length):null,u=e.extent.center,h=hn;et(n,[u.x,u.y,u.z],Be,Ie(n)),tt(Ge,Be),fe(h,t,Ge),Pe(r,n,s),c(o)&&c(i)&&Se(o,r,s,n,i),c(a)&&c(l)&&je(a,r,s,n,l),ct(s,h),Ne(s,r,n),c(o)&&c(i)&&ze(i,r,s,n,o),c(a)&&c(l)&&ke(l,r,s,n,a),e.vertexAttributesChanged()}function pn(e,t){ct(e.vertexAttributes.position,t),e.vertexAttributesChanged()}function ct(e,t){if(e)for(let n=0;n=a&&h=5-1,v=g===2||g===4,b=y?n-1:n;for(let x=0;x<=b;x++){const A=x/b*2*Math.PI,P=y?0:.5;w[0]=P*Math.sin(A),w[1]=P*-Math.cos(A),w[2]=g<=2?.5:-.5;for(let W=0;W<3;W++)o[l++]=w[W],a[u++]=R?W===2?g<=1?1:-1:0:W===2?0:w[W]/P;s[h++]=(x+(y?.5:0))/n,s[h++]=g<=1?1*g/3:g<=3?1*(g-2)/3+1/3:1*(g-4)/3+2/3,v||g===0||x===n||(g!==5&&(i[m++]=f,i[m++]=f+1,i[m++]=f-n),g!==1&&(i[m++]=f,i[m++]=f-n,i[m++]=f-n-1)),f++}}return{position:o,normal:a,uv:s,faces:i}}function yn(e,t){const n=typeof t=="number"?t:t!=null?t.width:1,r=typeof t=="number"?t:t!=null?t.height:1;switch(e){case"up":case"down":return{width:n,depth:r};case"north":case"south":return{width:n,height:r};case"east":case"west":return{depth:n,height:r}}}function xn(e){const t=ne.facingAxisOrderSwap[e],n=ne.position,r=ne.normal,o=new Float64Array(n.length),a=new Float32Array(r.length);let s=0;for(let i=0;i<4;i++){const l=s;for(let u=0;u<3;u++){const h=t[u],m=Math.abs(h)-1,f=h>=0?1:-1;o[s]=n[l+m]*f,a[s]=r[l+m]*f,s++}}return{position:o,normal:a,uv:new Float32Array(ne.uv),faces:new Uint32Array(ne.faces),isPlane:!0}}const H=1,B=2,G=3,ne={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[G,H,B],west:[-G,-H,B],north:[-H,G,B],south:[H,-G,B],up:[H,B,G],down:[H,-B,-G]}};function le(e,t,n){e.isPlane||wn(e),vn(e,n==null?void 0:n.size);const{vertexAttributes:r,transform:o}=jt(e,t,n);return{vertexAttributes:new T({...r,uv:e.uv}),transform:o,components:[new q({faces:e.faces,material:n&&n.material||null})],spatialReference:t.spatialReference}}function wn(e){for(let t=0;t{this.handles.add(_t(()=>{var e;return{vertexAttributes:this.vertexAttributes,components:(e=this.components)==null?void 0:e.map(t=>t.clone())}},()=>this._set("external",null),{once:!0,sync:!0}))})}get hasExtent(){return!this.loaded&&c(this.external)&&c(this.external.extent)||this.loaded&&this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0)}get _boundingInfo(){const e=this.vertexAttributes.position,t=this.spatialReference;if(e.length===0||this.components&&this.components.length===0)return{extent:new Fe({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:t}),center:new E({x:0,y:0,z:0,spatialReference:t})};const n=c(this.transform)?this.transform.project(e,t):e;let r=1/0,o=1/0,a=1/0,s=-1/0,i=-1/0,l=-1/0,u=0,h=0,m=0;const f=n.length,g=1/(f/3);let y=0;for(;yo.cloneWithDeduplication(n,r))}const t={components:e,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),transform:c(this.transform)?this.transform.clone():null,external:c(this.external)?{source:this.external.source,extent:c(this.external.extent)?this.external.extent.clone():null}:null};return new O(t)}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const t=he(()=>import("./gltfexport.b4e546f6.js"),["assets/gltfexport.b4e546f6.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/quat.b3994f2f.js","assets/mat3f64.6d32a1d7.js","assets/quatf64.4ae3e6f1.js","assets/georeference.c844666d.js","assets/mat4f64.ff2a477c.js","assets/BufferView.89055914.js","assets/vec33.4564cd5b.js","assets/enums.2d9e6f64.js","assets/imageutils.9dde1c66.js","assets/imageUtils.753f41b1.js","assets/earcut.afc1d357.js","assets/deduplicate.17ab7923.js"]),n=this.load(),r=await Promise.all([t,n]),{toBinaryGLTF:o}=r[0];return o(this,e)}static createBox(e,t){if(!(e instanceof E))return $.getLogger(z).error(".createBox()","expected location to be a Point instance"),null;const n=new O(le(fn(),e,t));return t&&t.imageFace&&t.imageFace!=="all"?gn(n,t.imageFace):n}static createSphere(e,t){return e instanceof E?new O(le(mn(t&&t.densificationFactor||0),e,t)):($.getLogger(z).error(".createSphere()","expected location to be a Point instance"),null)}static createCylinder(e,t){return e instanceof E?new O(le(dn(t&&t.densificationFactor||0),e,t)):($.getLogger(z).error(".createCylinder()","expected location to be a Point instance"),null)}static createPlane(e,t){var o;if(!(e instanceof E))return $.getLogger(z).error(".createPlane()","expected location to be a Point instance"),null;const n=(o=t==null?void 0:t.facing)!=null?o:"up",r=yn(n,t==null?void 0:t.size);return new O(le(xn(n),e,{...t,size:r}))}static createFromPolygon(e,t){var r;if(!(e instanceof Dt))return $.getLogger(z).error(".createFromPolygon()","expected polygon to be a Polygon instance"),null;const n=Vt(e);return new O({vertexAttributes:new T({position:n.position}),components:[new q({faces:n.faces,shading:"flat",material:(r=t==null?void 0:t.material)!=null?r:null})],spatialReference:e.spatialReference})}static async createFromGLTF(e,t,n){if(!(e instanceof E))throw $.getLogger(z).error(".createfromGLTF()","expected location to be a Point instance"),new Me("invalid-input","Expected location to be a Point instance");const{loadGLTFMesh:r}=await De(he(()=>import("./loadGLTFMesh.fce23b90.js"),["assets/loadGLTFMesh.fce23b90.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/mat3f64.6d32a1d7.js","assets/BufferView.89055914.js","assets/vec33.4564cd5b.js","assets/DefaultMaterial_COLOR_GAMMA.bf8213a8.js","assets/types.44c7402c.js","assets/mat4f64.ff2a477c.js","assets/enums.2d9e6f64.js","assets/Version.59f2da65.js","assets/quat.b3994f2f.js","assets/quatf64.4ae3e6f1.js","assets/georeference.c844666d.js","assets/imageUtils.753f41b1.js","assets/earcut.afc1d357.js","assets/deduplicate.17ab7923.js"]),n);return new O(await r(e,t,n))}static createWithExternalSource(e,t,n){var s,i,l,u;const r=(s=n==null?void 0:n.extent)!=null?s:null,o=(l=(i=n==null?void 0:n.transform)==null?void 0:i.clone())!=null?l:new me;o.origin=[e.x,e.y,(u=e.z)!=null?u:0];const a=e.spatialReference;return new O({external:{source:t,extent:r},transform:o,spatialReference:a})}static createIncomplete(e,t){var a,s,i;const n=(s=(a=t==null?void 0:t.transform)==null?void 0:a.clone())!=null?s:new me;n.origin=[e.x,e.y,(i=e.z)!=null?i:0];const r=e.spatialReference,o=new O({transform:n,spatialReference:r});return o.addResolvingPromise(Promise.reject(new Me("mesh-incomplete","Mesh resources are not complete"))),o}};p([d({type:[q],json:{write:!0}})],F.prototype,"components",void 0),p([d({type:me,json:{write:!0}})],F.prototype,"transform",void 0),p([d({constructOnly:!0})],F.prototype,"external",void 0),p([d({readOnly:!0})],F.prototype,"hasExtent",null),p([d({readOnly:!0})],F.prototype,"_boundingInfo",null),p([d({readOnly:!0})],F.prototype,"anchor",null),p([d({readOnly:!0})],F.prototype,"origin",null),p([d({readOnly:!0,json:{read:!1}})],F.prototype,"extent",null),p([d({readOnly:!0,json:{read:!1,write:!0,default:!0}})],F.prototype,"hasZ",void 0),p([d({readOnly:!0,json:{read:!1,write:!0,default:!1}})],F.prototype,"hasM",void 0),p([d({type:T,nonNullable:!0,json:{write:!0}})],F.prototype,"vertexAttributes",void 0),F=O=p([ee(z)],F);const Ae={x:ve(1,0,0),y:ve(0,1,0),z:ve(0,0,1)},V=ae(),Xe=ae(),Qe=ae(),ce=M(),qe=F;function _n(e,t,n){const r=n.features;n.features=[],delete n.geometryType;const o=Et.fromJSON(n);if(o.geometryType="mesh",!n.assetMaps)return o;const a=Sn(t,n.assetMaps),s=o.spatialReference,i=n.globalIdFieldName,l=se(e.outFields)||!e.outFields.length?()=>({}):Dn(e.outFields.includes("*")?null:new Set(e.outFields));for(const u of r){const h=En(u,i,s,t,a);c(h)&&o.features.push(new It({geometry:h,attributes:l(u)}))}return o}function Dn(e){return({attributes:t})=>{if(!t)return{};if(!e)return t;for(const n in t)e.has(n)||delete t[n];return t}}function En(e,t,n,r,o){const a=e.attributes[t],s=o.get(a);if(s==null||s.status===j.FAILED||s.url==null)return null;const i=In(e,n,r),l=Fe.fromJSON(e.geometry);l.spatialReference=n;const u=Pn(e.attributes,r,s.geographic);return s.status===j.PENDING?qe.createIncomplete(i,{extent:l,transform:u}):qe.createWithExternalSource(i,[{name:s.name,source:s.url}],{extent:l,transform:u})}function In({attributes:e},t,{transformFieldRoles:n}){return new E({x:e[n.originX],y:e[n.originY],z:e[n.originZ],spatialReference:t})}function Pn(e,{transformFieldRoles:t},n){return new me({translation:[e[t.translationX],e[t.translationY],e[t.translationZ]],rotation:ue([e[t.rotationX],e[t.rotationY],e[t.rotationZ]],e[t.rotationDeg]),scale:[e[t.scaleX],e[t.scaleY],e[t.scaleZ]],geographic:n})}var j;function Sn(e,t){const n=new Map;for(const r of t){const o=r.parentGlobalId;if(o==null)continue;const a=r.assetName,s=r.assetURL,i=r.conversionStatus;let l=n.get(o);if(l!=null)throw new Error("multiple asset parts not expected.");switch(l={name:a,status:j.FAILED,url:s,geographic:jn(r.flags).projectVertices},n.set(o,l),i){case"COMPLETED":case"SUBMITTED":l.status=j.COMPLETED;break;case"INPROGRESS":l.status=j.PENDING;break;default:l.status=j.FAILED}}return n}function jn(e){return{projectVertices:e.includes("PROJECT_VERTICES")}}(function(e){e[e.FAILED=0]="FAILED",e[e.PENDING=1]="PENDING",e[e.COMPLETED=2]="COMPLETED"})(j||(j={}));var Gn=Object.freeze(Object.defineProperty({__proto__:null,meshFeatureSetFromJSON:_n},Symbol.toStringTag,{value:"Module"}));export{Gn as a,Ht as c,q as g,oe as m,T as p}; +import{a6 as p,a7 as d,ix as mt,e0 as dt,d2 as yt,a8 as ee,cx as xe,jf as He,d$ as Te,b9 as Ke,c,s as $,cw as k,b4 as _,hE as xt,kS as N,M,cO as De,at as he,af as E,hu as wt,kT as vt,gQ as $t,c1 as bt,v as At,j as se,n as Me,fG as Ee,fO as et,fN as Ie,fV as tt,eb as fe,fE as Tt,O as nt,fD as ge,he as Mt,fM as Ft,kJ as rt,ad as ot,a4 as Rt,hT as Lt,d0 as Ct,cY as Ot,_ as _t,cU as Fe,az as Dt,aj as ve,d3 as Et,d1 as It}from"./index.221827cd.js";import{r as we,b as Pt,x as St,M as Pe,j as Se,a as je,O as Ne,h as ze,L as ke,_ as jt,c as ae,v as Re,g as Le,d as Nt,e as ue,f as me}from"./georeference.1d7480c1.js";import{r as zt}from"./imageUtils.753f41b1.js";import{x as kt}from"./earcut.afc1d357.js";import{n as Wt}from"./deduplicate.ef93b18a.js";import{e as We}from"./mat3f64.6d32a1d7.js";import{e as st}from"./mat4f64.ff2a477c.js";var Z;const $e=new WeakMap;let Ut=0,D=Z=class extends xe{constructor(e){super(e),this.wrap="repeat"}get url(){return this._get("url")||null}set url(e){this._set("url",e),e&&this._set("data",null)}get data(){return this._get("data")||null}set data(e){this._set("data",e),e&&this._set("url",null)}writeData(e,t,n,r){if(e instanceof HTMLImageElement){const o={type:"image-element",src:He(e.src,r),crossOrigin:e.crossOrigin};t[n]=o}else if(e instanceof HTMLCanvasElement){const o=e.getContext("2d").getImageData(0,0,e.width,e.height),a={type:"canvas-element",imageData:this._encodeImageData(o)};t[n]=a}else if(e instanceof HTMLVideoElement){const o={type:"video-element",src:He(e.src,r),autoplay:e.autoplay,loop:e.loop,muted:e.muted,crossOrigin:e.crossOrigin,preload:e.preload};t[n]=o}else{const o={type:"image-data",imageData:this._encodeImageData(e)};t[n]=o}}readData(e){switch(e.type){case"image-element":{const t=new Image;return t.src=e.src,t.crossOrigin=e.crossOrigin,t}case"canvas-element":{const t=this._decodeImageData(e.imageData),n=document.createElement("canvas");return n.width=t.width,n.height=t.height,n.getContext("2d").putImageData(t,0,0),n}case"image-data":return this._decodeImageData(e.imageData);case"video-element":{const t=document.createElement("video");return t.src=e.src,t.crossOrigin=e.crossOrigin,t.autoplay=e.autoplay,t.loop=e.loop,t.muted=e.muted,t.preload=e.preload,t}default:return}}get transparent(){const e=this.data,t=this.url;if(e instanceof HTMLCanvasElement)return this._imageDataContainsTransparent(e.getContext("2d").getImageData(0,0,e.width,e.height));if(e instanceof ImageData)return this._imageDataContainsTransparent(e);if(t){const n=t.substr(t.length-4,4).toLowerCase(),r=t.substr(0,15).toLocaleLowerCase();if(n===".png"||r==="data:image/png;")return!0}return!1}set transparent(e){this._overrideIfSome("transparent",e)}get contentHash(){const e=typeof this.wrap=="string"?this.wrap:typeof this.wrap=="object"?`${this.wrap.horizontal}/${this.wrap.vertical}`:"",t=(n="")=>`d:${n},t:${this.transparent},w:${e}`;return this.url!=null?t(this.url):this.data!=null?this.data instanceof HTMLImageElement||this.data instanceof HTMLVideoElement?t(this.data.src):($e.has(this.data)||$e.set(this.data,++Ut),t($e.get(this.data))):t()}clone(){const e={url:this.url,data:this.data,wrap:this._cloneWrap()};return new Z(e)}cloneWithDeduplication(e){const t=e.get(this);if(t)return t;const n=this.clone();return e.set(this,n),n}_cloneWrap(){return typeof this.wrap=="string"?this.wrap:{horizontal:this.wrap.horizontal,vertical:this.wrap.vertical}}_encodeImageData(e){let t="";for(let n=0;ng-u),f=new Uint32Array(kt(h,m,3));n.push({position:h,faces:f}),r+=h.length,o+=f.length}const a=Zt(n,r,o),s=Wt(a.position.buffer,6,{originalIndices:a.faces});return a.position=new Float64Array(s.buffer),a.faces=s.indices,a}function Zt(e,t,n){if(e.length===1)return e[0];const r=new Float64Array(t),o=new Uint32Array(n);let a=0,s=0,i=0;for(const l of e){for(let u=0;u=0;g--){const y=e[g],R=n===de.CCW_IS_HOLE&&Jt(y);if(R&&r!==1)o[i++]=y;else{let v=y.length;for(let x=0;x0&&(s[u++]={index:f,count:y.length}),f=R?ie(y,y.length-1,-1,m,f,y.length,t):ie(y,0,1,m,f,y.length,t);for(let x=0;x0&&(s[u++]={index:f,count:A.length}),f=ie(A,0,1,m,f,A.length,t)}i=0,b.count>0&&(a[l++]=b)}}for(let g=0;g0&&(s[u++]={index:f,count:y.length}),f=ie(y,0,1,m,f,y.length,t)}return a.length=l,s.length=u,{position:m,polygons:a,outlines:s}}function ie(e,t,n,r,o,a,s){o*=3;for(let i=0;iimport("./loadGLTFMesh.4a319eb1.js"),["assets/loadGLTFMesh.4a319eb1.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/mat3f64.6d32a1d7.js","assets/BufferView.6eee27cd.js","assets/vec33.46fc6802.js","assets/DefaultMaterial_COLOR_GAMMA.8ee780a2.js","assets/types.44c7402c.js","assets/mat4f64.ff2a477c.js","assets/enums.2d9e6f64.js","assets/Version.433fbe58.js","assets/quat.d9562009.js","assets/quatf64.4ae3e6f1.js","assets/georeference.1d7480c1.js","assets/imageUtils.753f41b1.js","assets/earcut.afc1d357.js","assets/deduplicate.ef93b18a.js"]),n),o=await lt(t,n),a=r(new E({x:0,y:0,z:0,spatialReference:e.spatialReference}),o.url,{resolveFile:on(o),useTransform:!0,signal:c(n)?n.signal:null});a.then(()=>o.dispose(),()=>o.dispose());const{vertexAttributes:s,components:i}=await a;e.vertexAttributes=s,e.components=i}function on(e){const t=wt(e.url);return n=>{var a;const r=vt(n,t,t),o=r?r.replace(/^ *\.\//,""):null;return(a=o?e.files.get(o):null)!=null?a:n}}async function lt(e,t){return e instanceof Blob?K.fromBlob(e):typeof e=="string"?new K(e):Array.isArray(e)?sn(e,t):an(e,t)}async function sn(e,t){const n=new Map;let r=null;const o=await $t(e.map(async s=>({name:s.name,source:await lt(s instanceof Blob?s:s.source,t)}))),a=[];for(const s of o)s&&(bt(t)?s.source.dispose():a.push(s));At(t);for(const{name:s,source:i}of a)(se(r)||/\.(gltf|glb)/i.test(s))&&(r=i.url),n.set(s,i.url),i.files&&i.files.forEach((l,u)=>n.set(u,l));if(se(r))throw new Me("mesh-load-external:missing-files","Missing files to load external mesh source");return new K(r,()=>a.forEach(({source:s})=>s.dispose()),n)}async function an(e,t){const{default:n}=await De(he(()=>import("./index.221827cd.js").then(function(o){return o.kX}),["assets/index.221827cd.js","assets/index.f5419ca5.css"]),t),r=typeof e.multipart[0]=="string"?await Promise.all(e.multipart.map(async o=>(await n(o,{responseType:"array-buffer"})).data)):e.multipart;return K.fromBlob(new Blob(r))}class K{constructor(t,n=()=>{},r=new Map){this.url=t,this.dispose=n,this.files=r}static fromBlob(t){const n=URL.createObjectURL(t);return new K(n,()=>URL.revokeObjectURL(n))}}function ln(e,t,n){e.vertexAttributes&&e.vertexAttributes.position&&(c(e.transform)?((n==null?void 0:n.geographic)!=null&&n.geographic!==e.transform.geographic&&$.getLogger("esri.geometry.support.meshUtils.offset").warn(`Specifying the 'geographic' parameter (${n.geographic}) different from the Mesh transform setting (${e.transform.geographic}) is not supported`),cn(e.transform,t)):we(e.spatialReference,n)?un(e,t):pn(e,t))}function cn(e,t){const n=e.origin;e.origin=Ee(M(),n,t)}function un(e,t){const n=e.spatialReference,r=e.vertexAttributes.position,o=e.vertexAttributes.normal,a=e.vertexAttributes.tangent,s=new Float64Array(r.length),i=c(o)?new Float32Array(o.length):null,l=c(a)?new Float32Array(a.length):null,u=e.extent.center,h=hn;et(n,[u.x,u.y,u.z],Be,Ie(n)),tt(Ge,Be),fe(h,t,Ge),Pe(r,n,s),c(o)&&c(i)&&Se(o,r,s,n,i),c(a)&&c(l)&&je(a,r,s,n,l),ct(s,h),Ne(s,r,n),c(o)&&c(i)&&ze(i,r,s,n,o),c(a)&&c(l)&&ke(l,r,s,n,a),e.vertexAttributesChanged()}function pn(e,t){ct(e.vertexAttributes.position,t),e.vertexAttributesChanged()}function ct(e,t){if(e)for(let n=0;n=a&&h=5-1,v=g===2||g===4,b=y?n-1:n;for(let x=0;x<=b;x++){const A=x/b*2*Math.PI,P=y?0:.5;w[0]=P*Math.sin(A),w[1]=P*-Math.cos(A),w[2]=g<=2?.5:-.5;for(let W=0;W<3;W++)o[l++]=w[W],a[u++]=R?W===2?g<=1?1:-1:0:W===2?0:w[W]/P;s[h++]=(x+(y?.5:0))/n,s[h++]=g<=1?1*g/3:g<=3?1*(g-2)/3+1/3:1*(g-4)/3+2/3,v||g===0||x===n||(g!==5&&(i[m++]=f,i[m++]=f+1,i[m++]=f-n),g!==1&&(i[m++]=f,i[m++]=f-n,i[m++]=f-n-1)),f++}}return{position:o,normal:a,uv:s,faces:i}}function yn(e,t){const n=typeof t=="number"?t:t!=null?t.width:1,r=typeof t=="number"?t:t!=null?t.height:1;switch(e){case"up":case"down":return{width:n,depth:r};case"north":case"south":return{width:n,height:r};case"east":case"west":return{depth:n,height:r}}}function xn(e){const t=ne.facingAxisOrderSwap[e],n=ne.position,r=ne.normal,o=new Float64Array(n.length),a=new Float32Array(r.length);let s=0;for(let i=0;i<4;i++){const l=s;for(let u=0;u<3;u++){const h=t[u],m=Math.abs(h)-1,f=h>=0?1:-1;o[s]=n[l+m]*f,a[s]=r[l+m]*f,s++}}return{position:o,normal:a,uv:new Float32Array(ne.uv),faces:new Uint32Array(ne.faces),isPlane:!0}}const H=1,B=2,G=3,ne={position:[-.5,-.5,0,.5,-.5,0,.5,.5,0,-.5,.5,0],normal:[0,0,1,0,0,1,0,0,1,0,0,1],uv:[0,1,1,1,1,0,0,0],faces:[0,1,2,0,2,3],facingAxisOrderSwap:{east:[G,H,B],west:[-G,-H,B],north:[-H,G,B],south:[H,-G,B],up:[H,B,G],down:[H,-B,-G]}};function le(e,t,n){e.isPlane||wn(e),vn(e,n==null?void 0:n.size);const{vertexAttributes:r,transform:o}=jt(e,t,n);return{vertexAttributes:new T({...r,uv:e.uv}),transform:o,components:[new q({faces:e.faces,material:n&&n.material||null})],spatialReference:t.spatialReference}}function wn(e){for(let t=0;t{this.handles.add(_t(()=>{var e;return{vertexAttributes:this.vertexAttributes,components:(e=this.components)==null?void 0:e.map(t=>t.clone())}},()=>this._set("external",null),{once:!0,sync:!0}))})}get hasExtent(){return!this.loaded&&c(this.external)&&c(this.external.extent)||this.loaded&&this.vertexAttributes.position.length>0&&(!this.components||this.components.length>0)}get _boundingInfo(){const e=this.vertexAttributes.position,t=this.spatialReference;if(e.length===0||this.components&&this.components.length===0)return{extent:new Fe({xmin:0,ymin:0,zmin:0,xmax:0,ymax:0,zmax:0,spatialReference:t}),center:new E({x:0,y:0,z:0,spatialReference:t})};const n=c(this.transform)?this.transform.project(e,t):e;let r=1/0,o=1/0,a=1/0,s=-1/0,i=-1/0,l=-1/0,u=0,h=0,m=0;const f=n.length,g=1/(f/3);let y=0;for(;yo.cloneWithDeduplication(n,r))}const t={components:e,spatialReference:this.spatialReference,vertexAttributes:this.vertexAttributes.clone(),transform:c(this.transform)?this.transform.clone():null,external:c(this.external)?{source:this.external.source,extent:c(this.external.extent)?this.external.extent.clone():null}:null};return new O(t)}vertexAttributesChanged(){this.notifyChange("vertexAttributes")}async toBinaryGLTF(e){const t=he(()=>import("./gltfexport.4b9e2f8e.js"),["assets/gltfexport.4b9e2f8e.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/quat.d9562009.js","assets/mat3f64.6d32a1d7.js","assets/quatf64.4ae3e6f1.js","assets/georeference.1d7480c1.js","assets/mat4f64.ff2a477c.js","assets/BufferView.6eee27cd.js","assets/vec33.46fc6802.js","assets/enums.2d9e6f64.js","assets/imageutils.5e4d6270.js","assets/imageUtils.753f41b1.js","assets/earcut.afc1d357.js","assets/deduplicate.ef93b18a.js"]),n=this.load(),r=await Promise.all([t,n]),{toBinaryGLTF:o}=r[0];return o(this,e)}static createBox(e,t){if(!(e instanceof E))return $.getLogger(z).error(".createBox()","expected location to be a Point instance"),null;const n=new O(le(fn(),e,t));return t&&t.imageFace&&t.imageFace!=="all"?gn(n,t.imageFace):n}static createSphere(e,t){return e instanceof E?new O(le(mn(t&&t.densificationFactor||0),e,t)):($.getLogger(z).error(".createSphere()","expected location to be a Point instance"),null)}static createCylinder(e,t){return e instanceof E?new O(le(dn(t&&t.densificationFactor||0),e,t)):($.getLogger(z).error(".createCylinder()","expected location to be a Point instance"),null)}static createPlane(e,t){var o;if(!(e instanceof E))return $.getLogger(z).error(".createPlane()","expected location to be a Point instance"),null;const n=(o=t==null?void 0:t.facing)!=null?o:"up",r=yn(n,t==null?void 0:t.size);return new O(le(xn(n),e,{...t,size:r}))}static createFromPolygon(e,t){var r;if(!(e instanceof Dt))return $.getLogger(z).error(".createFromPolygon()","expected polygon to be a Polygon instance"),null;const n=Vt(e);return new O({vertexAttributes:new T({position:n.position}),components:[new q({faces:n.faces,shading:"flat",material:(r=t==null?void 0:t.material)!=null?r:null})],spatialReference:e.spatialReference})}static async createFromGLTF(e,t,n){if(!(e instanceof E))throw $.getLogger(z).error(".createfromGLTF()","expected location to be a Point instance"),new Me("invalid-input","Expected location to be a Point instance");const{loadGLTFMesh:r}=await De(he(()=>import("./loadGLTFMesh.4a319eb1.js"),["assets/loadGLTFMesh.4a319eb1.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/mat3f64.6d32a1d7.js","assets/BufferView.6eee27cd.js","assets/vec33.46fc6802.js","assets/DefaultMaterial_COLOR_GAMMA.8ee780a2.js","assets/types.44c7402c.js","assets/mat4f64.ff2a477c.js","assets/enums.2d9e6f64.js","assets/Version.433fbe58.js","assets/quat.d9562009.js","assets/quatf64.4ae3e6f1.js","assets/georeference.1d7480c1.js","assets/imageUtils.753f41b1.js","assets/earcut.afc1d357.js","assets/deduplicate.ef93b18a.js"]),n);return new O(await r(e,t,n))}static createWithExternalSource(e,t,n){var s,i,l,u;const r=(s=n==null?void 0:n.extent)!=null?s:null,o=(l=(i=n==null?void 0:n.transform)==null?void 0:i.clone())!=null?l:new me;o.origin=[e.x,e.y,(u=e.z)!=null?u:0];const a=e.spatialReference;return new O({external:{source:t,extent:r},transform:o,spatialReference:a})}static createIncomplete(e,t){var a,s,i;const n=(s=(a=t==null?void 0:t.transform)==null?void 0:a.clone())!=null?s:new me;n.origin=[e.x,e.y,(i=e.z)!=null?i:0];const r=e.spatialReference,o=new O({transform:n,spatialReference:r});return o.addResolvingPromise(Promise.reject(new Me("mesh-incomplete","Mesh resources are not complete"))),o}};p([d({type:[q],json:{write:!0}})],F.prototype,"components",void 0),p([d({type:me,json:{write:!0}})],F.prototype,"transform",void 0),p([d({constructOnly:!0})],F.prototype,"external",void 0),p([d({readOnly:!0})],F.prototype,"hasExtent",null),p([d({readOnly:!0})],F.prototype,"_boundingInfo",null),p([d({readOnly:!0})],F.prototype,"anchor",null),p([d({readOnly:!0})],F.prototype,"origin",null),p([d({readOnly:!0,json:{read:!1}})],F.prototype,"extent",null),p([d({readOnly:!0,json:{read:!1,write:!0,default:!0}})],F.prototype,"hasZ",void 0),p([d({readOnly:!0,json:{read:!1,write:!0,default:!1}})],F.prototype,"hasM",void 0),p([d({type:T,nonNullable:!0,json:{write:!0}})],F.prototype,"vertexAttributes",void 0),F=O=p([ee(z)],F);const Ae={x:ve(1,0,0),y:ve(0,1,0),z:ve(0,0,1)},V=ae(),Xe=ae(),Qe=ae(),ce=M(),qe=F;function _n(e,t,n){const r=n.features;n.features=[],delete n.geometryType;const o=Et.fromJSON(n);if(o.geometryType="mesh",!n.assetMaps)return o;const a=Sn(t,n.assetMaps),s=o.spatialReference,i=n.globalIdFieldName,l=se(e.outFields)||!e.outFields.length?()=>({}):Dn(e.outFields.includes("*")?null:new Set(e.outFields));for(const u of r){const h=En(u,i,s,t,a);c(h)&&o.features.push(new It({geometry:h,attributes:l(u)}))}return o}function Dn(e){return({attributes:t})=>{if(!t)return{};if(!e)return t;for(const n in t)e.has(n)||delete t[n];return t}}function En(e,t,n,r,o){const a=e.attributes[t],s=o.get(a);if(s==null||s.status===j.FAILED||s.url==null)return null;const i=In(e,n,r),l=Fe.fromJSON(e.geometry);l.spatialReference=n;const u=Pn(e.attributes,r,s.geographic);return s.status===j.PENDING?qe.createIncomplete(i,{extent:l,transform:u}):qe.createWithExternalSource(i,[{name:s.name,source:s.url}],{extent:l,transform:u})}function In({attributes:e},t,{transformFieldRoles:n}){return new E({x:e[n.originX],y:e[n.originY],z:e[n.originZ],spatialReference:t})}function Pn(e,{transformFieldRoles:t},n){return new me({translation:[e[t.translationX],e[t.translationY],e[t.translationZ]],rotation:ue([e[t.rotationX],e[t.rotationY],e[t.rotationZ]],e[t.rotationDeg]),scale:[e[t.scaleX],e[t.scaleY],e[t.scaleZ]],geographic:n})}var j;function Sn(e,t){const n=new Map;for(const r of t){const o=r.parentGlobalId;if(o==null)continue;const a=r.assetName,s=r.assetURL,i=r.conversionStatus;let l=n.get(o);if(l!=null)throw new Error("multiple asset parts not expected.");switch(l={name:a,status:j.FAILED,url:s,geographic:jn(r.flags).projectVertices},n.set(o,l),i){case"COMPLETED":case"SUBMITTED":l.status=j.COMPLETED;break;case"INPROGRESS":l.status=j.PENDING;break;default:l.status=j.FAILED}}return n}function jn(e){return{projectVertices:e.includes("PROJECT_VERTICES")}}(function(e){e[e.FAILED=0]="FAILED",e[e.PENDING=1]="PENDING",e[e.COMPLETED=2]="COMPLETED"})(j||(j={}));var Gn=Object.freeze(Object.defineProperty({__proto__:null,meshFeatureSetFromJSON:_n},Symbol.toStringTag,{value:"Module"}));export{Gn as a,Ht as c,q as g,oe as m,T as p}; diff --git a/assets/multidimensionalUtils.4f713da1.js b/assets/multidimensionalUtils.59c05ac5.js similarity index 99% rename from assets/multidimensionalUtils.4f713da1.js rename to assets/multidimensionalUtils.59c05ac5.js index 2a54420..5e18ddd 100644 --- a/assets/multidimensionalUtils.4f713da1.js +++ b/assets/multidimensionalUtils.59c05ac5.js @@ -1 +1 @@ -import{a6 as y,a7 as w,dN as N,a8 as x,cx as I,b4 as j,c as T,j as D}from"./index.d94abe07.js";var C;let h=C=class extends I{constructor(e){super(e),this.variableName=null,this.dimensionName=null,this.values=[],this.isSlice=!1}clone(){return new C({variableName:this.variableName,dimensionName:this.dimensionName,values:j(this.values),isSlice:this.isSlice})}};y([w({type:String,json:{write:!0}})],h.prototype,"variableName",void 0),y([w({type:String,json:{write:!0}})],h.prototype,"dimensionName",void 0),y([w({type:N.array(N.oneOf([N.native(Number),N.array(N.native(Number))])),json:{write:!0}})],h.prototype,"values",void 0),y([w({type:Boolean,json:{write:!0}})],h.prototype,"isSlice",void 0),h=C=y([x("esri.layers.support.DimensionalDefinition")],h);const U=h;function S(e,n,a){var t;const o=n.shift();if(a.length===0){const s=[];a.push({sliceId:-1,multidimensionalDefinition:s})}const i=a.length;for(let s=0;s{a.push({sliceId:-1,multidimensionalDefinition:[...u,{variableName:e,dimensionName:o.name,values:[m]}]})})}n.length&&S(e,n,a)}function R(e,n){const a=[];let o=0;return(n?e.variables.filter(i=>i.name.toLowerCase()===n.toLowerCase()):[...e.variables].sort((i,t)=>i.name>t.name?1:-1)).forEach(i=>{const t=[],s=[...i.dimensions].sort((u,m)=>u.name>m.name?-1:1);S(i.name,s,t),t.forEach(u=>{a.push({...u,sliceId:o++})})}),a}function $(e,n,a){let o=e;if(n&&(n=[...n].sort((i,t)=>i.dimensionName{t.length&&(o=o.filter(u=>{const m=u.multidimensionalDefinition.find(r=>r.dimensionName===i);if(m==null)return!1;const l=m.values[0];return typeof l=="number"?typeof t[0]=="number"?t.includes(l):t.some(r=>r[0]<=l&&r[1]>=l):typeof t[0]=="number"?t.some(r=>l[0]<=r&&l[1]>=r):s?t.some(r=>r[0]===l[0]&&r[0]===l[1]):t.some(r=>r[0]>=l[0]&&r[0]<=l[1]||r[1]>=l[0]&&r[1]<=l[1]||r[0]l[1])}))}),o.length&&a&&T(a.start)&&T(a.end)){const i=a.start.getTime(),t=a.end.getTime(),s=o[0].multidimensionalDefinition.findIndex(u=>u.dimensionName==="StdTime");s>-1&&(o=o.filter(u=>{const m=u.multidimensionalDefinition[s].values[0];return i<=m&&t>=m}))}return o.map(i=>i.sliceId)}function A(e,n){return Array.isArray(e)?n[0]===n[1]?e[0]===n[0]||e[1]===n[0]:e[0]>=n[0]&&e[0]<=n[1]&&e[1]>=n[0]&&e[1]<=n[1]:e>=n[0]&&e<=n[1]}function E(e,n){return e[0]<=n[0]&&e[1]>=n[0]||e[0]<=n[1]&&e[1]>=n[1]||e[0]>=n[0]&&e[1]<=n[1]}function F(e){return e.length===1?[e[0],e[0]]:[e[0],e[e.length-1]]}function Y(e,n,a){var s,u,m;if(!((s=n==null?void 0:n.subsetDefinitions)!=null&&s.length))return e;let o;if(a){const{variables:l}=n;if(l.length&&!l.includes(a))return null;const r=n.subsetDefinitions.find(c=>c.dimensionName===e.name&&c.variableName===a);if(!((u=r==null?void 0:r.values)!=null&&u.length))return e;o=F(r.values)}else o=(m=n.dimensions.find(({name:l})=>l===e.name))==null?void 0:m.extent;const i=o;if(!i||!(i!=null&&i.length))return e;const t=e.values.filter(l=>A(l,i));return{...e,extent:[...i],values:t}}function z(e,n,a){var i;if(!((i=n==null?void 0:n.subsetDefinitions)!=null&&i.length))return!1;const{variables:o}=n;if(o.length&&e.some(({variableName:t})=>t&&!o.includes(t)))return!0;for(let t=0;t(s.variableName===""||m.variableName===s.variableName)&&m.dimensionName===s.dimensionName);if(u!=null&&u.values.length){const m=F(u.values);if(!s.isSlice&&s.values.length===2&&!Array.isArray(s.values[0])&&s.values[0]!==s.values[1]&&a){if(!E(s.values,m))return!0}else if(s.values.some(l=>!A(l,m)))return!0}}return!1}function B(e,n={}){var c,v,b;const{multidimensionalInfo:a,keyProperties:o}=e;if(D(a))return null;const i=n.variableName||(o==null?void 0:o.DefaultVariable);let{variables:t}=a;const{multidimensionalSubset:s}=n;(c=s==null?void 0:s.variables)!=null&&c.length&&(t=t.filter(({name:f})=>s.variables.includes(f)));const u=i&&(v=t.find(({name:f})=>f===i))!=null?v:t[0];if(!u)return null;const m=[],{dimensions:l,name:r}=u;if(l.length===0)return[new U({variableName:r,dimensionName:"",values:[],isSlice:!0})];for(let f=0;f{if(n.values==null)return!0;const a=n.values.length;return a===0||a>1||!n.isSlice&&Array.isArray(n.values[0])})}function V(e,n){var o;if(D(n)||D(e))return null;let a=n.variables.map(i=>({...i}));return(o=e==null?void 0:e.variables)!=null&&o.length&&(a=a.filter(({name:i})=>e.variables.includes(i)),a.forEach(i=>{i.dimensions=i.dimensions.map(t=>Y(t,e,i.name))})),a}function L(e,n){var u;const{values:a}=n;if(a!=null&&a.length)return Array.isArray(a[0])!==Array.isArray(e)?-1:Array.isArray(a[0])?a.findIndex(m=>m[0]===e[0]&&m[1]===e[1]):a.indexOf(e);const{extent:o}=n;if(Array.isArray(e)||eo[1])return-1;const i=n.interval||1;if(n.unit!=="ISO8601")return Math.round((e-o[0])/i);const t=o[0];let s=-1;switch(((u=n.intervalUnit)==null?void 0:u.toLowerCase())||"seconds"){case"seconds":s=Math.round((e-t)/1e3/i);break;case"minutes":s=Math.round((e-t)/6e4/i);break;case"hours":s=Math.round((e-t)/36e5/i);break;case"days":s=Math.round((e-t)/864e5/i);break;case"months":{const m=new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear(),l=new Date(t).getUTCMonth(),r=new Date(e).getUTCMonth();s=m===0?r-l:r+11-l+12*(m-1)}break;case"years":s=Math.round((new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear())/i);break;case"decades":s=Math.round((new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear())/10/i)}return s}function k(e){var s,u,m;let n=(s=e.values)==null?void 0:s.length;if(n)return n;const{extent:a,unit:o}=e,i=e.interval||1,t=a?a[1]-a[0]:0;if(o!=="ISO8601")return Math.round(t/i);switch((m=(u=e.intervalUnit)==null?void 0:u.toLowerCase())!=null?m:"seconds"){case"seconds":n=Math.round(t/1e3/i);break;case"minutes":n=Math.round(t/6e4/i);break;case"hours":n=Math.round(t/36e5/i);break;case"days":n=Math.round(t/864e5/i);break;case"months":{const l=new Date(a[1]).getUTCFullYear()-new Date(a[0]).getUTCFullYear(),r=new Date(a[1][0]).getUTCMonth(),c=new Date(a[1][1]).getUTCMonth();n=l===0?c-r+1:c+11-r+12*(l-1)+1}break;case"years":n=Math.round((new Date(a[1]).getUTCFullYear()-new Date(a[0]).getUTCFullYear())/i);break;case"decades":n=Math.round((new Date(a[1]).getUTCFullYear()-new Date(a[0]).getUTCFullYear())/10/i);break;default:n=0}return n}function q(e,n){let a=0;const o=e[0].variableName,i=[...n.variables].sort((t,s)=>t.name>s.name?1:-1);for(let t=0;tr.name>c.name?-1:1);if(s.name!==o){a+=u.map(r=>k(r)).reduce((r,c)=>r*c);continue}const m=u.map(r=>k(r)),l=u.length;for(let r=0;rb.dimensionName===u[r].name);if(c==null)return null;const v=L(c.values[0],u[r]);if(v===-1)return null;m.shift(),a+=r===l-1?v:v*m.reduce((b,f)=>b*f)}break}return a}export{B as c,V as d,P as f,q as g,R as i,z as m,U as p,$ as s}; +import{a6 as y,a7 as w,dN as N,a8 as x,cx as I,b4 as j,c as T,j as D}from"./index.221827cd.js";var C;let h=C=class extends I{constructor(e){super(e),this.variableName=null,this.dimensionName=null,this.values=[],this.isSlice=!1}clone(){return new C({variableName:this.variableName,dimensionName:this.dimensionName,values:j(this.values),isSlice:this.isSlice})}};y([w({type:String,json:{write:!0}})],h.prototype,"variableName",void 0),y([w({type:String,json:{write:!0}})],h.prototype,"dimensionName",void 0),y([w({type:N.array(N.oneOf([N.native(Number),N.array(N.native(Number))])),json:{write:!0}})],h.prototype,"values",void 0),y([w({type:Boolean,json:{write:!0}})],h.prototype,"isSlice",void 0),h=C=y([x("esri.layers.support.DimensionalDefinition")],h);const U=h;function S(e,n,a){var t;const o=n.shift();if(a.length===0){const s=[];a.push({sliceId:-1,multidimensionalDefinition:s})}const i=a.length;for(let s=0;s{a.push({sliceId:-1,multidimensionalDefinition:[...u,{variableName:e,dimensionName:o.name,values:[m]}]})})}n.length&&S(e,n,a)}function R(e,n){const a=[];let o=0;return(n?e.variables.filter(i=>i.name.toLowerCase()===n.toLowerCase()):[...e.variables].sort((i,t)=>i.name>t.name?1:-1)).forEach(i=>{const t=[],s=[...i.dimensions].sort((u,m)=>u.name>m.name?-1:1);S(i.name,s,t),t.forEach(u=>{a.push({...u,sliceId:o++})})}),a}function $(e,n,a){let o=e;if(n&&(n=[...n].sort((i,t)=>i.dimensionName{t.length&&(o=o.filter(u=>{const m=u.multidimensionalDefinition.find(r=>r.dimensionName===i);if(m==null)return!1;const l=m.values[0];return typeof l=="number"?typeof t[0]=="number"?t.includes(l):t.some(r=>r[0]<=l&&r[1]>=l):typeof t[0]=="number"?t.some(r=>l[0]<=r&&l[1]>=r):s?t.some(r=>r[0]===l[0]&&r[0]===l[1]):t.some(r=>r[0]>=l[0]&&r[0]<=l[1]||r[1]>=l[0]&&r[1]<=l[1]||r[0]l[1])}))}),o.length&&a&&T(a.start)&&T(a.end)){const i=a.start.getTime(),t=a.end.getTime(),s=o[0].multidimensionalDefinition.findIndex(u=>u.dimensionName==="StdTime");s>-1&&(o=o.filter(u=>{const m=u.multidimensionalDefinition[s].values[0];return i<=m&&t>=m}))}return o.map(i=>i.sliceId)}function A(e,n){return Array.isArray(e)?n[0]===n[1]?e[0]===n[0]||e[1]===n[0]:e[0]>=n[0]&&e[0]<=n[1]&&e[1]>=n[0]&&e[1]<=n[1]:e>=n[0]&&e<=n[1]}function E(e,n){return e[0]<=n[0]&&e[1]>=n[0]||e[0]<=n[1]&&e[1]>=n[1]||e[0]>=n[0]&&e[1]<=n[1]}function F(e){return e.length===1?[e[0],e[0]]:[e[0],e[e.length-1]]}function Y(e,n,a){var s,u,m;if(!((s=n==null?void 0:n.subsetDefinitions)!=null&&s.length))return e;let o;if(a){const{variables:l}=n;if(l.length&&!l.includes(a))return null;const r=n.subsetDefinitions.find(c=>c.dimensionName===e.name&&c.variableName===a);if(!((u=r==null?void 0:r.values)!=null&&u.length))return e;o=F(r.values)}else o=(m=n.dimensions.find(({name:l})=>l===e.name))==null?void 0:m.extent;const i=o;if(!i||!(i!=null&&i.length))return e;const t=e.values.filter(l=>A(l,i));return{...e,extent:[...i],values:t}}function z(e,n,a){var i;if(!((i=n==null?void 0:n.subsetDefinitions)!=null&&i.length))return!1;const{variables:o}=n;if(o.length&&e.some(({variableName:t})=>t&&!o.includes(t)))return!0;for(let t=0;t(s.variableName===""||m.variableName===s.variableName)&&m.dimensionName===s.dimensionName);if(u!=null&&u.values.length){const m=F(u.values);if(!s.isSlice&&s.values.length===2&&!Array.isArray(s.values[0])&&s.values[0]!==s.values[1]&&a){if(!E(s.values,m))return!0}else if(s.values.some(l=>!A(l,m)))return!0}}return!1}function B(e,n={}){var c,v,b;const{multidimensionalInfo:a,keyProperties:o}=e;if(D(a))return null;const i=n.variableName||(o==null?void 0:o.DefaultVariable);let{variables:t}=a;const{multidimensionalSubset:s}=n;(c=s==null?void 0:s.variables)!=null&&c.length&&(t=t.filter(({name:f})=>s.variables.includes(f)));const u=i&&(v=t.find(({name:f})=>f===i))!=null?v:t[0];if(!u)return null;const m=[],{dimensions:l,name:r}=u;if(l.length===0)return[new U({variableName:r,dimensionName:"",values:[],isSlice:!0})];for(let f=0;f{if(n.values==null)return!0;const a=n.values.length;return a===0||a>1||!n.isSlice&&Array.isArray(n.values[0])})}function V(e,n){var o;if(D(n)||D(e))return null;let a=n.variables.map(i=>({...i}));return(o=e==null?void 0:e.variables)!=null&&o.length&&(a=a.filter(({name:i})=>e.variables.includes(i)),a.forEach(i=>{i.dimensions=i.dimensions.map(t=>Y(t,e,i.name))})),a}function L(e,n){var u;const{values:a}=n;if(a!=null&&a.length)return Array.isArray(a[0])!==Array.isArray(e)?-1:Array.isArray(a[0])?a.findIndex(m=>m[0]===e[0]&&m[1]===e[1]):a.indexOf(e);const{extent:o}=n;if(Array.isArray(e)||eo[1])return-1;const i=n.interval||1;if(n.unit!=="ISO8601")return Math.round((e-o[0])/i);const t=o[0];let s=-1;switch(((u=n.intervalUnit)==null?void 0:u.toLowerCase())||"seconds"){case"seconds":s=Math.round((e-t)/1e3/i);break;case"minutes":s=Math.round((e-t)/6e4/i);break;case"hours":s=Math.round((e-t)/36e5/i);break;case"days":s=Math.round((e-t)/864e5/i);break;case"months":{const m=new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear(),l=new Date(t).getUTCMonth(),r=new Date(e).getUTCMonth();s=m===0?r-l:r+11-l+12*(m-1)}break;case"years":s=Math.round((new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear())/i);break;case"decades":s=Math.round((new Date(e).getUTCFullYear()-new Date(t).getUTCFullYear())/10/i)}return s}function k(e){var s,u,m;let n=(s=e.values)==null?void 0:s.length;if(n)return n;const{extent:a,unit:o}=e,i=e.interval||1,t=a?a[1]-a[0]:0;if(o!=="ISO8601")return Math.round(t/i);switch((m=(u=e.intervalUnit)==null?void 0:u.toLowerCase())!=null?m:"seconds"){case"seconds":n=Math.round(t/1e3/i);break;case"minutes":n=Math.round(t/6e4/i);break;case"hours":n=Math.round(t/36e5/i);break;case"days":n=Math.round(t/864e5/i);break;case"months":{const l=new Date(a[1]).getUTCFullYear()-new Date(a[0]).getUTCFullYear(),r=new Date(a[1][0]).getUTCMonth(),c=new Date(a[1][1]).getUTCMonth();n=l===0?c-r+1:c+11-r+12*(l-1)+1}break;case"years":n=Math.round((new Date(a[1]).getUTCFullYear()-new Date(a[0]).getUTCFullYear())/i);break;case"decades":n=Math.round((new Date(a[1]).getUTCFullYear()-new Date(a[0]).getUTCFullYear())/10/i);break;default:n=0}return n}function q(e,n){let a=0;const o=e[0].variableName,i=[...n.variables].sort((t,s)=>t.name>s.name?1:-1);for(let t=0;tr.name>c.name?-1:1);if(s.name!==o){a+=u.map(r=>k(r)).reduce((r,c)=>r*c);continue}const m=u.map(r=>k(r)),l=u.length;for(let r=0;rb.dimensionName===u[r].name);if(c==null)return null;const v=L(c.values[0],u[r]);if(v===-1)return null;m.shift(),a+=r===l-1?v:v*m.reduce((b,f)=>b*f)}break}return a}export{B as c,V as d,P as f,q as g,R as i,z as m,U as p,$ as s}; diff --git a/assets/nonChromiumPlatformUtils.79814374.js b/assets/nonChromiumPlatformUtils.a164ac17.js similarity index 98% rename from assets/nonChromiumPlatformUtils.79814374.js rename to assets/nonChromiumPlatformUtils.a164ac17.js index 3338093..af45ea2 100644 --- a/assets/nonChromiumPlatformUtils.79814374.js +++ b/assets/nonChromiumPlatformUtils.a164ac17.js @@ -1,4 +1,4 @@ -import{e as O}from"./tooltip.e0637362.js";import"./index.d94abe07.js";import"./guid.ae96513b.js";/*! +import{e as O}from"./tooltip.1fb2f0ea.js";import"./index.221827cd.js";import"./guid.ae96513b.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.0-beta.97 diff --git a/assets/normalizeUtilsSync.757b5fd1.js b/assets/normalizeUtilsSync.4d52fbd0.js similarity index 98% rename from assets/normalizeUtilsSync.757b5fd1.js rename to assets/normalizeUtilsSync.4d52fbd0.js index 17f7b19..938e931 100644 --- a/assets/normalizeUtilsSync.757b5fd1.js +++ b/assets/normalizeUtilsSync.4d52fbd0.js @@ -1 +1 @@ -import{ay as V,j as A,ax as J,bB as N,bC as S,aY as R,aZ as X,aW as j,aC as B,aV as b,aO as D,bD as E,bE as F,bF as p}from"./index.d94abe07.js";function G(t){return k(t,!0)}function H(t){return k(t,!1)}function k(t,s){if(A(t))return null;const n=t.spatialReference,i=J(n),e="toJSON"in t?t.toJSON():t;if(!i)return e;const h=N(n)?102100:4326,u=S[h].maxX,_=S[h].minX;if(R(e))return T(e,u,_);if(X(e))return e.points=e.points.map(o=>T(o,u,_)),e;if(j(e))return W(e,i);if(B(e)||b(e)){const o=D(Z,e),r={xmin:o[0],ymin:o[1],xmax:o[2],ymax:o[3]},x=p(r.xmin,_)*(2*u),m=x===0?e:E(e,x);return r.xmin+=x,r.xmax+=x,r.xmax>u?L(m,u,s):r.xmin<_?L(m,_,s):m}return e}function W(t,s){if(!s)return t;const n=Y(t,s).map(i=>i.extent);return n.length<2?n[0]||t:n.length>2?(t.xmin=s.valid[0],t.xmax=s.valid[1],t):{rings:n.map(i=>[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]])}}function T(t,s,n){if(Array.isArray(t)){const i=t[0];if(i>s){const e=p(i,s);t[0]=i+e*(-2*s)}else if(is){const e=p(i,s);t.x+=e*(-2*s)}else if(i0;if(_>2*r){const g={xmin:hl||M?n.push(new a({xmin:x,ymin:i,xmax:r,ymax:e},[m]),new a({xmin:o,ymin:i,xmax:l,ymax:e},[c])):n.push(new a({xmin:x,ymin:i,xmax:l,ymax:e},[m]));return n}function w(t,s){const[n,i]=s.valid,e=2*i;let h,u=0;return t>i?(h=Math.ceil(Math.abs(t-i)/e),t-=h*e,u=h):t=t.xmin&&s<=t.xmax&&n>=t.ymin&&n<=t.ymax}function L(t,s,n=!0){const i=!b(t);if(i&&F(t),n)return new q().cut(t,s);const e=i?t.rings:t.paths,h=i?4:2,u=e.length,_=-2*s;for(let o=0;o=h){const x=[];for(const m of r)x.push([m[0]+_,m[1]]);e.push(x)}}return i?t.rings=e:t.paths=e,t}class a{constructor(s,n){this.extent=s,this.frameIds=n}}const Z=V();class q{constructor(){this._linesIn=[],this._linesOut=[]}cut(s,n){let i;if(this._xCut=n,s.rings)this._closed=!0,i=s.rings,this._minPts=4;else{if(!s.paths)return null;this._closed=!1,i=s.paths,this._minPts=2}for(const h of i){if(!h||h.length=this._minPts&&i.push(h);const e=-2*this._xCut;for(const h of this._linesOut)if(h&&h.length>=this._minPts){for(const u of h)u[0]+=e;i.push(h)}return this._closed?s.rings=i:s.paths=i,s}moveTo(s){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(s[0]),this._moveTo(s[0],s[1],this._prevSide),this._prevPt=s,this._firstPt=s}lineTo(s){const n=this._side(s[0]);if(n*this._prevSide==-1){const i=this._intersect(this._prevPt,s);this._lineTo(this._xCut,i,0),this._prevSide=0,this._lineTo(s[0],s[1],n)}else this._lineTo(s[0],s[1],n);this._prevSide=n,this._prevPt=s}close(){const s=this._firstPt,n=this._prevPt;s[0]===n[0]&&s[1]===n[1]||this.lineTo(s),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(s,n,i){this._closed?(this._lineIn.push([i<=0?s:this._xCut,n]),this._lineOut.push([i>=0?s:this._xCut,n])):(i<=0&&this._lineIn.push([s,n]),i>=0&&this._lineOut.push([s,n]))}_lineTo(s,n,i){this._closed?(this._addPolyVertex(this._lineIn,i<=0?s:this._xCut,n),this._addPolyVertex(this._lineOut,i>=0?s:this._xCut,n)):i<0?(this._prevSide===0&&this._pushLineOut(),this._lineIn.push([s,n])):i>0?(this._prevSide===0&&this._pushLineIn(),this._lineOut.push([s,n])):this._prevSide<0?(this._lineIn.push([s,n]),this._lineOut.push([s,n])):this._prevSide>0&&(this._lineOut.push([s,n]),this._lineIn.push([s,n]))}_addPolyVertex(s,n,i){const e=s.length;e>1&&s[e-1][0]===n&&s[e-2][0]===n?s[e-1][1]=i:s.push([n,i])}_checkClosingPt(s){const n=s.length;n>3&&s[0][0]===this._xCut&&s[n-2][0]===this._xCut&&s[1][0]===this._xCut&&(s[0][1]=s[n-2][1],s.pop())}_side(s){return sthis._xCut?1:0}_intersect(s,n){const i=(this._xCut-s[0])/(n[0]-s[0]);return s[1]+i*(n[1]-s[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}export{G as a,H as p}; +import{ay as V,j as A,ax as J,bB as N,bC as S,aY as R,aZ as X,aW as j,aC as B,aV as b,aO as D,bD as E,bE as F,bF as p}from"./index.221827cd.js";function G(t){return k(t,!0)}function H(t){return k(t,!1)}function k(t,s){if(A(t))return null;const n=t.spatialReference,i=J(n),e="toJSON"in t?t.toJSON():t;if(!i)return e;const h=N(n)?102100:4326,u=S[h].maxX,_=S[h].minX;if(R(e))return T(e,u,_);if(X(e))return e.points=e.points.map(o=>T(o,u,_)),e;if(j(e))return W(e,i);if(B(e)||b(e)){const o=D(Z,e),r={xmin:o[0],ymin:o[1],xmax:o[2],ymax:o[3]},x=p(r.xmin,_)*(2*u),m=x===0?e:E(e,x);return r.xmin+=x,r.xmax+=x,r.xmax>u?L(m,u,s):r.xmin<_?L(m,_,s):m}return e}function W(t,s){if(!s)return t;const n=Y(t,s).map(i=>i.extent);return n.length<2?n[0]||t:n.length>2?(t.xmin=s.valid[0],t.xmax=s.valid[1],t):{rings:n.map(i=>[[i.xmin,i.ymin],[i.xmin,i.ymax],[i.xmax,i.ymax],[i.xmax,i.ymin],[i.xmin,i.ymin]])}}function T(t,s,n){if(Array.isArray(t)){const i=t[0];if(i>s){const e=p(i,s);t[0]=i+e*(-2*s)}else if(is){const e=p(i,s);t.x+=e*(-2*s)}else if(i0;if(_>2*r){const g={xmin:hl||M?n.push(new a({xmin:x,ymin:i,xmax:r,ymax:e},[m]),new a({xmin:o,ymin:i,xmax:l,ymax:e},[c])):n.push(new a({xmin:x,ymin:i,xmax:l,ymax:e},[m]));return n}function w(t,s){const[n,i]=s.valid,e=2*i;let h,u=0;return t>i?(h=Math.ceil(Math.abs(t-i)/e),t-=h*e,u=h):t=t.xmin&&s<=t.xmax&&n>=t.ymin&&n<=t.ymax}function L(t,s,n=!0){const i=!b(t);if(i&&F(t),n)return new q().cut(t,s);const e=i?t.rings:t.paths,h=i?4:2,u=e.length,_=-2*s;for(let o=0;o=h){const x=[];for(const m of r)x.push([m[0]+_,m[1]]);e.push(x)}}return i?t.rings=e:t.paths=e,t}class a{constructor(s,n){this.extent=s,this.frameIds=n}}const Z=V();class q{constructor(){this._linesIn=[],this._linesOut=[]}cut(s,n){let i;if(this._xCut=n,s.rings)this._closed=!0,i=s.rings,this._minPts=4;else{if(!s.paths)return null;this._closed=!1,i=s.paths,this._minPts=2}for(const h of i){if(!h||h.length=this._minPts&&i.push(h);const e=-2*this._xCut;for(const h of this._linesOut)if(h&&h.length>=this._minPts){for(const u of h)u[0]+=e;i.push(h)}return this._closed?s.rings=i:s.paths=i,s}moveTo(s){this._pushLineIn(),this._pushLineOut(),this._prevSide=this._side(s[0]),this._moveTo(s[0],s[1],this._prevSide),this._prevPt=s,this._firstPt=s}lineTo(s){const n=this._side(s[0]);if(n*this._prevSide==-1){const i=this._intersect(this._prevPt,s);this._lineTo(this._xCut,i,0),this._prevSide=0,this._lineTo(s[0],s[1],n)}else this._lineTo(s[0],s[1],n);this._prevSide=n,this._prevPt=s}close(){const s=this._firstPt,n=this._prevPt;s[0]===n[0]&&s[1]===n[1]||this.lineTo(s),this._checkClosingPt(this._lineIn),this._checkClosingPt(this._lineOut)}_moveTo(s,n,i){this._closed?(this._lineIn.push([i<=0?s:this._xCut,n]),this._lineOut.push([i>=0?s:this._xCut,n])):(i<=0&&this._lineIn.push([s,n]),i>=0&&this._lineOut.push([s,n]))}_lineTo(s,n,i){this._closed?(this._addPolyVertex(this._lineIn,i<=0?s:this._xCut,n),this._addPolyVertex(this._lineOut,i>=0?s:this._xCut,n)):i<0?(this._prevSide===0&&this._pushLineOut(),this._lineIn.push([s,n])):i>0?(this._prevSide===0&&this._pushLineIn(),this._lineOut.push([s,n])):this._prevSide<0?(this._lineIn.push([s,n]),this._lineOut.push([s,n])):this._prevSide>0&&(this._lineOut.push([s,n]),this._lineIn.push([s,n]))}_addPolyVertex(s,n,i){const e=s.length;e>1&&s[e-1][0]===n&&s[e-2][0]===n?s[e-1][1]=i:s.push([n,i])}_checkClosingPt(s){const n=s.length;n>3&&s[0][0]===this._xCut&&s[n-2][0]===this._xCut&&s[1][0]===this._xCut&&(s[0][1]=s[n-2][1],s.pop())}_side(s){return sthis._xCut?1:0}_intersect(s,n){const i=(this._xCut-s[0])/(n[0]-s[0]);return s[1]+i*(n[1]-s[1])}_pushLineIn(){this._lineIn&&this._lineIn.length>=this._minPts&&this._linesIn.push(this._lineIn),this._lineIn=[]}_pushLineOut(){this._lineOut&&this._lineOut.length>=this._minPts&&this._linesOut.push(this._lineOut),this._lineOut=[]}}export{G as a,H as p}; diff --git a/assets/number.8c2c26f3.js b/assets/number.9e690eda.js similarity index 98% rename from assets/number.8c2c26f3.js rename to assets/number.9e690eda.js index 51cdd17..eb3b6a0 100644 --- a/assets/number.8c2c26f3.js +++ b/assets/number.9e690eda.js @@ -1 +1 @@ -import{fs as E,ft as S}from"./index.d94abe07.js";const x={ar:[".",","],bg:[",","\xA0"],bs:[",","."],ca:[",","."],cs:[",","\xA0"],da:[",","."],de:[",","."],"de-ch":[".","\u2019"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[",","\xA0"],fi:[",","\xA0"],fr:[",","\u202F"],"fr-ch":[",","\u202F"],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[",","\xA0"],id:[",","."],it:[",","."],"it-ch":[".","\u2019"],ja:[".",","],ko:[".",","],lt:[",","\xA0"],lv:[",","\xA0"],mk:[",","."],nb:[",","\xA0"],nl:[",","."],pl:[",","\xA0"],pt:[",","."],"pt-pt":[",","\xA0"],ro:[",","."],ru:[",","\xA0"],sk:[",","\xA0"],sl:[",","."],sr:[",","."],sv:[",","\xA0"],th:[".",","],tr:[",","."],uk:[",","\xA0"],vi:[",","."],zh:[".",","]};function N(e){e||(e=E());let t=e in x;if(!t){const l=e.split("-");l.length>1&&l[0]in x&&(e=l[0],t=!0),t||(e="en")}const[n,r,s="#,##0.###"]=x[e];return{decimal:n,group:r,pattern:s}}function I(e,t){const n=N((t={...t}).locale);t.customs=n;const r=t.pattern||n.pattern;return isNaN(e)||Math.abs(e)===1/0?null:v(e,r,t)}const w=/[#0,]*[#0](?:\.0*#*)?/;function v(e,t,n){const r=(n=n||{}).customs.group,s=n.customs.decimal,l=t.split(";"),o=l[0];if((t=l[e<0?1:0]||"-"+o).includes("%"))e*=100;else if(t.includes("\u2030"))e*=1e3;else{if(t.includes("\xA4"))throw new Error("currency notation not supported");if(t.includes("E"))throw new Error("exponential notation not supported")}const d=w,u=o.match(d);if(!u)throw new Error("unable to find a number expression in pattern: "+t);return n.fractional===!1&&(n.places=0),t.replace(d,z(e,u[0],{decimal:s,group:r,places:n.places,round:n.round}))}function z(e,t,n){(n=n||{}).places===!0&&(n.places=0),n.places===1/0&&(n.places=6);const r=t.split("."),s=typeof n.places=="string"&&n.places.indexOf(",");let l=n.places;s?l=n.places.substring(s+1):l>=0||(l=(r[1]||[]).length),n.round<0||(e=Number(e.toFixed(Number(l))));const o=String(Math.abs(e)).split("."),d=o[1]||"";if(r[1]||n.places){s&&(n.places=n.places.substring(0,s));const c=n.places!==void 0?n.places:r[1]&&r[1].lastIndexOf("0")+1;c>d.length&&(o[1]=d.padEnd(Number(c),"0")),lo[0].length&&(o[0]=o[0].padStart(f,"0")),u.includes("#")||(o[0]=o[0].substr(o[0].length-f)));let p,i,a=r[0].lastIndexOf(",");if(a!==-1){p=r[0].length-a-1;const c=r[0].substr(0,a);a=c.lastIndexOf(","),a!==-1&&(i=c.length-a-1)}const g=[];for(let c=o[0];c;){const m=c.length-p;g.push(m>0?c.substr(m):c),c=m>0?c.slice(0,m):"",i&&(p=i,i=void 0)}return o[0]=g.reverse().join(n.group||","),o.join(n.decimal||".")}function O(e){const t=N((e=e||{}).locale),n=e.pattern||t.pattern,r=t.group,s=t.decimal;let l=1;if(n.includes("%"))l/=100;else if(n.includes("\u2030"))l/=1e3;else if(n.includes("\xA4"))throw new Error("currency notation not supported");const o=n.split(";");return o.length===1&&o.push("-"+o[0]),{regexp:h(o,u=>(u="(?:"+S(u,".")+")").replace(w,f=>{const p={signed:!1,separator:e.strict?r:[r,""],fractional:e.fractional,decimal:s,exponent:!1},i=f.split(".");let a=e.places;i.length===1&&l!==1&&(i[1]="###"),i.length===1||a===0?p.fractional=!1:(a===void 0&&(a=e.pattern?i[1].lastIndexOf("0")+1:1/0),a&&e.fractional==null&&(p.fractional=!0),!e.places&&a1&&(p.groupSize=g.pop().length,g.length>1&&(p.groupSize2=g.pop().length)),"("+y(p)+")"}),!0).replace(/[\xa0 ]/g,"[\\s\\xa0]"),group:r,decimal:s,factor:l}}function $(e,t){const n=O(t),r=new RegExp("^"+n.regexp+"$").exec(e);if(!r)return NaN;let s=r[1];if(!r[1]){if(!r[2])return NaN;s=r[2],n.factor*=-1}return s=s.replace(new RegExp("["+n.group+"\\s\\xa0]","g"),"").replace(n.decimal,"."),Number(s)*n.factor}function y(e){"places"in(e=e||{})||(e.places=1/0),typeof e.decimal!="string"&&(e.decimal="."),"fractional"in e&&!/^0/.test(String(e.places))||(e.fractional=[!0,!1]),"exponent"in e||(e.exponent=[!0,!1]),"eSigned"in e||(e.eSigned=[!0,!1]);const t=b(e),n=h(e.fractional,s=>{let l="";return s&&e.places!==0&&(l="\\"+e.decimal,e.places===1/0?l="(?:"+l+"\\d+)?":l+="\\d{"+e.places+"}"),l},!0);let r=t+n;return n&&(r="(?:(?:"+r+")|(?:"+n+"))"),r+h(e.exponent,s=>s?"([eE]"+b({signed:e.eSigned})+")":"")}function b(e){return"signed"in(e=e||{})||(e.signed=[!0,!1]),"separator"in e?"groupSize"in e||(e.groupSize=3):e.separator="",h(e.signed,t=>t?"[-+]":"",!0)+h(e.separator,t=>{if(!t)return"(?:\\d+)";(t=S(t))===" "?t="\\s":t==="\xA0"&&(t="\\s\\xa0");const n=e.groupSize,r=e.groupSize2;if(r){const s="(?:0|[1-9]\\d{0,"+(r-1)+"}(?:["+t+"]\\d{"+r+"})*["+t+"]\\d{"+n+"})";return n-r>0?"(?:"+s+"|(?:0|[1-9]\\d{0,"+(n-1)+"}))":s}return"(?:0|[1-9]\\d{0,"+(n-1)+"}(?:["+t+"]\\d{"+n+"})*)"},!0)}const h=(e,t,n)=>{if(!(e instanceof Array))return t(e);const r=[];for(let s=0;s"("+(t?"?:":"")+e+")";export{O as a,$ as p,I as s}; +import{fs as E,ft as S}from"./index.221827cd.js";const x={ar:[".",","],bg:[",","\xA0"],bs:[",","."],ca:[",","."],cs:[",","\xA0"],da:[",","."],de:[",","."],"de-ch":[".","\u2019"],el:[",","."],en:[".",","],"en-au":[".",","],es:[",","."],"es-mx":[".",","],et:[",","\xA0"],fi:[",","\xA0"],fr:[",","\u202F"],"fr-ch":[",","\u202F"],he:[".",","],hi:[".",",","#,##,##0.###"],hr:[",","."],hu:[",","\xA0"],id:[",","."],it:[",","."],"it-ch":[".","\u2019"],ja:[".",","],ko:[".",","],lt:[",","\xA0"],lv:[",","\xA0"],mk:[",","."],nb:[",","\xA0"],nl:[",","."],pl:[",","\xA0"],pt:[",","."],"pt-pt":[",","\xA0"],ro:[",","."],ru:[",","\xA0"],sk:[",","\xA0"],sl:[",","."],sr:[",","."],sv:[",","\xA0"],th:[".",","],tr:[",","."],uk:[",","\xA0"],vi:[",","."],zh:[".",","]};function N(e){e||(e=E());let t=e in x;if(!t){const l=e.split("-");l.length>1&&l[0]in x&&(e=l[0],t=!0),t||(e="en")}const[n,r,s="#,##0.###"]=x[e];return{decimal:n,group:r,pattern:s}}function I(e,t){const n=N((t={...t}).locale);t.customs=n;const r=t.pattern||n.pattern;return isNaN(e)||Math.abs(e)===1/0?null:v(e,r,t)}const w=/[#0,]*[#0](?:\.0*#*)?/;function v(e,t,n){const r=(n=n||{}).customs.group,s=n.customs.decimal,l=t.split(";"),o=l[0];if((t=l[e<0?1:0]||"-"+o).includes("%"))e*=100;else if(t.includes("\u2030"))e*=1e3;else{if(t.includes("\xA4"))throw new Error("currency notation not supported");if(t.includes("E"))throw new Error("exponential notation not supported")}const d=w,u=o.match(d);if(!u)throw new Error("unable to find a number expression in pattern: "+t);return n.fractional===!1&&(n.places=0),t.replace(d,z(e,u[0],{decimal:s,group:r,places:n.places,round:n.round}))}function z(e,t,n){(n=n||{}).places===!0&&(n.places=0),n.places===1/0&&(n.places=6);const r=t.split("."),s=typeof n.places=="string"&&n.places.indexOf(",");let l=n.places;s?l=n.places.substring(s+1):l>=0||(l=(r[1]||[]).length),n.round<0||(e=Number(e.toFixed(Number(l))));const o=String(Math.abs(e)).split("."),d=o[1]||"";if(r[1]||n.places){s&&(n.places=n.places.substring(0,s));const c=n.places!==void 0?n.places:r[1]&&r[1].lastIndexOf("0")+1;c>d.length&&(o[1]=d.padEnd(Number(c),"0")),lo[0].length&&(o[0]=o[0].padStart(f,"0")),u.includes("#")||(o[0]=o[0].substr(o[0].length-f)));let p,i,a=r[0].lastIndexOf(",");if(a!==-1){p=r[0].length-a-1;const c=r[0].substr(0,a);a=c.lastIndexOf(","),a!==-1&&(i=c.length-a-1)}const g=[];for(let c=o[0];c;){const m=c.length-p;g.push(m>0?c.substr(m):c),c=m>0?c.slice(0,m):"",i&&(p=i,i=void 0)}return o[0]=g.reverse().join(n.group||","),o.join(n.decimal||".")}function O(e){const t=N((e=e||{}).locale),n=e.pattern||t.pattern,r=t.group,s=t.decimal;let l=1;if(n.includes("%"))l/=100;else if(n.includes("\u2030"))l/=1e3;else if(n.includes("\xA4"))throw new Error("currency notation not supported");const o=n.split(";");return o.length===1&&o.push("-"+o[0]),{regexp:h(o,u=>(u="(?:"+S(u,".")+")").replace(w,f=>{const p={signed:!1,separator:e.strict?r:[r,""],fractional:e.fractional,decimal:s,exponent:!1},i=f.split(".");let a=e.places;i.length===1&&l!==1&&(i[1]="###"),i.length===1||a===0?p.fractional=!1:(a===void 0&&(a=e.pattern?i[1].lastIndexOf("0")+1:1/0),a&&e.fractional==null&&(p.fractional=!0),!e.places&&a1&&(p.groupSize=g.pop().length,g.length>1&&(p.groupSize2=g.pop().length)),"("+y(p)+")"}),!0).replace(/[\xa0 ]/g,"[\\s\\xa0]"),group:r,decimal:s,factor:l}}function $(e,t){const n=O(t),r=new RegExp("^"+n.regexp+"$").exec(e);if(!r)return NaN;let s=r[1];if(!r[1]){if(!r[2])return NaN;s=r[2],n.factor*=-1}return s=s.replace(new RegExp("["+n.group+"\\s\\xa0]","g"),"").replace(n.decimal,"."),Number(s)*n.factor}function y(e){"places"in(e=e||{})||(e.places=1/0),typeof e.decimal!="string"&&(e.decimal="."),"fractional"in e&&!/^0/.test(String(e.places))||(e.fractional=[!0,!1]),"exponent"in e||(e.exponent=[!0,!1]),"eSigned"in e||(e.eSigned=[!0,!1]);const t=b(e),n=h(e.fractional,s=>{let l="";return s&&e.places!==0&&(l="\\"+e.decimal,e.places===1/0?l="(?:"+l+"\\d+)?":l+="\\d{"+e.places+"}"),l},!0);let r=t+n;return n&&(r="(?:(?:"+r+")|(?:"+n+"))"),r+h(e.exponent,s=>s?"([eE]"+b({signed:e.eSigned})+")":"")}function b(e){return"signed"in(e=e||{})||(e.signed=[!0,!1]),"separator"in e?"groupSize"in e||(e.groupSize=3):e.separator="",h(e.signed,t=>t?"[-+]":"",!0)+h(e.separator,t=>{if(!t)return"(?:\\d+)";(t=S(t))===" "?t="\\s":t==="\xA0"&&(t="\\s\\xa0");const n=e.groupSize,r=e.groupSize2;if(r){const s="(?:0|[1-9]\\d{0,"+(r-1)+"}(?:["+t+"]\\d{"+r+"})*["+t+"]\\d{"+n+"})";return n-r>0?"(?:"+s+"|(?:0|[1-9]\\d{0,"+(n-1)+"}))":s}return"(?:0|[1-9]\\d{0,"+(n-1)+"}(?:["+t+"]\\d{"+n+"})*)"},!0)}const h=(e,t,n)=>{if(!(e instanceof Array))return t(e);const r=[];for(let s=0;s"("+(t?"?:":"")+e+")";export{O as a,$ as p,I as s}; diff --git a/assets/objectResourceUtils.996108d7.js b/assets/objectResourceUtils.dfe6cb73.js similarity index 97% rename from assets/objectResourceUtils.996108d7.js rename to assets/objectResourceUtils.dfe6cb73.js index 941f2ba..e85c821 100644 --- a/assets/objectResourceUtils.996108d7.js +++ b/assets/objectResourceUtils.dfe6cb73.js @@ -1,4 +1,4 @@ -import{a as Eo}from"./devEnvironmentUtils.d8d0484c.js";import{j as k,c as p,kB as Io,kC as No,kD as tr,N as ot,b2 as kr,eO as wi,M as I,aj as Xe,fU as Dt,h5 as cr,h4 as Do,gI as Fo,fD as Se,ac as vr,fC as Ai,O as K,fG as Ae,ad as Ze,s as gr,n as xr,G as Me,cj as Vt,an as Wt,hd as jt,at as wt,cs as zo,ba as Vo,q as Bt,W as Bo,jk as Wr,cu as Go,g_ as ct,kE as dt,v as jr,kF as Uo,C as Ho,D as ko,fI as qr,gH as At,f4 as Wo,eI as Fe,hD as jo,kg as qo,dU as Xo,kG as Ko,kH as Yo,fE as Tr,a1 as Zo,l as Jo,g$ as Xr,kI as Ci,m as Mi,k as Kr,u as bt,kJ as br,fM as _t,kK as dr,kL as Qo,a6 as x,fH as ie,hc as qt,fF as ea,r as ta,kM as ur,fy as ra,fz as ia,eb as oa,kN as aa,cQ as Oi,U as na,aU as Pi,ki as Yr,kO as $i,jq as Gt,eQ as sa,f_ as Zr,fL as la,kh as Jr}from"./index.d94abe07.js";import{e as Xt}from"./mat3f64.6d32a1d7.js";import{e as _r,o as Ri}from"./mat4f64.ff2a477c.js";import{c as hr,x as Je,u as Li,i as Qe,L as ca,O as Qr,E as da}from"./BufferView.89055914.js";import{t as ua,r as ha,f as ei,e as ma}from"./vec33.4564cd5b.js";import{u as ti,n as pa,m as fa,a as va,o as qe,r as Be,b as ga,c as xa,d as ri,e as Ta,t as ba,i as _a,f as Sa,g as ya}from"./DefaultMaterial_COLOR_GAMMA.bf8213a8.js";import{r as Ei}from"./Version.59f2da65.js";import{t as Ii}from"./requestImageUtils.7b09b5e8.js";import{a as Ft,c as rr,O as mr,b as Oe,o as wa,r as Aa,C as W,W as Sr,_ as yr,d as rt,n as Pe,e as Ct,f as Ca,A as Ma,h as Oa,l as Pa,g as $a,i as Ra,S as La}from"./OrderIndependentTransparency.4d1575c0.js";import{e as oe,v as Ea}from"./Util.ea9235b8.js";import{s as Ni,R as Di}from"./sphere.ec1f4496.js";import{O as h}from"./VertexAttribute.42396f25.js";import{u as _e,P as Ve,L as Ue,C as ce,F as Ia,D as Ke,M as ii,G as oi,Y as Na,V as Da,E as ft,I as $e,O as ne}from"./enums.2d9e6f64.js";import{E as Ce,n as Fa,a as za}from"./Texture.4c97bad5.js";import{_ as Va,a as Ba,E as Ga,x as Ua,n as Ha}from"./VertexArrayObject.a4c1d809.js";import{t as de}from"./VertexElementDescriptor.1fdca6da.js";import{T as Fi}from"./InterleavedLayout.f9d79992.js";import{r as ka,n as Wa}from"./vec3f32.1121a836.js";import{S as ja}from"./quat.b3994f2f.js";import{e as qa}from"./quatf64.4ae3e6f1.js";import{r as be}from"./symbolColorUtils.d5fe1bd7.js";function ut(t){if(k(t))return null;const e=p(t.offset)?t.offset:Io,r=p(t.rotation)?t.rotation:0,i=p(t.scale)?t.scale:No,o=tr(1,0,0,0,1,0,e[0],e[1],1),a=tr(Math.cos(r),-Math.sin(r),0,Math.sin(r),Math.cos(r),0,0,0,1),n=tr(i[0],0,0,0,i[1],0,0,0,1),l=ot();return kr(l,a,n),kr(l,o,l),l}class Xa{constructor(e,r,i,o,a){this.name=e,this.stageResources=r,this.lodThreshold=i,this.pivotOffset=o,this.numberOfVertices=a}}class wr{constructor(e,r,i,o){this.primitiveIndices=e,this._numIndexPerPrimitive=r,this.indices=i,this.position=o,this.center=I(),this._children=void 0,oe(e.length>=1),oe(i.length%this._numIndexPerPrimitive==0),oe(i.length>=e.length*this._numIndexPerPrimitive),oe(o.size===3||o.size===4);const{data:a,size:n}=o,l=e.length;let d=n*i[this._numIndexPerPrimitive*e[0]];ze.clear(),ze.push(d),this.bbMin=Xe(a[d],a[d+1],a[d+2]),this.bbMax=Dt(this.bbMin);for(let u=0;u1){const e=cr(I(),this.bbMin,this.bbMax,.5),r=this.primitiveIndices.length,i=new Uint8Array(r),o=new Array(8);for(let c=0;c<8;++c)o[c]=0;const{data:a,size:n}=this.position;for(let c=0;c0&&++l;if(l<2)return;const d=new Array(8);for(let c=0;c<8;++c)d[c]=o[c]>0?new Uint32Array(o[c]):void 0;for(let c=0;c<8;++c)o[c]=0;for(let c=0;cKa());const ir=I(),ai=I();function Za(t,e,r){if(!t||!e)return!1;const{size:i,data:o}=t;K(r,0,0,0),K(ye,0,0,0);let a=0,n=0;for(let l=0;l1&&Ze(r,r,1/n),n>0}const pe=I(),$t=I(),Rt=I(),ye=I();class Kt extends Ar{constructor(e,r=[],i=Ft.Triangle,o=null,a=-1){super(),this._primitiveType=i,this.objectAndLayerIdColor=o,this.edgeIndicesLength=a,this.type=St.Geometry,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[n,l]of e)l&&this._vertexAttributes.set(n,{...l});if(r==null||r.length===0){const n=Qa(this._vertexAttributes),l=ti(n);this.edgeIndicesLength=this.edgeIndicesLength<0?n:this.edgeIndicesLength;for(const d of this._vertexAttributes.keys())this._indices.set(d,l)}else for(const[n,l]of r)l&&(this._indices.set(n,pa(l)),n===h.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(n).length:this.edgeIndicesLength))}cloneShallow(){const e=new Kt([],void 0,this._primitiveType,this.objectAndLayerIdColor,void 0),{_vertexAttributes:r,_indices:i}=e;return this._vertexAttributes.forEach((o,a)=>r.set(a,o)),this._indices.forEach((o,a)=>i.set(a,o)),e.screenToWorldRatio=this.screenToWorldRatio,e._boundingInfo=this._boundingInfo,e}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){const r=this._vertexAttributes.get(e);return r&&!r.exclusive&&(r.data=Array.from(r.data),r.exclusive=!0),r}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get primitiveType(){return this._primitiveType}get faceCount(){return this.indexCount/3}get boundingInfo(){return k(this._boundingInfo)&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return this.primitiveType===Ft.Triangle?this._computeAttachmentOriginTriangles(e):this._computeAttachmentOriginPoints(e)}_computeAttachmentOriginTriangles(e){const r=this.indices.get(h.POSITION),i=this.vertexAttributes.get(h.POSITION);return Za(i,r,e)}_computeAttachmentOriginPoints(e){const r=this.indices.get(h.POSITION),i=this.vertexAttributes.get(h.POSITION);return Ja(i,r,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(h.POSITION);if(!e||e.length===0)return null;const r=this.primitiveType===Ft.Triangle?3:1;oe(e.length%r==0,"Indexing error: "+e.length+" not divisible by "+r);const i=ti(e.length/r),o=this.vertexAttributes.get(h.POSITION);return o?new wr(i,r,e,o):null}}function Qa(t){const e=t.values().next().value;return e==null?0:e.data.length/e.size}class Cr{}function s(t,...e){let r="";for(let i=0;i=1),oe(i.length%this._numIndexPerPrimitive==0),oe(i.length>=e.length*this._numIndexPerPrimitive),oe(o.size===3||o.size===4);const{data:a,size:n}=o,l=e.length;let d=n*i[this._numIndexPerPrimitive*e[0]];ze.clear(),ze.push(d),this.bbMin=Xe(a[d],a[d+1],a[d+2]),this.bbMax=Dt(this.bbMin);for(let u=0;u1){const e=cr(I(),this.bbMin,this.bbMax,.5),r=this.primitiveIndices.length,i=new Uint8Array(r),o=new Array(8);for(let c=0;c<8;++c)o[c]=0;const{data:a,size:n}=this.position;for(let c=0;c0&&++l;if(l<2)return;const d=new Array(8);for(let c=0;c<8;++c)d[c]=o[c]>0?new Uint32Array(o[c]):void 0;for(let c=0;c<8;++c)o[c]=0;for(let c=0;cKa());const ir=I(),ai=I();function Za(t,e,r){if(!t||!e)return!1;const{size:i,data:o}=t;K(r,0,0,0),K(ye,0,0,0);let a=0,n=0;for(let l=0;l1&&Ze(r,r,1/n),n>0}const pe=I(),$t=I(),Rt=I(),ye=I();class Kt extends Ar{constructor(e,r=[],i=Ft.Triangle,o=null,a=-1){super(),this._primitiveType=i,this.objectAndLayerIdColor=o,this.edgeIndicesLength=a,this.type=St.Geometry,this._vertexAttributes=new Map,this._indices=new Map,this._boundingInfo=null;for(const[n,l]of e)l&&this._vertexAttributes.set(n,{...l});if(r==null||r.length===0){const n=Qa(this._vertexAttributes),l=ti(n);this.edgeIndicesLength=this.edgeIndicesLength<0?n:this.edgeIndicesLength;for(const d of this._vertexAttributes.keys())this._indices.set(d,l)}else for(const[n,l]of r)l&&(this._indices.set(n,pa(l)),n===h.POSITION&&(this.edgeIndicesLength=this.edgeIndicesLength<0?this._indices.get(n).length:this.edgeIndicesLength))}cloneShallow(){const e=new Kt([],void 0,this._primitiveType,this.objectAndLayerIdColor,void 0),{_vertexAttributes:r,_indices:i}=e;return this._vertexAttributes.forEach((o,a)=>r.set(a,o)),this._indices.forEach((o,a)=>i.set(a,o)),e.screenToWorldRatio=this.screenToWorldRatio,e._boundingInfo=this._boundingInfo,e}get vertexAttributes(){return this._vertexAttributes}getMutableAttribute(e){const r=this._vertexAttributes.get(e);return r&&!r.exclusive&&(r.data=Array.from(r.data),r.exclusive=!0),r}get indices(){return this._indices}get indexCount(){const e=this._indices.values().next().value;return e?e.length:0}get primitiveType(){return this._primitiveType}get faceCount(){return this.indexCount/3}get boundingInfo(){return k(this._boundingInfo)&&(this._boundingInfo=this._calculateBoundingInfo()),this._boundingInfo}computeAttachmentOrigin(e){return this.primitiveType===Ft.Triangle?this._computeAttachmentOriginTriangles(e):this._computeAttachmentOriginPoints(e)}_computeAttachmentOriginTriangles(e){const r=this.indices.get(h.POSITION),i=this.vertexAttributes.get(h.POSITION);return Za(i,r,e)}_computeAttachmentOriginPoints(e){const r=this.indices.get(h.POSITION),i=this.vertexAttributes.get(h.POSITION);return Ja(i,r,e)}invalidateBoundingInfo(){this._boundingInfo=null}_calculateBoundingInfo(){const e=this.indices.get(h.POSITION);if(!e||e.length===0)return null;const r=this.primitiveType===Ft.Triangle?3:1;oe(e.length%r==0,"Indexing error: "+e.length+" not divisible by "+r);const i=ti(e.length/r),o=this.vertexAttributes.get(h.POSITION);return o?new wr(i,r,e,o):null}}function Qa(t){const e=t.values().next().value;return e==null?0:e.data.length/e.size}class Cr{}function s(t,...e){let r="";for(let i=0;iwt(()=>import("./SSAOBlur.glsl.1501066c.js"),["assets/SSAOBlur.glsl.1501066c.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/VertexAttribute.42396f25.js","assets/devEnvironmentUtils.d8d0484c.js","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/BufferView.89055914.js","assets/vec33.4564cd5b.js","assets/DefaultMaterial_COLOR_GAMMA.bf8213a8.js","assets/types.44c7402c.js","assets/enums.2d9e6f64.js","assets/Version.59f2da65.js","assets/quat.b3994f2f.js","assets/quatf64.4ae3e6f1.js","assets/requestImageUtils.7b09b5e8.js","assets/OrderIndependentTransparency.4d1575c0.js","assets/Util.ea9235b8.js","assets/sphere.ec1f4496.js","assets/Texture.4c97bad5.js","assets/VertexArrayObject.a4c1d809.js","assets/VertexElementDescriptor.1fdca6da.js","assets/InterleavedLayout.f9d79992.js","assets/vec3f32.1121a836.js","assets/symbolColorUtils.d5fe1bd7.js"]));function Ks(t){t.fragment.uniforms.add(new Q("projInfo",(e,r)=>Ys(r))),t.fragment.uniforms.add(new le("zScale",(e,r)=>So(r))),t.fragment.code.add(s`vec3 reconstructPosition(vec2 fragCoord, float depth) { + `),t}const Xs=Object.freeze(Object.defineProperty({__proto__:null,build:qs},Symbol.toStringTag,{value:"Module"}));class Dr extends Lr{initializeProgram(e){return new Er(e.rctx,Dr.shader.get().build(),Ot)}initializePipeline(){return Sr({colorWrite:yr})}}Dr.shader=new Jt(Xs,()=>wt(()=>import("./SSAOBlur.glsl.7f71e6b4.js"),["assets/SSAOBlur.glsl.7f71e6b4.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/VertexAttribute.42396f25.js","assets/devEnvironmentUtils.d8d0484c.js","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/BufferView.6eee27cd.js","assets/vec33.46fc6802.js","assets/DefaultMaterial_COLOR_GAMMA.8ee780a2.js","assets/types.44c7402c.js","assets/enums.2d9e6f64.js","assets/Version.433fbe58.js","assets/quat.d9562009.js","assets/quatf64.4ae3e6f1.js","assets/requestImageUtils.1f5d4b6d.js","assets/OrderIndependentTransparency.4d1575c0.js","assets/Util.f17667f9.js","assets/sphere.f99ddb50.js","assets/Texture.940076b2.js","assets/VertexArrayObject.53cf1857.js","assets/VertexElementDescriptor.1fdca6da.js","assets/InterleavedLayout.30cdc193.js","assets/vec3f32.1121a836.js","assets/symbolColorUtils.36aaa708.js"]));function Ks(t){t.fragment.uniforms.add(new Q("projInfo",(e,r)=>Ys(r))),t.fragment.uniforms.add(new le("zScale",(e,r)=>So(r))),t.fragment.code.add(s`vec3 reconstructPosition(vec2 fragCoord, float depth) { return vec3((fragCoord * projInfo.xy + projInfo.zw) * (zScale.x * depth + zScale.y), depth); }`)}function Ys(t){const e=t.camera.projectionMatrix;return e[11]===0?ie(gi,2/(t.camera.fullWidth*e[0]),2/(t.camera.fullHeight*e[5]),(1+e[12])/e[0],(1+e[13])/e[5]):ie(gi,-2/(t.camera.fullWidth*e[0]),-2/(t.camera.fullHeight*e[5]),(1-e[8])/e[0],(1-e[9])/e[5])}const gi=qt();function So(t){return t.camera.projectionMatrix[11]===0?Me(xi,0,1):Me(xi,1,0)}const xi=Wt(),Ti=16,Zs=.5;function Js(){const t=new Mt,e=t.fragment;return t.include(Mr),e.include(Nr),t.include(Ks),e.uniforms.add(new J("radius",(r,i)=>bi(i))),e.code.add(s`vec3 sphere[16]; void fillSphere() { @@ -650,7 +650,7 @@ return fallOffFunction(vv, vn, 0.1); A = (pow(A, 0.2) + 1.2 * A*A*A*A) / 2.2; gl_FragColor = vec4(A); } - `),t}function bi(t){return Math.max(10,20*t.camera.computeRenderPixelSizeAtDist(Math.abs(4*t.camera.relativeElevation)))}const _i=Wt(),Qs=Object.freeze(Object.defineProperty({__proto__:null,build:Js},Symbol.toStringTag,{value:"Module"}));class Fr extends Lr{initializeProgram(e){return new Er(e.rctx,Fr.shader.get().build(),Ot)}initializePipeline(){return Sr({colorWrite:yr})}}Fr.shader=new Jt(Qs,()=>wt(()=>import("./SSAO.glsl.e631cc39.js"),["assets/SSAO.glsl.e631cc39.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/VertexAttribute.42396f25.js","assets/devEnvironmentUtils.d8d0484c.js","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/BufferView.89055914.js","assets/vec33.4564cd5b.js","assets/DefaultMaterial_COLOR_GAMMA.bf8213a8.js","assets/types.44c7402c.js","assets/enums.2d9e6f64.js","assets/Version.59f2da65.js","assets/quat.b3994f2f.js","assets/quatf64.4ae3e6f1.js","assets/requestImageUtils.7b09b5e8.js","assets/OrderIndependentTransparency.4d1575c0.js","assets/Util.ea9235b8.js","assets/sphere.ec1f4496.js","assets/Texture.4c97bad5.js","assets/VertexArrayObject.a4c1d809.js","assets/VertexElementDescriptor.1fdca6da.js","assets/InterleavedLayout.f9d79992.js","assets/vec3f32.1121a836.js","assets/symbolColorUtils.d5fe1bd7.js"]));const el=2;function zr(t,e){const r=t.fragment;e.receiveAmbientOcclusion?(r.uniforms.add(He("ssaoTex",(i,o)=>o.ssaoHelper.colorTexture,e.hasWebGL2Context?j.None:j.InvSize)),r.constants.add("blurSizePixelsInverse","float",1/el),r.code.add(s` + `),t}function bi(t){return Math.max(10,20*t.camera.computeRenderPixelSizeAtDist(Math.abs(4*t.camera.relativeElevation)))}const _i=Wt(),Qs=Object.freeze(Object.defineProperty({__proto__:null,build:Js},Symbol.toStringTag,{value:"Module"}));class Fr extends Lr{initializeProgram(e){return new Er(e.rctx,Fr.shader.get().build(),Ot)}initializePipeline(){return Sr({colorWrite:yr})}}Fr.shader=new Jt(Qs,()=>wt(()=>import("./SSAO.glsl.1592f040.js"),["assets/SSAO.glsl.1592f040.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/VertexAttribute.42396f25.js","assets/devEnvironmentUtils.d8d0484c.js","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/BufferView.6eee27cd.js","assets/vec33.46fc6802.js","assets/DefaultMaterial_COLOR_GAMMA.8ee780a2.js","assets/types.44c7402c.js","assets/enums.2d9e6f64.js","assets/Version.433fbe58.js","assets/quat.d9562009.js","assets/quatf64.4ae3e6f1.js","assets/requestImageUtils.1f5d4b6d.js","assets/OrderIndependentTransparency.4d1575c0.js","assets/Util.f17667f9.js","assets/sphere.f99ddb50.js","assets/Texture.940076b2.js","assets/VertexArrayObject.53cf1857.js","assets/VertexElementDescriptor.1fdca6da.js","assets/InterleavedLayout.30cdc193.js","assets/vec3f32.1121a836.js","assets/symbolColorUtils.36aaa708.js"]));const el=2;function zr(t,e){const r=t.fragment;e.receiveAmbientOcclusion?(r.uniforms.add(He("ssaoTex",(i,o)=>o.ssaoHelper.colorTexture,e.hasWebGL2Context?j.None:j.InvSize)),r.constants.add("blurSizePixelsInverse","float",1/el),r.code.add(s` float evaluateAmbientOcclusionInverse() { vec2 ssaoTextureSizeInverse = ${et(e,"ssaoTex",!0)}; return texture2D(ssaoTex, gl_FragCoord.xy * blurSizePixelsInverse * ssaoTextureSizeInverse).a; @@ -1109,7 +1109,7 @@ return max(c.x, max(c.y, c.z)); gl_FragColor = highlightSlice(vec4(shadedColor, opacity_), vpos); ${t.transparencyPassType===rt.Color?s`gl_FragColor = premultiplyAlpha(gl_FragColor);`:""} } - `)),e.include(_o,t),e}const vl=Object.freeze(Object.defineProperty({__proto__:null,build:fl},Symbol.toStringTag,{value:"Module"}));class gl extends xs{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=Xe(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=Pe.Back,this.emissiveFactor=Xe(0,0,0),this.instancedDoublePrecision=!1,this.normals="default",this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=Xe(.2,.2,.2),this.diffuse=Xe(.8,.8,.8),this.externalColor=jt(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=I(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSizeEnabled=!1,this.vvSizeMinSize=[1,1,1],this.vvSizeMaxSize=[100,100,100],this.vvSizeOffset=[0,0,0],this.vvSizeFactor=[1,1,1],this.vvSizeValue=[1,1,1],this.vvColorEnabled=!1,this.vvColorValues=[0,0,0,0,0,0,0,0],this.vvColorColors=[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],this.vvSymbolAnchor=[0,0,0],this.vvSymbolRotationMatrix=Xt(),this.vvOpacityEnabled=!1,this.vvOpacityValues=[],this.vvOpacityOpacities=[],this.transparent=!1,this.writeDepth=!0,this.customDepthTest=Ct.Less,this.textureAlphaMode=W.Blend,this.textureAlphaCutoff=Ts,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=fr.Occlude}}class Pt extends Lr{initializeConfiguration(e,r){r.hasWebGL2Context=e.rctx.type===ta.WEBGL2,r.spherical=e.viewingMode===ur.Global,r.doublePrecisionRequiresObfuscation=vs(e.rctx),r.textureCoordinateType=r.hasColorTexture||r.hasMetallicRoughnessTexture||r.hasEmissionTexture||r.hasOcclusionTexture||r.hasNormalTexture?Z.Default:Z.None,r.objectAndLayerIdColorInstanced=r.instanced}initializeProgram(e){return this._initializeProgram(e,Pt.shader)}_initializeProgram(e,r){return new Er(e.rctx,r.get().build(this.configuration),Ot)}_convertDepthTestFunction(e){return e===Ct.Lequal?$e.LEQUAL:$e.LESS}_makePipeline(e,r){const i=this.configuration,o=e===rt.NONE,a=e===rt.FrontFace;return Sr({blending:i.output!==C.Color&&i.output!==C.Alpha||!i.transparent?null:o?Ca:Ma(e),culling:xl(i)&&Oa(i.cullFace),depthTest:{func:Pa(e,this._convertDepthTestFunction(i.customDepthTest))},depthWrite:o||a?i.writeDepth&&$a:null,colorWrite:yr,stencilWrite:i.hasOccludees?bs:null,stencilTest:i.hasOccludees?r?Ss:_s:null,polygonOffset:o||a?null:Ra(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,r){return r?this._occludeePipelineState:super.getPipelineState(e,r)}}function xl(t){return t.cullFace!==Pe.None||!t.hasSlicePlane&&!t.transparent&&!t.doubleSidedMode}Pt.shader=new Jt(vl,()=>wt(()=>import("./DefaultMaterial.glsl.037cb4cc.js"),["assets/DefaultMaterial.glsl.037cb4cc.js","assets/mat4f64.ff2a477c.js","assets/mat3f64.6d32a1d7.js","assets/vec3f32.1121a836.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/VertexAttribute.42396f25.js","assets/symbolColorUtils.d5fe1bd7.js","assets/OrderIndependentTransparency.4d1575c0.js","assets/enums.2d9e6f64.js","assets/VertexArrayObject.a4c1d809.js","assets/Texture.4c97bad5.js","assets/devEnvironmentUtils.d8d0484c.js","assets/BufferView.89055914.js","assets/vec33.4564cd5b.js","assets/DefaultMaterial_COLOR_GAMMA.bf8213a8.js","assets/types.44c7402c.js","assets/Version.59f2da65.js","assets/quat.b3994f2f.js","assets/quatf64.4ae3e6f1.js","assets/requestImageUtils.7b09b5e8.js","assets/Util.ea9235b8.js","assets/sphere.ec1f4496.js","assets/VertexElementDescriptor.1fdca6da.js","assets/InterleavedLayout.f9d79992.js"]));class we extends fo{constructor(){super(...arguments),this.hasWebGL2Context=!1}}x([T({constValue:!0})],we.prototype,"hasSliceHighlight",void 0),x([T({constValue:!1})],we.prototype,"hasSliceInVertexProgram",void 0),x([T({constValue:!1})],we.prototype,"instancedDoublePrecision",void 0),x([T({constValue:!1})],we.prototype,"useLegacyTerrainShading",void 0),x([T({constValue:!1})],we.prototype,"hasModelTransformation",void 0),x([T({constValue:z.Pass})],we.prototype,"pbrTextureBindType",void 0),x([T()],we.prototype,"hasWebGL2Context",void 0);class w extends we{constructor(){super(...arguments),this.output=C.Color,this.alphaDiscardMode=W.Opaque,this.doubleSidedMode=te.None,this.pbrMode=D.Disabled,this.cullFace=Pe.None,this.transparencyPassType=rt.NONE,this.normalType=X.Attribute,this.textureCoordinateType=Z.None,this.customDepthTest=Ct.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}x([T({count:C.COUNT})],w.prototype,"output",void 0),x([T({count:W.COUNT})],w.prototype,"alphaDiscardMode",void 0),x([T({count:te.COUNT})],w.prototype,"doubleSidedMode",void 0),x([T({count:D.COUNT})],w.prototype,"pbrMode",void 0),x([T({count:Pe.COUNT})],w.prototype,"cullFace",void 0),x([T({count:rt.COUNT})],w.prototype,"transparencyPassType",void 0),x([T({count:X.COUNT})],w.prototype,"normalType",void 0),x([T({count:Z.COUNT})],w.prototype,"textureCoordinateType",void 0),x([T({count:Ct.COUNT})],w.prototype,"customDepthTest",void 0),x([T()],w.prototype,"spherical",void 0),x([T()],w.prototype,"hasVertexColors",void 0),x([T()],w.prototype,"hasSymbolColors",void 0),x([T()],w.prototype,"hasVerticalOffset",void 0),x([T()],w.prototype,"hasSlicePlane",void 0),x([T()],w.prototype,"hasSliceHighlight",void 0),x([T()],w.prototype,"hasColorTexture",void 0),x([T()],w.prototype,"hasMetallicRoughnessTexture",void 0),x([T()],w.prototype,"hasEmissionTexture",void 0),x([T()],w.prototype,"hasOcclusionTexture",void 0),x([T()],w.prototype,"hasNormalTexture",void 0),x([T()],w.prototype,"hasScreenSizePerspective",void 0),x([T()],w.prototype,"hasVertexTangents",void 0),x([T()],w.prototype,"hasOccludees",void 0),x([T()],w.prototype,"hasMultipassTerrain",void 0),x([T()],w.prototype,"hasModelTransformation",void 0),x([T()],w.prototype,"offsetBackfaces",void 0),x([T()],w.prototype,"vvSize",void 0),x([T()],w.prototype,"vvColor",void 0),x([T()],w.prototype,"receiveShadows",void 0),x([T()],w.prototype,"receiveAmbientOcclusion",void 0),x([T()],w.prototype,"textureAlphaPremultiplied",void 0),x([T()],w.prototype,"instanced",void 0),x([T()],w.prototype,"instancedColor",void 0),x([T()],w.prototype,"objectAndLayerIdColorInstanced",void 0),x([T()],w.prototype,"instancedDoublePrecision",void 0),x([T()],w.prototype,"doublePrecisionRequiresObfuscation",void 0),x([T()],w.prototype,"writeDepth",void 0),x([T()],w.prototype,"transparent",void 0),x([T()],w.prototype,"enableOffset",void 0),x([T()],w.prototype,"cullAboveGround",void 0),x([T()],w.prototype,"snowCover",void 0),x([T()],w.prototype,"hasColorTextureTransform",void 0),x([T()],w.prototype,"hasEmissionTextureTransform",void 0),x([T()],w.prototype,"hasNormalTextureTransform",void 0),x([T()],w.prototype,"hasOcclusionTextureTransform",void 0),x([T()],w.prototype,"hasMetallicRoughnessTextureTransform",void 0),x([T({constValue:!0})],w.prototype,"hasVvInstancing",void 0),x([T({constValue:!1})],w.prototype,"useCustomDTRExponentForWater",void 0),x([T({constValue:!1})],w.prototype,"supportsTextureAtlas",void 0),x([T({constValue:!0})],w.prototype,"useFillLights",void 0);function Tl(t){const e=new Mt,{vertex:r,fragment:i,varyings:o}=e;return xt(r,t),e.include($r),o.add("vpos","vec3"),e.include(Tt,t),e.include(vo,t),e.include(bo,t),t.output!==C.Color&&t.output!==C.Alpha||(yt(e.vertex,t),e.include(Zt,t),e.include(gt,t),t.offsetBackfaces&&e.include(co),t.instancedColor&&e.attributes.add(h.INSTANCECOLOR,"vec4"),o.add("vNormalWorld","vec3"),o.add("localvpos","vec3"),t.hasMultipassTerrain&&o.add("depth","float"),e.include(tt,t),e.include(lo,t),e.include(xo,t),e.include(To,t),r.uniforms.add(new Q("externalColor",a=>a.externalColor)),o.add("vcolorExt","vec4"),r.code.add(s` + `)),e.include(_o,t),e}const vl=Object.freeze(Object.defineProperty({__proto__:null,build:fl},Symbol.toStringTag,{value:"Module"}));class gl extends xs{constructor(){super(...arguments),this.isSchematic=!1,this.usePBR=!1,this.mrrFactors=Xe(0,1,.5),this.hasVertexColors=!1,this.hasSymbolColors=!1,this.doubleSided=!1,this.doubleSidedType="normal",this.cullFace=Pe.Back,this.emissiveFactor=Xe(0,0,0),this.instancedDoublePrecision=!1,this.normals="default",this.receiveSSAO=!0,this.receiveShadows=!0,this.castShadows=!0,this.shadowMappingEnabled=!1,this.ambient=Xe(.2,.2,.2),this.diffuse=Xe(.8,.8,.8),this.externalColor=jt(1,1,1,1),this.colorMixMode="multiply",this.opacity=1,this.layerOpacity=1,this.origin=I(),this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.offsetTransparentBackfaces=!1,this.vvSizeEnabled=!1,this.vvSizeMinSize=[1,1,1],this.vvSizeMaxSize=[100,100,100],this.vvSizeOffset=[0,0,0],this.vvSizeFactor=[1,1,1],this.vvSizeValue=[1,1,1],this.vvColorEnabled=!1,this.vvColorValues=[0,0,0,0,0,0,0,0],this.vvColorColors=[1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0,1,0,0,0],this.vvSymbolAnchor=[0,0,0],this.vvSymbolRotationMatrix=Xt(),this.vvOpacityEnabled=!1,this.vvOpacityValues=[],this.vvOpacityOpacities=[],this.transparent=!1,this.writeDepth=!0,this.customDepthTest=Ct.Less,this.textureAlphaMode=W.Blend,this.textureAlphaCutoff=Ts,this.textureAlphaPremultiplied=!1,this.hasOccludees=!1,this.renderOccluded=fr.Occlude}}class Pt extends Lr{initializeConfiguration(e,r){r.hasWebGL2Context=e.rctx.type===ta.WEBGL2,r.spherical=e.viewingMode===ur.Global,r.doublePrecisionRequiresObfuscation=vs(e.rctx),r.textureCoordinateType=r.hasColorTexture||r.hasMetallicRoughnessTexture||r.hasEmissionTexture||r.hasOcclusionTexture||r.hasNormalTexture?Z.Default:Z.None,r.objectAndLayerIdColorInstanced=r.instanced}initializeProgram(e){return this._initializeProgram(e,Pt.shader)}_initializeProgram(e,r){return new Er(e.rctx,r.get().build(this.configuration),Ot)}_convertDepthTestFunction(e){return e===Ct.Lequal?$e.LEQUAL:$e.LESS}_makePipeline(e,r){const i=this.configuration,o=e===rt.NONE,a=e===rt.FrontFace;return Sr({blending:i.output!==C.Color&&i.output!==C.Alpha||!i.transparent?null:o?Ca:Ma(e),culling:xl(i)&&Oa(i.cullFace),depthTest:{func:Pa(e,this._convertDepthTestFunction(i.customDepthTest))},depthWrite:o||a?i.writeDepth&&$a:null,colorWrite:yr,stencilWrite:i.hasOccludees?bs:null,stencilTest:i.hasOccludees?r?Ss:_s:null,polygonOffset:o||a?null:Ra(i.enableOffset)})}initializePipeline(){return this._occludeePipelineState=this._makePipeline(this.configuration.transparencyPassType,!0),this._makePipeline(this.configuration.transparencyPassType,!1)}getPipelineState(e,r){return r?this._occludeePipelineState:super.getPipelineState(e,r)}}function xl(t){return t.cullFace!==Pe.None||!t.hasSlicePlane&&!t.transparent&&!t.doubleSidedMode}Pt.shader=new Jt(vl,()=>wt(()=>import("./DefaultMaterial.glsl.13f68fae.js"),["assets/DefaultMaterial.glsl.13f68fae.js","assets/mat4f64.ff2a477c.js","assets/mat3f64.6d32a1d7.js","assets/vec3f32.1121a836.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/VertexAttribute.42396f25.js","assets/symbolColorUtils.36aaa708.js","assets/OrderIndependentTransparency.4d1575c0.js","assets/enums.2d9e6f64.js","assets/VertexArrayObject.53cf1857.js","assets/Texture.940076b2.js","assets/devEnvironmentUtils.d8d0484c.js","assets/BufferView.6eee27cd.js","assets/vec33.46fc6802.js","assets/DefaultMaterial_COLOR_GAMMA.8ee780a2.js","assets/types.44c7402c.js","assets/Version.433fbe58.js","assets/quat.d9562009.js","assets/quatf64.4ae3e6f1.js","assets/requestImageUtils.1f5d4b6d.js","assets/Util.f17667f9.js","assets/sphere.f99ddb50.js","assets/VertexElementDescriptor.1fdca6da.js","assets/InterleavedLayout.30cdc193.js"]));class we extends fo{constructor(){super(...arguments),this.hasWebGL2Context=!1}}x([T({constValue:!0})],we.prototype,"hasSliceHighlight",void 0),x([T({constValue:!1})],we.prototype,"hasSliceInVertexProgram",void 0),x([T({constValue:!1})],we.prototype,"instancedDoublePrecision",void 0),x([T({constValue:!1})],we.prototype,"useLegacyTerrainShading",void 0),x([T({constValue:!1})],we.prototype,"hasModelTransformation",void 0),x([T({constValue:z.Pass})],we.prototype,"pbrTextureBindType",void 0),x([T()],we.prototype,"hasWebGL2Context",void 0);class w extends we{constructor(){super(...arguments),this.output=C.Color,this.alphaDiscardMode=W.Opaque,this.doubleSidedMode=te.None,this.pbrMode=D.Disabled,this.cullFace=Pe.None,this.transparencyPassType=rt.NONE,this.normalType=X.Attribute,this.textureCoordinateType=Z.None,this.customDepthTest=Ct.Less,this.spherical=!1,this.hasVertexColors=!1,this.hasSymbolColors=!1,this.hasVerticalOffset=!1,this.hasSlicePlane=!1,this.hasSliceHighlight=!0,this.hasColorTexture=!1,this.hasMetallicRoughnessTexture=!1,this.hasEmissionTexture=!1,this.hasOcclusionTexture=!1,this.hasNormalTexture=!1,this.hasScreenSizePerspective=!1,this.hasVertexTangents=!1,this.hasOccludees=!1,this.hasMultipassTerrain=!1,this.hasModelTransformation=!1,this.offsetBackfaces=!1,this.vvSize=!1,this.vvColor=!1,this.receiveShadows=!1,this.receiveAmbientOcclusion=!1,this.textureAlphaPremultiplied=!1,this.instanced=!1,this.instancedColor=!1,this.objectAndLayerIdColorInstanced=!1,this.instancedDoublePrecision=!1,this.doublePrecisionRequiresObfuscation=!1,this.writeDepth=!0,this.transparent=!1,this.enableOffset=!0,this.cullAboveGround=!1,this.snowCover=!1,this.hasColorTextureTransform=!1,this.hasEmissionTextureTransform=!1,this.hasNormalTextureTransform=!1,this.hasOcclusionTextureTransform=!1,this.hasMetallicRoughnessTextureTransform=!1}}x([T({count:C.COUNT})],w.prototype,"output",void 0),x([T({count:W.COUNT})],w.prototype,"alphaDiscardMode",void 0),x([T({count:te.COUNT})],w.prototype,"doubleSidedMode",void 0),x([T({count:D.COUNT})],w.prototype,"pbrMode",void 0),x([T({count:Pe.COUNT})],w.prototype,"cullFace",void 0),x([T({count:rt.COUNT})],w.prototype,"transparencyPassType",void 0),x([T({count:X.COUNT})],w.prototype,"normalType",void 0),x([T({count:Z.COUNT})],w.prototype,"textureCoordinateType",void 0),x([T({count:Ct.COUNT})],w.prototype,"customDepthTest",void 0),x([T()],w.prototype,"spherical",void 0),x([T()],w.prototype,"hasVertexColors",void 0),x([T()],w.prototype,"hasSymbolColors",void 0),x([T()],w.prototype,"hasVerticalOffset",void 0),x([T()],w.prototype,"hasSlicePlane",void 0),x([T()],w.prototype,"hasSliceHighlight",void 0),x([T()],w.prototype,"hasColorTexture",void 0),x([T()],w.prototype,"hasMetallicRoughnessTexture",void 0),x([T()],w.prototype,"hasEmissionTexture",void 0),x([T()],w.prototype,"hasOcclusionTexture",void 0),x([T()],w.prototype,"hasNormalTexture",void 0),x([T()],w.prototype,"hasScreenSizePerspective",void 0),x([T()],w.prototype,"hasVertexTangents",void 0),x([T()],w.prototype,"hasOccludees",void 0),x([T()],w.prototype,"hasMultipassTerrain",void 0),x([T()],w.prototype,"hasModelTransformation",void 0),x([T()],w.prototype,"offsetBackfaces",void 0),x([T()],w.prototype,"vvSize",void 0),x([T()],w.prototype,"vvColor",void 0),x([T()],w.prototype,"receiveShadows",void 0),x([T()],w.prototype,"receiveAmbientOcclusion",void 0),x([T()],w.prototype,"textureAlphaPremultiplied",void 0),x([T()],w.prototype,"instanced",void 0),x([T()],w.prototype,"instancedColor",void 0),x([T()],w.prototype,"objectAndLayerIdColorInstanced",void 0),x([T()],w.prototype,"instancedDoublePrecision",void 0),x([T()],w.prototype,"doublePrecisionRequiresObfuscation",void 0),x([T()],w.prototype,"writeDepth",void 0),x([T()],w.prototype,"transparent",void 0),x([T()],w.prototype,"enableOffset",void 0),x([T()],w.prototype,"cullAboveGround",void 0),x([T()],w.prototype,"snowCover",void 0),x([T()],w.prototype,"hasColorTextureTransform",void 0),x([T()],w.prototype,"hasEmissionTextureTransform",void 0),x([T()],w.prototype,"hasNormalTextureTransform",void 0),x([T()],w.prototype,"hasOcclusionTextureTransform",void 0),x([T()],w.prototype,"hasMetallicRoughnessTextureTransform",void 0),x([T({constValue:!0})],w.prototype,"hasVvInstancing",void 0),x([T({constValue:!1})],w.prototype,"useCustomDTRExponentForWater",void 0),x([T({constValue:!1})],w.prototype,"supportsTextureAtlas",void 0),x([T({constValue:!0})],w.prototype,"useFillLights",void 0);function Tl(t){const e=new Mt,{vertex:r,fragment:i,varyings:o}=e;return xt(r,t),e.include($r),o.add("vpos","vec3"),e.include(Tt,t),e.include(vo,t),e.include(bo,t),t.output!==C.Color&&t.output!==C.Alpha||(yt(e.vertex,t),e.include(Zt,t),e.include(gt,t),t.offsetBackfaces&&e.include(co),t.instancedColor&&e.attributes.add(h.INSTANCECOLOR,"vec4"),o.add("vNormalWorld","vec3"),o.add("localvpos","vec3"),t.hasMultipassTerrain&&o.add("depth","float"),e.include(tt,t),e.include(lo,t),e.include(xo,t),e.include(To,t),r.uniforms.add(new Q("externalColor",a=>a.externalColor)),o.add("vcolorExt","vec4"),r.code.add(s` void main(void) { forwardNormalizedVertexColor(); vcolorExt = externalColor; @@ -1188,4 +1188,4 @@ return max(c.x, max(c.y, c.z)); gl_FragColor = highlightSlice(vec4(shadedColor, opacity_), vpos); ${t.transparencyPassType===rt.Color?s`gl_FragColor = premultiplyAlpha(gl_FragColor);`:s``} } - `)),e.include(_o,t),e}const bl=Object.freeze(Object.defineProperty({__proto__:null,build:Tl},Symbol.toStringTag,{value:"Module"}));class er extends Pt{initializeConfiguration(e,r){super.initializeConfiguration(e,r),r.hasMetallicRoughnessTexture=!1,r.hasEmissionTexture=!1,r.hasOcclusionTexture=!1,r.hasNormalTexture=!1,r.hasModelTransformation=!1,r.normalType=X.Attribute,r.doubleSidedMode=te.WindingOrder,r.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,er.shader)}}er.shader=new Jt(bl,()=>wt(()=>import("./RealisticTree.glsl.8875d152.js"),["assets/RealisticTree.glsl.8875d152.js","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/vec3f32.1121a836.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/VertexAttribute.42396f25.js","assets/symbolColorUtils.d5fe1bd7.js","assets/OrderIndependentTransparency.4d1575c0.js","assets/enums.2d9e6f64.js","assets/VertexArrayObject.a4c1d809.js","assets/Texture.4c97bad5.js","assets/devEnvironmentUtils.d8d0484c.js","assets/BufferView.89055914.js","assets/vec33.4564cd5b.js","assets/DefaultMaterial_COLOR_GAMMA.bf8213a8.js","assets/types.44c7402c.js","assets/Version.59f2da65.js","assets/quat.b3994f2f.js","assets/quatf64.4ae3e6f1.js","assets/requestImageUtils.7b09b5e8.js","assets/Util.ea9235b8.js","assets/sphere.ec1f4496.js","assets/VertexElementDescriptor.1fdca6da.js","assets/InterleavedLayout.f9d79992.js"]));class Oo extends as{constructor(e){super(e,yl),this.supportsEdges=!0,this._configuration=new w,this._vertexBufferLayout=Al(this.parameters),this._instanceBufferLayout=e.instanced?Cl(this.parameters):null}isVisibleForOutput(e){return e!==C.Shadow&&e!==C.ShadowExludeHighlight&&e!==C.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||e.layerOpacity===0)return!1;const{instanced:r,hasVertexColors:i,hasSymbolColors:o,vvColorEnabled:a}=e,n=p(r)&&r.includes("color"),l=e.colorMixMode==="replace",d=e.opacity>0,c=e.externalColor&&e.externalColor[3]>0;return i&&(n||a||o)?!!l||d:i?l?c:d:n||a||o?!!l||d:l?c:d}getConfiguration(e,r){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=!!this.parameters.instanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=this.parameters.vvSizeEnabled,this._configuration.hasVerticalOffset=p(this.parameters.verticalOffset),this._configuration.hasScreenSizePerspective=p(this.parameters.screenSizePerspective),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normals==="screenDerivative"?X.ScreenDerivative:X.Attribute,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,p(this.parameters.customDepthTest)&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?Pe.None:this.parameters.cullFace,this._configuration.hasMultipassTerrain=r.multipassTerrain.enabled,this._configuration.cullAboveGround=r.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=p(this.parameters.modelTransformation),e!==C.Color&&e!==C.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=te.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&this.parameters.doubleSidedType==="normal"?te.View:this.parameters.doubleSided&&this.parameters.doubleSidedType==="winding-order"?te.WindingOrder:te.None,this._configuration.instancedColor=p(this.parameters.instanced)&&this.parameters.instanced.includes("color"),this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=!!r.ssaoHelper.ready&&this.parameters.receiveSSAO,this._configuration.vvColor=this.parameters.vvColorEnabled,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?D.Schematic:D.Normal:D.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=r.transparencyPassType,this._configuration.enableOffset=r.camera.relativeElevation0||_==="transparency"||_==="maskAndTransparency",R=L?$o(L.alphaChannelUsage):void 0,F={ambient:Yr(y.diffuse),diffuse:Yr(y.diffuse),opacity:1-(y.transparency||0),transparent:E,textureAlphaMode:R,textureAlphaCutoff:.33,textureId:M,initTextureTransparent:!0,doubleSided:!0,cullFace:Pe.None,colorMixMode:y.externalColorMixMode||"tint",textureAlphaPremultiplied:!!L&&!!L.params.preMultiplyAlpha};p(e)&&e.materialParamsMixin&&Object.assign(F,e.materialParamsMixin),O=new Oo(F),o[g.material]||(o[g.material]={}),o[g.material][g.texture]=O}i.push(O);const N=new Kt(v,P);f+=P.position?P.position.length:0,r.push(N)}return{engineResources:[{name:d,stageResources:{textures:a,materials:i,geometries:r},pivotOffset:n.model.pivotOffset,numberOfVertices:f,lodThreshold:null}],referenceBoundingBox:Dl(r)}}function Dl(t){const e=$i();return t.forEach(r=>{const i=r.boundingInfo;p(i)&&(Gt(e,i.getBBMin()),Gt(e,i.getBBMax()))}),e}async function Fl(t,e){const r=[];for(const a in t){const n=t[a],l=n.images[0].data;if(!l){Te.warn("Externally referenced texture data is not yet supported");continue}const d=n.encoding+";base64,"+l,c="/textureDefinitions/"+a,u=n.channels==="rgba"?n.alphaChannelUsage||"transparency":"none",m={noUnpackFlip:!0,wrap:{s:Ke.REPEAT,t:Ke.REPEAT},preMultiplyAlpha:$o(u)!==W.Opaque},f=p(e)&&e.disableTextures?Promise.resolve(null):Ii(d,e);r.push(f.then(b=>({refId:c,image:b,params:m,alphaChannelUsage:u})))}const i=await Promise.all(r),o={};for(const a of i)o[a.refId]=a;return o}function $o(t){switch(t){case"mask":return W.Mask;case"maskAndTransparency":return W.MaskBlend;case"none":return W.Opaque;default:return W.Blend}}function zl(t){const e=t.params;return{id:1,material:e.material,texture:e.texture,region:e.texture}}const Vl=new Ei(1,2,"wosr");async function Bl(t,e){const r=Ro(Eo(t));if(r.fileType==="wosr"){const u=await(e.cache?e.cache.loadWOSR(r.url,e):Rl(r.url,e)),{engineResources:m,referenceBoundingBox:f}=Nl(u,e);return{lods:m,referenceBoundingBox:f,isEsriSymbolResource:!1,isWosr:!0}}const i=await(e.cache?e.cache.loadGLTF(r.url,e,e.usePBR):fa(new va(e.streamDataRequester),r.url,e,e.usePBR)),o=sa(i.model.meta,"ESRI_proxyEllipsoid"),a=i.meta.isEsriSymbolResource&&p(o)&&i.meta.uri.includes("/RealisticTrees/");a&&!i.customMeta.esriTreeRendering&&(i.customMeta.esriTreeRendering=!0,kl(i,o));const n=i.meta.isEsriSymbolResource?{usePBR:e.usePBR,isSchematic:!1,treeRendering:a,mrrFactors:[0,1,.2]}:{usePBR:e.usePBR,isSchematic:!1,treeRendering:!1,mrrFactors:[0,1,.5]},l={...e.materialParamsMixin,treeRendering:a},{engineResources:d,referenceBoundingBox:c}=Lo(i,n,l,e.skipHighLods&&r.specifiedLodIndex==null?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:d,referenceBoundingBox:c,isEsriSymbolResource:i.meta.isEsriSymbolResource,isWosr:!1}}function Ro(t){const e=t.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return e?{fileType:"gltf",url:e[1],specifiedLodIndex:e[4]!=null?Number(e[4]):null}:t.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:t,specifiedLodIndex:null}:{fileType:"unknown",url:t,specifiedLodIndex:null}}function Lo(t,e,r,i){const o=t.model,a=new Array,n=new Map,l=new Map,d=o.lods.length,c=$i();return o.lods.forEach((u,m)=>{const f=i.skipHighLods===!0&&(d>1&&m===0||d>3&&m===1)||i.skipHighLods===!1&&i.singleLodIndex!=null&&m!==i.singleLodIndex;if(f&&m!==0)return;const b=new Array;let A=0;if(u.parts.forEach(g=>{const{geometry:S,vertexCount:v}=Gl(g);b.push(S),A+=v;const P=S.boundingInfo;p(P)&&m===0&&(Gt(c,P.getBBMin()),Gt(c,P.getBBMax()))}),f)return;const $=new Xa(u.name,{textures:new Array,materials:new Array,geometries:b},u.lodThreshold,[0,0,0],A);a.push($),u.parts.forEach(g=>{const S=g.material+(g.attributes.normal?"_normal":"")+(g.attributes.color?"_color":"")+(g.attributes.texCoord0?"_texCoord0":"")+(g.attributes.tangent?"_tangent":""),v=o.materials.get(g.material),P=p(g.attributes.texCoord0),L=p(g.attributes.normal);if(k(v))return;const V=Ul(v.alphaMode);if(!n.has(S)){if(P){const F=(B,U=!1)=>{if(p(B)&&!l.has(B)){const H=o.textures.get(B);p(H)&&l.set(B,new ee(H.data,U?{...H.parameters,preMultiplyAlpha:U}:H.parameters))}};F(v.textureColor,V!==W.Opaque),F(v.textureNormal),F(v.textureOcclusion),F(v.textureEmissive),F(v.textureMetallicRoughness)}const M=v.color[0]**(1/qe),O=v.color[1]**(1/qe),N=v.color[2]**(1/qe),y=v.emissiveFactor[0]**(1/qe),_=v.emissiveFactor[1]**(1/qe),E=v.emissiveFactor[2]**(1/qe),R=p(v.textureColor)&&P?l.get(v.textureColor):null;n.set(S,new Oo({...e,transparent:V===W.Blend,customDepthTest:Ct.Lequal,textureAlphaMode:V,textureAlphaCutoff:v.alphaCutoff,diffuse:[M,O,N],ambient:[M,O,N],opacity:v.opacity,doubleSided:v.doubleSided,doubleSidedType:"winding-order",cullFace:v.doubleSided?Pe.None:Pe.Back,hasVertexColors:!!g.attributes.color,hasVertexTangents:!!g.attributes.tangent,normals:L?"default":"screenDerivative",castShadows:!0,receiveSSAO:!0,textureId:p(R)?R.id:void 0,colorMixMode:v.colorMixMode,normalTextureId:p(v.textureNormal)&&P?l.get(v.textureNormal).id:void 0,textureAlphaPremultiplied:p(R)&&!!R.params.preMultiplyAlpha,occlusionTextureId:p(v.textureOcclusion)&&P?l.get(v.textureOcclusion).id:void 0,emissiveTextureId:p(v.textureEmissive)&&P?l.get(v.textureEmissive).id:void 0,metallicRoughnessTextureId:p(v.textureMetallicRoughness)&&P?l.get(v.textureMetallicRoughness).id:void 0,emissiveFactor:[y,_,E],mrrFactors:[v.metallicFactor,v.roughnessFactor,e.mrrFactors[2]],isSchematic:!1,colorTextureTransformMatrix:ut(v.colorTextureTransform),normalTextureTransformMatrix:ut(v.normalTextureTransform),occlusionTextureTransformMatrix:ut(v.occlusionTextureTransform),emissiveTextureTransformMatrix:ut(v.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:ut(v.metallicRoughnessTextureTransform),...r}))}if($.stageResources.materials.push(n.get(S)),P){const M=O=>{p(O)&&$.stageResources.textures.push(l.get(O))};M(v.textureColor),M(v.textureNormal),M(v.textureOcclusion),M(v.textureEmissive),M(v.textureMetallicRoughness)}})}),{engineResources:a,referenceBoundingBox:c}}function Gl(t){const e=Hl(t.indices||t.attributes.position.count,t.primitiveType),r=t.attributes.position.count,i=Be(Qe,r);ua(i,t.attributes.position,t.transform);const o=[[h.POSITION,{data:i.typedBuffer,size:i.elementCount,exclusive:!0}]],a=[[h.POSITION,e]];if(p(t.attributes.normal)){const n=Be(Qe,r);Zr(Nt,t.transform),ha(n,t.attributes.normal,Nt),o.push([h.NORMAL,{data:n.typedBuffer,size:n.elementCount,exclusive:!0}]),a.push([h.NORMAL,e])}if(p(t.attributes.tangent)){const n=Be(hr,r);Zr(Nt,t.transform),ga(n,t.attributes.tangent,Nt),o.push([h.TANGENT,{data:n.typedBuffer,size:n.elementCount,exclusive:!0}]),a.push([h.TANGENT,e])}if(p(t.attributes.texCoord0)){const n=Be(Li,r);xa(n,t.attributes.texCoord0),o.push([h.UV0,{data:n.typedBuffer,size:n.elementCount,exclusive:!0}]),a.push([h.UV0,e])}if(p(t.attributes.color)){const n=Be(Je,r);if(t.attributes.color.elementCount===4)t.attributes.color instanceof hr?ri(n,t.attributes.color,255):t.attributes.color instanceof Je?Ta(n,t.attributes.color):t.attributes.color instanceof ca&&ri(n,t.attributes.color,1/256);else{ba(n,255,255,255,255);const l=new Qr(n.buffer,0,4);t.attributes.color instanceof Qe?ei(l,t.attributes.color,255):t.attributes.color instanceof Qr?ma(l,t.attributes.color):t.attributes.color instanceof da&&ei(l,t.attributes.color,1/256)}o.push([h.COLOR,{data:n.typedBuffer,size:n.elementCount,exclusive:!0}]),a.push([h.COLOR,e])}return{geometry:new Kt(o,a),vertexCount:r}}const Nt=Xt();function Ul(t){switch(t){case"BLEND":return W.Blend;case"MASK":return W.Mask;case"OPAQUE":case null:case void 0:return W.Opaque}}function Hl(t,e){switch(e){case ft.TRIANGLES:return ya(t);case ft.TRIANGLE_STRIP:return Sa(t);case ft.TRIANGLE_FAN:return _a(t)}}function kl(t,e){for(let r=0;r1&&cr(u,u,d,$>-1?.2:Math.min(-4*$-3.8,1)),f.setVec(A,u),m.set(A,0,255*S),m.set(A,1,255*S),m.set(A,2,255*S),m.set(A,3,255)}o.attributes.normal=f,o.attributes.color=m}}}var mc=Object.freeze(Object.defineProperty({__proto__:null,fetch:Bl,gltfToEngineResources:Lo,parseUrl:Ro},Symbol.toStringTag,{value:"Module"}));export{Tl as I,fl as Q,qs as c,Js as d,mc as o}; + `)),e.include(_o,t),e}const bl=Object.freeze(Object.defineProperty({__proto__:null,build:Tl},Symbol.toStringTag,{value:"Module"}));class er extends Pt{initializeConfiguration(e,r){super.initializeConfiguration(e,r),r.hasMetallicRoughnessTexture=!1,r.hasEmissionTexture=!1,r.hasOcclusionTexture=!1,r.hasNormalTexture=!1,r.hasModelTransformation=!1,r.normalType=X.Attribute,r.doubleSidedMode=te.WindingOrder,r.hasVertexTangents=!1}initializeProgram(e){return this._initializeProgram(e,er.shader)}}er.shader=new Jt(bl,()=>wt(()=>import("./RealisticTree.glsl.6abe3a4c.js"),["assets/RealisticTree.glsl.6abe3a4c.js","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/vec3f32.1121a836.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/VertexAttribute.42396f25.js","assets/symbolColorUtils.36aaa708.js","assets/OrderIndependentTransparency.4d1575c0.js","assets/enums.2d9e6f64.js","assets/VertexArrayObject.53cf1857.js","assets/Texture.940076b2.js","assets/devEnvironmentUtils.d8d0484c.js","assets/BufferView.6eee27cd.js","assets/vec33.46fc6802.js","assets/DefaultMaterial_COLOR_GAMMA.8ee780a2.js","assets/types.44c7402c.js","assets/Version.433fbe58.js","assets/quat.d9562009.js","assets/quatf64.4ae3e6f1.js","assets/requestImageUtils.1f5d4b6d.js","assets/Util.f17667f9.js","assets/sphere.f99ddb50.js","assets/VertexElementDescriptor.1fdca6da.js","assets/InterleavedLayout.30cdc193.js"]));class Oo extends as{constructor(e){super(e,yl),this.supportsEdges=!0,this._configuration=new w,this._vertexBufferLayout=Al(this.parameters),this._instanceBufferLayout=e.instanced?Cl(this.parameters):null}isVisibleForOutput(e){return e!==C.Shadow&&e!==C.ShadowExludeHighlight&&e!==C.ShadowHighlight||this.parameters.castShadows}isVisible(){const e=this.parameters;if(!super.isVisible()||e.layerOpacity===0)return!1;const{instanced:r,hasVertexColors:i,hasSymbolColors:o,vvColorEnabled:a}=e,n=p(r)&&r.includes("color"),l=e.colorMixMode==="replace",d=e.opacity>0,c=e.externalColor&&e.externalColor[3]>0;return i&&(n||a||o)?!!l||d:i?l?c:d:n||a||o?!!l||d:l?c:d}getConfiguration(e,r){return this._configuration.output=e,this._configuration.hasNormalTexture=!!this.parameters.normalTextureId,this._configuration.hasColorTexture=!!this.parameters.textureId,this._configuration.hasVertexTangents=this.parameters.hasVertexTangents,this._configuration.instanced=!!this.parameters.instanced,this._configuration.instancedDoublePrecision=this.parameters.instancedDoublePrecision,this._configuration.vvSize=this.parameters.vvSizeEnabled,this._configuration.hasVerticalOffset=p(this.parameters.verticalOffset),this._configuration.hasScreenSizePerspective=p(this.parameters.screenSizePerspective),this._configuration.hasSlicePlane=this.parameters.hasSlicePlane,this._configuration.hasSliceHighlight=this.parameters.hasSliceHighlight,this._configuration.alphaDiscardMode=this.parameters.textureAlphaMode,this._configuration.normalType=this.parameters.normals==="screenDerivative"?X.ScreenDerivative:X.Attribute,this._configuration.transparent=this.parameters.transparent,this._configuration.writeDepth=this.parameters.writeDepth,p(this.parameters.customDepthTest)&&(this._configuration.customDepthTest=this.parameters.customDepthTest),this._configuration.hasOccludees=this.parameters.hasOccludees,this._configuration.cullFace=this.parameters.hasSlicePlane?Pe.None:this.parameters.cullFace,this._configuration.hasMultipassTerrain=r.multipassTerrain.enabled,this._configuration.cullAboveGround=r.multipassTerrain.cullAboveGround,this._configuration.hasModelTransformation=p(this.parameters.modelTransformation),e!==C.Color&&e!==C.Alpha||(this._configuration.hasVertexColors=this.parameters.hasVertexColors,this._configuration.hasSymbolColors=this.parameters.hasSymbolColors,this.parameters.treeRendering?this._configuration.doubleSidedMode=te.WindingOrder:this._configuration.doubleSidedMode=this.parameters.doubleSided&&this.parameters.doubleSidedType==="normal"?te.View:this.parameters.doubleSided&&this.parameters.doubleSidedType==="winding-order"?te.WindingOrder:te.None,this._configuration.instancedColor=p(this.parameters.instanced)&&this.parameters.instanced.includes("color"),this._configuration.receiveShadows=this.parameters.receiveShadows&&this.parameters.shadowMappingEnabled,this._configuration.receiveAmbientOcclusion=!!r.ssaoHelper.ready&&this.parameters.receiveSSAO,this._configuration.vvColor=this.parameters.vvColorEnabled,this._configuration.textureAlphaPremultiplied=!!this.parameters.textureAlphaPremultiplied,this._configuration.pbrMode=this.parameters.usePBR?this.parameters.isSchematic?D.Schematic:D.Normal:D.Disabled,this._configuration.hasMetallicRoughnessTexture=!!this.parameters.metallicRoughnessTextureId,this._configuration.hasEmissionTexture=!!this.parameters.emissiveTextureId,this._configuration.hasOcclusionTexture=!!this.parameters.occlusionTextureId,this._configuration.offsetBackfaces=!(!this.parameters.transparent||!this.parameters.offsetTransparentBackfaces),this._configuration.transparencyPassType=r.transparencyPassType,this._configuration.enableOffset=r.camera.relativeElevation0||_==="transparency"||_==="maskAndTransparency",R=L?$o(L.alphaChannelUsage):void 0,F={ambient:Yr(y.diffuse),diffuse:Yr(y.diffuse),opacity:1-(y.transparency||0),transparent:E,textureAlphaMode:R,textureAlphaCutoff:.33,textureId:M,initTextureTransparent:!0,doubleSided:!0,cullFace:Pe.None,colorMixMode:y.externalColorMixMode||"tint",textureAlphaPremultiplied:!!L&&!!L.params.preMultiplyAlpha};p(e)&&e.materialParamsMixin&&Object.assign(F,e.materialParamsMixin),O=new Oo(F),o[g.material]||(o[g.material]={}),o[g.material][g.texture]=O}i.push(O);const N=new Kt(v,P);f+=P.position?P.position.length:0,r.push(N)}return{engineResources:[{name:d,stageResources:{textures:a,materials:i,geometries:r},pivotOffset:n.model.pivotOffset,numberOfVertices:f,lodThreshold:null}],referenceBoundingBox:Dl(r)}}function Dl(t){const e=$i();return t.forEach(r=>{const i=r.boundingInfo;p(i)&&(Gt(e,i.getBBMin()),Gt(e,i.getBBMax()))}),e}async function Fl(t,e){const r=[];for(const a in t){const n=t[a],l=n.images[0].data;if(!l){Te.warn("Externally referenced texture data is not yet supported");continue}const d=n.encoding+";base64,"+l,c="/textureDefinitions/"+a,u=n.channels==="rgba"?n.alphaChannelUsage||"transparency":"none",m={noUnpackFlip:!0,wrap:{s:Ke.REPEAT,t:Ke.REPEAT},preMultiplyAlpha:$o(u)!==W.Opaque},f=p(e)&&e.disableTextures?Promise.resolve(null):Ii(d,e);r.push(f.then(b=>({refId:c,image:b,params:m,alphaChannelUsage:u})))}const i=await Promise.all(r),o={};for(const a of i)o[a.refId]=a;return o}function $o(t){switch(t){case"mask":return W.Mask;case"maskAndTransparency":return W.MaskBlend;case"none":return W.Opaque;default:return W.Blend}}function zl(t){const e=t.params;return{id:1,material:e.material,texture:e.texture,region:e.texture}}const Vl=new Ei(1,2,"wosr");async function Bl(t,e){const r=Ro(Eo(t));if(r.fileType==="wosr"){const u=await(e.cache?e.cache.loadWOSR(r.url,e):Rl(r.url,e)),{engineResources:m,referenceBoundingBox:f}=Nl(u,e);return{lods:m,referenceBoundingBox:f,isEsriSymbolResource:!1,isWosr:!0}}const i=await(e.cache?e.cache.loadGLTF(r.url,e,e.usePBR):fa(new va(e.streamDataRequester),r.url,e,e.usePBR)),o=sa(i.model.meta,"ESRI_proxyEllipsoid"),a=i.meta.isEsriSymbolResource&&p(o)&&i.meta.uri.includes("/RealisticTrees/");a&&!i.customMeta.esriTreeRendering&&(i.customMeta.esriTreeRendering=!0,kl(i,o));const n=i.meta.isEsriSymbolResource?{usePBR:e.usePBR,isSchematic:!1,treeRendering:a,mrrFactors:[0,1,.2]}:{usePBR:e.usePBR,isSchematic:!1,treeRendering:!1,mrrFactors:[0,1,.5]},l={...e.materialParamsMixin,treeRendering:a},{engineResources:d,referenceBoundingBox:c}=Lo(i,n,l,e.skipHighLods&&r.specifiedLodIndex==null?{skipHighLods:!0}:{skipHighLods:!1,singleLodIndex:r.specifiedLodIndex});return{lods:d,referenceBoundingBox:c,isEsriSymbolResource:i.meta.isEsriSymbolResource,isWosr:!1}}function Ro(t){const e=t.match(/(.*\.(gltf|glb))(\?lod=([0-9]+))?$/);return e?{fileType:"gltf",url:e[1],specifiedLodIndex:e[4]!=null?Number(e[4]):null}:t.match(/(.*\.(json|json\.gz))$/)?{fileType:"wosr",url:t,specifiedLodIndex:null}:{fileType:"unknown",url:t,specifiedLodIndex:null}}function Lo(t,e,r,i){const o=t.model,a=new Array,n=new Map,l=new Map,d=o.lods.length,c=$i();return o.lods.forEach((u,m)=>{const f=i.skipHighLods===!0&&(d>1&&m===0||d>3&&m===1)||i.skipHighLods===!1&&i.singleLodIndex!=null&&m!==i.singleLodIndex;if(f&&m!==0)return;const b=new Array;let A=0;if(u.parts.forEach(g=>{const{geometry:S,vertexCount:v}=Gl(g);b.push(S),A+=v;const P=S.boundingInfo;p(P)&&m===0&&(Gt(c,P.getBBMin()),Gt(c,P.getBBMax()))}),f)return;const $=new Xa(u.name,{textures:new Array,materials:new Array,geometries:b},u.lodThreshold,[0,0,0],A);a.push($),u.parts.forEach(g=>{const S=g.material+(g.attributes.normal?"_normal":"")+(g.attributes.color?"_color":"")+(g.attributes.texCoord0?"_texCoord0":"")+(g.attributes.tangent?"_tangent":""),v=o.materials.get(g.material),P=p(g.attributes.texCoord0),L=p(g.attributes.normal);if(k(v))return;const V=Ul(v.alphaMode);if(!n.has(S)){if(P){const F=(B,U=!1)=>{if(p(B)&&!l.has(B)){const H=o.textures.get(B);p(H)&&l.set(B,new ee(H.data,U?{...H.parameters,preMultiplyAlpha:U}:H.parameters))}};F(v.textureColor,V!==W.Opaque),F(v.textureNormal),F(v.textureOcclusion),F(v.textureEmissive),F(v.textureMetallicRoughness)}const M=v.color[0]**(1/qe),O=v.color[1]**(1/qe),N=v.color[2]**(1/qe),y=v.emissiveFactor[0]**(1/qe),_=v.emissiveFactor[1]**(1/qe),E=v.emissiveFactor[2]**(1/qe),R=p(v.textureColor)&&P?l.get(v.textureColor):null;n.set(S,new Oo({...e,transparent:V===W.Blend,customDepthTest:Ct.Lequal,textureAlphaMode:V,textureAlphaCutoff:v.alphaCutoff,diffuse:[M,O,N],ambient:[M,O,N],opacity:v.opacity,doubleSided:v.doubleSided,doubleSidedType:"winding-order",cullFace:v.doubleSided?Pe.None:Pe.Back,hasVertexColors:!!g.attributes.color,hasVertexTangents:!!g.attributes.tangent,normals:L?"default":"screenDerivative",castShadows:!0,receiveSSAO:!0,textureId:p(R)?R.id:void 0,colorMixMode:v.colorMixMode,normalTextureId:p(v.textureNormal)&&P?l.get(v.textureNormal).id:void 0,textureAlphaPremultiplied:p(R)&&!!R.params.preMultiplyAlpha,occlusionTextureId:p(v.textureOcclusion)&&P?l.get(v.textureOcclusion).id:void 0,emissiveTextureId:p(v.textureEmissive)&&P?l.get(v.textureEmissive).id:void 0,metallicRoughnessTextureId:p(v.textureMetallicRoughness)&&P?l.get(v.textureMetallicRoughness).id:void 0,emissiveFactor:[y,_,E],mrrFactors:[v.metallicFactor,v.roughnessFactor,e.mrrFactors[2]],isSchematic:!1,colorTextureTransformMatrix:ut(v.colorTextureTransform),normalTextureTransformMatrix:ut(v.normalTextureTransform),occlusionTextureTransformMatrix:ut(v.occlusionTextureTransform),emissiveTextureTransformMatrix:ut(v.emissiveTextureTransform),metallicRoughnessTextureTransformMatrix:ut(v.metallicRoughnessTextureTransform),...r}))}if($.stageResources.materials.push(n.get(S)),P){const M=O=>{p(O)&&$.stageResources.textures.push(l.get(O))};M(v.textureColor),M(v.textureNormal),M(v.textureOcclusion),M(v.textureEmissive),M(v.textureMetallicRoughness)}})}),{engineResources:a,referenceBoundingBox:c}}function Gl(t){const e=Hl(t.indices||t.attributes.position.count,t.primitiveType),r=t.attributes.position.count,i=Be(Qe,r);ua(i,t.attributes.position,t.transform);const o=[[h.POSITION,{data:i.typedBuffer,size:i.elementCount,exclusive:!0}]],a=[[h.POSITION,e]];if(p(t.attributes.normal)){const n=Be(Qe,r);Zr(Nt,t.transform),ha(n,t.attributes.normal,Nt),o.push([h.NORMAL,{data:n.typedBuffer,size:n.elementCount,exclusive:!0}]),a.push([h.NORMAL,e])}if(p(t.attributes.tangent)){const n=Be(hr,r);Zr(Nt,t.transform),ga(n,t.attributes.tangent,Nt),o.push([h.TANGENT,{data:n.typedBuffer,size:n.elementCount,exclusive:!0}]),a.push([h.TANGENT,e])}if(p(t.attributes.texCoord0)){const n=Be(Li,r);xa(n,t.attributes.texCoord0),o.push([h.UV0,{data:n.typedBuffer,size:n.elementCount,exclusive:!0}]),a.push([h.UV0,e])}if(p(t.attributes.color)){const n=Be(Je,r);if(t.attributes.color.elementCount===4)t.attributes.color instanceof hr?ri(n,t.attributes.color,255):t.attributes.color instanceof Je?Ta(n,t.attributes.color):t.attributes.color instanceof ca&&ri(n,t.attributes.color,1/256);else{ba(n,255,255,255,255);const l=new Qr(n.buffer,0,4);t.attributes.color instanceof Qe?ei(l,t.attributes.color,255):t.attributes.color instanceof Qr?ma(l,t.attributes.color):t.attributes.color instanceof da&&ei(l,t.attributes.color,1/256)}o.push([h.COLOR,{data:n.typedBuffer,size:n.elementCount,exclusive:!0}]),a.push([h.COLOR,e])}return{geometry:new Kt(o,a),vertexCount:r}}const Nt=Xt();function Ul(t){switch(t){case"BLEND":return W.Blend;case"MASK":return W.Mask;case"OPAQUE":case null:case void 0:return W.Opaque}}function Hl(t,e){switch(e){case ft.TRIANGLES:return ya(t);case ft.TRIANGLE_STRIP:return Sa(t);case ft.TRIANGLE_FAN:return _a(t)}}function kl(t,e){for(let r=0;r1&&cr(u,u,d,$>-1?.2:Math.min(-4*$-3.8,1)),f.setVec(A,u),m.set(A,0,255*S),m.set(A,1,255*S),m.set(A,2,255*S),m.set(A,3,255)}o.attributes.normal=f,o.attributes.color=m}}}var mc=Object.freeze(Object.defineProperty({__proto__:null,fetch:Bl,gltfToEngineResources:Lo,parseUrl:Ro},Symbol.toStringTag,{value:"Module"}));export{Tl as I,fl as Q,qs as c,Js as d,mc as o}; diff --git a/assets/observers.11f150c2.js b/assets/observers.440ad120.js similarity index 94% rename from assets/observers.11f150c2.js rename to assets/observers.440ad120.js index 721e0fd..b8b4b45 100644 --- a/assets/observers.11f150c2.js +++ b/assets/observers.440ad120.js @@ -1,4 +1,4 @@ -import{B as o}from"./index.d94abe07.js";/*! +import{B as o}from"./index.221827cd.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.0-beta.97 diff --git a/assets/ogcFeatureUtils.ed8217a8.js b/assets/ogcFeatureUtils.61a937b0.js similarity index 97% rename from assets/ogcFeatureUtils.ed8217a8.js rename to assets/ogcFeatureUtils.61a937b0.js index 51263ef..bb3e3a2 100644 --- a/assets/ogcFeatureUtils.ed8217a8.js +++ b/assets/ogcFeatureUtils.61a937b0.js @@ -1 +1 @@ -import{s as E,j as y,n as g,U as j,gx as B,ci as Q,aT as T,gY as U,bd as V,c as k,c8 as Y,bP as H,cL as G,e_ as X,gZ as ee}from"./index.d94abe07.js";import{T as te,L as ne,I as ie}from"./geojson.8a0cb9d1.js";import{o as ae}from"./clientSideDefaults.f5f7bfa0.js";const N=E.getLogger("esri.layers.graphics.sources.ogcfeature"),P="http://www.opengis.net/def/crs/",pe=`${P}OGC/1.3/CRS84`;async function ge(e,n,t={},i=5){const{links:r}=e,l=f(r,"items","application/geo+json")||f(r,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(y(l))throw new g("ogc-feature-layer:missing-items-page","Missing items url");const{data:c}=await j(l.href,{signal:t.signal,query:{limit:i,...t.customParameters,token:t.apiKey},headers:{accept:"application/geo+json"}});await te(c);const s=ne(c,{geometryType:n.geometryType}),u=n.fields||s.fields||[],x=n.hasZ!=null?n.hasZ:s.hasZ,F=s.geometryType,m=n.objectIdField||s.objectIdFieldName||"OBJECTID";let o=n.timeInfo;const w=u.find(({name:a})=>a===m);if(w)w.editable=!1,w.nullable=!1;else{if(!s.objectIdFieldType)throw new g("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");u.unshift({name:m,alias:m,type:s.objectIdFieldType==="number"?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(m!==s.objectIdFieldName){const a=u.find(({name:d})=>d===s.objectIdFieldName);a&&(a.type="esriFieldTypeInteger")}u===s.fields&&s.unknownFields.length>0&&N.warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:s.unknownFields}});for(const a of u){if(a.name==null&&(a.name=a.alias),a.alias==null&&(a.alias=a.name),a.type!=="esriFieldTypeOID"&&a.type!=="esriFieldTypeGlobalID"&&(a.editable=a.editable==null||!!a.editable,a.nullable=a.nullable==null||!!a.nullable),!a.name)throw new g("ogc-feature-layer:invalid-field-name","field name is missing",{field:a});if(!B.jsonValues.includes(a.type))throw new g("ogc-feature-layer:invalid-field-type",`invalid type for field "${a.name}"`,{field:a})}if(o){const a=new Q(u);if(o.startTimeField){const d=a.get(o.startTimeField);d?(o.startTimeField=d.name,d.type="esriFieldTypeDate"):o.startTimeField=null}if(o.endTimeField){const d=a.get(o.endTimeField);d?(o.endTimeField=d.name,d.type="esriFieldTypeDate"):o.endTimeField=null}if(o.trackIdField){const d=a.get(o.trackIdField);d?o.trackIdField=d.name:(o.trackIdField=null,N.warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:o}}))}o.startTimeField||o.endTimeField||(N.warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:o}}),o=null)}return{drawingInfo:F?ae(F):null,extent:de(e),geometryType:F,fields:u,hasZ:!!x,objectIdField:m,timeInfo:o}}async function ye(e,n={}){const{links:t}=e,i=f(t,"data","application/json")||f(t,"http://www.opengis.net/def/rel/ogc/1.0/data","application/json");if(y(i))throw new g("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:r,customParameters:l,signal:c}=n,{data:s}=await j(i.href,{signal:c,headers:{accept:"application/json"},query:{...l,token:r}});return s}async function we(e,n={}){const{links:t}=e,i=f(t,"conformance","application/json")||f(t,"http://www.opengis.net/def/rel/ogc/1.0/conformance","application/json");if(y(i))throw new g("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:r,customParameters:l,signal:c}=n,{data:s}=await j(i.href,{signal:c,headers:{accept:"application/json"},query:{...l,token:r}});return s}async function be(e,n={}){const{apiKey:t,customParameters:i,signal:r}=n,{data:l}=await j(e,{signal:r,headers:{accept:"application/json"},query:{...i,token:t}});return l}async function he(e,n={}){const t="application/vnd.oai.openapi+json;version=3.0",i=f(e.links,"service-desc",t);if(y(i))return N.warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:r,customParameters:l,signal:c}=n,{data:s}=await j(i.href,{signal:c,headers:{accept:t},query:{...l,token:r}});return s}function Fe(e){var r;const n=(r=/^http:\/\/www\.opengis.net\/def\/crs\/(?.*)\/(?.*)\/(?.*)$/i.exec(e))==null?void 0:r.groups;if(!n)return null;const{authority:t,code:i}=n;switch(t.toLowerCase()){case"ogc":switch(i.toLowerCase()){case"crs27":return T.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return T.WGS84.wkid;default:return null}case"esri":case"epsg":{const l=Number.parseInt(i,10);return Number.isNaN(l)?null:l}default:return null}}async function Ie(e,n,t){const i=await se(e,n,t);return U(i)}async function se(e,n,t){const{collection:i,layerDefinition:r,maxRecordCount:l,queryParameters:{apiKey:c,customParameters:s},spatialReference:u,supportedCrs:x}=e,{links:F}=i,m=f(F,"items","application/geo+json")||f(F,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(y(m))throw new g("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:o,num:w,start:a,timeExtent:d,where:D}=n;if(n.objectIds)throw new g("ogc-feature-layer:query-by-objectids-not-supported","Queries with objectids are not supported");const Z=T.fromJSON(u),I=V(n.outSpatialReference,Z),S=I.isWGS84?null:R(I,x),K=ce(o,x),L=oe(d),J=le(D),A=w!=null?w:a!=null&&a!==void 0?10:l,{data:b}=await j(m.href,{...t,query:{...s,...K,crs:S,datetime:L,query:J,limit:A,startindex:a,token:c},headers:{accept:"application/geo+json"}});let $=!1;b.links&&($=!!b.links.find(v=>v.rel==="next")),!$&&Number.isInteger(b.numberMatched)&&Number.isInteger(b.numberReturned)&&($=b.numberReturnedi.rel===n&&i.type===t)||e.find(i=>i.rel===n&&!i.type)}export{pe as F,ge as I,Ie as N,he as S,ye as T,P as j,we as k,se as q,Fe as v,be as x}; +import{s as E,j as y,n as g,U as j,gx as B,ci as Q,aT as T,gY as U,bd as V,c as k,c8 as Y,bP as H,cL as G,e_ as X,gZ as ee}from"./index.221827cd.js";import{T as te,L as ne,I as ie}from"./geojson.7d18026b.js";import{o as ae}from"./clientSideDefaults.d40b9315.js";const N=E.getLogger("esri.layers.graphics.sources.ogcfeature"),P="http://www.opengis.net/def/crs/",pe=`${P}OGC/1.3/CRS84`;async function ge(e,n,t={},i=5){const{links:r}=e,l=f(r,"items","application/geo+json")||f(r,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(y(l))throw new g("ogc-feature-layer:missing-items-page","Missing items url");const{data:c}=await j(l.href,{signal:t.signal,query:{limit:i,...t.customParameters,token:t.apiKey},headers:{accept:"application/geo+json"}});await te(c);const s=ne(c,{geometryType:n.geometryType}),u=n.fields||s.fields||[],x=n.hasZ!=null?n.hasZ:s.hasZ,F=s.geometryType,m=n.objectIdField||s.objectIdFieldName||"OBJECTID";let o=n.timeInfo;const w=u.find(({name:a})=>a===m);if(w)w.editable=!1,w.nullable=!1;else{if(!s.objectIdFieldType)throw new g("ogc-feature-layer:missing-feature-id","Collection geojson require a feature id as a unique identifier");u.unshift({name:m,alias:m,type:s.objectIdFieldType==="number"?"esriFieldTypeOID":"esriFieldTypeString",editable:!1,nullable:!1})}if(m!==s.objectIdFieldName){const a=u.find(({name:d})=>d===s.objectIdFieldName);a&&(a.type="esriFieldTypeInteger")}u===s.fields&&s.unknownFields.length>0&&N.warn({name:"ogc-feature-layer:unknown-field-types",message:"Some fields types couldn't be inferred from the features and were dropped",details:{unknownFields:s.unknownFields}});for(const a of u){if(a.name==null&&(a.name=a.alias),a.alias==null&&(a.alias=a.name),a.type!=="esriFieldTypeOID"&&a.type!=="esriFieldTypeGlobalID"&&(a.editable=a.editable==null||!!a.editable,a.nullable=a.nullable==null||!!a.nullable),!a.name)throw new g("ogc-feature-layer:invalid-field-name","field name is missing",{field:a});if(!B.jsonValues.includes(a.type))throw new g("ogc-feature-layer:invalid-field-type",`invalid type for field "${a.name}"`,{field:a})}if(o){const a=new Q(u);if(o.startTimeField){const d=a.get(o.startTimeField);d?(o.startTimeField=d.name,d.type="esriFieldTypeDate"):o.startTimeField=null}if(o.endTimeField){const d=a.get(o.endTimeField);d?(o.endTimeField=d.name,d.type="esriFieldTypeDate"):o.endTimeField=null}if(o.trackIdField){const d=a.get(o.trackIdField);d?o.trackIdField=d.name:(o.trackIdField=null,N.warn({name:"ogc-feature-layer:invalid-timeInfo-trackIdField",message:"trackIdField is missing",details:{timeInfo:o}}))}o.startTimeField||o.endTimeField||(N.warn({name:"ogc-feature-layer:invalid-timeInfo",message:"startTimeField and endTimeField are missing",details:{timeInfo:o}}),o=null)}return{drawingInfo:F?ae(F):null,extent:de(e),geometryType:F,fields:u,hasZ:!!x,objectIdField:m,timeInfo:o}}async function ye(e,n={}){const{links:t}=e,i=f(t,"data","application/json")||f(t,"http://www.opengis.net/def/rel/ogc/1.0/data","application/json");if(y(i))throw new g("ogc-feature-layer:missing-collections-page","Missing collections url");const{apiKey:r,customParameters:l,signal:c}=n,{data:s}=await j(i.href,{signal:c,headers:{accept:"application/json"},query:{...l,token:r}});return s}async function we(e,n={}){const{links:t}=e,i=f(t,"conformance","application/json")||f(t,"http://www.opengis.net/def/rel/ogc/1.0/conformance","application/json");if(y(i))throw new g("ogc-feature-layer:missing-conformance-page","Missing conformance url");const{apiKey:r,customParameters:l,signal:c}=n,{data:s}=await j(i.href,{signal:c,headers:{accept:"application/json"},query:{...l,token:r}});return s}async function be(e,n={}){const{apiKey:t,customParameters:i,signal:r}=n,{data:l}=await j(e,{signal:r,headers:{accept:"application/json"},query:{...i,token:t}});return l}async function he(e,n={}){const t="application/vnd.oai.openapi+json;version=3.0",i=f(e.links,"service-desc",t);if(y(i))return N.warn("ogc-feature-layer:missing-openapi-page","The OGC API-Features server does not have an OpenAPI page."),null;const{apiKey:r,customParameters:l,signal:c}=n,{data:s}=await j(i.href,{signal:c,headers:{accept:t},query:{...l,token:r}});return s}function Fe(e){var r;const n=(r=/^http:\/\/www\.opengis.net\/def\/crs\/(?.*)\/(?.*)\/(?.*)$/i.exec(e))==null?void 0:r.groups;if(!n)return null;const{authority:t,code:i}=n;switch(t.toLowerCase()){case"ogc":switch(i.toLowerCase()){case"crs27":return T.GCS_NAD_1927.wkid;case"crs83":return 4269;case"crs84":case"crs84h":return T.WGS84.wkid;default:return null}case"esri":case"epsg":{const l=Number.parseInt(i,10);return Number.isNaN(l)?null:l}default:return null}}async function Ie(e,n,t){const i=await se(e,n,t);return U(i)}async function se(e,n,t){const{collection:i,layerDefinition:r,maxRecordCount:l,queryParameters:{apiKey:c,customParameters:s},spatialReference:u,supportedCrs:x}=e,{links:F}=i,m=f(F,"items","application/geo+json")||f(F,"http://www.opengis.net/def/rel/ogc/1.0/items","application/geo+json");if(y(m))throw new g("ogc-feature-layer:missing-items-page","Missing items url");const{geometry:o,num:w,start:a,timeExtent:d,where:D}=n;if(n.objectIds)throw new g("ogc-feature-layer:query-by-objectids-not-supported","Queries with objectids are not supported");const Z=T.fromJSON(u),I=V(n.outSpatialReference,Z),S=I.isWGS84?null:R(I,x),K=ce(o,x),L=oe(d),J=le(D),A=w!=null?w:a!=null&&a!==void 0?10:l,{data:b}=await j(m.href,{...t,query:{...s,...K,crs:S,datetime:L,query:J,limit:A,startindex:a,token:c},headers:{accept:"application/geo+json"}});let $=!1;b.links&&($=!!b.links.find(v=>v.rel==="next")),!$&&Number.isInteger(b.numberMatched)&&Number.isInteger(b.numberReturned)&&($=b.numberReturnedi.rel===n&&i.type===t)||e.find(i=>i.rel===n&&!i.type)}export{pe as F,ge as I,Ie as N,he as S,ye as T,P as j,we as k,se as q,Fe as v,be as x}; diff --git a/assets/persistable.5f665309.js b/assets/persistable.6b292e5e.js similarity index 94% rename from assets/persistable.5f665309.js rename to assets/persistable.6b292e5e.js index a6e99c4..d566294 100644 --- a/assets/persistable.5f665309.js +++ b/assets/persistable.6b292e5e.js @@ -1 +1 @@ -import{eR as w,jd as _,je as z,iw as S,jf as x,jg as $,jh as k,ji as F,jj as A,jk as U,jl as B,i1 as E,eP as J,at as K,jm as T}from"./index.d94abe07.js";import{i as V}from"./multiOriginJSONSupportUtils.38b69b9c.js";function g(e){return y[D(e)]||L}function D(e){return e instanceof Blob?e.type:G(e.url)}function G(e){const t=w(e);return d[t]||I}const y={},I="text/plain",L=y[I],d={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const e in d)y[d[e]]=e;function ee(e){var o;const t=(o=e==null?void 0:e.origins)!=null?o:[void 0];return(i,n)=>{const s=X(e,i,n);for(const a of t){const r=_(i,a,n);for(const c in s)r[c]=s[c]}}}function X(e,t,o){var i;if((e==null?void 0:e.type)==="resource")return q(e,t,o);switch((i=e==null?void 0:e.type)!=null?i:"other"){case"other":return{read:!0,write:!0};case"url":{const{read:n,write:s}=T;return{read:n,write:s}}}}function q(e,t,o){const i=z(t,o);return{type:String,read:(n,s,a)=>{const r=S(n,s,a);return i.type===String?r:typeof i.type=="function"?new i.type({url:r}):void 0},write:{writer(n,s,a,r){if(!r||!r.resources)return typeof n=="string"?void(s[a]=x(n,r)):void(s[a]=n.write({},r));const c=Q(n),p=x(c,{...r,verifyItemRelativeUrls:r&&r.verifyItemRelativeUrls?{writtenUrls:r.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},$.NO),l=i.type!==String&&(!V(this)||r&&r.origin&&this.originIdOf(o)>k(r.origin)),u={object:this,propertyName:o,value:n,targetUrl:p,dest:s,targetPropertyName:a,context:r,params:e};r&&r.portalItem&&p&&!F(p)?l?C(u):H(u):r&&r.portalItem&&(p==null||A(p)!=null||U(p)||l)?P(u):s[a]=p}}}}function P(e){var v,h,j;const{targetUrl:t,params:o,value:i,context:n,dest:s,targetPropertyName:a}=e;if(!n.portalItem)return;const r=B(t),c=(v=r==null?void 0:r.filename)!=null?v:E(),p=(h=o==null?void 0:o.prefix)!=null?h:r==null?void 0:r.prefix,l=N(i,t,n),u=J(p,c),m=`${u}.${g(l)}`,f=n.portalItem.resourceFromPath(m);U(t)&&n.resources&&n.resources.pendingOperations.push(M(t).then(O=>{f.path=`${u}.${g(O)}`,s[a]=f.itemRelativeUrl}).catch(()=>{}));const R=(j=o==null?void 0:o.compress)!=null?j:!1;n.resources&&b({...e,resource:f,content:l,compress:R,updates:n.resources.toAdd}),s[a]=f.itemRelativeUrl}function C(e){var m;const{context:t,targetUrl:o,params:i,value:n,dest:s,targetPropertyName:a}=e;if(!t.portalItem)return;const r=t.portalItem.resourceFromPath(o),c=N(n,o,t),p=g(c),l=w(r.path),u=(m=i==null?void 0:i.compress)!=null?m:!1;p===l?(t.resources&&b({...e,resource:r,content:c,compress:u,updates:t.resources.toUpdate}),s[a]=o):P(e)}function H({context:e,targetUrl:t,dest:o,targetPropertyName:i}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(t),compress:!1}),o[i]=t)}function b({object:e,propertyName:t,updates:o,resource:i,content:n,compress:s}){o.push({resource:i,content:n,compress:s,finish:a=>{W(e,t,a)}})}function N(e,t,o){return typeof e=="string"?{url:t}:new Blob([JSON.stringify(e.toJSON(o))],{type:"application/json"})}async function M(e){const t=(await K(()=>import("./index.d94abe07.js").then(function(i){return i.kX}),["assets/index.d94abe07.js","assets/index.f5419ca5.css"])).default,{data:o}=await t(e,{responseType:"blob"});return o}function Q(e){return e==null?null:typeof e=="string"?e:e.url}function W(e,t,o){typeof e[t]=="string"?e[t]=o.url:e[t].url=o.url}export{ee as g}; +import{eR as w,jd as _,je as z,iw as S,jf as x,jg as $,jh as k,ji as F,jj as A,jk as U,jl as B,i1 as E,eP as J,at as K,jm as T}from"./index.221827cd.js";import{i as V}from"./multiOriginJSONSupportUtils.38b69b9c.js";function g(e){return y[D(e)]||L}function D(e){return e instanceof Blob?e.type:G(e.url)}function G(e){const t=w(e);return d[t]||I}const y={},I="text/plain",L=y[I],d={png:"image/png",jpeg:"image/jpeg",jpg:"image/jpg",bmp:"image/bmp",gif:"image/gif",json:"application/json",txt:"text/plain",xml:"application/xml",svg:"image/svg+xml",zip:"application/zip",pbf:"application/vnd.mapbox-vector-tile",gz:"application/gzip","bin.gz":"application/octet-stream"};for(const e in d)y[d[e]]=e;function ee(e){var o;const t=(o=e==null?void 0:e.origins)!=null?o:[void 0];return(i,n)=>{const s=X(e,i,n);for(const a of t){const r=_(i,a,n);for(const c in s)r[c]=s[c]}}}function X(e,t,o){var i;if((e==null?void 0:e.type)==="resource")return q(e,t,o);switch((i=e==null?void 0:e.type)!=null?i:"other"){case"other":return{read:!0,write:!0};case"url":{const{read:n,write:s}=T;return{read:n,write:s}}}}function q(e,t,o){const i=z(t,o);return{type:String,read:(n,s,a)=>{const r=S(n,s,a);return i.type===String?r:typeof i.type=="function"?new i.type({url:r}):void 0},write:{writer(n,s,a,r){if(!r||!r.resources)return typeof n=="string"?void(s[a]=x(n,r)):void(s[a]=n.write({},r));const c=Q(n),p=x(c,{...r,verifyItemRelativeUrls:r&&r.verifyItemRelativeUrls?{writtenUrls:r.verifyItemRelativeUrls.writtenUrls,rootPath:void 0}:void 0},$.NO),l=i.type!==String&&(!V(this)||r&&r.origin&&this.originIdOf(o)>k(r.origin)),u={object:this,propertyName:o,value:n,targetUrl:p,dest:s,targetPropertyName:a,context:r,params:e};r&&r.portalItem&&p&&!F(p)?l?C(u):H(u):r&&r.portalItem&&(p==null||A(p)!=null||U(p)||l)?P(u):s[a]=p}}}}function P(e){var v,h,j;const{targetUrl:t,params:o,value:i,context:n,dest:s,targetPropertyName:a}=e;if(!n.portalItem)return;const r=B(t),c=(v=r==null?void 0:r.filename)!=null?v:E(),p=(h=o==null?void 0:o.prefix)!=null?h:r==null?void 0:r.prefix,l=N(i,t,n),u=J(p,c),m=`${u}.${g(l)}`,f=n.portalItem.resourceFromPath(m);U(t)&&n.resources&&n.resources.pendingOperations.push(M(t).then(O=>{f.path=`${u}.${g(O)}`,s[a]=f.itemRelativeUrl}).catch(()=>{}));const R=(j=o==null?void 0:o.compress)!=null?j:!1;n.resources&&b({...e,resource:f,content:l,compress:R,updates:n.resources.toAdd}),s[a]=f.itemRelativeUrl}function C(e){var m;const{context:t,targetUrl:o,params:i,value:n,dest:s,targetPropertyName:a}=e;if(!t.portalItem)return;const r=t.portalItem.resourceFromPath(o),c=N(n,o,t),p=g(c),l=w(r.path),u=(m=i==null?void 0:i.compress)!=null?m:!1;p===l?(t.resources&&b({...e,resource:r,content:c,compress:u,updates:t.resources.toUpdate}),s[a]=o):P(e)}function H({context:e,targetUrl:t,dest:o,targetPropertyName:i}){e.portalItem&&e.resources&&(e.resources.toKeep.push({resource:e.portalItem.resourceFromPath(t),compress:!1}),o[i]=t)}function b({object:e,propertyName:t,updates:o,resource:i,content:n,compress:s}){o.push({resource:i,content:n,compress:s,finish:a=>{W(e,t,a)}})}function N(e,t,o){return typeof e=="string"?{url:t}:new Blob([JSON.stringify(e.toJSON(o))],{type:"application/json"})}async function M(e){const t=(await K(()=>import("./index.221827cd.js").then(function(i){return i.kX}),["assets/index.221827cd.js","assets/index.f5419ca5.css"])).default,{data:o}=await t(e,{responseType:"blob"});return o}function Q(e){return e==null?null:typeof e=="string"?e:e.url}function W(e,t,o){typeof e[t]=="string"?e[t]=o.url:e[t].url=o.url}export{ee as g}; diff --git a/assets/pixelUtils.82950e1a.js b/assets/pixelUtils.9c6f8dae.js similarity index 99% rename from assets/pixelUtils.82950e1a.js rename to assets/pixelUtils.9c6f8dae.js index 17c2aa0..2eb1d0d 100644 --- a/assets/pixelUtils.82950e1a.js +++ b/assets/pixelUtils.9c6f8dae.js @@ -1 +1 @@ -import{a6 as j,a7 as V,cw as ot,a8 as at,cx as ht,n as ct,c as P,j as N,b4 as ft,s as W,u as H}from"./index.d94abe07.js";class K{constructor(e=null,i=null,l=null){this.minValue=e,this.maxValue=i,this.noDataValue=l}}var L;let G=L=class extends ht{constructor(t){super(t),this.width=null,this.height=null,this.pixelType="f32",this.validPixelCount=null,this.mask=null,this.maskIsAlpha=!1,this.statistics=null}static createEmptyBand(t,e){return new(L.getPixelArrayConstructor(t))(e)}static getPixelArrayConstructor(t){let e;switch(t){case"u1":case"u2":case"u4":case"u8":e=Uint8Array;break;case"u16":e=Uint16Array;break;case"u32":e=Uint32Array;break;case"s8":e=Int8Array;break;case"s16":e=Int16Array;break;case"s32":e=Int32Array;break;case"f32":case"c64":case"c128":case"unknown":e=Float32Array;break;case"f64":e=Float64Array}return e}castPixelType(t){if(!t)return"f32";let e=t.toLowerCase();return["u1","u2","u4"].includes(e)?e="u8":["unknown","u8","s8","u16","s16","u32","s32","f32","f64"].includes(e)||(e="f32"),e}getPlaneCount(){var t;return(t=this.pixels)==null?void 0:t.length}addData(t){var e;if(!t.pixels||t.pixels.length!==this.width*this.height)throw new ct("pixelblock:invalid-or-missing-pixels","add data requires valid pixels array that has same length defined by pixel block width * height");this.pixels||(this.pixels=[]),this.statistics||(this.statistics=[]),this.pixels.push(t.pixels),this.statistics.push((e=t.statistics)!=null?e:new K)}getAsRGBA(){const t=new ArrayBuffer(this.width*this.height*4);switch(this.pixelType){case"s8":case"s16":case"u16":case"s32":case"u32":case"f32":case"f64":this._fillFromNon8Bit(t);break;default:this._fillFrom8Bit(t)}return new Uint8ClampedArray(t)}getAsRGBAFloat(){const t=new Float32Array(this.width*this.height*4);return this._fillFrom32Bit(t),t}updateStatistics(){if(!this.pixels)return;this.statistics=this.pixels.map(i=>this._calculateBandStatistics(i,this.mask));const t=this.mask;let e=0;if(P(t))for(let i=0;il?l:hs>=e.length),n=l===t.length&&!t.some((s,o)=>s!==o);return a||n?this:new L({pixelType:this.pixelType,width:this.width,height:this.height,mask:this.mask,validPixelCount:this.validPixelCount,maskIsAlpha:this.maskIsAlpha,pixels:t.map(s=>e[s]),statistics:i&&t.map(s=>i[s])})}clone(){const t=new L({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let e;P(this.mask)&&(this.mask instanceof Uint8Array?t.mask=new Uint8Array(this.mask):t.mask=this.mask.slice(0));const i=L.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.pixels=[];const l=!!this.pixels[0].slice;for(e=0;e=3?(n=l[1],s=l[2]):l.length===2&&(n=l[1]);const h=new Uint32Array(t),f=this.width*this.height;if(a.length===f)if(P(e)&&e.length===f)if(i)for(o=0;o0){for(const p of l)if(p.minValue!=null&&(s=Math.min(s,p.minValue)),p.maxValue!=null&&p.minValue!=null){const d=p.maxValue-p.minValue;o=Math.max(o,d)}n=255/o}else{let p=255;a==="s8"?(s=-128,p=127):a==="u16"?p=65535:a==="s16"?(s=-32768,p=32767):a==="u32"?p=4294967295:a==="s32"?(s=-2147483648,p=2147483647):a==="f32"?(s=-34e38,p=34e38):a==="f64"&&(s=-Number.MAX_VALUE,p=Number.MAX_VALUE),n=255/(p-s)}const h=new Uint32Array(t),f=this.width*this.height;let r,u,g,c,x;if(r=u=g=e[0],r.length!==f)return W.getLogger(this.declaredClass).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(u=e[1],e.length>=3&&(g=e[2]),P(i)&&i.length===f)for(c=0;c=3?(a=e[1],n=e[2]):e.length===2&&(a=e[1]);const o=this.width*this.height;if(l.length!==o)return W.getLogger(this.declaredClass).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let h=0;if(P(i)&&i.length===o)for(s=0;sl?s:l);else for(n=0;nl?s:l;return new K(i,l)}};j([V({json:{write:!0}})],G.prototype,"width",void 0),j([V({json:{write:!0}})],G.prototype,"height",void 0),j([V({json:{write:!0}})],G.prototype,"pixelType",void 0),j([ot("pixelType")],G.prototype,"castPixelType",null),j([V({json:{write:!0}})],G.prototype,"validPixelCount",void 0),j([V({json:{write:!0}})],G.prototype,"mask",void 0),j([V({json:{write:!0}})],G.prototype,"maskIsAlpha",void 0),j([V({json:{write:!0}})],G.prototype,"pixels",void 0),j([V({json:{write:!0}})],G.prototype,"statistics",void 0),G=L=j([at("esri.layers.support.PixelBlock")],G);const S=G;var Q,Y;function _(t){return P(t)&&t.declaredClass==="esri.layers.support.PixelBlock"&&t.pixels&&t.pixels.length>0}function wt(t,e){if(!(e!=null&&e.length)||!_(t))return t;const i=t.pixels.length;return e&&e.some(l=>l>=i)||i===1&&e.length===1&&e[0]===0?t:i!==e.length||e.some((l,a)=>l!==a)?new S({pixelType:t.pixelType,width:t.width,height:t.height,mask:t.mask,validPixelCount:t.validPixelCount,maskIsAlpha:t.maskIsAlpha,pixels:e.map(l=>t.pixels[l]),statistics:t.statistics&&e.map(l=>t.statistics[l])}):t}function kt(t){if(!(t!=null&&t.length)||t.some(r=>!_(r)))return null;if(t.length===1)return P(t[0])?t[0].clone():null;const e=t,{width:i,height:l,pixelType:a}=e[0];if(e.some(r=>r.width!==i||r.height!==l))return null;const n=e.map(({mask:r})=>r).filter(r=>r!=null);let s=null;n.length&&(s=new Uint8Array(i*l),s.set(n[0]),n.length>1&&st(n.slice(1),s));const o=[];e.forEach(({pixels:r})=>o.push(...r));const h=e.map(({statistics:r})=>r).filter(r=>r==null?void 0:r.length),f=[];return h.forEach(r=>f.push(...r)),new S({pixelType:a,width:i,height:l,mask:s,pixels:o,statistics:f.length?f:null})}function At(t){if(!t)return;const e=t.colormap;if(!e||e.length===0)return;const i=e.sort((u,g)=>u[0]-g[0]);let l=0;i[0][0]<0&&(l=i[0][0]);const a=Math.max(256,i[i.length-1][0]-l+1),n=new Uint8Array(4*a),s=[];let o,h=0,f=0;const r=i[0].length===5;if(a>65536)return i.forEach(u=>{s[u[0]-l]=r?u.slice(1):u.slice(1).concat([255])}),{indexed2DColormap:s,offset:l,alphaSpecified:r};if(t.fillUnspecified)for(o=i[f],h=o[0]-l;hy?a[r]=0:(g[r]=s[d],c[r]=s[d+1],x[r]=s[d+2],a[r]=s[d+3]));else{for(a=new Uint8Array(n),r=0;ry?a[r]=0:(g[r]=s[d],c[r]=s[d+1],x[r]=s[d+2],a[r]=s[d+3]);i.mask=a}}else if(o)if(P(a))for(r=0;rn));const o=[],h=e.outputPixelType||"u8";for(let r=0;r1;){if(f===r.value){p=!0;break}f>r.value?u=x:g=x,x=Math.floor((u+g)/2),r=e[Math.floor(x)]}p||(f===e[u].value?(r=e[u],p=!0):f===e[g].value?(r=e[g],p=!0):fe[u].value&&(f=0;m--)if(y>=a[2*m]&&y<=a[2*m+1]){r[d]=n[m];break}}}let c=u;if(o!=null&&o.length){c=new Uint8Array(i*l),u&&c.set(u);for(let x=0;x=o[m]&&y<=o[m+1]){r[d]=0,c[d]=0;break}}}}return new S({width:i,height:l,pixelType:s,pixels:[r],mask:c})}function Z(t,e,i,l){const a=i!=null&&i.length>=2?new Set(i):null,n=(i==null?void 0:i.length)===1?i[0]:null,s=!!(e!=null&&e.length);for(let o=0;o=e[r]&&h<=e[r+1]){f=!0;break}f||(l[o]=0)}l[o]&&(h===n||(a==null?void 0:a.has(h)))&&(l[o]=0)}}function tt(t,e){const i=t[0].length;for(let l=0;lx.pixelBlock);if(!i||N(i.pixelBlock))return null;const l=(i.extent.xmax-i.extent.xmin)/i.pixelBlock.width,a=(i.extent.ymax-i.extent.ymin)/i.pixelBlock.height,n=.01*Math.min(l,a),s=t.sort((x,p)=>Math.abs(x.extent.ymax-p.extent.ymax)>n?p.extent.ymax-x.extent.ymax:Math.abs(x.extent.xmin-p.extent.xmin)>n?x.extent.xmin-p.extent.xmin:0),o=Math.min.apply(null,s.map(x=>x.extent.xmin)),h=Math.min.apply(null,s.map(x=>x.extent.ymin)),f=Math.max.apply(null,s.map(x=>x.extent.xmax)),r=Math.max.apply(null,s.map(x=>x.extent.ymax)),u={x:Math.round((e.xmin-o)/l),y:Math.round((r-e.ymax)/a)},g={width:Math.round((f-o)/l),height:Math.round((r-h)/a)},c={width:Math.round((e.xmax-e.xmin)/l),height:Math.round((e.ymax-e.ymin)/a)};return Math.round(g.width/i.pixelBlock.width)*Math.round(g.height/i.pixelBlock.height)!==s.length||u.x<0||u.y<0||g.widthx.pixelBlock),g,{clipOffset:u,clipSize:c})}}function q(t,e,i,l,a,n){var p;const{width:s,height:o}=i.block,{x:h,y:f}=i.offset,{width:r,height:u}=i.mosaic,g=ut(s,o,l,a,h,f,r,u);let c=0,x=0;if(n){const d=n.hasGCSSShiftTransform?360:(p=n.halfWorldWidth)!=null?p:0,y=s*n.resolutionX,m=n.startX+l*y,k=m+y;md?x=n.rightPadding:m>=d&&(c=n.leftMargin-n.rightPadding,x=0)}if(g.xmax-=x,typeof e!="number")for(let d=g.ymin;d_(M));if(N(o))return null;const h=a?a.width:e.width,f=a?a.height:e.height,r=o.width,u=o.height,g=e.width/r,c=e.height/u,x={offset:l||{x:0,y:0},mosaic:a||e,block:{width:r,height:u}},p=o.pixelType,d=S.getPixelArrayConstructor(p),y=o.pixels.length,m=[];let k,w;for(let M=0;MN(M)||P(M.mask)&&M.mask.length>0)){U=new Uint8Array(h*f);for(let M=0;MP(c));if(N(l))return null;const a=t.some(c=>!P(c)||!!c.mask),{width:n,height:s}=e,o=a?new Uint8Array(n*s):null,{blockWidths:h}=i,f=[],r=l.getPlaneCount(),u=S.getPixelArrayConstructor(l.pixelType);if(a)for(let c=0,x=0;cl||h>a||n===0&&s===0&&o===l&&h===a)return t;t.mask||(t.mask=new Uint8Array(l*a));const f=t.mask;for(let r=0;r=h||g=o?0:1}return t.updateStatistics(),t}function gt(t){if(!_(t))return null;const e=t.clone(),{width:i,height:l,pixels:a}=t,n=a[0],s=e.pixels[0],o=H(t.mask);for(let h=2;he&&(i=n.value,e=l),n=a.next();return i}function z(t,e,i){if(i===0)return;const l=t.get(e);l===1?t.delete(e):t.set(e,l-1)}function D(t,e,i){i!==0&&t.set(e,t.has(e)?t.get(e)+1:1)}function dt(t,e,i){let{x:l,y:a}=e;const{width:n,height:s}=i;if(l===0&&a===0&&s===t.height&&n===t.width)return t;const{width:o,height:h}=t,f=Math.max(0,a),r=Math.max(0,l),u=Math.min(l+n,o),g=Math.min(a+s,h);if(u<0||g<0||!_(t))return null;l=Math.max(0,-l),a=Math.max(0,-a);const{pixels:c}=t,x=n*s,p=c.length,d=[];for(let w=0;w{const F=A instanceof Float32Array||A instanceof Float64Array?0:.5;for(let I=0;Ithis._calculateBandStatistics(i,this.mask));const t=this.mask;let e=0;if(P(t))for(let i=0;il?l:hs>=e.length),n=l===t.length&&!t.some((s,o)=>s!==o);return a||n?this:new L({pixelType:this.pixelType,width:this.width,height:this.height,mask:this.mask,validPixelCount:this.validPixelCount,maskIsAlpha:this.maskIsAlpha,pixels:t.map(s=>e[s]),statistics:i&&t.map(s=>i[s])})}clone(){const t=new L({width:this.width,height:this.height,pixelType:this.pixelType,maskIsAlpha:this.maskIsAlpha,validPixelCount:this.validPixelCount});let e;P(this.mask)&&(this.mask instanceof Uint8Array?t.mask=new Uint8Array(this.mask):t.mask=this.mask.slice(0));const i=L.getPixelArrayConstructor(this.pixelType);if(this.pixels&&this.pixels.length>0){t.pixels=[];const l=!!this.pixels[0].slice;for(e=0;e=3?(n=l[1],s=l[2]):l.length===2&&(n=l[1]);const h=new Uint32Array(t),f=this.width*this.height;if(a.length===f)if(P(e)&&e.length===f)if(i)for(o=0;o0){for(const p of l)if(p.minValue!=null&&(s=Math.min(s,p.minValue)),p.maxValue!=null&&p.minValue!=null){const d=p.maxValue-p.minValue;o=Math.max(o,d)}n=255/o}else{let p=255;a==="s8"?(s=-128,p=127):a==="u16"?p=65535:a==="s16"?(s=-32768,p=32767):a==="u32"?p=4294967295:a==="s32"?(s=-2147483648,p=2147483647):a==="f32"?(s=-34e38,p=34e38):a==="f64"&&(s=-Number.MAX_VALUE,p=Number.MAX_VALUE),n=255/(p-s)}const h=new Uint32Array(t),f=this.width*this.height;let r,u,g,c,x;if(r=u=g=e[0],r.length!==f)return W.getLogger(this.declaredClass).error("getAsRGBA()","Unable to convert to RGBA. The pixelblock is invalid.");if(e.length>=2)if(u=e[1],e.length>=3&&(g=e[2]),P(i)&&i.length===f)for(c=0;c=3?(a=e[1],n=e[2]):e.length===2&&(a=e[1]);const o=this.width*this.height;if(l.length!==o)return W.getLogger(this.declaredClass).error("getAsRGBAFloat()","Unable to convert to RGBA. The pixelblock is invalid.");let h=0;if(P(i)&&i.length===o)for(s=0;sl?s:l);else for(n=0;nl?s:l;return new K(i,l)}};j([V({json:{write:!0}})],G.prototype,"width",void 0),j([V({json:{write:!0}})],G.prototype,"height",void 0),j([V({json:{write:!0}})],G.prototype,"pixelType",void 0),j([ot("pixelType")],G.prototype,"castPixelType",null),j([V({json:{write:!0}})],G.prototype,"validPixelCount",void 0),j([V({json:{write:!0}})],G.prototype,"mask",void 0),j([V({json:{write:!0}})],G.prototype,"maskIsAlpha",void 0),j([V({json:{write:!0}})],G.prototype,"pixels",void 0),j([V({json:{write:!0}})],G.prototype,"statistics",void 0),G=L=j([at("esri.layers.support.PixelBlock")],G);const S=G;var Q,Y;function _(t){return P(t)&&t.declaredClass==="esri.layers.support.PixelBlock"&&t.pixels&&t.pixels.length>0}function wt(t,e){if(!(e!=null&&e.length)||!_(t))return t;const i=t.pixels.length;return e&&e.some(l=>l>=i)||i===1&&e.length===1&&e[0]===0?t:i!==e.length||e.some((l,a)=>l!==a)?new S({pixelType:t.pixelType,width:t.width,height:t.height,mask:t.mask,validPixelCount:t.validPixelCount,maskIsAlpha:t.maskIsAlpha,pixels:e.map(l=>t.pixels[l]),statistics:t.statistics&&e.map(l=>t.statistics[l])}):t}function kt(t){if(!(t!=null&&t.length)||t.some(r=>!_(r)))return null;if(t.length===1)return P(t[0])?t[0].clone():null;const e=t,{width:i,height:l,pixelType:a}=e[0];if(e.some(r=>r.width!==i||r.height!==l))return null;const n=e.map(({mask:r})=>r).filter(r=>r!=null);let s=null;n.length&&(s=new Uint8Array(i*l),s.set(n[0]),n.length>1&&st(n.slice(1),s));const o=[];e.forEach(({pixels:r})=>o.push(...r));const h=e.map(({statistics:r})=>r).filter(r=>r==null?void 0:r.length),f=[];return h.forEach(r=>f.push(...r)),new S({pixelType:a,width:i,height:l,mask:s,pixels:o,statistics:f.length?f:null})}function At(t){if(!t)return;const e=t.colormap;if(!e||e.length===0)return;const i=e.sort((u,g)=>u[0]-g[0]);let l=0;i[0][0]<0&&(l=i[0][0]);const a=Math.max(256,i[i.length-1][0]-l+1),n=new Uint8Array(4*a),s=[];let o,h=0,f=0;const r=i[0].length===5;if(a>65536)return i.forEach(u=>{s[u[0]-l]=r?u.slice(1):u.slice(1).concat([255])}),{indexed2DColormap:s,offset:l,alphaSpecified:r};if(t.fillUnspecified)for(o=i[f],h=o[0]-l;hy?a[r]=0:(g[r]=s[d],c[r]=s[d+1],x[r]=s[d+2],a[r]=s[d+3]));else{for(a=new Uint8Array(n),r=0;ry?a[r]=0:(g[r]=s[d],c[r]=s[d+1],x[r]=s[d+2],a[r]=s[d+3]);i.mask=a}}else if(o)if(P(a))for(r=0;rn));const o=[],h=e.outputPixelType||"u8";for(let r=0;r1;){if(f===r.value){p=!0;break}f>r.value?u=x:g=x,x=Math.floor((u+g)/2),r=e[Math.floor(x)]}p||(f===e[u].value?(r=e[u],p=!0):f===e[g].value?(r=e[g],p=!0):fe[u].value&&(f=0;m--)if(y>=a[2*m]&&y<=a[2*m+1]){r[d]=n[m];break}}}let c=u;if(o!=null&&o.length){c=new Uint8Array(i*l),u&&c.set(u);for(let x=0;x=o[m]&&y<=o[m+1]){r[d]=0,c[d]=0;break}}}}return new S({width:i,height:l,pixelType:s,pixels:[r],mask:c})}function Z(t,e,i,l){const a=i!=null&&i.length>=2?new Set(i):null,n=(i==null?void 0:i.length)===1?i[0]:null,s=!!(e!=null&&e.length);for(let o=0;o=e[r]&&h<=e[r+1]){f=!0;break}f||(l[o]=0)}l[o]&&(h===n||(a==null?void 0:a.has(h)))&&(l[o]=0)}}function tt(t,e){const i=t[0].length;for(let l=0;lx.pixelBlock);if(!i||N(i.pixelBlock))return null;const l=(i.extent.xmax-i.extent.xmin)/i.pixelBlock.width,a=(i.extent.ymax-i.extent.ymin)/i.pixelBlock.height,n=.01*Math.min(l,a),s=t.sort((x,p)=>Math.abs(x.extent.ymax-p.extent.ymax)>n?p.extent.ymax-x.extent.ymax:Math.abs(x.extent.xmin-p.extent.xmin)>n?x.extent.xmin-p.extent.xmin:0),o=Math.min.apply(null,s.map(x=>x.extent.xmin)),h=Math.min.apply(null,s.map(x=>x.extent.ymin)),f=Math.max.apply(null,s.map(x=>x.extent.xmax)),r=Math.max.apply(null,s.map(x=>x.extent.ymax)),u={x:Math.round((e.xmin-o)/l),y:Math.round((r-e.ymax)/a)},g={width:Math.round((f-o)/l),height:Math.round((r-h)/a)},c={width:Math.round((e.xmax-e.xmin)/l),height:Math.round((e.ymax-e.ymin)/a)};return Math.round(g.width/i.pixelBlock.width)*Math.round(g.height/i.pixelBlock.height)!==s.length||u.x<0||u.y<0||g.widthx.pixelBlock),g,{clipOffset:u,clipSize:c})}}function q(t,e,i,l,a,n){var p;const{width:s,height:o}=i.block,{x:h,y:f}=i.offset,{width:r,height:u}=i.mosaic,g=ut(s,o,l,a,h,f,r,u);let c=0,x=0;if(n){const d=n.hasGCSSShiftTransform?360:(p=n.halfWorldWidth)!=null?p:0,y=s*n.resolutionX,m=n.startX+l*y,k=m+y;md?x=n.rightPadding:m>=d&&(c=n.leftMargin-n.rightPadding,x=0)}if(g.xmax-=x,typeof e!="number")for(let d=g.ymin;d_(M));if(N(o))return null;const h=a?a.width:e.width,f=a?a.height:e.height,r=o.width,u=o.height,g=e.width/r,c=e.height/u,x={offset:l||{x:0,y:0},mosaic:a||e,block:{width:r,height:u}},p=o.pixelType,d=S.getPixelArrayConstructor(p),y=o.pixels.length,m=[];let k,w;for(let M=0;MN(M)||P(M.mask)&&M.mask.length>0)){U=new Uint8Array(h*f);for(let M=0;MP(c));if(N(l))return null;const a=t.some(c=>!P(c)||!!c.mask),{width:n,height:s}=e,o=a?new Uint8Array(n*s):null,{blockWidths:h}=i,f=[],r=l.getPlaneCount(),u=S.getPixelArrayConstructor(l.pixelType);if(a)for(let c=0,x=0;cl||h>a||n===0&&s===0&&o===l&&h===a)return t;t.mask||(t.mask=new Uint8Array(l*a));const f=t.mask;for(let r=0;r=h||g=o?0:1}return t.updateStatistics(),t}function gt(t){if(!_(t))return null;const e=t.clone(),{width:i,height:l,pixels:a}=t,n=a[0],s=e.pixels[0],o=H(t.mask);for(let h=2;he&&(i=n.value,e=l),n=a.next();return i}function z(t,e,i){if(i===0)return;const l=t.get(e);l===1?t.delete(e):t.set(e,l-1)}function D(t,e,i){i!==0&&t.set(e,t.has(e)?t.get(e)+1:1)}function dt(t,e,i){let{x:l,y:a}=e;const{width:n,height:s}=i;if(l===0&&a===0&&s===t.height&&n===t.width)return t;const{width:o,height:h}=t,f=Math.max(0,a),r=Math.max(0,l),u=Math.min(l+n,o),g=Math.min(a+s,h);if(u<0||g<0||!_(t))return null;l=Math.max(0,-l),a=Math.max(0,-a);const{pixels:c}=t,x=n*s,p=c.length,d=[];for(let w=0;w{const F=A instanceof Float32Array||A instanceof Float64Array?0:.5;for(let I=0;I{const{keyField:a}=r;d&&a&&e.fieldsIndex.has(a)&&!d.includes(a)&&d.push(a)}),d}function x(e,s){return e.popupTemplate?e.popupTemplate:l(s)&&s.defaultPopupTemplateEnabled&&l(e.defaultPopupTemplate)?e.defaultPopupTemplate:null}export{T as d,x as s}; +import{j as c,dt as h,db as I,c as l}from"./index.221827cd.js";async function T(e,s=e.popupTemplate){if(c(s))return[];const n=await s.getRequiredFields(e.fieldsIndex),{lastEditInfoEnabled:o}=s,{objectIdField:t,typeIdField:i,globalIdField:p,relationships:u}=e;if(n.includes("*"))return["*"];const f=o?await h(e):[],d=I(e.fieldsIndex,[...n,...f]);return i&&d.push(i),d&&t&&e.fieldsIndex.has(t)&&!d.includes(t)&&d.push(t),d&&p&&e.fieldsIndex.has(p)&&!d.includes(p)&&d.push(p),u&&u.forEach(r=>{const{keyField:a}=r;d&&a&&e.fieldsIndex.has(a)&&!d.includes(a)&&d.push(a)}),d}function x(e,s){return e.popupTemplate?e.popupTemplate:l(s)&&s.defaultPopupTemplateEnabled&&l(e.defaultPopupTemplate)?e.defaultPopupTemplate:null}export{T as d,x as s}; diff --git a/assets/portalItemUtils.57ded807.js b/assets/portalItemUtils.92eef7f6.js similarity index 92% rename from assets/portalItemUtils.57ded807.js rename to assets/portalItemUtils.92eef7f6.js index 3f5951a..c1b017a 100644 --- a/assets/portalItemUtils.57ded807.js +++ b/assets/portalItemUtils.92eef7f6.js @@ -1 +1 @@ -import{cH as o,aT as s,bI as c,cI as i}from"./index.d94abe07.js";async function a(n){const t=n.spatialReference;if(t.isWGS84)return n.clone();if(t.isWebMercator)return o(n);const e=s.WGS84;return await c(t,e),i(n,e)}function u(n,t){if(!f(n,t)){const e=n.typeKeywords;e?e.push(t):n.typeKeywords=[t]}}function f(n,t){var e;return!!((e=n.typeKeywords)!=null&&e.includes(t))}function p(n,t){const e=n.typeKeywords;if(e){const r=e.indexOf(t);r>-1&&e.splice(r,1)}}async function y(n){const t=n.clone().normalize();let e;if(t.length>1)for(const r of t)e?r.width>e.width&&(e=r):e=r;else e=t[0];return a(e)}const A={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table"};export{y as a,p as c,A as f,u as i,f as s}; +import{cH as o,aT as s,bI as c,cI as i}from"./index.221827cd.js";async function a(n){const t=n.spatialReference;if(t.isWGS84)return n.clone();if(t.isWebMercator)return o(n);const e=s.WGS84;return await c(t,e),i(n,e)}function u(n,t){if(!f(n,t)){const e=n.typeKeywords;e?e.push(t):n.typeKeywords=[t]}}function f(n,t){var e;return!!((e=n.typeKeywords)!=null&&e.includes(t))}function p(n,t){const e=n.typeKeywords;if(e){const r=e.indexOf(t);r>-1&&e.splice(r,1)}}async function y(n){const t=n.clone().normalize();let e;if(t.length>1)for(const r of t)e?r.width>e.width&&(e=r):e=r;else e=t[0];return a(e)}const A={DEVELOPER_BASEMAP:"DeveloperBasemap",JSAPI:"ArcGIS API for JavaScript",METADATA:"Metadata",MULTI_LAYER:"Multilayer",SINGLE_LAYER:"Singlelayer",TABLE:"Table"};export{y as a,p as c,A as f,u as i,f as s}; diff --git a/assets/portalLayers.8fee158d.js b/assets/portalLayers.72750f56.js similarity index 93% rename from assets/portalLayers.8fee158d.js rename to assets/portalLayers.72750f56.js index 42cfaa8..3d859dc 100644 --- a/assets/portalLayers.8fee158d.js +++ b/assets/portalLayers.72750f56.js @@ -1 +1 @@ -import{cD as L,n as S}from"./index.d94abe07.js";import{a as h}from"./lazyLayerLoader.f961f278.js";import{n as o,w as l,b as I,T as g,g as w}from"./layersLoader.67118e89.js";import{s as u}from"./portalItemUtils.57ded807.js";import"./jsonContext.3176ed6f.js";function z(e){return!e.portalItem||e.portalItem instanceof L||(e={...e,portalItem:new L(e.portalItem)}),T(e.portalItem).then(r=>{const a={portalItem:e.portalItem,...r.properties};return new r.constructor(a)})}function T(e){return e.load().then(M).then(v)}function M(e){switch(e.type){case"Map Service":return C(e);case"Feature Service":return G(e);case"Feature Collection":return P(e);case"Scene Service":return F(e);case"Image Service":return b(e);case"Stream Service":return $();case"Vector Tile Service":return j();case"GeoJson":return D();case"CSV":return K();case"KML":return O();case"WFS":return V();case"WMTS":return k();case"WMS":return W();case"Feed":return x();default:return Promise.reject(new S("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type}))}}function v(e){return(0,h[e.className])().then(r=>({constructor:r,properties:e.properties}))}function C(e){return B(e).then(r=>r?{className:"TileLayer"}:{className:"MapImageLayer"})}function G(e){return u(e,"Oriented Imagery Layer")?A(e):d(e).then(r=>{if(typeof r=="object"){const a={};return r.id!=null&&(a.layerId=r.id),{className:r.className||"FeatureLayer",properties:a}}return{className:"GroupLayer"}})}function F(e){return d(e).then(r=>{if(typeof r=="object"){const a={};let t;if(r.id!=null?(a.layerId=r.id,t=`${e.url}/layers/${r.id}`):t=e.url,Array.isArray(e.typeKeywords)&&e.typeKeywords.length>0){const n={IntegratedMesh:"IntegratedMeshLayer","3DObject":"SceneLayer",Point:"SceneLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};for(const s of Object.keys(n))if(e.typeKeywords.includes(s))return{className:n[s]}}return o(t).then(n=>{let s="SceneLayer";const c={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};return n&&n.layerType&&c[n.layerType]&&(s=c[n.layerType]),{className:s,properties:a}})}return r===!1?o(e.url).then(a=>(a==null?void 0:a.layerType)==="Voxel"?{className:"VoxelLayer"}:{className:"GroupLayer"}):{className:"GroupLayer"}})}async function P(e){await e.load();const r=u(e,"Map Notes"),a=u(e,"Markup");if(r||a)return{className:"MapNotesLayer"};if(u(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return l(t)===1?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function b(e){var c,y,m,p,f;await e.load();const r=(y=(c=e.typeKeywords)==null?void 0:c.map(N=>N.toLowerCase()))!=null?y:[];if(r.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(r.includes("tiled imagery"))return{className:"ImageryTileLayer"};const a=(m=await e.fetchData())==null?void 0:m.layerType;if(a==="ArcGISTiledImageServiceLayer")return{className:"ImageryTileLayer"};if(a==="ArcGISImageServiceLayer")return{className:"ImageryLayer"};const t=await o(e.url),n=(p=t.cacheType)==null?void 0:p.toLowerCase(),s=(f=t.capabilities)==null?void 0:f.toLowerCase().includes("tilesonly");return n==="map"||s?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function $(){return{className:"StreamLayer"}}function j(){return{className:"VectorTileLayer"}}function D(){return{className:"GeoJSONLayer"}}function K(){return{className:"CSVLayer"}}function O(){return{className:"KMLLayer"}}function V(){return{className:"WFSLayer"}}function W(){return{className:"WMSLayer"}}function k(){return{className:"WMTSLayer"}}function x(){return{className:"StreamLayer"}}function A(e){return e.load().then(()=>e.fetchData()).then(r=>r.coverage?{className:"GroupLayer"}:{className:"OrientedImageryLayer",properties:r})}function B(e){return o(e.url).then(r=>r.tileInfo)}function d(e){return!e.url||e.url.match(/\/\d+$/)?Promise.resolve({}):e.load().then(()=>e.fetchData()).then(async r=>{if(e.type==="Feature Service"){const a=i(await I(r,e.url));if(typeof a=="object"){const t=g(r);a.className=t.includes(a.id)?"SubtypeGroupLayer":"FeatureLayer"}return a}return l(r)>0?i(r):o(e.url).then(i)})}function i(e){return l(e)===1&&{id:w(e)}}export{z as fromItem,M as selectLayerClassPath}; +import{cD as L,n as S}from"./index.221827cd.js";import{a as h}from"./lazyLayerLoader.4d2df2af.js";import{n as o,w as l,b as I,T as g,g as w}from"./layersLoader.afdddce2.js";import{s as u}from"./portalItemUtils.92eef7f6.js";import"./jsonContext.fe51f9bd.js";function z(e){return!e.portalItem||e.portalItem instanceof L||(e={...e,portalItem:new L(e.portalItem)}),T(e.portalItem).then(r=>{const a={portalItem:e.portalItem,...r.properties};return new r.constructor(a)})}function T(e){return e.load().then(M).then(v)}function M(e){switch(e.type){case"Map Service":return C(e);case"Feature Service":return G(e);case"Feature Collection":return P(e);case"Scene Service":return F(e);case"Image Service":return b(e);case"Stream Service":return $();case"Vector Tile Service":return j();case"GeoJson":return D();case"CSV":return K();case"KML":return O();case"WFS":return V();case"WMTS":return k();case"WMS":return W();case"Feed":return x();default:return Promise.reject(new S("portal:unknown-item-type","Unknown item type '${type}'",{type:e.type}))}}function v(e){return(0,h[e.className])().then(r=>({constructor:r,properties:e.properties}))}function C(e){return B(e).then(r=>r?{className:"TileLayer"}:{className:"MapImageLayer"})}function G(e){return u(e,"Oriented Imagery Layer")?A(e):d(e).then(r=>{if(typeof r=="object"){const a={};return r.id!=null&&(a.layerId=r.id),{className:r.className||"FeatureLayer",properties:a}}return{className:"GroupLayer"}})}function F(e){return d(e).then(r=>{if(typeof r=="object"){const a={};let t;if(r.id!=null?(a.layerId=r.id,t=`${e.url}/layers/${r.id}`):t=e.url,Array.isArray(e.typeKeywords)&&e.typeKeywords.length>0){const n={IntegratedMesh:"IntegratedMeshLayer","3DObject":"SceneLayer",Point:"SceneLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};for(const s of Object.keys(n))if(e.typeKeywords.includes(s))return{className:n[s]}}return o(t).then(n=>{let s="SceneLayer";const c={Point:"SceneLayer","3DObject":"SceneLayer",IntegratedMesh:"IntegratedMeshLayer",PointCloud:"PointCloudLayer",Building:"BuildingSceneLayer"};return n&&n.layerType&&c[n.layerType]&&(s=c[n.layerType]),{className:s,properties:a}})}return r===!1?o(e.url).then(a=>(a==null?void 0:a.layerType)==="Voxel"?{className:"VoxelLayer"}:{className:"GroupLayer"}):{className:"GroupLayer"}})}async function P(e){await e.load();const r=u(e,"Map Notes"),a=u(e,"Markup");if(r||a)return{className:"MapNotesLayer"};if(u(e,"Route Layer"))return{className:"RouteLayer"};const t=await e.fetchData();return l(t)===1?{className:"FeatureLayer"}:{className:"GroupLayer"}}async function b(e){var c,y,m,p,f;await e.load();const r=(y=(c=e.typeKeywords)==null?void 0:c.map(N=>N.toLowerCase()))!=null?y:[];if(r.includes("elevation 3d layer"))return{className:"ElevationLayer"};if(r.includes("tiled imagery"))return{className:"ImageryTileLayer"};const a=(m=await e.fetchData())==null?void 0:m.layerType;if(a==="ArcGISTiledImageServiceLayer")return{className:"ImageryTileLayer"};if(a==="ArcGISImageServiceLayer")return{className:"ImageryLayer"};const t=await o(e.url),n=(p=t.cacheType)==null?void 0:p.toLowerCase(),s=(f=t.capabilities)==null?void 0:f.toLowerCase().includes("tilesonly");return n==="map"||s?{className:"ImageryTileLayer"}:{className:"ImageryLayer"}}function $(){return{className:"StreamLayer"}}function j(){return{className:"VectorTileLayer"}}function D(){return{className:"GeoJSONLayer"}}function K(){return{className:"CSVLayer"}}function O(){return{className:"KMLLayer"}}function V(){return{className:"WFSLayer"}}function W(){return{className:"WMSLayer"}}function k(){return{className:"WMTSLayer"}}function x(){return{className:"StreamLayer"}}function A(e){return e.load().then(()=>e.fetchData()).then(r=>r.coverage?{className:"GroupLayer"}:{className:"OrientedImageryLayer",properties:r})}function B(e){return o(e.url).then(r=>r.tileInfo)}function d(e){return!e.url||e.url.match(/\/\d+$/)?Promise.resolve({}):e.load().then(()=>e.fetchData()).then(async r=>{if(e.type==="Feature Service"){const a=i(await I(r,e.url));if(typeof a=="object"){const t=g(r);a.className=t.includes(a.id)?"SubtypeGroupLayer":"FeatureLayer"}return a}return l(r)>0?i(r):o(e.url).then(i)})}function i(e){return l(e)===1&&{id:w(e)}}export{z as fromItem,M as selectLayerClassPath}; diff --git a/assets/programUtils.956e69db.js b/assets/programUtils.10ecfb8b.js similarity index 91% rename from assets/programUtils.956e69db.js rename to assets/programUtils.10ecfb8b.js index 45b452b..80d8135 100644 --- a/assets/programUtils.956e69db.js +++ b/assets/programUtils.10ecfb8b.js @@ -1,4 +1,4 @@ -import{c as h}from"./index.d94abe07.js";import{h as u}from"./ProgramTemplate.e9a5aa54.js";class a{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return this._outer.size===0}get(e,o){var t;return(t=this._outer.get(e))==null?void 0:t.get(o)}set(e,o,t){const s=this._outer.get(e);s?s.set(o,t):this._outer.set(e,new Map([[o,t]]))}delete(e,o){const t=this._outer.get(e);t&&(t.delete(o),t.size===0&&this._outer.delete(e))}forEach(e){this._outer.forEach((o,t)=>e(o,t))}}class d{constructor(e){this._rctx=e,this._store=new a}dispose(){this._store.forEach(e=>e.forEach(o=>o.dispose())),this._store.clear()}acquire(e,o,t,s){const r=this._store.get(e,o);if(h(r))return r.ref(),r;const n=new u(this._rctx,e,o,t,s);return n.ref(),this._store.set(e,o,n),n}get test(){let e=0;return this._store.forEach(o=>o.forEach(t=>e+=t.hasGLName?2:1)),{cachedWebGLObjects:e}}}function l(i){const{options:e,value:o}=i;return typeof e[o]=="number"}function $(i){let e="";for(const o in i){const t=i[o];if(typeof t=="boolean")t&&(e+=`#define ${o} +import{c as h}from"./index.221827cd.js";import{h as u}from"./ProgramTemplate.cf9dd4e8.js";class a{constructor(){this._outer=new Map}clear(){this._outer.clear()}get empty(){return this._outer.size===0}get(e,o){var t;return(t=this._outer.get(e))==null?void 0:t.get(o)}set(e,o,t){const s=this._outer.get(e);s?s.set(o,t):this._outer.set(e,new Map([[o,t]]))}delete(e,o){const t=this._outer.get(e);t&&(t.delete(o),t.size===0&&this._outer.delete(e))}forEach(e){this._outer.forEach((o,t)=>e(o,t))}}class d{constructor(e){this._rctx=e,this._store=new a}dispose(){this._store.forEach(e=>e.forEach(o=>o.dispose())),this._store.clear()}acquire(e,o,t,s){const r=this._store.get(e,o);if(h(r))return r.ref(),r;const n=new u(this._rctx,e,o,t,s);return n.ref(),this._store.set(e,o,n),n}get test(){let e=0;return this._store.forEach(o=>o.forEach(t=>e+=t.hasGLName?2:1)),{cachedWebGLObjects:e}}}function l(i){const{options:e,value:o}=i;return typeof e[o]=="number"}function $(i){let e="";for(const o in i){const t=i[o];if(typeof t=="boolean")t&&(e+=`#define ${o} `);else if(typeof t=="number")e+=`#define ${o} ${t.toFixed()} `;else if(typeof t=="object")if(l(t)){const{value:s,options:r,namespace:n}=t,c=n?`${n}_`:"";for(const f in r)e+=`#define ${c}${f} ${r[f].toFixed()} `;e+=`#define ${o} ${c}${s} diff --git a/assets/projectionSupport.0542c13b.js b/assets/projectionSupport.4f5da4af.js similarity index 96% rename from assets/projectionSupport.0542c13b.js rename to assets/projectionSupport.4f5da4af.js index 184734f..b9e7c6a 100644 --- a/assets/projectionSupport.0542c13b.js +++ b/assets/projectionSupport.4f5da4af.js @@ -1 +1 @@ -import{bG as g,bH as M,c as t,bI as Z,bJ as m,bK as h,bL as l,bB as c,bM as p}from"./index.d94abe07.js";import{t as f}from"./json.879c9adc.js";const o=[0,0];function x(e,n){if(!n)return null;if("x"in n){const s={x:0,y:0};return[s.x,s.y]=e(n.x,n.y,o),n.z!=null&&(s.z=n.z),n.m!=null&&(s.m=n.m),s}if("xmin"in n){const s={xmin:0,ymin:0,xmax:0,ymax:0};return[s.xmin,s.ymin]=e(n.xmin,n.ymin,o),[s.xmax,s.ymax]=e(n.xmax,n.ymax,o),n.hasZ&&(s.zmin=n.zmin,s.zmax=n.zmax,s.hasZ=!0),n.hasM&&(s.mmin=n.mmin,s.mmax=n.mmax,s.hasM=!0),s}return"rings"in n?{rings:u(n.rings,e),hasM:n.hasM,hasZ:n.hasZ}:"paths"in n?{paths:u(n.paths,e),hasM:n.hasM,hasZ:n.hasZ}:"points"in n?{points:y(n.points,e),hasM:n.hasM,hasZ:n.hasZ}:null}function u(e,n){const s=[];for(const i of e)s.push(y(i,n));return s}function y(e,n){const s=[];for(const i of e){const r=n(i[0],i[1],[0,0]);s.push(r),i.length>2&&r.push(i[2]),i.length>3&&r.push(i[3])}return s}async function S(e,n){if(!e||!n)return;const s=Array.isArray(e)?e.map(i=>t(i.geometry)?i.geometry.spatialReference:null).filter(t):[e];await Z(s.map(i=>({source:i,dest:n})))}const _=x.bind(null,g),b=x.bind(null,M);function v(e,n,s,i){if(!e||(s||(s=n,n=e.spatialReference),!m(n)||!m(s)||h(n,s)))return e;if(l(n,s)){const r=c(s)?_(e):b(e);return r.spatialReference=s,r}return p(f,[e],n,s,null,i)[0]}class z{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(n,s,i){if(!n||!n.length||!s||!i||h(s,i))return n;const r={geometries:n,inSpatialReference:s,outSpatialReference:i,resolve:null};return this._jobs.push(r),new Promise(a=>{r.resolve=a,this._timer===null&&(this._timer=setTimeout(this._process,10))})}_process(){this._timer=null;const n=this._jobs.shift();if(!n)return;const{geometries:s,inSpatialReference:i,outSpatialReference:r,resolve:a}=n;l(i,r)?c(r)?a(s.map(_)):a(s.map(b)):a(p(f,s,i,r,null,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}}const R=new z;function w(e,n,s){return R.push(e,n,s)}export{w as M,S as f,v as g}; +import{bG as g,bH as M,c as t,bI as Z,bJ as m,bK as h,bL as l,bB as c,bM as p}from"./index.221827cd.js";import{t as f}from"./json.879c9adc.js";const o=[0,0];function x(e,n){if(!n)return null;if("x"in n){const s={x:0,y:0};return[s.x,s.y]=e(n.x,n.y,o),n.z!=null&&(s.z=n.z),n.m!=null&&(s.m=n.m),s}if("xmin"in n){const s={xmin:0,ymin:0,xmax:0,ymax:0};return[s.xmin,s.ymin]=e(n.xmin,n.ymin,o),[s.xmax,s.ymax]=e(n.xmax,n.ymax,o),n.hasZ&&(s.zmin=n.zmin,s.zmax=n.zmax,s.hasZ=!0),n.hasM&&(s.mmin=n.mmin,s.mmax=n.mmax,s.hasM=!0),s}return"rings"in n?{rings:u(n.rings,e),hasM:n.hasM,hasZ:n.hasZ}:"paths"in n?{paths:u(n.paths,e),hasM:n.hasM,hasZ:n.hasZ}:"points"in n?{points:y(n.points,e),hasM:n.hasM,hasZ:n.hasZ}:null}function u(e,n){const s=[];for(const i of e)s.push(y(i,n));return s}function y(e,n){const s=[];for(const i of e){const r=n(i[0],i[1],[0,0]);s.push(r),i.length>2&&r.push(i[2]),i.length>3&&r.push(i[3])}return s}async function S(e,n){if(!e||!n)return;const s=Array.isArray(e)?e.map(i=>t(i.geometry)?i.geometry.spatialReference:null).filter(t):[e];await Z(s.map(i=>({source:i,dest:n})))}const _=x.bind(null,g),b=x.bind(null,M);function v(e,n,s,i){if(!e||(s||(s=n,n=e.spatialReference),!m(n)||!m(s)||h(n,s)))return e;if(l(n,s)){const r=c(s)?_(e):b(e);return r.spatialReference=s,r}return p(f,[e],n,s,null,i)[0]}class z{constructor(){this._jobs=[],this._timer=null,this._process=this._process.bind(this)}async push(n,s,i){if(!n||!n.length||!s||!i||h(s,i))return n;const r={geometries:n,inSpatialReference:s,outSpatialReference:i,resolve:null};return this._jobs.push(r),new Promise(a=>{r.resolve=a,this._timer===null&&(this._timer=setTimeout(this._process,10))})}_process(){this._timer=null;const n=this._jobs.shift();if(!n)return;const{geometries:s,inSpatialReference:i,outSpatialReference:r,resolve:a}=n;l(i,r)?c(r)?a(s.map(_)):a(s.map(b)):a(p(f,s,i,r,null,null)),this._jobs.length>0&&(this._timer=setTimeout(this._process,10))}}const R=new z;function w(e,n,s){return R.push(e,n,s)}export{w as M,S as f,v as g}; diff --git a/assets/quantizationUtils.0d428d19.js b/assets/quantizationUtils.7ff797cc.js similarity index 97% rename from assets/quantizationUtils.0d428d19.js rename to assets/quantizationUtils.7ff797cc.js index 0d355e9..4782663 100644 --- a/assets/quantizationUtils.0d428d19.js +++ b/assets/quantizationUtils.7ff797cc.js @@ -1 +1 @@ -import{aY as d,aV as L,aC as M,aZ as A,aW as C,c as g,j as V}from"./index.d94abe07.js";const f=(r,n,t)=>[n,t],s=(r,n,t)=>[n,t,r[2]],m=(r,n,t)=>[n,t,r[2],r[3]];function T(r){return r?{originPosition:r.originPosition==="upper-left"?"upperLeft":r.originPosition==="lower-left"?"lowerLeft":r.originPosition,scale:r.tolerance?[r.tolerance,r.tolerance]:[1,1],translate:g(r.extent)?[r.extent.xmin,r.extent.ymax]:[0,0]}:null}function h({scale:r,translate:n},t){return Math.round((t-n[0])/r[0])}function x({scale:r,translate:n},t){return Math.round((n[1]-t)/r[1])}function p(r,n,t){const o=[];let u,i,l,e;for(let c=0;c0?(l=h(r,a[0]),e=x(r,a[1]),l===u&&e===i||(o.push(n(a,l-u,e-i)),u=l,i=e)):(u=h(r,a[0]),i=x(r,a[1]),o.push(n(a,u,i)))}return o.length>0?o:null}function b(r,n,t,o){return p(r,t?o?m:s:o?s:f,n)}function j(r,n,t,o){const u=[],i=t?o?m:s:o?s:f;for(let l=0;l=3&&u.push(e)}return u.length?u:null}function q(r,n,t,o){const u=[],i=t?o?m:s:o?s:f;for(let l=0;l=2&&u.push(e)}return u.length?u:null}function y({scale:r,translate:n},t){return t*r[0]+n[0]}function z({scale:r,translate:n},t){return n[1]-t*r[1]}function w(r,n,t){const o=new Array(t.length);if(!t.length)return o;const[u,i]=r.scale;let l=y(r,t[0][0]),e=z(r,t[0][1]);o[0]=n(t[0],l,e);for(let c=1;c[n,t],s=(r,n,t)=>[n,t,r[2]],m=(r,n,t)=>[n,t,r[2],r[3]];function T(r){return r?{originPosition:r.originPosition==="upper-left"?"upperLeft":r.originPosition==="lower-left"?"lowerLeft":r.originPosition,scale:r.tolerance?[r.tolerance,r.tolerance]:[1,1],translate:g(r.extent)?[r.extent.xmin,r.extent.ymax]:[0,0]}:null}function h({scale:r,translate:n},t){return Math.round((t-n[0])/r[0])}function x({scale:r,translate:n},t){return Math.round((n[1]-t)/r[1])}function p(r,n,t){const o=[];let u,i,l,e;for(let c=0;c0?(l=h(r,a[0]),e=x(r,a[1]),l===u&&e===i||(o.push(n(a,l-u,e-i)),u=l,i=e)):(u=h(r,a[0]),i=x(r,a[1]),o.push(n(a,u,i)))}return o.length>0?o:null}function b(r,n,t,o){return p(r,t?o?m:s:o?s:f,n)}function j(r,n,t,o){const u=[],i=t?o?m:s:o?s:f;for(let l=0;l=3&&u.push(e)}return u.length?u:null}function q(r,n,t,o){const u=[],i=t?o?m:s:o?s:f;for(let l=0;l=2&&u.push(e)}return u.length?u:null}function y({scale:r,translate:n},t){return t*r[0]+n[0]}function z({scale:r,translate:n},t){return n[1]-t*r[1]}function w(r,n,t){const o=new Array(t.length);if(!t.length)return o;const[u,i]=r.scale;let l=y(r,t[0][0]),e=z(r,t[0][1]);o[0]=n(t[0],l,e);for(let c=1;cb()?(n[0]=o[0]/r,n[1]=o[1]/r,n[2]=o[2]/r):(n[0]=1,n[1]=0,n[2]=0),a}function j(n,o,a){const r=o[0],e=o[1],c=o[2],t=o[3],u=a[0],i=a[1],h=a[2],M=a[3];return n[0]=r*M+t*u+e*h-c*i,n[1]=e*M+t*i+c*u-r*h,n[2]=c*M+t*h+r*i-e*u,n[3]=t*M-r*u-e*i-c*h,n}function Q(n,o,a){a*=.5;const r=o[0],e=o[1],c=o[2],t=o[3],u=Math.sin(a),i=Math.cos(a);return n[0]=r*i+t*u,n[1]=e*i+c*u,n[2]=c*i-e*u,n[3]=t*i-r*u,n}function R(n,o,a){a*=.5;const r=o[0],e=o[1],c=o[2],t=o[3],u=Math.sin(a),i=Math.cos(a);return n[0]=r*i-c*u,n[1]=e*i+t*u,n[2]=c*i+r*u,n[3]=t*i-e*u,n}function U(n,o,a){a*=.5;const r=o[0],e=o[1],c=o[2],t=o[3],u=Math.sin(a),i=Math.cos(a);return n[0]=r*i+e*u,n[1]=e*i-r*u,n[2]=c*i+t*u,n[3]=t*i-c*u,n}function V(n,o){const a=o[0],r=o[1],e=o[2];return n[0]=a,n[1]=r,n[2]=e,n[3]=Math.sqrt(Math.abs(1-a*a-r*r-e*e)),n}function $(n,o,a,r){const e=o[0],c=o[1],t=o[2],u=o[3];let i,h,M,s,l,g=a[0],m=a[1],q=a[2],p=a[3];return h=e*g+c*m+t*q+u*p,h<0&&(h=-h,g=-g,m=-m,q=-q,p=-p),1-h>b()?(i=Math.acos(h),M=Math.sin(i),s=Math.sin((1-r)*i)/M,l=Math.sin(r*i)/M):(s=1-r,l=r),n[0]=s*e+l*g,n[1]=s*c+l*m,n[2]=s*t+l*q,n[3]=s*u+l*p,n}function nn(n){const o=J,a=o(),r=o(),e=o(),c=Math.sqrt(1-a),t=Math.sqrt(a);return n[0]=c*Math.sin(2*Math.PI*r),n[1]=c*Math.cos(2*Math.PI*r),n[2]=t*Math.sin(2*Math.PI*e),n[3]=t*Math.cos(2*Math.PI*e),n}function on(n,o){const a=o[0],r=o[1],e=o[2],c=o[3],t=a*a+r*r+e*e+c*c,u=t?1/t:0;return n[0]=-a*u,n[1]=-r*u,n[2]=-e*u,n[3]=c*u,n}function rn(n,o){return n[0]=-o[0],n[1]=-o[1],n[2]=-o[2],n[3]=o[3],n}function z(n,o){const a=o[0]+o[4]+o[8];let r;if(a>0)r=Math.sqrt(a+1),n[3]=.5*r,r=.5/r,n[0]=(o[5]-o[7])*r,n[1]=(o[6]-o[2])*r,n[2]=(o[1]-o[3])*r;else{let e=0;o[4]>o[0]&&(e=1),o[8]>o[3*e+e]&&(e=2);const c=(e+1)%3,t=(e+2)%3;r=Math.sqrt(o[3*e+e]-o[3*c+c]-o[3*t+t]+1),n[e]=.5*r,r=.5/r,n[3]=(o[3*c+t]-o[3*t+c])*r,n[c]=(o[3*c+e]+o[3*e+c])*r,n[t]=(o[3*t+e]+o[3*e+t])*r}return n}function en(n,o,a,r){const e=.5*Math.PI/180;o*=e,a*=e,r*=e;const c=Math.sin(o),t=Math.cos(o),u=Math.sin(a),i=Math.cos(a),h=Math.sin(r),M=Math.cos(r);return n[0]=c*i*M-t*u*h,n[1]=t*u*M+c*i*h,n[2]=t*i*h-c*u*M,n[3]=t*i*M+c*u*h,n}function an(n){return"quat("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+")"}const cn=O,tn=S,un=T,hn=j,Mn=Y,fn=C,sn=D,E=H,ln=E,v=W,gn=v,P=X,mn=Z,qn=k;function pn(n,o,a){const r=w(o,a);return r<-.999999?(d(f,$n,o),B(f)<1e-6&&d(f,dn,o),F(f,f),_(n,f,Math.PI),n):r>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(d(f,o,a),n[0]=f[0],n[1]=f[1],n[2]=f[2],n[3]=1+r,P(n,n))}const f=G(),$n=A(1,0,0),dn=A(0,1,0);function Pn(n,o,a,r,e,c){return $(x,o,e,c),$(y,a,r,c),$(n,x,y,2*c*(1-c)),n}const x=I(),y=I();function xn(n,o,a,r){const e=yn;return e[0]=a[0],e[3]=a[1],e[6]=a[2],e[1]=r[0],e[4]=r[1],e[7]=r[2],e[2]=-o[0],e[5]=-o[1],e[8]=-o[2],P(n,z(n,e))}const yn=L();Object.freeze(Object.defineProperty({__proto__:null,identity:K,setAxisAngle:_,getAxisAngle:N,multiply:j,rotateX:Q,rotateY:R,rotateZ:U,calculateW:V,slerp:$,random:nn,invert:on,conjugate:rn,fromMat3:z,fromEuler:en,str:an,copy:cn,set:tn,add:un,mul:hn,scale:Mn,dot:fn,lerp:sn,length:E,len:ln,squaredLength:v,sqrLen:gn,normalize:P,exactEquals:mn,equals:qn,rotationTo:pn,sqlerp:Pn,setAxes:xn},Symbol.toStringTag,{value:"Module"}));export{mn as K,rn as S,en as k,_ as v,N as x,j as y}; +import{e as L}from"./mat3f64.6d32a1d7.js";import{e as I}from"./quatf64.4ae3e6f1.js";import{g3 as b,g4 as O,fH as S,g5 as T,g6 as Y,g7 as C,g8 as D,g9 as H,ga as W,gb as X,gc as Z,gd as k,fz as w,fC as d,ge as B,fE as F,M as G,aj as A,gf as J}from"./index.221827cd.js";function K(n){return n[0]=0,n[1]=0,n[2]=0,n[3]=1,n}function _(n,o,a){a*=.5;const r=Math.sin(a);return n[0]=r*o[0],n[1]=r*o[1],n[2]=r*o[2],n[3]=Math.cos(a),n}function N(n,o){const a=2*Math.acos(o[3]),r=Math.sin(a/2);return r>b()?(n[0]=o[0]/r,n[1]=o[1]/r,n[2]=o[2]/r):(n[0]=1,n[1]=0,n[2]=0),a}function j(n,o,a){const r=o[0],e=o[1],c=o[2],t=o[3],u=a[0],i=a[1],h=a[2],M=a[3];return n[0]=r*M+t*u+e*h-c*i,n[1]=e*M+t*i+c*u-r*h,n[2]=c*M+t*h+r*i-e*u,n[3]=t*M-r*u-e*i-c*h,n}function Q(n,o,a){a*=.5;const r=o[0],e=o[1],c=o[2],t=o[3],u=Math.sin(a),i=Math.cos(a);return n[0]=r*i+t*u,n[1]=e*i+c*u,n[2]=c*i-e*u,n[3]=t*i-r*u,n}function R(n,o,a){a*=.5;const r=o[0],e=o[1],c=o[2],t=o[3],u=Math.sin(a),i=Math.cos(a);return n[0]=r*i-c*u,n[1]=e*i+t*u,n[2]=c*i+r*u,n[3]=t*i-e*u,n}function U(n,o,a){a*=.5;const r=o[0],e=o[1],c=o[2],t=o[3],u=Math.sin(a),i=Math.cos(a);return n[0]=r*i+e*u,n[1]=e*i-r*u,n[2]=c*i+t*u,n[3]=t*i-c*u,n}function V(n,o){const a=o[0],r=o[1],e=o[2];return n[0]=a,n[1]=r,n[2]=e,n[3]=Math.sqrt(Math.abs(1-a*a-r*r-e*e)),n}function $(n,o,a,r){const e=o[0],c=o[1],t=o[2],u=o[3];let i,h,M,s,l,g=a[0],m=a[1],q=a[2],p=a[3];return h=e*g+c*m+t*q+u*p,h<0&&(h=-h,g=-g,m=-m,q=-q,p=-p),1-h>b()?(i=Math.acos(h),M=Math.sin(i),s=Math.sin((1-r)*i)/M,l=Math.sin(r*i)/M):(s=1-r,l=r),n[0]=s*e+l*g,n[1]=s*c+l*m,n[2]=s*t+l*q,n[3]=s*u+l*p,n}function nn(n){const o=J,a=o(),r=o(),e=o(),c=Math.sqrt(1-a),t=Math.sqrt(a);return n[0]=c*Math.sin(2*Math.PI*r),n[1]=c*Math.cos(2*Math.PI*r),n[2]=t*Math.sin(2*Math.PI*e),n[3]=t*Math.cos(2*Math.PI*e),n}function on(n,o){const a=o[0],r=o[1],e=o[2],c=o[3],t=a*a+r*r+e*e+c*c,u=t?1/t:0;return n[0]=-a*u,n[1]=-r*u,n[2]=-e*u,n[3]=c*u,n}function rn(n,o){return n[0]=-o[0],n[1]=-o[1],n[2]=-o[2],n[3]=o[3],n}function z(n,o){const a=o[0]+o[4]+o[8];let r;if(a>0)r=Math.sqrt(a+1),n[3]=.5*r,r=.5/r,n[0]=(o[5]-o[7])*r,n[1]=(o[6]-o[2])*r,n[2]=(o[1]-o[3])*r;else{let e=0;o[4]>o[0]&&(e=1),o[8]>o[3*e+e]&&(e=2);const c=(e+1)%3,t=(e+2)%3;r=Math.sqrt(o[3*e+e]-o[3*c+c]-o[3*t+t]+1),n[e]=.5*r,r=.5/r,n[3]=(o[3*c+t]-o[3*t+c])*r,n[c]=(o[3*c+e]+o[3*e+c])*r,n[t]=(o[3*t+e]+o[3*e+t])*r}return n}function en(n,o,a,r){const e=.5*Math.PI/180;o*=e,a*=e,r*=e;const c=Math.sin(o),t=Math.cos(o),u=Math.sin(a),i=Math.cos(a),h=Math.sin(r),M=Math.cos(r);return n[0]=c*i*M-t*u*h,n[1]=t*u*M+c*i*h,n[2]=t*i*h-c*u*M,n[3]=t*i*M+c*u*h,n}function an(n){return"quat("+n[0]+", "+n[1]+", "+n[2]+", "+n[3]+")"}const cn=O,tn=S,un=T,hn=j,Mn=Y,fn=C,sn=D,E=H,ln=E,v=W,gn=v,P=X,mn=Z,qn=k;function pn(n,o,a){const r=w(o,a);return r<-.999999?(d(f,$n,o),B(f)<1e-6&&d(f,dn,o),F(f,f),_(n,f,Math.PI),n):r>.999999?(n[0]=0,n[1]=0,n[2]=0,n[3]=1,n):(d(f,o,a),n[0]=f[0],n[1]=f[1],n[2]=f[2],n[3]=1+r,P(n,n))}const f=G(),$n=A(1,0,0),dn=A(0,1,0);function Pn(n,o,a,r,e,c){return $(x,o,e,c),$(y,a,r,c),$(n,x,y,2*c*(1-c)),n}const x=I(),y=I();function xn(n,o,a,r){const e=yn;return e[0]=a[0],e[3]=a[1],e[6]=a[2],e[1]=r[0],e[4]=r[1],e[7]=r[2],e[2]=-o[0],e[5]=-o[1],e[8]=-o[2],P(n,z(n,e))}const yn=L();Object.freeze(Object.defineProperty({__proto__:null,identity:K,setAxisAngle:_,getAxisAngle:N,multiply:j,rotateX:Q,rotateY:R,rotateZ:U,calculateW:V,slerp:$,random:nn,invert:on,conjugate:rn,fromMat3:z,fromEuler:en,str:an,copy:cn,set:tn,add:un,mul:hn,scale:Mn,dot:fn,lerp:sn,length:E,len:ln,squaredLength:v,sqrLen:gn,normalize:P,exactEquals:mn,equals:qn,rotationTo:pn,sqlerp:Pn,setAxes:xn},Symbol.toStringTag,{value:"Module"}));export{mn as K,rn as S,en as k,_ as v,N as x,j as y}; diff --git a/assets/rasterProjectionHelper.0a540f3d.js b/assets/rasterProjectionHelper.f3c10be2.js similarity index 99% rename from assets/rasterProjectionHelper.0a540f3d.js rename to assets/rasterProjectionHelper.f3c10be2.js index fe36210..e813837 100644 --- a/assets/rasterProjectionHelper.0a540f3d.js +++ b/assets/rasterProjectionHelper.f3c10be2.js @@ -1 +1 @@ -import{dD as Q,dE as Pt,cU as Y,cI as W,j as k,c as b,cq as O,az as St,af as N,dF as bt,n as Gt,dG as v,dH as T,dI as it,dJ as Nt,dK as Et,aT as kt,dL as ot}from"./index.d94abe07.js";var H;function xt(t,n,i){return!bt(t,n,i)}function $(t,n,i){const r=xt(t,n,i);if(r&&!Q())throw new Gt("rasterprojectionhelper-project","projection engine is not loaded");return r}(function(t){t[t.None=0]="None",t[t.North=1]="North",t[t.South=2]="South",t[t.Both=3]="Both"})(H||(H={}));const st=(t,n,i,r=0)=>{if(i[0]===1)return[0,0];let s=1,e=-1,o=1,u=-1;for(let a=0;at[a]?t[a]:s,e=e>t[a]?e:t[a],o=o>t[a+1]?t[a+1]:o,u=u>t[a+1]?u:t[a+1]);const{cols:f,rows:c}=n,l=(e-s)/f/i[0],d=(u-o)/c/i[1],p=2*r;let h=0,x=!1,m=[0,0];for(let a=0;ah&&(h=R+P,m=[R,P]),p&&h>p){x=!0;break}}if(x)break}return m},Tt={3395:20037508342789244e-9,3410:17334193943686873e-9,3857:20037508342788905e-9,3975:17367530445161372e-9,4087:20037508342789244e-9,4088:20015108787169147e-9,6933:17367530445161372e-9,32662:20037508342789244e-9,53001:2001508679602057e-8,53002:1000754339801029e-8,53003:2001508679602057e-8,53004:2001508679602057e-8,53016:14152803599503474e-9,53017:17333573624304302e-9,53034:2001508679602057e-8,53079:20015114352186374e-9,53080:20015114352186374e-9,54001:20037508342789244e-9,54002:10018754171394624e-9,54003:20037508342789244e-9,54004:20037508342789244e-9,54016:14168658027268292e-9,54017:1736753044516137e-8,54034:20037508342789244e-9,54079:20037508342789244e-9,54080:20037508342789244e-9,54100:20037508342789244e-9,54101:20037508342789244e-9},I=32,A=4,K=A,X=new Map,U=new Map,B=500;async function jt(){Q()||await Pt()}function It(t,n,i){return $(t.spatialReference,n)?i?ot(n,t.spatialReference,t):ot(t.spatialReference,n,t):null}function rt(t,n,i,r=null){const s=t.spatialReference;if(s.equals(n))return t;$(s,n,r);const e=i.center,o=new Y({xmin:e.x-t.x/2,xmax:e.x+t.x/2,ymin:e.y-t.y/2,ymax:e.y+t.y/2,spatialReference:s}),u=W(o,n,r),f=C(n);let c;if(k(u)||b(f)&&u.width>=f){const l=O(s)/O(n);c={x:t.x*l,y:t.y*l}}else c={x:u.width,y:u.height};return c}function E(t,n=.01){return O(t)?n/O(t):0}function at(t,n,i=null,r=!0){const s=t.spatialReference;if(s.equals(n))return t;$(s,n,i);const e=W(t,n,i);return r&&e&&mt([t],[e],s,n),e}function mt(t,n,i,r){const s=F(i,!0),e=F(r,!0),o=E(i,B),u=E(r,B);if(o&&b(s)&&b(e))for(let f=0;f=e[1]-u&&Math.abs(l-s[0])new N(u[0],u[1],i)),o=W(e,r,s);return s&&mt(e,o,i,r),o.map(u=>u?[u.x,u.y]:[NaN,NaN])}function lt(t){const{inSR:n,outSR:i,datumTransformation:r}=t,s=L(n),{points:e,mask:o}=V(t,s);if(!n.isGeographic){const f=n.wkid?v.coordsys(n.wkid):v.fromString(n.isGeographic?T.PE_TYPE_GEOGCS:T.PE_TYPE_PROJCS,n.wkt);it.projToGeog(f,e.length,e)}if(b(r)&&r.steps.length){let f;if(i.isGeographic&&(f=e.map(([l])=>l>179.9955?1:l<-179.9955?-1:0)),r.steps.forEach(l=>{const d=l.wkid?v.geogtran(l.wkid):v.fromString(T.PE_TYPE_GEOGTRAN,l.wkt);Nt.geogToGeog(d,e.length,e,null,l.isInverse?T.PE_TRANSFORM_2_TO_1:T.PE_TRANSFORM_1_TO_2)}),f)for(let l=0;l179.9955?1:p<-179.9955?-1:0;d&&h&&d!==h&&(e[l][0]=d>0?p+360:p-360)}}if(!i.isGeographic){const f=L(i,!0),c=b(f)&&f.isEnvelope?[f.bbox[1],f.bbox[3]]:[-90,90];zt(e,c);const l=i.wkid?v.coordsys(i.wkid):v.fromString(i.isGeographic?T.PE_TYPE_GEOGCS:T.PE_TYPE_PROJCS,i.wkt);it.geogToProj(l,e.length,e)}let u=e;if(o&&e.length!==o.length){u=[];for(let f=0,c=0;fa.getInclusive()===1&&a.getKind()===1);if(!o){if(o=s.find(a=>a.getInclusive()===1&&a.getKind()===0),!o)return null;e=!0}const u=i?0:(r.getNorthPoleLocation()===2?1:0)|(r.getSouthPoleLocation()===2?2:0),f=r.isPannableRectangle(),c=o.getCoord();if(e)return{isEnvelope:e,isPannable:f,vertices:c,coef:null,bbox:[c[0][0]-n,c[0][1]-n,c[1][0]+n,c[1][1]+n],poleLocation:u};let l=0;const d=[];let[p,h]=c[0],[x,m]=c[0];for(let a=0,w=c.length;ay?x:y,m=m>g?m:g}return{isEnvelope:!1,isPannable:f,vertices:c,coef:d,bbox:[p,h,x,m],poleLocation:u}}function V(t,n){const i=[],{cols:r,rows:s,xres:e,yres:o,usePixelCenter:u}=t;let{xmin:f,ymax:c}=t;if(u&&(f+=e/2,c-=o/2),k(n)){for(let h=0;h=h&&g<=m;for(let R=0;R=x&&P<=a&&(i.push([g,P]),l[y]=1)}}return{points:i,mask:l}}const d=n.coef,p=[];for(let h=0;h=R&&x<=P){const _=g*x+M;m.push(_),a.push(G)}}let w=m;if(m.length>2){let y=a[0]===2?0:a[0],g=m[0];w=[];for(let M=1;MM-R)}else m[0]>m[1]&&(w=[m[1],m[0]]);p.push(w)}for(let h=0,x=0;h=y[0]&&m<=y[1]&&(i.push([m,w]),l[x]=1);else if(y.length>2){let g=!1;for(let M=0;M=y[M]&&m<=y[M+1]){g=!0;break}g&&(i.push([m,w]),l[x]=1)}}}return{points:i,mask:l}}function zt(t,n){const[i,r]=n;for(let s=0;sr)&&(t[s]=[NaN,NaN])}}function pt(t){const n=C(t[0].spatialReference);if(t.length<2||k(n))return t[0];let{xmin:i,xmax:r,ymin:s,ymax:e}=t[0];for(let o=1;oE(s)){const{xmin:c,xmax:l}=t;for(let d=0;d<=e;d++){const p=d===0?c:-o/2,h=d===e?l-o*d:o/2;f[d]=new Y({xmin:p,xmax:h,ymin:t.ymin,ymax:t.ymax,spatialReference:s})}}return pt(f.map(c=>ft(c,n,i,r)).filter(b))}function Lt(t,n){const i=C(n);if(k(i))return null;let{xmin:r,ymin:s,xmax:e,ymax:o}=t;const u=t.spatialReference,f=new St({spatialReference:u,rings:[[[r,s],[e,s],[e,o],[r,o],[r,s]]]}),c=W(f,n);if(c.rings.length!==2||!c.rings[0].length||!c.rings[1].length)return null;const{rings:l}=c,d=E(u),p=new Y({spatialReference:n});for(let h=0;h<2;h++){r=e=l[h][0][0],s=o=l[h][0][1];for(let x=0;xl[h][x][0]?l[h][x][0]:r,e=el[h][x][1]?l[h][x][1]:s,o=o=o.ymax))return null;if(!r||!o)return o;const u=F(e,!0),f=F(n,!0);if(k(u)||k(f))return o;const c=E(e,.001),l=E(e,B),d=E(n,.001);if(Math.abs(o.xmin-f[0])l){o.xmin=f[0];const x=[];x.push(new N(t.xmax,t.ymin,e)),x.push(new N(t.xmax,(t.ymin+t.ymax)/2,e)),x.push(new N(t.xmax,t.ymax,e));const m=x.map(a=>at(a,n,i)).filter(a=>!isNaN(a==null?void 0:a.x)).map(a=>a.x);o.xmax=Math.max.apply(null,m)}if(hl){o.xmax=f[1];const x=[];x.push(new N(t.xmin,t.ymin,e)),x.push(new N(t.xmin,(t.ymin+t.ymax)/2,e)),x.push(new N(t.xmin,t.ymax,e));const m=x.map(a=>at(a,n,i)).filter(a=>!isNaN(a==null?void 0:a.x)).map(a=>a.x);o.xmin=Math.min.apply(null,m)}}else{const p=E(n,.001);Math.abs(o.xmin-f[0])0&&r.outofBoundPointCountK)&&(xt(f,c,t.datumTransformation)&&(f.isGeographic||b(L(f))),i=[A,A],r=D({...t,spacing:i}),s={cols:r.size[0]+1,rows:r.size[1]+1},o=st(r.offsets,s,i,K)),r.error=o,i[0]>1&&(r.coefficients=ht(r.offsets,s,e)),t.includeGCSGrid&&!f.isGeographic&&!f.isWebMercator)if(c.isGeographic)r.gcsGrid={offsets:r.offsets,coefficients:r.coefficients,spacing:i};else{const l=L(f);if(b(l)&&!l.isEnvelope){const d=Wt(f),p=gt(t.projectedExtent,d),{offsets:h}=D({...t,srcBufferExtent:p,spacing:i}),x=ht(h,s,e);r.gcsGrid={offsets:h,coefficients:x,spacing:i}}}return r}function D(t){const{projectedExtent:n,srcBufferExtent:i,pixelSize:r,datumTransformation:s,rasterTransform:e}=t,o=n.spatialReference,u=i.spatialReference,f=$(o,u),{xmin:c,ymin:l,xmax:d,ymax:p}=n,h=C(u),x=b(h)&&(t.hasWrapAround||(e==null?void 0:e.type)==="gcs-shift"),m=t.spacing||[I,I],a=m[0]*r.x,w=m[1]*r.y,y=m[0]===1,g=Math.ceil((d-c)/a-.1/m[0])+(y?0:1),M=Math.ceil((p-l)/w-.1/m[1])+(y?0:1),R=vt({cols:g,rows:M,xmin:c,ymax:p,xres:a,yres:w,inSR:o,outSR:u,datumTransformation:s,preferPE:m[0]<=A,usePixelCenter:y}),P=[];let G,_=0;const Z=y?-1:NaN,{xmin:tt,xmax:q,ymax:yt,width:dt,height:Mt}=i,wt=E(u,B),Rt=b(h)&&tt>0&&q>h/2;let nt=!1;if(f){const z=L(o);nt=b(z)&&z.poleLocation>0}for(let z=0;zq&&S[0]>h/2-wt?S[0]-=h:x&&z===0&&S[0]<0&&Rt&&!e&&(S[0]+=h),!S||isNaN(S[0])||isNaN(S[1]))P.push(Z),P.push(Z),J.push(null),_++;else{if(e){const et=e.inverseTransform(new N({x:S[0],y:S[1],spatialReference:u}));S=[et.x,et.y]}J.push(S),z>0&&x&&G[j]&&S[0]q&&S[0]>h&&(S[0]-=h)),P.push((S[0]-tt)/dt),P.push((yt-S[1])/Mt)}}G=J}return{offsets:P,error:null,coefficients:null,outofBoundPointCount:_,spacing:m,size:y?[g,M]:[g-1,M-1]}}function ht(t,n,i){const{cols:r,rows:s}=n,e=new Float32Array((r-1)*(s-1)*2*6),o=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),u=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let f=0;f=x)e=u.length,o=p/x>8;else{let w,y=m;for(let g=1;g<=u.length;g++){if(w=(u[g-1].x+u[g-1].y)/2,p<=w){p===w?e=g:i==="down"?(e=g-1,o=p/y>8):e=i==="up"||p-y>w-p||p/y>2?g:g-1;break}y=w}}const a=e===0?s:u[e-1];return o&&Math.min(a.x,a.y)*O(n.spatialReference)>19567&&(o=!1),{pyramidLevel:e,pyramidResolution:new N({x:a.x,y:a.y,spatialReference:n.spatialReference}),excessiveReading:o}}const f=Math.log(t.x/s.x)/Math.LN2,c=Math.log(t.y/s.y)/Math.LN2,l=n.storageInfo.maximumPyramidLevel||0;e=i==="down"?Math.floor(Math.min(f,c)):i==="up"?Math.ceil(Math.max(f,c)):Math.round((f+c)/2),e<0?e=0:e>l&&(o=e>l+3,e=l);const d=2**e;return{pyramidLevel:e,pyramidResolution:new N({x:d*n.nativePixelSize.x,y:d*n.nativePixelSize.y,spatialReference:n.spatialReference}),excessiveReading:o}}function qt(t,n,i=512,r=!0){const{extent:s,spatialReference:e,pixelSize:o}=t,u=rt(new N({x:o.x,y:o.y,spatialReference:e}),n,s);if(u==null)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const f=(u.x+u.y)/2,c=O(n),l=f*c*96*39.37,d=n.isGeographic?256/i*2958287637958547e-7:256/i*591657527591555e-6;let p=t.dataType==="vector-magdir"||t.dataType==="vector-uv";const h=gt(s,n),x=Math.min(Math.ceil(Math.log(Math.min(t.width,t.height)/32)/Math.LN2),Math.ceil(Math.log(d/2/l)/Math.LN2));if(!p&&r&&(n.isGeographic||n.isWebMercator)&&(p=h.xmin*h.xmax<0,!p&&x<3)){const P=C(n);if(b(P)){const G=2**x*f*i,_=Math.ceil(P/G);p=_===1||_===2&&P/2-h.xmax=R;)a/=2,m.x/=2,m.y/=2,y.push(a),g.push({x:m.x,y:m.y});return{projectedPixelSize:u,scales:y,srcResolutions:g,isCustomTilingScheme:!p}}export{Bt as $,rt as C,gt as J,xt as M,Ot as Q,jt as T,C as U,At as V,qt as i,at as j,Ft as n,Yt as o,It as v}; +import{dD as Q,dE as Pt,cU as Y,cI as W,j as k,c as b,cq as O,az as St,af as N,dF as bt,n as Gt,dG as v,dH as T,dI as it,dJ as Nt,dK as Et,aT as kt,dL as ot}from"./index.221827cd.js";var H;function xt(t,n,i){return!bt(t,n,i)}function $(t,n,i){const r=xt(t,n,i);if(r&&!Q())throw new Gt("rasterprojectionhelper-project","projection engine is not loaded");return r}(function(t){t[t.None=0]="None",t[t.North=1]="North",t[t.South=2]="South",t[t.Both=3]="Both"})(H||(H={}));const st=(t,n,i,r=0)=>{if(i[0]===1)return[0,0];let s=1,e=-1,o=1,u=-1;for(let a=0;at[a]?t[a]:s,e=e>t[a]?e:t[a],o=o>t[a+1]?t[a+1]:o,u=u>t[a+1]?u:t[a+1]);const{cols:f,rows:c}=n,l=(e-s)/f/i[0],d=(u-o)/c/i[1],p=2*r;let h=0,x=!1,m=[0,0];for(let a=0;ah&&(h=R+P,m=[R,P]),p&&h>p){x=!0;break}}if(x)break}return m},Tt={3395:20037508342789244e-9,3410:17334193943686873e-9,3857:20037508342788905e-9,3975:17367530445161372e-9,4087:20037508342789244e-9,4088:20015108787169147e-9,6933:17367530445161372e-9,32662:20037508342789244e-9,53001:2001508679602057e-8,53002:1000754339801029e-8,53003:2001508679602057e-8,53004:2001508679602057e-8,53016:14152803599503474e-9,53017:17333573624304302e-9,53034:2001508679602057e-8,53079:20015114352186374e-9,53080:20015114352186374e-9,54001:20037508342789244e-9,54002:10018754171394624e-9,54003:20037508342789244e-9,54004:20037508342789244e-9,54016:14168658027268292e-9,54017:1736753044516137e-8,54034:20037508342789244e-9,54079:20037508342789244e-9,54080:20037508342789244e-9,54100:20037508342789244e-9,54101:20037508342789244e-9},I=32,A=4,K=A,X=new Map,U=new Map,B=500;async function jt(){Q()||await Pt()}function It(t,n,i){return $(t.spatialReference,n)?i?ot(n,t.spatialReference,t):ot(t.spatialReference,n,t):null}function rt(t,n,i,r=null){const s=t.spatialReference;if(s.equals(n))return t;$(s,n,r);const e=i.center,o=new Y({xmin:e.x-t.x/2,xmax:e.x+t.x/2,ymin:e.y-t.y/2,ymax:e.y+t.y/2,spatialReference:s}),u=W(o,n,r),f=C(n);let c;if(k(u)||b(f)&&u.width>=f){const l=O(s)/O(n);c={x:t.x*l,y:t.y*l}}else c={x:u.width,y:u.height};return c}function E(t,n=.01){return O(t)?n/O(t):0}function at(t,n,i=null,r=!0){const s=t.spatialReference;if(s.equals(n))return t;$(s,n,i);const e=W(t,n,i);return r&&e&&mt([t],[e],s,n),e}function mt(t,n,i,r){const s=F(i,!0),e=F(r,!0),o=E(i,B),u=E(r,B);if(o&&b(s)&&b(e))for(let f=0;f=e[1]-u&&Math.abs(l-s[0])new N(u[0],u[1],i)),o=W(e,r,s);return s&&mt(e,o,i,r),o.map(u=>u?[u.x,u.y]:[NaN,NaN])}function lt(t){const{inSR:n,outSR:i,datumTransformation:r}=t,s=L(n),{points:e,mask:o}=V(t,s);if(!n.isGeographic){const f=n.wkid?v.coordsys(n.wkid):v.fromString(n.isGeographic?T.PE_TYPE_GEOGCS:T.PE_TYPE_PROJCS,n.wkt);it.projToGeog(f,e.length,e)}if(b(r)&&r.steps.length){let f;if(i.isGeographic&&(f=e.map(([l])=>l>179.9955?1:l<-179.9955?-1:0)),r.steps.forEach(l=>{const d=l.wkid?v.geogtran(l.wkid):v.fromString(T.PE_TYPE_GEOGTRAN,l.wkt);Nt.geogToGeog(d,e.length,e,null,l.isInverse?T.PE_TRANSFORM_2_TO_1:T.PE_TRANSFORM_1_TO_2)}),f)for(let l=0;l179.9955?1:p<-179.9955?-1:0;d&&h&&d!==h&&(e[l][0]=d>0?p+360:p-360)}}if(!i.isGeographic){const f=L(i,!0),c=b(f)&&f.isEnvelope?[f.bbox[1],f.bbox[3]]:[-90,90];zt(e,c);const l=i.wkid?v.coordsys(i.wkid):v.fromString(i.isGeographic?T.PE_TYPE_GEOGCS:T.PE_TYPE_PROJCS,i.wkt);it.geogToProj(l,e.length,e)}let u=e;if(o&&e.length!==o.length){u=[];for(let f=0,c=0;fa.getInclusive()===1&&a.getKind()===1);if(!o){if(o=s.find(a=>a.getInclusive()===1&&a.getKind()===0),!o)return null;e=!0}const u=i?0:(r.getNorthPoleLocation()===2?1:0)|(r.getSouthPoleLocation()===2?2:0),f=r.isPannableRectangle(),c=o.getCoord();if(e)return{isEnvelope:e,isPannable:f,vertices:c,coef:null,bbox:[c[0][0]-n,c[0][1]-n,c[1][0]+n,c[1][1]+n],poleLocation:u};let l=0;const d=[];let[p,h]=c[0],[x,m]=c[0];for(let a=0,w=c.length;ay?x:y,m=m>g?m:g}return{isEnvelope:!1,isPannable:f,vertices:c,coef:d,bbox:[p,h,x,m],poleLocation:u}}function V(t,n){const i=[],{cols:r,rows:s,xres:e,yres:o,usePixelCenter:u}=t;let{xmin:f,ymax:c}=t;if(u&&(f+=e/2,c-=o/2),k(n)){for(let h=0;h=h&&g<=m;for(let R=0;R=x&&P<=a&&(i.push([g,P]),l[y]=1)}}return{points:i,mask:l}}const d=n.coef,p=[];for(let h=0;h=R&&x<=P){const _=g*x+M;m.push(_),a.push(G)}}let w=m;if(m.length>2){let y=a[0]===2?0:a[0],g=m[0];w=[];for(let M=1;MM-R)}else m[0]>m[1]&&(w=[m[1],m[0]]);p.push(w)}for(let h=0,x=0;h=y[0]&&m<=y[1]&&(i.push([m,w]),l[x]=1);else if(y.length>2){let g=!1;for(let M=0;M=y[M]&&m<=y[M+1]){g=!0;break}g&&(i.push([m,w]),l[x]=1)}}}return{points:i,mask:l}}function zt(t,n){const[i,r]=n;for(let s=0;sr)&&(t[s]=[NaN,NaN])}}function pt(t){const n=C(t[0].spatialReference);if(t.length<2||k(n))return t[0];let{xmin:i,xmax:r,ymin:s,ymax:e}=t[0];for(let o=1;oE(s)){const{xmin:c,xmax:l}=t;for(let d=0;d<=e;d++){const p=d===0?c:-o/2,h=d===e?l-o*d:o/2;f[d]=new Y({xmin:p,xmax:h,ymin:t.ymin,ymax:t.ymax,spatialReference:s})}}return pt(f.map(c=>ft(c,n,i,r)).filter(b))}function Lt(t,n){const i=C(n);if(k(i))return null;let{xmin:r,ymin:s,xmax:e,ymax:o}=t;const u=t.spatialReference,f=new St({spatialReference:u,rings:[[[r,s],[e,s],[e,o],[r,o],[r,s]]]}),c=W(f,n);if(c.rings.length!==2||!c.rings[0].length||!c.rings[1].length)return null;const{rings:l}=c,d=E(u),p=new Y({spatialReference:n});for(let h=0;h<2;h++){r=e=l[h][0][0],s=o=l[h][0][1];for(let x=0;xl[h][x][0]?l[h][x][0]:r,e=el[h][x][1]?l[h][x][1]:s,o=o=o.ymax))return null;if(!r||!o)return o;const u=F(e,!0),f=F(n,!0);if(k(u)||k(f))return o;const c=E(e,.001),l=E(e,B),d=E(n,.001);if(Math.abs(o.xmin-f[0])l){o.xmin=f[0];const x=[];x.push(new N(t.xmax,t.ymin,e)),x.push(new N(t.xmax,(t.ymin+t.ymax)/2,e)),x.push(new N(t.xmax,t.ymax,e));const m=x.map(a=>at(a,n,i)).filter(a=>!isNaN(a==null?void 0:a.x)).map(a=>a.x);o.xmax=Math.max.apply(null,m)}if(hl){o.xmax=f[1];const x=[];x.push(new N(t.xmin,t.ymin,e)),x.push(new N(t.xmin,(t.ymin+t.ymax)/2,e)),x.push(new N(t.xmin,t.ymax,e));const m=x.map(a=>at(a,n,i)).filter(a=>!isNaN(a==null?void 0:a.x)).map(a=>a.x);o.xmin=Math.min.apply(null,m)}}else{const p=E(n,.001);Math.abs(o.xmin-f[0])0&&r.outofBoundPointCountK)&&(xt(f,c,t.datumTransformation)&&(f.isGeographic||b(L(f))),i=[A,A],r=D({...t,spacing:i}),s={cols:r.size[0]+1,rows:r.size[1]+1},o=st(r.offsets,s,i,K)),r.error=o,i[0]>1&&(r.coefficients=ht(r.offsets,s,e)),t.includeGCSGrid&&!f.isGeographic&&!f.isWebMercator)if(c.isGeographic)r.gcsGrid={offsets:r.offsets,coefficients:r.coefficients,spacing:i};else{const l=L(f);if(b(l)&&!l.isEnvelope){const d=Wt(f),p=gt(t.projectedExtent,d),{offsets:h}=D({...t,srcBufferExtent:p,spacing:i}),x=ht(h,s,e);r.gcsGrid={offsets:h,coefficients:x,spacing:i}}}return r}function D(t){const{projectedExtent:n,srcBufferExtent:i,pixelSize:r,datumTransformation:s,rasterTransform:e}=t,o=n.spatialReference,u=i.spatialReference,f=$(o,u),{xmin:c,ymin:l,xmax:d,ymax:p}=n,h=C(u),x=b(h)&&(t.hasWrapAround||(e==null?void 0:e.type)==="gcs-shift"),m=t.spacing||[I,I],a=m[0]*r.x,w=m[1]*r.y,y=m[0]===1,g=Math.ceil((d-c)/a-.1/m[0])+(y?0:1),M=Math.ceil((p-l)/w-.1/m[1])+(y?0:1),R=vt({cols:g,rows:M,xmin:c,ymax:p,xres:a,yres:w,inSR:o,outSR:u,datumTransformation:s,preferPE:m[0]<=A,usePixelCenter:y}),P=[];let G,_=0;const Z=y?-1:NaN,{xmin:tt,xmax:q,ymax:yt,width:dt,height:Mt}=i,wt=E(u,B),Rt=b(h)&&tt>0&&q>h/2;let nt=!1;if(f){const z=L(o);nt=b(z)&&z.poleLocation>0}for(let z=0;zq&&S[0]>h/2-wt?S[0]-=h:x&&z===0&&S[0]<0&&Rt&&!e&&(S[0]+=h),!S||isNaN(S[0])||isNaN(S[1]))P.push(Z),P.push(Z),J.push(null),_++;else{if(e){const et=e.inverseTransform(new N({x:S[0],y:S[1],spatialReference:u}));S=[et.x,et.y]}J.push(S),z>0&&x&&G[j]&&S[0]q&&S[0]>h&&(S[0]-=h)),P.push((S[0]-tt)/dt),P.push((yt-S[1])/Mt)}}G=J}return{offsets:P,error:null,coefficients:null,outofBoundPointCount:_,spacing:m,size:y?[g,M]:[g-1,M-1]}}function ht(t,n,i){const{cols:r,rows:s}=n,e=new Float32Array((r-1)*(s-1)*2*6),o=new Float32Array([-0,-1,1,-1,1,-0,1,-0,-0]),u=new Float32Array([-1,1,0,0,-1,1,1,0,0]);for(let f=0;f=x)e=u.length,o=p/x>8;else{let w,y=m;for(let g=1;g<=u.length;g++){if(w=(u[g-1].x+u[g-1].y)/2,p<=w){p===w?e=g:i==="down"?(e=g-1,o=p/y>8):e=i==="up"||p-y>w-p||p/y>2?g:g-1;break}y=w}}const a=e===0?s:u[e-1];return o&&Math.min(a.x,a.y)*O(n.spatialReference)>19567&&(o=!1),{pyramidLevel:e,pyramidResolution:new N({x:a.x,y:a.y,spatialReference:n.spatialReference}),excessiveReading:o}}const f=Math.log(t.x/s.x)/Math.LN2,c=Math.log(t.y/s.y)/Math.LN2,l=n.storageInfo.maximumPyramidLevel||0;e=i==="down"?Math.floor(Math.min(f,c)):i==="up"?Math.ceil(Math.max(f,c)):Math.round((f+c)/2),e<0?e=0:e>l&&(o=e>l+3,e=l);const d=2**e;return{pyramidLevel:e,pyramidResolution:new N({x:d*n.nativePixelSize.x,y:d*n.nativePixelSize.y,spatialReference:n.spatialReference}),excessiveReading:o}}function qt(t,n,i=512,r=!0){const{extent:s,spatialReference:e,pixelSize:o}=t,u=rt(new N({x:o.x,y:o.y,spatialReference:e}),n,s);if(u==null)return{projectedPixelSize:null,scales:null,srcResolutions:null,isCustomTilingScheme:!1};const f=(u.x+u.y)/2,c=O(n),l=f*c*96*39.37,d=n.isGeographic?256/i*2958287637958547e-7:256/i*591657527591555e-6;let p=t.dataType==="vector-magdir"||t.dataType==="vector-uv";const h=gt(s,n),x=Math.min(Math.ceil(Math.log(Math.min(t.width,t.height)/32)/Math.LN2),Math.ceil(Math.log(d/2/l)/Math.LN2));if(!p&&r&&(n.isGeographic||n.isWebMercator)&&(p=h.xmin*h.xmax<0,!p&&x<3)){const P=C(n);if(b(P)){const G=2**x*f*i,_=Math.ceil(P/G);p=_===1||_===2&&P/2-h.xmax=R;)a/=2,m.x/=2,m.y/=2,y.push(a),g.push({x:m.x,y:m.y});return{projectedPixelSize:u,scales:y,srcResolutions:g,isCustomTilingScheme:!p}}export{Bt as $,rt as C,gt as J,xt as M,Ot as Q,jt as T,C as U,At as V,qt as i,at as j,Ft as n,Yt as o,It as v}; diff --git a/assets/rasterizingUtils.4baad29a.js b/assets/rasterizingUtils.ec7fabe7.js similarity index 93% rename from assets/rasterizingUtils.4baad29a.js rename to assets/rasterizingUtils.ec7fabe7.js index 870b6d5..d0d5f8a 100644 --- a/assets/rasterizingUtils.4baad29a.js +++ b/assets/rasterizingUtils.ec7fabe7.js @@ -1 +1 @@ -import{o as x}from"./floatRGBA.df11258c.js";import{y as u}from"./index.d94abe07.js";const C=e=>e==="vertical"||e==="horizontal"||e==="cross"||e==="esriSFSCross"||e==="esriSFSVertical"||e==="esriSFSHorizontal";function k(e,i,T){const F=u(Math.ceil(T)),a=C(i)?8*F:16*F,o=2*F;e.width=a,e.height=a;const t=e.getContext("2d");t.strokeStyle="#FFFFFF",t.lineWidth=F,t.beginPath(),i!=="vertical"&&i!=="cross"&&i!=="esriSFSCross"&&i!=="esriSFSVertical"||(t.moveTo(a/2,-o),t.lineTo(a/2,a+o)),i!=="horizontal"&&i!=="cross"&&i!=="esriSFSCross"&&i!=="esriSFSHorizontal"||(t.moveTo(-o,a/2),t.lineTo(a+o,a/2)),i!=="forward-diagonal"&&i!=="diagonal-cross"&&i!=="esriSFSDiagonalCross"&&i!=="esriSFSForwardDiagonal"||(t.moveTo(-o,-o),t.lineTo(a+o,a+o),t.moveTo(a-o,-o),t.lineTo(a+o,o),t.moveTo(-o,a-o),t.lineTo(o,a+o)),i!=="backward-diagonal"&&i!=="diagonal-cross"&&i!=="esriSFSBackwardDiagonal"&&i!=="esriSFSDiagonalCross"||(t.moveTo(a+o,-o),t.lineTo(-o,a+o),t.moveTo(o,-o),t.lineTo(-o,o),t.moveTo(a+o,a-o),t.lineTo(a-o,a+o)),t.stroke();const d=t.getImageData(0,0,e.width,e.height),s=new Uint8Array(d.data);let l;for(let n=0;ne==="vertical"||e==="horizontal"||e==="cross"||e==="esriSFSCross"||e==="esriSFSVertical"||e==="esriSFSHorizontal";function k(e,i,T){const F=u(Math.ceil(T)),a=C(i)?8*F:16*F,o=2*F;e.width=a,e.height=a;const t=e.getContext("2d");t.strokeStyle="#FFFFFF",t.lineWidth=F,t.beginPath(),i!=="vertical"&&i!=="cross"&&i!=="esriSFSCross"&&i!=="esriSFSVertical"||(t.moveTo(a/2,-o),t.lineTo(a/2,a+o)),i!=="horizontal"&&i!=="cross"&&i!=="esriSFSCross"&&i!=="esriSFSHorizontal"||(t.moveTo(-o,a/2),t.lineTo(a+o,a/2)),i!=="forward-diagonal"&&i!=="diagonal-cross"&&i!=="esriSFSDiagonalCross"&&i!=="esriSFSForwardDiagonal"||(t.moveTo(-o,-o),t.lineTo(a+o,a+o),t.moveTo(a-o,-o),t.lineTo(a+o,o),t.moveTo(-o,a-o),t.lineTo(o,a+o)),i!=="backward-diagonal"&&i!=="diagonal-cross"&&i!=="esriSFSBackwardDiagonal"&&i!=="esriSFSDiagonalCross"||(t.moveTo(a+o,-o),t.lineTo(-o,a+o),t.moveTo(o,-o),t.lineTo(-o,o),t.moveTo(a+o,a-o),t.lineTo(a-o,a+o)),t.stroke();const d=t.getImageData(0,0,e.width,e.height),s=new Uint8Array(d.data);let l;for(let n=0;n{let i,a,b,l,r;if(s.data)if(s.data instanceof ArrayBuffer){if(!(e!=="json"&&e!=="text"&&e!=="blob"||(i=new Blob([s.data]),e!=="json"&&e!=="text"||(u||(u=new FileReaderSync),l=u.readAsText(i),e!=="json")))){try{a=JSON.parse(l||null)}catch(o){const d={...o,url:n,requestOptions:t};throw new f("request:server",o.message,d)}if(a.error){const o={...a.error,url:n,requestOptions:t};throw new f("request:server",a.error.message,o)}}}else e==="native"&&(s.data.signal=c,b=await fetch(s.data.url,s.data));switch(e){case"blob":r=i;break;case"json":r=a;break;case"native":r=b;break;case"text":r=l;break;default:r=s.data}return{data:r,requestOptions:t,ssl:s.ssl,url:n}})}export{w as execute}; +import{u as p,n as f}from"./index.221827cd.js";let u;function w(n,t){let e=t.responseType;e?e!=="array-buffer"&&e!=="blob"&&e!=="json"&&e!=="native"&&e!=="native-request-init"&&e!=="text"&&(e="text"):e="json",t.responseType=e;const c=p(t.signal);return delete t.signal,globalThis.invokeStaticMessage("request",{url:n,options:t},{signal:c}).then(async s=>{let i,a,b,l,r;if(s.data)if(s.data instanceof ArrayBuffer){if(!(e!=="json"&&e!=="text"&&e!=="blob"||(i=new Blob([s.data]),e!=="json"&&e!=="text"||(u||(u=new FileReaderSync),l=u.readAsText(i),e!=="json")))){try{a=JSON.parse(l||null)}catch(o){const d={...o,url:n,requestOptions:t};throw new f("request:server",o.message,d)}if(a.error){const o={...a.error,url:n,requestOptions:t};throw new f("request:server",a.error.message,o)}}}else e==="native"&&(s.data.signal=c,b=await fetch(s.data.url,s.data));switch(e){case"blob":r=i;break;case"json":r=a;break;case"native":r=b;break;case"text":r=l;break;default:r=s.data}return{data:r,requestOptions:t,ssl:s.ssl,url:n}})}export{w as execute}; diff --git a/assets/requestImageUtils.7b09b5e8.js b/assets/requestImageUtils.1f5d4b6d.js similarity index 54% rename from assets/requestImageUtils.7b09b5e8.js rename to assets/requestImageUtils.1f5d4b6d.js index 5f28568..68988d2 100644 --- a/assets/requestImageUtils.7b09b5e8.js +++ b/assets/requestImageUtils.1f5d4b6d.js @@ -1 +1 @@ -import{U as n}from"./index.d94abe07.js";async function r(t,a){const{data:e}=await n(t,{responseType:"image",...a});return e}export{r as t}; +import{U as n}from"./index.221827cd.js";async function r(t,a){const{data:e}=await n(t,{responseType:"image",...a});return e}export{r as t}; diff --git a/assets/resourceUtils.6d10bf82.js b/assets/resourceUtils.f4b6e42a.js similarity index 97% rename from assets/resourceUtils.6d10bf82.js rename to assets/resourceUtils.f4b6e42a.js index db10b7c..d47c273 100644 --- a/assets/resourceUtils.6d10bf82.js +++ b/assets/resourceUtils.f4b6e42a.js @@ -1 +1 @@ -import{eP as n,eQ as l,n as m,c as d,eR as v,j as R,U as P}from"./index.d94abe07.js";async function x(e,t={},r){await e.load(r);const a=n(e.itemUrl,"resources"),{start:o=1,num:c=10,sortOrder:i="asc",sortField:u="created"}=t,p={query:{start:o,num:c,sortOrder:i,sortField:u,token:e.apiKey},signal:l(r,"signal")},s=await e.portal._request(a,p);return{total:s.total,nextStart:s.nextStart,resources:s.resources.map(({created:w,size:g,resource:y})=>({created:new Date(w),size:g,resource:e.resourceFromPath(y)}))}}async function F(e,t,r,a){if(!e.hasPath())throw new m(`portal-item-resource-${t}:invalid-path`,"Resource does not have a valid path");const o=e.portalItem;await o.load(a);const c=n(o.userItemUrl,t==="add"?"addResources":"updateResources"),[i,u]=h(e.path),p=await q(r),s=new FormData;return i&&i!=="."&&s.append("resourcesPrefix",i),d(a)&&a.compress&&s.append("compress","true"),s.append("fileName",u),s.append("file",p,u),s.append("f","json"),d(a)&&a.access&&s.append("access",a.access),await o.portal._request(c,{method:"post",body:s,signal:l(a,"signal")}),e}async function O(e,t,r){if(!t.hasPath())throw new m("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(r);const a=n(e.userItemUrl,"removeResources");await e.portal._request(a,{method:"post",query:{resource:t.path},signal:l(r,"signal")}),t.portalItem=null}async function S(e,t){await e.load(t);const r=n(e.userItemUrl,"removeResources");return e.portal._request(r,{method:"post",query:{deleteAll:!0},signal:l(t,"signal")})}function h(e){const t=e.lastIndexOf("/");return t===-1?[".",e]:[e.slice(0,t),e.slice(t+1)]}function f(e){const[t,r]=I(e),[a,o]=h(t);return[a,o,r]}function I(e){const t=v(e);return R(t)?[e,""]:[e.slice(0,e.length-t.length-1),`.${t}`]}async function q(e){return e instanceof Blob?e:(await P(e.url,{responseType:"blob"})).data}function U(e,t){if(!e.hasPath())return null;const[r,,a]=f(e.path);return e.portalItem.resourceFromPath(n(r,t+a))}function T(e,t){if(!e.hasPath())return null;const[r,,a]=f(e.path);return e.portalItem.resourceFromPath(n(r,t+a))}export{F as addOrUpdateResource,q as contentToBlob,x as fetchResources,U as getSiblingOfSameType,T as getSiblingOfSameTypeI,S as removeAllResources,O as removeResource,f as splitPrefixFileNameAndExtension}; +import{eP as n,eQ as l,n as m,c as d,eR as v,j as R,U as P}from"./index.221827cd.js";async function x(e,t={},r){await e.load(r);const a=n(e.itemUrl,"resources"),{start:o=1,num:c=10,sortOrder:i="asc",sortField:u="created"}=t,p={query:{start:o,num:c,sortOrder:i,sortField:u,token:e.apiKey},signal:l(r,"signal")},s=await e.portal._request(a,p);return{total:s.total,nextStart:s.nextStart,resources:s.resources.map(({created:w,size:g,resource:y})=>({created:new Date(w),size:g,resource:e.resourceFromPath(y)}))}}async function F(e,t,r,a){if(!e.hasPath())throw new m(`portal-item-resource-${t}:invalid-path`,"Resource does not have a valid path");const o=e.portalItem;await o.load(a);const c=n(o.userItemUrl,t==="add"?"addResources":"updateResources"),[i,u]=h(e.path),p=await q(r),s=new FormData;return i&&i!=="."&&s.append("resourcesPrefix",i),d(a)&&a.compress&&s.append("compress","true"),s.append("fileName",u),s.append("file",p,u),s.append("f","json"),d(a)&&a.access&&s.append("access",a.access),await o.portal._request(c,{method:"post",body:s,signal:l(a,"signal")}),e}async function O(e,t,r){if(!t.hasPath())throw new m("portal-item-resources-remove:invalid-path","Resource does not have a valid path");await e.load(r);const a=n(e.userItemUrl,"removeResources");await e.portal._request(a,{method:"post",query:{resource:t.path},signal:l(r,"signal")}),t.portalItem=null}async function S(e,t){await e.load(t);const r=n(e.userItemUrl,"removeResources");return e.portal._request(r,{method:"post",query:{deleteAll:!0},signal:l(t,"signal")})}function h(e){const t=e.lastIndexOf("/");return t===-1?[".",e]:[e.slice(0,t),e.slice(t+1)]}function f(e){const[t,r]=I(e),[a,o]=h(t);return[a,o,r]}function I(e){const t=v(e);return R(t)?[e,""]:[e.slice(0,e.length-t.length-1),`.${t}`]}async function q(e){return e instanceof Blob?e:(await P(e.url,{responseType:"blob"})).data}function U(e,t){if(!e.hasPath())return null;const[r,,a]=f(e.path);return e.portalItem.resourceFromPath(n(r,t+a))}function T(e,t){if(!e.hasPath())return null;const[r,,a]=f(e.path);return e.portalItem.resourceFromPath(n(r,t+a))}export{F as addOrUpdateResource,q as contentToBlob,x as fetchResources,U as getSiblingOfSameType,T as getSiblingOfSameTypeI,S as removeAllResources,O as removeResource,f as splitPrefixFileNameAndExtension}; diff --git a/assets/scaleUtils.467c71f9.js b/assets/scaleUtils.de5ad5a6.js similarity index 71% rename from assets/scaleUtils.467c71f9.js rename to assets/scaleUtils.de5ad5a6.js index d36d3bd..13a707a 100644 --- a/assets/scaleUtils.467c71f9.js +++ b/assets/scaleUtils.de5ad5a6.js @@ -1 +1 @@ -import{cq as o,e7 as c}from"./index.d94abe07.js";const i=96;function a(t,n){const e=n||t.extent,r=t.width,f=o(e&&e.spatialReference);return e&&r?e.width/r*f*c*i:0}function u(t,n){return t/(o(n)*c*i)}export{a as i,u as r}; +import{cq as o,e7 as c}from"./index.221827cd.js";const i=96;function a(t,n){const e=n||t.extent,r=t.width,f=o(e&&e.spatialReference);return e&&r?e.width/r*f*c*i:0}function u(t,n){return t/(o(n)*c*i)}export{a as i,u as r}; diff --git a/assets/schemaUtils.69ad92d2.js b/assets/schemaUtils.d20994fa.js similarity index 97% rename from assets/schemaUtils.69ad92d2.js rename to assets/schemaUtils.d20994fa.js index a595d13..647b375 100644 --- a/assets/schemaUtils.69ad92d2.js +++ b/assets/schemaUtils.d20994fa.js @@ -1 +1 @@ -import{s as re,m as D,aQ as U,n as d,bQ as Q,c as w,bd as me,c3 as ge,c4 as be,u as k,I as X,c5 as ie,j as se,c6 as xe,c7 as he}from"./index.d94abe07.js";import{l as B,S as g,r as ve}from"./Utils.7f6f3a6b.js";import{c as Te}from"./utils.4b023c9d.js";import{l as Se}from"./visualVariablesUtils.aff73e6d.js";import{createSymbolSchema as b}from"./createSymbolSchema.e54d2060.js";import{t as we}from"./ExpandedCIM.f0b7f36d.js";import{a8 as Fe}from"./enums.0295eb81.js";import"./MaterialKey.229b1dd6.js";import{e as ne}from"./util.ab699fea.js";function Ee(e){if(!e)return B.NONE;let r=0;for(const i of e)if(i.type==="size"){const t=Se(i);r|=t,i.target==="outline"&&(r|=t<<4)}else i.type==="color"?r|=B.COLOR:i.type==="opacity"?r|=B.OPACITY:i.type==="rotation"&&(r|=B.ROTATION);return r}function Ie(e,r){if(!("visualVariables"in e)||!e.hasVisualVariables("size"))return 0;const i=e.getVisualVariablesForType("size");if(!i[0])return 0;const t=i[0];if(r&&t.field==="cluster_count"&&r.type==="cluster")return r.clusterMaxSize;if(t.target==="outline")return 0;if(t.transformationType==="stops")return t.stops.map(s=>s.size).reduce(A,0);if(t.transformationType==="clamped-linear"){let s=-1/0,n=-1/0;return s=typeof t.maxSize=="number"?t.maxSize:t.maxSize.stops.map(l=>l.size).reduce(A,0),n=typeof t.minSize=="number"?t.minSize:t.minSize.stops.map(l=>l.size).reduce(A,0),Math.max(s,n)}return t.transformationType==="real-world-size"?30:void 0}Fe.metrics,new we(0,0,24,24);function A(e,r){return Math.max(e,r)}const C=8,le=C-2,R=re.getLogger("esri.views.2d.layers.features.support.rendererUtils"),it=e=>{if(!("visualVariables"in e)||!e.visualVariables||!e.visualVariables.length)return e;const r=e.clone(),i=r.visualVariables.map(t=>ae(t)?oe(t):t);return r.visualVariables=i,r};function ze(e){return e.map(r=>ae(r)?oe(r.clone()):r)}function ae(e){return(e.type==="size"||e.type==="color"||e.type==="opacity")&&e.stops!=null}function oe(e){return e.stops=Me(e.type,e.stops),e}function I(e,r,i){return(1-i)*e+i*r}function Ve(e,r){const[i,...t]=r,s=t.pop(),n=t[0].value,l=t[t.length-1].value,u=(l-n)/le,o=[];for(let a=n;a=t[p].value;)p++;const c=t[p],f=r[p-1],F=a-f.value,S=c.value===f.value?1:F/(c.value-f.value);if(e==="color"){const x=t[p],h=r[p-1],m=x.color.clone();m.r=I(h.color.r,m.r,S),m.g=I(h.color.g,m.g,S),m.b=I(h.color.b,m.b,S),m.a=I(h.color.a,m.a,S),o.push({value:a,color:m,label:x.label})}else if(e==="size"){const x=t[p],h=r[p-1],m=Q(x.size),v=I(Q(h.size),m,S);o.push({value:a,size:v,label:x.label})}else{const x=t[p],h=I(r[p-1].opacity,x.opacity,S);o.push({value:a,opacity:h,label:x.label})}}return[i,...o,s]}function Oe(e){const[r,...i]=e,t=i.pop();for(;i.length>le;){let s=0,n=0;for(let l=1;ln&&(n=a,s=l)}i.splice(s,1)}return[r,...i,t]}function Me(e,r){return r.length<=C?r:(R.warn(`Found ${r.length} Visual Variable stops, but MapView only supports ${C}. Displayed stops will be simplified.`),r.length>2*C?Ve(e,r):Oe(r))}function G(){if(D("heatmap-force-raster"))return"raster";const{supportsTextureFloat:e,supportsTextureHalfFloat:r,supportsColorBufferFloat:i,supportsColorBufferFloatBlend:t,supportsColorBufferHalfFloat:s}=U("2d");return e&&i&&t||r&&s?"symbol":D("heatmap-allow-raster-fallback")?"raster":"none"}function st(e){if(!e)return!0;switch(e.type){case"dot-density":if(!U("2d").supportsTextureFloat)return R.error(new d("webgl-missing-extension","Missing WebGL extension OES_Texture_Float which is required for DotDensity")),!1;break;case"heatmap":{const r=G();if(r==="none"||r==="raster"&&!D("heatmap-force-raster")){const i=U("2d"),t=["supportsTextureFloat","supportsTextureHalfFloat","supportsColorBufferFloat","supportsColorBufferFloatBlend","supportsColorBufferHalfFloat"].filter(s=>!i[s]).join(", ");if(r==="none")return R.errorOnce(new d("webgl-missing-extension",`Missing WebGL${i.type} requirements for Heatmap: ${t}`)),!1;r==="raster"&&R.warnOnce(`Missing WebGL${i.type} requirements for accelerated Heatmap: ${t}. Feature support may be limited.`)}break}}return!0}const z=re.getLogger("esri.views.2d.layers.features.schemaUtils"),y="ValidationError";function _(e,r){let i=0,t=0,s=g.DEFAULT;if(w(e)){if(t=Ie(e,r),"visualVariables"in e&&(i=Ee(e.visualVariables||[]),e.type==="dot-density"&&(s=g.DOT_DENSITY)),e.type==="heatmap"&&(s=g.HEATMAP),e.type==="dictionary")return{maxVVSize:t,vvFlags:i,symbologyType:g.DEFAULT};if(e.type==="pie-chart")return{maxVVSize:t,vvFlags:i,symbologyType:g.PIE_CHART};if(s!==g.DOT_DENSITY&&s!==g.HEATMAP){const n=e.getSymbols();"backgroundFillSymbol"in e&&e.backgroundFillSymbol&&n.push(e.backgroundFillSymbol);let l=!0,u=!0;for(const o of n)if(o.type==="cim"&&(u=!1),o.type==="simple-fill"||o.type==="picture-fill"){const a=o.outline,p=a&&a.style!=="none"&&a.style!=="solid",c=o.type==="simple-fill"&&o.style!=="none"&&o.style!=="solid",f=o.type==="picture-fill"||c||p;p&&(l=!1),f&&(u=!1)}l?s=u?g.OUTLINE_FILL_SIMPLE:g.OUTLINE_FILL:u&&(s=g.SIMPLE)}}return{vvFlags:i,maxVVSize:t,symbologyType:s}}let Z=null;function nt(e){if(D("esri-2d-update-debug")){const r=ee(e,!0);console.debug("Created new schema",r),console.debug("Schema diff",ge(Z,r)),Z=r}return ee(e)}function ee(e,r=!1){var i,t;try{const s=Be(e,r),n=De(e),l={};s.map(a=>Ne(l,e,a));const u=w(e.subtypeCode)?`${e.subtypeField} = ${e.subtypeCode}`:null;return{source:{definitionExpression:be(e.definitionExpression,u),fields:e.fields.map(a=>a.toJSON()),gdbVersion:e.gdbVersion,historicMoment:(i=e.historicMoment)==null?void 0:i.getTime(),outFields:e.availableFields,pixelBuffer:e.pixelBuffer,spatialReference:e.spatialReference.toJSON(),timeExtent:(t=e.timeExtent)==null?void 0:t.toJSON(),customParameters:e.customParameters},attributes:{fields:{},indexCount:0},processors:s,tileRenderer:n,targets:l}}catch(s){if(s.fieldName===y)return z.error(s),null;throw s}}function Ne(e,r,i){switch(i.target){case"feature":return void H(e,P(r),i);case"aggregate":{if(!("featureReduction"in r))return;const t=r.featureReduction;switch(t.type){case"selection":throw new d(y,"Mapview does not support `selection` reduction type",t);case"binning":return H(e,P(r),i),void $e(e,t,r.fields.map(s=>s.toJSON()),i);case"cluster":return H(e,P(r),i),void Le(e,t,r.fields.map(s=>s.toJSON()),i)}}}}function W(e,r){for(const i in r){const t=r[i];if(t.target!==e.name)continue;const s=e.attributes[i];s?(s.context.mesh=s.context.mesh||t.context.mesh,s.context.storage=s.context.storage||t.context.storage):e.attributes[i]=t}return e}function P(e){var r,i,t,s,n;return[(i=(r=k(e.filter))==null?void 0:r.toJSON())!=null?i:null,(n=(s=k((t=k(e.featureEffect))==null?void 0:t.filter))==null?void 0:s.toJSON())!=null?n:null]}function H(e,r,i){return e.feature||(e.feature={name:"feature",input:"source",filters:r,attributes:{}}),W(e.feature,i.attributes.fields),e}function ue(e,r){const{onStatisticExpression:i,onStatisticField:t,statisticType:s}=e;switch(s){case"min":case"max":case"avg":case"avg_angle":case"sum":case"count":return"esriFieldTypeDouble";case"mode":{if(i){const{returnType:l}=i;return l?l==="string"?"esriFieldTypeString":"esriFieldTypeDouble":(z.error(new d(y,"Unable to infer type of aggregateField with onStatisticExpression. ReturnType is not defined",e)),"esriFieldTypeString")}const n=r.find(l=>l.name===t);return n?n.type:(z.error(new d(y,"Unable to infer type of aggregateField with onStatisticExpression. ReturnType is not defined",e)),"esriFieldTypeString")}}}function $e(e,r,i,t){var s;return e.aggregate||(e.aggregate={name:"aggregate",type:"bin",filters:null,input:"feature",params:{fixedBinLevel:r.fixedBinLevel,fields:((s=r.fields)!=null?s:[]).map(n=>({...n.toJSON(),type:ue(n,i)}))},attributes:{}}),W(e.aggregate,t.attributes.fields),e}function Le(e,r,i,t){var s,n;return e.aggregate||(e.aggregate={name:"aggregate",type:"cluster",input:"feature",filters:null,attributes:{},params:{clusterRadius:X(r.clusterRadius/2),clusterPixelBuffer:64*Math.ceil(X(r.clusterMaxSize)/64),fields:(n=(s=r.fields)!=null?s:[])==null?void 0:n.map(l=>({...l.toJSON(),type:ue(l,i)}))}}),W(e.aggregate,t.attributes.fields),e}function T(e,r){return r.field?E(e,{...r,type:"field",field:r.field}):r.valueExpression?E(e,{...r,type:"expression",valueExpression:r.valueExpression}):{field:null,fieldIndex:null}}function E(e,r){switch(r.type){case"expression":{const i=r.valueExpression;if(!e.fields[i]){const t=e.indexCount++;e.fields[i]={...r,name:i,fieldIndex:t}}return{fieldIndex:e.fields[i].fieldIndex}}case"label-expression":{const i=JSON.stringify(r.label);if(!e.fields[i]){const t=e.indexCount++;e.fields[i]={...r,name:i,fieldIndex:t}}return{fieldIndex:e.fields[i].fieldIndex}}case"field":{const i=r.field;return r.target==="aggregate"&&e.fields[i]||(e.fields[i]={...r,name:i}),{field:i}}case"statistic":return e.fields[r.name]={...r},{field:r.name}}}function Be(e,r=!1){const i=new Array;let t=0;return i.push(Re(e,t++,r)),i}function J(e,r,i,t,s,n=!1){const l=E(e,{type:"label-expression",target:i,context:{mesh:!0},resultType:"string",label:{labelExpression:r.labelExpression,labelExpressionInfo:r.labelExpressionInfo?{expression:r.labelExpressionInfo.expression}:null,symbol:!!r.symbol,where:r.where}}),{fieldIndex:u}=l;return{...b(r,s,n),fieldIndex:u,target:i,index:t}}function Ce(e,r,i){var p,c;const t="featureReduction"in r&&r.featureReduction;if(!t)return{fields:[],labels:[],matcher:null,rendererOverride:null};const s="aggregate",n=[];let l=null,u=ne(r.geometryType),o=[],a=null;if(t)switch(t.type){case"selection":return z.error(new d(y,"Mapview does not support `selection` reduction type",t)),{fields:[],labels:[],matcher:null,rendererOverride:null};case"cluster":case"binning":if(n.push(...(p=t.fields)!=null?p:[]),t.type==="cluster"?u="esriGeometryPoint":t.type==="binning"&&(u="esriGeometryPolygon"),t.renderer&&!((c=t.renderer.authoringInfo)!=null&&c.isAutoGenerated)){if(t.type==="cluster"){const{renderer:F}=xe(t.renderer,t,null);a=F}else a=t.renderer;const f=_(t.renderer,t);l=q(null,s,t.renderer,f,i),o=t&&t.labelsVisible&&t.labelingInfo||[]}else if(t.type==="cluster"){if(a=he(n,r.renderer,t,null,!0),t.symbol){const f=_(a,t);l={type:"simple",symbol:b(t.symbol,f,i),symbologyType:f.symbologyType}}o=t&&t.labelsVisible&&t.labelingInfo||[]}}return Ae(e,n),{labels:ie(o,t.type==="binning"?"esriGeometryPolygon":u),matcher:l,fields:n,rendererOverride:a}}function Re(e,r,i=!1){var m;const t={indexCount:0,fields:{}},s="featureReduction"in e&&e.featureReduction,n=s?"aggregate":"feature";if("sublayers"in e){const v={type:"subtype",subtypeField:e.subtypeField,renderers:{},symbologyType:g.DEFAULT},$={type:"subtype",mapping:{},target:"feature"},L={type:"subtype",classes:{}},pe={type:"symbol",target:"feature",aggregateFields:[],attributes:t,storage:$,mesh:{matcher:v,aggregateMatcher:null,labels:L,sortKey:null}},Y=new Set;let fe=0;for(const{renderer:V,subtypeCode:O,labelingInfo:ce,labelsVisible:de}of e.sublayers){const j={symbologyType:g.DEFAULT,vvFlags:0,maxVVSize:0},M=q(t,n,V,j,i),N=te(t,n,V),K=de&&ce;if("visualVariables"in V&&V.visualVariables&&V.visualVariables.length)throw new d(y,"Visual variables are currently not supported for subtype layers");if(M.type==="dictionary")throw new d(y,"Dictionary renderer is not supported in subtype layers");if(M.type==="subtype")throw new d(y,"Nested subtype renderers is not supported");if(w(N)&&N.type==="subtype")throw new d(y,"Nested subtype storage is not supported");if(w(N)&&w(N.attributeMapping))throw new d(y,"Non-visual-variable attributes are not supported in subtype layers");if(M.type==="heatmap")throw new d(y,"Heatmaps are not supported in subtype layers");if(M.type==="pie-chart")throw new d(y,"Pie-charts are not supported in subtype layers");if(Y.has(O))throw new d(y,"Subtype codes for sublayers must be unique");Y.add(O),v.renderers[O]=M,$.mapping[O]=N,K&&(L.classes[O]=K.map(ye=>J(t,ye,"feature",fe++,j,i)))}return pe}if(e.renderer.type==="heatmap"&&G()==="raster"){const{radius:v,fieldOffset:$,field:L}=e.renderer;return{type:"heatmap",aggregateFields:[],attributes:t,target:n,storage:null,mesh:{radius:v,fieldOffset:$,field:T(t,{target:n,field:L,resultType:"numeric"}).field}}}const l=Ce(t,e,i),u=ne(e.geometryType),o=(m=l.rendererOverride)!=null?m:e.renderer,a=_(o,s),p=q(t,n,o,a,i),c=te(t,n,o),f=ke(t,e.orderBy,s),F=e.labelsVisible&&e.labelingInfo||[],S=ie(F,u);let x=0;const h=[...S.map(v=>J(t,v,"feature",x++,a,i)),...l.labels.map(v=>J(t,v,"aggregate",x++,a,i))];return{type:"symbol",target:n,attributes:t,aggregateFields:l.fields,storage:c,mesh:{matcher:p,labels:{type:"simple",classes:h},aggregateMatcher:l.matcher,sortKey:f}}}function De(e){var r;return((r=e.renderer)==null?void 0:r.type)==="heatmap"&&G()==="raster"?{type:"heatmap"}:{type:"symbol"}}function ke(e,r,i){if(w(i)||se(r)||!r.length)return null;r.length>1&&z.warn(`Layer rendering currently only supports ordering by 1 orderByInfo, but found ${r.length}. All but the first will be discarded`);const t=r[0],s=t.order==="ascending"?"asc":"desc";return t.field?{field:t.field,order:s}:t.valueExpression?{fieldIndex:E(e,{type:"expression",target:"feature",valueExpression:t.valueExpression,resultType:"numeric"}).fieldIndex,order:s}:(z.error(new d(y,"Expected to find a field or valueExpression for OrderByInfo",t)),null)}function Ae(e,r){const i={mesh:!0,storage:!0};for(const t of r){const{name:s,onStatisticField:n,onStatisticExpression:l,statisticType:u}=t;let o=null,a=null;const p="numeric",c="feature";l?a=E(e,{type:"expression",target:c,valueExpression:l.expression,resultType:p}).fieldIndex:o=E(e,{type:"field",target:c,field:n,resultType:p}).field,E(e,{type:"statistic",target:"aggregate",name:s,context:i,inField:o,inFieldIndex:a,statisticType:u})}}function te(e,r,i){let t;switch(i.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":t={visualVariables:!0,attributes:null};break;default:t=Te(i).getStorageSpec(i)}return Pe(e,r,t,i)}function Pe(e,r,i,t){if(se(i))return null;const{visualVariables:s,attributes:n}=i;let l=null;s&&"visualVariables"in t&&(l=He(e,r,t.visualVariables));const u=w(l)?4:0;let o=null;return w(n)&&(o=n.map((a,p)=>{const{field:c,fieldIndex:f}=T(e,{valueExpression:a.valueExpression,field:a.field,resultType:"numeric",target:r});return{binding:p+u,field:c,fieldIndex:f}})),{type:"simple",target:r,attributeMapping:o,vvMapping:l}}function He(e,r,i){if(!i||!i.length)return[];const t={storage:!0},s="numeric";return ze(i).map(n=>{var a;const l=ve(n.type),{field:u,fieldIndex:o}=T(e,{target:r,valueExpression:n.valueExpression,field:n.field,context:t,resultType:s});switch(n.type){case"size":return n.valueExpression==="$view.scale"?null:{type:"size",binding:l,field:u,fieldIndex:o,normalizationField:T(e,{target:r,field:n.normalizationField,context:t,resultType:s}).field,valueRepresentation:(a=n.valueRepresentation)!=null?a:null};case"color":return{type:"color",binding:l,field:u,fieldIndex:o,normalizationField:T(e,{target:r,field:n.normalizationField,context:t,resultType:s}).field};case"opacity":return{type:"opacity",binding:l,field:u,fieldIndex:o,normalizationField:T(e,{target:r,field:n.normalizationField,context:t,resultType:s}).field};case"rotation":return{type:"rotation",binding:l,field:u,fieldIndex:o}}}).filter(n=>n)}function q(e,r,i,t,s=!1){const n=me(e,{indexCount:0,fields:{}});switch(i.type){case"simple":case"dot-density":return Je(n,i,t,s);case"class-breaks":return _e(n,r,i,t,s);case"unique-value":return qe(n,r,i,t,s);case"dictionary":return Ge(n,i,t,s);case"heatmap":return We(n,i,t,s);case"pie-chart":return Ue(n,i,t,s)}}function Je(e,r,i,t=!1){const s=r.getSymbols(),n=s.length?s[0]:null;return{type:"simple",symbol:b(n,i,t),symbologyType:i.symbologyType}}function Ue(e,r,i,t=!1){const s=r.getSymbols(),n=s[0],l=s.length>1?s[1]:null;return{type:"pie-chart",markerSymbol:b(n,i,t),fillSymbol:b(l,i,t),symbologyType:i.symbologyType}}function _e(e,r,i,t,s=!1){const n={mesh:!0,use:"renderer.field"},l=i.backgroundFillSymbol,{field:u,fieldIndex:o}=T(e,{target:r,field:i.field,valueExpression:i.valueExpression,resultType:"numeric",context:n}),a=i.normalizationType,p=a==="log"?"esriNormalizeByLog":a==="percent-of-total"?"esriNormalizeByPercentOfTotal":a==="field"?"esriNormalizeByField":null,c=i.classBreakInfos.map(f=>({symbol:b(f.symbol,t,s),min:f.minValue,max:f.maxValue})).sort((f,F)=>f.min-F.min);return{type:"interval",attributes:e.fields,field:u,fieldIndex:o,backgroundFillSymbol:b(l,t,s),defaultSymbol:b(i.defaultSymbol,t,s),intervals:c,normalizationField:i.normalizationField,normalizationTotal:i.normalizationTotal,normalizationType:p,isMaxInclusive:i.isMaxInclusive,symbologyType:t.symbologyType}}function qe(e,r,i,t,s=!1){const n=[],l=i.backgroundFillSymbol,u={target:r,context:{mesh:!0},resultType:"string"};if(i.field&&typeof i.field!="string")throw new d(y,"Expected renderer.field to be a string",i);const{field:o,fieldIndex:a}=T(e,{...u,field:i.field,valueExpression:i.valueExpression});for(const p of i.uniqueValueInfos)n.push({value:""+p.value,symbol:b(p.symbol,t,s)});return{type:"map",attributes:e.fields,field:o,fieldIndex:a,field2:T(e,{...u,field:i.field2}).field,field3:T(e,{...u,field:i.field3}).field,fieldDelimiter:i.fieldDelimiter,backgroundFillSymbol:b(l,t),defaultSymbol:b(i.defaultSymbol,t),map:n,symbologyType:t.symbologyType}}function Ge(e,r,i,t=!1){return{type:"dictionary",config:r.config,fieldMap:r.fieldMap,scaleExpression:r.scaleExpression,url:r.url,symbolOptions:i,symbologyType:i.symbologyType}}function We(e,r,i,t=!1){const s=r.getSymbols(),n=s.length?s[0]:null;return{type:"heatmap",symbol:b(n,i,t),symbologyType:i.symbologyType}}export{q as $,nt as F,st as h,it as n,_ as w}; +import{s as re,m as D,aQ as U,n as d,bQ as Q,c as w,bd as me,c3 as ge,c4 as be,u as k,I as X,c5 as ie,j as se,c6 as xe,c7 as he}from"./index.221827cd.js";import{l as B,S as g,r as ve}from"./Utils.2136650a.js";import{c as Te}from"./utils.0160becb.js";import{l as Se}from"./visualVariablesUtils.62efda9d.js";import{createSymbolSchema as b}from"./createSymbolSchema.827eb617.js";import{t as we}from"./ExpandedCIM.a372ce74.js";import{a8 as Fe}from"./enums.0295eb81.js";import"./MaterialKey.0cadabc1.js";import{e as ne}from"./util.520a352e.js";function Ee(e){if(!e)return B.NONE;let r=0;for(const i of e)if(i.type==="size"){const t=Se(i);r|=t,i.target==="outline"&&(r|=t<<4)}else i.type==="color"?r|=B.COLOR:i.type==="opacity"?r|=B.OPACITY:i.type==="rotation"&&(r|=B.ROTATION);return r}function Ie(e,r){if(!("visualVariables"in e)||!e.hasVisualVariables("size"))return 0;const i=e.getVisualVariablesForType("size");if(!i[0])return 0;const t=i[0];if(r&&t.field==="cluster_count"&&r.type==="cluster")return r.clusterMaxSize;if(t.target==="outline")return 0;if(t.transformationType==="stops")return t.stops.map(s=>s.size).reduce(A,0);if(t.transformationType==="clamped-linear"){let s=-1/0,n=-1/0;return s=typeof t.maxSize=="number"?t.maxSize:t.maxSize.stops.map(l=>l.size).reduce(A,0),n=typeof t.minSize=="number"?t.minSize:t.minSize.stops.map(l=>l.size).reduce(A,0),Math.max(s,n)}return t.transformationType==="real-world-size"?30:void 0}Fe.metrics,new we(0,0,24,24);function A(e,r){return Math.max(e,r)}const C=8,le=C-2,R=re.getLogger("esri.views.2d.layers.features.support.rendererUtils"),it=e=>{if(!("visualVariables"in e)||!e.visualVariables||!e.visualVariables.length)return e;const r=e.clone(),i=r.visualVariables.map(t=>ae(t)?oe(t):t);return r.visualVariables=i,r};function ze(e){return e.map(r=>ae(r)?oe(r.clone()):r)}function ae(e){return(e.type==="size"||e.type==="color"||e.type==="opacity")&&e.stops!=null}function oe(e){return e.stops=Me(e.type,e.stops),e}function I(e,r,i){return(1-i)*e+i*r}function Ve(e,r){const[i,...t]=r,s=t.pop(),n=t[0].value,l=t[t.length-1].value,u=(l-n)/le,o=[];for(let a=n;a=t[p].value;)p++;const c=t[p],f=r[p-1],F=a-f.value,S=c.value===f.value?1:F/(c.value-f.value);if(e==="color"){const x=t[p],h=r[p-1],m=x.color.clone();m.r=I(h.color.r,m.r,S),m.g=I(h.color.g,m.g,S),m.b=I(h.color.b,m.b,S),m.a=I(h.color.a,m.a,S),o.push({value:a,color:m,label:x.label})}else if(e==="size"){const x=t[p],h=r[p-1],m=Q(x.size),v=I(Q(h.size),m,S);o.push({value:a,size:v,label:x.label})}else{const x=t[p],h=I(r[p-1].opacity,x.opacity,S);o.push({value:a,opacity:h,label:x.label})}}return[i,...o,s]}function Oe(e){const[r,...i]=e,t=i.pop();for(;i.length>le;){let s=0,n=0;for(let l=1;ln&&(n=a,s=l)}i.splice(s,1)}return[r,...i,t]}function Me(e,r){return r.length<=C?r:(R.warn(`Found ${r.length} Visual Variable stops, but MapView only supports ${C}. Displayed stops will be simplified.`),r.length>2*C?Ve(e,r):Oe(r))}function G(){if(D("heatmap-force-raster"))return"raster";const{supportsTextureFloat:e,supportsTextureHalfFloat:r,supportsColorBufferFloat:i,supportsColorBufferFloatBlend:t,supportsColorBufferHalfFloat:s}=U("2d");return e&&i&&t||r&&s?"symbol":D("heatmap-allow-raster-fallback")?"raster":"none"}function st(e){if(!e)return!0;switch(e.type){case"dot-density":if(!U("2d").supportsTextureFloat)return R.error(new d("webgl-missing-extension","Missing WebGL extension OES_Texture_Float which is required for DotDensity")),!1;break;case"heatmap":{const r=G();if(r==="none"||r==="raster"&&!D("heatmap-force-raster")){const i=U("2d"),t=["supportsTextureFloat","supportsTextureHalfFloat","supportsColorBufferFloat","supportsColorBufferFloatBlend","supportsColorBufferHalfFloat"].filter(s=>!i[s]).join(", ");if(r==="none")return R.errorOnce(new d("webgl-missing-extension",`Missing WebGL${i.type} requirements for Heatmap: ${t}`)),!1;r==="raster"&&R.warnOnce(`Missing WebGL${i.type} requirements for accelerated Heatmap: ${t}. Feature support may be limited.`)}break}}return!0}const z=re.getLogger("esri.views.2d.layers.features.schemaUtils"),y="ValidationError";function _(e,r){let i=0,t=0,s=g.DEFAULT;if(w(e)){if(t=Ie(e,r),"visualVariables"in e&&(i=Ee(e.visualVariables||[]),e.type==="dot-density"&&(s=g.DOT_DENSITY)),e.type==="heatmap"&&(s=g.HEATMAP),e.type==="dictionary")return{maxVVSize:t,vvFlags:i,symbologyType:g.DEFAULT};if(e.type==="pie-chart")return{maxVVSize:t,vvFlags:i,symbologyType:g.PIE_CHART};if(s!==g.DOT_DENSITY&&s!==g.HEATMAP){const n=e.getSymbols();"backgroundFillSymbol"in e&&e.backgroundFillSymbol&&n.push(e.backgroundFillSymbol);let l=!0,u=!0;for(const o of n)if(o.type==="cim"&&(u=!1),o.type==="simple-fill"||o.type==="picture-fill"){const a=o.outline,p=a&&a.style!=="none"&&a.style!=="solid",c=o.type==="simple-fill"&&o.style!=="none"&&o.style!=="solid",f=o.type==="picture-fill"||c||p;p&&(l=!1),f&&(u=!1)}l?s=u?g.OUTLINE_FILL_SIMPLE:g.OUTLINE_FILL:u&&(s=g.SIMPLE)}}return{vvFlags:i,maxVVSize:t,symbologyType:s}}let Z=null;function nt(e){if(D("esri-2d-update-debug")){const r=ee(e,!0);console.debug("Created new schema",r),console.debug("Schema diff",ge(Z,r)),Z=r}return ee(e)}function ee(e,r=!1){var i,t;try{const s=Be(e,r),n=De(e),l={};s.map(a=>Ne(l,e,a));const u=w(e.subtypeCode)?`${e.subtypeField} = ${e.subtypeCode}`:null;return{source:{definitionExpression:be(e.definitionExpression,u),fields:e.fields.map(a=>a.toJSON()),gdbVersion:e.gdbVersion,historicMoment:(i=e.historicMoment)==null?void 0:i.getTime(),outFields:e.availableFields,pixelBuffer:e.pixelBuffer,spatialReference:e.spatialReference.toJSON(),timeExtent:(t=e.timeExtent)==null?void 0:t.toJSON(),customParameters:e.customParameters},attributes:{fields:{},indexCount:0},processors:s,tileRenderer:n,targets:l}}catch(s){if(s.fieldName===y)return z.error(s),null;throw s}}function Ne(e,r,i){switch(i.target){case"feature":return void H(e,P(r),i);case"aggregate":{if(!("featureReduction"in r))return;const t=r.featureReduction;switch(t.type){case"selection":throw new d(y,"Mapview does not support `selection` reduction type",t);case"binning":return H(e,P(r),i),void $e(e,t,r.fields.map(s=>s.toJSON()),i);case"cluster":return H(e,P(r),i),void Le(e,t,r.fields.map(s=>s.toJSON()),i)}}}}function W(e,r){for(const i in r){const t=r[i];if(t.target!==e.name)continue;const s=e.attributes[i];s?(s.context.mesh=s.context.mesh||t.context.mesh,s.context.storage=s.context.storage||t.context.storage):e.attributes[i]=t}return e}function P(e){var r,i,t,s,n;return[(i=(r=k(e.filter))==null?void 0:r.toJSON())!=null?i:null,(n=(s=k((t=k(e.featureEffect))==null?void 0:t.filter))==null?void 0:s.toJSON())!=null?n:null]}function H(e,r,i){return e.feature||(e.feature={name:"feature",input:"source",filters:r,attributes:{}}),W(e.feature,i.attributes.fields),e}function ue(e,r){const{onStatisticExpression:i,onStatisticField:t,statisticType:s}=e;switch(s){case"min":case"max":case"avg":case"avg_angle":case"sum":case"count":return"esriFieldTypeDouble";case"mode":{if(i){const{returnType:l}=i;return l?l==="string"?"esriFieldTypeString":"esriFieldTypeDouble":(z.error(new d(y,"Unable to infer type of aggregateField with onStatisticExpression. ReturnType is not defined",e)),"esriFieldTypeString")}const n=r.find(l=>l.name===t);return n?n.type:(z.error(new d(y,"Unable to infer type of aggregateField with onStatisticExpression. ReturnType is not defined",e)),"esriFieldTypeString")}}}function $e(e,r,i,t){var s;return e.aggregate||(e.aggregate={name:"aggregate",type:"bin",filters:null,input:"feature",params:{fixedBinLevel:r.fixedBinLevel,fields:((s=r.fields)!=null?s:[]).map(n=>({...n.toJSON(),type:ue(n,i)}))},attributes:{}}),W(e.aggregate,t.attributes.fields),e}function Le(e,r,i,t){var s,n;return e.aggregate||(e.aggregate={name:"aggregate",type:"cluster",input:"feature",filters:null,attributes:{},params:{clusterRadius:X(r.clusterRadius/2),clusterPixelBuffer:64*Math.ceil(X(r.clusterMaxSize)/64),fields:(n=(s=r.fields)!=null?s:[])==null?void 0:n.map(l=>({...l.toJSON(),type:ue(l,i)}))}}),W(e.aggregate,t.attributes.fields),e}function T(e,r){return r.field?E(e,{...r,type:"field",field:r.field}):r.valueExpression?E(e,{...r,type:"expression",valueExpression:r.valueExpression}):{field:null,fieldIndex:null}}function E(e,r){switch(r.type){case"expression":{const i=r.valueExpression;if(!e.fields[i]){const t=e.indexCount++;e.fields[i]={...r,name:i,fieldIndex:t}}return{fieldIndex:e.fields[i].fieldIndex}}case"label-expression":{const i=JSON.stringify(r.label);if(!e.fields[i]){const t=e.indexCount++;e.fields[i]={...r,name:i,fieldIndex:t}}return{fieldIndex:e.fields[i].fieldIndex}}case"field":{const i=r.field;return r.target==="aggregate"&&e.fields[i]||(e.fields[i]={...r,name:i}),{field:i}}case"statistic":return e.fields[r.name]={...r},{field:r.name}}}function Be(e,r=!1){const i=new Array;let t=0;return i.push(Re(e,t++,r)),i}function J(e,r,i,t,s,n=!1){const l=E(e,{type:"label-expression",target:i,context:{mesh:!0},resultType:"string",label:{labelExpression:r.labelExpression,labelExpressionInfo:r.labelExpressionInfo?{expression:r.labelExpressionInfo.expression}:null,symbol:!!r.symbol,where:r.where}}),{fieldIndex:u}=l;return{...b(r,s,n),fieldIndex:u,target:i,index:t}}function Ce(e,r,i){var p,c;const t="featureReduction"in r&&r.featureReduction;if(!t)return{fields:[],labels:[],matcher:null,rendererOverride:null};const s="aggregate",n=[];let l=null,u=ne(r.geometryType),o=[],a=null;if(t)switch(t.type){case"selection":return z.error(new d(y,"Mapview does not support `selection` reduction type",t)),{fields:[],labels:[],matcher:null,rendererOverride:null};case"cluster":case"binning":if(n.push(...(p=t.fields)!=null?p:[]),t.type==="cluster"?u="esriGeometryPoint":t.type==="binning"&&(u="esriGeometryPolygon"),t.renderer&&!((c=t.renderer.authoringInfo)!=null&&c.isAutoGenerated)){if(t.type==="cluster"){const{renderer:F}=xe(t.renderer,t,null);a=F}else a=t.renderer;const f=_(t.renderer,t);l=q(null,s,t.renderer,f,i),o=t&&t.labelsVisible&&t.labelingInfo||[]}else if(t.type==="cluster"){if(a=he(n,r.renderer,t,null,!0),t.symbol){const f=_(a,t);l={type:"simple",symbol:b(t.symbol,f,i),symbologyType:f.symbologyType}}o=t&&t.labelsVisible&&t.labelingInfo||[]}}return Ae(e,n),{labels:ie(o,t.type==="binning"?"esriGeometryPolygon":u),matcher:l,fields:n,rendererOverride:a}}function Re(e,r,i=!1){var m;const t={indexCount:0,fields:{}},s="featureReduction"in e&&e.featureReduction,n=s?"aggregate":"feature";if("sublayers"in e){const v={type:"subtype",subtypeField:e.subtypeField,renderers:{},symbologyType:g.DEFAULT},$={type:"subtype",mapping:{},target:"feature"},L={type:"subtype",classes:{}},pe={type:"symbol",target:"feature",aggregateFields:[],attributes:t,storage:$,mesh:{matcher:v,aggregateMatcher:null,labels:L,sortKey:null}},Y=new Set;let fe=0;for(const{renderer:V,subtypeCode:O,labelingInfo:ce,labelsVisible:de}of e.sublayers){const j={symbologyType:g.DEFAULT,vvFlags:0,maxVVSize:0},M=q(t,n,V,j,i),N=te(t,n,V),K=de&&ce;if("visualVariables"in V&&V.visualVariables&&V.visualVariables.length)throw new d(y,"Visual variables are currently not supported for subtype layers");if(M.type==="dictionary")throw new d(y,"Dictionary renderer is not supported in subtype layers");if(M.type==="subtype")throw new d(y,"Nested subtype renderers is not supported");if(w(N)&&N.type==="subtype")throw new d(y,"Nested subtype storage is not supported");if(w(N)&&w(N.attributeMapping))throw new d(y,"Non-visual-variable attributes are not supported in subtype layers");if(M.type==="heatmap")throw new d(y,"Heatmaps are not supported in subtype layers");if(M.type==="pie-chart")throw new d(y,"Pie-charts are not supported in subtype layers");if(Y.has(O))throw new d(y,"Subtype codes for sublayers must be unique");Y.add(O),v.renderers[O]=M,$.mapping[O]=N,K&&(L.classes[O]=K.map(ye=>J(t,ye,"feature",fe++,j,i)))}return pe}if(e.renderer.type==="heatmap"&&G()==="raster"){const{radius:v,fieldOffset:$,field:L}=e.renderer;return{type:"heatmap",aggregateFields:[],attributes:t,target:n,storage:null,mesh:{radius:v,fieldOffset:$,field:T(t,{target:n,field:L,resultType:"numeric"}).field}}}const l=Ce(t,e,i),u=ne(e.geometryType),o=(m=l.rendererOverride)!=null?m:e.renderer,a=_(o,s),p=q(t,n,o,a,i),c=te(t,n,o),f=ke(t,e.orderBy,s),F=e.labelsVisible&&e.labelingInfo||[],S=ie(F,u);let x=0;const h=[...S.map(v=>J(t,v,"feature",x++,a,i)),...l.labels.map(v=>J(t,v,"aggregate",x++,a,i))];return{type:"symbol",target:n,attributes:t,aggregateFields:l.fields,storage:c,mesh:{matcher:p,labels:{type:"simple",classes:h},aggregateMatcher:l.matcher,sortKey:f}}}function De(e){var r;return((r=e.renderer)==null?void 0:r.type)==="heatmap"&&G()==="raster"?{type:"heatmap"}:{type:"symbol"}}function ke(e,r,i){if(w(i)||se(r)||!r.length)return null;r.length>1&&z.warn(`Layer rendering currently only supports ordering by 1 orderByInfo, but found ${r.length}. All but the first will be discarded`);const t=r[0],s=t.order==="ascending"?"asc":"desc";return t.field?{field:t.field,order:s}:t.valueExpression?{fieldIndex:E(e,{type:"expression",target:"feature",valueExpression:t.valueExpression,resultType:"numeric"}).fieldIndex,order:s}:(z.error(new d(y,"Expected to find a field or valueExpression for OrderByInfo",t)),null)}function Ae(e,r){const i={mesh:!0,storage:!0};for(const t of r){const{name:s,onStatisticField:n,onStatisticExpression:l,statisticType:u}=t;let o=null,a=null;const p="numeric",c="feature";l?a=E(e,{type:"expression",target:c,valueExpression:l.expression,resultType:p}).fieldIndex:o=E(e,{type:"field",target:c,field:n,resultType:p}).field,E(e,{type:"statistic",target:"aggregate",name:s,context:i,inField:o,inFieldIndex:a,statisticType:u})}}function te(e,r,i){let t;switch(i.type){case"simple":case"class-breaks":case"unique-value":case"dictionary":t={visualVariables:!0,attributes:null};break;default:t=Te(i).getStorageSpec(i)}return Pe(e,r,t,i)}function Pe(e,r,i,t){if(se(i))return null;const{visualVariables:s,attributes:n}=i;let l=null;s&&"visualVariables"in t&&(l=He(e,r,t.visualVariables));const u=w(l)?4:0;let o=null;return w(n)&&(o=n.map((a,p)=>{const{field:c,fieldIndex:f}=T(e,{valueExpression:a.valueExpression,field:a.field,resultType:"numeric",target:r});return{binding:p+u,field:c,fieldIndex:f}})),{type:"simple",target:r,attributeMapping:o,vvMapping:l}}function He(e,r,i){if(!i||!i.length)return[];const t={storage:!0},s="numeric";return ze(i).map(n=>{var a;const l=ve(n.type),{field:u,fieldIndex:o}=T(e,{target:r,valueExpression:n.valueExpression,field:n.field,context:t,resultType:s});switch(n.type){case"size":return n.valueExpression==="$view.scale"?null:{type:"size",binding:l,field:u,fieldIndex:o,normalizationField:T(e,{target:r,field:n.normalizationField,context:t,resultType:s}).field,valueRepresentation:(a=n.valueRepresentation)!=null?a:null};case"color":return{type:"color",binding:l,field:u,fieldIndex:o,normalizationField:T(e,{target:r,field:n.normalizationField,context:t,resultType:s}).field};case"opacity":return{type:"opacity",binding:l,field:u,fieldIndex:o,normalizationField:T(e,{target:r,field:n.normalizationField,context:t,resultType:s}).field};case"rotation":return{type:"rotation",binding:l,field:u,fieldIndex:o}}}).filter(n=>n)}function q(e,r,i,t,s=!1){const n=me(e,{indexCount:0,fields:{}});switch(i.type){case"simple":case"dot-density":return Je(n,i,t,s);case"class-breaks":return _e(n,r,i,t,s);case"unique-value":return qe(n,r,i,t,s);case"dictionary":return Ge(n,i,t,s);case"heatmap":return We(n,i,t,s);case"pie-chart":return Ue(n,i,t,s)}}function Je(e,r,i,t=!1){const s=r.getSymbols(),n=s.length?s[0]:null;return{type:"simple",symbol:b(n,i,t),symbologyType:i.symbologyType}}function Ue(e,r,i,t=!1){const s=r.getSymbols(),n=s[0],l=s.length>1?s[1]:null;return{type:"pie-chart",markerSymbol:b(n,i,t),fillSymbol:b(l,i,t),symbologyType:i.symbologyType}}function _e(e,r,i,t,s=!1){const n={mesh:!0,use:"renderer.field"},l=i.backgroundFillSymbol,{field:u,fieldIndex:o}=T(e,{target:r,field:i.field,valueExpression:i.valueExpression,resultType:"numeric",context:n}),a=i.normalizationType,p=a==="log"?"esriNormalizeByLog":a==="percent-of-total"?"esriNormalizeByPercentOfTotal":a==="field"?"esriNormalizeByField":null,c=i.classBreakInfos.map(f=>({symbol:b(f.symbol,t,s),min:f.minValue,max:f.maxValue})).sort((f,F)=>f.min-F.min);return{type:"interval",attributes:e.fields,field:u,fieldIndex:o,backgroundFillSymbol:b(l,t,s),defaultSymbol:b(i.defaultSymbol,t,s),intervals:c,normalizationField:i.normalizationField,normalizationTotal:i.normalizationTotal,normalizationType:p,isMaxInclusive:i.isMaxInclusive,symbologyType:t.symbologyType}}function qe(e,r,i,t,s=!1){const n=[],l=i.backgroundFillSymbol,u={target:r,context:{mesh:!0},resultType:"string"};if(i.field&&typeof i.field!="string")throw new d(y,"Expected renderer.field to be a string",i);const{field:o,fieldIndex:a}=T(e,{...u,field:i.field,valueExpression:i.valueExpression});for(const p of i.uniqueValueInfos)n.push({value:""+p.value,symbol:b(p.symbol,t,s)});return{type:"map",attributes:e.fields,field:o,fieldIndex:a,field2:T(e,{...u,field:i.field2}).field,field3:T(e,{...u,field:i.field3}).field,fieldDelimiter:i.fieldDelimiter,backgroundFillSymbol:b(l,t),defaultSymbol:b(i.defaultSymbol,t),map:n,symbologyType:t.symbologyType}}function Ge(e,r,i,t=!1){return{type:"dictionary",config:r.config,fieldMap:r.fieldMap,scaleExpression:r.scaleExpression,url:r.url,symbolOptions:i,symbologyType:i.symbologyType}}function We(e,r,i,t=!1){const s=r.getSymbols(),n=s.length?s[0]:null;return{type:"heatmap",symbol:b(n,i,t),symbologyType:i.symbologyType}}export{q as $,nt as F,st as h,it as n,_ as w}; diff --git a/assets/schemaValidator.49ec0b34.js b/assets/schemaValidator.90689324.js similarity index 99% rename from assets/schemaValidator.49ec0b34.js rename to assets/schemaValidator.90689324.js index 4c61d85..6492793 100644 --- a/assets/schemaValidator.49ec0b34.js +++ b/assets/schemaValidator.90689324.js @@ -1,4 +1,4 @@ -import{n as Qe}from"./index.d94abe07.js";import{o as Ke,n as ke}from"./_commonjsHelpers.773c2c82.js";var Be,We={exports:{}};Be=function(){return function A($,C,e){function l(m,h){if(!C[m]){if(!$[m]){var j=typeof ke=="function"&&ke;if(!h&&j)return j(m,!0);if(t)return t(m,!0);var g=new Error("Cannot find module '"+m+"'");throw g.code="MODULE_NOT_FOUND",g}var o=C[m]={exports:{}};$[m][0].call(o.exports,function(c){return l($[m][1][c]||c)},o,o.exports,A,$,C,e)}return C[m].exports}for(var t=typeof ke=="function"&&ke,i=0;i%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,g=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,o=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,c=/^(?:\/(?:[^~/]|~0|~1)*)*$/,v=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,s=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function u(P){return P=P=="full"?"full":"fast",e.copy(u[P])}function p(P){var x=P.match(l);if(!x)return!1;var _,n=+x[1],S=+x[2],L=+x[3];return 1<=S&&S<=12&&1<=L&&L<=(S!=2||(_=n)%4!=0||_%100==0&&_%400!=0?t[S]:29)}function a(P,x){var _=P.match(i);if(!_)return!1;var n=_[1],S=_[2],L=_[3],D=_[5];return(n<=23&&S<=59&&L<=59||n==23&&S==59&&L==60)&&(!x||D)}($.exports=u).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":j,url:g,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:m,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:I,uuid:o,"json-pointer":c,"json-pointer-uri-fragment":v,"relative-json-pointer":s},u.full={date:p,time:a,"date-time":function(P){var x=P.split(b);return x.length==2&&p(x[0])&&a(x[1],!0)},uri:function(P){return f.test(P)&&h.test(P)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":j,url:g,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:m,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:I,uuid:o,"json-pointer":c,"json-pointer-uri-fragment":v,"relative-json-pointer":s};var b=/t|\s/i,f=/\/|:/,y=/[^\\]\\Z/;function I(P){if(y.test(P))return!1;try{return new RegExp(P),!0}catch{return!1}}},{"./util":10}],5:[function(A,$,C){var e=A("./resolve"),l=A("./util"),t=A("./error_classes"),i=A("fast-json-stable-stringify"),m=A("../dotjs/validate"),h=l.ucs2length,j=A("fast-deep-equal"),g=t.Validation;function o(b,f,y,I){var P=this,x=this._opts,_=[void 0],n={},S=[],L={},D=[],E={},q=[],O=function(k,z,Q){var te=c.call(this,k,z,Q);return 0<=te?{index:te,compiling:!0}:(te=this._compilations.length,this._compilations[te]={schema:k,root:z,baseId:Q},{index:te,compiling:!1})}.call(this,b,f=f||{schema:b,refVal:_,refs:n},I),M=this._compilations[O.index];if(O.compiling)return M.callValidate=J;var H=this._formats,N=this.RULES;try{var W=he(b,f,y,I);M.validate=W;var Y=M.callValidate;return Y&&(Y.schema=W.schema,Y.errors=null,Y.refs=W.refs,Y.refVal=W.refVal,Y.root=W.root,Y.$async=W.$async,x.sourceCode&&(Y.source=W.source)),W}finally{(function(k,z,Q){var te=c.call(this,k,z,Q);0<=te&&this._compilations.splice(te,1)}).call(this,b,f,I)}function J(){var k=M.validate,z=k.apply(this,arguments);return J.errors=k.errors,z}function he(k,z,Q,te){var pe=!z||z&&z.schema==k;if(z.schema!=f.schema)return o.call(P,k,z,Q,te);var ue=k.$async===!0,ne=m({isTop:!0,schema:k,isRoot:pe,baseId:te,root:z,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:t.MissingRef,RULES:N,validate:m,util:l,resolve:e,resolveRef:ae,usePattern:ve,useDefault:re,useCustomRule:Se,opts:x,formats:H,logger:P.logger,self:P});ne=a(_,u)+a(S,v)+a(D,s)+a(q,p)+ne,x.processCode&&(ne=x.processCode(ne,k));try{var K=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",ne)(P,N,H,f,_,D,q,j,h,g);_[0]=K}catch(fe){throw P.logger.error("Error compiling schema, function code:",ne),fe}return K.schema=k,K.errors=null,K.refs=n,K.refVal=_,K.root=pe?K:z,ue&&(K.$async=!0),x.sourceCode===!0&&(K.source={code:ne,patterns:S,defaults:D}),K}function ae(k,z,Q){z=e.url(k,z);var te,pe,ue=n[z];if(ue!==void 0)return ye(te=_[ue],pe="refVal["+ue+"]");if(!Q&&f.refs){var ne=f.refs[z];if(ne!==void 0)return ye(te=f.refVal[ne],pe=Z(z,te))}pe=Z(z);var K,fe,be,le=e.call(P,he,f,z);if(le!==void 0||(K=y&&y[z])&&(le=e.inlineRef(K,x.inlineRefs)?K:o.call(P,K,f,y,k)),le!==void 0)return fe=le,be=n[z],_[be]=fe,ye(le,pe);delete n[z]}function Z(k,z){var Q=_.length;return _[Q]=z,"refVal"+(n[k]=Q)}function ye(k,z){return typeof k=="object"||typeof k=="boolean"?{code:z,schema:k,inline:!0}:{code:z,$async:k&&!!k.$async}}function ve(k){var z=L[k];return z===void 0&&(z=L[k]=S.length,S[z]=k),"pattern"+z}function re(k){switch(typeof k){case"boolean":case"number":return""+k;case"string":return l.toQuotedString(k);case"object":if(k===null)return"null";var z=i(k),Q=E[z];return Q===void 0&&(Q=E[z]=D.length,D[Q]=k),"default"+Q}}function Se(k,z,Q,te){if(P._opts.validateSchema!==!1){var pe=k.definition.dependencies;if(pe&&!pe.every(function(de){return Object.prototype.hasOwnProperty.call(Q,de)}))throw new Error("parent schema must have all required keywords: "+pe.join(","));var ue=k.definition.validateSchema;if(ue&&!ue(z)){var ne="keyword schema is invalid: "+P.errorsText(ue.errors);if(P._opts.validateSchema!="log")throw new Error(ne);P.logger.error(ne)}}var K,fe=k.definition.compile,be=k.definition.inline,le=k.definition.macro;if(fe)K=fe.call(P,z,Q,te);else if(le)K=le.call(P,z,Q,te),x.validateSchema!==!1&&P.validateSchema(K,!0);else if(be)K=be.call(P,te,k.keyword,z,Q);else if(!(K=k.definition.validate))return;if(K===void 0)throw new Error('custom keyword "'+k.keyword+'"failed to compile');var ce=q.length;return{code:"customRule"+ce,validate:q[ce]=K}}}function c(b,f,y){for(var I=0;I",L=P?">":"<",D=void 0;if(!y&&typeof u!="number"&&u!==void 0)throw new Error(l+" must be number");if(!n&&_!==void 0&&typeof _!="number"&&typeof _!="boolean")throw new Error(x+" must be number or boolean");n?(h="exclIsNumber"+v,j="' + "+(g="op"+v)+" + '",c+=" var schemaExcl"+v+" = "+(t=e.util.getData(_.$data,s,e.dataPathArr))+"; ",D=x,(o=o||[]).push(c+=" var "+(i="exclusive"+v)+"; var "+(m="exclType"+v)+" = typeof "+(t="schemaExcl"+v)+"; if ("+m+" != 'boolean' && "+m+" != 'undefined' && "+m+" != 'number') { "),c="",e.createErrors!==!1?(c+=" { keyword: '"+(D||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(a)+" , params: {} ",e.opts.messages!==!1&&(c+=" , message: '"+x+" should be boolean' "),e.opts.verbose&&(c+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),c+=" } "):c+=" {} ",E=c,c=o.pop(),!e.compositeRule&&b?e.async?c+=" throw new ValidationError(["+E+"]); ":c+=" validate.errors = ["+E+"]; return false; ":c+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c+=" } else if ( ",y&&(c+=" ("+I+" !== undefined && typeof "+I+" != 'number') || "),c+=" "+m+" == 'number' ? ( ("+i+" = "+I+" === undefined || "+t+" "+S+"= "+I+") ? "+f+" "+L+"= "+t+" : "+f+" "+L+" "+I+" ) : ( ("+i+" = "+t+" === true) ? "+f+" "+L+"= "+I+" : "+f+" "+L+" "+I+" ) || "+f+" !== "+f+") { var op"+v+" = "+i+" ? '"+S+"' : '"+S+"='; ",u===void 0&&(D=x,a=e.errSchemaPath+"/"+x,I=t,y=n)):(j=S,(h=typeof _=="number")&&y?(g="'"+j+"'",c+=" if ( ",y&&(c+=" ("+I+" !== undefined && typeof "+I+" != 'number') || "),c+=" ( "+I+" === undefined || "+_+" "+S+"= "+I+" ? "+f+" "+L+"= "+_+" : "+f+" "+L+" "+I+" ) || "+f+" !== "+f+") { "):(h&&u===void 0?(i=!0,D=x,a=e.errSchemaPath+"/"+x,I=_,L+="="):(h&&(I=Math[P?"min":"max"](_,u)),_===(!h||I)?(i=!0,D=x,a=e.errSchemaPath+"/"+x,L+="="):(i=!1,j+="=")),g="'"+j+"'",c+=" if ( ",y&&(c+=" ("+I+" !== undefined && typeof "+I+" != 'number') || "),c+=" "+f+" "+L+" "+I+" || "+f+" !== "+f+") { ")),D=D||l,(o=o||[]).push(c),c="",e.createErrors!==!1?(c+=" { keyword: '"+(D||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(a)+" , params: { comparison: "+g+", limit: "+I+", exclusive: "+i+" } ",e.opts.messages!==!1&&(c+=" , message: 'should be "+j+" ",c+=y?"' + "+I:I+"'"),e.opts.verbose&&(c+=" , schema: ",c+=y?"validate.schema"+p:""+u,c+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),c+=" } "):c+=" {} ";var E=c;return c=o.pop(),!e.compositeRule&&b?e.async?c+=" throw new ValidationError(["+E+"]); ":c+=" validate.errors = ["+E+"]; return false; ":c+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c+=" } ",b&&(c+=" else { "),c}},{}],14:[function(A,$,C){$.exports=function(e,l){var t=" ",i=e.level,m=e.dataLevel,h=e.schema[l],j=e.schemaPath+e.util.getProperty(l),g=e.errSchemaPath+"/"+l,o=!e.opts.allErrors,c="data"+(m||""),v=e.opts.$data&&h&&h.$data,s=v?(t+=" var schema"+i+" = "+e.util.getData(h.$data,m,e.dataPathArr)+"; ","schema"+i):h;if(!v&&typeof h!="number")throw new Error(l+" must be number");t+="if ( ",v&&(t+=" ("+s+" !== undefined && typeof "+s+" != 'number') || "),t+=" "+c+".length "+(l=="maxItems"?">":"<")+" "+s+") { ";var u=l,p=p||[];p.push(t),t="",e.createErrors!==!1?(t+=" { keyword: '"+(u||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: { limit: "+s+" } ",e.opts.messages!==!1&&(t+=" , message: 'should NOT have ",t+=l=="maxItems"?"more":"fewer",t+=" than ",t+=v?"' + "+s+" + '":""+h,t+=" items' "),e.opts.verbose&&(t+=" , schema: ",t+=v?"validate.schema"+j:""+h,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var a=t;return t=p.pop(),!e.compositeRule&&o?e.async?t+=" throw new ValidationError(["+a+"]); ":t+=" validate.errors = ["+a+"]; return false; ":t+=" var err = "+a+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",o&&(t+=" else { "),t}},{}],15:[function(A,$,C){$.exports=function(e,l){var t=" ",i=e.level,m=e.dataLevel,h=e.schema[l],j=e.schemaPath+e.util.getProperty(l),g=e.errSchemaPath+"/"+l,o=!e.opts.allErrors,c="data"+(m||""),v=e.opts.$data&&h&&h.$data,s=v?(t+=" var schema"+i+" = "+e.util.getData(h.$data,m,e.dataPathArr)+"; ","schema"+i):h;if(!v&&typeof h!="number")throw new Error(l+" must be number");var u=l=="maxLength"?">":"<";t+="if ( ",v&&(t+=" ("+s+" !== undefined && typeof "+s+" != 'number') || "),e.opts.unicode===!1?t+=" "+c+".length ":t+=" ucs2length("+c+") ",t+=" "+u+" "+s+") { ";var p=l,a=a||[];a.push(t),t="",e.createErrors!==!1?(t+=" { keyword: '"+(p||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: { limit: "+s+" } ",e.opts.messages!==!1&&(t+=" , message: 'should NOT be ",t+=l=="maxLength"?"longer":"shorter",t+=" than ",t+=v?"' + "+s+" + '":""+h,t+=" characters' "),e.opts.verbose&&(t+=" , schema: ",t+=v?"validate.schema"+j:""+h,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var b=t;return t=a.pop(),!e.compositeRule&&o?e.async?t+=" throw new ValidationError(["+b+"]); ":t+=" validate.errors = ["+b+"]; return false; ":t+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",o&&(t+=" else { "),t}},{}],16:[function(A,$,C){$.exports=function(e,l){var t=" ",i=e.level,m=e.dataLevel,h=e.schema[l],j=e.schemaPath+e.util.getProperty(l),g=e.errSchemaPath+"/"+l,o=!e.opts.allErrors,c="data"+(m||""),v=e.opts.$data&&h&&h.$data,s=v?(t+=" var schema"+i+" = "+e.util.getData(h.$data,m,e.dataPathArr)+"; ","schema"+i):h;if(!v&&typeof h!="number")throw new Error(l+" must be number");t+="if ( ",v&&(t+=" ("+s+" !== undefined && typeof "+s+" != 'number') || "),t+=" Object.keys("+c+").length "+(l=="maxProperties"?">":"<")+" "+s+") { ";var u=l,p=p||[];p.push(t),t="",e.createErrors!==!1?(t+=" { keyword: '"+(u||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: { limit: "+s+" } ",e.opts.messages!==!1&&(t+=" , message: 'should NOT have ",t+=l=="maxProperties"?"more":"fewer",t+=" than ",t+=v?"' + "+s+" + '":""+h,t+=" properties' "),e.opts.verbose&&(t+=" , schema: ",t+=v?"validate.schema"+j:""+h,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var a=t;return t=p.pop(),!e.compositeRule&&o?e.async?t+=" throw new ValidationError(["+a+"]); ":t+=" validate.errors = ["+a+"]; return false; ":t+=" var err = "+a+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",o&&(t+=" else { "),t}},{}],17:[function(A,$,C){$.exports=function(e,l){var t=" ",i=e.schema[l],m=e.schemaPath+e.util.getProperty(l),h=e.errSchemaPath+"/"+l,j=!e.opts.allErrors,g=e.util.copy(e),o="";g.level++;var c="valid"+g.level,v=g.baseId,s=!0,u=i;if(u)for(var p,a=-1,b=u.length-1;a "+L+") { ",E=c+"["+L+"]",u.schema=O,u.schemaPath=j+"["+L+"]",u.errSchemaPath=g+"/"+L,u.errorPath=e.util.getPathExpr(e.errorPath,L,e.opts.jsonPointers,!0),u.dataPathArr[f]=L,q=e.validate(u),u.baseId=I,e.util.varOccurences(q,y)<2?t+=" "+e.util.varReplace(q,y,E)+" ":t+=" var "+y+" = "+E+"; "+q+" ",t+=" } ",o&&(t+=" if ("+a+") { ",p+="}"))}typeof n=="object"&&(e.opts.strictKeywords?typeof n=="object"&&0 "+h.length+") { for (var "+b+" = "+h.length+"; "+b+" < "+c+".length; "+b+"++) { ",u.errorPath=e.util.getPathExpr(e.errorPath,b,e.opts.jsonPointers,!0),E=c+"["+b+"]",u.dataPathArr[f]=b,q=e.validate(u),u.baseId=I,e.util.varOccurences(q,y)<2?t+=" "+e.util.varReplace(q,y,E)+" ":t+=" var "+y+" = "+E+"; "+q+" ",o&&(t+=" if (!"+a+") break; "),t+=" } } ",o&&(t+=" if ("+a+") { ",p+="}"))}else(e.opts.strictKeywords?typeof h=="object"&&0 1e-"+e.opts.multipleOfPrecision+" ":t+=" division"+i+" !== parseInt(division"+i+") ",t+=" ) ",v&&(t+=" ) "),t+=" ) { ";var u=u||[];u.push(t),t="",e.createErrors!==!1?(t+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: { multipleOf: "+s+" } ",e.opts.messages!==!1&&(t+=" , message: 'should be multiple of ",t+=v?"' + "+s:s+"'"),e.opts.verbose&&(t+=" , schema: ",t+=v?"validate.schema"+j:""+h,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var p=t;return t=u.pop(),!e.compositeRule&&o?e.async?t+=" throw new ValidationError(["+p+"]); ":t+=" validate.errors = ["+p+"]; return false; ":t+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",o&&(t+=" else { "),t}},{}],30:[function(A,$,C){$.exports=function(e,l){var t=" ",i=e.level,m=e.dataLevel,h=e.schema[l],j=e.schemaPath+e.util.getProperty(l),g=e.errSchemaPath+"/"+l,o=!e.opts.allErrors,c="data"+(m||""),v="errs__"+i,s=e.util.copy(e);s.level++;var u,p,a,b,f="valid"+s.level;return(e.opts.strictKeywords?typeof h=="object"&&0=e.opts.loopRequired,_=e.opts.ownProperties;if(o)if(t+=" var missing"+i+"; ",x){s||(t+=" var "+u+" = validate.schema"+j+"; ");var n="' + "+(O="schema"+i+"["+(E="i"+i)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(P,O,e.opts.jsonPointers)),t+=" var "+v+" = true; ",s&&(t+=" if (schema"+i+" === undefined) "+v+" = true; else if (!Array.isArray(schema"+i+")) "+v+" = false; else {"),t+=" for (var "+E+" = 0; "+E+" < "+u+".length; "+E+"++) { "+v+" = "+c+"["+u+"["+E+"]] !== undefined ",_&&(t+=" && Object.prototype.hasOwnProperty.call("+c+", "+u+"["+E+"]) "),t+="; if (!"+v+") break; } ",s&&(t+=" } "),(L=L||[]).push(t+=" if (!"+v+") { "),t="",e.createErrors!==!1?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: { missingProperty: '"+n+"' } ",e.opts.messages!==!1&&(t+=" , message: '",e.opts._errorDataPathProperty?t+="is a required property":t+="should have required property \\'"+n+"\\'",t+="' "),e.opts.verbose&&(t+=" , schema: validate.schema"+j+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var S=t;t=L.pop(),!e.compositeRule&&o?e.async?t+=" throw new ValidationError(["+S+"]); ":t+=" validate.errors = ["+S+"]; return false; ":t+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } else { "}else{t+=" if ( ";var L,D=p;if(D)for(var E=-1,q=D.length-1;E 1) { ",t=e.schema.items&&e.schema.items.type,i=Array.isArray(t),!t||t=="object"||t=="array"||i&&(0<=t.indexOf("object")||0<=t.indexOf("array"))?g+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+a+"[i], "+a+"[j])) { "+b+" = false; break outer; } } } ":(g+=" var itemIndices = {}, item; for (;i--;) { var item = "+a+"[i]; ",m="checkDataType"+(i?"s":""),g+=" if ("+e.util[m](t,"item",e.opts.strictNumbers,!0)+") continue; ",i&&(g+=` if (typeof item == 'string') item = '"' + item; `),g+=" if (typeof itemIndices[item] == 'number') { "+b+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "),g+=" } ",f&&(g+=" } "),(h=h||[]).push(g+=" if (!"+b+") { "),g="",e.createErrors!==!1?(g+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(g+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(g+=" , schema: ",g+=f?"validate.schema"+s:""+v,g+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+a+" "),g+=" } "):g+=" {} ",j=g,g=h.pop(),!e.compositeRule&&p?e.async?g+=" throw new ValidationError(["+j+"]); ":g+=" validate.errors = ["+j+"]; return false; ":g+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",g+=" } ",p&&(g+=" else { ")):p&&(g+=" if (true) { "),g}},{}],38:[function(A,$,C){$.exports=function(e,l){var t="",i=e.schema.$async===!0,m=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),h=e.self._getId(e.schema);if(e.opts.strictKeywords){var j=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(j){var g="unknown keyword: "+j;if(e.opts.strictKeywords!=="log")throw new Error(g);e.logger.warn(g)}}if(e.isTop&&(t+=" var validate = ",i&&(e.async=!0,t+="async "),t+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",h&&(e.opts.sourceCode||e.opts.processCode)&&(t+=" /*# sourceURL="+h+" */ ")),typeof e.schema=="boolean"||!m&&!e.schema.$ref){l="false schema";var o=e.level,c=e.dataLevel,v=e.schema[l],s=e.schemaPath+e.util.getProperty(l),u=e.errSchemaPath+"/"+l,p=!e.opts.allErrors,a="data"+(c||""),b="valid"+o;return e.schema===!1?(e.isTop?p=!0:t+=" var "+b+" = false; ",(Q=Q||[]).push(t),t="",e.createErrors!==!1?(t+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(t+=" , message: 'boolean schema is false' "),e.opts.verbose&&(t+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+a+" "),t+=" } "):t+=" {} ",N=t,t=Q.pop(),!e.compositeRule&&p?e.async?t+=" throw new ValidationError(["+N+"]); ":t+=" validate.errors = ["+N+"]; return false; ":t+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "):e.isTop?t+=i?" return data; ":" validate.errors = null; return true; ":t+=" var "+b+" = true; ",e.isTop&&(t+=" }; return validate; "),t}if(e.isTop){var f=e.isTop;if(o=e.level=0,c=e.dataLevel=0,a="data",e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[void 0],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var y="default is ignored in the schema root";if(e.opts.strictDefaults!=="log")throw new Error(y);e.logger.warn(y)}t+=" var vErrors = null; ",t+=" var errors = 0; ",t+=" if (rootData === undefined) rootData = data; "}else{if(o=e.level,a="data"+((c=e.dataLevel)||""),h&&(e.baseId=e.resolve.url(e.baseId,h)),i&&!e.async)throw new Error("async schema in sync schema");t+=" var errs_"+o+" = errors;"}b="valid"+o,p=!e.opts.allErrors;var I,P="",x="",_=e.schema.type,n=Array.isArray(_);if(_&&e.opts.nullable&&e.schema.nullable===!0&&(n?_.indexOf("null")==-1&&(_=_.concat("null")):_!="null"&&(_=[_,"null"],n=!0)),n&&_.length==1&&(_=_[0],n=!1),e.schema.$ref&&m){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(m=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(t+=" "+e.RULES.all.$comment.code(e,"$comment")),_){e.opts.coerceTypes&&(I=e.util.coerceToTypes(e.opts.coerceTypes,_));var S=e.RULES.types[_];if(I||n||S===!0||S&&!fe(S)){s=e.schemaPath+".type",u=e.errSchemaPath+"/type",s=e.schemaPath+".type",u=e.errSchemaPath+"/type";var L=n?"checkDataTypes":"checkDataType";if(t+=" if ("+e.util[L](_,a,e.opts.strictNumbers,!0)+") { ",I){var D="dataType"+o,E="coerced"+o;t+=" var "+D+" = typeof "+a+"; var "+E+" = undefined; ",e.opts.coerceTypes=="array"&&(t+=" if ("+D+" == 'object' && Array.isArray("+a+") && "+a+".length == 1) { "+a+" = "+a+"[0]; "+D+" = typeof "+a+"; if ("+e.util.checkDataType(e.schema.type,a,e.opts.strictNumbers)+") "+E+" = "+a+"; } "),t+=" if ("+E+" !== undefined) ; ";var q=I;if(q)for(var O,M=-1,H=q.length-1;M= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=Math.floor,f=String.fromCharCode;function y(r){throw new RangeError(a[r])}function I(r,d){var w=r.split("@"),T="";return 1>1,r+=b(r/d);455b((v-T)/B))&&y("overflow"),T+=ie*B;var ge=ee<=F?1:F+26<=ee?26:ee-F;if(ieb(v/se)&&y("overflow"),B*=se}var me=d.length+1;F=_(T-oe,me,oe==0),b(T/me)>v-R&&y("overflow"),R+=b(T/me),T%=me,d.splice(T++,0,R)}return String.fromCodePoint.apply(String,d)}function S(r){var d=[],w=(r=P(r)).length,T=128,R=0,F=72,G=!0,V=!1,U=void 0;try{for(var X,oe=r[Symbol.iterator]();!(G=(X=oe.next()).done);G=!0){var B=X.value;B<128&&d.push(f(B))}}catch(Ee){V=!0,U=Ee}finally{try{!G&&oe.return&&oe.return()}finally{if(V)throw U}}var ee=d.length,ie=ee;for(ee&&d.push("-");ieb((v-R)/we)&&y("overflow"),R+=(ge-T)*we,T=ge;var Pe=!0,De=!1,xe=void 0;try{for(var Me,ze=r[Symbol.iterator]();!(Pe=(Me=ze.next()).done);Pe=!0){var Ve=Me.value;if(Vev&&y("overflow"),Ve==T){for(var Fe=R,qe=36;;qe+=36){var Oe=qe<=F?1:F+26<=qe?26:qe-F;if(Fe>6|192).toString(16).toUpperCase()+"%"+(63&d|128).toString(16).toUpperCase():"%"+(d>>12|224).toString(16).toUpperCase()+"%"+(d>>6&63|128).toString(16).toUpperCase()+"%"+(63&d|128).toString(16).toUpperCase()}function q(r){for(var d="",w=0,T=r.length;wA-Z\\x5E-\\x7E]",'[\\"\\\\]'),ne=new RegExp(pe,"g"),K=new RegExp("(?:(?:%[EFef][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[89A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[0-9A-Fa-f][0-9A-Fa-f]))","g"),fe=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',ue),"g"),be=new RegExp(t("[^]",pe,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),le=be;function ce(r){var d=q(r);return d.match(ne)?d:r}var de={scheme:"mailto",parse:function(r,d){var w=r,T=w.to=w.path?w.path.split(","):[];if(w.path=void 0,w.query){for(var R=!1,F={},G=w.query.split("&"),V=0,U=G.length;VDeprecated, use `ground.layers` instead 1. An array of elevationLayer objects defining the basemaps used in the web scene.',items:{$ref:"#/definitions/elevationLayers_schema.json"},uniqueItems:!0},id:{type:"string",description:"A unique identifying string for the basemap."},title:{type:"string",description:"Required string title for the basemap that can be used in a table of contents."}},required:["baseMapLayers","title"],additionalProperties:!1},"clippingArea_schema.json":{title:"clippingArea",type:"object",description:"Defines area to be clipped for display.",properties:{clip:{type:"boolean",description:"enable / disable clipping"},geometry:{description:"envelope of clip area",$ref:"#/definitions/extent_schema.json"}}},"ground_schema.json":{title:"Ground",type:"object",description:"Ground defines the main surface of the web scene, based on elevation layers.",properties:{layers:{type:"array",description:"An array of elevationLayer objects defining the elevation of the ground in the web scene.",items:{$ref:"#/definitions/elevationLayers_schema.json"},uniqueItems:!0},navigationConstraint:{description:"Object determining whether the camera is constrained to navigate only above, or also under the ground surface. If not specified, navigation is constrained to above ground.",$ref:"#/definitions/navigationConstraint_schema.json"},surfaceColor:{description:"Defines the color of the ground surface, displayed underneath the basemap. If no color, the default grid is shown.",$ref:"#/definitions/color_schema.json"},transparency:{type:"integer",description:"The transparency of the ground surface. It is used for seeing through the ground, therefore this property also changes the transparency of the basemap. Draped operational layers are not affected by this property. The value has to lie between `100` (full transparency) and `0` (full opacity).",minimum:0,maximum:100}},required:["layers"],additionalProperties:!1},"heightModelInfo_schema.json":{title:"heightModelInfo",type:"object",description:"An object that defines the characteristics of the vertical coordinate system used by the web scene.",properties:{heightModel:{type:"string",description:"The surface type or height model of the vertical coordinate system.",enum:["ellipsoidal","gravity_related_height"],default:"ellipsoidal"},heightUnit:{type:"string",description:'The unit of the vertical coordinate system.1',enum:["150-kilometers","50-kilometers","benoit-1895-b-chain","clarke-foot","clarke-link","clarke-yard","foot","gold-coast-foot","indian-1937-yard","indian-yard","meter","sears-1922-truncated-chain","sears-chain","sears-foot","sears-yard","us-foot"]},vertCRS:{type:"string",description:"(Optional) The datum realization of the vertical coordinate system."}},required:["heightModel","heightUnit"],additionalProperties:!1},"initialState_schema.json":{title:"initialState",type:"object",description:"An object that provides information about the initial environment settings and viewpoint of the web scene.",properties:{environment:{type:"object",$ref:"#/definitions/environment_schema.json"},viewpoint:{description:"Describes a point of view for a 2D or 3D view. In a 3D view, it is determined using a camera position.",$ref:"#/definitions/viewpoint_schema.json"}},required:["environment","viewpoint"],additionalProperties:!1},"mapFloorInfo_schema.json":{title:"mapFloorInfo",type:"object",description:"Contains floor-awareness information for the web scene. Defines the layers and required fields for each layer that are used for floor filtering.",properties:{facilityLayer:{description:"Defines the layer and field properties for the Facility layer used for floor filtering.",$ref:"#/definitions/facilityLayerInfo_schema.json"},levelLayer:{description:"Defines the layer and field properties for the Level layer used for floor filtering.",$ref:"#/definitions/levelLayerInfo_schema.json"},siteLayer:{description:"Defines the layer and field properties for the Site layer used for floor filtering. This property is optional.",$ref:"#/definitions/siteLayerInfo_schema.json"}},required:["facilityLayer","levelLayer"],additionalProperties:!1},"mapRangeInfo_schema.json":{title:"Map Range Information",description:"Map range information",properties:{activeRangeName:{type:"string",description:"Active range ID that slider/picker acts upon."},currentRangeExtent:{type:"array",description:"Current range for the active range.",items:{type:"number"},minItems:2,maxItems:2},fullRangeExtent:{type:"array",description:"Full range extent for the active range to be presented in the UI.",items:{type:"number"},minItems:2,maxItems:2}},required:["activeRangeName"],additionalProperties:!1},"operationalLayers_schema.json":{title:"operationalLayers",type:"object",description:"Operational layers contain your data. Usually, a basemap sits beneath your operational layers to give them geographic context.",oneOf:[{$ref:"#/definitions/buildingSceneLayer_schema.json"},{$ref:"#/definitions/csvLayer_schema.json"},{$ref:"#/definitions/dimensionLayer_schema.json"},{$ref:"#/definitions/featureLayer_schema.json"},{$ref:"#/definitions/geojsonLayer_schema.json"},{$ref:"#/definitions/groupLayer_schema.json"},{$ref:"#/definitions/imageServiceLayer_schema.json"},{$ref:"#/definitions/integratedMeshLayer_schema.json"},{$ref:"#/definitions/kmlLayer_schema.json"},{$ref:"#/definitions/lineOfSightLayer_schema.json"},{$ref:"#/definitions/mapServiceLayer_schema.json"},{$ref:"#/definitions/ogcFeatureLayer_schema.json"},{$ref:"#/definitions/pointCloudLayer_schema.json"},{$ref:"#/definitions/rasterDataLayer_schema.json"},{$ref:"#/definitions/sceneLayer_schema.json"},{$ref:"#/definitions/tiledImageServiceLayer_schema.json"},{$ref:"#/definitions/tiledMapServiceLayer_schema.json"},{$ref:"#/definitions/vectorTileLayer_schema.json"},{$ref:"#/definitions/voxelLayer_schema.json"},{$ref:"#/definitions/webTiledLayer_schema.json"},{$ref:"#/definitions/wfsLayer_schema.json"},{$ref:"#/definitions/wmsLayer_schema.json"}]},"presentation_schema.json":{title:"presentation",type:"object",description:"A presentation consists of multiple slides, where each slide is a specific view into the web scene.",properties:{slides:{type:"array",description:"Array of slide objects.",items:{$ref:"#/definitions/slide_schema.json"}}},additionalProperties:!1},"spatialReference_schema.json":{title:"spatialReference",type:"object",description:`The spatialReference object is located at the top level of the JSON hierarchy. In addition to this, it is also available within the operationalLayer and basemap objects. +import{n as Qe}from"./index.221827cd.js";import{o as Ke,n as ke}from"./_commonjsHelpers.773c2c82.js";var Be,We={exports:{}};Be=function(){return function A($,C,e){function l(m,h){if(!C[m]){if(!$[m]){var j=typeof ke=="function"&&ke;if(!h&&j)return j(m,!0);if(t)return t(m,!0);var g=new Error("Cannot find module '"+m+"'");throw g.code="MODULE_NOT_FOUND",g}var o=C[m]={exports:{}};$[m][0].call(o.exports,function(c){return l($[m][1][c]||c)},o,o.exports,A,$,C,e)}return C[m].exports}for(var t=typeof ke=="function"&&ke,i=0;i%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,g=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-?)*(?:[0-9KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[KSa-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,o=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,c=/^(?:\/(?:[^~/]|~0|~1)*)*$/,v=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,s=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function u(P){return P=P=="full"?"full":"fast",e.copy(u[P])}function p(P){var x=P.match(l);if(!x)return!1;var _,n=+x[1],S=+x[2],L=+x[3];return 1<=S&&S<=12&&1<=L&&L<=(S!=2||(_=n)%4!=0||_%100==0&&_%400!=0?t[S]:29)}function a(P,x){var _=P.match(i);if(!_)return!1;var n=_[1],S=_[2],L=_[3],D=_[5];return(n<=23&&S<=59&&L<=59||n==23&&S==59&&L==60)&&(!x||D)}($.exports=u).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":j,url:g,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:m,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:I,uuid:o,"json-pointer":c,"json-pointer-uri-fragment":v,"relative-json-pointer":s},u.full={date:p,time:a,"date-time":function(P){var x=P.split(b);return x.length==2&&p(x[0])&&a(x[1],!0)},uri:function(P){return f.test(P)&&h.test(P)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":j,url:g,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:m,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:I,uuid:o,"json-pointer":c,"json-pointer-uri-fragment":v,"relative-json-pointer":s};var b=/t|\s/i,f=/\/|:/,y=/[^\\]\\Z/;function I(P){if(y.test(P))return!1;try{return new RegExp(P),!0}catch{return!1}}},{"./util":10}],5:[function(A,$,C){var e=A("./resolve"),l=A("./util"),t=A("./error_classes"),i=A("fast-json-stable-stringify"),m=A("../dotjs/validate"),h=l.ucs2length,j=A("fast-deep-equal"),g=t.Validation;function o(b,f,y,I){var P=this,x=this._opts,_=[void 0],n={},S=[],L={},D=[],E={},q=[],O=function(k,z,Q){var te=c.call(this,k,z,Q);return 0<=te?{index:te,compiling:!0}:(te=this._compilations.length,this._compilations[te]={schema:k,root:z,baseId:Q},{index:te,compiling:!1})}.call(this,b,f=f||{schema:b,refVal:_,refs:n},I),M=this._compilations[O.index];if(O.compiling)return M.callValidate=J;var H=this._formats,N=this.RULES;try{var W=he(b,f,y,I);M.validate=W;var Y=M.callValidate;return Y&&(Y.schema=W.schema,Y.errors=null,Y.refs=W.refs,Y.refVal=W.refVal,Y.root=W.root,Y.$async=W.$async,x.sourceCode&&(Y.source=W.source)),W}finally{(function(k,z,Q){var te=c.call(this,k,z,Q);0<=te&&this._compilations.splice(te,1)}).call(this,b,f,I)}function J(){var k=M.validate,z=k.apply(this,arguments);return J.errors=k.errors,z}function he(k,z,Q,te){var pe=!z||z&&z.schema==k;if(z.schema!=f.schema)return o.call(P,k,z,Q,te);var ue=k.$async===!0,ne=m({isTop:!0,schema:k,isRoot:pe,baseId:te,root:z,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:t.MissingRef,RULES:N,validate:m,util:l,resolve:e,resolveRef:ae,usePattern:ve,useDefault:re,useCustomRule:Se,opts:x,formats:H,logger:P.logger,self:P});ne=a(_,u)+a(S,v)+a(D,s)+a(q,p)+ne,x.processCode&&(ne=x.processCode(ne,k));try{var K=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",ne)(P,N,H,f,_,D,q,j,h,g);_[0]=K}catch(fe){throw P.logger.error("Error compiling schema, function code:",ne),fe}return K.schema=k,K.errors=null,K.refs=n,K.refVal=_,K.root=pe?K:z,ue&&(K.$async=!0),x.sourceCode===!0&&(K.source={code:ne,patterns:S,defaults:D}),K}function ae(k,z,Q){z=e.url(k,z);var te,pe,ue=n[z];if(ue!==void 0)return ye(te=_[ue],pe="refVal["+ue+"]");if(!Q&&f.refs){var ne=f.refs[z];if(ne!==void 0)return ye(te=f.refVal[ne],pe=Z(z,te))}pe=Z(z);var K,fe,be,le=e.call(P,he,f,z);if(le!==void 0||(K=y&&y[z])&&(le=e.inlineRef(K,x.inlineRefs)?K:o.call(P,K,f,y,k)),le!==void 0)return fe=le,be=n[z],_[be]=fe,ye(le,pe);delete n[z]}function Z(k,z){var Q=_.length;return _[Q]=z,"refVal"+(n[k]=Q)}function ye(k,z){return typeof k=="object"||typeof k=="boolean"?{code:z,schema:k,inline:!0}:{code:z,$async:k&&!!k.$async}}function ve(k){var z=L[k];return z===void 0&&(z=L[k]=S.length,S[z]=k),"pattern"+z}function re(k){switch(typeof k){case"boolean":case"number":return""+k;case"string":return l.toQuotedString(k);case"object":if(k===null)return"null";var z=i(k),Q=E[z];return Q===void 0&&(Q=E[z]=D.length,D[Q]=k),"default"+Q}}function Se(k,z,Q,te){if(P._opts.validateSchema!==!1){var pe=k.definition.dependencies;if(pe&&!pe.every(function(de){return Object.prototype.hasOwnProperty.call(Q,de)}))throw new Error("parent schema must have all required keywords: "+pe.join(","));var ue=k.definition.validateSchema;if(ue&&!ue(z)){var ne="keyword schema is invalid: "+P.errorsText(ue.errors);if(P._opts.validateSchema!="log")throw new Error(ne);P.logger.error(ne)}}var K,fe=k.definition.compile,be=k.definition.inline,le=k.definition.macro;if(fe)K=fe.call(P,z,Q,te);else if(le)K=le.call(P,z,Q,te),x.validateSchema!==!1&&P.validateSchema(K,!0);else if(be)K=be.call(P,te,k.keyword,z,Q);else if(!(K=k.definition.validate))return;if(K===void 0)throw new Error('custom keyword "'+k.keyword+'"failed to compile');var ce=q.length;return{code:"customRule"+ce,validate:q[ce]=K}}}function c(b,f,y){for(var I=0;I",L=P?">":"<",D=void 0;if(!y&&typeof u!="number"&&u!==void 0)throw new Error(l+" must be number");if(!n&&_!==void 0&&typeof _!="number"&&typeof _!="boolean")throw new Error(x+" must be number or boolean");n?(h="exclIsNumber"+v,j="' + "+(g="op"+v)+" + '",c+=" var schemaExcl"+v+" = "+(t=e.util.getData(_.$data,s,e.dataPathArr))+"; ",D=x,(o=o||[]).push(c+=" var "+(i="exclusive"+v)+"; var "+(m="exclType"+v)+" = typeof "+(t="schemaExcl"+v)+"; if ("+m+" != 'boolean' && "+m+" != 'undefined' && "+m+" != 'number') { "),c="",e.createErrors!==!1?(c+=" { keyword: '"+(D||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(a)+" , params: {} ",e.opts.messages!==!1&&(c+=" , message: '"+x+" should be boolean' "),e.opts.verbose&&(c+=" , schema: validate.schema"+p+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),c+=" } "):c+=" {} ",E=c,c=o.pop(),!e.compositeRule&&b?e.async?c+=" throw new ValidationError(["+E+"]); ":c+=" validate.errors = ["+E+"]; return false; ":c+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c+=" } else if ( ",y&&(c+=" ("+I+" !== undefined && typeof "+I+" != 'number') || "),c+=" "+m+" == 'number' ? ( ("+i+" = "+I+" === undefined || "+t+" "+S+"= "+I+") ? "+f+" "+L+"= "+t+" : "+f+" "+L+" "+I+" ) : ( ("+i+" = "+t+" === true) ? "+f+" "+L+"= "+I+" : "+f+" "+L+" "+I+" ) || "+f+" !== "+f+") { var op"+v+" = "+i+" ? '"+S+"' : '"+S+"='; ",u===void 0&&(D=x,a=e.errSchemaPath+"/"+x,I=t,y=n)):(j=S,(h=typeof _=="number")&&y?(g="'"+j+"'",c+=" if ( ",y&&(c+=" ("+I+" !== undefined && typeof "+I+" != 'number') || "),c+=" ( "+I+" === undefined || "+_+" "+S+"= "+I+" ? "+f+" "+L+"= "+_+" : "+f+" "+L+" "+I+" ) || "+f+" !== "+f+") { "):(h&&u===void 0?(i=!0,D=x,a=e.errSchemaPath+"/"+x,I=_,L+="="):(h&&(I=Math[P?"min":"max"](_,u)),_===(!h||I)?(i=!0,D=x,a=e.errSchemaPath+"/"+x,L+="="):(i=!1,j+="=")),g="'"+j+"'",c+=" if ( ",y&&(c+=" ("+I+" !== undefined && typeof "+I+" != 'number') || "),c+=" "+f+" "+L+" "+I+" || "+f+" !== "+f+") { ")),D=D||l,(o=o||[]).push(c),c="",e.createErrors!==!1?(c+=" { keyword: '"+(D||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(a)+" , params: { comparison: "+g+", limit: "+I+", exclusive: "+i+" } ",e.opts.messages!==!1&&(c+=" , message: 'should be "+j+" ",c+=y?"' + "+I:I+"'"),e.opts.verbose&&(c+=" , schema: ",c+=y?"validate.schema"+p:""+u,c+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),c+=" } "):c+=" {} ";var E=c;return c=o.pop(),!e.compositeRule&&b?e.async?c+=" throw new ValidationError(["+E+"]); ":c+=" validate.errors = ["+E+"]; return false; ":c+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",c+=" } ",b&&(c+=" else { "),c}},{}],14:[function(A,$,C){$.exports=function(e,l){var t=" ",i=e.level,m=e.dataLevel,h=e.schema[l],j=e.schemaPath+e.util.getProperty(l),g=e.errSchemaPath+"/"+l,o=!e.opts.allErrors,c="data"+(m||""),v=e.opts.$data&&h&&h.$data,s=v?(t+=" var schema"+i+" = "+e.util.getData(h.$data,m,e.dataPathArr)+"; ","schema"+i):h;if(!v&&typeof h!="number")throw new Error(l+" must be number");t+="if ( ",v&&(t+=" ("+s+" !== undefined && typeof "+s+" != 'number') || "),t+=" "+c+".length "+(l=="maxItems"?">":"<")+" "+s+") { ";var u=l,p=p||[];p.push(t),t="",e.createErrors!==!1?(t+=" { keyword: '"+(u||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: { limit: "+s+" } ",e.opts.messages!==!1&&(t+=" , message: 'should NOT have ",t+=l=="maxItems"?"more":"fewer",t+=" than ",t+=v?"' + "+s+" + '":""+h,t+=" items' "),e.opts.verbose&&(t+=" , schema: ",t+=v?"validate.schema"+j:""+h,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var a=t;return t=p.pop(),!e.compositeRule&&o?e.async?t+=" throw new ValidationError(["+a+"]); ":t+=" validate.errors = ["+a+"]; return false; ":t+=" var err = "+a+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",o&&(t+=" else { "),t}},{}],15:[function(A,$,C){$.exports=function(e,l){var t=" ",i=e.level,m=e.dataLevel,h=e.schema[l],j=e.schemaPath+e.util.getProperty(l),g=e.errSchemaPath+"/"+l,o=!e.opts.allErrors,c="data"+(m||""),v=e.opts.$data&&h&&h.$data,s=v?(t+=" var schema"+i+" = "+e.util.getData(h.$data,m,e.dataPathArr)+"; ","schema"+i):h;if(!v&&typeof h!="number")throw new Error(l+" must be number");var u=l=="maxLength"?">":"<";t+="if ( ",v&&(t+=" ("+s+" !== undefined && typeof "+s+" != 'number') || "),e.opts.unicode===!1?t+=" "+c+".length ":t+=" ucs2length("+c+") ",t+=" "+u+" "+s+") { ";var p=l,a=a||[];a.push(t),t="",e.createErrors!==!1?(t+=" { keyword: '"+(p||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: { limit: "+s+" } ",e.opts.messages!==!1&&(t+=" , message: 'should NOT be ",t+=l=="maxLength"?"longer":"shorter",t+=" than ",t+=v?"' + "+s+" + '":""+h,t+=" characters' "),e.opts.verbose&&(t+=" , schema: ",t+=v?"validate.schema"+j:""+h,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var b=t;return t=a.pop(),!e.compositeRule&&o?e.async?t+=" throw new ValidationError(["+b+"]); ":t+=" validate.errors = ["+b+"]; return false; ":t+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",o&&(t+=" else { "),t}},{}],16:[function(A,$,C){$.exports=function(e,l){var t=" ",i=e.level,m=e.dataLevel,h=e.schema[l],j=e.schemaPath+e.util.getProperty(l),g=e.errSchemaPath+"/"+l,o=!e.opts.allErrors,c="data"+(m||""),v=e.opts.$data&&h&&h.$data,s=v?(t+=" var schema"+i+" = "+e.util.getData(h.$data,m,e.dataPathArr)+"; ","schema"+i):h;if(!v&&typeof h!="number")throw new Error(l+" must be number");t+="if ( ",v&&(t+=" ("+s+" !== undefined && typeof "+s+" != 'number') || "),t+=" Object.keys("+c+").length "+(l=="maxProperties"?">":"<")+" "+s+") { ";var u=l,p=p||[];p.push(t),t="",e.createErrors!==!1?(t+=" { keyword: '"+(u||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: { limit: "+s+" } ",e.opts.messages!==!1&&(t+=" , message: 'should NOT have ",t+=l=="maxProperties"?"more":"fewer",t+=" than ",t+=v?"' + "+s+" + '":""+h,t+=" properties' "),e.opts.verbose&&(t+=" , schema: ",t+=v?"validate.schema"+j:""+h,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var a=t;return t=p.pop(),!e.compositeRule&&o?e.async?t+=" throw new ValidationError(["+a+"]); ":t+=" validate.errors = ["+a+"]; return false; ":t+=" var err = "+a+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",o&&(t+=" else { "),t}},{}],17:[function(A,$,C){$.exports=function(e,l){var t=" ",i=e.schema[l],m=e.schemaPath+e.util.getProperty(l),h=e.errSchemaPath+"/"+l,j=!e.opts.allErrors,g=e.util.copy(e),o="";g.level++;var c="valid"+g.level,v=g.baseId,s=!0,u=i;if(u)for(var p,a=-1,b=u.length-1;a "+L+") { ",E=c+"["+L+"]",u.schema=O,u.schemaPath=j+"["+L+"]",u.errSchemaPath=g+"/"+L,u.errorPath=e.util.getPathExpr(e.errorPath,L,e.opts.jsonPointers,!0),u.dataPathArr[f]=L,q=e.validate(u),u.baseId=I,e.util.varOccurences(q,y)<2?t+=" "+e.util.varReplace(q,y,E)+" ":t+=" var "+y+" = "+E+"; "+q+" ",t+=" } ",o&&(t+=" if ("+a+") { ",p+="}"))}typeof n=="object"&&(e.opts.strictKeywords?typeof n=="object"&&0 "+h.length+") { for (var "+b+" = "+h.length+"; "+b+" < "+c+".length; "+b+"++) { ",u.errorPath=e.util.getPathExpr(e.errorPath,b,e.opts.jsonPointers,!0),E=c+"["+b+"]",u.dataPathArr[f]=b,q=e.validate(u),u.baseId=I,e.util.varOccurences(q,y)<2?t+=" "+e.util.varReplace(q,y,E)+" ":t+=" var "+y+" = "+E+"; "+q+" ",o&&(t+=" if (!"+a+") break; "),t+=" } } ",o&&(t+=" if ("+a+") { ",p+="}"))}else(e.opts.strictKeywords?typeof h=="object"&&0 1e-"+e.opts.multipleOfPrecision+" ":t+=" division"+i+" !== parseInt(division"+i+") ",t+=" ) ",v&&(t+=" ) "),t+=" ) { ";var u=u||[];u.push(t),t="",e.createErrors!==!1?(t+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: { multipleOf: "+s+" } ",e.opts.messages!==!1&&(t+=" , message: 'should be multiple of ",t+=v?"' + "+s:s+"'"),e.opts.verbose&&(t+=" , schema: ",t+=v?"validate.schema"+j:""+h,t+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var p=t;return t=u.pop(),!e.compositeRule&&o?e.async?t+=" throw new ValidationError(["+p+"]); ":t+=" validate.errors = ["+p+"]; return false; ":t+=" var err = "+p+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+="} ",o&&(t+=" else { "),t}},{}],30:[function(A,$,C){$.exports=function(e,l){var t=" ",i=e.level,m=e.dataLevel,h=e.schema[l],j=e.schemaPath+e.util.getProperty(l),g=e.errSchemaPath+"/"+l,o=!e.opts.allErrors,c="data"+(m||""),v="errs__"+i,s=e.util.copy(e);s.level++;var u,p,a,b,f="valid"+s.level;return(e.opts.strictKeywords?typeof h=="object"&&0=e.opts.loopRequired,_=e.opts.ownProperties;if(o)if(t+=" var missing"+i+"; ",x){s||(t+=" var "+u+" = validate.schema"+j+"; ");var n="' + "+(O="schema"+i+"["+(E="i"+i)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(P,O,e.opts.jsonPointers)),t+=" var "+v+" = true; ",s&&(t+=" if (schema"+i+" === undefined) "+v+" = true; else if (!Array.isArray(schema"+i+")) "+v+" = false; else {"),t+=" for (var "+E+" = 0; "+E+" < "+u+".length; "+E+"++) { "+v+" = "+c+"["+u+"["+E+"]] !== undefined ",_&&(t+=" && Object.prototype.hasOwnProperty.call("+c+", "+u+"["+E+"]) "),t+="; if (!"+v+") break; } ",s&&(t+=" } "),(L=L||[]).push(t+=" if (!"+v+") { "),t="",e.createErrors!==!1?(t+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(g)+" , params: { missingProperty: '"+n+"' } ",e.opts.messages!==!1&&(t+=" , message: '",e.opts._errorDataPathProperty?t+="is a required property":t+="should have required property \\'"+n+"\\'",t+="' "),e.opts.verbose&&(t+=" , schema: validate.schema"+j+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),t+=" } "):t+=" {} ";var S=t;t=L.pop(),!e.compositeRule&&o?e.async?t+=" throw new ValidationError(["+S+"]); ":t+=" validate.errors = ["+S+"]; return false; ":t+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",t+=" } else { "}else{t+=" if ( ";var L,D=p;if(D)for(var E=-1,q=D.length-1;E 1) { ",t=e.schema.items&&e.schema.items.type,i=Array.isArray(t),!t||t=="object"||t=="array"||i&&(0<=t.indexOf("object")||0<=t.indexOf("array"))?g+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+a+"[i], "+a+"[j])) { "+b+" = false; break outer; } } } ":(g+=" var itemIndices = {}, item; for (;i--;) { var item = "+a+"[i]; ",m="checkDataType"+(i?"s":""),g+=" if ("+e.util[m](t,"item",e.opts.strictNumbers,!0)+") continue; ",i&&(g+=` if (typeof item == 'string') item = '"' + item; `),g+=" if (typeof itemIndices[item] == 'number') { "+b+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "),g+=" } ",f&&(g+=" } "),(h=h||[]).push(g+=" if (!"+b+") { "),g="",e.createErrors!==!1?(g+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(g+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(g+=" , schema: ",g+=f?"validate.schema"+s:""+v,g+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+a+" "),g+=" } "):g+=" {} ",j=g,g=h.pop(),!e.compositeRule&&p?e.async?g+=" throw new ValidationError(["+j+"]); ":g+=" validate.errors = ["+j+"]; return false; ":g+=" var err = "+j+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",g+=" } ",p&&(g+=" else { ")):p&&(g+=" if (true) { "),g}},{}],38:[function(A,$,C){$.exports=function(e,l){var t="",i=e.schema.$async===!0,m=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),h=e.self._getId(e.schema);if(e.opts.strictKeywords){var j=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(j){var g="unknown keyword: "+j;if(e.opts.strictKeywords!=="log")throw new Error(g);e.logger.warn(g)}}if(e.isTop&&(t+=" var validate = ",i&&(e.async=!0,t+="async "),t+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",h&&(e.opts.sourceCode||e.opts.processCode)&&(t+=" /*# sourceURL="+h+" */ ")),typeof e.schema=="boolean"||!m&&!e.schema.$ref){l="false schema";var o=e.level,c=e.dataLevel,v=e.schema[l],s=e.schemaPath+e.util.getProperty(l),u=e.errSchemaPath+"/"+l,p=!e.opts.allErrors,a="data"+(c||""),b="valid"+o;return e.schema===!1?(e.isTop?p=!0:t+=" var "+b+" = false; ",(Q=Q||[]).push(t),t="",e.createErrors!==!1?(t+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(t+=" , message: 'boolean schema is false' "),e.opts.verbose&&(t+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+a+" "),t+=" } "):t+=" {} ",N=t,t=Q.pop(),!e.compositeRule&&p?e.async?t+=" throw new ValidationError(["+N+"]); ":t+=" validate.errors = ["+N+"]; return false; ":t+=" var err = "+N+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "):e.isTop?t+=i?" return data; ":" validate.errors = null; return true; ":t+=" var "+b+" = true; ",e.isTop&&(t+=" }; return validate; "),t}if(e.isTop){var f=e.isTop;if(o=e.level=0,c=e.dataLevel=0,a="data",e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[void 0],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var y="default is ignored in the schema root";if(e.opts.strictDefaults!=="log")throw new Error(y);e.logger.warn(y)}t+=" var vErrors = null; ",t+=" var errors = 0; ",t+=" if (rootData === undefined) rootData = data; "}else{if(o=e.level,a="data"+((c=e.dataLevel)||""),h&&(e.baseId=e.resolve.url(e.baseId,h)),i&&!e.async)throw new Error("async schema in sync schema");t+=" var errs_"+o+" = errors;"}b="valid"+o,p=!e.opts.allErrors;var I,P="",x="",_=e.schema.type,n=Array.isArray(_);if(_&&e.opts.nullable&&e.schema.nullable===!0&&(n?_.indexOf("null")==-1&&(_=_.concat("null")):_!="null"&&(_=[_,"null"],n=!0)),n&&_.length==1&&(_=_[0],n=!1),e.schema.$ref&&m){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(m=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(t+=" "+e.RULES.all.$comment.code(e,"$comment")),_){e.opts.coerceTypes&&(I=e.util.coerceToTypes(e.opts.coerceTypes,_));var S=e.RULES.types[_];if(I||n||S===!0||S&&!fe(S)){s=e.schemaPath+".type",u=e.errSchemaPath+"/type",s=e.schemaPath+".type",u=e.errSchemaPath+"/type";var L=n?"checkDataTypes":"checkDataType";if(t+=" if ("+e.util[L](_,a,e.opts.strictNumbers,!0)+") { ",I){var D="dataType"+o,E="coerced"+o;t+=" var "+D+" = typeof "+a+"; var "+E+" = undefined; ",e.opts.coerceTypes=="array"&&(t+=" if ("+D+" == 'object' && Array.isArray("+a+") && "+a+".length == 1) { "+a+" = "+a+"[0]; "+D+" = typeof "+a+"; if ("+e.util.checkDataType(e.schema.type,a,e.opts.strictNumbers)+") "+E+" = "+a+"; } "),t+=" if ("+E+" !== undefined) ; ";var q=I;if(q)for(var O,M=-1,H=q.length-1;M= 0x80 (not a basic code point)","invalid-input":"Invalid input"},b=Math.floor,f=String.fromCharCode;function y(r){throw new RangeError(a[r])}function I(r,d){var w=r.split("@"),T="";return 1>1,r+=b(r/d);455b((v-T)/B))&&y("overflow"),T+=ie*B;var ge=ee<=F?1:F+26<=ee?26:ee-F;if(ieb(v/se)&&y("overflow"),B*=se}var me=d.length+1;F=_(T-oe,me,oe==0),b(T/me)>v-R&&y("overflow"),R+=b(T/me),T%=me,d.splice(T++,0,R)}return String.fromCodePoint.apply(String,d)}function S(r){var d=[],w=(r=P(r)).length,T=128,R=0,F=72,G=!0,V=!1,U=void 0;try{for(var X,oe=r[Symbol.iterator]();!(G=(X=oe.next()).done);G=!0){var B=X.value;B<128&&d.push(f(B))}}catch(Ee){V=!0,U=Ee}finally{try{!G&&oe.return&&oe.return()}finally{if(V)throw U}}var ee=d.length,ie=ee;for(ee&&d.push("-");ieb((v-R)/we)&&y("overflow"),R+=(ge-T)*we,T=ge;var Pe=!0,De=!1,xe=void 0;try{for(var Me,ze=r[Symbol.iterator]();!(Pe=(Me=ze.next()).done);Pe=!0){var Ve=Me.value;if(Vev&&y("overflow"),Ve==T){for(var Fe=R,qe=36;;qe+=36){var Oe=qe<=F?1:F+26<=qe?26:qe-F;if(Fe>6|192).toString(16).toUpperCase()+"%"+(63&d|128).toString(16).toUpperCase():"%"+(d>>12|224).toString(16).toUpperCase()+"%"+(d>>6&63|128).toString(16).toUpperCase()+"%"+(63&d|128).toString(16).toUpperCase()}function q(r){for(var d="",w=0,T=r.length;wA-Z\\x5E-\\x7E]",'[\\"\\\\]'),ne=new RegExp(pe,"g"),K=new RegExp("(?:(?:%[EFef][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[89A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[0-9A-Fa-f][0-9A-Fa-f]))","g"),fe=new RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',ue),"g"),be=new RegExp(t("[^]",pe,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),le=be;function ce(r){var d=q(r);return d.match(ne)?d:r}var de={scheme:"mailto",parse:function(r,d){var w=r,T=w.to=w.path?w.path.split(","):[];if(w.path=void 0,w.query){for(var R=!1,F={},G=w.query.split("&"),V=0,U=G.length;VDeprecated, use `ground.layers` instead 1. An array of elevationLayer objects defining the basemaps used in the web scene.',items:{$ref:"#/definitions/elevationLayers_schema.json"},uniqueItems:!0},id:{type:"string",description:"A unique identifying string for the basemap."},title:{type:"string",description:"Required string title for the basemap that can be used in a table of contents."}},required:["baseMapLayers","title"],additionalProperties:!1},"clippingArea_schema.json":{title:"clippingArea",type:"object",description:"Defines area to be clipped for display.",properties:{clip:{type:"boolean",description:"enable / disable clipping"},geometry:{description:"envelope of clip area",$ref:"#/definitions/extent_schema.json"}}},"ground_schema.json":{title:"Ground",type:"object",description:"Ground defines the main surface of the web scene, based on elevation layers.",properties:{layers:{type:"array",description:"An array of elevationLayer objects defining the elevation of the ground in the web scene.",items:{$ref:"#/definitions/elevationLayers_schema.json"},uniqueItems:!0},navigationConstraint:{description:"Object determining whether the camera is constrained to navigate only above, or also under the ground surface. If not specified, navigation is constrained to above ground.",$ref:"#/definitions/navigationConstraint_schema.json"},surfaceColor:{description:"Defines the color of the ground surface, displayed underneath the basemap. If no color, the default grid is shown.",$ref:"#/definitions/color_schema.json"},transparency:{type:"integer",description:"The transparency of the ground surface. It is used for seeing through the ground, therefore this property also changes the transparency of the basemap. Draped operational layers are not affected by this property. The value has to lie between `100` (full transparency) and `0` (full opacity).",minimum:0,maximum:100}},required:["layers"],additionalProperties:!1},"heightModelInfo_schema.json":{title:"heightModelInfo",type:"object",description:"An object that defines the characteristics of the vertical coordinate system used by the web scene.",properties:{heightModel:{type:"string",description:"The surface type or height model of the vertical coordinate system.",enum:["ellipsoidal","gravity_related_height"],default:"ellipsoidal"},heightUnit:{type:"string",description:'The unit of the vertical coordinate system.1',enum:["150-kilometers","50-kilometers","benoit-1895-b-chain","clarke-foot","clarke-link","clarke-yard","foot","gold-coast-foot","indian-1937-yard","indian-yard","meter","sears-1922-truncated-chain","sears-chain","sears-foot","sears-yard","us-foot"]},vertCRS:{type:"string",description:"(Optional) The datum realization of the vertical coordinate system."}},required:["heightModel","heightUnit"],additionalProperties:!1},"initialState_schema.json":{title:"initialState",type:"object",description:"An object that provides information about the initial environment settings and viewpoint of the web scene.",properties:{environment:{type:"object",$ref:"#/definitions/environment_schema.json"},viewpoint:{description:"Describes a point of view for a 2D or 3D view. In a 3D view, it is determined using a camera position.",$ref:"#/definitions/viewpoint_schema.json"}},required:["environment","viewpoint"],additionalProperties:!1},"mapFloorInfo_schema.json":{title:"mapFloorInfo",type:"object",description:"Contains floor-awareness information for the web scene. Defines the layers and required fields for each layer that are used for floor filtering.",properties:{facilityLayer:{description:"Defines the layer and field properties for the Facility layer used for floor filtering.",$ref:"#/definitions/facilityLayerInfo_schema.json"},levelLayer:{description:"Defines the layer and field properties for the Level layer used for floor filtering.",$ref:"#/definitions/levelLayerInfo_schema.json"},siteLayer:{description:"Defines the layer and field properties for the Site layer used for floor filtering. This property is optional.",$ref:"#/definitions/siteLayerInfo_schema.json"}},required:["facilityLayer","levelLayer"],additionalProperties:!1},"mapRangeInfo_schema.json":{title:"Map Range Information",description:"Map range information",properties:{activeRangeName:{type:"string",description:"Active range ID that slider/picker acts upon."},currentRangeExtent:{type:"array",description:"Current range for the active range.",items:{type:"number"},minItems:2,maxItems:2},fullRangeExtent:{type:"array",description:"Full range extent for the active range to be presented in the UI.",items:{type:"number"},minItems:2,maxItems:2}},required:["activeRangeName"],additionalProperties:!1},"operationalLayers_schema.json":{title:"operationalLayers",type:"object",description:"Operational layers contain your data. Usually, a basemap sits beneath your operational layers to give them geographic context.",oneOf:[{$ref:"#/definitions/buildingSceneLayer_schema.json"},{$ref:"#/definitions/csvLayer_schema.json"},{$ref:"#/definitions/dimensionLayer_schema.json"},{$ref:"#/definitions/featureLayer_schema.json"},{$ref:"#/definitions/geojsonLayer_schema.json"},{$ref:"#/definitions/groupLayer_schema.json"},{$ref:"#/definitions/imageServiceLayer_schema.json"},{$ref:"#/definitions/integratedMeshLayer_schema.json"},{$ref:"#/definitions/kmlLayer_schema.json"},{$ref:"#/definitions/lineOfSightLayer_schema.json"},{$ref:"#/definitions/mapServiceLayer_schema.json"},{$ref:"#/definitions/ogcFeatureLayer_schema.json"},{$ref:"#/definitions/pointCloudLayer_schema.json"},{$ref:"#/definitions/rasterDataLayer_schema.json"},{$ref:"#/definitions/sceneLayer_schema.json"},{$ref:"#/definitions/tiledImageServiceLayer_schema.json"},{$ref:"#/definitions/tiledMapServiceLayer_schema.json"},{$ref:"#/definitions/vectorTileLayer_schema.json"},{$ref:"#/definitions/voxelLayer_schema.json"},{$ref:"#/definitions/webTiledLayer_schema.json"},{$ref:"#/definitions/wfsLayer_schema.json"},{$ref:"#/definitions/wmsLayer_schema.json"}]},"presentation_schema.json":{title:"presentation",type:"object",description:"A presentation consists of multiple slides, where each slide is a specific view into the web scene.",properties:{slides:{type:"array",description:"Array of slide objects.",items:{$ref:"#/definitions/slide_schema.json"}}},additionalProperties:!1},"spatialReference_schema.json":{title:"spatialReference",type:"object",description:`The spatialReference object is located at the top level of the JSON hierarchy. In addition to this, it is also available within the operationalLayer and basemap objects. Many predefined spatial references have already been defined and are available for use. A spatial reference can be defined using a well-known ID (WKID) or well-known text (WKT). The default tolerance and resolution values for the associated coordinate system are used. diff --git a/assets/scrim.5d8801d4.js b/assets/scrim.51d512d2.js similarity index 96% rename from assets/scrim.5d8801d4.js rename to assets/scrim.51d512d2.js index 30fd5b9..ed6a97d 100644 --- a/assets/scrim.5d8801d4.js +++ b/assets/scrim.51d512d2.js @@ -1,4 +1,4 @@ -import{p as l,H as s,h as i}from"./index.d94abe07.js";import{d as m}from"./loader.3df23557.js";/*! +import{p as l,H as s,h as i}from"./index.221827cd.js";import{d as m}from"./loader.d1e283c7.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.0-beta.97 diff --git a/assets/sourceUtils.61cd5549.js b/assets/sourceUtils.ed369a2c.js similarity index 96% rename from assets/sourceUtils.61cd5549.js rename to assets/sourceUtils.ed369a2c.js index efc1363..5e2f562 100644 --- a/assets/sourceUtils.61cd5549.js +++ b/assets/sourceUtils.ed369a2c.js @@ -1 +1 @@ -import{gB as p,gC as y,gA as w,fe as I,gD as b,bJ as h,j as g,at as _}from"./index.d94abe07.js";class v{constructor(){this.code=null,this.description=null}}class q{constructor(t){this.error=new v,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=t}}function d(e){return new q(e)}class P{constructor(t){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=t}}function A(e){return new P(e)}const l=new Set;function D(e,t,i,m=!1,u){var c;l.clear();for(const r in i){const n=e.get(r);if(!n)continue;const a=i[r],s=j(n,a);if(s!==a&&u&&u.push({name:"invalid-value-type",message:"attribute value was converted to match the field type",details:{field:n,originalValue:a,sanitizedValue:s}}),l.add(n.name),n&&(m||n.editable)){const f=p(n,s);if(f)return d(y(f,n,s));t[n.name]=s}}for(const r of(c=e==null?void 0:e.requiredFields)!=null?c:[])if(!l.has(r.name))return d(`missing required field "${r.name}"`);return null}function j(e,t){let i=t;return typeof t=="string"&&w(e)?i=parseFloat(t):t!=null&&I(e)&&typeof t!="string"&&(i=String(t)),b(i)}let o;function F(e,t){if(!e||!h(t))return e;if("rings"in e||"paths"in e){if(g(o))throw new TypeError("geometry engine not loaded");return o.simplify(t,e)}return e}async function E(){return g(o)&&(o=await _(()=>import("./geometryEngineJSON.3d6e7890.js"),["assets/geometryEngineJSON.3d6e7890.js","assets/geometryEngineBase.82b25ca5.js","assets/geometryEngineJSON.f9e9a36f.js","assets/json.879c9adc.js"])),o}async function G(e,t){!h(e)||t!=="esriGeometryPolygon"&&t!=="esriGeometryPolyline"||await E()}export{d as a,A as f,F as g,D as m,G as w}; +import{gB as p,gC as y,gA as w,fe as I,gD as b,bJ as h,j as g,at as _}from"./index.221827cd.js";class v{constructor(){this.code=null,this.description=null}}class q{constructor(t){this.error=new v,this.globalId=null,this.objectId=null,this.success=!1,this.uniqueId=null,this.error.description=t}}function d(e){return new q(e)}class P{constructor(t){this.globalId=null,this.success=!0,this.objectId=this.uniqueId=t}}function A(e){return new P(e)}const l=new Set;function D(e,t,i,m=!1,u){var c;l.clear();for(const r in i){const n=e.get(r);if(!n)continue;const a=i[r],s=j(n,a);if(s!==a&&u&&u.push({name:"invalid-value-type",message:"attribute value was converted to match the field type",details:{field:n,originalValue:a,sanitizedValue:s}}),l.add(n.name),n&&(m||n.editable)){const f=p(n,s);if(f)return d(y(f,n,s));t[n.name]=s}}for(const r of(c=e==null?void 0:e.requiredFields)!=null?c:[])if(!l.has(r.name))return d(`missing required field "${r.name}"`);return null}function j(e,t){let i=t;return typeof t=="string"&&w(e)?i=parseFloat(t):t!=null&&I(e)&&typeof t!="string"&&(i=String(t)),b(i)}let o;function F(e,t){if(!e||!h(t))return e;if("rings"in e||"paths"in e){if(g(o))throw new TypeError("geometry engine not loaded");return o.simplify(t,e)}return e}async function E(){return g(o)&&(o=await _(()=>import("./geometryEngineJSON.3d6e7890.js"),["assets/geometryEngineJSON.3d6e7890.js","assets/geometryEngineBase.82b25ca5.js","assets/geometryEngineJSON.f9e9a36f.js","assets/json.879c9adc.js"])),o}async function G(e,t){!h(e)||t!=="esriGeometryPolygon"&&t!=="esriGeometryPolyline"||await E()}export{d as a,A as f,F as g,D as m,G as w}; diff --git a/assets/sphere.ec1f4496.js b/assets/sphere.f99ddb50.js similarity index 98% rename from assets/sphere.ec1f4496.js rename to assets/sphere.f99ddb50.js index 7a98929..108f525 100644 --- a/assets/sphere.ec1f4496.js +++ b/assets/sphere.f99ddb50.js @@ -1 +1 @@ -import{h8 as R,eM as Q,h9 as D,ha as F,hb as G,fU as z,M as p,fz as E,fD as g,fG as P,ad as M,ac as f,fA as T,hc as I,g4 as K,hd as Y,fy as U,s as k,j as H,fF as J,fC as A,he as N,fM as W,h7 as tt,fE as et,hf as V,O as x,h4 as st}from"./index.d94abe07.js";import{n as it}from"./mat3f64.6d32a1d7.js";import{n as rt}from"./mat4f64.ff2a477c.js";import{n as nt}from"./quatf64.4ae3e6f1.js";class ot{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return this._itemsPtr===0&&R(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*C);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;ethis._reset());const e=Math.floor(this._itemsPtr/this._itemsPerBuffer);for(;this._buffers.length<=e;){const s=new ArrayBuffer(this._itemsPerBuffer*this._itemByteSize);for(let i=0;ie;)this._buffers.pop(),this._items.length=this._buffers.length*this._itemsPerBuffer;this._itemsPtr=0}static createVec2f64(e=m){return new o(16,D,e)}static createVec3f64(e=m){return new o(24,F,e)}static createVec4f64(e=m){return new o(32,G,e)}static createMat3f64(e=m){return new o(72,it,e)}static createMat4f64(e=m){return new o(128,rt,e)}static createQuatf64(e=m){return new o(32,nt,e)}get test(){return{size:this._buffers.length*this._itemsPerBuffer*this._itemByteSize}}}const m=4*Q.KILOBYTES;o.createVec2f64();const h=o.createVec3f64();o.createVec4f64();o.createMat3f64();const ct=o.createMat4f64();o.createQuatf64();var _;(function(t){t[t.X=0]="X",t[t.Y=1]="Y",t[t.Z=2]="Z"})(_||(_={}));function ut(t){return t?O(z(t.origin),z(t.direction)):O(p(),p())}function O(t,e){return{origin:t,direction:e}}function Rt(t,e){const s=ft.get();return s.origin=t,s.direction=e,s}function at(t,e,s){const i=E(t.direction,g(s,e,t.origin));return P(s,t.origin,M(s,t.direction,i)),s}const ft=new ot(()=>ut());function ht(t,e){const s=E(t,e)/(f(t)*f(e));return-T(s)}function S(){return I()}function Z(t,e=S()){return K(e,t)}function mt(t,e){return Y(t[0],t[1],t[2],e)}function _t(t){return t}function gt(t){t[0]=t[1]=t[2]=t[3]=0}function lt(t,e){return t[0]=t[1]=t[2]=0,t[3]=e,t}function d(t){return t[3]}function pt(t){return t}function Mt(t,e,s,i){return Y(t,e,s,i)}function Pt(t,e,s){return t!==s&&U(s,t),s[3]=t[3]+e,s}function dt(t,e,s){return k.getLogger("esri.geometry.support.sphere").error("sphere.setExtent is not yet supported"),t===s?s:Z(t,s)}function $(t,e,s){if(H(e))return!1;const{origin:i,direction:r}=e,n=$t;n[0]=i[0]-t[0],n[1]=i[1]-t[1],n[2]=i[2]-t[2];const c=r[0]*r[0]+r[1]*r[1]+r[2]*r[2];if(c===0)return!1;const u=2*(r[0]*n[0]+r[1]*n[1]+r[2]*n[2]),l=u*u-4*c*(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]-t[3]*t[3]);if(l<0)return!1;const b=Math.sqrt(l);let a=(-u-b)/(2*c);const y=(-u+b)/(2*c);return(a<0||y0)&&(a=y),!(a<0)&&(s&&(s[0]=i[0]+r[0]*a,s[1]=i[1]+r[1]*a,s[2]=i[2]+r[2]*a),!0)}const $t=p();function yt(t,e){return $(t,e,null)}function wt(t,e,s){if($(t,e,s))return s;const i=j(t,e,h.get());return P(s,e.origin,M(h.get(),e.direction,J(e.origin,i)/f(e.direction))),s}function j(t,e,s){const i=h.get(),r=ct.get();A(i,e.origin,e.direction);const n=d(t);A(s,i,e.origin),M(s,s,1/f(s)*n);const c=v(t,e.origin),u=ht(e.origin,s);return N(r,u+c,i),W(s,s,r),s}function Bt(t,e,s){return $(t,e,s)?s:(at(e,t,s),q(t,s,s))}function q(t,e,s){const i=g(h.get(),e,t),r=M(h.get(),i,t[3]/f(i));return P(s,r,t)}function St(t,e){const s=g(h.get(),e,t),i=tt(s),r=t[3]*t[3];return Math.sqrt(Math.abs(i-r))}function v(t,e){const s=g(h.get(),e,t),i=f(s),r=d(t),n=r+Math.abs(r-i);return T(r/n)}const w=p();function L(t,e,s,i){const r=g(w,e,t);switch(s){case _.X:{const n=V(r,w)[2];return x(i,-Math.sin(n),Math.cos(n),0)}case _.Y:{const n=V(r,w),c=n[1],u=n[2],l=Math.sin(c);return x(i,-l*Math.cos(u),-l*Math.sin(u),Math.cos(c))}case _.Z:return et(i,r);default:return}}function X(t,e){const s=g(B,e,t);return f(s)-t[3]}function bt(t,e,s,i){const r=X(t,e),n=L(t,e,_.Z,B),c=M(B,n,s-r);return P(i,e,c)}function zt(t,e){const s=st(t,e),i=d(t);return s<=i*i}const B=p(),At=S();Object.freeze(Object.defineProperty({__proto__:null,create:S,copy:Z,fromCenterAndRadius:mt,wrap:_t,clear:gt,fromRadius:lt,getRadius:d,getCenter:pt,fromValues:Mt,elevate:Pt,setExtent:dt,intersectRay:$,intersectsRay:yt,intersectRayClosestSilhouette:wt,closestPointOnSilhouette:j,closestPoint:Bt,projectPoint:q,distanceToSilhouette:St,angleToSilhouette:v,axisAt:L,altitudeAt:X,setAltitudeAt:bt,containsPoint:zt,tmpSphere:At},Symbol.toStringTag,{value:"Module"}));export{zt as N,S as R,d as T,yt as V,Z as _,h as c,ut as d,pt as k,Rt as p,ot as s}; +import{h8 as R,eM as Q,h9 as D,ha as F,hb as G,fU as z,M as p,fz as E,fD as g,fG as P,ad as M,ac as f,fA as T,hc as I,g4 as K,hd as Y,fy as U,s as k,j as H,fF as J,fC as A,he as N,fM as W,h7 as tt,fE as et,hf as V,O as x,h4 as st}from"./index.221827cd.js";import{n as it}from"./mat3f64.6d32a1d7.js";import{n as rt}from"./mat4f64.ff2a477c.js";import{n as nt}from"./quatf64.4ae3e6f1.js";class ot{constructor(e){this._allocator=e,this._items=[],this._itemsPtr=0,this._grow()}get(){return this._itemsPtr===0&&R(()=>this._reset()),this._itemsPtr===this._items.length&&this._grow(),this._items[this._itemsPtr++]}_reset(){const e=Math.min(3*Math.max(8,this._itemsPtr),this._itemsPtr+3*C);this._items.length=Math.min(e,this._items.length),this._itemsPtr=0}_grow(){for(let e=0;ethis._reset());const e=Math.floor(this._itemsPtr/this._itemsPerBuffer);for(;this._buffers.length<=e;){const s=new ArrayBuffer(this._itemsPerBuffer*this._itemByteSize);for(let i=0;ie;)this._buffers.pop(),this._items.length=this._buffers.length*this._itemsPerBuffer;this._itemsPtr=0}static createVec2f64(e=m){return new o(16,D,e)}static createVec3f64(e=m){return new o(24,F,e)}static createVec4f64(e=m){return new o(32,G,e)}static createMat3f64(e=m){return new o(72,it,e)}static createMat4f64(e=m){return new o(128,rt,e)}static createQuatf64(e=m){return new o(32,nt,e)}get test(){return{size:this._buffers.length*this._itemsPerBuffer*this._itemByteSize}}}const m=4*Q.KILOBYTES;o.createVec2f64();const h=o.createVec3f64();o.createVec4f64();o.createMat3f64();const ct=o.createMat4f64();o.createQuatf64();var _;(function(t){t[t.X=0]="X",t[t.Y=1]="Y",t[t.Z=2]="Z"})(_||(_={}));function ut(t){return t?O(z(t.origin),z(t.direction)):O(p(),p())}function O(t,e){return{origin:t,direction:e}}function Rt(t,e){const s=ft.get();return s.origin=t,s.direction=e,s}function at(t,e,s){const i=E(t.direction,g(s,e,t.origin));return P(s,t.origin,M(s,t.direction,i)),s}const ft=new ot(()=>ut());function ht(t,e){const s=E(t,e)/(f(t)*f(e));return-T(s)}function S(){return I()}function Z(t,e=S()){return K(e,t)}function mt(t,e){return Y(t[0],t[1],t[2],e)}function _t(t){return t}function gt(t){t[0]=t[1]=t[2]=t[3]=0}function lt(t,e){return t[0]=t[1]=t[2]=0,t[3]=e,t}function d(t){return t[3]}function pt(t){return t}function Mt(t,e,s,i){return Y(t,e,s,i)}function Pt(t,e,s){return t!==s&&U(s,t),s[3]=t[3]+e,s}function dt(t,e,s){return k.getLogger("esri.geometry.support.sphere").error("sphere.setExtent is not yet supported"),t===s?s:Z(t,s)}function $(t,e,s){if(H(e))return!1;const{origin:i,direction:r}=e,n=$t;n[0]=i[0]-t[0],n[1]=i[1]-t[1],n[2]=i[2]-t[2];const c=r[0]*r[0]+r[1]*r[1]+r[2]*r[2];if(c===0)return!1;const u=2*(r[0]*n[0]+r[1]*n[1]+r[2]*n[2]),l=u*u-4*c*(n[0]*n[0]+n[1]*n[1]+n[2]*n[2]-t[3]*t[3]);if(l<0)return!1;const b=Math.sqrt(l);let a=(-u-b)/(2*c);const y=(-u+b)/(2*c);return(a<0||y0)&&(a=y),!(a<0)&&(s&&(s[0]=i[0]+r[0]*a,s[1]=i[1]+r[1]*a,s[2]=i[2]+r[2]*a),!0)}const $t=p();function yt(t,e){return $(t,e,null)}function wt(t,e,s){if($(t,e,s))return s;const i=j(t,e,h.get());return P(s,e.origin,M(h.get(),e.direction,J(e.origin,i)/f(e.direction))),s}function j(t,e,s){const i=h.get(),r=ct.get();A(i,e.origin,e.direction);const n=d(t);A(s,i,e.origin),M(s,s,1/f(s)*n);const c=v(t,e.origin),u=ht(e.origin,s);return N(r,u+c,i),W(s,s,r),s}function Bt(t,e,s){return $(t,e,s)?s:(at(e,t,s),q(t,s,s))}function q(t,e,s){const i=g(h.get(),e,t),r=M(h.get(),i,t[3]/f(i));return P(s,r,t)}function St(t,e){const s=g(h.get(),e,t),i=tt(s),r=t[3]*t[3];return Math.sqrt(Math.abs(i-r))}function v(t,e){const s=g(h.get(),e,t),i=f(s),r=d(t),n=r+Math.abs(r-i);return T(r/n)}const w=p();function L(t,e,s,i){const r=g(w,e,t);switch(s){case _.X:{const n=V(r,w)[2];return x(i,-Math.sin(n),Math.cos(n),0)}case _.Y:{const n=V(r,w),c=n[1],u=n[2],l=Math.sin(c);return x(i,-l*Math.cos(u),-l*Math.sin(u),Math.cos(c))}case _.Z:return et(i,r);default:return}}function X(t,e){const s=g(B,e,t);return f(s)-t[3]}function bt(t,e,s,i){const r=X(t,e),n=L(t,e,_.Z,B),c=M(B,n,s-r);return P(i,e,c)}function zt(t,e){const s=st(t,e),i=d(t);return s<=i*i}const B=p(),At=S();Object.freeze(Object.defineProperty({__proto__:null,create:S,copy:Z,fromCenterAndRadius:mt,wrap:_t,clear:gt,fromRadius:lt,getRadius:d,getCenter:pt,fromValues:Mt,elevate:Pt,setExtent:dt,intersectRay:$,intersectsRay:yt,intersectRayClosestSilhouette:wt,closestPointOnSilhouette:j,closestPoint:Bt,projectPoint:q,distanceToSilhouette:St,angleToSilhouette:v,axisAt:L,altitudeAt:X,setAltitudeAt:bt,containsPoint:zt,tmpSphere:At},Symbol.toStringTag,{value:"Module"}));export{zt as N,S as R,d as T,yt as V,Z as _,h as c,ut as d,pt as k,Rt as p,ot as s}; diff --git a/assets/statsWorker.46eac3dc.js b/assets/statsWorker.181932ee.js similarity index 94% rename from assets/statsWorker.46eac3dc.js rename to assets/statsWorker.181932ee.js index 41c7549..4794f05 100644 --- a/assets/statsWorker.46eac3dc.js +++ b/assets/statsWorker.181932ee.js @@ -1 +1 @@ -import{eS as C,ax as S,af as R,u as j,de as A,aT as B,I as O,eT as k,eU as q}from"./index.d94abe07.js";import{O as G}from"./quantizationUtils.0d428d19.js";import{c as E,x as U,m as Y,f as _,d as Z,V as H,T as J,F as K,D as L,N as Q,S as W}from"./utils.8c53cad2.js";import"./generateRendererUtils.ebdde5b7.js";let z=null;function X(e,a,o){return e.x<0?e.x+=a:e.x>o&&(e.x-=a),e}function aa(e,a,o,l){const n=C(o)?S(o):null,s=n?Math.round((n.valid[1]-n.valid[0])/a.scale[0]):null;return e.map(t=>{const i=new R(j(t.geometry));return G(a,i,i,i.hasZ,i.hasM),t.geometry=n?X(i,s,l[0]):i,t})}function ea(e,a=18,o,l,n,s){const t=new Float64Array(n*s);a=Math.round(O(a));let i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,m=0,f=0,d=0,c=0;const I=k(l,o);for(const{geometry:T,attributes:v}of e){const{x:p,y:u}=T,y=Math.max(0,p-a),V=Math.max(0,u-a),D=Math.min(s,u+a),g=Math.min(n,p+a),P=+I(v);for(let w=V;wr&&(r=m),c++}}if(!c)return{mean:0,stddev:0,min:0,max:0,mid:0,count:0};const x=(r-i)/2;return{mean:f/c,stdDev:Math.sqrt((d-f*f/c)/c),min:i,max:r,mid:x,count:c}}async function F(e,a){if(!a)return[];const{field:o,field2:l,field3:n,fieldDelimiter:s}=e,t=e.valueExpression,i=e.normalizationType,r=e.normalizationField,m=e.normalizationTotal,f=[],d=e.viewInfoParams;let c=null,I=null;if(t){if(!z){const{arcadeUtils:v}=await A();z=v}c=z.createFunction(t),I=d&&z.getViewInfo({viewingMode:d.viewingMode,scale:d.scale,spatialReference:new B(d.spatialReference)})}const x=e.fieldInfos,T=!(a[0]&&"declaredClass"in a[0]&&a[0].declaredClass==="esri.Graphic")&&x?{fields:x}:null;return a.forEach(v=>{const p=v.attributes;let u;if(t){const y=T?{...v,layer:T}:v,V=z.createExecContext(y,I);u=z.executeFunction(c,V)}else p&&(u=p[o],l&&(u=`${E(u)}${s}${E(p[l])}`,n&&(u=`${u}${s}${E(p[n])}`)));if(i&&typeof u=="number"&&isFinite(u)){const y=p&&parseFloat(p[r]);u=U(u,i,y,m)}f.push(u)}),f}async function oa(e){const{attribute:a,features:o}=e,{normalizationType:l,normalizationField:n,minValue:s,maxValue:t,fieldType:i}=a,r=await F({field:a.field,valueExpression:a.valueExpression,normalizationType:l,normalizationField:n,normalizationTotal:a.normalizationTotal,viewInfoParams:a.viewInfoParams,fieldInfos:a.fieldInfos},o),m=Y({normalizationType:l,normalizationField:n,minValue:s,maxValue:t}),f={value:.5,fieldType:i},d=i==="esriFieldTypeString"?_({values:r,supportsNullCount:m,percentileParams:f}):Z({values:r,minValue:s,maxValue:t,useSampleStdDev:!l,supportsNullCount:m,percentileParams:f});return H(d,i==="esriFieldTypeDate")}async function sa(e){const{attribute:a,features:o}=e,l=await F({field:a.field,field2:a.field2,field3:a.field3,fieldDelimiter:a.fieldDelimiter,valueExpression:a.valueExpression,viewInfoParams:a.viewInfoParams,fieldInfos:a.fieldInfos},o),n=J(l);return K(n,a.domains,a.returnAllCodedValues,a.fieldDelimiter)}async function ra(e){const{attribute:a,features:o}=e,{field:l,normalizationType:n,normalizationField:s,normalizationTotal:t,classificationMethod:i}=a,r=await F({field:l,valueExpression:a.valueExpression,normalizationType:n,normalizationField:s,normalizationTotal:t,viewInfoParams:a.viewInfoParams,fieldInfos:a.fieldInfos},o),m=L(r,{field:l,normalizationType:n,normalizationField:s,normalizationTotal:t,classificationMethod:i,standardDeviationInterval:a.standardDeviationInterval,numClasses:a.numClasses,minValue:a.minValue,maxValue:a.maxValue});return Q(m,i)}async function ma(e){const{attribute:a,features:o}=e,{field:l,normalizationType:n,normalizationField:s,normalizationTotal:t,classificationMethod:i}=a,r=await F({field:l,valueExpression:a.valueExpression,normalizationType:n,normalizationField:s,normalizationTotal:t,viewInfoParams:a.viewInfoParams,fieldInfos:a.fieldInfos},o);return W(r,{field:l,normalizationType:n,normalizationField:s,normalizationTotal:t,classificationMethod:i,standardDeviationInterval:a.standardDeviationInterval,numBins:a.numBins,minValue:a.minValue,maxValue:a.maxValue})}async function ua(e){const{attribute:a,features:o}=e,{field:l,radius:n,fieldOffset:s,transform:t,spatialReference:i,size:r}=a,m=aa(o,t,i,r),{count:f,min:d,max:c,mean:I,stdDev:x}=ea(m,n,s,l,r[0],r[1]);return{count:f,min:d,max:c,avg:I,stddev:x}}export{ra as classBreaks,ua as heatmapStatistics,ma as histogram,oa as summaryStatistics,sa as uniqueValues}; +import{eS as C,ax as S,af as R,u as j,de as A,aT as B,I as O,eT as k,eU as q}from"./index.221827cd.js";import{O as G}from"./quantizationUtils.7ff797cc.js";import{c as E,x as U,m as Y,f as _,d as Z,V as H,T as J,F as K,D as L,N as Q,S as W}from"./utils.83e0b804.js";import"./generateRendererUtils.5c972fdb.js";let z=null;function X(e,a,o){return e.x<0?e.x+=a:e.x>o&&(e.x-=a),e}function aa(e,a,o,l){const n=C(o)?S(o):null,s=n?Math.round((n.valid[1]-n.valid[0])/a.scale[0]):null;return e.map(t=>{const i=new R(j(t.geometry));return G(a,i,i,i.hasZ,i.hasM),t.geometry=n?X(i,s,l[0]):i,t})}function ea(e,a=18,o,l,n,s){const t=new Float64Array(n*s);a=Math.round(O(a));let i=Number.POSITIVE_INFINITY,r=Number.NEGATIVE_INFINITY,m=0,f=0,d=0,c=0;const I=k(l,o);for(const{geometry:T,attributes:v}of e){const{x:p,y:u}=T,y=Math.max(0,p-a),V=Math.max(0,u-a),D=Math.min(s,u+a),g=Math.min(n,p+a),P=+I(v);for(let w=V;wr&&(r=m),c++}}if(!c)return{mean:0,stddev:0,min:0,max:0,mid:0,count:0};const x=(r-i)/2;return{mean:f/c,stdDev:Math.sqrt((d-f*f/c)/c),min:i,max:r,mid:x,count:c}}async function F(e,a){if(!a)return[];const{field:o,field2:l,field3:n,fieldDelimiter:s}=e,t=e.valueExpression,i=e.normalizationType,r=e.normalizationField,m=e.normalizationTotal,f=[],d=e.viewInfoParams;let c=null,I=null;if(t){if(!z){const{arcadeUtils:v}=await A();z=v}c=z.createFunction(t),I=d&&z.getViewInfo({viewingMode:d.viewingMode,scale:d.scale,spatialReference:new B(d.spatialReference)})}const x=e.fieldInfos,T=!(a[0]&&"declaredClass"in a[0]&&a[0].declaredClass==="esri.Graphic")&&x?{fields:x}:null;return a.forEach(v=>{const p=v.attributes;let u;if(t){const y=T?{...v,layer:T}:v,V=z.createExecContext(y,I);u=z.executeFunction(c,V)}else p&&(u=p[o],l&&(u=`${E(u)}${s}${E(p[l])}`,n&&(u=`${u}${s}${E(p[n])}`)));if(i&&typeof u=="number"&&isFinite(u)){const y=p&&parseFloat(p[r]);u=U(u,i,y,m)}f.push(u)}),f}async function oa(e){const{attribute:a,features:o}=e,{normalizationType:l,normalizationField:n,minValue:s,maxValue:t,fieldType:i}=a,r=await F({field:a.field,valueExpression:a.valueExpression,normalizationType:l,normalizationField:n,normalizationTotal:a.normalizationTotal,viewInfoParams:a.viewInfoParams,fieldInfos:a.fieldInfos},o),m=Y({normalizationType:l,normalizationField:n,minValue:s,maxValue:t}),f={value:.5,fieldType:i},d=i==="esriFieldTypeString"?_({values:r,supportsNullCount:m,percentileParams:f}):Z({values:r,minValue:s,maxValue:t,useSampleStdDev:!l,supportsNullCount:m,percentileParams:f});return H(d,i==="esriFieldTypeDate")}async function sa(e){const{attribute:a,features:o}=e,l=await F({field:a.field,field2:a.field2,field3:a.field3,fieldDelimiter:a.fieldDelimiter,valueExpression:a.valueExpression,viewInfoParams:a.viewInfoParams,fieldInfos:a.fieldInfos},o),n=J(l);return K(n,a.domains,a.returnAllCodedValues,a.fieldDelimiter)}async function ra(e){const{attribute:a,features:o}=e,{field:l,normalizationType:n,normalizationField:s,normalizationTotal:t,classificationMethod:i}=a,r=await F({field:l,valueExpression:a.valueExpression,normalizationType:n,normalizationField:s,normalizationTotal:t,viewInfoParams:a.viewInfoParams,fieldInfos:a.fieldInfos},o),m=L(r,{field:l,normalizationType:n,normalizationField:s,normalizationTotal:t,classificationMethod:i,standardDeviationInterval:a.standardDeviationInterval,numClasses:a.numClasses,minValue:a.minValue,maxValue:a.maxValue});return Q(m,i)}async function ma(e){const{attribute:a,features:o}=e,{field:l,normalizationType:n,normalizationField:s,normalizationTotal:t,classificationMethod:i}=a,r=await F({field:l,valueExpression:a.valueExpression,normalizationType:n,normalizationField:s,normalizationTotal:t,viewInfoParams:a.viewInfoParams,fieldInfos:a.fieldInfos},o);return W(r,{field:l,normalizationType:n,normalizationField:s,normalizationTotal:t,classificationMethod:i,standardDeviationInterval:a.standardDeviationInterval,numBins:a.numBins,minValue:a.minValue,maxValue:a.maxValue})}async function ua(e){const{attribute:a,features:o}=e,{field:l,radius:n,fieldOffset:s,transform:t,spatialReference:i,size:r}=a,m=aa(o,t,i,r),{count:f,min:d,max:c,mean:I,stdDev:x}=ea(m,n,s,l,r[0],r[1]);return{count:f,min:d,max:c,avg:I,stddev:x}}export{ra as classBreaks,ua as heatmapStatistics,ma as histogram,oa as summaryStatistics,sa as uniqueValues}; diff --git a/assets/sublayerUtils.9d6cbcc3.js b/assets/sublayerUtils.59f5d9da.js similarity index 94% rename from assets/sublayerUtils.9d6cbcc3.js rename to assets/sublayerUtils.59f5d9da.js index a022614..20948cf 100644 --- a/assets/sublayerUtils.9d6cbcc3.js +++ b/assets/sublayerUtils.59f5d9da.js @@ -1 +1 @@ -import{j as f,e8 as l}from"./index.d94abe07.js";function g(e,o,r){return o.flatten(({sublayers:i})=>i).length!==e.length?!0:!!e.some(i=>i.originIdOf("minScale")>r||i.originIdOf("maxScale")>r||i.originIdOf("renderer")>r||i.originIdOf("labelingInfo")>r||i.originIdOf("opacity")>r||i.originIdOf("labelsVisible")>r||i.originIdOf("source")>r)||!a(e,o)}function d(e,o,r){return!!e.some(n=>{const i=n.source;return!(!i||i.type==="map-layer"&&i.mapLayerId===n.id&&(f(i.gdbVersion)||i.gdbVersion===r))||n.originIdOf("renderer")>l.SERVICE||n.originIdOf("labelingInfo")>l.SERVICE||n.originIdOf("opacity")>l.SERVICE||n.originIdOf("labelsVisible")>l.SERVICE})||!a(e,o)}function a(e,o){if(!e||!e.length||f(o))return!0;const r=o.slice().reverse().flatten(({sublayers:t})=>t&&t.toArray().reverse()).map(t=>t.id).toArray();if(e.length>r.length)return!1;let n=0;const i=r.length;for(const{id:t}of e){for(;n=i)return!1}return!0}function u(e){return!!e&&e.some(o=>o.minScale!=null||o.layerDefinition&&o.layerDefinition.minScale!=null)}export{d as i,g as n,u as t}; +import{j as f,e8 as l}from"./index.221827cd.js";function g(e,o,r){return o.flatten(({sublayers:i})=>i).length!==e.length?!0:!!e.some(i=>i.originIdOf("minScale")>r||i.originIdOf("maxScale")>r||i.originIdOf("renderer")>r||i.originIdOf("labelingInfo")>r||i.originIdOf("opacity")>r||i.originIdOf("labelsVisible")>r||i.originIdOf("source")>r)||!a(e,o)}function d(e,o,r){return!!e.some(n=>{const i=n.source;return!(!i||i.type==="map-layer"&&i.mapLayerId===n.id&&(f(i.gdbVersion)||i.gdbVersion===r))||n.originIdOf("renderer")>l.SERVICE||n.originIdOf("labelingInfo")>l.SERVICE||n.originIdOf("opacity")>l.SERVICE||n.originIdOf("labelsVisible")>l.SERVICE})||!a(e,o)}function a(e,o){if(!e||!e.length||f(o))return!0;const r=o.slice().reverse().flatten(({sublayers:t})=>t&&t.toArray().reverse()).map(t=>t.id).toArray();if(e.length>r.length)return!1;let n=0;const i=r.length;for(const{id:t}of e){for(;n=i)return!1}return!0}function u(e){return!!e&&e.some(o=>o.minScale!=null||o.layerDefinition&&o.layerDefinition.minScale!=null)}export{d as i,g as n,u as t}; diff --git a/assets/symbolColorUtils.d5fe1bd7.js b/assets/symbolColorUtils.36aaa708.js similarity index 62% rename from assets/symbolColorUtils.d5fe1bd7.js rename to assets/symbolColorUtils.36aaa708.js index 9a1feb6..5c14c36 100644 --- a/assets/symbolColorUtils.d5fe1bd7.js +++ b/assets/symbolColorUtils.36aaa708.js @@ -1 +1 @@ -import"./index.d94abe07.js";var i;(function(e){e[e.Multiply=1]="Multiply",e[e.Ignore=2]="Ignore",e[e.Replace=3]="Replace",e[e.Tint=4]="Tint"})(i||(i={}));export{i as r}; +import"./index.221827cd.js";var i;(function(e){e[e.Multiply=1]="Multiply",e[e.Ignore=2]="Ignore",e[e.Replace=3]="Replace",e[e.Tint=4]="Tint"})(i||(i={}));export{i as r}; diff --git a/assets/symbolLayerUtils.072aa491.js b/assets/symbolLayerUtils.5e2d5733.js similarity index 67% rename from assets/symbolLayerUtils.072aa491.js rename to assets/symbolLayerUtils.5e2d5733.js index 97c93e7..e20b713 100644 --- a/assets/symbolLayerUtils.072aa491.js +++ b/assets/symbolLayerUtils.5e2d5733.js @@ -1 +1 @@ -import{fd as p,n as i,c,U as d,hG as b,hH as w,ba as v,at as z,dU as g,hI as j}from"./index.d94abe07.js";let s=y();function y(){return new p(50)}function x(){s=y()}function P(e,r){if(e.type==="icon")return f(e,r);if(e.type==="object")return l(e,r);throw new i("symbol3d:unsupported-symbol-layer","computeLayerSize only works with symbol layers of type Icon and Object")}async function O(e,r){if(e.type==="icon")return L(e,r);if(e.type==="object")return B(e,r);throw new i("symbol3d:unsupported-symbol-layer","computeLayerSize only works with symbol layers of type Icon and Object")}async function f(e,r){var t,o;if((t=e.resource)!=null&&t.href)return _(e.resource.href).then(n=>[n.width,n.height]);if((o=e.resource)!=null&&o.primitive)return c(r)?[r,r]:[256,256];throw new i("symbol3d:invalid-symbol-layer","symbol layers of type Icon must have either an href or a primitive resource")}function L(e,r){return f(e,r).then(t=>{if(e.size==null)return t;const o=t[0]/t[1];return o>1?[e.size,e.size/o]:[e.size*o,e.size]})}function _(e){return d(e,{responseType:"image"}).then(r=>r.data)}function l(e,r){return I(e,r).then(t=>b(t))}async function B(e,r){const t=await l(e,r);return w(t,e)}async function I(e,r){var o;if(!e.isPrimitive){const n=v((o=e.resource)==null?void 0:o.href),u=s.get(n);if(u!==void 0)return u;const m=await z(()=>import("./objectResourceUtils.996108d7.js").then(function(h){return h.o}),["assets/objectResourceUtils.996108d7.js","assets/devEnvironmentUtils.d8d0484c.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/BufferView.89055914.js","assets/vec33.4564cd5b.js","assets/DefaultMaterial_COLOR_GAMMA.bf8213a8.js","assets/types.44c7402c.js","assets/enums.2d9e6f64.js","assets/Version.59f2da65.js","assets/quat.b3994f2f.js","assets/quatf64.4ae3e6f1.js","assets/requestImageUtils.7b09b5e8.js","assets/OrderIndependentTransparency.4d1575c0.js","assets/Util.ea9235b8.js","assets/sphere.ec1f4496.js","assets/VertexAttribute.42396f25.js","assets/Texture.4c97bad5.js","assets/VertexArrayObject.a4c1d809.js","assets/VertexElementDescriptor.1fdca6da.js","assets/InterleavedLayout.f9d79992.js","assets/vec3f32.1121a836.js","assets/symbolColorUtils.d5fe1bd7.js"]),a=await m.fetch(n,{disableTextures:!0});return s.put(n,a.referenceBoundingBox),a.referenceBoundingBox}let t=null;if(e.resource&&e.resource.primitive&&(t=g(j(e.resource.primitive)),c(r)))for(let n=0;n[n.width,n.height]);if((o=e.resource)!=null&&o.primitive)return c(r)?[r,r]:[256,256];throw new i("symbol3d:invalid-symbol-layer","symbol layers of type Icon must have either an href or a primitive resource")}function L(e,r){return f(e,r).then(t=>{if(e.size==null)return t;const o=t[0]/t[1];return o>1?[e.size,e.size/o]:[e.size*o,e.size]})}function _(e){return d(e,{responseType:"image"}).then(r=>r.data)}function l(e,r){return I(e,r).then(t=>b(t))}async function B(e,r){const t=await l(e,r);return w(t,e)}async function I(e,r){var o;if(!e.isPrimitive){const n=v((o=e.resource)==null?void 0:o.href),u=s.get(n);if(u!==void 0)return u;const m=await z(()=>import("./objectResourceUtils.dfe6cb73.js").then(function(h){return h.o}),["assets/objectResourceUtils.dfe6cb73.js","assets/devEnvironmentUtils.d8d0484c.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/mat3f64.6d32a1d7.js","assets/mat4f64.ff2a477c.js","assets/BufferView.6eee27cd.js","assets/vec33.46fc6802.js","assets/DefaultMaterial_COLOR_GAMMA.8ee780a2.js","assets/types.44c7402c.js","assets/enums.2d9e6f64.js","assets/Version.433fbe58.js","assets/quat.d9562009.js","assets/quatf64.4ae3e6f1.js","assets/requestImageUtils.1f5d4b6d.js","assets/OrderIndependentTransparency.4d1575c0.js","assets/Util.f17667f9.js","assets/sphere.f99ddb50.js","assets/VertexAttribute.42396f25.js","assets/Texture.940076b2.js","assets/VertexArrayObject.53cf1857.js","assets/VertexElementDescriptor.1fdca6da.js","assets/InterleavedLayout.30cdc193.js","assets/vec3f32.1121a836.js","assets/symbolColorUtils.36aaa708.js"]),a=await m.fetch(n,{disableTextures:!0});return s.put(n,a.referenceBoundingBox),a.referenceBoundingBox}let t=null;if(e.resource&&e.resource.primitive&&(t=g(j(e.resource.primitive)),c(r)))for(let n=0;n=r?(o.col=l-r,o.world+=1):o.col=l,o.row=w,o}export{d as l}; +import"./index.221827cd.js";function d(c,t,e,n){const o=c.clone(),r=1<=r?(o.col=l-r,o.world+=1):o.col=l,o.row=w,o}export{d as l}; diff --git a/assets/timeSupport.668a2439.js b/assets/timeSupport.968e62fc.js similarity index 95% rename from assets/timeSupport.668a2439.js rename to assets/timeSupport.968e62fc.js index 7c3ca39..bbc290f 100644 --- a/assets/timeSupport.668a2439.js +++ b/assets/timeSupport.968e62fc.js @@ -1 +1 @@ -import{fi as N,fj as E,aC as d,cm as I,aW as m,fk as T,fl as w,at as C,aJ as v,n as y,bJ as G,aA as _}from"./index.d94abe07.js";import{f as $}from"./projectionSupport.0542c13b.js";import{v as p}from"./utils.399e6089.js";function q(e){return e==="mesh"?N:E(e)}function P(e,t){return e?t?4:3:t?3:2}function M(e,t,i,r){return b(e,t,i,r.coords[0],r.coords[1])}function F(e,t,i,r,s,n){const l=P(s,n),{coords:a,lengths:u}=r;if(!u)return!1;for(let o=0,c=0;o=l||R=l)&&h+(l-f)/(R-f)*(A-h)import("./geometryEngineJSON.3d6e7890.js"),["assets/geometryEngineJSON.3d6e7890.js","assets/geometryEngineBase.82b25ca5.js","assets/geometryEngineJSON.f9e9a36f.js","assets/json.879c9adc.js"])}function z(e,t,i,r,s){if(d(t)&&i==="esriGeometryPoint"&&(e==="esriSpatialRelIntersects"||e==="esriSpatialRelContains")){const n=I(new v,t,!1,!1);return Promise.resolve(l=>M(n,!1,!1,l))}if(d(t)&&i==="esriGeometryMultipoint"){const n=I(new v,t,!1,!1);if(e==="esriSpatialRelContains")return Promise.resolve(l=>F(n,!1,!1,l,r,s))}if(m(t)&&i==="esriGeometryPoint"&&(e==="esriSpatialRelIntersects"||e==="esriSpatialRelContains"))return Promise.resolve(n=>T(t,p(i,r,s,n)));if(m(t)&&i==="esriGeometryMultipoint"&&e==="esriSpatialRelContains")return Promise.resolve(n=>w(t,p(i,r,s,n)));if(m(t)&&e==="esriSpatialRelIntersects"){const n=q(i);return Promise.resolve(l=>n(t,p(i,r,s,l)))}return U().then(n=>{const l=n[x[e]].bind(null,t.spatialReference,t);return a=>l(p(i,r,s,a))})}async function B(e,t,i){const{spatialRel:r,geometry:s}=e;if(s){if(!O(r))throw new y(S,"Unsupported query spatial relationship",{query:e});if(G(s.spatialReference)&&G(i)){if(!D(s))throw new y(S,"Unsupported query geometry type",{query:e});if(!J(t))throw new y(S,"Unsupported layer geometry type",{query:e});if(e.outSR)return $(e.geometry&&e.geometry.spatialReference,e.outSR)}}}function H(e){if(m(e))return!0;if(d(e)){for(const t of e.rings)if(t.length!==5||t[0][0]!==t[1][0]||t[0][0]!==t[4][0]||t[2][0]!==t[3][0]||t[0][1]!==t[3][1]||t[0][1]!==t[4][1]||t[1][1]!==t[2][1])return!1;return!0}return!1}function K(e,t){if(!e)return null;const i=t.featureAdapter,{startTimeField:r,endTimeField:s}=e;let n=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;if(r&&s)t.forEach(a=>{const u=i.getAttribute(a,r),o=i.getAttribute(a,s);u==null||isNaN(u)||(n=Math.min(n,u)),o==null||isNaN(o)||(l=Math.max(l,o))});else{const a=r||s;t.forEach(u=>{const o=i.getAttribute(u,a);o==null||isNaN(o)||(n=Math.min(n,o),l=Math.max(l,o))})}return{start:n,end:l}}function Q(e,t,i){if(!t||!e)return null;const{startTimeField:r,endTimeField:s}=e;if(!r&&!s)return null;const{start:n,end:l}=t;return n===null&&l===null?null:n===void 0&&l===void 0?Y():r&&s?V(i,r,s,n,l):W(i,r||s,n,l)}function V(e,t,i,r,s){return r!=null&&s!=null?n=>{const l=e.getAttribute(n,t),a=e.getAttribute(n,i);return(l==null||l<=s)&&(a==null||a>=r)}:r!=null?n=>{const l=e.getAttribute(n,i);return l==null||l>=r}:s!=null?n=>{const l=e.getAttribute(n,t);return l==null||l<=s}:void 0}function W(e,t,i,r){return i!=null&&r!=null&&i===r?s=>e.getAttribute(s,t)===i:i!=null&&r!=null?s=>{const n=e.getAttribute(s,t);return n>=i&&n<=r}:i!=null?s=>e.getAttribute(s,t)>=i:r!=null?s=>e.getAttribute(s,t)<=r:void 0}function Y(){return()=>!1}export{H as I,B as P,Q as n,K as t,z as v}; +import{fi as N,fj as E,aC as d,cm as I,aW as m,fk as T,fl as w,at as C,aJ as v,n as y,bJ as G,aA as _}from"./index.221827cd.js";import{f as $}from"./projectionSupport.4f5da4af.js";import{v as p}from"./utils.e42485ea.js";function q(e){return e==="mesh"?N:E(e)}function P(e,t){return e?t?4:3:t?3:2}function M(e,t,i,r){return b(e,t,i,r.coords[0],r.coords[1])}function F(e,t,i,r,s,n){const l=P(s,n),{coords:a,lengths:u}=r;if(!u)return!1;for(let o=0,c=0;o=l||R=l)&&h+(l-f)/(R-f)*(A-h)import("./geometryEngineJSON.3d6e7890.js"),["assets/geometryEngineJSON.3d6e7890.js","assets/geometryEngineBase.82b25ca5.js","assets/geometryEngineJSON.f9e9a36f.js","assets/json.879c9adc.js"])}function z(e,t,i,r,s){if(d(t)&&i==="esriGeometryPoint"&&(e==="esriSpatialRelIntersects"||e==="esriSpatialRelContains")){const n=I(new v,t,!1,!1);return Promise.resolve(l=>M(n,!1,!1,l))}if(d(t)&&i==="esriGeometryMultipoint"){const n=I(new v,t,!1,!1);if(e==="esriSpatialRelContains")return Promise.resolve(l=>F(n,!1,!1,l,r,s))}if(m(t)&&i==="esriGeometryPoint"&&(e==="esriSpatialRelIntersects"||e==="esriSpatialRelContains"))return Promise.resolve(n=>T(t,p(i,r,s,n)));if(m(t)&&i==="esriGeometryMultipoint"&&e==="esriSpatialRelContains")return Promise.resolve(n=>w(t,p(i,r,s,n)));if(m(t)&&e==="esriSpatialRelIntersects"){const n=q(i);return Promise.resolve(l=>n(t,p(i,r,s,l)))}return U().then(n=>{const l=n[x[e]].bind(null,t.spatialReference,t);return a=>l(p(i,r,s,a))})}async function B(e,t,i){const{spatialRel:r,geometry:s}=e;if(s){if(!O(r))throw new y(S,"Unsupported query spatial relationship",{query:e});if(G(s.spatialReference)&&G(i)){if(!D(s))throw new y(S,"Unsupported query geometry type",{query:e});if(!J(t))throw new y(S,"Unsupported layer geometry type",{query:e});if(e.outSR)return $(e.geometry&&e.geometry.spatialReference,e.outSR)}}}function H(e){if(m(e))return!0;if(d(e)){for(const t of e.rings)if(t.length!==5||t[0][0]!==t[1][0]||t[0][0]!==t[4][0]||t[2][0]!==t[3][0]||t[0][1]!==t[3][1]||t[0][1]!==t[4][1]||t[1][1]!==t[2][1])return!1;return!0}return!1}function K(e,t){if(!e)return null;const i=t.featureAdapter,{startTimeField:r,endTimeField:s}=e;let n=Number.POSITIVE_INFINITY,l=Number.NEGATIVE_INFINITY;if(r&&s)t.forEach(a=>{const u=i.getAttribute(a,r),o=i.getAttribute(a,s);u==null||isNaN(u)||(n=Math.min(n,u)),o==null||isNaN(o)||(l=Math.max(l,o))});else{const a=r||s;t.forEach(u=>{const o=i.getAttribute(u,a);o==null||isNaN(o)||(n=Math.min(n,o),l=Math.max(l,o))})}return{start:n,end:l}}function Q(e,t,i){if(!t||!e)return null;const{startTimeField:r,endTimeField:s}=e;if(!r&&!s)return null;const{start:n,end:l}=t;return n===null&&l===null?null:n===void 0&&l===void 0?Y():r&&s?V(i,r,s,n,l):W(i,r||s,n,l)}function V(e,t,i,r,s){return r!=null&&s!=null?n=>{const l=e.getAttribute(n,t),a=e.getAttribute(n,i);return(l==null||l<=s)&&(a==null||a>=r)}:r!=null?n=>{const l=e.getAttribute(n,i);return l==null||l>=r}:s!=null?n=>{const l=e.getAttribute(n,t);return l==null||l<=s}:void 0}function W(e,t,i,r){return i!=null&&r!=null&&i===r?s=>e.getAttribute(s,t)===i:i!=null&&r!=null?s=>{const n=e.getAttribute(s,t);return n>=i&&n<=r}:i!=null?s=>e.getAttribute(s,t)>=i:r!=null?s=>e.getAttribute(s,t)<=r:void 0}function Y(){return()=>!1}export{H as I,B as P,Q as n,K as t,z as v}; diff --git a/assets/tooltip.e0637362.js b/assets/tooltip.1fb2f0ea.js similarity index 99% rename from assets/tooltip.e0637362.js rename to assets/tooltip.1fb2f0ea.js index 2ed6d79..d65f91c 100644 --- a/assets/tooltip.e0637362.js +++ b/assets/tooltip.1fb2f0ea.js @@ -1,8 +1,8 @@ -import{B as Xt,at as Yt,ht as qt,g as Gt,p as Jt,H as Kt,hp as Qt,h as W,t as Zt,a as te,hq as ee}from"./index.d94abe07.js";import{g as ne}from"./guid.ae96513b.js";/*! +import{B as Xt,at as Yt,ht as qt,g as Gt,p as Jt,H as Kt,hp as Qt,h as W,t as Zt,a as te,hq as ee}from"./index.221827cd.js";import{g as ne}from"./guid.ae96513b.js";/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.0-beta.97 - */var ie=typeof global=="object"&&global&&global.Object===Object&&global,oe=typeof self=="object"&&self&&self.Object===Object&&self,Ct=ie||oe||Function("return this")(),G=Ct.Symbol,St=Object.prototype,re=St.hasOwnProperty,se=St.toString,F=G?G.toStringTag:void 0;function ae(t){var e=re.call(t,F),n=t[F];try{t[F]=void 0;var i=!0}catch{}var o=se.call(t);return i&&(e?t[F]=n:delete t[F]),o}var ce=Object.prototype,le=ce.toString;function fe(t){return le.call(t)}var ue="[object Null]",de="[object Undefined]",mt=G?G.toStringTag:void 0;function me(t){return t==null?t===void 0?de:ue:mt&&mt in Object(t)?ae(t):fe(t)}function he(t){return t!=null&&typeof t=="object"}var pe="[object Symbol]";function ge(t){return typeof t=="symbol"||he(t)&&me(t)==pe}var ve=/\s/;function we(t){for(var e=t.length;e--&&ve.test(t.charAt(e)););return e}var ye=/^\s+/;function be(t){return t&&t.slice(0,we(t)+1).replace(ye,"")}function nt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var ht=0/0,xe=/^[-+]0x[0-9a-f]+$/i,Te=/^0b[01]+$/i,Ee=/^0o[0-7]+$/i,Re=parseInt;function pt(t){if(typeof t=="number")return t;if(ge(t))return ht;if(nt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=nt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=be(t);var n=Te.test(t);return n||Ee.test(t)?Re(t.slice(2),n?2:8):xe.test(t)?ht:+t}var et=function(){return Ct.Date.now()},Pe="Expected a function",Oe=Math.max,Ae=Math.min;function Le(t,e,n){var i,o,a,s,r,c,f=0,m=!1,l=!1,u=!0;if(typeof t!="function")throw new TypeError(Pe);e=pt(e)||0,nt(n)&&(m=!!n.leading,l="maxWait"in n,a=l?Oe(pt(n.maxWait)||0,e):a,u="trailing"in n?!!n.trailing:u);function h(p){var P=i,E=o;return i=o=void 0,f=p,s=t.apply(E,P),s}function d(p){return f=p,r=setTimeout(b,e),m?h(p):s}function y(p){var P=p-c,E=p-f,R=e-P;return l?Ae(R,a-E):R}function g(p){var P=p-c,E=p-f;return c===void 0||P>=e||P<0||l&&E>=a}function b(){var p=et();if(g(p))return v(p);r=setTimeout(b,y(p))}function v(p){return r=void 0,u&&i?h(p):(i=o=void 0,s)}function x(){r!==void 0&&clearTimeout(r),f=0,i=c=o=r=void 0}function w(){return r===void 0?s:v(et())}function T(){var p=et(),P=g(p);if(i=arguments,o=this,c=p,P){if(r===void 0)return d(c);if(l)return clearTimeout(r),r=setTimeout(b,e),h(c)}return r===void 0&&(r=setTimeout(b,e)),s}return T.cancel=x,T.flush=w,T}function N(t){return t.split("-")[0]}function B(t){return t.split("-")[1]}function X(t){return["top","bottom"].includes(N(t))?"x":"y"}function ct(t){return t==="y"?"height":"width"}function gt(t,e,n){let{reference:i,floating:o}=t;const a=i.x+i.width/2-o.width/2,s=i.y+i.height/2-o.height/2,r=X(e),c=ct(r),f=i[c]/2-o[c]/2,m=N(e),l=r==="x";let u;switch(m){case"top":u={x:a,y:i.y-o.height};break;case"bottom":u={x:a,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:s};break;case"left":u={x:i.x-o.width,y:s};break;default:u={x:i.x,y:i.y}}switch(B(e)){case"start":u[r]-=f*(n&&l?-1:1);break;case"end":u[r]+=f*(n&&l?-1:1);break}return u}const ke=async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:a=[],platform:s}=n,r=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:m}=gt(c,i,r),l=i,u={},h=0;for(let d=0;d({name:"arrow",options:t,async fn(e){const{element:n,padding:i=0}=t!=null?t:{},{x:o,y:a,placement:s,rects:r,platform:c}=e;if(n==null)return{};const f=Ht(i),m={x:o,y:a},l=X(s),u=B(s),h=ct(l),d=await c.getDimensions(n),y=l==="y"?"top":"left",g=l==="y"?"bottom":"right",b=r.reference[h]+r.reference[l]-m[l]-r.floating[h],v=m[l]-r.reference[l],x=await(c.getOffsetParent==null?void 0:c.getOffsetParent(n));let w=x?l==="y"?x.clientHeight||0:x.clientWidth||0:0;w===0&&(w=r.floating[h]);const T=b/2-v/2,p=f[y],P=w-d[h]-f[g],E=w/2-d[h]/2+T,R=it(p,E,P),I=(u==="start"?f[y]:f[g])>0&&E!==R&&r.reference[h]<=r.floating[h]?E_e[e])}function Dt(t,e,n){n===void 0&&(n=!1);const i=B(t),o=X(t),a=ct(o);let s=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=K(s)),{main:s,cross:K(s)}}const $e={start:"end",end:"start"};function ot(t){return t.replace(/start|end/g,e=>$e[e])}const _t=["top","right","bottom","left"],Ie=_t.reduce((t,e)=>t.concat(e,e+"-start",e+"-end"),[]);function je(t,e,n){return(t?[...n.filter(o=>B(o)===t),...n.filter(o=>B(o)!==t)]:n.filter(o=>N(o)===o)).filter(o=>t?B(o)===t||(e?ot(o)!==o:!1):!0)}const Be=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,i,o,a,s;const{x:r,y:c,rects:f,middlewareData:m,placement:l,platform:u,elements:h}=e,{alignment:d=null,allowedPlacements:y=Ie,autoAlignment:g=!0,...b}=t,v=je(d,g,y),x=await U(e,b),w=(n=(i=m.autoPlacement)==null?void 0:i.index)!=null?n:0,T=v[w];if(T==null)return{};const{main:p,cross:P}=Dt(T,f,await(u.isRTL==null?void 0:u.isRTL(h.floating)));if(l!==T)return{x:r,y:c,reset:{placement:v[0]}};const E=[x[N(T)],x[p],x[P]],R=[...(o=(a=m.autoPlacement)==null?void 0:a.overflows)!=null?o:[],{placement:T,overflows:E}],S=v[w+1];if(S)return{data:{index:w+1,overflows:R},reset:{placement:S}};const H=R.slice().sort((A,M)=>A.overflows[0]-M.overflows[0]),I=(s=H.find(A=>{let{overflows:M}=A;return M.every(zt=>zt<=0)}))==null?void 0:s.placement,j=I!=null?I:H[0].placement;return j!==l?{data:{index:w+1,overflows:R},reset:{placement:j}}:{}}}};function Ne(t){const e=K(t);return[ot(t),e,ot(e)]}const vt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:r,elements:c}=e,{mainAxis:f=!0,crossAxis:m=!0,fallbackPlacements:l,fallbackStrategy:u="bestFit",flipAlignment:h=!0,...d}=t,y=N(i),b=l||(y===s||!h?[K(s)]:Ne(s)),v=[s,...b],x=await U(e,d),w=[];let T=((n=o.flip)==null?void 0:n.overflows)||[];if(f&&w.push(x[y]),m){const{main:R,cross:S}=Dt(i,a,await(r.isRTL==null?void 0:r.isRTL(c.floating)));w.push(x[R],x[S])}if(T=[...T,{placement:i,overflows:w}],!w.every(R=>R<=0)){var p,P;const R=((p=(P=o.flip)==null?void 0:P.index)!=null?p:0)+1,S=v[R];if(S)return{data:{index:R,overflows:T},reset:{placement:S}};let H="bottom";switch(u){case"bestFit":{var E;const I=(E=T.map(j=>[j,j.overflows.filter(A=>A>0).reduce((A,M)=>A+M,0)]).sort((j,A)=>j[1]-A[1])[0])==null?void 0:E[0].placement;I&&(H=I);break}case"initialPlacement":H=s;break}if(i!==H)return{reset:{placement:H}}}return{}}}};function wt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function yt(t){return _t.some(e=>t[e]>=0)}const Me=function(t){let{strategy:e="referenceHidden",...n}=t===void 0?{}:t;return{name:"hide",async fn(i){const{rects:o}=i;switch(e){case"referenceHidden":{const a=await U(i,{...n,elementContext:"reference"}),s=wt(a,o.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:yt(s)}}}case"escaped":{const a=await U(i,{...n,altBoundary:!0}),s=wt(a,o.floating);return{data:{escapedOffsets:s,escaped:yt(s)}}}default:return{}}}}};async function We(t,e){const{placement:n,platform:i,elements:o}=t,a=await(i.isRTL==null?void 0:i.isRTL(o.floating)),s=N(n),r=B(n),c=X(n)==="x",f=["left","top"].includes(s)?-1:1,m=a&&c?-1:1,l=typeof e=="function"?e(t):e;let{mainAxis:u,crossAxis:h,alignmentAxis:d}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...l};return r&&typeof d=="number"&&(h=r==="end"?d*-1:d),c?{x:h*m,y:u*f}:{x:u*f,y:h*m}}const Fe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:i}=e,o=await We(e,t);return{x:n+o.x,y:i+o.y,data:o}}}};function Ve(t){return t==="x"?"y":"x"}const Ue=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:r={fn:g=>{let{x:b,y:v}=g;return{x:b,y:v}}},...c}=t,f={x:n,y:i},m=await U(e,c),l=X(N(o)),u=Ve(l);let h=f[l],d=f[u];if(a){const g=l==="y"?"top":"left",b=l==="y"?"bottom":"right",v=h+m[g],x=h-m[b];h=it(v,h,x)}if(s){const g=u==="y"?"top":"left",b=u==="y"?"bottom":"right",v=d+m[g],x=d-m[b];d=it(v,d,x)}const y=r.fn({...e,[l]:h,[u]:d});return{...y,data:{x:y.x-n,y:y.y-i}}}}};function $t(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function C(t){if(t==null)return window;if(!$t(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function D(t){return C(t).getComputedStyle(t)}function _(t){return $t(t)?"":t?(t.nodeName||"").toLowerCase():""}function It(){const t=navigator.userAgentData;return t!=null&&t.brands?t.brands.map(e=>e.brand+"/"+e.version).join(" "):navigator.userAgent}function O(t){return t instanceof C(t).HTMLElement}function L(t){return t instanceof C(t).Element}function ze(t){return t instanceof C(t).Node}function z(t){if(typeof ShadowRoot=="undefined")return!1;const e=C(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Y(t){const{overflow:e,overflowX:n,overflowY:i,display:o}=D(t);return/auto|scroll|overlay|hidden/.test(e+i+n)&&!["inline","contents"].includes(o)}function Xe(t){return["table","td","th"].includes(_(t))}function jt(t){const e=/firefox/i.test(It()),n=D(t);return n.transform!=="none"||n.perspective!=="none"||e&&n.willChange==="filter"||e&&(n.filter?n.filter!=="none":!1)||["transform","perspective"].some(i=>n.willChange.includes(i))||["paint","layout","strict","content"].some(i=>{const o=n.contain;return o!=null?o.includes(i):!1})}function Bt(){return!/^((?!chrome|android).)*safari/i.test(It())}function lt(t){return["html","body","#document"].includes(_(t))}const bt=Math.min,V=Math.max,Q=Math.round;function k(t,e,n){var i,o,a,s;e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect();let c=1,f=1;e&&O(t)&&(c=t.offsetWidth>0&&Q(r.width)/t.offsetWidth||1,f=t.offsetHeight>0&&Q(r.height)/t.offsetHeight||1);const m=L(t)?C(t):window,l=!Bt()&&n,u=(r.left+(l&&(i=(o=m.visualViewport)==null?void 0:o.offsetLeft)!=null?i:0))/c,h=(r.top+(l&&(a=(s=m.visualViewport)==null?void 0:s.offsetTop)!=null?a:0))/f,d=r.width/c,y=r.height/f;return{width:d,height:y,top:h,right:u+d,bottom:h+y,left:u,x:u,y:h}}function $(t){return((ze(t)?t.ownerDocument:t.document)||window.document).documentElement}function tt(t){return L(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Nt(t){return k($(t)).left+tt(t).scrollLeft}function Ye(t){const e=k(t);return Q(e.width)!==t.offsetWidth||Q(e.height)!==t.offsetHeight}function qe(t,e,n){const i=O(e),o=$(e),a=k(t,i&&Ye(e),n==="fixed");let s={scrollLeft:0,scrollTop:0};const r={x:0,y:0};if(i||!i&&n!=="fixed")if((_(e)!=="body"||Y(o))&&(s=tt(e)),O(e)){const c=k(e,!0);r.x=c.x+e.clientLeft,r.y=c.y+e.clientTop}else o&&(r.x=Nt(o));return{x:a.left+s.scrollLeft-r.x,y:a.top+s.scrollTop-r.y,width:a.width,height:a.height}}function ft(t){return _(t)==="html"?t:t.assignedSlot||t.parentNode||(z(t)?t.host:null)||$(t)}function xt(t){return!O(t)||D(t).position==="fixed"?null:t.offsetParent}function Ge(t){let e=ft(t);for(z(e)&&(e=e.host);O(e)&&!lt(e);){if(jt(e))return e;{const n=e.parentNode;e=z(n)?n.host:n}}return null}function rt(t){const e=C(t);let n=xt(t);for(;n&&Xe(n)&&D(n).position==="static";)n=xt(n);return n&&(_(n)==="html"||_(n)==="body"&&D(n).position==="static"&&!jt(n))?e:n||Ge(t)||e}function Tt(t){if(O(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=k(t);return{width:e.width,height:e.height}}function Je(t){let{rect:e,offsetParent:n,strategy:i}=t;const o=O(n),a=$(n);if(n===a)return e;let s={scrollLeft:0,scrollTop:0};const r={x:0,y:0};if((o||!o&&i!=="fixed")&&((_(n)!=="body"||Y(a))&&(s=tt(n)),O(n))){const c=k(n,!0);r.x=c.x+n.clientLeft,r.y=c.y+n.clientTop}return{...e,x:e.x-s.scrollLeft+r.x,y:e.y-s.scrollTop+r.y}}function Ke(t,e){const n=C(t),i=$(t),o=n.visualViewport;let a=i.clientWidth,s=i.clientHeight,r=0,c=0;if(o){a=o.width,s=o.height;const f=Bt();(f||!f&&e==="fixed")&&(r=o.offsetLeft,c=o.offsetTop)}return{width:a,height:s,x:r,y:c}}function Qe(t){var e;const n=$(t),i=tt(t),o=(e=t.ownerDocument)==null?void 0:e.body,a=V(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=V(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let r=-i.scrollLeft+Nt(t);const c=-i.scrollTop;return D(o||n).direction==="rtl"&&(r+=V(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:s,x:r,y:c}}function Mt(t){const e=ft(t);return lt(e)?t.ownerDocument.body:O(e)&&Y(e)?e:Mt(e)}function Z(t,e){var n;e===void 0&&(e=[]);const i=Mt(t),o=i===((n=t.ownerDocument)==null?void 0:n.body),a=C(i),s=o?[a].concat(a.visualViewport||[],Y(i)?i:[]):i,r=e.concat(s);return o?r:r.concat(Z(s))}function Ze(t,e){const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&z(n)){let i=e;do{if(i&&t===i)return!0;i=i.parentNode||i.host}while(i)}return!1}function tn(t,e){let n=t;for(;n&&!lt(n)&&!e.includes(n)&&!(L(n)&&["absolute","fixed"].includes(D(n).position));){const i=ft(n);n=z(i)?i.host:i}return n}function en(t,e){const n=k(t,!1,e==="fixed"),i=n.top+t.clientTop,o=n.left+t.clientLeft;return{top:i,left:o,x:o,y:i,right:o+t.clientWidth,bottom:i+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}function Et(t,e,n){return e==="viewport"?J(Ke(t,n)):L(e)?en(e,n):J(Qe($(t)))}function nn(t){const e=Z(t),n=tn(t,e);let i=null;if(n&&O(n)){const o=rt(n);Y(n)?i=n:O(o)&&(i=o)}return L(i)?e.filter(o=>i&&L(o)&&Ze(o,i)&&_(o)!=="body"):[]}function on(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t;const s=[...n==="clippingAncestors"?nn(e):[].concat(n),i],r=s[0],c=s.reduce((f,m)=>{const l=Et(e,m,o);return f.top=V(l.top,f.top),f.right=bt(l.right,f.right),f.bottom=bt(l.bottom,f.bottom),f.left=V(l.left,f.left),f},Et(e,r,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}const q={getClippingRect:on,convertOffsetParentRelativeRectToViewportRelativeRect:Je,isElement:L,getDimensions:Tt,getOffsetParent:rt,getDocumentElement:$,getElementRects:t=>{let{reference:e,floating:n,strategy:i}=t;return{reference:qe(e,rt(n),i),floating:{...Tt(n),x:0,y:0}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>D(t).direction==="rtl"};function rn(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s=!0,animationFrame:r=!1}=i,c=o&&!r,f=c||a?[...L(t)?Z(t):[],...Z(e)]:[];f.forEach(d=>{c&&d.addEventListener("scroll",n,{passive:!0}),a&&d.addEventListener("resize",n)});let m=null;if(s){let d=!0;m=new ResizeObserver(()=>{d||n(),d=!1}),L(t)&&!r&&m.observe(t),m.observe(e)}let l,u=r?k(t):null;r&&h();function h(){const d=k(t);u&&(d.x!==u.x||d.y!==u.y||d.width!==u.width||d.height!==u.height)&&n(),u=d,l=requestAnimationFrame(h)}return n(),()=>{var d;f.forEach(y=>{c&&y.removeEventListener("scroll",n),a&&y.removeEventListener("resize",n)}),(d=m)==null||d.disconnect(),m=null,r&&cancelAnimationFrame(l)}}const sn=(t,e,n)=>ke(t,e,{platform:q,...n}),an=globalThis.calciteComponentsConfig,cn={floatingUINonChromiumPositioningFix:!0,...an},ln=fn();async function fn(){function t(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(n=>`${n.brand}/${n.version}`).join(" "):navigator.userAgent}if(Xt.isBrowser&&cn.floatingUINonChromiumPositioningFix&&/firefox|safari/i.test(t())){const{getClippingRect:e,getElementRects:n,getOffsetParent:i}=await Yt(()=>import("./nonChromiumPlatformUtils.79814374.js"),["assets/nonChromiumPlatformUtils.79814374.js","assets/index.d94abe07.js","assets/index.f5419ca5.css","assets/guid.ae96513b.js"]);q.getClippingRect=e,q.getOffsetParent=i,q.getElementRects=n}}const Wt="data-placement",Rt=100,Pt=["top","bottom","right","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end"],st={animation:"calcite-floating-ui-anim",animationActive:"calcite-floating-ui-anim--active"};function un({placement:t,disableFlip:e,flipPlacements:n,offsetDistance:i,offsetSkidding:o,arrowEl:a,type:s}){const r=[Ue(),Me()];if(s==="menu")return[...r,vt({fallbackPlacements:n||["top-start","top","top-end","bottom-start","bottom","bottom-end"]})];if(s==="popover"||s==="tooltip"){const c=[...r,Fe({mainAxis:typeof i=="number"?i:0,crossAxis:typeof o=="number"?o:0})];return t==="auto"||t==="auto-start"||t==="auto-end"?c.push(Be({alignment:t==="auto-start"?"start":t==="auto-end"?"end":null})):e||c.push(vt(n?{fallbackPlacements:n}:{})),a&&c.push(De({element:a})),c}return[]}function On(t,e){const n=t.filter(i=>Pt.includes(i));return n.length!==t.length&&console.warn(`${e.tagName}: Invalid value found in: flipPlacements. Try any of these: ${Pt.map(i=>`"${i}"`).join(", ").trim()}`,{el:e}),n}function dn(t,e){const n=["left","right"];return Gt(t)==="rtl"&&n.reverse(),e.replace(/-leading/gi,"-start").replace(/-trailing/gi,"-end").replace(/leading/gi,n[0]).replace(/trailing/gi,n[1])}async function mn(t,e,n=!1){if(!!t.open)return n?hn(e):Ft(e)}const hn=Le(Ft,Rt,{leading:!0,maxWait:Rt});async function Ft({referenceEl:t,floatingEl:e,overlayPositioning:n="absolute",placement:i,disableFlip:o,flipPlacements:a,offsetDistance:s,offsetSkidding:r,includeArrow:c=!1,arrowEl:f,type:m}){var l;if(!t||!e||c&&!f)return null;await ln;const{x:u,y:h,placement:d,strategy:y,middlewareData:g}=await sn(t,e,{strategy:n,placement:i==="auto"||i==="auto-start"||i==="auto-end"?void 0:dn(e,i),middleware:un({placement:i,disableFlip:o,flipPlacements:a,offsetDistance:s,offsetSkidding:r,arrowEl:f,type:m})});if(g!=null&&g.arrow){const{x:T,y:p}=g.arrow;Object.assign(f.style,{left:T!=null?`${T}px`:"",top:p!=null?`${p}px`:""})}const v=((l=g==null?void 0:g.hide)===null||l===void 0?void 0:l.referenceHidden)?"hidden":null,x=v?"none":null;e.setAttribute(Wt,d);const w=`translate(${Math.round(u)}px,${Math.round(h)}px)`;Object.assign(e.style,{visibility:v,pointerEvents:x,position:y,top:"0",left:"0",transform:w})}const at=new WeakMap;function pn(t,e,n){if(!n||!e)return;Vt(t,e,n);const i=t.overlayPositioning;n.style.position=i,i==="absolute"&&Ut(n);const o=rn;at.set(t,o(e,n,()=>t.reposition()))}function Vt(t,e,n){if(!n||!e)return;ut(n).removeEventListener("transitionend",dt);const i=at.get(t);i&&i(),at.delete(t)}const Ot=4,gn=Math.ceil(Math.hypot(Ot,Ot));function vn(t){!t||t.style.position!=="absolute"||ut(t).addEventListener("transitionend",dt)}function ut(t){return t.shadowRoot||t}function dt(t){const e=t.target;if(t.propertyName==="opacity"&&e.classList.contains(st.animation)){const n=wn(e);Ut(n),ut(n).removeEventListener("transitionend",dt)}}function Ut(t){t.style.transform="",t.style.top="-99999px",t.style.left="-99999px"}function wn(t){return qt(t,`[${Wt}]`)}/*! + */var ie=typeof global=="object"&&global&&global.Object===Object&&global,oe=typeof self=="object"&&self&&self.Object===Object&&self,Ct=ie||oe||Function("return this")(),G=Ct.Symbol,St=Object.prototype,re=St.hasOwnProperty,se=St.toString,F=G?G.toStringTag:void 0;function ae(t){var e=re.call(t,F),n=t[F];try{t[F]=void 0;var i=!0}catch{}var o=se.call(t);return i&&(e?t[F]=n:delete t[F]),o}var ce=Object.prototype,le=ce.toString;function fe(t){return le.call(t)}var ue="[object Null]",de="[object Undefined]",mt=G?G.toStringTag:void 0;function me(t){return t==null?t===void 0?de:ue:mt&&mt in Object(t)?ae(t):fe(t)}function he(t){return t!=null&&typeof t=="object"}var pe="[object Symbol]";function ge(t){return typeof t=="symbol"||he(t)&&me(t)==pe}var ve=/\s/;function we(t){for(var e=t.length;e--&&ve.test(t.charAt(e)););return e}var ye=/^\s+/;function be(t){return t&&t.slice(0,we(t)+1).replace(ye,"")}function nt(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var ht=0/0,xe=/^[-+]0x[0-9a-f]+$/i,Te=/^0b[01]+$/i,Ee=/^0o[0-7]+$/i,Re=parseInt;function pt(t){if(typeof t=="number")return t;if(ge(t))return ht;if(nt(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=nt(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=be(t);var n=Te.test(t);return n||Ee.test(t)?Re(t.slice(2),n?2:8):xe.test(t)?ht:+t}var et=function(){return Ct.Date.now()},Pe="Expected a function",Oe=Math.max,Ae=Math.min;function Le(t,e,n){var i,o,a,s,r,c,f=0,m=!1,l=!1,u=!0;if(typeof t!="function")throw new TypeError(Pe);e=pt(e)||0,nt(n)&&(m=!!n.leading,l="maxWait"in n,a=l?Oe(pt(n.maxWait)||0,e):a,u="trailing"in n?!!n.trailing:u);function h(p){var P=i,E=o;return i=o=void 0,f=p,s=t.apply(E,P),s}function d(p){return f=p,r=setTimeout(b,e),m?h(p):s}function y(p){var P=p-c,E=p-f,R=e-P;return l?Ae(R,a-E):R}function g(p){var P=p-c,E=p-f;return c===void 0||P>=e||P<0||l&&E>=a}function b(){var p=et();if(g(p))return v(p);r=setTimeout(b,y(p))}function v(p){return r=void 0,u&&i?h(p):(i=o=void 0,s)}function x(){r!==void 0&&clearTimeout(r),f=0,i=c=o=r=void 0}function w(){return r===void 0?s:v(et())}function T(){var p=et(),P=g(p);if(i=arguments,o=this,c=p,P){if(r===void 0)return d(c);if(l)return clearTimeout(r),r=setTimeout(b,e),h(c)}return r===void 0&&(r=setTimeout(b,e)),s}return T.cancel=x,T.flush=w,T}function N(t){return t.split("-")[0]}function B(t){return t.split("-")[1]}function X(t){return["top","bottom"].includes(N(t))?"x":"y"}function ct(t){return t==="y"?"height":"width"}function gt(t,e,n){let{reference:i,floating:o}=t;const a=i.x+i.width/2-o.width/2,s=i.y+i.height/2-o.height/2,r=X(e),c=ct(r),f=i[c]/2-o[c]/2,m=N(e),l=r==="x";let u;switch(m){case"top":u={x:a,y:i.y-o.height};break;case"bottom":u={x:a,y:i.y+i.height};break;case"right":u={x:i.x+i.width,y:s};break;case"left":u={x:i.x-o.width,y:s};break;default:u={x:i.x,y:i.y}}switch(B(e)){case"start":u[r]-=f*(n&&l?-1:1);break;case"end":u[r]+=f*(n&&l?-1:1);break}return u}const ke=async(t,e,n)=>{const{placement:i="bottom",strategy:o="absolute",middleware:a=[],platform:s}=n,r=await(s.isRTL==null?void 0:s.isRTL(e));let c=await s.getElementRects({reference:t,floating:e,strategy:o}),{x:f,y:m}=gt(c,i,r),l=i,u={},h=0;for(let d=0;d({name:"arrow",options:t,async fn(e){const{element:n,padding:i=0}=t!=null?t:{},{x:o,y:a,placement:s,rects:r,platform:c}=e;if(n==null)return{};const f=Ht(i),m={x:o,y:a},l=X(s),u=B(s),h=ct(l),d=await c.getDimensions(n),y=l==="y"?"top":"left",g=l==="y"?"bottom":"right",b=r.reference[h]+r.reference[l]-m[l]-r.floating[h],v=m[l]-r.reference[l],x=await(c.getOffsetParent==null?void 0:c.getOffsetParent(n));let w=x?l==="y"?x.clientHeight||0:x.clientWidth||0:0;w===0&&(w=r.floating[h]);const T=b/2-v/2,p=f[y],P=w-d[h]-f[g],E=w/2-d[h]/2+T,R=it(p,E,P),I=(u==="start"?f[y]:f[g])>0&&E!==R&&r.reference[h]<=r.floating[h]?E_e[e])}function Dt(t,e,n){n===void 0&&(n=!1);const i=B(t),o=X(t),a=ct(o);let s=o==="x"?i===(n?"end":"start")?"right":"left":i==="start"?"bottom":"top";return e.reference[a]>e.floating[a]&&(s=K(s)),{main:s,cross:K(s)}}const $e={start:"end",end:"start"};function ot(t){return t.replace(/start|end/g,e=>$e[e])}const _t=["top","right","bottom","left"],Ie=_t.reduce((t,e)=>t.concat(e,e+"-start",e+"-end"),[]);function je(t,e,n){return(t?[...n.filter(o=>B(o)===t),...n.filter(o=>B(o)!==t)]:n.filter(o=>N(o)===o)).filter(o=>t?B(o)===t||(e?ot(o)!==o:!1):!0)}const Be=function(t){return t===void 0&&(t={}),{name:"autoPlacement",options:t,async fn(e){var n,i,o,a,s;const{x:r,y:c,rects:f,middlewareData:m,placement:l,platform:u,elements:h}=e,{alignment:d=null,allowedPlacements:y=Ie,autoAlignment:g=!0,...b}=t,v=je(d,g,y),x=await U(e,b),w=(n=(i=m.autoPlacement)==null?void 0:i.index)!=null?n:0,T=v[w];if(T==null)return{};const{main:p,cross:P}=Dt(T,f,await(u.isRTL==null?void 0:u.isRTL(h.floating)));if(l!==T)return{x:r,y:c,reset:{placement:v[0]}};const E=[x[N(T)],x[p],x[P]],R=[...(o=(a=m.autoPlacement)==null?void 0:a.overflows)!=null?o:[],{placement:T,overflows:E}],S=v[w+1];if(S)return{data:{index:w+1,overflows:R},reset:{placement:S}};const H=R.slice().sort((A,M)=>A.overflows[0]-M.overflows[0]),I=(s=H.find(A=>{let{overflows:M}=A;return M.every(zt=>zt<=0)}))==null?void 0:s.placement,j=I!=null?I:H[0].placement;return j!==l?{data:{index:w+1,overflows:R},reset:{placement:j}}:{}}}};function Ne(t){const e=K(t);return[ot(t),e,ot(e)]}const vt=function(t){return t===void 0&&(t={}),{name:"flip",options:t,async fn(e){var n;const{placement:i,middlewareData:o,rects:a,initialPlacement:s,platform:r,elements:c}=e,{mainAxis:f=!0,crossAxis:m=!0,fallbackPlacements:l,fallbackStrategy:u="bestFit",flipAlignment:h=!0,...d}=t,y=N(i),b=l||(y===s||!h?[K(s)]:Ne(s)),v=[s,...b],x=await U(e,d),w=[];let T=((n=o.flip)==null?void 0:n.overflows)||[];if(f&&w.push(x[y]),m){const{main:R,cross:S}=Dt(i,a,await(r.isRTL==null?void 0:r.isRTL(c.floating)));w.push(x[R],x[S])}if(T=[...T,{placement:i,overflows:w}],!w.every(R=>R<=0)){var p,P;const R=((p=(P=o.flip)==null?void 0:P.index)!=null?p:0)+1,S=v[R];if(S)return{data:{index:R,overflows:T},reset:{placement:S}};let H="bottom";switch(u){case"bestFit":{var E;const I=(E=T.map(j=>[j,j.overflows.filter(A=>A>0).reduce((A,M)=>A+M,0)]).sort((j,A)=>j[1]-A[1])[0])==null?void 0:E[0].placement;I&&(H=I);break}case"initialPlacement":H=s;break}if(i!==H)return{reset:{placement:H}}}return{}}}};function wt(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function yt(t){return _t.some(e=>t[e]>=0)}const Me=function(t){let{strategy:e="referenceHidden",...n}=t===void 0?{}:t;return{name:"hide",async fn(i){const{rects:o}=i;switch(e){case"referenceHidden":{const a=await U(i,{...n,elementContext:"reference"}),s=wt(a,o.reference);return{data:{referenceHiddenOffsets:s,referenceHidden:yt(s)}}}case"escaped":{const a=await U(i,{...n,altBoundary:!0}),s=wt(a,o.floating);return{data:{escapedOffsets:s,escaped:yt(s)}}}default:return{}}}}};async function We(t,e){const{placement:n,platform:i,elements:o}=t,a=await(i.isRTL==null?void 0:i.isRTL(o.floating)),s=N(n),r=B(n),c=X(n)==="x",f=["left","top"].includes(s)?-1:1,m=a&&c?-1:1,l=typeof e=="function"?e(t):e;let{mainAxis:u,crossAxis:h,alignmentAxis:d}=typeof l=="number"?{mainAxis:l,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...l};return r&&typeof d=="number"&&(h=r==="end"?d*-1:d),c?{x:h*m,y:u*f}:{x:u*f,y:h*m}}const Fe=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){const{x:n,y:i}=e,o=await We(e,t);return{x:n+o.x,y:i+o.y,data:o}}}};function Ve(t){return t==="x"?"y":"x"}const Ue=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:i,placement:o}=e,{mainAxis:a=!0,crossAxis:s=!1,limiter:r={fn:g=>{let{x:b,y:v}=g;return{x:b,y:v}}},...c}=t,f={x:n,y:i},m=await U(e,c),l=X(N(o)),u=Ve(l);let h=f[l],d=f[u];if(a){const g=l==="y"?"top":"left",b=l==="y"?"bottom":"right",v=h+m[g],x=h-m[b];h=it(v,h,x)}if(s){const g=u==="y"?"top":"left",b=u==="y"?"bottom":"right",v=d+m[g],x=d-m[b];d=it(v,d,x)}const y=r.fn({...e,[l]:h,[u]:d});return{...y,data:{x:y.x-n,y:y.y-i}}}}};function $t(t){return t&&t.document&&t.location&&t.alert&&t.setInterval}function C(t){if(t==null)return window;if(!$t(t)){const e=t.ownerDocument;return e&&e.defaultView||window}return t}function D(t){return C(t).getComputedStyle(t)}function _(t){return $t(t)?"":t?(t.nodeName||"").toLowerCase():""}function It(){const t=navigator.userAgentData;return t!=null&&t.brands?t.brands.map(e=>e.brand+"/"+e.version).join(" "):navigator.userAgent}function O(t){return t instanceof C(t).HTMLElement}function L(t){return t instanceof C(t).Element}function ze(t){return t instanceof C(t).Node}function z(t){if(typeof ShadowRoot=="undefined")return!1;const e=C(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Y(t){const{overflow:e,overflowX:n,overflowY:i,display:o}=D(t);return/auto|scroll|overlay|hidden/.test(e+i+n)&&!["inline","contents"].includes(o)}function Xe(t){return["table","td","th"].includes(_(t))}function jt(t){const e=/firefox/i.test(It()),n=D(t);return n.transform!=="none"||n.perspective!=="none"||e&&n.willChange==="filter"||e&&(n.filter?n.filter!=="none":!1)||["transform","perspective"].some(i=>n.willChange.includes(i))||["paint","layout","strict","content"].some(i=>{const o=n.contain;return o!=null?o.includes(i):!1})}function Bt(){return!/^((?!chrome|android).)*safari/i.test(It())}function lt(t){return["html","body","#document"].includes(_(t))}const bt=Math.min,V=Math.max,Q=Math.round;function k(t,e,n){var i,o,a,s;e===void 0&&(e=!1),n===void 0&&(n=!1);const r=t.getBoundingClientRect();let c=1,f=1;e&&O(t)&&(c=t.offsetWidth>0&&Q(r.width)/t.offsetWidth||1,f=t.offsetHeight>0&&Q(r.height)/t.offsetHeight||1);const m=L(t)?C(t):window,l=!Bt()&&n,u=(r.left+(l&&(i=(o=m.visualViewport)==null?void 0:o.offsetLeft)!=null?i:0))/c,h=(r.top+(l&&(a=(s=m.visualViewport)==null?void 0:s.offsetTop)!=null?a:0))/f,d=r.width/c,y=r.height/f;return{width:d,height:y,top:h,right:u+d,bottom:h+y,left:u,x:u,y:h}}function $(t){return((ze(t)?t.ownerDocument:t.document)||window.document).documentElement}function tt(t){return L(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.pageXOffset,scrollTop:t.pageYOffset}}function Nt(t){return k($(t)).left+tt(t).scrollLeft}function Ye(t){const e=k(t);return Q(e.width)!==t.offsetWidth||Q(e.height)!==t.offsetHeight}function qe(t,e,n){const i=O(e),o=$(e),a=k(t,i&&Ye(e),n==="fixed");let s={scrollLeft:0,scrollTop:0};const r={x:0,y:0};if(i||!i&&n!=="fixed")if((_(e)!=="body"||Y(o))&&(s=tt(e)),O(e)){const c=k(e,!0);r.x=c.x+e.clientLeft,r.y=c.y+e.clientTop}else o&&(r.x=Nt(o));return{x:a.left+s.scrollLeft-r.x,y:a.top+s.scrollTop-r.y,width:a.width,height:a.height}}function ft(t){return _(t)==="html"?t:t.assignedSlot||t.parentNode||(z(t)?t.host:null)||$(t)}function xt(t){return!O(t)||D(t).position==="fixed"?null:t.offsetParent}function Ge(t){let e=ft(t);for(z(e)&&(e=e.host);O(e)&&!lt(e);){if(jt(e))return e;{const n=e.parentNode;e=z(n)?n.host:n}}return null}function rt(t){const e=C(t);let n=xt(t);for(;n&&Xe(n)&&D(n).position==="static";)n=xt(n);return n&&(_(n)==="html"||_(n)==="body"&&D(n).position==="static"&&!jt(n))?e:n||Ge(t)||e}function Tt(t){if(O(t))return{width:t.offsetWidth,height:t.offsetHeight};const e=k(t);return{width:e.width,height:e.height}}function Je(t){let{rect:e,offsetParent:n,strategy:i}=t;const o=O(n),a=$(n);if(n===a)return e;let s={scrollLeft:0,scrollTop:0};const r={x:0,y:0};if((o||!o&&i!=="fixed")&&((_(n)!=="body"||Y(a))&&(s=tt(n)),O(n))){const c=k(n,!0);r.x=c.x+n.clientLeft,r.y=c.y+n.clientTop}return{...e,x:e.x-s.scrollLeft+r.x,y:e.y-s.scrollTop+r.y}}function Ke(t,e){const n=C(t),i=$(t),o=n.visualViewport;let a=i.clientWidth,s=i.clientHeight,r=0,c=0;if(o){a=o.width,s=o.height;const f=Bt();(f||!f&&e==="fixed")&&(r=o.offsetLeft,c=o.offsetTop)}return{width:a,height:s,x:r,y:c}}function Qe(t){var e;const n=$(t),i=tt(t),o=(e=t.ownerDocument)==null?void 0:e.body,a=V(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),s=V(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0);let r=-i.scrollLeft+Nt(t);const c=-i.scrollTop;return D(o||n).direction==="rtl"&&(r+=V(n.clientWidth,o?o.clientWidth:0)-a),{width:a,height:s,x:r,y:c}}function Mt(t){const e=ft(t);return lt(e)?t.ownerDocument.body:O(e)&&Y(e)?e:Mt(e)}function Z(t,e){var n;e===void 0&&(e=[]);const i=Mt(t),o=i===((n=t.ownerDocument)==null?void 0:n.body),a=C(i),s=o?[a].concat(a.visualViewport||[],Y(i)?i:[]):i,r=e.concat(s);return o?r:r.concat(Z(s))}function Ze(t,e){const n=e.getRootNode==null?void 0:e.getRootNode();if(t.contains(e))return!0;if(n&&z(n)){let i=e;do{if(i&&t===i)return!0;i=i.parentNode||i.host}while(i)}return!1}function tn(t,e){let n=t;for(;n&&!lt(n)&&!e.includes(n)&&!(L(n)&&["absolute","fixed"].includes(D(n).position));){const i=ft(n);n=z(i)?i.host:i}return n}function en(t,e){const n=k(t,!1,e==="fixed"),i=n.top+t.clientTop,o=n.left+t.clientLeft;return{top:i,left:o,x:o,y:i,right:o+t.clientWidth,bottom:i+t.clientHeight,width:t.clientWidth,height:t.clientHeight}}function Et(t,e,n){return e==="viewport"?J(Ke(t,n)):L(e)?en(e,n):J(Qe($(t)))}function nn(t){const e=Z(t),n=tn(t,e);let i=null;if(n&&O(n)){const o=rt(n);Y(n)?i=n:O(o)&&(i=o)}return L(i)?e.filter(o=>i&&L(o)&&Ze(o,i)&&_(o)!=="body"):[]}function on(t){let{element:e,boundary:n,rootBoundary:i,strategy:o}=t;const s=[...n==="clippingAncestors"?nn(e):[].concat(n),i],r=s[0],c=s.reduce((f,m)=>{const l=Et(e,m,o);return f.top=V(l.top,f.top),f.right=bt(l.right,f.right),f.bottom=bt(l.bottom,f.bottom),f.left=V(l.left,f.left),f},Et(e,r,o));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}const q={getClippingRect:on,convertOffsetParentRelativeRectToViewportRelativeRect:Je,isElement:L,getDimensions:Tt,getOffsetParent:rt,getDocumentElement:$,getElementRects:t=>{let{reference:e,floating:n,strategy:i}=t;return{reference:qe(e,rt(n),i),floating:{...Tt(n),x:0,y:0}}},getClientRects:t=>Array.from(t.getClientRects()),isRTL:t=>D(t).direction==="rtl"};function rn(t,e,n,i){i===void 0&&(i={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:s=!0,animationFrame:r=!1}=i,c=o&&!r,f=c||a?[...L(t)?Z(t):[],...Z(e)]:[];f.forEach(d=>{c&&d.addEventListener("scroll",n,{passive:!0}),a&&d.addEventListener("resize",n)});let m=null;if(s){let d=!0;m=new ResizeObserver(()=>{d||n(),d=!1}),L(t)&&!r&&m.observe(t),m.observe(e)}let l,u=r?k(t):null;r&&h();function h(){const d=k(t);u&&(d.x!==u.x||d.y!==u.y||d.width!==u.width||d.height!==u.height)&&n(),u=d,l=requestAnimationFrame(h)}return n(),()=>{var d;f.forEach(y=>{c&&y.removeEventListener("scroll",n),a&&y.removeEventListener("resize",n)}),(d=m)==null||d.disconnect(),m=null,r&&cancelAnimationFrame(l)}}const sn=(t,e,n)=>ke(t,e,{platform:q,...n}),an=globalThis.calciteComponentsConfig,cn={floatingUINonChromiumPositioningFix:!0,...an},ln=fn();async function fn(){function t(){const e=navigator.userAgentData;return e!=null&&e.brands?e.brands.map(n=>`${n.brand}/${n.version}`).join(" "):navigator.userAgent}if(Xt.isBrowser&&cn.floatingUINonChromiumPositioningFix&&/firefox|safari/i.test(t())){const{getClippingRect:e,getElementRects:n,getOffsetParent:i}=await Yt(()=>import("./nonChromiumPlatformUtils.a164ac17.js"),["assets/nonChromiumPlatformUtils.a164ac17.js","assets/index.221827cd.js","assets/index.f5419ca5.css","assets/guid.ae96513b.js"]);q.getClippingRect=e,q.getOffsetParent=i,q.getElementRects=n}}const Wt="data-placement",Rt=100,Pt=["top","bottom","right","left","top-start","top-end","bottom-start","bottom-end","right-start","right-end","left-start","left-end"],st={animation:"calcite-floating-ui-anim",animationActive:"calcite-floating-ui-anim--active"};function un({placement:t,disableFlip:e,flipPlacements:n,offsetDistance:i,offsetSkidding:o,arrowEl:a,type:s}){const r=[Ue(),Me()];if(s==="menu")return[...r,vt({fallbackPlacements:n||["top-start","top","top-end","bottom-start","bottom","bottom-end"]})];if(s==="popover"||s==="tooltip"){const c=[...r,Fe({mainAxis:typeof i=="number"?i:0,crossAxis:typeof o=="number"?o:0})];return t==="auto"||t==="auto-start"||t==="auto-end"?c.push(Be({alignment:t==="auto-start"?"start":t==="auto-end"?"end":null})):e||c.push(vt(n?{fallbackPlacements:n}:{})),a&&c.push(De({element:a})),c}return[]}function On(t,e){const n=t.filter(i=>Pt.includes(i));return n.length!==t.length&&console.warn(`${e.tagName}: Invalid value found in: flipPlacements. Try any of these: ${Pt.map(i=>`"${i}"`).join(", ").trim()}`,{el:e}),n}function dn(t,e){const n=["left","right"];return Gt(t)==="rtl"&&n.reverse(),e.replace(/-leading/gi,"-start").replace(/-trailing/gi,"-end").replace(/leading/gi,n[0]).replace(/trailing/gi,n[1])}async function mn(t,e,n=!1){if(!!t.open)return n?hn(e):Ft(e)}const hn=Le(Ft,Rt,{leading:!0,maxWait:Rt});async function Ft({referenceEl:t,floatingEl:e,overlayPositioning:n="absolute",placement:i,disableFlip:o,flipPlacements:a,offsetDistance:s,offsetSkidding:r,includeArrow:c=!1,arrowEl:f,type:m}){var l;if(!t||!e||c&&!f)return null;await ln;const{x:u,y:h,placement:d,strategy:y,middlewareData:g}=await sn(t,e,{strategy:n,placement:i==="auto"||i==="auto-start"||i==="auto-end"?void 0:dn(e,i),middleware:un({placement:i,disableFlip:o,flipPlacements:a,offsetDistance:s,offsetSkidding:r,arrowEl:f,type:m})});if(g!=null&&g.arrow){const{x:T,y:p}=g.arrow;Object.assign(f.style,{left:T!=null?`${T}px`:"",top:p!=null?`${p}px`:""})}const v=((l=g==null?void 0:g.hide)===null||l===void 0?void 0:l.referenceHidden)?"hidden":null,x=v?"none":null;e.setAttribute(Wt,d);const w=`translate(${Math.round(u)}px,${Math.round(h)}px)`;Object.assign(e.style,{visibility:v,pointerEvents:x,position:y,top:"0",left:"0",transform:w})}const at=new WeakMap;function pn(t,e,n){if(!n||!e)return;Vt(t,e,n);const i=t.overlayPositioning;n.style.position=i,i==="absolute"&&Ut(n);const o=rn;at.set(t,o(e,n,()=>t.reposition()))}function Vt(t,e,n){if(!n||!e)return;ut(n).removeEventListener("transitionend",dt);const i=at.get(t);i&&i(),at.delete(t)}const Ot=4,gn=Math.ceil(Math.hypot(Ot,Ot));function vn(t){!t||t.style.position!=="absolute"||ut(t).addEventListener("transitionend",dt)}function ut(t){return t.shadowRoot||t}function dt(t){const e=t.target;if(t.propertyName==="opacity"&&e.classList.contains(st.animation)){const n=wn(e);Ut(n),ut(n).removeEventListener("transitionend",dt)}}function Ut(t){t.style.transform="",t.style.top="-99999px",t.style.left="-99999px"}function wn(t){return qt(t,`[${Wt}]`)}/*! * All material copyright ESRI, All Rights Reserved, unless otherwise specified. * See https://github.com/Esri/calcite-components/blob/master/LICENSE.md for details. * v1.0.0-beta.97 diff --git a/assets/util.ab699fea.js b/assets/util.520a352e.js similarity index 84% rename from assets/util.ab699fea.js rename to assets/util.520a352e.js index 8102913..71cf614 100644 --- a/assets/util.ab699fea.js +++ b/assets/util.520a352e.js @@ -1 +1 @@ -import{ct as i}from"./index.d94abe07.js";const l=new i({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"});function u(e){return l.toJSON(e)}function m(e){const{bandCount:o,attributeTable:n,colormap:r,pixelType:t}=e.rasterInfo;return o===1&&(n!=null||r!=null||t==="u8"||t==="s8")}export{u as e,m as r}; +import{ct as i}from"./index.221827cd.js";const l=new i({esriGeometryPoint:"point",esriGeometryMultipoint:"multipoint",esriGeometryPolyline:"polyline",esriGeometryPolygon:"polygon",esriGeometryMultiPatch:"multipatch",mesh:"mesh"});function u(e){return l.toJSON(e)}function m(e){const{bandCount:o,attributeTable:n,colormap:r,pixelType:t}=e.rasterInfo;return o===1&&(n!=null||r!=null||t==="u8"||t==="s8")}export{u as e,m as r}; diff --git a/assets/utils.4b023c9d.js b/assets/utils.0160becb.js similarity index 98% rename from assets/utils.4b023c9d.js rename to assets/utils.0160becb.js index 7bc39fe..99d4c5c 100644 --- a/assets/utils.4b023c9d.js +++ b/assets/utils.0160becb.js @@ -1 +1 @@ -import{a6 as _,a7 as m,a8 as q,a9 as U,m as N,s as B,b4 as S,b5 as M,b6 as P,b7 as G,W as Y,j as z,K as C,N as L,c as E,I as $,b8 as k,b9 as j,n as W}from"./index.d94abe07.js";import{d as y,b as A,S as V}from"./Utils.7f6f3a6b.js";import{U as K}from"./MaterialKey.229b1dd6.js";import{r as J,s as D}from"./enums.0295eb81.js";import{C as h}from"./enums.2d9e6f64.js";const R=-1;let p=class extends U{constructor(s){super(s),this._from=null,this._to=null,this._final=null,this._current=[],this._time=0,this.duration=N("mapview-transitions-duration"),this.effects=[]}set effect(s){if(this._get("effect")!==(s=s||"")){this._set("effect",s);try{this._transitionTo(x(s))}catch(e){this._transitionTo([]),B.getLogger(this.declaredClass).warn("Invalid Effect",{effect:s,error:e})}}}get hasEffects(){return this.transitioning||!!this.effects.length}set scale(s){this._updateForScale(s)}get transitioning(){return this._to!==null}canTransitionTo(s){try{return this.scale>0&&F(this._current,x(s),this.scale)}catch{return!1}}transitionStep(s,e){this._applyTimeTransition(s),this._updateForScale(e)}endTransitions(){this._applyTimeTransition(this.duration)}_transitionTo(s){this.scale>0&&F(this._current,s,this.scale)?(this._final=s,this._to=S(s),Q(this._current,this._to,this.scale),this._from=S(this._current),this._time=0):(this._from=this._to=this._final=null,this._current=s),this._set("effects",this._current[0]?S(this._current[0].effects):[])}_applyTimeTransition(s){if(!(this._to&&this._from&&this._current&&this._final))return;this._time+=s;const e=Math.min(1,this._time/this.duration);for(let t=0;t=e[0].scale)n=i=e[0].effects;else if(s<=e[t].scale)n=i=e[t].effects;else for(let r=0;r=s&&l.scale<=s){o=(s-c.scale)/(l.scale-c.scale),i=c.effects,n=l.effects;break}}for(let r=0;r1||e.length>1)&&t<=0)&&P(s[0].effects,e[0].effects)}function Q(s,e,t){var l,d;const i=s.length>e.length?s:e,n=s.length>e.length?e:s,o=n[n.length-1],r=(l=o==null?void 0:o.scale)!=null?l:t,c=(d=o==null?void 0:o.effects)!=null?d:[];for(let a=n.length;ai?Math.max(i,n-o):Math.min(i,n+o),this.computedVisible=this.computedOpacity>0;const r=i===this.computedOpacity;this.inFadeTransition=!r,r||this.requestRender()}}else this.computedOpacity=this.opacity,this.computedVisible=this.visible}onAttach(){}onDetach(){}doRender(e){}ready(){this._isReady||(this._isReady=!0,this.emit("isReady"),this.requestRender())}}class oe extends te{constructor(){super(...arguments),this._childrenSet=new Set,this._needsSort=!1,this.children=[],this._effectView=null}get blendMode(){return this._blendMode}set blendMode(e){this._blendMode=e,this.requestRender()}get clips(){return this._clips}set clips(e){this._clips=e,this.children.forEach(t=>t.clips=e)}get computedEffects(){var e,t;return(t=(e=this._effectView)==null?void 0:e.effects)!=null?t:null}get effect(){var e,t;return(t=(e=this._effectView)==null?void 0:e.effect)!=null?t:""}set effect(e){(this._effectView||e)&&(this._effectView||(this._effectView=new p),this._effectView.effect=e,this.requestRender())}updateTransitionProperties(e,t){super.updateTransitionProperties(e,t),this._effectView&&(this._effectView.transitionStep(e,t),this._effectView.transitioning&&this.requestRender())}doRender(e){const t=this.createRenderParams(e);this.renderChildren(t)}addChild(e){return this.addChildAt(e,this.children.length)}addChildAt(e,t=this.children.length){if(!e||this.contains(e))return e;this._needsSort=!0;const i=e.parent;return i&&i!==this&&i.removeChild(e),t>=this.children.length?this.children.push(e):this.children.splice(t,0,e),this._childrenSet.add(e),e.parent=this,e.stage=this.stage,this!==this.stage&&(e.clips=this.clips),this.requestRender(),e}contains(e){return this._childrenSet.has(e)}endTransitions(){super.endTransitions(),this._effectView&&(this._effectView.endTransitions(),this.requestRender())}removeAllChildren(){this._childrenSet.clear(),this._needsSort=!0;for(const e of this.children)this!==this.stage&&(e.clips=null),e.stage=null,e.parent=null;this.children.length=0}removeChild(e){return this.contains(e)?this.removeChildAt(this.children.indexOf(e)):e}removeChildAt(e){if(e<0||e>=this.children.length)return null;this._needsSort=!0;const t=this.children.splice(e,1)[0];return this._childrenSet.delete(t),this!==this.stage&&(t.clips=null),t.stage=null,t.parent=null,t}sortChildren(e){this._needsSort&&(this.children.sort(e),this._needsSort=!1)}beforeRender(e){super.beforeRender(e);for(const t of this.children)t.beforeRender(e)}afterRender(e){super.afterRender(e);for(const t of this.children)t.afterRender(e)}_createTransforms(){return{dvs:L()}}onAttach(){super.onAttach();const e=this.stage;for(const t of this.children)t.stage=e}onDetach(){super.onDetach();for(const e of this.children)e.stage=null}renderChildren(e){for(const t of this.children)t.processRender(e)}createRenderParams(e){return{...e,blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:e.globalOpacity*this.computedOpacity,inFadeTransition:this.inFadeTransition}}}class g{static getStorageSpec(e){return null}static createOrUpdateRendererSchema(e,t){return E(e)&&e.type==="default"?e:{type:"default"}}static getVariation(e){return{}}static getVariationHash(e){return 0}}g.type="default",g.programSpec=null;class b extends g{static getStorageSpec({attributes:e}){return{visualVariables:!1,attributes:e!=null?e:null}}static _createRendererSchema(){return{type:"dot-density",colors:new Float32Array(32),dotValue:-1,dotSize:-1,dotScale:-1,dotBlending:!1,backgroundColor:new Float32Array(4),activeDots:new Float32Array(8),seed:-1}}static createOrUpdateRendererSchema(e,t){const{attributes:i,dotValue:n,referenceScale:o,dotSize:r,dotBlendingEnabled:c,seed:l,backgroundColor:d}=t,a=E(e)&&e.type==="dot-density"?e:this._createRendererSchema();a.dotValue=n,a.dotSize=r,a.dotScale=o,a.dotBlending=c,a.seed=l;const{colors:w,activeDots:v,backgroundColor:f}=a;for(let u=0;u=i.length?null:i[u].color;y(w,I,4*u)}for(let u=0;u<8;u++)v[u]=u`${H}:${I.toString()}`).join();let f,u=!0;return E(e)&&e.type==="heatmap"?(f=e,u=v!==e.gradientHash):f=this._createRendererSchema(),f.radius=$(i),f.minDensity=n,f.densityRange=a,f.referenceScale=r,f.isFieldActive=w,u&&(f.gradient=k(d),f.gradientHash=v),f}}O.type="heatmap",O.programSpec={shader:"materials/icon/heatmapAccumulate",vertexLayout:{geometry:[{location:0,name:"a_pos",count:2,type:h.SHORT},{location:1,name:"a_vertexOffset",count:2,type:h.SHORT},{location:4,name:"a_id",count:4,type:h.UNSIGNED_BYTE}]}};class T extends g{static getStorageSpec({attributes:e}){return{visualVariables:!0,attributes:e!=null?e:null}}static _createRendererSchema(){return{type:"pie-chart",colors:new Float32Array(4*D),defaultColor:new Float32Array(4),othersColor:new Float32Array(4),outlineColor:new Float32Array(4),holePercentage:0,sectorThreshold:0,outlineWidth:1,numberOfFields:10}}static createOrUpdateRendererSchema(e,t){const{attributes:i,defaultColor:n,holePercentage:o,othersCategory:r,outline:c}=t,l=E(e)&&e.type==="pie-chart"?e:this._createRendererSchema();for(let d=0;d=i.length?new j([0,0,0,0]):i[d].color;y(l.colors,a,4*d)}return y(l.defaultColor,n),y(l.othersColor,r==null?void 0:r.color),y(l.outlineColor,c==null?void 0:c.color),l.outlineWidth=$((c==null?void 0:c.width)||0),l.holePercentage=o,l.sectorThreshold=(r==null?void 0:r.threshold)||0,l.numberOfFields=i.length,l}static getVariation(e){return{numberOfFields:e.numberOfFields}}static getVariationHash(e){return e.numberOfFields}}T.type="pie-chart",T.programSpec={shader:"materials/pie",vertexLayout:{geometry:[{location:0,name:"a_pos",count:2,type:h.SHORT},{location:1,name:"a_vertexOffset",count:2,type:h.SHORT},{location:2,name:"a_texCoords",count:2,type:h.UNSIGNED_SHORT},{location:3,name:"a_bitSetAndDistRatio",count:2,type:h.UNSIGNED_SHORT},{location:4,name:"a_id",count:4,type:h.UNSIGNED_BYTE},{location:5,name:"a_color",count:4,type:h.UNSIGNED_BYTE,normalized:!0},{location:6,name:"a_outlineColor",count:4,type:h.UNSIGNED_BYTE,normalized:!0},{location:7,name:"a_sizeAndOutlineWidth",count:4,type:h.UNSIGNED_BYTE},{location:8,name:"a_zoomRange",count:2,type:h.UNSIGNED_SHORT}]},hittestAttributes:["a_vertexOffset","a_texCoords"]};function le(s,e){if(s.type!==e)throw new W("material-view-model:unexpected-renderer-schema",`expected to find renderer schema of type "${e}" but found type "${s.type}"`)}function ce(s){switch(s==null?void 0:s.type){case"dot-density":return b;case"heatmap":return O;case"pie-chart":return T;default:return g}}function he(s){const{geometryType:e,symbologyType:t}=K.load(s);switch(e){case A.FILL:if(t===V.DOT_DENSITY)return b;break;case A.MARKER:switch(t){case V.HEATMAP:return O;case V.PIE_CHART:return T}}return g}export{p as a,ce as c,g as e,oe as i,he as p,te as r,le as s}; +import{a6 as _,a7 as m,a8 as q,a9 as U,m as N,s as B,b4 as S,b5 as M,b6 as P,b7 as G,W as Y,j as z,K as C,N as L,c as E,I as $,b8 as k,b9 as j,n as W}from"./index.221827cd.js";import{d as y,b as A,S as V}from"./Utils.2136650a.js";import{U as K}from"./MaterialKey.0cadabc1.js";import{r as J,s as D}from"./enums.0295eb81.js";import{C as h}from"./enums.2d9e6f64.js";const R=-1;let p=class extends U{constructor(s){super(s),this._from=null,this._to=null,this._final=null,this._current=[],this._time=0,this.duration=N("mapview-transitions-duration"),this.effects=[]}set effect(s){if(this._get("effect")!==(s=s||"")){this._set("effect",s);try{this._transitionTo(x(s))}catch(e){this._transitionTo([]),B.getLogger(this.declaredClass).warn("Invalid Effect",{effect:s,error:e})}}}get hasEffects(){return this.transitioning||!!this.effects.length}set scale(s){this._updateForScale(s)}get transitioning(){return this._to!==null}canTransitionTo(s){try{return this.scale>0&&F(this._current,x(s),this.scale)}catch{return!1}}transitionStep(s,e){this._applyTimeTransition(s),this._updateForScale(e)}endTransitions(){this._applyTimeTransition(this.duration)}_transitionTo(s){this.scale>0&&F(this._current,s,this.scale)?(this._final=s,this._to=S(s),Q(this._current,this._to,this.scale),this._from=S(this._current),this._time=0):(this._from=this._to=this._final=null,this._current=s),this._set("effects",this._current[0]?S(this._current[0].effects):[])}_applyTimeTransition(s){if(!(this._to&&this._from&&this._current&&this._final))return;this._time+=s;const e=Math.min(1,this._time/this.duration);for(let t=0;t=e[0].scale)n=i=e[0].effects;else if(s<=e[t].scale)n=i=e[t].effects;else for(let r=0;r=s&&l.scale<=s){o=(s-c.scale)/(l.scale-c.scale),i=c.effects,n=l.effects;break}}for(let r=0;r1||e.length>1)&&t<=0)&&P(s[0].effects,e[0].effects)}function Q(s,e,t){var l,d;const i=s.length>e.length?s:e,n=s.length>e.length?e:s,o=n[n.length-1],r=(l=o==null?void 0:o.scale)!=null?l:t,c=(d=o==null?void 0:o.effects)!=null?d:[];for(let a=n.length;ai?Math.max(i,n-o):Math.min(i,n+o),this.computedVisible=this.computedOpacity>0;const r=i===this.computedOpacity;this.inFadeTransition=!r,r||this.requestRender()}}else this.computedOpacity=this.opacity,this.computedVisible=this.visible}onAttach(){}onDetach(){}doRender(e){}ready(){this._isReady||(this._isReady=!0,this.emit("isReady"),this.requestRender())}}class oe extends te{constructor(){super(...arguments),this._childrenSet=new Set,this._needsSort=!1,this.children=[],this._effectView=null}get blendMode(){return this._blendMode}set blendMode(e){this._blendMode=e,this.requestRender()}get clips(){return this._clips}set clips(e){this._clips=e,this.children.forEach(t=>t.clips=e)}get computedEffects(){var e,t;return(t=(e=this._effectView)==null?void 0:e.effects)!=null?t:null}get effect(){var e,t;return(t=(e=this._effectView)==null?void 0:e.effect)!=null?t:""}set effect(e){(this._effectView||e)&&(this._effectView||(this._effectView=new p),this._effectView.effect=e,this.requestRender())}updateTransitionProperties(e,t){super.updateTransitionProperties(e,t),this._effectView&&(this._effectView.transitionStep(e,t),this._effectView.transitioning&&this.requestRender())}doRender(e){const t=this.createRenderParams(e);this.renderChildren(t)}addChild(e){return this.addChildAt(e,this.children.length)}addChildAt(e,t=this.children.length){if(!e||this.contains(e))return e;this._needsSort=!0;const i=e.parent;return i&&i!==this&&i.removeChild(e),t>=this.children.length?this.children.push(e):this.children.splice(t,0,e),this._childrenSet.add(e),e.parent=this,e.stage=this.stage,this!==this.stage&&(e.clips=this.clips),this.requestRender(),e}contains(e){return this._childrenSet.has(e)}endTransitions(){super.endTransitions(),this._effectView&&(this._effectView.endTransitions(),this.requestRender())}removeAllChildren(){this._childrenSet.clear(),this._needsSort=!0;for(const e of this.children)this!==this.stage&&(e.clips=null),e.stage=null,e.parent=null;this.children.length=0}removeChild(e){return this.contains(e)?this.removeChildAt(this.children.indexOf(e)):e}removeChildAt(e){if(e<0||e>=this.children.length)return null;this._needsSort=!0;const t=this.children.splice(e,1)[0];return this._childrenSet.delete(t),this!==this.stage&&(t.clips=null),t.stage=null,t.parent=null,t}sortChildren(e){this._needsSort&&(this.children.sort(e),this._needsSort=!1)}beforeRender(e){super.beforeRender(e);for(const t of this.children)t.beforeRender(e)}afterRender(e){super.afterRender(e);for(const t of this.children)t.afterRender(e)}_createTransforms(){return{dvs:L()}}onAttach(){super.onAttach();const e=this.stage;for(const t of this.children)t.stage=e}onDetach(){super.onDetach();for(const e of this.children)e.stage=null}renderChildren(e){for(const t of this.children)t.processRender(e)}createRenderParams(e){return{...e,blendMode:this.blendMode,effects:this.computedEffects,globalOpacity:e.globalOpacity*this.computedOpacity,inFadeTransition:this.inFadeTransition}}}class g{static getStorageSpec(e){return null}static createOrUpdateRendererSchema(e,t){return E(e)&&e.type==="default"?e:{type:"default"}}static getVariation(e){return{}}static getVariationHash(e){return 0}}g.type="default",g.programSpec=null;class b extends g{static getStorageSpec({attributes:e}){return{visualVariables:!1,attributes:e!=null?e:null}}static _createRendererSchema(){return{type:"dot-density",colors:new Float32Array(32),dotValue:-1,dotSize:-1,dotScale:-1,dotBlending:!1,backgroundColor:new Float32Array(4),activeDots:new Float32Array(8),seed:-1}}static createOrUpdateRendererSchema(e,t){const{attributes:i,dotValue:n,referenceScale:o,dotSize:r,dotBlendingEnabled:c,seed:l,backgroundColor:d}=t,a=E(e)&&e.type==="dot-density"?e:this._createRendererSchema();a.dotValue=n,a.dotSize=r,a.dotScale=o,a.dotBlending=c,a.seed=l;const{colors:w,activeDots:v,backgroundColor:f}=a;for(let u=0;u=i.length?null:i[u].color;y(w,I,4*u)}for(let u=0;u<8;u++)v[u]=u`${H}:${I.toString()}`).join();let f,u=!0;return E(e)&&e.type==="heatmap"?(f=e,u=v!==e.gradientHash):f=this._createRendererSchema(),f.radius=$(i),f.minDensity=n,f.densityRange=a,f.referenceScale=r,f.isFieldActive=w,u&&(f.gradient=k(d),f.gradientHash=v),f}}O.type="heatmap",O.programSpec={shader:"materials/icon/heatmapAccumulate",vertexLayout:{geometry:[{location:0,name:"a_pos",count:2,type:h.SHORT},{location:1,name:"a_vertexOffset",count:2,type:h.SHORT},{location:4,name:"a_id",count:4,type:h.UNSIGNED_BYTE}]}};class T extends g{static getStorageSpec({attributes:e}){return{visualVariables:!0,attributes:e!=null?e:null}}static _createRendererSchema(){return{type:"pie-chart",colors:new Float32Array(4*D),defaultColor:new Float32Array(4),othersColor:new Float32Array(4),outlineColor:new Float32Array(4),holePercentage:0,sectorThreshold:0,outlineWidth:1,numberOfFields:10}}static createOrUpdateRendererSchema(e,t){const{attributes:i,defaultColor:n,holePercentage:o,othersCategory:r,outline:c}=t,l=E(e)&&e.type==="pie-chart"?e:this._createRendererSchema();for(let d=0;d=i.length?new j([0,0,0,0]):i[d].color;y(l.colors,a,4*d)}return y(l.defaultColor,n),y(l.othersColor,r==null?void 0:r.color),y(l.outlineColor,c==null?void 0:c.color),l.outlineWidth=$((c==null?void 0:c.width)||0),l.holePercentage=o,l.sectorThreshold=(r==null?void 0:r.threshold)||0,l.numberOfFields=i.length,l}static getVariation(e){return{numberOfFields:e.numberOfFields}}static getVariationHash(e){return e.numberOfFields}}T.type="pie-chart",T.programSpec={shader:"materials/pie",vertexLayout:{geometry:[{location:0,name:"a_pos",count:2,type:h.SHORT},{location:1,name:"a_vertexOffset",count:2,type:h.SHORT},{location:2,name:"a_texCoords",count:2,type:h.UNSIGNED_SHORT},{location:3,name:"a_bitSetAndDistRatio",count:2,type:h.UNSIGNED_SHORT},{location:4,name:"a_id",count:4,type:h.UNSIGNED_BYTE},{location:5,name:"a_color",count:4,type:h.UNSIGNED_BYTE,normalized:!0},{location:6,name:"a_outlineColor",count:4,type:h.UNSIGNED_BYTE,normalized:!0},{location:7,name:"a_sizeAndOutlineWidth",count:4,type:h.UNSIGNED_BYTE},{location:8,name:"a_zoomRange",count:2,type:h.UNSIGNED_SHORT}]},hittestAttributes:["a_vertexOffset","a_texCoords"]};function le(s,e){if(s.type!==e)throw new W("material-view-model:unexpected-renderer-schema",`expected to find renderer schema of type "${e}" but found type "${s.type}"`)}function ce(s){switch(s==null?void 0:s.type){case"dot-density":return b;case"heatmap":return O;case"pie-chart":return T;default:return g}}function he(s){const{geometryType:e,symbologyType:t}=K.load(s);switch(e){case A.FILL:if(t===V.DOT_DENSITY)return b;break;case A.MARKER:switch(t){case V.HEATMAP:return O;case V.PIE_CHART:return T}}return g}export{p as a,ce as c,g as e,oe as i,he as p,te as r,le as s}; diff --git a/assets/utils.8c53cad2.js b/assets/utils.83e0b804.js similarity index 99% rename from assets/utils.8c53cad2.js rename to assets/utils.83e0b804.js index 6418607..22b48a4 100644 --- a/assets/utils.8c53cad2.js +++ b/assets/utils.83e0b804.js @@ -1 +1 @@ -import{a as F,l as x}from"./generateRendererUtils.ebdde5b7.js";const D="",z="equal-interval",I=1,N=5,S=10,M=/\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*/gi,V=new Set(["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSingle","esriFieldTypeDouble"]),C=["min","max","avg","stddev","count","sum","variance","nullcount","median"];function b(t){return t==null||typeof t=="string"&&!t?D:t}function k(t){const e=t.normalizationField!=null||t.normalizationType!=null,l=t.minValue!=null||t.maxValue!=null,a=!!t.sqlExpression&&t.supportsSQLExpression;return!e&&!l&&!a}function L(t){const e=t.returnDistinct?[...new Set(t.values)]:t.values,l=e.filter(o=>o!=null).length,a={count:l};return t.supportsNullCount&&(a.nullcount=e.length-l),t.percentileParams&&(a.median=y(e,t.percentileParams)),a}function $(t){const{values:e,useSampleStdDev:l,supportsNullCount:a}=t;let o=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,n=null,r=null,s=null,f=null,u=0;const c=t.minValue==null?-1/0:t.minValue,d=t.maxValue==null?1/0:t.maxValue;for(const m of e)Number.isFinite(m)?m>=c&&m<=d&&(n+=m,o=Math.min(o,m),i=Math.max(i,m),u++):typeof m=="string"&&u++;if(u&&n!=null){r=n/u;let m=0;for(const v of e)Number.isFinite(v)&&v>=c&&v<=d&&(m+=(v-r)**2);f=l?u>1?m/(u-1):0:u>0?m/u:0,s=Math.sqrt(f)}else o=null,i=null;const p={avg:r,count:u,max:i,min:o,stddev:s,sum:n,variance:f};return a&&(p.nullcount=e.length-u),t.percentileParams&&(p.median=y(e,t.percentileParams)),p}function y(t,e){const{fieldType:l,value:a,orderBy:o,isDiscrete:i}=e,n=w(l,o==="desc");if((t=[...t].filter(p=>p!=null).sort((p,m)=>n(p,m))).length===0)return null;if(a<=0)return t[0];if(a>=1)return t[t.length-1];const r=(t.length-1)*a,s=Math.floor(r),f=s+1,u=r%1,c=t[s],d=t[f];return f>=t.length||i||typeof c=="string"||typeof d=="string"?c:c*(1-u)+d*u}function w(t,e){const l=e?1:-1,a=E(e),o=g(e);if(!(!!t&&["esriFieldTypeDate","esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...V].includes(t)))return(i,n)=>typeof i=="number"&&typeof n=="number"?a(i,n):typeof i=="string"&&typeof n=="string"?o(i,n):l;if(t==="esriFieldTypeDate")return(i,n)=>{const r=new Date(i).getTime(),s=new Date(n).getTime();return isNaN(r)||isNaN(s)?l:a(r,s)};if(V.has(t))return(i,n)=>a(i,n);if(t==="esriFieldTypeString")return(i,n)=>o(i,n);if(t==="esriFieldTypeGUID"||t==="esriFieldTypeGlobalID"){const i=g(e);return(n,r)=>i(T(n),T(r))}return e?(i,n)=>1:(i,n)=>-1}function g(t){return t?(e,l)=>(e=e==null?void 0:e.toUpperCase(),l=l==null?void 0:l.toUpperCase(),e>l?-1:e(e=e==null?void 0:e.toUpperCase(),l=l==null?void 0:l.toUpperCase(),el?1:0)}function E(t){return t?(e,l)=>l-e:(e,l)=>e-l}function T(t){return t.substr(24,12)+t.substr(19,4)+t.substr(16,2)+t.substr(14,2)+t.substr(11,2)+t.substr(9,2)+t.substr(6,2)+t.substr(4,2)+t.substr(2,2)+t.substr(0,2)}function Y(t,e){let l;for(l in t)C.includes(l)&&(Number.isFinite(t[l])||(t[l]=null));return e&&["avg","stddev","variance"].forEach(a=>{t[a]!=null&&(t[a]=Math.ceil(t[a]))}),t}function _(t){const e={};for(let l of t)(l==null||typeof l=="string"&&l.trim()==="")&&(l=null),e[l]==null?e[l]={count:1,data:l}:e[l].count++;return{count:e}}function h(t){return(t==null?void 0:t.type)!=="coded-value"?[]:t.codedValues.map(e=>e.code)}function Q(t,e,l,a){const o=t.count,i=[];if(l&&e){const n=[],r=h(e[0]);for(const s of r)if(e[1]){const f=h(e[1]);for(const u of f)if(e[2]){const c=h(e[2]);for(const d of c)n.push(`${b(s)}${a}${b(u)}${a}${b(d)}`)}else n.push(`${b(s)}${a}${b(u)}`)}else n.push(s);for(const s of n)o.hasOwnProperty(s)||(o[s]={data:s,count:0})}for(const n in o){const r=o[n];i.push({value:r.data,count:r.count,label:r.label})}return{uniqueValueInfos:i}}function j(t,e,l,a){let o=null;switch(e){case"log":t!==0&&(o=Math.log(t)*Math.LOG10E);break;case"percent-of-total":Number.isFinite(a)&&a!==0&&(o=t/a*100);break;case"field":Number.isFinite(l)&&l!==0&&(o=t/l);break;case"natural-log":t>0&&(o=Math.log(t));break;case"square-root":t>0&&(o=t**.5)}return o}function q(t,e){const l=P({field:e.field,normalizationType:e.normalizationType,normalizationField:e.normalizationField,classificationMethod:e.classificationMethod,standardDeviationInterval:e.standardDeviationInterval,breakCount:e.numClasses||N});return t=G(t,e.minValue,e.maxValue),F({definition:l,values:t,normalizationTotal:e.normalizationTotal})}function G(t,e,l){return e=e!=null?e:-1/0,l=l!=null?l:1/0,t.filter(a=>Number.isFinite(a)&&a>=e&&a<=l)}function P(t){const e=t.field,l=t.classificationMethod||z,a=t.normalizationType,o=t.normalizationField,i=new x;return i.classificationField=e,i.breakCount=t.breakCount,i.classificationMethod=l,i.standardDeviationInterval=l==="standard-deviation"?t.standardDeviationInterval||I:void 0,i.normalizationType=a,i.normalizationField=a==="field"?o:void 0,i}function H(t,e){let l=t.classBreaks;const a=l.length,o=l[0].minValue,i=l[a-1].maxValue,n=e==="standard-deviation",r=M;return l=l.map(s=>{const f=s.label,u={minValue:s.minValue,maxValue:s.maxValue,label:f};if(n&&f){const c=f.match(r).map(d=>+d.trim());c.length===2?(u.minStdDev=c[0],u.maxStdDev=c[1],c[0]<0&&c[1]>0&&(u.hasAvg=!0)):c.length===1&&(f.includes("<")?(u.minStdDev=null,u.maxStdDev=c[0]):f.includes(">")&&(u.minStdDev=c[0],u.maxStdDev=null))}return u}),{minValue:o,maxValue:i,classBreakInfos:l,normalizationTotal:t.normalizationTotal}}function J(t,e){const{min:l,max:a,intervals:o}=U(t,e),i=o.map((n,r)=>({minValue:o[r][0],maxValue:o[r][1],count:0}));for(const n of t)if(n!=null&&n>=l&&n<=a){const r=B(o,n);r>-1&&i[r].count++}return{bins:i,minValue:l,maxValue:a,normalizationTotal:e.normalizationTotal}}function U(t,e){const{field:l,classificationMethod:a,standardDeviationInterval:o,normalizationType:i,normalizationField:n,normalizationTotal:r,minValue:s,maxValue:f}=e,u=e.numBins||S;let c=null,d=null,p=null;if((!a||a==="equal-interval")&&!i){if(s!=null&&f!=null)c=s,d=f;else{const m=$({values:t,minValue:s,maxValue:f,useSampleStdDev:!i,supportsNullCount:k({normalizationType:i,normalizationField:n,minValue:s,maxValue:f})});c=m.min,d=m.max}p=O(c,d,u)}else{const{classBreaks:m}=q(t,{field:l,normalizationType:i,normalizationField:n,normalizationTotal:r,classificationMethod:a,standardDeviationInterval:o,minValue:s,maxValue:f,numClasses:u});c=m[0].minValue,d=m[m.length-1].maxValue,p=m.map(v=>[v.minValue,v.maxValue])}return{min:c,max:d,intervals:p}}function B(t,e){let l=-1;for(let a=t.length-1;a>=0;a--)if(e>=t[a][0]){l=a;break}return l}function O(t,e,l){const a=(e-t)/l,o=[];let i,n=t;for(let r=1;r<=l;r++)i=n+a,i=Number(i.toFixed(16)),o.push([n,r===l?e:i]),n=i;return o}export{q as D,Q as F,H as N,J as S,_ as T,Y as V,b as c,$ as d,L as f,k as m,y as p,w as v,j as x}; +import{a as F,l as x}from"./generateRendererUtils.5c972fdb.js";const D="",z="equal-interval",I=1,N=5,S=10,M=/\s*(\+|-)?((\d+(\.\d+)?)|(\.\d+))\s*/gi,V=new Set(["esriFieldTypeInteger","esriFieldTypeSmallInteger","esriFieldTypeSingle","esriFieldTypeDouble"]),C=["min","max","avg","stddev","count","sum","variance","nullcount","median"];function b(t){return t==null||typeof t=="string"&&!t?D:t}function k(t){const e=t.normalizationField!=null||t.normalizationType!=null,l=t.minValue!=null||t.maxValue!=null,a=!!t.sqlExpression&&t.supportsSQLExpression;return!e&&!l&&!a}function L(t){const e=t.returnDistinct?[...new Set(t.values)]:t.values,l=e.filter(o=>o!=null).length,a={count:l};return t.supportsNullCount&&(a.nullcount=e.length-l),t.percentileParams&&(a.median=y(e,t.percentileParams)),a}function $(t){const{values:e,useSampleStdDev:l,supportsNullCount:a}=t;let o=Number.POSITIVE_INFINITY,i=Number.NEGATIVE_INFINITY,n=null,r=null,s=null,f=null,u=0;const c=t.minValue==null?-1/0:t.minValue,d=t.maxValue==null?1/0:t.maxValue;for(const m of e)Number.isFinite(m)?m>=c&&m<=d&&(n+=m,o=Math.min(o,m),i=Math.max(i,m),u++):typeof m=="string"&&u++;if(u&&n!=null){r=n/u;let m=0;for(const v of e)Number.isFinite(v)&&v>=c&&v<=d&&(m+=(v-r)**2);f=l?u>1?m/(u-1):0:u>0?m/u:0,s=Math.sqrt(f)}else o=null,i=null;const p={avg:r,count:u,max:i,min:o,stddev:s,sum:n,variance:f};return a&&(p.nullcount=e.length-u),t.percentileParams&&(p.median=y(e,t.percentileParams)),p}function y(t,e){const{fieldType:l,value:a,orderBy:o,isDiscrete:i}=e,n=w(l,o==="desc");if((t=[...t].filter(p=>p!=null).sort((p,m)=>n(p,m))).length===0)return null;if(a<=0)return t[0];if(a>=1)return t[t.length-1];const r=(t.length-1)*a,s=Math.floor(r),f=s+1,u=r%1,c=t[s],d=t[f];return f>=t.length||i||typeof c=="string"||typeof d=="string"?c:c*(1-u)+d*u}function w(t,e){const l=e?1:-1,a=E(e),o=g(e);if(!(!!t&&["esriFieldTypeDate","esriFieldTypeString","esriFieldTypeGUID","esriFieldTypeGlobalID",...V].includes(t)))return(i,n)=>typeof i=="number"&&typeof n=="number"?a(i,n):typeof i=="string"&&typeof n=="string"?o(i,n):l;if(t==="esriFieldTypeDate")return(i,n)=>{const r=new Date(i).getTime(),s=new Date(n).getTime();return isNaN(r)||isNaN(s)?l:a(r,s)};if(V.has(t))return(i,n)=>a(i,n);if(t==="esriFieldTypeString")return(i,n)=>o(i,n);if(t==="esriFieldTypeGUID"||t==="esriFieldTypeGlobalID"){const i=g(e);return(n,r)=>i(T(n),T(r))}return e?(i,n)=>1:(i,n)=>-1}function g(t){return t?(e,l)=>(e=e==null?void 0:e.toUpperCase(),l=l==null?void 0:l.toUpperCase(),e>l?-1:e(e=e==null?void 0:e.toUpperCase(),l=l==null?void 0:l.toUpperCase(),el?1:0)}function E(t){return t?(e,l)=>l-e:(e,l)=>e-l}function T(t){return t.substr(24,12)+t.substr(19,4)+t.substr(16,2)+t.substr(14,2)+t.substr(11,2)+t.substr(9,2)+t.substr(6,2)+t.substr(4,2)+t.substr(2,2)+t.substr(0,2)}function Y(t,e){let l;for(l in t)C.includes(l)&&(Number.isFinite(t[l])||(t[l]=null));return e&&["avg","stddev","variance"].forEach(a=>{t[a]!=null&&(t[a]=Math.ceil(t[a]))}),t}function _(t){const e={};for(let l of t)(l==null||typeof l=="string"&&l.trim()==="")&&(l=null),e[l]==null?e[l]={count:1,data:l}:e[l].count++;return{count:e}}function h(t){return(t==null?void 0:t.type)!=="coded-value"?[]:t.codedValues.map(e=>e.code)}function Q(t,e,l,a){const o=t.count,i=[];if(l&&e){const n=[],r=h(e[0]);for(const s of r)if(e[1]){const f=h(e[1]);for(const u of f)if(e[2]){const c=h(e[2]);for(const d of c)n.push(`${b(s)}${a}${b(u)}${a}${b(d)}`)}else n.push(`${b(s)}${a}${b(u)}`)}else n.push(s);for(const s of n)o.hasOwnProperty(s)||(o[s]={data:s,count:0})}for(const n in o){const r=o[n];i.push({value:r.data,count:r.count,label:r.label})}return{uniqueValueInfos:i}}function j(t,e,l,a){let o=null;switch(e){case"log":t!==0&&(o=Math.log(t)*Math.LOG10E);break;case"percent-of-total":Number.isFinite(a)&&a!==0&&(o=t/a*100);break;case"field":Number.isFinite(l)&&l!==0&&(o=t/l);break;case"natural-log":t>0&&(o=Math.log(t));break;case"square-root":t>0&&(o=t**.5)}return o}function q(t,e){const l=P({field:e.field,normalizationType:e.normalizationType,normalizationField:e.normalizationField,classificationMethod:e.classificationMethod,standardDeviationInterval:e.standardDeviationInterval,breakCount:e.numClasses||N});return t=G(t,e.minValue,e.maxValue),F({definition:l,values:t,normalizationTotal:e.normalizationTotal})}function G(t,e,l){return e=e!=null?e:-1/0,l=l!=null?l:1/0,t.filter(a=>Number.isFinite(a)&&a>=e&&a<=l)}function P(t){const e=t.field,l=t.classificationMethod||z,a=t.normalizationType,o=t.normalizationField,i=new x;return i.classificationField=e,i.breakCount=t.breakCount,i.classificationMethod=l,i.standardDeviationInterval=l==="standard-deviation"?t.standardDeviationInterval||I:void 0,i.normalizationType=a,i.normalizationField=a==="field"?o:void 0,i}function H(t,e){let l=t.classBreaks;const a=l.length,o=l[0].minValue,i=l[a-1].maxValue,n=e==="standard-deviation",r=M;return l=l.map(s=>{const f=s.label,u={minValue:s.minValue,maxValue:s.maxValue,label:f};if(n&&f){const c=f.match(r).map(d=>+d.trim());c.length===2?(u.minStdDev=c[0],u.maxStdDev=c[1],c[0]<0&&c[1]>0&&(u.hasAvg=!0)):c.length===1&&(f.includes("<")?(u.minStdDev=null,u.maxStdDev=c[0]):f.includes(">")&&(u.minStdDev=c[0],u.maxStdDev=null))}return u}),{minValue:o,maxValue:i,classBreakInfos:l,normalizationTotal:t.normalizationTotal}}function J(t,e){const{min:l,max:a,intervals:o}=U(t,e),i=o.map((n,r)=>({minValue:o[r][0],maxValue:o[r][1],count:0}));for(const n of t)if(n!=null&&n>=l&&n<=a){const r=B(o,n);r>-1&&i[r].count++}return{bins:i,minValue:l,maxValue:a,normalizationTotal:e.normalizationTotal}}function U(t,e){const{field:l,classificationMethod:a,standardDeviationInterval:o,normalizationType:i,normalizationField:n,normalizationTotal:r,minValue:s,maxValue:f}=e,u=e.numBins||S;let c=null,d=null,p=null;if((!a||a==="equal-interval")&&!i){if(s!=null&&f!=null)c=s,d=f;else{const m=$({values:t,minValue:s,maxValue:f,useSampleStdDev:!i,supportsNullCount:k({normalizationType:i,normalizationField:n,minValue:s,maxValue:f})});c=m.min,d=m.max}p=O(c,d,u)}else{const{classBreaks:m}=q(t,{field:l,normalizationType:i,normalizationField:n,normalizationTotal:r,classificationMethod:a,standardDeviationInterval:o,minValue:s,maxValue:f,numClasses:u});c=m[0].minValue,d=m[m.length-1].maxValue,p=m.map(v=>[v.minValue,v.maxValue])}return{min:c,max:d,intervals:p}}function B(t,e){let l=-1;for(let a=t.length-1;a>=0;a--)if(e>=t[a][0]){l=a;break}return l}function O(t,e,l){const a=(e-t)/l,o=[];let i,n=t;for(let r=1;r<=l;r++)i=n+a,i=Number(i.toFixed(16)),o.push([n,r===l?e:i]),n=i;return o}export{q as D,Q as F,H as N,J as S,_ as T,Y as V,b as c,$ as d,L as f,k as m,y as p,w as v,j as x}; diff --git a/assets/utils.9731fda2.js b/assets/utils.bc3381b3.js similarity index 99% rename from assets/utils.9731fda2.js rename to assets/utils.bc3381b3.js index 7af80a0..bc3459a 100644 --- a/assets/utils.9731fda2.js +++ b/assets/utils.bc3381b3.js @@ -1 +1 @@ -import{a6 as l,a7 as p,a8 as x,cx as It,cw as re,j as T,ct as Bt,c as j,ei as tt,b4 as k,eW as oe,d2 as ft,eX as ie,e0 as at,u as ae,n as Ot,af as Mt,cU as ue}from"./index.d94abe07.js";import{o as le,c as ce,a as pe,x as ht,u as he,d as fe}from"./RasterSymbolizer.4ee6ff2c.js";import{r as me,g,h as de,o as Gt,i as Lt,k as ge,y as ye,w as xe,c as Vt,x as we}from"./pixelUtils.82950e1a.js";let ut=class extends It{constructor(){super(...arguments),this.raster=void 0}};l([p({json:{write:!0}})],ut.prototype,"raster",void 0),ut=l([x("esri.layers.support.rasterFunctions.AspectFunctionArguments")],ut);const R=ut;var mt;let dt=mt=class extends R{clone(){return new mt({raster:this.raster})}};dt=mt=l([x("esri.layers.support.rasterFunctions.AspectFunctionArguments")],dt);const Ae=dt;let B=class extends It{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0}bind(t,n=!1){const a=this._getRasterValues();for(let o=0;othis._readRasterValue(a,t));return this._processPixels({...t,pixelBlocks:n})}getPrimaryRasters(){const t=[],n=[];return this._getPrimaryRasters(this,t,n),{rasters:t,rasterIds:n}}_getOutputPixelType(t){var n;return this.outputPixelType==="unknown"?t:(n=this.outputPixelType)!=null?n:t}_getRasterValues(){const{rasterArgumentNames:t}=this;return t[0]==="rasters"&&Array.isArray(this.functionArguments.rasters)?this.functionArguments.rasters:t.map(n=>this.functionArguments[n])}_getSourceRasterInfos(t){const n=this._getRasterValues(),{rasterInfos:a,rasterIds:o}=t;return n.map(r=>r&&typeof r=="object"&&"bind"in r&&r.rasterInfo?r.rasterInfo:typeof r=="string"&&o.includes(r)?a[o.indexOf(r)]:a[0])}_getPrimaryRasterId(t){return t==null?void 0:t.url}_getPrimaryRasters(t,n=[],a=[]){for(let o=0;or),s}return t.process(n)}};l([p({json:{write:!0}})],B.prototype,"functionName",void 0),l([p({json:{write:!0}})],B.prototype,"functionArguments",void 0),l([p()],B.prototype,"rasterArgumentNames",void 0),l([p({json:{write:!0}}),re(t=>t==null?void 0:t.toLowerCase())],B.prototype,"outputPixelType",void 0),l([p({json:{write:!0}})],B.prototype,"mainPrimaryRasterId",void 0),l([p()],B.prototype,"sourceRasters",void 0),l([p({json:{write:!0}})],B.prototype,"sourceRasterInfos",void 0),l([p({json:{write:!0}})],B.prototype,"rasterInfo",void 0),l([p({json:{write:!0}})],B.prototype,"readingBufferSize",void 0),B=l([x("esri.layers.support.rasterFunctions.BaseRasterFunction")],B);const I=B;let C=class extends I{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.isGCS=t.spatialReference.isGeographic,this.outputPixelType=this._getOutputPixelType("f32");const n=t.clone();return n.pixelType=this.outputPixelType,n.statistics=null,n.histograms=null,this.rasterInfo=n,{success:!0}}_processPixels(t){var r;const n=(r=t.pixelBlocks)==null?void 0:r[0];if(T(n))return null;const{extent:a}=t,o=a?{x:a.width/n.width,y:a.height/n.height}:{x:1,y:1};return le(n,{resolution:o})}};l([p({json:{write:!0,name:"rasterFunction"}})],C.prototype,"functionName",void 0),l([p({type:Ae,json:{write:!0,name:"rasterFunctionArguments"}})],C.prototype,"functionArguments",void 0),l([p()],C.prototype,"rasterArgumentNames",void 0),l([p({json:{write:!0}})],C.prototype,"isGCS",void 0),C=l([x("esri.layers.support.rasterFunctions.AspectFunction")],C);const ve=C,$e=new Set(["+","-","*","/","(",")"]);function Ne(t,n){(t=t.replace(/ /g,"")).startsWith("-")&&(t="0"+t),t.startsWith("+")&&(t=t.slice(1,t.length));const a=t.split(""),o=[],r=[];let s="";for(let i=0;i-1)a>0&&(r+=n+1);else{for(let i=0;i0&&(r+=n+1)}let s=0;for(let i=0;i0;){const{numIndex:i,opIndex:e}=Se(r);if(o=Fe(t,r[e],s[i],s[i+1]),r.length===1)break;r=be(r,e),s.splice(i,2,o)}return[o]}const Re=new Bt({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function Ie(t,n){var h;if(!me(t))return t;const{equation:a,method:o}=n,r=n.bandIndexes.map(f=>f-1),{pixels:s,mask:i}=t;let e;switch(o){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":e=Dt(i,s[r[0]],s[r[1]]);break;case"ndwi":e=Dt(i,s[r[1]],s[r[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":e=Pe(i,s[r[0]],s[r[1]]);break;case"ci-g":case"ci-re":e=je(i,s[r[0]],s[r[1]]);break;case"savi":e=ke(i,s[r[0]],s[r[1]],r[2]+1);break;case"tsavi":e=Me(i,s[r[0]],s[r[1]],r[2]+1,r[3]+1,r[4]+1);break;case"msavi":e=De(i,s[r[0]],s[r[1]]);break;case"gemi":e=Ce(i,s[r[0]],s[r[1]]);break;case"pvi":e=Ee(i,s[r[0]],s[r[1]],r[2]+1,r[3]+1);break;case"gvitm":e=_e(i,[s[r[0]],s[r[1]],s[r[2]],s[r[3]],s[r[4]],s[r[5]]]);break;case"sultan":e=Oe(i,[s[r[0]],s[r[1]],s[r[2]],s[r[3]],s[r[4]],s[r[5]]]);break;case"vari":e=Ge(i,[s[r[0]],s[r[1]],s[r[2]]]);break;case"mtvi2":e=Le(i,[s[r[0]],s[r[1]],s[r[2]]]);break;case"rtvi-core":e=Ve(i,[s[r[0]],s[r[1]],s[r[2]]]);break;case"evi":e=ze(i,[s[r[0]],s[r[1]],s[r[2]]]);break;case"wndwi":e=qe(i,[s[r[0]],s[r[1]],s[r[2]]],(h=r[3])!=null?h:.5);break;case"bai":e=He(i,s[r[0]],s[r[1]]);break;case"custom":e=Te(i,s,a);break;default:return t}const u=j(i)?new Uint8Array(i.length):null;j(i)&&j(u)&&u.set(i);const c=new g({width:t.width,height:t.height,pixelType:"f32",pixels:e,mask:u});return c.updateStatistics(),c}function Be(t,n,a,o){const{mask:r,pixels:s,width:i,height:e}=t,u=s[a],c=s[n],h=c.length,f=o?new Uint8Array(h):new Float32Array(h),m=o?100:1,v=o?100:0;for(let A=0;AparseFloat(i));return Ie(n,{method:a,bandIndexes:r,equation:o})}};l([p({json:{write:!0,name:"rasterFunction"}})],U.prototype,"functionName",void 0),l([p({type:Ue,json:{write:!0,name:"rasterFunctionArguments"}})],U.prototype,"functionArguments",void 0),l([p()],U.prototype,"rasterArgumentNames",void 0),U=l([x("esri.layers.support.rasterFunctions.BandArithmeticFunction")],U);const Xe=U;var yt;let M=yt=class extends R{readColorRamp(t){return ie(t)}clone(){var t;return new yt({colormap:k(this.colormap),colormapName:this.colormapName,colorRamp:(t=this.colorRamp)==null?void 0:t.clone(),colorRampName:this.colorRampName})}};l([p({type:[[Number]],json:{write:!0}})],M.prototype,"colormap",void 0),l([p({type:String,json:{write:!0}})],M.prototype,"colormapName",void 0),l([p({types:oe,json:{write:!0}})],M.prototype,"colorRamp",void 0),l([ft("colorRamp")],M.prototype,"readColorRamp",null),l([p({type:String,json:{write:!0}})],M.prototype,"colorRampName",void 0),M=yt=l([x("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],M);const We=M;let E=class extends I{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,error:"colormap-function: source data must be single band"};let{colormap:n,colorRamp:a}=this.functionArguments;if(n!=null&&n.length||a&&(n=ce(a,256,!0)),!(n!=null&&n.length))return{success:!1,error:"colormap-function: missing colormap argument"};this.outputPixelType=this._getOutputPixelType("u8");const o=t.clone();return o.pixelType=this.outputPixelType,o.colormap=n,this.rasterInfo=o,{success:!0}}_processPixels(t){var n;return(n=t.pixelBlocks)==null?void 0:n[0]}};l([p({json:{write:!0,name:"rasterFunction"}})],E.prototype,"functionName",void 0),l([p({type:We,json:{write:!0,name:"rasterFunctionArguments"}})],E.prototype,"functionArguments",void 0),l([p()],E.prototype,"rasterArgumentNames",void 0),l([p({json:{write:!0}})],E.prototype,"indexedColormap",void 0),E=l([x("esri.layers.support.rasterFunctions.ColormapFunction")],E);const Je=E;var xt;let nt=xt=class extends R{writeRasters(t,n){n.rasters=t.map(a=>typeof a=="number"||typeof a=="string"?a:a.toJSON())}clone(){return new xt({rasters:k(this.rasters)})}};l([p({json:{write:!0}})],nt.prototype,"rasters",void 0),l([at("rasters")],nt.prototype,"writeRasters",null),nt=xt=l([x("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],nt);const Ye=nt;let X=class extends I{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,n=t[0];this.outputPixelType=this._getOutputPixelType(n.pixelType);const a=n.clone();if(a.attributeTable=null,a.colormap=null,a.pixelType=this.outputPixelType,a.bandCount=t.map(({bandCount:o})=>o).reduce((o,r)=>o+r),t.every(({statistics:o})=>j(o)&&o.length)){const o=[];t.forEach(({statistics:r})=>j(r)&&o.push(...r)),a.statistics=o}if(t.every(({histograms:o})=>j(o)&&o.length)){const o=[];t.forEach(({histograms:r})=>j(r)&&o.push(...r)),a.histograms=o}return this.rasterInfo=a,{success:!0}}_processPixels(t){const{pixelBlocks:n}=t;if(!n)return null;const a=n==null?void 0:n[0];return T(a)?null:de(n)}};l([p({json:{write:!0,name:"rasterFunction"}})],X.prototype,"functionName",void 0),l([p({type:Ye,json:{write:!0,name:"rasterFunctionArguments"}})],X.prototype,"functionArguments",void 0),l([p()],X.prototype,"rasterArgumentNames",void 0),X=l([x("esri.layers.support.rasterFunctions.CompositeBandFunction")],X);const Ke=X;var y;(function(t){t[t.UserDefined=-1]="UserDefined",t[t.LineDetectionHorizontal=0]="LineDetectionHorizontal",t[t.LineDetectionVertical=1]="LineDetectionVertical",t[t.LineDetectionLeftDiagonal=2]="LineDetectionLeftDiagonal",t[t.LineDetectionRightDiagonal=3]="LineDetectionRightDiagonal",t[t.GradientNorth=4]="GradientNorth",t[t.GradientWest=5]="GradientWest",t[t.GradientEast=6]="GradientEast",t[t.GradientSouth=7]="GradientSouth",t[t.GradientNorthEast=8]="GradientNorthEast",t[t.GradientNorthWest=9]="GradientNorthWest",t[t.SmoothArithmeticMean=10]="SmoothArithmeticMean",t[t.Smoothing3x3=11]="Smoothing3x3",t[t.Smoothing5x5=12]="Smoothing5x5",t[t.Sharpening3x3=13]="Sharpening3x3",t[t.Sharpening5x5=14]="Sharpening5x5",t[t.Laplacian3x3=15]="Laplacian3x3",t[t.Laplacian5x5=16]="Laplacian5x5",t[t.SobelHorizontal=17]="SobelHorizontal",t[t.SobelVertical=18]="SobelVertical",t[t.Sharpen=19]="Sharpen",t[t.Sharpen2=20]="Sharpen2",t[t.PointSpread=21]="PointSpread",t[t.None=255]="None"})(y||(y={}));const $=new Map;function Qe(t){const n=Math.sqrt(t.length),a=t.slice(0,n),o=[1];for(let r=1;re+u);return s!==0&&s!==1&&(a=a.map(e=>e/s)),nn(n,{kernel:a,rows:o,cols:r,outputPixelType:this.outputPixelType})}};l([p({json:{write:!0,name:"rasterFunction"}})],W.prototype,"functionName",void 0),l([p({type:sn,json:{write:!0,name:"rasterFunctionArguments"}})],W.prototype,"functionArguments",void 0),l([p()],W.prototype,"rasterArgumentNames",void 0),W=l([x("esri.layers.support.rasterFunctions.ConvolutionFunction")],W);const rn=W;var At;let st=At=class extends R{constructor(){super(...arguments),this.bandIDs=[],this.missingBandAction=Gt.bestMatch}clone(){return new At({bandIDs:[...this.bandIDs],missingBandAction:this.missingBandAction})}};l([p({json:{write:!0}})],st.prototype,"bandIDs",void 0),l([p({json:{write:!0}})],st.prototype,"missingBandAction",void 0),st=At=l([x("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],st);const on=st;let J=class extends I{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,n=t[0],{bandCount:a}=n,{bandIDs:o,missingBandAction:r}=this.functionArguments;if(r===Gt.fail&&o.some(u=>u<0||u>=a))return{success:!1,error:"extract-band-function: invalid bandIDs"};this.outputPixelType=this._getOutputPixelType("f32");const s=n.clone();s.pixelType=this.outputPixelType;const{statistics:i,histograms:e}=s;return j(i)&&i.length&&(s.statistics=o.map(u=>i[u]||i[i.length-1])),j(e)&&e.length&&(s.histograms=o.map(u=>e[u]||e[e.length-1])),this.rasterInfo=s,{success:!0}}_processPixels(t){var r;const n=(r=t.pixelBlocks)==null?void 0:r[0];if(T(n))return null;const a=n.pixels.length,o=this.functionArguments.bandIDs.map(s=>s>=a?a-1:s);return n.extractBands(o)}};l([p({json:{write:!0,name:"rasterFunction"}})],J.prototype,"functionName",void 0),l([p({type:on,json:{write:!0,name:"rasterFunctionArguments"}})],J.prototype,"functionArguments",void 0),l([p()],J.prototype,"rasterArgumentNames",void 0),J=l([x("esri.layers.support.rasterFunctions.ExtractBandFunction")],J);const an=J;var vt;let O=vt=class extends R{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!1}writeRasters(t,n){n.rasters=t.map(a=>typeof a=="number"||typeof a=="string"?a:a.toJSON())}clone(){return new vt({method:this.operation,processAsMultiband:this.processAsMultiband,rasters:k(this.rasters)})}};l([p({json:{write:!0}})],O.prototype,"operation",void 0),l([p({json:{write:!0}})],O.prototype,"rasters",void 0),l([at("rasters")],O.prototype,"writeRasters",null),l([p({json:{write:!0}})],O.prototype,"processAsMultiband",void 0),O=vt=l([x("esri.layers.support.rasterFunctions.LocalFunctionArguments")],O);const un=O;var ct;(function(t){t[t.Plus=1]="Plus",t[t.Minus=2]="Minus",t[t.Times=3]="Times",t[t.SquareRoot=4]="SquareRoot",t[t.Power=5]="Power",t[t.ACos=6]="ACos",t[t.ASin=7]="ASin",t[t.ATan=8]="ATan",t[t.ATanH=9]="ATanH",t[t.Abs=10]="Abs",t[t.BitwiseAnd=11]="BitwiseAnd",t[t.BitwiseLeftShift=12]="BitwiseLeftShift",t[t.BitwiseNot=13]="BitwiseNot",t[t.BitwiseOr=14]="BitwiseOr",t[t.BitwiseRightShift=15]="BitwiseRightShift",t[t.BitwiseXOr=16]="BitwiseXOr",t[t.BooleanAnd=17]="BooleanAnd",t[t.BooleanNot=18]="BooleanNot",t[t.BooleanOr=19]="BooleanOr",t[t.BooleanXOr=20]="BooleanXOr",t[t.Cos=21]="Cos",t[t.CosH=22]="CosH",t[t.Divide=23]="Divide",t[t.EqualTo=24]="EqualTo",t[t.Exp=25]="Exp",t[t.Exp10=26]="Exp10",t[t.Exp2=27]="Exp2",t[t.GreaterThan=28]="GreaterThan",t[t.GreaterThanEqual=29]="GreaterThanEqual",t[t.Int=30]="Int",t[t.IsNull=31]="IsNull",t[t.Float=32]="Float",t[t.LessThan=33]="LessThan",t[t.LessThanEqual=34]="LessThanEqual",t[t.Ln=35]="Ln",t[t.Log10=36]="Log10",t[t.Log2=37]="Log2",t[t.Majority=38]="Majority",t[t.Max=39]="Max",t[t.Mean=40]="Mean",t[t.Med=41]="Med",t[t.Min=42]="Min",t[t.Minority=43]="Minority",t[t.Mod=44]="Mod",t[t.Negate=45]="Negate",t[t.NotEqual=46]="NotEqual",t[t.Range=47]="Range",t[t.RoundDown=48]="RoundDown",t[t.RoundUp=49]="RoundUp",t[t.SetNull=50]="SetNull",t[t.Sin=51]="Sin",t[t.SinH=52]="SinH",t[t.Square=53]="Square",t[t.Std=54]="Std",t[t.Sum=55]="Sum",t[t.Tan=56]="Tan",t[t.TanH=57]="TanH",t[t.Variety=58]="Variety",t[t.ACosH=59]="ACosH",t[t.ASinH=60]="ASinH",t[t.ATan2=61]="ATan2",t[t.FloatDivide=64]="FloatDivide",t[t.FloorDivide=65]="FloorDivide",t[t.MajorityIgnoreNoData=66]="MajorityIgnoreNoData",t[t.MaxIgnoreNoData=67]="MaxIgnoreNoData",t[t.MeanIgnoreNoData=68]="MeanIgnoreNoData",t[t.MedIgnoreNoData=69]="MedIgnoreNoData",t[t.MinIgnoreNoData=70]="MinIgnoreNoData",t[t.MinorityIgnoreNoData=71]="MinorityIgnoreNoData",t[t.RangeIgnoreNoData=72]="RangeIgnoreNoData",t[t.StdIgnoreNoData=73]="StdIgnoreNoData",t[t.SumIgnoreNoData=74]="SumIgnoreNoData",t[t.VarietyIgnoreNoData=75]="VarietyIgnoreNoData",t[t.Con=76]="Con"})(ct||(ct={}));function ln(t){const n=t.map(i=>i.mask).filter(i=>j(i));if(n.length===0)return null;const a=n[0].length,o=new Uint8Array(a);if(n.length===1)return o.set(n[0]),o;let r,s=n[0];for(let i=1;i>r[e]);return i}function $n(t,n,a){const[o,r]=t,s=o.length,i=g.createEmptyBand(a,s);for(let e=0;er[e]?1:0);return i}function Pn(t,n,a){const[o,r]=t,s=o.length,i=g.createEmptyBand(a,s);for(let e=0;e=r[e]?1:0);return i}function jn(t,n,a){const[o,r]=t,s=o.length,i=g.createEmptyBand(a,s);for(let e=0;ec[e]&&(i[e]=c[e])}return i}function Wt(t,n,a){const o=t.length;if(o<2)return t[0];const[r]=t,s=r.length,i=g.createEmptyBand(a,s);i.set(r);for(let e=0;eh[e]&&(u=h[e])}i[e]-=u}return i}function Jt(t,n,a){const o=t.length;if(o<2)return t[0];const[r]=t,s=r.length,i=g.createEmptyBand(a,s);i.set(r);for(let e=0;ef&&(f=h,c=m);i[u]=c}return i}function te(t,n,a){const o=t.length;if(o<2)return t[0];const[r]=t,s=r.length,i=g.createEmptyBand(a,s),e=new Map;for(let u=0;uv.pixels[h]);let m;if(n===ct.SetNull){const v=_n(f,o,s);m=v.band,u=v.mask}else d.has(n)?m=d.get(n)(f,o,s):N.has(n)?m=gn(f,o,s,N.get(n)):pt.has(n)&&(m=yn(f,o,s,pt.get(n)));if(m==null)return null;e.push(m)}u||n===ct.IsNull||(u=o);const c=t[0];return new g({width:c.width,height:c.height,pixelType:s,mask:u,pixels:e})}let Y=class extends I{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,n=t[0],{bandCount:a}=n,{processAsMultiband:o}=this.functionArguments;if(o&&t.some(s=>s.bandCount!==a))return{success:!1,error:"local-function: input rasters do not have same band count"};this.outputPixelType=this._getOutputPixelType("f32");const r=n.clone();return r.pixelType=this.outputPixelType,r.statistics=null,r.histograms=null,o||(r.bandCount=1),this.rasterInfo=r,{success:!0}}_processPixels(t){var a;const{pixelBlocks:n}=t;return T(n)||n.some(o=>T(o))?null:Kn(n,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:(a=this.outputPixelType)!=null?a:void 0})}};l([p({json:{write:!0,name:"rasterFunction"}})],Y.prototype,"functionName",void 0),l([p({type:un,json:{write:!0,name:"rasterFunctionArguments"}})],Y.prototype,"functionArguments",void 0),l([p()],Y.prototype,"rasterArgumentNames",void 0),Y=l([x("esri.layers.support.rasterFunctions.LocalFunction")],Y);const Qn=Y;var $t;let K=$t=class extends R{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=Lt.matchAny}clone(){var t,n,a,o;return new $t({includedRanges:(n=(t=this.includedRanges)==null?void 0:t.slice())!=null?n:[],noDataValues:(o=(a=this.noDataValues)==null?void 0:a.slice())!=null?o:[],noDataInterpretation:this.noDataInterpretation})}};l([p({json:{write:!0}})],K.prototype,"includedRanges",void 0),l([p({json:{write:!0}})],K.prototype,"noDataValues",void 0),l([p({json:{write:!0}})],K.prototype,"noDataInterpretation",void 0),K=$t=l([x("esri.layers.support.rasterFunctions.MaskFunctionArguments")],K);const Zn=K;let G=class extends I{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:n}=t;this.outputPixelType=this._getOutputPixelType(n),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:a,noDataValues:o}=this.functionArguments;return(a==null?void 0:a.length)||(o==null?void 0:o.length)?(this.lookup=ge(n,this.functionArguments.includedRanges,this.functionArguments.noDataValues),{success:!0}):{success:!1,error:"missing includedRanges or noDataValues argument"}}_processPixels(t){var u;const n=(u=t.pixelBlocks)==null?void 0:u[0];if(T(n))return null;const{outputPixelType:a,lookup:o}=this,{includedRanges:r,noDataValues:s,noDataInterpretation:i}=this.functionArguments,e=i===Lt.matchAll;return ye(n,{includedRanges:r,noDataValues:s,outputPixelType:a,matchAll:e,lookup:o})}};l([p({json:{write:!0,name:"rasterFunction"}})],G.prototype,"functionName",void 0),l([p({type:Zn,json:{write:!0,name:"rasterFunctionArguments"}})],G.prototype,"functionArguments",void 0),l([p()],G.prototype,"rasterArgumentNames",void 0),l([p({json:{write:!0}})],G.prototype,"lookup",void 0),G=l([x("esri.layers.support.rasterFunctions.MaskFunction")],G);const ts=G;var Nt;let Q=Nt=class extends R{constructor(){super(...arguments),this.visibleBandID=0,this.infraredBandID=1,this.scaled=!0}clone(){const{visibleBandID:t,infraredBandID:n,scaled:a}=this;return new Nt({visibleBandID:t,infraredBandID:n,scaled:a})}};l([p({json:{write:!0}})],Q.prototype,"visibleBandID",void 0),l([p({json:{write:!0}})],Q.prototype,"infraredBandID",void 0),l([p({json:{write:!0}})],Q.prototype,"scaled",void 0),Q=Nt=l([x("esri.layers.support.rasterFunctions.NDVIFunctionArguments")],Q);const es=Q;let Z=class extends I{constructor(){super(...arguments),this.functionName="NDVI",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{scaled:t}=this.functionArguments;this.outputPixelType=this._getOutputPixelType(t?"u8":"f32");const n=this.sourceRasterInfos[0].clone();n.pixelType=this.outputPixelType,n.colormap=null,n.histograms=null;const[a,o,r,s]=t?[0,200,100,10]:[-1,1,0,.1];return n.statistics=[{min:a,max:o,avg:r,stddev:s}],this.rasterInfo=n,{success:!0}}_processPixels(t){var s;const n=(s=t.pixelBlocks)==null?void 0:s[0];if(T(n))return null;const{visibleBandID:a,infraredBandID:o,scaled:r}=this.functionArguments;return Be(n,a,o,r)}};l([p({json:{write:!0,name:"rasterFunction"}})],Z.prototype,"functionName",void 0),l([p({type:es,json:{write:!0,name:"rasterFunctionArguments"}})],Z.prototype,"functionArguments",void 0),l([p()],Z.prototype,"rasterArgumentNames",void 0),Z=l([x("esri.layers.support.rasterFunctions.NDVIFunction")],Z);const ns=Z;var Ft;let L=Ft=class extends R{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1}clone(){return new Ft({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched})}};l([p({json:{write:!0}})],L.prototype,"inputRanges",void 0),l([p({json:{write:!0}})],L.prototype,"outputValues",void 0),l([p({json:{write:!0}})],L.prototype,"noDataRanges",void 0),l([p({json:{write:!0}})],L.prototype,"allowUnmatched",void 0),L=Ft=l([x("esri.layers.support.rasterFunctions.RemapFunctionArguments")],L);const ss=L;let V=class extends I{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:n}=t;this.outputPixelType=this._getOutputPixelType(n),t.pixelType=this.outputPixelType,t.colormap=null,t.histograms=null;const{statistics:a}=t,{allowUnmatched:o,outputValues:r}=this.functionArguments;if(j(a)&&a.length&&!o){let s=r[0],i=s;for(let e=0;er[e]?r[e]:s,i=i>r[e]?i:r[e];for(let e=0;e({min:r,max:s,avg:i,stddev:e}))),this.rasterInfo=n,{success:!0}}_processPixels(t){var n;return(n=t.pixelBlocks)==null?void 0:n[0]}};l([p({json:{write:!0,name:"rasterFunction"}})],H.prototype,"functionName",void 0),l([p({type:us,json:{write:!0,name:"rasterFunctionArguments"}})],H.prototype,"functionArguments",void 0),l([p()],H.prototype,"rasterArgumentNames",void 0),l([p({json:{write:!0}})],H.prototype,"indexedColormap",void 0),H=l([x("esri.layers.support.rasterFunctions.StatisticsHistogramsFunction")],H);const ls=H;var Tt;const cs=new Bt({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",7:"sigmoid"},{useNumericKeys:!0});let b=Tt=class extends R{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(t,n,a){t!=null&&t.length&&(Array.isArray(t[0])||(t=t.map(o=>[o.min,o.max,o.avg,o.stddev])),n[a]=t)}clone(){return new Tt({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:k(this.statistics),gamma:k(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:k(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};l([p({type:Boolean,json:{write:!0}})],b.prototype,"computeGamma",void 0),l([p({type:Boolean,json:{name:"dra",write:!0}})],b.prototype,"dynamicRangeAdjustment",void 0),l([p({type:[Number],json:{write:!0}})],b.prototype,"gamma",void 0),l([p()],b.prototype,"histograms",void 0),l([p({type:Number,json:{write:!0}})],b.prototype,"maxPercent",void 0),l([p({type:Number,json:{write:!0}})],b.prototype,"minPercent",void 0),l([p({type:Number,json:{write:!0}})],b.prototype,"numberOfStandardDeviations",void 0),l([p({type:Number,json:{name:"max",write:!0}})],b.prototype,"outputMax",void 0),l([p({type:Number,json:{name:"min",write:!0}})],b.prototype,"outputMin",void 0),l([p({type:Number,json:{write:!0}})],b.prototype,"sigmoidStrengthLevel",void 0),l([p({json:{type:[[Number]],write:!0}})],b.prototype,"statistics",void 0),l([at("statistics")],b.prototype,"writeStatistics",null),l([tt(cs)],b.prototype,"stretchType",void 0),l([p({type:Boolean,json:{write:!0}})],b.prototype,"useGamma",void 0),b=Tt=l([x("esri.layers.support.rasterFunctions.StretchFunctionArguments")],b);const ps=b;let D=class extends I{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const t=this.sourceRasterInfos[0],{pixelType:n}=t,{functionArguments:a}=this,{dynamicRangeAdjustment:o,gamma:r,useGamma:s}=a;if(!o&&["u8","u16","s8","s16"].includes(n)){const e=ht(a.toJSON(),{rasterInfo:t});this.lookup=he({pixelType:n,...e,gamma:s?r:null})}else o&&(this.cutOffs=ht(a.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(n);const i=t.clone();return i.pixelType=this.outputPixelType,i.statistics=null,i.histograms=null,this.outputPixelType==="u8"&&(i.keyProperties.DataType="processed"),this.rasterInfo=i,{success:!0}}_processPixels(t){var i;const n=(i=t.pixelBlocks)==null?void 0:i[0];if(T(n))return n;const{lookup:a}=this;if(a)return Vt(n,{...a,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:o}=this,r=this.cutOffs||ht(o.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:n}),s=o.useGamma?o.gamma:null;return fe(n,{...r,gamma:s,outputPixelType:this.outputPixelType})}};l([p({json:{write:!0,name:"rasterFunction"}})],D.prototype,"functionName",void 0),l([p({type:ps,json:{write:!0,name:"rasterFunctionArguments"}})],D.prototype,"functionArguments",void 0),l([p()],D.prototype,"rasterArgumentNames",void 0),l([p({json:{write:!0}})],D.prototype,"lookup",void 0),l([p({json:{write:!0}})],D.prototype,"cutOffs",void 0),D=l([x("esri.layers.support.rasterFunctions.StretchFunction")],D);const hs=D,S=new Map;function $s(t,n){if("rasterFunction"in t)return ne(t,n!=null?n:{});throw new Ot("raster-function-helper","unsupported raster function json.")}function fs(t,n){return n[0]==="rasters"&&Array.isArray(t.rasters)?t.rasters:n.map(a=>t[a])}function ne(t,n){var m,v;const{rasterFunction:a,rasterFunctionArguments:o}=t,r=(m=t.outputPixelType)==null?void 0:m.toLowerCase();if(a==null||!S.has(a))throw new Ot("raster-function-helper",`unsupported raster function: ${a}`);const s=S.get(a),i=(typeof s.ctor=="function"?s.ctor:s.ctor.default).fromJSON({...t,outputPixelType:r}),{rasterArgumentNames:e}=i,u=[],c=fs(o,e),h=e[0]==="rasters",f=[];for(let w=0;w180+this.tolerance&&(t.x-=360),t):(t.xmin>=180-this.tolerance?(t.xmax-=360,t.xmin-=360):t.xmax>180+this.tolerance&&(t.xmin=-180,t.xmax=180),t)}inverseTransform(t){return(t=t.clone()).type==="point"?(t.x<-this.tolerance&&(t.x+=360),t):(t.xmin<-this.tolerance&&(t.xmin+=360,t.xmax+=360),t)}};l([tt({GCSShiftXform:"gcs-shift"})],it.prototype,"type",void 0),l([p()],it.prototype,"tolerance",void 0),it=l([x("esri.layers.support.rasterTransforms.GCSShiftTransform")],it);const ms=it;let lt=class extends Pt{constructor(){super(...arguments),this.type="identity"}};l([tt({IdentityXform:"identity"})],lt.prototype,"type",void 0),lt=l([x("esri.layers.support.rasterTransforms.IdentityTransform")],lt);const ds=lt;function Rt(t,n,a){const{x:o,y:r}=n;if(a<2)return{x:t[0]+o*t[2]+r*t[4],y:t[1]+o*t[3]+r*t[5]};if(a===2){const m=o*o,v=r*r,w=o*r;return{x:t[0]+o*t[2]+r*t[4]+m*t[6]+w*t[8]+v*t[10],y:t[1]+o*t[3]+r*t[5]+m*t[7]+w*t[9]+v*t[11]}}const s=o*o,i=r*r,e=o*r,u=s*o,c=s*r,h=o*i,f=r*i;return{x:t[0]+o*t[2]+r*t[4]+s*t[6]+e*t[8]+i*t[10]+u*t[12]+c*t[14]+h*t[16]+f*t[18],y:t[1]+o*t[3]+r*t[5]+s*t[7]+e*t[9]+i*t[11]+u*t[13]+c*t[15]+h*t[17]+f*t[19]}}function _t(t,n,a){const{xmin:o,ymin:r,xmax:s,ymax:i,spatialReference:e}=n;let u=[];if(a<2)u.push({x:o,y:i}),u.push({x:s,y:i}),u.push({x:o,y:r}),u.push({x:s,y:r});else{let f=10;for(let m=0;mRt(t,f,a));const c=u.map(f=>f.x),h=u.map(f=>f.y);return new ue({xmin:Math.min.apply(null,c),xmax:Math.max.apply(null,c),ymin:Math.min.apply(null,h),ymax:Math.max.apply(null,h),spatialReference:e})}function gs(t){const[n,a,o,r,s,i]=t,e=o*i-s*r,u=s*r-o*i;return[(s*a-n*i)/e,(o*a-n*r)/u,i/e,r/u,-s/e,-o/u]}let P=class extends Pt{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(t,n){const{coeffX:a,coeffY:o}=n;if(!(a!=null&&a.length)||!(o!=null&&o.length)||a.length!==o.length)return null;const r=[];for(let s=0;s0}forwardTransform(t){if(t.type==="point"){const n=Rt(this.forwardCoefficients,t,this.polynomialOrder);return new Mt({x:n.x,y:n.y,spatialReference:t.spatialReference})}return _t(this.forwardCoefficients,t,this.polynomialOrder)}inverseTransform(t){if(t.type==="point"){const n=Rt(this.inverseCoefficients,t,this.polynomialOrder);return new Mt({x:n.x,y:n.y,spatialReference:t.spatialReference})}return _t(this.inverseCoefficients,t,this.polynomialOrder)}};l([p({json:{write:!0}})],P.prototype,"polynomialOrder",void 0),l([p()],P.prototype,"forwardCoefficients",void 0),l([ft("forwardCoefficients",["coeffX","coeffY"])],P.prototype,"readForwardCoefficients",null),l([at("forwardCoefficients")],P.prototype,"writeForwardCoefficients",null),l([p({json:{write:!0}})],P.prototype,"inverseCoefficients",null),l([ft("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],P.prototype,"readInverseCoefficients",null),l([at("inverseCoefficients")],P.prototype,"writeInverseCoefficients",null),l([p()],P.prototype,"affectsPixelSize",null),l([tt({PolynomialXform:"polynomial"})],P.prototype,"type",void 0),P=l([x("esri.layers.support.rasterTransforms.PolynomialTransform")],P);const ys=P,se={GCSShiftXform:ms,IdentityXform:ds,PolynomialXform:ys},xs=Object.keys(se);function Ns(t){const n=t==null?void 0:t.type;return!t||xs.includes(n)}function Fs(t){if(!(t==null?void 0:t.type))return null;const a=se[t==null?void 0:t.type];if(a){const o=new a;return o.read(t),o}return null}export{ms as c,Ns as f,Fs as i,$s as l,ys as m}; +import{a6 as l,a7 as p,a8 as x,cx as It,cw as re,j as T,ct as Bt,c as j,ei as tt,b4 as k,eW as oe,d2 as ft,eX as ie,e0 as at,u as ae,n as Ot,af as Mt,cU as ue}from"./index.221827cd.js";import{o as le,c as ce,a as pe,x as ht,u as he,d as fe}from"./RasterSymbolizer.093b1748.js";import{r as me,g,h as de,o as Gt,i as Lt,k as ge,y as ye,w as xe,c as Vt,x as we}from"./pixelUtils.9c6f8dae.js";let ut=class extends It{constructor(){super(...arguments),this.raster=void 0}};l([p({json:{write:!0}})],ut.prototype,"raster",void 0),ut=l([x("esri.layers.support.rasterFunctions.AspectFunctionArguments")],ut);const R=ut;var mt;let dt=mt=class extends R{clone(){return new mt({raster:this.raster})}};dt=mt=l([x("esri.layers.support.rasterFunctions.AspectFunctionArguments")],dt);const Ae=dt;let B=class extends It{constructor(){super(...arguments),this.functionArguments=null,this.readingBufferSize=0}bind(t,n=!1){const a=this._getRasterValues();for(let o=0;othis._readRasterValue(a,t));return this._processPixels({...t,pixelBlocks:n})}getPrimaryRasters(){const t=[],n=[];return this._getPrimaryRasters(this,t,n),{rasters:t,rasterIds:n}}_getOutputPixelType(t){var n;return this.outputPixelType==="unknown"?t:(n=this.outputPixelType)!=null?n:t}_getRasterValues(){const{rasterArgumentNames:t}=this;return t[0]==="rasters"&&Array.isArray(this.functionArguments.rasters)?this.functionArguments.rasters:t.map(n=>this.functionArguments[n])}_getSourceRasterInfos(t){const n=this._getRasterValues(),{rasterInfos:a,rasterIds:o}=t;return n.map(r=>r&&typeof r=="object"&&"bind"in r&&r.rasterInfo?r.rasterInfo:typeof r=="string"&&o.includes(r)?a[o.indexOf(r)]:a[0])}_getPrimaryRasterId(t){return t==null?void 0:t.url}_getPrimaryRasters(t,n=[],a=[]){for(let o=0;or),s}return t.process(n)}};l([p({json:{write:!0}})],B.prototype,"functionName",void 0),l([p({json:{write:!0}})],B.prototype,"functionArguments",void 0),l([p()],B.prototype,"rasterArgumentNames",void 0),l([p({json:{write:!0}}),re(t=>t==null?void 0:t.toLowerCase())],B.prototype,"outputPixelType",void 0),l([p({json:{write:!0}})],B.prototype,"mainPrimaryRasterId",void 0),l([p()],B.prototype,"sourceRasters",void 0),l([p({json:{write:!0}})],B.prototype,"sourceRasterInfos",void 0),l([p({json:{write:!0}})],B.prototype,"rasterInfo",void 0),l([p({json:{write:!0}})],B.prototype,"readingBufferSize",void 0),B=l([x("esri.layers.support.rasterFunctions.BaseRasterFunction")],B);const I=B;let C=class extends I{constructor(){super(...arguments),this.functionName="Aspect",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.isGCS=!1}_bindSourceRasters(){const t=this.sourceRasterInfos[0];this.isGCS=t.spatialReference.isGeographic,this.outputPixelType=this._getOutputPixelType("f32");const n=t.clone();return n.pixelType=this.outputPixelType,n.statistics=null,n.histograms=null,this.rasterInfo=n,{success:!0}}_processPixels(t){var r;const n=(r=t.pixelBlocks)==null?void 0:r[0];if(T(n))return null;const{extent:a}=t,o=a?{x:a.width/n.width,y:a.height/n.height}:{x:1,y:1};return le(n,{resolution:o})}};l([p({json:{write:!0,name:"rasterFunction"}})],C.prototype,"functionName",void 0),l([p({type:Ae,json:{write:!0,name:"rasterFunctionArguments"}})],C.prototype,"functionArguments",void 0),l([p()],C.prototype,"rasterArgumentNames",void 0),l([p({json:{write:!0}})],C.prototype,"isGCS",void 0),C=l([x("esri.layers.support.rasterFunctions.AspectFunction")],C);const ve=C,$e=new Set(["+","-","*","/","(",")"]);function Ne(t,n){(t=t.replace(/ /g,"")).startsWith("-")&&(t="0"+t),t.startsWith("+")&&(t=t.slice(1,t.length));const a=t.split(""),o=[],r=[];let s="";for(let i=0;i-1)a>0&&(r+=n+1);else{for(let i=0;i0&&(r+=n+1)}let s=0;for(let i=0;i0;){const{numIndex:i,opIndex:e}=Se(r);if(o=Fe(t,r[e],s[i],s[i+1]),r.length===1)break;r=be(r,e),s.splice(i,2,o)}return[o]}const Re=new Bt({0:"custom",1:"ndvi",2:"savi",3:"tsavi",4:"msavi",5:"gemi",6:"pvi",7:"gvitm",8:"sultan",9:"vari",10:"gndvi",11:"sr",12:"ndvi-re",13:"sr-re",14:"mtvi2",15:"rtvi-core",16:"ci-re",17:"ci-g",18:"ndwi",19:"evi",20:"iron-oxide",21:"ferrous-minerals",22:"clay-minerals",23:"wndwi",24:"bai",25:"nbr",26:"ndbi",27:"ndmi",28:"ndsi",29:"mndwi"},{useNumericKeys:!0});function Ie(t,n){var h;if(!me(t))return t;const{equation:a,method:o}=n,r=n.bandIndexes.map(f=>f-1),{pixels:s,mask:i}=t;let e;switch(o){case"gndvi":case"nbr":case"ndbi":case"ndvi":case"ndvi-re":case"ndsi":case"ndmi":case"mndwi":e=Dt(i,s[r[0]],s[r[1]]);break;case"ndwi":e=Dt(i,s[r[1]],s[r[0]]);break;case"sr":case"sr-re":case"iron-oxide":case"ferrous-minerals":case"clay-minerals":e=Pe(i,s[r[0]],s[r[1]]);break;case"ci-g":case"ci-re":e=je(i,s[r[0]],s[r[1]]);break;case"savi":e=ke(i,s[r[0]],s[r[1]],r[2]+1);break;case"tsavi":e=Me(i,s[r[0]],s[r[1]],r[2]+1,r[3]+1,r[4]+1);break;case"msavi":e=De(i,s[r[0]],s[r[1]]);break;case"gemi":e=Ce(i,s[r[0]],s[r[1]]);break;case"pvi":e=Ee(i,s[r[0]],s[r[1]],r[2]+1,r[3]+1);break;case"gvitm":e=_e(i,[s[r[0]],s[r[1]],s[r[2]],s[r[3]],s[r[4]],s[r[5]]]);break;case"sultan":e=Oe(i,[s[r[0]],s[r[1]],s[r[2]],s[r[3]],s[r[4]],s[r[5]]]);break;case"vari":e=Ge(i,[s[r[0]],s[r[1]],s[r[2]]]);break;case"mtvi2":e=Le(i,[s[r[0]],s[r[1]],s[r[2]]]);break;case"rtvi-core":e=Ve(i,[s[r[0]],s[r[1]],s[r[2]]]);break;case"evi":e=ze(i,[s[r[0]],s[r[1]],s[r[2]]]);break;case"wndwi":e=qe(i,[s[r[0]],s[r[1]],s[r[2]]],(h=r[3])!=null?h:.5);break;case"bai":e=He(i,s[r[0]],s[r[1]]);break;case"custom":e=Te(i,s,a);break;default:return t}const u=j(i)?new Uint8Array(i.length):null;j(i)&&j(u)&&u.set(i);const c=new g({width:t.width,height:t.height,pixelType:"f32",pixels:e,mask:u});return c.updateStatistics(),c}function Be(t,n,a,o){const{mask:r,pixels:s,width:i,height:e}=t,u=s[a],c=s[n],h=c.length,f=o?new Uint8Array(h):new Float32Array(h),m=o?100:1,v=o?100:0;for(let A=0;AparseFloat(i));return Ie(n,{method:a,bandIndexes:r,equation:o})}};l([p({json:{write:!0,name:"rasterFunction"}})],U.prototype,"functionName",void 0),l([p({type:Ue,json:{write:!0,name:"rasterFunctionArguments"}})],U.prototype,"functionArguments",void 0),l([p()],U.prototype,"rasterArgumentNames",void 0),U=l([x("esri.layers.support.rasterFunctions.BandArithmeticFunction")],U);const Xe=U;var yt;let M=yt=class extends R{readColorRamp(t){return ie(t)}clone(){var t;return new yt({colormap:k(this.colormap),colormapName:this.colormapName,colorRamp:(t=this.colorRamp)==null?void 0:t.clone(),colorRampName:this.colorRampName})}};l([p({type:[[Number]],json:{write:!0}})],M.prototype,"colormap",void 0),l([p({type:String,json:{write:!0}})],M.prototype,"colormapName",void 0),l([p({types:oe,json:{write:!0}})],M.prototype,"colorRamp",void 0),l([ft("colorRamp")],M.prototype,"readColorRamp",null),l([p({type:String,json:{write:!0}})],M.prototype,"colorRampName",void 0),M=yt=l([x("esri.layers.support.rasterFunctions.ColormapFunctionArguments")],M);const We=M;let E=class extends I{constructor(){super(...arguments),this.functionName="Colormap",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const t=this.sourceRasterInfos[0];if(t.bandCount>1)return{success:!1,error:"colormap-function: source data must be single band"};let{colormap:n,colorRamp:a}=this.functionArguments;if(n!=null&&n.length||a&&(n=ce(a,256,!0)),!(n!=null&&n.length))return{success:!1,error:"colormap-function: missing colormap argument"};this.outputPixelType=this._getOutputPixelType("u8");const o=t.clone();return o.pixelType=this.outputPixelType,o.colormap=n,this.rasterInfo=o,{success:!0}}_processPixels(t){var n;return(n=t.pixelBlocks)==null?void 0:n[0]}};l([p({json:{write:!0,name:"rasterFunction"}})],E.prototype,"functionName",void 0),l([p({type:We,json:{write:!0,name:"rasterFunctionArguments"}})],E.prototype,"functionArguments",void 0),l([p()],E.prototype,"rasterArgumentNames",void 0),l([p({json:{write:!0}})],E.prototype,"indexedColormap",void 0),E=l([x("esri.layers.support.rasterFunctions.ColormapFunction")],E);const Je=E;var xt;let nt=xt=class extends R{writeRasters(t,n){n.rasters=t.map(a=>typeof a=="number"||typeof a=="string"?a:a.toJSON())}clone(){return new xt({rasters:k(this.rasters)})}};l([p({json:{write:!0}})],nt.prototype,"rasters",void 0),l([at("rasters")],nt.prototype,"writeRasters",null),nt=xt=l([x("esri.layers.support.rasterFunctions.CompositeBandFunctionArguments")],nt);const Ye=nt;let X=class extends I{constructor(){super(...arguments),this.functionName="CompositeBand",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,n=t[0];this.outputPixelType=this._getOutputPixelType(n.pixelType);const a=n.clone();if(a.attributeTable=null,a.colormap=null,a.pixelType=this.outputPixelType,a.bandCount=t.map(({bandCount:o})=>o).reduce((o,r)=>o+r),t.every(({statistics:o})=>j(o)&&o.length)){const o=[];t.forEach(({statistics:r})=>j(r)&&o.push(...r)),a.statistics=o}if(t.every(({histograms:o})=>j(o)&&o.length)){const o=[];t.forEach(({histograms:r})=>j(r)&&o.push(...r)),a.histograms=o}return this.rasterInfo=a,{success:!0}}_processPixels(t){const{pixelBlocks:n}=t;if(!n)return null;const a=n==null?void 0:n[0];return T(a)?null:de(n)}};l([p({json:{write:!0,name:"rasterFunction"}})],X.prototype,"functionName",void 0),l([p({type:Ye,json:{write:!0,name:"rasterFunctionArguments"}})],X.prototype,"functionArguments",void 0),l([p()],X.prototype,"rasterArgumentNames",void 0),X=l([x("esri.layers.support.rasterFunctions.CompositeBandFunction")],X);const Ke=X;var y;(function(t){t[t.UserDefined=-1]="UserDefined",t[t.LineDetectionHorizontal=0]="LineDetectionHorizontal",t[t.LineDetectionVertical=1]="LineDetectionVertical",t[t.LineDetectionLeftDiagonal=2]="LineDetectionLeftDiagonal",t[t.LineDetectionRightDiagonal=3]="LineDetectionRightDiagonal",t[t.GradientNorth=4]="GradientNorth",t[t.GradientWest=5]="GradientWest",t[t.GradientEast=6]="GradientEast",t[t.GradientSouth=7]="GradientSouth",t[t.GradientNorthEast=8]="GradientNorthEast",t[t.GradientNorthWest=9]="GradientNorthWest",t[t.SmoothArithmeticMean=10]="SmoothArithmeticMean",t[t.Smoothing3x3=11]="Smoothing3x3",t[t.Smoothing5x5=12]="Smoothing5x5",t[t.Sharpening3x3=13]="Sharpening3x3",t[t.Sharpening5x5=14]="Sharpening5x5",t[t.Laplacian3x3=15]="Laplacian3x3",t[t.Laplacian5x5=16]="Laplacian5x5",t[t.SobelHorizontal=17]="SobelHorizontal",t[t.SobelVertical=18]="SobelVertical",t[t.Sharpen=19]="Sharpen",t[t.Sharpen2=20]="Sharpen2",t[t.PointSpread=21]="PointSpread",t[t.None=255]="None"})(y||(y={}));const $=new Map;function Qe(t){const n=Math.sqrt(t.length),a=t.slice(0,n),o=[1];for(let r=1;re+u);return s!==0&&s!==1&&(a=a.map(e=>e/s)),nn(n,{kernel:a,rows:o,cols:r,outputPixelType:this.outputPixelType})}};l([p({json:{write:!0,name:"rasterFunction"}})],W.prototype,"functionName",void 0),l([p({type:sn,json:{write:!0,name:"rasterFunctionArguments"}})],W.prototype,"functionArguments",void 0),l([p()],W.prototype,"rasterArgumentNames",void 0),W=l([x("esri.layers.support.rasterFunctions.ConvolutionFunction")],W);const rn=W;var At;let st=At=class extends R{constructor(){super(...arguments),this.bandIDs=[],this.missingBandAction=Gt.bestMatch}clone(){return new At({bandIDs:[...this.bandIDs],missingBandAction:this.missingBandAction})}};l([p({json:{write:!0}})],st.prototype,"bandIDs",void 0),l([p({json:{write:!0}})],st.prototype,"missingBandAction",void 0),st=At=l([x("esri.layers.support.rasterFunctions.ExtractBandFunctionArguments")],st);const on=st;let J=class extends I{constructor(){super(...arguments),this.functionName="ExtractBand",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,n=t[0],{bandCount:a}=n,{bandIDs:o,missingBandAction:r}=this.functionArguments;if(r===Gt.fail&&o.some(u=>u<0||u>=a))return{success:!1,error:"extract-band-function: invalid bandIDs"};this.outputPixelType=this._getOutputPixelType("f32");const s=n.clone();s.pixelType=this.outputPixelType;const{statistics:i,histograms:e}=s;return j(i)&&i.length&&(s.statistics=o.map(u=>i[u]||i[i.length-1])),j(e)&&e.length&&(s.histograms=o.map(u=>e[u]||e[e.length-1])),this.rasterInfo=s,{success:!0}}_processPixels(t){var r;const n=(r=t.pixelBlocks)==null?void 0:r[0];if(T(n))return null;const a=n.pixels.length,o=this.functionArguments.bandIDs.map(s=>s>=a?a-1:s);return n.extractBands(o)}};l([p({json:{write:!0,name:"rasterFunction"}})],J.prototype,"functionName",void 0),l([p({type:on,json:{write:!0,name:"rasterFunctionArguments"}})],J.prototype,"functionArguments",void 0),l([p()],J.prototype,"rasterArgumentNames",void 0),J=l([x("esri.layers.support.rasterFunctions.ExtractBandFunction")],J);const an=J;var vt;let O=vt=class extends R{constructor(){super(...arguments),this.rasters=[],this.processAsMultiband=!1}writeRasters(t,n){n.rasters=t.map(a=>typeof a=="number"||typeof a=="string"?a:a.toJSON())}clone(){return new vt({method:this.operation,processAsMultiband:this.processAsMultiband,rasters:k(this.rasters)})}};l([p({json:{write:!0}})],O.prototype,"operation",void 0),l([p({json:{write:!0}})],O.prototype,"rasters",void 0),l([at("rasters")],O.prototype,"writeRasters",null),l([p({json:{write:!0}})],O.prototype,"processAsMultiband",void 0),O=vt=l([x("esri.layers.support.rasterFunctions.LocalFunctionArguments")],O);const un=O;var ct;(function(t){t[t.Plus=1]="Plus",t[t.Minus=2]="Minus",t[t.Times=3]="Times",t[t.SquareRoot=4]="SquareRoot",t[t.Power=5]="Power",t[t.ACos=6]="ACos",t[t.ASin=7]="ASin",t[t.ATan=8]="ATan",t[t.ATanH=9]="ATanH",t[t.Abs=10]="Abs",t[t.BitwiseAnd=11]="BitwiseAnd",t[t.BitwiseLeftShift=12]="BitwiseLeftShift",t[t.BitwiseNot=13]="BitwiseNot",t[t.BitwiseOr=14]="BitwiseOr",t[t.BitwiseRightShift=15]="BitwiseRightShift",t[t.BitwiseXOr=16]="BitwiseXOr",t[t.BooleanAnd=17]="BooleanAnd",t[t.BooleanNot=18]="BooleanNot",t[t.BooleanOr=19]="BooleanOr",t[t.BooleanXOr=20]="BooleanXOr",t[t.Cos=21]="Cos",t[t.CosH=22]="CosH",t[t.Divide=23]="Divide",t[t.EqualTo=24]="EqualTo",t[t.Exp=25]="Exp",t[t.Exp10=26]="Exp10",t[t.Exp2=27]="Exp2",t[t.GreaterThan=28]="GreaterThan",t[t.GreaterThanEqual=29]="GreaterThanEqual",t[t.Int=30]="Int",t[t.IsNull=31]="IsNull",t[t.Float=32]="Float",t[t.LessThan=33]="LessThan",t[t.LessThanEqual=34]="LessThanEqual",t[t.Ln=35]="Ln",t[t.Log10=36]="Log10",t[t.Log2=37]="Log2",t[t.Majority=38]="Majority",t[t.Max=39]="Max",t[t.Mean=40]="Mean",t[t.Med=41]="Med",t[t.Min=42]="Min",t[t.Minority=43]="Minority",t[t.Mod=44]="Mod",t[t.Negate=45]="Negate",t[t.NotEqual=46]="NotEqual",t[t.Range=47]="Range",t[t.RoundDown=48]="RoundDown",t[t.RoundUp=49]="RoundUp",t[t.SetNull=50]="SetNull",t[t.Sin=51]="Sin",t[t.SinH=52]="SinH",t[t.Square=53]="Square",t[t.Std=54]="Std",t[t.Sum=55]="Sum",t[t.Tan=56]="Tan",t[t.TanH=57]="TanH",t[t.Variety=58]="Variety",t[t.ACosH=59]="ACosH",t[t.ASinH=60]="ASinH",t[t.ATan2=61]="ATan2",t[t.FloatDivide=64]="FloatDivide",t[t.FloorDivide=65]="FloorDivide",t[t.MajorityIgnoreNoData=66]="MajorityIgnoreNoData",t[t.MaxIgnoreNoData=67]="MaxIgnoreNoData",t[t.MeanIgnoreNoData=68]="MeanIgnoreNoData",t[t.MedIgnoreNoData=69]="MedIgnoreNoData",t[t.MinIgnoreNoData=70]="MinIgnoreNoData",t[t.MinorityIgnoreNoData=71]="MinorityIgnoreNoData",t[t.RangeIgnoreNoData=72]="RangeIgnoreNoData",t[t.StdIgnoreNoData=73]="StdIgnoreNoData",t[t.SumIgnoreNoData=74]="SumIgnoreNoData",t[t.VarietyIgnoreNoData=75]="VarietyIgnoreNoData",t[t.Con=76]="Con"})(ct||(ct={}));function ln(t){const n=t.map(i=>i.mask).filter(i=>j(i));if(n.length===0)return null;const a=n[0].length,o=new Uint8Array(a);if(n.length===1)return o.set(n[0]),o;let r,s=n[0];for(let i=1;i>r[e]);return i}function $n(t,n,a){const[o,r]=t,s=o.length,i=g.createEmptyBand(a,s);for(let e=0;er[e]?1:0);return i}function Pn(t,n,a){const[o,r]=t,s=o.length,i=g.createEmptyBand(a,s);for(let e=0;e=r[e]?1:0);return i}function jn(t,n,a){const[o,r]=t,s=o.length,i=g.createEmptyBand(a,s);for(let e=0;ec[e]&&(i[e]=c[e])}return i}function Wt(t,n,a){const o=t.length;if(o<2)return t[0];const[r]=t,s=r.length,i=g.createEmptyBand(a,s);i.set(r);for(let e=0;eh[e]&&(u=h[e])}i[e]-=u}return i}function Jt(t,n,a){const o=t.length;if(o<2)return t[0];const[r]=t,s=r.length,i=g.createEmptyBand(a,s);i.set(r);for(let e=0;ef&&(f=h,c=m);i[u]=c}return i}function te(t,n,a){const o=t.length;if(o<2)return t[0];const[r]=t,s=r.length,i=g.createEmptyBand(a,s),e=new Map;for(let u=0;uv.pixels[h]);let m;if(n===ct.SetNull){const v=_n(f,o,s);m=v.band,u=v.mask}else d.has(n)?m=d.get(n)(f,o,s):N.has(n)?m=gn(f,o,s,N.get(n)):pt.has(n)&&(m=yn(f,o,s,pt.get(n)));if(m==null)return null;e.push(m)}u||n===ct.IsNull||(u=o);const c=t[0];return new g({width:c.width,height:c.height,pixelType:s,mask:u,pixels:e})}let Y=class extends I{constructor(){super(...arguments),this.functionName="Local",this.functionArguments=null,this.rasterArgumentNames=["rasters"]}_bindSourceRasters(){const{sourceRasterInfos:t}=this,n=t[0],{bandCount:a}=n,{processAsMultiband:o}=this.functionArguments;if(o&&t.some(s=>s.bandCount!==a))return{success:!1,error:"local-function: input rasters do not have same band count"};this.outputPixelType=this._getOutputPixelType("f32");const r=n.clone();return r.pixelType=this.outputPixelType,r.statistics=null,r.histograms=null,o||(r.bandCount=1),this.rasterInfo=r,{success:!0}}_processPixels(t){var a;const{pixelBlocks:n}=t;return T(n)||n.some(o=>T(o))?null:Kn(n,this.functionArguments.operation,{processAsMultiband:this.functionArguments.processAsMultiband,outputPixelType:(a=this.outputPixelType)!=null?a:void 0})}};l([p({json:{write:!0,name:"rasterFunction"}})],Y.prototype,"functionName",void 0),l([p({type:un,json:{write:!0,name:"rasterFunctionArguments"}})],Y.prototype,"functionArguments",void 0),l([p()],Y.prototype,"rasterArgumentNames",void 0),Y=l([x("esri.layers.support.rasterFunctions.LocalFunction")],Y);const Qn=Y;var $t;let K=$t=class extends R{constructor(){super(...arguments),this.includedRanges=null,this.noDataValues=null,this.noDataInterpretation=Lt.matchAny}clone(){var t,n,a,o;return new $t({includedRanges:(n=(t=this.includedRanges)==null?void 0:t.slice())!=null?n:[],noDataValues:(o=(a=this.noDataValues)==null?void 0:a.slice())!=null?o:[],noDataInterpretation:this.noDataInterpretation})}};l([p({json:{write:!0}})],K.prototype,"includedRanges",void 0),l([p({json:{write:!0}})],K.prototype,"noDataValues",void 0),l([p({json:{write:!0}})],K.prototype,"noDataInterpretation",void 0),K=$t=l([x("esri.layers.support.rasterFunctions.MaskFunctionArguments")],K);const Zn=K;let G=class extends I{constructor(){super(...arguments),this.functionName="Mask",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:n}=t;this.outputPixelType=this._getOutputPixelType(n),t.pixelType=this.outputPixelType,this.rasterInfo=t;const{includedRanges:a,noDataValues:o}=this.functionArguments;return(a==null?void 0:a.length)||(o==null?void 0:o.length)?(this.lookup=ge(n,this.functionArguments.includedRanges,this.functionArguments.noDataValues),{success:!0}):{success:!1,error:"missing includedRanges or noDataValues argument"}}_processPixels(t){var u;const n=(u=t.pixelBlocks)==null?void 0:u[0];if(T(n))return null;const{outputPixelType:a,lookup:o}=this,{includedRanges:r,noDataValues:s,noDataInterpretation:i}=this.functionArguments,e=i===Lt.matchAll;return ye(n,{includedRanges:r,noDataValues:s,outputPixelType:a,matchAll:e,lookup:o})}};l([p({json:{write:!0,name:"rasterFunction"}})],G.prototype,"functionName",void 0),l([p({type:Zn,json:{write:!0,name:"rasterFunctionArguments"}})],G.prototype,"functionArguments",void 0),l([p()],G.prototype,"rasterArgumentNames",void 0),l([p({json:{write:!0}})],G.prototype,"lookup",void 0),G=l([x("esri.layers.support.rasterFunctions.MaskFunction")],G);const ts=G;var Nt;let Q=Nt=class extends R{constructor(){super(...arguments),this.visibleBandID=0,this.infraredBandID=1,this.scaled=!0}clone(){const{visibleBandID:t,infraredBandID:n,scaled:a}=this;return new Nt({visibleBandID:t,infraredBandID:n,scaled:a})}};l([p({json:{write:!0}})],Q.prototype,"visibleBandID",void 0),l([p({json:{write:!0}})],Q.prototype,"infraredBandID",void 0),l([p({json:{write:!0}})],Q.prototype,"scaled",void 0),Q=Nt=l([x("esri.layers.support.rasterFunctions.NDVIFunctionArguments")],Q);const es=Q;let Z=class extends I{constructor(){super(...arguments),this.functionName="NDVI",this.functionArguments=null,this.rasterArgumentNames=["raster"]}_bindSourceRasters(){const{scaled:t}=this.functionArguments;this.outputPixelType=this._getOutputPixelType(t?"u8":"f32");const n=this.sourceRasterInfos[0].clone();n.pixelType=this.outputPixelType,n.colormap=null,n.histograms=null;const[a,o,r,s]=t?[0,200,100,10]:[-1,1,0,.1];return n.statistics=[{min:a,max:o,avg:r,stddev:s}],this.rasterInfo=n,{success:!0}}_processPixels(t){var s;const n=(s=t.pixelBlocks)==null?void 0:s[0];if(T(n))return null;const{visibleBandID:a,infraredBandID:o,scaled:r}=this.functionArguments;return Be(n,a,o,r)}};l([p({json:{write:!0,name:"rasterFunction"}})],Z.prototype,"functionName",void 0),l([p({type:es,json:{write:!0,name:"rasterFunctionArguments"}})],Z.prototype,"functionArguments",void 0),l([p()],Z.prototype,"rasterArgumentNames",void 0),Z=l([x("esri.layers.support.rasterFunctions.NDVIFunction")],Z);const ns=Z;var Ft;let L=Ft=class extends R{constructor(){super(...arguments),this.inputRanges=null,this.outputValues=null,this.noDataRanges=null,this.allowUnmatched=!1}clone(){return new Ft({inputRanges:[...this.inputRanges],outputValues:[...this.outputValues],noDataRanges:[...this.noDataRanges],allowUnmatched:this.allowUnmatched})}};l([p({json:{write:!0}})],L.prototype,"inputRanges",void 0),l([p({json:{write:!0}})],L.prototype,"outputValues",void 0),l([p({json:{write:!0}})],L.prototype,"noDataRanges",void 0),l([p({json:{write:!0}})],L.prototype,"allowUnmatched",void 0),L=Ft=l([x("esri.layers.support.rasterFunctions.RemapFunctionArguments")],L);const ss=L;let V=class extends I{constructor(){super(...arguments),this.functionName="Remap",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null}_bindSourceRasters(){const t=this.sourceRasterInfos[0].clone(),{pixelType:n}=t;this.outputPixelType=this._getOutputPixelType(n),t.pixelType=this.outputPixelType,t.colormap=null,t.histograms=null;const{statistics:a}=t,{allowUnmatched:o,outputValues:r}=this.functionArguments;if(j(a)&&a.length&&!o){let s=r[0],i=s;for(let e=0;er[e]?r[e]:s,i=i>r[e]?i:r[e];for(let e=0;e({min:r,max:s,avg:i,stddev:e}))),this.rasterInfo=n,{success:!0}}_processPixels(t){var n;return(n=t.pixelBlocks)==null?void 0:n[0]}};l([p({json:{write:!0,name:"rasterFunction"}})],H.prototype,"functionName",void 0),l([p({type:us,json:{write:!0,name:"rasterFunctionArguments"}})],H.prototype,"functionArguments",void 0),l([p()],H.prototype,"rasterArgumentNames",void 0),l([p({json:{write:!0}})],H.prototype,"indexedColormap",void 0),H=l([x("esri.layers.support.rasterFunctions.StatisticsHistogramsFunction")],H);const ls=H;var Tt;const cs=new Bt({0:"none",3:"standard-deviation",4:"histogram-equalization",5:"min-max",6:"percent-clip",7:"sigmoid"},{useNumericKeys:!0});let b=Tt=class extends R{constructor(){super(...arguments),this.computeGamma=!1,this.dynamicRangeAdjustment=!1,this.gamma=[],this.histograms=null,this.statistics=null,this.stretchType="none",this.useGamma=!1}writeStatistics(t,n,a){t!=null&&t.length&&(Array.isArray(t[0])||(t=t.map(o=>[o.min,o.max,o.avg,o.stddev])),n[a]=t)}clone(){return new Tt({stretchType:this.stretchType,outputMin:this.outputMin,outputMax:this.outputMax,useGamma:this.useGamma,computeGamma:this.computeGamma,statistics:k(this.statistics),gamma:k(this.gamma),sigmoidStrengthLevel:this.sigmoidStrengthLevel,numberOfStandardDeviations:this.numberOfStandardDeviations,minPercent:this.minPercent,maxPercent:this.maxPercent,histograms:k(this.histograms),dynamicRangeAdjustment:this.dynamicRangeAdjustment,raster:this.raster})}};l([p({type:Boolean,json:{write:!0}})],b.prototype,"computeGamma",void 0),l([p({type:Boolean,json:{name:"dra",write:!0}})],b.prototype,"dynamicRangeAdjustment",void 0),l([p({type:[Number],json:{write:!0}})],b.prototype,"gamma",void 0),l([p()],b.prototype,"histograms",void 0),l([p({type:Number,json:{write:!0}})],b.prototype,"maxPercent",void 0),l([p({type:Number,json:{write:!0}})],b.prototype,"minPercent",void 0),l([p({type:Number,json:{write:!0}})],b.prototype,"numberOfStandardDeviations",void 0),l([p({type:Number,json:{name:"max",write:!0}})],b.prototype,"outputMax",void 0),l([p({type:Number,json:{name:"min",write:!0}})],b.prototype,"outputMin",void 0),l([p({type:Number,json:{write:!0}})],b.prototype,"sigmoidStrengthLevel",void 0),l([p({json:{type:[[Number]],write:!0}})],b.prototype,"statistics",void 0),l([at("statistics")],b.prototype,"writeStatistics",null),l([tt(cs)],b.prototype,"stretchType",void 0),l([p({type:Boolean,json:{write:!0}})],b.prototype,"useGamma",void 0),b=Tt=l([x("esri.layers.support.rasterFunctions.StretchFunctionArguments")],b);const ps=b;let D=class extends I{constructor(){super(...arguments),this.functionName="Stretch",this.functionArguments=null,this.rasterArgumentNames=["raster"],this.lookup=null,this.cutOffs=null}_bindSourceRasters(){this.lookup=null,this.cutOffs=null;const t=this.sourceRasterInfos[0],{pixelType:n}=t,{functionArguments:a}=this,{dynamicRangeAdjustment:o,gamma:r,useGamma:s}=a;if(!o&&["u8","u16","s8","s16"].includes(n)){const e=ht(a.toJSON(),{rasterInfo:t});this.lookup=he({pixelType:n,...e,gamma:s?r:null})}else o&&(this.cutOffs=ht(a.toJSON(),{rasterInfo:t}));this.outputPixelType=this._getOutputPixelType(n);const i=t.clone();return i.pixelType=this.outputPixelType,i.statistics=null,i.histograms=null,this.outputPixelType==="u8"&&(i.keyProperties.DataType="processed"),this.rasterInfo=i,{success:!0}}_processPixels(t){var i;const n=(i=t.pixelBlocks)==null?void 0:i[0];if(T(n))return n;const{lookup:a}=this;if(a)return Vt(n,{...a,outputPixelType:this.rasterInfo.pixelType});const{functionArguments:o}=this,r=this.cutOffs||ht(o.toJSON(),{rasterInfo:this.sourceRasterInfos[0],pixelBlock:n}),s=o.useGamma?o.gamma:null;return fe(n,{...r,gamma:s,outputPixelType:this.outputPixelType})}};l([p({json:{write:!0,name:"rasterFunction"}})],D.prototype,"functionName",void 0),l([p({type:ps,json:{write:!0,name:"rasterFunctionArguments"}})],D.prototype,"functionArguments",void 0),l([p()],D.prototype,"rasterArgumentNames",void 0),l([p({json:{write:!0}})],D.prototype,"lookup",void 0),l([p({json:{write:!0}})],D.prototype,"cutOffs",void 0),D=l([x("esri.layers.support.rasterFunctions.StretchFunction")],D);const hs=D,S=new Map;function $s(t,n){if("rasterFunction"in t)return ne(t,n!=null?n:{});throw new Ot("raster-function-helper","unsupported raster function json.")}function fs(t,n){return n[0]==="rasters"&&Array.isArray(t.rasters)?t.rasters:n.map(a=>t[a])}function ne(t,n){var m,v;const{rasterFunction:a,rasterFunctionArguments:o}=t,r=(m=t.outputPixelType)==null?void 0:m.toLowerCase();if(a==null||!S.has(a))throw new Ot("raster-function-helper",`unsupported raster function: ${a}`);const s=S.get(a),i=(typeof s.ctor=="function"?s.ctor:s.ctor.default).fromJSON({...t,outputPixelType:r}),{rasterArgumentNames:e}=i,u=[],c=fs(o,e),h=e[0]==="rasters",f=[];for(let w=0;w180+this.tolerance&&(t.x-=360),t):(t.xmin>=180-this.tolerance?(t.xmax-=360,t.xmin-=360):t.xmax>180+this.tolerance&&(t.xmin=-180,t.xmax=180),t)}inverseTransform(t){return(t=t.clone()).type==="point"?(t.x<-this.tolerance&&(t.x+=360),t):(t.xmin<-this.tolerance&&(t.xmin+=360,t.xmax+=360),t)}};l([tt({GCSShiftXform:"gcs-shift"})],it.prototype,"type",void 0),l([p()],it.prototype,"tolerance",void 0),it=l([x("esri.layers.support.rasterTransforms.GCSShiftTransform")],it);const ms=it;let lt=class extends Pt{constructor(){super(...arguments),this.type="identity"}};l([tt({IdentityXform:"identity"})],lt.prototype,"type",void 0),lt=l([x("esri.layers.support.rasterTransforms.IdentityTransform")],lt);const ds=lt;function Rt(t,n,a){const{x:o,y:r}=n;if(a<2)return{x:t[0]+o*t[2]+r*t[4],y:t[1]+o*t[3]+r*t[5]};if(a===2){const m=o*o,v=r*r,w=o*r;return{x:t[0]+o*t[2]+r*t[4]+m*t[6]+w*t[8]+v*t[10],y:t[1]+o*t[3]+r*t[5]+m*t[7]+w*t[9]+v*t[11]}}const s=o*o,i=r*r,e=o*r,u=s*o,c=s*r,h=o*i,f=r*i;return{x:t[0]+o*t[2]+r*t[4]+s*t[6]+e*t[8]+i*t[10]+u*t[12]+c*t[14]+h*t[16]+f*t[18],y:t[1]+o*t[3]+r*t[5]+s*t[7]+e*t[9]+i*t[11]+u*t[13]+c*t[15]+h*t[17]+f*t[19]}}function _t(t,n,a){const{xmin:o,ymin:r,xmax:s,ymax:i,spatialReference:e}=n;let u=[];if(a<2)u.push({x:o,y:i}),u.push({x:s,y:i}),u.push({x:o,y:r}),u.push({x:s,y:r});else{let f=10;for(let m=0;mRt(t,f,a));const c=u.map(f=>f.x),h=u.map(f=>f.y);return new ue({xmin:Math.min.apply(null,c),xmax:Math.max.apply(null,c),ymin:Math.min.apply(null,h),ymax:Math.max.apply(null,h),spatialReference:e})}function gs(t){const[n,a,o,r,s,i]=t,e=o*i-s*r,u=s*r-o*i;return[(s*a-n*i)/e,(o*a-n*r)/u,i/e,r/u,-s/e,-o/u]}let P=class extends Pt{constructor(){super(...arguments),this.polynomialOrder=1,this.type="polynomial"}readForwardCoefficients(t,n){const{coeffX:a,coeffY:o}=n;if(!(a!=null&&a.length)||!(o!=null&&o.length)||a.length!==o.length)return null;const r=[];for(let s=0;s0}forwardTransform(t){if(t.type==="point"){const n=Rt(this.forwardCoefficients,t,this.polynomialOrder);return new Mt({x:n.x,y:n.y,spatialReference:t.spatialReference})}return _t(this.forwardCoefficients,t,this.polynomialOrder)}inverseTransform(t){if(t.type==="point"){const n=Rt(this.inverseCoefficients,t,this.polynomialOrder);return new Mt({x:n.x,y:n.y,spatialReference:t.spatialReference})}return _t(this.inverseCoefficients,t,this.polynomialOrder)}};l([p({json:{write:!0}})],P.prototype,"polynomialOrder",void 0),l([p()],P.prototype,"forwardCoefficients",void 0),l([ft("forwardCoefficients",["coeffX","coeffY"])],P.prototype,"readForwardCoefficients",null),l([at("forwardCoefficients")],P.prototype,"writeForwardCoefficients",null),l([p({json:{write:!0}})],P.prototype,"inverseCoefficients",null),l([ft("inverseCoefficients",["inverseCoeffX","inverseCoeffY"])],P.prototype,"readInverseCoefficients",null),l([at("inverseCoefficients")],P.prototype,"writeInverseCoefficients",null),l([p()],P.prototype,"affectsPixelSize",null),l([tt({PolynomialXform:"polynomial"})],P.prototype,"type",void 0),P=l([x("esri.layers.support.rasterTransforms.PolynomialTransform")],P);const ys=P,se={GCSShiftXform:ms,IdentityXform:ds,PolynomialXform:ys},xs=Object.keys(se);function Ns(t){const n=t==null?void 0:t.type;return!t||xs.includes(n)}function Fs(t){if(!(t==null?void 0:t.type))return null;const a=se[t==null?void 0:t.type];if(a){const o=new a;return o.read(t),o}return null}export{ms as c,Ns as f,Fs as i,$s as l,ys as m}; diff --git a/assets/utils.399e6089.js b/assets/utils.e42485ea.js similarity index 96% rename from assets/utils.399e6089.js rename to assets/utils.e42485ea.js index 35fc791..e27906e 100644 --- a/assets/utils.399e6089.js +++ b/assets/utils.e42485ea.js @@ -1 +1 @@ -import{ct as A,fg as J,e2 as B,c9 as E,j as S,aW as b,aC as q,aV as z,bK as I,dF as Z,fm as k,fn as P,bB as V,e_ as O,at as j,c as C,aG as D,aH as y,fo as K,aJ as g,fp as p,aI as H,fq as L,fr as T}from"./index.d94abe07.js";import{f as G,g as N}from"./projectionSupport.0542c13b.js";const W=new A({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),v=Object.freeze({}),M=new g,X=new g,R=new g,l={esriGeometryPoint:p,esriGeometryPolyline:H,esriGeometryPolygon:L,esriGeometryMultipoint:T};function rt(t,a,r,n=t.hasZ,e=t.hasM){if(S(a))return null;const o=t.hasZ&&n,s=t.hasM&&e;if(r){const i=y(R,a,t.hasZ,t.hasM,"esriGeometryPoint",r,n,e);return p(i,o,s)}return p(a,o,s)}function st(t,a,r,n,e,o,s=a,i=r){var w,d,h,_,x,F;const u=a&&s,c=r&&i,f=C(n)?"coords"in n?n:n.geometry:null;if(S(f))return null;if(e){let m=D(X,f,a,r,t,e,s,i);return o&&(m=y(R,m,u,c,t,o)),(d=(w=l[t])==null?void 0:w.call(l,m,u,c))!=null?d:null}if(o){const m=y(R,f,a,r,t,o,s,i);return(_=(h=l[t])==null?void 0:h.call(l,m,u,c))!=null?_:null}return K(M,f,a,r,s,i),(F=(x=l[t])==null?void 0:x.call(l,M,u,c))!=null?F:null}async function ot(t,a,r){const{outFields:n,orderByFields:e,groupByFieldsForStatistics:o,outStatistics:s}=t;if(n)for(let i=0;iN(n,O));return(await it())(s.spatialReference,s,a,o)}async function it(){return(await j(()=>import("./geometryEngineJSON.3d6e7890.js"),["assets/geometryEngineJSON.3d6e7890.js","assets/geometryEngineBase.82b25ca5.js","assets/geometryEngineJSON.f9e9a36f.js","assets/json.879c9adc.js"])).geodesicBuffer}function lt(t){return t&&$ in t?JSON.parse(JSON.stringify(t,et)):t}const $="_geVersion",et=(t,a)=>t!==$?a:void 0;export{lt as E,v as F,Q as J,rt as b,st as v,ot as z}; +import{ct as A,fg as J,e2 as B,c9 as E,j as S,aW as b,aC as q,aV as z,bK as I,dF as Z,fm as k,fn as P,bB as V,e_ as O,at as j,c as C,aG as D,aH as y,fo as K,aJ as g,fp as p,aI as H,fq as L,fr as T}from"./index.221827cd.js";import{f as G,g as N}from"./projectionSupport.4f5da4af.js";const W=new A({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"}),v=Object.freeze({}),M=new g,X=new g,R=new g,l={esriGeometryPoint:p,esriGeometryPolyline:H,esriGeometryPolygon:L,esriGeometryMultipoint:T};function rt(t,a,r,n=t.hasZ,e=t.hasM){if(S(a))return null;const o=t.hasZ&&n,s=t.hasM&&e;if(r){const i=y(R,a,t.hasZ,t.hasM,"esriGeometryPoint",r,n,e);return p(i,o,s)}return p(a,o,s)}function st(t,a,r,n,e,o,s=a,i=r){var w,d,h,_,x,F;const u=a&&s,c=r&&i,f=C(n)?"coords"in n?n:n.geometry:null;if(S(f))return null;if(e){let m=D(X,f,a,r,t,e,s,i);return o&&(m=y(R,m,u,c,t,o)),(d=(w=l[t])==null?void 0:w.call(l,m,u,c))!=null?d:null}if(o){const m=y(R,f,a,r,t,o,s,i);return(_=(h=l[t])==null?void 0:h.call(l,m,u,c))!=null?_:null}return K(M,f,a,r,s,i),(F=(x=l[t])==null?void 0:x.call(l,M,u,c))!=null?F:null}async function ot(t,a,r){const{outFields:n,orderByFields:e,groupByFieldsForStatistics:o,outStatistics:s}=t;if(n)for(let i=0;iN(n,O));return(await it())(s.spatialReference,s,a,o)}async function it(){return(await j(()=>import("./geometryEngineJSON.3d6e7890.js"),["assets/geometryEngineJSON.3d6e7890.js","assets/geometryEngineBase.82b25ca5.js","assets/geometryEngineJSON.f9e9a36f.js","assets/json.879c9adc.js"])).geodesicBuffer}function lt(t){return t&&$ in t?JSON.parse(JSON.stringify(t,et)):t}const $="_geVersion",et=(t,a)=>t!==$?a:void 0;export{lt as E,v as F,Q as J,rt as b,st as v,ot as z}; diff --git a/assets/vec33.4564cd5b.js b/assets/vec33.46fc6802.js similarity index 97% rename from assets/vec33.4564cd5b.js rename to assets/vec33.46fc6802.js index a71f0fd..e128440 100644 --- a/assets/vec33.4564cd5b.js +++ b/assets/vec33.46fc6802.js @@ -1 +1 @@ -import{s as O}from"./index.d94abe07.js";const j=O.getLogger("esri.views.3d.support.buffer.math");function z(t,r,e){if(t.count!==r.count)return void j.error("source and destination buffers need to have the same number of elements");const s=t.count,n=e[0],f=e[1],c=e[2],i=e[4],o=e[5],u=e[6],d=e[8],p=e[9],l=e[10],y=e[12],B=e[13],M=e[14],g=t.typedBuffer,h=t.typedBufferStride,m=r.typedBuffer,v=r.typedBufferStride;for(let a=0;a0){const B=1/Math.sqrt(y);s[o]=B*d,s[o+1]=B*p,s[o+2]=B*l}}}function q(t,r,e){const s=Math.min(t.count,r.count),n=t.typedBuffer,f=t.typedBufferStride,c=r.typedBuffer,i=r.typedBufferStride;for(let o=0;o>e,n[u+1]=c[d+1]>>e,n[u+2]=c[d+2]>>e}}Object.freeze(Object.defineProperty({__proto__:null,transformMat4:z,transformMat3:P,scale:T,normalize:$,shiftRight:q},Symbol.toStringTag,{value:"Module"}));function w(t,r,e){const s=t.typedBuffer,n=t.typedBufferStride,f=r.typedBuffer,c=r.typedBufferStride,i=e?e.count:r.count;let o=(e&&e.dstIndex?e.dstIndex:0)*n,u=(e&&e.srcIndex?e.srcIndex:0)*c;for(let d=0;d0){const B=1/Math.sqrt(y);s[o]=B*d,s[o+1]=B*p,s[o+2]=B*l}}}function q(t,r,e){const s=Math.min(t.count,r.count),n=t.typedBuffer,f=t.typedBufferStride,c=r.typedBuffer,i=r.typedBufferStride;for(let o=0;o>e,n[u+1]=c[d+1]>>e,n[u+2]=c[d+2]>>e}}Object.freeze(Object.defineProperty({__proto__:null,transformMat4:z,transformMat3:P,scale:T,normalize:$,shiftRight:q},Symbol.toStringTag,{value:"Module"}));function w(t,r,e){const s=t.typedBuffer,n=t.typedBufferStride,f=r.typedBuffer,c=r.typedBufferStride,i=e?e.count:r.count;let o=(e&&e.dstIndex?e.dstIndex:0)*n,u=(e&&e.srcIndex?e.srcIndex:0)*c;for(let d=0;d(e&v)>>>23,F=e=>e&$,U=e=>y(e)===m?E:x;function L(e){return y(e)===m}function R(e,s){return((s?v:0)|e)>>>0}const T=(e,s)=>e&&((...t)=>s.warn("DEBUG:",...t))||(()=>null),Z=!1;function k(e,s){if(!e||!s)return e;switch(s){case"radius":case"distance":return 2*e;case"diameter":case"width":return e;case"area":return Math.sqrt(e)}return e}function I(e){return{value:e.value,size:f(e.size)}}function a(e){return e.map(s=>I(s))}function u(e){if(typeof e=="string"||typeof e=="number")return f(e);const s=e;return{type:"size",expression:s.expression,stops:a(s.stops)}}const c=e=>{const s=[],t=[],n=a(e),o=n.length;for(let l=0;l<6;l++){const i=n[Math.min(l,o-1)];s.push(i.value),t.push(i.size==null?g:z(i.size))}return{values:new Float32Array(s),sizes:new Float32Array(t)}};function N(e){const s=e&&e.length>0?{}:null,t=s?{}:null;if(!s)return{vvFields:s,vvRanges:t};for(const n of e)if(n.field&&(s[n.type]=n.field),n.type==="size"){t.size||(t.size={});const o=n;switch(S(o)){case r.SIZE_MINMAX_VALUE:t.size.minMaxValue={minDataValue:o.minDataValue,maxDataValue:o.maxDataValue,minSize:u(o.minSize),maxSize:u(o.maxSize)};break;case r.SIZE_SCALE_STOPS:t.size.scaleStops={stops:a(o.stops)};break;case r.SIZE_FIELD_STOPS:if(o.levels){const l={};for(const i in o.levels)l[i]=c(o.levels[i]);t.size.fieldStops={type:"level-dependent",levels:l}}else t.size.fieldStops={type:"static",...c(o.stops)};break;case r.SIZE_UNIT_VALUE:t.size.unitValue={unit:o.valueUnit,valueRepresentation:o.valueRepresentation}}}else if(n.type==="color")t.color=_(n);else if(n.type==="opacity")t.opacity=V(n);else if(n.type==="rotation"){const o=n;t.rotation={type:o.rotationType}}return{vvFields:s,vvRanges:t}}function V(e){const s={values:[0,0,0,0,0,0,0,0],opacities:[0,0,0,0,0,0,0,0]};if(typeof e.field=="string"){if(!e.stops)return null;{if(e.stops.length>8)return null;const t=e.stops;for(let n=0;n<8;++n){const o=t[Math.min(n,t.length-1)];s.values[n]=o.value,s.opacities[n]=o.opacity}}}else{if(!(e.stops&&e.stops.length>=0))return null;{const t=e.stops&&e.stops.length>=0&&e.stops[0].opacity;for(let n=0;n<8;n++)s.values[n]=1/0,s.opacities[n]=t}}return s}function p(e,s,t){e[4*s+0]=t.r/255,e[4*s+1]=t.g/255,e[4*s+2]=t.b/255,e[4*s+3]=t.a}function _(e){if(h(e)||e.normalizationField)return null;const s={field:null,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};if(typeof e.field=="string"){if(!e.stops)return null;{if(e.stops.length>8)return null;s.field=e.field;const t=e.stops;for(let n=0;n<8;++n){const o=t[Math.min(n,t.length-1)];s.values[n]=o.value,p(s.colors,n,o.color)}}}else{if(!(e.stops&&e.stops.length>=0))return null;{const t=e.stops&&e.stops.length>=0&&e.stops[0].color;for(let n=0;n<8;n++)s.values[n]=1/0,p(s.colors,n,t)}}for(let t=0;t<32;t+=4)d(s.colors,t,!0);return s}export{$ as a,N as b,m as c,y as e,F as f,U as i,Z as l,T as n,L as p,k as r,R as s,D as u}; +import{j as h,bQ as f,I as z}from"./index.221827cd.js";import{l as r,p as d}from"./Utils.2136650a.js";import{ac as g}from"./enums.0295eb81.js";import{l as S}from"./visualVariablesUtils.62efda9d.js";const $=8388607,v=8388608,E=254,x=255,D=0,m=1,y=e=>(e&v)>>>23,F=e=>e&$,U=e=>y(e)===m?E:x;function L(e){return y(e)===m}function R(e,s){return((s?v:0)|e)>>>0}const T=(e,s)=>e&&((...t)=>s.warn("DEBUG:",...t))||(()=>null),Z=!1;function k(e,s){if(!e||!s)return e;switch(s){case"radius":case"distance":return 2*e;case"diameter":case"width":return e;case"area":return Math.sqrt(e)}return e}function I(e){return{value:e.value,size:f(e.size)}}function a(e){return e.map(s=>I(s))}function u(e){if(typeof e=="string"||typeof e=="number")return f(e);const s=e;return{type:"size",expression:s.expression,stops:a(s.stops)}}const c=e=>{const s=[],t=[],n=a(e),o=n.length;for(let l=0;l<6;l++){const i=n[Math.min(l,o-1)];s.push(i.value),t.push(i.size==null?g:z(i.size))}return{values:new Float32Array(s),sizes:new Float32Array(t)}};function N(e){const s=e&&e.length>0?{}:null,t=s?{}:null;if(!s)return{vvFields:s,vvRanges:t};for(const n of e)if(n.field&&(s[n.type]=n.field),n.type==="size"){t.size||(t.size={});const o=n;switch(S(o)){case r.SIZE_MINMAX_VALUE:t.size.minMaxValue={minDataValue:o.minDataValue,maxDataValue:o.maxDataValue,minSize:u(o.minSize),maxSize:u(o.maxSize)};break;case r.SIZE_SCALE_STOPS:t.size.scaleStops={stops:a(o.stops)};break;case r.SIZE_FIELD_STOPS:if(o.levels){const l={};for(const i in o.levels)l[i]=c(o.levels[i]);t.size.fieldStops={type:"level-dependent",levels:l}}else t.size.fieldStops={type:"static",...c(o.stops)};break;case r.SIZE_UNIT_VALUE:t.size.unitValue={unit:o.valueUnit,valueRepresentation:o.valueRepresentation}}}else if(n.type==="color")t.color=_(n);else if(n.type==="opacity")t.opacity=V(n);else if(n.type==="rotation"){const o=n;t.rotation={type:o.rotationType}}return{vvFields:s,vvRanges:t}}function V(e){const s={values:[0,0,0,0,0,0,0,0],opacities:[0,0,0,0,0,0,0,0]};if(typeof e.field=="string"){if(!e.stops)return null;{if(e.stops.length>8)return null;const t=e.stops;for(let n=0;n<8;++n){const o=t[Math.min(n,t.length-1)];s.values[n]=o.value,s.opacities[n]=o.opacity}}}else{if(!(e.stops&&e.stops.length>=0))return null;{const t=e.stops&&e.stops.length>=0&&e.stops[0].opacity;for(let n=0;n<8;n++)s.values[n]=1/0,s.opacities[n]=t}}return s}function p(e,s,t){e[4*s+0]=t.r/255,e[4*s+1]=t.g/255,e[4*s+2]=t.b/255,e[4*s+3]=t.a}function _(e){if(h(e)||e.normalizationField)return null;const s={field:null,values:[0,0,0,0,0,0,0,0],colors:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]};if(typeof e.field=="string"){if(!e.stops)return null;{if(e.stops.length>8)return null;s.field=e.field;const t=e.stops;for(let n=0;n<8;++n){const o=t[Math.min(n,t.length-1)];s.values[n]=o.value,p(s.colors,n,o.color)}}}else{if(!(e.stops&&e.stops.length>=0))return null;{const t=e.stops&&e.stops.length>=0&&e.stops[0].color;for(let n=0;n<8;n++)s.values[n]=1/0,p(s.colors,n,t)}}for(let t=0;t<32;t+=4)d(s.colors,t,!0);return s}export{$ as a,N as b,m as c,y as e,F as f,U as i,Z as l,T as n,L as p,k as r,R as s,D as u}; diff --git a/assets/visualVariablesUtils.aff73e6d.js b/assets/visualVariablesUtils.62efda9d.js similarity index 84% rename from assets/visualVariablesUtils.aff73e6d.js rename to assets/visualVariablesUtils.62efda9d.js index 86db603..05f02eb 100644 --- a/assets/visualVariablesUtils.aff73e6d.js +++ b/assets/visualVariablesUtils.62efda9d.js @@ -1 +1 @@ -import{s as a,n as r}from"./index.d94abe07.js";import{Q as i,l as s}from"./Utils.7f6f3a6b.js";function p(e){return i(e.minDataValue)&&i(e.maxDataValue)&&e.minSize!=null&&e.maxSize!=null?s.SIZE_MINMAX_VALUE:(e.expression&&e.expression==="view.scale"||e.valueExpression&&e.valueExpression==="$view.scale")&&Array.isArray(e.stops)?s.SIZE_SCALE_STOPS:(e.field!=null||e.expression&&e.expression!=="view.scale"||e.valueExpression&&e.valueExpression!=="$view.scale")&&(Array.isArray(e.stops)||"levels"in e&&e.levels)?s.SIZE_FIELD_STOPS:(e.field!=null||e.expression&&e.expression!=="view.scale"||e.valueExpression&&e.valueExpression!=="$view.scale")&&e.valueUnit!=null?s.SIZE_UNIT_VALUE:(a.getLogger("esri.views.2d.engine.webgl").error(new r("mapview-bad-type","Found invalid size VisualVariable",e)),s.NONE)}export{p as l}; +import{s as a,n as r}from"./index.221827cd.js";import{Q as i,l as s}from"./Utils.2136650a.js";function p(e){return i(e.minDataValue)&&i(e.maxDataValue)&&e.minSize!=null&&e.maxSize!=null?s.SIZE_MINMAX_VALUE:(e.expression&&e.expression==="view.scale"||e.valueExpression&&e.valueExpression==="$view.scale")&&Array.isArray(e.stops)?s.SIZE_SCALE_STOPS:(e.field!=null||e.expression&&e.expression!=="view.scale"||e.valueExpression&&e.valueExpression!=="$view.scale")&&(Array.isArray(e.stops)||"levels"in e&&e.levels)?s.SIZE_FIELD_STOPS:(e.field!=null||e.expression&&e.expression!=="view.scale"||e.valueExpression&&e.valueExpression!=="$view.scale")&&e.valueUnit!=null?s.SIZE_UNIT_VALUE:(a.getLogger("esri.views.2d.engine.webgl").error(new r("mapview-bad-type","Found invalid size VisualVariable",e)),s.NONE)}export{p as l}; diff --git a/assets/webStyleSymbolUtils.1a3d8f77.js b/assets/webStyleSymbolUtils.20098551.js similarity index 96% rename from assets/webStyleSymbolUtils.1a3d8f77.js rename to assets/webStyleSymbolUtils.20098551.js index 00e27c3..f655e04 100644 --- a/assets/webStyleSymbolUtils.1a3d8f77.js +++ b/assets/webStyleSymbolUtils.20098551.js @@ -1 +1 @@ -import{bS as W,ba as F,n as N,c as U,bW as D,bX as u,bY as $,bZ as M,hu as j,bU as O,bV as P,hv as v,hw as R,hx as g,hy as w,bT as V}from"./index.d94abe07.js";import{c as X,a as S}from"./devEnvironmentUtils.d8d0484c.js";function z(e,t,a,s){return e.name?e.styleName&&e.styleName==="Esri2DPointSymbolsStyle"?Z(e,t,s):W(e,t,s).then(r=>Y(F(r),e.name,t,a,s)):Promise.reject(new N("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference"))}function Y(e,t,a,s,r){var h,f,d;const y=e.data,m=a&&U(a.portal)?a.portal:D.getDefault(),c={portal:m,url:u(e.baseUrl),origin:"portal-item"},o=y.items.find(n=>n.name===t);if(!o){const n=`The symbol name '${t}' could not be found`;return Promise.reject(new N("symbolstyleutils:symbol-name-not-found",n,{symbolName:t}))}let i=$(M(o,s),c),b=(f=(h=o.thumbnail)==null?void 0:h.href)!=null?f:null;const p=o.thumbnail&&o.thumbnail.imageData;X()&&(i=(d=S(i))!=null?d:"",b=S(b));const x={portal:m,url:u(j(i)),origin:"portal-item"};return O(i,r).then(n=>{const E=s==="cimRef"?P(n.data):n.data,l=v(E,x);if(l&&R(l)){if(b){const T=$(b,c);l.thumbnail=new g({url:T})}else p&&(l.thumbnail=new g({url:`data:image/png;base64,${p}`}));e.styleUrl?l.styleOrigin=new w({portal:a.portal,styleUrl:e.styleUrl,name:t}):e.styleName&&(l.styleOrigin=new w({portal:a.portal,styleName:e.styleName,name:t}))}return l})}function Z(e,t,a){const s=V.replace(/\{SymbolName\}/gi,e.name),r=U(t.portal)?t.portal:D.getDefault();return O(s,a).then(y=>{const m=P(y.data);return v(m,{portal:r,url:u(j(s)),origin:"portal-item"})})}export{Y as fetchSymbolFromStyle,z as resolveWebStyleSymbol}; +import{bS as W,ba as F,n as N,c as U,bW as D,bX as u,bY as $,bZ as M,hu as j,bU as O,bV as P,hv as v,hw as R,hx as g,hy as w,bT as V}from"./index.221827cd.js";import{c as X,a as S}from"./devEnvironmentUtils.d8d0484c.js";function z(e,t,a,s){return e.name?e.styleName&&e.styleName==="Esri2DPointSymbolsStyle"?Z(e,t,s):W(e,t,s).then(r=>Y(F(r),e.name,t,a,s)):Promise.reject(new N("symbolstyleutils:style-symbol-reference-name-missing","Missing name in style symbol reference"))}function Y(e,t,a,s,r){var h,f,d;const y=e.data,m=a&&U(a.portal)?a.portal:D.getDefault(),c={portal:m,url:u(e.baseUrl),origin:"portal-item"},o=y.items.find(n=>n.name===t);if(!o){const n=`The symbol name '${t}' could not be found`;return Promise.reject(new N("symbolstyleutils:symbol-name-not-found",n,{symbolName:t}))}let i=$(M(o,s),c),b=(f=(h=o.thumbnail)==null?void 0:h.href)!=null?f:null;const p=o.thumbnail&&o.thumbnail.imageData;X()&&(i=(d=S(i))!=null?d:"",b=S(b));const x={portal:m,url:u(j(i)),origin:"portal-item"};return O(i,r).then(n=>{const E=s==="cimRef"?P(n.data):n.data,l=v(E,x);if(l&&R(l)){if(b){const T=$(b,c);l.thumbnail=new g({url:T})}else p&&(l.thumbnail=new g({url:`data:image/png;base64,${p}`}));e.styleUrl?l.styleOrigin=new w({portal:a.portal,styleUrl:e.styleUrl,name:t}):e.styleName&&(l.styleOrigin=new w({portal:a.portal,styleName:e.styleName,name:t}))}return l})}function Z(e,t,a){const s=V.replace(/\{SymbolName\}/gi,e.name),r=U(t.portal)?t.portal:D.getDefault();return O(s,a).then(y=>{const m=P(y.data);return v(m,{portal:r,url:u(j(s)),origin:"portal-item"})})}export{Y as fetchSymbolFromStyle,z as resolveWebStyleSymbol}; diff --git a/assets/webglDeps.a00b541b.js b/assets/webglDeps.a00b541b.js deleted file mode 100644 index 5f0f00b..0000000 --- a/assets/webglDeps.a00b541b.js +++ /dev/null @@ -1 +0,0 @@ -import{E as o,x as t,s,a as f}from"./VertexArrayObject.a4c1d809.js";import{h as x,e as p,a as c}from"./ProgramTemplate.e9a5aa54.js";import{s as g,n as i}from"./programUtils.956e69db.js";import{E as u}from"./Texture.4c97bad5.js";import{o as h}from"./index.d94abe07.js";import"./enums.2d9e6f64.js";export{o as BufferObject,t as FramebufferObject,x as Program,g as ProgramCache,s as Renderbuffer,p as ShaderCompiler,u as Texture,f as VertexArrayObject,h as createContextOrErrorHTML,c as createProgram,i as glslifyDefineMap}; diff --git a/assets/webglDeps.e3ffc164.js b/assets/webglDeps.e3ffc164.js new file mode 100644 index 0000000..d6edaf1 --- /dev/null +++ b/assets/webglDeps.e3ffc164.js @@ -0,0 +1 @@ +import{E as o,x as t,s,a as f}from"./VertexArrayObject.53cf1857.js";import{h as x,e as p,a as c}from"./ProgramTemplate.cf9dd4e8.js";import{s as g,n as i}from"./programUtils.10ecfb8b.js";import{E as u}from"./Texture.940076b2.js";import{o as h}from"./index.221827cd.js";import"./enums.2d9e6f64.js";export{o as BufferObject,t as FramebufferObject,x as Program,g as ProgramCache,s as Renderbuffer,p as ShaderCompiler,u as Texture,f as VertexArrayObject,h as createContextOrErrorHTML,c as createProgram,i as glslifyDefineMap}; diff --git a/assets/wfsUtils.f8061e44.js b/assets/wfsUtils.6ba3d875.js similarity index 98% rename from assets/wfsUtils.f8061e44.js rename to assets/wfsUtils.6ba3d875.js index 916a1b8..f71ef5e 100644 --- a/assets/wfsUtils.f8061e44.js +++ b/assets/wfsUtils.6ba3d875.js @@ -1 +1 @@ -import{U as T,hh as L,n as m,hi as M,eu as $,hj as P,hk as x,aT as A,j as C,cU as V,bK as W,e_ as b,bI as X,cI as z,cB as _,gG as d,hl as Y,c as k}from"./index.d94abe07.js";import{s as q}from"./geojson.8a0cb9d1.js";import{o as F,n as h}from"./xmlUtils.56e603f6.js";function H(n){var t;return(t=B(n))!=null?t:J(n)}function J(n){const t=new Date(n).getTime();return Number.isNaN(t)?null:t}function B(n){var y,f,E,N;const t=K.exec(n);if(!(t!=null&&t.groups))return null;const e=t.groups,a=+e.year,r=+e.month-1,s=+e.day,o=+((y=e.hours)!=null?y:"0"),i=+((f=e.minutes)!=null?f:"0"),u=+((E=e.seconds)!=null?E:"0");if(o>23||i>59||u>59)return null;const p=(N=e.ms)!=null?N:"0",c=p?+p.padEnd(3,"0").substring(0,3):0;let l;if(e.isUTC)l=Date.UTC(a,r,s,o,i,u,c);else if(e.offsetSign){const O=+e.offsetHours,j=+e.offsetMinutes;l=6e4*(e.offsetSign==="+"?-1:1)*(60*O+j)+Date.UTC(a,r,s,o,i,u,c)}else l=new Date(a,r,s,o,i,u,c).getTime();return Number.isNaN(l)?null:l}const K=/^(?:(?-?\d{4,})-(?\d{2})-(?\d{2}))(?:T(?\d{2}):(?\d{2}):(?\d{2})(?:\.(?\d+))?)?(?:(?Z)|(?:(?\+|-)(?\d{2}):(?\d{2})))?$/,S="xlink:href",g="2.0.0",G="__esri_wfs_id__",Q="wfs-layer:getWFSLayerTypeInfo-error",Z="wfs-layer:empty-service",R="wfs-layer:feature-type-not-found",ee="wfs-layer:geojson-not-supported",te="wfs-layer:kvp-encoding-not-supported",ne="wfs-layer:malformed-json",v="wfs-layer:unknown-geometry-type",ae="wfs-layer:unknown-field-type",re="wfs-layer:unsupported-spatial-reference",se="wfs-layer:unsupported-wfs-version";async function Ne(n,t){const e=oe((await T(n,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:g,...t==null?void 0:t.customParameters},signal:t==null?void 0:t.signal})).data);return pe(n,e),e}function oe(n){const t=D(n);Se(t),I(t);const e=t.firstElementChild,a=L(ce(e));return{operations:ue(e),get featureTypes(){return Array.from(a())},readFeatureTypes:a}}const ie=new Set(["json","application/json","geojson","application/json; subtype=geojson"]);function ue(n){let t=!1;const e={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}};if(F(n,{OperationsMetadata:{Operation:a=>{switch(a.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:r=>{e.GetCapabilities.url=r.getAttribute(S)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:r=>{e.DescribeFeatureType.url=r.getAttribute(S)}}}};case"GetFeature":return{DCP:{HTTP:{Get:r=>{e.GetFeature.url=r.getAttribute(S)}}},Parameter:r=>{if(r.getAttribute("name")==="outputFormat")return{AllowedValues:{Value:s=>{const o=s.textContent;o&&ie.has(o.toLowerCase())&&(e.GetFeature.outputFormat=o)}}}}}}},Constraint:a=>{switch(a.getAttribute("name")){case"KVPEncoding":return{DefaultValue:r=>{t=r.textContent.toLowerCase()==="true"}};case"ImplementsResultPaging":return{DefaultValue:r=>{e.GetFeature.supportsPagination=r.textContent.toLowerCase()==="true"}}}}}}),!t)throw new m(te,"WFS service doesn't support key/value pair (KVP) encoding");if(C(e.GetFeature.outputFormat))throw new m(ee,"WFS service doesn't support GeoJSON output format");return e}function pe(n,t){M(n)&&($(n,t.operations.DescribeFeatureType.url,!0)&&(t.operations.DescribeFeatureType.url=P(t.operations.DescribeFeatureType.url)),$(n,t.operations.GetFeature.url,!0)&&(t.operations.GetFeature.url=P(t.operations.GetFeature.url)))}function ce(n){return h(n,{FeatureTypeList:{FeatureType:t=>{const e={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",supportedSpatialReferences:[]},a=new Set([4326]),r=s=>{var i,u,p,c;const o=parseInt((c=(p=(u=(i=s.textContent)==null?void 0:i.match(/(?\d+$)/i))==null?void 0:u.groups)==null?void 0:p.wkid)!=null?c:"",10);Number.isNaN(o)||a.add(o)};return F(t,{Name:s=>{const{name:o,prefix:i}=w(s.textContent);e.typeName=`${i}:${o}`,e.name=o,e.namespacePrefix=i,e.namespaceUri=s.lookupNamespaceURI(i)},Abstract:s=>{e.description=s.textContent},Title:s=>{e.title=s.textContent},WGS84BoundingBox:s=>{e.extent=le(s)},DefaultSRS:r,DefaultCRS:r,OtherSRS:r,OtherCRS:r}),e.title||(e.title=e.name),e.supportedSpatialReferences.push(...a),e}}})}function le(n){let t,e,a,r;for(const s of n.children)switch(s.localName){case"LowerCorner":[t,e]=s.textContent.split(" ").map(o=>Number.parseFloat(o));break;case"UpperCorner":[a,r]=s.textContent.split(" ").map(o=>Number.parseFloat(o))}return{xmin:t,ymin:e,xmax:a,ymax:r,spatialReference:b}}function me(n,t,e){return x(n,a=>e?a.name===t&&a.namespaceUri===e:a.typeName===t||a.name===t)}async function $e(n,t,e,a={}){var l;const{featureType:r,extent:s}=await ye(n,t,e,a),{fields:o,geometryType:i,swapXY:u,objectIdField:p,geometryField:c}=await fe(n,r.typeName,a);return{url:n.operations.GetCapabilities.url,name:r.name,namespaceUri:r.namespaceUri,fields:o,geometryField:c,geometryType:i,objectIdField:p,spatialReference:(l=a.spatialReference)!=null?l:A.WGS84,extent:s,swapXY:u,wfsCapabilities:n,customParameters:a.customParameters}}async function ye(n,t,e,a={}){const{spatialReference:r=A.WGS84}=a,s=n.readFeatureTypes(),o=t?me(s,t,e):s.next().value;if(C(o))throw t?new m(R,`The type '${t}' could not be found in the service`):new m(Z,"The service is empty");let i=new V({...o.extent,spatialReference:r});if(!W(r,b))try{await X(b,r,void 0,a),i=z(i,b)}catch{throw new m(re,"Projection not supported")}return{extent:i,spatialReference:r,featureType:o}}async function fe(n,t,e={}){var p,c,l,y,f;const[a,r]=await _([we(n.operations.DescribeFeatureType.url,t,e),ge(n,t,e)]);if(a.error||r.error)throw new m(Q,`An error occurred while getting info about the feature type '${t}'`,{error:a.error||r.error});const{fields:s,errors:o}=(p=a.value)!=null?p:{},i=((c=a.value)==null?void 0:c.geometryType)||((l=r.value)==null?void 0:l.geometryType),u=(f=(y=r.value)==null?void 0:y.swapXY)!=null?f:!1;if(C(i))throw new m(v,`The geometry type could not be determined for type '${t}`,{typeName:t,geometryType:i,fields:s,errors:o});return{...de(s!=null?s:[]),geometryType:i,swapXY:u}}function de(n){var a;const t=n.find(r=>r.type==="geometry");let e=n.find(r=>r.type==="oid");return n=n.filter(r=>r.type!=="geometry"),e||(e=new d({name:G,type:"oid",alias:G}),n.unshift(e)),{geometryField:(a=t==null?void 0:t.name)!=null?a:null,objectIdField:e.name,fields:n}}async function ge(n,t,e={}){var u;let a,r=!1;const[s,o]=await Promise.all([Fe(n.operations.GetFeature.url,t,n.operations.GetFeature.outputFormat,{...e,count:1}),T(n.operations.GetFeature.url,{responseType:"text",query:U(t,void 0,{...e,count:1}),signal:e==null?void 0:e.signal})]),i=s.type==="FeatureCollection"&&((u=s.features[0])==null?void 0:u.geometry);if(i){let p;switch(a=Y.fromJSON(q(i.type)),i.type){case"Point":p=i.coordinates;break;case"LineString":case"MultiPoint":p=i.coordinates[0];break;case"MultiLineString":case"Polygon":p=i.coordinates[0][0];break;case"MultiPolygon":p=i.coordinates[0][0][0]}const c=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(o.data);if(c){const l=p[0].toFixed(3),y=p[1].toFixed(3),f=parseFloat(c[1]).toFixed(3);l===parseFloat(c[2]).toFixed(3)&&y===f&&(r=!0)}}return{geometryType:a,swapXY:r}}async function we(n,t,e){return be(t,(await T(n,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:g,TYPENAME:t,...e==null?void 0:e.customParameters},signal:e==null?void 0:e.signal})).data)}function be(n,t){const{name:e}=w(n),a=D(t);I(a);const r=x(h(a.firstElementChild,{element:s=>({name:s.getAttribute("name"),typeName:w(s.getAttribute("type")).name})}),({name:s})=>s===e);if(k(r)){const s=x(h(a.firstElementChild,{complexType:o=>o}),o=>o.getAttribute("name")===r.typeName);if(k(s))return Te(s)}throw new m(R,`Type '${n}' not found in document`,{document:new XMLSerializer().serializeToString(a)})}const he=new Set(["objectid","fid"]);function Te(n){const t=[],e=[];let a;const r=h(n,{complexContent:{extension:{sequence:{element:s=>s}}}});for(const s of r){const o=s.getAttribute("name");if(!o)continue;let i,u;if(s.hasAttribute("type")?i=w(s.getAttribute("type")).name:F(s,{simpleType:{restriction:l=>(i=w(l.getAttribute("base")).name,{maxLength:y=>{u=+y.getAttribute("value")}})}}),!i)continue;const p=s.getAttribute("nillable")==="true";let c=!1;switch(i.toLowerCase()){case"integer":case"nonpositiveinteger":case"negativeinteger":case"long":case"int":case"short":case"byte":case"nonnegativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"positiveinteger":e.push(new d({name:o,alias:o,type:"integer",nullable:p}));break;case"float":case"double":case"decimal":e.push(new d({name:o,alias:o,type:"double",nullable:p}));break;case"boolean":case"string":case"gyearmonth":case"gyear":case"gmonthday":case"gday":case"gmonth":case"anyuri":case"qname":case"notation":case"normalizedstring":case"token":case"language":case"idrefs":case"entities":case"nmtoken":case"nmtokens":case"name":case"ncname":case"id":case"idref":case"entity":case"duration":case"time":e.push(new d({name:o,alias:o,type:"string",nullable:p,length:u!=null?u:255}));break;case"datetime":case"date":e.push(new d({name:o,alias:o,type:"date",nullable:p,length:u!=null?u:36}));break;case"pointpropertytype":a="point",c=!0;break;case"multipointpropertytype":a="multipoint",c=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":a="polyline",c=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":a="polygon",c=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":c=!0,t.push(new m(v,`geometry type '${i}' is not supported`,{type:new XMLSerializer().serializeToString(n)}));break;default:t.push(new m(ae,`Unknown field type '${i}'`,{type:new XMLSerializer().serializeToString(n)}))}c&&e.push(new d({name:o,alias:o,type:"geometry",nullable:p}))}for(const s of e)if(s.type==="integer"&&!s.nullable&&he.has(s.name.toLowerCase())){s.type="oid";break}return{geometryType:a,fields:e,errors:t}}async function Fe(n,t,e,a){var s;let{data:r}=await T(n,{responseType:"text",query:U(t,e,a),signal:a==null?void 0:a.signal});r=r.replace(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{if((s=a==null?void 0:a.dateFields)!=null&&s.length){const o=new Set(a.dateFields);return JSON.parse(r,(i,u)=>o.has(i)?H(u):u)}return JSON.parse(r)}catch(o){throw new m(ne,"Error while parsing the\xA0response",{response:r,error:o})}}function U(n,t,e){return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:g,TYPENAMES:n,OUTPUTFORMAT:t,SRSNAME:"EPSG:4326",STARTINDEX:e==null?void 0:e.startIndex,COUNT:e==null?void 0:e.count,...e==null?void 0:e.customParameters}}function D(n){return new DOMParser().parseFromString(n.trim(),"text/xml")}function w(n){const[t,e]=n.split(":");return{prefix:e?t:"",name:e!=null?e:t}}function Se(n){var e;const t=(e=n.firstElementChild)==null?void 0:e.getAttribute("version");if(t&&t!==g)throw new m(se,`Unsupported WFS version ${t}. Supported version: ${g}`)}function I(n){let t="",e="";if(F(n.firstElementChild,{Exception:a=>(t=a.getAttribute("exceptionCode"),{ExceptionText:r=>{e=r.textContent}})}),t)throw new m(`wfs-layer:${t}`,e)}export{G as C,Ne as D,Fe as K,me as W,$e as X,de as z}; +import{U as T,hh as L,n as m,hi as M,eu as $,hj as P,hk as x,aT as A,j as C,cU as V,bK as W,e_ as b,bI as X,cI as z,cB as _,gG as d,hl as Y,c as k}from"./index.221827cd.js";import{s as q}from"./geojson.7d18026b.js";import{o as F,n as h}from"./xmlUtils.56e603f6.js";function H(n){var t;return(t=B(n))!=null?t:J(n)}function J(n){const t=new Date(n).getTime();return Number.isNaN(t)?null:t}function B(n){var y,f,E,N;const t=K.exec(n);if(!(t!=null&&t.groups))return null;const e=t.groups,a=+e.year,r=+e.month-1,s=+e.day,o=+((y=e.hours)!=null?y:"0"),i=+((f=e.minutes)!=null?f:"0"),u=+((E=e.seconds)!=null?E:"0");if(o>23||i>59||u>59)return null;const p=(N=e.ms)!=null?N:"0",c=p?+p.padEnd(3,"0").substring(0,3):0;let l;if(e.isUTC)l=Date.UTC(a,r,s,o,i,u,c);else if(e.offsetSign){const O=+e.offsetHours,j=+e.offsetMinutes;l=6e4*(e.offsetSign==="+"?-1:1)*(60*O+j)+Date.UTC(a,r,s,o,i,u,c)}else l=new Date(a,r,s,o,i,u,c).getTime();return Number.isNaN(l)?null:l}const K=/^(?:(?-?\d{4,})-(?\d{2})-(?\d{2}))(?:T(?\d{2}):(?\d{2}):(?\d{2})(?:\.(?\d+))?)?(?:(?Z)|(?:(?\+|-)(?\d{2}):(?\d{2})))?$/,S="xlink:href",g="2.0.0",G="__esri_wfs_id__",Q="wfs-layer:getWFSLayerTypeInfo-error",Z="wfs-layer:empty-service",R="wfs-layer:feature-type-not-found",ee="wfs-layer:geojson-not-supported",te="wfs-layer:kvp-encoding-not-supported",ne="wfs-layer:malformed-json",v="wfs-layer:unknown-geometry-type",ae="wfs-layer:unknown-field-type",re="wfs-layer:unsupported-spatial-reference",se="wfs-layer:unsupported-wfs-version";async function Ne(n,t){const e=oe((await T(n,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"GetCapabilities",VERSION:g,...t==null?void 0:t.customParameters},signal:t==null?void 0:t.signal})).data);return pe(n,e),e}function oe(n){const t=D(n);Se(t),I(t);const e=t.firstElementChild,a=L(ce(e));return{operations:ue(e),get featureTypes(){return Array.from(a())},readFeatureTypes:a}}const ie=new Set(["json","application/json","geojson","application/json; subtype=geojson"]);function ue(n){let t=!1;const e={GetCapabilities:{url:""},DescribeFeatureType:{url:""},GetFeature:{url:"",outputFormat:null,supportsPagination:!1}};if(F(n,{OperationsMetadata:{Operation:a=>{switch(a.getAttribute("name")){case"GetCapabilities":return{DCP:{HTTP:{Get:r=>{e.GetCapabilities.url=r.getAttribute(S)}}}};case"DescribeFeatureType":return{DCP:{HTTP:{Get:r=>{e.DescribeFeatureType.url=r.getAttribute(S)}}}};case"GetFeature":return{DCP:{HTTP:{Get:r=>{e.GetFeature.url=r.getAttribute(S)}}},Parameter:r=>{if(r.getAttribute("name")==="outputFormat")return{AllowedValues:{Value:s=>{const o=s.textContent;o&&ie.has(o.toLowerCase())&&(e.GetFeature.outputFormat=o)}}}}}}},Constraint:a=>{switch(a.getAttribute("name")){case"KVPEncoding":return{DefaultValue:r=>{t=r.textContent.toLowerCase()==="true"}};case"ImplementsResultPaging":return{DefaultValue:r=>{e.GetFeature.supportsPagination=r.textContent.toLowerCase()==="true"}}}}}}),!t)throw new m(te,"WFS service doesn't support key/value pair (KVP) encoding");if(C(e.GetFeature.outputFormat))throw new m(ee,"WFS service doesn't support GeoJSON output format");return e}function pe(n,t){M(n)&&($(n,t.operations.DescribeFeatureType.url,!0)&&(t.operations.DescribeFeatureType.url=P(t.operations.DescribeFeatureType.url)),$(n,t.operations.GetFeature.url,!0)&&(t.operations.GetFeature.url=P(t.operations.GetFeature.url)))}function ce(n){return h(n,{FeatureTypeList:{FeatureType:t=>{const e={typeName:"undefined:undefined",name:"",title:"",description:"",extent:null,namespacePrefix:"",namespaceUri:"",supportedSpatialReferences:[]},a=new Set([4326]),r=s=>{var i,u,p,c;const o=parseInt((c=(p=(u=(i=s.textContent)==null?void 0:i.match(/(?\d+$)/i))==null?void 0:u.groups)==null?void 0:p.wkid)!=null?c:"",10);Number.isNaN(o)||a.add(o)};return F(t,{Name:s=>{const{name:o,prefix:i}=w(s.textContent);e.typeName=`${i}:${o}`,e.name=o,e.namespacePrefix=i,e.namespaceUri=s.lookupNamespaceURI(i)},Abstract:s=>{e.description=s.textContent},Title:s=>{e.title=s.textContent},WGS84BoundingBox:s=>{e.extent=le(s)},DefaultSRS:r,DefaultCRS:r,OtherSRS:r,OtherCRS:r}),e.title||(e.title=e.name),e.supportedSpatialReferences.push(...a),e}}})}function le(n){let t,e,a,r;for(const s of n.children)switch(s.localName){case"LowerCorner":[t,e]=s.textContent.split(" ").map(o=>Number.parseFloat(o));break;case"UpperCorner":[a,r]=s.textContent.split(" ").map(o=>Number.parseFloat(o))}return{xmin:t,ymin:e,xmax:a,ymax:r,spatialReference:b}}function me(n,t,e){return x(n,a=>e?a.name===t&&a.namespaceUri===e:a.typeName===t||a.name===t)}async function $e(n,t,e,a={}){var l;const{featureType:r,extent:s}=await ye(n,t,e,a),{fields:o,geometryType:i,swapXY:u,objectIdField:p,geometryField:c}=await fe(n,r.typeName,a);return{url:n.operations.GetCapabilities.url,name:r.name,namespaceUri:r.namespaceUri,fields:o,geometryField:c,geometryType:i,objectIdField:p,spatialReference:(l=a.spatialReference)!=null?l:A.WGS84,extent:s,swapXY:u,wfsCapabilities:n,customParameters:a.customParameters}}async function ye(n,t,e,a={}){const{spatialReference:r=A.WGS84}=a,s=n.readFeatureTypes(),o=t?me(s,t,e):s.next().value;if(C(o))throw t?new m(R,`The type '${t}' could not be found in the service`):new m(Z,"The service is empty");let i=new V({...o.extent,spatialReference:r});if(!W(r,b))try{await X(b,r,void 0,a),i=z(i,b)}catch{throw new m(re,"Projection not supported")}return{extent:i,spatialReference:r,featureType:o}}async function fe(n,t,e={}){var p,c,l,y,f;const[a,r]=await _([we(n.operations.DescribeFeatureType.url,t,e),ge(n,t,e)]);if(a.error||r.error)throw new m(Q,`An error occurred while getting info about the feature type '${t}'`,{error:a.error||r.error});const{fields:s,errors:o}=(p=a.value)!=null?p:{},i=((c=a.value)==null?void 0:c.geometryType)||((l=r.value)==null?void 0:l.geometryType),u=(f=(y=r.value)==null?void 0:y.swapXY)!=null?f:!1;if(C(i))throw new m(v,`The geometry type could not be determined for type '${t}`,{typeName:t,geometryType:i,fields:s,errors:o});return{...de(s!=null?s:[]),geometryType:i,swapXY:u}}function de(n){var a;const t=n.find(r=>r.type==="geometry");let e=n.find(r=>r.type==="oid");return n=n.filter(r=>r.type!=="geometry"),e||(e=new d({name:G,type:"oid",alias:G}),n.unshift(e)),{geometryField:(a=t==null?void 0:t.name)!=null?a:null,objectIdField:e.name,fields:n}}async function ge(n,t,e={}){var u;let a,r=!1;const[s,o]=await Promise.all([Fe(n.operations.GetFeature.url,t,n.operations.GetFeature.outputFormat,{...e,count:1}),T(n.operations.GetFeature.url,{responseType:"text",query:U(t,void 0,{...e,count:1}),signal:e==null?void 0:e.signal})]),i=s.type==="FeatureCollection"&&((u=s.features[0])==null?void 0:u.geometry);if(i){let p;switch(a=Y.fromJSON(q(i.type)),i.type){case"Point":p=i.coordinates;break;case"LineString":case"MultiPoint":p=i.coordinates[0];break;case"MultiLineString":case"Polygon":p=i.coordinates[0][0];break;case"MultiPolygon":p=i.coordinates[0][0][0]}const c=/<[^>]*pos[^>]*> *(-?\d+(?:\.\d+)?) (-?\d+(?:\.\d+)?)/.exec(o.data);if(c){const l=p[0].toFixed(3),y=p[1].toFixed(3),f=parseFloat(c[1]).toFixed(3);l===parseFloat(c[2]).toFixed(3)&&y===f&&(r=!0)}}return{geometryType:a,swapXY:r}}async function we(n,t,e){return be(t,(await T(n,{responseType:"text",query:{SERVICE:"WFS",REQUEST:"DescribeFeatureType",VERSION:g,TYPENAME:t,...e==null?void 0:e.customParameters},signal:e==null?void 0:e.signal})).data)}function be(n,t){const{name:e}=w(n),a=D(t);I(a);const r=x(h(a.firstElementChild,{element:s=>({name:s.getAttribute("name"),typeName:w(s.getAttribute("type")).name})}),({name:s})=>s===e);if(k(r)){const s=x(h(a.firstElementChild,{complexType:o=>o}),o=>o.getAttribute("name")===r.typeName);if(k(s))return Te(s)}throw new m(R,`Type '${n}' not found in document`,{document:new XMLSerializer().serializeToString(a)})}const he=new Set(["objectid","fid"]);function Te(n){const t=[],e=[];let a;const r=h(n,{complexContent:{extension:{sequence:{element:s=>s}}}});for(const s of r){const o=s.getAttribute("name");if(!o)continue;let i,u;if(s.hasAttribute("type")?i=w(s.getAttribute("type")).name:F(s,{simpleType:{restriction:l=>(i=w(l.getAttribute("base")).name,{maxLength:y=>{u=+y.getAttribute("value")}})}}),!i)continue;const p=s.getAttribute("nillable")==="true";let c=!1;switch(i.toLowerCase()){case"integer":case"nonpositiveinteger":case"negativeinteger":case"long":case"int":case"short":case"byte":case"nonnegativeinteger":case"unsignedlong":case"unsignedint":case"unsignedshort":case"unsignedbyte":case"positiveinteger":e.push(new d({name:o,alias:o,type:"integer",nullable:p}));break;case"float":case"double":case"decimal":e.push(new d({name:o,alias:o,type:"double",nullable:p}));break;case"boolean":case"string":case"gyearmonth":case"gyear":case"gmonthday":case"gday":case"gmonth":case"anyuri":case"qname":case"notation":case"normalizedstring":case"token":case"language":case"idrefs":case"entities":case"nmtoken":case"nmtokens":case"name":case"ncname":case"id":case"idref":case"entity":case"duration":case"time":e.push(new d({name:o,alias:o,type:"string",nullable:p,length:u!=null?u:255}));break;case"datetime":case"date":e.push(new d({name:o,alias:o,type:"date",nullable:p,length:u!=null?u:36}));break;case"pointpropertytype":a="point",c=!0;break;case"multipointpropertytype":a="multipoint",c=!0;break;case"curvepropertytype":case"multicurvepropertytype":case"multilinestringpropertytype":a="polyline",c=!0;break;case"surfacepropertytype":case"multisurfacepropertytype":case"multipolygonpropertytype":a="polygon",c=!0;break;case"geometrypropertytype":case"multigeometrypropertytype":c=!0,t.push(new m(v,`geometry type '${i}' is not supported`,{type:new XMLSerializer().serializeToString(n)}));break;default:t.push(new m(ae,`Unknown field type '${i}'`,{type:new XMLSerializer().serializeToString(n)}))}c&&e.push(new d({name:o,alias:o,type:"geometry",nullable:p}))}for(const s of e)if(s.type==="integer"&&!s.nullable&&he.has(s.name.toLowerCase())){s.type="oid";break}return{geometryType:a,fields:e,errors:t}}async function Fe(n,t,e,a){var s;let{data:r}=await T(n,{responseType:"text",query:U(t,e,a),signal:a==null?void 0:a.signal});r=r.replace(/": +(-?\d+),(\d+)(,)?/g,'": $1.$2$3');try{if((s=a==null?void 0:a.dateFields)!=null&&s.length){const o=new Set(a.dateFields);return JSON.parse(r,(i,u)=>o.has(i)?H(u):u)}return JSON.parse(r)}catch(o){throw new m(ne,"Error while parsing the\xA0response",{response:r,error:o})}}function U(n,t,e){return{SERVICE:"WFS",REQUEST:"GetFeature",VERSION:g,TYPENAMES:n,OUTPUTFORMAT:t,SRSNAME:"EPSG:4326",STARTINDEX:e==null?void 0:e.startIndex,COUNT:e==null?void 0:e.count,...e==null?void 0:e.customParameters}}function D(n){return new DOMParser().parseFromString(n.trim(),"text/xml")}function w(n){const[t,e]=n.split(":");return{prefix:e?t:"",name:e!=null?e:t}}function Se(n){var e;const t=(e=n.firstElementChild)==null?void 0:e.getAttribute("version");if(t&&t!==g)throw new m(se,`Unsupported WFS version ${t}. Supported version: ${g}`)}function I(n){let t="",e="";if(F(n.firstElementChild,{Exception:a=>(t=a.getAttribute("exceptionCode"),{ExceptionText:r=>{e=r.textContent}})}),t)throw new m(`wfs-layer:${t}`,e)}export{G as C,Ne as D,Fe as K,me as W,$e as X,de as z}; diff --git a/index.html b/index.html index a776a66..b41ac07 100644 --- a/index.html +++ b/index.html @@ -4,8 +4,8 @@ - RReveja e compare suas corridas - + Reveja e compare suas corridas +